CIRCT 24.0.0git
Loading...
Searching...
No Matches
LocalVisitor Class Reference
Collaboration diagram for LocalVisitor:

Public Types

using ObjectToMaxDistance

Public Member Functions

 LocalVisitor (hw::HWModuleOp module, Context *ctx)
LogicalResult initializeAndRun ()
void waitUntilDone () const
FailureOr< ArrayRef< OpenPath > > getOrComputePaths (Value value, size_t bitPos)
ArrayRef< OpenPath > getCachedPaths (Value value, size_t bitPos) const
void getInternalPaths (SmallVectorImpl< DataflowPath > &results) const
void setTopLevel ()
bool isTopLevel () const
hw::HWModuleOp getHWModuleOp () const
const auto & getFromInputPortToEndPoint () const
const auto & getFromOutputPortToStartPoint () const
const auto & getEndPointResults () const
circt::igraph::InstancePathCache * getInstancePathCache () const
llvm::ImmutableListFactory< DebugPoint > * getDebugPointFactory () const

Private Member Functions

void putUnclosedResult (const Object &object, int64_t delay, llvm::ImmutableList< DebugPoint > history, ObjectToMaxDistance &objectToMaxDistance)
LogicalResult initializeAndRun (hw::InstanceOp instance)
LogicalResult initializeAndRun (hw::OutputOp output)
LogicalResult visitValue (Value value, size_t bitPos, SmallVectorImpl< OpenPath > &results)
LogicalResult visit (mlir::BlockArgument argument, size_t bitPos, SmallVectorImpl< OpenPath > &results)
LogicalResult visit (hw::InstanceOp op, size_t bitPos, size_t resultNum, SmallVectorImpl< OpenPath > &results)
LogicalResult visit (hw::WireOp op, size_t bitPos, SmallVectorImpl< OpenPath > &results)
LogicalResult visit (comb::ConcatOp op, size_t bitPos, SmallVectorImpl< OpenPath > &results)
LogicalResult visit (comb::ExtractOp op, size_t bitPos, SmallVectorImpl< OpenPath > &results)
LogicalResult visit (comb::ReplicateOp op, size_t bitPos, SmallVectorImpl< OpenPath > &results)
std::pair< Value, size_t > findLeader (Value value, size_t bitpos) const
LogicalResult markEquivalent (Value from, size_t fromBitPos, Value to, size_t toBitPos, SmallVectorImpl< OpenPath > &results)
LogicalResult visit (BooleanLogicOpInterface op, size_t bitPos, SmallVectorImpl< OpenPath > &results)
LogicalResult visit (comb::AndOp op, size_t bitPos, SmallVectorImpl< OpenPath > &results)
LogicalResult visit (comb::XorOp op, size_t bitPos, SmallVectorImpl< OpenPath > &results)
LogicalResult visit (comb::OrOp op, size_t bitPos, SmallVectorImpl< OpenPath > &results)
LogicalResult visit (comb::MuxOp op, size_t bitPos, SmallVectorImpl< OpenPath > &results)
LogicalResult addLogicOp (Operation *op, size_t bitPos, SmallVectorImpl< OpenPath > &results)
LogicalResult visit (comb::TruthTableOp op, size_t bitPos, SmallVectorImpl< OpenPath > &results)
LogicalResult visit (hw::ConstantOp op, size_t bitPos, SmallVectorImpl< OpenPath > &results)
LogicalResult visit (seq::FirRegOp op, size_t bitPos, SmallVectorImpl< OpenPath > &results)
LogicalResult visit (seq::CompRegOp op, size_t bitPos, SmallVectorImpl< OpenPath > &results)
LogicalResult visit (seq::FirMemReadOp op, size_t bitPos, SmallVectorImpl< OpenPath > &results)
LogicalResult visit (seq::FirMemReadWriteOp op, size_t bitPos, SmallVectorImpl< OpenPath > &results)
LogicalResult visitDefault (OpResult result, size_t bitPos, SmallVectorImpl< OpenPath > &results)
LogicalResult addEdge (Value to, size_t toBitPos, int64_t delay, SmallVectorImpl< OpenPath > &results)
LogicalResult markStartPoint (Value value, size_t bitPos, SmallVectorImpl< OpenPath > &results)
LogicalResult markRegEndPoint (Value endPoint, Value start, Value reset={}, Value resetValue={}, Value enable={})

Private Attributes

