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

Disabling of assert statements #2162

Closed
towoe opened this issue Feb 11, 2020 · 2 comments
Closed

Disabling of assert statements #2162

towoe opened this issue Feb 11, 2020 · 2 comments

Comments

@towoe
Copy link
Contributor

@towoe towoe commented Feb 11, 2020

Since 83a1bd0 it seems to me that regardless of most* settings, assert statements always terminate the simulation.
* +verilator+error+limit+50 will delay the termination.

Previous to the commit I think it was possible to use Verilated::assertOn(false) to disable the termination of the simulation based on the firing of any assert statements in the Verilog code.
And in fact they seem to be only activated if the build option --assert was used.

Is it possible to ignore all asserts, and if yes, what would be the correct way to do that?

@towoe towoe added the new label Feb 11, 2020
@wsnyder wsnyder added effort: hours type: bug and removed new labels Feb 11, 2020
@wsnyder

This comment has been minimized.

Copy link
Member

@wsnyder wsnyder commented Feb 11, 2020

Anything untested will eventually get broken ;)

The intent was not to break assertOn. However probably assertOn should control only what is under assert(...) etc, and not a standalone $error/$warning.

Could you like to attempt a pull request to fix this? The V3Assert code needs to add back the assertOn when not under an AstAssert (etc), plus we need some tests.

@towoe

This comment has been minimized.

Copy link
Contributor Author

@towoe towoe commented Feb 11, 2020

Thanks for the quick response.
Will try to fix this and add some tests for it.

towoe added a commit to towoe/verilator that referenced this issue Feb 14, 2020
Insert the check AssertOn to allow disabling of asserts.
Asserts can be disabled by not using the `--assert` flag and by setting
`AssertOn(false)`.
Add tests for this behavior.

Fixes verilator#2162.

Signed-off-by: Tobias Wölfel <tobias.woelfel@mailbox.org>
towoe added a commit to towoe/verilator that referenced this issue Feb 14, 2020
Insert the check AssertOn to allow disabling of asserts.
Asserts can be disabled by not using the `--assert` flag and by setting
`AssertOn(false)`.
Add tests for this behavior.

Fixes verilator#2162.

Signed-off-by: Tobias Wölfel <tobias.woelfel@mailbox.org>
towoe added a commit to towoe/verilator that referenced this issue Feb 14, 2020
Insert the check AssertOn to allow disabling of asserts.
Asserts can be disabled by not using the `--assert` flag and by setting
`AssertOn(false)`.
Add tests for this behavior.
Bad tests check that the assert still causes a stop.
Non bad tests check that asserts are properly disabled and cause no stop
of the simulation.

Fixes verilator#2162.

Signed-off-by: Tobias Wölfel <tobias.woelfel@mailbox.org>
towoe added a commit to towoe/verilator that referenced this issue Feb 15, 2020
Insert the check AssertOn to allow disabling of asserts.
Asserts can be disabled by not using the `--assert` flag or by calling
`AssertOn(false)`, or passing the "+verilator+noassert" runtime flag.
Add tests for this behavior.
Bad tests check that the assert still causes a stop.
Non bad tests check that asserts are properly disabled and cause no stop
of the simulation.

Fixes verilator#2162.

Signed-off-by: Tobias Wölfel <tobias.woelfel@mailbox.org>
@wsnyder wsnyder closed this in 18f8cd0 Feb 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.