From 3f07846136767cbed13fd83baaba416f19c61667 Mon Sep 17 00:00:00 2001 From: bd Date: Mon, 10 Mar 2025 19:42:01 -0400 Subject: CLI view, clock, store, program banner --- src/storage/cache.cc | 14 ++++++-------- src/storage/storage.cc | 2 ++ 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/storage') 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, 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(i) << " | "; @@ -116,7 +114,7 @@ std::ostream &operator<<(std::ostream &os, const Cache &c) } os << "| 0x" << std::setfill(' ') << std::bitset(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; -- cgit v1.2.3