|
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) | |
| std::optional< MatchResult > | match (CutEnumerator &enumerator, const Cut &cut) const override |
| Check if a cut matches this pattern and compute area/delay metrics. | |
| llvm::FailureOr< Operation * > | rewrite (mlir::OpBuilder &rewriter, CutEnumerator &enumerator, const Cut &cut) const override |
| Return a new operation that replaces the matched cut. | |
| 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. | |
Public Member Functions inherited from circt::synth::CutRewritePattern | |
| 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 |
| SmallVector< DelayType, 8 > | cachedDelays |
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 47 of file GenericLUTMapper.cpp.
|
inlineoverridevirtual |
Get the number of outputs this pattern produces.
Implements circt::synth::CutRewritePattern.
Definition at line 91 of file GenericLUTMapper.cpp.
|
inlineoverridevirtual |
Get the name of this pattern. Used for debugging.
Reimplemented from circt::synth::CutRewritePattern.
Definition at line 93 of file GenericLUTMapper.cpp.
|
inlineoverridevirtual |
Check if a cut matches this pattern and compute area/delay metrics.
This method is called to determine if a cut can be replaced by this pattern. If the cut matches, it should return a MatchResult containing the area and per-input delays for this specific cut.
If useTruthTableMatcher() returns true, this method is only called for cuts with matching truth tables.
Implements circt::synth::CutRewritePattern.
Definition at line 50 of file GenericLUTMapper.cpp.
References cachedDelays, 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 61 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.
| SmallVector<DelayType, 8> GenericLUT::cachedDelays |
Definition at line 45 of file GenericLUTMapper.cpp.
Referenced by match().
| unsigned GenericLUT::k |
Definition at line 44 of file GenericLUTMapper.cpp.