Options.py revision 5869:acbe11bbfe68
17008Snate@binkert.org# Copyright (c) 2006-2008 The Regents of The University of Michigan
27008Snate@binkert.org# All rights reserved.
37008Snate@binkert.org#
47008Snate@binkert.org# Redistribution and use in source and binary forms, with or without
57008Snate@binkert.org# modification, are permitted provided that the following conditions are
67008Snate@binkert.org# met: redistributions of source code must retain the above copyright
77008Snate@binkert.org# notice, this list of conditions and the following disclaimer;
87008Snate@binkert.org# redistributions in binary form must reproduce the above copyright
97008Snate@binkert.org# notice, this list of conditions and the following disclaimer in the
107008Snate@binkert.org# documentation and/or other materials provided with the distribution;
117008Snate@binkert.org# neither the name of the copyright holders nor the names of its
127008Snate@binkert.org# contributors may be used to endorse or promote products derived from
137008Snate@binkert.org# this software without specific prior written permission.
147008Snate@binkert.org#
157008Snate@binkert.org# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
167008Snate@binkert.org# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
177008Snate@binkert.org# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
187008Snate@binkert.org# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
197008Snate@binkert.org# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
207008Snate@binkert.org# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
217008Snate@binkert.org# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
227008Snate@binkert.org# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
237008Snate@binkert.org# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
247008Snate@binkert.org# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
257008Snate@binkert.org# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
267008Snate@binkert.org#
277008Snate@binkert.org# Authors: Lisa Hsu
286285Snate@binkert.org
297039Snate@binkert.org# system options
307039Snate@binkert.orgparser.add_option("-d", "--detailed", action="store_true")
316285Snate@binkert.orgparser.add_option("-t", "--timing", action="store_true")
327055Snate@binkert.orgparser.add_option("--inorder", action="store_true")
337055Snate@binkert.orgparser.add_option("-n", "--num-cpus", type="int", default=1)
346876Ssteve.reinhardt@amd.comparser.add_option("--caches", action="store_true")
358341Snilay@cs.wisc.eduparser.add_option("--l2cache", action="store_true")
366506Spdudnik@gmail.comparser.add_option("--fastmem", action="store_true")
377055Snate@binkert.org
388436SBrad.Beckmann@amd.com# Run duration options
399497Snilay@cs.wisc.eduparser.add_option("-m", "--maxtick", type="int")
406881SBrad.Beckmann@amd.comparser.add_option("--maxtime", type="float")
418683Snilay@cs.wisc.edu
429364Snilay@cs.wisc.edu# Checkpointing options
439364Snilay@cs.wisc.edu###Note that performing checkpointing via python script files will override
447055Snate@binkert.org###checkpoint instructions built into binaries.
459465Snilay@cs.wisc.eduparser.add_option("--take-checkpoints", action="store", type="string",
466285Snate@binkert.org    help="<M,N> will take checkpoint at cycle M and every N cycles thereafter")
476285Snate@binkert.orgparser.add_option("--max-checkpoints", action="store", type="int",
486285Snate@binkert.org    help="the maximum number of checkpoints to drop", default=5)
496285Snate@binkert.orgparser.add_option("--checkpoint-dir", action="store", type="string",
509465Snilay@cs.wisc.edu    help="Place all checkpoints in this absolute directory")
517039Snate@binkert.orgparser.add_option("-r", "--checkpoint-restore", action="store", type="int",
527039Snate@binkert.org    help="restore from checkpoint <N>")
536876Ssteve.reinhardt@amd.com
548436SBrad.Beckmann@amd.com# CPU Switching - default switch model goes from a checkpoint
559496Snilay@cs.wisc.edu# to a timing simple CPU with caches to warm up, then to detailed CPU for
568257SBrad.Beckmann@amd.com# data measurement
577039Snate@binkert.orgparser.add_option("-s", "--standard-switch", action="store_true",
587039Snate@binkert.org    help="switch from timing CPU to Detailed CPU")
597055Snate@binkert.orgparser.add_option("-w", "--warmup", action="store", type="int",
607055Snate@binkert.org    help="if -s, then this is the warmup period.  else, this is ignored",
617055Snate@binkert.org    default=5000000000)
627039Snate@binkert.org
637039Snate@binkert.org# Fastforwarding and simpoint related materials
647039Snate@binkert.orgparser.add_option("-W", "--warmup-insts", action="store", type="int",
658531Snilay@cs.wisc.edu    default=None,
668531Snilay@cs.wisc.edu    help="Warmup period in total instructions (requires --standard-switch)")
676285Snate@binkert.orgparser.add_option("-I", "--max-inst", action="store", type="int", default=None,
687055Snate@binkert.org    help="Total number of instructions to simulate (default: run forever)")
697055Snate@binkert.orgparser.add_option("--bench", action="store", type="string", default=None,
707039Snate@binkert.org    help="base names for --take-checkpoint and --checkpoint-restore")
717055Snate@binkert.orgparser.add_option("-F", "--fast-forward", action="store", type="string",
727039Snate@binkert.org    default=None,
738683Snilay@cs.wisc.edu    help="Number of instructions to fast forward before switching")
748683Snilay@cs.wisc.eduparser.add_option("-S", "--simpoint", action="store_true", default=False,
759302Snilay@cs.wisc.edu    help="""Use workload simpoints as an instruction offset for
769302Snilay@cs.wisc.edu--checkpoint-restore or --take-checkpoint.""")
779302Snilay@cs.wisc.eduparser.add_option("--at-instruction", action="store_true", default=False,
789302Snilay@cs.wisc.edu    help="""Treate value of --checkpoint-restore or --take-checkpoint as a
799302Snilay@cs.wisc.edunumber of instructions.""")
809302Snilay@cs.wisc.edu