交叉编译Coremark v1.01并在LS1046ARDB测试

下载源码

alan@FSLChengdu:/data/alan/lsdk$ git clone https://github.com/eembc/coremark.git

预备编译环境

alan@FSLChengdu:/data/alan/lsdk/coremark$ source /opt/fsl-qoriq/2.0/environment-setup-aarch64-fsl-linux

因为要在android上测试,所以需要静态链接,修改Makefile

diff --git a/linux64/core_portme.mak b/linux64/core_portme.mak

index 5cfabee..28f12d0 100755

--- a/linux64/core_portme.mak

+++ b/linux64/core_portme.mak

@@ -21,12 +21,12 @@

OUTFLAG= -o

# Flag: CC

#      Use this flag to define compiler to use

-CC = gcc

+CC = aarch64-fsl-linux-gcc  --sysroot=/opt/fsl-qoriq/2.0/sysroots/aarch64-fsl-linux

# 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 = -O2

FLAGS_STR = "$(PORT_CFLAGS) $(XCFLAGS) $(XLFLAGS) $(LFLAGS_END)"

-CFLAGS = $(PORT_CFLAGS) -I$(PORT_DIR) -I. -DFLAGS_STR=\"$(FLAGS_STR)\"

+CFLAGS = $(PORT_CFLAGS) -I$(PORT_DIR) -I. -DFLAGS_STR=\"$(FLAGS_STR)\" -static

#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.

编译单核版本

alan@FSLChengdu:/data/alan/lsdk/coremark$ make PORT_CFLAGS="-O3 -funroll-all-loops --param max-inline-insns-auto=550" PORT_DIR=linux64

alan@FSLChengdu:/data/alan/lsdk/coremark$ file coremark.exe

coremark.exe: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, for GNU/Linux 3.14.0, BuildID[sha1]=c6bcd6a2a56bca92735d6d308113902632f0d2ef, not stripped

编译4核版本

alan@FSLChengdu:/data/alan/lsdk/coremark$ make PORT_CFLAGS="-O3 -funroll-all-loops -static --param max-inline-insns-auto=550" PORT_DIR=linux64

上传到LS1046ARDB板子测试

单核coremark性能

layerscape:/system/xbin # ./coremark.1thread

2K performance run parameters for coremark.

CoreMark Size    : 666

Total ticks      : 17748

Total time (secs): 17.748000

Iterations/Sec  : 11268.875366

Iterations      : 200000

Compiler version : GCC4.9.3 20150311 (prerelease)

Compiler flags  : -O3 -funroll-all-loops --param max-inline-insns-auto=550 -DPERFORMANCE_RUN=1  -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      : 0x4983

Correct operation validated. See readme.txt for run and reporting rules.

CoreMark 1.0 : 11268.875366 / GCC4.9.3 20150311 (prerelease) -O3 -funroll-all-loops --param max-inline-insns-auto=550 -DPERFORMANCE_RU                                                        N=1  -lrt / Heap

4核coremark性能

layerscape:/system/xbin # ./coremark.4thread

2K performance run parameters for coremark.

CoreMark Size    : 666

Total ticks      : 18273

Total time (secs): 18.273000

Iterations/Sec  : 43780.441088

Iterations      : 800000

Compiler version : GCC4.9.3 20150311 (prerelease)

Compiler flags  : -O3 -funroll-all-loops --param max-inline-insns-auto=550 -DMULTITHREAD=4 -DUSE_FORK=1 -DPERFORMANCE_RUN=1  -lrt

Parallel Fork : 4

Memory location  : Please put data memory location here

                        (e.g. code in flash, data on heap etc)

你可能感兴趣的:(交叉编译Coremark v1.01并在LS1046ARDB测试)