From 2d498363d7f3f62d1bdf46dce76fe2a5f073551f Mon Sep 17 00:00:00 2001 From: steve Date: Sun, 5 Sep 2004 18:09:47 +0000 Subject: [PATCH] Handle instance array of port-less modules. --- parse.y | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/parse.y b/parse.y index db709d292..cc3decb2d 100644 --- a/parse.y +++ b/parse.y @@ -19,7 +19,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #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 # include "config.h" @@ -1091,6 +1091,22 @@ gate_instance $$ = tmp; } + /* Degenerate modules can have no ports. */ + + | IDENTIFIER range + { lgate*tmp = new lgate; + svector*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. */ | IDENTIFIER '(' port_name_list ')' @@ -1620,6 +1636,10 @@ module_item delete $1; } + | IDENTIFIER parameter_value_opt error ';' + { yyerror(@1, "error: Invalid module instantiation"); + } + /* Continuous assignment can have an optional drive strength, then an optional delay3 that applies to all the assignments in the assign_list. */