forked from Github_Repos/cvw
Found small bug in busfsm which was issuing 1 extra memory read after each cache line fetch. Does not appear to have translated to an extra read out of ahblite.
This commit is contained in:
parent
1f74528792
commit
ee3d968da0
@ -71,14 +71,14 @@ module busdp #(parameter WORDSPERLINE, LINELEN, LOGWPL, CACHE_ENABLED)
|
|||||||
localparam integer WordCountThreshold = CACHE_ENABLED ? WORDSPERLINE - 1 : 0;
|
localparam integer WordCountThreshold = CACHE_ENABLED ? WORDSPERLINE - 1 : 0;
|
||||||
logic [`PA_BITS-1:0] LocalLSUBusAdr;
|
logic [`PA_BITS-1:0] LocalLSUBusAdr;
|
||||||
logic [LOGWPL-1:0] WordCountDelayed;
|
logic [LOGWPL-1:0] WordCountDelayed;
|
||||||
|
logic BufferCaptureEn;
|
||||||
|
|
||||||
// *** implement flops as an array if feasbile; DLSUBusBuffer might be a problem
|
// *** implement flops as an array if feasbile; DLSUBusBuffer might be a problem
|
||||||
// *** better name than DLSUBusBuffer
|
// *** better name than DLSUBusBuffer
|
||||||
genvar index;
|
genvar index;
|
||||||
for (index = 0; index < WORDSPERLINE; index++) begin:fetchbuffer
|
for (index = 0; index < WORDSPERLINE; index++) begin:fetchbuffer
|
||||||
logic [WORDSPERLINE-1:0] CaptureWord;
|
logic [WORDSPERLINE-1:0] CaptureWord;
|
||||||
assign CaptureWord[index] = LSUBusAck & LSUBusRead & (index == WordCountDelayed);
|
assign CaptureWord[index] = BufferCaptureEn & (index == WordCountDelayed);
|
||||||
flopen #(`XLEN) fb(.clk, .en(CaptureWord[index]), .d(LSUBusHRDATA),
|
flopen #(`XLEN) fb(.clk, .en(CaptureWord[index]), .d(LSUBusHRDATA),
|
||||||
.q(DLSUBusBuffer[(index+1)*`XLEN-1:index*`XLEN]));
|
.q(DLSUBusBuffer[(index+1)*`XLEN-1:index*`XLEN]));
|
||||||
end
|
end
|
||||||
@ -90,5 +90,6 @@ module busdp #(parameter WORDSPERLINE, LINELEN, LOGWPL, CACHE_ENABLED)
|
|||||||
busfsm #(WordCountThreshold, LOGWPL, CACHE_ENABLED) busfsm(
|
busfsm #(WordCountThreshold, LOGWPL, CACHE_ENABLED) busfsm(
|
||||||
.clk, .reset, .IgnoreRequest, .LSURWM, .DCacheFetchLine, .DCacheWriteLine,
|
.clk, .reset, .IgnoreRequest, .LSURWM, .DCacheFetchLine, .DCacheWriteLine,
|
||||||
.LSUBusAck, .LSUBusInit, .CPUBusy, .CacheableM, .BusStall, .LSUBusWrite, .SelLSUBusWord, .LSUBusRead,
|
.LSUBusAck, .LSUBusInit, .CPUBusy, .CacheableM, .BusStall, .LSUBusWrite, .SelLSUBusWord, .LSUBusRead,
|
||||||
|
.BufferCaptureEn,
|
||||||
.LSUBurstType, .LSUTransType, .LSUTransComplete, .DCacheBusAck, .BusCommittedM, .SelUncachedAdr, .WordCount, .WordCountDelayed);
|
.LSUBurstType, .LSUTransType, .LSUTransComplete, .DCacheBusAck, .BusCommittedM, .SelUncachedAdr, .WordCount, .WordCountDelayed);
|
||||||
endmodule
|
endmodule
|
||||||
|
@ -55,6 +55,7 @@ module busfsm #(parameter integer WordCountThreshold,
|
|||||||
output logic DCacheBusAck,
|
output logic DCacheBusAck,
|
||||||
output logic BusCommittedM,
|
output logic BusCommittedM,
|
||||||
output logic SelUncachedAdr,
|
output logic SelUncachedAdr,
|
||||||
|
output logic BufferCaptureEn,
|
||||||
output logic [LOGWPL-1:0] WordCount, WordCountDelayed);
|
output logic [LOGWPL-1:0] WordCount, WordCountDelayed);
|
||||||
|
|
||||||
|
|
||||||
@ -167,15 +168,15 @@ module busfsm #(parameter integer WordCountThreshold,
|
|||||||
(BusCurrState == STATE_BUS_WRITE);
|
(BusCurrState == STATE_BUS_WRITE);
|
||||||
assign UnCachedLSUBusWrite = (BusCurrState == STATE_BUS_READY & UnCachedAccess & LSURWM[0] & ~IgnoreRequest) |
|
assign UnCachedLSUBusWrite = (BusCurrState == STATE_BUS_READY & UnCachedAccess & LSURWM[0] & ~IgnoreRequest) |
|
||||||
(BusCurrState == STATE_BUS_UNCACHED_WRITE);
|
(BusCurrState == STATE_BUS_UNCACHED_WRITE);
|
||||||
assign LSUBusWrite = UnCachedLSUBusWrite | (BusCurrState == STATE_BUS_WRITE);
|
assign LSUBusWrite = UnCachedLSUBusWrite | (BusCurrState == STATE_BUS_WRITE & ~WordCountFlag);
|
||||||
assign SelLSUBusWord = (BusCurrState == STATE_BUS_READY & UnCachedAccess & LSURWM[0]) |
|
assign SelLSUBusWord = (BusCurrState == STATE_BUS_READY & UnCachedAccess & LSURWM[0]) |
|
||||||
(BusCurrState == STATE_BUS_UNCACHED_WRITE) |
|
(BusCurrState == STATE_BUS_UNCACHED_WRITE) |
|
||||||
(BusCurrState == STATE_BUS_WRITE);
|
(BusCurrState == STATE_BUS_WRITE);
|
||||||
|
|
||||||
assign UnCachedLSUBusRead = (BusCurrState == STATE_BUS_READY & UnCachedAccess & LSURWM[1] & ~IgnoreRequest) |
|
assign UnCachedLSUBusRead = (BusCurrState == STATE_BUS_READY & UnCachedAccess & LSURWM[1] & ~IgnoreRequest) |
|
||||||
(BusCurrState == STATE_BUS_UNCACHED_READ);
|
(BusCurrState == STATE_BUS_UNCACHED_READ);
|
||||||
assign LSUBusRead = UnCachedLSUBusRead | (BusCurrState == STATE_BUS_FETCH) | (BusCurrState == STATE_BUS_READY & DCacheFetchLine);
|
assign LSUBusRead = UnCachedLSUBusRead | (BusCurrState == STATE_BUS_FETCH & ~(WordCountFlag)) | (BusCurrState == STATE_BUS_READY & DCacheFetchLine);
|
||||||
|
assign BufferCaptureEn = UnCachedLSUBusRead | BusCurrState == STATE_BUS_FETCH;
|
||||||
|
|
||||||
// Makes bus only do uncached reads/writes when we actually do uncached reads/writes. Needed because CacheableM is 0 when flushing cache.
|
// Makes bus only do uncached reads/writes when we actually do uncached reads/writes. Needed because CacheableM is 0 when flushing cache.
|
||||||
assign UnCachedRW = UnCachedLSUBusWrite | UnCachedLSUBusRead;
|
assign UnCachedRW = UnCachedLSUBusWrite | UnCachedLSUBusRead;
|
||||||
|
Loading…
Reference in New Issue
Block a user