forked from Github_Repos/cvw
Removed VDWriteEnable.
This commit is contained in:
parent
161f907cae
commit
da2dca9816
6
pipelined/src/cache/cache.sv
vendored
6
pipelined/src/cache/cache.sv
vendored
@ -99,10 +99,8 @@ module cache #(parameter LINELEN, NUMLINES, NUMWAYS, DCACHE = 1) (
|
|||||||
logic [NUMWAYS-1:0] NextFlushWay;
|
logic [NUMWAYS-1:0] NextFlushWay;
|
||||||
logic FlushWayCntEn;
|
logic FlushWayCntEn;
|
||||||
logic FlushWayCntRst;
|
logic FlushWayCntRst;
|
||||||
logic VDWriteEnable;
|
|
||||||
logic SelEvict;
|
logic SelEvict;
|
||||||
logic LRUWriteEn;
|
logic LRUWriteEn;
|
||||||
logic [NUMWAYS-1:0] VDWriteEnableWay;
|
|
||||||
logic SelFlush;
|
logic SelFlush;
|
||||||
logic ResetOrFlushAdr, ResetOrFlushWay;
|
logic ResetOrFlushAdr, ResetOrFlushWay;
|
||||||
logic [NUMWAYS-1:0] WayHitSaved, WayHitRaw;
|
logic [NUMWAYS-1:0] WayHitSaved, WayHitRaw;
|
||||||
@ -124,7 +122,6 @@ module cache #(parameter LINELEN, NUMLINES, NUMWAYS, DCACHE = 1) (
|
|||||||
cacheway #(NUMLINES, LINELEN, TAGLEN, OFFSETLEN, SETLEN) CacheWays[NUMWAYS-1:0](
|
cacheway #(NUMLINES, LINELEN, TAGLEN, OFFSETLEN, SETLEN) CacheWays[NUMWAYS-1:0](
|
||||||
.clk, .reset, .RAdr, .PAdr,
|
.clk, .reset, .RAdr, .PAdr,
|
||||||
.WriteEnable(SRAMWayWriteEnable),
|
.WriteEnable(SRAMWayWriteEnable),
|
||||||
.VDWriteEnable(VDWriteEnableWay),
|
|
||||||
.WriteWordEnable(SRAMWordEnable),
|
.WriteWordEnable(SRAMWordEnable),
|
||||||
.TagWriteEnable(SRAMLineWayWriteEnable),
|
.TagWriteEnable(SRAMLineWayWriteEnable),
|
||||||
.WriteData(SRAMWriteData),
|
.WriteData(SRAMWriteData),
|
||||||
@ -191,7 +188,6 @@ module cache #(parameter LINELEN, NUMLINES, NUMWAYS, DCACHE = 1) (
|
|||||||
.en(FlushWayCntEn), .val({{NUMWAYS-1{1'b0}}, 1'b1}),
|
.en(FlushWayCntEn), .val({{NUMWAYS-1{1'b0}}, 1'b1}),
|
||||||
.d(NextFlushWay), .q(FlushWay));
|
.d(NextFlushWay), .q(FlushWay));
|
||||||
assign FlushWayFlag = FlushWay[NUMWAYS-1];
|
assign FlushWayFlag = FlushWay[NUMWAYS-1];
|
||||||
assign VDWriteEnableWay = FlushWay & {NUMWAYS{VDWriteEnable}};
|
|
||||||
assign NextFlushWay = {FlushWay[NUMWAYS-2:0], FlushWay[NUMWAYS-1]};
|
assign NextFlushWay = {FlushWay[NUMWAYS-2:0], FlushWay[NUMWAYS-1]};
|
||||||
|
|
||||||
assign SelectedWay = SelFlush ? FlushWay : (SRAMLineWriteEnable ? VictimWay : WayHit);
|
assign SelectedWay = SelFlush ? FlushWay : (SRAMLineWriteEnable ? VictimWay : WayHit);
|
||||||
@ -215,5 +211,5 @@ module cache #(parameter LINELEN, NUMLINES, NUMWAYS, DCACHE = 1) (
|
|||||||
.FlushAdrCntEn, .FlushWayCntEn, .FlushAdrCntRst,
|
.FlushAdrCntEn, .FlushWayCntEn, .FlushAdrCntRst,
|
||||||
.FlushWayCntRst, .FlushAdrFlag, .FlushWayFlag, .FlushCache,
|
.FlushWayCntRst, .FlushAdrFlag, .FlushWayFlag, .FlushCache,
|
||||||
.save, .restore,
|
.save, .restore,
|
||||||
.VDWriteEnable, .LRUWriteEn);
|
.LRUWriteEn);
|
||||||
endmodule
|
endmodule
|
||||||
|
6
pipelined/src/cache/cachefsm.sv
vendored
6
pipelined/src/cache/cachefsm.sv
vendored
@ -75,10 +75,7 @@ module cachefsm
|
|||||||
output logic FlushAdrCntRst,
|
output logic FlushAdrCntRst,
|
||||||
output logic FlushWayCntRst,
|
output logic FlushWayCntRst,
|
||||||
output logic save,
|
output logic save,
|
||||||
output logic restore,
|
output logic restore);
|
||||||
output logic VDWriteEnable
|
|
||||||
|
|
||||||
);
|
|
||||||
|
|
||||||
logic [1:0] PreSelAdr;
|
logic [1:0] PreSelAdr;
|
||||||
logic resetDelay;
|
logic resetDelay;
|
||||||
@ -201,7 +198,6 @@ module cachefsm
|
|||||||
(CurrState == STATE_MISS_READ_WORD_DELAY & DoAMO) |
|
(CurrState == STATE_MISS_READ_WORD_DELAY & DoAMO) |
|
||||||
(CurrState == STATE_MISS_WRITE_WORD);
|
(CurrState == STATE_MISS_WRITE_WORD);
|
||||||
assign SRAMLineWriteEnable = (CurrState == STATE_MISS_WRITE_CACHE_LINE);
|
assign SRAMLineWriteEnable = (CurrState == STATE_MISS_WRITE_CACHE_LINE);
|
||||||
assign VDWriteEnable = (CurrState == STATE_FLUSH_CLEAR_DIRTY);
|
|
||||||
assign SelEvict = (CurrState == STATE_MISS_EVICT_DIRTY);
|
assign SelEvict = (CurrState == STATE_MISS_EVICT_DIRTY);
|
||||||
assign LRUWriteEn = (CurrState == STATE_READY & (DoAMOHit | DoReadHit | DoWriteHit)) |
|
assign LRUWriteEn = (CurrState == STATE_READY & (DoAMOHit | DoReadHit | DoWriteHit)) |
|
||||||
(CurrState == STATE_MISS_READ_WORD_DELAY) |
|
(CurrState == STATE_MISS_READ_WORD_DELAY) |
|
||||||
|
11
pipelined/src/cache/cacheway.sv
vendored
11
pipelined/src/cache/cacheway.sv
vendored
@ -38,7 +38,6 @@ module cacheway #(parameter NUMLINES=512, parameter LINELEN = 256, TAGLEN = 26,
|
|||||||
input logic [$clog2(NUMLINES)-1:0] RAdr,
|
input logic [$clog2(NUMLINES)-1:0] RAdr,
|
||||||
input logic [`PA_BITS-1:0] PAdr,
|
input logic [`PA_BITS-1:0] PAdr,
|
||||||
input logic WriteEnable,
|
input logic WriteEnable,
|
||||||
input logic VDWriteEnable,
|
|
||||||
input logic [LINELEN/`XLEN-1:0] WriteWordEnable,
|
input logic [LINELEN/`XLEN-1:0] WriteWordEnable,
|
||||||
input logic TagWriteEnable,
|
input logic TagWriteEnable,
|
||||||
input logic [LINELEN-1:0] WriteData,
|
input logic [LINELEN-1:0] WriteData,
|
||||||
@ -69,7 +68,7 @@ module cacheway #(parameter NUMLINES=512, parameter LINELEN = 256, TAGLEN = 26,
|
|||||||
logic [$clog2(NUMLINES)-1:0] RAdrD;
|
logic [$clog2(NUMLINES)-1:0] RAdrD;
|
||||||
logic SetValidD, ClearValidD;
|
logic SetValidD, ClearValidD;
|
||||||
logic SetDirtyD, ClearDirtyD;
|
logic SetDirtyD, ClearDirtyD;
|
||||||
logic WriteEnableD, VDWriteEnableD;
|
logic WriteEnableD;
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Tag Array
|
// Tag Array
|
||||||
@ -113,8 +112,8 @@ module cacheway #(parameter NUMLINES=512, parameter LINELEN = 256, TAGLEN = 26,
|
|||||||
end
|
end
|
||||||
// *** consider revisiting whether these delays are the best option?
|
// *** consider revisiting whether these delays are the best option?
|
||||||
flop #($clog2(NUMLINES)) RAdrDelayReg(clk, RAdr, RAdrD);
|
flop #($clog2(NUMLINES)) RAdrDelayReg(clk, RAdr, RAdrD);
|
||||||
flop #(4) ValidCtrlDelayReg(clk, {SetValid, ClearValid, WriteEnable, VDWriteEnable},
|
flop #(3) ValidCtrlDelayReg(clk, {SetValid, ClearValid, WriteEnable},
|
||||||
{SetValidD, ClearValidD, WriteEnableD, VDWriteEnableD});
|
{SetValidD, ClearValidD, WriteEnableD});
|
||||||
assign Valid = ValidBits[RAdrD];
|
assign Valid = ValidBits[RAdrD];
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
@ -125,8 +124,8 @@ module cacheway #(parameter NUMLINES=512, parameter LINELEN = 256, TAGLEN = 26,
|
|||||||
if (DIRTY_BITS) begin:dirty
|
if (DIRTY_BITS) begin:dirty
|
||||||
always_ff @(posedge clk) begin
|
always_ff @(posedge clk) begin
|
||||||
if (reset) DirtyBits <= #1 {NUMLINES{1'b0}};
|
if (reset) DirtyBits <= #1 {NUMLINES{1'b0}};
|
||||||
else if (SetDirtyD & (WriteEnableD | VDWriteEnableD)) DirtyBits[RAdrD] <= #1 1'b1;
|
else if (SetDirtyD) DirtyBits[RAdrD] <= #1 1'b1;
|
||||||
else if (ClearDirtyD & (WriteEnableD | VDWriteEnableD)) DirtyBits[RAdrD] <= #1 1'b0;
|
else if (ClearDirtyD) DirtyBits[RAdrD] <= #1 1'b0;
|
||||||
end
|
end
|
||||||
flop #(2) DirtyCtlDelayReg(clk, {SetDirty, ClearDirty}, {SetDirtyD, ClearDirtyD});
|
flop #(2) DirtyCtlDelayReg(clk, {SetDirty, ClearDirty}, {SetDirtyD, ClearDirtyD});
|
||||||
assign Dirty = DirtyBits[RAdrD];
|
assign Dirty = DirtyBits[RAdrD];
|
||||||
|
Loading…
Reference in New Issue
Block a user