From c09b4035da3ad8e3810ddc88344629105ed4dcb2 Mon Sep 17 00:00:00 2001 From: Cary R Date: Tue, 13 Jul 2010 16:12:03 -0700 Subject: [PATCH] The switch gates do not support a strength specification. This patch splits the switch types out of the gates to allow them to be defined to not take a strength specification. (cherry picked from commit df4722b92c556ef88019be624ab1995cdb23d4d7) --- parse.y | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/parse.y b/parse.y index 54a478cb1..47dd01550 100644 --- a/parse.y +++ b/parse.y @@ -343,7 +343,7 @@ static PECallFunction*make_call_function(perm_string tn, PExpr*arg1, PExpr*arg2) %type range range_opt %type dimensions_opt dimensions %type net_type var_type net_type_opt -%type gatetype +%type gatetype switchtype %type port_type %type primitive_type primitive_type_opt %type parameter_value_opt @@ -1672,7 +1672,10 @@ gatetype | K_not { $$ = PGBuiltin::NOT; } | K_notif0 { $$ = PGBuiltin::NOTIF0; } | K_notif1 { $$ = PGBuiltin::NOTIF1; } - | K_nmos { $$ = PGBuiltin::NMOS; } + ; + +switchtype + : K_nmos { $$ = PGBuiltin::NMOS; } | K_rnmos { $$ = PGBuiltin::RNMOS; } | K_pmos { $$ = PGBuiltin::PMOS; } | K_rpmos { $$ = PGBuiltin::RPMOS; } @@ -2179,7 +2182,8 @@ module_item | K_defparam defparam_assign_list ';' /* Most gate types have an optional drive strength and optional - three-value delay. These rules handle the different cases. */ + two/three-value delay. These rules handle the different cases. + We check that the actual number of delays is correct later. */ | attribute_list_opt gatetype gate_instance_list ';' { pform_makegates($2, str_strength, 0, $3, $1); @@ -2197,6 +2201,15 @@ module_item { pform_makegates($2, $3, $4, $5, $1); } + /* The switch type gates do not support a strength. */ + | attribute_list_opt switchtype gate_instance_list ';' + { pform_makegates($2, str_strength, 0, $3, $1); + } + + | attribute_list_opt switchtype delay3 gate_instance_list ';' + { pform_makegates($2, str_strength, $3, $4, $1); + } + /* Pullup and pulldown devices cannot have delays, and their strengths are limited. */