SPRUJ28E November 2021 – September 2024 AM68 , AM68A , TDA4AL-Q1 , TDA4VE-Q1 , TDA4VL-Q1
If the circular addressing mode is selected in AMODE the definition of the upper 16 bits of the FMTFLAGS field are used to select the type of addressing for each entry in the loop and to define 2 unique masks that can be used for the circular buffering.
The following example code shows the method used to compute the masks referred to by the address_add function described in the‘ Address Arithmetic with Selectable Linear/Circular Addressing Modes section.
// Circular addressing masks.
// 1 bits in the mask indicate address bits that remain fixed.
// 0 bits in the mask indicate address bits that are allowed to vary.
uint64_t circ_mask_0;// mask for circular addressing block 0
uint64_t circ_mask_1;// mask for circular addressing block 1
void compute_circular_address_masks( int cbk0, int cbk1 )
{
int block_size_0 = cbk0 + 9;// power-of-2 of block size in bytes
int block_size_1 = cbk0 + cbk1 + 10;
if ( block_size_1 > 31 ) block_size_1 = 32;// clamp to 4GB maximum size
circ_mask_0 = (~0ULL) << block_size_0;
circ_mask_1 = (~0ULL) << block_size_1;
}
Example 3-4 Circular Address Mask Computation
31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 20 | 19 | 16 | ||||
AM3 | AM2 | AM1 | AM0 | CBK1 | CBK0 |
Bit | Field | Description |
---|---|---|
16-19 | CBK0 | Specifies the circular block 0 value as used in Circular Address Mask Computation |
20-23 | CBK1 | Specifies the circular block 1value as used in Circular Address Mask Computation |
24-25 | AM0 | The address mode to use with ICNT0 loop |
26-27 | AM1 | The address mode to use with ICNT1 loop |
28-29 | AM2 | The address mode to use with ICNT2 loop |
30-31 | AM3 | The address mode to use with ICNT3 loop |