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

Multi dimensional variable in function causing issues #1414

veripoolbot opened this issue Apr 3, 2019 · 1 comment

Multi dimensional variable in function causing issues #1414

veripoolbot opened this issue Apr 3, 2019 · 1 comment


Copy link

@veripoolbot veripoolbot commented Apr 3, 2019

Author Name: Johan Wouters
Original Redmine Issue: 1414 from


I added a small example of a structure that causes issues in our codebase. We use a function to calculate a localparam and Verilator seems to fail because the function contains a multi-dimensional variable.

The message I get is:
%Error: test.v:19: Expecting expression to be constant, but can't determine constant for FUNCREF 'problematic function'
%Error: test.v:13 ... Location of non-constant ASSIGN: LHS isn't simple variable

this is with Verilator 4.012 and swithes -sv -Wno-lint -cc test.v --top-module test

The code can be simulated, logic synthesis and logic equivalence checking also works fine

Copy link
Contributor Author

@veripoolbot veripoolbot commented Jun 15, 2019

Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2019-06-15T13:38:27Z

Sorry, forgot to reply to this when filed. This is duplicate of #�, basically at present you can't have unpacked arrays in constant functions. A woraround is to use a packed array.

 reg signed [127:0] [0:4-1] blah;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant