CIRCT 20.0.0git
Loading...
Searching...
No Matches
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 <PortImplementation.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.
 

Detailed Description

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

Definition at line 57 of file PortImplementation.h.

Member Typedef Documentation

◆ const_iterator

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

Definition at line 71 of file PortImplementation.h.

◆ ConstPortDirectionRange

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

Definition at line 81 of file PortImplementation.h.

◆ iterator

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

Definition at line 70 of file PortImplementation.h.

◆ PortDirectionRange

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

Definition at line 78 of file PortImplementation.h.

Constructor & Destructor Documentation

◆ ModulePortInfo() [1/2]

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

Definition at line 58 of file PortImplementation.h.

References ports, and sanitizeInOut().

◆ ModulePortInfo() [2/2]

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

Definition at line 65 of file PortImplementation.h.

References sanitizeInOut().

Member Function Documentation

◆ at() [1/2]

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

Definition at line 156 of file PortImplementation.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 160 of file PortImplementation.h.

References ports.

◆ atInput() [1/2]

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

Definition at line 157 of file PortImplementation.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 161 of file PortImplementation.h.

References portNumForInput(), and ports.

◆ atOutput() [1/2]

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

Definition at line 158 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 164 of file PortImplementation.h.

References portNumForOutput(), and ports.

◆ begin() [1/2]

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

Definition at line 73 of file PortImplementation.h.

References ports.

◆ begin() [2/2]

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

Definition at line 75 of file PortImplementation.h.

References ports.

◆ end() [1/2]

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

Definition at line 74 of file PortImplementation.h.

References ports.

◆ end() [2/2]

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

Definition at line 76 of file PortImplementation.h.

References ports.

◆ eraseInput()

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

Definition at line 168 of file PortImplementation.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 118 of file PortImplementation.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 122 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 136 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 146 of file PortImplementation.h.

References ports.

Referenced by atOutput(), and atOutput().

◆ sanitizeInOut()

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

Definition at line 175 of file PortImplementation.h.

References circt::hw::ModulePort::InOut, and ports.

Referenced by ModulePortInfo(), and ModulePortInfo().

◆ size()

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

◆ 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

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