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] 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))