Skip to content

Commit

Permalink
[InstanceChoice] Move specialize options pass earlier in the firtool …
Browse files Browse the repository at this point in the history
…pipeline
  • Loading branch information
prithayan committed Dec 13, 2024
1 parent 6b4bea0 commit 58ae2dc
Showing 1 changed file with 6 additions and 4 deletions.
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

0 comments on commit 58ae2dc

Please sign in to comment.