/*----------------------------------------------------------------------*/ /* tclirsim.c --- Creates the interpreter-wrapped version of irsim */ /* */ /* Written by Tim Edwards November 2002 */ /* */ /*----------------------------------------------------------------------*/ #define _GNU_SOURCE #include #include #include #include /* Ctrl-C interrupt handling */ #include #include #include "defs.h" #include "net.h" #include "globals.h" #include "rsim.h" /* * Handling of VA_COPY. These variables are set by the configuration * script. Some systems define va_copy, some define __va_copy, and * some don't define it at all. It is assumed that systems which do * not define it at all allow arguments to be copied with "=". */ #ifndef HAVE_VA_COPY #ifdef HAVE___VA_COPY #define va_copy(a, b) __va_copy(a, b) #else #define va_copy(a, b) a = b #endif #endif Tcl_Interp *irsiminterp; Tcl_Interp *consoleinterp; private int UseTkConsole = TRUE; extern char *filename; /* current input file (see rsim.h) */ extern int lineno; /* current line number */ extern char *first_file; /* basename of network file read-in */ extern int targc; extern char **targv; extern Command cmds[]; extern char wildCard[MAXARGS]; extern void Tcl_stdflush(); extern void InitTkAnalyzer(); extern void TagInit(); extern int IrsimTagCallback(); extern void enable_interrupt(); extern void disable_interrupt(); extern Tcl_Obj *list_all_vectors(); private int InterruptPending = FALSE; private void (*oldinthandler)() = SIG_DFL; int tclirsim_base(); int tclirsim_marker(); int tclirsim_print(); int tclirsim_simtime(); int tclirsim_trace(); int tclirsim_zoom(); Command anacmds[] = { {"base", tclirsim_base, 1, 4, "base get|set [trace] [bin|oct|hex]", 0}, {"marker", tclirsim_marker, 1, 4, "marker [1|2] set|move|delta...", 0}, {"print", tclirsim_print, 1, 3, "print [|