[FIRRTLToHW] Lower FIRRTL prints to Sim#10153
Open
Conversation
uenoku
reviewed
Apr 8, 2026
| ClockType:$clock, | ||
| I1:$condition | ||
| I1:$condition, | ||
| DefaultValuedAttr<BoolAttr, "false">:$usePrintfCond |
Member
There was a problem hiding this comment.
We don't want to carry FIRRTL thing here. Could you try if it's possible to push PRINTF_COND to condition?
Contributor
There was a problem hiding this comment.
An alternative could be to have the wrapping in PRINTF_COND be a SimToSV pass lowering option which the firtool pipeline could set. That would allow us to use the Sim ops, and then have a uniform FIRRTL-flavored emission in firtool, while still allowing other CIRCT-based tools to work with the Sim ops directly.
Or, maybe more idiomatic, we could add something like a hw.optional or hw.choice operation which allows you to pick one of a few IR regions based on a configuration parameter, which could be a macro when we emit SV. Maybe?
37cf0fa to
b4ef3ab
Compare
b4ef3ab to
2f1d03e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is part of #10131 , split from #10140.
Since this PR is based on #10146, the current diff for this PR is not accurate. Please review #10146 first.
It focuses on the migration of firrtl.printf/ firrtl.fprintf / firrtl.fflush lowering logic.