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$