summaryrefslogtreecommitdiff
path: root/src/main/resources
diff options
context:
space:
mode:
authorJack Koenig2017-01-10 17:18:09 -0800
committerGitHub2017-01-10 17:18:09 -0800
commit06df5adfd78061aa5ae7567882fb8c42d7260a46 (patch)
tree39b070505c95fd89e7a88eb64009d9b1468ef7a3 /src/main/resources
parent22b9beefd6ddc358f1573a305ed9b498634c6d23 (diff)
Make stop() immediately end simulation for Verilator tests (#434)
Diffstat (limited to 'src/main/resources')
-rw-r--r--src/main/resources/top.cpp7
1 files changed, 7 insertions, 0 deletions
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 <verilated_vcd_c.h> // 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;