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

[dv] Avoid imports into class scope #26002

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rswarbrick
Copy link
Contributor

There are detailed notes in the commits, but I think this fixes every example where we do the problem.

As such, this fixes #26001.

@rswarbrick rswarbrick added the Component:DV DV issue: testbench, test case, etc. label Jan 24, 2025
@rswarbrick rswarbrick requested a review from a team as a code owner January 24, 2025 10:51
Copy link
Contributor

@marnovandermaas marnovandermaas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for making this PR. Very nice to see these errors fixed instead of waived.

This construct isn't technically allowed by the SystemVerilog
spec (which explicitly says it is illegal to put an import at the top
of a class scope). At least one EDA tool (Questa) reports an error
from this code.

Move the import to the tasks where it is needed.

Signed-off-by: Rupert Swarbrick <[email protected]>
This construct isn't technically allowed by the SystemVerilog
spec (which explicitly says it is illegal to put an import at the top
of a class scope). At least one EDA tool (Questa) reports an error
from this code.

Rather than doing the import, make the resolution explicit (since
there are only two instances)

Signed-off-by: Rupert Swarbrick <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component:DV DV issue: testbench, test case, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Some code in OpenTitan uses "import" at top-level in a class
2 participants