|
CIRCT 23.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. | |
| virtual void | write (std::unique_ptr< SegmentedMessageData > msg) |
| Write a multi-segment message. | |
| 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. | |
| size_t | getFrameSizeBytes () const |
| Get the size of each frame in bytes. | |
| 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. | |
| std::vector< MessageData > | getMessageFrames (const MessageData &data) |
| Break a message into its frames. | |
| 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 219 of file Ports.h.
Referenced by bandwidthWriteTest(), dmaWriteTest(), runLoopbackI8(), streamingAddTest(), streamingAddTranslatedTest(), and sv2cCosimserverEpRegister().
|
inlineoverridevirtual |
Implements esi::ChannelPort.
Definition at line 226 of file Ports.h.
References connected.
Referenced by esi::TypedWritePort< T, SkipTypeCheck >::disconnect(), esi::TypedWritePort< void >::disconnect(), 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 279 of file Ports.h.
References translationBuffer, translationBufferIdx, and tryWriteImpl().
Referenced by esi::TypedWritePort< T, SkipTypeCheck >::flush(), esi::TypedWritePort< void >::flush(), and tryWrite().
|
protected |
Break a message into its frames.
Definition at line 567 of file Ports.cpp.
References assert(), esi::ChannelPort::getFrameSizeBytes(), esi::Type::toString(), and esi::ChannelPort::type.
|
inlineoverridevirtual |
Implements esi::ChannelPort.
Definition at line 227 of file Ports.h.
References connected.
Referenced by esi::TypedWritePort< T, SkipTypeCheck >::isConnected(), and esi::TypedWritePort< void >::isConnected().
|
protected |
Translate outgoing data if the port type is a window type.
Append the new message 'chunks' to translationBuffer.
Definition at line 473 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 261 of file Ports.h.
References assert(), flush(), translateMessages, translateOutgoing(), translationBuffer, and tryWriteImpl().
Referenced by NB_MODULE(), esi::TypedWritePort< void >::tryWrite(), and esi::TypedWritePort< T, SkipTypeCheck >::tryWrite().
|
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 231 of file Ports.h.
References assert(), translateMessages, translateOutgoing(), translationBuffer, and writeImpl().
Referenced by bandwidthWriteTest(), NB_MODULE(), runLoopbackI8(), streamingAddTest(), streamingAddTranslatedTest(), sv2cCosimserverEpTryPut(), esi::TypedWritePort< void >::write(), esi::TypedWritePort< T, SkipTypeCheck >::write(), write(), and esi::TypedWritePort< T, SkipTypeCheck >::write().
|
inlinevirtual |
|
protectedpure virtual |
Implementation for write(). Subclasses must implement this.
Implemented in esi::UnknownWriteChannelPort.
Referenced by write().
|
private |
Definition at line 313 of file Ports.h.
Referenced by esiaccel.types.FunctionPort::connect(), esiaccel.types.MetricPort::connect(), esiaccel.types.ToHostPort::connect(), esiaccel.types.FromHostPort::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 302 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 305 of file Ports.h.
Referenced by flush(), tryWrite(), and write().
|
protected |