summaryrefslogtreecommitdiff
path: root/src/sim/wb.cc
diff options
context:
space:
mode:
authorbd <bdunaisky@umass.edu>2025-04-18 00:58:40 +0000
committerGitHub <noreply@github.com>2025-04-18 00:58:40 +0000
commit480181957b3f3dbcf7731023504c2cacc8d181ea (patch)
treee936781b52c6846d87c98381ed47bc7da7c43bff /src/sim/wb.cc
parent62b9e280d5d0222710e491dcd28fe26bea915dcd (diff)
parent984ce6eef2e439955ff991f90c2b654be7c6c3f3 (diff)
Merge pull request #54 from bdunahu/bdunahu
The pipeline says some things and there are numbers
Diffstat (limited to 'src/sim/wb.cc')
-rw-r--r--src/sim/wb.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/sim/wb.cc b/src/sim/wb.cc
index 4e6b2b0..c62468c 100644
--- a/src/sim/wb.cc
+++ b/src/sim/wb.cc
@@ -28,9 +28,17 @@ void WB::write_handler()
throw std::runtime_error("instruction tried to pop a register out of "
"an empty queue during writeback.");
+ if (this->curr_instr->get_mnemonic() == POP) {
+ // POP performs a second register write
+ reg = this->checked_out.front();
+ this->checked_out.pop_front();
+ this->store_register(reg, this->curr_instr->get_s3());
+ }
+
this->checked_out.pop_front();
reg = this->curr_instr->get_checked_out();
this->store_register(reg, this->curr_instr->get_s1());
+
}
void WB::jump_handler()