فهرست منبع

CMSIS-DSP: Improved IPSS support for M55 in test framework.

Christophe Favergeon 5 سال پیش
والد
کامیت
862067fbf6

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

@@ -22,8 +22,8 @@ LOAD_REGION 0x0
 	* (+RW,+ZI)                         
     }
 
-    ARM_LIB_STACK 0x21000000 ALIGN 64 EMPTY -0x00002000 
+    ARM_LIB_STACK 0x20100000 ALIGN 64 EMPTY -0x00002000 
     {}
-    ARM_LIB_HEAP 0x21000000 ALIGN 64 EMPTY 0x00100000 
+    ARM_LIB_HEAP 0x20100000 ALIGN 64 EMPTY 0x00100000 
     {}
 }

+ 3 - 11
CMSIS/DSP/Platforms/IPSS/ARMv81MML/system_ARMv81MML.c

@@ -243,7 +243,8 @@ typedef struct
 
 int stdout_putchar(char txchar)
 {
-    SERIAL_DATA = txchar;                     
+    SERIAL_DATA = txchar; 
+    return(txchar);                    
 }
 
 int stderr_putchar(char txchar)
@@ -278,26 +279,17 @@ void SystemInit (void)
   SCB->CCR |= SCB_CCR_UNALIGN_TRP_Msk;
 #endif
 
-#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
-  //  TZ_SAU_Setup();
-#endif
-
-  //   SystemCoreClock = SYSTEM_CLOCK;
-
-  //Disable debug
-  // DEBUG_DEMCR &=~ DEBUG_TRCENA;
 
   // enable DL branch cache
   CCR |= CCR_DL;
   __ISB();
-  
+
 
 }
 
 __attribute__((constructor(255)))
 void platform_init(void)
 {
-    printf("\nMPS3 ARMv81MML Generic Template...\n");
     printf("\n_[TEST START]____________________________________________________\n");
 }
 

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

@@ -287,6 +287,9 @@ endif()
   
 
 target_sources(FrameworkLib PRIVATE ${FRAMEWORKSRC})
+if (BENCHMARK)
+    target_compile_definitions(FrameworkLib PUBLIC BENCHMARK)
+endif()
 
 if (EXTBENCH)
   target_compile_definitions(FrameworkLib PUBLIC EXTBENCH)

+ 13 - 1
CMSIS/DSP/Testing/FrameworkSource/ArrayMemory.cpp

@@ -40,7 +40,9 @@ namespace Client {
          this->m_bufferLength = bufferLength;
          this->m_generation=0;
          this->memError=false;
+         #if !defined(BENCHMARK)
          memset((void*)ptr, 0, bufferLength);
+         #endif
      }
 
      // By default there is alignment and  tail
@@ -54,7 +56,9 @@ namespace Client {
          this->m_bufferLength = bufferLength;
          this->m_generation=0;
          this->memError=false;
+         #if !defined(BENCHMARK)
          memset((void*)ptr, 0, bufferLength);
+         #endif
         }
      
      bool ArrayMemory::HasMemError()
@@ -149,7 +153,15 @@ namespace Client {
     */
     void ArrayMemory::FreeMemory()
     {
-        memset(this->m_ptr, 0, this->m_bufferLength);
+        #if !defined(BENCHMARK)
+           /*
+            In benchmark mode, memory is not clearer between
+            tests. It is faster when running on cycle model or RTL.
+            In benchmark mode, we don't tests so having a memory not
+            in a clean state is not a problem.
+           */
+           memset(this->m_ptr, 0, this->m_bufferLength);
+        #endif
         this->m_currentPtr=this->m_ptr;
         this->m_generation++;
         this->memError=false;

+ 17 - 6
CMSIS/DSP/Testing/FrameworkSource/IORunner.cpp

@@ -40,11 +40,15 @@
 #include "arm_math.h"
 #include "Calibrate.h"
 
+#define CALIBNB 20
+
 namespace Client
 {
   
       IORunner::IORunner(IO *io,PatternMgr *mgr,  Testing::RunningMode runningMode):m_io(io), m_mgr(mgr)
       {
+        Testing::cycles_t current;
+
         this->m_runningMode = runningMode;
         // Set running mode on PatternMgr.
         if (runningMode == Testing::kDumpOnly)
@@ -70,8 +74,8 @@ a C++ function pointer from the cycle measurements.
         Calibrate c((Testing::testID_t)0);
         Client::Suite *s=(Client::Suite *)&c;
         Client::test t = (Client::test)&Calibrate::empty;
-
-        cycleMeasurementStart();
+        calibration = 0;
+        
 /* 
 
 EXTBENCH is set when benchmarking is done through external traces
@@ -99,20 +103,26 @@ Indeed, in that case the calibration value can only be measured by parsing the t
 Otherwise, the calibration is measured below.
 
 */
-        for(int i=0;i < 20;i++)
+        for(int i=0;i < CALIBNB;i++)
         {
+          cycleMeasurementStart();
           if (!m_mgr->HasMemError())
           {
              (s->*t)();
           }
+          #ifndef EXTBENCH
+             current = getCycles();
+          #endif
+          calibration += current;
+          cycleMeasurementStop();
         }
 #ifdef EXTBENCH
         stopSection();
 #endif
+
 #ifndef EXTBENCH
-        calibration=getCycles() / 20;
+        calibration=calibration / CALIBNB;
 #endif
-        cycleMeasurementStop();
 
       }
 
@@ -229,7 +239,8 @@ Otherwise, the calibration is measured below.
                 stopSection();
 #endif
 #ifndef EXTBENCH
-                cycles=getCycles()-calibration;
+                cycles=getCycles();
+                cycles=cycles-calibration;
 #endif
                 cycleMeasurementStop();
               }