gem5  v21.0.1.0
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 
39  : TesterThread(p)
40 {
41  threadName = "CpuThread(Thread ID " + std::to_string(threadId) + ")";
42  threadEvent.setDesc("CpuThread tick");
43  assert(numLanes == 1);
44 }
45 
46 void
48 {
49  assert(curAction);
51  // we should not have any outstanding fence or atomic op at this point
52  assert(pendingFenceCount == 0);
53  assert(pendingAtomicCount == 0);
54 
55  fatal("CpuThread::issueLoadOps - not yet implemented");
56 }
57 
58 void
60 {
61  assert(curAction);
63  // we should not have any outstanding fence or atomic op at this point
64  assert(pendingFenceCount == 0);
65  assert(pendingAtomicCount == 0);
66 
67  fatal("CpuThread::issueStoreOps - not yet implemented");
68 }
69 
70 void
72 {
73  assert(curAction);
75  // we should not have any outstanding ops at this point
76  assert(pendingFenceCount == 0);
77  assert(pendingLdStCount == 0);
78  assert(pendingAtomicCount == 0);
79 
80  fatal("CpuThread::issueAtomicOps - not yet implemented");
81 }
82 
83 void
85 {
86  DPRINTF(ProtocolTest, "Issuing Acquire Op ...\n");
87 
88  assert(curAction);
90  // we should not have any outstanding ops at this point
91  assert(pendingFenceCount == 0);
92  assert(pendingLdStCount == 0);
93  assert(pendingAtomicCount == 0);
94 
95  // no-op: Acquire does not apply to CPU threads
96 }
97 
98 void
100 {
101  DPRINTF(ProtocolTest, "Issuing Release Op ...\n");
102 
103  assert(curAction);
105  // we should not have any outstanding ops at this point
106  assert(pendingFenceCount == 0);
107  assert(pendingLdStCount == 0);
108  assert(pendingAtomicCount == 0);
109 
110  // no-op: Release does not apply to CPU threads
111 }
112 
113 void
115 {
116  fatal("CpuThread::hitCallback - not yet implemented");
117 }
fatal
#define fatal(...)
This implements a cprintf based fatal() function.
Definition: logging.hh:183
TesterThread::pendingFenceCount
int pendingFenceCount
Definition: tester_thread.hh:161
TesterThread::TesterThreadEvent::setDesc
void setDesc(std::string _description)
Definition: tester_thread.hh:92
TesterThread
Definition: tester_thread.hh:48
sc_dt::to_string
const std::string to_string(sc_enc enc)
Definition: sc_fxdefs.cc:91
TesterThread::numLanes
int numLanes
Definition: tester_thread.hh:137
Episode::Action::Type::LOAD
@ LOAD
CpuThread::issueAtomicOps
void issueAtomicOps()
Definition: cpu_thread.cc:71
TesterThread::pendingAtomicCount
int pendingAtomicCount
Definition: tester_thread.hh:162
Episode::Action::getType
Type getType() const
Definition: episode.hh:63
TesterThread::threadName
std::string threadName
Definition: tester_thread.hh:139
CpuThread::issueStoreOps
void issueStoreOps()
Definition: cpu_thread.cc:59
CpuThread::CpuThread
CpuThread(const Params &p)
Definition: cpu_thread.cc:38
DPRINTF
#define DPRINTF(x,...)
Definition: trace.hh:237
Episode::Action::Type::RELEASE
@ RELEASE
CpuThread::issueLoadOps
void issueLoadOps()
Definition: cpu_thread.cc:47
Episode::Action::Type::ACQUIRE
@ ACQUIRE
CpuThread::issueReleaseOp
void issueReleaseOp()
Definition: cpu_thread.cc:99
cpu_thread.hh
TesterThread::curAction
const Episode::Action * curAction
Definition: tester_thread.hh:157
CpuThread::issueAcquireOp
void issueAcquireOp()
Definition: cpu_thread.cc:84
TesterThread::threadId
int threadId
Definition: tester_thread.hh:135
CpuThread::hitCallback
void hitCallback(PacketPtr pkt)
Definition: cpu_thread.cc:114
Episode::Action::Type::STORE
@ STORE
Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:258
TesterThread::threadEvent
TesterThreadEvent threadEvent
Definition: tester_thread.hh:97
CpuThread::Params
CpuThreadParams Params
Definition: cpu_thread.hh:44
TesterThread::pendingLdStCount
int pendingLdStCount
Definition: tester_thread.hh:160
MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:323
Episode::Action::Type::ATOMIC
@ ATOMIC

Generated on Tue Jun 22 2021 15:28:27 for gem5 by doxygen 1.8.17