gem5  v21.1.0.1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
cpu_thread.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017-2021 Advanced Micro Devices, Inc.
3  * All rights reserved.
4  *
5  * For use for simulation and test purposes only
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions are met:
9  *
10  * 1. Redistributions of source code must retain the above copyright notice,
11  * this list of conditions and the following disclaimer.
12  *
13  * 2. Redistributions in binary form must reproduce the above copyright notice,
14  * this list of conditions and the following disclaimer in the documentation
15  * and/or other materials provided with the distribution.
16  *
17  * 3. Neither the name of the copyright holder nor the names of its
18  * contributors may be used to endorse or promote products derived from this
19  * software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
25  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31  * POSSIBILITY OF SUCH DAMAGE.
32  */
33 
35 
36 #include "debug/ProtocolTest.hh"
37 
38 namespace gem5
39 {
40 
42  : TesterThread(p)
43 {
44  threadName = "CpuThread(Thread ID " + std::to_string(threadId) + ")";
45  threadEvent.setDesc("CpuThread tick");
46  assert(numLanes == 1);
47 }
48 
49 void
51 {
52  assert(curAction);
54  // we should not have any outstanding fence or atomic op at this point
55  assert(pendingFenceCount == 0);
56  assert(pendingAtomicCount == 0);
57 
58  fatal("CpuThread::issueLoadOps - not yet implemented");
59 }
60 
61 void
63 {
64  assert(curAction);
66  // we should not have any outstanding fence or atomic op at this point
67  assert(pendingFenceCount == 0);
68  assert(pendingAtomicCount == 0);
69 
70  fatal("CpuThread::issueStoreOps - not yet implemented");
71 }
72 
73 void
75 {
76  assert(curAction);
78  // we should not have any outstanding ops at this point
79  assert(pendingFenceCount == 0);
80  assert(pendingLdStCount == 0);
81  assert(pendingAtomicCount == 0);
82 
83  fatal("CpuThread::issueAtomicOps - not yet implemented");
84 }
85 
86 void
88 {
89  DPRINTF(ProtocolTest, "Issuing Acquire Op ...\n");
90 
91  assert(curAction);
93  // we should not have any outstanding ops at this point
94  assert(pendingFenceCount == 0);
95  assert(pendingLdStCount == 0);
96  assert(pendingAtomicCount == 0);
97 
98  // no-op: Acquire does not apply to CPU threads
99 }
100 
101 void
103 {
104  DPRINTF(ProtocolTest, "Issuing Release Op ...\n");
105 
106  assert(curAction);
108  // we should not have any outstanding ops at this point
109  assert(pendingFenceCount == 0);
110  assert(pendingLdStCount == 0);
111  assert(pendingAtomicCount == 0);
112 
113  // no-op: Release does not apply to CPU threads
114 }
115 
116 void
118 {
119  fatal("CpuThread::hitCallback - not yet implemented");
120 }
121 
122 } // namespace gem5
fatal
#define fatal(...)
This implements a cprintf based fatal() function.
Definition: logging.hh:189
gem5::TesterThread::TesterThreadEvent::setDesc
void setDesc(std::string _description)
Definition: tester_thread.hh:95
gem5::CpuThread::issueLoadOps
void issueLoadOps()
Definition: cpu_thread.cc:50
gem5::Episode::Action::Type::STORE
@ STORE
gem5::TesterThread::curAction
const Episode::Action * curAction
Definition: tester_thread.hh:160
gem5::Episode::Action::getType
Type getType() const
Definition: episode.hh:68
gem5::TesterThread::pendingAtomicCount
int pendingAtomicCount
Definition: tester_thread.hh:165
sc_dt::to_string
const std::string to_string(sc_enc enc)
Definition: sc_fxdefs.cc:91
gem5::TesterThread::pendingFenceCount
int pendingFenceCount
Definition: tester_thread.hh:164
gem5::TesterThread::threadEvent
TesterThreadEvent threadEvent
Definition: tester_thread.hh:100
gem5::TesterThread
Definition: tester_thread.hh:51
gem5::CpuThread::hitCallback
void hitCallback(PacketPtr pkt)
Definition: cpu_thread.cc:117
gem5::TesterThread::pendingLdStCount
int pendingLdStCount
Definition: tester_thread.hh:163
gem5::CpuThread::issueReleaseOp
void issueReleaseOp()
Definition: cpu_thread.cc:102
gem5::CpuThread::CpuThread
CpuThread(const Params &p)
Definition: cpu_thread.cc:41
DPRINTF
#define DPRINTF(x,...)
Definition: trace.hh:186
gem5::Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:283
gem5::TesterThread::threadId
int threadId
Definition: tester_thread.hh:138
gem5::TesterThread::numLanes
int numLanes
Definition: tester_thread.hh:140
gem5::MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:326
gem5::Episode::Action::Type::ATOMIC
@ ATOMIC
gem5::Episode::Action::Type::RELEASE
@ RELEASE
cpu_thread.hh
gem5::CpuThread::issueAtomicOps
void issueAtomicOps()
Definition: cpu_thread.cc:74
gem5::CpuThread::Params
CpuThreadParams Params
Definition: cpu_thread.hh:47
gem5::CpuThread::issueStoreOps
void issueStoreOps()
Definition: cpu_thread.cc:62
gem5::Episode::Action::Type::ACQUIRE
@ ACQUIRE
gem5::CpuThread::issueAcquireOp
void issueAcquireOp()
Definition: cpu_thread.cc:87
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: decoder.cc:40
gem5::TesterThread::threadName
std::string threadName
Definition: tester_thread.hh:142
gem5::Episode::Action::Type::LOAD
@ LOAD

Generated on Tue Sep 7 2021 14:53:45 for gem5 by doxygen 1.8.17