Overview - 2023.2 English

Vitis Libraries

Release Date
2023-12-20
Version
2023.2 English

widget_api_cast is a design to change the interface between connected components. This component is able to change the stream interface to window interface and vice-versa. In addition, multiple input stream ports may be defined, as well as multiple copies of the window output.

These are the templates to configure the Widget API Cast class.

Parameters:

TT_DATA

describes the type of individual data samples input to and output from the function. This is a typename and must be one of the following:

int16, cint16, int32, cint32, float, cfloat.

TP_IN_API defines the input interface type. 0 = Window, 1 = Stream
TP_OUT_API defines the output interface type. 0 = Window, 1 = Stream
TP_NUM_INPUTS describes the number of input stream interfaces to be processed. When 2 inputs are configured, whe data will be read sequentially from each.
TP_WINDOW_VSIZE describes the number of samples in the window API used if either input or output is a window. Note: Margin size should not be included in TP_INPUT_WINDOW_VSIZE.
TP_NUM_OUTPUT_CLONES sets the number of output ports to write the input data to. Note that while input data from multiple ports is independent, data out is not.
TP_PATTERN sets the interleave or deinterleave pattern for configurations using dual streams, since streams are not considered clones for input nor for output. The patterns supported are: 0 (default) : 128bits are taken from each input, concatenated to 256b and output to window. or one 256b window read is split into upper and lower 128b cunks for output. 1 : kSampleIntlv. One TT_DATA sample is taken from each stream and written to window or vice versa. 2 : kSplit. The window is split into 2 halves with each half going to a stream.
TP_HEADER_BYTES sets the number of bytes at the beginning of a window which are not subject to interlace. These bytes are not included in TP_WINDOW_VSIZE as that refers to payload data whereas a header is intended for control information. Where this widget is configured for 2 streams in, the header is read from the first stream and copied to output. The header on the second stream is read and discarded. The header is written to all output windows or streams.
template <
    typename TT_DATA,
    unsigned int TP_IN_API,
    unsigned int TP_OUT_API,
    unsigned int TP_NUM_INPUTS,
    unsigned int TP_WINDOW_VSIZE,
    unsigned int TP_NUM_OUTPUT_CLONES = 1,
    unsigned int TP_PATTERN = 0,
    unsigned int TP_HEADER_BYTES = 0
    >
class widget_api_cast_graph: public graph

// fields

port <input> in[TP_NUM_INPUTS]
port <output> out[TP_NUM_OUTPUT_CLONES]
kernel m_kernel