diff --git a/APP_Framework/Applications/benchmark/support/Makefile b/APP_Framework/Applications/benchmark/support/Makefile index 7a27a2cd5..b89bba4b8 100644 --- a/APP_Framework/Applications/benchmark/support/Makefile +++ b/APP_Framework/Applications/benchmark/support/Makefile @@ -1,5 +1,5 @@ # SRC_FILES := beebsc.c benchmark.c -SRC_FILES := $(wildcard src/*/*.c) +SRC_FILES += $(wildcard *.c) # include $(APPDIR)/Application.mk include $(KERNEL_ROOT)/compiler.mk \ No newline at end of file diff --git a/APP_Framework/Applications/benchmark/support/beebsc.h b/APP_Framework/Applications/benchmark/support/beebsc.h index 5f7dc0e09..dd21a2ae1 100644 --- a/APP_Framework/Applications/benchmark/support/beebsc.h +++ b/APP_Framework/Applications/benchmark/support/beebsc.h @@ -12,7 +12,9 @@ #ifndef BEEBSC_H #define BEEBSC_H +#include #include +#include /* BEEBS fixes RAND_MAX to its lowest permitted value, 2^15-1 */ @@ -36,10 +38,13 @@ This function just*/ +// #define assert_beebs(expr) \ +// { \ +// if (!(expr)) exit(1); \ +// } + #define assert_beebs(expr) \ - { \ - if (!(expr)) exit(1); \ - } + { assert(expr); } #define float_eq_beebs(exp, actual) (fabsf(exp - actual) < VERIFY_FLOAT_EPS) #define float_neq_beebs(exp, actual) !float_eq_beebs(exp, actual) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index 3a940bf1a..a71b0e2fd 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -4,6 +4,7 @@ #include #include #include +#include extern benchmark_handle mont64_handle; extern benchmark_handle crc32_handle; @@ -70,8 +71,8 @@ float tmp_diff = 0.0; float global_diff = 0.0; clock_t start_time = 0, end_time = 0; -void start_trigger(void) { start_time = clock(); } -void stop_trigger(void) { end_time = clock(); } +void start_trigger(void) { start_time = PrivGetTickTime(); } +void stop_trigger(void) { end_time = PrivGetTickTime(); } void init_benchmark_runset() { int i = 0; @@ -80,7 +81,7 @@ void init_benchmark_runset() { } } void organize_result(const benchmark_handle *handle) { - tmp_diff = (float)(end_time - start_time) / CLOCKS_PER_SEC; + tmp_diff = (float)(end_time - start_time) / TICK_PER_SECOND; global_diff += tmp_diff; int i = 0; while (bmh_list[i].handle != NULL) { @@ -132,11 +133,11 @@ int run_benchmark() { return (!correct); } -int embenchmark() { +static int embenchmark(void) { run_benchmark(); printf("[BENCHMARK] Global Time Diff: %f\n", global_diff); return 0; } -PRIV_SHELL_CMD_FUNCTION(embenchmark, run embenchmark, PRIV_SHELL_CMD_MAIN_ATTR); +PRIV_SHELL_CMD_FUNCTION(embenchmark, benchmark, PRIV_SHELL_CMD_MAIN_ATTR); #endif diff --git a/Ubiquitous/XiZi_IIoT/path_kernel.mk b/Ubiquitous/XiZi_IIoT/path_kernel.mk index 9d27bc84c..c1fddfd4d 100755 --- a/Ubiquitous/XiZi_IIoT/path_kernel.mk +++ b/Ubiquitous/XiZi_IIoT/path_kernel.mk @@ -497,7 +497,7 @@ endif endif -# ifeq ($(CONFIG_BENCHMARK), y) +ifeq ($(CONFIG_APP_BENCHMARK), y) KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Applications/benchmark/support KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Applications/benchmark/src/cubic \ -I$(KERNEL_ROOT)/../../APP_Framework/Applications/benchmark/src/picojpeg \ @@ -505,7 +505,7 @@ KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Applications/benchmark/src/c -I$(KERNEL_ROOT)/../../APP_Framework/Applications/benchmark/src/sglib-combined \ -I$(KERNEL_ROOT)/../../APP_Framework/Applications/benchmark/src/slre \ -lm -# endif +endif ifeq ($(CONFIG_TOOL_SHELL), y)