Skip to content

Commit

Permalink
[FIRRTL][CheckCombLoops] Switch to the new pass checkCombLoops instea…
Browse files Browse the repository at this point in the history
…d of checkCombCycles (#4513)

Switch to the new CheckCombLoops pass and add a flag
 `--use-old-check-comb-cycles` to switch to the old `CheckCombCycles` pass.
  • Loading branch information
prithayan authored Jan 10, 2023
1 parent e6a9e33 commit 0cf02d2
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions tools/firtool/firtool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,11 @@ static cl::opt<bool>
cl::desc("Disable the CheckCombCycles pass"),
cl::init(false), cl::Hidden, cl::cat(mainCategory));

static cl::opt<bool> useOldCheckCombCycles(
"use-old-check-comb-cycles",
cl::desc("Use old CheckCombCycles pass, that does not support aggregates"),
cl::init(false), cl::Hidden, cl::cat(mainCategory));

static cl::opt<bool> disableIMDCE("disable-imdce",
cl::desc("Disable the IMDCE pass"),
cl::init(false), cl::Hidden,
Expand Down Expand Up @@ -692,14 +697,16 @@ static LogicalResult processBuffer(
firrtl::createRandomizeRegisterInitPass());

if (!disableCheckCombCycles) {
// TODO: Currently CheckCombCyles pass doesn't support aggregates so skip
// the pass for now.
if (preserveAggregate == firrtl::PreserveAggregate::None)
pm.nest<firrtl::CircuitOp>().addPass(firrtl::createCheckCombCyclesPass());
else
emitWarning(module->getLoc())
<< "CheckCombCyclesPass doens't support aggregate "
"values yet so it is skipped\n";
if (useOldCheckCombCycles) {
if (preserveAggregate == firrtl::PreserveAggregate::None)
pm.nest<firrtl::CircuitOp>().addPass(
firrtl::createCheckCombCyclesPass());
else
emitWarning(module->getLoc())
<< "CheckCombCyclesPass doens't support aggregate "
"values yet so it is skipped\n";
} else
pm.nest<firrtl::CircuitOp>().addPass(firrtl::createCheckCombLoopsPass());
}

// If we parsed a FIRRTL file and have optimizations enabled, clean it up.
Expand Down

0 comments on commit 0cf02d2

Please sign in to comment.