summaryrefslogtreecommitdiff
path: root/src/sim/stage.cc
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-03-29 17:11:17 -0400
committerbd <bdunahu@operationnull.com>2025-03-29 17:11:17 -0400
commitd21a1a9caa1f1791343a5376121936e552b1124c (patch)
treedf28c01f6d01603e5408bc1b1b111a66adafbff7 /src/sim/stage.cc
parentac0ae7206491a42cdba70560b0db41cfc8c7f642 (diff)
Fetch stage properly holds objects until parent is ready
Diffstat (limited to 'src/sim/stage.cc')
-rw-r--r--src/sim/stage.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/sim/stage.cc b/src/sim/stage.cc
index 8d9dfc0..48ee494 100644
--- a/src/sim/stage.cc
+++ b/src/sim/stage.cc
@@ -5,7 +5,14 @@
static Logger *global_log = Logger::getInstance();
-Stage::Stage(Stage *next) { this->next = next; }
+Stage::Stage(Stage *next)
+{
+ this->next = next;
+ this->curr_instr = nullptr;
+ this->status = OK;
+}
+
+Stage::~Stage() { delete this->next; };
std::array<int, GPR_NUM> Stage::gprs;
std::array<int, V_NUM> Stage::vrs;
@@ -19,7 +26,7 @@ Response Stage::check_out(unsigned int &v)
{
Response r;
if (this->is_checked_out(v))
- r = STALLED;
+ r = BLOCKED;
else {
r = OK;
v = this->check_out_register(v);