mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-11 06:05:49 +00:00
More cleanup
This commit is contained in:
parent
b80a540c73
commit
b3976daccd
@ -1,5 +1,5 @@
|
||||
///////////////////////////////////////////
|
||||
// oneHotDecoder.sv
|
||||
// onehotdecoder.sv
|
||||
//
|
||||
// Written: ross1728@gmail.com July 09, 2021
|
||||
// Modified:
|
||||
|
@ -187,7 +187,7 @@ module bpred (
|
||||
// Correct branch/jump target.
|
||||
mux2 #(`XLEN) pccorrectemux(PCLinkE, IEUAdrE, PCSrcE, PCCorrectE);
|
||||
|
||||
// If the fence/csrw was predicted as a taken branch then we select PCF, rather PCE.
|
||||
// If the fence/csrw was predicted as a taken branch then we select PCF, rather than PCE.
|
||||
// Effectively this is PCM+4 or the non-existant PCLinkM
|
||||
if(`INSTR_CLASS_PRED) mux2 #(`XLEN) pcmuxBPWrongInvalidateFlush(PCE, PCF, BPWrongM, NextValidPCE);
|
||||
else assign NextValidPCE = PCE;
|
||||
@ -201,7 +201,7 @@ module bpred (
|
||||
// 3. target ras (ras target wrong / class[2])
|
||||
// 4. direction (br dir wrong / class[0])
|
||||
|
||||
// Unforuantely we can't use PCD to infer the correctness of the BTB or RAS because the class prediction
|
||||
// Unfortunately we can't use PCD to infer the correctness of the BTB or RAS because the class prediction
|
||||
// could be wrong or the fall through address selected for branch predict not taken.
|
||||
// By pipeline the BTB's PC and RAS address through the pipeline we can measure the accuracy of
|
||||
// both without the above inaccuracies.
|
||||
|
@ -1,7 +1,7 @@
|
||||
///////////////////////////////////////////
|
||||
// btb.sv
|
||||
//
|
||||
// Written: Ross Thomposn ross1728@gmail.com
|
||||
// Written: Ross Thompson ross1728@gmail.com
|
||||
// Created: February 15, 2021
|
||||
// Modified: 24 January 2023
|
||||
//
|
||||
@ -34,7 +34,7 @@ module btb #(parameter Depth = 10 ) (
|
||||
input logic clk,
|
||||
input logic reset,
|
||||
input logic StallF, StallD, StallE, StallM, StallW, FlushD, FlushE, FlushM, FlushW,
|
||||
input logic [`XLEN-1:0] PCNextF, PCF, PCD, PCE, PCM,// PC at various stages
|
||||
input logic [`XLEN-1:0] PCNextF, PCF, PCD, PCE, PCM, // PC at various stages
|
||||
output logic [`XLEN-1:0] BPBTAF, // BTB's guess at PC
|
||||
output logic [`XLEN-1:0] BPBTAD,
|
||||
output logic [`XLEN-1:0] BPBTAE,
|
||||
@ -73,7 +73,7 @@ module btb #(parameter Depth = 10 ) (
|
||||
|
||||
// must output a valid PC and valid bit during reset. Because only PCF, not PCNextF is reset, PCNextF is invalid
|
||||
// during reset. The BTB must produce a non X PC1NextF to allow the simulation to run.
|
||||
// While thie mux could be included in IFU it is not necessary for the IROM/I$/bus.
|
||||
// While the mux could be included in IFU it is not necessary for the IROM/I$/bus.
|
||||
// For now it is optimal to leave it here.
|
||||
assign ResetPC = `RESET_VECTOR;
|
||||
assign PCNextFIndex = reset ? ResetPC[Depth+1:2] : {PCNextF[Depth+1] ^ PCNextF[1], PCNextF[Depth:2]};
|
||||
|
Loading…
Reference in New Issue
Block a user