mirror of
				https://github.com/openhwgroup/cvw
				synced 2025-02-11 06:05:49 +00:00 
			
		
		
		
	Added branch outcome logger to testbench
This commit is contained in:
		
							parent
							
								
									475becb414
								
							
						
					
					
						commit
						bf08c57ab0
					
				| @ -33,6 +33,7 @@ | ||||
| `include "tests.vh" | ||||
| 
 | ||||
| `define PrintHPMCounters 0 | ||||
| `define BPRED_LOGGER 1 | ||||
| 
 | ||||
| module testbench; | ||||
|   parameter DEBUG=0; | ||||
| @ -475,6 +476,19 @@ logic [3:0] dummy; | ||||
|         release dut.core.ifu.bpred.bpred.TargetPredictor.memory.mem[adrindex]; | ||||
|         end | ||||
|       end | ||||
| 
 | ||||
|       if (`BPRED_LOGGER) begin | ||||
|         string direction; | ||||
|         int    file; | ||||
|         initial | ||||
|           file = $fopen("branch.log", "w"); | ||||
|         always @(posedge clk) begin | ||||
|            if(dut.core.ifu.InstrClassM[0] & ~dut.core.StallW & ~dut.core.FlushW & dut.core.InstrValidM) begin | ||||
|              direction = dut.core.ifu.bpred.bpred.Predictor.DirPredictor.PCSrcM ? "t" : "n"; | ||||
|              $fwrite(file, "%h %s\n", dut.core.PCM, direction); | ||||
|            end | ||||
|         end | ||||
|       end | ||||
|     end | ||||
| 
 | ||||
|   // check for hange up.
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user