Executing Tcl Scripts in Novas
Tcl is a general purpose programming language which is widely used in EDA tools. With Tcl scripts you can extend and customize a tool’s capability, to make your design flow to be more efficient. The Verdi™ Automated Debug System has embedded the Tcl interpreter so that users can easily execute their own Tcl scripts in the Verdi system. There are various ways to execute the Tcl script in the Verdi system. Following are some examples demonstrating how to run the Tcl script in Verdi:
To run the Tcl script from the Verdi command line:
Use the –play command line option to replay your Tcl script, for example:
Verdi –play your_script.tcl &
All your actions in the Verdi GUI will be saved as a Tcl file in ./VerdiLog/Verdi.cmd, and you can use the –play option to replay this Tcl file in command line when invoking the Verdi system.
To run Tcl command or script in the Verdi GUI:
In the Verdi GUI, open the Preferences form using the Tools > Preferences command. Go to the General folder and enable the Enable TCL Command Entry Form option. The Command Entry form will be opened. The setting will be saved in the novas.rc resource file and the Command Entry form will be opened automatically next time you invoke the Verdi system. Type Tcl commands in this Command Entry form to execute it, and use “source” command to execute an existing Tcl script.

To source the Tcl script automatically when invoking the Verdi GUI:
There are several ways to source the Tcl script and execute it automatically when invoking the Verdi system:
1. Set the NOVAS_AUTO_SOURCE environment variable and specify the Tcl script before invoking the Verdi system. For example:
%
setenv NOVAS_AUTO_SOURCE
your_script.tcl
%
verdi &
2. Modify the novas.rc resource file in your working directory. Search for the TclAutoSource tag in the [General] section of the novas.rc resource file, and specify your Tcl script for the TclAutoSource tag. For example:
[General]
TclAutoSource = MyTclScript.tcl
3. In the Verdi GUI, open the Preferences form using the Tools > Preferences command. Go to the Auto Source folder and click the Browse button to specify your Tcl script file. The script will be executed automatically the next time you invoke the Verdi system.

To register a callback to a specific Verdi action and execute the script when triggering that action:
You can use the embedded Tcl command AddEventCallback to register a callback on a specific Verdi REASON with a Tcl procedure. The Tcl procedure will be executed when the specified REASON is triggered. For example, if you have created a Tcl procedure and want to execute it automatically when some action happens in the Verdi system, add the following Tcl code into your Tcl script and source the script when invoking the Verdi system:
AddEventCallback [tk appname] AutoLoadSignal wvCreateWindow 1
In the above example, the procedure AutoLoadSIgnal will be executed automatically every time a waveform window is created, where wvCreateWindow is an available REASON in the Verdi system. You can refer to the <Verdi_install>/doc/tcl.pdf document for all available REASON to register your Tcl procedure to a specific Verdi action.

