Home - MD Cheat Sheet: Get Arm Research Starter Kit
Home - MD Cheat Sheet: Get Arm Research Starter Kit
TABLE OF
CONTENTS
▸
Home.md
Home.md
Cheat Sheet
This Cheat Sheet contains all commands and code examples used in the Arm Research Starter Kit
(RSK) on System Modeling using gem5
1. Get Started
Follow these instructions to download all the required materials, build a gem5 binary and run simple
examples in both System Call Emulation (SE) and Full System (FS) modes.
$ wget https://raw.githubusercontent.com/arm-university/arm-gem5-rsk/master/clo
$ bash clone.sh
Build gem5
Build gem5 binaries for Arm
$ cd gem5
$ scons build/ARM/gem5.opt -j4 # parallel build
file:///Users/reyad/Downloads/documentation.html#Home 1/7
6/8/2019 Documentation
Note: each core runs its own program
FS Simulation
Get Arm full system disk image and set $M5_PATH :
$ wget http://www.gem5.org/dist/current/arm/aarch-system-20170616.tar.xz
$ tar xvfJ aarch-system-20170616.tar.xz
2. SE Benchmarks
We use the Stanford SingleSource workloads from the LLVM test-suite for benchmarking in the SE
mode.
Step1: create a .ini under the se_results directory (where the results of SE runs are
stored), e.g. exe_time.ini looks like this:
[Benchmarks]
Bubblesort
IntMM
Oscar
[Parameters]
sim_seconds
[Output]
res_exe_time.txt
Step2: run the read_results.sh bash script from the se_results directory and pass the
sample exe_time.ini file as a parameter:
3. FS Benchmarks
file:///Users/reyad/Downloads/documentation.html#Home 3/7
6/8/2019 Documentation
$ wget http://parsec.cs.princeton.edu/download/3.0/parsec-3.0.tar.gz
$ tar -xvzf parsec-3.0.tar.gz
Compiling on QEMU
Common Steps
Step1: from the parsec-3.0 directory, apply static-patch.diff :
$ 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=
$ wget -O config.sub 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=bl
$ cd /parsec_dir/ # cd to the parsec dir
$ find . -name "config.guess" -type f -print -execdir cp {} config.guess_ol
$ find . -name "config.guess" -type f -print -execdir cp /absolute_path_to_
$ find . -name "config.sub" -type f -print -execdir cp {} config.sub_old \;
$ find . -name "config.sub" -type f -print -execdir cp /absolute_path_to_tm
$ wget https://releases.linaro.org/components/toolchain/binaries/latest-5/aarch
$ tar xvfJ gcc-linaro-5.4.1-2017.05-x86_64_aarch64-linux-gnu.tar.xz
Note: before applying the patch, change the CC_HOME and the BINUTIL_HOME in the
xcompile-patch.diff to point to the downloaded <gcc-linaro directory> and
<gcc-linaro directory>/aarch64-linux-gnu directories
file:///Users/reyad/Downloads/documentation.html#Home 4/7
6/8/2019 Documentation
Cross-compile PARSEC:
Resolve dependencies
Get the 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
$ gzip -dc vexpress64-openembedded_lamp-armv8-gcc-4.9_20150620-722.img.gz > vex
Start QEMU:
file:///Users/reyad/Downloads/documentation.html#Home 5/7
6/8/2019 Documentation
Run PARSEC
To run PARSEC benchmarks on Arm, we need to enlarge the disk image and copy the directory of
compiled benchmarks parsec-3.0 to it. Then, we need to generate benchmark runscripts and pass
them via the --script option to the simulation script starter_fs.py .
$ cp linaro-minimal-aarch64.img expanded-linaro-minimal-aarch64.img
$ dd if=/dev/zero bs=1G count=20 >> ./expanded-linaro-minimal-aarch64.img # add
$ sudo parted expanded-linaro-minimal-aarch64.img resizepart 1 100% # grow part
Mount the expanded disk image, resize it, and copy PARSEC to it:
$ mkdir disk_mnt
$ name=$(sudo fdisk -l expanded-linaro-minimal-aarch64.img | tail -1 | awk
$ start_sector=$(sudo fdisk -l expanded-linaro-minimal-aarch64.img | grep $
$ units=$(sudo fdisk -l expanded-linaro-minimal-aarch64.img | grep ^Units |
$ sudo mount -o loop,offset=$(($start_sector*$units)) expanded-linaro-minim
$ df # find /dev/loopX for disk_mnt
$ sudo resize2fs /dev/loopX # resize filesystem
$ df # check that the Available space for disk_mnt is increased
$ sudo cp -r /path_to_compiled_parsec-3.0_dir/ disk_mnt/home/root # copy th
$ ls disk_mnt/home/root # check the parsec-3.0 contents
$ sudo umount disk_mnt
$ cd arm-gem5-rsk/parsec_rcs
$ bash gen_rcs.sh -i simsmall -p <pkgname> -i <simsmall/simmedium/simlarge> -n
file:///Users/reyad/Downloads/documentation.html#Home 6/7
6/8/2019 Documentation
file:///Users/reyad/Downloads/documentation.html#Home 7/7