summaryrefslogtreecommitdiff
path: root/src/storage
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-03-10 19:42:01 -0400
committerbd <bdunahu@operationnull.com>2025-03-10 19:42:01 -0400
commit3f07846136767cbed13fd83baaba416f19c61667 (patch)
tree140af0aec8ee90ac4c15e8b877ff2dc88f33d7ae /src/storage
parent141494cb961b72a7ad56c3e754af43a07f1b8c23 (diff)
CLI view, clock, store, program banner
Diffstat (limited to 'src/storage')
-rw-r--r--src/storage/cache.cc14
-rw-r--r--src/storage/storage.cc2
2 files changed, 8 insertions, 8 deletions
diff --git a/src/storage/cache.cc b/src/storage/cache.cc
index 45ef0ab..d382c3d 100644
--- a/src/storage/cache.cc
+++ b/src/storage/cache.cc
@@ -100,13 +100,11 @@ std::ostream &operator<<(std::ostream &os, const Cache &c)
c.view(0, L1_CACHE_SIZE);
std::array<std::array<int, 2>, L1_CACHE_SIZE> meta = c.get_meta();
- os << std::setfill(' ') << std::setw(L1_CACHE_SPEC + 1) << " ADDRESS |"
- << std::setfill(' ') << std::setw(11) << "0" << std::setfill(' ')
- << std::setw(11) << "1" << std::setfill(' ') << std::setw(11) << "2"
- << std::setfill(' ') << std::setw(11) << "3"
- << " |" << std::setfill(' ')
- << std::setw(MEM_SPEC - LINE_SPEC - L1_CACHE_SPEC + 4) << "TAG "
- << "| D \n";
+ os << " " << std::setfill(' ') << std::setw(L1_CACHE_SPEC + 2) << "INDEX"
+ << " | " << std::setfill(' ') << std::setw((8 + 3) * 4 - 1) << "DATA"
+ << " | " << std::setfill(' ')
+ << std::setw(MEM_SPEC - LINE_SPEC - L1_CACHE_SPEC + 2) << "TAG"
+ << " | D\n";
for (int i = 0; i < L1_CACHE_SIZE; ++i) {
os << " 0b" << std::setw(L1_CACHE_SPEC) << std::bitset<L1_CACHE_SPEC>(i)
<< " | ";
@@ -116,7 +114,7 @@ std::ostream &operator<<(std::ostream &os, const Cache &c)
}
os << "| 0x" << std::setfill(' ')
<< std::bitset<MEM_SPEC - LINE_SPEC - L1_CACHE_SPEC>(meta.at(i)[0])
- << " | " << (int)(meta.at(i)[0] < 0) << '\n';
+ << " | " << (int)(meta.at(i)[0] >= 0) << '\n';
}
std::cout.flags(default_flags);
diff --git a/src/storage/storage.cc b/src/storage/storage.cc
index 62f3699..8e2e461 100644
--- a/src/storage/storage.cc
+++ b/src/storage/storage.cc
@@ -17,6 +17,8 @@ Storage *Storage::get_lower() { return this->lower; }
void Storage::resolve()
{
+ if (this->lower)
+ this->lower->resolve();
if (this->wait_time == 0) {
this->requester = IDLE;
this->wait_time = delay;