Add support to $sdf_annotate for RECREM and optional rtriple values

This patch adds support to $sdf_annotate to ignore RECREM constructs
in the SDF file. It also adds the ability to not specify all the
values in a rtriple (e.g. 1.1::1.6).
This commit is contained in:
Cary R 2010-03-18 14:19:52 -07:00 committed by Stephen Williams
parent 47f1286819
commit 6a7675c812
2 changed files with 24 additions and 8 deletions

View File

@ -126,6 +126,7 @@ static struct {
{ "IOPATH", K_IOPATH },
{ "PROCESS", K_PROCESS },
{ "PROGRAM", K_PROGRAM },
{ "RECREM", K_RECREM },
{ "RECOVERY", K_RECOVERY },
{ "REMOVAL", K_REMOVAL },
{ "SDFVERSION", K_SDFVERSION },

View File

@ -45,9 +45,9 @@ char sdf_use_hchar = '.';
%token K_ABSOLUTE K_CELL K_CELLTYPE K_DATE K_DELAYFILE K_DELAY K_DESIGN
%token K_DIVIDER K_HOLD K_INCREMENT K_INSTANCE K_INTERCONNECT K_IOPATH
%token K_NEGEDGE K_POSEDGE K_PROCESS K_PROGRAM K_RECOVERY K_REMOVAL
%token K_SDFVERSION K_SETUP K_SETUPHOLD K_TEMPERATURE K_TIMESCALE
%token K_TIMINGCHECK K_VENDOR K_VERSION K_VOLTAGE K_WIDTH
%token K_NEGEDGE K_POSEDGE K_PROCESS K_PROGRAM K_RECREM K_RECOVERY
%token K_REMOVAL K_SDFVERSION K_SETUP K_SETUPHOLD K_TEMPERATURE
%token K_TIMESCALE K_TIMINGCHECK K_VENDOR K_VERSION K_VOLTAGE K_WIDTH
%token K_01 K_10 K_0Z K_Z1 K_1Z K_Z0
%token HCHAR
@ -60,8 +60,8 @@ char sdf_use_hchar = '.';
%type <string_val> hierarchical_identifier
%type <string_val> port port_instance port_interconnect
%type <real_val> rtriple signed_real_number
%type <delay> delval rvalue
%type <real_val> signed_real_number
%type <delay> delval rvalue rtriple signed_real_number_opt
%type <int_val> edge_identifier
%type <port_with_edge> port_edge port_spec
@ -284,6 +284,7 @@ tchk_def
| '(' K_SETUPHOLD port_tchk port_tchk rvalue rvalue ')'
| '(' K_RECOVERY port_tchk port_tchk rvalue ')'
| '(' K_REMOVAL port_tchk port_tchk rvalue ')'
| '(' K_RECREM port_tchk port_tchk rvalue rvalue ')'
| '(' K_WIDTH port_tchk rvalue ')'
;
@ -369,8 +370,7 @@ rvalue
{ $$.defined = 1;
$$.value = $2; }
| '(' rtriple ')'
{ $$.defined = 1;
$$.value = $2; }
{ $$ = $2; }
| '(' ')'
{ $$.defined = 0;
$$.value = 0.0; }
@ -390,7 +390,7 @@ hierarchical_identifier
;
rtriple
: signed_real_number ':' signed_real_number ':' signed_real_number
: signed_real_number_opt ':' signed_real_number_opt ':' signed_real_number_opt
{ switch(sdf_min_typ_max) {
case _vpiDelaySelMinimum:
$$ = $1;
@ -402,9 +402,24 @@ rtriple
$$ = $5;
break;
}
/* At least one of the values must be defined. */
if (! ($1.defined || $3.defined || $5.defined)) {
vpi_printf("%s:%d: SDF ERROR: rtriple must have at least one "
"defined value.\n", sdf_parse_path, @1.first_line);
}
}
;
signed_real_number_opt
: /* When missing. */
{ $$.value = 0.0;
$$.defined = 0;
}
| signed_real_number
{ $$.value = $1;
$$.defined = 1;
}
signed_real_number
: REAL_NUMBER { $$ = $1; }
| '+' REAL_NUMBER { $$ = $2; }