stat_control.hh revision 9450
12914SN/A/*
210713Sandreas.hansson@arm.com * Copyright (c) 2012 ARM Limited
38856SN/A * All rights reserved
48856SN/A *
58856SN/A * The license below extends only to copyright in the software and shall
68856SN/A * not be construed as granting a license to any other intellectual
78856SN/A * property including but not limited to intellectual property relating
88856SN/A * to a hardware implementation of the functionality of the software
98856SN/A * licensed hereunder.  You may use the software subject to the license
108856SN/A * terms below provided that you ensure that this notice is replicated
118856SN/A * unmodified and in its entirety in all distributions of the software,
128856SN/A * modified or unmodified, in source code or in binary form.
138856SN/A *
142914SN/A * Copyright (c) 2004-2005 The Regents of The University of Michigan
152914SN/A * All rights reserved.
162914SN/A *
172914SN/A * Redistribution and use in source and binary forms, with or without
182914SN/A * modification, are permitted provided that the following conditions are
192914SN/A * met: redistributions of source code must retain the above copyright
202914SN/A * notice, this list of conditions and the following disclaimer;
212914SN/A * redistributions in binary form must reproduce the above copyright
222914SN/A * notice, this list of conditions and the following disclaimer in the
232914SN/A * documentation and/or other materials provided with the distribution;
242914SN/A * neither the name of the copyright holders nor the names of its
252914SN/A * contributors may be used to endorse or promote products derived from
262914SN/A * this software without specific prior written permission.
272914SN/A *
282914SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
292914SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
302914SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
312914SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
322914SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
332914SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
342914SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
352914SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
362914SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
372914SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
382914SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
392914SN/A *
402914SN/A * Authors: Nathan Binkert
418856SN/A *          Sascha Bischoff
422914SN/A */
432914SN/A
448914Sandreas.hansson@arm.com#ifndef __SIM_STAT_CONTROL_HH__
458914Sandreas.hansson@arm.com#define __SIM_STAT_CONTROL_HH__
463091SN/A
472914SN/Anamespace Stats {
482914SN/A
498914Sandreas.hansson@arm.comvoid initSimStats();
508914Sandreas.hansson@arm.com
518914Sandreas.hansson@arm.com/**
5210713Sandreas.hansson@arm.com * Update the events after resuming from a checkpoint. When resuming from a
532914SN/A * checkpoint, curTick will be updated, and any already scheduled events can
542914SN/A * end up scheduled in the past. This function checks if the dumpEvent is
558229SN/A * scheduled in the past, and reschedules it appropriately.
568229SN/A */
572914SN/Avoid updateEvents();
589342SAndreas.Sandberg@arm.com
599356Snilay@cs.wisc.edu/**
602914SN/A * Schedule statistics dumping. This allows you to dump and/or reset the
613091SN/A * built-in statistics. This can either be done once, or it can be done on a
628914Sandreas.hansson@arm.com * regular basis.
638914Sandreas.hansson@arm.com * @param dump Set true to dump the statistics.
643091SN/A * @param reset Set true to reset the statistics.
659342SAndreas.Sandberg@arm.com * @param when When the dump and/or reset should occur.
662914SN/A * @param repeat How often the event should repeat. Set 0 to disable repeating.
678914Sandreas.hansson@arm.com */
684490SN/Avoid schedStatEvent(bool dump, bool reset, Tick when = curTick(),
694490SN/A                    Tick repeat = 0);
704490SN/A
714490SN/A/**
724490SN/A * Schedule periodic statistics dumping. This allows you to dump and reset the
7310713Sandreas.hansson@arm.com * built-in statistics on a regular basis, thereby allowing the extraction of
7410713Sandreas.hansson@arm.com * temporal trends in the data.
754490SN/A * @param period The period at which the dumping should occur.
764490SN/A */
774490SN/Avoid periodicStatDump(Tick period = 0);
784490SN/A} // namespace Stats
794490SN/A
8010713Sandreas.hansson@arm.com#endif // __SIM_STAT_CONTROL_HH__
814490SN/A