Should hierarchical names be allowed in value parameter definitions, and more generally, in constant expressions? #1100
martinwhitaker
started this conversation in
General
Replies: 1 comment 1 reply
-
I would expect if it is not allowed in one context then it should not be allowed in another though $bits() is somewhat special since it is really focusing on the type and not the actual value so I understand why we would think it should work differently. Does the standard talk about type parameters having different rules? If so I would argue $bits() should also behave differently. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
IEEE 1800-2017 section 6.20.2 states
so that is a definite no. For constant expressions in general, the syntax in appendix A also appears to exclude it.
Currently Icarus Verilog will reject the direct use of a hierarchical name in a constant expression, but will accept it as the operand of the $bits function in a constant expression. Other simulators I have tried vary - some allow both, some allow neither.
This is relevant to issue #483 and issue #575. I have a fix for the underlying bug, but need to decide what are valid regression tests.
Beta Was this translation helpful? Give feedback.
All reactions