CIRCT 22.0.0git
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
LocalVisitor Class Reference
Collaboration diagram for LocalVisitor:
Collaboration graph
[legend]

Public Types

using ObjectToMaxDistance = llvm::MapVector< Object, std::pair< int64_t, llvm::ImmutableList< DebugPoint > > >
 

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 getClosedPaths (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::InstancePathCachegetInstancePathCache () 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 (aig::AndInverterOp op, size_t bitPos, SmallVectorImpl< OpenPath > &results)
 
LogicalResult visit (mig::MajorityInverterOp 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 >, ObjectToMaxDistancefromInputPortToEndPoint
 
llvm::MapVector< std::tuple< size_t, size_t >, ObjectToMaxDistancefromOutputPortToStartPoint
 
llvm::EquivalenceClasses< std::pair< Value, size_t > > ec
 
DenseMap< std::pair< Value, size_t >, std::pair< Value, size_t > > ecMap
 
hw::HWModuleOp Contextctx
 
std::unique_ptr< circt::igraph::InstancePathCacheinstancePathCache
 
std::unique_ptr< llvm::ImmutableListFactory< DebugPoint > > debugPointFactory
 
DenseMap< std::pair< Value, size_t >, SmallVector< OpenPath > > cachedResults
 
DenseMap< Object, SmallVector< OpenPath > > endPointResults
 
std::unique_ptr< OperationAnalyzeroperationAnalyzer
 
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

using LocalVisitor::ObjectToMaxDistance = llvm::MapVector<Object, 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 
)

Definition at line 750 of file LongestPathAnalysis.cpp.

References ctx, debugPointFactory, done, instancePathCache, and operationAnalyzer.

Member Function Documentation

◆ addEdge()

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

Definition at line 852 of file LongestPathAnalysis.cpp.

References getOrComputePaths().

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

◆ addLogicOp()

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

Definition at line 1045 of file LongestPathAnalysis.cpp.

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

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.

◆ getCachedPaths()

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

Definition at line 763 of file LongestPathAnalysis.cpp.

References cachedResults, ec, and getCachedPaths().

Referenced by getCachedPaths().

◆ getClosedPaths()

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

◆ getDebugPointFactory()

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

Definition at line 616 of file LongestPathAnalysis.cpp.

◆ getEndPointResults()

const auto & LocalVisitor::getEndPointResults ( ) const
inline

Definition at line 610 of file LongestPathAnalysis.cpp.

◆ getFromInputPortToEndPoint()

const auto & LocalVisitor::getFromInputPortToEndPoint ( ) const
inline

Definition at line 604 of file LongestPathAnalysis.cpp.

◆ getFromOutputPortToStartPoint()

const auto & LocalVisitor::getFromOutputPortToStartPoint ( ) const
inline

Definition at line 607 of file LongestPathAnalysis.cpp.

◆ getHWModuleOp()

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

Definition at line 602 of file LongestPathAnalysis.cpp.

◆ getInstancePathCache()

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

◆ getOrComputePaths()

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

◆ initializeAndRun() [1/3]

LogicalResult LocalVisitor::initializeAndRun ( )

Definition at line 1265 of file LongestPathAnalysis.cpp.

References ctx, and getOrComputePaths().

◆ 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.

◆ markEquivalent()

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

Definition at line 841 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 932 of file LongestPathAnalysis.cpp.

Referenced by visit().

◆ putUnclosedResult()

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

Definition at line 781 of file LongestPathAnalysis.cpp.

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

◆ setTopLevel()

void LocalVisitor::setTopLevel ( )
inline

Definition at line 600 of file LongestPathAnalysis.cpp.

◆ visit() [1/18]

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

Definition at line 865 of file LongestPathAnalysis.cpp.

References addLogicOp().

◆ visit() [2/18]

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

Definition at line 883 of file LongestPathAnalysis.cpp.

References addLogicOp().

◆ visit() [3/18]

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

Definition at line 1028 of file LongestPathAnalysis.cpp.

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

◆ visit() [4/18]

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

Definition at line 918 of file LongestPathAnalysis.cpp.

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

◆ visit() [5/18]

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

Definition at line 898 of file LongestPathAnalysis.cpp.

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

◆ visit() [6/18]

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

Definition at line 888 of file LongestPathAnalysis.cpp.

References addLogicOp().

◆ visit() [7/18]

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

Definition at line 926 of file LongestPathAnalysis.cpp.

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

◆ visit() [8/18]

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

Definition at line 909 of file LongestPathAnalysis.cpp.

References addEdge().

◆ visit() [9/18]

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

Definition at line 893 of file LongestPathAnalysis.cpp.

References addLogicOp().

◆ visit() [10/18]

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

Definition at line 686 of file LongestPathAnalysis.cpp.

◆ visit() [11/18]

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

◆ visit() [12/18]

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

Definition at line 938 of file LongestPathAnalysis.cpp.

References markEquivalent().

◆ visit() [13/18]

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

Definition at line 871 of file LongestPathAnalysis.cpp.

References addEdge().

◆ visit() [14/18]

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

Definition at line 1091 of file LongestPathAnalysis.cpp.

References assert(), ctx, and debugPointFactory.

Referenced by visitValue().

◆ visit() [15/18]

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

Definition at line 697 of file LongestPathAnalysis.cpp.

◆ visit() [16/18]

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

Definition at line 702 of file LongestPathAnalysis.cpp.

◆ visit() [17/18]

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

Definition at line 707 of file LongestPathAnalysis.cpp.

◆ visit() [18/18]

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

Definition at line 692 of file LongestPathAnalysis.cpp.

◆ visitDefault()

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

Definition at line 1057 of file LongestPathAnalysis.cpp.

References addEdge(), and operationAnalyzer.

Referenced by visitValue().

◆ visitValue()

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

Definition at line 1142 of file LongestPathAnalysis.cpp.

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

Referenced by getOrComputePaths(), and markEquivalent().

◆ waitUntilDone()

void LocalVisitor::waitUntilDone ( ) const

Definition at line 790 of file LongestPathAnalysis.cpp.

References cv, done, and mutex.

Referenced by Context::getLocalVisitorMutable().

Member Data Documentation

◆ cachedResults

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

Definition at line 733 of file LongestPathAnalysis.cpp.

Referenced by getCachedPaths(), and getOrComputePaths().

◆ ctx

hw::HWModuleOp Context* LocalVisitor::ctx
private

◆ cv

std::condition_variable LocalVisitor::cv
mutableprivate

Definition at line 743 of file LongestPathAnalysis.cpp.

Referenced by waitUntilDone().

◆ debugPointFactory

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

Definition at line 730 of file LongestPathAnalysis.cpp.

Referenced by initializeAndRun(), LocalVisitor(), visit(), visit(), and visitValue().

◆ done

std::atomic_bool LocalVisitor::done
private

Definition at line 742 of file LongestPathAnalysis.cpp.

Referenced by LocalVisitor(), and waitUntilDone().

◆ ec

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

Definition at line 658 of file LongestPathAnalysis.cpp.

Referenced by getCachedPaths(), getOrComputePaths(), and markEquivalent().

◆ 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 736 of file LongestPathAnalysis.cpp.

Referenced by initializeAndRun(), and markRegEndPoint().

◆ fromInputPortToEndPoint

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

Definition at line 627 of file LongestPathAnalysis.cpp.

Referenced by initializeAndRun(), and markRegEndPoint().

◆ fromOutputPortToStartPoint

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

Definition at line 631 of file LongestPathAnalysis.cpp.

Referenced by initializeAndRun().

◆ instancePathCache

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

Definition at line 728 of file LongestPathAnalysis.cpp.

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

◆ mutex

std::mutex LocalVisitor::mutex
mutableprivate

Definition at line 744 of file LongestPathAnalysis.cpp.

Referenced by waitUntilDone().

◆ operationAnalyzer

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

Definition at line 739 of file LongestPathAnalysis.cpp.

Referenced by LocalVisitor(), and visitDefault().

◆ topLevel

bool LocalVisitor::topLevel = false
private

Definition at line 747 of file LongestPathAnalysis.cpp.


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