CIRCT 24.0.0git
Loading...
Searching...
No Matches
circt::synth Namespace Reference

Classes

struct  Object
struct  DebugPoint
struct  OpenPath
class  DataflowPath
struct  LongestPathAnalysisOptions
 Configuration options for the longest path analysis. More...
class  LongestPathAnalysis
class  IncrementalLongestPathAnalysis
class  LongestPathCollection
class  ResourceUsageAnalysis
 Analysis that computes resource usage for Synth dialect operations. More...
class  ValueWithArrivalTime
 Helper class for delay-aware tree building. More...
struct  Signal
 Edge representation in the logic network. More...
struct  LogicNetworkGate
 Represents a single gate/node in the flat logic network. More...
class  LogicNetwork
 Flat logic network representation for efficient cut enumeration. More...
struct  MatchResult
 Result of matching a cut against a pattern. More...
class  MatchedPattern
 Represents a cut that has been successfully matched to a rewriting pattern. More...
class  Cut
 Represents a cut in the combinational logic network. More...
class  CutSet
 Manages a collection of cuts for a single logic node using priority cuts algorithm. More...
struct  CutRewriterOptions
 Configuration options for the cut-based rewriting algorithm. More...
struct  CutEnumeratorStats
class  TrackedSpecificBumpPtrAllocator
class  CutEnumerator
 Cut enumeration engine for combinational logic networks. More...
struct  CutRewritePattern
 Base class for cut rewriting patterns used in combinational logic optimization. More...
class  CutRewritePatternSet
 Manages a collection of rewriting patterns for combinational logic optimization. More...
class  CutRewriter
 Main cut-based rewriting algorithm for combinational logic optimization. More...
struct  CombLoweringPipelineOptions
 Options for the aig lowering pipeline. More...
struct  SynthOptimizationPipelineOptions
 Options for the synth optimization pipeline. More...

Typedefs

using DelayType = int64_t

Enumerations

enum  OptimizationStrategy { OptimizationStrategyArea , OptimizationStrategyTiming }
 Optimization strategy. More...

Functions

llvm::json::Value toJSON (const circt::synth::DataflowPath &path)
void registerSynthAnalysisPrerequisitePasses ()
void populateVariadicAndInverterLoweringPatterns (mlir::RewritePatternSet &patterns)
void populateVariadicXorInverterLoweringPatterns (mlir::RewritePatternSet &patterns)
bool isLogicNetworkOp (mlir::Operation *op)
LogicalResult topologicallySortGraphRegionBlocks (mlir::Operation *op, llvm::function_ref< bool(mlir::Value, mlir::Operation *)> isOperandReady)
 This function performs a topological sort on the operations within each block of graph regions in the given operation.
template<typename T>
T buildBalancedTreeWithArrivalTimes (llvm::ArrayRef< T > elements, llvm::function_ref< T(T, T)> combine)
 Build a balanced binary tree using a priority queue to greedily pair elements with earliest arrival times.
template<typename T>
T evaluateDotLogic (const T &x, const T &y, const T &z)
 Evaluate the Boolean function x ^ (z | (x & y)).
template<typename T>
T evaluateMajorityLogic (const T &a, const T &b, const T &c)
llvm::APInt invertBooleanLogic (llvm::APInt value)
llvm::KnownBits invertBooleanLogic (llvm::KnownBits value)
llvm::KnownBits applyInputInversion (llvm::KnownBits value, bool inverted)
template<typename T>
T evaluateOneHotLogic (const T &a, const T &b, const T &c)
template<typename T>
T evaluateMuxLogic (const T &a, const T &b, const T &c)
template<typename T>
T evaluateGambleLogic (const T &a, const T &b, const T &c)
LogicalResult topologicallySortLogicNetwork (mlir::Operation *op)
FailureOr< BinaryTruthTable > getTruthTable (ValueRange values, Block *block)
 Get the truth table for operations within a block.
void buildCombLoweringPipeline (mlir::OpPassManager &pm, const CombLoweringPipelineOptions &options)
 Populate the synthesis pipelines.
void buildSynthOptimizationPipeline (mlir::OpPassManager &pm, const SynthOptimizationPipelineOptions &options)
void registerSynthesisPipeline ()
 Register the synthesis pipelines.

Variables

static constexpr unsigned maxTruthTableInputs = 16
 Maximum number of inputs supported for truth table generation.

Typedef Documentation

◆ DelayType

using circt::synth::DelayType = int64_t

Definition at line 40 of file CutRewriter.h.

Enumeration Type Documentation

◆ OptimizationStrategy

Optimization strategy.

Enumerator
OptimizationStrategyArea 

Optimize for minimal area.

OptimizationStrategyTiming 

Optimize for minimal critical path delay.

Definition at line 24 of file SynthPasses.h.

Function Documentation

◆ applyInputInversion()

llvm::KnownBits circt::synth::applyInputInversion ( llvm::KnownBits value,
bool inverted )
inline

Definition at line 154 of file SynthOps.h.

◆ buildBalancedTreeWithArrivalTimes()

template<typename T>
T circt::synth::buildBalancedTreeWithArrivalTimes ( llvm::ArrayRef< T > elements,
llvm::function_ref< T(T, T)> combine )

Build a balanced binary tree using a priority queue to greedily pair elements with earliest arrival times.

