This commit is contained in:
TXuian 2022-12-12 12:19:47 +08:00
parent fce0d6b6ac
commit 65a7e3f6ed
3 changed files with 14 additions and 6 deletions

View File

@ -1448,6 +1448,7 @@ benchmark.c.home.tyy.works.xiuos.APP_Framework.Applications.benchmark.o: \
/home/tyy/works/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/termios.h \ /home/tyy/works/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/termios.h \
/home/tyy/works/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/nuttx/arch.h \ /home/tyy/works/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/nuttx/arch.h \
/home/tyy/works/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/nuttx/cache.h \ /home/tyy/works/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/include/nuttx/cache.h \
/home/tyy/works/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/apps/../../../APP_Framework/Applications/benchmark/support/beebsc.h /home/tyy/works/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/apps/../../../APP_Framework/Applications/benchmark/support/beebsc.h \
/home/tyy/works/xiuos/Ubiquitous/Nuttx_Fusion_XiUOS/apps/../../../APP_Framework/Framework/connection/zigbee/e18/../../../../../Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/arch/risc-v/src/k210/encoding.h
# No files specified for dependency generation # No files specified for dependency generation
# No files specified for dependency generation # No files specified for dependency generation

View File

@ -5,6 +5,12 @@
#include <time.h> #include <time.h>
#include <transform.h> #include <transform.h>
// #define NUTTX
#ifdef NUTTX
// #include "k210_sysctl.h"
#include "../../../../../Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/arch/risc-v/src/k210/encoding.h"
#endif
extern benchmark_handle mont64_handle; extern benchmark_handle mont64_handle;
extern benchmark_handle crc32_handle; extern benchmark_handle crc32_handle;
extern benchmark_handle md5_handle; extern benchmark_handle md5_handle;
@ -80,7 +86,7 @@ void start_trigger(clock_t *start_time) {
*start_time = read_cycle(); *start_time = read_cycle();
} }
void stop_trigger(clock_t *end_time) { void stop_trigger(clock_t *end_time) {
*end_time = PrivGetTickTime(); // *end_time = PrivGetTickTime();
*end_time = read_cycle(); *end_time = read_cycle();
} }
@ -109,7 +115,7 @@ void organize_result(const benchmark_handle *handle, clock_t start_time,
void print_result() { void print_result() {
int i = 0; int i = 0;
while (bmh_list[i].handle != NULL) { while (bmh_list[i].handle != NULL) {
printf("[BENCHMARK] Time Cost: %-15s %7ld\n", bmh_list[i].name, printf("[BENCHMARK] Time Cost: %-15s %20ld\n", bmh_list[i].name,
bmh_list[i].time); bmh_list[i].time);
i++; i++;
} }
@ -121,11 +127,11 @@ void *print_result_asyn() {
stop_trigger(&g_stop_time); stop_trigger(&g_stop_time);
int i = 0; int i = 0;
while (bmh_list[i].handle != NULL) { while (bmh_list[i].handle != NULL) {
printf("[BENCHMARK] Time Cost: %-15s %7ld\n", bmh_list[i].name, printf("[BENCHMARK] Time Cost: %-15s %20ld\n", bmh_list[i].name,
bmh_list[i].time); bmh_list[i].time);
i++; i++;
} }
printf("[BENCHMARK] Global Time Diff: %7ld, %d\n", printf("[BENCHMARK] Global Time Diff: %20ld, %d\n",
(clock_t)(g_stop_time - g_start_time), done_cnt); (clock_t)(g_stop_time - g_start_time), done_cnt);
}; };
@ -240,7 +246,7 @@ void *run_benchmark_sequential(void *args) {
stop_trigger(&s_stop_time); stop_trigger(&s_stop_time);
print_result(); print_result();
printf("[BENCHMARK] Global Time Diff: %7ld\n", printf("[BENCHMARK] Global Time Diff: %20ld\n",
(clock_t)(s_stop_time - s_start_time)); (clock_t)(s_stop_time - s_start_time));
} }

View File

@ -69,6 +69,7 @@ APPPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Applications/benchmark/src/cubi
-I$(KERNEL_ROOT)/../../APP_Framework/Applications/benchmark/src/qrduino \ -I$(KERNEL_ROOT)/../../APP_Framework/Applications/benchmark/src/qrduino \
-I$(KERNEL_ROOT)/../../APP_Framework/Applications/benchmark/src/sglib-combined \ -I$(KERNEL_ROOT)/../../APP_Framework/Applications/benchmark/src/sglib-combined \
-I$(KERNEL_ROOT)/../../APP_Framework/Applications/benchmark/src/slre \ -I$(KERNEL_ROOT)/../../APP_Framework/Applications/benchmark/src/slre \
-I$(KERNEL_ROOT)/../../Ubiquitous/Nuttx_Fusion_XiUOS/nuttx/arch/risc-v/src/k210 \
-lm -lm
export SRC_APP_DIR = ../../../APP_Framework export SRC_APP_DIR = ../../../APP_Framework