|
CIRCT 22.0.0git
|
A ChannelPort which sends data to the accelerator. More...
#include <Ports.h>


Public Member Functions | |
| virtual void | connect (const ConnectOptions &options={}) override |
| Set up a connection to the accelerator. | |
| virtual void | disconnect () override |
| virtual bool | isConnected () const override |
| void | write (const MessageData &data) |
| A very basic blocking write API. | |
| bool | tryWrite (const MessageData &data) |
| A basic non-blocking write API. | |
| bool | flush () |
| Flush any buffered data. | |
| ChannelPort (const Type *type) | |
Public Member Functions inherited from esi::ChannelPort | |
| ChannelPort (const Type *type) | |
| virtual | ~ChannelPort () |
| bool | poll () |
| Poll for incoming data. | |
| const Type * | getType () const |
Protected Member Functions | |
| virtual void | writeImpl (const MessageData &)=0 |
| Implementation for write(). Subclasses must implement this. | |
| virtual bool | tryWriteImpl (const MessageData &data)=0 |
| Implementation for tryWrite(). Subclasses must implement this. | |
| void | translateOutgoing (const MessageData &data) |
| Translate outgoing data if the port type is a window type. | |
Protected Member Functions inherited from esi::ChannelPort | |
| 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 | |
| bool | translateMessages = false |
| Whether to translate outgoing data if the port type is a window type. | |
| std::vector< MessageData > | translationBuffer |
| If tryWrite cannot write all the messages of a windowed type at once, it stores them here and writes them out one by one on subsequent calls. | |
| size_t | translationBufferIdx = 0 |
| Index of the next message to write in translationBuffer. | |
Protected Attributes inherited from esi::ChannelPort | |
| const Type * | type |
| std::unique_ptr< TranslationInfo > | translationInfo |
Private Attributes | |
| volatile bool | connected = false |
A ChannelPort which sends data to the accelerator.
|
inlineoverridevirtual |
Set up a connection to the accelerator.
Implements esi::ChannelPort.
Reimplemented in esi::UnknownWriteChannelPort.
Definition at line 210 of file Ports.h.
Referenced by bandwidthWriteTest(), dmaWriteTest(), streamingAddTest(), streamingAddTranslatedTest(), and sv2cCosimserverEpRegister().
|
inlineoverridevirtual |
Implements esi::ChannelPort.
Definition at line 217 of file Ports.h.
References connected.
Referenced by streamingAddTest(), and streamingAddTranslatedTest().
|
inline |
Flush any buffered data.
Returns true if all data was flushed.
If translateMessages is false, calling flush() will immediately return true and perform no action, as there is no buffered data to flush.
Definition at line 259 of file Ports.h.
References translationBuffer, translationBufferIdx, and tryWriteImpl().
Referenced by tryWrite().
|
inlineoverridevirtual |
|
protected |
Translate outgoing data if the port type is a window type.
Append the new message 'chunks' to translationBuffer.
Definition at line 461 of file Ports.cpp.
References assert(), and esi::ChannelPort::translationInfo.
Referenced by tryWrite(), and write().
|
inline |
A basic non-blocking write API.
Returns true if any of the data was queued and/or sent. If the data type is a window a 'true' return does not indicate that the message has been completely written. The 'flush' method can be used to check that the entire buffer has been written. It is invalid for backends to always return false (i.e. backends must eventually ensure that writes may succeed).
Definition at line 241 of file Ports.h.
References assert(), flush(), translateMessages, translateOutgoing(), translationBuffer, and tryWriteImpl().
Referenced by NB_MODULE().
|
protectedpure virtual |
Implementation for tryWrite(). Subclasses must implement this.
Implemented in esi::UnknownWriteChannelPort.
Referenced by flush(), and tryWrite().
|
inline |
A very basic blocking write API.
Will likely change for performance reasons.
Definition at line 222 of file Ports.h.
References assert(), translateMessages, translateOutgoing(), translationBuffer, and writeImpl().
Referenced by bandwidthWriteTest(), NB_MODULE(), streamingAddTest(), streamingAddTranslatedTest(), and sv2cCosimserverEpTryPut().
|
protectedpure virtual |
Implementation for write(). Subclasses must implement this.
Implemented in esi::UnknownWriteChannelPort.
Referenced by write().
|
private |
Definition at line 290 of file Ports.h.
Referenced by esiaccel.types.FunctionPort::connect(), esiaccel.types.MetricPort::connect(), esiaccel.types.CallbackPort::connect(), disconnect(), and isConnected().
|
protected |
Whether to translate outgoing data if the port type is a window type.
Set by the connect() method.
Definition at line 279 of file Ports.h.
Referenced by tryWrite(), and write().
|
protected |
If tryWrite cannot write all the messages of a windowed type at once, it stores them here and writes them out one by one on subsequent calls.
Definition at line 282 of file Ports.h.
Referenced by flush(), tryWrite(), and write().
|
protected |