CIRCT 22.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) |
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. | |
ArrayRef< Cut > | getCuts () const |
Get read-only access to all cuts in this set. | |
Private Attributes | |
llvm::SmallVector< Cut, 4 > | 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 188 of file CutRewriter.h.
void CutSet::addCut | ( | Cut | cut | ) |
Add a new cut to this set.
NOTE: The cut set must not be frozen
Definition at line 442 of file CutRewriter.cpp.
void CutSet::finalize | ( | const CutRewriterOptions & | options, |
llvm::function_ref< std::optional< MatchedPattern >(const Cut &)> | matchCut | ||
) |
Finalize the cut set by removing duplicates and selecting the best pattern.
This method:
Definition at line 509 of file CutRewriter.cpp.
References assert(), bestCut, cuts, circt::synth::Cut::getMatchedPattern(), isFrozen, circt::synth::CutRewriterOptions::maxCutInputSize, circt::synth::CutRewriterOptions::maxCutSizePerRoot, and removeDuplicateAndNonMinimalCuts().
Cut * CutSet::getBestMatchedCut | ( | ) | const |
Get the cut associated with the best matched pattern.
Definition at line 438 of file CutRewriter.cpp.
References bestCut.
ArrayRef< Cut > CutSet::getCuts | ( | ) | const |
Get read-only access to all cuts in this set.
Definition at line 447 of file CutRewriter.cpp.
References cuts.
|
inline |
Check if this cut set has a valid matched pattern.
Definition at line 196 of file CutRewriter.h.
References bestCut.
unsigned CutSet::size | ( | ) | const |
Get the number of cuts in this set.
Definition at line 440 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 191 of file CutRewriter.h.
Referenced by finalize(), getBestMatchedCut(), and isMatched().
|
private |
Collection of cuts for this node.
Definition at line 190 of file CutRewriter.h.
Referenced by addCut(), finalize(), getCuts(), and size().
|
private |
Whether cut set is finalized.
Definition at line 192 of file CutRewriter.h.
Referenced by addCut(), and finalize().