stat_control.hh revision 11793
12SN/A/* 21762SN/A * Copyright (c) 2012 ARM Limited 32SN/A * All rights reserved 42SN/A * 52SN/A * The license below extends only to copyright in the software and shall 62SN/A * not be construed as granting a license to any other intellectual 72SN/A * property including but not limited to intellectual property relating 82SN/A * to a hardware implementation of the functionality of the software 92SN/A * licensed hereunder. You may use the software subject to the license 102SN/A * terms below provided that you ensure that this notice is replicated 112SN/A * unmodified and in its entirety in all distributions of the software, 122SN/A * modified or unmodified, in source code or in binary form. 132SN/A * 142SN/A * Copyright (c) 2004-2005 The Regents of The University of Michigan 152SN/A * All rights reserved. 162SN/A * 172SN/A * Redistribution and use in source and binary forms, with or without 182SN/A * modification, are permitted provided that the following conditions are 192SN/A * met: redistributions of source code must retain the above copyright 202SN/A * notice, this list of conditions and the following disclaimer; 212SN/A * redistributions in binary form must reproduce the above copyright 222SN/A * notice, this list of conditions and the following disclaimer in the 232SN/A * documentation and/or other materials provided with the distribution; 242SN/A * neither the name of the copyright holders nor the names of its 252SN/A * contributors may be used to endorse or promote products derived from 262SN/A * this software without specific prior written permission. 272665Ssaidi@eecs.umich.edu * 282665Ssaidi@eecs.umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 292SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 302SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 316216Snate@binkert.org * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 322439SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 336216Snate@binkert.org * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 34146SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 35146SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 36146SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 37146SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 38146SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39146SN/A * 401717SN/A * Authors: Nathan Binkert 41146SN/A * Sascha Bischoff 426216Snate@binkert.org */ 436658Snate@binkert.org 441717SN/A#ifndef __SIM_STAT_CONTROL_HH__ 45146SN/A#define __SIM_STAT_CONTROL_HH__ 461977SN/A 472623SN/A#include "base/types.hh" 482683Sktlim@umich.edu#include "sim/core.hh" 491717SN/A 50146SN/Anamespace Stats { 512683Sktlim@umich.edu 523348Sbinkertn@umich.edudouble statElapsedTime(); 536105Ssteve.reinhardt@amd.com 546216Snate@binkert.orgTick statElapsedTicks(); 552036SN/A 56146SN/ATick statFinalTick(); 5756SN/A 5856SN/Avoid initSimStats(); 59695SN/A 602901Ssaidi@eecs.umich.edu/** 612SN/A * Update the events after resuming from a checkpoint. When resuming from a 621858SN/A * checkpoint, curTick will be updated, and any already scheduled events can 633565Sgblack@eecs.umich.edu * end up scheduled in the past. This function checks if the dumpEvent is 643565Sgblack@eecs.umich.edu * scheduled in the past, and reschedules it appropriately. 652171SN/A */ 662170SN/Avoid updateEvents(); 673562Sgblack@eecs.umich.edu 68146SN/A/** 692462SN/A * Schedule statistics dumping. This allows you to dump and/or reset the 70146SN/A * built-in statistics. This can either be done once, or it can be done on a 712SN/A * regular basis. 722SN/A * @param dump Set true to dump the statistics. 732449SN/A * @param reset Set true to reset the statistics. 741355SN/A * @param when When the dump and/or reset should occur. 755529Snate@binkert.org * @param repeat How often the event should repeat. Set 0 to disable repeating. 764495Sacolyte@umich.edu */ 77224SN/Avoid schedStatEvent(bool dump, bool reset, Tick when = curTick(), 781858SN/A Tick repeat = 0); 792683Sktlim@umich.edu 802420SN/A/** 815529Snate@binkert.org * Schedule periodic statistics dumping. This allows you to dump and reset the 826331Sgblack@eecs.umich.edu * built-in statistics on a regular basis, thereby allowing the extraction of 832420SN/A * temporal trends in the data. 842SN/A * @param period The period at which the dumping should occur. 856029Ssteve.reinhardt@amd.com */ 862672Sktlim@umich.eduvoid periodicStatDump(Tick period = 0); 872683Sktlim@umich.edu} // namespace Stats 882SN/A 892SN/A#endif // __SIM_STAT_CONTROL_HH__ 90334SN/A