1 <?xml version=
"1.0" encoding=
"ISO-8859-1" ?>
3 <section niv='
1'
><title>Adder
</title>
5 <p>This example tackles similar concepts as the ones described in the previous example. It just illustrates them on a more slightly complex design,
6 a combinational full adder.
</p>
7 <p>This example takes place in the
<f>adder/
</f> directory.
</p>
9 <section niv='
2'
><title>Database Generation
</title>
11 <section niv='
3'
><title>Global Configuration
</title>
12 <p>The complete configuration required for the database generation takes place in the
<f>db.tcl
</f>. It is the same as in the previous example (inverters). The script also launches the commands that effectively generate that database.
</p>
14 <p>The temperature and supplies specifications take place in the
<f>adder.spi
</f> file:
</p>
17 <cl>.GLOBAL vdd vss
</cl>
18 <cl>Vsupply vdd
0 DC
1.62</cl>
19 <cl>Vground vss
0 DC
0</cl>
21 <p>As the
<f>adder.spi
</f> subcircuit is not instantiated, the
<f>vdd
</f> and
<f>vss
</f> signals appear in the
<f>.GLOBAL
</f>
25 <p>The technology file is included with a SPICE
<f>.INCLUDE
</f> directive in the
<f>adder.spi
</f> file.
</p>
26 <code>.INCLUDE ../techno/bsim4_dummy.ng
</code>
28 <section niv='
3'
><title>Database Generation
</title>
29 <p>The generation launch is done through the command
<f>hitas
</f>:
</p>
31 <cl>avt_LoadFile adder.spi spice
</cl>
32 <cl>set fig [hitas adder]
</cl>
34 <p>The
<f>hitas
</f> function takes as argument the name of the figure (the subckt for a SPICE netlist) to analyze. The tas function returns a pointer on the timing database newly created. This pointer can be used as an input to further steps of verification, thus avoiding costly re-reading of the timing database from the disk.
</p>
35 <p>To perform the database generation, just launch the script
<f>db.tcl
</f></p>
42 <section niv='
2'
><title>Path Searching with the Tcl Interface
</title>
43 <p>The complete configuration required for the database browsing takes place in the
<f>report.tcl
</f>.
</p>
45 <code>set fig [ttv_LoadSpecifiedTimingFigure adder]
</code>
46 <p>reads the timing database from disk (as said before, the re-reading of the database can be avoided by directly taking as an input the return value of the
<f>hitas
</f> function. For the sake of clarity, and because we are dealing with small timing databases, we preferred to split different verification steps into different scripts).
</p>
48 <code>set clist [ttv_GetPaths $fig * * rr
5 critic path max]
</code>
49 <p>gives the
5 most critical paths (
<f>critic
</f> and
<f>path
</f> arguments) of the design, that begin and end on a rising transition (
<f>rr
</f> argument), with no specification of signal name (
<f>* *
</f> arguments), in the database pointed out by
<f>$fig
</f>. The function returns a pointer on the newly created list.
</p>
51 <code>ttv_DisplayPathListDetail stdout $clist
</code>
52 <p>displays on the standard output the detail of all the paths of the path list given by the
<f>ttv_GetPaths
</f> function.
</p>
53 <p>To get these paths, launch the script
<f>report.tcl
</f>.
</p>
56 <section niv='
2'
><title>Exercises
</title>
58 <item>Ex
1.1. Get the list of connectors with the Tcl interface and with the GUI.
</item>
59 <item>Ex
1.2. Get the critical paths between selected connectors, with any transition, with the Tcl interface and with the GUI
</item>
60 <item>Ex
1.3. Get all the parallel paths of the most critical path with the Tcl interface and with the GUI
</item>
61 <item>Ex
1.4 Get the detail of a parallel path and identify divergence
</item>
62 <item>Ex
1.5 Hide the column
<f>Line Type
</f> in the report and observe the results
</item>
63 <item>Ex
1.6 Change the unit of the report from
<f>ns
</f> <f>ps
</f> (
<f>ttv_SetupReport
</f>)
</item>
68 <section niv='
2'
><title>Solutions
</title>
70 <cl>#!/usr/bin/env avt_shell
</cl>
72 <cl># Ex adder
.1 </cl>
73 <cl>set fig [ttv_LoadSpecifiedTimingFigure adder]
</cl>
74 <cl>set clist [ttv_GetTimingSignalList $fig connector interface]
</cl>
75 <cl>foreach c $clist {
</cl>
76 <cl> puts
"[ttv_GetTimingSignalProperty $c NAME] [ttv_GetTimingSignalProperty $c DIR]"</cl>
79 <cl># Ex adder
.2 </cl>
80 <cl>set fig [ttv_LoadSpecifiedTimingFigure adder]
</cl>
81 <cl>set clist [ttv_GetPaths $fig a_0 cout ??
5 critic path max]
</cl>
82 <cl>ttv_DisplayPathListDetail stdout $clist
</cl>
84 <cl># Ex adder
.3 and adder
.4</cl>
85 <cl>set fig [ttv_LoadSpecifiedTimingFigure adder]
</cl>
86 <cl>set clist [ttv_GetPaths $fig * * rr
5 critic path max]
</cl>
87 <cl>set plist [ttv_GetParallelPaths [lindex $clist
1]
10]
</cl>
88 <cl>ttv_DisplayPathListDetail stdout $plist
</cl>
90 <cl># Ex adder
.5 and adder
.6</cl>
91 <cl>ttv_DisplayPathDetailHideColumn dt.linetype
</cl>
92 <cl>ttv_SetupReport ps
</cl>
93 <cl>ttv_DisplayPathListDetail stdout $plist
</cl>