Running gem5

From gem5
Revision as of 16:05, 31 July 2006 by Ktlim (talk | contribs)
Jump to: navigation, search

M5 uses script files to specify simulated system configurations and simulation options. Running M5 is as simple as giving the name of a script file (ending in '.py') as a command-line argument.

The script file documentation page (Configuration Files Explained) has details on script file format and interpretation. The easiest way to get started is to use an existing script file. A variety of script files are provided in the src/configs directory.

There are several options that are global to M5, such as output options and debug print options. These options must be specified prior to the script file. Thus a typical m5 command line looks like:

% build/ALPHA_SE/m5.debug [m5 options] [script options]

A few typical m5 options are:

  • --trace-flags="SomeFlagString" - turn on event tracing for the specified classes of simulation events
  • --trace-start=<start_time> - time at which the traces indicated by the trace.flags param are to begin dumping

Running m5 with the "-h" flag prints a help message, including basic command-line parameters and the global m5 options. Here is what it looks like:

% build/ALPHA_SE/m5.debug -h
  m5.debug [m5 options] [script options]

 Copyright (c) 2001-2006 The Regents of The University of Michigan All Rights

--version               show program's version number and exit
--help, -h              show this help message and exit
--authors, -A           Show author information
--copyright, -C         Show full copyright information
--readme, -R            Show the readme
--release-notes, -N     Show the release notes
--outdir=DIR, -d DIR    Set the output directory to DIR [Default: .]
--interactive, -i       Invoke the interactive interpreter after running the
--pdb                   Invoke the python debugger before running the script
--path=PATH[:PATH], -p PATH[:PATH]
                        Prepend PATH to the system path when invoking the
--quiet, -q             Reduce verbosity

Simluation options that are script-specific can be specified directly on the command line as "--<option>=<value>", with these options being listed after the script file. From the simulator's perspective, setting options in this fashion is indistinguishable from specifying them in a script file.

Running m5 with a config file and the "-h" flag prints out all options that are available for that script. Here is a sample:

% build/ALPHA_SE/m5.debug configs/test/ -h
usage: [options]

  -h, --help            show this help message and exit
  -d, --detailed
  -t, --timing
  -m MAXTICK, --maxtick=MAXTICK