summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-03-30 14:35:27 -0400
committerbd <bdunahu@operationnull.com>2025-03-30 14:35:27 -0400
commit36dabe6183af98b2e3f6d0316436dc3affc3d986 (patch)
tree76515ad651b844e48d7bfafe5cb67d724ab7fb25
parent8c46ba4f216aec9f512cd398317f891be9b07e84 (diff)
Free everything I allocated :)
-rw-r--r--src/sim/dum.cc12
-rw-r--r--tests/id.cc10
2 files changed, 11 insertions, 11 deletions
diff --git a/src/sim/dum.cc b/src/sim/dum.cc
index f14c89a..dd16660 100644
--- a/src/sim/dum.cc
+++ b/src/sim/dum.cc
@@ -5,8 +5,6 @@
#include "stage.h"
#include "utils.h"
-static Logger *global_log = Logger::getInstance();
-
DUM::DUM(Stage *stage) : Stage(stage) { this->id = IDLE; }
InstrDTO *DUM::advance(Response p)
@@ -24,15 +22,7 @@ InstrDTO *DUM::advance(Response p)
return r;
}
-void DUM::advance_helper()
-{
- if (this->curr_instr)
- global_log->log(
- DEBUG, string_format(
- "Using bits: %i ", this->curr_instr->get_instr_bits()));
- else
- global_log->log(DEBUG, "curr_instr is null");
-}
+void DUM::advance_helper() {}
void DUM::set_curr_instr(InstrDTO *d)
{
diff --git a/tests/id.cc b/tests/id.cc
index 6d6a155..be50ed5 100644
--- a/tests/id.cc
+++ b/tests/id.cc
@@ -125,6 +125,8 @@ TEST_CASE_METHOD(IDFixture, "Parse arbitrary r-type # two", "[id]")
CHECK(i->get_s2() == 0x00000000);
CHECK(i->get_s3() == 0x00000000);
CHECK(i->get_mnemonic() == SUB);
+
+ delete i;
}
TEST_CASE_METHOD(IDFixture, "Parse arbitrary i-type # one", "[id]")
@@ -144,6 +146,8 @@ TEST_CASE_METHOD(IDFixture, "Parse arbitrary i-type # one", "[id]")
CHECK(i->get_s2() == 0x00000000);
CHECK(i->get_s3() == 0xF);
CHECK(i->get_mnemonic() == SFTLI);
+
+ delete i;
}
TEST_CASE_METHOD(IDFixture, "Parse arbitrary i-type # two", "[id]")
@@ -163,6 +167,8 @@ TEST_CASE_METHOD(IDFixture, "Parse arbitrary i-type # two", "[id]")
CHECK(i->get_s2() == 0x00000000);
CHECK(i->get_s3() == 0xCC);
CHECK(i->get_mnemonic() == STORE);
+
+ delete i;
}
TEST_CASE_METHOD(IDFixture, "Parse arbitrary j-type # one", "[id]")
@@ -181,6 +187,8 @@ TEST_CASE_METHOD(IDFixture, "Parse arbitrary j-type # one", "[id]")
CHECK(i->get_s1() == 0x00000000); // registers are empty
CHECK(i->get_s2() == 0x3456);
CHECK(i->get_mnemonic() == BOF);
+
+ delete i;
}
TEST_CASE_METHOD(IDFixture, "Parse arbitrary j-type # two", "[id]")
@@ -199,6 +207,8 @@ TEST_CASE_METHOD(IDFixture, "Parse arbitrary j-type # two", "[id]")
CHECK(i->get_s1() == 0x00000000); // registers are empty
CHECK(i->get_s2() == 0xBBCCF);
CHECK(i->get_mnemonic() == JAL);
+
+ delete i;
}
TEST_CASE_METHOD(IDFixture, "read does not conflict with read", "[id]")