From f8ae5b7c8abe1cc077d928a1748b13d5ec8c41ed Mon Sep 17 00:00:00 2001 From: Brian Campbell Date: Wed, 14 Nov 2018 15:56:26 +0000 Subject: Fix memory map in RVFI-DII mode --- riscv/riscv_sim.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/riscv/riscv_sim.c b/riscv/riscv_sim.c index 1d338880..3a4b66eb 100644 --- a/riscv/riscv_sim.c +++ b/riscv/riscv_sim.c @@ -303,11 +303,6 @@ void init_sail_reset_vector(uint64_t entry) /* set rom size */ rv_rom_size = rom_end - rv_rom_base; -#ifdef RVFI_DII - if (rvfi_dii) - zPC = entry; - else -#endif /* boot at reset vector */ zPC = rv_rom_base; } @@ -317,6 +312,15 @@ void init_sail(uint64_t elf_entry) model_init(); zinit_platform(UNIT); zinit_sys(UNIT); +#ifdef RVFI_DII + if (rvfi_dii) { + rv_ram_base = UINT64_C(0x80000000); + rv_ram_size = UINT64_C(0x10000); + rv_rom_base = UINT64_C(0); + rv_rom_size = UINT64_C(0); + zPC = elf_entry; + } else +#endif init_sail_reset_vector(elf_entry); } -- cgit v1.2.3