slang::ast::InterfacePortSymbol class

Represents the public-facing side of a module / program / interface port that is also a connection to an interface instance (optionally with a modport restriction).

Base classes

class Symbol
Base class for all symbols (logical code constructs) such as modules, types, functions, variables, etc.

Public functions

auto getDeclaredRange() const -> std::optional<std::span<const ConstantRange>>
Gets the set of dimensions for specifying interface arrays.
auto getConnection() const -> IfaceConn
Gets the interface instance that this port connects to.

Public variables

const DefinitionSymbol* interfaceDef
A pointer to the definition for the interface.
std::string_view modport
If non-empty, the name of the modport that restricts which interface signals are accessible.
bool isGeneric
Set to true if this is a generic interface port, which allows connections to any interface type.

Function documentation

std::optional<std::span<const ConstantRange>> slang::ast::InterfacePortSymbol::getDeclaredRange() const

Gets the set of dimensions for specifying interface arrays.

Returns nullopt if an error occurs evaluating the dimensions.

Variable documentation

bool slang::ast::InterfacePortSymbol::isGeneric

Set to true if this is a generic interface port, which allows connections to any interface type.

If true, interfaceDef will be nullptr.