llvm::MapVector< std::pair< BlockArgument, size_t >, ObjectToMaxDistance > fromInputPortToEndPoint
llvm::MapVector< std::tuple< size_t, size_t >, ObjectToMaxDistance > fromOutputPortToStartPoint
llvm::EquivalenceClasses< std::pair< Value, size_t > > ec
DenseMap< std::pair< Value, size_t >, std::pair< Value, size_t > > ecMap
hw::HWModuleOp module
Context * ctx
std::unique_ptr< circt::igraph::InstancePathCache > instancePathCache
std::unique_ptr< llvm::ImmutableListFactory< DebugPoint > > debugPointFactory
DenseMap< std::pair< Value, size_t >, std::unique_ptr< SmallVector< OpenPath > > > cachedResults
DenseMap< Object, SmallVector< OpenPath > > endPointResults
std::unique_ptr< OperationAnalyzer > operationAnalyzer
std::atomic_bool done
std::condition_variable cv
std::mutex mutex
bool topLevel = false

Detailed Description

Definition at line 579 of file LongestPathAnalysis.cpp.

Member Typedef Documentation

◆ ObjectToMaxDistance

Initial value:
std::pair<int64_t, llvm::ImmutableList<DebugPoint>>>

Definition at line 595 of file LongestPathAnalysis.cpp.

Constructor & Destructor Documentation

◆ LocalVisitor()

LocalVisitor::LocalVisitor ( hw::HWModuleOp module,
Context * ctx )

Member Function Documentation

◆ addEdge()

LogicalResult LocalVisitor::addEdge ( Value to,
size_t toBitPos,
int64_t delay,
SmallVectorImpl< OpenPath > & results )
private

Definition at line 855 of file LongestPathAnalysis.cpp.

References failure(), getOrComputePaths(), and success().

Referenced by addLogicOp(), visit(), visit(), and visitDefault().

◆ addLogicOp()

LogicalResult LocalVisitor::addLogicOp ( Operation * op,
size_t bitPos,
SmallVectorImpl< OpenPath > & results )
private

Definition at line 1035 of file LongestPathAnalysis.cpp.

References addEdge(), ctx, failure(), filterPaths(), and success().

Referenced by visit(), visit(), visit(), and visit().

◆ findLeader()

std::pair< Value, size_t > LocalVisitor::findLeader ( Value value,
size_t bitpos ) const
inlineprivate

Definition at line 660 of file LongestPathAnalysis.cpp.

References ec.

◆ getCachedPaths()

ArrayRef< OpenPath > LocalVisitor::getCachedPaths ( Value value,
size_t bitPos ) const

Definition at line 762 of file LongestPathAnalysis.cpp.

References cachedResults, ec, and getCachedPaths().

Referenced by getCachedPaths().

◆ getDebugPointFactory()

llvm::ImmutableListFactory< DebugPoint > * LocalVisitor::getDebugPointFactory ( ) const
inline

Definition at line 616 of file LongestPathAnalysis.cpp.

References debugPointFactory.

◆ getEndPointResults()

const auto & LocalVisitor::getEndPointResults ( ) const
inline

Definition at line 610 of file LongestPathAnalysis.cpp.

References endPointResults.

◆ getFromInputPortToEndPoint()

const auto & LocalVisitor::getFromInputPortToEndPoint ( ) const
inline

Definition at line 604 of file LongestPathAnalysis.cpp.

References fromInputPortToEndPoint.

◆ getFromOutputPortToStartPoint()

const auto & LocalVisitor::getFromOutputPortToStartPoint ( ) const
inline

Definition at line 607 of file LongestPathAnalysis.cpp.

References fromOutputPortToStartPoint.

◆ getHWModuleOp()

hw::HWModuleOp LocalVisitor::getHWModuleOp ( ) const
inline

Definition at line 602 of file LongestPathAnalysis.cpp.

◆ getInstancePathCache()

circt::igraph::InstancePathCache * LocalVisitor::getInstancePathCache ( ) const
inline

Definition at line 612 of file LongestPathAnalysis.cpp.

References instancePathCache.

◆ getInternalPaths()

void LocalVisitor::getInternalPaths ( SmallVectorImpl< DataflowPath > & results) const

◆ getOrComputePaths()

FailureOr< ArrayRef< OpenPath > > LocalVisitor::getOrComputePaths ( Value value,
size_t bitPos )

◆ initializeAndRun() [1/3]

LogicalResult LocalVisitor::initializeAndRun ( )

◆ initializeAndRun() [2/3]

LogicalResult LocalVisitor::initializeAndRun ( hw::InstanceOp instance)
private

◆ initializeAndRun() [3/3]

LogicalResult LocalVisitor::initializeAndRun ( hw::OutputOp output)
private

◆ isTopLevel()

bool LocalVisitor::isTopLevel ( ) const
inline

Definition at line 601 of file LongestPathAnalysis.cpp.

References topLevel.

◆ markEquivalent()

LogicalResult LocalVisitor::markEquivalent ( Value from,
size_t fromBitPos,
Value to,
size_t toBitPos,
SmallVectorImpl< OpenPath > & results )
private

Definition at line 844 of file LongestPathAnalysis.cpp.

References assert(), ec, and visitValue().

