CPU Performance测试(CoreMark、BenchMark)

CPU Performance测试(CoreMark、BenchMark)本文详述了 CPU 性能测试工具 CoreMark 的使用 尤其针对 ARMSOC 平台 适合对 C C 和 Linux 有一定了解的读者

大家好,欢迎来到IT知识分享网。

1)本章主要讲解CPU性能测试工具CoreMark使用说明,其他ARM SOC厂商(MTK/海思/Mstar/Amlogic/SigmaStar/全志/RockChip平台)都适用。

2)适用于对C/C++语言有基本的认识,以及对Linux环境有基本的掌握能力。

3)内容属于原创,若转载,请说明出处。

4)本人提供相关问题有偿答疑和技术支持。

简介:CoreMark是一款用于评估CPU Performance性能BenchMark的基准测试程序,CoreMark目前取代了过时的 Dhrystone 基准测试,它包含了多种不同的计算任务,包括浮点数、整数、缓存、内存等方面的测试。CoreMark的测试结果通常被用来作为ARM/RISC-V 32位、64位  CPU性能的参考,它可以帮助开发人员和系统管理员评估不同处理器和系统的性能,比较不同处理器之间的性能差异,也可以用来测试处理器在多线程并行计算方面的性能。

#File: core_portme.mak CROSS_COMPILE = arm-linux-gnueabihf- # Flag: OUTFLAG # Use this flag to define how to to get an executable (e.g -o) OUTFLAG= -o # Flag: CC # Use this flag to define compiler to use CC = $(CROSS_COMPILE)gcc # Flag: CFLAGS # Use this flag to define compiler options. Note, you can add compiler options from the command line using XCFLAGS="other flags" PORT_CFLAGS = -mcpu=cortex-a32 -mfpu=neon -static -O3 FLAGS_STR = "$(PORT_CFLAGS) $(XCFLAGS) $(XLFLAGS) $(LFLAGS_END)" CFLAGS = $(PORT_CFLAGS) -I$(PORT_DIR) -I. -DFLAGS_STR=\"$(FLAGS_STR)\" #Flag: LFLAGS_END # Define any libraries needed for linking or other flags that should come at the end of the link line (e.g. linker scripts). # Note: On certain platforms, the default clock_gettime implementation is supported but requires linking of librt. LFLAGS_END += -lrt # Flag: PORT_SRCS # Port specific source files can be added here PORT_SRCS = $(PORT_DIR)/core_portme.c # Flag: LOAD # Define this flag if you need to load to a target, as in a cross compile environment. # Flag: RUN # Define this flag if running does not consist of simple invocation of the binary. # In a cross compile environment, you need to define this. #For flashing and using a tera term macro, you could use #LOAD = flash ADDR #RUN = ttpmacro coremark.ttl #For copying to target and executing via SSH connection, you could use #LOAD = scp $(OUTFILE) user@target:~ #RUN = ssh user@target -c #For native compilation and execution LOAD = echo Loading done RUN = OEXT = .o EXE = .exe # Flag: SEPARATE_COMPILE # Define if you need to separate compilation from link stage. # In this case, you also need to define below how to create an object file, and how to link. ifdef SEPARATE_COMPILE LD = $(CROSS_COMPILE)gcc OBJOUT = -o LFLAGS = OFLAG = -o COUT = -c # Flag: PORT_OBJS # Port specific object files can be added here PORT_OBJS = $(PORT_DIR)/core_portme$(OEXT) PORT_CLEAN = *$(OEXT) $(OPATH)%$(OEXT) : %.c $(CC) $(CFLAGS) $(XCFLAGS) $(COUT) $< $(OBJOUT) $@ ..... ..... .....

测试:(CA32平台测试)

/tmp # ls coremark-arm_ca32 /tmp # ./coremark-arm_ca32 2K performance run parameters for coremark. CoreMark Size : 666 Total ticks : 14167 Total time (secs): 14. Iterations/Sec : 2117. Iterations : 30000 Compiler version : GCC11.1.0 Compiler flags : -mcpu=cortex-a32 -mfpu=neon -static -O3 -lrt Memory location : Please put data memory location here (e.g. code in flash, data on heap etc) seedcrc : 0xe9f5 [0]crclist : 0xe714 [0]crcmatrix : 0x1fd7 [0]crcstate : 0x8e3a [0]crcfinal : 0x5275 Correct operation validated. See readme.txt for run and reporting rules. CoreMark 1.0 : 2117. / GCC11.1.0 -mcpu=cortex-a32 -mfpu=neon -static -O3 -lrt / Heap

CoreMark 1.0 : 2117.即为本次测试得分,类似于手机的安兔兔跑分一样,分值越高性能越好。如下是完整的修改源码:

#File: core_portme.mak CROSS_COMPILE = arm-linux-gnueabihf- # Flag: OUTFLAG # Use this flag to define how to to get an executable (e.g -o) OUTFLAG= -o # Flag: CC # Use this flag to define compiler to use CC = $(CROSS_COMPILE)gcc # Flag: CFLAGS # Use this flag to define compiler options. Note, you can add compiler options from the command line using XCFLAGS="other flags" PORT_CFLAGS = -mcpu=cortex-a32 -mfpu=neon -static -O3 FLAGS_STR = "$(PORT_CFLAGS) $(XCFLAGS) $(XLFLAGS) $(LFLAGS_END)" CFLAGS = $(PORT_CFLAGS) -I$(PORT_DIR) -I. -DFLAGS_STR=\"$(FLAGS_STR)\" #Flag: LFLAGS_END # Define any libraries needed for linking or other flags that should come at the end of the link line (e.g. linker scripts). # Note: On certain platforms, the default clock_gettime implementation is supported but requires linking of librt. LFLAGS_END += -lrt # Flag:

免责声明:本站所有文章内容,图片,视频等均是来源于用户投稿和互联网及文摘转载整编而成,不代表本站观点,不承担相关法律责任。其著作权各归其原作者或其出版社所有。如发现本站有涉嫌抄袭侵权/违法违规的内容,侵犯到您的权益,请在线联系站长,一经查实,本站将立刻删除。 本文来自网络,若有侵权,请联系删除,如若转载,请注明出处:https://haidsoft.com/134894.html

(0)
上一篇 2025-07-08 19:20
下一篇 2025-07-08 19:26

相关推荐

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注微信