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 > nonNPNPatterns
 Patterns that use custom matching logic instead of NPN lookup.
 

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 454 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 625 of file CutRewriter.cpp.

References nonNPNPatterns, 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 479 of file CutRewriter.h.

Member Data Documentation

◆ nonNPNPatterns

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

Patterns that use custom matching logic instead of NPN lookup.

These patterns are checked against every cut.

Definition at line 476 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 472 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 465 of file CutRewriter.h.

Referenced by CutRewritePatternSet().


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