- •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
5
Example Listings
This chapter contains the complete C-language source code listings of all of the example delay back annotators and delay calculators referenced in this document. Each example is preceded by a brief description of its operation.
Note that the veriusertfs definition needed to associate a new Verilog-XL HDL system task with the delay back annotator or delay calculator appears at the end of each example.
Because the definition is included in this manner, the files containing the example source code completely replace the file veriuser.c in the Veritool linking step.
Delay Back Annotators
Cell Output Nets to Lumped or Distributed Delay Cells
Figure 5-1 on page 93 shows a delay back annotator that requires a delay file containing cell output net names and their associated rise and fall delays. Figure 3-5 on page 25 shows an example delay file in this syntax. The back annotator reads each net/delay pair and adds the delays to all primitives in the appropriate cell instance that drive the net. This back annotator must be used with designs containing cells described with lumped or distributed (primitive output) delay timing, as does the design in Figure 3-1 on page 22 and Figure 3-3 on page 24 .
Figure 5-1 Annotating from cell output nets to lumped or distributed delay cells
#include <stdio.h> #include "acc_user.h" #include "veriuser.h"
#define dlArgsPerLine 3
dl_read_net_delays()
{
FILE *fdin;
char *file_name, net_name[256]; int num_args, line_num = 0; double rise, fall;
handle net, prim, driver; bool dl_verbose = false;
October 2000 |
93 |
Product Version 3.2 |
Back Annotation and Delay Calculation
Example Listings
/**********************************/ /*** Initialize access routines ***/
/**********************************/ acc_initialize(); acc_configure(accDevelopmentVersion,"1.5a");
/*******************************************************/
/*** Configure so that if acc_replace_delays needs |
***/ |
/** a hiz delay it makes it the maximum of the input |
**/ |
/*** rise and fall delays |
***/ |
/*******************************************************/
acc_configure(accToHiZDelay,"max"); /********************************************/ /*** Check for +dlverbose on command line ***/
/********************************************/
if (mc_scan_plusargs("dlverbose")) dl_verbose = true;
/**********************************/ /*** Open delay annotation file ***/
/**********************************/
file_name = tf_strgetp(1,’b’);
if ((fdin = fopen(file_name,"r")) == null)
{
io_printf("file: <%s> not found\n", file_name); return;
}
/**********************************************/ /*** Read and process each line in the file ***/
/**********************************************/ while ((num_args=fscanf(fdin,"%s %lf %lf",
net_name,&rise,&fall))!= EOF)
{
/*****************************************************/ /*** Check for correct number of arguments read in ***/
/*****************************************************/ line_num++;
if (num_args != dlArgsPerLine)
{
io_printf("Input error in file %s at line %d\n", file_name, line_num); continue;
}
/****************************************************/ /*** Find 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 dl_ann : net %s not found\n", net_name);
continue;
}
/*******************************************************/ /*** Replace delays on all net drivers in same ***/
October 2000 |
94 |
Product Version 3.2 |
Back Annotation and Delay Calculation |
|
|
Example Listings |
|
|
/*** module as the net |
***/ |
/*******************************************************/ driver = null;
while (driver = acc_next_driver(net,driver))
{
/*** check if driver and net are in same module ***/
prim = acc_handle_parent(driver);
if (acc_handle_parent(prim) != acc_handle_parent(net)) continue;
if (dl_verbose)
{
double newrise, newfall; acc_fetch_delays(prim,&newrise,&newfall); io_printf("Primitive %s had added rise fall delays :
%d %d\n", acc_fetch_fullname(prim), (int)rise, (int)fall);
}
acc_append_delays(driver, rise, fall); if (dl_verbose)
{
double newrise, newfall; acc_fetch_delays(prim,&newrise,&newfall); io_printf("New delays are : %d %d\n",
(int)newrise, (int)newfall);
}
}
}
/* clean up access routines */ acc_close();
}
s_tfcell veriusertfs[] = { {usertask,0,
0,0, dl_read_net_delays,0, "$ba_delays",0},
{0}
};
Interconnect Nets to Lumped or Distributed Delay Cells
Figure 5-2 on page 95 shows an example delay back annotator that requires a delay file that contains interconnect net names and their associated rise and fall delays. Figure 3-6 on page 26 shows an example delay file that follows this syntax. The back annotator reads each net/ delay pair and adds the delays to all primitives that drive the net in all cell instances that have output or inout ports connected to the net. This back annotator must be used with designs that contain cells described with lumped or distributed (primitive output) delay timing, as does the design in Figure 3-1 on page 22 and Figure 3-3 on page 24 .
Figure 5-2 Annotating from interconnect nets to lumped or distributed delay cells
#include <stdio.h> #include "acc_user.h"
October 2000 |
95 |
Product Version 3.2 |
Back Annotation and Delay Calculation
Example Listings
#include "veriuser.h"
#define dlArgsPerLine 3
dl_read_int_delays()
{
FILE *fdin;
char *file_name, net_name[256]; int num_args, line_num = 0; double rise, fall;
handle net, prim, driver; bool dl_verbose = false;
/**********************************/ /*** Initialize access routines ***/
/**********************************/ acc_initialize(); acc_configure(accDevelopmentVersion,"1.5a");
/************************************************************/
/*** Configure so that |
if |
acc_replace_delays needs a hiz |
***/ |
||
/*** |
delay it |
makes it |
the maximum of the input |
***/ |
|
/*** |
rise and |
fall delays |
|
***/ |
|
/************************************************************/ acc_configure(accToHiZDelay,"max");
/********************************************/ /*** Check for +dlverbose on command line ***/
/********************************************/ if (mc_scan_plusargs("dlverbose"))
dl_verbose = true;
/**********************************/ /*** Open delay annotation file ***/
/**********************************/ file_name = tf_strgetp(1,’b’);
if ((fdin = fopen(file_name,"r")) == null)
{
io_printf("file: <%s> not found\n", file_name); return;
}
/**********************************************/ /*** Read and process each line in the file ***/
/**********************************************/ while ((num_args=fscanf(fdin,"%s %lf %lf",
net_name,&rise,&fall)) != EOF)
{
/*****************************************************/ /*** Check for correct number of arguments read in ***/
/*****************************************************/ line_num++;
if (num_args != dlArgsPerLine)
{
io_printf("Input error in file %s at line %d\n", file_name, line_num);
continue;
}
/****************************************************/ /*** Find handle to input net, make sure it is OK ***/
/****************************************************/ net = acc_handle_object(net_name) ;
October 2000 |
96 |
Product Version 3.2 |
