CIRCT 22.0.0git
Loading...
Searching...
No Matches
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
esi::ChannelPort Class Referenceabstract

Unidirectional channels are the basic communication primitive between the host and accelerator. More...

#include <Ports.h>

Inheritance diagram for esi::ChannelPort:
Inheritance graph
[legend]
Collaboration diagram for esi::ChannelPort:
Collaboration graph
[legend]

Classes

struct  ConnectOptions
 
struct  TranslationInfo
 Instructions for translating windowed types. More...
 

Public Member Functions

 ChannelPort (const Type *type)
 
virtual ~ChannelPort ()
 
virtual void connect (const ConnectOptions &options=ConnectOptions())=0
 Set up a connection to the accelerator.
 
virtual void disconnect ()=0
 
virtual bool isConnected () const =0
 
bool poll ()
 Poll for incoming data.
 
const TypegetType () const
 

Protected Member Functions

virtual bool pollImpl ()
 Method called by poll() to actually poll the channel if the channel is connected.
 
virtual void connectImpl (const ConnectOptions &options)
 Called by all connect methods to let backends initiate the underlying connections.
 

Protected Attributes

const Typetype
 
std::unique_ptr< TranslationInfotranslationInfo
 

Detailed Description

Unidirectional channels are the basic communication primitive between the host and accelerator.

A 'ChannelPort' is the host side of a channel. It can be either read or write but not both. At this level, channels are untyped – just streams of bytes. They are not intended to be used directly by users but used by higher level APIs which add types.

Definition at line 36 of file Ports.h.

Constructor & Destructor Documentation

◆ ChannelPort()

ChannelPort::ChannelPort ( const Type type)

Definition at line 26 of file Ports.cpp.

References translationInfo, and type.

◆ ~ChannelPort()

virtual esi::ChannelPort::~ChannelPort ( )
inlinevirtual

Definition at line 39 of file Ports.h.

Member Function Documentation

◆ connect()

virtual void esi::ChannelPort::connect ( const ConnectOptions options = ConnectOptions())
pure virtual

Set up a connection to the accelerator.

Implemented in esi::UnknownReadChannelPort, esi::WriteChannelPort, esi::UnknownWriteChannelPort, and esi::ReadChannelPort.

Referenced by NB_MODULE().

◆ connectImpl()

virtual void esi::ChannelPort::connectImpl ( const ConnectOptions options)
inlineprotectedvirtual

Called by all connect methods to let backends initiate the underlying connections.

Definition at line 202 of file Ports.h.

Referenced by esi::ReadChannelPort::connect(), and esi::ReadChannelPort::connect().

◆ disconnect()

virtual void esi::ChannelPort::disconnect ( )
pure virtual

Implemented in esi::WriteChannelPort, and esi::ReadChannelPort.

Referenced by NB_MODULE().

◆ getType()

const Type * esi::ChannelPort::getType ( ) const
inline

Definition at line 130 of file Ports.h.

References type.

Referenced by NB_MODULE().

◆ isConnected()

virtual bool esi::ChannelPort::isConnected ( ) const
pure virtual

Implemented in esi::WriteChannelPort, and esi::ReadChannelPort.

Referenced by poll().

◆ poll()

bool esi::ChannelPort::poll ( )
inline

Poll for incoming data.

Returns true if data was read or written into a buffer as a result of the poll. Calling the call back could (will) also happen in that case. Some backends need this to be called periodically. In the usual case, this will be called by a background thread, but the ESI runtime does not want to assume that the host processes use standard threads. If the user wants to provide their own threads, they need to call this on each port occasionally. This is also called from the 'master' poll method in the Accelerator class.

Definition at line 124 of file Ports.h.

References isConnected(), and pollImpl().

◆ pollImpl()

virtual bool esi::ChannelPort::pollImpl ( )
inlineprotectedvirtual

Method called by poll() to actually poll the channel if the channel is connected.

Definition at line 198 of file Ports.h.

Referenced by poll().

Member Data Documentation

◆ translationInfo

std::unique_ptr<TranslationInfo> esi::ChannelPort::translationInfo
protected

◆ type

const Type* esi::ChannelPort::type
protected

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