CIRCT 24.0.0git
Loading...
Searching...
No Matches
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:

Public Member Functions

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

Static Public Member Functions

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

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(), InnerSymTarget(), InnerSymTarget(), operator=(), operator=(), and operator==().

◆ InnerSymTarget() [2/6]

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

Target an operation.

Definition at line 33 of file InnerSymbolTable.h.

References InnerSymTarget(), and op.

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

References fieldID, invalidPort, op, and portIdx.

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

References fieldID, op, and portIdx.

◆ InnerSymTarget() [5/6]

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

References InnerSymTarget().

◆ InnerSymTarget() [6/6]

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

References InnerSymTarget().

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

◆ getOp()

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

◆ 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::firrtl::getFieldRefForTarget(), circt::hw::InnerSymbolTable::getInnerSymbol(), circt::firrtl::getOrAddInnerSym(), and circt::hw::operator<<().

◆ getTargetForSubfield()

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()

◆ 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

References InnerSymTarget().

◆ operator=() [2/2]

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

References InnerSymTarget().

◆ operator==()

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

Definition at line 91 of file InnerSymbolTable.h.

References asTuple(), and InnerSymTarget().

Member Data Documentation

◆ fieldID

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

◆ invalidPort

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

Definition at line 85 of file InnerSymbolTable.h.

Referenced by InnerSymTarget(), and isPort().

◆ op

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

◆ portIdx

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

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