Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

verible-verilog-syntax does not support dimensioned parameter in list of parameter assignments #2152

Open
craigc40 opened this issue Apr 2, 2024 · 0 comments
Labels
rejects-valid syntax If the parser wrongly rejects syntactically valid code (according to SV-2017).

Comments

@craigc40
Copy link

craigc40 commented Apr 2, 2024

Describe the bug

Valid syntax rejected. Verible-verilog-syntax does not seem to support a dimensioned parameter in a list of parameter assignments.

Version

% verible-verilog-syntax --version
    v0.0-3471-g9cb45092
    Commit	2023-12-23
    Built	2023-12-23T08:07:18Z 

To Reproduce

Given testme.sv as follows:

module testme (sig1, sig2);

  parameter integer
    PRAM1 = 0,
    PRAM_ARY [3:0] = '{default:8};

  input sig1;
  output logic sig2;

  assign sig2 = (PRAM_ARY[1]>4)? sig1 : '0;

endmodule

Run

verible-verilog-syntax testme.sv

Actual behavior:

Code rejected

testme.sv:6:14: syntax error at token "["

Expected behavior

Accepts syntax

SV-2017 spec section 6.20.1 Parameter declaration syntax

parameter_declaration ::= parameter data_type_or_implicit list_of_param_assignments
| parameter type list_of_type_assignments

list_of_param_assignments ::= param_assignment { , param_assignment }

param_assignment ::=
parameter_identifier { unpacked_dimension } [ = constant_param_expression ]

@craigc40 craigc40 added the rejects-valid syntax If the parser wrongly rejects syntactically valid code (according to SV-2017). label Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rejects-valid syntax If the parser wrongly rejects syntactically valid code (according to SV-2017).
Projects
None yet
Development

No branches or pull requests

1 participant