我正在尝试MIPS DSP功能在PIC32 MX130F064 B上工作。我使用XC32 V2.05和MPLABX V4.15。FFT函数(MIPS1 FFT16)工作很好。向量添加函数(MIPSvVECADAD16)工作得很好。但是多个函数中没有一个工作(MIPSH VECUMUL16,MIPSY VECUM SUMIX SuffRES16等)。下面是一个示例,演示MIPsxVECUAD16的工作原理,但是MIPsxVECUMUL16不起作用。我尝试了不同的编译器设置,使用32位版本的函数并使用不同的数据类型(包括FrACT和字节对齐编译器指令)。但这些都没有效果。下面是测试代码,在这里我表示向量乘法工作,但是向量乘以X.H.& gt;包括“dSpBixDSP.H”UINT32×t AB〔1000〕;INT32 32×BB;INT16 TestOutOUT〔16〕;INT16 TEST1〔16〕;INT16 Test2〔16〕;int NN;int main(空隙){int NN;(NN=0;NN & LT;16;NN+++){Test1[NN]=NN。//TEST1是0,1,2,3,4…Test2[NN]=NN+5;//Test2是5、6、7、8、9、…} MIPSSVIECADAD16(TestOutOUT,TEST1,TEST 2,16);//矢量添加工作完美!对于(NN=0;NN和lt;16;NN++){//这是我设置断点并检查TestOxOUT数组的地方。PtUB= TestOxOU[NN];//TestExoT是5,7,9,11,15,…正确答案!} MIPSvVECUMUL16(Tes
tiOUT,TEST1,TEST 2,16);/ /向量多重返回全部零。对于(NN=0;NN和lt;16;NN++){//这是我设置断点并检查TestOxOUT数组的地方。PtUB= TestOxOU[NN];//TestIOUT应该是0,7,14等,但它都是零(不正确)} TestOxOut[0 ]=MIPSv.VEC.SUMIX SUBARES16(Test1,16.1);//平方和返回零/ /这是我设置断点并检查TestOxOUT数组的地方。PtUB= TestEXOUT〔0〕;//TestExOUT(0)等于零(不正确)返回(0);}
以上来自于百度翻译
以下为原文
I'm trying to get the mips DSP functions working on a PIC32MX130F064B. I'm using xc32 v2.05 and MPLABX v4.15. The FFT function (mips_fft16) works great. The vector add function (mips_vec_add16) works great. But none of the multiple functions work (mips_vec_mul16, mips_vec_sum_squares16 etc) . Below is an example where I show mips_vec_add16 working, but the mips_vec_mul16 doesn't work. I've tried different compiler settings, using 32 bit version of the functions and using different datatypes (including Fract and byte alignment compiler directives). But none of that works.
Below is test code where I show that the vector add works, but the vector multiplies return all zeros.
#include
#include "dsplib_dsp.h"
uint32_t aa[1000];
uint32_t bb;
int16 test_out[16];
int16 test1[16];
int16 test2[16];
int nn;
int main(void)
{
int nn;
for (nn=0;nn<16;nn++) {
test1[nn]=nn; //test1 is 0,1,2,3,4 ...
test2[nn]=nn+5; //test2 is 5,6,7,8,9,....
}
mips_vec_add16(test_out,test1,test2,16); //vector add works perfect!
for (nn=0;nn<16;nn++) {
//This is where I set a breakpoint and inspect test_out array.
PORTB = test_out[nn]; //test_out is 5,7,9,11,15,....correct answer!
}
mips_vec_mul16(test_out,test1,test2,16); //vector multiple returns all zeros.
for (nn=0;nn<16;nn++) {
//This is where I set a breakpoint and inspect test_out array.
PORTB = test_out[nn]; //test_out should be 0,7,14,etc, but it's all zeros (incorrect)
}
test_out[0]=mips_vec_sum_squares16(test1,16,1); //sum of squares returns zeros
//This is where I set a breakpoint and inspect test_out array.
PORTB = test_out[0]; //test_out[0] is equal to zero (incorrect)
return(0);
}