SPRUIG3C January 2018 – August 2019 TDA4VM , TDA4VM-Q1
In order to generate the copy-in/copy-out operations, the migration tool needs to know how large the table is. Unfortunately there is nothing in the Kernel-C source code that definitively indicates the size of a lookup or histogram table (the tables are referred to via a pointer to their base address). However, the migration tool can conservatively estimate the maximum required size by analyzing the possible range of values of the index vector used to index the table.
As a starting point, the absolute maximum table size is 32K bytes. That’s the size of each VCOP memory block, and the maximum size reservable for table data in L1D on C7x.
On VCOP, the index vector can only be defined by
loading it from memory. If the load’s data type is __vptr_int8
or
__vptr_uint8
, the maximum index value is either 127 or 255
respectively.
Alternatively, saturation is often applied to the index values so as to insure the table access is within its bounds. The migration tool uses the max-set value from the saturation expression to determine an upper bound on the index value and therefore the table’s size.
To indicate the exact size of a table in bytes,
the _HISTOGRAM
and _LOOKUP
directives have a new
optional parameter, table_size
:
_LOOKUP(num_tables, num_pts, duplication, table_size)
_HISTOGRAM(num_copies, duplication, table_size)
(Duplication is covered in Section 5.5.8) If the table size is not specified using the directives, and cannot be inferred by saturation or data size, the maximum size of 32K bytes will be used. The migration tool will issue a warning in this case.