CIRCT 24.0.0git
Loading...
Searching...
No Matches
circt::igraph::InstanceRecord Class Reference

This is an edge in the InstanceGraph. More...

#include <InstanceGraph.h>

Inheritance diagram for circt::igraph::InstanceRecord:
Collaboration diagram for circt::igraph::InstanceRecord:

Public Member Functions

template<typename TTarget = InstanceOpInterface>
auto getInstance ()
 Get the instance-like op that this is tracking.
InstanceGraphNode * getParent () const
 Get the module where the instantiation lives.
InstanceGraphNode * getTarget () const
 Get the module which the instance-like is instantiating.
void erase ()
 Erase this instance record, removing it from the parent module and the target's use-list.

Private Member Functions

 InstanceRecord (InstanceGraphNode *parent, InstanceOpInterface instance, InstanceGraphNode *target)
 InstanceRecord (const InstanceRecord &)=delete

Private Attributes

InstanceGraphNode * parent
 This is the module where the instantiation lives.
InstanceOpInterface instance
 The InstanceLike that this is tracking.
InstanceGraphNode * target
 This is the module which the instance-like is instantiating.
InstanceRecord * nextUse = nullptr
 Intrusive linked list for other uses.
InstanceRecord * prevUse = nullptr

Friends

class InstanceGraph
 Iterates over the handshake::FuncOp's in the program to build an instance graph.
class InstanceGraphNode

Detailed Description

This is an edge in the InstanceGraph.

This tracks a specific instantiation of a module.

Definition at line 59 of file InstanceGraph.h.

Constructor & Destructor Documentation

◆ InstanceRecord() [1/2]

circt::igraph::InstanceRecord::InstanceRecord ( InstanceGraphNode * parent,
InstanceOpInterface instance,
InstanceGraphNode * target )
inlineprivate

Definition at line 84 of file InstanceGraph.h.

References instance, InstanceGraphNode, parent, and target.

Referenced by InstanceRecord().

◆ InstanceRecord() [2/2]

circt::igraph::InstanceRecord::InstanceRecord ( const InstanceRecord & )
privatedelete

References InstanceRecord().

Member Function Documentation

◆ erase()

void InstanceRecord::erase ( )

Erase this instance record, removing it from the parent module and the target's use-list.

Definition at line 20 of file InstanceGraph.cpp.

References getParent(), circt::igraph::InstanceGraphNode::instances, nextUse, prevUse, and target.

◆ getInstance()

template<typename TTarget = InstanceOpInterface>
auto circt::igraph::InstanceRecord::getInstance ( )
inline

Get the instance-like op that this is tracking.

Definition at line 64 of file InstanceGraph.h.

References instance.

◆ getParent()

InstanceGraphNode * circt::igraph::InstanceRecord::getParent ( ) const
inline

Get the module where the instantiation lives.

Definition at line 71 of file InstanceGraph.h.

References InstanceGraphNode, and parent.

Referenced by erase(), and llvm::GraphTraits< llvm::Inverse< circt::igraph::InstanceGraphNode * > >::getParent().

◆ getTarget()

InstanceGraphNode * circt::igraph::InstanceRecord::getTarget ( ) const
inline

Get the module which the instance-like is instantiating.

Definition at line 74 of file InstanceGraph.h.

References InstanceGraphNode, and target.

Referenced by llvm::GraphTraits< circt::igraph::InstanceGraphNode * >::getChild().

◆ InstanceGraph

friend class InstanceGraph
friend

Iterates over the handshake::FuncOp's in the program to build an instance graph.

In doing so, we detect whether there are any cycles in this graph, as well as infer a top function for the design by performing a topological sort of the instance graph. The result of this sort is placed in sortedFuncs.

Definition at line 81 of file InstanceGraph.h.

References InstanceGraph.

Referenced by InstanceGraph.

◆ InstanceGraphNode

friend class InstanceGraphNode
friend

Definition at line 82 of file InstanceGraph.h.

References InstanceGraphNode.

Referenced by getParent(), getTarget(), InstanceGraphNode, and InstanceRecord().

Member Data Documentation

◆ instance

InstanceOpInterface circt::igraph::InstanceRecord::instance
private

The InstanceLike that this is tracking.

Definition at line 93 of file InstanceGraph.h.

Referenced by getInstance(), and InstanceRecord().

◆ nextUse

InstanceRecord* circt::igraph::InstanceRecord::nextUse = nullptr
private

Intrusive linked list for other uses.

Definition at line 98 of file InstanceGraph.h.

Referenced by erase(), and circt::igraph::InstanceGraphNode::recordUse().

◆ parent

InstanceGraphNode* circt::igraph::InstanceRecord::parent
private

This is the module where the instantiation lives.

Definition at line 90 of file InstanceGraph.h.

Referenced by getParent(), and InstanceRecord().

◆ prevUse

InstanceRecord* circt::igraph::InstanceRecord::prevUse = nullptr
private

Definition at line 99 of file InstanceGraph.h.

Referenced by erase().

◆ target

InstanceGraphNode* circt::igraph::InstanceRecord::target
private

This is the module which the instance-like is instantiating.

Definition at line 96 of file InstanceGraph.h.

Referenced by erase(), getTarget(), and InstanceRecord().


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