diff options
Diffstat (limited to 'DSP/DSP_Lib_TestSuite/Common')
26 files changed, 1447 insertions, 622 deletions
diff --git a/DSP/DSP_Lib_TestSuite/Common/JTest/inc/jtest_cycle.h b/DSP/DSP_Lib_TestSuite/Common/JTest/inc/jtest_cycle.h index d1b4db5..ed09f95 100644 --- a/DSP/DSP_Lib_TestSuite/Common/JTest/inc/jtest_cycle.h +++ b/DSP/DSP_Lib_TestSuite/Common/JTest/inc/jtest_cycle.h @@ -43,6 +43,8 @@ extern const char * JTEST_CYCLE_STRF; __jtest_cycle_end_count)); \ } while (0) */ +#ifndef ARMv7A + #define JTEST_COUNT_CYCLES(fn_call) \ do \ { \ @@ -56,10 +58,22 @@ extern const char * JTEST_CYCLE_STRF; __jtest_cycle_end_count = \ JTEST_SYSTICK_VALUE(SysTick); \ \ - JTEST_SYSTICK_RESET(SysTick); \ + JTEST_SYSTICK_RESET(SysTick); \ JTEST_DUMP_STRF(JTEST_CYCLE_STRF, \ (JTEST_SYSTICK_INITIAL_VALUE - \ __jtest_cycle_end_count)); \ } while (0) +#else +/* TODO */ +#define JTEST_COUNT_CYCLES(fn_call) \ + do \ + { \ + fn_call; \ + } while (0) + +#endif + #endif /* _JTEST_CYCLE_H_ */ + + diff --git a/DSP/DSP_Lib_TestSuite/Common/JTest/inc/jtest_fw.h b/DSP/DSP_Lib_TestSuite/Common/JTest/inc/jtest_fw.h index c655cfd..e48c0c5 100644 --- a/DSP/DSP_Lib_TestSuite/Common/JTest/inc/jtest_fw.h +++ b/DSP/DSP_Lib_TestSuite/Common/JTest/inc/jtest_fw.h @@ -141,6 +141,19 @@ typedef struct JTEST_FW_struct * Fill the buffer named buf_name with value and dump it to the Keil debugger * using action. */ +#if defined(ARMv7A) || defined(FILEIO) + +#define JTEST_ACT_DUMP(action, buf_name, value) \ + do \ + { \ + JTEST_CLEAR_BUFFER(buf_name); \ + printf("%s",value); \ + strcpy(JTEST_FW.buf_name, (value)); \ + JTEST_TRIGGER_ACTION(action); \ + } while (0) + +#else + #define JTEST_ACT_DUMP(action, buf_name, value) \ do \ { \ @@ -149,6 +162,7 @@ typedef struct JTEST_FW_struct JTEST_TRIGGER_ACTION(action); \ } while (0) +#endif /** * Trigger the "Exit Framework" action in the Keil Debugger. */ @@ -192,14 +206,29 @@ typedef struct JTEST_FW_struct /** * Dump a formatted string to the Keil Debugger. */ +#if defined(ARMv7A) || defined(FILEIO) + #define JTEST_DUMP_STRF(format_str, ... ) \ do \ { \ JTEST_CLEAR_STR_BUFFER(); \ sprintf(JTEST_FW.str_buffer,format_str, __VA_ARGS__); \ + printf("%s",JTEST_FW.str_buffer); \ jtest_dump_str_segments(); \ } while (0) +#else + +#define JTEST_DUMP_STRF(format_str, ... ) \ + do \ + { \ + JTEST_CLEAR_STR_BUFFER(); \ + sprintf(JTEST_FW.str_buffer,format_str, __VA_ARGS__); \ + jtest_dump_str_segments(); \ + } while (0) + +#endif + /* Pass/Fail Macros */ /*--------------------------------------------------------------------------------*/ diff --git a/DSP/DSP_Lib_TestSuite/Common/JTest/inc/jtest_systick.h b/DSP/DSP_Lib_TestSuite/Common/JTest/inc/jtest_systick.h index ec3e317..afb6e05 100644 --- a/DSP/DSP_Lib_TestSuite/Common/JTest/inc/jtest_systick.h +++ b/DSP/DSP_Lib_TestSuite/Common/JTest/inc/jtest_systick.h @@ -2,7 +2,7 @@ #define _JTEST_SYSTICK_H_ /*--------------------------------------------------------------------------------*/ -/* Includes */ +/* Includes */ /*--------------------------------------------------------------------------------*/ /* Get access to the SysTick structure. */ @@ -10,6 +10,8 @@ #include "ARMCM0.h" #elif defined ARMCM0P #include "ARMCM0plus.h" +#elif defined ARMCM0P_MPU + #include "ARMCM0plus_MPU.h" #elif defined ARMCM3 #include "ARMCM3.h" #elif defined ARMCM4 @@ -40,22 +42,22 @@ #include "ARMv8MML_DP.h" #elif defined ARMv8MML_DSP_DP #include "ARMv8MML_DSP_DP.h" - +#elif defined ARMv7A + /* TODO */ #else #warning "no appropriate header file found!" #endif /*--------------------------------------------------------------------------------*/ -/* Macros and Defines */ +/* Macros and Defines */ /*--------------------------------------------------------------------------------*/ /** * Initial value for the SysTick module. * - * @note This is also the maximum value, important as SysTick is a decrementing - * counter. + * This is also the maximum value, important as SysTick is a decrementing counter. */ -#define JTEST_SYSTICK_INITIAL_VALUE 0xFFFFFF +#define JTEST_SYSTICK_INITIAL_VALUE 0xFFFFFF /** * Reset the SysTick, decrementing timer to it's maximum value and disable it. @@ -66,11 +68,10 @@ #define JTEST_SYSTICK_RESET(systick_ptr) \ do \ { \ - (systick_ptr)->LOAD = JTEST_SYSTICK_INITIAL_VALUE; \ - (systick_ptr)->VAL = 1; \ + (systick_ptr)->CTRL = SysTick_CTRL_CLKSOURCE_Msk; \ \ - /* Disable the SysTick module. */ \ - (systick_ptr)->CTRL = UINT32_C(0x000000); \ + (systick_ptr)->LOAD = JTEST_SYSTICK_INITIAL_VALUE; \ + (systick_ptr)->VAL = JTEST_SYSTICK_INITIAL_VALUE; \ } while (0) /** @@ -81,13 +82,13 @@ { \ (systick_ptr)->CTRL = \ SysTick_CTRL_ENABLE_Msk | \ - SysTick_CTRL_CLKSOURCE_Msk; /* Internal clk*/ \ + SysTick_CTRL_CLKSOURCE_Msk; \ } while (0) /** * Evaluate to the current value of the SysTick timer. */ -#define JTEST_SYSTICK_VALUE(systick_ptr) \ +#define JTEST_SYSTICK_VALUE(systick_ptr) \ ((systick_ptr)->VAL) #endif /* _JTEST_SYSTICK_H_ */ diff --git a/DSP/DSP_Lib_TestSuite/Common/JTest/jtest_FVP.ini b/DSP/DSP_Lib_TestSuite/Common/JTest/jtest_FVP.ini index 44d22eb..cfb438f 100644 --- a/DSP/DSP_Lib_TestSuite/Common/JTest/jtest_FVP.ini +++ b/DSP/DSP_Lib_TestSuite/Common/JTest/jtest_FVP.ini @@ -12,7 +12,7 @@ LOG OFF /* Turn off Logging by defau BK * /* Remove existing breakpoints. */ INCLUDE ../../Common/JTest/jtest_fns.ini /* Load the JTEST helper functions */ -INCLUDE ../../Common/JTest/jtest_log_FVP.ini /* Include a log file if specified by jtest_log.ini */ +INCLUDE ../../Common/JTest/jtest_log_FVP.ini /* Include specified log file */ /* Break on special members of the JTEST framework. The framework's name is defined in jtest_fw.h by the #DEFINE JTEST_FW. */ diff --git a/DSP/DSP_Lib_TestSuite/Common/JTest/jtest_Simulator.ini b/DSP/DSP_Lib_TestSuite/Common/JTest/jtest_Simulator.ini index 8f2a6b1..d6c87b8 100644 --- a/DSP/DSP_Lib_TestSuite/Common/JTest/jtest_Simulator.ini +++ b/DSP/DSP_Lib_TestSuite/Common/JTest/jtest_Simulator.ini @@ -17,12 +17,12 @@ INCLUDE ../../Common/JTest/jtest_log_Simulator.ini /* Include specified log fil /* Break on special members of the JTEST framework. The framework's name is defined in jtest_fw.h by the #DEFINE JTEST_FW. */ -BS test_start , 1, "coverage_clear(); test_start_msg();" -BS test_end , 1, "coverage_msg(); test_end_msg();" +BS test_start , 1, "test_start_msg();" +BS test_end , 1, "test_end_msg();" BS group_start , 1, "group_start_msg();" BS group_end , 1, "group_end_msg();" BS dump_str , 1, "dump_str_fn();" -BS dump_data , 1, "dump_data_fn();" +//BS dump_data , 1, "dump_data_fn();" BS exit_fw , 1, "break_fn(); debug_clean_fn(); log_off_fn();" debug_setup_finished_msg() /* Output a message to let the output diff --git a/DSP/DSP_Lib_TestSuite/Common/JTest/jtest_Simulator.ini.withCoverage b/DSP/DSP_Lib_TestSuite/Common/JTest/jtest_Simulator.ini.withCoverage new file mode 100644 index 0000000..8f2a6b1 --- /dev/null +++ b/DSP/DSP_Lib_TestSuite/Common/JTest/jtest_Simulator.ini.withCoverage @@ -0,0 +1,32 @@ +/* This demonstrates how to setup a Debugger '*.ini' file to interface with the + * C-code using the JTEST test framework. + */ + +MAP 0x00000000, 0x001FFFFF EXEC READ /* 2048K Flash */ +MAP 0x20000000, 0x201FFFFF READ WRITE /* 2048K RAM */ + +LOAD %L INCREMENTAL + + +RESET /* Reset the target processor */ +LOG OFF /* Turn off Logging by default. */ +BK * /* Remove existing breakpoints. */ + +INCLUDE ../../Common/JTest/jtest_fns.ini /* Load the JTEST helper functions */ +INCLUDE ../../Common/JTest/jtest_log_Simulator.ini /* Include specified log file */ + +/* Break on special members of the JTEST framework. The framework's + name is defined in jtest_fw.h by the #DEFINE JTEST_FW. */ +BS test_start , 1, "coverage_clear(); test_start_msg();" +BS test_end , 1, "coverage_msg(); test_end_msg();" +BS group_start , 1, "group_start_msg();" +BS group_end , 1, "group_end_msg();" +BS dump_str , 1, "dump_str_fn();" +BS dump_data , 1, "dump_data_fn();" +BS exit_fw , 1, "break_fn(); debug_clean_fn(); log_off_fn();" + +debug_setup_finished_msg() /* Output a message to let the output + parser know that setup has + finished. */ + +G /* Start the Tests */ diff --git a/DSP/DSP_Lib_TestSuite/Common/inc/templates/test_templates.h b/DSP/DSP_Lib_TestSuite/Common/inc/templates/test_templates.h index 69c3488..3badc80 100644 --- a/DSP/DSP_Lib_TestSuite/Common/inc/templates/test_templates.h +++ b/DSP/DSP_Lib_TestSuite/Common/inc/templates/test_templates.h @@ -62,25 +62,29 @@ /** * Assert that buffers A and B are byte-equivalent for a number of bytes. */ -#define TEST_ASSERT_BUFFERS_EQUAL(buf_a, buf_b, bytes) \ - do \ - { \ - if (memcmp(buf_a, buf_b, bytes) != 0) \ - { \ - return JTEST_TEST_FAILED; \ - } \ + +#define TEST_ASSERT_BUFFERS_EQUAL(buf_a, buf_b, bytes)\ + do \ + { \ + if (memcmp(buf_a, buf_b, bytes) != 0) \ + { \ + return JTEST_TEST_FAILED; \ + } \ } while (0) + + + /** * Assert that the two entities are equal. */ -#define TEST_ASSERT_EQUAL(a, b) \ - do \ - { \ - if ((a) != (b)) \ - { \ - return JTEST_TEST_FAILED; \ - } \ +#define TEST_ASSERT_EQUAL(a, b) \ + do \ + { \ + if ((a) != (b)) \ + { \ + return JTEST_TEST_FAILED;\ + } \ } while (0) /** @@ -111,31 +115,35 @@ * Assert that the SNR between a reference and test sample is above a given * threshold. */ -#define TEST_ASSERT_SNR(ref_ptr, tst_ptr, block_size, threshold) \ - do \ - { \ - float32_t snr = arm_snr_f32(ref_ptr, tst_ptr, block_size); \ - if ( snr <= threshold) \ - { \ - JTEST_DUMP_STRF("SNR: %f\n", snr); \ - return JTEST_TEST_FAILED; \ - } \ - } while (0) \ + +#define TEST_ASSERT_SNR(ref_ptr, tst_ptr, block_size, threshold) \ + do \ + { \ + float32_t snr = arm_snr_f32(ref_ptr, tst_ptr, block_size);\ + if ( snr <= threshold) \ + { \ + JTEST_DUMP_STRF("SNR: %f\n", snr); \ + return JTEST_TEST_FAILED; \ + } \ + } while (0) + /** * Assert that the SNR between a reference and test sample is above a given * threshold. Special case for float64_t */ -#define TEST_ASSERT_DBL_SNR(ref_ptr, tst_ptr, block_size, threshold) \ + +#define TEST_ASSERT_DBL_SNR(ref_ptr, tst_ptr, block_size, threshold)\ do \ { \ float64_t snr = arm_snr_f64(ref_ptr, tst_ptr, block_size); \ - if ( snr <= threshold) \ + if ( snr <= threshold) \ { \ JTEST_DUMP_STRF("SNR: %f\n", snr); \ return JTEST_TEST_FAILED; \ } \ - } while (0) \ + } while (0) + /** * Compare test and reference elements by converting to float and diff --git a/DSP/DSP_Lib_TestSuite/Common/platform/ARMCC/armcc5_arm.sct b/DSP/DSP_Lib_TestSuite/Common/platform/ARMCC/armcc5_arm.sct new file mode 100644 index 0000000..987f554 --- /dev/null +++ b/DSP/DSP_Lib_TestSuite/Common/platform/ARMCC/armcc5_arm.sct @@ -0,0 +1,70 @@ +#! armcc -E +; command above MUST be in first line (no comment above!) + +/* +;-------- <<< Use Configuration Wizard in Context Menu >>> ------------------ +*/ + +/*--------------------- Flash Configuration ------------------------- +; <h> Flash Configuration +; <o0> Flash Base Address <0x0-0xFFFFFFFF:8> +; <o1> Flash Size (in Bytes) <0x0-0xFFFFFFFF:8> +; </h> + *----------------------------------------------------------------------------*/ +#define __ROM_BASE 0x00000000 +#define __ROM_SIZE 0x00200000 + +/*--------------------- Embedded RAM Configuration --------------------------- +; <h> RAM Configuration +; <o0> RAM Base Address <0x0-0xFFFFFFFF:8> +; <o1> RAM Size (in Bytes) <0x0-0xFFFFFFFF:8> +; </h> + *----------------------------------------------------------------------------*/ +#define __RAM_BASE 0x20000000 +#define __RAM_SIZE 0x00200000 + +/*--------------------- Stack / Heap Configuration --------------------------- +; <h> Stack / Heap Configuration +; <o0> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> +; <o1> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> +; </h> + *----------------------------------------------------------------------------*/ +#define __STACK_SIZE 0x00000400 +#define __HEAP_SIZE 0x00000C00 + + +/*---------------------------------------------------------------------------- + User Stack & Heap boundery definition + *----------------------------------------------------------------------------*/ +#define __STACK_TOP (__RAM_BASE + __RAM_SIZE) +#define __HEAP_BASE (__RAM_BASE + __RAM_SIZE - __STACK_SIZE - __HEAP_SIZE) + + +/*---------------------------------------------------------------------------- + Scatter File Definitions definition + *----------------------------------------------------------------------------*/ +#define __RO_BASE __ROM_BASE +#define __RO_SIZE __ROM_SIZE + +#define __RW_BASE (__RAM_BASE ) +#define __RW_SIZE (__RAM_SIZE - __STACK_SIZE - __HEAP_SIZE) + + + +LR_ROM __RO_BASE __RO_SIZE { ; load region size_region + ER_ROM __RO_BASE __RO_SIZE { ; load address = execution address + *.o (RESET, +First) + *(InRoot$$Sections) + .ANY (+RO) + } + + RW_RAM __RW_BASE __RW_SIZE { ; RW data + .ANY (+RW +ZI) + } + + ARM_LIB_HEAP __HEAP_BASE EMPTY __HEAP_SIZE { ; Reserve empty region for heap + } + + ARM_LIB_STACK __STACK_TOP EMPTY -__STACK_SIZE { ; Reserve empty region for stack + } +} diff --git a/DSP/DSP_Lib_TestSuite/Common/platform/ARMCC/startup_armv6-m.s b/DSP/DSP_Lib_TestSuite/Common/platform/ARMCC/startup_armv6-m.s index e9731e3..056174c 100644 --- a/DSP/DSP_Lib_TestSuite/Common/platform/ARMCC/startup_armv6-m.s +++ b/DSP/DSP_Lib_TestSuite/Common/platform/ARMCC/startup_armv6-m.s @@ -31,33 +31,6 @@ ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ; POSSIBILITY OF SUCH DAMAGE. ; ---------------------------------------------------------------------------*/ -;/* -; //-------- <<< Use Configuration Wizard in Context Menu >>> ------------------ -;*/ - - -; <h> Stack Configuration -; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> -; </h> - -Stack_Size EQU 0x00000400 - - AREA STACK, NOINIT, READWRITE, ALIGN=3 -Stack_Mem SPACE Stack_Size -__initial_sp - - -; <h> Heap Configuration -; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> -; </h> - -Heap_Size EQU 0x00000C00 - - AREA HEAP, NOINIT, READWRITE, ALIGN=3 -__heap_base -Heap_Mem SPACE Heap_Size -__heap_limit - PRESERVE8 THUMB @@ -66,11 +39,12 @@ __heap_limit ; Vector Table Mapped to Address 0 at Reset AREA RESET, DATA, READONLY + IMPORT ||Image$$ARM_LIB_STACK$$ZI$$Limit|| EXPORT __Vectors EXPORT __Vectors_End EXPORT __Vectors_Size -__Vectors DCD __initial_sp ; Top of Stack +__Vectors DCD ||Image$$ARM_LIB_STACK$$ZI$$Limit|| ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler @@ -134,62 +108,4 @@ SysTick_Handler PROC ALIGN -; User Initial Stack & Heap - IF :DEF:__MICROLIB - - EXPORT __initial_sp - EXPORT __heap_base - EXPORT __heap_limit - - ELSE - - IMPORT __use_two_region_memory - -;/* -; __user_setup_stackheap() returns the: -; - heap base in r0 (if the program uses the heap) -; - stack base in sp -; - heap limit in r2 (if the program uses the heap and uses two-region memory). -; */ - EXPORT __user_setup_stackheap - -__user_setup_stackheap PROC - LDR R0, = __initial_sp - MOV SP, R0 - IF Heap_Size > 0 - LDR R2, = __heap_limit - LDR R0, = __heap_base - ELSE - MOV R0, #0 - MOV R2, #0 - ENDIF - BX LR - ENDP - - -;/* -;__user_initial_stackheap() returns the: -; - heap base in r0 -; - stack base in r1, that is, the highest address in the stack region -; - heap limit in r2 -; - stack limit in r3, that is, the lowest address in the stack region. -; */ -; -;/* DEPRICATED -; EXPORT __user_initial_stackheap -; -;__user_initial_stackheap PROC -; LDR R0, = Heap_Mem -; LDR R1, =(Stack_Mem + Stack_Size) -; LDR R2, = (Heap_Mem + Heap_Size) -; LDR R3, = Stack_Mem -; BX LR -; ENDP -; */ - - ALIGN - - ENDIF - - END diff --git a/DSP/DSP_Lib_TestSuite/Common/platform/ARMCC/startup_armv6-m.s.noSCT b/DSP/DSP_Lib_TestSuite/Common/platform/ARMCC/startup_armv6-m.s.noSCT new file mode 100644 index 0000000..e9731e3 --- /dev/null +++ b/DSP/DSP_Lib_TestSuite/Common/platform/ARMCC/startup_armv6-m.s.noSCT @@ -0,0 +1,195 @@ +;/* File: startup_armv6-m.s +; * Purpose: startup file for armv7-m architecture devices. +; * Should be used with ARMCC +; * Version: V2.00 +; * Date: 16 November 2015 +; * +; */ +;/* Copyright (c) 2011 - 2014 ARM LIMITED +; +; All rights reserved. +; Redistribution and use in source and binary forms, with or without +; modification, are permitted provided that the following conditions are met: +; - Redistributions of source code must retain the above copyright +; notice, this list of conditions and the following disclaimer. +; - Redistributions in binary form must reproduce the above copyright +; notice, this list of conditions and the following disclaimer in the +; documentation and/or other materials provided with the distribution. +; - Neither the name of ARM nor the names of its contributors may be used +; to endorse or promote products derived from this software without +; specific prior written permission. +; * +; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +; ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE +; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +; POSSIBILITY OF SUCH DAMAGE. +; ---------------------------------------------------------------------------*/ +;/* +; //-------- <<< Use Configuration Wizard in Context Menu >>> ------------------ +;*/ + + +; <h> Stack Configuration +; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> +; </h> + +Stack_Size EQU 0x00000400 + + AREA STACK, NOINIT, READWRITE, ALIGN=3 +Stack_Mem SPACE Stack_Size +__initial_sp + + +; <h> Heap Configuration +; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> +; </h> + +Heap_Size EQU 0x00000C00 + + AREA HEAP, NOINIT, READWRITE, ALIGN=3 +__heap_base +Heap_Mem SPACE Heap_Size +__heap_limit + + + PRESERVE8 + THUMB + + +; Vector Table Mapped to Address 0 at Reset + + AREA RESET, DATA, READONLY + EXPORT __Vectors + EXPORT __Vectors_End + EXPORT __Vectors_Size + +__Vectors DCD __initial_sp ; Top of Stack + DCD Reset_Handler ; Reset Handler + DCD NMI_Handler ; NMI Handler + DCD HardFault_Handler ; Hard Fault Handler + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD SVC_Handler ; SVCall Handler + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD PendSV_Handler ; PendSV Handler + DCD SysTick_Handler ; SysTick Handler +__Vectors_End + +__Vectors_Size EQU __Vectors_End - __Vectors + + AREA |.text|, CODE, READONLY + + +; Reset Handler + +Reset_Handler PROC + EXPORT Reset_Handler [WEAK] + IMPORT SystemInit + IMPORT __main + LDR R0, =SystemInit + BLX R0 + LDR R0, =__main + BX R0 + ENDP + + +; Dummy Exception Handlers (infinite loops which can be modified) + +NMI_Handler PROC + EXPORT NMI_Handler [WEAK] + BKPT #0 + B . + ENDP +HardFault_Handler\ + PROC + EXPORT HardFault_Handler [WEAK] + BKPT #0 + B . + ENDP +SVC_Handler PROC + EXPORT SVC_Handler [WEAK] + B . + ENDP +PendSV_Handler PROC + EXPORT PendSV_Handler [WEAK] + B . + ENDP +SysTick_Handler PROC + EXPORT SysTick_Handler [WEAK] + B . + ENDP + + ALIGN + +; User Initial Stack & Heap + IF :DEF:__MICROLIB + + EXPORT __initial_sp + EXPORT __heap_base + EXPORT __heap_limit + + ELSE + + IMPORT __use_two_region_memory + +;/* +; __user_setup_stackheap() returns the: +; - heap base in r0 (if the program uses the heap) +; - stack base in sp +; - heap limit in r2 (if the program uses the heap and uses two-region memory). +; */ + EXPORT __user_setup_stackheap + +__user_setup_stackheap PROC + LDR R0, = __initial_sp + MOV SP, R0 + IF Heap_Size > 0 + LDR R2, = __heap_limit + LDR R0, = __heap_base + ELSE + MOV R0, #0 + MOV R2, #0 + ENDIF + BX LR + ENDP + + +;/* +;__user_initial_stackheap() returns the: +; - heap base in r0 +; - stack base in r1, that is, the highest address in the stack region +; - heap limit in r2 +; - stack limit in r3, that is, the lowest address in the stack region. +; */ +; +;/* DEPRICATED +; EXPORT __user_initial_stackheap +; +;__user_initial_stackheap PROC +; LDR R0, = Heap_Mem +; LDR R1, =(Stack_Mem + Stack_Size) +; LDR R2, = (Heap_Mem + Heap_Size) +; LDR R3, = Stack_Mem +; BX LR +; ENDP +; */ + + ALIGN + + ENDIF + + + END diff --git a/DSP/DSP_Lib_TestSuite/Common/platform/ARMCC/startup_armv7-m.s b/DSP/DSP_Lib_TestSuite/Common/platform/ARMCC/startup_armv7-m.s index 2b00ab9..b40c565 100644 --- a/DSP/DSP_Lib_TestSuite/Common/platform/ARMCC/startup_armv7-m.s +++ b/DSP/DSP_Lib_TestSuite/Common/platform/ARMCC/startup_armv7-m.s @@ -31,33 +31,6 @@ ; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE ; POSSIBILITY OF SUCH DAMAGE. ; ---------------------------------------------------------------------------*/ -;/* -; //-------- <<< Use Configuration Wizard in Context Menu >>> ------------------ -;*/ - - -; <h> Stack Configuration -; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> -; </h> - -Stack_Size EQU 0x00000400 - - AREA STACK, NOINIT, READWRITE, ALIGN=3 -Stack_Mem SPACE Stack_Size -__initial_sp - - -; <h> Heap Configuration -; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> -; </h> - -Heap_Size EQU 0x00000C00 - - AREA HEAP, NOINIT, READWRITE, ALIGN=3 -__heap_base -Heap_Mem SPACE Heap_Size -__heap_limit - PRESERVE8 THUMB @@ -66,11 +39,12 @@ __heap_limit ; Vector Table Mapped to Address 0 at Reset AREA RESET, DATA, READONLY + IMPORT ||Image$$ARM_LIB_STACK$$ZI$$Limit|| EXPORT __Vectors EXPORT __Vectors_End EXPORT __Vectors_Size -__Vectors DCD __initial_sp ; Top of Stack +__Vectors DCD ||Image$$ARM_LIB_STACK$$ZI$$Limit|| ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler @@ -157,62 +131,4 @@ SysTick_Handler PROC ALIGN -; User Initial Stack & Heap - IF :DEF:__MICROLIB - - EXPORT __initial_sp - EXPORT __heap_base - EXPORT __heap_limit - - ELSE - - IMPORT __use_two_region_memory - -;/* -; __user_setup_stackheap() returns the: -; - heap base in r0 (if the program uses the heap) -; - stack base in sp -; - heap limit in r2 (if the program uses the heap and uses two-region memory). -; */ - EXPORT __user_setup_stackheap - -__user_setup_stackheap PROC - LDR R0, = __initial_sp - MOV SP, R0 - IF Heap_Size > 0 - LDR R2, = __heap_limit - LDR R0, = __heap_base - ELSE - MOV R0, #0 - MOV R2, #0 - ENDIF - BX LR - ENDP - - -;/* -;__user_initial_stackheap() returns the: -; - heap base in r0 -; - stack base in r1, that is, the highest address in the stack region -; - heap limit in r2 -; - stack limit in r3, that is, the lowest address in the stack region. -; */ -; -;/* DEPRICATED -; EXPORT __user_initial_stackheap -; -;__user_initial_stackheap PROC -; LDR R0, = Heap_Mem -; LDR R1, =(Stack_Mem + Stack_Size) -; LDR R2, = (Heap_Mem + Heap_Size) -; LDR R3, = Stack_Mem -; BX LR -; ENDP -; */ - - ALIGN - - ENDIF - - END diff --git a/DSP/DSP_Lib_TestSuite/Common/platform/ARMCC/startup_armv7-m.s.noSCT b/DSP/DSP_Lib_TestSuite/Common/platform/ARMCC/startup_armv7-m.s.noSCT new file mode 100644 index 0000000..2b00ab9 --- /dev/null +++ b/DSP/DSP_Lib_TestSuite/Common/platform/ARMCC/startup_armv7-m.s.noSCT @@ -0,0 +1,218 @@ +;/* File: startup_armv7-m.s +; * Purpose: startup file for armv7-m architecture devices. +; * Should be used with ARMCC +; * Version: V2.00 +; * Date: 16 November 2015 +; * +; */ +;/* Copyright (c) 2011 - 2014 ARM LIMITED +; +; All rights reserved. +; Redistribution and use in source and binary forms, with or without +; modification, are permitted provided that the following conditions are met: +; - Redistributions of source code must retain the above copyright +; notice, this list of conditions and the following disclaimer. +; - Redistributions in binary form must reproduce the above copyright +; notice, this list of conditions and the following disclaimer in the +; documentation and/or other materials provided with the distribution. +; - Neither the name of ARM nor the names of its contributors may be used +; to endorse or promote products derived from this software without +; specific prior written permission. +; * +; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +; ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE +; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +; POSSIBILITY OF SUCH DAMAGE. +; ---------------------------------------------------------------------------*/ +;/* +; //-------- <<< Use Configuration Wizard in Context Menu >>> ------------------ +;*/ + + +; <h> Stack Configuration +; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> +; </h> + +Stack_Size EQU 0x00000400 + + AREA STACK, NOINIT, READWRITE, ALIGN=3 +Stack_Mem SPACE Stack_Size +__initial_sp + + +; <h> Heap Configuration +; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> +; </h> + +Heap_Size EQU 0x00000C00 + + AREA HEAP, NOINIT, READWRITE, ALIGN=3 +__heap_base +Heap_Mem SPACE Heap_Size +__heap_limit + + + PRESERVE8 + THUMB + + +; Vector Table Mapped to Address 0 at Reset + + AREA RESET, DATA, READONLY + EXPORT __Vectors + EXPORT __Vectors_End + EXPORT __Vectors_Size + +__Vectors DCD __initial_sp ; Top of Stack + DCD Reset_Handler ; Reset Handler + DCD NMI_Handler ; NMI Handler + DCD HardFault_Handler ; Hard Fault Handler + DCD MemManage_Handler ; MPU Fault Handler + DCD BusFault_Handler ; Bus Fault Handler + DCD UsageFault_Handler ; Usage Fault Handler + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD SVC_Handler ; SVCall Handler + DCD DebugMon_Handler ; Debug Monitor Handler + DCD 0 ; Reserved + DCD PendSV_Handler ; PendSV Handler + DCD SysTick_Handler ; SysTick Handler +__Vectors_End + +__Vectors_Size EQU __Vectors_End - __Vectors + + AREA |.text|, CODE, READONLY + + +; Reset Handler + +Reset_Handler PROC + EXPORT Reset_Handler [WEAK] + IMPORT SystemInit + IMPORT __main + LDR R0, =SystemInit + BLX R0 + LDR R0, =__main + BX R0 + ENDP + + +; Dummy Exception Handlers (infinite loops which can be modified) + +NMI_Handler PROC + EXPORT NMI_Handler [WEAK] + BKPT #0 + B . + ENDP +HardFault_Handler\ + PROC + EXPORT HardFault_Handler [WEAK] + BKPT #0 + B . + ENDP +MemManage_Handler\ + PROC + EXPORT MemManage_Handler [WEAK] + BKPT #0 + B . + ENDP +BusFault_Handler\ + PROC + EXPORT BusFault_Handler [WEAK] + BKPT #0 + B . + ENDP +UsageFault_Handler\ + PROC + EXPORT UsageFault_Handler [WEAK] + BKPT #0 + B . + ENDP +SVC_Handler PROC + EXPORT SVC_Handler [WEAK] + B . + ENDP +DebugMon_Handler\ + PROC + EXPORT DebugMon_Handler [WEAK] + B . + ENDP +PendSV_Handler PROC + EXPORT PendSV_Handler [WEAK] + B . + ENDP +SysTick_Handler PROC + EXPORT SysTick_Handler [WEAK] + B . + ENDP + + ALIGN + +; User Initial Stack & Heap + IF :DEF:__MICROLIB + + EXPORT __initial_sp + EXPORT __heap_base + EXPORT __heap_limit + + ELSE + + IMPORT __use_two_region_memory + +;/* +; __user_setup_stackheap() returns the: +; - heap base in r0 (if the program uses the heap) +; - stack base in sp +; - heap limit in r2 (if the program uses the heap and uses two-region memory). +; */ + EXPORT __user_setup_stackheap + +__user_setup_stackheap PROC + LDR R0, = __initial_sp + MOV SP, R0 + IF Heap_Size > 0 + LDR R2, = __heap_limit + LDR R0, = __heap_base + ELSE + MOV R0, #0 + MOV R2, #0 + ENDIF + BX LR + ENDP + + +;/* +;__user_initial_stackheap() returns the: +; - heap base in r0 +; - stack base in r1, that is, the highest address in the stack region +; - heap limit in r2 +; - stack limit in r3, that is, the lowest address in the stack region. +; */ +; +;/* DEPRICATED +; EXPORT __user_initial_stackheap +; +;__user_initial_stackheap PROC +; LDR R0, = Heap_Mem +; LDR R1, =(Stack_Mem + Stack_Size) +; LDR R2, = (Heap_Mem + Heap_Size) +; LDR R3, = Stack_Mem +; BX LR +; ENDP +; */ + + ALIGN + + ENDIF + + + END diff --git a/DSP/DSP_Lib_TestSuite/Common/platform/ARMCLANG/armcc6_arm.sct b/DSP/DSP_Lib_TestSuite/Common/platform/ARMCLANG/armcc6_arm.sct new file mode 100644 index 0000000..8de3ce7 --- /dev/null +++ b/DSP/DSP_Lib_TestSuite/Common/platform/ARMCLANG/armcc6_arm.sct @@ -0,0 +1,70 @@ +#! armclang -E --target=arm-arm-none-eabi -mcpu=cortex-m0 -xc +; command above MUST be in first line (no comment above!) + +/* +;-------- <<< Use Configuration Wizard in Context Menu >>> ------------------ +*/ + +/*--------------------- Flash Configuration ------------------------- +; <h> Flash Configuration +; <o0> Flash Base Address <0x0-0xFFFFFFFF:8> +; <o1> Flash Size (in Bytes) <0x0-0xFFFFFFFF:8> +; </h> + *----------------------------------------------------------------------------*/ +#define __ROM_BASE 0x00000000 +#define __ROM_SIZE 0x00200000 + +/*--------------------- Embedded RAM Configuration --------------------------- +; <h> RAM Configuration +; <o0> RAM Base Address <0x0-0xFFFFFFFF:8> +; <o1> RAM Size (in Bytes) <0x0-0xFFFFFFFF:8> +; </h> + *----------------------------------------------------------------------------*/ +#define __RAM_BASE 0x20000000 +#define __RAM_SIZE 0x00200000 + +/*--------------------- Stack / Heap Configuration --------------------------- +; <h> Stack / Heap Configuration +; <o0> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> +; <o1> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> +; </h> + *----------------------------------------------------------------------------*/ +#define __STACK_SIZE 0x00000400 +#define __HEAP_SIZE 0x00000C00 + + +/*---------------------------------------------------------------------------- + User Stack & Heap boundery definition + *----------------------------------------------------------------------------*/ +#define __STACK_TOP (__RAM_BASE + __RAM_SIZE) +#define __HEAP_BASE (__RAM_BASE + __RAM_SIZE - __STACK_SIZE - __HEAP_SIZE) + + +/*---------------------------------------------------------------------------- + Scatter File Definitions definition + *----------------------------------------------------------------------------*/ +#define __RO_BASE __ROM_BASE +#define __RO_SIZE __ROM_SIZE + +#define __RW_BASE (__RAM_BASE ) +#define __RW_SIZE (__RAM_SIZE - __STACK_SIZE - __HEAP_SIZE) + + + +LR_ROM __RO_BASE __RO_SIZE { ; load region size_region + ER_ROM __RO_BASE __RO_SIZE { ; load address = execution address + *.o (RESET, +First) + *(InRoot$$Sections) + .ANY (+RO) + } + + RW_RAM __RW_BASE __RW_SIZE { ; RW data + .ANY (+RW +ZI) + } + + ARM_LIB_HEAP __HEAP_BASE EMPTY __HEAP_SIZE { ; Reserve empty region for heap + } + + ARM_LIB_STACK __STACK_TOP EMPTY -__STACK_SIZE { ; Reserve empty region for stack + } +} diff --git a/DSP/DSP_Lib_TestSuite/Common/platform/ARMCLANG/startup_armv6-m.S b/DSP/DSP_Lib_TestSuite/Common/platform/ARMCLANG/startup_armv6-m.S index 3d18268..d3499af 100644 --- a/DSP/DSP_Lib_TestSuite/Common/platform/ARMCLANG/startup_armv6-m.S +++ b/DSP/DSP_Lib_TestSuite/Common/platform/ARMCLANG/startup_armv6-m.S @@ -42,39 +42,7 @@ /* .eabi_attribute Tag_ABI_align8_preserved,1 www.support.code-red-tech.com/CodeRedWiki/Preserve8 */ .eabi_attribute 25, 1 /* Tag_ABI_align_preserved */ - -/* - ;<h> Stack Configuration - ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> - ;</h> -*/ - .equ Stack_Size, 0x00000400 - - .section STACK, "w" - .align 3 - .globl __StackTop - .globl __StackLimit -__StackLimit: - .space Stack_Size -__StackTop: /* formerly known as __initial_sp */ - - -/* - ;<h> Heap Configuration - ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> - ;</h> -*/ - .equ Heap_Size, 0x00000C00 - - .section HEAP, "w" - .align 3 - .globl __HeapBase - .globl __HeapLimit -__HeapBase: - .if Heap_Size - .space Heap_Size - .endif -__HeapLimit: + .global Image$$ARM_LIB_STACK$$ZI$$Limit .section RESET, "x" @@ -83,7 +51,7 @@ __HeapLimit: .globl __Vectors_End .globl __Vectors_Size __Vectors: - .long __StackTop /* Top of Stack */ + .long Image$$ARM_LIB_STACK$$ZI$$Limit /* Top of Stack */ .long Reset_Handler /* Reset Handler */ .long NMI_Handler /* NMI Handler */ .long HardFault_Handler /* Hard Fault Handler */ @@ -156,48 +124,4 @@ SysTick_Handler: bkpt #0 b . - - .global __use_two_region_memory - -/* - __user_setup_stackheap() returns the: - - heap base in r0 (if the program uses the heap) - - stack base in sp - - heap limit in r2 (if the program uses the heap and uses two-region memory). - */ - .globl __user_setup_stackheap - .type __user_setup_stackheap, %function - .thumb_func -__user_setup_stackheap: - ldr r0, =__StackTop - mov sp, r0 - .if Heap_Size - ldr r0, =__HeapBase - ldr r2, =__HeapLimit - .else - mov r0, #0 - mov r2, #0 - .endif - bx lr - - -/* -__user_initial_stackheap() returns the: - - heap base in r0 - - stack base in r1, that is, the highest address in the stack region - - heap limit in r2 - - stack limit in r3, that is, the lowest address in the stack region. - */ -/* DEPRICATED - .globl __user_initial_stackheap - .type __user_initial_stackheap, %function - .thumb_func -__user_initial_stackheap: - ldr r0, = __HeapBase - ldr r1, = __StackTop - ldr r2, = __HeapLimit - ldr r3, = __StackLimit - bx lr -*/ - .end diff --git a/DSP/DSP_Lib_TestSuite/Common/platform/ARMCLANG/startup_armv6-m.S.noSCT b/DSP/DSP_Lib_TestSuite/Common/platform/ARMCLANG/startup_armv6-m.S.noSCT new file mode 100644 index 0000000..3d18268 --- /dev/null +++ b/DSP/DSP_Lib_TestSuite/Common/platform/ARMCLANG/startup_armv6-m.S.noSCT @@ -0,0 +1,203 @@ +/* File: startup_armv6-m.S + * Purpose: startup file for armv6-m architecture devices. + * Should be used with ARMCLANG + * Version: V2.00 + * Date: 16 November 2015 + * + */ +/* Copyright (c) 2011 - 2015 ARM LIMITED + + All rights reserved. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + - Neither the name of ARM nor the names of its contributors may be used + to endorse or promote products derived from this software without + specific prior written permission. + * + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + ---------------------------------------------------------------------------*/ +/* + ;//-------- <<< Use Configuration Wizard in Context Menu >>> ------------------ +*/ + + + .syntax unified + .arch armv6-m + +/* .eabi_attribute Tag_ABI_align8_preserved,1 www.support.code-red-tech.com/CodeRedWiki/Preserve8 */ +.eabi_attribute 25, 1 /* Tag_ABI_align_preserved */ + + +/* + ;<h> Stack Configuration + ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> + ;</h> +*/ + .equ Stack_Size, 0x00000400 + + .section STACK, "w" + .align 3 + .globl __StackTop + .globl __StackLimit +__StackLimit: + .space Stack_Size +__StackTop: /* formerly known as __initial_sp */ + + +/* + ;<h> Heap Configuration + ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> + ;</h> +*/ + .equ Heap_Size, 0x00000C00 + + .section HEAP, "w" + .align 3 + .globl __HeapBase + .globl __HeapLimit +__HeapBase: + .if Heap_Size + .space Heap_Size + .endif +__HeapLimit: + + + .section RESET, "x" + .align 2 + .globl __Vectors + .globl __Vectors_End + .globl __Vectors_Size +__Vectors: + .long __StackTop /* Top of Stack */ + .long Reset_Handler /* Reset Handler */ + .long NMI_Handler /* NMI Handler */ + .long HardFault_Handler /* Hard Fault Handler */ + .long 0 /* Reserved */ + .long 0 /* Reserved */ + .long 0 /* Reserved */ + .long 0 /* Reserved */ + .long 0 /* Reserved */ + .long 0 /* Reserved */ + .long 0 /* Reserved */ + .long SVC_Handler /* SVCall Handler */ + .long 0 /* Reserved */ + .long 0 /* Reserved */ + .long PendSV_Handler /* PendSV Handler */ + .long SysTick_Handler /* SysTick Handler */ +__Vectors_End: + + .equ __Vectors_Size, __Vectors_End - __Vectors + + + .text + .thumb + .align 2 + + .globl Reset_Handler + .weak Reset_Handler + .type Reset_Handler, %function + .thumb_func +Reset_Handler: + bl SystemInit + bl __main + + .globl NMI_Handler + .weak NMI_Handler + .type NMI_Handler, %function + .thumb_func +NMI_Handler: + bkpt #0 + b . + + .globl HardFault_Handler + .weak HardFault_Handler + .type HardFault_Handler, %function + .thumb_func +HardFault_Handler: + bkpt #0 + b . + + .globl SVC_Handler + .weak SVC_Handler + .type SVC_Handler, %function + .thumb_func +SVC_Handler: + bkpt #0 + b . + + .globl PendSV_Handler + .weak PendSV_Handler + .type PendSV_Handler, %function + .thumb_func +PendSV_Handler: + bkpt #0 + b . + + .globl SysTick_Handler + .weak SysTick_Handler + .type SysTick_Handler, %function + .thumb_func +SysTick_Handler: + bkpt #0 + b . + + + .global __use_two_region_memory + +/* + __user_setup_stackheap() returns the: + - heap base in r0 (if the program uses the heap) + - stack base in sp + - heap limit in r2 (if the program uses the heap and uses two-region memory). + */ + .globl __user_setup_stackheap + .type __user_setup_stackheap, %function + .thumb_func +__user_setup_stackheap: + ldr r0, =__StackTop + mov sp, r0 + .if Heap_Size + ldr r0, =__HeapBase + ldr r2, =__HeapLimit + .else + mov r0, #0 + mov r2, #0 + .endif + bx lr + + +/* +__user_initial_stackheap() returns the: + - heap base in r0 + - stack base in r1, that is, the highest address in the stack region + - heap limit in r2 + - stack limit in r3, that is, the lowest address in the stack region. + */ +/* DEPRICATED + .globl __user_initial_stackheap + .type __user_initial_stackheap, %function + .thumb_func +__user_initial_stackheap: + ldr r0, = __HeapBase + ldr r1, = __StackTop + ldr r2, = __HeapLimit + ldr r3, = __StackLimit + bx lr +*/ + + .end diff --git a/DSP/DSP_Lib_TestSuite/Common/platform/ARMCLANG/startup_armv7-m.S b/DSP/DSP_Lib_TestSuite/Common/platform/ARMCLANG/startup_armv7-m.S index 4bdb549..53a307e 100644 --- a/DSP/DSP_Lib_TestSuite/Common/platform/ARMCLANG/startup_armv7-m.S +++ b/DSP/DSP_Lib_TestSuite/Common/platform/ARMCLANG/startup_armv7-m.S @@ -37,44 +37,12 @@ .syntax unified - .arch armv6-m + .arch armv7-m /* .eabi_attribute Tag_ABI_align8_preserved,1 www.support.code-red-tech.com/CodeRedWiki/Preserve8 */ .eabi_attribute 25, 1 /* Tag_ABI_align_preserved */ - -/* - ;<h> Stack Configuration - ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> - ;</h> -*/ - .equ Stack_Size, 0x00000400 - - .section STACK, "w" - .align 3 - .globl __StackTop - .globl __StackLimit -__StackLimit: - .space Stack_Size -__StackTop: /* formerly known as __initial_sp */ - - -/* - ;<h> Heap Configuration - ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> - ;</h> -*/ - .equ Heap_Size, 0x00000C00 - - .section HEAP, "w" - .align 3 - .globl __HeapBase - .globl __HeapLimit -__HeapBase: - .if Heap_Size - .space Heap_Size - .endif -__HeapLimit: + .global Image$$ARM_LIB_STACK$$ZI$$Limit .section RESET, "x" @@ -83,7 +51,7 @@ __HeapLimit: .globl __Vectors_End .globl __Vectors_Size __Vectors: - .long __StackTop /* Top of Stack */ + .long Image$$ARM_LIB_STACK$$ZI$$Limit /* Top of Stack */ .long Reset_Handler /* Reset Handler */ .long NMI_Handler /* NMI Handler */ .long HardFault_Handler /* Hard Fault Handler */ @@ -188,48 +156,4 @@ SysTick_Handler: bkpt #0 b . - - .global __use_two_region_memory - -/* - __user_setup_stackheap() returns the: - - heap base in r0 (if the program uses the heap) - - stack base in sp - - heap limit in r2 (if the program uses the heap and uses two-region memory). - */ - .globl __user_setup_stackheap - .type __user_setup_stackheap, %function - .thumb_func -__user_setup_stackheap: - ldr r0, =__StackTop - mov sp, r0 - .if Heap_Size - ldr r0, =__HeapBase - ldr r2, =__HeapLimit - .else - mov r0, #0 - mov r2, #0 - .endif - bx lr - - -/* -__user_initial_stackheap() returns the: - - heap base in r0 - - stack base in r1, that is, the highest address in the stack region - - heap limit in r2 - - stack limit in r3, that is, the lowest address in the stack region. - */ -/* DEPRICATED - .globl __user_initial_stackheap - .type __user_initial_stackheap, %function - .thumb_func -__user_initial_stackheap: - ldr r0, = __HeapBase - ldr r1, = __StackTop - ldr r2, = __HeapLimit - ldr r3, = __StackLimit - bx lr -*/ - .end diff --git a/DSP/DSP_Lib_TestSuite/Common/platform/ARMCLANG/startup_armv7-m.S.noSCT b/DSP/DSP_Lib_TestSuite/Common/platform/ARMCLANG/startup_armv7-m.S.noSCT new file mode 100644 index 0000000..4bdb549 --- /dev/null +++ b/DSP/DSP_Lib_TestSuite/Common/platform/ARMCLANG/startup_armv7-m.S.noSCT @@ -0,0 +1,235 @@ +/* File: startup_armv7-m.S + * Purpose: startup file for armv7-m architecture devices. + * Should be used with ARMCLANG + * Version: V2.00 + * Date: 16 November 2015 + * + */ +/* Copyright (c) 2011 - 2015 ARM LIMITED + + All rights reserved. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + - Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + - Neither the name of ARM nor the names of its contributors may be used + to endorse or promote products derived from this software without + specific prior written permission. + * + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + ---------------------------------------------------------------------------*/ +/* + ;//-------- <<< Use Configuration Wizard in Context Menu >>> ------------------ +*/ + + + .syntax unified + .arch armv6-m + +/* .eabi_attribute Tag_ABI_align8_preserved,1 www.support.code-red-tech.com/CodeRedWiki/Preserve8 */ +.eabi_attribute 25, 1 /* Tag_ABI_align_preserved */ + + +/* + ;<h> Stack Configuration + ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> + ;</h> +*/ + .equ Stack_Size, 0x00000400 + + .section STACK, "w" + .align 3 + .globl __StackTop + .globl __StackLimit +__StackLimit: + .space Stack_Size +__StackTop: /* formerly known as __initial_sp */ + + +/* + ;<h> Heap Configuration + ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> + ;</h> +*/ + .equ Heap_Size, 0x00000C00 + + .section HEAP, "w" + .align 3 + .globl __HeapBase + .globl __HeapLimit +__HeapBase: + .if Heap_Size + .space Heap_Size + .endif +__HeapLimit: + + + .section RESET, "x" + .align 2 + .globl __Vectors + .globl __Vectors_End + .globl __Vectors_Size +__Vectors: + .long __StackTop /* Top of Stack */ + .long Reset_Handler /* Reset Handler */ + .long NMI_Handler /* NMI Handler */ + .long HardFault_Handler /* Hard Fault Handler */ + .long MemManage_Handler /* MPU Fault Handler */ + .long BusFault_Handler /* Bus Fault Handler */ + .long UsageFault_Handler /* Usage Fault Handler */ + .long 0 /* Reserved */ + .long 0 /* Reserved */ + .long 0 /* Reserved */ + .long 0 /* Reserved */ + .long SVC_Handler /* SVCall Handler */ + .long DebugMon_Handler /* Debug Monitor Handler */ + .long 0 /* Reserved */ + .long PendSV_Handler /* PendSV Handler */ + .long SysTick_Handler /* SysTick Handler */ +__Vectors_End: + + .equ __Vectors_Size, __Vectors_End - __Vectors + + + .text + .thumb + .align 2 + + .globl Reset_Handler + .weak Reset_Handler + .type Reset_Handler, %function + .thumb_func +Reset_Handler: + bl SystemInit + bl __main + + .globl NMI_Handler + .weak NMI_Handler + .type NMI_Handler, %function + .thumb_func +NMI_Handler: + bkpt #0 + b . + + .globl HardFault_Handler + .weak HardFault_Handler + .type HardFault_Handler, %function + .thumb_func +HardFault_Handler: + bkpt #0 + b . + + .globl MemManage_Handler + .weak MemManage_Handler + .type MemManage_Handler, %function + .thumb_func +MemManage_Handler: + bkpt #0 + b . + + .globl BusFault_Handler + .weak BusFault_Handler + .type BusFault_Handler, %function + .thumb_func +BusFault_Handler: + bkpt #0 + b . + + .globl UsageFault_Handler + .weak UsageFault_Handler + .type UsageFault_Handler, %function + .thumb_func +UsageFault_Handler: + bkpt #0 + b . + + .globl SVC_Handler + .weak SVC_Handler + .type SVC_Handler, %function + .thumb_func +SVC_Handler: + bkpt #0 + b . + + .globl DebugMon_Handler + .weak DebugMon_Handler + .type DebugMon_Handler, %function + .thumb_func +DebugMon_Handler: + bkpt #0 + b . + + .globl PendSV_Handler + .weak PendSV_Handler + .type PendSV_Handler, %function + .thumb_func +PendSV_Handler: + bkpt #0 + b . + + .globl SysTick_Handler + .weak SysTick_Handler + .type SysTick_Handler, %function + .thumb_func +SysTick_Handler: + bkpt #0 + b . + + + .global __use_two_region_memory + +/* + __user_setup_stackheap() returns the: + - heap base in r0 (if the program uses the heap) + - stack base in sp + - heap limit in r2 (if the program uses the heap and uses two-region memory). + */ + .globl __user_setup_stackheap + .type __user_setup_stackheap, %function + .thumb_func +__user_setup_stackheap: + ldr r0, =__StackTop + mov sp, r0 + .if Heap_Size + ldr r0, =__HeapBase + ldr r2, =__HeapLimit + .else + mov r0, #0 + mov r2, #0 + .endif + bx lr + + +/* +__user_initial_stackheap() returns the: + - heap base in r0 + - stack base in r1, that is, the highest address in the stack region + - heap limit in r2 + - stack limit in r3, that is, the lowest address in the stack region. + */ +/* DEPRICATED + .globl __user_initial_stackheap + .type __user_initial_stackheap, %function + .thumb_func +__user_initial_stackheap: + ldr r0, = __HeapBase + ldr r1, = __StackTop + ldr r2, = __HeapLimit + ldr r3, = __StackLimit + bx lr +*/ + + .end diff --git a/DSP/DSP_Lib_TestSuite/Common/platform/startup_generic.S b/DSP/DSP_Lib_TestSuite/Common/platform/startup_generic.S index 6d68355..91a9ea3 100644 --- a/DSP/DSP_Lib_TestSuite/Common/platform/startup_generic.S +++ b/DSP/DSP_Lib_TestSuite/Common/platform/startup_generic.S @@ -1,56 +1,62 @@ #if defined (__CC_ARM) - #if (defined (ARM_MATH_CM0)) + #if (defined (ARMCM0)) #include "ARMCC\startup_armv6-m.s" - #elif (defined (ARM_MATH_CM0P)) + #elif (defined (ARMCM0P) || defined (ARMCM0P_MPU)) #include "ARMCC\startup_armv6-m.s" - #elif (defined (ARM_MATH_CM3)) + #elif (defined (ARMCM3)) #include "ARMCC\startup_armv7-m.s" - #elif (defined (ARM_MATH_CM4)) + #elif (defined (ARMCM4) || defined (ARMCM4_FP)) #include "ARMCC\startup_armv7-m.s" - #elif (defined (ARM_MATH_CM7)) + #elif (defined (ARMCM7) || defined (ARMCM7_SP) || defined (ARMCM7_DP)) #include "ARMCC\startup_armv7-m.s" - #elif (defined (ARM_MATH_ARMV8MBL)) + #elif (defined (ARMv8MBL)) #include "ARMCC\startup_armv6-m.s" - #elif (defined (ARM_MATH_ARMV8MML)) + #elif (defined (ARMv8MML) || defined (ARMv8MML_DSP) || \ + defined (ARMv8MML_SP) || defined (ARMv8MML_DSP_SP) || \ + defined (ARMv8MML_DP) || defined (ARMv8MML_DSP_DP) ) #include "ARMCC\startup_armv7-m.s" #else #error "No appropriate startup file found!" #endif #elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) - #if (defined (ARM_MATH_CM0)) + #if (defined (ARMCM0)) #include "ARMCLANG\startup_armv6-m.S" - #elif (defined (ARM_MATH_CM0P)) + #elif (defined (ARMCM0P) || defined (ARMCM0P_MPU)) #include "ARMCLANG\startup_armv6-m.S" - #elif (defined (ARM_MATH_CM3)) + #elif (defined (ARMCM3)) #include "ARMCLANG\startup_armv7-m.S" - #elif (defined (ARM_MATH_CM4)) + #elif (defined (ARMCM4) || defined (ARMCM4_FP)) #include "ARMCLANG\startup_armv7-m.S" - #elif (defined (ARM_MATH_CM7)) + #elif (defined (ARMCM7) || defined (ARMCM7_SP) || defined (ARMCM7_DP)) #include "ARMCLANG\startup_armv7-m.S" - #elif (defined (ARM_MATH_ARMV8MBL)) + #elif (defined (ARMv8MBL)) #include "ARMCLANG\startup_armv6-m.S" - #elif (defined (ARM_MATH_ARMV8MML)) + #elif (defined (ARMv8MML) || defined (ARMv8MML_DSP) || \ + defined (ARMv8MML_SP) || defined (ARMv8MML_DSP_SP) || \ + defined (ARMv8MML_DP) || defined (ARMv8MML_DSP_DP) ) #include "ARMCLANG\startup_armv7-m.S" #else #error "No appropriate startup file found!" #endif #elif defined (__GNUC__) - #if (defined (ARM_MATH_CM0)) + #if (defined (ARMCM0)) #include "GCC\startup_armv6-m.S" - #elif (defined (ARM_MATH_CM0P)) + #elif (defined (ARMCM0P) || defined (ARMCM0P_MPU)) #include "GCC\startup_armv6-m.S" - #elif (defined (ARM_MATH_CM3)) + #elif (defined (ARMCM3)) #include "GCC\startup_armv7-m.S" - #elif (defined (ARM_MATH_CM4)) + #elif (defined (ARMCM4) || defined (ARMCM4_FP)) #include "GCC\startup_armv7-m.S" - #elif (defined (ARM_MATH_CM7)) + #elif (defined (ARMCM7) || defined (ARMCM7_SP) || defined (ARMCM7_DP)) #include "GCC\startup_armv7-m.S" - #elif (defined (ARM_MATH_ARMV8MBL)) + #elif (defined (ARMv8MBL)) #include "GCC\startup_armv6-m.S" - #elif (defined (ARM_MATH_ARMV8MML)) + #elif (defined (ARMv8MML) || defined (ARMv8MML_DSP) || \ + defined (ARMv8MML_SP) || defined (ARMv8MML_DSP_SP) || \ + defined (ARMv8MML_DP) || defined (ARMv8MML_DSP_DP) ) #include "GCC\startup_armv7-m.S" #else #error "No appropriate startup file found!" diff --git a/DSP/DSP_Lib_TestSuite/Common/src/all_tests.c b/DSP/DSP_Lib_TestSuite/Common/src/all_tests.c index aaa4524..2926273 100644 --- a/DSP/DSP_Lib_TestSuite/Common/src/all_tests.c +++ b/DSP/DSP_Lib_TestSuite/Common/src/all_tests.c @@ -12,19 +12,51 @@ JTEST_DEFINE_GROUP(all_tests) { - /* - To skip a test, comment it out - */ - JTEST_GROUP_CALL(basic_math_tests); - JTEST_GROUP_CALL(complex_math_tests); - JTEST_GROUP_CALL(controller_tests); - JTEST_GROUP_CALL(fast_math_tests); - JTEST_GROUP_CALL(filtering_tests); - JTEST_GROUP_CALL(matrix_tests); - JTEST_GROUP_CALL(statistics_tests); - JTEST_GROUP_CALL(support_tests); - JTEST_GROUP_CALL(transform_tests); - JTEST_GROUP_CALL(intrinsics_tests); - - return; + /* + To skip a test, comment it out + */ +#if !defined(CUSTOMIZE_TESTS) || defined(ENABLE_BASICMATH_TESTS) + JTEST_GROUP_CALL(basic_math_tests); +#endif + +#if !defined(CUSTOMIZE_TESTS) || defined(ENABLE_COMPLEXMATH_TESTS) + JTEST_GROUP_CALL(complex_math_tests); +#endif + +#if !defined(CUSTOMIZE_TESTS) || defined(ENABLE_CONTROLLER_TESTS) + JTEST_GROUP_CALL(controller_tests); +#endif + +#if !defined(CUSTOMIZE_TESTS) || defined(ENABLE_FASTMATH_TESTS) + JTEST_GROUP_CALL(fast_math_tests); +#endif + +#if !defined(CUSTOMIZE_TESTS) || defined(ENABLE_FILTERING_TESTS) + /* Biquad df2T_f32 will fail with Neon. The test must be updated. + Neon implementation is requiring a different initialization. + */ + JTEST_GROUP_CALL(filtering_tests); +#endif + +#if !defined(CUSTOMIZE_TESTS) || defined(ENABLE_MATRIX_TESTS) + JTEST_GROUP_CALL(matrix_tests); +#endif + +#if !defined(CUSTOMIZE_TESTS) || defined(ENABLE_STATISTICS_TESTS) + JTEST_GROUP_CALL(statistics_tests); +#endif() + +#if !defined(CUSTOMIZE_TESTS) || defined(ENABLE_SUPPORT_TESTS) + JTEST_GROUP_CALL(support_tests); +#endif + +#if !defined(CUSTOMIZE_TESTS) || defined(ENABLE_TRANSFORM_TESTS) + JTEST_GROUP_CALL(transform_tests); +#endif + +#if !defined(CUSTOMIZE_TESTS) || defined(ENABLE_INTRINSICS_TESTS) + JTEST_GROUP_CALL(intrinsics_tests); +#endif + + return; } diff --git a/DSP/DSP_Lib_TestSuite/Common/src/fast_math_tests/fast_math_tests_common_data.c b/DSP/DSP_Lib_TestSuite/Common/src/fast_math_tests/fast_math_tests_common_data.c index 01dda76..db74d35 100644 --- a/DSP/DSP_Lib_TestSuite/Common/src/fast_math_tests/fast_math_tests_common_data.c +++ b/DSP/DSP_Lib_TestSuite/Common/src/fast_math_tests/fast_math_tests_common_data.c @@ -190,175 +190,181 @@ const q15_t * fast_math_q15_inputs = (q15_t *) fast_math_q31_inputs; const float32_t fast_math_f32_inputs[FAST_MATH_MAX_LEN] = { - -1.5E-07, 5.0545058, 6.1958757, 0.1884450, 3.3656774, 0.5471223, - -5.0396892, 6.2149808, 0.4206357, 5.9024140, 0.1142128, 4.2966847, - -4.9243615, 3.3560853, 5.5628775, 5.6486144, 3.9328821, 0.8662564, - -1.3684878, 1.1444261, 0.2627620, 0.6719343, 3.8732286, 5.9040643, - -2.2271110, 2.5800587, 6.1848498, 5.9412493, 4.2514839, 6.2096863, - -4.8181437, 2.1155439, 4.1618680, 1.5341357, 1.8567268, 4.2736867, - -3.3165594, 2.5861183, 3.7864876, 4.7156566, 3.6664471, 3.4670146, - -3.6666823, 3.2158594, 0.5189454, 4.5211925, 6.2590334, 2.2276047, - -6.1025991, 2.1768018, 5.5703194, 2.8569321, 2.5976403, 1.3680509, - -0.7895111, 1.9409676, 4.5622487, 4.9189303, 4.3591961, 0.0615894, - -5.2980657, 5.7951829, 4.8440482, 0.2680398, 2.3762136, 4.4254964, - -4.5836656, 1.4091744, 1.6905207, 4.2287795, 3.0001720, 3.9189258, - -1.4856273, 1.1129014, 5.2128031, 4.8187110, 5.8715002, 0.6778860, - -1.1449692, 0.6226340, 3.0772767, 1.2141962, 5.6290528, 0.6225986, - -0.2775005, 3.5015887, 4.8537297, 1.9599772, 1.1245801, 2.1297213, - -1.3203840, 3.2053828, 5.6948550, 3.9516457, 0.6379562, 2.4558128, - -0.3431663, 3.1496534, 2.7125841, 6.2678565, 5.0994494, 3.0514394, - -5.6199810, 0.8642307, 2.4504731, 5.8267510, 5.7647838, 4.4835177, - 3.8851284, 2.1569414, 5.8812331, 0.7839784, 4.5904032, 4.0619375, - 5.2348483, 2.5024810, 4.7112719, 5.2478452, 2.0260784, 3.4699621, - 6.1520498, 3.4514073, 2.0761128, 3.8922546, 2.2659464, 4.7532896, - 2.6006151, 3.0934955, 4.3652005, 6.1118673, 2.0593452, 5.2640727, - 4.6437278, 5.9952549, 0.2005758, 2.2422740, 4.1635768, 1.7687265, - 1.4475395, 4.4681525, 3.9243074, 3.7109036, 4.1496541, 0.2987948, - 2.1914796, 2.8358565, 1.5136507, 4.4927603, 5.3795520, 1.7687650, - 4.5933278, 0.8655898, 5.2572843, 0.8708603, 3.6958286, 2.3006310, - 5.0690197, 3.1653480, 3.0762120, 5.5106597, 2.2188555, 2.8239372, - 6.0540393, 0.2657649, 6.1132775, 1.1888217, 4.1916405, 3.6847088, - 4.2418564, 2.2683684, 3.8973243, 5.0966113, 0.1209983, 0.5269928, - 6.1248595, 4.0925498, 1.4529100, 2.5352096, 0.7666775, 1.6866509, - 1.6200953, 2.0839142, 0.9565145, 2.1865966, 0.7644026, 5.5552975, - 0.5923686, 5.8436176, 2.5071164, 0.2978322, 2.1511962, 4.6242118, - 4.9931353, 3.4237447, 4.3116692, 5.6148598, 0.3442670, 1.9079607, - 0.2902301, 1.2282167, 4.5249352, 4.5349096, 5.5153742, 3.6595342, - 0.4441228, 5.7977751, 5.0288862, 1.7966571, 3.4159368, 6.1875316, - 4.4967379, 5.2714014, 2.7222564, 2.9570223, 3.5230663, 1.6907520, - 4.7062218, 3.1660203, 4.0640250, 1.9336225, 0.8716326, 2.9881129, - 2.2773988, 4.9518627, 4.9027432, 4.2003861, 0.8388295, 0.1354396, - 3.5175829, 1.8901016, 5.9024853, 6.1631993, 1.8008890, 5.0317023, - 5.6304337, 3.7543702, 5.5544410, 5.9296402, 3.4504620, 4.5765894, - 3.6238793, 0.1624673, 2.8056369, 4.0608350, 3.2748147, 2.3393094, - 5.8881908, 5.2121085, 5.3349614, 2.3407017, 3.7270886, 5.4824095, - 5.8653636, 4.2000849, 1.2992148, 4.1082644, 0.4527132, 2.5555406, - 4.1904544, 5.8667713, 5.0953493, 3.0445066, 4.7547955, 2.6203864, - 6.1059115, 6.2076281, 5.4295991, 2.4434288, 2.8572272, 1.5499814, - 4.9286757, 5.5470323, 5.7410198, 3.5078076, 3.7627993, 0.9354200, - 5.6530665, 2.8299063, 1.2922774, 5.6526739, 4.7914663, 5.5448250, - 1.7903950, 4.2300036, 4.1737937, 0.7716694, 2.5592571, 1.7296789, - 4.5029688, 1.7805566, 5.6309835, 5.1935484, 2.4506089, 3.1284165, - 4.3655898, 5.2424950, 3.8304163, 3.6111801, 2.0485834, 2.8678003, - 4.4849099, 5.5568808, 4.5292698, 0.1169475, 4.2397456, 2.7552322, - 2.7509053, 0.7353640, 5.1187960, 2.0411269, 1.5470969, 2.1533307, - 2.3605433, 3.4340988, 3.5306485, 2.4870244, 2.5015301, 3.2381477, - 4.1313862, 5.9747764, 4.5386496, 2.5137752, 5.2268018, 0.8440727, - 0.3799239, 0.5293398, 0.0000000, 2.0371338, 1.8958053, 0.0733938, - 3.3923238, 0.5992443, 0.9205800, 3.9655772, 5.3992694, 6.1212150, - 3.5866836, 6.2633946, 3.4780043, 3.2387210, 2.0777367, 2.7017810, - 3.0901098, 0.4463392, 5.5778300, 0.4061048, 2.7406309, 5.1938664, - 2.4789345, 3.8545764, 5.1436714, 5.5683790, 5.8503469, 1.1987353, - 1.6247202, 5.6414565, 3.7282025, 3.1657206, 3.8503962, 5.1485818, - 3.3419582, 1.2696753, 2.8518968, 2.6886436, 6.0698884, 3.8959208, - 4.3692639, 4.5249277, 2.1796068, 3.2483466, 3.4978155, 0.9832885, - 3.5315023, 4.3655778, 2.6794992, 5.2544420, 4.5954405, 2.2621418, - 2.8539005, 2.4277593, 4.8729535, 4.6135614, 2.7035154, 4.3589760, - 5.9389515, 4.9274787, 4.4332387, 0.6869673, 2.4500066, 3.7127639, - 2.8863700, 0.3162955, 1.4368865, 5.2413645, 0.0982985, 5.4268554, - 0.4905223, 4.2037186, 3.1429204, 1.3696954, 3.5915675, 0.7677371, - 4.2170618, 3.7673071, 0.3517086, 0.3540136, 0.9581898, 0.1232828, - 2.7342886, 5.2290017, 3.8791769, 3.2680695, 5.4278441, 0.6138541, - 5.7054603, 0.6786889, 3.2483864, 0.8994758, 3.5146290, 0.0287746, - 4.8172051, 5.3325973, 5.7605579, 6.2013046, 3.1738449, 1.7053924, - 0.6330341, 3.1909083, 3.6794907, 4.7933610, 0.5212697, 4.1569315, - 3.2482749, 1.0747264, 5.8971330, 3.7101152, 2.7685894, 5.9182512, - 4.1212281, 2.8396586, 5.2759745, 3.3465722, 3.4801751, 4.2729777, - 2.3071222, 1.5035072, 3.6374836, 5.4468120, 2.5558538, 0.7075818, - 2.7887656, 1.8861142, 2.5219880, 5.2361777, 2.5360737, 2.4515477, - 2.2647672, 0.8812504, 1.6344462, 0.5454754, 2.6979830, 1.6165554, - 1.8695956, 2.6694641, 0.7490013, 3.1105972, 4.4384875, 1.5304166, - 4.9327408, 0.4655185, 2.4748426, 0.0213259, 1.3865538, 0.0081717, - 1.1886509, 0.8952537, 1.6843712, 1.0988793, 0.8711572, 3.7629093, - 5.6615138, 5.9022971, 1.3897429, 3.0327137, 2.3625475, 3.2910070, - 1.6642436, 0.4295011, 2.7415239, 1.0923508, 0.1640358, 5.9984205, - 2.7055177, 6.0416507, 4.7903915, 0.0461730, 4.2728088, 4.4356194, - 4.0534637, 3.4702651, 1.3704176, 4.8529200, 1.4327442, 2.3302118, - 5.5978709, 5.3807748, 2.5285646, 1.9981730, 3.8241692, 5.7189253, - 5.7120324, 3.7170973, 2.0896078, 5.3599569, 2.7796679, 5.6822331, - 0.2084724, 3.3453343, 4.5018856, 1.1265867, 2.1144987, 1.1794352, - 2.0227281, 2.5375066, 3.4467437, 0.3062336, 3.4729184, 1.7266910, - 1.5174002, 1.5277262, 0.9686124, 6.0093412, 5.8789338, 5.1441345, - 4.5758041, 1.1046577, 2.2642776, 1.1862024, 0.0075297, 1.9881224, - 4.3958232, 3.9285942, 3.4121603, 2.7585521, 1.8059588, 3.1520171, - 4.7849358, 4.7903511, 3.6194660, 4.6977042, 4.0560129, 0.7742111, - 3.1692252, 2.1819072, 0.5789810, 0.9289656, 1.2451370, 4.2239985, - 2.7112647, 4.3630684, 1.6134250, 0.0613154, 3.3444332, 1.7554715, - 5.9453394, 5.6953510, 2.4673100, 0.1561700, 4.2187618, 5.2600982, - 6.1041123, 0.3577199, 2.8294680, 3.6597688, 4.3142726, 4.5203293, - 4.0843265, 4.5673388, 2.3489542, 3.6541880, 0.7295941, 0.3622530, - 6.1560465, 1.7896003, 3.7383338, 6.0454361, 1.1672793, 1.2129049, - 2.1466132, 5.8615704, 2.4546365, 1.7166712, 0.9547117, 2.4951084, - 2.3544507, 0.8238180, 2.7334414, 0.5749942, 3.8618151, 0.0689837, - 3.6019012, 4.9620190, 1.4788531, 2.8149909, 3.5773830, 0.3857966, - 3.1182750, 4.0357856, 1.3902536, 5.2593808, 6.1014456, 5.3179177, - 3.1792883, 1.7522271, 4.6911344, 1.4886775, 6.0151778, 3.8972087, - 3.7715583, 1.0845061, 0.5676653, 1.6038597, 5.3945577, 5.7244031, - 4.3959286, 4.5564551, 1.4444168, 3.6194506, 5.0933266, 2.5374227, - 6.2105471, 0.5654792, 2.0165320, 3.2132771, 0.3808010, 4.5596317, - 3.4969429, 3.3260664, 5.2149334, 5.3957421, 4.9576149, 1.9970040, - 2.8413032, 4.7263877, 0.6902815, 0.6895316, 1.6957291, 3.2963937, - 6.1113470, 4.4636294, 1.9594738, 1.8312791, 5.3429527, 5.7280497, - 4.0166905, 1.6045389, 0.5571039, 5.2669152, 3.6738954, 5.9571429, - 0.3834561, 3.6734096, 1.7913869, 5.2007946, 1.2000032, 2.7804978, - 2.4718774, 5.1935175, 4.2529065, 1.3044083, 1.9987109, 0.8407592, - 4.2189258, 3.5876427, 1.0666779, 0.9277486, 2.9912971, 5.7057758, - 3.4694180, 0.2069675, 0.3384307, 5.0583614, 2.8360719, 2.4042372, - 4.9614777, 2.2888819, 3.3448533, 4.4714710, 5.4756485, 2.0652177, - 4.0848120, 6.1250762, 0.4773170, 3.6883502, 2.6005256, 1.9423615, - 1.6577182, 4.7674690, 6.2531264, 1.1722630, 4.9080805, 1.2302350, - 6.2351753, 5.0407581, 2.6654950, 4.5795867, 3.1312479, 5.0830358, - 2.2400117, 0.4602021, 3.7133088, 5.7188788, 1.2174673, 2.7166470, - 4.7071094, 0.2462034, 5.9459353, 4.7983010, 3.5111731, 1.1551193, - 3.1287047, 3.2537199, 6.2470131, 5.3711915, 6.0469623, 4.2659122, - 2.5352740, 5.8746469, 3.0126903, 1.4563896, 2.4899651, 4.4301324, - 3.5095299, 4.7540509, 6.2547920, 6.0471349, 3.3619258, 6.0561746, - 0.7264988, 0.3232592, 1.9122808, 3.6454528, 3.3361480, 5.6624574, - 3.3963785, 2.7142142, 3.4096772, 4.4762342, 0.1047703, 5.0323343, - 0.8954125, 3.0063438, 1.6137441, 2.3190715, 4.1579916, 1.0656836, - 1.7516517, 1.2454643, 1.2256706, 2.0535941, 5.5313259, 2.9600203, - 2.5382144, 1.1261446, 6.0879353, 2.5601199, 5.3060708, 3.8662016, - 2.3663172, 5.5114955, 4.9313732, 2.9213939, 5.1143679, 5.6450910, - 2.6969853, 2.1006537, 3.7488443, 5.6673754, 4.4112136, 2.3716204, - 4.6178643, 5.9948046, 3.4105954, 3.3935850, 1.9547595, 0.4475800, - 1.1434170, 0.5842667, 2.9121888, 0.0586379, 5.7492774, 4.0384655, - 0.0089162, 0.1909163, 1.3098570, 2.8586366, 0.7996361, 0.0543350, - 4.5683759, 2.2249794, 4.9036865, 2.7435946, 2.7429546, 0.3092155, - 0.3118464, 0.5723993, 3.7324447, 1.5147758, 5.2864780, 5.3860266, - 6.0545540, 3.0718480, 1.3842492, 1.4213108, 3.3727372, 4.7884765, - 2.1838288, 2.8980046, 4.0169897, 5.7637923, 1.0151904, 4.4964699, - 3.6300404, 2.7224978, 5.5558613, 2.4696170, 1.1245340, 3.9793522, - 3.9207111, 2.0605178, 5.0451799, 6.2799046, 6.1636676, 0.7981966, - 1.4592079, 0.1484872, 3.8166117, 0.6962355, 2.5601436, 5.5548184, - 3.4440198, 2.3185147, 1.3090764, 2.7705283, 6.0079576, 0.7792778, - 2.9578927, 5.3840384, 0.2726304, 4.3456090, 6.1511471, 1.7798247, - 0.8405677, 4.3057392, 5.7142715, 3.8382030, 5.6547587, 1.2153801, - 4.7401894, 2.1756202, 2.6303011, 0.9784166, 5.1459324, 3.9265103, - 4.6405120, 5.0586705, 0.4223724, 5.9739917, 3.1263686, 4.7447217, - 4.6646686, 5.2221411, 0.9833301, 2.8733554, 3.8836400, 5.8570808, - -5.2470141, 5.6261119, 3.6600718, 3.6615062, 5.3716581, 0.2190677, - -5.5632585, 2.5618482, 0.2285950, 4.6881858, 0.9728179, 0.9042027, - -3.8073530, 1.5989503, 2.0367209, 2.5245268, 2.5533189, 2.4265105, - -3.8314979, 1.0486053, 1.1818174, 0.5945707, 2.0306392, 4.8355201, - -1.4710068, 4.6518534, 4.3531065, 5.1778361, 5.2023364, 1.8432851, - -1.9438243, 3.2862931, 2.0439139, 5.2266206, 5.0912323, 3.4997233, - -1.6522518, 4.2761236, 1.4680860, 2.8678051, 2.4163051, 3.3841326, - -6.2310582, 4.7451897, 6.1603795, 1.4751828, 3.3210347, 0.3231823, - -4.7555888, 3.7823504, 5.3857498, 6.2095284, 5.8401232, 2.5730582, - -0.0021455, 3.3984387, 1.3052100, 1.3777994, 2.0471011, 0.6028680, - -4.6968925, 4.7030205, 3.4136510, 2.1245480, 5.2297066, 3.4719134, - -6.0164208, 5.6098372, 2.2399783, 3.4331443, 2.1782657, 3.9131853, - -5.0053405, 4.6864702, 0.7887674, 5.1672539, 0.1580253, 2.6039335, - -4.5955687, 4.9095176, 2.3077255, 4.6801428, 5.6062801, 1.5243220, - -0.8142818, 1.4141432, 2.1992023, 1.8038058, 5.8275790, 0.3224138, - -3.7238350, 1.0235240, 5.2678588, 1.0528164, 3.1554195, 6.2789723, - -2.2330890, 0.2957980, 1.3424690, 2.4996969, 2.0964990, 1.4426353, - -5.8818165, 4.2926017, 6.0451393, 2.7518666, 5.9083095, 0.0366581, - -3.8346722, 5.0333074, 1.4638661, 5.8588735, 4.7957215, 5.1927356, - -3.6031780, 4.9799375, 2.0674268, 1.4040530, 1.9627813, 3.6726693, - -5.2145043, 1.8250297, 2.5293238, 5.4164658, 3.8625225, 6.2278165, - -1.2798778, 5.1975080, 4.2465638, 1.5641957, 2.9894493, 2.5074636, - -3.7663816, 5.0298329, 0.6601666, 5.1612735, 5.2847013, 2.2274284, - -2.7022061, 3.5954850, 4.4034117, 4.6650751, 4.7619266, 2.4449681, - -2.6973871, 6.0088907, 3.6000853, 5.3389611 + /* Special values close to increments of pi/2 */ + -0.0, 0.0, -1.5E-07, 1.5E-07, 1.5707964, 1.5707965, + -1.5707964, -1.5707965, 3.1415925, 3.1415927, -3.1415925, -3.1415927, + 6.2831855, 6.283186, -6.2831855, -6.283186, + + /* Test some slightly larger values too */ + 10.1, -13.2, + + /* Random values (0, 2pi) */ + -1.3684878, 1.1444261, 0.2627620, 0.6719343, 3.8732286, 5.9040643, + -2.2271110, 2.5800587, 6.1848498, 5.9412493, 4.2514839, 6.2096863, + -4.8181437, 2.1155439, 4.1618680, 1.5341357, 1.8567268, 4.2736867, + -3.3165594, 2.5861183, 3.7864876, 4.7156566, 3.6664471, 3.4670146, + -3.6666823, 3.2158594, 0.5189454, 4.5211925, 6.2590334, 2.2276047, + -6.1025991, 2.1768018, 5.5703194, 2.8569321, 2.5976403, 1.3680509, + -0.7895111, 1.9409676, 4.5622487, 4.9189303, 4.3591961, 0.0615894, + -5.2980657, 5.7951829, 4.8440482, 0.2680398, 2.3762136, 4.4254964, + -4.5836656, 1.4091744, 1.6905207, 4.2287795, 3.0001720, 3.9189258, + -1.4856273, 1.1129014, 5.2128031, 4.8187110, 5.8715002, 0.6778860, + -1.1449692, 0.6226340, 3.0772767, 1.2141962, 5.6290528, 0.6225986, + -0.2775005, 3.5015887, 4.8537297, 1.9599772, 1.1245801, 2.1297213, + -1.3203840, 3.2053828, 5.6948550, 3.9516457, 0.6379562, 2.4558128, + -0.3431663, 3.1496534, 2.7125841, 6.2678565, 5.0994494, 3.0514394, + -5.6199810, 0.8642307, 2.4504731, 5.8267510, 5.7647838, 4.4835177, + 3.8851284, 2.1569414, 5.8812331, 0.7839784, 4.5904032, 4.0619375, + 5.2348483, 2.5024810, 4.7112719, 5.2478452, 2.0260784, 3.4699621, + 6.1520498, 3.4514073, 2.0761128, 3.8922546, 2.2659464, 4.7532896, + 2.6006151, 3.0934955, 4.3652005, 6.1118673, 2.0593452, 5.2640727, + 4.6437278, 5.9952549, 0.2005758, 2.2422740, 4.1635768, 1.7687265, + 1.4475395, 4.4681525, 3.9243074, 3.7109036, 4.1496541, 0.2987948, + 2.1914796, 2.8358565, 1.5136507, 4.4927603, 5.3795520, 1.7687650, + 4.5933278, 0.8655898, 5.2572843, 0.8708603, 3.6958286, 2.3006310, + 5.0690197, 3.1653480, 3.0762120, 5.5106597, 2.2188555, 2.8239372, + 6.0540393, 0.2657649, 6.1132775, 1.1888217, 4.1916405, 3.6847088, + 4.2418564, 2.2683684, 3.8973243, 5.0966113, 0.1209983, 0.5269928, + 6.1248595, 4.0925498, 1.4529100, 2.5352096, 0.7666775, 1.6866509, + 1.6200953, 2.0839142, 0.9565145, 2.1865966, 0.7644026, 5.5552975, + 0.5923686, 5.8436176, 2.5071164, 0.2978322, 2.1511962, 4.6242118, + 4.9931353, 3.4237447, 4.3116692, 5.6148598, 0.3442670, 1.9079607, + 0.2902301, 1.2282167, 4.5249352, 4.5349096, 5.5153742, 3.6595342, + 0.4441228, 5.7977751, 5.0288862, 1.7966571, 3.4159368, 6.1875316, + 4.4967379, 5.2714014, 2.7222564, 2.9570223, 3.5230663, 1.6907520, + 4.7062218, 3.1660203, 4.0640250, 1.9336225, 0.8716326, 2.9881129, + 2.2773988, 4.9518627, 4.9027432, 4.2003861, 0.8388295, 0.1354396, + 3.5175829, 1.8901016, 5.9024853, 6.1631993, 1.8008890, 5.0317023, + 5.6304337, 3.7543702, 5.5544410, 5.9296402, 3.4504620, 4.5765894, + 3.6238793, 0.1624673, 2.8056369, 4.0608350, 3.2748147, 2.3393094, + 5.8881908, 5.2121085, 5.3349614, 2.3407017, 3.7270886, 5.4824095, + 5.8653636, 4.2000849, 1.2992148, 4.1082644, 0.4527132, 2.5555406, + 4.1904544, 5.8667713, 5.0953493, 3.0445066, 4.7547955, 2.6203864, + 6.1059115, 6.2076281, 5.4295991, 2.4434288, 2.8572272, 1.5499814, + 4.9286757, 5.5470323, 5.7410198, 3.5078076, 3.7627993, 0.9354200, + 5.6530665, 2.8299063, 1.2922774, 5.6526739, 4.7914663, 5.5448250, + 1.7903950, 4.2300036, 4.1737937, 0.7716694, 2.5592571, 1.7296789, + 4.5029688, 1.7805566, 5.6309835, 5.1935484, 2.4506089, 3.1284165, + 4.3655898, 5.2424950, 3.8304163, 3.6111801, 2.0485834, 2.8678003, + 4.4849099, 5.5568808, 4.5292698, 0.1169475, 4.2397456, 2.7552322, + 2.7509053, 0.7353640, 5.1187960, 2.0411269, 1.5470969, 2.1533307, + 2.3605433, 3.4340988, 3.5306485, 2.4870244, 2.5015301, 3.2381477, + 4.1313862, 5.9747764, 4.5386496, 2.5137752, 5.2268018, 0.8440727, + 0.3799239, 0.5293398, 0.0000000, 2.0371338, 1.8958053, 0.0733938, + 3.3923238, 0.5992443, 0.9205800, 3.9655772, 5.3992694, 6.1212150, + 3.5866836, 6.2633946, 3.4780043, 3.2387210, 2.0777367, 2.7017810, + 3.0901098, 0.4463392, 5.5778300, 0.4061048, 2.7406309, 5.1938664, + 2.4789345, 3.8545764, 5.1436714, 5.5683790, 5.8503469, 1.1987353, + 1.6247202, 5.6414565, 3.7282025, 3.1657206, 3.8503962, 5.1485818, + 3.3419582, 1.2696753, 2.8518968, 2.6886436, 6.0698884, 3.8959208, + 4.3692639, 4.5249277, 2.1796068, 3.2483466, 3.4978155, 0.9832885, + 3.5315023, 4.3655778, 2.6794992, 5.2544420, 4.5954405, 2.2621418, + 2.8539005, 2.4277593, 4.8729535, 4.6135614, 2.7035154, 4.3589760, + 5.9389515, 4.9274787, 4.4332387, 0.6869673, 2.4500066, 3.7127639, + 2.8863700, 0.3162955, 1.4368865, 5.2413645, 0.0982985, 5.4268554, + 0.4905223, 4.2037186, 3.1429204, 1.3696954, 3.5915675, 0.7677371, + 4.2170618, 3.7673071, 0.3517086, 0.3540136, 0.9581898, 0.1232828, + 2.7342886, 5.2290017, 3.8791769, 3.2680695, 5.4278441, 0.6138541, + 5.7054603, 0.6786889, 3.2483864, 0.8994758, 3.5146290, 0.0287746, + 4.8172051, 5.3325973, 5.7605579, 6.2013046, 3.1738449, 1.7053924, + 0.6330341, 3.1909083, 3.6794907, 4.7933610, 0.5212697, 4.1569315, + 3.2482749, 1.0747264, 5.8971330, 3.7101152, 2.7685894, 5.9182512, + 4.1212281, 2.8396586, 5.2759745, 3.3465722, 3.4801751, 4.2729777, + 2.3071222, 1.5035072, 3.6374836, 5.4468120, 2.5558538, 0.7075818, + 2.7887656, 1.8861142, 2.5219880, 5.2361777, 2.5360737, 2.4515477, + 2.2647672, 0.8812504, 1.6344462, 0.5454754, 2.6979830, 1.6165554, + 1.8695956, 2.6694641, 0.7490013, 3.1105972, 4.4384875, 1.5304166, + 4.9327408, 0.4655185, 2.4748426, 0.0213259, 1.3865538, 0.0081717, + 1.1886509, 0.8952537, 1.6843712, 1.0988793, 0.8711572, 3.7629093, + 5.6615138, 5.9022971, 1.3897429, 3.0327137, 2.3625475, 3.2910070, + 1.6642436, 0.4295011, 2.7415239, 1.0923508, 0.1640358, 5.9984205, + 2.7055177, 6.0416507, 4.7903915, 0.0461730, 4.2728088, 4.4356194, + 4.0534637, 3.4702651, 1.3704176, 4.8529200, 1.4327442, 2.3302118, + 5.5978709, 5.3807748, 2.5285646, 1.9981730, 3.8241692, 5.7189253, + 5.7120324, 3.7170973, 2.0896078, 5.3599569, 2.7796679, 5.6822331, + 0.2084724, 3.3453343, 4.5018856, 1.1265867, 2.1144987, 1.1794352, + 2.0227281, 2.5375066, 3.4467437, 0.3062336, 3.4729184, 1.7266910, + 1.5174002, 1.5277262, 0.9686124, 6.0093412, 5.8789338, 5.1441345, + 4.5758041, 1.1046577, 2.2642776, 1.1862024, 0.0075297, 1.9881224, + 4.3958232, 3.9285942, 3.4121603, 2.7585521, 1.8059588, 3.1520171, + 4.7849358, 4.7903511, 3.6194660, 4.6977042, 4.0560129, 0.7742111, + 3.1692252, 2.1819072, 0.5789810, 0.9289656, 1.2451370, 4.2239985, + 2.7112647, 4.3630684, 1.6134250, 0.0613154, 3.3444332, 1.7554715, + 5.9453394, 5.6953510, 2.4673100, 0.1561700, 4.2187618, 5.2600982, + 6.1041123, 0.3577199, 2.8294680, 3.6597688, 4.3142726, 4.5203293, + 4.0843265, 4.5673388, 2.3489542, 3.6541880, 0.7295941, 0.3622530, + 6.1560465, 1.7896003, 3.7383338, 6.0454361, 1.1672793, 1.2129049, + 2.1466132, 5.8615704, 2.4546365, 1.7166712, 0.9547117, 2.4951084, + 2.3544507, 0.8238180, 2.7334414, 0.5749942, 3.8618151, 0.0689837, + 3.6019012, 4.9620190, 1.4788531, 2.8149909, 3.5773830, 0.3857966, + 3.1182750, 4.0357856, 1.3902536, 5.2593808, 6.1014456, 5.3179177, + 3.1792883, 1.7522271, 4.6911344, 1.4886775, 6.0151778, 3.8972087, + 3.7715583, 1.0845061, 0.5676653, 1.6038597, 5.3945577, 5.7244031, + 4.3959286, 4.5564551, 1.4444168, 3.6194506, 5.0933266, 2.5374227, + 6.2105471, 0.5654792, 2.0165320, 3.2132771, 0.3808010, 4.5596317, + 3.4969429, 3.3260664, 5.2149334, 5.3957421, 4.9576149, 1.9970040, + 2.8413032, 4.7263877, 0.6902815, 0.6895316, 1.6957291, 3.2963937, + 6.1113470, 4.4636294, 1.9594738, 1.8312791, 5.3429527, 5.7280497, + 4.0166905, 1.6045389, 0.5571039, 5.2669152, 3.6738954, 5.9571429, + 0.3834561, 3.6734096, 1.7913869, 5.2007946, 1.2000032, 2.7804978, + 2.4718774, 5.1935175, 4.2529065, 1.3044083, 1.9987109, 0.8407592, + 4.2189258, 3.5876427, 1.0666779, 0.9277486, 2.9912971, 5.7057758, + 3.4694180, 0.2069675, 0.3384307, 5.0583614, 2.8360719, 2.4042372, + 4.9614777, 2.2888819, 3.3448533, 4.4714710, 5.4756485, 2.0652177, + 4.0848120, 6.1250762, 0.4773170, 3.6883502, 2.6005256, 1.9423615, + 1.6577182, 4.7674690, 6.2531264, 1.1722630, 4.9080805, 1.2302350, + 6.2351753, 5.0407581, 2.6654950, 4.5795867, 3.1312479, 5.0830358, + 2.2400117, 0.4602021, 3.7133088, 5.7188788, 1.2174673, 2.7166470, + 4.7071094, 0.2462034, 5.9459353, 4.7983010, 3.5111731, 1.1551193, + 3.1287047, 3.2537199, 6.2470131, 5.3711915, 6.0469623, 4.2659122, + 2.5352740, 5.8746469, 3.0126903, 1.4563896, 2.4899651, 4.4301324, + 3.5095299, 4.7540509, 6.2547920, 6.0471349, 3.3619258, 6.0561746, + 0.7264988, 0.3232592, 1.9122808, 3.6454528, 3.3361480, 5.6624574, + 3.3963785, 2.7142142, 3.4096772, 4.4762342, 0.1047703, 5.0323343, + 0.8954125, 3.0063438, 1.6137441, 2.3190715, 4.1579916, 1.0656836, + 1.7516517, 1.2454643, 1.2256706, 2.0535941, 5.5313259, 2.9600203, + 2.5382144, 1.1261446, 6.0879353, 2.5601199, 5.3060708, 3.8662016, + 2.3663172, 5.5114955, 4.9313732, 2.9213939, 5.1143679, 5.6450910, + 2.6969853, 2.1006537, 3.7488443, 5.6673754, 4.4112136, 2.3716204, + 4.6178643, 5.9948046, 3.4105954, 3.3935850, 1.9547595, 0.4475800, + 1.1434170, 0.5842667, 2.9121888, 0.0586379, 5.7492774, 4.0384655, + 0.0089162, 0.1909163, 1.3098570, 2.8586366, 0.7996361, 0.0543350, + 4.5683759, 2.2249794, 4.9036865, 2.7435946, 2.7429546, 0.3092155, + 0.3118464, 0.5723993, 3.7324447, 1.5147758, 5.2864780, 5.3860266, + 6.0545540, 3.0718480, 1.3842492, 1.4213108, 3.3727372, 4.7884765, + 2.1838288, 2.8980046, 4.0169897, 5.7637923, 1.0151904, 4.4964699, + 3.6300404, 2.7224978, 5.5558613, 2.4696170, 1.1245340, 3.9793522, + 3.9207111, 2.0605178, 5.0451799, 6.2799046, 6.1636676, 0.7981966, + 1.4592079, 0.1484872, 3.8166117, 0.6962355, 2.5601436, 5.5548184, + 3.4440198, 2.3185147, 1.3090764, 2.7705283, 6.0079576, 0.7792778, + 2.9578927, 5.3840384, 0.2726304, 4.3456090, 6.1511471, 1.7798247, + 0.8405677, 4.3057392, 5.7142715, 3.8382030, 5.6547587, 1.2153801, + 4.7401894, 2.1756202, 2.6303011, 0.9784166, 5.1459324, 3.9265103, + 4.6405120, 5.0586705, 0.4223724, 5.9739917, 3.1263686, 4.7447217, + 4.6646686, 5.2221411, 0.9833301, 2.8733554, 3.8836400, 5.8570808, + -5.2470141, 5.6261119, 3.6600718, 3.6615062, 5.3716581, 0.2190677, + -5.5632585, 2.5618482, 0.2285950, 4.6881858, 0.9728179, 0.9042027, + -3.8073530, 1.5989503, 2.0367209, 2.5245268, 2.5533189, 2.4265105, + -3.8314979, 1.0486053, 1.1818174, 0.5945707, 2.0306392, 4.8355201, + -1.4710068, 4.6518534, 4.3531065, 5.1778361, 5.2023364, 1.8432851, + -1.9438243, 3.2862931, 2.0439139, 5.2266206, 5.0912323, 3.4997233, + -1.6522518, 4.2761236, 1.4680860, 2.8678051, 2.4163051, 3.3841326, + -6.2310582, 4.7451897, 6.1603795, 1.4751828, 3.3210347, 0.3231823, + -4.7555888, 3.7823504, 5.3857498, 6.2095284, 5.8401232, 2.5730582, + -0.0021455, 3.3984387, 1.3052100, 1.3777994, 2.0471011, 0.6028680, + -4.6968925, 4.7030205, 3.4136510, 2.1245480, 5.2297066, 3.4719134, + -6.0164208, 5.6098372, 2.2399783, 3.4331443, 2.1782657, 3.9131853, + -5.0053405, 4.6864702, 0.7887674, 5.1672539, 0.1580253, 2.6039335, + -4.5955687, 4.9095176, 2.3077255, 4.6801428, 5.6062801, 1.5243220, + -0.8142818, 1.4141432, 2.1992023, 1.8038058, 5.8275790, 0.3224138, + -3.7238350, 1.0235240, 5.2678588, 1.0528164, 3.1554195, 6.2789723, + -2.2330890, 0.2957980, 1.3424690, 2.4996969, 2.0964990, 1.4426353, + -5.8818165, 4.2926017, 6.0451393, 2.7518666, 5.9083095, 0.0366581, + -3.8346722, 5.0333074, 1.4638661, 5.8588735, 4.7957215, 5.1927356, + -3.6031780, 4.9799375, 2.0674268, 1.4040530, 1.9627813, 3.6726693, + -5.2145043, 1.8250297, 2.5293238, 5.4164658, 3.8625225, 6.2278165, + -1.2798778, 5.1975080, 4.2465638, 1.5641957, 2.9894493, 2.5074636, + -3.7663816, 5.0298329, 0.6601666, 5.1612735, 5.2847013, 2.2274284, + -2.7022061, 3.5954850, 4.4034117, 4.6650751, 4.7619266, 2.4449681, + -2.6973871, 6.0088907, 3.6000853, 5.3389611 }; diff --git a/DSP/DSP_Lib_TestSuite/Common/src/filtering_tests/conv_tests.c b/DSP/DSP_Lib_TestSuite/Common/src/filtering_tests/conv_tests.c index fc45819..981004b 100644 --- a/DSP/DSP_Lib_TestSuite/Common/src/filtering_tests/conv_tests.c +++ b/DSP/DSP_Lib_TestSuite/Common/src/filtering_tests/conv_tests.c @@ -442,32 +442,32 @@ CONV_DEFINE_TEST(conv_partial_opt , q7 , q7_t , CONV_PARTIAL_TEST_TEMPL JTEST_DEFINE_GROUP(conv_tests) { - /* - To skip a test, comment it out. - */ - JTEST_TEST_CALL(arm_conv_f32_tests); - JTEST_TEST_CALL(arm_conv_q31_tests); - JTEST_TEST_CALL(arm_conv_q15_tests); - JTEST_TEST_CALL(arm_conv_q7_tests); + /* + To skip a test, comment it out. + */ + JTEST_TEST_CALL(arm_conv_f32_tests); + JTEST_TEST_CALL(arm_conv_q31_tests); + JTEST_TEST_CALL(arm_conv_q15_tests); + JTEST_TEST_CALL(arm_conv_q7_tests); - JTEST_TEST_CALL(arm_conv_opt_q15_tests); - JTEST_TEST_CALL(arm_conv_opt_q7_tests); + JTEST_TEST_CALL(arm_conv_opt_q15_tests); + JTEST_TEST_CALL(arm_conv_opt_q7_tests); - JTEST_TEST_CALL(arm_conv_fast_q31_tests); - JTEST_TEST_CALL(arm_conv_fast_q15_tests); + JTEST_TEST_CALL(arm_conv_fast_q31_tests); + JTEST_TEST_CALL(arm_conv_fast_q15_tests); - JTEST_TEST_CALL(arm_conv_fast_opt_q15_tests); + JTEST_TEST_CALL(arm_conv_fast_opt_q15_tests); - JTEST_TEST_CALL(arm_conv_partial_f32_tests); - JTEST_TEST_CALL(arm_conv_partial_q31_tests); - JTEST_TEST_CALL(arm_conv_partial_q15_tests); - JTEST_TEST_CALL(arm_conv_partial_q7_tests); + JTEST_TEST_CALL(arm_conv_partial_f32_tests); + JTEST_TEST_CALL(arm_conv_partial_q31_tests); + JTEST_TEST_CALL(arm_conv_partial_q15_tests); + JTEST_TEST_CALL(arm_conv_partial_q7_tests); - JTEST_TEST_CALL(arm_conv_partial_fast_q31_tests); - JTEST_TEST_CALL(arm_conv_partial_fast_q15_tests); + JTEST_TEST_CALL(arm_conv_partial_fast_q31_tests); + JTEST_TEST_CALL(arm_conv_partial_fast_q15_tests); - JTEST_TEST_CALL(arm_conv_partial_fast_opt_q15_tests); + JTEST_TEST_CALL(arm_conv_partial_fast_opt_q15_tests); - JTEST_TEST_CALL(arm_conv_partial_opt_q15_tests); - JTEST_TEST_CALL(arm_conv_partial_opt_q7_tests); + JTEST_TEST_CALL(arm_conv_partial_opt_q15_tests); + JTEST_TEST_CALL(arm_conv_partial_opt_q7_tests); } diff --git a/DSP/DSP_Lib_TestSuite/Common/src/filtering_tests/filtering_test_common_data.c b/DSP/DSP_Lib_TestSuite/Common/src/filtering_tests/filtering_test_common_data.c index 49c4eb7..0fc4178 100644 --- a/DSP/DSP_Lib_TestSuite/Common/src/filtering_tests/filtering_test_common_data.c +++ b/DSP/DSP_Lib_TestSuite/Common/src/filtering_tests/filtering_test_common_data.c @@ -10,7 +10,7 @@ float32_t filtering_output_ref[LMS_MAX_BLOCKSIZE*2] = {0}; float32_t filtering_output_f32_fut[LMS_MAX_BLOCKSIZE*2] = {0}; float32_t filtering_output_f32_ref[LMS_MAX_BLOCKSIZE*2] = {0}; float32_t filtering_input_lms[LMS_MAX_BLOCKSIZE*2] = {0}; -float32_t filtering_pState[LMS_MAX_BLOCKSIZE + FILTERING_MAX_NUMTAPS] = {0}; +__ALIGNED(8) float32_t filtering_pState[LMS_MAX_BLOCKSIZE + FILTERING_MAX_NUMTAPS] = {0}; float32_t filtering_scratch[FILTERING_MAX_BLOCKSIZE * 3] = {0}; float32_t filtering_scratch2[FILTERING_MAX_BLOCKSIZE * 3] = {0}; float32_t filtering_coeffs_lms[FILTERING_MAX_NUMTAPS]; diff --git a/DSP/DSP_Lib_TestSuite/Common/src/filtering_tests/filtering_test_group.c b/DSP/DSP_Lib_TestSuite/Common/src/filtering_tests/filtering_test_group.c index 7132556..453bad6 100644 --- a/DSP/DSP_Lib_TestSuite/Common/src/filtering_tests/filtering_test_group.c +++ b/DSP/DSP_Lib_TestSuite/Common/src/filtering_tests/filtering_test_group.c @@ -3,15 +3,15 @@ JTEST_DEFINE_GROUP(filtering_tests) { - /* - To skip a test, comment it out. - */ - JTEST_GROUP_CALL(biquad_tests); - JTEST_GROUP_CALL(conv_tests); - JTEST_GROUP_CALL(correlate_tests); - JTEST_GROUP_CALL(fir_tests); - JTEST_GROUP_CALL(iir_tests); - JTEST_GROUP_CALL(lms_tests); + /* + To skip a test, comment it out. + */ + JTEST_GROUP_CALL(biquad_tests); + JTEST_GROUP_CALL(conv_tests); + JTEST_GROUP_CALL(correlate_tests); + JTEST_GROUP_CALL(fir_tests); + JTEST_GROUP_CALL(iir_tests); + JTEST_GROUP_CALL(lms_tests); - return; + return; } diff --git a/DSP/DSP_Lib_TestSuite/Common/src/main.c b/DSP/DSP_Lib_TestSuite/Common/src/main.c index 8dd4b40..a41de7d 100644 --- a/DSP/DSP_Lib_TestSuite/Common/src/main.c +++ b/DSP/DSP_Lib_TestSuite/Common/src/main.c @@ -3,8 +3,8 @@ #include "arm_math.h" -#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) -asm(" .global __ARM_use_no_argv\n"); +#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) && !defined (__MICROLIB) +__asm(" .global __ARM_use_no_argv\n"); #endif @@ -16,12 +16,16 @@ void debug_init(void) int main(void) { +#if !defined(FILEIO) debug_init(); +#endif JTEST_INIT(); /* Initialize test framework. */ JTEST_GROUP_CALL(all_tests); /* Run all tests. */ JTEST_ACT_EXIT_FW(); /* Exit test framework. */ +#if !defined(FILEIO) while (1); /* Never return. */ +#endif } diff --git a/DSP/DSP_Lib_TestSuite/Common/src/math_helper.c b/DSP/DSP_Lib_TestSuite/Common/src/math_helper.c index 35925c8..2b1d30d 100644 --- a/DSP/DSP_Lib_TestSuite/Common/src/math_helper.c +++ b/DSP/DSP_Lib_TestSuite/Common/src/math_helper.c @@ -64,7 +64,7 @@ float arm_snr_f32(float *pRef, float *pTest, uint32_t buffSize) if (temp == 0x7FC00000) { - return(0); + return(100000.0); } /* Checking for a NAN value in pTest array */ @@ -73,7 +73,7 @@ float arm_snr_f32(float *pRef, float *pTest, uint32_t buffSize) if (temp == 0x7FC00000) { - return(0); + return(100000.0); } EnergySignal += pRef[i] * pRef[i]; EnergyError += (pRef[i] - pTest[i]) * (pRef[i] - pTest[i]); @@ -85,12 +85,21 @@ float arm_snr_f32(float *pRef, float *pTest, uint32_t buffSize) if (temp == 0x7FC00000) { - return(0); + return(100000.0); } SNR = 10 * log10f (EnergySignal / EnergyError); + /* Checking for a NAN value in SNR */ + test = (int *)(&SNR); + temp = *test; + + if (temp == 0x7FC00000) + { + return(100000.0); + } + return (SNR); } @@ -113,7 +122,7 @@ double arm_snr_f64(double *pRef, double *pTest, uint32_t buffSize) if (temp == 0x7FC00000) { - return(0); + return(100000.0); } /* Checking for a NAN value in pTest array */ @@ -122,7 +131,7 @@ double arm_snr_f64(double *pRef, double *pTest, uint32_t buffSize) if (temp == 0x7FC00000) { - return(0); + return(100000.0); } EnergySignal += pRef[i] * pRef[i]; EnergyError += (pRef[i] - pTest[i]) * (pRef[i] - pTest[i]); @@ -134,12 +143,21 @@ double arm_snr_f64(double *pRef, double *pTest, uint32_t buffSize) if (temp == 0x7FC00000) { - return(0); + return(100000.0); } SNR = 10 * log10 (EnergySignal / EnergyError); + /* Checking for a NAN value in SNR */ + test = (int *)(&SNR); + temp = *test; + + if (temp == 0x7FC00000) + { + return(10000.0); + } + return (SNR); } diff --git a/DSP/DSP_Lib_TestSuite/Common/src/matrix_tests/matrix_test_common_data.c b/DSP/DSP_Lib_TestSuite/Common/src/matrix_tests/matrix_test_common_data.c index 0394892..9043a23 100644 --- a/DSP/DSP_Lib_TestSuite/Common/src/matrix_tests/matrix_test_common_data.c +++ b/DSP/DSP_Lib_TestSuite/Common/src/matrix_tests/matrix_test_common_data.c @@ -45,7 +45,10 @@ arm_matrix_instance_f64 matrix_output_ref64 = { * Pool of random data to base matrix inputs from. */ float32_t matrix_f32_100_rand[100] = { - -45.0345569674258, -11.0261163038747, -14.6841428777929, +/* -45.0345569674258, first number negativ causes fault in 1x1 multiplay with 0. + AC6 DSP_Lib calculatas a -0.0 which is not a 0.0 in memcmp! + */ + 45.0345569674258, -11.0261163038747, -14.6841428777929, 0.0345569674258, -11.0261163038747, -14.6841428777929, -20.3679194392227, 27.5712678608402, -12.1390617339732, -19.8753669720509, 42.3379642103244, -23.7788252219155, @@ -82,7 +85,8 @@ float32_t matrix_f32_100_rand[100] = { }; float64_t matrix_f64_100_rand[100] = { - -45.0345569674258, -11.0261163038747, -14.6841428777929, +// -45.0345569674258, -11.0261163038747, -14.6841428777929, + 45.0345569674258, -11.0261163038747, -14.6841428777929, 0.0345569674258, -11.0261163038747, -14.6841428777929, -20.3679194392227, 27.5712678608402, -12.1390617339732, -19.8753669720509, 42.3379642103244, -23.7788252219155, |