Closed stieeev closed 1 month ago
Saw a Stack Overflow post that seems relevant:
One interesting usage is - considering an innocent looking footnote in Chapter 9.4 of the standard:
The rules for globally static expressions imply that a declared constant or a generic may be initialized with an expression that is not globally static, for example, with a call to an impure function. The resulting constant value may be globally static, even though its initial value expression is not.
Yes you're correct, this check is overly strict.
hdl.zip
The attached example file top.vhd instantiates work.ram with a generic set to the value INIT_LINE("default.txt"), which is not a globally static expression. nvc 1.12.0 fails this with an error:
Questasim 2022.3 doesn't bat an eyelid with this, not even a warning.
I'm not expert in the VHDL standards, but I guess the requirement for globally static expressions applies to ports but not to generics ?