Options.py (11626:c89c72b0e5f5) Options.py (11688:725fef71f376)
1# Copyright (c) 2013 ARM Limited
2# All rights reserved.
3#
4# The license below extends only to copyright in the software and shall
5# not be construed as granting a license to any other intellectual
6# property including but not limited to intellectual property relating
7# to a hardware implementation of the functionality of the software
8# licensed hereunder. You may use the software subject to the license
9# terms below provided that you ensure that this notice is replicated
10# unmodified and in its entirety in all distributions of the software,
11# modified or unmodified, in source code or in binary form.
12#
13# Copyright (c) 2006-2008 The Regents of The University of Michigan
14# All rights reserved.
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: Lisa Hsu
40
41import m5
42from m5.defines import buildEnv
43from m5.objects import *
1# Copyright (c) 2013 ARM Limited
2# All rights reserved.
3#
4# The license below extends only to copyright in the software and shall
5# not be construed as granting a license to any other intellectual
6# property including but not limited to intellectual property relating
7# to a hardware implementation of the functionality of the software
8# licensed hereunder. You may use the software subject to the license
9# terms below provided that you ensure that this notice is replicated
10# unmodified and in its entirety in all distributions of the software,
11# modified or unmodified, in source code or in binary form.
12#
13# Copyright (c) 2006-2008 The Regents of The University of Michigan
14# All rights reserved.
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: Lisa Hsu
40
41import m5
42from m5.defines import buildEnv
43from m5.objects import *
44from Benchmarks import *
44from common.Benchmarks import *
45
45
46import CpuConfig
47import MemConfig
48import PlatformConfig
46from common import CpuConfig
47from common import MemConfig
48from common import PlatformConfig
49
49
50from FSConfig import os_types
51
52def _listCpuTypes(option, opt, value, parser):
53 CpuConfig.print_cpu_list()
54 sys.exit(0)
55
56def _listMemTypes(option, opt, value, parser):
57 MemConfig.print_mem_list()
58 sys.exit(0)
59
60def _listPlatformTypes(option, opt, value, parser):
61 PlatformConfig.print_platform_list()
62 sys.exit(0)
63
50def _listCpuTypes(option, opt, value, parser):
51 CpuConfig.print_cpu_list()
52 sys.exit(0)
53
54def _listMemTypes(option, opt, value, parser):
55 MemConfig.print_mem_list()
56 sys.exit(0)
57
58def _listPlatformTypes(option, opt, value, parser):
59 PlatformConfig.print_platform_list()
60 sys.exit(0)
61
64def addCommonOptions(parser):
65 # system options
66 parser.add_option("--list-cpu-types",
67 action="callback", callback=_listCpuTypes,
68 help="List available CPU types")
69 parser.add_option("--cpu-type", type="choice", default="atomic",
70 choices=CpuConfig.cpu_names(),
71 help = "type of cpu to run with")
72 parser.add_option("--checker", action="store_true");
62# Add the very basic options that work also in the case of the no ISA
63# being used, and consequently no CPUs, but rather various types of
64# testers and traffic generators.
65def addNoISAOptions(parser):
73 parser.add_option("-n", "--num-cpus", type="int", default=1)
74 parser.add_option("--sys-voltage", action="store", type="string",
75 default='1.0V',
76 help = """Top-level voltage for blocks running at system
77 power supply""")
78 parser.add_option("--sys-clock", action="store", type="string",
79 default='1GHz',
80 help = """Top-level clock for blocks running at system
81 speed""")
66 parser.add_option("-n", "--num-cpus", type="int", default=1)
67 parser.add_option("--sys-voltage", action="store", type="string",
68 default='1.0V',
69 help = """Top-level voltage for blocks running at system
70 power supply""")
71 parser.add_option("--sys-clock", action="store", type="string",
72 default='1GHz',
73 help = """Top-level clock for blocks running at system
74 speed""")
82 parser.add_option("--cpu-clock", action="store", type="string",
83 default='2GHz',
84 help="Clock for blocks running at CPU speed")
85 parser.add_option("--smt", action="store_true", default=False,
86 help = """
87 Only used if multiple programs are specified. If true,
88 then the number of threads per cpu is same as the
89 number of programs.""")
90 parser.add_option("--elastic-trace-en", action="store_true",
91 help="""Enable capture of data dependency and instruction
92 fetch traces using elastic trace probe.""")
93 # Trace file paths input to trace probe in a capture simulation and input
94 # to Trace CPU in a replay simulation
95 parser.add_option("--inst-trace-file", action="store", type="string",
96 help="""Instruction fetch trace file input to
97 Elastic Trace probe in a capture simulation and
98 Trace CPU in a replay simulation""", default="")
99 parser.add_option("--data-trace-file", action="store", type="string",
100 help="""Data dependency trace file input to
101 Elastic Trace probe in a capture simulation and
102 Trace CPU in a replay simulation""", default="")
103
104 # Memory Options
105 parser.add_option("--list-mem-types",
106 action="callback", callback=_listMemTypes,
107 help="List available memory types")
108 parser.add_option("--mem-type", type="choice", default="DDR3_1600_x64",
109 choices=MemConfig.mem_names(),
110 help = "type of memory to use")
111 parser.add_option("--mem-channels", type="int", default=1,
112 help = "number of memory channels")
113 parser.add_option("--mem-ranks", type="int", default=None,
114 help = "number of memory ranks per channel")
115 parser.add_option("--mem-size", action="store", type="string",
116 default="512MB",
117 help="Specify the physical memory size (single memory)")
118
75
76 # Memory Options
77 parser.add_option("--list-mem-types",
78 action="callback", callback=_listMemTypes,
79 help="List available memory types")
80 parser.add_option("--mem-type", type="choice", default="DDR3_1600_x64",
81 choices=MemConfig.mem_names(),
82 help = "type of memory to use")
83 parser.add_option("--mem-channels", type="int", default=1,
84 help = "number of memory channels")
85 parser.add_option("--mem-ranks", type="int", default=None,
86 help = "number of memory ranks per channel")
87 parser.add_option("--mem-size", action="store", type="string",
88 default="512MB",
89 help="Specify the physical memory size (single memory)")
90
119 parser.add_option("-l", "--lpae", action="store_true")
120 parser.add_option("-V", "--virtualisation", action="store_true")
121
122 parser.add_option("--memchecker", action="store_true")
123
124 # Cache Options
125 parser.add_option("--external-memory-system", type="string",
126 help="use external ports of this port_type for caches")
127 parser.add_option("--tlm-memory", type="string",
128 help="use external port for SystemC TLM cosimulation")
129 parser.add_option("--caches", action="store_true")
130 parser.add_option("--l2cache", action="store_true")
91
92 parser.add_option("--memchecker", action="store_true")
93
94 # Cache Options
95 parser.add_option("--external-memory-system", type="string",
96 help="use external ports of this port_type for caches")
97 parser.add_option("--tlm-memory", type="string",
98 help="use external port for SystemC TLM cosimulation")
99 parser.add_option("--caches", action="store_true")
100 parser.add_option("--l2cache", action="store_true")
131 parser.add_option("--fastmem", action="store_true")
132 parser.add_option("--num-dirs", type="int", default=1)
133 parser.add_option("--num-l2caches", type="int", default=1)
134 parser.add_option("--num-l3caches", type="int", default=1)
135 parser.add_option("--l1d_size", type="string", default="64kB")
136 parser.add_option("--l1i_size", type="string", default="32kB")
137 parser.add_option("--l2_size", type="string", default="2MB")
138 parser.add_option("--l3_size", type="string", default="16MB")
139 parser.add_option("--l1d_assoc", type="int", default=2)
140 parser.add_option("--l1i_assoc", type="int", default=2)
141 parser.add_option("--l2_assoc", type="int", default=8)
142 parser.add_option("--l3_assoc", type="int", default=16)
143 parser.add_option("--cacheline_size", type="int", default=64)
144
101 parser.add_option("--num-dirs", type="int", default=1)
102 parser.add_option("--num-l2caches", type="int", default=1)
103 parser.add_option("--num-l3caches", type="int", default=1)
104 parser.add_option("--l1d_size", type="string", default="64kB")
105 parser.add_option("--l1i_size", type="string", default="32kB")
106 parser.add_option("--l2_size", type="string", default="2MB")
107 parser.add_option("--l3_size", type="string", default="16MB")
108 parser.add_option("--l1d_assoc", type="int", default=2)
109 parser.add_option("--l1i_assoc", type="int", default=2)
110 parser.add_option("--l2_assoc", type="int", default=8)
111 parser.add_option("--l3_assoc", type="int", default=16)
112 parser.add_option("--cacheline_size", type="int", default=64)
113
114 # Enable Ruby
115 parser.add_option("--ruby", action="store_true")
116
117 # Run duration options
118 parser.add_option("-m", "--abs-max-tick", type="int", default=m5.MaxTick,
119 metavar="TICKS", help="Run to absolute simulated tick "
120 "specified including ticks from a restored checkpoint")
121 parser.add_option("--rel-max-tick", type="int", default=None,
122 metavar="TICKS", help="Simulate for specified number of"
123 " ticks relative to the simulation start tick (e.g. if "
124 "restoring a checkpoint)")
125 parser.add_option("--maxtime", type="float", default=None,
126 help="Run to the specified absolute simulated time in "
127 "seconds")
128
129# Add common options that assume a non-NULL ISA.
130def addCommonOptions(parser):
131 # start by adding the base options that do not assume an ISA
132 addNoISAOptions(parser)
133
134 # system options
135 parser.add_option("--list-cpu-types",
136 action="callback", callback=_listCpuTypes,
137 help="List available CPU types")
138 parser.add_option("--cpu-type", type="choice", default="atomic",
139 choices=CpuConfig.cpu_names(),
140 help = "type of cpu to run with")
141 parser.add_option("--checker", action="store_true");
142 parser.add_option("--cpu-clock", action="store", type="string",
143 default='2GHz',
144 help="Clock for blocks running at CPU speed")
145 parser.add_option("--smt", action="store_true", default=False,
146 help = """
147 Only used if multiple programs are specified. If true,
148 then the number of threads per cpu is same as the
149 number of programs.""")
150 parser.add_option("--elastic-trace-en", action="store_true",
151 help="""Enable capture of data dependency and instruction
152 fetch traces using elastic trace probe.""")
153 # Trace file paths input to trace probe in a capture simulation and input
154 # to Trace CPU in a replay simulation
155 parser.add_option("--inst-trace-file", action="store", type="string",
156 help="""Instruction fetch trace file input to
157 Elastic Trace probe in a capture simulation and
158 Trace CPU in a replay simulation""", default="")
159 parser.add_option("--data-trace-file", action="store", type="string",
160 help="""Data dependency trace file input to
161 Elastic Trace probe in a capture simulation and
162 Trace CPU in a replay simulation""", default="")
163
164 parser.add_option("-l", "--lpae", action="store_true")
165 parser.add_option("-V", "--virtualisation", action="store_true")
166
167 parser.add_option("--fastmem", action="store_true")
168
145 # dist-gem5 options
146 parser.add_option("--dist", action="store_true",
147 help="Parallel distributed gem5 simulation.")
148 parser.add_option("--is-switch", action="store_true",
149 help="Select the network switch simulator process for a"\
150 "distributed gem5 run")
151 parser.add_option("--dist-rank", default=0, action="store", type="int",
152 help="Rank of this system within the dist gem5 run.")
153 parser.add_option("--dist-size", default=0, action="store", type="int",
154 help="Number of gem5 processes within the dist gem5 run.")
155 parser.add_option("--dist-server-name",
156 default="127.0.0.1",
157 action="store", type="string",
158 help="Name of the message server host\nDEFAULT: localhost")
159 parser.add_option("--dist-server-port",
160 default=2200,
161 action="store", type="int",
162 help="Message server listen port\nDEFAULT: 2200")
163 parser.add_option("--dist-sync-repeat",
164 default="0us",
165 action="store", type="string",
166 help="Repeat interval for synchronisation barriers among dist-gem5 processes\nDEFAULT: --ethernet-linkdelay")
167 parser.add_option("--dist-sync-start",
168 default="5200000000000t",
169 action="store", type="string",
170 help="Time to schedule the first dist synchronisation barrier\nDEFAULT:5200000000000t")
171 parser.add_option("--ethernet-linkspeed", default="10Gbps",
172 action="store", type="string",
173 help="Link speed in bps\nDEFAULT: 10Gbps")
174 parser.add_option("--ethernet-linkdelay", default="10us",
175 action="store", type="string",
176 help="Link delay in seconds\nDEFAULT: 10us")
177
169 # dist-gem5 options
170 parser.add_option("--dist", action="store_true",
171 help="Parallel distributed gem5 simulation.")
172 parser.add_option("--is-switch", action="store_true",
173 help="Select the network switch simulator process for a"\
174 "distributed gem5 run")
175 parser.add_option("--dist-rank", default=0, action="store", type="int",
176 help="Rank of this system within the dist gem5 run.")
177 parser.add_option("--dist-size", default=0, action="store", type="int",
178 help="Number of gem5 processes within the dist gem5 run.")
179 parser.add_option("--dist-server-name",
180 default="127.0.0.1",
181 action="store", type="string",
182 help="Name of the message server host\nDEFAULT: localhost")
183 parser.add_option("--dist-server-port",
184 default=2200,
185 action="store", type="int",
186 help="Message server listen port\nDEFAULT: 2200")
187 parser.add_option("--dist-sync-repeat",
188 default="0us",
189 action="store", type="string",
190 help="Repeat interval for synchronisation barriers among dist-gem5 processes\nDEFAULT: --ethernet-linkdelay")
191 parser.add_option("--dist-sync-start",
192 default="5200000000000t",
193 action="store", type="string",
194 help="Time to schedule the first dist synchronisation barrier\nDEFAULT:5200000000000t")
195 parser.add_option("--ethernet-linkspeed", default="10Gbps",
196 action="store", type="string",
197 help="Link speed in bps\nDEFAULT: 10Gbps")
198 parser.add_option("--ethernet-linkdelay", default="10us",
199 action="store", type="string",
200 help="Link delay in seconds\nDEFAULT: 10us")
201
178 # Enable Ruby
179 parser.add_option("--ruby", action="store_true")
180
181 # Run duration options
202 # Run duration options
182 parser.add_option("-m", "--abs-max-tick", type="int", default=m5.MaxTick,
183 metavar="TICKS", help="Run to absolute simulated tick " \
184 "specified including ticks from a restored checkpoint")
185 parser.add_option("--rel-max-tick", type="int", default=None,
186 metavar="TICKS", help="Simulate for specified number of" \
187 " ticks relative to the simulation start tick (e.g. if " \
188 "restoring a checkpoint)")
189 parser.add_option("--maxtime", type="float", default=None,
190 help="Run to the specified absolute simulated time in " \
191 "seconds")
192 parser.add_option("-I", "--maxinsts", action="store", type="int",
193 default=None, help="""Total number of instructions to
194 simulate (default: run forever)""")
195 parser.add_option("--work-item-id", action="store", type="int",
196 help="the specific work id for exit & checkpointing")
197 parser.add_option("--num-work-ids", action="store", type="int",
198 help="Number of distinct work item types")
199 parser.add_option("--work-begin-cpu-id-exit", action="store", type="int",
200 help="exit when work starts on the specified cpu")
201 parser.add_option("--work-end-exit-count", action="store", type="int",
202 help="exit at specified work end count")
203 parser.add_option("--work-begin-exit-count", action="store", type="int",
204 help="exit at specified work begin count")
205 parser.add_option("--init-param", action="store", type="int", default=0,
206 help="""Parameter available in simulation with m5
207 initparam""")
208 parser.add_option("--initialize-only", action="store_true", default=False,
209 help="""Exit after initialization. Do not simulate time.
210 Useful when gem5 is run as a library.""")
211
212 # Simpoint options
213 parser.add_option("--simpoint-profile", action="store_true",
214 help="Enable basic block profiling for SimPoints")
215 parser.add_option("--simpoint-interval", type="int", default=10000000,
216 help="SimPoint interval in num of instructions")
217 parser.add_option("--take-simpoint-checkpoints", action="store", type="string",
218 help="<simpoint file,weight file,interval-length,warmup-length>")
219 parser.add_option("--restore-simpoint-checkpoint", action="store_true",
220 help="restore from a simpoint checkpoint taken with " +
221 "--take-simpoint-checkpoints")
222
223 # Checkpointing options
224 ###Note that performing checkpointing via python script files will override
225 ###checkpoint instructions built into binaries.
226 parser.add_option("--take-checkpoints", action="store", type="string",
227 help="<M,N> take checkpoints at tick M and every N ticks thereafter")
228 parser.add_option("--max-checkpoints", action="store", type="int",
229 help="the maximum number of checkpoints to drop", default=5)
230 parser.add_option("--checkpoint-dir", action="store", type="string",
231 help="Place all checkpoints in this absolute directory")
232 parser.add_option("-r", "--checkpoint-restore", action="store", type="int",
233 help="restore from checkpoint <N>")
234 parser.add_option("--checkpoint-at-end", action="store_true",
235 help="take a checkpoint at end of run")
236 parser.add_option("--work-begin-checkpoint-count", action="store", type="int",
237 help="checkpoint at specified work begin count")
238 parser.add_option("--work-end-checkpoint-count", action="store", type="int",
239 help="checkpoint at specified work end count")
240 parser.add_option("--work-cpus-checkpoint-count", action="store", type="int",
241 help="checkpoint and exit when active cpu count is reached")
242 parser.add_option("--restore-with-cpu", action="store", type="choice",
243 default="atomic", choices=CpuConfig.cpu_names(),
244 help = "cpu type for restoring from a checkpoint")
245
246
247 # CPU Switching - default switch model goes from a checkpoint
248 # to a timing simple CPU with caches to warm up, then to detailed CPU for
249 # data measurement
250 parser.add_option("--repeat-switch", action="store", type="int",
251 default=None,
252 help="switch back and forth between CPUs with period <N>")
253 parser.add_option("-s", "--standard-switch", action="store", type="int",
254 default=None,
255 help="switch from timing to Detailed CPU after warmup period of <N>")
256 parser.add_option("-p", "--prog-interval", type="str",
257 help="CPU Progress Interval")
258
259 # Fastforwarding and simpoint related materials
260 parser.add_option("-W", "--warmup-insts", action="store", type="int",
261 default=None,
262 help="Warmup period in total instructions (requires --standard-switch)")
263 parser.add_option("--bench", action="store", type="string", default=None,
264 help="base names for --take-checkpoint and --checkpoint-restore")
265 parser.add_option("-F", "--fast-forward", action="store", type="string",
266 default=None,
267 help="Number of instructions to fast forward before switching")
268 parser.add_option("-S", "--simpoint", action="store_true", default=False,
269 help="""Use workload simpoints as an instruction offset for
270 --checkpoint-restore or --take-checkpoint.""")
271 parser.add_option("--at-instruction", action="store_true", default=False,
272 help="""Treat value of --checkpoint-restore or --take-checkpoint as a
273 number of instructions.""")
274 parser.add_option("--spec-input", default="ref", type="choice",
275 choices=["ref", "test", "train", "smred", "mdred",
276 "lgred"],
277 help="Input set size for SPEC CPU2000 benchmarks.")
278 parser.add_option("--arm-iset", default="arm", type="choice",
279 choices=["arm", "thumb", "aarch64"],
280 help="ARM instruction set.")
281
282
283def addSEOptions(parser):
284 # Benchmark options
285 parser.add_option("-c", "--cmd", default="",
286 help="The binary to run in syscall emulation mode.")
287 parser.add_option("-o", "--options", default="",
288 help="""The options to pass to the binary, use " "
289 around the entire string""")
290 parser.add_option("-e", "--env", default="",
291 help="Initialize workload environment from text file.")
292 parser.add_option("-i", "--input", default="",
293 help="Read stdin from a file.")
294 parser.add_option("--output", default="",
295 help="Redirect stdout to a file.")
296 parser.add_option("--errout", default="",
297 help="Redirect stderr to a file.")
298
299def addFSOptions(parser):
203 parser.add_option("-I", "--maxinsts", action="store", type="int",
204 default=None, help="""Total number of instructions to
205 simulate (default: run forever)""")
206 parser.add_option("--work-item-id", action="store", type="int",
207 help="the specific work id for exit & checkpointing")
208 parser.add_option("--num-work-ids", action="store", type="int",
209 help="Number of distinct work item types")
210 parser.add_option("--work-begin-cpu-id-exit", action="store", type="int",
211 help="exit when work starts on the specified cpu")
212 parser.add_option("--work-end-exit-count", action="store", type="int",
213 help="exit at specified work end count")
214 parser.add_option("--work-begin-exit-count", action="store", type="int",
215 help="exit at specified work begin count")
216 parser.add_option("--init-param", action="store", type="int", default=0,
217 help="""Parameter available in simulation with m5
218 initparam""")
219 parser.add_option("--initialize-only", action="store_true", default=False,
220 help="""Exit after initialization. Do not simulate time.
221 Useful when gem5 is run as a library.""")
222
223 # Simpoint options
224 parser.add_option("--simpoint-profile", action="store_true",
225 help="Enable basic block profiling for SimPoints")
226 parser.add_option("--simpoint-interval", type="int", default=10000000,
227 help="SimPoint interval in num of instructions")
228 parser.add_option("--take-simpoint-checkpoints", action="store", type="string",
229 help="<simpoint file,weight file,interval-length,warmup-length>")
230 parser.add_option("--restore-simpoint-checkpoint", action="store_true",
231 help="restore from a simpoint checkpoint taken with " +
232 "--take-simpoint-checkpoints")
233
234 # Checkpointing options
235 ###Note that performing checkpointing via python script files will override
236 ###checkpoint instructions built into binaries.
237 parser.add_option("--take-checkpoints", action="store", type="string",
238 help="<M,N> take checkpoints at tick M and every N ticks thereafter")
239 parser.add_option("--max-checkpoints", action="store", type="int",
240 help="the maximum number of checkpoints to drop", default=5)
241 parser.add_option("--checkpoint-dir", action="store", type="string",
242 help="Place all checkpoints in this absolute directory")
243 parser.add_option("-r", "--checkpoint-restore", action="store", type="int",
244 help="restore from checkpoint <N>")
245 parser.add_option("--checkpoint-at-end", action="store_true",
246 help="take a checkpoint at end of run")
247 parser.add_option("--work-begin-checkpoint-count", action="store", type="int",
248 help="checkpoint at specified work begin count")
249 parser.add_option("--work-end-checkpoint-count", action="store", type="int",
250 help="checkpoint at specified work end count")
251 parser.add_option("--work-cpus-checkpoint-count", action="store", type="int",
252 help="checkpoint and exit when active cpu count is reached")
253 parser.add_option("--restore-with-cpu", action="store", type="choice",
254 default="atomic", choices=CpuConfig.cpu_names(),
255 help = "cpu type for restoring from a checkpoint")
256
257
258 # CPU Switching - default switch model goes from a checkpoint
259 # to a timing simple CPU with caches to warm up, then to detailed CPU for
260 # data measurement
261 parser.add_option("--repeat-switch", action="store", type="int",
262 default=None,
263 help="switch back and forth between CPUs with period <N>")
264 parser.add_option("-s", "--standard-switch", action="store", type="int",
265 default=None,
266 help="switch from timing to Detailed CPU after warmup period of <N>")
267 parser.add_option("-p", "--prog-interval", type="str",
268 help="CPU Progress Interval")
269
270 # Fastforwarding and simpoint related materials
271 parser.add_option("-W", "--warmup-insts", action="store", type="int",
272 default=None,
273 help="Warmup period in total instructions (requires --standard-switch)")
274 parser.add_option("--bench", action="store", type="string", default=None,
275 help="base names for --take-checkpoint and --checkpoint-restore")
276 parser.add_option("-F", "--fast-forward", action="store", type="string",
277 default=None,
278 help="Number of instructions to fast forward before switching")
279 parser.add_option("-S", "--simpoint", action="store_true", default=False,
280 help="""Use workload simpoints as an instruction offset for
281 --checkpoint-restore or --take-checkpoint.""")
282 parser.add_option("--at-instruction", action="store_true", default=False,
283 help="""Treat value of --checkpoint-restore or --take-checkpoint as a
284 number of instructions.""")
285 parser.add_option("--spec-input", default="ref", type="choice",
286 choices=["ref", "test", "train", "smred", "mdred",
287 "lgred"],
288 help="Input set size for SPEC CPU2000 benchmarks.")
289 parser.add_option("--arm-iset", default="arm", type="choice",
290 choices=["arm", "thumb", "aarch64"],
291 help="ARM instruction set.")
292
293
294def addSEOptions(parser):
295 # Benchmark options
296 parser.add_option("-c", "--cmd", default="",
297 help="The binary to run in syscall emulation mode.")
298 parser.add_option("-o", "--options", default="",
299 help="""The options to pass to the binary, use " "
300 around the entire string""")
301 parser.add_option("-e", "--env", default="",
302 help="Initialize workload environment from text file.")
303 parser.add_option("-i", "--input", default="",
304 help="Read stdin from a file.")
305 parser.add_option("--output", default="",
306 help="Redirect stdout to a file.")
307 parser.add_option("--errout", default="",
308 help="Redirect stderr to a file.")
309
310def addFSOptions(parser):
311 from FSConfig import os_types
312
300 # Simulation options
301 parser.add_option("--timesync", action="store_true",
302 help="Prevent simulated time from getting ahead of real time")
303
304 # System options
305 parser.add_option("--kernel", action="store", type="string")
306 parser.add_option("--os-type", action="store", type="choice",
307 choices=os_types[buildEnv['TARGET_ISA']], default="linux",
308 help="Specifies type of OS to boot")
309 parser.add_option("--script", action="store", type="string")
310 parser.add_option("--frame-capture", action="store_true",
311 help="Stores changed frame buffers from the VNC server to compressed "\
312 "files in the gem5 output directory")
313
314 if buildEnv['TARGET_ISA'] == "arm":
315 parser.add_option("--bare-metal", action="store_true",
316 help="Provide the raw system without the linux specific bits")
317 parser.add_option("--list-machine-types",
318 action="callback", callback=_listPlatformTypes,
319 help="List available platform types")
320 parser.add_option("--machine-type", action="store", type="choice",
321 choices=PlatformConfig.platform_names(),
322 default="VExpress_EMM")
323 parser.add_option("--dtb-filename", action="store", type="string",
324 help="Specifies device tree blob file to use with device-tree-"\
325 "enabled kernels")
326 parser.add_option("--enable-context-switch-stats-dump", \
327 action="store_true", help="Enable stats dump at context "\
328 "switches and dump tasks file (required for Streamline)")
329
330 # Benchmark options
331 parser.add_option("--dual", action="store_true",
332 help="Simulate two systems attached with an ethernet link")
333 parser.add_option("-b", "--benchmark", action="store", type="string",
334 dest="benchmark",
335 help="Specify the benchmark to run. Available benchmarks: %s"\
336 % DefinedBenchmarks)
337
338 # Metafile options
339 parser.add_option("--etherdump", action="store", type="string", dest="etherdump",
340 help="Specify the filename to dump a pcap capture of the" \
341 "ethernet traffic")
342
343 # Disk Image Options
344 parser.add_option("--disk-image", action="store", type="string", default=None,
345 help="Path to the disk image to use.")
346 parser.add_option("--root-device", action="store", type="string", default=None,
347 help="OS device name for root partition")
348
349 # Command line options
350 parser.add_option("--command-line", action="store", type="string",
351 default=None,
352 help="Template for the kernel command line.")
353 parser.add_option("--command-line-file", action="store",
354 default=None, type="string",
355 help="File with a template for the kernel command line")
313 # Simulation options
314 parser.add_option("--timesync", action="store_true",
315 help="Prevent simulated time from getting ahead of real time")
316
317 # System options
318 parser.add_option("--kernel", action="store", type="string")
319 parser.add_option("--os-type", action="store", type="choice",
320 choices=os_types[buildEnv['TARGET_ISA']], default="linux",
321 help="Specifies type of OS to boot")
322 parser.add_option("--script", action="store", type="string")
323 parser.add_option("--frame-capture", action="store_true",
324 help="Stores changed frame buffers from the VNC server to compressed "\
325 "files in the gem5 output directory")
326
327 if buildEnv['TARGET_ISA'] == "arm":
328 parser.add_option("--bare-metal", action="store_true",
329 help="Provide the raw system without the linux specific bits")
330 parser.add_option("--list-machine-types",
331 action="callback", callback=_listPlatformTypes,
332 help="List available platform types")
333 parser.add_option("--machine-type", action="store", type="choice",
334 choices=PlatformConfig.platform_names(),
335 default="VExpress_EMM")
336 parser.add_option("--dtb-filename", action="store", type="string",
337 help="Specifies device tree blob file to use with device-tree-"\
338 "enabled kernels")
339 parser.add_option("--enable-context-switch-stats-dump", \
340 action="store_true", help="Enable stats dump at context "\
341 "switches and dump tasks file (required for Streamline)")
342
343 # Benchmark options
344 parser.add_option("--dual", action="store_true",
345 help="Simulate two systems attached with an ethernet link")
346 parser.add_option("-b", "--benchmark", action="store", type="string",
347 dest="benchmark",
348 help="Specify the benchmark to run. Available benchmarks: %s"\
349 % DefinedBenchmarks)
350
351 # Metafile options
352 parser.add_option("--etherdump", action="store", type="string", dest="etherdump",
353 help="Specify the filename to dump a pcap capture of the" \
354 "ethernet traffic")
355
356 # Disk Image Options
357 parser.add_option("--disk-image", action="store", type="string", default=None,
358 help="Path to the disk image to use.")
359 parser.add_option("--root-device", action="store", type="string", default=None,
360 help="OS device name for root partition")
361
362 # Command line options
363 parser.add_option("--command-line", action="store", type="string",
364 default=None,
365 help="Template for the kernel command line.")
366 parser.add_option("--command-line-file", action="store",
367 default=None, type="string",
368 help="File with a template for the kernel command line")