summaryrefslogtreecommitdiff
path: root/src/cli/cli.cc
diff options
context:
space:
mode:
authorSiddarth Suresh <155843085+SiddarthSuresh98@users.noreply.github.com>2025-03-11 20:34:40 -0400
committerGitHub <noreply@github.com>2025-03-11 20:34:40 -0400
commit89b9d1e4592d11cd6146b1bc3b3c12e241e574d3 (patch)
tree30947c7018653ca18d4a69de20936b3615768f9e /src/cli/cli.cc
parentf208e63ce553c6144a672cd35da23425fa7f86d1 (diff)
parent7c828204a091330eca7dd6495f02f54c2c0a3091 (diff)
Merge pull request #26 from bdunahu/bdunahu
clarify macro names, implement load in CLI, fix many display issues
Diffstat (limited to 'src/cli/cli.cc')
-rw-r--r--src/cli/cli.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/cli/cli.cc b/src/cli/cli.cc
index a885aee..41ac57c 100644
--- a/src/cli/cli.cc
+++ b/src/cli/cli.cc
@@ -100,14 +100,15 @@ void Cli::help()
void Cli::load(Accessor accessor, int address)
{
+ address = wrap_address(address);
const auto default_flags = std::cout.flags();
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);
@@ -115,8 +116,9 @@ void Cli::load(Accessor accessor, int address)
void Cli::store(Accessor accessor, int data, int address)
{
+ address = wrap_address(address);
Response r = this->cache->write_word(accessor, data, address);
- std::cout << r << " to " << accessor << " storing " << data << " in"
+ std::cout << r << " to " << accessor << " storing " << data << " in "
<< address << std::endl;
}
@@ -209,7 +211,7 @@ void Cli::initialize()
if (this->cache != nullptr)
delete this->cache;
- Dram *d = new Dram(MEM_SIZE, MEM_DELAY);
+ Dram *d = new Dram(MEM_LINES, MEM_DELAY);
this->cache = new Cache(d, L1_CACHE_DELAY);
this->cycle = 1;
}