summaryrefslogtreecommitdiff
path: root/DSP/DSP_Lib_TestSuite/Common/JTest
diff options
context:
space:
mode:
authorrihab kouki <rihab.kouki@st.com>2020-07-28 11:24:49 +0100
committerrihab kouki <rihab.kouki@st.com>2020-07-28 11:24:49 +0100
commit96d6da4e252b06dcfdc041e7df23e86161c33007 (patch)
treea262f59bb1db7ec7819acae435f5049cbe5e2354 /DSP/DSP_Lib_TestSuite/Common/JTest
parent9f95ff5b6ba01db09552b84a0ab79607060a2666 (diff)
downloadst-cmsis-core-lowfat-master.tar.gz
st-cmsis-core-lowfat-master.tar.bz2
st-cmsis-core-lowfat-master.zip
Official ARM version: v5.6.0HEADmaster
Diffstat (limited to 'DSP/DSP_Lib_TestSuite/Common/JTest')
-rw-r--r--DSP/DSP_Lib_TestSuite/Common/JTest/inc/jtest_cycle.h16
-rw-r--r--DSP/DSP_Lib_TestSuite/Common/JTest/inc/jtest_fw.h29
-rw-r--r--DSP/DSP_Lib_TestSuite/Common/JTest/inc/jtest_systick.h25
-rw-r--r--DSP/DSP_Lib_TestSuite/Common/JTest/jtest_FVP.ini2
-rw-r--r--DSP/DSP_Lib_TestSuite/Common/JTest/jtest_Simulator.ini6
-rw-r--r--DSP/DSP_Lib_TestSuite/Common/JTest/jtest_Simulator.ini.withCoverage32
6 files changed, 93 insertions, 17 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 */