Handle instance array of port-less modules.

This commit is contained in:
steve 2004-09-05 18:09:47 +00:00
parent 15059bbfdc
commit 2d498363d7
1 changed files with 21 additions and 1 deletions

22
parse.y
View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#ifdef HAVE_CVS_IDENT #ifdef HAVE_CVS_IDENT
#ident "$Id: parse.y,v 1.197 2004/08/26 04:02:03 steve Exp $" #ident "$Id: parse.y,v 1.198 2004/09/05 18:09:47 steve Exp $"
#endif #endif
# include "config.h" # include "config.h"
@ -1091,6 +1091,22 @@ gate_instance
$$ = tmp; $$ = tmp;
} }
/* Degenerate modules can have no ports. */
| IDENTIFIER range
{ lgate*tmp = new lgate;
svector<PExpr*>*rng = $2;
tmp->name = $1;
tmp->parms = 0;
tmp->range[0] = (*rng)[0];
tmp->range[1] = (*rng)[1];
tmp->file = @1.text;
tmp->lineno = @1.first_line;
delete $1;
delete rng;
$$ = tmp;
}
/* Modules can also take ports by port-name expressions. */ /* Modules can also take ports by port-name expressions. */
| IDENTIFIER '(' port_name_list ')' | IDENTIFIER '(' port_name_list ')'
@ -1620,6 +1636,10 @@ module_item
delete $1; delete $1;
} }
| IDENTIFIER parameter_value_opt error ';'
{ yyerror(@1, "error: Invalid module instantiation");
}
/* Continuous assignment can have an optional drive strength, then /* Continuous assignment can have an optional drive strength, then
an optional delay3 that applies to all the assignments in the an optional delay3 that applies to all the assignments in the
assign_list. */ assign_list. */