diff options
author | bd <bdunaisky@umass.edu> | 2025-04-02 04:05:18 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-02 04:05:18 +0000 |
commit | 9fb95d655393777dde5929182f94de36f903821d (patch) | |
tree | 4462f35895737460a01fab891a15f87aba2efb70 /src/sim/controller.cc | |
parent | 24f0bd8af57381ab3112b5774d4ad23ac80f0718 (diff) | |
parent | 3eeb345d673bee6d62b04fc8a8a95ab822dc1e45 (diff) |
Merge pull request #46 from bdunahu/bdunahu
Ensure all stages only do work if they are not 'OK'
Diffstat (limited to 'src/sim/controller.cc')
-rw-r--r-- | src/sim/controller.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/sim/controller.cc b/src/sim/controller.cc index 7e24b3d..65e5676 100644 --- a/src/sim/controller.cc +++ b/src/sim/controller.cc @@ -9,6 +9,7 @@ Controller::Controller(Stage *stage, Storage *storage, bool is_pipelined) this->storage = storage; this->is_pipelined = is_pipelined; this->pc = 0x0; + this->checked_out = {}; this->gprs = {0}; // grant side-door access this->id = SIDE; @@ -18,7 +19,7 @@ void Controller::run_for(int number) { int i; for (i = 0; i < number; ++i) { - this->advance(OK); + this->advance(WAIT); } } @@ -37,9 +38,11 @@ InstrDTO *Controller::advance(Response p) InstrDTO *r; r = this->next->advance(p); ++this->clock_cycle; + return r; } -void Controller::advance_helper() { +void Controller::advance_helper() +{ // TODO: check halt condition and call UI to refresh } |