CIRCT 23.0.0git
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
circt::synth::CutSet Class Reference

Manages a collection of cuts for a single logic node using priority cuts algorithm. More...

#include <CutRewriter.h>

Collaboration diagram for circt::synth::CutSet:
Collaboration graph
[legend]

Public Member Functions

bool isMatched () const
 Check if this cut set has a valid matched pattern.
 
CutgetBestMatchedCut () 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.
 
CutbestCut = nullptr
 
bool isFrozen = false
 Whether cut set is finalized.
 

Detailed Description

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.

Member Function Documentation

◆ addCut()

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().

◆ finalize()

void CutSet::finalize ( const CutRewriterOptions options,
llvm::function_ref< std::optional< MatchedPattern >(const Cut &)>  matchCut,
const LogicNetwork logicNetwork 
)

◆ getBestMatchedCut()

Cut * CutSet::getBestMatchedCut ( ) const

Get the cut associated with the best matched pattern.

Definition at line 636 of file CutRewriter.cpp.

References bestCut.

◆ getCuts()

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().

◆ isMatched()

bool circt::synth::CutSet::isMatched ( ) const
inline

Check if this cut set has a valid matched pattern.

Definition at line 504 of file CutRewriter.h.

References bestCut.

◆ size()

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().

Member Data Documentation

◆ bestCut

Cut* circt::synth::CutSet::bestCut = nullptr
private

Definition at line 499 of file CutRewriter.h.

Referenced by finalize(), getBestMatchedCut(), and isMatched().

◆ cuts

llvm::SmallVector<Cut *, 12> circt::synth::CutSet::cuts
private

Collection of cuts for this node.

Definition at line 498 of file CutRewriter.h.

Referenced by addCut(), finalize(), getCuts(), and size().

◆ isFrozen

bool circt::synth::CutSet::isFrozen = false
private

Whether cut set is finalized.

Definition at line 500 of file CutRewriter.h.

Referenced by addCut(), and finalize().


The documentation for this class was generated from the following files: