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

Parameter of an array of enumeration values breaks conditionals inside a generate block #1484

Closed
veripoolbot opened this issue Jul 30, 2019 · 3 comments
Labels
resolution: duplicate Closed; issue or pull request already exists

Comments

@veripoolbot
Copy link
Contributor


Author Name: John Martin (@emmicro-us)
Original Redmine Issue: 1484 from https://www.veripool.org


This was tested using the Verilator 4.016 release. When using a parameter that is an array of enumeration values inside an if (or case) condition of a generate block triggers the following errors:
%Error: test.sv:48: Illegal assignment of constant to unpacked array
%Error: test.sv:48: Generate If condition must evaluate to constant

When changing the array to be packed Verilator will throw only warnings; however the generate block does not evaluate the condition correctly. Attached is a test case that demonstrates this. The example simulates correctly with Incisive and synthesizes with Design Compiler. Icarus Verilog and Yosys unfortunately don't support this syntax.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2019-07-30T19:36:40Z


Thanks for the report & test. This is a duplicate of #�, on which work is currently in progress.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2019-11-10T01:32:17Z


Note #� is fixed in git, now this example fails with

%Error: t/t_param_array6.v:58: Illegal assignment of constant to unpacked array

This is because of a mistake in the provided source, it should be

parameter OpType_t OP_MODULES[MAX_NUM_OPS] = '{

(Note the tick). With that change this test passes.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: John Martin (@emmicro-us)
Original Date: 2019-11-10T01:43:54Z


Silly mistake :( Thank you for looking at it!

@veripoolbot veripoolbot added the resolution: duplicate Closed; issue or pull request already exists label Dec 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolution: duplicate Closed; issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

1 participant