summaryrefslogtreecommitdiff
path: root/src/sim/controller.cc
diff options
context:
space:
mode:
authorSiddarth Suresh <155843085+SiddarthSuresh98@users.noreply.github.com>2025-03-29 22:14:42 -0400
committerGitHub <noreply@github.com>2025-03-29 22:14:42 -0400
commitd20623d031cf909d8892c2db38cf2e2e02bc6a9b (patch)
tree56ef4ae4325a5b803c484a3e5c8d87b89572cedf /src/sim/controller.cc
parentcaeff52f029920e027d18bc01149425560801f82 (diff)
parent1250c3765f59801d060152d5f6eed0a9faa11b50 (diff)
Merge pull request #37 from bdunahu/bdunahu
Instr, InstrDTO gets/sets, other structures required for decode -- tests as we move forward -- base classes -- decode stage implemented
Diffstat (limited to 'src/sim/controller.cc')
-rw-r--r--src/sim/controller.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/sim/controller.cc b/src/sim/controller.cc
index 6d46dc4..17937eb 100644
--- a/src/sim/controller.cc
+++ b/src/sim/controller.cc
@@ -10,6 +10,8 @@ Controller::Controller(Stage *stage, Storage *storage, bool is_pipelined)
this->is_pipelined = is_pipelined;
this->pc = 0x0;
this->gprs = {0};
+ // grant side-door access
+ this->id = SIDE;
}
void Controller::run_for(int number)
@@ -17,7 +19,7 @@ void Controller::run_for(int number)
InstrDTO instr;
int i;
for (i = 0; i < number; ++i) {
- this->advance(instr);
+ this->advance(instr, OK);
}
}
@@ -27,11 +29,11 @@ std::array<int, GPR_NUM> Controller::get_gprs() { return this->gprs; }
int Controller::get_pc() { return this->pc; }
-Response Controller::advance(InstrDTO &i)
+Response Controller::advance(InstrDTO &next_instr, Response p)
{
Response r;
-
- r = this->next->advance(i);
+
+ r = this->next->advance(next_instr, p);
++this->clock_cycle;
return r;
}