From 06df5adfd78061aa5ae7567882fb8c42d7260a46 Mon Sep 17 00:00:00 2001 From: Jack Koenig Date: Tue, 10 Jan 2017 17:18:09 -0800 Subject: Make stop() immediately end simulation for Verilator tests (#434) --- src/main/resources/top.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/main/resources/top.cpp') diff --git a/src/main/resources/top.cpp b/src/main/resources/top.cpp index 075d7085..4e9c1433 100644 --- a/src/main/resources/top.cpp +++ b/src/main/resources/top.cpp @@ -5,6 +5,13 @@ # include // Trace file format header #endif +// Override Verilator definition so first $finish ends simulation +// Note: VL_USER_FINISH needs to be defined when compiling Verilator code +void vl_finish(const char* filename, int linenum, const char* hier) { + Verilated::flushCall(); + exit(0); +} + using namespace std; //VGCDTester *top; -- cgit v1.2.3