Andes Workshop

It is currently Sun Jul 22, 2018 6:14 am

All times are UTC + 8 hours [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: A tip to use Andes DSP Library
PostPosted: Fri Aug 19, 2016 11:22 am 
Offline

Joined: Fri May 04, 2012 6:49 am
Posts: 17
A formal article show us how to use Andes DSP Library:
viewtopic.php?f=23&t=924
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:


Attachments:
linker setting.png
linker setting.png [ 44.48 KiB | Viewed 2585 times ]
Top
 Profile Send private message E-mail  
 
 Post subject: Re: A tip to use Andes DSP Library
PostPosted: Tue Jan 30, 2018 6:14 pm 
Offline

Joined: Mon Dec 12, 2016 5:07 pm
Posts: 17
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.


Top
 Profile Send private message E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 8 hours [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group