1#! /bin/bash
2
3#
4# Copyright (c) 2015 ARM Limited
5# All rights reserved
6#
7# The license below extends only to copyright in the software and shall
8# not be construed as granting a license to any other intellectual
9# property including but not limited to intellectual property relating
10# to a hardware implementation of the functionality of the software
11# licensed hereunder.  You may use the software subject to the license
12# terms below provided that you ensure that this notice is replicated
13# unmodified and in its entirety in all distributions of the software,
14# modified or unmodified, in source code or in binary form.
15#
16# Redistribution and use in source and binary forms, with or without
17# modification, are permitted provided that the following conditions are
18# met: redistributions of source code must retain the above copyright
19# notice, this list of conditions and the following disclaimer;
20# redistributions in binary form must reproduce the above copyright
21# notice, this list of conditions and the following disclaimer in the
22# documentation and/or other materials provided with the distribution;
23# neither the name of the copyright holders nor the names of its
24# contributors may be used to endorse or promote products derived from
25# this software without specific prior written permission.
26#
27# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
29# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
30# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
31# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
32# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
33# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
34# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
35# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
36# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
37# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38#
39# Authors: Gabor Dozsa
40#
41#
42# This is an example script to start a dist gem5 simulations using
43# two AArch64 systems. It is also uses the example
44# dist gem5 bootscript util/dist/test/simple_bootscript.rcS that will
45# run the linux ping command to check if we can see the peer system
46# connected via the simulated Ethernet link.
47
48GEM5_DIR=$(pwd)/$(dirname $0)/../../..
49
50IMG=$M5_PATH/disks/aarch64-ubuntu-trusty-headless.img
51VMLINUX=$M5_PATH/binaries/vmlinux.aarch64.20140821
52DTB=$M5_PATH/binaries/vexpress.aarch64.20140821.dtb
53
54FS_CONFIG=$GEM5_DIR/configs/example/fs.py
55SW_CONFIG=$GEM5_DIR/configs/dist/sw.py
56GEM5_EXE=$GEM5_DIR/build/ARM/gem5.opt
57
58BOOT_SCRIPT=$GEM5_DIR/util/dist/test/simple_bootscript.rcS
59GEM5_DIST_SH=$GEM5_DIR/util/dist/gem5-dist.sh
60
61DEBUG_FLAGS="--debug-flags=DistEthernet"
62#CHKPT_RESTORE="-r1"
63
64NNODES=2
65
66$GEM5_DIST_SH -n $NNODES                                                     \
67              -x $GEM5_EXE                                                   \
68              -s $SW_CONFIG                                                  \
69              -f $FS_CONFIG                                                  \
70              --m5-args                                                      \
71                 $DEBUG_FLAGS                                                \
72              --fs-args                                                      \
73                  --cpu-type=atomic                                          \
74		  --num-cpus=1                                               \
75                  --machine-type=VExpress_EMM64                              \
76                  --disk-image=$IMG                                          \
77                  --kernel=$VMLINUX                                          \
78                  --dtb-filename=$DTB                                        \
79                  --script=$BOOT_SCRIPT                                      \
80              --cf-args                                                      \
81                  $CHKPT_RESTORE
82
83