diff options
author | bd <bdunahu@operationnull.com> | 2025-04-17 16:28:36 -0400 |
---|---|---|
committer | bd <bdunahu@operationnull.com> | 2025-04-17 16:28:36 -0400 |
commit | f6f2f32b6dbd1b1e60052cb67f40864c3b5bd74b (patch) | |
tree | 12a68837106fbabd3ee1f9553a7ee4da7031b3d2 /src | |
parent | 2c94ea91b1c5a0d7c0ebb0ab229950f7c849909a (diff) |
Functioning PUSH/POP
Diffstat (limited to 'src')
-rw-r--r-- | src/sim/ex.cc | 2 | ||||
-rw-r--r-- | src/sim/id.cc | 2 | ||||
-rw-r--r-- | src/sim/wb.cc | 9 |
3 files changed, 5 insertions, 8 deletions
diff --git a/src/sim/ex.cc b/src/sim/ex.cc index c676781..a32105f 100644 --- a/src/sim/ex.cc +++ b/src/sim/ex.cc @@ -340,9 +340,7 @@ EX::EX(Stage *stage) : Stage(stage) INIT_INSTRUCTION( PUSH, { - std::cout << "adding " << s1 << " and " << s3; s1 = s1 + s3; - std::cout << " for " << s1 << std::endl; (void)pc; (void)s2; (void)this; diff --git a/src/sim/id.cc b/src/sim/id.cc index de412d4..d10d695 100644 --- a/src/sim/id.cc +++ b/src/sim/id.cc @@ -198,8 +198,6 @@ void ID::decode_J_type( this->status = this->read_guard(*&s1); } - std::cout << m << ":" << this->status << std::endl; - } std::vector<int> ID::stage_info() diff --git a/src/sim/wb.cc b/src/sim/wb.cc index 08e5ed3..c62468c 100644 --- a/src/sim/wb.cc +++ b/src/sim/wb.cc @@ -28,16 +28,17 @@ void WB::write_handler() throw std::runtime_error("instruction tried to pop a register out of " "an empty queue during writeback."); - this->checked_out.pop_front(); - reg = this->curr_instr->get_checked_out(); - this->store_register(reg, this->curr_instr->get_s1()); - 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() |