gem5  v22.1.0.0
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 
44 namespace gem5
45 {
46 
49 GEM5_DEPRECATED_NAMESPACE(SimClock, sim_clock);
50 namespace sim_clock
51 {
52 extern Tick Frequency;
53 
54 GEM5_DEPRECATED_NAMESPACE(Float, as_float);
55 namespace as_float
56 {
57 
62 extern double s;
63 extern double ms;
64 extern double us;
65 extern double ns;
66 extern double ps;
72 extern double Hz;
73 extern double kHz;
74 extern double MHz;
75 extern double GHz;
77 } // namespace as_float
78 
84 GEM5_DEPRECATED_NAMESPACE(Int, as_int);
85 namespace as_int
86 {
87 extern Tick s;
88 extern Tick ms;
89 extern Tick us;
90 extern Tick ns;
91 extern Tick ps;
93 } // namespace as_int
94 } // namespace sim_clock
97 void fixClockFrequency();
98 bool clockFrequencyFixed();
99 
100 void setClockFrequency(Tick ticksPerSecond);
101 Tick getClockFrequency(); // Ticks per second.
102 
103 void setOutputDir(const std::string &dir);
104 
105 void registerExitCallback(const std::function<void()> &callback);
106 void doExitCleanup();
107 
108 } // namespace gem5
109 
110 #endif /* __SIM_CORE_HH__ */
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
double ps
picosecond
Definition: core.cc:57
double us
microsecond
Definition: core.cc:55
double ms
millisecond
Definition: core.cc:54
double ns
nanosecond
Definition: core.cc:56
double Hz
These variables the inverse of above.
Definition: core.cc:59
double s
These variables equal the number of ticks in the unit of time they're named after in a double.
Definition: core.cc:53
Tick s
second
Definition: core.cc:68
Tick ns
nanosecond
Definition: core.cc:71
Tick ps
picosecond
Definition: core.cc:72
Tick ms
millisecond
Definition: core.cc:69
Tick us
microsecond
Definition: core.cc:70
Tick Frequency
The simulated frequency of curTick(). (In ticks per second)
Definition: core.cc:48
GEM5_DEPRECATED_NAMESPACE(Float, as_float)
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Tick getClockFrequency()
Definition: core.cc:124
bool clockFrequencyFixed()
Definition: core.cc:115
void fixClockFrequency()
Definition: core.cc:87
uint64_t Tick
Tick count type.
Definition: types.hh:58
void setOutputDir(const std::string &dir)
Definition: core.cc:127
void setClockFrequency(Tick tps)
Definition: core.cc:118
void doExitCleanup()
Do C++ simulator exit processing.
Definition: core.cc:156
void registerExitCallback(const std::function< void()> &callback)
Register an exit callback.
Definition: core.cc:146
GEM5_DEPRECATED_NAMESPACE(GuestABI, guest_abi)

Generated on Wed Dec 21 2022 10:22:39 for gem5 by doxygen 1.9.1