请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
器件型号:TMS320C6657 很确定该代码是错误的。 就在电池组的右侧、您可以看到在设置其值之前使用了"i"。 此外、它看起来"x pointer"、x_ptr、永远不会递增。 不确定测试方法、但它在这里不起作用、看起来不正确。 让 TI 更有能力。 在库函数损坏、CCS 和不存在的技术支持这一残酷的笑话之间、您可能会失去一个客户、一年购买数百万美元的产品。 成本降低很重要、外包是实现这一目标的一种方法、但当产品质量受到影响且遭受巨大损失时、或许是时候重新评估该决定了。
void DSPF_sp_fircirc (const float * x、float * h、float * restrict y、 int index、int csize、int nh、int NY) { int i、j; /*循环缓冲区块大小=((2^(csize + 1))/4)浮点数*/ int mod =(1 <<(csize - 1))-1; float *x_ptr =(float*)&x[索引]; _float2_t x_10、x_21、x_32、x_43、x_54、 H_10; __float2_t sum1、sum2、sum3、sum4; _nassert (nh >=2); _nassert (nh % 2 = 0); _nassert (NY >=4); _nassert (NY % 4 = 0); _nassert (((int) x % 8 = 0); _nassert (((int) y % 8 = 0); _nassert (((int) h % 8 = 0); #pragma MUST_ITERATE (1、、、) for (j = 0;j < ny;j+=4) { 总和1 = 0; sum2 = 0; 总和3 = 0; sum4 = 0; x_10 =_amem8_f2_const (&x_ptr [(i)&(mod)]); x_32 =_amem8_f2_const (&x_pt[(i+2)&(mod)]); x_21 =_ftof2 (_lof2 (x_32)、_hif2 (x_10)); /*注意:以相反的顺序给出的 h 系数:{h[nh-1]、h[nh-2]、...、h[0]}*/ #pragma MUST_ITERATE (1、、、) 对于(i = 0;i < nh;i+=2){ h_10 =_amem8_f2_const (&h[i]); x_54 =_amem8_f2_const (&x_pt[(i+4)&(mod)]); x_43 =_ftof2 (_lof2 (x_54)、_hif2 (x_32)); sum1 =_daddsp (sum1、_dmpysp (x_10、h_10)); sum2 =_daddsp (sum2、_dmpysp (x_21、h_10)); sum3 =_daddsp (sum3、_dmpysp (x_32、h_10)); sum4 =_daddsp (sum4、_dmpysp (x_43、h_10)); x_10 = x_32; x_21 = x_43; x_32 = x_54; } _amem8_f2 (&y[j])=_ftof2 (_hif2 (sum2)+_lof2 (sum2)、_hif2 (sum1)+_lof2 (sum1)); _amem8_f2 (&y[j+2])=_ftof2 (_hif2 (sum4)+_lof2 (sum4)、_hif2 (sum3)+_lof2 (sum3))); } }