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"); 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""") 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 91 # Memory Options 92 parser.add_option("--list-mem-types", 93 action="callback", callback=_listMemTypes, 94 help="List available memory types") 95 parser.add_option("--mem-type", type="choice", default="DDR3_1600_x64", 96 choices=MemConfig.mem_names(), 97 help = "type of memory to use") 98 parser.add_option("--mem-channels", type="int", default=1, 99 help = "number of memory channels") 100 parser.add_option("--mem-ranks", type="int", default=None, 101 help = "number of memory ranks per channel") 102 parser.add_option("--mem-size", action="store", type="string", 103 default="512MB", 104 help="Specify the physical memory size (single memory)") 105 106 parser.add_option("-l", "--lpae", action="store_true") 107 parser.add_option("-V", "--virtualisation", action="store_true") 108 109 parser.add_option("--memchecker", action="store_true") 110 111 # Cache Options 112 parser.add_option("--external-memory-system", type="string", 113 help="use external ports of this port_type for caches") 114 parser.add_option("--tlm-memory", type="string", 115 help="use external port for SystemC TLM cosimulation") 116 parser.add_option("--caches", action="store_true") 117 parser.add_option("--l2cache", action="store_true") 118 parser.add_option("--fastmem", action="store_true") 119 parser.add_option("--num-dirs", type="int", default=1) 120 parser.add_option("--num-l2caches", type="int", default=1) 121 parser.add_option("--num-l3caches", type="int", default=1) 122 parser.add_option("--l1d_size", type="string", default="64kB") 123 parser.add_option("--l1i_size", type="string", default="32kB") 124 parser.add_option("--l2_size", type="string", default="2MB") 125 parser.add_option("--l3_size", type="string", default="16MB") 126 parser.add_option("--l1d_assoc", type="int", default=2) 127 parser.add_option("--l1i_assoc", type="int", default=2) 128 parser.add_option("--l2_assoc", type="int", default=8) 129 parser.add_option("--l3_assoc", type="int", default=16) 130 parser.add_option("--cacheline_size", type="int", default=64) 131 132 # Enable Ruby 133 parser.add_option("--ruby", action="store_true") 134 135 # Run duration options 136 parser.add_option("-m", "--abs-max-tick", type="int", default=m5.MaxTick, 137 metavar="TICKS", help="Run to absolute simulated tick " \ 138 "specified including ticks from a restored checkpoint") 139 parser.add_option("--rel-max-tick", type="int", default=None, 140 metavar="TICKS", help="Simulate for specified number of" \ 141 " ticks relative to the simulation start tick (e.g. if " \ 142 "restoring a checkpoint)") 143 parser.add_option("--maxtime", type="float", default=None, 144 help="Run to the specified absolute simulated time in " \ 145 "seconds") 146 parser.add_option("-I", "--maxinsts", action="store", type="int", 147 default=None, help="""Total number of instructions to 148 simulate (default: run forever)""") 149 parser.add_option("--work-item-id", action="store", type="int", 150 help="the specific work id for exit & checkpointing") 151 parser.add_option("--num-work-ids", action="store", type="int", 152 help="Number of distinct work item types") 153 parser.add_option("--work-begin-cpu-id-exit", action="store", type="int", 154 help="exit when work starts on the specified cpu") 155 parser.add_option("--work-end-exit-count", action="store", type="int", 156 help="exit at specified work end count") 157 parser.add_option("--work-begin-exit-count", action="store", type="int", 158 help="exit at specified work begin count") 159 parser.add_option("--init-param", action="store", type="int", default=0, 160 help="""Parameter available in simulation with m5 161 initparam""") 162 parser.add_option("--initialize-only", action="store_true", default=False, 163 help="""Exit after initialization. Do not simulate time. 164 Useful when gem5 is run as a library.""") 165 166 # Simpoint options 167 parser.add_option("--simpoint-profile", action="store_true", 168 help="Enable basic block profiling for SimPoints") 169 parser.add_option("--simpoint-interval", type="int", default=10000000, 170 help="SimPoint interval in num of instructions") 171 parser.add_option("--take-simpoint-checkpoints", action="store", type="string", 172 help="<simpoint file,weight file,interval-length,warmup-length>") 173 parser.add_option("--restore-simpoint-checkpoint", action="store_true", 174 help="restore from a simpoint checkpoint taken with " + 175 "--take-simpoint-checkpoints") 176 177 # Checkpointing options 178 ###Note that performing checkpointing via python script files will override 179 ###checkpoint instructions built into binaries. 180 parser.add_option("--take-checkpoints", action="store", type="string", 181 help="<M,N> take checkpoints at tick M and every N ticks thereafter") 182 parser.add_option("--max-checkpoints", action="store", type="int", 183 help="the maximum number of checkpoints to drop", default=5) 184 parser.add_option("--checkpoint-dir", action="store", type="string", 185 help="Place all checkpoints in this absolute directory") 186 parser.add_option("-r", "--checkpoint-restore", action="store", type="int", 187 help="restore from checkpoint <N>") 188 parser.add_option("--checkpoint-at-end", action="store_true", 189 help="take a checkpoint at end of run") 190 parser.add_option("--work-begin-checkpoint-count", action="store", type="int", 191 help="checkpoint at specified work begin count") 192 parser.add_option("--work-end-checkpoint-count", action="store", type="int", 193 help="checkpoint at specified work end count") 194 parser.add_option("--work-cpus-checkpoint-count", action="store", type="int", 195 help="checkpoint and exit when active cpu count is reached") 196 parser.add_option("--restore-with-cpu", action="store", type="choice", 197 default="atomic", choices=CpuConfig.cpu_names(), 198 help = "cpu type for restoring from a checkpoint") 199 200 201 # CPU Switching - default switch model goes from a checkpoint 202 # to a timing simple CPU with caches to warm up, then to detailed CPU for 203 # data measurement 204 parser.add_option("--repeat-switch", action="store", type="int", 205 default=None, 206 help="switch back and forth between CPUs with period <N>") 207 parser.add_option("-s", "--standard-switch", action="store", type="int", 208 default=None, 209 help="switch from timing to Detailed CPU after warmup period of <N>") 210 parser.add_option("-p", "--prog-interval", type="str", 211 help="CPU Progress Interval") 212 213 # Fastforwarding and simpoint related materials 214 parser.add_option("-W", "--warmup-insts", action="store", type="int", 215 default=None, 216 help="Warmup period in total instructions (requires --standard-switch)") 217 parser.add_option("--bench", action="store", type="string", default=None, 218 help="base names for --take-checkpoint and --checkpoint-restore") 219 parser.add_option("-F", "--fast-forward", action="store", type="string", 220 default=None, 221 help="Number of instructions to fast forward before switching") 222 parser.add_option("-S", "--simpoint", action="store_true", default=False, 223 help="""Use workload simpoints as an instruction offset for 224 --checkpoint-restore or --take-checkpoint.""") 225 parser.add_option("--at-instruction", action="store_true", default=False, 226 help="""Treat value of --checkpoint-restore or --take-checkpoint as a 227 number of instructions.""") 228 parser.add_option("--spec-input", default="ref", type="choice", 229 choices=["ref", "test", "train", "smred", "mdred", 230 "lgred"], 231 help="Input set size for SPEC CPU2000 benchmarks.") 232 parser.add_option("--arm-iset", default="arm", type="choice", 233 choices=["arm", "thumb", "aarch64"], 234 help="ARM instruction set.") 235 236 237def addSEOptions(parser): 238 # Benchmark options 239 parser.add_option("-c", "--cmd", default="", 240 help="The binary to run in syscall emulation mode.") 241 parser.add_option("-o", "--options", default="", 242 help="""The options to pass to the binary, use " " 243 around the entire string""") 244 parser.add_option("-e", "--env", default="", 245 help="Initialize workload environment from text file.") 246 parser.add_option("-i", "--input", default="", 247 help="Read stdin from a file.") 248 parser.add_option("--output", default="", 249 help="Redirect stdout to a file.") 250 parser.add_option("--errout", default="", 251 help="Redirect stderr to a file.") 252 253def addFSOptions(parser): 254 # Simulation options 255 parser.add_option("--timesync", action="store_true", 256 help="Prevent simulated time from getting ahead of real time") 257 258 # System options 259 parser.add_option("--kernel", action="store", type="string") 260 parser.add_option("--os-type", action="store", type="choice", 261 choices=os_types[buildEnv['TARGET_ISA']], default="linux", 262 help="Specifies type of OS to boot") 263 parser.add_option("--script", action="store", type="string") 264 parser.add_option("--frame-capture", action="store_true", 265 help="Stores changed frame buffers from the VNC server to compressed "\ 266 "files in the gem5 output directory") 267 268 if buildEnv['TARGET_ISA'] == "arm": 269 parser.add_option("--bare-metal", action="store_true", 270 help="Provide the raw system without the linux specific bits")
|