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
commit1b01b557e76f8643964e5c367c072ab7778036f6 (patch)
tree30947c7018653ca18d4a69de20936b3615768f9e /src/cli/cli.cc
parent92e8c2583695a3bf652e0e8dedb79e7a99922f5f (diff)
parentc55104f8e99ea6ccb0c66a5e0d3cfc81dbbc19ab (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;
}