Loading [MathJax]/extensions/tex2jax.js
CIRCT 21.0.0git
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 > > getOrComputeResults (Value value, size_t bitPos)
 
ArrayRef< OpenPath > getResults (Value value, size_t bitPos) const
 
void getClosedPaths (SmallVectorImpl< DataflowPath > &results) const
 
void setTopLevel ()
 
bool isTopLevel () const
 
hw::HWModuleOp getHWModuleOp () const
 
const auto & getFromInputPortToFanOut () const
 
const auto & getFromOutputPortToFanIn () const
 
const auto & getFanOutResults () 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 (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 (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 (Operation *op, size_t bitPos, SmallVectorImpl< OpenPath > &results)
 
LogicalResult addEdge (Value to, size_t toBitPos, int64_t delay, SmallVectorImpl< OpenPath > &results)
 
LogicalResult markFanIn (Value value, size_t bitPos, SmallVectorImpl< OpenPath > &results)
 
LogicalResult markRegFanOut (Value fanOut, Value start, Value reset={}, Value resetValue={}, Value enable={})
 

Private Attributes

llvm::MapVector< std::pair< BlockArgument, size_t >, ObjectToMaxDistancefromInputPortToFanOut
 
llvm::MapVector< std::tuple< size_t, size_t >, ObjectToMaxDistancefromOutputPortToFanIn
 
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 > > fanOutResults
 
std::atomic_bool done
 
std::condition_variable cv
 
std::mutex mutex
 
bool topLevel = false
 

Detailed Description

Definition at line 419 of file LongestPathAnalysis.cpp.

Member Typedef Documentation

◆ ObjectToMaxDistance

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

Definition at line 435 of file LongestPathAnalysis.cpp.

Constructor & Destructor Documentation

◆ LocalVisitor()

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

Definition at line 579 of file LongestPathAnalysis.cpp.

References ctx, debugPointFactory, done, and instancePathCache.

Member Function Documentation

◆ addEdge()

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

Definition at line 677 of file LongestPathAnalysis.cpp.

References getOrComputeResults().

Referenced by addLogicOp(), and visit().

◆ addLogicOp()

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

Definition at line 849 of file LongestPathAnalysis.cpp.

References addEdge(), and deduplicatePaths().

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

References ec.

◆ getClosedPaths()

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

◆ getDebugPointFactory()

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

Definition at line 452 of file LongestPathAnalysis.cpp.

References debugPointFactory.

◆ getFanOutResults()

const auto & LocalVisitor::getFanOutResults ( ) const
inline

Definition at line 446 of file LongestPathAnalysis.cpp.

References fanOutResults.

◆ getFromInputPortToFanOut()

const auto & LocalVisitor::getFromInputPortToFanOut ( ) const
inline

Definition at line 444 of file LongestPathAnalysis.cpp.

References fromInputPortToFanOut.

◆ getFromOutputPortToFanIn()

const auto & LocalVisitor::getFromOutputPortToFanIn ( ) const
inline

Definition at line 445 of file LongestPathAnalysis.cpp.

References fromOutputPortToFanIn.

◆ getHWModuleOp()

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

Definition at line 442 of file LongestPathAnalysis.cpp.

◆ getInstancePathCache()

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

Definition at line 448 of file LongestPathAnalysis.cpp.

References instancePathCache.

Referenced by LongestPathAnalysis::Impl::getClosedPaths().

◆ getOrComputeResults()

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

◆ getResults()

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

Definition at line 590 of file LongestPathAnalysis.cpp.

References cachedResults, ec, and getResults().

Referenced by getResults().

◆ initializeAndRun() [1/3]

LogicalResult LocalVisitor::initializeAndRun ( )

Definition at line 1037 of file LongestPathAnalysis.cpp.

References ctx, and getOrComputeResults().

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

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

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

◆ markFanIn()

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

Definition at line 735 of file LongestPathAnalysis.cpp.

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

◆ markRegFanOut()

LogicalResult LocalVisitor::markRegFanOut ( Value  fanOut,
Value  start,
Value  reset = {},
Value  resetValue = {},
Value  enable = {} 
)
private

◆ putUnclosedResult()

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

Definition at line 607 of file LongestPathAnalysis.cpp.

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

◆ setTopLevel()

void LocalVisitor::setTopLevel ( )
inline

Definition at line 440 of file LongestPathAnalysis.cpp.

References topLevel.

◆ visit() [1/16]

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

Definition at line 690 of file LongestPathAnalysis.cpp.

References addLogicOp().

◆ visit() [2/16]

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

Definition at line 695 of file LongestPathAnalysis.cpp.

References addLogicOp().

◆ visit() [3/16]

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

Definition at line 832 of file LongestPathAnalysis.cpp.

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

◆ visit() [4/16]

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

Definition at line 721 of file LongestPathAnalysis.cpp.

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

◆ visit() [5/16]

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

Definition at line 710 of file LongestPathAnalysis.cpp.

References addEdge(), and deduplicatePaths().

◆ visit() [6/16]

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

Definition at line 700 of file LongestPathAnalysis.cpp.

References addLogicOp().

◆ visit() [7/16]

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

Definition at line 729 of file LongestPathAnalysis.cpp.

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

◆ visit() [8/16]

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

Definition at line 705 of file LongestPathAnalysis.cpp.

References addLogicOp().

◆ visit() [9/16]

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

Definition at line 518 of file LongestPathAnalysis.cpp.

◆ visit() [10/16]

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

◆ visit() [11/16]

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

Definition at line 741 of file LongestPathAnalysis.cpp.

References markEquivalent().

◆ visit() [12/16]

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

Definition at line 867 of file LongestPathAnalysis.cpp.

References assert(), ctx, and debugPointFactory.

Referenced by visitValue().

◆ visit() [13/16]

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

Definition at line 529 of file LongestPathAnalysis.cpp.

References markFanIn().

◆ visit() [14/16]

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

Definition at line 534 of file LongestPathAnalysis.cpp.

References markFanIn().

◆ visit() [15/16]

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

Definition at line 539 of file LongestPathAnalysis.cpp.

References markFanIn().

◆ visit() [16/16]

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

Definition at line 524 of file LongestPathAnalysis.cpp.

References markFanIn().

◆ visitDefault()

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

Definition at line 862 of file LongestPathAnalysis.cpp.

Referenced by visitValue().

◆ visitValue()

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

Definition at line 918 of file LongestPathAnalysis.cpp.

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

Referenced by getOrComputeResults(), and markEquivalent().

◆ waitUntilDone()

void LocalVisitor::waitUntilDone ( ) const

Definition at line 616 of file LongestPathAnalysis.cpp.

References cv, done, and mutex.

Member Data Documentation

◆ cachedResults

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

Definition at line 565 of file LongestPathAnalysis.cpp.

Referenced by getOrComputeResults(), and getResults().

◆ ctx

hw::HWModuleOp Context* LocalVisitor::ctx
private

◆ cv

std::condition_variable LocalVisitor::cv
mutableprivate

Definition at line 572 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 571 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 495 of file LongestPathAnalysis.cpp.

◆ fanOutResults

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

Definition at line 568 of file LongestPathAnalysis.cpp.

Referenced by getFanOutResults(), initializeAndRun(), and markRegFanOut().

◆ fromInputPortToFanOut

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

◆ fromOutputPortToFanIn

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

Definition at line 467 of file LongestPathAnalysis.cpp.

Referenced by getFromOutputPortToFanIn(), and initializeAndRun().

◆ instancePathCache

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

◆ mutex

std::mutex LocalVisitor::mutex
mutableprivate

Definition at line 573 of file LongestPathAnalysis.cpp.

Referenced by waitUntilDone().

◆ topLevel

bool LocalVisitor::topLevel = false
private

Definition at line 576 of file LongestPathAnalysis.cpp.

Referenced by isTopLevel(), and setTopLevel().


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