PrimeTime Tcl procs

Primetime TCL procs:

PT and other synopsys tools support a lot of tcl procs that make writing tcl programs easier. We already saw a lot of PT cmds as all_fanin, report_timing, etc that were for for specific task. There are many general purpose procs too provided by synopsys that can be used to make our own procs lot easier to write. These procs are loaded automatically when you invoke PT_SHELL, so you can call these procs directly.

Parsing arguments:

One of the most used tcl procs is for parsing proc arguments. Let's say we want to write a custom tcl proc for taking in some inputs and producing a o/p (ex proc to add 2 numbers). The standard tcl cmd for parsing args is by using the cmdline package provided by tcl. However, synopsys provides their own cmdline parser which is std across all of their cmds, and much easier to use. It also has helper proc to show the required args if -help is typed or if wrong args are provided.

parse_proc_arguments => This parses the argument list and puts them into the array specified. This is put inside our proc, and is the first line inside our proc, so that it will parse the args and put them into the array for use downstream.

syntax: parse_proc_arguments -args <arg_list> <result_array>

define_proc_attributes => This prints info on screen about the proc (i. what it does), args required, etc. This is when you just type the proc name, or use -help option (similar to how all std PT cmds show options, etc when you use -help option, or type the cmd with incorrect options). This checks for correctness of args too when you call the named proc. So this proc is a companion proc to parse_proc_arguments. Usually we use both these procs with a

ex:

proc my_proc {args} {
 parse_proc_arguments -args $args results
 set sp [get_pins $results(-from)]
 if {[set num [get_pins $results(-num)]] eq {}} {return 0}

foreach argname [array names results] { echo " $argname = $results($argname)" }
}

define_proc_attributes path_dly_onscreen \
 -info "Prints delay of gates on screen" \
 -define_args {\
    {-from            "startpoint name or collection"    "" string  required}
    {-to              "endpoint name or collection"    "" string  required}
    {-num              "num of paths"    "" float  required}
 }

 

parse_proc_arguments