diff options
author | Will Hawkins <8715530+hawkinsw@users.noreply.github.com> | 2020-11-29 19:09:50 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-29 16:09:50 -0800 |
commit | f4f6e12eeeabccc31853ab4e8570219d1f5cba37 (patch) | |
tree | 6861e5831a07a0725c659ce5133129f29ac619e1 /riscv/sim.cc | |
parent | 4b04d715298c7c0542badf30828f65d1f02e1c1d (diff) | |
download | riscv-isa-sim-f4f6e12eeeabccc31853ab4e8570219d1f5cba37.zip riscv-isa-sim-f4f6e12eeeabccc31853ab4e8570219d1f5cba37.tar.gz riscv-isa-sim-f4f6e12eeeabccc31853ab4e8570219d1f5cba37.tar.bz2 |
Fix #607: Add a core parameter to the interactive str command (#608)
Add a core parameter to the interactive str command. This makes it
possible for the spike user to specify the device whose memory contains
the NUL-terminated string to be printed.
Diffstat (limited to 'riscv/sim.cc')
-rw-r--r-- | riscv/sim.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/riscv/sim.cc b/riscv/sim.cc index 20895d6..0261f86 100644 --- a/riscv/sim.cc +++ b/riscv/sim.cc @@ -351,9 +351,13 @@ char* sim_t::addr_to_mem(reg_t addr) { if (!paddr_ok(addr)) return NULL; auto desc = bus.find_device(addr); - if (auto mem = dynamic_cast<mem_t*>(desc.second)) + if (auto mem = dynamic_cast<mem_t*>(desc.second)) { if (addr - desc.first < mem->size()) return mem->contents() + (addr - desc.first); + } else if (auto mem = dynamic_cast<clint_t*>(desc.second)) { + fprintf(stdout, "clint_t\n"); + return NULL; + } return NULL; } |