stat_control.hh revision 9262
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
47729SN/Anamespace Stats {
48695SN/A
494078Sbinkertn@umich.eduvoid initSimStats();
509262Ssascha.bischoff@arm.com
519262Ssascha.bischoff@arm.com/**
529262Ssascha.bischoff@arm.com * Update the events after resuming from a checkpoint. When resuming from a
539262Ssascha.bischoff@arm.com * checkpoint, curTick will be updated, and any already scheduled events can
549262Ssascha.bischoff@arm.com * end up scheduled in the past. This function checks if the dumpEvent is
559262Ssascha.bischoff@arm.com * scheduled in the past, and reschedules it appropriately.
569262Ssascha.bischoff@arm.com */
579262Ssascha.bischoff@arm.comvoid updateEvents();
589262Ssascha.bischoff@arm.com
599262Ssascha.bischoff@arm.com/**
609262Ssascha.bischoff@arm.com * Schedule statistics dumping. This allows you to dump and/or reset the
619262Ssascha.bischoff@arm.com * built-in statistics. This can either be done once, or it can be done on a
629262Ssascha.bischoff@arm.com * regular basis.
639262Ssascha.bischoff@arm.com * @param dump Set true to dump the statistics.
649262Ssascha.bischoff@arm.com * @param reset Set true to reset the statistics.
659262Ssascha.bischoff@arm.com * @param when When the dump and/or reset should occur.
669262Ssascha.bischoff@arm.com * @param repeat How often the event should repeat. Set 0 to disable repeating.
679262Ssascha.bischoff@arm.com */
687823Ssteve.reinhardt@amd.comvoid schedStatEvent(bool dump, bool reset, Tick when = curTick(),
697822Ssteve.reinhardt@amd.com                    Tick repeat = 0);
70695SN/A
719262Ssascha.bischoff@arm.com/**
729262Ssascha.bischoff@arm.com * Schedule periodic statistics dumping. This allows you to dump and reset the
739262Ssascha.bischoff@arm.com * built-in statistics on a regular basis, thereby allowing the extraction of
749262Ssascha.bischoff@arm.com * temporal trends in the data.
759262Ssascha.bischoff@arm.com * @param period The period at which the dumping should occur.
769262Ssascha.bischoff@arm.com */
779262Ssascha.bischoff@arm.comvoid periodicStatDump(uint64_t period = 0);
787811Ssteve.reinhardt@amd.com} // namespace Stats
79695SN/A
80695SN/A#endif // __SIM_STAT_CONTROL_HH__
81