forked from Github_Repos/cvw
Logger significantly improved.
This commit is contained in:
parent
fdb81e44c9
commit
11a5b23bb8
@ -557,31 +557,38 @@ end
|
|||||||
|
|
||||||
if (`ICACHE_SUPPORTED && `I_CACHE_ADDR_LOGGER) begin : ICacheLogger
|
if (`ICACHE_SUPPORTED && `I_CACHE_ADDR_LOGGER) begin : ICacheLogger
|
||||||
int file;
|
int file;
|
||||||
string LogFile;
|
string LogFile;
|
||||||
logic resetD, resetEdge;
|
logic resetD, resetEdge;
|
||||||
logic Enable;
|
logic Enable;
|
||||||
// assign Enable = ~dut.core.StallD & ~dut.core.FlushD & dut.core.ifu.bus.icache.CacheRWF[1] & ~reset;
|
// assign Enable = ~dut.core.StallD & ~dut.core.FlushD & dut.core.ifu.bus.icache.CacheRWF[1] & ~reset;
|
||||||
|
|
||||||
// this version of Enable allows for accurate eviction logging.
|
// this version of Enable allows for accurate eviction logging.
|
||||||
// Likely needs further improvement.
|
// Likely needs further improvement.
|
||||||
assign Enable = dut.core.ifu.bus.icache.icache.cachefsm.LRUWriteEn & ~reset;
|
assign Enable = dut.core.ifu.bus.icache.icache.cachefsm.LRUWriteEn &
|
||||||
flop #(1) ResetDReg(clk, reset, resetD);
|
dut.core.ifu.immu.immu.pmachecker.Cacheable &
|
||||||
assign resetEdge = ~reset & resetD;
|
~dut.core.ifu.bus.icache.icache.cachefsm.FlushStage &
|
||||||
|
~reset;
|
||||||
|
flop #(1) ResetDReg(clk, reset, resetD);
|
||||||
|
assign resetEdge = ~reset & resetD;
|
||||||
|
|
||||||
|
flop #(1) InvalReg(clk, dut.core.ifu.InvalidateICacheM, InvalDelayed);
|
||||||
|
assign InvalEdge = dut.core.ifu.InvalidateICacheM & ~InvalDelayed;
|
||||||
|
|
||||||
initial begin
|
initial begin
|
||||||
LogFile = $psprintf("ICache.log");
|
LogFile = $psprintf("ICache.log");
|
||||||
file = $fopen(LogFile, "w");
|
file = $fopen(LogFile, "w");
|
||||||
$fwrite(file, "BEGIN %s\n", memfilename);
|
$fwrite(file, "BEGIN %s\n", memfilename);
|
||||||
end
|
end
|
||||||
string AccessTypeString, HitMissString;
|
string AccessTypeString, HitMissString;
|
||||||
assign HitMissString = dut.core.ifu.bus.icache.icache.CacheHit ? "H" :
|
assign HitMissString = dut.core.ifu.bus.icache.icache.CacheHit ? "H" :
|
||||||
dut.core.ifu.bus.icache.icache.vict.cacheLRU.AllValid ? "E" : "M";
|
dut.core.ifu.bus.icache.icache.vict.cacheLRU.AllValid ? "E" : "M";
|
||||||
assign AccessTypeString = dut.core.ifu.InvalidateICacheM ? "I" : "R";
|
|
||||||
always @(posedge clk) begin
|
always @(posedge clk) begin
|
||||||
if(resetEdge) $fwrite(file, "TRAIN\n");
|
if(resetEdge) $fwrite(file, "TRAIN\n");
|
||||||
if(Begin) $fwrite(file, "BEGIN %s\n", memfilename);
|
if(Begin) $fwrite(file, "BEGIN %s\n", memfilename);
|
||||||
if(Enable) begin // only log i cache reads
|
if(Enable) begin // only log i cache reads
|
||||||
$fwrite(file, "%h %s %s\n", dut.core.ifu.PCPF, AccessTypeString, HitMissString);
|
$fwrite(file, "%h R %s\n", dut.core.ifu.PCPF, HitMissString);
|
||||||
end
|
end
|
||||||
|
if(InvalEdge) $fwrite(file, "0 I X\n");
|
||||||
if(EndSample) $fwrite(file, "END %s\n", memfilename);
|
if(EndSample) $fwrite(file, "END %s\n", memfilename);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -612,6 +619,7 @@ end
|
|||||||
// Likely needs further improvement.
|
// Likely needs further improvement.
|
||||||
assign Enabled = dut.core.lsu.bus.dcache.dcache.cachefsm.LRUWriteEn &
|
assign Enabled = dut.core.lsu.bus.dcache.dcache.cachefsm.LRUWriteEn &
|
||||||
~dut.core.lsu.bus.dcache.dcache.cachefsm.FlushStage &
|
~dut.core.lsu.bus.dcache.dcache.cachefsm.FlushStage &
|
||||||
|
dut.core.lsu.dmmu.dmmu.pmachecker.Cacheable &
|
||||||
(AccessTypeString != "NULL");
|
(AccessTypeString != "NULL");
|
||||||
|
|
||||||
initial begin
|
initial begin
|
||||||
@ -625,6 +633,7 @@ end
|
|||||||
if(Enabled) begin
|
if(Enabled) begin
|
||||||
$fwrite(file, "%h %s %s\n", dut.core.lsu.PAdrM, AccessTypeString, HitMissString);
|
$fwrite(file, "%h %s %s\n", dut.core.lsu.PAdrM, AccessTypeString, HitMissString);
|
||||||
end
|
end
|
||||||
|
if(dut.core.lsu.bus.dcache.dcache.cachefsm.FlushFlag) $fwrite(file, "0 F X\n");
|
||||||
if(EndSample) $fwrite(file, "END %s\n", memfilename);
|
if(EndSample) $fwrite(file, "END %s\n", memfilename);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user