gem5: integrate fs_bigLITTLE.py into run

This commit is contained in:
Ciro Santilli
2018-06-17 12:05:00 +01:00
parent 57dbe81f33
commit 18c1c823fe
4 changed files with 112 additions and 82 deletions

View File

@@ -6390,9 +6390,9 @@ The out of build tree is required, because otherwise Buildroot would copy the ou
=== gem5 fs_bigLITTLE === gem5 fs_bigLITTLE
TODO integrate into `run`. There is no way to pass command line arguments except by hacking the script, this is a pre-requisite for good integration. By default, we use `configs/example/fs.py` script.
This system is more representative of ARM, which almost always has the big little cluster. The `-X-b` option enables the alternative `configs/example/arm/fs_bigLITTLE.py` script instead.
First apply: First apply:
@@ -6418,14 +6418,20 @@ index 7d66c03a6..d71e714fe 100644
then: then:
.... ....
./fs-biglittle ./run -aA -g -X-b
.... ....
Source: link:fs-biglittle[] Advantages over `fs.py`:
Boot messages start at 5 minutes, boot finishes at 10 minutes and gives a shell. * more representative of mobile ARM SoCs, which almost always have big little cluster
* simpler than `fs.py`, and therefore easier to understand and modify
`cat /proc/cpuinfo` shows 4 identical CPUs instead of 2 of two different types, likely because gem5 does not expose some informational register much like the caches: https://www.mail-archive.com/gem5-users@gem5.org/msg15426.html `config.ini` does show that the two big ones are `DerivO3CPU` and the small ones are `MinorCPU`. Disadvantages over `fs.py`:
* only works for ARM, not other archs
* not as many configuration options as `fs.py`, many things are hardcoded
We setup 2 big and 2 small CPUs, but `cat /proc/cpuinfo` shows 4 identical CPUs instead of 2 of two different types, likely because gem5 does not expose some informational register much like the caches: https://www.mail-archive.com/gem5-users@gem5.org/msg15426.html `config.ini` does show that the two big ones are `DerivO3CPU` and the small ones are `MinorCPU`.
TODO: why is the `--dtb` required despite `fs_bigLITTLE.py` having a DTB generation capability? Without it, nothing shows on terminal, and the simulation terminates with `simulate() limit reached @ 18446744073709551615`. The magic `vmlinux.vexpress_gem5_v1.20170616` works however without a DTB. TODO: why is the `--dtb` required despite `fs_bigLITTLE.py` having a DTB generation capability? Without it, nothing shows on terminal, and the simulation terminates with `simulate() limit reached @ 18446744073709551615`. The magic `vmlinux.vexpress_gem5_v1.20170616` works however without a DTB.

View File

@@ -1,13 +0,0 @@
#!/usr/bin/env bash
. common
set_common_vars -L "${common_linux_variant}" -M "${common_gem5_variant}" aarch64 true
M5_PATH="${common_gem5_system_dir}" \
"${common_gem5_build_dir}/ARM/gem5.opt" \
"${common_gem5_default_src_dir}/configs/example/arm/fs_bigLITTLE.py" \
--big-cpus=2 \
--caches \
--disk="${common_images_dir}/rootfs.ext2" \
--dtb "${common_gem5_system_dir}/arm/dt/armv8_gem5_v1_big_little_2_2.dtb" \
--kernel="${common_vmlinux}" \
--little-cpus=2 \
;

34
run
View File

