Andes Workshop

A tip to use Andes DSP Library
Page 1 of 1

Author:  HuJin [ Fri Aug 19, 2016 11:22 am ]
Post subject:  A tip to use Andes DSP Library

A formal article show us how to use Andes DSP Library:
This article show two attentional facts and responding tip.

Fact1: Some fucntions in Andes DSP Library will call functions in Math Library. Ex. nds32_sqrt_f32 will call sqrtf(). That means Andes DSP Library depends on Math Library.

Fact2: For static library, if there is a dependency between the multiple static libraries, there is a link order between the static libraries. Ex. Lib2.a depends on the lib1.a, and the final executable file test.adx depends on the lib2.a, the link option should be: -llib1.a -llib2.a, and not in turn, otherwise will be reported in the lib1.a some of the symbols are not defined.

Tips: So it is suggested to linker dsp library and then link math library when you want to use Andes DSP Library. The AndeSight setting is:

linker setting.png
linker setting.png [ 44.48 KiB | Viewed 1857 times ]

Author:  Hubert Chung [ Tue Jan 30, 2018 6:14 pm ]
Post subject:  Re: A tip to use Andes DSP Library

Newlib or MCUlib toolchains, “-ldsp” is needed to link libdsp.a when building applications without DSP ISA Extension. If your applications need the DSP ISA Extension support, please use linking options “-ldsp -mext-dsp -mext-zol” instead to obtain better performance.

For certain Andes DSP library functions that involve math functions in libm library (that is, nds32_std_f32, nds32_rms_f32, nds32_cmag_f32, nds32_sqrt_f32 and nds32_atan_f32), the linking option “-lm” must be applied after “-ldsp”. These linking options for Newlib and MCUlib toolchains are summarized below:
-ldsp links Andes DSP library (libdsp.a).
-mext-dsp enables DSP ISA Extension.
-mext-zol enables zero overhead loop.
-lm links libm math library.
Note that if you want to accelerate the DSP library with DSP ISA Extension, all three DSP related options (-ldsp, -mext-dsp and -mext-zol) MUST be applied at the same time. If these options are used individually, unpredictable errors may occur.

Page 1 of 1 All times are UTC + 8 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group