[FIRRTLToHW] Add support for lower-to-core in firrtl.fflush#10545
[FIRRTLToHW] Add support for lower-to-core in firrtl.fflush#10545nanjo712 wants to merge 6 commits into
Conversation
9182b5d to
922f713
Compare
| ; CHECK-NEXT: [[FILE2:%.+]] = sim.get_file [[FMTFILE2]] | ||
| ; CHECK-NEXT: sim.proc.print [[MSG]] to [[FILE2]] | ||
| ; CHECK-NEXT: } | ||
| ; CHECK: sim.triggered %clock if %enable { |
There was a problem hiding this comment.
I know it's a hard problem but is there a way/plan to merge fprintf/fflush in the same sim.triggered statement? Or are we going to introduce a token type to provide order in graph region?
There was a problem hiding this comment.
We have a SquashSimTriggered pass in the Sim dialect to merge sim.triggered operations with the same clock, while sinking the condition to an internal scf.if. For now, I believe this should be sufficient to maintain the current behavior of FIRRTL to SV.
|
Regarding the need to introduce tokens to provide order semantics in graph regions, my personal understanding is that simply providing order semantics in the downstream dialect might not be very meaningful. If we need a sufficiently strong order guarantee, I think we would need to make some modifications at least at the FIRRTL level. Based on my own observations, I think introducing a process block in FIRRTL would be a simpler approach, and tokens are also a common practice. At this point, I'm not entirely sure which approach we would prefer. |
FIRRTL uses SSACFG, so it's ordered arguably. However in Sim dialect the order of sim.triggered is not defined. |
Sorry for my misunderstanding, that makes sense.
Can we execute SquashSimTriggered as early as possible after FIRRTLToHW to maintain the order as much as possible? This is also the main purpose of introducing this pass. |
922f713 to
8fbe8bf
Compare
|
In the firtool pipeline, I added a Squash pass after LowerToHW. Currently, this behavior seems to be as expected? |
8fbe8bf to
cec5065
Compare
It seems better if this was handled as part of the |
cec5065 to
fc379a2
Compare
This is reasonable because a post-hoc pass appears to split the FIRRTL conversion process into two parts. I tried to mimic the approach of Look forward to your feedback! |
|
Hi @nanjo712, |
Thank you for discussing this topic on ODM; I have already took a look on #7676. I hope we can eventually reach a consensus regarding the modeling of the ordering of side-effect operations. |
Add support for lower-to-core in firrtl.fflush
Part of #10131