Skip to content

Commit

Permalink
[emulator] set sv scope before invoking dpi_error
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Avimitin authored and sequencer committed Oct 1, 2023
1 parent 42ee90d commit 7076e11
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions emulator/src/dpi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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()); \
}

Expand Down

0 comments on commit 7076e11

Please sign in to comment.