From 96c89e0a51688f708224d6ca9844de7dff100f8f Mon Sep 17 00:00:00 2001 From: Christophe Favergeon Date: Thu, 20 May 2021 13:16:37 +0200 Subject: [PATCH] CMSIS-DSP: Corrections to tests Build issue with f16 on gcc. Added some customization hooks. --- .../ARMv81MML/Startup/AC6/startup_ARMv81MML.c | 14 ++++++++++++++ Testing/Source/Tests/UnaryTestsF16.cpp | 16 ++++++++-------- Testing/testmain.cpp | 9 ++++++++- 3 files changed, 30 insertions(+), 9 deletions(-) diff --git a/Platforms/IPSS/ARMv81MML/Startup/AC6/startup_ARMv81MML.c b/Platforms/IPSS/ARMv81MML/Startup/AC6/startup_ARMv81MML.c index eccf7258..77085274 100755 --- a/Platforms/IPSS/ARMv81MML/Startup/AC6/startup_ARMv81MML.c +++ b/Platforms/IPSS/ARMv81MML/Startup/AC6/startup_ARMv81MML.c @@ -120,6 +120,13 @@ extern const pFunc __VECTOR_TABLE[496]; #pragma GCC diagnostic pop #endif +void systeminit_hook (void) __attribute__ ((weak)); + +void systeminit_hook(void) +{ + +} + /*---------------------------------------------------------------------------- Reset Handler called on controller reset *----------------------------------------------------------------------------*/ @@ -129,15 +136,22 @@ void Reset_Handler(void) SystemInit(); /* CMSIS System Initialization */ + systeminit_hook(); + __PROGRAM_START(); /* Enter PreMain (C library entry point) */ } +#define SERIAL_BASE_ADDRESS (0xA8000000ul) + +#define SERIAL_DATA *((volatile unsigned *) SERIAL_BASE_ADDRESS) /*---------------------------------------------------------------------------- Hard Fault Handler *----------------------------------------------------------------------------*/ void HardFault_Handler(void) { + SERIAL_DATA = 'H'; + SERIAL_DATA = '\n'; while(1); } diff --git a/Testing/Source/Tests/UnaryTestsF16.cpp b/Testing/Source/Tests/UnaryTestsF16.cpp index 2b3745a4..60a89059 100755 --- a/Testing/Source/Tests/UnaryTestsF16.cpp +++ b/Testing/Source/Tests/UnaryTestsF16.cpp @@ -301,18 +301,18 @@ void UnaryTestsF16::test_mat_cmplx_trans_f16() static void refInnerTail(float16_t *b) { - b[0] = 1.0f16; - b[1] = -2.0f16; - b[2] = 3.0f16; - b[3] = -4.0f16; + b[0] = 1.0f; + b[1] = -2.0f; + b[2] = 3.0f; + b[3] = -4.0f; } static void checkInnerTail(float16_t *b) { - ASSERT_TRUE(b[0] == 1.0f16); - ASSERT_TRUE(b[1] == -2.0f16); - ASSERT_TRUE(b[2] == 3.0f16); - ASSERT_TRUE(b[3] == -4.0f16); + ASSERT_TRUE(b[0] == 1.0f); + ASSERT_TRUE(b[1] == -2.0f); + ASSERT_TRUE(b[2] == 3.0f); + ASSERT_TRUE(b[3] == -4.0f); } void UnaryTestsF16::test_mat_inverse_f16() diff --git a/Testing/testmain.cpp b/Testing/testmain.cpp index 627ec675..59df851b 100644 --- a/Testing/testmain.cpp +++ b/Testing/testmain.cpp @@ -22,9 +22,16 @@ using namespace std; // Reference patterns are ignored in this case. #include "TestDrive.h" +extern "C" void testmain_hook (void) __attribute__ ((weak)); + +void testmain_hook(void) +{ + +} int testmain(const char *patterns) { + testmain_hook(); char *memoryBuf=NULL; memoryBuf = (char*)malloc(MEMSIZE); @@ -43,7 +50,7 @@ int testmain(const char *patterns) Client::Semihosting io("../TestDesc.txt","../Patterns","../Output","../Parameters"); #endif - + // Pattern Manager making the link between IO and Memory Client::PatternMgr mgr(&io,&memory);