From 7076e11cafe29da88d2deea5f428f1b557494adb Mon Sep 17 00:00:00 2001 From: Avimitin Date: Fri, 29 Sep 2023 19:37:41 +0800 Subject: [PATCH] [emulator] set sv scope before invoking `dpi_error` The verilator will exit without warning when user calling cpp function which is not in scope. This commit can fix the weird abort behavior of the verilator. Signed-off-by: Avimitin --- emulator/src/dpi.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/emulator/src/dpi.cc b/emulator/src/dpi.cc index e996a61d0..b3c3aaa9f 100644 --- a/emulator/src/dpi.cc +++ b/emulator/src/dpi.cc @@ -38,6 +38,7 @@ void print_perf_summary(); } catch (std::runtime_error &e) { \ terminated = true; \ LOG(ERROR) << fmt::format("detect exception ({}), gracefully abort simulation", e.what()); \ + svSetScope(svGetScopeFromName("TOP.TestBench.verificationModule.dpiError")); \ dpi_error(e.what()); \ }