gem5 v24.0.0.0
Loading...
Searching...
No Matches
core.hh
Go to the documentation of this file.
1/*
2 * Copyright (c) 2006 The Regents of The University of Michigan
3 * Copyright (c) 2013 Advanced Micro Devices, Inc.
4 * Copyright (c) 2013 Mark D. Hill and David A. Wood
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are
9 * met: redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer;
11 * redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution;
14 * neither the name of the copyright holders nor the names of its
15 * contributors may be used to endorse or promote products derived from
16 * this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31#ifndef __SIM_CORE_HH__
32#define __SIM_CORE_HH__
33
38#include <functional>
39#include <string>
40
41#include "base/compiler.hh"
42#include "base/types.hh"
43
44namespace gem5
45{
46
49namespace sim_clock
50{
51extern Tick Frequency;
52
53namespace as_float
54{
55
60extern double s;
61extern double ms;
62extern double us;
63extern double ns;
64extern double ps;
70extern double Hz;
71extern double kHz;
72extern double MHz;
73extern double GHz;
75} // namespace as_float
76
82namespace as_int
83{
84extern Tick s;
85extern Tick ms;
86extern Tick us;
87extern Tick ns;
88extern Tick ps;
90} // namespace as_int
91} // namespace sim_clock
96
97void setClockFrequency(Tick ticksPerSecond);
98Tick getClockFrequency(); // Ticks per second.
99
100void setOutputDir(const std::string &dir);
101
102void registerExitCallback(const std::function<void()> &callback);
103void doExitCleanup();
104
105} // namespace gem5
106
107#endif /* __SIM_CORE_HH__ */
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
double ps
picosecond
Definition core.cc:55
double us
microsecond
Definition core.cc:53
double ms
millisecond
Definition core.cc:52
double ns
nanosecond
Definition core.cc:54
double Hz
These variables the inverse of above.
Definition core.cc:57
double s
These variables equal the number of ticks in the unit of time they're named after in a double.
Definition core.cc:51
Tick ns
nanosecond
Definition core.cc:68
Tick ps
picosecond
Definition core.cc:69
Tick ms
millisecond
Definition core.cc:66
Tick us
microsecond
Definition core.cc:67
Tick Frequency
The simulated frequency of curTick(). (In ticks per second)
Definition core.cc:47
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
Tick getClockFrequency()
Definition core.cc:121
bool clockFrequencyFixed()
Definition core.cc:112
void fixClockFrequency()
Definition core.cc:84
uint64_t Tick
Tick count type.
Definition types.hh:58
void setOutputDir(const std::string &dir)
Definition core.cc:124
void setClockFrequency(Tick tps)
Definition core.cc:115
void doExitCleanup()
Do C++ simulator exit processing.
Definition core.cc:153
void registerExitCallback(const std::function< void()> &callback)
Register an exit callback.
Definition core.cc:143

Generated on Tue Jun 18 2024 16:24:06 for gem5 by doxygen 1.11.0