diff options
author | Chih-Min Chao <chihmin.chao@sifive.com> | 2019-09-04 20:16:52 -0700 |
---|---|---|
committer | Chih-Min Chao <chihmin.chao@sifive.com> | 2019-09-04 20:16:52 -0700 |
commit | a4347c82a86454af5fc39ef44601b2404bff53c6 (patch) | |
tree | 9f9d085d62012fe77b1d1e6259b1572ddd097948 /spike_main | |
parent | d3a330c9b68d05e9d3e879141962235e7de3efba (diff) | |
download | spike-a4347c82a86454af5fc39ef44601b2404bff53c6.zip spike-a4347c82a86454af5fc39ef44601b2404bff53c6.tar.gz spike-a4347c82a86454af5fc39ef44601b2404bff53c6.tar.bz2 |
rvv: exit when there is unsupported instructions
Signed-off-by: Chih-Min Chao <chihmin.chao@sifive.com>
Diffstat (limited to 'spike_main')
-rw-r--r-- | spike_main/spike.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spike_main/spike.cc b/spike_main/spike.cc index 5bd5fe0..0dbfa16 100644 --- a/spike_main/spike.cc +++ b/spike_main/spike.cc @@ -105,6 +105,13 @@ static std::vector<std::pair<reg_t, mem_t*>> make_mems(const char* arg) #ifdef RISCV_ENABLE_IMPL_CHECK extern unsigned g_check_impl; +extern bool g_has_unsupport; +static void exit_with_unsupport(void) +{ + if (g_has_unsupport) { + _Exit(123); + } +} #endif extern bool g_vector_mistrap; @@ -255,6 +262,10 @@ int main(int argc, char** argv) if (!*argv1) help(); +#ifdef RISCV_ENABLE_IMPL_CHECK + atexit(exit_with_unsupport); +#endif + sim_t s(isa, varch, nprocs, halted, start_pc, mems, plugin_devices, htif_args, std::move(hartids), dm_config); std::unique_ptr<remote_bitbang_t> remote_bitbang((remote_bitbang_t *) NULL); |