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.
 | 
					    // 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 & 
 | 
				
			||||||
 | 
					                    dut.core.ifu.immu.immu.pmachecker.Cacheable &
 | 
				
			||||||
 | 
					                    ~dut.core.ifu.bus.icache.icache.cachefsm.FlushStage &
 | 
				
			||||||
 | 
					                    ~reset;
 | 
				
			||||||
	  flop #(1) ResetDReg(clk, reset, resetD);
 | 
						  flop #(1) ResetDReg(clk, reset, resetD);
 | 
				
			||||||
	  assign resetEdge = ~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");
 | 
				
			||||||
@ -575,13 +582,13 @@ 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