Get this building, removing scheduling issue.

This commit is contained in:
Jonathan Woodruff
2025-05-23 10:43:42 +01:00
parent 1873702c81
commit 5331162e3c
3 changed files with 20 additions and 23 deletions

View File

@@ -297,7 +297,7 @@ deriving (Eq, FShow, Bits);
`endif
module mkCommitStage#(CommitInput inIfc)(CommitStage);
Bool verbose = False;
Bool verbose = True;
Integer verbosity = 1; // Bluespec: for lightweight verbosity trace

View File

@@ -45,7 +45,6 @@ import Bht::*;
import GSelectPred::*;
import GSharePred::*;
import TourPred::*;
import TourPredSecure::*;
import Ras::*;
export DirPredTrainInfo(..);

View File

@@ -26,6 +26,7 @@ import Vector::*;
import Ehr::*;
import Types::*;
import ProcTypes::*;
import ConfigReg::*;
typedef struct {
Epoch curEp;
@@ -53,47 +54,44 @@ endinterface
(* synthesize *)
module mkEpochManager(EpochManager);
Reg#(Epoch) curr_epoch <- mkReg(0);
Reg#(Epoch) prev_checked_epoch <- mkReg(0);
Reg#(Epoch) curr_epoch <- mkConfigReg(0);
Reg#(Epoch) prev_checked_epoch <- mkConfigReg(0);
Epoch next_epoch = (curr_epoch== fromInteger(valueOf(NumEpochs)-1)) ? 0 : (curr_epoch+1);
// epochs in the core are within range [prev_checked_epoch, curr_epoch]
// prev_checked_epoch can be updated in a lazy way
Vector#(SupSize, Ehr#(2, Maybe#(Epoch))) updatePrevEn <- replicateM(mkEhr(Invalid));
Vector#(SupSize, RWire#(Epoch)) updatePrevEn <- replicateM(mkRWire);
(* fire_when_enabled, no_implicit_conditions *)
rule canon_prev_checked_epoch;
Vector#(SupSize, Maybe#(Epoch)) updates = readVEhr(1, updatePrevEn);
Vector#(SupSize, Maybe#(Epoch)) updates = ?;
for (Integer i = 0; i < valueof(SupSize); i = i + 1) updates[i] = updatePrevEn[i].wget();
// find the last update
if(find(isValid, reverse(updates)) matches tagged Valid .upd) begin
doAssert(isValid(upd), "must be valid");
prev_checked_epoch <= validValue(upd);
end
// reset EHR
for(Integer i = 0; i < valueof(SupSize); i = i+1) begin
updatePrevEn[i][1] <= Invalid;
end
endrule
Vector#(SupSize, EM_updatePrevEpoch) updateIfc;
for(Integer i = 0; i < valueof(SupSize); i = i+1) begin
updateIfc[i] = (interface EM_updatePrevEpoch;
method Action update(Epoch e);
updatePrevEn[i][0] <= Valid (e); // record update action
updatePrevEn[i].wset(e); // record update action
`ifdef BSIM
// sanity check
Epoch checkedEpoch = prev_checked_epoch;
for(Integer j = 0; j < i; j = j+1) begin
if(updatePrevEn[j][1] matches tagged Valid .ep) begin
checkedEpoch = ep;
end
end
if(checkedEpoch <= curr_epoch) begin
doAssert(checkedEpoch <= e && e <= curr_epoch, "e in [checkedEpoch, curr_epoch]");
end
else begin
doAssert(checkedEpoch <= e || e <= curr_epoch, "e in [checkedEpoch, max] + [0, curr_epoch]");
end
//Epoch checkedEpoch = prev_checked_epoch;
//for(Integer j = 0; j < i; j = j+1) begin
// if(updatePrevEn[j][1] matches tagged Valid .ep) begin
// checkedEpoch = ep;
// end
//end
//if(checkedEpoch <= curr_epoch) begin
// doAssert(checkedEpoch <= e && e <= curr_epoch, "e in [checkedEpoch, curr_epoch]");
//end
//else begin
// doAssert(checkedEpoch <= e || e <= curr_epoch, "e in [checkedEpoch, max] + [0, curr_epoch]");
//end
`endif
endmethod
endinterface);