Skip to content

Commit

Permalink
Fix notification trigger logic
Browse files Browse the repository at this point in the history
  • Loading branch information
h0lyalg0rithm committed Nov 9, 2023
1 parent 2995d15 commit 3859246
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
16 changes: 8 additions & 8 deletions core/CPUTopology.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ olympia::CoreTopologySimple::CoreTopologySimple(){
0,
&factories->execute_rf
},
{
"rob",
"cpu.core*",
"ROB Unit",
sparta::TreeNode::GROUP_NAME_NONE,
sparta::TreeNode::GROUP_IDX_NONE,
&factories->rob_rf
},
{
"dcache",
"cpu.core*",
Expand Down Expand Up @@ -117,14 +125,6 @@ olympia::CoreTopologySimple::CoreTopologySimple(){
sparta::TreeNode::GROUP_IDX_NONE,
&factories->mss_rf
},
{
"rob",
"cpu.core*",
"ROB Unit",
sparta::TreeNode::GROUP_NAME_NONE,
sparta::TreeNode::GROUP_IDX_NONE,
&factories->rob_rf
},
{
"preloader",
"cpu.core*",
Expand Down
8 changes: 7 additions & 1 deletion core/ROB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ namespace olympia
// Will be true if the user provides a -i option
if (SPARTA_EXPECT_FALSE((num_retired_ == num_insts_to_retire_))) {
rob_stopped_simulation_ = true;
if(reorder_buffer_.empty()) {
rob_drained_notif_source_->postNotification(true);
}
getScheduler()->stopRunning();
break;
}
Expand Down Expand Up @@ -204,10 +207,13 @@ namespace olympia

void ROB::onStartingTeardown_() {
if ((reorder_buffer_.size() > 0) && (false == rob_stopped_simulation_)) {
rob_drained_notif_source_->postNotification(true);
std::cerr << "WARNING! Simulation is ending, but the ROB didn't stop it. Lock up situation?" << std::endl;
dumpDebugContent_(std::cerr);
}

if(reorder_buffer_.empty()) {
rob_drained_notif_source_->postNotification(true);
}
}

}

0 comments on commit 3859246

Please sign in to comment.