From b6a39db627678d633830189ca5f1d4169273abfe Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Wed, 27 Aug 2014 07:57:20 -0400 Subject: [PATCH] Fix optional parameter keyword in module #(), bug810. --- Changes | 2 ++ src/verilog.y | 12 +++++++----- test_regress/t/t_param.v | 4 ++-- veripool-logo.png | Bin 885 -> 0 bytes 4 files changed, 11 insertions(+), 7 deletions(-) delete mode 100644 veripool-logo.png diff --git a/Changes b/Changes index fb9f3ef20..fff4d3836 100644 --- a/Changes +++ b/Changes @@ -15,6 +15,8 @@ indicates the contributor was also the author of the fix; Thanks! **** Fix over-shift structure optimization error, bug803. [Jeff Bush] +**** Fix optional parameter keyword in module #(), bug810. [Iztok Jeras] + * Verilator 3.862 2014-06-10 diff --git a/src/verilog.y b/src/verilog.y index f92215efc..5e4d86947 100644 --- a/src/verilog.y +++ b/src/verilog.y @@ -841,8 +841,7 @@ paramPortDeclOrArgList: // IEEE: list_of_param_assignments + { parameter_ paramPortDeclOrArg: // IEEE: param_assignment + parameter_port_declaration // // We combine the two as we can't tell which follows a comma - param_assignment { $$ = $1; } - | parameter_port_declarationFront param_assignment { $$ = $2; } + parameter_port_declarationFrontE param_assignment { $$ = $2; } ; portsStarE: // IEEE: .* + list_of_ports + list_of_port_declarations + empty @@ -1149,10 +1148,13 @@ parameter_declarationFront: // IEEE: parameter_declaration w/o assignment //UNSUP varGParamReset yTYPE { /*VARRESET-in-varGParam*/ VARDTYPE($2); } ; -parameter_port_declarationFront: // IEEE: parameter_port_declaration w/o assignment +parameter_port_declarationFrontE: // IEEE: parameter_port_declaration w/o assignment // // IEEE: parameter_declaration (minus assignment) - parameter_declarationFront { } - // + varGParamReset implicit_typeE { /*VARRESET-in-varGParam*/ VARDTYPE($2); } + | varGParamReset data_type { /*VARRESET-in-varGParam*/ VARDTYPE($2); } + | implicit_typeE { /*VARRESET-in-varGParam*/ VARDTYPE($1); } + | data_type { /*VARRESET-in-varGParam*/ VARDTYPE($1); } + //UNSUP varGParamReset yTYPE { /*VARRESET-in-varGParam*/ VARDTYPE($2); } //UNSUP data_type { VARDTYPE($1); } //UNSUP yTYPE { VARDTYPE($1); } ; diff --git a/test_regress/t/t_param.v b/test_regress/t/t_param.v index 9e7402cc5..8418cf417 100644 --- a/test_regress/t/t_param.v +++ b/test_regress/t/t_param.v @@ -46,8 +46,8 @@ module m1; initial if (PACKED_PARAM != 8'h36) $stop; endmodule -module m2; - parameter PAR2 = 10; +// bug 810 +module m2 #(/*parameter*/ integer PAR2 = 10); initial begin $display("%x",PAR2); if (PAR2 !== 2) $stop; diff --git a/veripool-logo.png b/veripool-logo.png deleted file mode 100644 index 6ca0a537ba175a0767e9a8c5477399d1ac97fe4e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 885 zcmV-*1B(2KP)Px#U{Fj{MgRZ*l#{s5oSX^@5`Y8+k0~x@4k?^;kpTg4xT(}oPh+4$LcMx=GcAXr zU29MvUM?;-y|?BY8zppfkA@KxuZ*xHBx{pQUXD0Jg9r+M006+i@tJ1-0A~L)%*-=0 znORV`aR2}S0d!JMQvg8b*k%9#00Cl4M??UK1szBL000SaNLh0L01FcU01FcV0GgZ_ z00007bV*G`2iyV{4lNRYmn(Vz00MzYL_t(Y$HkV5wxTc$MZtirB8U~iMlb#Uznr8G zpom^@)|xqB=_8w@B@~n7Ur55F0pDR#eUAZb#^7sA$=HAbs6m4Iv?SE1XBe;zNcjnq zi-B?%c+VV;dV?v+L(0->z!caelTt2WD$tUGgAgRsmZMoNVb;t>LZ@;z&bb{?gGsb( zV1sfKbQ23U95Fjgtiu=si%EBf7@K&TW3^pE|M*5sg&gwU;KiG?Q= zB}A3I>B+9Qhp(ERucjxqPE#9c5H?Je4tRqZ(^9OW$wx{YL75dQL0y}{AJ)*CbpogY zR-B>yVHv}PuNv3(7uU}2im=3RNje;8;LO;V^kb&Lg