CMSIS-DSP: Update link script for test framework.

pull/19/head
Christophe Favergeon 6 years ago
parent 1044e5b793
commit 18fe3c157d

@ -13,18 +13,19 @@ LOAD_REGION 0x0
{ {
*.o (RESET, +First) *.o (RESET, +First)
* (InRoot$$$Sections) * (InRoot$$$Sections)
* (+RO-CODE) * (+RO)
} }
DATA 0x20000000 0x7000 DATA 0x20000000 0x60000
{ {
* (+RO-DATA)
* (+RW,+ZI) * (+RW,+ZI)
} }
ARM_LIB_STACK 0x2000C000 ALIGN 64 EMPTY -0x00002000 ARM_LIB_STACK 0x20062000 ALIGN 64 EMPTY -0x00002000
{} {}
ARM_LIB_HEAP 0x2000C000 ALIGN 64 EMPTY 0x0050000 ARM_LIB_HEAP 0x20062000 ALIGN 64 EMPTY 0x0050000
{} {}
} }

@ -12,21 +12,23 @@
LOAD_REGION 0x0 LOAD_REGION 0x0
{ {
CODE +0 0x30000 CODE +0 0x80000
{ {
*.o (RESET, +First) *.o (RESET, +First)
* (InRoot$$$Sections) * (InRoot$$$Sections)
* (+RO-CODE) * (+RO)
} }
DATA 0x20000000 0x7000
DATA 0x20000000 NOCOMPRESS 0x60000
{ {
* (+RO-DATA)
* (+RW,+ZI) * (+RW,+ZI)
} }
ARM_LIB_STACK 0x2000C000 ALIGN 64 EMPTY -0x00002000 ARM_LIB_STACK 0x20062000 ALIGN 64 EMPTY -0x00002000
{} {}
ARM_LIB_HEAP 0x2000C000 ALIGN 64 EMPTY 0x00050000 ARM_LIB_HEAP 0x20062000 ALIGN 64 EMPTY 0x00050000
{} {}
} }

@ -25,5 +25,10 @@ LOAD_REGION 0x0
{} {}
ARM_LIB_HEAP 0x20006000 ALIGN 64 EMPTY 0x0050000 ARM_LIB_HEAP 0x20006000 ALIGN 64 EMPTY 0x0050000
{} {}
PATTERNS 0x60000000 0x80000
{
patterndata.c.o (+RO-DATA)
}
} }

@ -9,16 +9,15 @@
LOAD_REGION 0x0 LOAD_REGION 0x0
{ {
CODE +0 0x30000 CODE +0 0x100000
{ {
*.o (RESET, +First) *.o (RESET, +First)
* (InRoot$$$Sections) * (InRoot$$$Sections)
* (+RO-CODE) * (+RO)
} }
DATA 0x20000000 0xF0000 DATA 0x20000000 NOCOMPRESS 0xF0000
{ {
* (+RO-DATA)
* (+RW,+ZI) * (+RW,+ZI)
} }
@ -26,6 +25,11 @@ LOAD_REGION 0x0
{} {}
ARM_LIB_HEAP 0x20100000 ALIGN 64 EMPTY 0x00100000 ARM_LIB_HEAP 0x20100000 ALIGN 64 EMPTY 0x00100000
{} {}
PATTERNS 0x60000000 0x100000
{
patterndata.c.o (+RO-DATA)
}
} }

@ -9,16 +9,15 @@
LOAD_REGION 0x0 LOAD_REGION 0x0
{ {
CODE +0 0x30000 CODE +0 0x100000
{ {
*.o (RESET, +First) *.o (RESET, +First)
* (InRoot$$$Sections) * (InRoot$$$Sections)
* (+RO-CODE) * (+RO)
} }
DATA 0x20000000 0xF0000 DATA 0x20000000 NOCOMPRESS 0xF0000
{ {
* (+RO-DATA)
* (+RW,+ZI) * (+RW,+ZI)
} }
@ -26,4 +25,9 @@ LOAD_REGION 0x0
{} {}
ARM_LIB_HEAP 0x20100000 ALIGN 64 EMPTY 0x00100000 ARM_LIB_HEAP 0x20100000 ALIGN 64 EMPTY 0x00100000
{} {}
PATTERNS 0x60000000 0x100000
{
patterndata.c.o (+RO-DATA)
}
} }

