GEM5 checkpoint

Add gem5 as buildroot package to cross compile m5.

Add gem5 as a submodule.

Split gem5 from arch on CLI with "-a arm -g" instead of "-a arm-gem5".
This commit is contained in:
Ciro Santilli
2018-02-21 00:44:17 +00:00
parent 0c2bd829d4
commit 9e5173f324
11 changed files with 133 additions and 54 deletions

38
rungem5
View File

@@ -1,5 +1,5 @@
#!/usr/bin/env bash
arch='arm-gem5'
arch=arm
while getopts 'a:' OPT; do
case "$OPT" in
a)
@@ -8,27 +8,27 @@ while getopts 'a:' OPT; do
esac
done
shift "$(($OPTIND - 1))"
outdir="$(pwd)/buildroot/output.${arch}~"
echo $arch
if echo "$arch" | grep -Eq '^x86_64(-|$)'; then
outdir="$(pwd)/buildroot/output.${arch}-gem5~"
gem5_dir="$(pwd)/gem5/gem5"
if [ "$arch" = x86_64 ]; then
cmd="\
M5_PATH=\"$(pwd)/gem5-system\" \
./gem5/build/X86/gem5.opt \
gem5/configs/example/fs.py \
--disk-image=\"${outdir}/images/rootfs.ext2\" \
--kernel=\"${outdir}/build/linux-custom/vmlinux\" \
--root-device='/dev/sda' \
M5_PATH='$(pwd)/gem5/gem5-system' \
'${gem5_dir}/build/X86/gem5.opt' \
'${gem5_dir}/configs/example/fs.py' \
--disk-image='${outdir}/images/rootfs.ext2' \
--kernel='${outdir}/build/linux-custom/vmlinux' \
--root-device=/dev/sda \
"
elif echo "$arch" | grep -Eq '^arm(-|$)'; then
elif [ "$arch" = arm ]; then
cmd="\
M5_PATH=\"$(pwd)/gem5-system\" \
./gem5/build/ARM/gem5.opt \
gem5/configs/example/fs.py \
--disk-image=\"${outdir}/images/rootfs.ext2\" \
--dtb-file=\"$(pwd)/gem5/system/arm/dt/armv7_gem5_v1_1cpu.dtb\" \
--kernel=\"${outdir}/build/linux-custom/vmlinux\" \
--machine-type='VExpress_GEM5_V1' \
--root-device='/dev/sda' \
M5_PATH='$(pwd)/gem5/gem5-system' \
'${gem5_dir}/build/ARM/gem5.opt' \
'${gem5_dir}/configs/example/fs.py' \
--disk-image='${outdir}/images/rootfs.ext2' \
--dtb-file='${gem5_dir}/system/arm/dt/armv7_gem5_v1_1cpu.dtb' \
--kernel='${outdir}/build/linux-custom/vmlinux' \
--machine-type=VExpress_GEM5_V1 \
--root-device=/dev/sda \
"
fi
cmd="$cmd \"\$@\""