Ver Fonte

CMSIS-DSP: Update link script for test framework.

Christophe Favergeon há 5 anos atrás
pai
commit
d99acabff1

+ 6 - 5
CMSIS/DSP/Platforms/IPSS/ARMCM0/LinkScripts/AC6/lnk.sct

@@ -13,18 +13,19 @@ LOAD_REGION 0x0
     {
         *.o (RESET, +First)
         * (InRoot$$$Sections)
-        * (+RO-CODE)                              
+        * (+RO)                              
     }
 
-    DATA 0x20000000 0x7000
+    DATA 0x20000000 0x60000
     {
-    * (+RO-DATA)
     * (+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 
     {}
+
+   
 }
 

+ 8 - 6
CMSIS/DSP/Platforms/IPSS/ARMCM33/LinkScripts/AC6/lnk.sct

@@ -12,21 +12,23 @@
 
 LOAD_REGION 0x0
 {
-    CODE +0 0x30000
+    CODE +0 0x80000
     {
         *.o (RESET, +First)
         * (InRoot$$$Sections)
-        * (+RO-CODE)                                
+        * (+RO)                                
     }
 
-    DATA 0x20000000 0x7000
+   
+    DATA 0x20000000 NOCOMPRESS 0x60000
     {
-    * (+RO-DATA)
     * (+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 
     {}
+
+    
 }

+ 5 - 0
CMSIS/DSP/Platforms/IPSS/ARMCM4/LinkScripts/AC6/lnk.sct

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

+ 8 - 4
CMSIS/DSP/Platforms/IPSS/ARMCM7/LinkScripts/AC6/lnk.sct

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

+ 9 - 5
CMSIS/DSP/Platforms/IPSS/ARMv81MML/LinkScripts/AC6/lnk.sct

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

+ 4 - 0
CMSIS/DSP/Testing/CMakeLists.txt

@@ -330,6 +330,10 @@ set_platform_core()
 core_includes(FrameworkLib)
 
 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.
 # (cpp part)

+ 3 - 1
CMSIS/DSP/Testing/Include/Benchmarks/TransformF32.h

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

+ 2 - 26
CMSIS/DSP/Testing/Source/Benchmarks/TransformF32.cpp

@@ -3,34 +3,10 @@
 #include "arm_math.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()
     { 
-       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()
@@ -76,7 +52,7 @@ switch (fftLen) {
             this->pSrc=samples.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);
           break;
 

+ 4 - 2
CMSIS/DSP/Testing/main.cpp

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

+ 15 - 0
CMSIS/DSP/Testing/patterndata.c

@@ -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
+

+ 1 - 2
CMSIS/DSP/Testing/testmain.cpp

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