summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/c11.h4
-rw-r--r--tests/cache_1_1.cc14
-rw-r--r--tests/cache_2_1.cc12
-rw-r--r--tests/dram.cc30
4 files changed, 30 insertions, 30 deletions
diff --git a/tests/c11.h b/tests/c11.h
index 983d298..57a8ee1 100644
--- a/tests/c11.h
+++ b/tests/c11.h
@@ -23,7 +23,7 @@ class C11
this->fetch = new int();
this->c = new Cache(new Dram(this->m_delay), 5, 0, this->c_delay);
this->expected = {0, 0, 0, 0};
- this->actual = this->c->view(0, 1)[0];
+ this->actual = this->c->get_data()[0];
}
~C11()
@@ -42,7 +42,7 @@ class C11
// check response
CHECK(!r);
// check for early modifications
- actual = c->view(0, 1)[0];
+ actual = c->get_data()[0];
REQUIRE(this->expected == this->actual);
}
}
diff --git a/tests/cache_1_1.cc b/tests/cache_1_1.cc
index 7d16f76..3cc83a0 100644
--- a/tests/cache_1_1.cc
+++ b/tests/cache_1_1.cc
@@ -20,7 +20,7 @@ TEST_CASE_METHOD(C11, "store 0th element in DELAY cycles", "[dram]")
CHECK(r);
expected.at(0) = w;
- actual = c->view(0, 1)[0];
+ actual = c->get_data()[0];
REQUIRE(expected == actual);
}
@@ -40,7 +40,7 @@ TEST_CASE_METHOD(C11, "store 0th, 1st element in DELAY cycles, with conflict", "
CHECK(!r);
// check for early modifications
- actual = c->view(0, 1)[0];
+ actual = c->get_data()[0];
REQUIRE(this->expected == this->actual);
}
@@ -48,7 +48,7 @@ TEST_CASE_METHOD(C11, "store 0th, 1st element in DELAY cycles, with conflict", "
CHECK(r);
expected.at(0) = w;
- actual = c->view(0, 1)[0];
+ actual = c->get_data()[0];
REQUIRE(expected == actual);
// this should have been loaded already!
@@ -59,7 +59,7 @@ TEST_CASE_METHOD(C11, "store 0th, 1st element in DELAY cycles, with conflict", "
CHECK(r);
expected.at(1) = w;
- actual = c->view(0, 1)[0];
+ actual = c->get_data()[0];
REQUIRE(expected == actual);
}
@@ -81,7 +81,7 @@ TEST_CASE_METHOD(
CHECK(r);
expected.at(0) = w;
- actual = c->view(0, 1)[0];
+ actual = c->get_data()[0];
REQUIRE(expected == actual);
// write back to memory
@@ -95,7 +95,7 @@ TEST_CASE_METHOD(
CHECK(r);
expected.at(0) = 0;
- actual = c->view(0, 1)[0];
+ actual = c->get_data()[0];
CHECK(expected == actual);
this->wait_then_do(
@@ -106,6 +106,6 @@ TEST_CASE_METHOD(
expected.at(0) = 0;
expected.at(1) = w;
- actual = c->view(0, 1)[0];
+ actual = c->get_data()[0];
REQUIRE(expected == actual);
}
diff --git a/tests/cache_2_1.cc b/tests/cache_2_1.cc
index cb48d2a..191d5f2 100644
--- a/tests/cache_2_1.cc
+++ b/tests/cache_2_1.cc
@@ -43,12 +43,12 @@ TEST_CASE_METHOD(C21, "store 32th, 96th element in DELAY cycles, evict to level
// check level 2
// note this is write-back == no write
- actual = this->c2->view(32, 1)[0];
+ actual = this->c2->get_data()[32];
REQUIRE(expected == actual);
// check level 1
expected.at(0) = w;
- actual = this->c->view(0, 1)[0];
+ actual = this->c->get_data()[0];
REQUIRE(expected == actual);
// wait = evict
@@ -57,7 +57,7 @@ TEST_CASE_METHOD(C21, "store 32th, 96th element in DELAY cycles, evict to level
});
// check level 2
- actual = this->c2->view(32, 1)[0];
+ actual = this->c2->get_data()[32];
REQUIRE(expected == actual);
// read in line
@@ -75,13 +75,13 @@ TEST_CASE_METHOD(C21, "store 32th, 96th element in DELAY cycles, evict to level
CHECK(r);
// check level 2
- actual = this->c2->view(96, 1)[0];
+ actual = this->c2->get_data()[96];
REQUIRE(expected == actual);
expected.at(0) = w;
- actual = this->c2->view(32, 1)[0];
+ actual = this->c2->get_data()[32];
REQUIRE(expected == actual);
// check level 1
- actual = this->c->view(0, 1)[0];
+ actual = this->c->get_data()[0];
REQUIRE(expected == actual);
}
diff --git a/tests/dram.cc b/tests/dram.cc
index 06a7720..5eb0316 100644
--- a/tests/dram.cc
+++ b/tests/dram.cc
@@ -12,7 +12,7 @@ class D
this->mem = new int;
this->fetch = new int;
this->expected = {0, 0, 0, 0};
- this->actual = this->d->view(0, 1)[0];
+ this->actual = this->d->get_data()[0];
}
~D()
@@ -31,7 +31,7 @@ class D
// check response
CHECK(!r);
// check for early modifications
- actual = d->view(0, 1)[0];
+ actual = d->get_data()[0];
REQUIRE(this->expected == this->actual);
}
}
@@ -58,7 +58,7 @@ TEST_CASE_METHOD(D, "store 0th element in DELAY cycles", "[dram]")
CHECK(r);
expected.at(0) = w;
- actual = this->d->view(0, 1)[0];
+ actual = this->d->get_data()[0];
REQUIRE(expected == actual);
}
@@ -76,7 +76,7 @@ TEST_CASE_METHOD(D, "store 0th, 1st element in DELAY cycles, no conflict", "[dra
REQUIRE(r);
expected.at(0) = w;
- actual = d->view(0, 1)[0];
+ actual = d->get_data()[0];
REQUIRE(expected == actual);
this->wait_for_storage(
@@ -85,7 +85,7 @@ TEST_CASE_METHOD(D, "store 0th, 1st element in DELAY cycles, no conflict", "[dra
r = d->write_word(this->fetch, w, 0x1);
CHECK(r);
- actual = d->view(0, 1)[0];
+ actual = d->get_data()[0];
expected.at(1) = w;
REQUIRE(expected == actual);
}
@@ -104,7 +104,7 @@ TEST_CASE_METHOD(D, "store 0th element in DELAY cycles with conflict", "[dram]")
CHECK(!r);
// check for early modifications
- actual = d->view(0, 1)[0];
+ actual = d->get_data()[0];
REQUIRE(expected == actual);
}
@@ -112,7 +112,7 @@ TEST_CASE_METHOD(D, "store 0th element in DELAY cycles with conflict", "[dram]")
REQUIRE(r);
expected.at(0) = w;
- actual = d->view(0, 1)[0];
+ actual = d->get_data()[0];
REQUIRE(expected == actual);
this->wait_for_storage(
@@ -121,7 +121,7 @@ TEST_CASE_METHOD(D, "store 0th element in DELAY cycles with conflict", "[dram]")
r = d->write_word(this->fetch, w, 0x1);
CHECK(r);
- actual = d->view(0, 1)[0];
+ actual = d->get_data()[0];
expected.at(1) = w;
REQUIRE(expected == actual);
}
@@ -141,7 +141,7 @@ TEST_CASE_METHOD(D, "store line in DELAY cycles", "[dram]")
r = d->write_line(this->mem, buffer, 0x0);
CHECK(r);
- actual = d->view(0, 1)[0];
+ actual = d->get_data()[0];
expected = buffer;
REQUIRE(expected == actual);
}
@@ -162,7 +162,7 @@ TEST_CASE_METHOD(D, "store line in DELAY cycles no conflict", "[dram]")
REQUIRE(r);
expected = buffer;
- actual = d->view(0, 1)[0];
+ actual = d->get_data()[0];
REQUIRE(expected == actual);
buffer = {w + 4, w + 5, w + 6, w + 7};
@@ -173,7 +173,7 @@ TEST_CASE_METHOD(D, "store line in DELAY cycles no conflict", "[dram]")
CHECK(r);
expected = buffer;
- actual = d->view(0, 1)[0];
+ actual = d->get_data()[0];
REQUIRE(expected == actual);
}
@@ -193,14 +193,14 @@ TEST_CASE_METHOD(D, "store line in DELAY cycles with conflict", "[dram]")
CHECK(!r);
// check for early modifications
- actual = d->view(0, 1)[0];
+ actual = d->get_data()[0];
REQUIRE(expected == actual);
}
r = d->write_line(this->mem, buffer, 0x0);
CHECK(r);
- actual = d->view(0, 1)[0];
+ actual = d->get_data()[0];
expected = buffer;
REQUIRE(expected == actual);
@@ -212,7 +212,7 @@ TEST_CASE_METHOD(D, "store line in DELAY cycles with conflict", "[dram]")
CHECK(r);
expected = buffer;
- actual = d->view(0, 1)[0];
+ actual = d->get_data()[0];
REQUIRE(expected == actual);
}
@@ -299,7 +299,7 @@ TEST_CASE_METHOD(
r = d->write_line(this->mem, expected, addr);
CHECK(r);
- actual = d->view(0, 1)[0];
+ actual = d->get_data()[0];
REQUIRE(expected == actual);
for (i = 0; i < LINE_SIZE; ++i) {