diff options
author | bd <bdunahu@operationnull.com> | 2025-03-11 17:24:49 -0400 |
---|---|---|
committer | bd <bdunahu@operationnull.com> | 2025-03-11 17:24:49 -0400 |
commit | 256fd73b42ae7d10fe0190984d032f839a2127bd (patch) | |
tree | 99ffd87c42c7179561877254431cb78fca02a5f3 /src | |
parent | d743af4b5df01e3a75725912bee1d00b8fe573dd (diff) |
clarify macro names, implement load in CLI, fix many display issues
Diffstat (limited to 'src')
-rw-r--r-- | src/cli/cli.cc | 8 | ||||
-rw-r--r-- | src/storage/cache.cc | 2 | ||||
-rw-r--r-- | src/utils/utils.cc | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/src/cli/cli.cc b/src/cli/cli.cc index d90edef..8dc7e2e 100644 --- a/src/cli/cli.cc +++ b/src/cli/cli.cc @@ -104,10 +104,10 @@ void Cli::load(Accessor accessor, int address) const auto default_fill = std::cout.fill(); signed int data; - // Response r = this->cache->read_word(accessor, address, data); - // std::cout << r << " to " << accessor << " reading " << address << std::endl; - // if (r == OK) - // std::cout << "\tGot:" << std::hex << data; + Response r = this->cache->read_word(accessor, address, data); + std::cout << r << " to " << accessor << " reading " << address << std::endl; + if (r == OK) + std::cout << " Got:" << std::hex << data << std::endl; std::cout.flags(default_flags); std::cout.fill(default_fill); diff --git a/src/storage/cache.cc b/src/storage/cache.cc index a73390b..14a6e61 100644 --- a/src/storage/cache.cc +++ b/src/storage/cache.cc @@ -135,7 +135,7 @@ void Cache::fetch_resource(int expected) r = this->lower->write_line( L1CACHE, actual, ((index << LINE_SPEC) + - (meta->at(0) << (L1_CACHE_SPEC + LINE_SPEC)))); + (meta->at(0) << (L1_CACHE_LINE_SPEC + LINE_SPEC)))); if (r == OK) { meta->at(1) = -1; } diff --git a/src/utils/utils.cc b/src/utils/utils.cc index b5a4d55..87ce488 100644 --- a/src/utils/utils.cc +++ b/src/utils/utils.cc @@ -31,7 +31,7 @@ const std::string string_format(const char *const zcFormat, ...) int wrap_address(int address) { if (address < 0){ - return ((address % MEM_SIZE) + MEM_SIZE) % MEM_SIZE; + return ((address % MEM_LINES) + MEM_LINES) % MEM_LINES; } - return address % MEM_SIZE; + return address % MEM_LINES; } |