CIRCT 24.0.0git
Loading...
Searching...
No Matches
circt::hw::ModulePortInfo Struct Reference

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

#include <PortImplementation.h>

Collaboration diagram for circt::hw::ModulePortInfo:

Public Types

using iterator = SmallVector<PortInfo>::iterator
using const_iterator = SmallVector<PortInfo>::const_iterator
using PortDirectionRange
using ConstPortDirectionRange

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
PortInfo & at (size_t idx)
PortInfo & atInput (size_t idx)
PortInfo & atOutput (size_t idx)
const PortInfo & at (size_t idx) const
const PortInfo & atInput (size_t idx) const
const PortInfo & atOutput (size_t idx) const
void eraseInput (size_t idx)

Private Attributes

SmallVector< PortInfo > ports
 This contains a list of all ports. Input first.

Detailed Description

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

Definition at line 56 of file PortImplementation.h.

Member Typedef Documentation

◆ const_iterator

using circt::hw::ModulePortInfo::const_iterator = SmallVector<PortInfo>::const_iterator

Definition at line 67 of file PortImplementation.h.

◆ ConstPortDirectionRange

Initial value:
llvm::iterator_range<llvm::filter_iterator<
const_iterator, std::function<bool(const PortInfo &)>>>
SmallVector< PortInfo >::const_iterator const_iterator
This holds the name, type, direction of a module's ports.

Definition at line 77 of file PortImplementation.h.

◆ iterator

using circt::hw::ModulePortInfo::iterator = SmallVector<PortInfo>::iterator

Definition at line 66 of file PortImplementation.h.

◆ PortDirectionRange

Initial value:
llvm::iterator_range<
llvm::filter_iterator<iterator, std::function<bool(const PortInfo &)>>>
SmallVector< PortInfo >::iterator iterator

Definition at line 74 of file PortImplementation.h.

Constructor & Destructor Documentation

◆ ModulePortInfo() [1/2]

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

Definition at line 57 of file PortImplementation.h.

References ports.

◆ ModulePortInfo() [2/2]

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

Definition at line 63 of file PortImplementation.h.

References begin(), end(), and ports.

Member Function Documentation

◆ at() [1/2]

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

Definition at line 150 of file PortImplementation.h.

References ports.

◆ at() [2/2]

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

Definition at line 154 of file PortImplementation.h.

References ports.

◆ atInput() [1/2]

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

Definition at line 151 of file PortImplementation.h.

References portNumForInput(), and ports.

◆ atInput() [2/2]

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

Definition at line 155 of file PortImplementation.h.

References portNumForInput(), and ports.

◆ atOutput() [1/2]

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

Definition at line 152 of file PortImplementation.h.

References portNumForOutput(), and ports.

◆ atOutput() [2/2]

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

Definition at line 158 of file PortImplementation.h.

References portNumForOutput(), and ports.

◆ begin() [1/2]

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

Definition at line 69 of file PortImplementation.h.

References ports.

Referenced by ModulePortInfo().

◆ begin() [2/2]

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

Definition at line 71 of file PortImplementation.h.

References ports.

◆ end() [1/2]

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

Definition at line 70 of file PortImplementation.h.

References ports.

Referenced by ModulePortInfo().

◆ end() [2/2]

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

Definition at line 72 of file PortImplementation.h.

References ports.

◆ eraseInput()

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

Definition at line 162 of file PortImplementation.h.

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

Referenced by convertExtMemoryOps().

◆ getInputs() [1/2]

◆ getInputs() [2/2]

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

Definition at line 112 of file PortImplementation.h.

References getPortsOfDirection().

◆ getOutputs() [1/2]

◆ getOutputs() [2/2]

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

Definition at line 116 of file PortImplementation.h.

References getPortsOfDirection().

◆ getPortsOfDirection() [1/2]

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

◆ getPortsOfDirection() [2/2]

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

◆ portNumForInput()

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

Definition at line 130 of file PortImplementation.h.

References ports.

Referenced by atInput(), atInput(), and eraseInput().

◆ portNumForOutput()

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

Definition at line 140 of file PortImplementation.h.

References ports.

Referenced by atOutput(), and atOutput().

◆ size()

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

Definition at line 120 of file PortImplementation.h.

References ports.

◆ sizeInputs()

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

◆ sizeOutputs()

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

Definition at line 125 of file PortImplementation.h.

References getOutputs().

Referenced by circt::hw::PortConverterImpl::run().

Member Data Documentation

◆ ports

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

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