summaryrefslogtreecommitdiff
path: root/src/sim/controller.cc
diff options
context:
space:
mode:
authorSiddarth Suresh <155843085+SiddarthSuresh98@users.noreply.github.com>2025-03-30 14:02:23 -0400
committerGitHub <noreply@github.com>2025-03-30 14:02:23 -0400
commiteedf9686eb60f2008e7766cc9a5d3e037b9dae64 (patch)
tree0cfa9009fe483b72940727f3b5a4236f779fe6e7 /src/sim/controller.cc
parentd20623d031cf909d8892c2db38cf2e2e02bc6a9b (diff)
parent8e56373a5436852fe9c7934e03d7b57493625003 (diff)
Merge pull request #40 from bdunahu/bdunahu
Minor simplification to API between pipeline components -- Fixed memory leaks
Diffstat (limited to 'src/sim/controller.cc')
-rw-r--r--src/sim/controller.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/sim/controller.cc b/src/sim/controller.cc
index 17937eb..622f1dc 100644
--- a/src/sim/controller.cc
+++ b/src/sim/controller.cc
@@ -16,10 +16,9 @@ Controller::Controller(Stage *stage, Storage *storage, bool is_pipelined)
void Controller::run_for(int number)
{
- InstrDTO instr;
int i;
for (i = 0; i < number; ++i) {
- this->advance(instr, OK);
+ this->advance(OK);
}
}
@@ -29,11 +28,11 @@ std::array<int, GPR_NUM> Controller::get_gprs() { return this->gprs; }
int Controller::get_pc() { return this->pc; }
-Response Controller::advance(InstrDTO &next_instr, Response p)
+InstrDTO *Controller::advance(Response p)
{
- Response r;
+ InstrDTO *r;
- r = this->next->advance(next_instr, p);
+ r = this->next->advance(p);
++this->clock_cycle;
return r;
}