Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
renau committed Jan 28, 2025
1 parent a7cb58a commit b4c765a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
8 changes: 4 additions & 4 deletions conf/desesc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@ bpred = ["bp0", "bp1"]
do_random_transients = false

# Fetch parameters
fetch_align = true
fetch_align = false
trace_align = false
fetch_one_line = true # jumps within cacheline do not flush
fetch_one_line = false # jumps within cacheline do not flush
max_bb_cycle = 1
prefetcher = "pref_opt"

Expand Down Expand Up @@ -346,10 +346,10 @@ miss_delay = 8
assoc = 4
repl_policy = "lru"

port_num = 1
port_num = 2
port_banks = 32

send_port_num = 1
send_port_num = 2

max_requests = 32

Expand Down
4 changes: 0 additions & 4 deletions emul/dinst.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ class Dinst {
bool interCluster;
bool keep_stats;
bool biasBranch;
uint32_t branch_signature;
bool imli_highconf;

bool prefetch;
Expand Down Expand Up @@ -912,9 +911,6 @@ class Dinst {

bool getImliHighconf() const { return imli_highconf; }

void setBranchSignature(uint32_t s) { branch_signature = s; }
uint32_t getBranchSignature() const { return branch_signature; }

bool isTaken() const {
I(getInst()->isControl());
return addr != 0;
Expand Down
22 changes: 16 additions & 6 deletions simu/BPred.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,6 @@ Outcome BPIMLI::predict(Dinst *dinst, bool doUpdate, bool doStats) {
uint32_t sign = 0;
bool ptaken = imli->getPrediction(pc, bias, sign); // pass taken for statistics
dinst->setBiasBranch(bias);
dinst->setBranchSignature(sign);

bool no_alloc = true;
if (dinst->isUseLevel3()) {
Expand Down Expand Up @@ -621,6 +620,10 @@ void BPSuperbp::fetchBoundaryEnd() {
}

Outcome BPSuperbp::predict(Dinst *dinst, bool doUpdate, bool doStats) {
if (dinst->getInst()->isJump() || dinst->getInst()->isFuncRet()) {
return btb.predict(dinst, doUpdate, doStats);
}

// return btb.predict(dinst, doUpdate, doStats);
uint64_t pc = dinst->getPC();
uint8_t insn_type = dinst->getInst()->isFuncRet() ? 4 /*insn_t::ret*/
Expand All @@ -631,18 +634,25 @@ Outcome BPSuperbp::predict(Dinst *dinst, bool doUpdate, bool doStats) {

bool taken = dinst->isTaken();
uint64_t branchTarget = dinst->getAddr();

if (!FetchPredict) {
superbp_p->fetchBoundaryBegin(dinst->getPC());
}
bool ptaken = superbp_p->handle_insn_desesc(pc, branchTarget, insn_type, taken);
// superbp in sync (must be done for all instructions), prediction made, also ftq updated as per previous resolution info

dinst->setBiasBranch(false); // TODO: SUPERBP does not return the confidence of the branch (assume false)

if (!FetchPredict) {
superbp_p->fetchBoundaryEnd();
}

#if 0
if (pc == 6212110) {
// printf ("***************************************************\n");
// fmt::print("pc:{} taken:{} ptaken:{}\n", pc, taken, ptaken);
// printf ("***************************************************\n");
}
// for jump - may just return btb target
if (dinst->getInst()->isJump()) {
return btb.predict(dinst, doUpdate, doStats);
}
#endif

if (taken != ptaken) {
if (doUpdate) {
Expand Down

0 comments on commit b4c765a

Please sign in to comment.