Difference between revisions of "Running gem5"

From gem5
Jump to: navigation, search
Line 3: Line 3:
 
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.
 
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.
  
Simluation options can be specified directly on the command line as "--<option>=<value>". From the simulator's perspective, setting options in this fashion is indistinguishable from specifying them in a script file. A few options typically specified on the command line instead of in a script file are:
+
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:
  
* --traceflags="SomeFlagString" - turn on event tracing for the specified classes of simulation events
+
<pre>
* --tracestart=<start_cycle> - cycle at which the traces indicated by the trace.flags param are to begin dumping
+
% build/ALPHA_SE/m5.debug [m5 options] script.py [script options]
 +
</pre>
 +
 
 +
A few typical m5 options are:
  
Running m5 with the "-h" flag prints a help message, including basic command-line parameters. Here is what it looks like:
+
* --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:
  
 
<pre>
 
<pre>
 
% build/ALPHA_SE/m5.debug -h
 
% build/ALPHA_SE/m5.debug -h
Usage:
+
Usage
m5.debug [-p <path>] [-i ] [-h] <config file>
+
=====
 +
  m5.debug [m5 options] script.py [script options]
  
  -p, --path <path>  prepends <path> to PYTHONPATH instead of using
+
  Copyright (c) 2001-2006 The Regents of The University of Michigan All Rights
                    built-in zip archive.  Useful when developing/debugging
+
Reserved
                    changes to built-in Python libraries, as the new Python
 
                    can be tested without building a new m5 binary.
 
  
-i, --interactive forces entry into interactive mode after the supplied
+
options
                    script is executed (just like the -i option to the
+
=======
                    Python interpreter).
+
--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
 +
                        script
 +
--pdb                  Invoke the python debugger before running the script
 +
--path=PATH[:PATH], -p PATH[:PATH]
 +
                        Prepend PATH to the system path when invoking the
 +
                        script
 +
--quiet, -q            Reduce verbosity
 +
...
 +
</pre>
  
-h                Prints this help
+
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.
 
 
<configfile>       config file name which ends in .py. (Normally you can
 
                    run <configfile> --help to get help on that config files
 
                    parameters.
 
</pre>
 
  
Additionally, running m5 with a config file and the "-h" flag prints out all options that are available.  Here is a sample:
+
Running m5 with a config file and the "-h" flag prints out all options that are available for that script.  Here is a sample:
  
 
<pre>
 
<pre>
Line 38: Line 53:
  
 
options:
 
options:
   --outdir=OUTDIR
+
   -h, --help            show this help message and exit
   --traceflags=TRACEFLAGS
+
   -d, --detailed
  --tracestart=TRACESTART
+
   -t, --timing
   --tracefile=TRACEFILE
+
   -m MAXTICK, --maxtick=MAXTICK
  --nopcsymbol          Disable PC symbols in trace output
 
   --noprintcycle        Don't print cycle numbers in trace output
 
  --noprintopclass      Don't print op class type in trace output
 
 
...
 
...
 
</pre>
 
</pre>

Revision as of 15:05, 31 July 2006

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.py [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
Usage
=====
  m5.debug [m5 options] script.py [script options]

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

options
=======
--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
                        script
--pdb                   Invoke the python debugger before running the script
--path=PATH[:PATH], -p PATH[:PATH]
                        Prepend PATH to the system path when invoking the
                        script
--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/test.py -h
usage: test.py [options]

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