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

pull/19/head
Christophe Favergeon 6 years ago
parent 90e24d1614
commit 49b06e1f2b

@ -22,8 +22,8 @@ LOAD_REGION 0x0
* (+RW,+ZI) * (+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
{} {}
} }

@ -243,7 +243,8 @@ typedef struct
int stdout_putchar(char txchar) int stdout_putchar(char txchar)
{ {
SERIAL_DATA = txchar; SERIAL_DATA = txchar;
return(txchar);
} }
int stderr_putchar(char txchar) int stderr_putchar(char txchar)
@ -278,26 +279,17 @@ void SystemInit (void)
SCB->CCR |= SCB_CCR_UNALIGN_TRP_Msk; SCB->CCR |= SCB_CCR_UNALIGN_TRP_Msk;
#endif #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 // enable DL branch cache
CCR |= CCR_DL; CCR |= CCR_DL;
__ISB(); __ISB();
} }
__attribute__((constructor(255))) __attribute__((constructor(255)))
void platform_init(void) void platform_init(void)
{ {
printf("\nMPS3 ARMv81MML Generic Template...\n");
printf("\n_[TEST START]____________________________________________________\n"); printf("\n_[TEST START]____________________________________________________\n");
} }

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

@ -40,7 +40,9 @@ namespace Client {
this->m_bufferLength = bufferLength; this->m_bufferLength = bufferLength;
this->m_generation=0; this->m_generation=0;
this->memError=false; this->memError=false;
#if !defined(BENCHMARK)
memset((void*)ptr, 0, bufferLength); memset((void*)ptr, 0, bufferLength);
#endif
} }
// By default there is alignment and tail // By default there is alignment and tail
@ -54,7 +56,9 @@ namespace Client {
this->m_bufferLength = bufferLength; this->m_bufferLength = bufferLength;
this->m_generation=0; this->m_generation=0;
this->memError=false; this->memError=false;
#if !defined(BENCHMARK)
memset((void*)ptr, 0, bufferLength); memset((void*)ptr, 0, bufferLength);
#endif
} }
bool ArrayMemory::HasMemError() bool ArrayMemory::HasMemError()
@ -149,7 +153,15 @@ namespace Client {
*/ */
void ArrayMemory::FreeMemory() 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_currentPtr=this->m_ptr;
this->m_generation++; this->m_generation++;
this->memError=false; this->memError=false;

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

Loading…
Cancel
Save