SPRUIG3C January 2018 – August 2019 TDA4VM , TDA4VM-Q1
Some VCOP applications have kernels
that manipulate the parameter blocks of other kernels. This is to allow dynamic
update of kernel parameters without the overhead of returning to ARP32 and
re-calling the init()
function. However, it is fragile in that it
relies on the updating kernel to have direct knowledge of the pblock of the other
kernel, manifested as hard-coded pblock offsets.
There is no direct way to support this for C7x translation since the pblock size and layout differ. Kernels that perform pblock manipulation will not work if directly translated for C7x.
Compatibility Warning: Pblock Manipulation |
---|
The size and layout of the pblock differs between C7x and VCOP. A kernel which tries to modify the pblock or otherwise depends on its contents will not execute correctly on C7x. |
As an alternative means to support this functionality, the C7x migration tool adds an additional function to the dispatch API that allows for dynamic update of kernel parameters.
Recall that the
init()
function captures kernel parameters and stores them in
the tvals structure. It also computes additional expressions used by the
vloops()
function and stores them in the tvals structure.
A new keyword, __update,
identifies kernel parameters that may be dynamically updated. If any kernel
parameters are declared using __update
, the migration tool
generates an additional function with the following signature:
void kernel_update(<update args>, unsigned short pblock[])
The arguments to the
update()
function consist only of the kernel parameters
declared as __update
. The function updates the pblock by
re-capturing these parameters into the tvals structure, and re-evaluating any tvals
that depend on them. The updated pblock can be passed to a re-invocation of the
vloops()
function.
Table 2-2 provides an example of a kernel that declares __update
parameters, along with the generated code and the kernel dispatch code that calls
it.
Kernel-C Program |
|
Generated Update Function |
|
Client’s Kernel Dispatch Code |
|