Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[InstanceChoice] Move specialize options pass earlier in the firtool pipeline #7988

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions lib/Firtool/Firtool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ LogicalResult firtool::populatePreprocessTransforms(mlir::PassManager &pm,
LogicalResult firtool::populateCHIRRTLToLowFIRRTL(mlir::PassManager &pm,
const FirtoolOptions &opt,
StringRef inputFilename) {
// TODO: Ensure instance graph and other passes can handle instance choice
// then run this pass after all diagnostic passes have run.
pm.addNestedPass<firrtl::CircuitOp>(firrtl::createSpecializeOptionPass(
opt.shouldSelectDefaultInstanceChoice()));
pm.nest<firrtl::CircuitOp>().addPass(firrtl::createLowerSignaturesPass());

pm.nest<firrtl::CircuitOp>().addPass(firrtl::createInjectDUTHierarchyPass());
Expand Down Expand Up @@ -131,10 +135,8 @@ LogicalResult firtool::populateCHIRRTLToLowFIRRTL(mlir::PassManager &pm,

pm.addNestedPass<firrtl::CircuitOp>(firrtl::createCheckCombLoopsPass());

// Must run the specialize instance-choice and layers passes after all
// diagnostic passes have run, otherwise it can hide errors.
pm.addNestedPass<firrtl::CircuitOp>(firrtl::createSpecializeOptionPass(
opt.shouldSelectDefaultInstanceChoice()));
// Must run this pass after all diagnostic passes have run, otherwise it can
// hide errors.
pm.addNestedPass<firrtl::CircuitOp>(firrtl::createSpecializeLayersPass());

// Run after inference, layer specialization.
Expand Down
Loading