Skip to content

[FIRRTLToHW] Lower FIRRTL prints to Sim and migrate SV lowering logic to SimToSV#10140

Closed
nanjo712 wants to merge 1 commit into
llvm:mainfrom
nanjo712:feat/lower-firrtl-print-to-sim
Closed

[FIRRTLToHW] Lower FIRRTL prints to Sim and migrate SV lowering logic to SimToSV#10140
nanjo712 wants to merge 1 commit into
llvm:mainfrom
nanjo712:feat/lower-firrtl-print-to-sim

Conversation

@nanjo712
Copy link
Copy Markdown
Contributor

@nanjo712 nanjo712 commented Apr 6, 2026

This PR is part of #10131 .

It focuses on the migration of firrtl.printf/ firrtl.fprintf / firrtl.fflush lowering logic and introduce some change in Sim Dialect.

This is a preliminary plan I've proposed based on the current situation. Please point out any errors.

@seldridge
Copy link
Copy Markdown
Member

@prithayan: Are there any implications for our internal flows with this change?

@nanjo712 nanjo712 force-pushed the feat/lower-firrtl-print-to-sim branch 4 times, most recently from 1e8274a to 1eadb40 Compare April 6, 2026 16:00
@nanjo712 nanjo712 force-pushed the feat/lower-firrtl-print-to-sim branch from 1eadb40 to 035ccca Compare April 6, 2026 16:01
Comment thread test/firtool/print.fir
@prithayan
Copy link
Copy Markdown
Contributor

@prithayan: Are there any implications for our internal flows with this change?

Thanks @seldridge for pointing it out. We lower them from FIRRTL dialect to our internal representation, before LowerToHW. So this should not affect them.

Comment thread include/circt/Dialect/Sim/SimOps.td
Comment thread lib/Conversion/SimToSV/SimToSV.cpp
Copy link
Copy Markdown
Member

@uenoku uenoku left a comment

Choose a reason for hiding this comment

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

Thank you, I think this PR is good demonstration for the end-2-end change, but could you to split the PR?

As for sim.print/fflush transition, we want to keep emitting them in the same always block and preserve the relative order (so print -> fflush is called in the same cycle), and we don't have a good way to enforce that yet.

@nanjo712
Copy link
Copy Markdown
Contributor Author

nanjo712 commented Apr 7, 2026

Thanks for feedback, I will split the PR and fix the issue.

@nanjo712
Copy link
Copy Markdown
Contributor Author

nanjo712 commented Apr 8, 2026

I have split the PR into #10146 and #10153. If you have time, please review them.

I will close this PR because it is no longer useful.

@nanjo712 nanjo712 closed this Apr 8, 2026
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.

4 participants