From 07b1f5da5b98a689c4510ae165a2995ed299af20 Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 14:47:41 +0800 Subject: [PATCH 01/70] add benchmark to app. TODO: test benchmark. --- APP_Framework/Applications/benchmark/support/benchmark.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index 4046370b0..3a940bf1a 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -132,10 +132,11 @@ int run_benchmark() { return (!correct); } -int main() { +int embenchmark() { 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); #endif From fbc7d384f078cda0d5e8aebddc2666956289b2ac Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 15:39:54 +0800 Subject: [PATCH 02/70] add benchmark to app. TODO: test benchmark. --- APP_Framework/Applications/benchmark/support/Makefile | 2 +- APP_Framework/Applications/benchmark/support/beebsc.h | 11 ++++++++--- .../Applications/benchmark/support/benchmark.c | 11 ++++++----- Ubiquitous/XiZi_IIoT/path_kernel.mk | 4 ++-- 4 files changed, 17 insertions(+), 11 deletions(-) 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) From 4f0c2d23d5647140bb377c557eda3ca04489d32c Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 15:44:38 +0800 Subject: [PATCH 03/70] add benchmark to app. TODO: test benchmark. --- APP_Framework/Applications/benchmark/support/support.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/APP_Framework/Applications/benchmark/support/support.h b/APP_Framework/Applications/benchmark/support/support.h index ea7530dbd..ea7a8fa4d 100644 --- a/APP_Framework/Applications/benchmark/support/support.h +++ b/APP_Framework/Applications/benchmark/support/support.h @@ -28,7 +28,7 @@ #include #include -#define CPU_MHZ 1000 +#define CPU_MHZ 1 /* Benchmarks must implement verify_benchmark, which must return -1 if no verification is done. */ From 260be1073f22813ee00cbcb42f4b7c24376c0ff7 Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 15:48:54 +0800 Subject: [PATCH 04/70] add benchmark to app. TODO: test benchmark. --- APP_Framework/Applications/benchmark/support/benchmark.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index a71b0e2fd..d908d31ee 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -87,6 +87,7 @@ void organize_result(const benchmark_handle *handle) { while (bmh_list[i].handle != NULL) { if (bmh_list[i].handle == handle) { bmh_list[i].time = tmp_diff; + printf("[BENCHMARK] TaskName: %s\n", bmh_list[i].name); break; } i++; @@ -108,6 +109,7 @@ int run_benchmark() { int correct; init_benchmark_runset(); + printf("[BENCHMARK] Start Benchmark running.\n"); benchmark_handle *cur_handle = get_benchmark_list()->next; while (NULL != cur_handle) { From d4cd8889bc537789d2a2d00b0d86f0906d5b3880 Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 15:52:18 +0800 Subject: [PATCH 05/70] add benchmark to app. TODO: test benchmark. --- .../benchmark/support/benchmark.c | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index d908d31ee..47336e771 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -36,29 +36,29 @@ typedef struct BenchmarkPair { } BenchmarkPair; BenchmarkPair bmh_list[] = { - {.handle = &mont64_handle, .name = "mont", .time = 0}, // - {.handle = &crc32_handle, .name = "crc32", .time = 0}, // - {.handle = &md5_handle, .name = "md5sum", .time = 0}, // - {.handle = &cubic_handle, .name = "cubic", .time = 0}, // - {.handle = &edn_handle, .name = "edn", .time = 0}, // - {.handle = &huffbench_handle, .name = "huffbench", .time = 0}, // - {.handle = &matmult_int_handle, .name = "matmult-int", .time = 0}, // - {.handle = &libminver_handle, .name = "libminver", .time = 0}, // - {.handle = &nobody_handle, .name = "nobody", .time = 0}, // - {.handle = &nettle_aes_handle, .name = "nettle-aes", .time = 0}, // - {.handle = &nettle_sha256_handle, .name = "nettle-sha256", .time = 0}, // - {.handle = &libnsichneu_handle, .name = "libnsichneu", .time = 0}, // - {.handle = &picojpeg_handle, .name = "picojpeg", .time = 0}, // - {.handle = &primecount_handle, .name = "primecount", .time = 0}, // - {.handle = &qrtest_handle, .name = "qrtest", .time = 0}, // - {.handle = &combined_handle, .name = "combined", .time = 0}, // - {.handle = &slre_handle, .name = "slre", .time = 0}, // - {.handle = &libst_handle, .name = "libst", .time = 0}, // - {.handle = &statemate_handle, .name = "statemate", .time = 0}, // - {.handle = &tarfind_handle, .name = "tarfind", .time = 0}, // - {.handle = &libud_handle, .name = "libud", .time = 0}, // - {.handle = &libwikisort_handle, .name = "libwikisort", .time = 0}, // - {.handle = NULL, .name = "", .time = 0}, // + {.handle = &mont64_handle, .name = "mont", .time = 0}, // + // {.handle = &crc32_handle, .name = "crc32", .time = 0}, // + // {.handle = &md5_handle, .name = "md5sum", .time = 0}, // + // {.handle = &cubic_handle, .name = "cubic", .time = 0}, // + // {.handle = &edn_handle, .name = "edn", .time = 0}, // + // {.handle = &huffbench_handle, .name = "huffbench", .time = 0}, // + // {.handle = &matmult_int_handle, .name = "matmult-int", .time = 0}, // + // {.handle = &libminver_handle, .name = "libminver", .time = 0}, // + // {.handle = &nobody_handle, .name = "nobody", .time = 0}, // + // {.handle = &nettle_aes_handle, .name = "nettle-aes", .time = 0}, // + // {.handle = &nettle_sha256_handle, .name = "nettle-sha256", .time = 0}, // + // {.handle = &libnsichneu_handle, .name = "libnsichneu", .time = 0}, // + // {.handle = &picojpeg_handle, .name = "picojpeg", .time = 0}, // + // {.handle = &primecount_handle, .name = "primecount", .time = 0}, // + // {.handle = &qrtest_handle, .name = "qrtest", .time = 0}, // + // {.handle = &combined_handle, .name = "combined", .time = 0}, // + // {.handle = &slre_handle, .name = "slre", .time = 0}, // + // {.handle = &libst_handle, .name = "libst", .time = 0}, // + // {.handle = &statemate_handle, .name = "statemate", .time = 0}, // + // {.handle = &tarfind_handle, .name = "tarfind", .time = 0}, // + // {.handle = &libud_handle, .name = "libud", .time = 0}, // + // {.handle = &libwikisort_handle, .name = "libwikisort", .time = 0}, // + {.handle = NULL, .name = "", .time = 0}, // }; float benchmark_time[25]; From b9d39e53fe764e321fc450eb9f4225948701107e Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 15:53:45 +0800 Subject: [PATCH 06/70] add benchmark to app. TODO: test benchmark. --- APP_Framework/Applications/benchmark/support/benchmark.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index 47336e771..b255ad02b 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -37,7 +37,7 @@ typedef struct BenchmarkPair { BenchmarkPair bmh_list[] = { {.handle = &mont64_handle, .name = "mont", .time = 0}, // - // {.handle = &crc32_handle, .name = "crc32", .time = 0}, // + {.handle = &crc32_handle, .name = "crc32", .time = 0}, // // {.handle = &md5_handle, .name = "md5sum", .time = 0}, // // {.handle = &cubic_handle, .name = "cubic", .time = 0}, // // {.handle = &edn_handle, .name = "edn", .time = 0}, // From f04afd26ef64e56ade2734bbb9a50dbab2c6a245 Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 15:56:10 +0800 Subject: [PATCH 07/70] add benchmark to app. TODO: test benchmark. --- APP_Framework/Applications/benchmark/support/benchmark.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index b255ad02b..1e641363c 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -38,9 +38,9 @@ typedef struct BenchmarkPair { BenchmarkPair bmh_list[] = { {.handle = &mont64_handle, .name = "mont", .time = 0}, // {.handle = &crc32_handle, .name = "crc32", .time = 0}, // - // {.handle = &md5_handle, .name = "md5sum", .time = 0}, // - // {.handle = &cubic_handle, .name = "cubic", .time = 0}, // - // {.handle = &edn_handle, .name = "edn", .time = 0}, // + {.handle = &md5_handle, .name = "md5sum", .time = 0}, // + {.handle = &cubic_handle, .name = "cubic", .time = 0}, // + {.handle = &edn_handle, .name = "edn", .time = 0}, // // {.handle = &huffbench_handle, .name = "huffbench", .time = 0}, // // {.handle = &matmult_int_handle, .name = "matmult-int", .time = 0}, // // {.handle = &libminver_handle, .name = "libminver", .time = 0}, // From e31992a58f2b6d527e903d8be0ed28e971231e8d Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 15:56:44 +0800 Subject: [PATCH 08/70] add benchmark to app. TODO: test benchmark. --- APP_Framework/Applications/benchmark/support/benchmark.c | 1 - 1 file changed, 1 deletion(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index 1e641363c..8bbf969ce 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -87,7 +87,6 @@ void organize_result(const benchmark_handle *handle) { while (bmh_list[i].handle != NULL) { if (bmh_list[i].handle == handle) { bmh_list[i].time = tmp_diff; - printf("[BENCHMARK] TaskName: %s\n", bmh_list[i].name); break; } i++; From 9c6ac61f9009e662ccf0830bc922ec0e9a24e881 Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 15:59:28 +0800 Subject: [PATCH 09/70] add benchmark to app. TODO: test benchmark. --- .../Applications/benchmark/support/benchmark.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index 8bbf969ce..0e534a5ab 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -38,14 +38,14 @@ typedef struct BenchmarkPair { BenchmarkPair bmh_list[] = { {.handle = &mont64_handle, .name = "mont", .time = 0}, // {.handle = &crc32_handle, .name = "crc32", .time = 0}, // - {.handle = &md5_handle, .name = "md5sum", .time = 0}, // - {.handle = &cubic_handle, .name = "cubic", .time = 0}, // - {.handle = &edn_handle, .name = "edn", .time = 0}, // - // {.handle = &huffbench_handle, .name = "huffbench", .time = 0}, // - // {.handle = &matmult_int_handle, .name = "matmult-int", .time = 0}, // - // {.handle = &libminver_handle, .name = "libminver", .time = 0}, // - // {.handle = &nobody_handle, .name = "nobody", .time = 0}, // - // {.handle = &nettle_aes_handle, .name = "nettle-aes", .time = 0}, // + // {.handle = &md5_handle, .name = "md5sum", .time = 0}, // + {.handle = &cubic_handle, .name = "cubic", .time = 0}, // + {.handle = &edn_handle, .name = "edn", .time = 0}, // + {.handle = &huffbench_handle, .name = "huffbench", .time = 0}, // + {.handle = &matmult_int_handle, .name = "matmult-int", .time = 0}, // + {.handle = &libminver_handle, .name = "libminver", .time = 0}, // + {.handle = &nobody_handle, .name = "nobody", .time = 0}, // + {.handle = &nettle_aes_handle, .name = "nettle-aes", .time = 0}, // // {.handle = &nettle_sha256_handle, .name = "nettle-sha256", .time = 0}, // // {.handle = &libnsichneu_handle, .name = "libnsichneu", .time = 0}, // // {.handle = &picojpeg_handle, .name = "picojpeg", .time = 0}, // From 2293694b05343d9a7ee70d2e0524cbac5b93dd74 Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 16:01:03 +0800 Subject: [PATCH 10/70] add benchmark to app. TODO: test benchmark. --- .../Applications/benchmark/support/benchmark.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index 0e534a5ab..f84d2c23f 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -39,13 +39,13 @@ BenchmarkPair bmh_list[] = { {.handle = &mont64_handle, .name = "mont", .time = 0}, // {.handle = &crc32_handle, .name = "crc32", .time = 0}, // // {.handle = &md5_handle, .name = "md5sum", .time = 0}, // - {.handle = &cubic_handle, .name = "cubic", .time = 0}, // - {.handle = &edn_handle, .name = "edn", .time = 0}, // - {.handle = &huffbench_handle, .name = "huffbench", .time = 0}, // - {.handle = &matmult_int_handle, .name = "matmult-int", .time = 0}, // - {.handle = &libminver_handle, .name = "libminver", .time = 0}, // - {.handle = &nobody_handle, .name = "nobody", .time = 0}, // - {.handle = &nettle_aes_handle, .name = "nettle-aes", .time = 0}, // + {.handle = &cubic_handle, .name = "cubic", .time = 0}, // + {.handle = &edn_handle, .name = "edn", .time = 0}, // + {.handle = &huffbench_handle, .name = "huffbench", .time = 0}, // + // {.handle = &matmult_int_handle, .name = "matmult-int", .time = 0}, // + // {.handle = &libminver_handle, .name = "libminver", .time = 0}, // + // {.handle = &nobody_handle, .name = "nobody", .time = 0}, // + // {.handle = &nettle_aes_handle, .name = "nettle-aes", .time = 0}, // // {.handle = &nettle_sha256_handle, .name = "nettle-sha256", .time = 0}, // // {.handle = &libnsichneu_handle, .name = "libnsichneu", .time = 0}, // // {.handle = &picojpeg_handle, .name = "picojpeg", .time = 0}, // From 4b8c9dc8ad3f56884f6fd8bf2cee2282f801c6d2 Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 16:03:09 +0800 Subject: [PATCH 11/70] add benchmark to app. TODO: test benchmark. --- APP_Framework/Applications/benchmark/support/benchmark.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index f84d2c23f..21284a373 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -38,10 +38,10 @@ typedef struct BenchmarkPair { BenchmarkPair bmh_list[] = { {.handle = &mont64_handle, .name = "mont", .time = 0}, // {.handle = &crc32_handle, .name = "crc32", .time = 0}, // - // {.handle = &md5_handle, .name = "md5sum", .time = 0}, // - {.handle = &cubic_handle, .name = "cubic", .time = 0}, // - {.handle = &edn_handle, .name = "edn", .time = 0}, // - {.handle = &huffbench_handle, .name = "huffbench", .time = 0}, // + {.handle = &md5_handle, .name = "md5sum", .time = 0}, // + {.handle = &cubic_handle, .name = "cubic", .time = 0}, // + // {.handle = &edn_handle, .name = "edn", .time = 0}, // + // {.handle = &huffbench_handle, .name = "huffbench", .time = 0}, // // {.handle = &matmult_int_handle, .name = "matmult-int", .time = 0}, // // {.handle = &libminver_handle, .name = "libminver", .time = 0}, // // {.handle = &nobody_handle, .name = "nobody", .time = 0}, // From bd46910209c354cfc1fb8da87da9f08fa8b4958b Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 16:06:11 +0800 Subject: [PATCH 12/70] add benchmark to app. TODO: test benchmark. --- APP_Framework/Applications/benchmark/support/benchmark.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index 21284a373..136e4437f 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -38,9 +38,9 @@ typedef struct BenchmarkPair { BenchmarkPair bmh_list[] = { {.handle = &mont64_handle, .name = "mont", .time = 0}, // {.handle = &crc32_handle, .name = "crc32", .time = 0}, // - {.handle = &md5_handle, .name = "md5sum", .time = 0}, // + // {.handle = &md5_handle, .name = "md5sum", .time = 0}, // {.handle = &cubic_handle, .name = "cubic", .time = 0}, // - // {.handle = &edn_handle, .name = "edn", .time = 0}, // + {.handle = &edn_handle, .name = "edn", .time = 0}, // // {.handle = &huffbench_handle, .name = "huffbench", .time = 0}, // // {.handle = &matmult_int_handle, .name = "matmult-int", .time = 0}, // // {.handle = &libminver_handle, .name = "libminver", .time = 0}, // From 49a9c808960bf583ddd1137d386d3b8f8587ae86 Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 16:08:05 +0800 Subject: [PATCH 13/70] add benchmark to app. TODO: test benchmark. --- APP_Framework/Applications/benchmark/support/benchmark.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index 136e4437f..f84d2c23f 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -39,9 +39,9 @@ BenchmarkPair bmh_list[] = { {.handle = &mont64_handle, .name = "mont", .time = 0}, // {.handle = &crc32_handle, .name = "crc32", .time = 0}, // // {.handle = &md5_handle, .name = "md5sum", .time = 0}, // - {.handle = &cubic_handle, .name = "cubic", .time = 0}, // - {.handle = &edn_handle, .name = "edn", .time = 0}, // - // {.handle = &huffbench_handle, .name = "huffbench", .time = 0}, // + {.handle = &cubic_handle, .name = "cubic", .time = 0}, // + {.handle = &edn_handle, .name = "edn", .time = 0}, // + {.handle = &huffbench_handle, .name = "huffbench", .time = 0}, // // {.handle = &matmult_int_handle, .name = "matmult-int", .time = 0}, // // {.handle = &libminver_handle, .name = "libminver", .time = 0}, // // {.handle = &nobody_handle, .name = "nobody", .time = 0}, // From 4783f3019b50584fd6093a72cae3a934df06b1ac Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 16:09:45 +0800 Subject: [PATCH 14/70] add benchmark to app. TODO: test benchmark. --- .../Applications/benchmark/support/benchmark.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index f84d2c23f..cc170991e 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -39,12 +39,12 @@ BenchmarkPair bmh_list[] = { {.handle = &mont64_handle, .name = "mont", .time = 0}, // {.handle = &crc32_handle, .name = "crc32", .time = 0}, // // {.handle = &md5_handle, .name = "md5sum", .time = 0}, // - {.handle = &cubic_handle, .name = "cubic", .time = 0}, // - {.handle = &edn_handle, .name = "edn", .time = 0}, // - {.handle = &huffbench_handle, .name = "huffbench", .time = 0}, // - // {.handle = &matmult_int_handle, .name = "matmult-int", .time = 0}, // - // {.handle = &libminver_handle, .name = "libminver", .time = 0}, // - // {.handle = &nobody_handle, .name = "nobody", .time = 0}, // + {.handle = &cubic_handle, .name = "cubic", .time = 0}, // + {.handle = &edn_handle, .name = "edn", .time = 0}, // + // {.handle = &huffbench_handle, .name = "huffbench", .time = 0}, // + {.handle = &matmult_int_handle, .name = "matmult-int", .time = 0}, // + {.handle = &libminver_handle, .name = "libminver", .time = 0}, // + {.handle = &nobody_handle, .name = "nobody", .time = 0}, // // {.handle = &nettle_aes_handle, .name = "nettle-aes", .time = 0}, // // {.handle = &nettle_sha256_handle, .name = "nettle-sha256", .time = 0}, // // {.handle = &libnsichneu_handle, .name = "libnsichneu", .time = 0}, // From 2c81284bedebfcc9e9999612259d26a06d17c446 Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 16:10:49 +0800 Subject: [PATCH 15/70] add benchmark to app. TODO: test benchmark. --- APP_Framework/Applications/benchmark/support/beebsc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/APP_Framework/Applications/benchmark/support/beebsc.h b/APP_Framework/Applications/benchmark/support/beebsc.h index dd21a2ae1..7ac8c7b4b 100644 --- a/APP_Framework/Applications/benchmark/support/beebsc.h +++ b/APP_Framework/Applications/benchmark/support/beebsc.h @@ -20,8 +20,8 @@ #ifdef RAND_MAX #undef RAND_MAX -#define RAND_MAX ((1U << 15) - 1) #endif +#define RAND_MAX ((1U << 15) - 1) /* Common understanding of a "small value" (epsilon) for floating point comparisons. */ From eee22c91ce871b057b49fd3d40d0ee3c0c2e5f2b Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 16:12:49 +0800 Subject: [PATCH 16/70] add benchmark to app. TODO: test benchmark. --- .../benchmark/support/benchmark.c | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index cc170991e..b430574d9 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -42,17 +42,17 @@ BenchmarkPair bmh_list[] = { {.handle = &cubic_handle, .name = "cubic", .time = 0}, // {.handle = &edn_handle, .name = "edn", .time = 0}, // // {.handle = &huffbench_handle, .name = "huffbench", .time = 0}, // - {.handle = &matmult_int_handle, .name = "matmult-int", .time = 0}, // - {.handle = &libminver_handle, .name = "libminver", .time = 0}, // - {.handle = &nobody_handle, .name = "nobody", .time = 0}, // - // {.handle = &nettle_aes_handle, .name = "nettle-aes", .time = 0}, // - // {.handle = &nettle_sha256_handle, .name = "nettle-sha256", .time = 0}, // - // {.handle = &libnsichneu_handle, .name = "libnsichneu", .time = 0}, // - // {.handle = &picojpeg_handle, .name = "picojpeg", .time = 0}, // - // {.handle = &primecount_handle, .name = "primecount", .time = 0}, // - // {.handle = &qrtest_handle, .name = "qrtest", .time = 0}, // - // {.handle = &combined_handle, .name = "combined", .time = 0}, // - // {.handle = &slre_handle, .name = "slre", .time = 0}, // + {.handle = &matmult_int_handle, .name = "matmult-int", .time = 0}, // + {.handle = &libminver_handle, .name = "libminver", .time = 0}, // + {.handle = &nobody_handle, .name = "nbody", .time = 0}, // + {.handle = &nettle_aes_handle, .name = "nettle-aes", .time = 0}, // + {.handle = &nettle_sha256_handle, .name = "nettle-sha256", .time = 0}, // + {.handle = &libnsichneu_handle, .name = "libnsichneu", .time = 0}, // + {.handle = &picojpeg_handle, .name = "picojpeg", .time = 0}, // + {.handle = &primecount_handle, .name = "primecount", .time = 0}, // + {.handle = &qrtest_handle, .name = "qrtest", .time = 0}, // + {.handle = &combined_handle, .name = "combined", .time = 0}, // + {.handle = &slre_handle, .name = "slre", .time = 0}, // // {.handle = &libst_handle, .name = "libst", .time = 0}, // // {.handle = &statemate_handle, .name = "statemate", .time = 0}, // // {.handle = &tarfind_handle, .name = "tarfind", .time = 0}, // From 88f42626a37c6e94388b931eda31df35408ac725 Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 16:21:19 +0800 Subject: [PATCH 17/70] add benchmark to app. TODO: test benchmark. --- .../Applications/benchmark/support/benchmark.c | 14 +++++++++----- .../Applications/benchmark/support/support.h | 6 +++--- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index b430574d9..020178ea6 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -64,7 +64,7 @@ BenchmarkPair bmh_list[] = { float benchmark_time[25]; extern benchmark_handle *get_benchmark_list(); -extern void add_benchmark_handle(benchmark_handle *); +extern void add_benchmark_handle(benchmark_handle *head, benchmark_handle *); int store_idx = 0; float tmp_diff = 0.0; @@ -74,10 +74,10 @@ clock_t start_time = 0, end_time = 0; void start_trigger(void) { start_time = PrivGetTickTime(); } void stop_trigger(void) { end_time = PrivGetTickTime(); } -void init_benchmark_runset() { +void init_benchmark_runset(benchmark_handle *head) { int i = 0; while (bmh_list[i].handle != NULL) { - add_benchmark_handle(bmh_list[i++].handle); + add_benchmark_handle(head, bmh_list[i++].handle); } } void organize_result(const benchmark_handle *handle) { @@ -107,10 +107,14 @@ int run_benchmark() { volatile int result; int correct; - init_benchmark_runset(); + benchmark_handle head = { + .handle.magic_number = MAGIC_NUMBER, + .next = NULL, + }; + init_benchmark_runset(&head); printf("[BENCHMARK] Start Benchmark running.\n"); - benchmark_handle *cur_handle = get_benchmark_list()->next; + benchmark_handle *cur_handle = head.next; while (NULL != cur_handle) { assert(cur_handle->handle.magic_number != MAGIC_NUMBER); cur_handle->handle.benchmark_func->initialise_benchmark(); diff --git a/APP_Framework/Applications/benchmark/support/support.h b/APP_Framework/Applications/benchmark/support/support.h index ea7a8fa4d..ccc3f24c9 100644 --- a/APP_Framework/Applications/benchmark/support/support.h +++ b/APP_Framework/Applications/benchmark/support/support.h @@ -90,7 +90,7 @@ static benchmark_handle *get_benchmark_list() { return &head; } -static void add_benchmark_handle(benchmark_handle *bh) { +static void add_benchmark_handle(benchmark_handle *head, benchmark_handle *bh) { if (NULL == bh) { return; } @@ -102,8 +102,8 @@ static void add_benchmark_handle(benchmark_handle *bh) { NULL == bh->handle.benchmark_func->verify_benchmark) { return; } - bh->next = get_benchmark_list()->next; - get_benchmark_list()->next = bh; + bh->next = head->next; + head->next = bh; } /* Local simplified versions of library functions */ From e3e27d9de91ffde0cfbda1bb92b20eadac391062 Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 16:24:00 +0800 Subject: [PATCH 18/70] add benchmark to app. TODO: test benchmark. --- .../Applications/benchmark/support/benchmark.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index 020178ea6..e3aedd677 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -47,12 +47,12 @@ BenchmarkPair bmh_list[] = { {.handle = &nobody_handle, .name = "nbody", .time = 0}, // {.handle = &nettle_aes_handle, .name = "nettle-aes", .time = 0}, // {.handle = &nettle_sha256_handle, .name = "nettle-sha256", .time = 0}, // - {.handle = &libnsichneu_handle, .name = "libnsichneu", .time = 0}, // - {.handle = &picojpeg_handle, .name = "picojpeg", .time = 0}, // - {.handle = &primecount_handle, .name = "primecount", .time = 0}, // - {.handle = &qrtest_handle, .name = "qrtest", .time = 0}, // - {.handle = &combined_handle, .name = "combined", .time = 0}, // - {.handle = &slre_handle, .name = "slre", .time = 0}, // + // {.handle = &libnsichneu_handle, .name = "libnsichneu", .time = 0}, // + // {.handle = &picojpeg_handle, .name = "picojpeg", .time = 0}, // + // {.handle = &primecount_handle, .name = "primecount", .time = 0}, // + // {.handle = &qrtest_handle, .name = "qrtest", .time = 0}, // + // {.handle = &combined_handle, .name = "combined", .time = 0}, // + // {.handle = &slre_handle, .name = "slre", .time = 0}, // // {.handle = &libst_handle, .name = "libst", .time = 0}, // // {.handle = &statemate_handle, .name = "statemate", .time = 0}, // // {.handle = &tarfind_handle, .name = "tarfind", .time = 0}, // From fed230457864dbdda22770b51eec398e189b1fdf Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 16:27:33 +0800 Subject: [PATCH 19/70] add benchmark to app. TODO: test benchmark. --- .../Applications/benchmark/support/benchmark.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index e3aedd677..0ec253f20 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -52,13 +52,13 @@ BenchmarkPair bmh_list[] = { // {.handle = &primecount_handle, .name = "primecount", .time = 0}, // // {.handle = &qrtest_handle, .name = "qrtest", .time = 0}, // // {.handle = &combined_handle, .name = "combined", .time = 0}, // - // {.handle = &slre_handle, .name = "slre", .time = 0}, // - // {.handle = &libst_handle, .name = "libst", .time = 0}, // - // {.handle = &statemate_handle, .name = "statemate", .time = 0}, // - // {.handle = &tarfind_handle, .name = "tarfind", .time = 0}, // - // {.handle = &libud_handle, .name = "libud", .time = 0}, // - // {.handle = &libwikisort_handle, .name = "libwikisort", .time = 0}, // - {.handle = NULL, .name = "", .time = 0}, // + {.handle = &slre_handle, .name = "slre", .time = 0}, // + {.handle = &libst_handle, .name = "libst", .time = 0}, // + {.handle = &statemate_handle, .name = "statemate", .time = 0}, // + {.handle = &tarfind_handle, .name = "tarfind", .time = 0}, // + {.handle = &libud_handle, .name = "libud", .time = 0}, // + {.handle = &libwikisort_handle, .name = "libwikisort", .time = 0}, // + {.handle = NULL, .name = "", .time = 0}, // }; float benchmark_time[25]; @@ -66,7 +66,6 @@ float benchmark_time[25]; extern benchmark_handle *get_benchmark_list(); extern void add_benchmark_handle(benchmark_handle *head, benchmark_handle *); -int store_idx = 0; float tmp_diff = 0.0; float global_diff = 0.0; @@ -79,6 +78,7 @@ void init_benchmark_runset(benchmark_handle *head) { while (bmh_list[i].handle != NULL) { add_benchmark_handle(head, bmh_list[i++].handle); } + global_diff = 0; } void organize_result(const benchmark_handle *handle) { tmp_diff = (float)(end_time - start_time) / TICK_PER_SECOND; From 8e634991f7e92e395a6b615e9825602ef132c36d Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 16:32:43 +0800 Subject: [PATCH 20/70] add benchmark to app. TODO: test benchmark. --- .../benchmark/support/benchmark.c | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index 0ec253f20..bbf9d48fc 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -39,9 +39,9 @@ BenchmarkPair bmh_list[] = { {.handle = &mont64_handle, .name = "mont", .time = 0}, // {.handle = &crc32_handle, .name = "crc32", .time = 0}, // // {.handle = &md5_handle, .name = "md5sum", .time = 0}, // - {.handle = &cubic_handle, .name = "cubic", .time = 0}, // - {.handle = &edn_handle, .name = "edn", .time = 0}, // - // {.handle = &huffbench_handle, .name = "huffbench", .time = 0}, // + {.handle = &cubic_handle, .name = "cubic", .time = 0}, // + {.handle = &edn_handle, .name = "edn", .time = 0}, // + {.handle = &huffbench_handle, .name = "huffbench", .time = 0}, // {.handle = &matmult_int_handle, .name = "matmult-int", .time = 0}, // {.handle = &libminver_handle, .name = "libminver", .time = 0}, // {.handle = &nobody_handle, .name = "nbody", .time = 0}, // @@ -52,13 +52,13 @@ BenchmarkPair bmh_list[] = { // {.handle = &primecount_handle, .name = "primecount", .time = 0}, // // {.handle = &qrtest_handle, .name = "qrtest", .time = 0}, // // {.handle = &combined_handle, .name = "combined", .time = 0}, // - {.handle = &slre_handle, .name = "slre", .time = 0}, // - {.handle = &libst_handle, .name = "libst", .time = 0}, // - {.handle = &statemate_handle, .name = "statemate", .time = 0}, // - {.handle = &tarfind_handle, .name = "tarfind", .time = 0}, // - {.handle = &libud_handle, .name = "libud", .time = 0}, // - {.handle = &libwikisort_handle, .name = "libwikisort", .time = 0}, // - {.handle = NULL, .name = "", .time = 0}, // + {.handle = &slre_handle, .name = "slre", .time = 0}, // + // {.handle = &libst_handle, .name = "libst", .time = 0}, // + // {.handle = &statemate_handle, .name = "statemate", .time = 0}, // + // {.handle = &tarfind_handle, .name = "tarfind", .time = 0}, // + // {.handle = &libud_handle, .name = "libud", .time = 0}, // + // {.handle = &libwikisort_handle, .name = "libwikisort", .time = 0}, // + {.handle = NULL, .name = "", .time = 0}, // }; float benchmark_time[25]; @@ -88,6 +88,8 @@ void organize_result(const benchmark_handle *handle) { if (bmh_list[i].handle == handle) { bmh_list[i].time = tmp_diff; break; + printf("[BENCHMARK] Time Cost: %-15s %.4f\n", bmh_list[i].name, + bmh_list[i].time); } i++; } @@ -134,7 +136,7 @@ int run_benchmark() { cur_handle = cur_handle->next; } - print_result(); + // print_result(); return (!correct); } From 3fd8bacbf367c2f2b9154609eeb56b208599f3d1 Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 16:35:12 +0800 Subject: [PATCH 21/70] add benchmark to app. TODO: test benchmark. --- APP_Framework/Applications/benchmark/support/benchmark.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index bbf9d48fc..ac98e0962 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -39,9 +39,9 @@ BenchmarkPair bmh_list[] = { {.handle = &mont64_handle, .name = "mont", .time = 0}, // {.handle = &crc32_handle, .name = "crc32", .time = 0}, // // {.handle = &md5_handle, .name = "md5sum", .time = 0}, // - {.handle = &cubic_handle, .name = "cubic", .time = 0}, // - {.handle = &edn_handle, .name = "edn", .time = 0}, // - {.handle = &huffbench_handle, .name = "huffbench", .time = 0}, // + {.handle = &cubic_handle, .name = "cubic", .time = 0}, // + {.handle = &edn_handle, .name = "edn", .time = 0}, // + // {.handle = &huffbench_handle, .name = "huffbench", .time = 0}, // {.handle = &matmult_int_handle, .name = "matmult-int", .time = 0}, // {.handle = &libminver_handle, .name = "libminver", .time = 0}, // {.handle = &nobody_handle, .name = "nbody", .time = 0}, // From d41727dd195263d9448ec031c2e4718bdc99e6cb Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 16:35:50 +0800 Subject: [PATCH 22/70] add benchmark to app. TODO: test benchmark. --- APP_Framework/Applications/benchmark/support/benchmark.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index ac98e0962..00942867b 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -87,9 +87,9 @@ void organize_result(const benchmark_handle *handle) { while (bmh_list[i].handle != NULL) { if (bmh_list[i].handle == handle) { bmh_list[i].time = tmp_diff; - break; printf("[BENCHMARK] Time Cost: %-15s %.4f\n", bmh_list[i].name, bmh_list[i].time); + break; } i++; } From eaec4ad6a64326167c6581e67b0acc3d21b6e1f3 Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 16:37:27 +0800 Subject: [PATCH 23/70] add benchmark to app. TODO: test benchmark. --- APP_Framework/Applications/benchmark/support/benchmark.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index 00942867b..932406ac2 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -52,7 +52,7 @@ BenchmarkPair bmh_list[] = { // {.handle = &primecount_handle, .name = "primecount", .time = 0}, // // {.handle = &qrtest_handle, .name = "qrtest", .time = 0}, // // {.handle = &combined_handle, .name = "combined", .time = 0}, // - {.handle = &slre_handle, .name = "slre", .time = 0}, // + // {.handle = &slre_handle, .name = "slre", .time = 0}, // // {.handle = &libst_handle, .name = "libst", .time = 0}, // // {.handle = &statemate_handle, .name = "statemate", .time = 0}, // // {.handle = &tarfind_handle, .name = "tarfind", .time = 0}, // From d4a82bb399d285e1247ba9f028821b91431e2d4c Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 16:37:43 +0800 Subject: [PATCH 24/70] add benchmark to app. TODO: test benchmark. --- .../Applications/benchmark/support/benchmark.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index 932406ac2..90411e232 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -36,12 +36,12 @@ typedef struct BenchmarkPair { } BenchmarkPair; BenchmarkPair bmh_list[] = { - {.handle = &mont64_handle, .name = "mont", .time = 0}, // - {.handle = &crc32_handle, .name = "crc32", .time = 0}, // - // {.handle = &md5_handle, .name = "md5sum", .time = 0}, // - {.handle = &cubic_handle, .name = "cubic", .time = 0}, // - {.handle = &edn_handle, .name = "edn", .time = 0}, // - // {.handle = &huffbench_handle, .name = "huffbench", .time = 0}, // + {.handle = &mont64_handle, .name = "mont", .time = 0}, // + {.handle = &crc32_handle, .name = "crc32", .time = 0}, // + {.handle = &md5_handle, .name = "md5sum", .time = 0}, // + {.handle = &cubic_handle, .name = "cubic", .time = 0}, // + {.handle = &edn_handle, .name = "edn", .time = 0}, // + {.handle = &huffbench_handle, .name = "huffbench", .time = 0}, // {.handle = &matmult_int_handle, .name = "matmult-int", .time = 0}, // {.handle = &libminver_handle, .name = "libminver", .time = 0}, // {.handle = &nobody_handle, .name = "nbody", .time = 0}, // From 3db9b5f59003be90ac05bcceabfbcdcf1180e1ba Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 16:39:38 +0800 Subject: [PATCH 25/70] add benchmark to app. TODO: test benchmark. --- .../Applications/benchmark/support/benchmark.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index 90411e232..3fbcaf0b5 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -36,12 +36,12 @@ typedef struct BenchmarkPair { } BenchmarkPair; BenchmarkPair bmh_list[] = { - {.handle = &mont64_handle, .name = "mont", .time = 0}, // - {.handle = &crc32_handle, .name = "crc32", .time = 0}, // - {.handle = &md5_handle, .name = "md5sum", .time = 0}, // - {.handle = &cubic_handle, .name = "cubic", .time = 0}, // - {.handle = &edn_handle, .name = "edn", .time = 0}, // - {.handle = &huffbench_handle, .name = "huffbench", .time = 0}, // + {.handle = &mont64_handle, .name = "mont", .time = 0}, // + {.handle = &crc32_handle, .name = "crc32", .time = 0}, // + {.handle = &md5_handle, .name = "md5sum", .time = 0}, // + {.handle = &cubic_handle, .name = "cubic", .time = 0}, // + {.handle = &edn_handle, .name = "edn", .time = 0}, // + // {.handle = &huffbench_handle, .name = "huffbench", .time = 0}, // {.handle = &matmult_int_handle, .name = "matmult-int", .time = 0}, // {.handle = &libminver_handle, .name = "libminver", .time = 0}, // {.handle = &nobody_handle, .name = "nbody", .time = 0}, // From e5d38b05e133317e0a1861d64b57d3fde4de7b7a Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 16:41:37 +0800 Subject: [PATCH 26/70] add benchmark to app. TODO: test benchmark. --- APP_Framework/Applications/benchmark/support/benchmark.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index 3fbcaf0b5..9375932d6 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -47,9 +47,9 @@ BenchmarkPair bmh_list[] = { {.handle = &nobody_handle, .name = "nbody", .time = 0}, // {.handle = &nettle_aes_handle, .name = "nettle-aes", .time = 0}, // {.handle = &nettle_sha256_handle, .name = "nettle-sha256", .time = 0}, // - // {.handle = &libnsichneu_handle, .name = "libnsichneu", .time = 0}, // - // {.handle = &picojpeg_handle, .name = "picojpeg", .time = 0}, // - // {.handle = &primecount_handle, .name = "primecount", .time = 0}, // + {.handle = &libnsichneu_handle, .name = "libnsichneu", .time = 0}, // + {.handle = &picojpeg_handle, .name = "picojpeg", .time = 0}, // + {.handle = &primecount_handle, .name = "primecount", .time = 0}, // // {.handle = &qrtest_handle, .name = "qrtest", .time = 0}, // // {.handle = &combined_handle, .name = "combined", .time = 0}, // // {.handle = &slre_handle, .name = "slre", .time = 0}, // From 4efb49e87c1f341eb397c84f30664c21ac6a8043 Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 16:44:29 +0800 Subject: [PATCH 27/70] add benchmark to app. TODO: test benchmark. --- APP_Framework/Applications/benchmark/support/benchmark.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index 9375932d6..d4be3d505 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -50,11 +50,11 @@ BenchmarkPair bmh_list[] = { {.handle = &libnsichneu_handle, .name = "libnsichneu", .time = 0}, // {.handle = &picojpeg_handle, .name = "picojpeg", .time = 0}, // {.handle = &primecount_handle, .name = "primecount", .time = 0}, // - // {.handle = &qrtest_handle, .name = "qrtest", .time = 0}, // - // {.handle = &combined_handle, .name = "combined", .time = 0}, // + {.handle = &qrtest_handle, .name = "qrtest", .time = 0}, // + {.handle = &combined_handle, .name = "combined", .time = 0}, // // {.handle = &slre_handle, .name = "slre", .time = 0}, // - // {.handle = &libst_handle, .name = "libst", .time = 0}, // - // {.handle = &statemate_handle, .name = "statemate", .time = 0}, // + {.handle = &libst_handle, .name = "libst", .time = 0}, // + {.handle = &statemate_handle, .name = "statemate", .time = 0}, // // {.handle = &tarfind_handle, .name = "tarfind", .time = 0}, // // {.handle = &libud_handle, .name = "libud", .time = 0}, // // {.handle = &libwikisort_handle, .name = "libwikisort", .time = 0}, // From 0b48f3240cfc854d4ec6bd5cd75c2539293551b8 Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 16:46:42 +0800 Subject: [PATCH 28/70] add benchmark to app. TODO: test benchmark. --- .../Applications/benchmark/support/benchmark.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index d4be3d505..35221d4f5 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -53,12 +53,12 @@ BenchmarkPair bmh_list[] = { {.handle = &qrtest_handle, .name = "qrtest", .time = 0}, // {.handle = &combined_handle, .name = "combined", .time = 0}, // // {.handle = &slre_handle, .name = "slre", .time = 0}, // - {.handle = &libst_handle, .name = "libst", .time = 0}, // - {.handle = &statemate_handle, .name = "statemate", .time = 0}, // - // {.handle = &tarfind_handle, .name = "tarfind", .time = 0}, // - // {.handle = &libud_handle, .name = "libud", .time = 0}, // - // {.handle = &libwikisort_handle, .name = "libwikisort", .time = 0}, // - {.handle = NULL, .name = "", .time = 0}, // + {.handle = &libst_handle, .name = "libst", .time = 0}, // + {.handle = &statemate_handle, .name = "statemate", .time = 0}, // + {.handle = &tarfind_handle, .name = "tarfind", .time = 0}, // + {.handle = &libud_handle, .name = "libud", .time = 0}, // + {.handle = &libwikisort_handle, .name = "libwikisort", .time = 0}, // + {.handle = NULL, .name = "", .time = 0}, // }; float benchmark_time[25]; From 09f449201e6ead3afa484b3a44a1019fc82188bc Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 16:48:03 +0800 Subject: [PATCH 29/70] add benchmark to app. TODO: test benchmark. --- .../Applications/benchmark/support/benchmark.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index 35221d4f5..15451bf9d 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -40,9 +40,9 @@ BenchmarkPair bmh_list[] = { {.handle = &crc32_handle, .name = "crc32", .time = 0}, // {.handle = &md5_handle, .name = "md5sum", .time = 0}, // {.handle = &cubic_handle, .name = "cubic", .time = 0}, // - {.handle = &edn_handle, .name = "edn", .time = 0}, // + {.handle = &edn_handle, .name = "edn", .time = 0}, // - // {.handle = &huffbench_handle, .name = "huffbench", .time = 0}, // - {.handle = &matmult_int_handle, .name = "matmult-int", .time = 0}, // + {.handle = &matmult_int_handle, .name = "matmult-int", .time = 0}, // - {.handle = &libminver_handle, .name = "libminver", .time = 0}, // {.handle = &nobody_handle, .name = "nbody", .time = 0}, // {.handle = &nettle_aes_handle, .name = "nettle-aes", .time = 0}, // @@ -50,11 +50,11 @@ BenchmarkPair bmh_list[] = { {.handle = &libnsichneu_handle, .name = "libnsichneu", .time = 0}, // {.handle = &picojpeg_handle, .name = "picojpeg", .time = 0}, // {.handle = &primecount_handle, .name = "primecount", .time = 0}, // - {.handle = &qrtest_handle, .name = "qrtest", .time = 0}, // - {.handle = &combined_handle, .name = "combined", .time = 0}, // + {.handle = &qrtest_handle, .name = "qrtest", .time = 0}, // - + {.handle = &combined_handle, .name = "combined", .time = 0}, // - // {.handle = &slre_handle, .name = "slre", .time = 0}, // - {.handle = &libst_handle, .name = "libst", .time = 0}, // - {.handle = &statemate_handle, .name = "statemate", .time = 0}, // + {.handle = &libst_handle, .name = "libst", .time = 0}, // - + {.handle = &statemate_handle, .name = "statemate", .time = 0}, // - {.handle = &tarfind_handle, .name = "tarfind", .time = 0}, // {.handle = &libud_handle, .name = "libud", .time = 0}, // {.handle = &libwikisort_handle, .name = "libwikisort", .time = 0}, // From 002778961df504eb4436c8561566bb2ac57eaed6 Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 16:49:54 +0800 Subject: [PATCH 30/70] add benchmark to app. TODO: test benchmark. --- .../Applications/benchmark/support/benchmark.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index 15451bf9d..8455dccf2 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -53,12 +53,12 @@ BenchmarkPair bmh_list[] = { {.handle = &qrtest_handle, .name = "qrtest", .time = 0}, // - {.handle = &combined_handle, .name = "combined", .time = 0}, // - // {.handle = &slre_handle, .name = "slre", .time = 0}, // - {.handle = &libst_handle, .name = "libst", .time = 0}, // - - {.handle = &statemate_handle, .name = "statemate", .time = 0}, // - - {.handle = &tarfind_handle, .name = "tarfind", .time = 0}, // - {.handle = &libud_handle, .name = "libud", .time = 0}, // - {.handle = &libwikisort_handle, .name = "libwikisort", .time = 0}, // - {.handle = NULL, .name = "", .time = 0}, // + {.handle = &libst_handle, .name = "libst", .time = 0}, // - + {.handle = &statemate_handle, .name = "statemate", .time = 0}, // - + {.handle = &tarfind_handle, .name = "tarfind", .time = 0}, // + {.handle = &libud_handle, .name = "libud", .time = 0}, // + // {.handle = &libwikisort_handle, .name = "libwikisort", .time = 0}, // + {.handle = NULL, .name = "", .time = 0}, // }; float benchmark_time[25]; From 93e42ded0d46badc639ee5f39a13138fa7dda36a Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 16:51:44 +0800 Subject: [PATCH 31/70] add benchmark to app. TODO: test benchmark. --- .../Applications/benchmark/support/benchmark.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index 8455dccf2..301186baa 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -52,11 +52,11 @@ BenchmarkPair bmh_list[] = { {.handle = &primecount_handle, .name = "primecount", .time = 0}, // {.handle = &qrtest_handle, .name = "qrtest", .time = 0}, // - {.handle = &combined_handle, .name = "combined", .time = 0}, // - - // {.handle = &slre_handle, .name = "slre", .time = 0}, // - {.handle = &libst_handle, .name = "libst", .time = 0}, // - - {.handle = &statemate_handle, .name = "statemate", .time = 0}, // - - {.handle = &tarfind_handle, .name = "tarfind", .time = 0}, // - {.handle = &libud_handle, .name = "libud", .time = 0}, // + {.handle = &slre_handle, .name = "slre", .time = 0}, // + {.handle = &libst_handle, .name = "libst", .time = 0}, // - + {.handle = &statemate_handle, .name = "statemate", .time = 0}, // - + {.handle = &tarfind_handle, .name = "tarfind", .time = 0}, // + {.handle = &libud_handle, .name = "libud", .time = 0}, // // {.handle = &libwikisort_handle, .name = "libwikisort", .time = 0}, // {.handle = NULL, .name = "", .time = 0}, // }; From 7446dd20b1ad0bfb9589b0b16e24ab75a04c968a Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 16:57:43 +0800 Subject: [PATCH 32/70] add benchmark to app. TODO: test benchmark. --- .../Applications/benchmark/src/slre/libslre.c | 3 ++- .../Applications/benchmark/support/benchmark.c | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/APP_Framework/Applications/benchmark/src/slre/libslre.c b/APP_Framework/Applications/benchmark/src/slre/libslre.c index f6d194af9..5fae22dec 100644 --- a/APP_Framework/Applications/benchmark/src/slre/libslre.c +++ b/APP_Framework/Applications/benchmark/src/slre/libslre.c @@ -31,8 +31,9 @@ #define ARRAY_SIZE(ar) (int) (sizeof(ar) / sizeof((ar)[0])) #define FAIL_IF(condition, error_code) if (condition) return (error_code) +#define SLRE_DEBUG #ifdef SLRE_DEBUG -#define DBG(x) printf x +#define DBG(x) printf x; #else #define DBG(x) #endif diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index 301186baa..dfb2b3794 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -40,9 +40,9 @@ BenchmarkPair bmh_list[] = { {.handle = &crc32_handle, .name = "crc32", .time = 0}, // {.handle = &md5_handle, .name = "md5sum", .time = 0}, // {.handle = &cubic_handle, .name = "cubic", .time = 0}, // - {.handle = &edn_handle, .name = "edn", .time = 0}, // - + {.handle = &edn_handle, .name = "edn", .time = 0}, // // {.handle = &huffbench_handle, .name = "huffbench", .time = 0}, // - {.handle = &matmult_int_handle, .name = "matmult-int", .time = 0}, // - + {.handle = &matmult_int_handle, .name = "matmult-int", .time = 0}, // {.handle = &libminver_handle, .name = "libminver", .time = 0}, // {.handle = &nobody_handle, .name = "nbody", .time = 0}, // {.handle = &nettle_aes_handle, .name = "nettle-aes", .time = 0}, // @@ -50,11 +50,11 @@ BenchmarkPair bmh_list[] = { {.handle = &libnsichneu_handle, .name = "libnsichneu", .time = 0}, // {.handle = &picojpeg_handle, .name = "picojpeg", .time = 0}, // {.handle = &primecount_handle, .name = "primecount", .time = 0}, // - {.handle = &qrtest_handle, .name = "qrtest", .time = 0}, // - - {.handle = &combined_handle, .name = "combined", .time = 0}, // - + {.handle = &qrtest_handle, .name = "qrtest", .time = 0}, // + {.handle = &combined_handle, .name = "combined", .time = 0}, // {.handle = &slre_handle, .name = "slre", .time = 0}, // - {.handle = &libst_handle, .name = "libst", .time = 0}, // - - {.handle = &statemate_handle, .name = "statemate", .time = 0}, // - + {.handle = &libst_handle, .name = "libst", .time = 0}, // + {.handle = &statemate_handle, .name = "statemate", .time = 0}, // {.handle = &tarfind_handle, .name = "tarfind", .time = 0}, // {.handle = &libud_handle, .name = "libud", .time = 0}, // // {.handle = &libwikisort_handle, .name = "libwikisort", .time = 0}, // From d677e5cb0b1281397cf236fbf6fe4b33f913aca3 Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 17:02:32 +0800 Subject: [PATCH 33/70] add benchmark to app. TODO: test benchmark. --- .../Applications/benchmark/support/benchmark.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index dfb2b3794..ad2443d7a 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -52,13 +52,13 @@ BenchmarkPair bmh_list[] = { {.handle = &primecount_handle, .name = "primecount", .time = 0}, // {.handle = &qrtest_handle, .name = "qrtest", .time = 0}, // {.handle = &combined_handle, .name = "combined", .time = 0}, // - {.handle = &slre_handle, .name = "slre", .time = 0}, // - {.handle = &libst_handle, .name = "libst", .time = 0}, // - {.handle = &statemate_handle, .name = "statemate", .time = 0}, // - {.handle = &tarfind_handle, .name = "tarfind", .time = 0}, // - {.handle = &libud_handle, .name = "libud", .time = 0}, // - // {.handle = &libwikisort_handle, .name = "libwikisort", .time = 0}, // - {.handle = NULL, .name = "", .time = 0}, // + // {.handle = &slre_handle, .name = "slre", .time = 0}, // + {.handle = &libst_handle, .name = "libst", .time = 0}, // + {.handle = &statemate_handle, .name = "statemate", .time = 0}, // + {.handle = &tarfind_handle, .name = "tarfind", .time = 0}, // + {.handle = &libud_handle, .name = "libud", .time = 0}, // + {.handle = &libwikisort_handle, .name = "libwikisort", .time = 0}, // + {.handle = NULL, .name = "", .time = 0}, // }; float benchmark_time[25]; From 958d8e26dfdf70ef78c540dba819f82037966887 Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 17:16:15 +0800 Subject: [PATCH 34/70] add benchmark to app. TODO: test benchmark. --- APP_Framework/Applications/benchmark/support/beebsc.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/APP_Framework/Applications/benchmark/support/beebsc.h b/APP_Framework/Applications/benchmark/support/beebsc.h index 7ac8c7b4b..ee7112742 100644 --- a/APP_Framework/Applications/benchmark/support/beebsc.h +++ b/APP_Framework/Applications/benchmark/support/beebsc.h @@ -43,8 +43,13 @@ // if (!(expr)) exit(1); \ // } +// #define assert_beebs(expr) \ +// { assert(expr); } + #define assert_beebs(expr) \ - { assert(expr); } + { \ + if (!(expr)) return; \ + } #define float_eq_beebs(exp, actual) (fabsf(exp - actual) < VERIFY_FLOAT_EPS) #define float_neq_beebs(exp, actual) !float_eq_beebs(exp, actual) From 846743982b7397516d8cce22ddd9ab0450d8c109 Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 17:25:19 +0800 Subject: [PATCH 35/70] add benchmark to app. TODO: test benchmark. --- .../Applications/benchmark/support/beebsc.h | 7 +------ .../Applications/benchmark/support/benchmark.c | 13 +++++++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/beebsc.h b/APP_Framework/Applications/benchmark/support/beebsc.h index ee7112742..7ac8c7b4b 100644 --- a/APP_Framework/Applications/benchmark/support/beebsc.h +++ b/APP_Framework/Applications/benchmark/support/beebsc.h @@ -43,13 +43,8 @@ // if (!(expr)) exit(1); \ // } -// #define assert_beebs(expr) \ -// { assert(expr); } - #define assert_beebs(expr) \ - { \ - if (!(expr)) return; \ - } + { 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 ad2443d7a..367399c92 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -104,7 +104,7 @@ void print_result() { } }; -int run_benchmark() { +void *run_benchmark(void *args) { int i = 0; volatile int result; int correct; @@ -137,12 +137,17 @@ int run_benchmark() { } // print_result(); - return (!correct); + printf("[BENCHMARK] Global Time Diff: %f\n", global_diff); + return NULL; } +pthread_t benchmark_task; static int embenchmark(void) { - run_benchmark(); - printf("[BENCHMARK] Global Time Diff: %f\n", global_diff); + pthread_attr_t attr; + attr.schedparam.sched_priority = 25; + attr.stacksize = 4096; + + PrivTaskCreate(&benchmark_task, &attr, run_benchmark, NULL); return 0; } PRIV_SHELL_CMD_FUNCTION(embenchmark, benchmark, PRIV_SHELL_CMD_MAIN_ATTR); From 2ad977d28e95d780573c32216d4de42d6e910e82 Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 17:27:26 +0800 Subject: [PATCH 36/70] add benchmark to app. TODO: test benchmark. --- .../Applications/benchmark/support/benchmark.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index 367399c92..aa597b873 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -36,12 +36,12 @@ typedef struct BenchmarkPair { } BenchmarkPair; BenchmarkPair bmh_list[] = { - {.handle = &mont64_handle, .name = "mont", .time = 0}, // - {.handle = &crc32_handle, .name = "crc32", .time = 0}, // - {.handle = &md5_handle, .name = "md5sum", .time = 0}, // - {.handle = &cubic_handle, .name = "cubic", .time = 0}, // - {.handle = &edn_handle, .name = "edn", .time = 0}, // - // {.handle = &huffbench_handle, .name = "huffbench", .time = 0}, // + {.handle = &mont64_handle, .name = "mont", .time = 0}, // + {.handle = &crc32_handle, .name = "crc32", .time = 0}, // + {.handle = &md5_handle, .name = "md5sum", .time = 0}, // + {.handle = &cubic_handle, .name = "cubic", .time = 0}, // + {.handle = &edn_handle, .name = "edn", .time = 0}, // + {.handle = &huffbench_handle, .name = "huffbench", .time = 0}, // {.handle = &matmult_int_handle, .name = "matmult-int", .time = 0}, // {.handle = &libminver_handle, .name = "libminver", .time = 0}, // {.handle = &nobody_handle, .name = "nbody", .time = 0}, // From a727caeabdc4acc41d4bbe5e22d7fe182ec53d78 Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 17:36:55 +0800 Subject: [PATCH 37/70] add benchmark to app. TODO: test benchmark. --- APP_Framework/Applications/benchmark/support/benchmark.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index aa597b873..21ff32eca 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -145,7 +145,7 @@ pthread_t benchmark_task; static int embenchmark(void) { pthread_attr_t attr; attr.schedparam.sched_priority = 25; - attr.stacksize = 4096; + attr.stacksize = 8192; PrivTaskCreate(&benchmark_task, &attr, run_benchmark, NULL); return 0; From 86d5d6be59725ac533ede05b695d426962c7aa3a Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 17:40:20 +0800 Subject: [PATCH 38/70] add benchmark to app. TODO: test benchmark. --- APP_Framework/Applications/benchmark/support/benchmark.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index 21ff32eca..dcf9ce57c 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -145,7 +145,7 @@ pthread_t benchmark_task; static int embenchmark(void) { pthread_attr_t attr; attr.schedparam.sched_priority = 25; - attr.stacksize = 8192; + attr.stacksize = 6144; PrivTaskCreate(&benchmark_task, &attr, run_benchmark, NULL); return 0; From 8aed85d59ac49e9e2f73b61491c7ad8ca270fe21 Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 17:44:26 +0800 Subject: [PATCH 39/70] add benchmark to app. TODO: test benchmark. --- APP_Framework/Applications/benchmark/support/benchmark.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index dcf9ce57c..187f8f676 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -87,8 +87,6 @@ void organize_result(const benchmark_handle *handle) { while (bmh_list[i].handle != NULL) { if (bmh_list[i].handle == handle) { bmh_list[i].time = tmp_diff; - printf("[BENCHMARK] Time Cost: %-15s %.4f\n", bmh_list[i].name, - bmh_list[i].time); break; } i++; @@ -136,7 +134,7 @@ void *run_benchmark(void *args) { cur_handle = cur_handle->next; } - // print_result(); + print_result(); printf("[BENCHMARK] Global Time Diff: %f\n", global_diff); return NULL; } From c4da1ec3817950a22848c8c8944730519eb7acad Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 17:47:15 +0800 Subject: [PATCH 40/70] add benchmark to app. TODO: test benchmark. --- APP_Framework/Applications/benchmark/support/benchmark.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index 187f8f676..cb8e6851f 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -143,7 +143,7 @@ pthread_t benchmark_task; static int embenchmark(void) { pthread_attr_t attr; attr.schedparam.sched_priority = 25; - attr.stacksize = 6144; + attr.stacksize = 4096; PrivTaskCreate(&benchmark_task, &attr, run_benchmark, NULL); return 0; From fc40d495d69535da3f24025e34bb17b37b757c01 Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 17:49:37 +0800 Subject: [PATCH 41/70] add benchmark to app. TODO: test benchmark. --- .../Applications/benchmark/support/benchmark.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index cb8e6851f..490cd6406 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -53,12 +53,12 @@ BenchmarkPair bmh_list[] = { {.handle = &qrtest_handle, .name = "qrtest", .time = 0}, // {.handle = &combined_handle, .name = "combined", .time = 0}, // // {.handle = &slre_handle, .name = "slre", .time = 0}, // - {.handle = &libst_handle, .name = "libst", .time = 0}, // - {.handle = &statemate_handle, .name = "statemate", .time = 0}, // - {.handle = &tarfind_handle, .name = "tarfind", .time = 0}, // - {.handle = &libud_handle, .name = "libud", .time = 0}, // - {.handle = &libwikisort_handle, .name = "libwikisort", .time = 0}, // - {.handle = NULL, .name = "", .time = 0}, // + {.handle = &libst_handle, .name = "libst", .time = 0}, // + {.handle = &statemate_handle, .name = "statemate", .time = 0}, // + {.handle = &tarfind_handle, .name = "tarfind", .time = 0}, // + {.handle = &libud_handle, .name = "libud", .time = 0}, // + // {.handle = &libwikisort_handle, .name = "libwikisort", .time = 0}, // + {.handle = NULL, .name = "", .time = 0}, // }; float benchmark_time[25]; From 7c50a73bf1474f00d01db06b1310a25453a34503 Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 17:51:59 +0800 Subject: [PATCH 42/70] add benchmark to app. TODO: test benchmark. --- .../benchmark/support/benchmark.c | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index 490cd6406..1053b196c 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -36,12 +36,12 @@ typedef struct BenchmarkPair { } BenchmarkPair; BenchmarkPair bmh_list[] = { - {.handle = &mont64_handle, .name = "mont", .time = 0}, // - {.handle = &crc32_handle, .name = "crc32", .time = 0}, // - {.handle = &md5_handle, .name = "md5sum", .time = 0}, // - {.handle = &cubic_handle, .name = "cubic", .time = 0}, // - {.handle = &edn_handle, .name = "edn", .time = 0}, // - {.handle = &huffbench_handle, .name = "huffbench", .time = 0}, // + {.handle = &mont64_handle, .name = "mont", .time = 0}, // + {.handle = &crc32_handle, .name = "crc32", .time = 0}, // + {.handle = &md5_handle, .name = "md5sum", .time = 0}, // + {.handle = &cubic_handle, .name = "cubic", .time = 0}, // + {.handle = &edn_handle, .name = "edn", .time = 0}, // + // {.handle = &huffbench_handle, .name = "huffbench", .time = 0}, // {.handle = &matmult_int_handle, .name = "matmult-int", .time = 0}, // {.handle = &libminver_handle, .name = "libminver", .time = 0}, // {.handle = &nobody_handle, .name = "nbody", .time = 0}, // @@ -53,12 +53,12 @@ BenchmarkPair bmh_list[] = { {.handle = &qrtest_handle, .name = "qrtest", .time = 0}, // {.handle = &combined_handle, .name = "combined", .time = 0}, // // {.handle = &slre_handle, .name = "slre", .time = 0}, // - {.handle = &libst_handle, .name = "libst", .time = 0}, // - {.handle = &statemate_handle, .name = "statemate", .time = 0}, // - {.handle = &tarfind_handle, .name = "tarfind", .time = 0}, // - {.handle = &libud_handle, .name = "libud", .time = 0}, // - // {.handle = &libwikisort_handle, .name = "libwikisort", .time = 0}, // - {.handle = NULL, .name = "", .time = 0}, // + {.handle = &libst_handle, .name = "libst", .time = 0}, // + {.handle = &statemate_handle, .name = "statemate", .time = 0}, // + {.handle = &tarfind_handle, .name = "tarfind", .time = 0}, // + {.handle = &libud_handle, .name = "libud", .time = 0}, // + {.handle = &libwikisort_handle, .name = "libwikisort", .time = 0}, // + {.handle = NULL, .name = "", .time = 0}, // }; float benchmark_time[25]; From 99c1582d27a5255401f39bc1b54bf35bc2e7915c Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 17:56:33 +0800 Subject: [PATCH 43/70] add benchmark to app. TODO: test benchmark. --- APP_Framework/Applications/benchmark/support/benchmark.c | 9 +++++---- Ubiquitous/XiZi_IIoT/board/xidatong-riscv64/link.lds | 9 +-------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index 1053b196c..2a0b886f4 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -141,11 +141,12 @@ void *run_benchmark(void *args) { pthread_t benchmark_task; static int embenchmark(void) { - pthread_attr_t attr; - attr.schedparam.sched_priority = 25; - attr.stacksize = 4096; + // pthread_attr_t attr; + // attr.schedparam.sched_priority = 25; + // attr.stacksize = 4096; - PrivTaskCreate(&benchmark_task, &attr, run_benchmark, NULL); + // PrivTaskCreate(&benchmark_task, &attr, run_benchmark, NULL); + run_benchmark(NULL); return 0; } PRIV_SHELL_CMD_FUNCTION(embenchmark, benchmark, PRIV_SHELL_CMD_MAIN_ATTR); diff --git a/Ubiquitous/XiZi_IIoT/board/xidatong-riscv64/link.lds b/Ubiquitous/XiZi_IIoT/board/xidatong-riscv64/link.lds index 64bc796fc..60b6f3a21 100644 --- a/Ubiquitous/XiZi_IIoT/board/xidatong-riscv64/link.lds +++ b/Ubiquitous/XiZi_IIoT/board/xidatong-riscv64/link.lds @@ -10,7 +10,7 @@ * See the Mulan PSL v2 for more details. */ -__STACKSIZE__ = 4096; +__STACKSIZE__ = 8192; OUTPUT_ARCH( "riscv" ) MEMORY { @@ -41,13 +41,6 @@ SECTIONS _shell_command_end = .; . = ALIGN(8); - /* section information for embench */ - . = ALIGN(8); - _benchmark_start = .; - KEEP (*(benchmark)) - _benchmark_end = .; - . = ALIGN(8); - PROVIDE(__ctors_start__ = .); KEEP (*(SORT(.init_array.*))) KEEP (*(.init_array)) From 6d3d07f60a85256301635aed36a50a574dcc067d Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 18:00:46 +0800 Subject: [PATCH 44/70] add benchmark to app. TODO: test benchmark. --- Ubiquitous/XiZi_IIoT/board/xidatong-riscv64/link.lds | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ubiquitous/XiZi_IIoT/board/xidatong-riscv64/link.lds b/Ubiquitous/XiZi_IIoT/board/xidatong-riscv64/link.lds index 60b6f3a21..684f8f370 100644 --- a/Ubiquitous/XiZi_IIoT/board/xidatong-riscv64/link.lds +++ b/Ubiquitous/XiZi_IIoT/board/xidatong-riscv64/link.lds @@ -10,7 +10,7 @@ * See the Mulan PSL v2 for more details. */ -__STACKSIZE__ = 8192; +__STACKSIZE__ = 6144; OUTPUT_ARCH( "riscv" ) MEMORY { From f8dd05c0060f63591e37d611604a5d39f348ff17 Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 18:05:21 +0800 Subject: [PATCH 45/70] add benchmark to app. TODO: test benchmark. --- .../Applications/benchmark/support/benchmark.c | 10 +++++----- Ubiquitous/XiZi_IIoT/board/xidatong-riscv64/link.lds | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index 2a0b886f4..055cba32f 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -141,12 +141,12 @@ void *run_benchmark(void *args) { pthread_t benchmark_task; static int embenchmark(void) { - // pthread_attr_t attr; - // attr.schedparam.sched_priority = 25; - // attr.stacksize = 4096; + pthread_attr_t attr; + attr.schedparam.sched_priority = 25; + attr.stacksize = 4096; - // PrivTaskCreate(&benchmark_task, &attr, run_benchmark, NULL); - run_benchmark(NULL); + PrivTaskCreate(&benchmark_task, &attr, run_benchmark, NULL); + // run_benchmark(NULL); return 0; } PRIV_SHELL_CMD_FUNCTION(embenchmark, benchmark, PRIV_SHELL_CMD_MAIN_ATTR); diff --git a/Ubiquitous/XiZi_IIoT/board/xidatong-riscv64/link.lds b/Ubiquitous/XiZi_IIoT/board/xidatong-riscv64/link.lds index 684f8f370..79bc98ce6 100644 --- a/Ubiquitous/XiZi_IIoT/board/xidatong-riscv64/link.lds +++ b/Ubiquitous/XiZi_IIoT/board/xidatong-riscv64/link.lds @@ -10,7 +10,7 @@ * See the Mulan PSL v2 for more details. */ -__STACKSIZE__ = 6144; +__STACKSIZE__ = 4096; OUTPUT_ARCH( "riscv" ) MEMORY { From 52202e2785517c0d8532d0368d8b8e4fd1d007de Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 18:08:56 +0800 Subject: [PATCH 46/70] add benchmark to app. TODO: test benchmark. --- .../benchmark/support/benchmark.c | 24 +++++++++---------- .../XiZi_IIoT/board/xidatong-riscv64/link.lds | 7 ++++++ 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index 055cba32f..f2986c4b3 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -36,12 +36,12 @@ typedef struct BenchmarkPair { } BenchmarkPair; BenchmarkPair bmh_list[] = { - {.handle = &mont64_handle, .name = "mont", .time = 0}, // - {.handle = &crc32_handle, .name = "crc32", .time = 0}, // - {.handle = &md5_handle, .name = "md5sum", .time = 0}, // - {.handle = &cubic_handle, .name = "cubic", .time = 0}, // - {.handle = &edn_handle, .name = "edn", .time = 0}, // - // {.handle = &huffbench_handle, .name = "huffbench", .time = 0}, // + {.handle = &mont64_handle, .name = "mont", .time = 0}, // + {.handle = &crc32_handle, .name = "crc32", .time = 0}, // + {.handle = &md5_handle, .name = "md5sum", .time = 0}, // + {.handle = &cubic_handle, .name = "cubic", .time = 0}, // + {.handle = &edn_handle, .name = "edn", .time = 0}, // + {.handle = &huffbench_handle, .name = "huffbench", .time = 0}, // {.handle = &matmult_int_handle, .name = "matmult-int", .time = 0}, // {.handle = &libminver_handle, .name = "libminver", .time = 0}, // {.handle = &nobody_handle, .name = "nbody", .time = 0}, // @@ -53,12 +53,12 @@ BenchmarkPair bmh_list[] = { {.handle = &qrtest_handle, .name = "qrtest", .time = 0}, // {.handle = &combined_handle, .name = "combined", .time = 0}, // // {.handle = &slre_handle, .name = "slre", .time = 0}, // - {.handle = &libst_handle, .name = "libst", .time = 0}, // - {.handle = &statemate_handle, .name = "statemate", .time = 0}, // - {.handle = &tarfind_handle, .name = "tarfind", .time = 0}, // - {.handle = &libud_handle, .name = "libud", .time = 0}, // - {.handle = &libwikisort_handle, .name = "libwikisort", .time = 0}, // - {.handle = NULL, .name = "", .time = 0}, // + {.handle = &libst_handle, .name = "libst", .time = 0}, // + {.handle = &statemate_handle, .name = "statemate", .time = 0}, // + {.handle = &tarfind_handle, .name = "tarfind", .time = 0}, // + {.handle = &libud_handle, .name = "libud", .time = 0}, // + // {.handle = &libwikisort_handle, .name = "libwikisort", .time = 0}, // + {.handle = NULL, .name = "", .time = 0}, // }; float benchmark_time[25]; diff --git a/Ubiquitous/XiZi_IIoT/board/xidatong-riscv64/link.lds b/Ubiquitous/XiZi_IIoT/board/xidatong-riscv64/link.lds index 79bc98ce6..64bc796fc 100644 --- a/Ubiquitous/XiZi_IIoT/board/xidatong-riscv64/link.lds +++ b/Ubiquitous/XiZi_IIoT/board/xidatong-riscv64/link.lds @@ -41,6 +41,13 @@ SECTIONS _shell_command_end = .; . = ALIGN(8); + /* section information for embench */ + . = ALIGN(8); + _benchmark_start = .; + KEEP (*(benchmark)) + _benchmark_end = .; + . = ALIGN(8); + PROVIDE(__ctors_start__ = .); KEEP (*(SORT(.init_array.*))) KEEP (*(.init_array)) From 2d6bb4b7445e412b5497f28aab75e96fdd85ad9d Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 18:10:57 +0800 Subject: [PATCH 47/70] add benchmark to app. TODO: test benchmark. --- .../Applications/benchmark/support/benchmark.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index f2986c4b3..466f542fe 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -36,12 +36,12 @@ typedef struct BenchmarkPair { } BenchmarkPair; BenchmarkPair bmh_list[] = { - {.handle = &mont64_handle, .name = "mont", .time = 0}, // - {.handle = &crc32_handle, .name = "crc32", .time = 0}, // - {.handle = &md5_handle, .name = "md5sum", .time = 0}, // - {.handle = &cubic_handle, .name = "cubic", .time = 0}, // - {.handle = &edn_handle, .name = "edn", .time = 0}, // - {.handle = &huffbench_handle, .name = "huffbench", .time = 0}, // + {.handle = &mont64_handle, .name = "mont", .time = 0}, // + {.handle = &crc32_handle, .name = "crc32", .time = 0}, // + {.handle = &md5_handle, .name = "md5sum", .time = 0}, // + {.handle = &cubic_handle, .name = "cubic", .time = 0}, // + {.handle = &edn_handle, .name = "edn", .time = 0}, // + // {.handle = &huffbench_handle, .name = "huffbench", .time = 0}, // {.handle = &matmult_int_handle, .name = "matmult-int", .time = 0}, // {.handle = &libminver_handle, .name = "libminver", .time = 0}, // {.handle = &nobody_handle, .name = "nbody", .time = 0}, // From 21eee47631378e0713a8ad57813dd282c62354ae Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 19:11:27 +0800 Subject: [PATCH 48/70] add benchmark to app. TODO: test benchmark. --- .../Applications/benchmark/support/benchmark.c | 14 +++++++------- .../XiZi_IIoT/board/xidatong-riscv64/link.lds | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index 466f542fe..cc3f00f00 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -53,12 +53,12 @@ BenchmarkPair bmh_list[] = { {.handle = &qrtest_handle, .name = "qrtest", .time = 0}, // {.handle = &combined_handle, .name = "combined", .time = 0}, // // {.handle = &slre_handle, .name = "slre", .time = 0}, // - {.handle = &libst_handle, .name = "libst", .time = 0}, // - {.handle = &statemate_handle, .name = "statemate", .time = 0}, // - {.handle = &tarfind_handle, .name = "tarfind", .time = 0}, // - {.handle = &libud_handle, .name = "libud", .time = 0}, // - // {.handle = &libwikisort_handle, .name = "libwikisort", .time = 0}, // - {.handle = NULL, .name = "", .time = 0}, // + {.handle = &libst_handle, .name = "libst", .time = 0}, // + {.handle = &statemate_handle, .name = "statemate", .time = 0}, // + {.handle = &tarfind_handle, .name = "tarfind", .time = 0}, // + {.handle = &libud_handle, .name = "libud", .time = 0}, // + {.handle = &libwikisort_handle, .name = "libwikisort", .time = 0}, // + {.handle = NULL, .name = "", .time = 0}, // }; float benchmark_time[25]; @@ -143,7 +143,7 @@ pthread_t benchmark_task; static int embenchmark(void) { pthread_attr_t attr; attr.schedparam.sched_priority = 25; - attr.stacksize = 4096; + attr.stacksize = 5120; PrivTaskCreate(&benchmark_task, &attr, run_benchmark, NULL); // run_benchmark(NULL); diff --git a/Ubiquitous/XiZi_IIoT/board/xidatong-riscv64/link.lds b/Ubiquitous/XiZi_IIoT/board/xidatong-riscv64/link.lds index 64bc796fc..6026a8d94 100644 --- a/Ubiquitous/XiZi_IIoT/board/xidatong-riscv64/link.lds +++ b/Ubiquitous/XiZi_IIoT/board/xidatong-riscv64/link.lds @@ -10,7 +10,7 @@ * See the Mulan PSL v2 for more details. */ -__STACKSIZE__ = 4096; +__STACKSIZE__ = 5120; OUTPUT_ARCH( "riscv" ) MEMORY { From c5b50b03c80760aeca9312afc8a7f94c087df38f Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 19:14:34 +0800 Subject: [PATCH 49/70] add benchmark to app. TODO: test benchmark. --- .../Applications/benchmark/support/benchmark.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index cc3f00f00..0bdc2d0ef 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -53,12 +53,12 @@ BenchmarkPair bmh_list[] = { {.handle = &qrtest_handle, .name = "qrtest", .time = 0}, // {.handle = &combined_handle, .name = "combined", .time = 0}, // // {.handle = &slre_handle, .name = "slre", .time = 0}, // - {.handle = &libst_handle, .name = "libst", .time = 0}, // - {.handle = &statemate_handle, .name = "statemate", .time = 0}, // - {.handle = &tarfind_handle, .name = "tarfind", .time = 0}, // - {.handle = &libud_handle, .name = "libud", .time = 0}, // - {.handle = &libwikisort_handle, .name = "libwikisort", .time = 0}, // - {.handle = NULL, .name = "", .time = 0}, // + {.handle = &libst_handle, .name = "libst", .time = 0}, // + {.handle = &statemate_handle, .name = "statemate", .time = 0}, // + {.handle = &tarfind_handle, .name = "tarfind", .time = 0}, // + {.handle = &libud_handle, .name = "libud", .time = 0}, // + // {.handle = &libwikisort_handle, .name = "libwikisort", .time = 0}, // + {.handle = NULL, .name = "", .time = 0}, // }; float benchmark_time[25]; From e542de5758bd46818539035a08d29d1209a53403 Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 19:19:31 +0800 Subject: [PATCH 50/70] add benchmark to app. TODO: test benchmark. --- APP_Framework/Applications/benchmark/support/benchmark.c | 2 +- Ubiquitous/XiZi_IIoT/board/xidatong-riscv64/link.lds | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index 0bdc2d0ef..3ba48cae3 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -143,7 +143,7 @@ pthread_t benchmark_task; static int embenchmark(void) { pthread_attr_t attr; attr.schedparam.sched_priority = 25; - attr.stacksize = 5120; + attr.stacksize = 8192; PrivTaskCreate(&benchmark_task, &attr, run_benchmark, NULL); // run_benchmark(NULL); diff --git a/Ubiquitous/XiZi_IIoT/board/xidatong-riscv64/link.lds b/Ubiquitous/XiZi_IIoT/board/xidatong-riscv64/link.lds index 6026a8d94..3774c1519 100644 --- a/Ubiquitous/XiZi_IIoT/board/xidatong-riscv64/link.lds +++ b/Ubiquitous/XiZi_IIoT/board/xidatong-riscv64/link.lds @@ -10,7 +10,7 @@ * See the Mulan PSL v2 for more details. */ -__STACKSIZE__ = 5120; +__STACKSIZE__ = 8192; OUTPUT_ARCH( "riscv" ) MEMORY { From f0c1e01e60b1e493c9d4990188e3f2003c85596c Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 19:24:01 +0800 Subject: [PATCH 51/70] add benchmark to app. TODO: test benchmark. --- .../Applications/benchmark/support/benchmark.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index 3ba48cae3..3685e1bc4 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -53,12 +53,12 @@ BenchmarkPair bmh_list[] = { {.handle = &qrtest_handle, .name = "qrtest", .time = 0}, // {.handle = &combined_handle, .name = "combined", .time = 0}, // // {.handle = &slre_handle, .name = "slre", .time = 0}, // - {.handle = &libst_handle, .name = "libst", .time = 0}, // - {.handle = &statemate_handle, .name = "statemate", .time = 0}, // - {.handle = &tarfind_handle, .name = "tarfind", .time = 0}, // - {.handle = &libud_handle, .name = "libud", .time = 0}, // - // {.handle = &libwikisort_handle, .name = "libwikisort", .time = 0}, // - {.handle = NULL, .name = "", .time = 0}, // + {.handle = &libst_handle, .name = "libst", .time = 0}, // + {.handle = &statemate_handle, .name = "statemate", .time = 0}, // + {.handle = &tarfind_handle, .name = "tarfind", .time = 0}, // + {.handle = &libud_handle, .name = "libud", .time = 0}, // + {.handle = &libwikisort_handle, .name = "libwikisort", .time = 0}, // + {.handle = NULL, .name = "", .time = 0}, // }; float benchmark_time[25]; From 59fa9c1c201d6bddcc9a148518a326b3835c59aa Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 19:25:59 +0800 Subject: [PATCH 52/70] add benchmark to app. TODO: test benchmark. --- .../Applications/benchmark/support/benchmark.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index 3685e1bc4..7ee6bf716 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -36,12 +36,12 @@ typedef struct BenchmarkPair { } BenchmarkPair; BenchmarkPair bmh_list[] = { - {.handle = &mont64_handle, .name = "mont", .time = 0}, // - {.handle = &crc32_handle, .name = "crc32", .time = 0}, // - {.handle = &md5_handle, .name = "md5sum", .time = 0}, // - {.handle = &cubic_handle, .name = "cubic", .time = 0}, // - {.handle = &edn_handle, .name = "edn", .time = 0}, // - // {.handle = &huffbench_handle, .name = "huffbench", .time = 0}, // + {.handle = &mont64_handle, .name = "mont", .time = 0}, // + {.handle = &crc32_handle, .name = "crc32", .time = 0}, // + {.handle = &md5_handle, .name = "md5sum", .time = 0}, // + {.handle = &cubic_handle, .name = "cubic", .time = 0}, // + {.handle = &edn_handle, .name = "edn", .time = 0}, // + {.handle = &huffbench_handle, .name = "huffbench", .time = 0}, // {.handle = &matmult_int_handle, .name = "matmult-int", .time = 0}, // {.handle = &libminver_handle, .name = "libminver", .time = 0}, // {.handle = &nobody_handle, .name = "nbody", .time = 0}, // From ee849ad76ddc29cc89996337b055a0d8f95c3e0c Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 19:29:24 +0800 Subject: [PATCH 53/70] add benchmark to app. TODO: test benchmark. --- APP_Framework/Applications/benchmark/support/benchmark.c | 2 +- Ubiquitous/XiZi_IIoT/board/xidatong-riscv64/link.lds | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index 7ee6bf716..3b057e4d7 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -143,7 +143,7 @@ pthread_t benchmark_task; static int embenchmark(void) { pthread_attr_t attr; attr.schedparam.sched_priority = 25; - attr.stacksize = 8192; + attr.stacksize = 16384; PrivTaskCreate(&benchmark_task, &attr, run_benchmark, NULL); // run_benchmark(NULL); diff --git a/Ubiquitous/XiZi_IIoT/board/xidatong-riscv64/link.lds b/Ubiquitous/XiZi_IIoT/board/xidatong-riscv64/link.lds index 3774c1519..769d05510 100644 --- a/Ubiquitous/XiZi_IIoT/board/xidatong-riscv64/link.lds +++ b/Ubiquitous/XiZi_IIoT/board/xidatong-riscv64/link.lds @@ -10,7 +10,7 @@ * See the Mulan PSL v2 for more details. */ -__STACKSIZE__ = 8192; +__STACKSIZE__ = 16384; OUTPUT_ARCH( "riscv" ) MEMORY { From 95b6058cdd275f3a8c8ba7565b4e6f4a8f5f2576 Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 19:31:51 +0800 Subject: [PATCH 54/70] add benchmark to app. TODO: test benchmark. --- .../Applications/benchmark/support/benchmark.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index 3b057e4d7..727bf91cb 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -52,13 +52,13 @@ BenchmarkPair bmh_list[] = { {.handle = &primecount_handle, .name = "primecount", .time = 0}, // {.handle = &qrtest_handle, .name = "qrtest", .time = 0}, // {.handle = &combined_handle, .name = "combined", .time = 0}, // - // {.handle = &slre_handle, .name = "slre", .time = 0}, // - {.handle = &libst_handle, .name = "libst", .time = 0}, // - {.handle = &statemate_handle, .name = "statemate", .time = 0}, // - {.handle = &tarfind_handle, .name = "tarfind", .time = 0}, // - {.handle = &libud_handle, .name = "libud", .time = 0}, // - {.handle = &libwikisort_handle, .name = "libwikisort", .time = 0}, // - {.handle = NULL, .name = "", .time = 0}, // + {.handle = &slre_handle, .name = "slre", .time = 0}, // + {.handle = &libst_handle, .name = "libst", .time = 0}, // + {.handle = &statemate_handle, .name = "statemate", .time = 0}, // + {.handle = &tarfind_handle, .name = "tarfind", .time = 0}, // + {.handle = &libud_handle, .name = "libud", .time = 0}, // + {.handle = &libwikisort_handle, .name = "libwikisort", .time = 0}, // + {.handle = NULL, .name = "", .time = 0}, // }; float benchmark_time[25]; From 52cfcba2a3f7c73bd754d45f94fb0c6aeb9885d2 Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 19:34:03 +0800 Subject: [PATCH 55/70] add benchmark to app. TODO: test benchmark. --- APP_Framework/Applications/benchmark/src/slre/libslre.c | 1 - 1 file changed, 1 deletion(-) diff --git a/APP_Framework/Applications/benchmark/src/slre/libslre.c b/APP_Framework/Applications/benchmark/src/slre/libslre.c index 5fae22dec..10d2783e6 100644 --- a/APP_Framework/Applications/benchmark/src/slre/libslre.c +++ b/APP_Framework/Applications/benchmark/src/slre/libslre.c @@ -31,7 +31,6 @@ #define ARRAY_SIZE(ar) (int) (sizeof(ar) / sizeof((ar)[0])) #define FAIL_IF(condition, error_code) if (condition) return (error_code) -#define SLRE_DEBUG #ifdef SLRE_DEBUG #define DBG(x) printf x; #else From 02ff38a3446d9d98683f13839660b52b68ee3186 Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 20:44:26 +0800 Subject: [PATCH 56/70] add benchmark to app. TODO: test benchmark. --- .../Applications/benchmark/src/slre/libslre.c | 3 + .../benchmark/src/statemate/libstatemate.c | 39 ++++++------- .../benchmark/support/benchmark.c | 57 +++++++++++-------- .../Applications/benchmark/support/support.h | 4 +- 4 files changed, 58 insertions(+), 45 deletions(-) diff --git a/APP_Framework/Applications/benchmark/src/slre/libslre.c b/APP_Framework/Applications/benchmark/src/slre/libslre.c index 10d2783e6..d0ea25250 100644 --- a/APP_Framework/Applications/benchmark/src/slre/libslre.c +++ b/APP_Framework/Applications/benchmark/src/slre/libslre.c @@ -31,6 +31,9 @@ #define ARRAY_SIZE(ar) (int) (sizeof(ar) / sizeof((ar)[0])) #define FAIL_IF(condition, error_code) if (condition) return (error_code) +#ifdef DBG +#undef DBG +#endif #ifdef SLRE_DEBUG #define DBG(x) printf x; #else diff --git a/APP_Framework/Applications/benchmark/src/statemate/libstatemate.c b/APP_Framework/Applications/benchmark/src/statemate/libstatemate.c index 56f6a74e3..31e5de34c 100644 --- a/APP_Framework/Applications/benchmark/src/statemate/libstatemate.c +++ b/APP_Framework/Applications/benchmark/src/statemate/libstatemate.c @@ -19,7 +19,7 @@ * statemate.c * * This code was automatically generated by - * the STAtechart Real-time-Code generator STARC + * the STAtechart Real-bm_time-Code generator STARC * which was developed at C-LAB. * * The original StateChart specifies an experimental @@ -170,7 +170,7 @@ char FH_DU__MFHA_old; #define FH_TUERMODUL_CTRL__END_REVERS_copy_IDX 23 #define FH_TUERMODUL__EINKLEMMUNG_IDX 24 -static unsigned long time; +static unsigned long bm_time; char stable; char step; @@ -193,39 +193,39 @@ char BLOCK_ERKENNUNG_CTRL_BLOCK_ERKENNUNG_CTRL_next_state; /** 2 bits **/ void interface(void) { if (SYS_bit_get(Bitlist, entered_WIEDERHOLSPERRE_FH_TUERMODUL_CTRL_IDX)) - tm_entered_WIEDERHOLSPERRE_FH_TUERMODUL_CTRL = time; + tm_entered_WIEDERHOLSPERRE_FH_TUERMODUL_CTRL = bm_time; if (SYS_bit_get(Bitlist, entered_WIEDERHOLSPERRE_FH_TUERMODUL_CTRL_IDX) || SYS_bit_get(Bitlist, exited_BEREIT_FH_TUERMODUL_CTRL_IDX)) tm_entered_WIEDERHOLSPERRE_FH_TUERMODUL_CTRLexited_BEREIT_FH_TUERMODUL_CTRL = - time; + bm_time; if ((sc_FH_TUERMODUL_CTRL_2375_2 != 0) && - (time - sc_FH_TUERMODUL_CTRL_2375_2 >= 0.5)) { + (bm_time - sc_FH_TUERMODUL_CTRL_2375_2 >= 0.5)) { FH_TUERMODUL__MFHA_copy = 0; sc_FH_TUERMODUL_CTRL_2375_2 = 0; } if ((sc_FH_TUERMODUL_CTRL_2352_1 != 0) && - (time - sc_FH_TUERMODUL_CTRL_2352_1 >= 0.5)) { + (bm_time - sc_FH_TUERMODUL_CTRL_2352_1 >= 0.5)) { FH_TUERMODUL__MFHZ_copy = 0; sc_FH_TUERMODUL_CTRL_2352_1 = 0; } if ((sc_FH_TUERMODUL_CTRL_2329_1 != 0) && - (time - sc_FH_TUERMODUL_CTRL_2329_1 >= 0.5)) { + (bm_time - sc_FH_TUERMODUL_CTRL_2329_1 >= 0.5)) { FH_TUERMODUL__MFHZ_copy = 0; sc_FH_TUERMODUL_CTRL_2329_1 = 0; } if ((sc_FH_TUERMODUL_CTRL_1781_10 != 0) && - (time - sc_FH_TUERMODUL_CTRL_1781_10 >= 0.5)) { + (bm_time - sc_FH_TUERMODUL_CTRL_1781_10 >= 0.5)) { sc_FH_TUERMODUL_CTRL_1781_10 = 0; } if ((sc_FH_TUERMODUL_CTRL_1739_10 != 0) && - (time - sc_FH_TUERMODUL_CTRL_1739_10 >= 0.5)) { + (bm_time - sc_FH_TUERMODUL_CTRL_1739_10 >= 0.5)) { sc_FH_TUERMODUL_CTRL_1739_10 = 0; } if ((SYS_bit_get(Bitlist, entered_EINSCHALTSTROM_MESSEN_BLOCK_ERKENNUNG_CTRL_IDX) || BLOCK_ERKENNUNG_CTRL__N != BLOCK_ERKENNUNG_CTRL__N_old)) tm_entered_EINSCHALTSTROM_MESSEN_BLOCK_ERKENNUNG_CTRLch_BLOCK_ERKENNUNG_CTRL__N_copy = - time; + bm_time; } /** interface **/ @@ -466,7 +466,7 @@ void generic_FH_TUERMODUL_CTRL(void) { ((FH_TUERMODUL__MFHZ))) { stable = 0; FH_TUERMODUL__MFHZ_copy = 0; - sc_FH_TUERMODUL_CTRL_2329_1 = time; + sc_FH_TUERMODUL_CTRL_2329_1 = bm_time; B_FH_TUERMODUL_CTRL_next_state = 3; INITIALISIERT_FH_TUERMODUL_CTRL_next_state = 3; @@ -538,7 +538,7 @@ void generic_FH_TUERMODUL_CTRL(void) { ((FH_TUERMODUL__MFHA))) { stable = 0; FH_TUERMODUL__MFHA_copy = 0; - sc_FH_TUERMODUL_CTRL_2375_2 = time; + sc_FH_TUERMODUL_CTRL_2375_2 = bm_time; B_FH_TUERMODUL_CTRL_next_state = 2; NICHT_INITIALISIERT_NICHT_INITIALISIERT_next_state = 3; @@ -548,7 +548,7 @@ void generic_FH_TUERMODUL_CTRL(void) { ((FH_TUERMODUL__MFHZ))) { stable = 0; FH_TUERMODUL__MFHZ_copy = 0; - sc_FH_TUERMODUL_CTRL_2352_1 = time; + sc_FH_TUERMODUL_CTRL_2352_1 = bm_time; B_FH_TUERMODUL_CTRL_next_state = 2; NICHT_INITIALISIERT_NICHT_INITIALISIERT_next_state = 3; @@ -657,7 +657,7 @@ void generic_FH_TUERMODUL_CTRL(void) { SYS_bit_clr(Bitlist, active_EINKLEMMSCHUTZ_CTRL_copy_IDX); FH_TUERMODUL__MFHZ_copy = 0; - sc_FH_TUERMODUL_CTRL_1781_10 = time; + sc_FH_TUERMODUL_CTRL_1781_10 = bm_time; FH_TUERMODUL__MFHA_copy = 1; break; } @@ -715,7 +715,7 @@ void generic_FH_TUERMODUL_CTRL(void) { MANUELL_SCHLIESSEN_FH_TUERMODUL_CTRL_next_state = 1; SYS_bit_clr(Bitlist, active_EINKLEMMSCHUTZ_CTRL_copy_IDX); - sc_FH_TUERMODUL_CTRL_1739_10 = time; + sc_FH_TUERMODUL_CTRL_1739_10 = bm_time; FH_TUERMODUL__MFHA_copy = 1; break; } @@ -799,7 +799,7 @@ void generic_FH_TUERMODUL_CTRL(void) { if ((step == 1 && tm_entered_WIEDERHOLSPERRE_FH_TUERMODUL_CTRLexited_BEREIT_FH_TUERMODUL_CTRL != 0 && - (time - + (bm_time - tm_entered_WIEDERHOLSPERRE_FH_TUERMODUL_CTRLexited_BEREIT_FH_TUERMODUL_CTRL == 1)) && ((FH_TUERMODUL__MFHZ || FH_TUERMODUL__MFHA))) { @@ -817,7 +817,8 @@ void generic_FH_TUERMODUL_CTRL(void) { { if ((step == 1 && tm_entered_WIEDERHOLSPERRE_FH_TUERMODUL_CTRL != 0 && - (time - tm_entered_WIEDERHOLSPERRE_FH_TUERMODUL_CTRL == 3)) && + (bm_time - tm_entered_WIEDERHOLSPERRE_FH_TUERMODUL_CTRL == + 3)) && (((!(FH_TUERMODUL__MFHZ || FH_TUERMODUL__MFHA)) && FH_TUERMODUL_CTRL__N > 0))) { stable = 0; @@ -965,7 +966,7 @@ void generic_BLOCK_ERKENNUNG_CTRL(void) { if (step == 1 && tm_entered_EINSCHALTSTROM_MESSEN_BLOCK_ERKENNUNG_CTRLch_BLOCK_ERKENNUNG_CTRL__N_copy != 0 && - (time - + (bm_time - tm_entered_EINSCHALTSTROM_MESSEN_BLOCK_ERKENNUNG_CTRLch_BLOCK_ERKENNUNG_CTRL__N_copy == 0.002)) { BLOCK_ERKENNUNG_CTRL__N = BLOCK_ERKENNUNG_CTRL__N + 1; @@ -1001,7 +1002,7 @@ void generic_BLOCK_ERKENNUNG_CTRL(void) { } void FH_DU(void) { - time = 1; /**SYS_get_clock()**/ + bm_time = 1; /**SYS_get_clock()**/ stable = 0; step = 0; while (!stable) { diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index 727bf91cb..707c3e32a 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -32,6 +32,7 @@ extern benchmark_handle libwikisort_handle; typedef struct BenchmarkPair { benchmark_handle *handle; char name[15]; + pthread_t task_ptr; float time; } BenchmarkPair; @@ -69,9 +70,8 @@ extern void add_benchmark_handle(benchmark_handle *head, benchmark_handle *); float tmp_diff = 0.0; float global_diff = 0.0; -clock_t start_time = 0, end_time = 0; -void start_trigger(void) { start_time = PrivGetTickTime(); } -void stop_trigger(void) { end_time = PrivGetTickTime(); } +void start_trigger(clock_t *start_time) { *start_time = PrivGetTickTime(); } +void stop_trigger(clock_t *end_time) { *end_time = PrivGetTickTime(); } void init_benchmark_runset(benchmark_handle *head) { int i = 0; @@ -80,7 +80,8 @@ void init_benchmark_runset(benchmark_handle *head) { } global_diff = 0; } -void organize_result(const benchmark_handle *handle) { +void organize_result(const benchmark_handle *handle, clock_t start_time, + clock_t end_time) { tmp_diff = (float)(end_time - start_time) / TICK_PER_SECOND; global_diff += tmp_diff; int i = 0; @@ -102,6 +103,26 @@ void print_result() { } }; +sem_t syn_sem; +void *run_one_example(void *arg) { + const benchmark_handle *handle = arg; + assert(handle != NULL); + clock_t start_time = 0, end_time = 0; + handle->handle.benchmark_func->initialise_benchmark(); + handle->handle.benchmark_func->warm_caches(WARMUP_HEAT); + start_trigger(&start_time); + volatile int result = handle->handle.benchmark_func->benchmark(); + stop_trigger(&end_time); + + int correct = handle->handle.benchmark_func->verify_benchmark(result); + if (!correct) { + printf("[EmBench] Wrong result!.\n"); + } + organize_result(handle, start_time, end_time); + PrivSemaphoreAbandon(&syn_sem); +} + +pthread_attr_t case_attr; void *run_benchmark(void *args) { int i = 0; volatile int result; @@ -114,39 +135,27 @@ void *run_benchmark(void *args) { init_benchmark_runset(&head); printf("[BENCHMARK] Start Benchmark running.\n"); + case_attr.schedparam.sched_priority = 30; + case_attr.stacksize = 16384; + PrivSemaphoreCreate(&syn_sem, 0, -21); + benchmark_handle *cur_handle = head.next; while (NULL != cur_handle) { assert(cur_handle->handle.magic_number != MAGIC_NUMBER); - cur_handle->handle.benchmark_func->initialise_benchmark(); - cur_handle->handle.benchmark_func->warm_caches(WARMUP_HEAT); - - start_trigger(); - result = cur_handle->handle.benchmark_func->benchmark(); - stop_trigger(); - - correct = cur_handle->handle.benchmark_func->verify_benchmark(result); - if (!correct) { - printf("[EmBench] Wrong result!.\n"); - break; - } - organize_result(cur_handle); + PrivTaskCreate(&cur_handle->task_ptr, &case_attr, run_one_example, + (void *)cur_handle); cur_handle = cur_handle->next; } + PrivSemaphoreObtainWait(&syn_sem, NULL); print_result(); printf("[BENCHMARK] Global Time Diff: %f\n", global_diff); return NULL; } -pthread_t benchmark_task; static int embenchmark(void) { - pthread_attr_t attr; - attr.schedparam.sched_priority = 25; - attr.stacksize = 16384; - - PrivTaskCreate(&benchmark_task, &attr, run_benchmark, NULL); - // run_benchmark(NULL); + run_benchmark(NULL); return 0; } PRIV_SHELL_CMD_FUNCTION(embenchmark, benchmark, PRIV_SHELL_CMD_MAIN_ATTR); diff --git a/APP_Framework/Applications/benchmark/support/support.h b/APP_Framework/Applications/benchmark/support/support.h index ccc3f24c9..6ecb9ff62 100644 --- a/APP_Framework/Applications/benchmark/support/support.h +++ b/APP_Framework/Applications/benchmark/support/support.h @@ -27,6 +27,7 @@ #include #include +#include #define CPU_MHZ 1 @@ -38,8 +39,6 @@ static int verify_benchmark(int result); /* Standard functions implemented for each board */ void initialise_board(void); -void start_trigger(void); -void stop_trigger(void); /* Every benchmark implements this for one-off data initialization. This is only used for initialization that is independent of how often benchmark () @@ -80,6 +79,7 @@ typedef struct benchmark_handle { benchmark_t *benchmark_func; } handle; struct benchmark_handle *next; + pthread_t task_ptr; } benchmark_handle; static benchmark_handle *get_benchmark_list() { From 222fc55b086c95e4348f8d16778967e91e1d6ce8 Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 20:51:01 +0800 Subject: [PATCH 57/70] add benchmark to app. TODO: test benchmark. --- APP_Framework/Applications/benchmark/support/benchmark.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index 707c3e32a..9cb1a80ff 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -68,7 +68,6 @@ extern benchmark_handle *get_benchmark_list(); extern void add_benchmark_handle(benchmark_handle *head, benchmark_handle *); float tmp_diff = 0.0; - float global_diff = 0.0; void start_trigger(clock_t *start_time) { *start_time = PrivGetTickTime(); } void stop_trigger(clock_t *end_time) { *end_time = PrivGetTickTime(); } @@ -103,6 +102,7 @@ void print_result() { } }; +pthread_mutex_t case_mu; sem_t syn_sem; void *run_one_example(void *arg) { const benchmark_handle *handle = arg; @@ -118,7 +118,9 @@ void *run_one_example(void *arg) { if (!correct) { printf("[EmBench] Wrong result!.\n"); } + PrivMutexObtain(&case_mu); organize_result(handle, start_time, end_time); + PrivMutexAbandon(&case_mu); PrivSemaphoreAbandon(&syn_sem); } @@ -138,6 +140,7 @@ void *run_benchmark(void *args) { case_attr.schedparam.sched_priority = 30; case_attr.stacksize = 16384; PrivSemaphoreCreate(&syn_sem, 0, -21); + PrivMutexCreate(&case_mu, 0); benchmark_handle *cur_handle = head.next; while (NULL != cur_handle) { From d172f7bba0df158f94d286c56575262f3e003f23 Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 20:54:10 +0800 Subject: [PATCH 58/70] add benchmark to app. TODO: test benchmark. --- APP_Framework/Applications/benchmark/support/benchmark.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index 9cb1a80ff..ff3668037 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -138,7 +138,7 @@ void *run_benchmark(void *args) { printf("[BENCHMARK] Start Benchmark running.\n"); case_attr.schedparam.sched_priority = 30; - case_attr.stacksize = 16384; + case_attr.stacksize = 8192; PrivSemaphoreCreate(&syn_sem, 0, -21); PrivMutexCreate(&case_mu, 0); From cbb09b62010445e79308ea2fec59c8332c0b45c3 Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 20:57:30 +0800 Subject: [PATCH 59/70] add benchmark to app. TODO: test benchmark. --- APP_Framework/Applications/benchmark/support/benchmark.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index ff3668037..0df6d11d2 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -137,8 +137,8 @@ void *run_benchmark(void *args) { init_benchmark_runset(&head); printf("[BENCHMARK] Start Benchmark running.\n"); - case_attr.schedparam.sched_priority = 30; - case_attr.stacksize = 8192; + case_attr.schedparam.sched_priority = 25; + case_attr.stacksize = 16384; PrivSemaphoreCreate(&syn_sem, 0, -21); PrivMutexCreate(&case_mu, 0); From d2a6741a2c1ca2def8bedb1dd21c3453589371ad Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 21:01:19 +0800 Subject: [PATCH 60/70] add benchmark to app. TODO: test benchmark. --- APP_Framework/Applications/benchmark/support/benchmark.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index 0df6d11d2..ef6cd1c00 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -139,7 +139,7 @@ void *run_benchmark(void *args) { case_attr.schedparam.sched_priority = 25; case_attr.stacksize = 16384; - PrivSemaphoreCreate(&syn_sem, 0, -21); + PrivSemaphoreCreate(&syn_sem, 0, -22); PrivMutexCreate(&case_mu, 0); benchmark_handle *cur_handle = head.next; From 17e9e10bddbcc149d5652f3aa655eb026c40bf29 Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 21:03:47 +0800 Subject: [PATCH 61/70] add benchmark to app. TODO: test benchmark. --- APP_Framework/Applications/benchmark/support/benchmark.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index ef6cd1c00..3ccac6e8f 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -139,7 +139,7 @@ void *run_benchmark(void *args) { case_attr.schedparam.sched_priority = 25; case_attr.stacksize = 16384; - PrivSemaphoreCreate(&syn_sem, 0, -22); + PrivSemaphoreCreate(&syn_sem, 0, -20); PrivMutexCreate(&case_mu, 0); benchmark_handle *cur_handle = head.next; From 25f82ecdaffe74c4c03536066acab98ef1fdd960 Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 21:08:25 +0800 Subject: [PATCH 62/70] add benchmark to app. TODO: test benchmark. --- APP_Framework/Applications/benchmark/support/benchmark.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index 3ccac6e8f..0df6d11d2 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -139,7 +139,7 @@ void *run_benchmark(void *args) { case_attr.schedparam.sched_priority = 25; case_attr.stacksize = 16384; - PrivSemaphoreCreate(&syn_sem, 0, -20); + PrivSemaphoreCreate(&syn_sem, 0, -21); PrivMutexCreate(&case_mu, 0); benchmark_handle *cur_handle = head.next; From 23f5102c6b41c3683bee189683a1049a7c27cd36 Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 21:09:34 +0800 Subject: [PATCH 63/70] add benchmark to app. TODO: test benchmark. --- APP_Framework/Applications/benchmark/support/benchmark.c | 2 +- APP_Framework/Applications/benchmark/support/support.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index 0df6d11d2..3ccac6e8f 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -139,7 +139,7 @@ void *run_benchmark(void *args) { case_attr.schedparam.sched_priority = 25; case_attr.stacksize = 16384; - PrivSemaphoreCreate(&syn_sem, 0, -21); + PrivSemaphoreCreate(&syn_sem, 0, -20); PrivMutexCreate(&case_mu, 0); benchmark_handle *cur_handle = head.next; diff --git a/APP_Framework/Applications/benchmark/support/support.h b/APP_Framework/Applications/benchmark/support/support.h index 6ecb9ff62..4b29cd806 100644 --- a/APP_Framework/Applications/benchmark/support/support.h +++ b/APP_Framework/Applications/benchmark/support/support.h @@ -29,7 +29,7 @@ #include #include -#define CPU_MHZ 1 +#define CPU_MHZ 10 /* Benchmarks must implement verify_benchmark, which must return -1 if no verification is done. */ From 3288e1dd7afad2d30449b45f53dafd2fc7693784 Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 21:12:49 +0800 Subject: [PATCH 64/70] add benchmark to app. TODO: test benchmark. --- APP_Framework/Applications/benchmark/support/benchmark.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index 3ccac6e8f..0df6d11d2 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -139,7 +139,7 @@ void *run_benchmark(void *args) { case_attr.schedparam.sched_priority = 25; case_attr.stacksize = 16384; - PrivSemaphoreCreate(&syn_sem, 0, -20); + PrivSemaphoreCreate(&syn_sem, 0, -21); PrivMutexCreate(&case_mu, 0); benchmark_handle *cur_handle = head.next; From 23ff23bad2c979cb1aba31e811b559644fbd1d16 Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 21:18:43 +0800 Subject: [PATCH 65/70] add benchmark to app. TODO: test benchmark. --- APP_Framework/Applications/benchmark/support/benchmark.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index 0df6d11d2..0449191ee 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -102,6 +102,7 @@ void print_result() { } }; +int done_cnt = 0; pthread_mutex_t case_mu; sem_t syn_sem; void *run_one_example(void *arg) { @@ -122,11 +123,12 @@ void *run_one_example(void *arg) { organize_result(handle, start_time, end_time); PrivMutexAbandon(&case_mu); PrivSemaphoreAbandon(&syn_sem); + done_cnt++; } pthread_attr_t case_attr; void *run_benchmark(void *args) { - int i = 0; + done_cnt = 0; volatile int result; int correct; @@ -139,7 +141,7 @@ void *run_benchmark(void *args) { case_attr.schedparam.sched_priority = 25; case_attr.stacksize = 16384; - PrivSemaphoreCreate(&syn_sem, 0, -21); + PrivSemaphoreCreate(&syn_sem, 0, -20); PrivMutexCreate(&case_mu, 0); benchmark_handle *cur_handle = head.next; @@ -153,7 +155,7 @@ void *run_benchmark(void *args) { PrivSemaphoreObtainWait(&syn_sem, NULL); print_result(); - printf("[BENCHMARK] Global Time Diff: %f\n", global_diff); + printf("[BENCHMARK] Global Time Diff: %f, Done: %d\n", global_diff, done_cnt); return NULL; } From 30f537ef10ca9f0d1513cd6f46e28f40fb7a4c00 Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 21:21:35 +0800 Subject: [PATCH 66/70] add benchmark to app. TODO: test benchmark. --- .../benchmark/support/benchmark.c | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index 0449191ee..110542075 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -37,29 +37,29 @@ typedef struct BenchmarkPair { } BenchmarkPair; BenchmarkPair bmh_list[] = { - {.handle = &mont64_handle, .name = "mont", .time = 0}, // - {.handle = &crc32_handle, .name = "crc32", .time = 0}, // - {.handle = &md5_handle, .name = "md5sum", .time = 0}, // - {.handle = &cubic_handle, .name = "cubic", .time = 0}, // - {.handle = &edn_handle, .name = "edn", .time = 0}, // - {.handle = &huffbench_handle, .name = "huffbench", .time = 0}, // - {.handle = &matmult_int_handle, .name = "matmult-int", .time = 0}, // - {.handle = &libminver_handle, .name = "libminver", .time = 0}, // - {.handle = &nobody_handle, .name = "nbody", .time = 0}, // - {.handle = &nettle_aes_handle, .name = "nettle-aes", .time = 0}, // - {.handle = &nettle_sha256_handle, .name = "nettle-sha256", .time = 0}, // - {.handle = &libnsichneu_handle, .name = "libnsichneu", .time = 0}, // - {.handle = &picojpeg_handle, .name = "picojpeg", .time = 0}, // - {.handle = &primecount_handle, .name = "primecount", .time = 0}, // - {.handle = &qrtest_handle, .name = "qrtest", .time = 0}, // - {.handle = &combined_handle, .name = "combined", .time = 0}, // - {.handle = &slre_handle, .name = "slre", .time = 0}, // - {.handle = &libst_handle, .name = "libst", .time = 0}, // - {.handle = &statemate_handle, .name = "statemate", .time = 0}, // - {.handle = &tarfind_handle, .name = "tarfind", .time = 0}, // - {.handle = &libud_handle, .name = "libud", .time = 0}, // - {.handle = &libwikisort_handle, .name = "libwikisort", .time = 0}, // - {.handle = NULL, .name = "", .time = 0}, // + {.handle = &mont64_handle, .name = "mont", .time = 0}, // + {.handle = &crc32_handle, .name = "crc32", .time = 0}, // + {.handle = &md5_handle, .name = "md5sum", .time = 0}, // + {.handle = &cubic_handle, .name = "cubic", .time = 0}, // + {.handle = &edn_handle, .name = "edn", .time = 0}, // + {.handle = &huffbench_handle, .name = "huffbench", .time = 0}, // + {.handle = &matmult_int_handle, .name = "matmult-int", .time = 0}, // + {.handle = &libminver_handle, .name = "libminver", .time = 0}, // + {.handle = &nobody_handle, .name = "nbody", .time = 0}, // + {.handle = &nettle_aes_handle, .name = "nettle-aes", .time = 0}, // + // {.handle = &nettle_sha256_handle, .name = "nettle-sha256", .time = 0}, // + // {.handle = &libnsichneu_handle, .name = "libnsichneu", .time = 0}, // + // {.handle = &picojpeg_handle, .name = "picojpeg", .time = 0}, // + // {.handle = &primecount_handle, .name = "primecount", .time = 0}, // + {.handle = &qrtest_handle, .name = "qrtest", .time = 0}, // + {.handle = &combined_handle, .name = "combined", .time = 0}, // + {.handle = &slre_handle, .name = "slre", .time = 0}, // + {.handle = &libst_handle, .name = "libst", .time = 0}, // + {.handle = &statemate_handle, .name = "statemate", .time = 0}, // + {.handle = &tarfind_handle, .name = "tarfind", .time = 0}, // + {.handle = &libud_handle, .name = "libud", .time = 0}, // + {.handle = &libwikisort_handle, .name = "libwikisort", .time = 0}, // + {.handle = NULL, .name = "", .time = 0}, // }; float benchmark_time[25]; @@ -141,7 +141,7 @@ void *run_benchmark(void *args) { case_attr.schedparam.sched_priority = 25; case_attr.stacksize = 16384; - PrivSemaphoreCreate(&syn_sem, 0, -20); + PrivSemaphoreCreate(&syn_sem, 0, -17); PrivMutexCreate(&case_mu, 0); benchmark_handle *cur_handle = head.next; From ad1387cc1902889df4a4e161dd5b58c8014465a9 Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 21:23:31 +0800 Subject: [PATCH 67/70] add benchmark to app. TODO: test benchmark. --- APP_Framework/Applications/benchmark/support/benchmark.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index 110542075..be56988e8 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -141,7 +141,7 @@ void *run_benchmark(void *args) { case_attr.schedparam.sched_priority = 25; case_attr.stacksize = 16384; - PrivSemaphoreCreate(&syn_sem, 0, -17); + PrivSemaphoreCreate(&syn_sem, 0, -16); PrivMutexCreate(&case_mu, 0); benchmark_handle *cur_handle = head.next; From 7837d746ed47bf7b6ce4954ef5cc6104f275db0d Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 21:26:50 +0800 Subject: [PATCH 68/70] add benchmark to app. TODO: test benchmark. --- .../benchmark/support/benchmark.c | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index be56988e8..0449191ee 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -37,29 +37,29 @@ typedef struct BenchmarkPair { } BenchmarkPair; BenchmarkPair bmh_list[] = { - {.handle = &mont64_handle, .name = "mont", .time = 0}, // - {.handle = &crc32_handle, .name = "crc32", .time = 0}, // - {.handle = &md5_handle, .name = "md5sum", .time = 0}, // - {.handle = &cubic_handle, .name = "cubic", .time = 0}, // - {.handle = &edn_handle, .name = "edn", .time = 0}, // - {.handle = &huffbench_handle, .name = "huffbench", .time = 0}, // - {.handle = &matmult_int_handle, .name = "matmult-int", .time = 0}, // - {.handle = &libminver_handle, .name = "libminver", .time = 0}, // - {.handle = &nobody_handle, .name = "nbody", .time = 0}, // - {.handle = &nettle_aes_handle, .name = "nettle-aes", .time = 0}, // - // {.handle = &nettle_sha256_handle, .name = "nettle-sha256", .time = 0}, // - // {.handle = &libnsichneu_handle, .name = "libnsichneu", .time = 0}, // - // {.handle = &picojpeg_handle, .name = "picojpeg", .time = 0}, // - // {.handle = &primecount_handle, .name = "primecount", .time = 0}, // - {.handle = &qrtest_handle, .name = "qrtest", .time = 0}, // - {.handle = &combined_handle, .name = "combined", .time = 0}, // - {.handle = &slre_handle, .name = "slre", .time = 0}, // - {.handle = &libst_handle, .name = "libst", .time = 0}, // - {.handle = &statemate_handle, .name = "statemate", .time = 0}, // - {.handle = &tarfind_handle, .name = "tarfind", .time = 0}, // - {.handle = &libud_handle, .name = "libud", .time = 0}, // - {.handle = &libwikisort_handle, .name = "libwikisort", .time = 0}, // - {.handle = NULL, .name = "", .time = 0}, // + {.handle = &mont64_handle, .name = "mont", .time = 0}, // + {.handle = &crc32_handle, .name = "crc32", .time = 0}, // + {.handle = &md5_handle, .name = "md5sum", .time = 0}, // + {.handle = &cubic_handle, .name = "cubic", .time = 0}, // + {.handle = &edn_handle, .name = "edn", .time = 0}, // + {.handle = &huffbench_handle, .name = "huffbench", .time = 0}, // + {.handle = &matmult_int_handle, .name = "matmult-int", .time = 0}, // + {.handle = &libminver_handle, .name = "libminver", .time = 0}, // + {.handle = &nobody_handle, .name = "nbody", .time = 0}, // + {.handle = &nettle_aes_handle, .name = "nettle-aes", .time = 0}, // + {.handle = &nettle_sha256_handle, .name = "nettle-sha256", .time = 0}, // + {.handle = &libnsichneu_handle, .name = "libnsichneu", .time = 0}, // + {.handle = &picojpeg_handle, .name = "picojpeg", .time = 0}, // + {.handle = &primecount_handle, .name = "primecount", .time = 0}, // + {.handle = &qrtest_handle, .name = "qrtest", .time = 0}, // + {.handle = &combined_handle, .name = "combined", .time = 0}, // + {.handle = &slre_handle, .name = "slre", .time = 0}, // + {.handle = &libst_handle, .name = "libst", .time = 0}, // + {.handle = &statemate_handle, .name = "statemate", .time = 0}, // + {.handle = &tarfind_handle, .name = "tarfind", .time = 0}, // + {.handle = &libud_handle, .name = "libud", .time = 0}, // + {.handle = &libwikisort_handle, .name = "libwikisort", .time = 0}, // + {.handle = NULL, .name = "", .time = 0}, // }; float benchmark_time[25]; @@ -141,7 +141,7 @@ void *run_benchmark(void *args) { case_attr.schedparam.sched_priority = 25; case_attr.stacksize = 16384; - PrivSemaphoreCreate(&syn_sem, 0, -16); + PrivSemaphoreCreate(&syn_sem, 0, -20); PrivMutexCreate(&case_mu, 0); benchmark_handle *cur_handle = head.next; From cfa923decff937a311c05389cd0e4ca7581f7d01 Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Wed, 7 Dec 2022 21:29:46 +0800 Subject: [PATCH 69/70] add benchmark to app. TODO: test benchmark. --- APP_Framework/Applications/benchmark/support/support.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/APP_Framework/Applications/benchmark/support/support.h b/APP_Framework/Applications/benchmark/support/support.h index 4b29cd806..f86c6a543 100644 --- a/APP_Framework/Applications/benchmark/support/support.h +++ b/APP_Framework/Applications/benchmark/support/support.h @@ -29,7 +29,7 @@ #include #include -#define CPU_MHZ 10 +#define CPU_MHZ 5 /* Benchmarks must implement verify_benchmark, which must return -1 if no verification is done. */ From da410c852920da4eb325b044c10ddbcd3fe8d711 Mon Sep 17 00:00:00 2001 From: TXuian <1163589503@qq.com> Date: Thu, 8 Dec 2022 15:18:41 +0800 Subject: [PATCH 70/70] Add Benchmark to App. TODO: Test Benchmark at other kernels. --- APP_Framework/Applications/benchmark/support/benchmark.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/APP_Framework/Applications/benchmark/support/benchmark.c b/APP_Framework/Applications/benchmark/support/benchmark.c index 0449191ee..60bdaad40 100644 --- a/APP_Framework/Applications/benchmark/support/benchmark.c +++ b/APP_Framework/Applications/benchmark/support/benchmark.c @@ -139,7 +139,7 @@ void *run_benchmark(void *args) { init_benchmark_runset(&head); printf("[BENCHMARK] Start Benchmark running.\n"); - case_attr.schedparam.sched_priority = 25; + case_attr.schedparam.sched_priority = 30; case_attr.stacksize = 16384; PrivSemaphoreCreate(&syn_sem, 0, -20); PrivMutexCreate(&case_mu, 0); @@ -153,7 +153,9 @@ void *run_benchmark(void *args) { cur_handle = cur_handle->next; } - PrivSemaphoreObtainWait(&syn_sem, NULL); + struct timespec abstime; + abstime.tv_sec = 10; + PrivSemaphoreObtainWait(&syn_sem, &abstime); print_result(); printf("[BENCHMARK] Global Time Diff: %f, Done: %d\n", global_diff, done_cnt); return NULL;