forked from Github_Repos/cvw
		
	Logger significantly improved.
This commit is contained in:
		
							parent
							
								
									fdb81e44c9
								
							
						
					
					
						commit
						11a5b23bb8
					
				| @ -564,9 +564,16 @@ end | ||||
|      | ||||
|     // this version of Enable allows for accurate eviction logging.
 | ||||
|     // 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 &  | ||||
|                     dut.core.ifu.immu.immu.pmachecker.Cacheable & | ||||
|                     ~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 | ||||
| 	    LogFile = $psprintf("ICache.log"); | ||||
|       file = $fopen(LogFile, "w"); | ||||
| @ -575,13 +582,13 @@ end | ||||
|     string AccessTypeString, HitMissString; | ||||
|     assign HitMissString = dut.core.ifu.bus.icache.icache.CacheHit ? "H" : | ||||
|                            dut.core.ifu.bus.icache.icache.vict.cacheLRU.AllValid ? "E" : "M"; | ||||
|     assign AccessTypeString = dut.core.ifu.InvalidateICacheM ? "I" : "R"; | ||||
|     always @(posedge clk) begin | ||||
| 	  if(resetEdge) $fwrite(file, "TRAIN\n"); | ||||
| 	  if(Begin) $fwrite(file, "BEGIN %s\n", memfilename); | ||||
| 	  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 | ||||
|     if(InvalEdge) $fwrite(file, "0 I X\n"); | ||||
| 	  if(EndSample) $fwrite(file, "END %s\n", memfilename); | ||||
|     end | ||||
|   end | ||||
| @ -612,6 +619,7 @@ end | ||||
|     // Likely needs further improvement.
 | ||||
|     assign Enabled = dut.core.lsu.bus.dcache.dcache.cachefsm.LRUWriteEn & | ||||
|                      ~dut.core.lsu.bus.dcache.dcache.cachefsm.FlushStage & | ||||
|                      dut.core.lsu.dmmu.dmmu.pmachecker.Cacheable & | ||||
|                      (AccessTypeString != "NULL"); | ||||
| 
 | ||||
|     initial begin | ||||
| @ -625,6 +633,7 @@ end | ||||
| 	  if(Enabled) begin | ||||
| 	    $fwrite(file, "%h %s %s\n", dut.core.lsu.PAdrM, AccessTypeString, HitMissString); | ||||
| 	  end | ||||
|     if(dut.core.lsu.bus.dcache.dcache.cachefsm.FlushFlag) $fwrite(file, "0 F X\n"); | ||||
| 	  if(EndSample) $fwrite(file, "END %s\n", memfilename); | ||||
|     end | ||||
|   end | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user