Referenced by visit(), visit(), visit(), and visit().

◆ markRegEndPoint()

LogicalResult LocalVisitor::markRegEndPoint ( Value endPoint,
Value start,
Value reset = {},
Value resetValue = {},
Value enable = {} )
private

◆ markStartPoint()

LogicalResult LocalVisitor::markStartPoint ( Value value,
size_t bitPos,
SmallVectorImpl< OpenPath > & results )
private

Definition at line 922 of file LongestPathAnalysis.cpp.

References success().

Referenced by visit(), visit(), visit(), visit(), and visit().

◆ putUnclosedResult()

void LocalVisitor::putUnclosedResult ( const Object & object,
int64_t delay,
llvm::ImmutableList< DebugPoint > history,
ObjectToMaxDistance & objectToMaxDistance )
private

Definition at line 780 of file LongestPathAnalysis.cpp.

Referenced by initializeAndRun(), initializeAndRun(), and markRegEndPoint().

◆ setTopLevel()

void LocalVisitor::setTopLevel ( )
inline

Definition at line 600 of file LongestPathAnalysis.cpp.

References topLevel.

◆ visit() [1/17]

LogicalResult LocalVisitor::visit ( BooleanLogicOpInterface op,
size_t bitPos,
SmallVectorImpl< OpenPath > & results )
private

Definition at line 868 of file LongestPathAnalysis.cpp.

References addLogicOp().

◆ visit() [2/17]

LogicalResult LocalVisitor::visit ( comb::AndOp op,
size_t bitPos,
SmallVectorImpl< OpenPath > & results )
private

Definition at line 873 of file LongestPathAnalysis.cpp.

References addLogicOp().

◆ visit() [3/17]

LogicalResult LocalVisitor::visit ( comb::ConcatOp op,
size_t bitPos,
SmallVectorImpl< OpenPath > & results )
private

Definition at line 1018 of file LongestPathAnalysis.cpp.

References failure(), circt::hw::getBitWidth(), and markEquivalent().

◆ visit() [4/17]

LogicalResult LocalVisitor::visit ( comb::ExtractOp op,
size_t bitPos,
SmallVectorImpl< OpenPath > & results )
private

Definition at line 908 of file LongestPathAnalysis.cpp.

References assert(), circt::hw::getBitWidth(), and markEquivalent().

◆ visit() [5/17]

LogicalResult LocalVisitor::visit ( comb::MuxOp op,
size_t bitPos,
SmallVectorImpl< OpenPath > & results )
private

Definition at line 888 of file LongestPathAnalysis.cpp.

References addEdge(), ctx, failure(), filterPaths(), and success().

◆ visit() [6/17]

LogicalResult LocalVisitor::visit ( comb::OrOp op,
size_t bitPos,
SmallVectorImpl< OpenPath > & results )
private

Definition at line 878 of file LongestPathAnalysis.cpp.

References addLogicOp().

◆ visit() [7/17]

LogicalResult LocalVisitor::visit ( comb::ReplicateOp op,
size_t bitPos,
SmallVectorImpl< OpenPath > & results )
private

Definition at line 916 of file LongestPathAnalysis.cpp.

References circt::hw::getBitWidth(), and markEquivalent().

◆ visit() [8/17]

LogicalResult LocalVisitor::visit ( comb::TruthTableOp op,
size_t bitPos,
SmallVectorImpl< OpenPath > & results )
private

Definition at line 899 of file LongestPathAnalysis.cpp.

References addEdge(), failure(), and success().

◆ visit() [9/17]

LogicalResult LocalVisitor::visit ( comb::XorOp op,
size_t bitPos,
SmallVectorImpl< OpenPath > & results )
private

Definition at line 883 of file LongestPathAnalysis.cpp.

References addLogicOp().

◆ visit() [10/17]

LogicalResult LocalVisitor::visit ( hw::ConstantOp op,
size_t bitPos,
SmallVectorImpl< OpenPath > & results )
inlineprivate

Definition at line 684 of file LongestPathAnalysis.cpp.

References success().

◆ visit() [11/17]

LogicalResult LocalVisitor::visit ( hw::InstanceOp op,
size_t bitPos,
size_t resultNum,
SmallVectorImpl< OpenPath > & results )
private

◆ visit() [12/17]

LogicalResult LocalVisitor::visit ( hw::WireOp op,
size_t bitPos,
SmallVectorImpl< OpenPath > & results )
private

Definition at line 928 of file LongestPathAnalysis.cpp.

References markEquivalent().

◆ visit() [13/17]

LogicalResult LocalVisitor::visit ( mlir::BlockArgument argument,
size_t bitPos,
SmallVectorImpl< OpenPath > & results )
private

Definition at line 1082 of file LongestPathAnalysis.cpp.

References assert(), ctx, debugPointFactory, module, and success().

Referenced by visitValue().

