CIRCT  18.0.0git
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
circt::hw::ModulePortInfo Struct Reference

This holds a decoded list of input/inout and output ports for a module or instance. More...

#include <HWOpInterfaces.h>

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

Public Types

using iterator = SmallVector< PortInfo >::iterator
 
using const_iterator = SmallVector< PortInfo >::const_iterator
 
using PortDirectionRange = llvm::iterator_range< llvm::filter_iterator< iterator, std::function< bool(const PortInfo &)> >>
 
using ConstPortDirectionRange = llvm::iterator_range< llvm::filter_iterator< const_iterator, std::function< bool(const PortInfo &)> >>
 

Public Member Functions

 ModulePortInfo (ArrayRef< PortInfo > inputs, ArrayRef< PortInfo > outputs)
 
 ModulePortInfo (ArrayRef< PortInfo > mergedPorts)
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
PortDirectionRange getPortsOfDirection (bool input)
 
ConstPortDirectionRange getPortsOfDirection (bool input) const
 
PortDirectionRange getInputs ()
 
PortDirectionRange getOutputs ()
 
ConstPortDirectionRange getInputs () const
 
ConstPortDirectionRange getOutputs () const
 
size_t size () const
 
size_t sizeInputs () const
 
size_t sizeOutputs () const
 
size_t portNumForInput (size_t idx) const
 
size_t portNumForOutput (size_t idx) const
 
PortInfoat (size_t idx)
 
PortInfoatInput (size_t idx)
 
PortInfoatOutput (size_t idx)
 
const PortInfoat (size_t idx) const
 
const PortInfoatInput (size_t idx) const
 
const PortInfoatOutput (size_t idx) const
 
void eraseInput (size_t idx)
 

Private Member Functions

void sanitizeInOut ()
 

Private Attributes

SmallVector< PortInfoports
 This contains a list of all ports. Input first. More...
 

Detailed Description

This holds a decoded list of input/inout and output ports for a module or instance.

Definition at line 59 of file HWOpInterfaces.h.

Member Typedef Documentation

◆ const_iterator

Definition at line 73 of file HWOpInterfaces.h.

◆ ConstPortDirectionRange

using circt::hw::ModulePortInfo::ConstPortDirectionRange = llvm::iterator_range<llvm::filter_iterator< const_iterator, std::function<bool(const PortInfo &)> >>

Definition at line 83 of file HWOpInterfaces.h.

◆ iterator

Definition at line 72 of file HWOpInterfaces.h.

◆ PortDirectionRange

using circt::hw::ModulePortInfo::PortDirectionRange = llvm::iterator_range< llvm::filter_iterator<iterator, std::function<bool(const PortInfo &)> >>

Definition at line 80 of file HWOpInterfaces.h.

Constructor & Destructor Documentation

◆ ModulePortInfo() [1/2]

circt::hw::ModulePortInfo::ModulePortInfo ( ArrayRef< PortInfo inputs,
ArrayRef< PortInfo outputs 
)
inlineexplicit

Definition at line 60 of file HWOpInterfaces.h.

References inputs, outputs, ports, and sanitizeInOut().

◆ ModulePortInfo() [2/2]

circt::hw::ModulePortInfo::ModulePortInfo ( ArrayRef< PortInfo mergedPorts)
inlineexplicit

Definition at line 67 of file HWOpInterfaces.h.

References sanitizeInOut().

Member Function Documentation

◆ at() [1/2]

PortInfo& circt::hw::ModulePortInfo::at ( size_t  idx)
inline

Definition at line 158 of file HWOpInterfaces.h.

References ports.

Referenced by circt::hw::HWModulePortAccessor::HWModulePortAccessor().

◆ at() [2/2]

const PortInfo& circt::hw::ModulePortInfo::at ( size_t  idx) const
inline

Definition at line 162 of file HWOpInterfaces.h.

References ports.

◆ atInput() [1/2]

PortInfo& circt::hw::ModulePortInfo::atInput ( size_t  idx)
inline

Definition at line 159 of file HWOpInterfaces.h.

References portNumForInput(), and ports.

Referenced by circt::msft::getValueName().

◆ atInput() [2/2]

const PortInfo& circt::hw::ModulePortInfo::atInput ( size_t  idx) const
inline

