From 8184828bd23178c0754a6e04b1e60ba6444c6eb5 Mon Sep 17 00:00:00 2001 From: Huaqi Fang <578567190@qq.com> Date: Tue, 16 Jan 2024 14:13:47 +0800 Subject: [PATCH] application: Fix coremark and whetstone IPC calculation Signed-off-by: Huaqi Fang <578567190@qq.com> --- application/baremetal/benchmark/coremark/core_main.c | 2 +- application/baremetal/benchmark/whetstone/whets.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/application/baremetal/benchmark/coremark/core_main.c b/application/baremetal/benchmark/coremark/core_main.c index a5683f43..8694c2a5 100644 --- a/application/baremetal/benchmark/coremark/core_main.c +++ b/application/baremetal/benchmark/coremark/core_main.c @@ -422,7 +422,7 @@ MAIN_RETURN_TYPE main(int argc, char* argv[]) ee_printf("CSV, CoreMark, %u, %u, %u.%s\n", \ (unsigned int)results[0].iterations, (unsigned int)total_time, (unsigned int)(cmk_dmips/1000), pstr); - float f_ipc = (((float)total_time / total_instret)); + float f_ipc = (((float)total_instret / total_time)); uint32_t i_ipc = (uint32_t)(f_ipc * 1000); pstr = dec2str(i_ipc); diff --git a/application/baremetal/benchmark/whetstone/whets.c b/application/baremetal/benchmark/whetstone/whets.c index 8dbb1de7..4ff47525 100644 --- a/application/baremetal/benchmark/whetstone/whets.c +++ b/application/baremetal/benchmark/whetstone/whets.c @@ -316,7 +316,7 @@ int main(void) printf("\nCSV, Benchmark, MWIPS/MHz\n"); printf("CSV, Whetstone, %u.%s\n", (unsigned int)(whet_mwips/1000), pstr); - float f_ipc = (((float)used_cycle / used_instret)); + float f_ipc = (((float)used_instret / used_cycle)); uint32_t i_ipc = (uint32_t)(f_ipc * 1000); pstr = dec2str(i_ipc);