diff options
author | Siddarth Suresh <155843085+SiddarthSuresh98@users.noreply.github.com> | 2025-04-17 10:50:58 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-17 10:50:58 -0400 |
commit | 62b9e280d5d0222710e491dcd28fe26bea915dcd (patch) | |
tree | e1f68ac7a6e4dc481c19346e38ad20d113f13825 /tests/id.cc | |
parent | b778ccc3e7c2f2ac3c4892a87f5269f342fd895f (diff) | |
parent | 430986b4b1ee1013db070991ce289176f48fa8e8 (diff) |
Merge pull request #52 from bdunahu/bdunahu
[WIP] Partial fixes for changes in DRAM/Cache, including uncovered bug
Diffstat (limited to 'tests/id.cc')
-rw-r--r-- | tests/id.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/id.cc b/tests/id.cc index 77a7cd9..06eec0c 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); @@ -140,7 +140,7 @@ TEST_CASE_METHOD(IDFixture, "Parse arbitrary i-type # one", "[id]") CHECK(i->get_s1() == 0x00000000); // registers are empty CHECK(i->get_s2() == 0x00000000); CHECK(i->get_s3() == 0xF); - CHECK(i->get_mnemonic() == SFTLI); + CHECK(i->get_mnemonic() == ANDI); delete i; } @@ -152,11 +152,11 @@ 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); - CHECK(i->get_mnemonic() == STORE); + CHECK(i->get_mnemonic() == STOREV); delete i; } @@ -185,7 +185,7 @@ TEST_CASE_METHOD(IDFixture, "Parse arbitrary j-type # two", "[id]") i = this->decode_bits(t); CHECK(i->get_s1() == 0x00000000); // registers are empty - CHECK(i->get_s2() == 0xBBCCF); + CHECK(i->get_s2() == 0xFFFBBCCF); CHECK(i->get_mnemonic() == JAL); delete i; @@ -254,7 +254,7 @@ TEST_CASE_METHOD(IDFixture, "stores indefinite conflicts", "[id]") signed int v, ov; Response r; - v = 0b0; + v = 0b1; ov = v; while (v < 0b110) { this->d->write_guard(v); @@ -269,8 +269,8 @@ TEST_CASE_METHOD(IDFixture, "stores indefinite conflicts", "[id]") CHECK(v == 0b110); REQUIRE(r == STALLED); - v = 0b0; + v = 0b1; r = this->d->read_guard(v); - CHECK(v == 0b0); + CHECK(v == 0b1); REQUIRE(r == STALLED); } |