diff options
author | bd <bdunahu@operationnull.com> | 2025-03-30 22:00:28 -0400 |
---|---|---|
committer | bd <bdunahu@operationnull.com> | 2025-03-30 22:00:28 -0400 |
commit | 723d582d1108975caf071a76c1556a01fb0553d1 (patch) | |
tree | 331984395d884650278f680fc15390824d90c4af /src | |
parent | 6a15f66bef28de9e1b982c3adda4d9b75c818852 (diff) |
Sanity check for pipeline up to exe
Diffstat (limited to 'src')
-rw-r--r-- | src/sim/if.cc | 2 | ||||
-rw-r--r-- | src/sim/stage.cc | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/sim/if.cc b/src/sim/if.cc index 77a2704..fa8f6c2 100644 --- a/src/sim/if.cc +++ b/src/sim/if.cc @@ -11,7 +11,7 @@ InstrDTO *IF::advance(Response p) InstrDTO *r = nullptr; this->advance_helper(); - if (this->status == OK && p == OK) { + if (this->curr_instr != nullptr && p == OK) { // mutual consent ++this->pc; this->curr_instr->set_time_of(this->id, this->clock_cycle); diff --git a/src/sim/stage.cc b/src/sim/stage.cc index 2c03741..5b81e4c 100644 --- a/src/sim/stage.cc +++ b/src/sim/stage.cc @@ -7,7 +7,7 @@ Stage::Stage(Stage *next) { this->next = next; this->curr_instr = nullptr; - this->status = STALLED; + this->status = OK; this->checked_out = {}; } @@ -35,7 +35,7 @@ InstrDTO *Stage::advance(Response p) Response n; this->advance_helper(); - if (this->status == OK && p == OK) { + if (this->curr_instr != nullptr && p == OK) { // mutual consent this->curr_instr->set_time_of(this->id, this->clock_cycle); r = new InstrDTO(*this->curr_instr); |