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 `endif
module mkCommitStage#(CommitInput inIfc)(CommitStage); module mkCommitStage#(CommitInput inIfc)(CommitStage);
Bool verbose = False; Bool verbose = True;
Integer verbosity = 1; // Bluespec: for lightweight verbosity trace Integer verbosity = 1; // Bluespec: for lightweight verbosity trace

View File

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

View File

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