core.hh revision 7823
14123Sbinkertn@umich.edu/*
24123Sbinkertn@umich.edu * Copyright (c) 2006 The Regents of The University of Michigan
34123Sbinkertn@umich.edu * All rights reserved.
44123Sbinkertn@umich.edu *
54123Sbinkertn@umich.edu * Redistribution and use in source and binary forms, with or without
64123Sbinkertn@umich.edu * modification, are permitted provided that the following conditions are
74123Sbinkertn@umich.edu * met: redistributions of source code must retain the above copyright
84123Sbinkertn@umich.edu * notice, this list of conditions and the following disclaimer;
94123Sbinkertn@umich.edu * redistributions in binary form must reproduce the above copyright
104123Sbinkertn@umich.edu * notice, this list of conditions and the following disclaimer in the
114123Sbinkertn@umich.edu * documentation and/or other materials provided with the distribution;
124123Sbinkertn@umich.edu * neither the name of the copyright holders nor the names of its
134123Sbinkertn@umich.edu * contributors may be used to endorse or promote products derived from
144123Sbinkertn@umich.edu * this software without specific prior written permission.
154123Sbinkertn@umich.edu *
164123Sbinkertn@umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
174123Sbinkertn@umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
184123Sbinkertn@umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
194123Sbinkertn@umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
204123Sbinkertn@umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
214123Sbinkertn@umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
224123Sbinkertn@umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
234123Sbinkertn@umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
244123Sbinkertn@umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
254123Sbinkertn@umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
264123Sbinkertn@umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
274123Sbinkertn@umich.edu *
284123Sbinkertn@umich.edu * Authors: Nathan Binkert
294123Sbinkertn@umich.edu *          Steve Reinhardt
304123Sbinkertn@umich.edu */
314123Sbinkertn@umich.edu
324167Sbinkertn@umich.edu#ifndef __SIM_CORE_HH__
334167Sbinkertn@umich.edu#define __SIM_CORE_HH__
344167Sbinkertn@umich.edu
354123Sbinkertn@umich.edu#include <string>
364123Sbinkertn@umich.edu
376214Snate@binkert.org#include "base/types.hh"
384123Sbinkertn@umich.edu
394167Sbinkertn@umich.edu/// The universal simulation clock.
407823Ssteve.reinhardt@amd.comextern Tick _curTick;
417823Ssteve.reinhardt@amd.com
427823Ssteve.reinhardt@amd.cominline Tick curTick() { return _curTick; }
437823Ssteve.reinhardt@amd.cominline void curTick(Tick newVal) { _curTick = newVal; }
447823Ssteve.reinhardt@amd.com
454167Sbinkertn@umich.educonst Tick retryTime = 1000;
464167Sbinkertn@umich.edu
477064Snate@binkert.orgnamespace SimClock {
487823Ssteve.reinhardt@amd.com/// The simulated frequency of curTick().
494167Sbinkertn@umich.eduextern Tick Frequency;
504167Sbinkertn@umich.edu
514167Sbinkertn@umich.edunamespace Float {
524167Sbinkertn@umich.eduextern double s;
534167Sbinkertn@umich.eduextern double ms;
544167Sbinkertn@umich.eduextern double us;
554167Sbinkertn@umich.eduextern double ns;
564167Sbinkertn@umich.eduextern double ps;
574167Sbinkertn@umich.edu
584167Sbinkertn@umich.eduextern double Hz;
594167Sbinkertn@umich.eduextern double kHz;
604167Sbinkertn@umich.eduextern double MHz;
614167Sbinkertn@umich.eduextern double GHZ;
627811Ssteve.reinhardt@amd.com} // namespace Float
634167Sbinkertn@umich.edu
644167Sbinkertn@umich.edunamespace Int {
654167Sbinkertn@umich.eduextern Tick s;
664167Sbinkertn@umich.eduextern Tick ms;
674167Sbinkertn@umich.eduextern Tick us;
684167Sbinkertn@umich.eduextern Tick ns;
694167Sbinkertn@umich.eduextern Tick ps;
707811Ssteve.reinhardt@amd.com} // namespace Int
717811Ssteve.reinhardt@amd.com} // namespace SimClock
724167Sbinkertn@umich.edu
734167Sbinkertn@umich.eduvoid setClockFrequency(Tick ticksPerSecond);
744167Sbinkertn@umich.edu
754123Sbinkertn@umich.eduvoid setOutputDir(const std::string &dir);
764123Sbinkertn@umich.edu
774167Sbinkertn@umich.edustruct Callback;
784123Sbinkertn@umich.eduvoid registerExitCallback(Callback *callback);
794123Sbinkertn@umich.eduvoid doExitCleanup();
804167Sbinkertn@umich.edu
814167Sbinkertn@umich.edu#endif /* __SIM_CORE_HH__ */
82