CIRCT
20.0.0git
|
Unidirectional channels are the basic communication primitive between the host and accelerator. More...
#include <Ports.h>
Public Member Functions | |
ChannelPort (const Type *type) | |
virtual | ~ChannelPort () |
virtual void | connect (std::optional< unsigned > bufferSize=std::nullopt)=0 |
Set up a connection to the accelerator. More... | |
virtual void | disconnect ()=0 |
virtual bool | isConnected () const =0 |
bool | poll () |
Poll for incoming data. More... | |
const Type * | getType () const |
Protected Member Functions | |
virtual bool | pollImpl () |
Method called by poll() to actually poll the channel if the channel is connected. More... | |
virtual void | connectImpl (std::optional< unsigned > bufferSize) |
Called by all connect methods to let backends initiate the underlying connections. More... | |
Protected Attributes | |
const Type * | type |
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.
|
pure virtual |
Set up a connection to the accelerator.
The buffer size is optional and should be considered merely a hint. Individual implementations use it however they like. The unit is number of messages of the port type.
Implemented in esi::ReadChannelPort, and esi::WriteChannelPort.
Referenced by PYBIND11_MODULE().
|
inlineprotectedvirtual |
Called by all connect methods to let backends initiate the underlying connections.
Definition at line 70 of file Ports.h.
Referenced by esi::ReadChannelPort::connect(), and esi::WriteChannelPort::connect().
|
pure virtual |
Implemented in esi::ReadChannelPort, and esi::WriteChannelPort.
Referenced by PYBIND11_MODULE().
|
inline |
Definition at line 59 of file Ports.h.
References type.
Referenced by PYBIND11_MODULE(), esi::services::FuncService::Function::toString(), and esi::services::CallService::Callback::toString().
|
pure virtual |
Implemented in esi::ReadChannelPort, and esi::WriteChannelPort.
Referenced by 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 53 of file Ports.h.
References isConnected(), and pollImpl().
|
inlineprotectedvirtual |
|
protected |
Definition at line 62 of file Ports.h.
Referenced by fsm.MachineOp::__init__(), esiaccel.types.WritePort::__serialize_msg(), hw.HWModuleOp::add_entry_block(), esiaccel.types.Port::connect(), getType(), hw.HWModuleOp::input_indices(), fsm.MachineOp::instantiate(), hw.HWModuleOp::outputs(), and esiaccel.types.ReadPort::read().