From f382ee70da7c5342df448288a3b7804c09f4a8c5 Mon Sep 17 00:00:00 2001 From: Scott Johnson Date: Mon, 24 Oct 2016 14:45:34 -0700 Subject: [PATCH] Sanity check compile-time vs simulation-time options If user compiles without +define+DEBUG but then requests +vcdfile at simulation time, that request would be silently ignored. This changes it to a fatal error. It's good philosophy to treat plusargs like +vcdfile as commands, not suggestions, and die immediately if they cannot be honored, instead of silently ignoring them. Otherwise the user sits through the entire simulation and then is left scratching his head wondering where his waveforms are. --- vsrc/TestDriver.v | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vsrc/TestDriver.v b/vsrc/TestDriver.v index d448e849..6e6ca404 100644 --- a/vsrc/TestDriver.v +++ b/vsrc/TestDriver.v @@ -67,7 +67,15 @@ module TestDriver; `define VCDPLUSCLOSE $dumpoff; `endif `else + // No +define+DEBUG `define VCDPLUSCLOSE + + if ($test$plusargs("vcdplusfile=") || $test$plusargs("vcdfile=")) + begin + $fdisplay(stderr, "Error: +vcdfile or +vcdplusfile requested but compile did not have +define+DEBUG enabled"); + $fatal; + end + `endif end