@@ -18,8 +18,10 @@ extra_append='console_msg_format=syslog nokaslr norandmaps printk.devkmsg=on pri
extra_append_after_dash= extra_append_after_dash=
extra_flags= extra_flags=
extra_flags_qemu= extra_flags_qemu=
extra_opts=
gem5=false gem5=false
gem5opts= gem5opts=
gem5_fsbiglittle=false
lkmc_eval= lkmc_eval=
initrd=false initrd=false
initramfs=false initramfs=false
@@ -34,7 +36,7 @@ trace_enabled=false
# just to prevent QEMU from emitting a warning that '' is not valid. # just to prevent QEMU from emitting a warning that '' is not valid.
trace_type=pr_manager_run trace_type=pr_manager_run
vnc= vnc=
while getopts a:c:DdE:e:F:f:G:ghIiKkL:M:m:n:PT:U:uVx OPT; do while getopts a:c:DdE:e:F:f:G:ghIiKkL:M:m:n:PT:U:uVX:x OPT; do
case "$OPT" in case "$OPT" in
a) a)
arch="$OPTARG" arch="$OPTARG"
@@ -114,6 +116,9 @@ while getopts a:c:DdE:e:F:f:G:ghIiKkL:M:m:n:PT:U:uVx OPT; do
u) u)
tmux=true tmux=true
;; ;;
X)
extra_opts="${extra_opts} ${OPTARG}"
;;
x) x)
nographic=false nographic=false
;; ;;
@@ -128,6 +133,17 @@ while getopts a:c:DdE:e:F:f:G:ghIiKkL:M:m:n:PT:U:uVx OPT; do
done done
shift "$(($OPTIND - 1))" shift "$(($OPTIND - 1))"
extra_flags="$extra_flags $@" extra_flags="$extra_flags $@"
OPTIND=1
while getopts b OPT "$extra_opts"; do
case "$OPT" in
b)
gem5_fsbiglittle=true
;;
?)
exit 2
;;
esac
done
set_common_vars -L "$common_linux_variant" -M "$common_gem5_variant" -n "$common_run_id" "$arch" "$gem5" set_common_vars -L "$common_linux_variant" -M "$common_gem5_variant" -n "$common_run_id" "$arch" "$gem5"
if "$debug" && "$kvm"; then if "$debug" && "$kvm"; then
echo 'error: -d and -K are incompatible' 1>&2 echo 'error: -d and -K are incompatible' 1>&2
@@ -176,6 +192,21 @@ ${debug_vm} \
--debug-file=trace.txt \\ --debug-file=trace.txt \\
${gem5opts} \ ${gem5opts} \
-d '${common_m5out_dir}' \\ -d '${common_m5out_dir}' \\
"
if "$gem5_fsbiglittle"; then
cmd="${gem5_common} \
"${common_gem5_default_src_dir}/configs/example/arm/fs_bigLITTLE.py" \
--big-cpus=2 \\
--cpu-type=atomic \\
--disk="${common_images_dir}/rootfs.ext2" \\
--dtb "${common_gem5_system_dir}/arm/dt/armv8_gem5_v1_big_little_2_2.dtb" \\
--kernel="${common_vmlinux}" \\
--little-cpus=2 \\
${extra_flags} \\
"
else
gem5_common="\
${gem5_common} \
'${common_gem5_src_dir}/configs/example/fs.py' \\ '${common_gem5_src_dir}/configs/example/fs.py' \\
--disk-image='${common_images_dir}/rootfs.ext2' \\ --disk-image='${common_images_dir}/rootfs.ext2' \\
--kernel='${common_vmlinux}' \\ --kernel='${common_vmlinux}' \\
@@ -202,6 +233,7 @@ ${extra_flags} \
${extra_flags} \ ${extra_flags} \
" "
fi fi
fi
else else
mkdir -p "$common_qemu_run_dir" mkdir -p "$common_qemu_run_dir"
if [ -z "$debug_vm" ]; then if [ -z "$debug_vm" ]; then

View File

@@ -58,5 +58,10 @@
** if on gem5, the gem5 terminal ** if on gem5, the gem5 terminal
|`-V` | |Run QEMU with VNC instead of the default SDL. |`-V` | |Run QEMU with VNC instead of the default SDL.
Connect to it with: `vinagre localhost:5900`. Connect to it with: `vinagre localhost:5900`.
|`-X` |`EXTRA_OPTS` |Extra options that did not fit into `A-z`!
This string is parsed by `getopt` on a separate parse step with different
meanings for each flag.
|`-X-b` | |Use `fs_bigLITTLE.py` instead of `fs.py` on gem5 simulation.
Ignored by QEMU.
|`-x` | |Run in graphic mode. Mnemonic: X11. |`-x` | |Run in graphic mode. Mnemonic: X11.
|=== |===