This minimizes the critical path delay.

Template parameters: T - The element type (must have operator> defined)

The algorithm uses a min-heap to repeatedly combine the two elements with the earliest arrival times, which is optimal for minimizing maximum delay.

Definition at line 105 of file SynthOps.h.

References assert().

◆ buildCombLoweringPipeline()

void circt::synth::buildCombLoweringPipeline ( mlir::OpPassManager & pm,
const CombLoweringPipelineOptions & options )

Populate the synthesis pipelines.

Referenced by registerSynthesisPipeline().

◆ buildSynthOptimizationPipeline()

void circt::synth::buildSynthOptimizationPipeline ( mlir::OpPassManager & pm,
const SynthOptimizationPipelineOptions & options )

◆ evaluateDotLogic()

template<typename T>
T circt::synth::evaluateDotLogic ( const T & x,
const T & y,
const T & z )

Evaluate the Boolean function x ^ (z | (x & y)).

Definition at line 135 of file SynthOps.h.

Referenced by applyGateSemantics().

◆ evaluateGambleLogic()

template<typename T>
T circt::synth::evaluateGambleLogic ( const T & a,
const T & b,
const T & c )

Definition at line 173 of file SynthOps.h.

References invertBooleanLogic().

Referenced by applyGateSemantics().

◆ evaluateMajorityLogic()

template<typename T>
T circt::synth::evaluateMajorityLogic ( const T & a,
const T & b,
const T & c )

Definition at line 140 of file SynthOps.h.

Referenced by applyGateSemantics().

◆ evaluateMuxLogic()

template<typename T>
T circt::synth::evaluateMuxLogic ( const T & a,
const T & b,
const T & c )

Definition at line 168 of file SynthOps.h.

References invertBooleanLogic().

Referenced by applyGateSemantics().

◆ evaluateOneHotLogic()

template<typename T>
T circt::synth::evaluateOneHotLogic ( const T & a,
const T & b,
const T & c )

Definition at line 162 of file SynthOps.h.

References invertBooleanLogic().

Referenced by applyGateSemantics().

◆ getTruthTable()

FailureOr< BinaryTruthTable > circt::synth::getTruthTable ( ValueRange values,
Block * block )

Get the truth table for operations within a block.

Definition at line 308 of file CutRewriter.cpp.

References circt::createVarMask(), circt::hw::getBitWidth(), and maxTruthTableInputs.

Referenced by getNPNClassFromModule().

◆ invertBooleanLogic() [1/2]

llvm::APInt circt::synth::invertBooleanLogic ( llvm::APInt value)
inline

Definition at line 144 of file SynthOps.h.

Referenced by evaluateGambleLogic(), evaluateMuxLogic(), and evaluateOneHotLogic().

◆ invertBooleanLogic() [2/2]

llvm::KnownBits circt::synth::invertBooleanLogic ( llvm::KnownBits value)
inline

Definition at line 149 of file SynthOps.h.

◆ isLogicNetworkOp()

bool circt::synth::isLogicNetworkOp ( mlir::Operation * op)

◆ populateVariadicAndInverterLoweringPatterns()

void circt::synth::populateVariadicAndInverterLoweringPatterns ( mlir::RewritePatternSet & patterns)

◆ populateVariadicXorInverterLoweringPatterns()

void circt::synth::populateVariadicXorInverterLoweringPatterns ( mlir::RewritePatternSet & patterns)

◆ registerSynthAnalysisPrerequisitePasses()

void circt::synth::registerSynthAnalysisPrerequisitePasses ( )
inline

Definition at line 361 of file LongestPathAnalysis.h.

◆ registerSynthesisPipeline()

void circt::synth::registerSynthesisPipeline ( void )

Register the synthesis pipelines.

Definition at line 155 of file SynthesisPipeline.cpp.

References buildCombLoweringPipeline(), and buildSynthOptimizationPipeline().

Referenced by registerSynthesisPipeline().

◆ toJSON()

llvm::json::Value circt::synth::toJSON ( const circt::synth::DataflowPath & path)

Definition at line 433 of file LongestPathAnalysis.cpp.

References toJSON().

Referenced by toJSON(), toJSON(), toJSON(), toJSON(), and toJSON().

◆ topologicallySortGraphRegionBlocks()

LogicalResult circt::synth::topologicallySortGraphRegionBlocks ( mlir::Operation * op,
llvm::function_ref< bool(mlir::Value, mlir::Operation *)> isOperandReady )

This function performs a topological sort on the operations within each block of graph regions in the given operation.

It uses MLIR's topological sort utility as a wrapper, ensuring that operations are ordered such that all operands are defined before their uses. The isOperandReady callback allows customization of when an operand is considered ready for sorting.

Definition at line 543 of file SynthOps.cpp.

References success().

◆ topologicallySortLogicNetwork()

LogicalResult circt::synth::topologicallySortLogicNetwork ( mlir::Operation * op)

Variable Documentation

◆ maxTruthTableInputs

unsigned circt::synth::maxTruthTableInputs = 16
staticconstexpr

Maximum number of inputs supported for truth table generation.

This limit prevents excessive memory usage as truth table size grows exponentially with the number of inputs (2^n entries).

Definition at line 45 of file CutRewriter.h.

Referenced by getNPNClassFromModule(), and getTruthTable().