the fir_interp in DSP library can not get correct result for 21569,but work well for 21489.
did you ever test it on 21569?and is there any demo code?
my CCES is 2.10.0
Could you please try simple example for fir_interp function available at below mentioned CCES help path with your filter coefficients and input data and let us know how you gets on.
CrossCore® Embedded Studio <version> > SHARC® Development Tools Documentation > C/C++ Library Manual for SHARC® Processors > DSP Run-Time Library > DSP Run-Time Library Reference > fir_interp
Please confirm whether you are getting expected results with simple example and the functions did produce non-zero plausible-looking output.
If you are still facing issue, Could you please share us an example project along with steps to reproduce your issue here.
Also, share us more details such as what input is provided, what output is expected, and what you get instead? Screenshot of behavior or issue that you are facing. This will help us to assist you further.
I've had a quick look at this and it definitely looks like there's a problem with the fir_interp() function. I believe the non-simd version is OK, so you can use that for now. This version can be selected by going to the Project Options, selecting "CrossCore SHARC C/C++ Compiler" -> "Processor" and selecting "Disable automatic SIMD code generation". If you are using the command line tools, you can use the compiler switch "-no-simd".
The library contains two versions of the fir_interp() function:
- a simd version called "fir_interp_vec()"
- a non-simd version called "fir_interp_vec_nonSIMD()"
When SIMD generation is disabled, the header file filter.h will convert calls to "fir_interp()" to the non-simd version of the function.
There are therefore a couple of ways you can do ensure the non-simd version is called, even when SIMD is enabled in your project:
1) Add the following to your code, after the #include of filter.h:
asm volatile ("#define fir_interp_vec. fir_interp_vec_nonSIMD.");
asm volatile ("#define _fir_interp_vec _fir_interp_vec_nonSIMD");
This forces the assembler preprocessor to ensure that the non-simd version is called.
2) Copy the source file for fir_interp() to your project and modify it. The source file is <<INSTALL>>/SHARC/lib/src/libdsp_src/fir_interp.asm
You will see the following code at line approx 480:
#pragma function_name fir_interp_vec_nonSIMD
#pragma function_name fir_interp_vec
If you change this to:
#pragma function_name fir_interp_vec_nonSIMD // Always use the non-simd version
You should find that your application will always call the non-simd version.
Note that you will need to add the following include path to the assembler preprocessor options in your Project Options:
where "<<INSTALL>>" is the path to your installation of CrossCore Embedded Studio.
I've attached a ZIP file that contains an updated version of the SIMD fir_interp() function. This updated version has been reviewed and tested internally and we plan to include it in CrossCore Embedded Studio 2.11.1.
The simplest way to use it is as follows:
- Open the ZIP file and copy the assembly file into your project
- Add the following include path to the assembler preprocessor options in your Project Options
- Rebuild your project.
It is also possible to replace the fir_interp() function in the DSP library with the new version, but that requires a few more steps and is best done using command line tools. Let me know if you want to do that and I will provide instructions.