summaryrefslogtreecommitdiff
path: root/src/sim/mm.cc
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-04-17 20:52:55 -0400
committerbd <bdunahu@operationnull.com>2025-04-17 20:52:55 -0400
commit496a08fbfafb8399c9addaf2501262fee228ffd6 (patch)
tree3e87aed03b50673c8e8c53dba98a45f32f979f48 /src/sim/mm.cc
parent025cdd8e174fcf1a229355ecaf63861ac388fa63 (diff)
parent984ce6eef2e439955ff991f90c2b654be7c6c3f3 (diff)
Merge remote-tracking branch 'origin/bdunahu' into dev-sid
Diffstat (limited to 'src/sim/mm.cc')
-rw-r--r--src/sim/mm.cc11
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;
}