Previous: Miscellaneous procedures, Up: Procedures and variables


2.4.8 Variables

Variables control how things work. Some of these are settable via command-line options. All of them can be examined or changed by evaluating the uvar procedure for the variable, which is named by appending “uvar:” (note colon) with the variable name. Pass this procedure one of the keywords #:getter, #:setter or #:wrline to get a procedure that gets the value, sets the value (with an additional argument), or displays the value to the current output port followed by newline.

— Variable: debug

When set to a non-zero integer, this variable causes output of debugging information. It is primarily for use by the developers as the debugging output may be incomprehensible to ordinary users.

The command-line option -d sets the value to -1, which causes a lot of output.

— Variable: batch-mode

When set to non-#f, this variable causes THUD to exit immediately after processing the user initialization file.

The command-line option -b sets the value to #t.

— Variable: verbose

When set to non-#f, this variable causes THUD to output informational messages describing its operation. When #f, THUD suppresses these messages.

The command-line option -s sets the value to #f.

— Variable: init-file

By default "~/.thud", this variable holds a string indicating the script file to be executed immediately before showing an interactive face. When in batch mode (see batch-mode above), this script is the last thing that gets executed before THUD exits.

The command-line option -x FILE sets the value to FILE.

— Variable: face

By default hide-parens, this variable holds a symbol indicating the face THUD should use for non-batch (interactive) mode. The valid settings are one of full, hide-parens or emacs. The emacs interface is still very experimental – use with caution.

The command-line option -F FACE sets the value to FACE.

— Variable: max-cycle

By default #f, this variable controls when next and SIM:run-forever should stop.

When used interactively, the command next stops after that cycle number is reached, even if the cycle count argument to next would indicate simulation beyond it.

For compiled designs, the procedure SIM:run-forever throws done-sim when max-cycle is reached.

— Variable: scope

Some procedures are said to obey this variable. This means that they restrict their domain to those elements that are within this scope.

          For example, if a design has the following scopes:
          
          /a/b/c/
          /a/b/
          /a/b/d/
          /x/y/z/
          
          then setting scope to /a/b will affect those
          procedures by restricting their domain to /a/b/,
          /a/b/c/ and /a/b/d/ (and excluding /x/y/z/).