diff options
author | bd <bdunahu@operationnull.com> | 2025-04-17 15:30:26 -0400 |
---|---|---|
committer | bd <bdunahu@operationnull.com> | 2025-04-17 15:30:26 -0400 |
commit | 2c94ea91b1c5a0d7c0ebb0ab229950f7c849909a (patch) | |
tree | c1fe016db8127633f9d14aac696ef9040967228d /src/sim/mm.cc | |
parent | 430986b4b1ee1013db070991ce289176f48fa8e8 (diff) |
The pipeline says some things and there are numbers
Diffstat (limited to 'src/sim/mm.cc')
-rw-r--r-- | src/sim/mm.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/sim/mm.cc b/src/sim/mm.cc index a9a60c2..a02ca83 100644 --- a/src/sim/mm.cc +++ b/src/sim/mm.cc @@ -21,8 +21,8 @@ void MM::advance_helper() this->status = STALLED; break; + case PUSH: case STORE: - // TODO signed issues, we aren't wrapping addresses i = this->storage->write_word( this, this->curr_instr->get_s2(), this->curr_instr->get_s1()); this->status = i ? OK : STALLED; @@ -31,6 +31,15 @@ void MM::advance_helper() } break; + case POP: + i = this->storage->read_word(this, this->curr_instr->get_s3(), data); + this->status = i ? OK : STALLED; + if (this->status == OK) { + this->curr_instr->set_s3(data); + } else + this->status = STALLED; + break; + default: this->status = OK; } |