Undriven "C-like Top-level Signals" in SystemVerilog model #851
Replies: 2 comments
-
The idea is the Previously we have used genuinely very C-like SystemVerilog where we both read and wrote to toplevel signals, and that didn't cause us any issues other than some debugging features in Jasper not liking it very much, so I guess it depends on the tool? |
Beta Was this translation helpful? Give feedback.
-
I agree that passing all those signals through the module’s I/Os can be quite cumbersome. From my experience, this approach works well when the generated model is used as the top-level module. However, when it is instantiated inside another module, EDA tools require the full hierarchical path to the signal; otherwise, they won’t be able to locate it. In the example above, I modified the references to That said, the change was done manually on the generated model, which is neither efficient nor sustainable in the long term. I was wondering if this adjustment could be automated via the compiler or if there’s a more elegant workaround available? |
Beta Was this translation helpful? Give feedback.
-
Issue
I encountered failures in formal verification testbenches on the Sail-generated SystemVerilog (SV) model caused by "C-like top-level signals."
These signals are declared at the top level, outside any module, and are referenced within modules without being explicitly passed as inputs or declared internally. Consequently, they are treated as undriven signals, which leads to garbage values and failures during simulation.
Example:
zero_reg
SignalBelow is a snippet illustrating the issue with the zero_reg signal:
Problem Summary
The
zero_reg
signal is declared at the top level but is neither passed as an input nor declared as an internal signal in modules such as rX.SystemVerilog does not support C-like global variables, so such signals are treated as undriven, leading to incorrect behavior.
Request for Suggestions
Has anyone encountered a similar issue? If so, do you have ideas for fixes or workarounds?
Possible directions might include:
Any feedback or suggestions would be greatly appreciated!
Many thanks,
Nicolas
Beta Was this translation helpful? Give feedback.
All reactions