core.hh revision 7823:dac01f14f20f
12221SN/A/* 22221SN/A * Copyright (c) 2006 The Regents of The University of Michigan 32221SN/A * All rights reserved. 42221SN/A * 52221SN/A * Redistribution and use in source and binary forms, with or without 62221SN/A * modification, are permitted provided that the following conditions are 72221SN/A * met: redistributions of source code must retain the above copyright 82221SN/A * notice, this list of conditions and the following disclaimer; 92221SN/A * redistributions in binary form must reproduce the above copyright 102221SN/A * notice, this list of conditions and the following disclaimer in the 112221SN/A * documentation and/or other materials provided with the distribution; 122221SN/A * neither the name of the copyright holders nor the names of its 132221SN/A * contributors may be used to endorse or promote products derived from 142221SN/A * this software without specific prior written permission. 152221SN/A * 162221SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 172221SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 182221SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 192221SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 202221SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 212221SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 222221SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 232221SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 242221SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 252221SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 262221SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 272665Ssaidi@eecs.umich.edu * 282665Ssaidi@eecs.umich.edu * Authors: Nathan Binkert 292665Ssaidi@eecs.umich.edu * Steve Reinhardt 302221SN/A */ 312221SN/A 323890Ssaidi@eecs.umich.edu#ifndef __SIM_CORE_HH__ 333890Ssaidi@eecs.umich.edu#define __SIM_CORE_HH__ 342221SN/A 357678Sgblack@eecs.umich.edu#include <string> 362221SN/A 372221SN/A#include "base/types.hh" 382221SN/A 392221SN/A/// The universal simulation clock. 402223SN/Aextern Tick _curTick; 412221SN/A 422221SN/Ainline Tick curTick() { return _curTick; } 433415Sgblack@eecs.umich.eduinline void curTick(Tick newVal) { _curTick = newVal; } 443415Sgblack@eecs.umich.edu 452221SN/Aconst Tick retryTime = 1000; 464997Sgblack@eecs.umich.edu 474997Sgblack@eecs.umich.edunamespace SimClock { 483573Sgblack@eecs.umich.edu/// The simulated frequency of curTick(). 492221SN/Aextern Tick Frequency; 502221SN/A 513576Sgblack@eecs.umich.edunamespace Float { 523576Sgblack@eecs.umich.eduextern double s; 533576Sgblack@eecs.umich.eduextern double ms; 543576Sgblack@eecs.umich.eduextern double us; 553576Sgblack@eecs.umich.eduextern double ns; 563576Sgblack@eecs.umich.eduextern double ps; 573576Sgblack@eecs.umich.edu 583576Sgblack@eecs.umich.eduextern double Hz; 593576Sgblack@eecs.umich.eduextern double kHz; 603573Sgblack@eecs.umich.eduextern double MHz; 613573Sgblack@eecs.umich.eduextern double GHZ; 623573Sgblack@eecs.umich.edu} // namespace Float 633573Sgblack@eecs.umich.edu 643573Sgblack@eecs.umich.edunamespace Int { 653576Sgblack@eecs.umich.eduextern Tick s; 663573Sgblack@eecs.umich.eduextern Tick ms; 673573Sgblack@eecs.umich.eduextern Tick us; 6810417Sandreas.hansson@arm.comextern Tick ns; 6910417Sandreas.hansson@arm.comextern Tick ps; 702223SN/A} // namespace Int 712223SN/A} // namespace SimClock 722223SN/A 733576Sgblack@eecs.umich.eduvoid setClockFrequency(Tick ticksPerSecond); 742221SN/A 752221SN/Avoid setOutputDir(const std::string &dir); 763573Sgblack@eecs.umich.edu 773573Sgblack@eecs.umich.edustruct Callback; 782221SN/Avoid registerExitCallback(Callback *callback); 793573Sgblack@eecs.umich.eduvoid doExitCleanup(); 803573Sgblack@eecs.umich.edu 812221SN/A#endif /* __SIM_CORE_HH__ */ 827741Sgblack@eecs.umich.edu