@ -330,6 +330,10 @@ set_platform_core()
core_includes(FrameworkLib) core_includes(FrameworkLib)
add_executable(Testing main.cpp) add_executable(Testing main.cpp)
# To see the file in the scatter load, it must not because
# linked in a .a archive
target_include_directories(Testing PRIVATE GeneratedInclude)
target_sources(Testing PRIVATE patterndata.c)
# With -O2, generated code is crashing on some cycle accurate models. # With -O2, generated code is crashing on some cycle accurate models.
# (cpp part) # (cpp part)

@ -21,9 +21,11 @@ class TransformF32:public Client::Suite
float32_t *pDst; float32_t *pDst;
float32_t *pState; float32_t *pState;
const arm_cfft_instance_f32 *cfftInstance; arm_cfft_instance_f32 cfftInstance;
arm_rfft_fast_instance_f32 rfftFastInstance; arm_rfft_fast_instance_f32 rfftFastInstance;
arm_status status;
arm_dct4_instance_f32 dct4Instance; arm_dct4_instance_f32 dct4Instance;
arm_rfft_instance_f32 rfftInstance; arm_rfft_instance_f32 rfftInstance;
arm_cfft_radix4_instance_f32 cfftRadix4Instance; arm_cfft_radix4_instance_f32 cfftRadix4Instance;

@ -3,34 +3,10 @@
#include "arm_math.h" #include "arm_math.h"
#include "arm_const_structs.h" #include "arm_const_structs.h"
const arm_cfft_instance_f32 *arm_cfft_get_instance_f32(uint16_t fftLen)
{
switch (fftLen) {
case 16:
return(&arm_cfft_sR_f32_len16);
case 32:
return(&arm_cfft_sR_f32_len32);
case 64:
return(&arm_cfft_sR_f32_len64);
case 128:
return(&arm_cfft_sR_f32_len128);
case 256:
return(&arm_cfft_sR_f32_len256);
case 512:
return(&arm_cfft_sR_f32_len512);
case 1024:
return(&arm_cfft_sR_f32_len1024);
case 2048:
return(&arm_cfft_sR_f32_len2048);
case 4096:
return(&arm_cfft_sR_f32_len4096);
}
return(NULL);
}
void TransformF32::test_cfft_f32() void TransformF32::test_cfft_f32()
{ {
arm_cfft_f32(this->cfftInstance, this->pDst, this->ifft,this->bitRev); arm_cfft_f32(&(this->cfftInstance), this->pDst, this->ifft,this->bitRev);
} }
void TransformF32::test_rfft_f32() void TransformF32::test_rfft_f32()
@ -76,7 +52,7 @@ switch (fftLen) {
this->pSrc=samples.ptr(); this->pSrc=samples.ptr();
this->pDst=output.ptr(); this->pDst=output.ptr();
this->cfftInstance=arm_cfft_get_instance_f32(this->nbSamples); status=arm_cfft_init_f32(&cfftInstance,this->nbSamples);
memcpy(this->pDst,this->pSrc,2*sizeof(float32_t)*this->nbSamples); memcpy(this->pDst,this->pSrc,2*sizeof(float32_t)*this->nbSamples);
break; break;

@ -1,8 +1,10 @@
#include <stdio.h> #include <stdio.h>
extern int testmain(); #include "arm_math.h"
extern int testmain(const char *);
extern "C" const char *patternData;
int main() int main()
{ {
return(testmain()); return(testmain(patternData));
} }

@ -0,0 +1,15 @@
#include "arm_math.h"
#ifdef __cplusplus
extern "C"
{
#endif
#include "Patterns.h"
const char *patternData=(const char*)patterns;
#ifdef __cplusplus
}
#endif

@ -19,11 +19,10 @@ using namespace std;
// char* array describing the tests and the input patterns. // char* array describing the tests and the input patterns.
// Reference patterns are ignored in this case. // Reference patterns are ignored in this case.
#include "TestDrive.h" #include "TestDrive.h"
#include "Patterns.h"
int testmain() int testmain(const char *patterns)
{ {
char *memoryBuf=NULL; char *memoryBuf=NULL;

Loading…
Cancel
Save