19665Sandreas.hansson@arm.com# Copyright (c) 2013 ARM Limited
29665Sandreas.hansson@arm.com# All rights reserved.
39665Sandreas.hansson@arm.com#
49665Sandreas.hansson@arm.com# The license below extends only to copyright in the software and shall
59665Sandreas.hansson@arm.com# not be construed as granting a license to any other intellectual
69665Sandreas.hansson@arm.com# property including but not limited to intellectual property relating
79665Sandreas.hansson@arm.com# to a hardware implementation of the functionality of the software
89665Sandreas.hansson@arm.com# licensed hereunder.  You may use the software subject to the license
99665Sandreas.hansson@arm.com# terms below provided that you ensure that this notice is replicated
109665Sandreas.hansson@arm.com# unmodified and in its entirety in all distributions of the software,
119665Sandreas.hansson@arm.com# modified or unmodified, in source code or in binary form.
129665Sandreas.hansson@arm.com#
135353Svilas.sridharan@gmail.com# Copyright (c) 2006-2008 The Regents of The University of Michigan
143395Shsul@eecs.umich.edu# All rights reserved.
153395Shsul@eecs.umich.edu#
163395Shsul@eecs.umich.edu# Redistribution and use in source and binary forms, with or without
173395Shsul@eecs.umich.edu# modification, are permitted provided that the following conditions are
183395Shsul@eecs.umich.edu# met: redistributions of source code must retain the above copyright
193395Shsul@eecs.umich.edu# notice, this list of conditions and the following disclaimer;
203395Shsul@eecs.umich.edu# redistributions in binary form must reproduce the above copyright
213395Shsul@eecs.umich.edu# notice, this list of conditions and the following disclaimer in the
223395Shsul@eecs.umich.edu# documentation and/or other materials provided with the distribution;
233395Shsul@eecs.umich.edu# neither the name of the copyright holders nor the names of its
243395Shsul@eecs.umich.edu# contributors may be used to endorse or promote products derived from
253395Shsul@eecs.umich.edu# this software without specific prior written permission.
263395Shsul@eecs.umich.edu#
273395Shsul@eecs.umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
283395Shsul@eecs.umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
293395Shsul@eecs.umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
303395Shsul@eecs.umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
313395Shsul@eecs.umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
323395Shsul@eecs.umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
333395Shsul@eecs.umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
343395Shsul@eecs.umich.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
353395Shsul@eecs.umich.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
363395Shsul@eecs.umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
373395Shsul@eecs.umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
383395Shsul@eecs.umich.edu#
393395Shsul@eecs.umich.edu# Authors: Lisa Hsu
403395Shsul@eecs.umich.edu
4113774Sandreas.sandberg@arm.comfrom __future__ import print_function
4213774Sandreas.sandberg@arm.comfrom __future__ import absolute_import
4313774Sandreas.sandberg@arm.com
448920Snilay@cs.wisc.eduimport m5
458920Snilay@cs.wisc.edufrom m5.defines import buildEnv
468920Snilay@cs.wisc.edufrom m5.objects import *
477025SBrad.Beckmann@amd.com
4813774Sandreas.sandberg@arm.comfrom .Benchmarks import *
4913774Sandreas.sandberg@arm.comfrom . import CpuConfig
5013774Sandreas.sandberg@arm.comfrom . import BPConfig
5113876Sjavier.bueno@metempsy.comfrom . import HWPConfig
5213774Sandreas.sandberg@arm.comfrom . import MemConfig
5313774Sandreas.sandberg@arm.comfrom . import PlatformConfig
5410747SChris.Emmons@arm.com
559520SAndreas.Sandberg@ARM.comdef _listCpuTypes(option, opt, value, parser):
569520SAndreas.Sandberg@ARM.com    CpuConfig.print_cpu_list()
579520SAndreas.Sandberg@ARM.com    sys.exit(0)
589520SAndreas.Sandberg@ARM.com
5913432Spau.cabre@metempsy.comdef _listBPTypes(option, opt, value, parser):
6013432Spau.cabre@metempsy.com    BPConfig.print_bp_list()
6113432Spau.cabre@metempsy.com    sys.exit(0)
6213432Spau.cabre@metempsy.com
6313876Sjavier.bueno@metempsy.comdef _listHWPTypes(option, opt, value, parser):
6413876Sjavier.bueno@metempsy.com    HWPConfig.print_hwp_list()
6513876Sjavier.bueno@metempsy.com    sys.exit(0)
6613876Sjavier.bueno@metempsy.com
6713958Sjairo.balart@metempsy.comdef _listIndirectBPTypes(option, opt, value, parser):
6813958Sjairo.balart@metempsy.com    BPConfig.print_indirect_bp_list()
6913958Sjairo.balart@metempsy.com    sys.exit(0)
7013958Sjairo.balart@metempsy.com
719665Sandreas.hansson@arm.comdef _listMemTypes(option, opt, value, parser):
729665Sandreas.hansson@arm.com    MemConfig.print_mem_list()
739665Sandreas.hansson@arm.com    sys.exit(0)
749665Sandreas.hansson@arm.com
7511238Sandreas.sandberg@arm.comdef _listPlatformTypes(option, opt, value, parser):
7611238Sandreas.sandberg@arm.com    PlatformConfig.print_platform_list()
7711238Sandreas.sandberg@arm.com    sys.exit(0)
7811238Sandreas.sandberg@arm.com
7911688Sandreas.hansson@arm.com# Add the very basic options that work also in the case of the no ISA
8011688Sandreas.hansson@arm.com# being used, and consequently no CPUs, but rather various types of
8111688Sandreas.hansson@arm.com# testers and traffic generators.
8211688Sandreas.hansson@arm.comdef addNoISAOptions(parser):
838920Snilay@cs.wisc.edu    parser.add_option("-n", "--num-cpus", type="int", default=1)
849827Sakash.bagdia@arm.com    parser.add_option("--sys-voltage", action="store", type="string",
859827Sakash.bagdia@arm.com                      default='1.0V',
869827Sakash.bagdia@arm.com                      help = """Top-level voltage for blocks running at system
879827Sakash.bagdia@arm.com                      power supply""")
889790Sakash.bagdia@arm.com    parser.add_option("--sys-clock", action="store", type="string",
899790Sakash.bagdia@arm.com                      default='1GHz',
909790Sakash.bagdia@arm.com                      help = """Top-level clock for blocks running at system
919790Sakash.bagdia@arm.com                      speed""")
9211688Sandreas.hansson@arm.com
9311688Sandreas.hansson@arm.com    # Memory Options
9411688Sandreas.hansson@arm.com    parser.add_option("--list-mem-types",
9511688Sandreas.hansson@arm.com                      action="callback", callback=_listMemTypes,
9611688Sandreas.hansson@arm.com                      help="List available memory types")
9711837Swendy.elsasser@arm.com    parser.add_option("--mem-type", type="choice", default="DDR3_1600_8x8",
9811688Sandreas.hansson@arm.com                      choices=MemConfig.mem_names(),
9911688Sandreas.hansson@arm.com                      help = "type of memory to use")
10011688Sandreas.hansson@arm.com    parser.add_option("--mem-channels", type="int", default=1,
10111688Sandreas.hansson@arm.com                      help = "number of memory channels")
10211688Sandreas.hansson@arm.com    parser.add_option("--mem-ranks", type="int", default=None,
10311688Sandreas.hansson@arm.com                      help = "number of memory ranks per channel")
10411688Sandreas.hansson@arm.com    parser.add_option("--mem-size", action="store", type="string",
10511688Sandreas.hansson@arm.com                      default="512MB",
10611688Sandreas.hansson@arm.com                      help="Specify the physical memory size (single memory)")
10714038Smatthew.poremba@amd.com    parser.add_option("--enable-dram-powerdown", action="store_true",
10814038Smatthew.poremba@amd.com                       help="Enable low-power states in DRAMCtrl")
10911688Sandreas.hansson@arm.com
11011688Sandreas.hansson@arm.com
11111688Sandreas.hansson@arm.com    parser.add_option("--memchecker", action="store_true")
11211688Sandreas.hansson@arm.com
11311688Sandreas.hansson@arm.com    # Cache Options
11411688Sandreas.hansson@arm.com    parser.add_option("--external-memory-system", type="string",
11511688Sandreas.hansson@arm.com                      help="use external ports of this port_type for caches")
11611688Sandreas.hansson@arm.com    parser.add_option("--tlm-memory", type="string",
11711688Sandreas.hansson@arm.com                      help="use external port for SystemC TLM cosimulation")
11811688Sandreas.hansson@arm.com    parser.add_option("--caches", action="store_true")
11911688Sandreas.hansson@arm.com    parser.add_option("--l2cache", action="store_true")
12011688Sandreas.hansson@arm.com    parser.add_option("--num-dirs", type="int", default=1)
12111688Sandreas.hansson@arm.com    parser.add_option("--num-l2caches", type="int", default=1)
12211688Sandreas.hansson@arm.com    parser.add_option("--num-l3caches", type="int", default=1)
12311688Sandreas.hansson@arm.com    parser.add_option("--l1d_size", type="string", default="64kB")
12411688Sandreas.hansson@arm.com    parser.add_option("--l1i_size", type="string", default="32kB")
12511688Sandreas.hansson@arm.com    parser.add_option("--l2_size", type="string", default="2MB")
12611688Sandreas.hansson@arm.com    parser.add_option("--l3_size", type="string", default="16MB")
12711688Sandreas.hansson@arm.com    parser.add_option("--l1d_assoc", type="int", default=2)
12811688Sandreas.hansson@arm.com    parser.add_option("--l1i_assoc", type="int", default=2)
12911688Sandreas.hansson@arm.com    parser.add_option("--l2_assoc", type="int", default=8)
13011688Sandreas.hansson@arm.com    parser.add_option("--l3_assoc", type="int", default=16)
13111688Sandreas.hansson@arm.com    parser.add_option("--cacheline_size", type="int", default=64)
13211688Sandreas.hansson@arm.com
13311688Sandreas.hansson@arm.com    # Enable Ruby
13411688Sandreas.hansson@arm.com    parser.add_option("--ruby", action="store_true")
13511688Sandreas.hansson@arm.com
13611688Sandreas.hansson@arm.com    # Run duration options
13711688Sandreas.hansson@arm.com    parser.add_option("-m", "--abs-max-tick", type="int", default=m5.MaxTick,
13811688Sandreas.hansson@arm.com                      metavar="TICKS", help="Run to absolute simulated tick "
13911688Sandreas.hansson@arm.com                      "specified including ticks from a restored checkpoint")
14011688Sandreas.hansson@arm.com    parser.add_option("--rel-max-tick", type="int", default=None,
14111688Sandreas.hansson@arm.com                      metavar="TICKS", help="Simulate for specified number of"
14211688Sandreas.hansson@arm.com                      " ticks relative to the simulation start tick (e.g. if "
14311688Sandreas.hansson@arm.com                      "restoring a checkpoint)")
14411688Sandreas.hansson@arm.com    parser.add_option("--maxtime", type="float", default=None,
14511688Sandreas.hansson@arm.com                      help="Run to the specified absolute simulated time in "
14611688Sandreas.hansson@arm.com                      "seconds")
14713357Sciro.santilli@arm.com    parser.add_option("-P", "--param", action="append", default=[],
14813357Sciro.santilli@arm.com        help="Set a SimObject parameter relative to the root node. "
14913357Sciro.santilli@arm.com             "An extended Python multi range slicing syntax can be used "
15013357Sciro.santilli@arm.com             "for arrays. For example: "
15113357Sciro.santilli@arm.com             "'system.cpu[0,1,3:8:2].max_insts_all_threads = 42' "
15213357Sciro.santilli@arm.com             "sets max_insts_all_threads for cpus 0, 1, 3, 5 and 7 "
15313357Sciro.santilli@arm.com             "Direct parameters of the root object are not accessible, "
15413357Sciro.santilli@arm.com             "only parameters of its children.")
15511688Sandreas.hansson@arm.com
15611688Sandreas.hansson@arm.com# Add common options that assume a non-NULL ISA.
15711688Sandreas.hansson@arm.comdef addCommonOptions(parser):
15811688Sandreas.hansson@arm.com    # start by adding the base options that do not assume an ISA
15911688Sandreas.hansson@arm.com    addNoISAOptions(parser)
16011688Sandreas.hansson@arm.com
16111688Sandreas.hansson@arm.com    # system options
16211688Sandreas.hansson@arm.com    parser.add_option("--list-cpu-types",
16311688Sandreas.hansson@arm.com                      action="callback", callback=_listCpuTypes,
16411688Sandreas.hansson@arm.com                      help="List available CPU types")
16511995Sgabeblack@google.com    parser.add_option("--cpu-type", type="choice", default="AtomicSimpleCPU",
16611688Sandreas.hansson@arm.com                      choices=CpuConfig.cpu_names(),
16711688Sandreas.hansson@arm.com                      help = "type of cpu to run with")
16813432Spau.cabre@metempsy.com    parser.add_option("--list-bp-types",
16913432Spau.cabre@metempsy.com                      action="callback", callback=_listBPTypes,
17013432Spau.cabre@metempsy.com                      help="List available branch predictor types")
17113958Sjairo.balart@metempsy.com    parser.add_option("--list-indirect-bp-types",
17213958Sjairo.balart@metempsy.com                      action="callback", callback=_listIndirectBPTypes,
17313958Sjairo.balart@metempsy.com                      help="List available indirect branch predictor types")
17413432Spau.cabre@metempsy.com    parser.add_option("--bp-type", type="choice", default=None,
17513432Spau.cabre@metempsy.com                      choices=BPConfig.bp_names(),
17613432Spau.cabre@metempsy.com                      help = """
17713432Spau.cabre@metempsy.com                      type of branch predictor to run with
17813432Spau.cabre@metempsy.com                      (if not set, use the default branch predictor of
17913432Spau.cabre@metempsy.com                      the selected CPU)""")
18013958Sjairo.balart@metempsy.com    parser.add_option("--indirect-bp-type", type="choice",
18113958Sjairo.balart@metempsy.com                      default="SimpleIndirectPredictor",
18213958Sjairo.balart@metempsy.com                      choices=BPConfig.indirect_bp_names(),
18313958Sjairo.balart@metempsy.com                      help = "type of indirect branch predictor to run with")
18413876Sjavier.bueno@metempsy.com    parser.add_option("--list-hwp-types",
18513876Sjavier.bueno@metempsy.com                      action="callback", callback=_listHWPTypes,
18613876Sjavier.bueno@metempsy.com                      help="List available hardware prefetcher types")
18713876Sjavier.bueno@metempsy.com    parser.add_option("--l1i-hwp-type", type="choice", default=None,
18813876Sjavier.bueno@metempsy.com                      choices=HWPConfig.hwp_names(),
18913876Sjavier.bueno@metempsy.com                      help = """
19013876Sjavier.bueno@metempsy.com                      type of hardware prefetcher to use with the L1
19113876Sjavier.bueno@metempsy.com                      instruction cache.
19213876Sjavier.bueno@metempsy.com                      (if not set, use the default prefetcher of
19313876Sjavier.bueno@metempsy.com                      the selected cache)""")
19413876Sjavier.bueno@metempsy.com    parser.add_option("--l1d-hwp-type", type="choice", default=None,
19513876Sjavier.bueno@metempsy.com                      choices=HWPConfig.hwp_names(),
19613876Sjavier.bueno@metempsy.com                      help = """
19713876Sjavier.bueno@metempsy.com                      type of hardware prefetcher to use with the L1
19813876Sjavier.bueno@metempsy.com                      data cache.
19913876Sjavier.bueno@metempsy.com                      (if not set, use the default prefetcher of
20013876Sjavier.bueno@metempsy.com                      the selected cache)""")
20113876Sjavier.bueno@metempsy.com    parser.add_option("--l2-hwp-type", type="choice", default=None,
20213876Sjavier.bueno@metempsy.com                      choices=HWPConfig.hwp_names(),
20313876Sjavier.bueno@metempsy.com                      help = """
20413876Sjavier.bueno@metempsy.com                      type of hardware prefetcher to use with the L2 cache.
20513876Sjavier.bueno@metempsy.com                      (if not set, use the default prefetcher of
20613876Sjavier.bueno@metempsy.com                      the selected cache)""")
20711688Sandreas.hansson@arm.com    parser.add_option("--checker", action="store_true");
2089789Sakash.bagdia@arm.com    parser.add_option("--cpu-clock", action="store", type="string",
2099789Sakash.bagdia@arm.com                      default='2GHz',
2109789Sakash.bagdia@arm.com                      help="Clock for blocks running at CPU speed")
2119800Snilay@cs.wisc.edu    parser.add_option("--smt", action="store_true", default=False,
2129800Snilay@cs.wisc.edu                      help = """
2139800Snilay@cs.wisc.edu                      Only used if multiple programs are specified. If true,
2149800Snilay@cs.wisc.edu                      then the number of threads per cpu is same as the
2159800Snilay@cs.wisc.edu                      number of programs.""")
21611251Sradhika.jagtap@ARM.com    parser.add_option("--elastic-trace-en", action="store_true",
21711251Sradhika.jagtap@ARM.com                      help="""Enable capture of data dependency and instruction
21811251Sradhika.jagtap@ARM.com                      fetch traces using elastic trace probe.""")
21911251Sradhika.jagtap@ARM.com    # Trace file paths input to trace probe in a capture simulation and input
22011251Sradhika.jagtap@ARM.com    # to Trace CPU in a replay simulation
22111251Sradhika.jagtap@ARM.com    parser.add_option("--inst-trace-file", action="store", type="string",
22211251Sradhika.jagtap@ARM.com                      help="""Instruction fetch trace file input to
22311251Sradhika.jagtap@ARM.com                      Elastic Trace probe in a capture simulation and
22411251Sradhika.jagtap@ARM.com                      Trace CPU in a replay simulation""", default="")
22511251Sradhika.jagtap@ARM.com    parser.add_option("--data-trace-file", action="store", type="string",
22611251Sradhika.jagtap@ARM.com                      help="""Data dependency trace file input to
22711251Sradhika.jagtap@ARM.com                      Elastic Trace probe in a capture simulation and
22811251Sradhika.jagtap@ARM.com                      Trace CPU in a replay simulation""", default="")
2299800Snilay@cs.wisc.edu
23010037SARM gem5 Developers    parser.add_option("-l", "--lpae", action="store_true")
23110037SARM gem5 Developers    parser.add_option("-V", "--virtualisation", action="store_true")
23210037SARM gem5 Developers
23311626Smichael.lebeane@amd.com    # dist-gem5 options
23411626Smichael.lebeane@amd.com    parser.add_option("--dist", action="store_true",
23511626Smichael.lebeane@amd.com                      help="Parallel distributed gem5 simulation.")
23611703Smichael.lebeane@amd.com    parser.add_option("--dist-sync-on-pseudo-op", action="store_true",
23711703Smichael.lebeane@amd.com                      help="Use a pseudo-op to start dist-gem5 synchronization.")
23811626Smichael.lebeane@amd.com    parser.add_option("--is-switch", action="store_true",
23911626Smichael.lebeane@amd.com                      help="Select the network switch simulator process for a"\
24011626Smichael.lebeane@amd.com                      "distributed gem5 run")
24111626Smichael.lebeane@amd.com    parser.add_option("--dist-rank", default=0, action="store", type="int",
24211626Smichael.lebeane@amd.com                      help="Rank of this system within the dist gem5 run.")
24311626Smichael.lebeane@amd.com    parser.add_option("--dist-size", default=0, action="store", type="int",
24411626Smichael.lebeane@amd.com                      help="Number of gem5 processes within the dist gem5 run.")
24511626Smichael.lebeane@amd.com    parser.add_option("--dist-server-name",
24611626Smichael.lebeane@amd.com                      default="127.0.0.1",
24711626Smichael.lebeane@amd.com                      action="store", type="string",
24811626Smichael.lebeane@amd.com                      help="Name of the message server host\nDEFAULT: localhost")
24911626Smichael.lebeane@amd.com    parser.add_option("--dist-server-port",
25011626Smichael.lebeane@amd.com                      default=2200,
25111626Smichael.lebeane@amd.com                      action="store", type="int",
25211626Smichael.lebeane@amd.com                      help="Message server listen port\nDEFAULT: 2200")
25311626Smichael.lebeane@amd.com    parser.add_option("--dist-sync-repeat",
25411626Smichael.lebeane@amd.com                      default="0us",
25511626Smichael.lebeane@amd.com                      action="store", type="string",
25611626Smichael.lebeane@amd.com                      help="Repeat interval for synchronisation barriers among dist-gem5 processes\nDEFAULT: --ethernet-linkdelay")
25711626Smichael.lebeane@amd.com    parser.add_option("--dist-sync-start",
25811626Smichael.lebeane@amd.com                      default="5200000000000t",
25911626Smichael.lebeane@amd.com                      action="store", type="string",
26011626Smichael.lebeane@amd.com                      help="Time to schedule the first dist synchronisation barrier\nDEFAULT:5200000000000t")
26111626Smichael.lebeane@amd.com    parser.add_option("--ethernet-linkspeed", default="10Gbps",
26211626Smichael.lebeane@amd.com                        action="store", type="string",
26311626Smichael.lebeane@amd.com                        help="Link speed in bps\nDEFAULT: 10Gbps")
26411626Smichael.lebeane@amd.com    parser.add_option("--ethernet-linkdelay", default="10us",
26511626Smichael.lebeane@amd.com                      action="store", type="string",
26611626Smichael.lebeane@amd.com                      help="Link delay in seconds\nDEFAULT: 10us")
26711626Smichael.lebeane@amd.com
2688920Snilay@cs.wisc.edu    # Run duration options
2698920Snilay@cs.wisc.edu    parser.add_option("-I", "--maxinsts", action="store", type="int",
2708920Snilay@cs.wisc.edu                      default=None, help="""Total number of instructions to
2718920Snilay@cs.wisc.edu                                            simulate (default: run forever)""")
2728920Snilay@cs.wisc.edu    parser.add_option("--work-item-id", action="store", type="int",
2738920Snilay@cs.wisc.edu                      help="the specific work id for exit & checkpointing")
27410159Sgedare@rtems.org    parser.add_option("--num-work-ids", action="store", type="int",
27510159Sgedare@rtems.org                      help="Number of distinct work item types")
2768920Snilay@cs.wisc.edu    parser.add_option("--work-begin-cpu-id-exit", action="store", type="int",
2778920Snilay@cs.wisc.edu                      help="exit when work starts on the specified cpu")
2788920Snilay@cs.wisc.edu    parser.add_option("--work-end-exit-count", action="store", type="int",
2798920Snilay@cs.wisc.edu                      help="exit at specified work end count")
2808920Snilay@cs.wisc.edu    parser.add_option("--work-begin-exit-count", action="store", type="int",
2818920Snilay@cs.wisc.edu                      help="exit at specified work begin count")
2828920Snilay@cs.wisc.edu    parser.add_option("--init-param", action="store", type="int", default=0,
2838920Snilay@cs.wisc.edu                      help="""Parameter available in simulation with m5
2848920Snilay@cs.wisc.edu                              initparam""")
28510757SCurtis.Dunham@arm.com    parser.add_option("--initialize-only", action="store_true", default=False,
28610757SCurtis.Dunham@arm.com                      help="""Exit after initialization. Do not simulate time.
28710757SCurtis.Dunham@arm.com                              Useful when gem5 is run as a library.""")
2886776SBrad.Beckmann@amd.com
2899800Snilay@cs.wisc.edu    # Simpoint options
2909800Snilay@cs.wisc.edu    parser.add_option("--simpoint-profile", action="store_true",
2919800Snilay@cs.wisc.edu                      help="Enable basic block profiling for SimPoints")
2929800Snilay@cs.wisc.edu    parser.add_option("--simpoint-interval", type="int", default=10000000,
2939800Snilay@cs.wisc.edu                      help="SimPoint interval in num of instructions")
29410608Sdam.sunwoo@arm.com    parser.add_option("--take-simpoint-checkpoints", action="store", type="string",
29510608Sdam.sunwoo@arm.com        help="<simpoint file,weight file,interval-length,warmup-length>")
29610608Sdam.sunwoo@arm.com    parser.add_option("--restore-simpoint-checkpoint", action="store_true",
29710608Sdam.sunwoo@arm.com        help="restore from a simpoint checkpoint taken with " +
29810608Sdam.sunwoo@arm.com             "--take-simpoint-checkpoints")
2999800Snilay@cs.wisc.edu
3008920Snilay@cs.wisc.edu    # Checkpointing options
3018920Snilay@cs.wisc.edu    ###Note that performing checkpointing via python script files will override
3028920Snilay@cs.wisc.edu    ###checkpoint instructions built into binaries.
3038920Snilay@cs.wisc.edu    parser.add_option("--take-checkpoints", action="store", type="string",
3049357Sandreas.hansson@arm.com        help="<M,N> take checkpoints at tick M and every N ticks thereafter")
3058920Snilay@cs.wisc.edu    parser.add_option("--max-checkpoints", action="store", type="int",
3068920Snilay@cs.wisc.edu        help="the maximum number of checkpoints to drop", default=5)
3078920Snilay@cs.wisc.edu    parser.add_option("--checkpoint-dir", action="store", type="string",
3088920Snilay@cs.wisc.edu        help="Place all checkpoints in this absolute directory")
3098920Snilay@cs.wisc.edu    parser.add_option("-r", "--checkpoint-restore", action="store", type="int",
3108920Snilay@cs.wisc.edu        help="restore from checkpoint <N>")
3118920Snilay@cs.wisc.edu    parser.add_option("--checkpoint-at-end", action="store_true",
3128920Snilay@cs.wisc.edu                      help="take a checkpoint at end of run")
3138920Snilay@cs.wisc.edu    parser.add_option("--work-begin-checkpoint-count", action="store", type="int",
3148920Snilay@cs.wisc.edu                      help="checkpoint at specified work begin count")
3158920Snilay@cs.wisc.edu    parser.add_option("--work-end-checkpoint-count", action="store", type="int",
3168920Snilay@cs.wisc.edu                      help="checkpoint at specified work end count")
3178920Snilay@cs.wisc.edu    parser.add_option("--work-cpus-checkpoint-count", action="store", type="int",
3188920Snilay@cs.wisc.edu                      help="checkpoint and exit when active cpu count is reached")
3198920Snilay@cs.wisc.edu    parser.add_option("--restore-with-cpu", action="store", type="choice",
32011995Sgabeblack@google.com                      default="AtomicSimpleCPU", choices=CpuConfig.cpu_names(),
3218920Snilay@cs.wisc.edu                      help = "cpu type for restoring from a checkpoint")
3223395Shsul@eecs.umich.edu
3235361Srstrong@cs.ucsd.edu
3248920Snilay@cs.wisc.edu    # CPU Switching - default switch model goes from a checkpoint
3258920Snilay@cs.wisc.edu    # to a timing simple CPU with caches to warm up, then to detailed CPU for
3268920Snilay@cs.wisc.edu    # data measurement
3279151Satgutier@umich.edu    parser.add_option("--repeat-switch", action="store", type="int",
3289151Satgutier@umich.edu        default=None,
3299151Satgutier@umich.edu        help="switch back and forth between CPUs with period <N>")
3309151Satgutier@umich.edu    parser.add_option("-s", "--standard-switch", action="store", type="int",
3319151Satgutier@umich.edu        default=None,
3329151Satgutier@umich.edu        help="switch from timing to Detailed CPU after warmup period of <N>")
3339562Ssaidi@eecs.umich.edu    parser.add_option("-p", "--prog-interval", type="str",
3348920Snilay@cs.wisc.edu        help="CPU Progress Interval")
3358920Snilay@cs.wisc.edu
3368920Snilay@cs.wisc.edu    # Fastforwarding and simpoint related materials
3378920Snilay@cs.wisc.edu    parser.add_option("-W", "--warmup-insts", action="store", type="int",
3388920Snilay@cs.wisc.edu        default=None,
3398920Snilay@cs.wisc.edu        help="Warmup period in total instructions (requires --standard-switch)")
3408920Snilay@cs.wisc.edu    parser.add_option("--bench", action="store", type="string", default=None,
3418920Snilay@cs.wisc.edu        help="base names for --take-checkpoint and --checkpoint-restore")
3428920Snilay@cs.wisc.edu    parser.add_option("-F", "--fast-forward", action="store", type="string",
3438920Snilay@cs.wisc.edu        default=None,
3448920Snilay@cs.wisc.edu        help="Number of instructions to fast forward before switching")
3458920Snilay@cs.wisc.edu    parser.add_option("-S", "--simpoint", action="store_true", default=False,
3468920Snilay@cs.wisc.edu        help="""Use workload simpoints as an instruction offset for
3478920Snilay@cs.wisc.edu                --checkpoint-restore or --take-checkpoint.""")
3488920Snilay@cs.wisc.edu    parser.add_option("--at-instruction", action="store_true", default=False,
3498920Snilay@cs.wisc.edu        help="""Treat value of --checkpoint-restore or --take-checkpoint as a
3508920Snilay@cs.wisc.edu                number of instructions.""")
35110037SARM gem5 Developers    parser.add_option("--spec-input", default="ref", type="choice",
35210037SARM gem5 Developers                      choices=["ref", "test", "train", "smred", "mdred",
35310037SARM gem5 Developers                               "lgred"],
35410037SARM gem5 Developers                      help="Input set size for SPEC CPU2000 benchmarks.")
35510037SARM gem5 Developers    parser.add_option("--arm-iset", default="arm", type="choice",
35610037SARM gem5 Developers                      choices=["arm", "thumb", "aarch64"],
35710037SARM gem5 Developers                      help="ARM instruction set.")
35810037SARM gem5 Developers
3598920Snilay@cs.wisc.edu
3608920Snilay@cs.wisc.edudef addSEOptions(parser):
3618920Snilay@cs.wisc.edu    # Benchmark options
3628920Snilay@cs.wisc.edu    parser.add_option("-c", "--cmd", default="",
3638920Snilay@cs.wisc.edu                      help="The binary to run in syscall emulation mode.")
3648920Snilay@cs.wisc.edu    parser.add_option("-o", "--options", default="",
3658920Snilay@cs.wisc.edu                      help="""The options to pass to the binary, use " "
3668920Snilay@cs.wisc.edu                              around the entire string""")
36710803Sbrandon.potter@amd.com    parser.add_option("-e", "--env", default="",
36810803Sbrandon.potter@amd.com                      help="Initialize workload environment from text file.")
3698920Snilay@cs.wisc.edu    parser.add_option("-i", "--input", default="",
3708920Snilay@cs.wisc.edu                      help="Read stdin from a file.")
3718920Snilay@cs.wisc.edu    parser.add_option("--output", default="",
3728920Snilay@cs.wisc.edu                      help="Redirect stdout to a file.")
3738920Snilay@cs.wisc.edu    parser.add_option("--errout", default="",
3748920Snilay@cs.wisc.edu                      help="Redirect stderr to a file.")
37513883Sdavid.hashe@amd.com    parser.add_option("--chroot", action="store", type="string", default="/",
37613883Sdavid.hashe@amd.com                      help="The chroot option allows a user to alter the "    \
37713883Sdavid.hashe@amd.com                           "search path for processes running in SE mode. "   \
37813883Sdavid.hashe@amd.com                           "Normally, the search path would begin at the "    \
37913883Sdavid.hashe@amd.com                           "root of the filesystem (i.e. /). With chroot, "   \
38013883Sdavid.hashe@amd.com                           "a user can force the process to begin looking at" \
38113883Sdavid.hashe@amd.com                           "some other location (i.e. /home/user/rand_dir)."  \
38213883Sdavid.hashe@amd.com                           "The intended use is to trick sophisticated "      \
38313883Sdavid.hashe@amd.com                           "software which queries the __HOST__ filesystem "  \
38413883Sdavid.hashe@amd.com                           "for information or functionality. Instead of "    \
38513883Sdavid.hashe@amd.com                           "finding files on the __HOST__ filesystem, the "   \
38613883Sdavid.hashe@amd.com                           "process will find the user's replacment files.")
38713883Sdavid.hashe@amd.com
3888920Snilay@cs.wisc.edu
3898920Snilay@cs.wisc.edudef addFSOptions(parser):
39013774Sandreas.sandberg@arm.com    from .FSConfig import os_types
39111688Sandreas.hansson@arm.com
3928920Snilay@cs.wisc.edu    # Simulation options
3938920Snilay@cs.wisc.edu    parser.add_option("--timesync", action="store_true",
3948920Snilay@cs.wisc.edu            help="Prevent simulated time from getting ahead of real time")
3958920Snilay@cs.wisc.edu
3968920Snilay@cs.wisc.edu    # System options
3978920Snilay@cs.wisc.edu    parser.add_option("--kernel", action="store", type="string")
39810747SChris.Emmons@arm.com    parser.add_option("--os-type", action="store", type="choice",
39913731Sandreas.sandberg@arm.com                      choices=os_types[str(buildEnv['TARGET_ISA'])],
40013731Sandreas.sandberg@arm.com                      default="linux",
40113731Sandreas.sandberg@arm.com                      help="Specifies type of OS to boot")
4028920Snilay@cs.wisc.edu    parser.add_option("--script", action="store", type="string")
4038920Snilay@cs.wisc.edu    parser.add_option("--frame-capture", action="store_true",
4048920Snilay@cs.wisc.edu            help="Stores changed frame buffers from the VNC server to compressed "\
4058920Snilay@cs.wisc.edu            "files in the gem5 output directory")
4068920Snilay@cs.wisc.edu
4078920Snilay@cs.wisc.edu    if buildEnv['TARGET_ISA'] == "arm":
4088920Snilay@cs.wisc.edu        parser.add_option("--bare-metal", action="store_true",
4098920Snilay@cs.wisc.edu                   help="Provide the raw system without the linux specific bits")
41011238Sandreas.sandberg@arm.com        parser.add_option("--list-machine-types",
41111238Sandreas.sandberg@arm.com                          action="callback", callback=_listPlatformTypes,
41211238Sandreas.sandberg@arm.com                      help="List available platform types")
4138920Snilay@cs.wisc.edu        parser.add_option("--machine-type", action="store", type="choice",
41411238Sandreas.sandberg@arm.com                choices=PlatformConfig.platform_names(),
41511238Sandreas.sandberg@arm.com                default="VExpress_EMM")
4169539Satgutier@umich.edu        parser.add_option("--dtb-filename", action="store", type="string",
4179539Satgutier@umich.edu              help="Specifies device tree blob file to use with device-tree-"\
4189539Satgutier@umich.edu              "enabled kernels")
41912079Sgedare@rtems.org        parser.add_option("--enable-security-extensions", action="store_true",
42012079Sgedare@rtems.org              help="Turn on the ARM Security Extensions")
4219935Sdam.sunwoo@arm.com        parser.add_option("--enable-context-switch-stats-dump", \
4229935Sdam.sunwoo@arm.com                action="store_true", help="Enable stats dump at context "\
4239935Sdam.sunwoo@arm.com                "switches and dump tasks file (required for Streamline)")
4249935Sdam.sunwoo@arm.com
4258920Snilay@cs.wisc.edu    # Benchmark options
4268920Snilay@cs.wisc.edu    parser.add_option("--dual", action="store_true",
4278920Snilay@cs.wisc.edu                      help="Simulate two systems attached with an ethernet link")
4288920Snilay@cs.wisc.edu    parser.add_option("-b", "--benchmark", action="store", type="string",
4298920Snilay@cs.wisc.edu                      dest="benchmark",
4308920Snilay@cs.wisc.edu                      help="Specify the benchmark to run. Available benchmarks: %s"\
4318920Snilay@cs.wisc.edu                      % DefinedBenchmarks)
4328920Snilay@cs.wisc.edu
4338920Snilay@cs.wisc.edu    # Metafile options
4348920Snilay@cs.wisc.edu    parser.add_option("--etherdump", action="store", type="string", dest="etherdump",
4358920Snilay@cs.wisc.edu                      help="Specify the filename to dump a pcap capture of the" \
4368920Snilay@cs.wisc.edu                      "ethernet traffic")
4378956Sjayneel@cs.wisc.edu
4388956Sjayneel@cs.wisc.edu    # Disk Image Options
4398956Sjayneel@cs.wisc.edu    parser.add_option("--disk-image", action="store", type="string", default=None,
4408956Sjayneel@cs.wisc.edu                      help="Path to the disk image to use.")
44110697SCurtis.Dunham@arm.com    parser.add_option("--root-device", action="store", type="string", default=None,
44210697SCurtis.Dunham@arm.com                      help="OS device name for root partition")
44310594Sgabeblack@google.com
44410594Sgabeblack@google.com    # Command line options
44510594Sgabeblack@google.com    parser.add_option("--command-line", action="store", type="string",
44610594Sgabeblack@google.com                      default=None,
44710594Sgabeblack@google.com                      help="Template for the kernel command line.")
44810594Sgabeblack@google.com    parser.add_option("--command-line-file", action="store",
44910594Sgabeblack@google.com                      default=None, type="string",
45010594Sgabeblack@google.com                      help="File with a template for the kernel command line")
451