mirror of
				https://github.com/openhwgroup/cvw
				synced 2025-02-11 06:05:49 +00:00 
			
		
		
		
	Added FlushF to hazard unit.
Fixed some typos with the names of signals in the branch predictor. They were causing signals to be not set. Note there is a modelsim flag which prevents it from compiling if a logic is undefined. I will look this up and add it to the compiler.
This commit is contained in:
		
							parent
							
								
									06e975ac2f
								
							
						
					
					
						commit
						597dd1e7e6
					
				| @ -44,7 +44,7 @@ mem load -infile twoBitPredictor.txt -format bin testbench/dut/hart/ifu/bpred/Di | ||||
| mem load -infile BTBPredictor.txt -format bin testbench/dut/hart/ifu/bpred/TargetPredictor/memory/memory | ||||
| 
 | ||||
| do wave.do | ||||
| add log /* -recursive | ||||
| add log -r /* | ||||
| 
 | ||||
| -- Run the Simulation  | ||||
| #run 1000 | ||||
|  | ||||
							
								
								
									
										1622
									
								
								wally-pipelined/regression/wave-all.do
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1622
									
								
								wally-pipelined/regression/wave-all.do
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -3,17 +3,25 @@ quietly WaveActivateNextPane {} 0 | ||||
| add wave -noupdate /testbench/clk | ||||
| add wave -noupdate /testbench/reset | ||||
| add wave -noupdate -radix ascii /testbench/memfilename | ||||
| add wave -noupdate -expand -group {Execution Stage} /testbench/dut/hart/ifu/PCE | ||||
| add wave -noupdate -expand -group {Execution Stage} /testbench/InstrEName | ||||
| add wave -noupdate -expand -group {Execution Stage} /testbench/dut/hart/ifu/InstrE | ||||
| add wave -noupdate -divider <NULL> | ||||
| add wave -noupdate /testbench/dut/hart/ebu/IReadF | ||||
| add wave -noupdate -expand -group HDU /testbench/dut/hart/DataStall | ||||
| add wave -noupdate -expand -group HDU /testbench/dut/hart/InstrStall | ||||
| add wave -noupdate -expand -group HDU -color Yellow /testbench/dut/hart/hzu/FlushF | ||||
| add wave -noupdate -expand -group HDU -color Yellow /testbench/dut/hart/FlushD | ||||
| add wave -noupdate -expand -group HDU -color Yellow /testbench/dut/hart/FlushE | ||||
| add wave -noupdate -expand -group HDU -color Yellow /testbench/dut/hart/FlushM | ||||
| add wave -noupdate -expand -group HDU -color Yellow /testbench/dut/hart/FlushW | ||||
| add wave -noupdate -expand -group HDU -color Orange /testbench/dut/hart/StallF | ||||
| add wave -noupdate -expand -group HDU -color Orange /testbench/dut/hart/StallD | ||||
| add wave -noupdate -expand -group HDU -expand -group hazards /testbench/dut/hart/hzu/BPPredWrongE | ||||
| add wave -noupdate -expand -group HDU -expand -group hazards /testbench/dut/hart/hzu/CSRWritePendingDEM | ||||
| add wave -noupdate -expand -group HDU -expand -group hazards /testbench/dut/hart/hzu/RetM | ||||
| add wave -noupdate -expand -group HDU -expand -group hazards /testbench/dut/hart/hzu/TrapM | ||||
| add wave -noupdate -expand -group HDU -expand -group hazards /testbench/dut/hart/hzu/LoadStallD | ||||
| add wave -noupdate -expand -group HDU -expand -group hazards /testbench/dut/hart/hzu/InstrStall | ||||
| add wave -noupdate -expand -group HDU -expand -group hazards /testbench/dut/hart/hzu/DataStall | ||||
| add wave -noupdate -expand -group HDU -expand -group Flush -color Yellow /testbench/dut/hart/hzu/FlushF | ||||
| add wave -noupdate -expand -group HDU -expand -group Flush -color Yellow /testbench/dut/hart/FlushD | ||||
| add wave -noupdate -expand -group HDU -expand -group Flush -color Yellow /testbench/dut/hart/FlushE | ||||
| add wave -noupdate -expand -group HDU -expand -group Flush -color Yellow /testbench/dut/hart/FlushM | ||||
| add wave -noupdate -expand -group HDU -expand -group Flush -color Yellow /testbench/dut/hart/FlushW | ||||
| add wave -noupdate -expand -group HDU -expand -group Stall -color Orange /testbench/dut/hart/StallF | ||||
| add wave -noupdate -expand -group HDU -expand -group Stall -color Orange /testbench/dut/hart/StallD | ||||
| add wave -noupdate -expand -group Bpred -expand -group direction -divider Update | ||||
| add wave -noupdate -expand -group Bpred -expand -group direction /testbench/dut/hart/ifu/bpred/DirPredictor/UpdatePC | ||||
| add wave -noupdate -expand -group Bpred -expand -group direction /testbench/dut/hart/ifu/bpred/DirPredictor/UpdateEN | ||||
| @ -23,17 +31,23 @@ add wave -noupdate -expand -group Bpred -expand -group direction /testbench/dut/ | ||||
| add wave -noupdate -expand -group InstrClass /testbench/dut/hart/ifu/bpred/InstrClassF | ||||
| add wave -noupdate -expand -group InstrClass /testbench/dut/hart/ifu/bpred/InstrClassD | ||||
| add wave -noupdate -expand -group InstrClass /testbench/dut/hart/ifu/bpred/InstrClassE | ||||
| add wave -noupdate /testbench/dut/hart/ifu/bpred/InstrF | ||||
| add wave -noupdate -expand -group {instruction pipeline} /testbench/dut/hart/ifu/InstrF | ||||
| add wave -noupdate -expand -group {instruction pipeline} /testbench/dut/hart/ifu/InstrD | ||||
| add wave -noupdate -expand -group {instruction pipeline} /testbench/dut/hart/ifu/InstrE | ||||
| add wave -noupdate -expand -group {instruction pipeline} /testbench/dut/hart/ifu/InstrM | ||||
| add wave -noupdate /testbench/dut/hart/ifu/bpred/BPPredWrongE | ||||
| add wave -noupdate /testbench/dut/hart/ifu/PCNextF | ||||
| add wave -noupdate /testbench/dut/hart/ifu/PCF | ||||
| add wave -noupdate /testbench/dut/hart/ifu/PCPlus2or4F | ||||
| add wave -noupdate /testbench/dut/hart/ifu/PCNext0F | ||||
| add wave -noupdate /testbench/dut/hart/ifu/PCNext1F | ||||
| add wave -noupdate /testbench/dut/hart/ifu/SelBPPredF | ||||
| add wave -noupdate /testbench/dut/hart/ifu/bpred/BTBValidF | ||||
| add wave -noupdate /testbench/dut/hart/ifu/bpred/BPPredF | ||||
| add wave -noupdate -expand -group {PCNext Generation} /testbench/dut/hart/ifu/PCNextF | ||||
| add wave -noupdate -expand -group {PCNext Generation} /testbench/dut/hart/ifu/PCF | ||||
| add wave -noupdate -expand -group {PCNext Generation} /testbench/dut/hart/ifu/PCPlus2or4F | ||||
| add wave -noupdate -expand -group {PCNext Generation} /testbench/dut/hart/ifu/BPPredPCF | ||||
| add wave -noupdate -expand -group {PCNext Generation} /testbench/dut/hart/ifu/PCNext0F | ||||
| add wave -noupdate -expand -group {PCNext Generation} /testbench/dut/hart/ifu/PCNext1F | ||||
| add wave -noupdate -expand -group {PCNext Generation} /testbench/dut/hart/ifu/SelBPPredF | ||||
| add wave -noupdate -expand -group {PCNext Generation} /testbench/dut/hart/ifu/BPPredWrongE | ||||
| add wave -noupdate -expand -group {PCNext Generation} /testbench/dut/hart/ifu/PrivilegedChangePCM | ||||
| add wave -noupdate /testbench/dut/hart/ifu/bpred/TargetPredictor/ValidBits | ||||
| add wave -noupdate /testbench/dut/hart/ifu/bpred/BPPredF | ||||
| add wave -noupdate /testbench/dut/hart/ifu/bpred/BTBValidF | ||||
| add wave -noupdate /testbench/dut/hart/ifu/bpred/TargetPredictor/LookUpPCIndexQ | ||||
| add wave -noupdate /testbench/dut/hart/ifu/bpred/TargetPredictor/UpdatePCIndexQ | ||||
| add wave -noupdate /testbench/dut/hart/ifu/bpred/TargetPredictor/LookUpPC | ||||
| @ -42,15 +56,38 @@ add wave -noupdate -expand -group {bp wrong} /testbench/dut/hart/ifu/bpred/FallT | ||||
| add wave -noupdate -expand -group {bp wrong} /testbench/dut/hart/ifu/bpred/PredictionDirWrongE | ||||
| add wave -noupdate -expand -group {bp wrong} /testbench/dut/hart/ifu/bpred/PredictionPCWrongE | ||||
| add wave -noupdate -expand -group {bp wrong} /testbench/dut/hart/ifu/bpred/BPPredWrongE | ||||
| add wave -noupdate -expand -group BTB -divider Update | ||||
| add wave -noupdate -expand -group BTB /testbench/dut/hart/ifu/bpred/TargetPredictor/UpdateEN | ||||
| add wave -noupdate -expand -group BTB /testbench/dut/hart/ifu/bpred/TargetPredictor/UpdatePC | ||||
| add wave -noupdate -expand -group BTB /testbench/dut/hart/ifu/bpred/TargetPredictor/UpdateTarget | ||||
| add wave -noupdate -expand -group {Execution Stage} /testbench/dut/hart/ifu/PCE | ||||
| add wave -noupdate -expand -group {Execution Stage} /testbench/dut/hart/ifu/InstrE | ||||
| add wave -noupdate -expand -group {bp wrong} /testbench/dut/hart/ifu/bpred/InstrClassE | ||||
| add wave -noupdate -group BTB -divider Update | ||||
| add wave -noupdate -group BTB /testbench/dut/hart/ifu/bpred/TargetPredictor/UpdateEN | ||||
| add wave -noupdate -group BTB /testbench/dut/hart/ifu/bpred/TargetPredictor/UpdatePC | ||||
| add wave -noupdate -group BTB /testbench/dut/hart/ifu/bpred/TargetPredictor/UpdateTarget | ||||
| add wave -noupdate -group BTB -divider Lookup | ||||
| add wave -noupdate -group BTB /testbench/dut/hart/ifu/bpred/TargetPredictor/TargetPC | ||||
| add wave -noupdate -group BTB /testbench/dut/hart/ifu/bpred/TargetPredictor/Valid | ||||
| add wave -noupdate /testbench/dut/hart/ifu/bpred/BTBPredPCF | ||||
| add wave -noupdate /testbench/dut/hart/ifu/bpred/TargetPredictor/TargetPC | ||||
| add wave -noupdate /testbench/dut/hart/ifu/bpred/CorrectPCE | ||||
| add wave -noupdate /testbench/dut/hart/ifu/bpred/FlushF | ||||
| add wave -noupdate /testbench/dut/hart/FlushF | ||||
| add wave -noupdate -expand -group RegFile /testbench/dut/hart/ieu/dp/regf/rf | ||||
| add wave -noupdate -expand -group RegFile /testbench/dut/hart/ieu/dp/regf/a1 | ||||
| add wave -noupdate -expand -group RegFile /testbench/dut/hart/ieu/dp/regf/a2 | ||||
| add wave -noupdate -expand -group RegFile /testbench/dut/hart/ieu/dp/regf/a3 | ||||
| add wave -noupdate -expand -group RegFile /testbench/dut/hart/ieu/dp/regf/rd1 | ||||
| add wave -noupdate -expand -group RegFile /testbench/dut/hart/ieu/dp/regf/rd2 | ||||
| add wave -noupdate -expand -group RegFile /testbench/dut/hart/ieu/dp/regf/we3 | ||||
| add wave -noupdate -expand -group RegFile /testbench/dut/hart/ieu/dp/regf/wd3 | ||||
| add wave -noupdate /testbench/dut/hart/ieu/c/RegWriteE | ||||
| add wave -noupdate -group {Decode Stage} /testbench/dut/hart/ifu/InstrD | ||||
| add wave -noupdate -group {Decode Stage} /testbench/InstrDName | ||||
| add wave -noupdate -group {Decode Stage} /testbench/dut/hart/ieu/c/RegWriteD | ||||
| add wave -noupdate -group {Decode Stage} /testbench/dut/hart/ieu/dp/RdD | ||||
| add wave -noupdate -group {Decode Stage} /testbench/dut/hart/ieu/dp/Rs1D | ||||
| add wave -noupdate -group {Decode Stage} /testbench/dut/hart/ieu/dp/Rs2D | ||||
| add wave -noupdate /testbench/InstrFName | ||||
| TreeUpdate [SetDefaultTree] | ||||
| WaveRestoreCursors {{Cursor 1} {137177 ns} 0} | ||||
| quietly wave cursor active 1 | ||||
| WaveRestoreCursors {{Cursor 2} {332469 ns} 0} {{Cursor 3} {333566 ns} 0} {{Cursor 4} {675 ns} 0} | ||||
| quietly wave cursor active 2 | ||||
| configure wave -namecolwidth 250 | ||||
| configure wave -valuecolwidth 185 | ||||
| configure wave -justifyvalue left | ||||
| @ -65,4 +102,4 @@ configure wave -griddelta 40 | ||||
| configure wave -timeline 0 | ||||
| configure wave -timelineunits ns | ||||
| update | ||||
| WaveRestoreZoom {136946 ns} {137442 ns} | ||||
| WaveRestoreZoom {333505 ns} {333689 ns} | ||||
|  | ||||
| @ -34,7 +34,7 @@ module hazard( | ||||
|   input  logic       LoadStallD, | ||||
|   input  logic       InstrStall, DataStall, | ||||
|   // Stall outputs
 | ||||
|   output logic       StallF, StallD, FlushD, FlushE, FlushM, FlushW | ||||
|   output logic       StallF, StallD, FlushF, FlushD, FlushE, FlushM, FlushW | ||||
| ); | ||||
| 
 | ||||
|   logic BranchFlushDE; | ||||
|  | ||||
| @ -58,7 +58,7 @@ module bpred | ||||
|   logic [1:0] 		    BPPredF, BPPredD, BPPredE, UpdateBPPredE; | ||||
| 
 | ||||
|   logic [3:0] 		    InstrClassD, InstrClassF, InstrClassE; | ||||
|   logic [`XLEN-1:0] 	    BTBPredPCF, RASPCF, BTBPredPCMemoryF; | ||||
|   logic [`XLEN-1:0] 	    BTBPredPCF, RASPCF; | ||||
|   logic 		    TargetWrongE; | ||||
|   logic 		    FallThroughWrongE; | ||||
|   logic 		    PredictionDirWrongE; | ||||
| @ -71,7 +71,7 @@ module bpred | ||||
|   // This is probably too much logic. 
 | ||||
|   // *** This also encourages me to switch to predicting the class.
 | ||||
| 
 | ||||
|   assign InstrClassF[2] = InstrF[6:0] == 7'h67 && InstrF[19:15] == 5'h01; // jump register, but not return
 | ||||
|   assign InstrClassF[2] = InstrF[6:0] == 7'h67 && InstrF[19:15] != 5'h01; // jump register, but not return
 | ||||
|   assign InstrClassF[1] = InstrF[6:0] == 7'h6F; // jump
 | ||||
|   assign InstrClassF[0] = InstrF[6:0] == 7'h63; // branch
 | ||||
|    | ||||
| @ -102,7 +102,7 @@ module bpred | ||||
|   BTBPredictor TargetPredictor(.clk(clk), | ||||
| 			       .reset(reset), | ||||
| 			       .LookUpPC(PCNextF), | ||||
| 			       .TargetPC(BTBPredPCMemoryF), | ||||
| 			       .TargetPC(BTBPredPCF), | ||||
| 			       .Valid(BTBValidF), | ||||
| 			       // update
 | ||||
| 			       .UpdateEN(InstrClassE[2] | InstrClassE[1] | InstrClassE[0]), | ||||
| @ -111,7 +111,7 @@ module bpred | ||||
| 
 | ||||
|   // need to forward when updating to the same address as reading.
 | ||||
|   assign CorrectPCE = PCSrcE ? PCTargetE : PCLinkE; | ||||
|   assign TargetPC = (PCE == PCNextF) ? CorrectPCE : BTBPredPCMemoryF; | ||||
|   assign TargetPC = (PCE == PCNextF) ? CorrectPCE : BTBPredPCF; | ||||
| 
 | ||||
|   // Part 4 RAS
 | ||||
|   // *** need to add the logic to restore RAS on flushes.  We will use incr for this.
 | ||||
| @ -155,7 +155,7 @@ module bpred | ||||
|   flopenrc #(4) InstrClassRegE(.clk(clk), | ||||
| 			       .reset(reset), | ||||
| 			       .en(~StallD), | ||||
| 			       .clear(flushD), | ||||
| 			       .clear(FlushD), | ||||
| 			       .d(InstrClassD), | ||||
| 			       .q(InstrClassE)); | ||||
| 
 | ||||
|  | ||||
| @ -74,7 +74,7 @@ module ifu ( | ||||
| 
 | ||||
|   assign PrivilegedChangePCM = RetM | TrapM; | ||||
| 
 | ||||
|   assign StallExceptResolveBranchesF = StallF & ~(PCSrcE | PrivilegedChangePCM); | ||||
|   assign StallExceptResolveBranchesF = StallF & ~(SelBPPredF | BPPredWrongE | PrivilegedChangePCM); | ||||
| 
 | ||||
|   //mux3    #(`XLEN) pcmux(PCPlus2or4F, PCCorrectE, PrivilegedNextPCM, {PrivilegedChangePCM, BPPredWrongE}, UnalignedPCNextF);
 | ||||
|   mux2 #(`XLEN) pcmux0(.d0(PCPlus2or4F), | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user