Closed YikeZhou closed 7 months ago
Unfortunately, that test case is invalid. If the test used export prim_util_pkg::get_5;
in lc_ctrl_state_pkg
, it would work as expected.
From Section 26.6 of IEEE 1800-2017:
By default, declarations imported into a package are not visible by way of subsequent imports of that package. Package export declarations allow a package to specify that imported declarations are to be made visible in subsequent imports.
Thank you so much for guiding me to the proper section. I really appreciate it! In my opinion, sv2v seems to behave quite reasonably. (In case you haven't already tried it, I just tried the four commercial simulators on edaplayground.com as you suggested in another issue. Half of them accepted the code without error. I suppose encountering such "undefined behaviors" in SystemVerilog is not that uncommon, is it?)
In my opinion, sv2v seems to behave quite reasonably.
I'm glad you agree!
I just tried the four commercial simulators on edaplayground.com as you suggested in another issue. Half of them accepted the code without error. I suppose encountering such "undefined behaviors" in SystemVerilog is not that uncommon, is it?
Indeed, there are numerous ambiguities within the SystemVerilog specification. However, it's important to distinguish:
These two sets have limited overlap. In this case, there is disagreement among tools, but I think the specification is unambiguous.
Please consider this example. It comes from tests/ImportFunction/top.sv in the UHDM-integration-tests repository.
When running
I got
Importing
get_5()
inside the module declaration seems to work, though.