SPRUI30H November 2015 – May 2024 DRA745 , DRA746 , DRA750 , DRA756
In addition to the vector instructions in PMEM, the vector core must read a parameter file in WBUF or IBUFL/IBUFH (depending on the pointer value) before it begins intended computation. The parameters include loop counts, address pointers to arrays, constants used in the computation, round/truncate shift count, saturation bounds, etc. The parameter pointer is located in VCOP_PARAM_PTR[31:0] PARAM_PTR.
Separation of configuration coded in the program memory versus configuration conveyed in data memory is essential, as this allows library functions to be constructed with reasonable code size and can serve a variety of need in applications. Loop counts and address pointers being conveyed via parameters is needed, so that, for example, one filter function works for various data/coefficient/output arrays and block and coefficient kernel sizes. Round/truncation shifts being convey via parameters means that, for example, the same filtering kernel program can work for filters with different radix point bit positions for filter coefficients.
Parameter registers are 16-bit per entry in the parameter file, up to 64 entries. The first 2 entries of the parameter file, P0 and P1, are hard-coded to constant values 0 and 1 respectively, as these are commonly used and it reduces code size by referring to these constants without taking up data memory space.
Parameters are referred to in the vector instructions either as single register, 16-bit parameter, or as a register pair, together make up 32-bit. Where a pair is used, the first parameter must be an even index, and contains the lower 16-bit of the 32-bit.
From an application development point of view, algorithm kernels are sometimes coded in one vector command per kernel, sometimes in several commands. Thus it is beneficial for the vector core to advance the parameter pointer automatically to reduce overhead. This requires a mechanism to specify or modify the parameter pointer when needed. This is addressed by the parameter pointer update feature through VCTRL.
A VCTRL instruction variation updates the parameter pointer for the subsequent VLOOP. The syntax is:
VCTRL scalar_register, PARAM_PTR |
Unless updated again by VCTRL, the parameter pointer is advanced automatically at the end of VLOOP execution by the #PL field of VLOOP. Thus, parameter blocks for multiple consecutive VLOOPs can be placed consecutively in data memory, and no VCTRL VCOP_PARAM_PTR is needed except for the first VLOOP.
For efficiency of parameter access by VLOOP, the pointer value conveyed via VCTRL must be 32-bit aligned. The parameter length specified in VLOOP is also 32-bit aligned. Thus, at the beginning of any VLOOP, the pointer is 32-bit aligned.
Note that inside a VLOOP while parameters are pulled off to configure the loop, the parameter pointer is only 16-bit aligned.
For example, if 11 parameter registers are used in a vector command, P0..10, the encoded parameter length is ceiling((11 – 2)/2) = 5. The subsequent next vector command accesses parameter registers 5 32-bit words from the current vector command, leaving one 16-bit halfword in memory unused.