diff options
Diffstat (limited to 'tests/controller.cc')
-rw-r--r-- | tests/controller.cc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/controller.cc b/tests/controller.cc index a1b8123..e3b9f3c 100644 --- a/tests/controller.cc +++ b/tests/controller.cc @@ -1,6 +1,11 @@ #include "controller.h" #include "cache.h" #include "dram.h" +#include "ex.h" +#include "id.h" +#include "if.h" +#include "mm.h" +#include "wb.h" #include <algorithm> #include <catch2/catch_test_macros.hpp> @@ -10,7 +15,14 @@ class ControllerPipeFixture ControllerPipeFixture() { this->c = new Cache(new Dram(3), 1); - this->ct = new Controller(this->c, true); + + IF *f = new IF(nullptr); + ID *d = new ID(f); + EX *e = new EX(d); + MM *m = new MM(e); + WB *w = new WB(m); + + this->ct = new Controller(w, this->c, true); } ~ControllerPipeFixture() { @@ -31,7 +43,7 @@ TEST_CASE_METHOD( gprs = this->ct->get_gprs(); - CHECK(this->ct->get_clock_cycle() == 0); + CHECK(this->ct->get_clock_cycle() == 1); CHECK(std::all_of( gprs.begin(), gprs.end(), [](int value) { return value == 0; })); // change me later |