From: Jianzhong Xu Date: Fri, 8 Mar 2019 21:22:42 +0000 (-0500) Subject: Fixed following bugs: X-Git-Url: https://git.ti.com/gitweb?p=ep-processor-libraries%2Fdsplib.git;a=commitdiff_plain;h=e6fdaea3f1906f30c6b295d22dd9d43de1171a5f Fixed following bugs: - PROC_LIBS-282: Incorrect indexing in the DSPF_sp_fircirc - PROC_LIBS-222: Example fft_sp_ex in dsplib_c66x_3_4_0_0 does not give correct results - PRSDK-5250: Missing DSPF_sp_fftSPxSP_r2c result in DSPLIB test report Signed-off-by: Jianzhong Xu --- diff --git a/ti/dsplib/docs/bundle/DSPLIB_C66x_TestReport.html b/ti/dsplib/docs/bundle/DSPLIB_C66x_TestReport.html index af8019d..62d54bf 100644 --- a/ti/dsplib/docs/bundle/DSPLIB_C66x_TestReport.html +++ b/ti/dsplib/docs/bundle/DSPLIB_C66x_TestReport.html @@ -321,7 +321,7 @@ - DSPF_sp_fftSPxSP + DSPF_sp_fftSPxSP_r2c Passed 579 (N=128) 1136 (N=256) N/A @@ -1317,7 +1317,7 @@ - DSPF_sp_fftSPxSP + DSPF_sp_fftSPxSP_r2c Passed 579 (N=128) 1136 (N=256) N/A @@ -2313,7 +2313,7 @@ - DSPF_sp_fftSPxSP + DSPF_sp_fftSPxSP_r2c Passed 590 (N=128) 1144 (N=256) N/A @@ -3309,7 +3309,7 @@ - DSPF_sp_fftSPxSP + DSPF_sp_fftSPxSP_r2c Passed 590 (N=128) 1144 (N=256) N/A diff --git a/ti/dsplib/docs/bundle/doxygen/release.h.xdt b/ti/dsplib/docs/bundle/doxygen/release.h.xdt index a51781a..3bf72ea 100644 --- a/ti/dsplib/docs/bundle/doxygen/release.h.xdt +++ b/ti/dsplib/docs/bundle/doxygen/release.h.xdt @@ -182,7 +182,11 @@ *
* *

Fixed Bugs

