gem5  v21.2.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
thread_state.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2006 The Regents of The University of Michigan
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are
7  * met: redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer;
9  * redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution;
12  * neither the name of the copyright holders nor the names of its
13  * contributors may be used to endorse or promote products derived from
14  * this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28 
29 #include "cpu/thread_state.hh"
30 
31 #include "base/output.hh"
32 #include "cpu/base.hh"
33 #include "mem/port.hh"
34 #include "mem/port_proxy.hh"
37 #include "sim/full_system.hh"
38 #include "sim/serialize.hh"
39 #include "sim/system.hh"
40 
41 namespace gem5
42 {
43 
44 ThreadState::ThreadState(BaseCPU *cpu, ThreadID _tid, Process *_process)
45  : numInst(0), numOp(0), threadStats(cpu, _tid),
46  numLoad(0), startNumLoad(0),
47  _status(ThreadContext::Halted), baseCpu(cpu),
48  _contextId(0), _threadId(_tid), lastActivate(0), lastSuspend(0),
49  process(_process), storeCondFailures(0)
50 {
51 }
52 
53 void
55 {
57 }
58 
59 void
61 {
63 }
64 
66  const ThreadID& tid)
67  : statistics::Group(cpu, csprintf("thread_%i", tid).c_str()),
68  ADD_STAT(numInsts, statistics::units::Count::get(),
69  "Number of Instructions committed"),
70  ADD_STAT(numOps, statistics::units::Count::get(),
71  "Number of Ops committed"),
72  ADD_STAT(numMemRefs, statistics::units::Count::get(),
73  "Number of Memory References")
74 {
75 }
76 
77 } // namespace gem5
thread_state.hh
gem5::ThreadState::ThreadStateStats::ThreadStateStats
ThreadStateStats(BaseCPU *cpu, const ThreadID &thread)
Definition: thread_state.cc:65
system.hh
serialize.hh
gem5::CheckpointIn
Definition: serialize.hh:68
translating_port_proxy.hh
gem5::ThreadState::unserialize
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Definition: thread_state.cc:60
gem5::ThreadState::serialize
void serialize(CheckpointOut &cp) const override
Serialize an object.
Definition: thread_state.cc:54
gem5::csprintf
std::string csprintf(const char *format, const Args &...args)
Definition: cprintf.hh:161
output.hh
SERIALIZE_ENUM
#define SERIALIZE_ENUM(scalar)
Definition: serialize.hh:591
gem5::ThreadContext
ThreadContext is the external interface to all thread state for anything outside of the CPU.
Definition: thread_context.hh:94
ADD_STAT
#define ADD_STAT(n,...)
Convenience macro to add a stat to a statistics group.
Definition: group.hh:75
port_proxy.hh
port.hh
full_system.hh
gem5::Process
Definition: process.hh:68
base.hh
gem5::ThreadState::_status
ThreadContext::Status _status
Definition: thread_state.hh:112
gem5::statistics::Group
Statistics container.
Definition: group.hh:93
gem5::CheckpointOut
std::ostream CheckpointOut
Definition: serialize.hh:66
UNSERIALIZE_ENUM
#define UNSERIALIZE_ENUM(scalar)
Definition: serialize.hh:598
se_translating_port_proxy.hh
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: tlb.cc:60
gem5::ThreadState::ThreadState
ThreadState(BaseCPU *cpu, ThreadID _tid, Process *_process)
Definition: thread_state.cc:44
gem5::ThreadID
int16_t ThreadID
Thread index/ID type.
Definition: types.hh:242

Generated on Tue Dec 21 2021 11:34:26 for gem5 by doxygen 1.8.17