Skip to content

Instantly share code, notes, and snippets.

@winter-muted
Created November 15, 2018 21:43
Show Gist options
  • Save winter-muted/581509a48c895659337a074c02484cd3 to your computer and use it in GitHub Desktop.
Save winter-muted/581509a48c895659337a074c02484cd3 to your computer and use it in GitHub Desktop.
gem5 runscript for CDA5106 project
#!/bin/bash
#############################
# This code is unlicensed.
# Do whatever you want with it.
#############################
# Put this code in your gem5 root directory.
# Name it whatever you want.
# For *nix, be sure to mark it executable...
# $ chmod u+x [name_you_chose]
#
# Execute from command line in gem5 dir:
# $ ./[name_you_chose]
#
############################
# TODO Change this unless you are Bruce
gem5_install_dir='/run/media/bruce/buffer/gem5'
fs_dir="$gem5_install_dir/fs/"
config="configs/example/fs.py"
# First command line argument of this script is used
# to create a unique output folder. Example:
# $ ./my_gem5.sh L2-512 &
# $ ./my_gem5.sh L2-1024 &
if [ "$#" == 1 ]; then # FRAGILE
output_str=$1
output="-d $output_str"
fi
# put required options here
kernel="--kernel=$fs_dir/binaries/vmlinux.vexpress_gem5_v1_64.20170616"
image="--disk-image=$fs_dir/disks/expanded-linaro-minimal-aarch64.img"
dtb="--dtb=$fs_dir/binaries/armv8_gem5_v1_1cpu.20170616.dtb"
machine="--machine-type=VExpress_GEM5_V1" # This bit was important!
cpu="--cpu-type=O3_ARM_v7a_3"
caches="--caches"
# put test options here. you'll have to do some hunting
# to figure out what flags matter for your experiment
ruby="--ruby"
l2_size="--l2_size=512kB"
l3_size="$blah" # unset vars dont affect the commmand line
speed_of_light="--really-fast" # invalid options will cause breakage
# Concatenate required options
req_options="$kernel $image $dtb $machine $cpu $caches "
# Choose which test options to include
test_options="$l2_size $l3_size $ruby"
# Make the computer do the work
build/ARM/gem5.opt $output $config $req_options $test_options
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment