SPRUIG8J January 2018 – March 2024
Once the Streaming Engine has been configured, a corresponding stream can be opened and used. The following API is provided to facilitate this, which take the parameter template as well as the starting memory address from which the hardware should fetch the stream data:
__SE0_OPEN(void *addr,
__SE_TEMPLATE_v1 param);
__SE1_OPEN(void *addr,
__SE_TEMPLATE_v1 param);
The Streaming Engines are accessed using the following API, which will return a vector of data according to the given type, which is used to cast the type of the data being fetched by the stream:
__SE0(type),
__SE0ADV(type)
__SE1(type),
__SE1ADV(type)
Streaming Engines are closed using the corresponding close API:
__SE0_CLOSE();
__SE1_CLOSE();
Example for a stream with four dimensions:
// OPEN STREAMING ENGINE 1 AT startaddr WITH PARAMETER TEMPLATE params
__SE1_OPEN((void*)startaddr, params);
// READ THE STREAM AND ADVANCE THE COUNTERS
for (I0 = 0; I0 < 8; I0++)
{
uint8 Vout;
Vout.lo = __SE1ADV(uint4);
Vout.hi = __SE1ADV(uint4);
Vresult += Vout;
}
// CLOSE THE STREAM
__SE1_CLOSE();
Streaming from the provided memory address implies a contract in which the program promises never to modify the data in any area of memory that can be reached by that Streaming Engine during its lifetime.