stat_control.hh revision 9554
18839Sandreas.hansson@arm.com/*
28839Sandreas.hansson@arm.com * Copyright (c) 2012 ARM Limited
38839Sandreas.hansson@arm.com * All rights reserved
48839Sandreas.hansson@arm.com *
58839Sandreas.hansson@arm.com * The license below extends only to copyright in the software and shall
68839Sandreas.hansson@arm.com * not be construed as granting a license to any other intellectual
78839Sandreas.hansson@arm.com * property including but not limited to intellectual property relating
88839Sandreas.hansson@arm.com * to a hardware implementation of the functionality of the software
98839Sandreas.hansson@arm.com * licensed hereunder.  You may use the software subject to the license
108839Sandreas.hansson@arm.com * terms below provided that you ensure that this notice is replicated
118839Sandreas.hansson@arm.com * unmodified and in its entirety in all distributions of the software,
128839Sandreas.hansson@arm.com * modified or unmodified, in source code or in binary form.
135335Shines@cs.fsu.edu *
147897Shestness@cs.utexas.edu * Copyright (c) 2004-2005 The Regents of The University of Michigan
154486Sbinkertn@umich.edu * All rights reserved.
164486Sbinkertn@umich.edu *
174486Sbinkertn@umich.edu * Redistribution and use in source and binary forms, with or without
184486Sbinkertn@umich.edu * modification, are permitted provided that the following conditions are
194486Sbinkertn@umich.edu * met: redistributions of source code must retain the above copyright
204486Sbinkertn@umich.edu * notice, this list of conditions and the following disclaimer;
214486Sbinkertn@umich.edu * redistributions in binary form must reproduce the above copyright
224486Sbinkertn@umich.edu * notice, this list of conditions and the following disclaimer in the
234486Sbinkertn@umich.edu * documentation and/or other materials provided with the distribution;
244486Sbinkertn@umich.edu * neither the name of the copyright holders nor the names of its
254486Sbinkertn@umich.edu * contributors may be used to endorse or promote products derived from
264486Sbinkertn@umich.edu * this software without specific prior written permission.
274486Sbinkertn@umich.edu *
284486Sbinkertn@umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
294486Sbinkertn@umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
304486Sbinkertn@umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
314486Sbinkertn@umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
324486Sbinkertn@umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
334486Sbinkertn@umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
344486Sbinkertn@umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
354486Sbinkertn@umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
364486Sbinkertn@umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
374486Sbinkertn@umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
384486Sbinkertn@umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
394486Sbinkertn@umich.edu *
404486Sbinkertn@umich.edu * Authors: Nathan Binkert
417897Shestness@cs.utexas.edu *          Sascha Bischoff
428839Sandreas.hansson@arm.com */
434486Sbinkertn@umich.edu
446654Snate@binkert.org#ifndef __SIM_STAT_CONTROL_HH__
456654Snate@binkert.org#define __SIM_STAT_CONTROL_HH__
466654Snate@binkert.org
473102SN/Anamespace Stats {
483102SN/A
496654Snate@binkert.orgdouble statElapsedTime();
509036Sandreas.hansson@arm.com
514776Sgblack@eecs.umich.eduTick statElapsedTicks();
524776Sgblack@eecs.umich.edu
536654Snate@binkert.orgTick statFinalTick();
542667SN/A
554776Sgblack@eecs.umich.eduvoid initSimStats();
564776Sgblack@eecs.umich.edu
576654Snate@binkert.org/**
586023Snate@binkert.org * Update the events after resuming from a checkpoint. When resuming from a
598745Sgblack@eecs.umich.edu * checkpoint, curTick will be updated, and any already scheduled events can
606654Snate@binkert.org * end up scheduled in the past. This function checks if the dumpEvent is
616022Sgblack@eecs.umich.edu * scheduled in the past, and reschedules it appropriately.
628745Sgblack@eecs.umich.edu */
636654Snate@binkert.orgvoid updateEvents();
646022Sgblack@eecs.umich.edu
658745Sgblack@eecs.umich.edu/**
666654Snate@binkert.org * Schedule statistics dumping. This allows you to dump and/or reset the
676022Sgblack@eecs.umich.edu * built-in statistics. This can either be done once, or it can be done on a
688745Sgblack@eecs.umich.edu * regular basis.
696654Snate@binkert.org * @param dump Set true to dump the statistics.
706116Snate@binkert.org * @param reset Set true to reset the statistics.
718745Sgblack@eecs.umich.edu * @param when When the dump and/or reset should occur.
726691Stjones1@inf.ed.ac.uk * @param repeat How often the event should repeat. Set 0 to disable repeating.
736691Stjones1@inf.ed.ac.uk */
748745Sgblack@eecs.umich.eduvoid schedStatEvent(bool dump, bool reset, Tick when = curTick(),
754486Sbinkertn@umich.edu                    Tick repeat = 0);
765529Snate@binkert.org
771366SN/A/**
781310SN/A * Schedule periodic statistics dumping. This allows you to dump and reset the
799338SAndreas.Sandberg@arm.com * built-in statistics on a regular basis, thereby allowing the extraction of
809254SAndreas.Sandberg@arm.com * temporal trends in the data.
819254SAndreas.Sandberg@arm.com * @param period The period at which the dumping should occur.
829254SAndreas.Sandberg@arm.com */
839254SAndreas.Sandberg@arm.comvoid periodicStatDump(Tick period = 0);
849254SAndreas.Sandberg@arm.com} // namespace Stats
859254SAndreas.Sandberg@arm.com
869254SAndreas.Sandberg@arm.com#endif // __SIM_STAT_CONTROL_HH__
879254SAndreas.Sandberg@arm.com