projects
/
riscv-isa-sim.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
df640b0
)
Make sure to translate Debug RAM addresses also.
author
Tim Newsome
<tim@sifive.com>
Sat, 23 Apr 2016 17:40:23 +0000
(10:40 -0700)
committer
Tim Newsome
<tim@sifive.com>
Mon, 23 May 2016 19:12:11 +0000
(12:12 -0700)
riscv/decode.h
patch
|
blob
|
history
riscv/sim.cc
patch
|
blob
|
history
diff --git
a/riscv/decode.h
b/riscv/decode.h
index bf6a84cb47f2d3e303877c1f76cec2f9c1102ecc..9b9df5baa896a52e9f8efc65c888cc5b8fe0919a 100644
(file)
--- a/
riscv/decode.h
+++ b/
riscv/decode.h
@@
-237,9
+237,12
@@
private:
#define DCSR_CAUSE_STEPPED 4
#define DCSR_CAUSE_HALT 5
#define DCSR_CAUSE_STEPPED 4
#define DCSR_CAUSE_HALT 5
+#define DEBUG_START 0xfffffffffffff000
#define DEBUG_RAM_START 0xfffffffffffffc00 // TODO: 0x400
#define DEBUG_RAM_END (DEBUG_RAM_START + 64)
#define DEBUG_ROM_START 0xfffffffffffff800 // TODO: 0x800
#define DEBUG_ROM_END (DEBUG_ROM_START + debug_rom_raw_len)
#define DEBUG_RAM_START 0xfffffffffffffc00 // TODO: 0x400
#define DEBUG_RAM_END (DEBUG_RAM_START + 64)
#define DEBUG_ROM_START 0xfffffffffffff800 // TODO: 0x800
#define DEBUG_ROM_END (DEBUG_ROM_START + debug_rom_raw_len)
+#define DEBUG_END 0xffffffffffffffff
+#define DEBUG_SIZE (DEBUG_END - DEBUG_START + 1)
#endif
#endif
diff --git
a/riscv/sim.cc
b/riscv/sim.cc
index 5cf2646e20ea6cb42134012f803d61b50ae2276a..7c50425e5a9baf6ac90398738f9e66d67129fe94 100644
(file)
--- a/
riscv/sim.cc
+++ b/
riscv/sim.cc
@@
-42,10
+42,11
@@
sim_t::sim_t(const char* isa, size_t nprocs, size_t mem_mb, bool halted,
(unsigned long)memsz, (unsigned long)memsz0);
/* Copy Debug ROM into the end of the allocated block, because we surely
(unsigned long)memsz, (unsigned long)memsz0);
/* Copy Debug ROM into the end of the allocated block, because we surely
- * didn't succeed in allocati
on
0xfffffffff800 bytes. */
+ * didn't succeed in allocati
ng
0xfffffffff800 bytes. */
/* TODO: Once everything uses the new memory map, just put this at the
* address that it actually belongs at. */
/* TODO: Once everything uses the new memory map, just put this at the
* address that it actually belongs at. */
- memcpy(mem + memsz - debug_rom_raw_len, debug_rom_raw, debug_rom_raw_len);
+ memcpy(mem + memsz - DEBUG_SIZE + DEBUG_ROM_START - DEBUG_START,
+ debug_rom_raw, debug_rom_raw_len);
debug_mmu = new mmu_t(this, NULL);
debug_mmu = new mmu_t(this, NULL);