Definition at line 163 of file HWOpInterfaces.h.

References portNumForInput(), and ports.

◆ atOutput() [1/2]

PortInfo& circt::hw::ModulePortInfo::atOutput ( size_t  idx)
inline

Definition at line 160 of file HWOpInterfaces.h.

References portNumForOutput(), and ports.

◆ atOutput() [2/2]

const PortInfo& circt::hw::ModulePortInfo::atOutput ( size_t  idx) const
inline

Definition at line 166 of file HWOpInterfaces.h.

References portNumForOutput(), and ports.

◆ begin() [1/2]

iterator circt::hw::ModulePortInfo::begin ( )
inline

Definition at line 75 of file HWOpInterfaces.h.

References ports.

◆ begin() [2/2]

const_iterator circt::hw::ModulePortInfo::begin ( ) const
inline

Definition at line 77 of file HWOpInterfaces.h.

References ports.

◆ end() [1/2]

iterator circt::hw::ModulePortInfo::end ( )
inline

Definition at line 76 of file HWOpInterfaces.h.

References ports.

◆ end() [2/2]

const_iterator circt::hw::ModulePortInfo::end ( ) const
inline

Definition at line 78 of file HWOpInterfaces.h.

References ports.

◆ eraseInput()

void circt::hw::ModulePortInfo::eraseInput ( size_t  idx)
inline

Definition at line 170 of file HWOpInterfaces.h.

References assert(), portNumForInput(), ports, and sizeInputs().

Referenced by convertExtMemoryOps().

◆ getInputs() [1/2]

PortDirectionRange circt::hw::ModulePortInfo::getInputs ( )
inline

◆ getInputs() [2/2]

ConstPortDirectionRange circt::hw::ModulePortInfo::getInputs ( ) const
inline

Definition at line 120 of file HWOpInterfaces.h.

References getPortsOfDirection().

◆ getOutputs() [1/2]

PortDirectionRange circt::hw::ModulePortInfo::getOutputs ( )
inline

◆ getOutputs() [2/2]

ConstPortDirectionRange circt::hw::ModulePortInfo::getOutputs ( ) const
inline

Definition at line 124 of file HWOpInterfaces.h.

References getPortsOfDirection().

◆ getPortsOfDirection() [1/2]

PortDirectionRange circt::hw::ModulePortInfo::getPortsOfDirection ( bool  input)
inline

Definition at line 86 of file HWOpInterfaces.h.

References InOut, Input, Output, and ports.

Referenced by getInputs(), and getOutputs().

◆ getPortsOfDirection() [2/2]

ConstPortDirectionRange circt::hw::ModulePortInfo::getPortsOfDirection ( bool  input) const
inline

Definition at line 101 of file HWOpInterfaces.h.

References InOut, Input, Output, and ports.

◆ portNumForInput()

size_t circt::hw::ModulePortInfo::portNumForInput ( size_t  idx) const
inline

Definition at line 138 of file HWOpInterfaces.h.

References ports.

Referenced by atInput(), and eraseInput().

◆ portNumForOutput()

size_t circt::hw::ModulePortInfo::portNumForOutput ( size_t  idx) const
inline

Definition at line 148 of file HWOpInterfaces.h.

References ports.

Referenced by atOutput().

◆ sanitizeInOut()

void circt::hw::ModulePortInfo::sanitizeInOut ( )
inlineprivate

Definition at line 177 of file HWOpInterfaces.h.

References InOut, and ports.

Referenced by ModulePortInfo().

◆ size()

size_t circt::hw::ModulePortInfo::size ( ) const
inline

Definition at line 128 of file HWOpInterfaces.h.

References ports.

◆ sizeInputs()

size_t circt::hw::ModulePortInfo::sizeInputs ( ) const
inline

◆ sizeOutputs()

size_t circt::hw::ModulePortInfo::sizeOutputs ( ) const
inline

Member Data Documentation

◆ ports

SmallVector<PortInfo> circt::hw::ModulePortInfo::ports
private

This contains a list of all ports. Input first.

Definition at line 186 of file HWOpInterfaces.h.

Referenced by at(), atInput(), atOutput(), begin(), end(), eraseInput(), getPortsOfDirection(), ModulePortInfo(), portNumForInput(), portNumForOutput(), sanitizeInOut(), and size().


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