- •Contents
- •Introduction
- •About These Application Notes
- •What Is a Cell?
- •Cell Interconnect Delays
- •What Is Delay Back Annotation?
- •What Is Delay Calculation?
- •Prerequisites and Related Reading
- •Creating a Back Annotator
- •The Programming Language Interface (PLI) Mechanism
- •PLI Access Routines
- •Access Routine Families
- •Required UTILITY Routines
- •Access to Timing Information
- •Effect of Source Protection
- •Where to Look for More Information
- •Back Annotating Delays
- •Examples Used in This Chapter
- •Retrieving a Handle to the Object Associated with the Delay
- •Retrieving a Handle to a Net
- •Retrieving a Handle to a Module Path Delay
- •Retrieving a Handle to a Timing Check
- •Annotating the Delay
- •Determining How and Where to Place Delays
- •Annotating to Cells with Path Delays
- •Annotating to Cells with Lumped or Distributed Delays
- •Libraries with Mixed Cell Timing Descriptions
- •Annotating to Timing Checks
- •Calculating Delays
- •Examples Used in This Chapter
- •Scanning Cell Instances Within the Design
- •Determining the Scope of the Delay Calculation
- •Scan Methodology
- •Scanning Objects Within the Cell Instance
- •Relationship to Modeling Methodology
- •Scanning Path Delays
- •Scanning Cell Output Ports
- •Libraries with Mixed Cell Timing Descriptions
- •Types of Data Needed
- •Coding Data into Cell Descriptions (Attributes)
- •Retrieving Cell I/O Load Factors
- •Load Due to Interconnect Wire
- •Calculating and Annotating the Delays
- •Calculating the Delays
- •Annotating the Delays
- •Example Listings
- •Delay Back Annotators
- •Cell Output Nets to Lumped or Distributed Delay Cells
- •Interconnect Nets to Lumped or Distributed Delay Cells
- •Cell Output Nets to Path Delay Cells
- •Interconnect Nets to Path Delay Cells
- •Delay Calculators
- •Creating and Extracting Data From a Hash Table
- •Random Cell Scan and Cell Output Nets
- •Random Cell Scan and Cell Interconnect Nets
- •Delay Calculation Driven by Cell Output Nets
- •Delay Calculation Driven by a Cell Interconnect Nets
- •Index
Back Annotation and Delay Calculation
Back Annotating Delays
Figure 3-6 Delay back annotation file with interconnect nets and their associated delays
top.m1.dm1 10 12 top.m1.dm2 10 12 top.m1.q[0] 25 27 top.m1.qb[0] 30 35 top.m1.q[1] 25 27 top.m1.qb[1] 30 35
Retrieving a Handle to the Object Associated with the Delay
The first task that you must accomplish within your delay back annotation facility is to retrieve a handle to the object associated with the indicated delay. Because you are mapping objects and delays from an external utility into the Veritool environment, the object associated with a delay in the delay back annotation file is not necessarily the object that the delay will be associated with in the Veritool. The object will, however, give you a starting point for determining where to place the delay. The following is a list of design objects that are typically identified in delay back annotation files:
■nets
■module paths
■timing checks
Retrieving a Handle to a Net
The access routine acc_handle_object takes as its input a legal Verilog HDL hierarchical name and returns a handle to the object identified by the name. Thus, if the hierarchical name of a net is provided in the delay back annotation file, you may retrieve a handle to the net simply by calling acc_handle_object with this name. Figure 3-7 on page 26 shows a C routine fragment that reads the example delay back annotation file shown in Figure 3-5 on page 25 and retrieves a handle to the net associated with the indicated delays.
Figure 3-7 Retrieving a handle to a net given the hierarchical net name
void dl_read_net_delays()
{
FILE *fdin;
char *file_name, net_name[256]; int num_args, line_num = 0;
October 2000 |
26 |
Product Version 3.2 |
Back Annotation and Delay Calculation
Back Annotating Delays
double rise, fall; handle net, prim, driver; bool dl_verbose = false;
/*************************************************/ /*** Initialize access routines and set version***/ /*************************************************/ acc_initialize(); acc_configure(accDevelopmentVersion,"1.5a");
. . .
/**********************************************/ /*** Read and process each line in the file ***/
/**********************************************/
while ((num_args=fscanf(fdin,"%s %lf %lf",net_name,&rise, &fall)) != EOF)
{
/********************************************************/ /*** Retrieve handle to input net, make sure it is OK ***/
/********************************************************/ net = acc_handle_object(net_name);
if ((net == null) || (acc_fetch_type(net) != accNet))
{
io_printf("Warning from $back_annotate : net %s not found\n", net_name);
continue;
}
/* process delays */
. . .
}
/* clean up access routines */ acc_close();
}
Note that the delay back annotation file does not have to contain a Verilog HDL syntax net name. It must, however, contain enough information to allow you to create the net name from the identifier provided.
Retrieving a Handle to a Module Path Delay
In order to retrieve a handle to a module path delay, the delay back annotation file must contain the following pieces of information:
■the hierarchical instance name of the module containing the path delay
■the name of the path source net
■the name of the path destination net
Given this information, you can retrieve a handle to the path delay with the access routine acc_handle_modpath. Figure 3-4 on page 25 and Figure 3-8 on page 28 show an example delay back annotation file that corresponds to the design shown in Figure 3-2 on
October 2000 |
27 |
Product Version 3.2 |
Back Annotation and Delay Calculation
Back Annotating Delays
page 23 and Figure 3-3 on page 24 . This file contains, among other things, Verilog HDL module instance names, names of path source nets and path destination nets that identify path delays within this module, and the rise and fall delays associated with these paths. Figure 3-9 on page 28 shows a C-language routine fragment that reads this file and retrieves handles to the indicated path delays.
Figure 3-8 Delay back annotation file identifying paths and their associated delays
top.m1 2 clk q 10 clk qb 10 3
366 d 0 clk 9 5
367 clk 13 d 0 3
Module instance name
top.m2 2
Path source net
clk q 25
Path destination net clk qb 30
3
366 d 0 clk 9 15
367 clk 13 d 0 7
top.m3 2 clk q 40 clk qb 50 3
366 d 0 clk 9 20
367 clk 13 d 0 17
Figure 3-9 Retrieving handles to path delays
October 2000 |
28 |
Product Version 3.2 |
Back Annotation and Delay Calculation
Back Annotating Delays
ba_ppt_call() |
|
|
|
{ /* |
ba_ppt_call() */ |
|
|
FILE |
*ba_fp; |
|
/* pointer to back-annotation file */ |
char |
hier_name[LARGE_STRING] |
/* |
module instance name */ |
int num_paths; |
/* |
number of path delays */ |
|
handle mod_handle; |
/* |
handle to module instance */ |
|
handle curr_path; |
/* |
handle to current path delay */ |
|
char |
pathin_name[SMALL_STRING]; |
|
/* name of current path input */ |
char |
pathout_name[SMALL_STRING]; |
/* name of current path output */ |
|
double rise, fall; |
|
/* incremental delays */ |
|
. . . |
|
|
|
/* |
read and annotate the delays |
*/ |
while (fscanf(ba_fp,"%s %d",hier_name,&num_paths) != EOF)
{
/* get handle to module instance */ mod_handle = acc_handle_object(hier_name);
. . .
/* read path IDs and delays and annotate the delays */ for (i = 0; i < num_paths; i++)
{
fscanf(ba_fp,"%s %s %lf %lf",pathin_name,pathout_name, &rise,&fall);
/* retrieve a handle to the path */
curr_path = acc_handle_modpath(mod_handle,pathin_name, pathout_name);
/* process delay */
. . .
}
}
} /* ba_ppt_call() */
Note that if a module path delay description contains more than one source or destination net, the net that appears first in the description must be used in the call to acc_handle_modpath. Therefore, the first net must be identified in the delay back annotation file.
Retrieving a Handle to a Timing Check
In order to retrieve a handle to a timing check, the delay back annotation file must contain the following information:
■the hierarchical name of the module instance containing the timing check
■the type of timing check
■the name of the net connected to the lower bound of the timing check
■the edge type specified for the lower bound net
■the name of the net connected to the upper bound of the timing check (if there is an upper bound)
October 2000 |
29 |
Product Version 3.2 |
Back Annotation and Delay Calculation
Back Annotating Delays
■the edge type specified for the upper bound net (if there is an upper bound)
Given this information, you can retrieve a handle to the timing check using acc_handle_tchk. The timing check and edge types are identified in calls to this routine by referencing constants defined in the access routine C-language include file acc_user.h.
Figure 3-10 on page 30 lists the constants.
Figure 3-10 Timing check identification constants defined in acc_user.h
Construct |
Defined constant |
Value |
|
|
|
Timing checks |
|
|
Setup check ($setup) |
accSetup |
366 |
Hold check ($hold) |
accHold |
367 |
Width check ($width) |
accWidth |
368 |
Period check ($period) |
accPeriod |
369 |
Recovery check ($recovery) |
accRecovery |
370 |
Skew check ($skew) |
accSkew |
371 |
No change check ($nochange) |
accNochange |
376 |
Setup Hold check ($setuphold) |
accSetuphold |
377 |
Edge types |
|
|
None |
accNoedge |
0 |
Positive edge (0 −> 1, 0 −> x, x −> 1) |
accPosedge |
13 |
Negative edge (1 −> 0, 1 −> x, x −> 0) |
accNegedge |
50 |
0→1 edge |
accEdge01 |
1 |
1→0 edge |
accEdge10 |
2 |
0→x edge |
accEdge0x |
4 |
x→1 edge |
accEdgex1 |
8 |
1→x edge |
accEdge1x |
16 |
x→0 edge |
accEdgex0 |
32 |
|
|
|
October 2000 |
30 |
Product Version 3.2 |
Back Annotation and Delay Calculation
Back Annotating Delays
If possible, include these constants directly in the delay back annotation file, as done in the examples, instead of using string identifiers that are interpreted by your delay back annotation facility. This will allow for faster processing of the delay back annotation file.
If a timing check upper or lower bound net is active on more than one edge (as specified by the edge keyword), then the sum of the constants representing the edges must be used in the call to acc_handle_tchk.
Figure 3-4 on page 25 and Figure 3-11 on page 32 show an example delay back annotation file corresponding to the design in Figure 3-2 on page 23 and Figure 3-3 on page 24 . This
file contains Verilog HDL module instance names, a set of net names and constants that specify timing checks in the module instance, and the time limits associated with the timing checks.
October 2000 |
31 |
Product Version 3.2 |
Back Annotation and Delay Calculation
Back Annotating Delays
Figure 3-11 Example delay back annotation file identifying timing checks and their associated limits
top.m1 2 clk q 10 clk qb 10 3
366 d 0 clk 9 5
367 clk 13 d 0 3
top.m2 2 clk q 25 clk qb 30 3
366 d 0 clk 9 15
367 clk 13 d 0 7
top.m3 2 clk q 40 clk qb 50
3
366 d 0 clk 9 20
367 clk 13 d 0 17
Timing check type (maps to accSetup)
Edge types (map to accPosedge, accNoedge)
Edge types (map to accNoedge, accEdge01+accEdge0x)
Figure 3-12 on page 32 shows a C-language routine fragment that scans the example delay back annotation file shown in Figure 3-11 on page 32 and retrieves handles to the timing checks. The constant representing edge[01,x1] is obtained by summing accEdge01 and accEdgex1.
Figure 3-12 Retrieving handles to timing checks
ba_ppt_call() |
|
{ /* ba_ppt_call() */ |
|
. . . |
|
int num_tchecks; |
/* number of timing checks */ |
char sig1_str[SMALL_STRING]; |
/* timing check signal one string */ |
char sig2_str[SMALL_STRING]; |
/* timing check signal two string */ |
handle tcheck_handle; |
/* handle to timing check */ |
October 2000 |
32 |
Product Version 3.2 |