Ignore bit selects in SDF INTERCONNECT lines.

Icarus does not support interconnect delays so INTERCONNECT is
currently ignored. The SDF parser does not currently support a
bit select as a port_instance. Since we are already ignoring
the INTERCONNECT I added support for bit selects there. This
is probably the most common place to find them.
This commit is contained in:
Cary R 2010-03-04 21:17:36 -08:00 committed by Stephen Williams
parent be67199177
commit df7d65f4d6
2 changed files with 27 additions and 4 deletions

View File

@ -5,7 +5,7 @@
%{
/*
* Copyright (c) 2007-2009 Stephen Williams (steve@icarus.com)
* Copyright (c) 2007-2010 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@ -73,6 +73,12 @@ static int yywrap(void)
<EDGE_ID>[pP][oO][sS][eE][dD][gG][eE] {return K_POSEDGE; }
<EDGE_ID>[nN][eE][gG][eE][dD][gG][eE] {return K_NEGEDGE; }
/* Integer values */
[0-9]+ {
yylval.int_val = strtoul(yytext, 0);
return INTEGER;
}
/* Real values */
[0-9]+(\.[0-9]+)?([Ee][+-]?[0-9]+)? {
yylval.real_val = strtod(yytext, 0);

View File

@ -1,7 +1,7 @@
%{
/*
* Copyright (c) 1998-2009 Stephen Williams (steve@icarus.com)
* Copyright (c) 1998-2010 Stephen Williams (steve@icarus.com)
*
* This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU
@ -58,7 +58,7 @@ char sdf_use_hchar = '.';
%type <string_val> celltype
%type <string_val> cell_instance
%type <string_val> hierarchical_identifier
%type <string_val> port port_instance
%type <string_val> port port_instance port_interconnect
%type <real_val> rtriple signed_real_number
%type <delay> delval rvalue
@ -173,6 +173,11 @@ time_scale
sdf_parse_path, @2.first_line, $3, $4);
free($4);
}
| '(' K_TIMESCALE INTEGER IDENTIFIER ')'
{ if (sdf_flag_inform) vpi_printf("%s:%d:SDF INFO: TIMESCALE : %lu%s\n",
sdf_parse_path, @2.first_line, $3, $4);
free($4);
}
;
cell_list
@ -254,7 +259,8 @@ del_def
| '(' K_IOPATH error ')'
{ vpi_printf("%s:%d: SDF ERROR: Invalid/malformed IOPATH\n",
sdf_parse_path, @2.first_line); }
| '(' K_INTERCONNECT port_instance port_instance delval_list ')'
/* | '(' K_INTERCONNECT port_instance port_instance delval_list ')' */
| '(' K_INTERCONNECT port_interconnect port_interconnect delval_list ')'
{ if (sdf_flag_warning) vpi_printf("%s:%d: SDF WARNING: "
"INTERCONNECT not supported.\n",
sdf_parse_path, @2.first_line);
@ -301,6 +307,14 @@ port
/* | hierarchical_identifier '[' INTEGER ']' */
;
/* Since INTERCONNECT is ignored we can also ignore a vector bit. */
port_interconnect
: hierarchical_identifier
{ $$ = $1; }
| hierarchical_identifier '[' INTEGER ']'
{ $$ = $1;}
;
port_edge
: '(' {start_edge_id();} edge_identifier {stop_edge_id();} port_instance ')'
{ $$.vpi_edge = $3; $$.string_val = $5; }
@ -384,6 +398,9 @@ signed_real_number
: REAL_NUMBER { $$ = $1; }
| '+' REAL_NUMBER { $$ = $2; }
| '-' REAL_NUMBER { $$ = -$2; }
| INTEGER { $$ = $1; }
| '+' INTEGER { $$ = $2; }
| '-' INTEGER { $$ = -$2; }
;
%%