From 7132b8ff6b1f809341465ab4754243d5bf596590 Mon Sep 17 00:00:00 2001 From: Stephen Williams Date: Wed, 11 Jul 2007 21:38:56 -0700 Subject: [PATCH] Start runtime trace aids The runtime is a vvp runtime engine debug aid that allows for detailed dump into a debug log. The trace is enabled by setting the VVP_DEBUG variable and activating specific debug messages in the vvp source. Signed-off-by: Stephen Williams --- vvp/compile.cc | 3 +++ vvp/compile.h | 7 +++++++ vvp/debug.txt | 18 ++++++++++++++++++ vvp/main.cc | 9 +++++++++ vvp/resolv.cc | 48 +++++++++++------------------------------------- vvp/resolv.h | 5 ++++- 6 files changed, 52 insertions(+), 38 deletions(-) create mode 100644 vvp/debug.txt diff --git a/vvp/compile.cc b/vvp/compile.cc index f87aa32a8..508e2d14a 100644 --- a/vvp/compile.cc +++ b/vvp/compile.cc @@ -1197,6 +1197,9 @@ void compile_resolver(char*label, char*type, unsigned argc, struct symb_s*argv) if (strcmp(type,"tri") == 0) { obj = new resolv_functor(vvp_scalar_t(BIT4_Z, 0)); + } else if (strncmp(type,"tri$",4) == 0) { + obj = new resolv_functor(vvp_scalar_t(BIT4_Z, 0), strdup(type+4)); + } else if (strcmp(type,"tri0") == 0) { obj = new resolv_functor(vvp_scalar_t(BIT4_0, 5)); diff --git a/vvp/compile.h b/vvp/compile.h index ae6c90ab9..c5aaab4de 100644 --- a/vvp/compile.h +++ b/vvp/compile.h @@ -23,6 +23,7 @@ #endif # include +# include # include "parse_misc.h" # include "vpi_user.h" # include "vvp_net.h" @@ -44,6 +45,12 @@ extern void compile_cleanup(void); extern bool verbose_flag; +/* + * If this file opened, then write debug information to this + * file. This is used for debugging the VVP runtime itself. + */ +extern ofstream debug_file; + /* * Connect a list of symbols to a contiguous set of ipoints. * Constants C are handled by setting the ival of the ipoint. diff --git a/vvp/debug.txt b/vvp/debug.txt new file mode 100644 index 000000000..0a2e405cc --- /dev/null +++ b/vvp/debug.txt @@ -0,0 +1,18 @@ + +DEBUG AIDS FOR VVP + +Debuging vvp can be fiendishly difficult, so there are some built in +debugging aids. These are enabled by setting the environment variable +VVP_DEBUG to the path to an output file. Then, various detailed debug +tools can be enabled as described below. + +* .resolv + +The .resolv can print debug information along with a label by +specifying the debug output label on the .resolv line: + + .resolv tri$