◆ visit() [14/17]

LogicalResult LocalVisitor::visit ( seq::CompRegOp op,
size_t bitPos,
SmallVectorImpl< OpenPath > & results )
inlineprivate

Definition at line 695 of file LongestPathAnalysis.cpp.

References markStartPoint().

◆ visit() [15/17]

LogicalResult LocalVisitor::visit ( seq::FirMemReadOp op,
size_t bitPos,
SmallVectorImpl< OpenPath > & results )
inlineprivate

Definition at line 700 of file LongestPathAnalysis.cpp.

References markStartPoint().

◆ visit() [16/17]

LogicalResult LocalVisitor::visit ( seq::FirMemReadWriteOp op,
size_t bitPos,
SmallVectorImpl< OpenPath > & results )
inlineprivate

Definition at line 705 of file LongestPathAnalysis.cpp.

References markStartPoint().

◆ visit() [17/17]

LogicalResult LocalVisitor::visit ( seq::FirRegOp op,
size_t bitPos,
SmallVectorImpl< OpenPath > & results )
inlineprivate

Definition at line 690 of file LongestPathAnalysis.cpp.

References markStartPoint().

◆ visitDefault()

LogicalResult LocalVisitor::visitDefault ( OpResult result,
size_t bitPos,
SmallVectorImpl< OpenPath > & results )
private

Definition at line 1048 of file LongestPathAnalysis.cpp.

References addEdge(), failure(), operationAnalyzer, and success().

Referenced by visitValue().

◆ visitValue()

LogicalResult LocalVisitor::visitValue ( Value value,
size_t bitPos,
SmallVectorImpl< OpenPath > & results )
private

Definition at line 1137 of file LongestPathAnalysis.cpp.

References ctx, debugPointFactory, success(), visit(), and visitDefault().

Referenced by getOrComputePaths(), and markEquivalent().

◆ waitUntilDone()

void LocalVisitor::waitUntilDone ( ) const

Definition at line 789 of file LongestPathAnalysis.cpp.

References cv, done, and mutex.

Member Data Documentation

◆ cachedResults

DenseMap<std::pair<Value, size_t>, std::unique_ptr<SmallVector<OpenPath> > > LocalVisitor::cachedResults
private

Definition at line 732 of file LongestPathAnalysis.cpp.

Referenced by getCachedPaths(), and getOrComputePaths().

◆ ctx

◆ cv

std::condition_variable LocalVisitor::cv
mutableprivate

Definition at line 742 of file LongestPathAnalysis.cpp.

Referenced by waitUntilDone().

◆ debugPointFactory

std::unique_ptr<llvm::ImmutableListFactory<DebugPoint> > LocalVisitor::debugPointFactory
private

◆ done

std::atomic_bool LocalVisitor::done
private

Definition at line 741 of file LongestPathAnalysis.cpp.

Referenced by LocalVisitor(), and waitUntilDone().

◆ ec

llvm::EquivalenceClasses<std::pair<Value, size_t> > LocalVisitor::ec
private

◆ ecMap

DenseMap<std::pair<Value, size_t>, std::pair<Value, size_t> > LocalVisitor::ecMap
private

Definition at line 659 of file LongestPathAnalysis.cpp.

◆ endPointResults

DenseMap<Object, SmallVector<OpenPath> > LocalVisitor::endPointResults
private

Definition at line 735 of file LongestPathAnalysis.cpp.

Referenced by getEndPointResults(), initializeAndRun(), and markRegEndPoint().

◆ fromInputPortToEndPoint

llvm::MapVector<std::pair<BlockArgument, size_t>, ObjectToMaxDistance> LocalVisitor::fromInputPortToEndPoint
private

◆ fromOutputPortToStartPoint

llvm::MapVector<std::tuple<size_t, size_t>, ObjectToMaxDistance> LocalVisitor::fromOutputPortToStartPoint
private

Definition at line 631 of file LongestPathAnalysis.cpp.

Referenced by getFromOutputPortToStartPoint(), and initializeAndRun().

◆ instancePathCache

std::unique_ptr<circt::igraph::InstancePathCache> LocalVisitor::instancePathCache
private

◆ module

hw::HWModuleOp LocalVisitor::module
private

◆ mutex

std::mutex LocalVisitor::mutex
mutableprivate

Definition at line 743 of file LongestPathAnalysis.cpp.

Referenced by waitUntilDone().

◆ operationAnalyzer

std::unique_ptr<OperationAnalyzer> LocalVisitor::operationAnalyzer
private

Definition at line 738 of file LongestPathAnalysis.cpp.

Referenced by LocalVisitor(), and visitDefault().

◆ topLevel

bool LocalVisitor::topLevel = false
private

Definition at line 746 of file LongestPathAnalysis.cpp.

Referenced by isTopLevel(), and setTopLevel().


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