Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Synopsys 2012
Glossary
VIA = Verdi Interoperability Applications NPI = Novas Programming Interface Novas KDB = Novas Knowledge Database FSDB = Fast Signal Database VPI = Verilog Procedural Interface
Synopsys 2012
Overview
Verdi Tcl Introduction
Use Tcl in Verdi Case Study
Synopsys 2012
Overview
Verdi Tcl Introduction
Use Tcl in Verdi Case Study
Synopsys 2012
Tcl Introduction
Verdi Technology Background
Automated cause & effect tracing
Save significant engineering time Easy visualization of behavior with time and structure
Verification Tools
Designs
Open API
Compiler
FSDB
KDB
Advanced debugger
State, testbench, assertions, transactions
Power-aware
Clock analysis Post-layout ECO
Synopsys 2012
Tcl Introduction
Tcl Basic
What is Tcl?
Tcl stands for Tool Command Language A String basis scripting language Use source your_script.tcl to execute your Tcl script under tclsh
What is Tk?
Tk is an associated toolkit to create window-based interactive applications using Tcl
Synopsys 2012
Tcl Introduction
What Can You Do in Verdi with Tcl?
Use Tcl to combine Verdi commands to make your own feature to improve efficiency
Add your new feature, which was created by Tcl scripts, to the Verdi menu command or bind-key Use NPI (Novas Programming Interface) to traverse the design without Verdi GUI
Synopsys 2012
Tcl Introduction
Possible Applications in Verdi with Tcl
Application of FSDB
Calculate FSDB results. For example, duty cycles Search and sort FSDB results. For example, search for small pulses
Application of KDB
Access to Verdi database to do calculations and queries. For example, extract snake path from the design
Synopsys 2012
Tcl Introduction
Tcl Command Sets in Verdi
Verdi provides Tcl commands for each action in the GUI All Tcl commands are categorized by module and have a set prefix Prefix sys deb src wv sch tfg nMem fsm reg eco ta sid lx Module System Debussy (Verdi) nTrace nWave nSchema Temporal Flow View Memory/MDA nState nRegister nECO Transaction Siloti ListX
Synopsys 2012
Overview
Verdi Tcl Introduction
Use Tcl in Verdi Case Study
Synopsys 2012
10
Synopsys 2012
11
Synopsys 2012
12
NOTE: you can also register a callback with a triggered reason after invoking Verdi, for example:
AddEventCallback [tk appname] AutoLoadSignal wvCreateWindow 1 To execute the Tcl procedure AutoLoadSignal when a nWave window is created tk appname: returns the name of the application, the application name will be Verdi if you source the Tcl script after invoking Verdi
Synopsys 2012 14
Overview
Verdi Tcl Introduction
Use Tcl in Verdi Case Study
Synopsys 2012
15
Script purpose:
This script generates an nWave session file before exiting and loads last session when nWave is invoked. When select Save and Close Win under File menu on nWave , it generates nWave session file named "<FSDBName>.rc" and "AutoSaveSignal.rc" automatically. If there is a file named "AutoSaveSignal.rc" when invoking nWave, it is loaded automatically.
Usage:
% setenv NOVAS_AUTO_SOURCE AutoSave.tcl % verdi ...
Output file:
<FSDBNAME>.rc AutoSaveSignal.rc
Synopsys 2012 16
$fname: get the FSDB name from GetFileName procedure. Note it uses $ary($wid) to get the FSDB name in GetFileName procedure when there are multiple FSDB files
if { $fname != "" } { wvSaveSignal -win $wid "$fname.rc" Save signals to FSDB_name.rc file } Save signals to wvSaveSignal -win $wid "AutoSaveSignal.rc AutoSaveSignal.rc file } wvCloseWindow -win $wid Close current nWave window
17
Synopsys 2012
Note: here the p1 and p2 argument will be: $P1: wvCreateWindow $P2: 2a97b46aa8 (the window ID)
if { [file exists "AutoSaveSignal.rc"] } { wvRestoreSignal -win $p2 "AutoSaveSignal.rc" } Restore the AutoSaveSignal.rc file
into nWave if the file already exists
qwConfig -type nWave -cmds [list\ {qwAction -name "Save" -text "Save and Close Win -tcl {AutoSaveSignal}}\ {qwAddMenuAction -action "Save" -group "File" -before "Reload"} ] }
Synopsys 2012
Create a Save and Close Win command under File menu, invoking the command will execute the AutoSaveSignal procedure.
18
proc GetFileName {p1 p2} { global ary set lname "" set wid [wvGetCurrentWindow] set sid [string last / $p2] set lid [string last . $p2]
Note: here the p1 and p2 argument will be: P1: wvOpenFSDBFile P2: /verdi/home/allen_shieh/demo/rtl.fsdb Get the window ID for current nWave window $sid: get the index for last / in $p2 $lid: get the index for last . in $p2
set lname [string range $p2 [incr sid] [incr lid -1]] # puts "$p1 $p2 $lname" set ary($wid) $lname }
To store the fsdb name in $ary array with $wid index
AddEventCallback [tk appname] AutoLoadSignal wvCreateWindow 1 AddEventCallback [tk appname] GetFileName wvOpenFSDBFile 1
Register callbacks to: 1. Execute procedure AutoLoadSignal when opening nWave window 2. Execute procedure GetFileName when loading FSDB
Synopsys 2012 19
Overview
Verdi Tcl Introduction
Use Tcl in Verdi Case Study
Synopsys 2012
20
% vi tcl_log
Synopsys 2012
21
The TclPro Debugger is not included in Novas package, download the software and get the instruction from:
http://www.tcl.tk/software/tclpro/
Invoke Verdi with prodebug option and load the Tcl script with play option:
% verdi -prodebug -play demo_traverse.tcl
Synopsys 2012
22
Run stops
Synopsys 2012
23
Reference
Get Help from Resources
Novas Command Language:
<Verdi_install>/doc/tcl.pdf
NPI Models:
<Verdi_install>/doc/VIA_NPI.pdf
Useful web sites:
Tcl Developer Site: http://www.tcl.tk/ Tcl Tutorials: http://www.tcl.tk/man/tcl8.5/tutorial/tcltutorial.html Tcl Commands: http://www.tcl.tk/man/tcl8.5/TclCmd/contents.htm Tk Commands: http://www.tcl.tk/man/tcl8.5/TkCmd/contents.htm
Synopsys 2012
24