From 23d3ebb2702e6b08c7f6b997067e1bc76483b813 Mon Sep 17 00:00:00 2001 From: bd Date: Wed, 16 Apr 2025 22:22:09 -0400 Subject: Partial fixes for changes in DRAM/Cache, including uncovered bug --- tests/controller.cc | 2 +- tests/ex.cc | 2 +- tests/id.cc | 4 ++-- tests/if.cc | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/controller.cc b/tests/controller.cc index a009a70..74284b7 100644 --- a/tests/controller.cc +++ b/tests/controller.cc @@ -16,7 +16,7 @@ class ControllerPipeFixture ControllerPipeFixture() { this->d = new Dram(1); - this->c = new Cache(this->d, 0); + this->c = new Cache(this->d, 5, 0, 0); IF *f = new IF(nullptr); ID *d = new ID(f); diff --git a/tests/ex.cc b/tests/ex.cc index 13437f7..a493a21 100644 --- a/tests/ex.cc +++ b/tests/ex.cc @@ -13,7 +13,7 @@ class EXFixture EXFixture() { this->dr = new Dram(3); - this->c = new Cache(this->dr, 1); + this->c = new Cache(this->dr, 5, 0, 1); this->dum = new DUM(nullptr); this->e = new EX(dum); this->ct = new Controller(this->e, this->c, true); diff --git a/tests/id.cc b/tests/id.cc index 77a7cd9..b8d0479 100644 --- a/tests/id.cc +++ b/tests/id.cc @@ -13,7 +13,7 @@ class IDFixture IDFixture() { this->dr = new Dram(3); - this->c = new Cache(this->dr, 1); + this->c = new Cache(this->dr, 5, 0, 1); this->dum = new DUM(nullptr); this->d = new ID(dum); this->ct = new Controller(this->d, this->c, true); @@ -152,7 +152,7 @@ TEST_CASE_METHOD(IDFixture, "Parse arbitrary i-type # two", "[id]") t = this->encode_I_type(0xCC, 0b010, 0b101, 0b1011, 0b1); i = this->decode_bits(t); - + CHECK(i->get_s1() == 0x00000000); // registers are empty CHECK(i->get_s2() == 0x00000000); CHECK(i->get_s3() == 0xCC); diff --git a/tests/if.cc b/tests/if.cc index d6c1bca..5ccd73b 100644 --- a/tests/if.cc +++ b/tests/if.cc @@ -17,7 +17,7 @@ class IFFixture p = {0xC000, 0xC001, 0xC002, 0xC003}; d->load(p); - this->c = new Cache(d, this->c_delay); + this->c = new Cache(d, 5, 0, this->c_delay); this->f = new IF(nullptr); this->ct = new Controller(this->f, this->c, true); } -- cgit v1.2.3