Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .jenkins/build_test_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ run () {
cat run
echo ""
compare_outputs "$(grep "retired:" run | rev | cut -d ' ' -f1 | rev)" "6724" "retired instructions"
compare_outputs "$(grep "cycles:" run | rev | cut -d ' ' -f1 | rev)" "8677" "simulated cycles"
compare_outputs "$(grep "cycles:" run | rev | cut -d ' ' -f1 | rev)" "8612" "simulated cycles"
echo ""
}

Expand Down
2 changes: 1 addition & 1 deletion src/include/simeng/Instruction.hh
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class Instruction {
// Flag as mispredicted if taken state was wrongly predicted, or taken and
// predicted target is wrong
return (branchTaken_ != prediction_.taken ||
(prediction_.target != branchAddress_));
(branchTaken_ && (prediction_.target != branchAddress_)));
}

/** Check whether an exception has been encountered while processing this
Expand Down
13 changes: 11 additions & 2 deletions src/lib/pipeline/FetchUnit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,17 @@ void FetchUnit::tick() {
}
} else if (loopBufferState_ == LoopBufferState::WAITING &&
pc_ == loopBoundaryAddress_) {
// Once set loopBoundaryAddress_ is fetched, start to fill loop buffer
loopBufferState_ = LoopBufferState::FILLING;
// loopBoundaryAddress_ has been fetched whilst loop buffer is waiting,
// start filling Loop Buffer if the branch predictor tells us to
// reenter the detected loop
if (macroOp[0]->isBranch() && !macroOp[0]->getBranchPrediction().taken) {
// If branch is not taken then we aren't re-entering the detected
// loop, therefore Loop Buffer stays idle
loopBufferState_ = LoopBufferState::IDLE;
} else {
// Otherwise, start to fill Loop Buffer
loopBufferState_ = LoopBufferState::FILLING;
}
}

assert(bytesRead <= bufferedBytes_ &&
Expand Down