Options.py revision 6776
15353Svilas.sridharan@gmail.com# Copyright (c) 2006-2008 The Regents of The University of Michigan
23395Shsul@eecs.umich.edu# All rights reserved.
33395Shsul@eecs.umich.edu#
43395Shsul@eecs.umich.edu# Redistribution and use in source and binary forms, with or without
53395Shsul@eecs.umich.edu# modification, are permitted provided that the following conditions are
63395Shsul@eecs.umich.edu# met: redistributions of source code must retain the above copyright
73395Shsul@eecs.umich.edu# notice, this list of conditions and the following disclaimer;
83395Shsul@eecs.umich.edu# redistributions in binary form must reproduce the above copyright
93395Shsul@eecs.umich.edu# notice, this list of conditions and the following disclaimer in the
103395Shsul@eecs.umich.edu# documentation and/or other materials provided with the distribution;
113395Shsul@eecs.umich.edu# neither the name of the copyright holders nor the names of its
123395Shsul@eecs.umich.edu# contributors may be used to endorse or promote products derived from
133395Shsul@eecs.umich.edu# this software without specific prior written permission.
143395Shsul@eecs.umich.edu#
153395Shsul@eecs.umich.edu# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
163395Shsul@eecs.umich.edu# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
173395Shsul@eecs.umich.edu# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
183395Shsul@eecs.umich.edu# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
193395Shsul@eecs.umich.edu# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
203395Shsul@eecs.umich.edu# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
213395Shsul@eecs.umich.edu# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
223395Shsul@eecs.umich.edu# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
233395Shsul@eecs.umich.edu# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
243395Shsul@eecs.umich.edu# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
253395Shsul@eecs.umich.edu# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
263395Shsul@eecs.umich.edu#
273395Shsul@eecs.umich.edu# Authors: Lisa Hsu
283395Shsul@eecs.umich.edu
293395Shsul@eecs.umich.edu# system options
303395Shsul@eecs.umich.eduparser.add_option("-d", "--detailed", action="store_true")
313395Shsul@eecs.umich.eduparser.add_option("-t", "--timing", action="store_true")
325869Sksewell@umich.eduparser.add_option("--inorder", action="store_true")
335361Srstrong@cs.ucsd.eduparser.add_option("-n", "--num-cpus", type="int", default=1)
343395Shsul@eecs.umich.eduparser.add_option("--caches", action="store_true")
354455Ssaidi@eecs.umich.eduparser.add_option("--l2cache", action="store_true")
364968Sacolyte@umich.eduparser.add_option("--fastmem", action="store_true")
373395Shsul@eecs.umich.edu
383395Shsul@eecs.umich.edu# Run duration options
393395Shsul@eecs.umich.eduparser.add_option("-m", "--maxtick", type="int")
403395Shsul@eecs.umich.eduparser.add_option("--maxtime", type="float")
416641Sksewell@umich.eduparser.add_option("--maxinsts", type="int")
426144Sksewell@umich.eduparser.add_option("--prog_intvl", type="int")
436144Sksewell@umich.edu
443395Shsul@eecs.umich.edu
453395Shsul@eecs.umich.edu# Checkpointing options
463395Shsul@eecs.umich.edu###Note that performing checkpointing via python script files will override
473395Shsul@eecs.umich.edu###checkpoint instructions built into binaries.
485361Srstrong@cs.ucsd.eduparser.add_option("--take-checkpoints", action="store", type="string",
495361Srstrong@cs.ucsd.edu    help="<M,N> will take checkpoint at cycle M and every N cycles thereafter")
505361Srstrong@cs.ucsd.eduparser.add_option("--max-checkpoints", action="store", type="int",
515361Srstrong@cs.ucsd.edu    help="the maximum number of checkpoints to drop", default=5)
525361Srstrong@cs.ucsd.eduparser.add_option("--checkpoint-dir", action="store", type="string",
535361Srstrong@cs.ucsd.edu    help="Place all checkpoints in this absolute directory")
545361Srstrong@cs.ucsd.eduparser.add_option("-r", "--checkpoint-restore", action="store", type="int",
555361Srstrong@cs.ucsd.edu    help="restore from checkpoint <N>")
566776SBrad.Beckmann@amd.comparser.add_option("--checkpoint-at-end", action="store_true",
576776SBrad.Beckmann@amd.com                  help="take a checkpoint at end of run")
586776SBrad.Beckmann@amd.com
593395Shsul@eecs.umich.edu
603395Shsul@eecs.umich.edu# CPU Switching - default switch model goes from a checkpoint
613395Shsul@eecs.umich.edu# to a timing simple CPU with caches to warm up, then to detailed CPU for
623395Shsul@eecs.umich.edu# data measurement
635361Srstrong@cs.ucsd.eduparser.add_option("-s", "--standard-switch", action="store_true",
645361Srstrong@cs.ucsd.edu    help="switch from timing CPU to Detailed CPU")
653445Shsul@eecs.umich.eduparser.add_option("-w", "--warmup", action="store", type="int",
665361Srstrong@cs.ucsd.edu    help="if -s, then this is the warmup period.  else, this is ignored",
675361Srstrong@cs.ucsd.edu    default=5000000000)
686769SBrad.Beckmann@amd.comparser.add_option("--profile", help="CPU profile interval")
695361Srstrong@cs.ucsd.edu
705361Srstrong@cs.ucsd.edu# Fastforwarding and simpoint related materials
715361Srstrong@cs.ucsd.eduparser.add_option("-W", "--warmup-insts", action="store", type="int",
725361Srstrong@cs.ucsd.edu    default=None,
735361Srstrong@cs.ucsd.edu    help="Warmup period in total instructions (requires --standard-switch)")
745361Srstrong@cs.ucsd.eduparser.add_option("-I", "--max-inst", action="store", type="int", default=None,
755361Srstrong@cs.ucsd.edu    help="Total number of instructions to simulate (default: run forever)")
765361Srstrong@cs.ucsd.eduparser.add_option("--bench", action="store", type="string", default=None,
775361Srstrong@cs.ucsd.edu    help="base names for --take-checkpoint and --checkpoint-restore")
785361Srstrong@cs.ucsd.eduparser.add_option("-F", "--fast-forward", action="store", type="string",
795361Srstrong@cs.ucsd.edu    default=None,
805361Srstrong@cs.ucsd.edu    help="Number of instructions to fast forward before switching")
815361Srstrong@cs.ucsd.eduparser.add_option("-S", "--simpoint", action="store_true", default=False,
825361Srstrong@cs.ucsd.edu    help="""Use workload simpoints as an instruction offset for
835361Srstrong@cs.ucsd.edu--checkpoint-restore or --take-checkpoint.""")
845361Srstrong@cs.ucsd.eduparser.add_option("--at-instruction", action="store_true", default=False,
855361Srstrong@cs.ucsd.edu    help="""Treate value of --checkpoint-restore or --take-checkpoint as a
865361Srstrong@cs.ucsd.edunumber of instructions.""")
87