gem5 ARM架构,FS模式下运行parsec 3.0

FS Benchmarks parsec
parsec patches and runscript

第一步:下载parsec3.0

$ wget http://parsec.cs.princeton.edu/download/3.0/parsec-3.0.tar.gz
$ tar -xvzf parsec-3.0.tar.gz

第二步:编译 PARSEC benchmarks for Arm:

有两种方法:

  • Cross-compiling on an x86 machine
  • Compiling on QEMU

首先做准备工作:

1.进入parsec目录,应用static-patch.diff

patch -p1 < ../path_to_patches/static-patch.diff

2.替换config.guess 和config.sub文件

  • [注意 ] /parsec_dir/ 和 /absolute_path_to_tmp/的路径
$ mkdir tmp; cd tmp # make a tmp dir outside the parsec dir
$ wget -O config.guess 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD'
$ wget -O config.sub 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD'
$ cd /parsec_dir/ # cd to the parsec dir
$ find . -name "config.guess" -type f -print -execdir cp {} config.guess_old \;
$ find . -name "config.guess" -type f -print -execdir cp /absolute_path_to_tmp/config.guess {} \;
$ find . -name "config.sub" -type f -print -execdir cp {} config.sub_old \;
$ find . -name "config.sub" -type f -print -execdir cp /absolute_path_to_tmp/config.sub {} \;

接着进行编译:Cross-compiling on an x86 machine (具体方法见FS Benchmarks parsec)

我们采用Compiling on QEMU方式编译:
step1: 进入parsec目录,应用qemu-patch.diff

$ patch -p1 < ../path_to_patches/qemu-patch.diff

step 2:检查依赖关系

$ sudo apt-get install libglib2.0 libpixman-1-dev libfdt-dev libcap-dev libattr1-dev

step3: 下载和make QEMU

$ git clone git://git.qemu.org/qemu.git qemu
$ cd qemu
$ ./configure --target-list=aarch64-softmmu
$ make

step4: 获取Arm AArch64 kernel and disk image for QEMU:

$ wget http://releases.linaro.org/archive/15.06/openembedded/aarch64/Image 
$ wget http://releases.linaro.org/archive/15.06/openembedded/aarch64/vexpress64-openembedded_lamp-armv8-gcc-4.9_20150620-722.img.gz 
$ gzip -dc vexpress64-openembedded_lamp-armv8-gcc-4.9_20150620-722.img.gz > vexpress_arm64.img

注意:Image和vexpress_arm64.img文件均需要放在parsec目录下。

step5: 启动QEMU

  • [ 注意] 设置/shared_directory路径,该路径为parsec的目录路径,要修改以下shell对应部分
$ ./qemu/aarch64-softmmu/qemu-system-aarch64 -m 1024 -cpu cortex-a53 -nographic -machine virt -kernel Image -append 'root=/dev/vda2 rw rootwait mem=1024M console=ttyAMA0,38400n8' -drive if=none,id=image,file=vexpress_arm64.img -netdev user,id=user0 -device virtio-net-device,netdev=user0 -device virtio-blk-device,drive=image -fsdev local,id=r,path=/shared_directory/,security_model=none -device virtio-9p-device,fsdev=r,mount_tag=r

将/shared_directory/ 路径挂载到QEMU:

$ mount -t 9p -o trans=virtio r /mnt

step6: 在QEMU上编译PARSEC:

  • [ 注意] 设置pkgname的名称,为blackscholes,bodytrack等;
$ cd /mnt # cd to the mounted PARSEC directory
$ source ./env.sh
$ parsecmgmt -a build -c gcc-hooks -p <pkgname>
$ poweroff # quit QEMU

第三步:运行parsec

你可能感兴趣的:(gem5)