SPRUIG8J January 2018 – March 2024
During typical operation, both the Streaming Engine (SE) and the Streaming Address Generator (SA) are conceptually modeled as a seven-level loop nest that calculates an offset. From the following model, some key points can be observed:
current_element_offset = 0;
/* ICNT5 programmed in the SE or SA template. */
for (i5 = 0; i5 < ICNT5; i5++)
{
level5_offset = current_element_offset;
/* ICNT4 programmed in the SE or SA template. */
for (i4 = 0; i4 < ICNT4; i4++)
{
level4_offset = current_element_offset;
/* ICNT3 programmed in the SE or SA template. */
for (i3 = 0; i3 < ICNT3; i3++)
{
level3_offset = current_element_offset;
/* ICNT2 programmed in the SE or SA template. */
for (i2 = 0; i2 < ICNT2; i2++)
{
level2_offset = current_element_offset;
/* ICNT1 programmed in the SE or SA template. */
for (i1 = 0; i1 < ICNT1; i1++)
{
level1_offset = current_element_offset;
/* ICNT0 programmed in the SE or SA template. */
/* VECLEN programmed in the SE or SA template. */
for (i0 = 0; i0 < ICNT0; i0 += VECLEN)
{
level0_offset = current_element_offset;
/* This inner loop demonstrates element processing of a vector.
* It is not considered a "level" of an SE or SA.
*/
for (elem = 0; elem < VECLEN; elem++)
{
/* Element processing. For the SE, this builds a
* result vector element-by-element at the specified
* offset from the base address, including
* performing vector predication. For the SA, this
* builds a predicate.
*/
process_element(current_element_offset);
/* DIM0 cannot be programmed. It is always 1. */
DIM0 = 1;
current_element_offset += DIM0;
}
/* Vector processing. For the SE, this yields the vector
* that was built in the SE register (e.g. SE0). For the
* SA, this yields the offset that the vector starts at
* in the SA register (e.g. SA0) and a vector predicate
* in the SA predicate register (e.g. PSA0).
*/
process_return_vector_data(level0_offset);
}
/* DIM1 programmed in the SE or SA template. */
current_element_offset = level1_offset + DIM1;
}
/* DIM2 programmed in the SE or SA template. */
current_element_offset = level2_offset + DIM2;
}
/* DIM3 programmed in the SE or SA template. */
current_element_offset = level3_offset + DIM3;
}
/* DIM4 programmed in the SE or SA template. */
current_element_offset = level4_offset + DIM4;
}
/* DIM5 programmed in the SE or SA template. */
current_element_offset = level5_offset + DIM5;
}