CIRCT  19.0.0git
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
circt::hw::InnerSymTarget Class Reference

The target of an inner symbol, the entity the symbol is a handle for. More...

#include <InnerSymbolTable.h>

Collaboration diagram for circt::hw::InnerSymTarget:
Collaboration graph
[legend]

Public Member Functions

 InnerSymTarget ()
 Default constructor, invalid. More...
 
 InnerSymTarget (Operation *op)
 Target an operation. More...
 
 InnerSymTarget (Operation *op, size_t fieldID)
 Target an operation and a field (=0 means the op itself). More...
 
 InnerSymTarget (size_t portIdx, Operation *op, size_t fieldID=0)
 Target a port, and optionally a field (=0 means the port itself). More...
 
 InnerSymTarget (const InnerSymTarget &)=default
 
 InnerSymTarget (InnerSymTarget &&)=default
 
auto getField () const
 Return the target's fieldID. More...
 
Operation * getOp () const
 Return the target's base operation. For ports, this is the module. More...
 
auto getPort () const
 Return the target's port, if valid. Check "isPort()". More...
 
bool isField () const
 Return if this targets a field (nonzero fieldID). More...
 
bool isPort () const
 Return if this targets a port. More...
 
bool isOpOnly () const
 Returns if this targets an operation only (not port or field). More...
 
bool operator== (const InnerSymTarget &rhs) const
 
InnerSymTargetoperator= (InnerSymTarget &&)=default
 
InnerSymTargetoperator= (const InnerSymTarget &)=default
 
 operator bool () const
 Check if this target is valid. More...
 

Static Public Member Functions

static InnerSymTarget getTargetForSubfield (const InnerSymTarget &base, size_t fieldID)
 Return a target to the specified field within the given base. More...
 

Private Member Functions

auto asTuple () const
 

Private Attributes

Operation * op = nullptr
 
size_t portIdx = 0
 
size_t fieldID = 0
 

Static Private Attributes

static constexpr size_t invalidPort = ~size_t{0}
 

Detailed Description

The target of an inner symbol, the entity the symbol is a handle for.

Definition at line 27 of file InnerSymbolTable.h.

Constructor & Destructor Documentation

◆ InnerSymTarget() [1/6]

circt::hw::InnerSymTarget::InnerSymTarget ( )
inline

Default constructor, invalid.

Definition at line 30 of file InnerSymbolTable.h.

References assert().

Referenced by getTargetForSubfield().

◆ InnerSymTarget() [2/6]

circt::hw::InnerSymTarget::InnerSymTarget ( Operation *  op)
inlineexplicit

Target an operation.

Definition at line 33 of file InnerSymbolTable.h.

◆ InnerSymTarget() [3/6]

circt::hw::InnerSymTarget::InnerSymTarget ( Operation *  op,
size_t  fieldID 
)
inline

Target an operation and a field (=0 means the op itself).

Definition at line 36 of file InnerSymbolTable.h.

◆ InnerSymTarget() [4/6]

circt::hw::InnerSymTarget::InnerSymTarget ( size_t  portIdx,
Operation *  op,
size_t  fieldID = 0 
)
inline

Target a port, and optionally a field (=0 means the port itself).

Definition at line 40 of file InnerSymbolTable.h.

◆ InnerSymTarget() [5/6]

circt::hw::InnerSymTarget::InnerSymTarget ( const InnerSymTarget )
default

◆ InnerSymTarget() [6/6]

circt::hw::InnerSymTarget::InnerSymTarget ( InnerSymTarget &&  )
default

Member Function Documentation

◆ asTuple()

auto circt::hw::InnerSymTarget::asTuple ( ) const
inlineprivate

Definition at line 81 of file InnerSymbolTable.h.

References fieldID, op, and portIdx.

Referenced by operator==().

◆ getField()

auto circt::hw::InnerSymTarget::getField ( ) const
inline

