mirror of
				https://github.com/openhwgroup/cvw
				synced 2025-02-11 06:05:49 +00:00 
			
		
		
		
	Partial fix to RAS prediction accurracy.
This commit is contained in:
		
							parent
							
								
									53c8042276
								
							
						
					
					
						commit
						17aebb8a3b
					
				| @ -32,12 +32,14 @@ module RASPredictor | ||||
|   #(parameter int StackSize = 16 | ||||
|     ) | ||||
|   (input logic              clk, | ||||
|    input logic              reset, | ||||
|    input logic              PopF, | ||||
|    input logic 				reset, | ||||
|    input logic 				PopF, | ||||
|    output logic [`XLEN-1:0] RASPCF, | ||||
|    input logic              PushE, | ||||
|    input logic              incr, | ||||
|    input logic [`XLEN-1:0]  PCLinkE | ||||
|    input logic [3:0] 		WrongPredInstrClassD, | ||||
|    input logic [3:0] 		InstrClassD, | ||||
|    input logic 				PushE, | ||||
|    input logic 				incr, | ||||
|    input logic [`XLEN-1:0] 	PCLinkE | ||||
|    ); | ||||
| 
 | ||||
|   // *** need to update so it either doesn't push until the memory stage
 | ||||
| @ -50,9 +52,9 @@ module RASPredictor | ||||
|   logic [StackSize-1:0]     [`XLEN-1:0] memory; | ||||
|   integer        index; | ||||
|    | ||||
|   assign CounterEn = PopF | PushE | incr; | ||||
|   assign CounterEn = PopF | PushE | incr | WrongPredInstrClassD[2]; | ||||
| 
 | ||||
|   assign PtrD = PopF ? PtrM1 : PtrP1; | ||||
|   assign PtrD = PopF | InstrClassD[2] ? PtrM1 : PtrP1; | ||||
| 
 | ||||
|   assign PtrM1 = PtrQ - 1'b1; | ||||
|   assign PtrP1 = PtrQ + 1'b1; | ||||
|  | ||||
| @ -79,7 +79,8 @@ module bpred ( | ||||
|   logic                     BPPredWrongM; | ||||
|   logic [`XLEN-1:0]         PCNext0F; | ||||
|   logic [`XLEN-1:0] 		PCCorrectE; | ||||
| 
 | ||||
|   logic [3:0] 				WrongPredInstrClassD; | ||||
|    | ||||
|   // Part 1 branch direction prediction
 | ||||
|   // look into the 2 port Sram model. something is wrong. 
 | ||||
|   if (`BPTYPE == "BPTWOBIT") begin:Predictor | ||||
| @ -157,6 +158,8 @@ module bpred ( | ||||
|   RASPredictor RASPredictor(.clk(clk), | ||||
|        .reset(reset), | ||||
|        .PopF(PredInstrClassF[2] & ~StallF), | ||||
| 							.WrongPredInstrClassD, | ||||
| 							.InstrClassD, | ||||
|        .RASPCF, | ||||
|        .PushE(InstrClassE[3] & ~StallE), | ||||
|        .incr(1'b0), | ||||
| @ -213,6 +216,9 @@ module bpred ( | ||||
|   assign RASPredPCWrongE = InstrClassE[2] & PredictionPCWrongE; | ||||
|   // Finally if the real instruction class is non CFI but the predictor said it was we need to count.
 | ||||
|   assign BPPredClassNonCFIWrongE = PredictionInstrClassWrongE & ~|InstrClassE; | ||||
| 
 | ||||
|   // branch class prediction wrong.
 | ||||
|   assign WrongPredInstrClassD = PredInstrClassD ^ InstrClassD; | ||||
|    | ||||
|    | ||||
|   // Selects the BP or PC+2/4.
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user