TI中文支持网
TI专业的中文技术问题搜集分享网站

TMS320C6678: 【TMDXEVM667LE】DSPF_sp_fftSPxSP

Part Number:TMS320C6678

在dsplib库中的源代码DSPF_sp_fftSPxSP_d.c 这个c文件是测试fft的c代码、优化c代码以及线性汇编代码的时间 

为什么要把输入数组和输出数组以及旋转因子数组多定义PAD个数

float x_i [M + 2 * PAD];
float x_sa[M + 2 * PAD];
float x_cn[M + 2 * PAD];

float w [M + 2 * PAD];

float y_i [M + 2 * PAD];
float y_sa[M + 2 * PAD];
float y_cn[M + 2 * PAD];

然后又定义指针

float *const ptr_x_i = x_i + PAD;
float *const ptr_x_sa = x_sa + PAD;
float *const ptr_x_cn = x_cn + PAD;

float *const ptr_w = w + PAD;

float *const ptr_y_i = y_i + PAD;
float *const ptr_y_sa = y_sa + PAD;
float *const ptr_y_cn = y_cn + PAD;

请问这个PAD是用来干什么的?另外ptr_x_i 这些指针为什么只加了一个PAD?

Shine:

因为DSPF_sp_fftSPxSP要求输入数组是double words对齐Arrays pointed by ptr_x, ptr_w, and ptr_y should align on the double words boundary

,

Zahir Wang:

在cmd文件中查看数组的首地址如下

PAD=0

0c00c000 00004000 (.common:x_sa) 0c010000 00004000 (.common:y_cn) 0c014000 00004000 (.common:y_i) 0c018000 00004000 (.common:y_sa)

PAD=16

0c00c180 00004080 (.common:x_sa) 0c010200 00004080 (.common:y_cn) 0c014280 00004080 (.common:y_i) 0c018300 00004080 (.common:y_sa)

加上PAD后

0c00c1c0 00004080 (.ptr_x)

0c018340 00004080 (.ptr_y )

 0c00c11c0、0c00c000、0c00c180这三个地址不都是double words对齐,那为什么还要设置PAD,然后prt_x地址为x_sa+pad?

,

Shine:

在e2e上找到一个类似的帖子,这个pad可以去掉,您看一下去掉后结果是不是还是一样。https://e2e.ti.com/support/processors-group/processors/f/processors-forum/220132/c674x-dsplib-padding

赞(0)
未经允许不得转载:TI中文支持网 » TMS320C6678: 【TMDXEVM667LE】DSPF_sp_fftSPxSP
分享到: 更多 (0)