- * No bugs were fixed in this release. + * * * *
diff --git a/ti/dsplib/docs/manifest/manifest.xml b/ti/dsplib/docs/manifest/manifest.xml index 20fbe14..fc9a500 100644 --- a/ti/dsplib/docs/manifest/manifest.xml +++ b/ti/dsplib/docs/manifest/manifest.xml @@ -57,7 +57,7 @@ --> DSPLIB Package - 3.4.0.2 + 3.4.0.3 Publicly Available Publicly Available The TI C6000 DSPLIB is an optimized DSP Function Library for C programmers @@ -71,7 +71,7 @@ --> Digital Signal Processing library - 3.4.0.2 + 3.4.0.3 TI BSD Source N/A diff --git a/ti/dsplib/examples/fft_sp_ex/fft_example_sp.c b/ti/dsplib/examples/fft_sp_ex/fft_example_sp.c index 457a25d..0646512 100644 --- a/ti/dsplib/examples/fft_sp_ex/fft_example_sp.c +++ b/ti/dsplib/examples/fft_sp_ex/fft_example_sp.c @@ -151,30 +151,27 @@ seperateRealImg () { void gen_twiddle_fft_sp (float *w, int n) { int i, j, k; - double x_t, y_t, theta1, theta2, theta3; const double PI = 3.141592654; for (j = 1, k = 0; j <= n >> 2; j = j << 2) { for (i = 0; i < n >> 2; i += j) { - theta1 = 2 * PI * i / n; - x_t = cos (theta1); - y_t = sin (theta1); - w[k] = (float) x_t; - w[k + 1] = (float) y_t; - - theta2 = 4 * PI * i / n; - x_t = cos (theta2); - y_t = sin (theta2); - w[k + 2] = (float) x_t; - w[k + 3] = (float) y_t; - - theta3 = 6 * PI * i / n; - x_t = cos (theta3); - y_t = sin (theta3); - w[k + 4] = (float) x_t; - w[k + 5] = (float) y_t; +#ifdef _LITTLE_ENDIAN + w[k] = (float) sin (2 * PI * i / n); + w[k + 1] = (float) cos (2 * PI * i / n); + w[k + 2] = (float) sin (4 * PI * i / n); + w[k + 3] = (float) cos (4 * PI * i / n); + w[k + 4] = (float) sin (6 * PI * i / n); + w[k + 5] = (float) cos (6 * PI * i / n); +#else + w[k] = (float) cos (2 * PI * i / n); + w[k + 1] = (float) -sin (2 * PI * i / n); + w[k + 2] = (float) cos (4 * PI * i / n); + w[k + 3] = (float) -sin (4 * PI * i / n); + w[k + 4] = (float) cos (6 * PI * i / n); + w[k + 5] = (float) -sin (6 * PI * i / n); +#endif k += 6; } } diff --git a/ti/dsplib/package.bld b/ti/dsplib/package.bld index f26e9d2..a218f2c 100644 --- a/ti/dsplib/package.bld +++ b/ti/dsplib/package.bld @@ -965,7 +965,7 @@ Package.archiveFiles["CommonArchiveFiles"] = { /* Set up version number for the package */ Package.pkgStdVer = "2.0"; - Package.version = [3, 4, 0, 2, 3, 0]; + Package.version = [3, 4, 0, 3, 3, 0]; Package.createVersion(); diff --git a/ti/dsplib/src/DSPF_sp_fftSPxSP_r2c/c66/DSPF_sp_fftSPxSP_r2c_d.c b/ti/dsplib/src/DSPF_sp_fftSPxSP_r2c/c66/DSPF_sp_fftSPxSP_r2c_d.c index 5927339..cbdde69 100644 --- a/ti/dsplib/src/DSPF_sp_fftSPxSP_r2c/c66/DSPF_sp_fftSPxSP_r2c_d.c +++ b/ti/dsplib/src/DSPF_sp_fftSPxSP_r2c/c66/DSPF_sp_fftSPxSP_r2c_d.c @@ -180,7 +180,7 @@ int main () tw_gen (ptr_w_i, N); tw_gen_cn (ptr_w_cn, N); - printf("DSPF_sp_fftSPxSP\tIter#: %d\t", k); + printf("DSPF_sp_fftSPxSP_r2c\tIter#: %d\t", k); t_start = _itoll(TSCH, TSCL); DSPF_sp_fftSPxSP_r2c_cn (N, &ptr_x_cn[0], &ptr_w_cn[0], ptr_y_cn, brev, rad_cn, 0, N); t_stop = _itoll(TSCH, TSCL); diff --git a/ti/dsplib/src/DSPF_sp_fircirc/c66/DSPF_sp_fircirc.c b/ti/dsplib/src/DSPF_sp_fircirc/c66/DSPF_sp_fircirc.c index a734eba..e065658 100644 --- a/ti/dsplib/src/DSPF_sp_fircirc/c66/DSPF_sp_fircirc.c +++ b/ti/dsplib/src/DSPF_sp_fircirc/c66/DSPF_sp_fircirc.c @@ -51,7 +51,6 @@ void DSPF_sp_fircirc(const float *x, float *h, float *restrict y, int i, j; /* Circular Buffer block size = ((2^(csize + 1)) / 4) floating point numbers */ int mod = (1 << (csize - 1)) - 1; - float *x_ptr = (float*)&x[index]; __float2_t x_10, x_21, x_32, x_43, x_54, h_10; __float2_t sum1, sum2, sum3, sum4; @@ -71,15 +70,15 @@ void DSPF_sp_fircirc(const float *x, float *h, float *restrict y, sum3 = 0; sum4 = 0; - x_10 = _amem8_f2_const(&x_ptr[(i) & (mod)]); - x_32 = _amem8_f2_const(&x_ptr[(i+2) & (mod)]); + x_10 = _amem8_f2_const(&x[(j+index) & (mod)]); + x_32 = _amem8_f2_const(&x[(j+2+index) & (mod)]); x_21 = _ftof2(_lof2(x_32), _hif2(x_10)); /* note: h coeffs given in reverse order: { h[nh-1], h[nh-2], ..., h[0] } */ #pragma MUST_ITERATE(1,,) for(i = 0; i < nh; i+=2) { h_10 = _amem8_f2_const(&h[i]); - x_54 = _amem8_f2_const(&x_ptr[(i+4) & (mod)]); + x_54 = _amem8_f2_const(&x[(j+i+4+index) & (mod)]); x_43 = _ftof2(_lof2(x_54), _hif2(x_32)); sum1 = _daddsp(sum1, _dmpysp(x_10, h_10)); @@ -102,7 +101,6 @@ void DSPF_sp_fircirc(const float *x, float *h, float *restrict y, int i, j; /* Circular Buffer block size = ((2^(csize + 1)) / 4) floating point numbers */ int mod = (1 << (csize - 1)) - 1; - float *x_ptr = (float*)&x[index]; __float2_t x_01, x_12, x_23, x_34, x_45, h_01; __float2_t sum1, sum2, sum3, sum4; @@ -122,15 +120,15 @@ void DSPF_sp_fircirc(const float *x, float *h, float *restrict y, sum3 = 0; sum4 = 0; - x_01 = _amem8_f2_const(&x_ptr[(i) & (mod)]); - x_23 = _amem8_f2_const(&x_ptr[(i+2) & (mod)]); + x_01 = _amem8_f2_const(&x[(j+index) & (mod)]); + x_23 = _amem8_f2_const(&x[(j+2+index) & (mod)]); x_12 = _ftof2(_lof2(x_01), _hif2(x_23)); /* note: h coeffs given in reverse order: { h[nh-1], h[nh-2], ..., h[0] } */ #pragma MUST_ITERATE(1,,) for(i = 0; i < nh; i+=2) { h_01 = _amem8_f2_const(&h[i]); - x_45 = _amem8_f2_const(&x_ptr[(i+4) & (mod)]); + x_45 = _amem8_f2_const(&x[(j+i+4+index) & (mod)]); x_34 = _ftof2(_lof2(x_23), _hif2(x_45)); sum1 = _daddsp(sum1, _dmpysp(x_01, h_01)); @@ -153,4 +151,3 @@ void DSPF_sp_fircirc(const float *x, float *h, float *restrict y, /* Copyright (c) 2011 Texas Instruments, Incorporated. */ /* All Rights Reserved. */ /* ======================================================================= */ - diff --git a/ti/dsplib/src/DSPF_sp_fircirc/c66/DSPF_sp_fircirc_d.c b/ti/dsplib/src/DSPF_sp_fircirc/c66/DSPF_sp_fircirc_d.c index 155abb4..c259ee4 100644 --- a/ti/dsplib/src/DSPF_sp_fircirc/c66/DSPF_sp_fircirc_d.c +++ b/ti/dsplib/src/DSPF_sp_fircirc/c66/DSPF_sp_fircirc_d.c @@ -156,7 +156,7 @@ void main() /* --------------------------------------------------------------- */ for(i=0; i< ny; i++) { pct_diff = 0; - if (abs((ptr_y_i[i]) > FLT_THRES) || (abs(ptr_y_cn[i]) > FLT_THRES)) + if ((abs(ptr_y_i[i]) > FLT_THRES) || (abs(ptr_y_cn[i]) > FLT_THRES)) pct_diff = (ptr_y_cn[i] - ptr_y_i[i]) / ptr_y_cn[i] * 100.0; if (pct_diff < 0) pct_diff *= -1; if (pct_diff > max_pct_diff) max_pct_diff = pct_diff; diff --git a/ti/dsplib/src/DSPF_sp_fircirc/c674/DSPF_sp_fircirc_d.c b/ti/dsplib/src/DSPF_sp_fircirc/c674/DSPF_sp_fircirc_d.c index 97537dd..dc043ae 100644 --- a/ti/dsplib/src/DSPF_sp_fircirc/c674/DSPF_sp_fircirc_d.c +++ b/ti/dsplib/src/DSPF_sp_fircirc/c674/DSPF_sp_fircirc_d.c @@ -156,7 +156,7 @@ void main() /* --------------------------------------------------------------- */ for(i=0; i< ny; i++) { pct_diff = 0; - if (abs((ptr_y_i[i]) > FLT_THRES) || (abs(ptr_y_cn[i]) > FLT_THRES)) + if ((abs(ptr_y_i[i]) > FLT_THRES) || (abs(ptr_y_cn[i]) > FLT_THRES)) pct_diff = (ptr_y_cn[i] - ptr_y_i[i]) / ptr_y_cn[i] * 100.0; if (pct_diff < 0) pct_diff *= -1; if (pct_diff > max_pct_diff) max_pct_diff = pct_diff;