Return the target's fieldID.

Definition at line 49 of file InnerSymbolTable.h.

References fieldID.

Referenced by dropSymbol(), circt::hw::InnerSymbolTable::getInnerSymbol(), circt::firrtl::getOrAddInnerSym(), and circt::hw::operator<<().

◆ getOp()

Operation* circt::hw::InnerSymTarget::getOp ( ) const
inline

Return the target's base operation. For ports, this is the module.

Definition at line 52 of file InnerSymbolTable.h.

References op.

Referenced by dropSymbol(), circt::hw::InnerSymbolTable::get(), circt::firrtl::getInnerRefTo(), circt::hw::InnerSymbolTable::getInnerSymbol(), circt::firrtl::getOrAddInnerSym(), and circt::hw::operator<<().

◆ getPort()

auto circt::hw::InnerSymTarget::getPort ( ) const
inline

Return the target's port, if valid. Check "isPort()".

Definition at line 55 of file InnerSymbolTable.h.

References assert(), isPort(), and portIdx.

Referenced by dropSymbol(), circt::hw::InnerSymbolTable::getInnerSymbol(), circt::firrtl::getOrAddInnerSym(), and circt::hw::operator<<().

◆ getTargetForSubfield()

static InnerSymTarget circt::hw::InnerSymTarget::getTargetForSubfield ( const InnerSymTarget base,
size_t  fieldID 
)
inlinestatic

Return a target to the specified field within the given base.

FieldID is relative to the specified base target.

Definition at line 73 of file InnerSymbolTable.h.

References fieldID, InnerSymTarget(), isPort(), op, and portIdx.

Referenced by circt::hw::InnerSymbolTable::walkSymbols().

◆ isField()

bool circt::hw::InnerSymTarget::isField ( ) const
inline

Return if this targets a field (nonzero fieldID).

Definition at line 63 of file InnerSymbolTable.h.

References fieldID.

Referenced by isOpOnly(), and circt::hw::operator<<().

◆ isOpOnly()

bool circt::hw::InnerSymTarget::isOpOnly ( ) const
inline

Returns if this targets an operation only (not port or field).

Definition at line 69 of file InnerSymbolTable.h.

References isField(), and isPort().

◆ isPort()

bool circt::hw::InnerSymTarget::isPort ( ) const
inline

◆ operator bool()

circt::hw::InnerSymTarget::operator bool ( ) const
inline

Check if this target is valid.

Definition at line 100 of file InnerSymbolTable.h.

References op.

◆ operator=() [1/2]

InnerSymTarget& circt::hw::InnerSymTarget::operator= ( const InnerSymTarget )
default

◆ operator=() [2/2]

InnerSymTarget& circt::hw::InnerSymTarget::operator= ( InnerSymTarget &&  )
default

◆ operator==()

bool circt::hw::InnerSymTarget::operator== ( const InnerSymTarget rhs) const
inline

Definition at line 91 of file InnerSymbolTable.h.

References asTuple().

Member Data Documentation

◆ fieldID

size_t circt::hw::InnerSymTarget::fieldID = 0
private

Definition at line 84 of file InnerSymbolTable.h.

Referenced by asTuple(), getField(), getTargetForSubfield(), and isField().

◆ invalidPort

constexpr size_t circt::hw::InnerSymTarget::invalidPort = ~size_t{0}
staticconstexprprivate

Definition at line 85 of file InnerSymbolTable.h.

Referenced by isPort().

◆ op

Operation* circt::hw::InnerSymTarget::op = nullptr
private

Definition at line 82 of file InnerSymbolTable.h.

Referenced by asTuple(), getOp(), getTargetForSubfield(), and operator bool().

◆ portIdx

size_t circt::hw::InnerSymTarget::portIdx = 0
private

Definition at line 83 of file InnerSymbolTable.h.

Referenced by asTuple(), getPort(), getTargetForSubfield(), and isPort().


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