mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-11 06:05:49 +00:00
Kind of a frustrating set of changes to get the verilator errors out of the copyShadow module.
This commit is contained in:
parent
4a3cc8b9c8
commit
58942b246b
@ -125,22 +125,25 @@ module copyShadow import cvw::*; #(parameter cvw_t P,
|
|||||||
output logic CacheValid,
|
output logic CacheValid,
|
||||||
output logic CacheDirty);
|
output logic CacheDirty);
|
||||||
|
|
||||||
logic [P.XLEN-1:0] TagExtend;
|
logic [P.XLEN+1:0] TagExtend;
|
||||||
logic [P.XLEN-1:0] IndexExtend;
|
logic [P.XLEN+1:0] IndexExtend;
|
||||||
logic [P.XLEN-1:0] CacheWordExtend;
|
logic [P.XLEN+1:0] CacheWordExtend;
|
||||||
|
logic [P.XLEN+1:0] CacheAdrExtend;
|
||||||
|
|
||||||
assign TagExtend = {{{P.XLEN-(P.PA_BITS-tagstart)}{1'b0}}, tag};
|
assign TagExtend = {{{P.XLEN-(P.PA_BITS-tagstart)+2}{1'b0}}, tag};
|
||||||
assign IndexExtend = {{{P.XLEN-32}{1'b0}}, index};
|
assign IndexExtend = {{{P.XLEN-32+2}{1'b0}}, index};
|
||||||
assign CacheWordExtend = {{{P.XLEN-32}{1'b0}}, cacheWord};
|
assign CacheWordExtend = {{{P.XLEN-32+2}{1'b0}}, cacheWord};
|
||||||
|
|
||||||
always_ff @(posedge clk) begin
|
always_ff @(posedge clk) begin
|
||||||
if(start) begin
|
if(start) begin
|
||||||
CacheTag = TagExtend;
|
CacheTag = TagExtend[P.XLEN-1:0];
|
||||||
CacheValid = valid;
|
CacheValid = valid;
|
||||||
CacheDirty = dirty;
|
CacheDirty = dirty;
|
||||||
CacheData = data;
|
CacheData = data;
|
||||||
CacheAdr = (TagExtend << tagstart) + (IndexExtend << loglinebytelen) + (CacheWordExtend << $clog2(sramlen/8));
|
CacheAdrExtend = (TagExtend << tagstart) + (IndexExtend << loglinebytelen) + (CacheWordExtend << $clog2(sramlen/8));
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
assign CacheAdr = CacheAdrExtend[P.PA_BITS-1:0];
|
||||||
|
|
||||||
endmodule
|
endmodule
|
||||||
|
Loading…
Reference in New Issue
Block a user