111291Sgabor.dozsa@arm.com#! /bin/bash
211291Sgabor.dozsa@arm.com
311291Sgabor.dozsa@arm.com#
411291Sgabor.dozsa@arm.com# Copyright (c) 2015 ARM Limited
511291Sgabor.dozsa@arm.com# All rights reserved
611291Sgabor.dozsa@arm.com#
711291Sgabor.dozsa@arm.com# The license below extends only to copyright in the software and shall
811291Sgabor.dozsa@arm.com# not be construed as granting a license to any other intellectual
911291Sgabor.dozsa@arm.com# property including but not limited to intellectual property relating
1011291Sgabor.dozsa@arm.com# to a hardware implementation of the functionality of the software
1111291Sgabor.dozsa@arm.com# licensed hereunder.  You may use the software subject to the license
1211291Sgabor.dozsa@arm.com# terms below provided that you ensure that this notice is replicated
1311291Sgabor.dozsa@arm.com# unmodified and in its entirety in all distributions of the software,
1411291Sgabor.dozsa@arm.com# modified or unmodified, in source code or in binary form.
1511291Sgabor.dozsa@arm.com#
1611291Sgabor.dozsa@arm.com# Redistribution and use in source and binary forms, with or without
1711291Sgabor.dozsa@arm.com# modification, are permitted provided that the following conditions are
1811291Sgabor.dozsa@arm.com# met: redistributions of source code must retain the above copyright
1911291Sgabor.dozsa@arm.com# notice, this list of conditions and the following disclaimer;
2011291Sgabor.dozsa@arm.com# redistributions in binary form must reproduce the above copyright
2111291Sgabor.dozsa@arm.com# notice, this list of conditions and the following disclaimer in the
2211291Sgabor.dozsa@arm.com# documentation and/or other materials provided with the distribution;
2311291Sgabor.dozsa@arm.com# neither the name of the copyright holders nor the names of its
2411291Sgabor.dozsa@arm.com# contributors may be used to endorse or promote products derived from
2511291Sgabor.dozsa@arm.com# this software without specific prior written permission.
2611291Sgabor.dozsa@arm.com#
2711291Sgabor.dozsa@arm.com# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
2811291Sgabor.dozsa@arm.com# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
2911291Sgabor.dozsa@arm.com# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
3011291Sgabor.dozsa@arm.com# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
3111291Sgabor.dozsa@arm.com# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
3211291Sgabor.dozsa@arm.com# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3311291Sgabor.dozsa@arm.com# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
3411291Sgabor.dozsa@arm.com# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
3511291Sgabor.dozsa@arm.com# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
3611291Sgabor.dozsa@arm.com# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3711291Sgabor.dozsa@arm.com# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3811291Sgabor.dozsa@arm.com#
3911291Sgabor.dozsa@arm.com# Authors: Gabor Dozsa
4011291Sgabor.dozsa@arm.com#
4111291Sgabor.dozsa@arm.com#
4211291Sgabor.dozsa@arm.com# This is an example script to start a dist gem5 simulations using
4311291Sgabor.dozsa@arm.com# two AArch64 systems. It is also uses the example
4411291Sgabor.dozsa@arm.com# dist gem5 bootscript util/dist/test/simple_bootscript.rcS that will
4511291Sgabor.dozsa@arm.com# run the linux ping command to check if we can see the peer system
4611291Sgabor.dozsa@arm.com# connected via the simulated Ethernet link.
4711291Sgabor.dozsa@arm.com
4811291Sgabor.dozsa@arm.comGEM5_DIR=$(pwd)/$(dirname $0)/../../..
4911291Sgabor.dozsa@arm.com
5011291Sgabor.dozsa@arm.comIMG=$M5_PATH/disks/aarch64-ubuntu-trusty-headless.img
5111291Sgabor.dozsa@arm.comVMLINUX=$M5_PATH/binaries/vmlinux.aarch64.20140821
5211291Sgabor.dozsa@arm.comDTB=$M5_PATH/binaries/vexpress.aarch64.20140821.dtb
5311291Sgabor.dozsa@arm.com
5411291Sgabor.dozsa@arm.comFS_CONFIG=$GEM5_DIR/configs/example/fs.py
5511444Sm.alian1369@gmail.comSW_CONFIG=$GEM5_DIR/configs/dist/sw.py
5611291Sgabor.dozsa@arm.comGEM5_EXE=$GEM5_DIR/build/ARM/gem5.opt
5711291Sgabor.dozsa@arm.com
5811291Sgabor.dozsa@arm.comBOOT_SCRIPT=$GEM5_DIR/util/dist/test/simple_bootscript.rcS
5911291Sgabor.dozsa@arm.comGEM5_DIST_SH=$GEM5_DIR/util/dist/gem5-dist.sh
6011291Sgabor.dozsa@arm.com
6111291Sgabor.dozsa@arm.comDEBUG_FLAGS="--debug-flags=DistEthernet"
6211291Sgabor.dozsa@arm.com#CHKPT_RESTORE="-r1"
6311291Sgabor.dozsa@arm.com
6411291Sgabor.dozsa@arm.comNNODES=2
6511291Sgabor.dozsa@arm.com
6611291Sgabor.dozsa@arm.com$GEM5_DIST_SH -n $NNODES                                                     \
6711291Sgabor.dozsa@arm.com              -x $GEM5_EXE                                                   \
6811291Sgabor.dozsa@arm.com              -s $SW_CONFIG                                                  \
6911291Sgabor.dozsa@arm.com              -f $FS_CONFIG                                                  \
7011291Sgabor.dozsa@arm.com              --m5-args                                                      \
7111291Sgabor.dozsa@arm.com                 $DEBUG_FLAGS                                                \
7211291Sgabor.dozsa@arm.com              --fs-args                                                      \
7311291Sgabor.dozsa@arm.com                  --cpu-type=atomic                                          \
7411291Sgabor.dozsa@arm.com		  --num-cpus=1                                               \
7511291Sgabor.dozsa@arm.com                  --machine-type=VExpress_EMM64                              \
7611291Sgabor.dozsa@arm.com                  --disk-image=$IMG                                          \
7711291Sgabor.dozsa@arm.com                  --kernel=$VMLINUX                                          \
7811291Sgabor.dozsa@arm.com                  --dtb-filename=$DTB                                        \
7911291Sgabor.dozsa@arm.com                  --script=$BOOT_SCRIPT                                      \
8011291Sgabor.dozsa@arm.com              --cf-args                                                      \
8111291Sgabor.dozsa@arm.com                  $CHKPT_RESTORE
8211291Sgabor.dozsa@arm.com
83