CIRCT 21.0.0git
|
Services provide connections to 'bundles' – collections of named, unidirectional communication channels. More...
#include <Ports.h>
Public Member Functions | |
BundlePort (AppID id, const BundleType *type, PortMap channels) | |
Construct a port. | |
virtual | ~BundlePort ()=default |
AppID | getID () const |
Get the ID of the port. | |
WriteChannelPort & | getRawWrite (const std::string &name) const |
Get access to the raw byte streams of a channel. | |
ReadChannelPort & | getRawRead (const std::string &name) const |
const PortMap & | getChannels () const |
template<typename T > | |
T * | getAs () const |
Cast this Bundle port to a subclass which is actually useful. | |
bool | poll () |
Calls poll on all channels in the bundle and returns true if any of them returned true. | |
Static Public Member Functions | |
static bool | isWrite (BundleType::Direction bundleDir) |
Compute the direction of a channel given the bundle direction and the bundle port's direction. | |
Protected Attributes | |
AppID | id |
const BundleType * | type |
PortMap | channels |
Services provide connections to 'bundles' – collections of named, unidirectional communication channels.
This class provides access to those ChannelPorts.
BundlePort::BundlePort | ( | AppID | id, |
const BundleType * | type, | ||
PortMap | channels | ||
) |
|
virtualdefault |
|
inline |
|
inline |
|
inline |
Get the ID of the port.
Definition at line 239 of file Ports.h.
References id.
Referenced by printPort().
ReadChannelPort & BundlePort::getRawRead | ( | const std::string & | name | ) | const |
WriteChannelPort & BundlePort::getRawWrite | ( | const std::string & | name | ) | const |
Get access to the raw byte streams of a channel.
Intended for internal usage and binding to other languages (e.g. Python) which have their own message serialization code. Exposed publicly as an escape hatch, but ordinary users should not use. You have been warned.
Definition at line 25 of file Ports.cpp.
References channels.
|
inlinestatic |
Compute the direction of a channel given the bundle direction and the bundle port's direction.
Definition at line 230 of file Ports.h.
References esi::BundleType::To.
Referenced by esi::backends::cosim::CosimEngine::createPort().
|
inline |
|
protected |
Definition at line 270 of file Ports.h.
Referenced by getChannels(), getRawRead(), getRawWrite(), and poll().
|
protected |
Definition at line 269 of file Ports.h.
Referenced by esiaccel.types.WritePort::__serialize_msg(), hw.HWModuleOp::add_entry_block(), esiaccel.types.Port::connect(), esi::services::FuncService::Function::get(), hw.HWModuleOp::input_indices(), fsm.MachineOp::instantiate(), hw.HWModuleOp::outputs(), esiaccel.types.ReadPort::read(), esi::services::FuncService::Function::toString(), and esi::services::CallService::Callback::toString().