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

Manages a collection of rewriting patterns for combinational logic optimization. More...

#include <CutRewriter.h>

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

Public Member Functions

 CutRewritePatternSet (llvm::SmallVector< std::unique_ptr< CutRewritePattern >, 4 > patterns)
 Constructor that takes ownership of the provided patterns.
 

Private Attributes

llvm::SmallVector< std::unique_ptr< CutRewritePattern >, 4 > patterns
 Owned collection of all rewriting patterns.
 
DenseMap< std::pair< APInt, unsigned >, SmallVector< std::pair< NPNClass, const CutRewritePattern * > > > npnToPatternMap
 Fast lookup table mapping NPN canonical forms to matching patterns.
 
SmallVector< const CutRewritePattern *, 4 > nonTruthTablePatterns
 Patterns that use custom matching logic instead of truth tables.
 

Friends

class CutRewriter
 CutRewriter needs access to internal data structures for pattern matching.
 

Detailed Description

Manages a collection of rewriting patterns for combinational logic optimization.

This class organizes and provides efficient access to rewriting patterns used during cut-based optimization. It maintains:

The pattern set is used by the CutRewriter to find suitable replacements for cuts in the combinational logic network.

Definition at line 401 of file CutRewriter.h.

Constructor & Destructor Documentation

◆ CutRewritePatternSet()

CutRewritePatternSet::CutRewritePatternSet ( llvm::SmallVector< std::unique_ptr< CutRewritePattern >, 4 >  patterns)

Constructor that takes ownership of the provided patterns.

During construction, patterns are analyzed and organized for efficient lookup. Truth table matchers are indexed by their NPN canonical forms.

Definition at line 628 of file CutRewriter.cpp.

References nonTruthTablePatterns, npnToPatternMap, pattern, and patterns.

Friends And Related Symbol Documentation

◆ CutRewriter

friend class CutRewriter
friend

CutRewriter needs access to internal data structures for pattern matching.

Definition at line 426 of file CutRewriter.h.

Member Data Documentation

◆ nonTruthTablePatterns

SmallVector<const CutRewritePattern *, 4> circt::synth::CutRewritePatternSet::nonTruthTablePatterns
private

Patterns that use custom matching logic instead of truth tables.

These patterns are checked against every cut.

Definition at line 423 of file CutRewriter.h.

Referenced by CutRewritePatternSet().

◆ npnToPatternMap

DenseMap<std::pair<APInt, unsigned>, SmallVector<std::pair<NPNClass, const CutRewritePattern *> > > circt::synth::CutRewritePatternSet::npnToPatternMap
private

Fast lookup table mapping NPN canonical forms to matching patterns.

Each entry maps a truth table and input size to patterns that can handle it.

Definition at line 419 of file CutRewriter.h.

Referenced by CutRewritePatternSet().

◆ patterns

llvm::SmallVector<std::unique_ptr<CutRewritePattern>, 4> circt::synth::CutRewritePatternSet::patterns
private

Owned collection of all rewriting patterns.

Definition at line 412 of file CutRewriter.h.

Referenced by CutRewritePatternSet().


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