CIRCT 24.0.0git
Loading...
Searching...
No Matches
esi::services::ChannelService::ToHost Class Reference

A port which reads data from the accelerator (to_host). More...

#include <Services.h>

Inheritance diagram for esi::services::ChannelService::ToHost:
Collaboration diagram for esi::services::ChannelService::ToHost:

Public Member Functions

void connect ()
std::future< MessageData > read ()
virtual std::optional< std::string > toString (bool oneLine=false) const override
Public Member Functions inherited from esi::services::ServicePort
virtual ~ServicePort ()=default
 BundlePort (AppID id, const BundleType *type, PortMap channels)
 Construct a port.
Public Member Functions inherited from esi::BundlePort
 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 ToHost * get (AppID id, const BundleType *type, ReadChannelPort &dataPort)
Static Public Member Functions inherited from esi::BundlePort
static bool isWrite (BundleType::Direction bundleDir)
 Compute the direction of a channel given the bundle direction and the bundle port's direction.

Private Attributes

ReadChannelPort * dataPort = nullptr
bool connected = false

Friends

class ChannelService

Additional Inherited Members

Protected Attributes inherited from esi::BundlePort
AppID id
const BundleType * type
PortMap channels

Detailed Description

A port which reads data from the accelerator (to_host).

Definition at line 323 of file Services.h.

Member Function Documentation

◆ connect()

void ChannelService::ToHost::connect ( )

Definition at line 250 of file Services.cpp.

References esi::BundlePort::channels, connected, dataPort, and esi::BundlePort::getRawRead().

Referenced by NB_MODULE().

◆ get()

ChannelService::ToHost * ChannelService::ToHost::get ( AppID id,
const BundleType * type,
ReadChannelPort & dataPort )
static

Definition at line 244 of file Services.cpp.

References esi::BundlePort::type.

◆ read()

std::future< MessageData > ChannelService::ToHost::read ( )

Definition at line 261 of file Services.cpp.

References connected, and dataPort.

Referenced by NB_MODULE().

◆ toString()

virtual std::optional< std::string > esi::services::ChannelService::ToHost::toString ( bool oneLine = false) const
inlineoverridevirtual

Reimplemented from esi::services::ServicePort.

Definition at line 334 of file Services.h.

References esi::ChannelType::getInner(), esi::Type::toString(), and esi::BundlePort::type.

◆ ChannelService

friend class ChannelService
friend

Definition at line 324 of file Services.h.

References ChannelService, dataPort, and esi::BundlePort::type.

Referenced by ChannelService.

Member Data Documentation

◆ connected

◆ dataPort

ReadChannelPort* esi::services::ChannelService::ToHost::dataPort = nullptr
private

Definition at line 342 of file Services.h.

Referenced by ChannelService, connect(), and read().


The documentation for this class was generated from the following files: