1695SN/A/*
29262Ssascha.bischoff@arm.com * Copyright (c) 2012 ARM Limited
39262Ssascha.bischoff@arm.com * All rights reserved
49262Ssascha.bischoff@arm.com *
59262Ssascha.bischoff@arm.com * The license below extends only to copyright in the software and shall
69262Ssascha.bischoff@arm.com * not be construed as granting a license to any other intellectual
79262Ssascha.bischoff@arm.com * property including but not limited to intellectual property relating
89262Ssascha.bischoff@arm.com * to a hardware implementation of the functionality of the software
99262Ssascha.bischoff@arm.com * licensed hereunder.  You may use the software subject to the license
109262Ssascha.bischoff@arm.com * terms below provided that you ensure that this notice is replicated
119262Ssascha.bischoff@arm.com * unmodified and in its entirety in all distributions of the software,
129262Ssascha.bischoff@arm.com * modified or unmodified, in source code or in binary form.
139262Ssascha.bischoff@arm.com *
141762SN/A * Copyright (c) 2004-2005 The Regents of The University of Michigan
15695SN/A * All rights reserved.
16695SN/A *
17695SN/A * Redistribution and use in source and binary forms, with or without
18695SN/A * modification, are permitted provided that the following conditions are
19695SN/A * met: redistributions of source code must retain the above copyright
20695SN/A * notice, this list of conditions and the following disclaimer;
21695SN/A * redistributions in binary form must reproduce the above copyright
22695SN/A * notice, this list of conditions and the following disclaimer in the
23695SN/A * documentation and/or other materials provided with the distribution;
24695SN/A * neither the name of the copyright holders nor the names of its
25695SN/A * contributors may be used to endorse or promote products derived from
26695SN/A * this software without specific prior written permission.
27695SN/A *
28695SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29695SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30695SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31695SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32695SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33695SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34695SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35695SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36695SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37695SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38695SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
392665Ssaidi@eecs.umich.edu *
402665Ssaidi@eecs.umich.edu * Authors: Nathan Binkert
419262Ssascha.bischoff@arm.com *          Sascha Bischoff
42695SN/A */
43695SN/A
44695SN/A#ifndef __SIM_STAT_CONTROL_HH__
45695SN/A#define __SIM_STAT_CONTROL_HH__
46695SN/A
4711793Sbrandon.potter@amd.com#include "base/types.hh"
4811793Sbrandon.potter@amd.com#include "sim/core.hh"
4911793Sbrandon.potter@amd.com
50729SN/Anamespace Stats {
51695SN/A
529554Sandreas.hansson@arm.comdouble statElapsedTime();
539554Sandreas.hansson@arm.com
549554Sandreas.hansson@arm.comTick statElapsedTicks();
559554Sandreas.hansson@arm.com
569554Sandreas.hansson@arm.comTick statFinalTick();
579554Sandreas.hansson@arm.com
584078Sbinkertn@umich.eduvoid initSimStats();
599262Ssascha.bischoff@arm.com
609262Ssascha.bischoff@arm.com/**
619262Ssascha.bischoff@arm.com * Update the events after resuming from a checkpoint. When resuming from a
629262Ssascha.bischoff@arm.com * checkpoint, curTick will be updated, and any already scheduled events can
639262Ssascha.bischoff@arm.com * end up scheduled in the past. This function checks if the dumpEvent is
649262Ssascha.bischoff@arm.com * scheduled in the past, and reschedules it appropriately.
659262Ssascha.bischoff@arm.com */
669262Ssascha.bischoff@arm.comvoid updateEvents();
679262Ssascha.bischoff@arm.com
689262Ssascha.bischoff@arm.com/**
699262Ssascha.bischoff@arm.com * Schedule statistics dumping. This allows you to dump and/or reset the
709262Ssascha.bischoff@arm.com * built-in statistics. This can either be done once, or it can be done on a
719262Ssascha.bischoff@arm.com * regular basis.
729262Ssascha.bischoff@arm.com * @param dump Set true to dump the statistics.
739262Ssascha.bischoff@arm.com * @param reset Set true to reset the statistics.
749262Ssascha.bischoff@arm.com * @param when When the dump and/or reset should occur.
759262Ssascha.bischoff@arm.com * @param repeat How often the event should repeat. Set 0 to disable repeating.
769262Ssascha.bischoff@arm.com */
777823Ssteve.reinhardt@amd.comvoid schedStatEvent(bool dump, bool reset, Tick when = curTick(),
787822Ssteve.reinhardt@amd.com                    Tick repeat = 0);
79695SN/A
809262Ssascha.bischoff@arm.com/**
819262Ssascha.bischoff@arm.com * Schedule periodic statistics dumping. This allows you to dump and reset the
829262Ssascha.bischoff@arm.com * built-in statistics on a regular basis, thereby allowing the extraction of
839262Ssascha.bischoff@arm.com * temporal trends in the data.
849262Ssascha.bischoff@arm.com * @param period The period at which the dumping should occur.
859262Ssascha.bischoff@arm.com */
869450Ssascha.bischoff@arm.comvoid periodicStatDump(Tick period = 0);
877811Ssteve.reinhardt@amd.com} // namespace Stats
88695SN/A
89695SN/A#endif // __SIM_STAT_CONTROL_HH__
90