|
CIRCT 23.0.0git
|
Manages a collection of cuts for a single logic node using priority cuts algorithm. More...
#include <CutRewriter.h>

Public Member Functions | |
| bool | isMatched () const |
| Check if this cut set has a valid matched pattern. | |
| Cut * | getBestMatchedCut () const |
| Get the cut associated with the best matched pattern. | |
| void | finalize (const CutRewriterOptions &options, llvm::function_ref< std::optional< MatchedPattern >(const Cut &)> matchCut, const LogicNetwork &logicNetwork) |
| Finalize the cut set by removing duplicates and selecting the best pattern. | |
| unsigned | size () const |
| Get the number of cuts in this set. | |
| void | addCut (Cut *cut) |
| Add a new cut to this set using bump allocator. | |
| ArrayRef< Cut * > | getCuts () const |
| Get read-only access to all cuts in this set. | |
Private Attributes | |
| llvm::SmallVector< Cut *, 12 > | cuts |
| Collection of cuts for this node. | |
| Cut * | bestCut = nullptr |
| bool | isFrozen = false |
| Whether cut set is finalized. | |
Manages a collection of cuts for a single logic node using priority cuts algorithm.
Each node in the combinational logic network can have multiple cuts representing different ways to group it with surrounding logic. The CutSet manages these cuts and selects the best one based on the optimization strategy (area or timing).
The priority cuts algorithm maintains a bounded set of the most promising cuts to avoid exponential explosion while ensuring good optimization results.
Definition at line 496 of file CutRewriter.h.
| void CutSet::addCut | ( | Cut * | cut | ) |
Add a new cut to this set using bump allocator.
NOTE: The cut set must not be frozen
Definition at line 640 of file CutRewriter.cpp.
References assert(), cuts, and isFrozen.
Referenced by circt::synth::CutEnumerator::getCutSet().
| void CutSet::finalize | ( | const CutRewriterOptions & | options, |
| llvm::function_ref< std::optional< MatchedPattern >(const Cut &)> | matchCut, | ||
| const LogicNetwork & | logicNetwork | ||
| ) |
Finalize the cut set by removing duplicates and selecting the best pattern.
Definition at line 716 of file CutRewriter.cpp.
References assert(), bestCut, compareDelayAndArea(), cuts, circt::synth::Cut::getMatchedPattern(), isFrozen, circt::synth::CutRewriterOptions::maxCutInputSize, circt::synth::CutRewriterOptions::maxCutSizePerRoot, removeDuplicateAndNonMinimalCuts(), and circt::synth::CutRewriterOptions::strategy.
| Cut * CutSet::getBestMatchedCut | ( | ) | const |
Get the cut associated with the best matched pattern.
Definition at line 636 of file CutRewriter.cpp.
References bestCut.
| ArrayRef< Cut * > CutSet::getCuts | ( | ) | const |
Get read-only access to all cuts in this set.
Definition at line 645 of file CutRewriter.cpp.
References cuts.
Referenced by circt::synth::CutEnumerator::visitLogicOp().
|
inline |
Check if this cut set has a valid matched pattern.
Definition at line 504 of file CutRewriter.h.
References bestCut.
| unsigned CutSet::size | ( | ) | const |
Get the number of cuts in this set.
Definition at line 638 of file CutRewriter.cpp.
References cuts.
Referenced by esiaccel.types.ArrayType::bit_width(), esiaccel.types.ArrayType::deserialize(), and esiaccel.types.ArrayType::is_valid().
|
private |
Definition at line 499 of file CutRewriter.h.
Referenced by finalize(), getBestMatchedCut(), and isMatched().
|
private |
Collection of cuts for this node.
Definition at line 498 of file CutRewriter.h.
Referenced by addCut(), finalize(), getCuts(), and size().
|
private |
Whether cut set is finalized.
Definition at line 500 of file CutRewriter.h.
Referenced by addCut(), and finalize().