diff options
author | Prashanth Mundkur <prashanth.mundkur@gmail.com> | 2019-05-02 11:15:05 -0700 |
---|---|---|
committer | Prashanth Mundkur <prashanth.mundkur@gmail.com> | 2019-05-02 11:15:05 -0700 |
commit | 40d2b3d6a899d52a2fa0086021fc0e83d3043663 (patch) | |
tree | de4d07f0b6c3294238a43ed6f97ac62007de63f5 /c_emulator | |
parent | 9be6d5783ff2fa0df24691cfc3273c50528b534a (diff) | |
download | sail-riscv-40d2b3d6a899d52a2fa0086021fc0e83d3043663.zip sail-riscv-40d2b3d6a899d52a2fa0086021fc0e83d3043663.tar.gz sail-riscv-40d2b3d6a899d52a2fa0086021fc0e83d3043663.tar.bz2 |
rvfi: clear memory between tests.
Diffstat (limited to 'c_emulator')
-rw-r--r-- | c_emulator/riscv_sim.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/c_emulator/riscv_sim.c b/c_emulator/riscv_sim.c index 1c9e9e3..c70b31c 100644 --- a/c_emulator/riscv_sim.c +++ b/c_emulator/riscv_sim.c @@ -432,6 +432,14 @@ void init_sail(uint64_t elf_entry) if (!rv_enable_rvc) z_set_Misa_C(&zmisa, 0); } +/* reinitialize to clear state and memory, typically across tests runs */ +void reinit_sail(uint64_t elf_entry) +{ + model_fini(); + model_init(); + init_sail(elf_entry); +} + int init_check(struct tv_spike_t *s) { int passed = 1; @@ -800,7 +808,7 @@ int main(int argc, char **argv) #else if (rvfi_dii) { /* Reset for next test */ - init_sail(entry); + reinit_sail(entry); } } while (rvfi_dii); #endif |