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

parser refuses bit-selection of concatenation #2244

Open
matlupi opened this issue Aug 27, 2024 · 1 comment
Open

parser refuses bit-selection of concatenation #2244

matlupi opened this issue Aug 27, 2024 · 1 comment
Labels
rejects-valid syntax If the parser wrongly rejects syntactically valid code (according to SV-2017).

Comments

@matlupi
Copy link

matlupi commented Aug 27, 2024

Describe the bug

The code below raises an error but is valid according to the LMR

To Reproduce

class test;
  bit [31:0] pattern;
  constraint pattern_c {
    foreach (pattern[i]) if (i!=0) if (i<16) {pattern[15:0],pattern[15:0]}[i+:16] != pattern[15:0];
  }
endclass

Called with

> verible-verilog-lint test.sv

Version (to be tried on a newer version)

> verible-verilog-lint --version
v0.0-3481-gc517d611
Commit    2024-01-05
Built    2024-01-05T17:03:26Z

Actual behavior:

Reject valid syntax by returning an error.
The problem is the selection of the concatenation.

> verible-verilog-lint test.sv
test.sv:4:75: syntax error at token "["
test.sv:5:3: syntax error at token "}"

Expected behavior

As indicated in LRM 11.4.12

One or more bits of a concatenation can be selected as if the concatenation were a packed array with the range [n-1:0]. 
@matlupi matlupi added the rejects-valid syntax If the parser wrongly rejects syntactically valid code (according to SV-2017). label Aug 27, 2024
@matlupi matlupi changed the title parser refuses selection of concatenation parser refuses bit-selection of concatenation Aug 27, 2024
@matlupi
Copy link
Author

matlupi commented Aug 27, 2024

Same problem observed with latest version available.
If I remove the bit-selection, the code is accepted.

Version

> verible-verilog-lint --version
v0.0-3756-gda9a0f8c
Commit    2024-08-23
Built    2024-08-24T03:49:26Z

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