CIRCT 22.0.0git
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
esi::ChannelPort::ConnectOptions Struct Reference

#include <Ports.h>

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

Public Member Functions

 ConnectOptions (std::optional< unsigned > bufferSize=std::nullopt, bool translateMessage=true)
 

Public Attributes

std::optional< unsigned > bufferSize = std::nullopt
 The buffer size is optional and should be considered merely a hint.
 
bool translateMessage = true
 If the type of this port is a window, translate the incoming/outgoing data into its underlying ('into') type.
 

Detailed Description

Definition at line 41 of file Ports.h.

Constructor & Destructor Documentation

◆ ConnectOptions()

esi::ChannelPort::ConnectOptions::ConnectOptions ( std::optional< unsigned >  bufferSize = std::nullopt,
bool  translateMessage = true 
)
inline

Definition at line 106 of file Ports.h.

Member Data Documentation

◆ bufferSize

std::optional<unsigned> esi::ChannelPort::ConnectOptions::bufferSize = std::nullopt

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.

Definition at line 45 of file Ports.h.

Referenced by NB_MODULE().

◆ translateMessage

bool esi::ChannelPort::ConnectOptions::translateMessage = true

If the type of this port is a window, translate the incoming/outgoing data into its underlying ('into') type.

For 'into' types without lists, just re-arranges the data fields from the lowered type to the 'into' type.

If this option is false, no translation is done and the data is passed through as-is. Same is true for non-windowed types.

For messages with lists, only two types are supported: 1) Parallel encoding includes any 'header' data with each frame. Said header data is the same across all frames, so this encoding is inefficient but is commonly used for on-chip streaming interfaces. Each frame contains a 'last' field to indicate the end of the list. In cases where 'numItems' is greater than 1, a field named '<listField>_size' indicates the number of valid items in that frame. 2) Serial (bulk transfer) encoding, where a 'header' frame precedes the list data frame. Said header frame contains a 'count' field indicating the number of items in the list. Importantly, the header frame is always re-transmitted after the specified number of list items have been sent. If the 'count' field is zero, the end of the list has been reached. If it is non-zero, the message has not been completely transmitted and reading should continue until a 'count' of zero is received.

In both cases, the host-side MessageData contains the complete header followed by the list data. In other words, header data is not duplicated in the returned message. So for a windowed type with header fields and a list of (x,y) coordinates, the host memory layout would be:

struct ExampleList {
uint32_t headerField2; // SystemVerilog ordering
uint32_t headerField1;
size_t list_length; // Number list items
struct { uint16_t y, x; } list_data[];
}

In a parallel encoding, each frame's wire format (from hardware) is:

struct ExampleListFrame {
uint8_t list_last; // Non-zero indicates last item in list
struct { uint16_t y, x; } list_data[numItems]; // SV field ordering
uint32_t headerField2; // SV struct ordering (reversed)
uint32_t headerField1;
}

Important note: for consistency, preserves SystemVerilog struct field ordering! So it's the opposite of C struct ordering.

Implementation status:

  • Only parallel list encoding is supported.
  • Fields must be byte-aligned.

See the CIRCT documentation (or td files) for more details on windowed messages.

Definition at line 104 of file Ports.h.

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


The documentation for this struct was generated from the following file: