CIRCT 22.0.0git
|
#include "circt/Dialect/Synth/Transforms/CutRewriter.h"
#include "circt/Dialect/AIG/AIGOps.h"
#include "circt/Dialect/Comb/CombOps.h"
#include "circt/Dialect/HW/HWOps.h"
#include "circt/Support/LLVM.h"
#include "circt/Support/NPNClass.h"
#include "circt/Support/UnusedOpPruner.h"
#include "mlir/Analysis/TopologicalSortUtils.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/Operation.h"
#include "mlir/IR/RegionKindInterface.h"
#include "mlir/IR/Value.h"
#include "mlir/IR/ValueRange.h"
#include "mlir/IR/Visitors.h"
#include "mlir/Support/LLVM.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/Bitset.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/ScopeExit.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/iterator.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/LogicalResult.h"
#include <algorithm>
#include <functional>
#include <memory>
#include <optional>
#include <string>
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "synth-cut-rewriter" |
Functions | |
static bool | isSupportedLogicOp (mlir::Operation *op) |
static void | simulateLogicOp (Operation *op, DenseMap< Value, llvm::APInt > &eval) |
static bool | isAlwaysCutInput (Value value) |
static bool | compareDelayAndArea (OptimizationStrategy strategy, double newArea, ArrayRef< DelayType > newDelay, double oldArea, ArrayRef< DelayType > oldDelay) |
template<typename OpRange > | |
static FailureOr< BinaryTruthTable > | computeTruthTable (mlir::ValueRange values, const OpRange &ops, const llvm::SmallSetVector< mlir::Value, 4 > &inputArgs) |
Get the truth table for an op. | |
static Cut | getAsTrivialCut (mlir::Value value) |
static bool | isCutDerivedFromOperand (const Cut &cut, Operation *op) |
static void | removeDuplicateAndNonMinimalCuts (SmallVectorImpl< Cut > &cuts) |
static StringRef | getTestVariableName (Value value, DenseMap< OperationName, unsigned > &opCounter) |
Generate a human-readable name for a value used in test output. | |
#define DEBUG_TYPE "synth-cut-rewriter" |
Definition at line 55 of file CutRewriter.cpp.
|
static |
Definition at line 108 of file CutRewriter.cpp.
References circt::synth::OptimizationStrategyArea, circt::synth::OptimizationStrategyTiming, and strategy.
Referenced by circt::synth::CutRewriter::patternMatchCut().
|
static |
Get the truth table for an op.
Definition at line 156 of file CutRewriter.cpp.
References assert(), isSupportedLogicOp(), circt::synth::maxTruthTableInputs, pattern, and simulateLogicOp().
Referenced by circt::synth::Cut::getTruthTable(), and circt::synth::getTruthTable().
|
static |
Definition at line 308 of file CutRewriter.cpp.
References circt::synth::Cut::inputs.
Referenced by circt::synth::CutEnumerator::getCutSet(), and circt::synth::CutEnumerator::visitLogicOp().
|
static |
Generate a human-readable name for a value used in test output.
This function creates meaningful names for values to make debug output and test results more readable and understandable.
Definition at line 803 of file CutRewriter.cpp.
Referenced by circt::synth::CutEnumerator::dump().
|
static |
Definition at line 92 of file CutRewriter.cpp.
References isSupportedLogicOp().
Referenced by circt::synth::Cut::mergeWith(), circt::synth::CutRewriter::patternMatchCut(), and circt::synth::CutRewriter::runBottomUpRewrite().
|
static |
Definition at line 317 of file CutRewriter.cpp.
References assert(), circt::synth::Cut::getRoot(), circt::synth::Cut::inputs, and circt::synth::Cut::isTrivialCut().
Referenced by circt::synth::Cut::mergeWith(), and circt::synth::Cut::reRoot().
|
static |
Definition at line 60 of file CutRewriter.cpp.
Referenced by computeTruthTable(), isAlwaysCutInput(), simulateLogicOp(), circt::synth::topologicallySortLogicNetwork(), and circt::synth::CutEnumerator::visit().
|
static |
Definition at line 467 of file CutRewriter.cpp.
Referenced by circt::synth::CutSet::finalize().
|
static |
Definition at line 66 of file CutRewriter.cpp.
References assert(), and isSupportedLogicOp().
Referenced by computeTruthTable().