-
Notifications
You must be signed in to change notification settings - Fork 76
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
Hiding assertions code from design tools #49
Comments
Hello @rahuljainNV. I've created a PR #55 which provides a solution for the problem you described. Please tell if the solution is acceptable. |
I could not fully follow the changes, how they are helping in hiding asserts from frontend tools while still enabling them for testbench/simulations. Could you pls explain them a bit? |
My understanding of this issue was that you want to have a way to control the RV_ASSERT_ON define without touching the source code. I assume that the define guard is actually needed there because when unset it effectively "hides" assertions and this is desired. Do you consider |
you are right, need a way to control the RV_ASSERT_ON without touching the source code. A possible solution that I had in mind was to add below guard around RV_ASSERT_ON in common_defines.sv This would be the usage scenario.
This way by default everyone sees the asserts, but if any tool has a problem, it can set SYNTHESIS and then all asserts are hidden from it. |
Alright, so you need an external define to control whether assertions are enabled or not. I'll work on the approach with the "SYNTHESIS" define. |
I've updated the PR #55 so now it generates |
I don't understand all the config system of VeeR, so can't comment on the changes and if they align with general guidelines within VeeR codebase (though I am baffled on how a simple of change of adding ifndef SYTHESIS guard is done using so many files/scripts). |
The output is as intended, here is a fragment:
If that's fine I can merge PR #55 |
Verilator simulations won't compile with enabled assertions ...
On Wednesday, February 22, 2023 at 07:51:01 AM CST, Maciej Kurc ***@***.***> wrote:
The output is as intended, here is a fragment:
...
`define RV_BUILD_AXI4 1
`define CPU_TOP `RV_TOP.veer
`ifndef SYNTHESIS
`define RV_ASSERT_ON 1
`endif
`define RV_LDERR_ROLLBACK 1
`define TOP tb_top
...
If that's fine I can merge PR #55
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
BTW, you guys could use pd_defines.vh file for synthesis flow, instead of common_defines.vh, which is also generated and contains just this :
|
@mkurc-ant looks good to me. |
@algrobman Yes indeed. But that happens even without PR #55. That's why |
Usually, we hide all the assertion code in RTL from frontend tools like synthesis/lint etc.
The core has used below define to add guard against asserts. So we could "not define" this and asserts should get excluded.
However, since this define is already getting set in common_defines.sv directly which has other design defines as well, there is no way to unset this without editing the code.
swerv_el2/rtl/common_defines.sv: `define RV_ASSERT_ON
Should we move this define to outside of design code, so that it is set in verif environment only and not seen by design tools?
The text was updated successfully, but these errors were encountered: