CIRCT 22.0.0git
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
TechLibraryPattern Struct Reference

Simple technology library encoded as a HWModuleOp. More...

Inheritance diagram for TechLibraryPattern:
Inheritance graph
[legend]
Collaboration diagram for TechLibraryPattern:
Collaboration graph
[legend]

Public Member Functions

 TechLibraryPattern (hw::HWModuleOp module, double area, SmallVector< SmallVector< DelayType, 2 >, 4 > delay, NPNClass npnClass)
 
StringRef getPatternName () const override
 Get the name of this pattern. Used for debugging.
 
bool match (const Cut &cut) const override
 Match the cut set against this library primitive.
 
bool useTruthTableMatcher (SmallVectorImpl< NPNClass > &matchingNPNClasses) const override
 Enable truth table matching for this pattern.
 
llvm::FailureOr< Operation * > rewrite (mlir::OpBuilder &builder, Cut &cut) const override
 Rewrite the cut set using this library primitive.
 
double getArea () const override
 Get the area cost of this pattern.
 
DelayType getDelay (unsigned inputIndex, unsigned outputIndex) const override
 Get the delay between specific input and output.
 
unsigned getNumInputs () const
 
unsigned getNumOutputs () const override
 Get the number of outputs this pattern produces.
 
LocationAttr getLoc () const override
 Get location for this pattern(optional).
 
- Public Member Functions inherited from circt::synth::CutRewritePattern
 CutRewritePattern (mlir::MLIRContext *context)
 
virtual ~CutRewritePattern ()=default
 Virtual destructor for base class.
 
mlir::MLIRContext * getContext () const
 

Private Attributes

const double area
 
const SmallVector< SmallVector< DelayType, 2 >, 4 > delay
 
hw::HWModuleOp NPNClass npnClass
 

Detailed Description

Simple technology library encoded as a HWModuleOp.

Definition at line 88 of file TechMapper.cpp.

Constructor & Destructor Documentation

◆ TechLibraryPattern()

TechLibraryPattern::TechLibraryPattern ( hw::HWModuleOp  module,
double  area,
SmallVector< SmallVector< DelayType, 2 >, 4 >  delay,
NPNClass  npnClass 
)
inline

Definition at line 89 of file TechMapper.cpp.

Member Function Documentation

◆ getArea()

double TechLibraryPattern::getArea ( ) const
inlineoverridevirtual

Get the area cost of this pattern.

Implements circt::synth::CutRewritePattern.

Definition at line 135 of file TechMapper.cpp.

References area.

◆ getDelay()

DelayType TechLibraryPattern::getDelay ( unsigned  inputIndex,
unsigned  outputIndex 
) const
inlineoverridevirtual

Get the delay between specific input and output.

NOTE: The input index is already permuted according to the pattern's input permutation, so it's not necessary to account for it here.

Implements circt::synth::CutRewritePattern.

Definition at line 137 of file TechMapper.cpp.

References delay.

◆ getLoc()

LocationAttr TechLibraryPattern::getLoc ( ) const
inlineoverridevirtual

Get location for this pattern(optional).

Reimplemented from circt::synth::CutRewritePattern.

Definition at line 149 of file TechMapper.cpp.

◆ getNumInputs()

unsigned TechLibraryPattern::getNumInputs ( ) const
inline

Definition at line 141 of file TechMapper.cpp.

◆ getNumOutputs()

unsigned TechLibraryPattern::getNumOutputs ( ) const
inlineoverridevirtual

Get the number of outputs this pattern produces.

Implements circt::synth::CutRewritePattern.

Definition at line 145 of file TechMapper.cpp.

◆ getPatternName()

StringRef TechLibraryPattern::getPatternName ( ) const
inlineoverridevirtual

Get the name of this pattern. Used for debugging.

Reimplemented from circt::synth::CutRewritePattern.

Definition at line 105 of file TechMapper.cpp.

◆ match()

bool TechLibraryPattern::match ( const Cut cut) const
inlineoverridevirtual

Match the cut set against this library primitive.

Implements circt::synth::CutRewritePattern.

Definition at line 111 of file TechMapper.cpp.

References circt::NPNClass::equivalentOtherThanPermutation(), circt::synth::Cut::getNPNClass(), and npnClass.

◆ rewrite()

llvm::FailureOr< Operation * > TechLibraryPattern::rewrite ( mlir::OpBuilder &  builder,
Cut cut 
) const
inlineoverridevirtual

Rewrite the cut set using this library primitive.

Implements circt::synth::CutRewritePattern.

Definition at line 123 of file TechMapper.cpp.

References circt::synth::Cut::getPermutatedInputs(), circt::synth::Cut::getRoot(), and npnClass.

◆ useTruthTableMatcher()

bool TechLibraryPattern::useTruthTableMatcher ( SmallVectorImpl< NPNClass > &  matchingNPNClasses) const
inlineoverridevirtual

Enable truth table matching for this pattern.

Reimplemented from circt::synth::CutRewritePattern.

Definition at line 116 of file TechMapper.cpp.

References npnClass.

Member Data Documentation

◆ area

const double TechLibraryPattern::area
private

Definition at line 155 of file TechMapper.cpp.

Referenced by getArea().

◆ delay

const SmallVector<SmallVector<DelayType, 2>, 4> TechLibraryPattern::delay
private

Definition at line 156 of file TechMapper.cpp.

Referenced by getDelay(), and synth.DataflowPath::to_flamegraph().

◆ npnClass

hw::HWModuleOp NPNClass TechLibraryPattern::npnClass
private

Definition at line 158 of file TechMapper.cpp.

Referenced by match(), rewrite(), and useTruthTableMatcher().


The documentation for this struct was generated from the following file: