Skip to content

Commit

Permalink
CMSIS-DSP: Corrections to tests
Browse files Browse the repository at this point in the history
Build issue with f16 on gcc.
Added some customization hooks.
  • Loading branch information
christophe0606 committed May 20, 2021
1 parent bdc52ce commit 3d6b710
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 9 deletions.
14 changes: 14 additions & 0 deletions CMSIS/DSP/Platforms/IPSS/ARMv81MML/Startup/AC6/startup_ARMv81MML.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*----------------------------------------------------------------------------*/
Expand All @@ -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);
}

Expand Down
16 changes: 8 additions & 8 deletions CMSIS/DSP/Testing/Source/Tests/UnaryTestsF16.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
9 changes: 8 additions & 1 deletion CMSIS/DSP/Testing/testmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);

Expand Down

0 comments on commit 3d6b710

Please sign in to comment.