CIRCT 22.0.0git
|
A generic K-input LUT pattern that can implement any boolean function with up to K inputs using a lookup table. More...
Public Member Functions | |
GenericLUT (mlir::MLIRContext *context, unsigned k) | |
bool | match (const Cut &cut) const override |
Check if a cut matches this pattern. | |
llvm::FailureOr< Operation * > | rewrite (mlir::OpBuilder &rewriter, Cut &cut) const override |
Return a new operation that replaces the matched cut. | |
double | getArea (const Cut &cut) 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 override |
Get the number of inputs this pattern expects. | |
unsigned | getNumOutputs () const override |
Get the number of outputs this pattern produces. | |
StringRef | getPatternName () const override |
Get the name of this pattern. Used for debugging. | |
![]() | |
CutRewritePattern (mlir::MLIRContext *context) | |
virtual | ~CutRewritePattern ()=default |
Virtual destructor for base class. | |
virtual bool | useTruthTableMatcher (SmallVectorImpl< NPNClass > &matchingNPNClasses) const |
Specify truth tables that this pattern can match. | |
virtual LocationAttr | getLoc () const |
Get location for this pattern(optional). | |
mlir::MLIRContext * | getContext () const |
Public Attributes | |
unsigned | k |
A generic K-input LUT pattern that can implement any boolean function with up to K inputs using a lookup table.
Definition at line 43 of file GenericLUTMapper.cpp.
|
inline |
Definition at line 46 of file GenericLUTMapper.cpp.
|
inlineoverridevirtual |
Get the area cost of this pattern.
Implements circt::synth::CutRewritePattern.
Definition at line 86 of file GenericLUTMapper.cpp.
|
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 91 of file GenericLUTMapper.cpp.
|
inlineoverridevirtual |
Get the number of inputs this pattern expects.
Implements circt::synth::CutRewritePattern.
Definition at line 96 of file GenericLUTMapper.cpp.
References k.
|
inlineoverridevirtual |
Get the number of outputs this pattern produces.
Implements circt::synth::CutRewritePattern.
Definition at line 98 of file GenericLUTMapper.cpp.
|
inlineoverridevirtual |
Get the name of this pattern. Used for debugging.
Reimplemented from circt::synth::CutRewritePattern.
Definition at line 100 of file GenericLUTMapper.cpp.
|
inlineoverridevirtual |
Check if a cut matches this pattern.
This method is called to determine if a cut can be replaced by this pattern. If useTruthTableMatcher() returns true, this method is only called for cuts with matching truth tables.
Implements circt::synth::CutRewritePattern.
Definition at line 49 of file GenericLUTMapper.cpp.
References circt::synth::Cut::getInputSize(), circt::synth::Cut::getOutputSize(), and k.
|
inlineoverridevirtual |
Return a new operation that replaces the matched cut.
Unlike MLIR's RewritePattern framework which allows arbitrary in-place modifications, this method creates a new operation to replace the matched cut rather than modifying existing operations. This constraint exists because the cut enumerator maintains references to operations throughout the circuit, making it safe to only replace the root operation of each cut while preserving all other operations unchanged.
Implements circt::synth::CutRewritePattern.
Definition at line 54 of file GenericLUTMapper.cpp.
References circt::synth::Cut::dump(), circt::synth::Cut::getInputSize(), circt::synth::Cut::getRoot(), circt::synth::Cut::getTruthTable(), circt::synth::Cut::inputs, and k.
unsigned GenericLUT::k |
Definition at line 44 of file GenericLUTMapper.cpp.
Referenced by getNumInputs(), match(), and rewrite().