Skip to content

[FIRRTLToHW] Lower FIRRTL prints to Sim#10153

Open
nanjo712 wants to merge 2 commits intollvm:mainfrom
nanjo712:feat/lower-firrtl-print-to-sim-v2
Open

[FIRRTLToHW] Lower FIRRTL prints to Sim#10153
nanjo712 wants to merge 2 commits intollvm:mainfrom
nanjo712:feat/lower-firrtl-print-to-sim-v2

Conversation

@nanjo712
Copy link
Copy Markdown
Contributor

@nanjo712 nanjo712 commented Apr 8, 2026

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.

ClockType:$clock,
I1:$condition
I1:$condition,
DefaultValuedAttr<BoolAttr, "false">:$usePrintfCond
Copy link
Copy Markdown
Member

@uenoku uenoku Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want to carry FIRRTL thing here. Could you try if it's possible to push PRINTF_COND to condition?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@nanjo712 nanjo712 force-pushed the feat/lower-firrtl-print-to-sim-v2 branch 4 times, most recently from 37cf0fa to b4ef3ab Compare April 8, 2026 12:50
@nanjo712 nanjo712 force-pushed the feat/lower-firrtl-print-to-sim-v2 branch from b4ef3ab to 2f1d03e Compare April 8, 2026 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants