-
Notifications
You must be signed in to change notification settings - Fork 609
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
Wrap printfs in the Verification layerblock #4506
Conversation
Change the emission of printfs to emit these under the `Verification` layerblock. This is done as part of replacing the `firtool` extract-test-code feature with layers and the "advanced layer sink" `firtool` feature. The extract-test-code feature will extract asserts _and_ printfs together. This is technically a deviation from this behavior. However, it seems better to not lump these in with asserts. Nonetheless, this is a backwards compatible change from the perspective of extract-test-code because the `Verification` layer is always loaded if the `Assert` layer is present. (Prints will always show up if you turn on assertions.) In the future, we probably want to add a `Debug` layer under the `Verification` layer where these will live. I would like to hold off on making this change until extract-test-code is gone. Signed-off-by: Schuyler Eldridge <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -8,24 +8,20 @@ import circt.stage.ChiselStage | |||
class SinglePrintfTester() extends Module { | |||
val x = 254.U | |||
printf("x=%x", x) | |||
stop() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This stop is removed so that the test can simply check if a layerblock shows up. Stops are placed under layerblocks which means that the test would pass even without the change in this PR to move printfs under layers.
FileCheck would really help here. 🙃
What if user specially want to put the printf into another layer? |
If the user wraps them in any other layer, then the printf will go in that layer. If the user puts them in a module with layers enabled, then they will not be put in a layer. This is using the same additional arguments that So, a user can override this on a case-by-case basis. If the user wants to globally change a layer to another layer or if they cannot change the printfs, then they need to use the |
neat! |
Change the emission of printfs to emit these under the
Verification
layerblock. This is done as part of replacing thefirtool
extract-test-code feature with layers and the "advanced layer sink"firtool
feature.The extract-test-code feature will extract asserts and printfs together. This is technically a deviation from this behavior. However, it seems better to not lump these in with asserts. Nonetheless, this is a backwards compatible change from the perspective of extract-test-code because the
Verification
layer is always loaded if theAssert
layer is present. (Prints will always show up if you turn on assertions.)In the future, we probably want to add a
Debug
layer under theVerification
layer where these will live. I would like to hold off on making this change until extract-test-code is gone.Release Notes
Move printfs under the
Verification
layer by default.