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

Enable SVA in Verilator #200

Merged
merged 8 commits into from
Oct 20, 2023

Conversation

michael-platzer
Copy link
Contributor

This PR removes the ifndef .. endif blocks that exclude the assertions from Verilator simulation, thus enabling them in Verilator as well. Hence, the PR fixes #199. As explained in that issue, Verilator has had support for assert properties since at least version 3.922 released in 2018 and support for the implication operator has been added in version 4.026 released in 2020.

Three files use a default disable (e.g., default disable iff !rst_ni;), which is not supported by Verilator. The default disable has been left in place, but additionally a disable statement has been added to all assert properties of those files.

Note that stream_xbar and stream_omega_net both have the following default disable, which appears to be incorrect:

default disable iff rst_ni;

Given the suffix of rst_ni, the reset signal appears to be inverted (i.e., low active) and the SVA should probably be disabled if rst_ni is low rather than high. I have not modified the default disable for these files but the individual disable statements for each assert property disable the assertion if rst_ni is low instead. Please let me know whether this default is intended behavior or whether this should be fixed.

All modified files lint successfully in Verilator 5.002.

@michael-platzer
Copy link
Contributor Author

Ping @niwis ⏰ 🙃

@niwis
Copy link
Collaborator

niwis commented Oct 19, 2023

Thanks a lot, @michael-platzer! I had a chat with @bluewww, and perhaps it would make sense to keep the ability to turn off assertions without doing so (at least per default) for verilator. This would imply replacing `ifndef VERILATOR by something more generic like `ifndef ASSERTS_OFF. Then the user could decide individually whether to include the assertions for a project/target. What do you think?

I agree that the default disable iff in stream_xbar and stream_omega_net looks wrong and should probably be fixed.

@michael-platzer michael-platzer force-pushed the verilator_asserts branch 2 times, most recently from a381b59 to 61532ea Compare October 19, 2023 08:11
@michael-platzer
Copy link
Contributor Author

Thanks @niwis for the feedback, I have replaced the `ifndef VERILATOR by `ifndef ASSERTS_OFF as you suggested. The last two commits fix the default disable in stream_xbar and stream_omega_net.

Please let me know if you are happy with the changes.

@bluewww
Copy link
Contributor

bluewww commented Oct 19, 2023

I think its better if we name the macro COMMON_CELLS_ASSERTS_OFF. This allows people to be more selective about the assertions. @niwis

@niwis
Copy link
Collaborator

niwis commented Oct 19, 2023

@michael-platzer sorry for the back and forth, but could you rename the macro accordingly? Then we can merge this

@michael-platzer
Copy link
Contributor Author

@michael-platzer sorry for the back and forth

No worries 🙂 Macro is renamed.

@niwis
Copy link
Collaborator

niwis commented Oct 20, 2023

Thanks a lot! Could you fix the exceeding line lengths for linting to pass?

@michael-platzer
Copy link
Contributor Author

Could you fix the exceeding line lengths for linting to pass?

Done, CI looks good now.

Copy link
Collaborator

@niwis niwis left a comment

Choose a reason for hiding this comment

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

Awesome, thanks a lot!

@niwis niwis merged commit 52f83ee into pulp-platform:master Oct 20, 2023
5 checks passed
@michael-platzer michael-platzer deleted the verilator_asserts branch October 20, 2023 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No assertions in Verilator
3 participants