-
Notifications
You must be signed in to change notification settings - Fork 317
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[firtool] Add an option to emit HW MLIR into file #8169
Conversation
tools/firtool/firtool.cpp
Outdated
@@ -456,6 +494,11 @@ static LogicalResult processBuffer( | |||
if (failed(firtool::populateHWToBTOR2(pm, firtoolOptions, | |||
(*outputFile)->os()))) | |||
return failure(); | |||
|
|||
// If requseted, emit the HW IR to hwOutFile. |
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.
*requested
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.
Generally, excited for this, just one general question.
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.
Really excited for this! For any tool or analysis that wants to start from an HW design, this is going to be very valuable!
Is possible for adding a c-api for this? |
It's a bit tricky to do that because the option is not pipeline option strictly speaking (The option is not added to FirtoolOption intentionally). In CAPI you can manually dump IR after HW lowering if you necessary, and I think it's more flexible. So let me first merge the PR and add CAPI if it turned it's really necessary. |
This PR adds
-output-hw-mlir
option to firtool which emits HW IR into file in a similar way to-output-final-mlir
.This PR adds
DumpIR
pass to simplify the emission. It's currently not exposed to other tool as it's very specific to firtool pipeline (actually the pass indirectly uses cl options defined in firtool.cpp)