SPRUIG3C January 2018 – August 2019 TDA4VM , TDA4VM-Q1
VCOP has a hardware feature that supports circular addressing for loads and stores. Addresses consisting of a base and offset computed such that the offset is taken modulo a fixed buffer size, causing the address to wrap back to the beginning of the buffer as the offset increases. In VCOP Kernel-C circular addressing is specified using a modulo (%) operator in the address calculation.
C7X does not directly support circular addressing using normal indirect addressing modes. The Streaming Engine supports circular addressing, but only for loads.
The migration tool implements circular addressing using an explicit computation at the point of the access. The effective address is computed as follows:
unsigned long mask = BUF_SIZE - 1;
void *addr = (base & ~mask) | ((base + offset) & mask);
The mask is invariant and can be pre-computed outside the loop. The rest of the computation requires 4 instructions: an ADD, two ANDs, and an OR.