34#include "debug/ProtocolTest.hh"
43 ", CU ID = " + std::to_string(
cuId) +
")";
61 for (
int lane = 0; lane <
numLanes; ++lane) {
68 DPRINTF(ProtocolTest,
"%s Episode %d: Issuing Load - Addr %s\n",
72 int load_size =
sizeof(
Value);
75 assert(address % load_size == 0);
77 auto req = std::make_shared<Request>(address, load_size,
80 req->setPaddr(address);
81 req->setReqInstSeqNum(
tester->getActionSeqNum());
86 uint8_t*
data =
new uint8_t[load_size];
93 if (!
port->sendTimingReq(pkt)) {
94 panic(
"Not expected failed sendTimingReq\n");
112 for (
int lane = 0; lane <
numLanes; ++lane) {
123 assert(address %
sizeof(
Value) == 0);
125 DPRINTF(ProtocolTest,
"%s Episode %d: Issuing Store - Addr %s - "
130 auto req = std::make_shared<Request>(address,
sizeof(
Value),
131 0,
tester->requestorId(), 0,
133 req->setPaddr(address);
134 req->setReqInstSeqNum(
tester->getActionSeqNum());
139 uint8_t *writeData =
new uint8_t[
sizeof(
Value)];
140 for (
int j = 0; j <
sizeof(
Value); ++j) {
141 writeData[j] = ((uint8_t*)&new_value)[j];
149 if (!
port->sendTimingReq(pkt)) {
150 panic(
"Not expecting a failed sendTimingReq\n");
173 for (
int lane = 0; lane <
numLanes; ++lane) {
175 assert(location >= 0);
179 DPRINTF(ProtocolTest,
"%s Episode %d: Issuing Atomic_Inc - Addr %s\n",
184 assert(address %
sizeof(
Value) == 0);
186 auto req = std::make_shared<Request>(address,
sizeof(
Value),
187 flags,
tester->requestorId(),
190 req->setPaddr(address);
191 req->setReqInstSeqNum(
tester->getActionSeqNum());
196 uint8_t*
data =
new uint8_t[
sizeof(
Value)];
200 if (!
port->sendTimingReq(pkt)) {
201 panic(
"Not expecting failed sendTimingReq\n");
215 DPRINTF(ProtocolTest,
"%s Episode %d: Issuing Acquire\n", this->
getName(),
225 auto acq_req = std::make_shared<Request>(0, 0, 0,
228 acq_req->setPaddr(0);
229 acq_req->setReqInstSeqNum(
tester->getActionSeqNum());
240 if (!
port->sendTimingReq(pkt)) {
241 panic(
"Not expecting failed sendTimingReq\n");
248 DPRINTF(ProtocolTest,
"%s Episode %d: Issuing Release\n", this->
getName(),
268 DPRINTF(ProtocolTest,
"%s Episode %d: hitCallback - Command %s - "
274 bool isTransactionDone =
true;
319 isTransactionDone =
false;
349 panic(
"Unsupported MemCmd response type");
352 if (isTransactionDone) {
static const int INVALID_LOCATION
static const int INVALID_VALUE
Cycles curCycle() const
Determine the current cycle, corresponding to a tick aligned to a clock edge.
virtual void issueReleaseOp()
GpuWavefrontParams Params
AddressManager::Value Value
virtual void issueAcquireOp()
virtual void hitCallback(PacketPtr pkt)
AddressManager::Location Location
virtual void setExtraRequestFlags(RequestPtr req)
GpuWavefront(const Params &p)
const std::string & toString() const
Return the string to a cmd given by idx.
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
SenderState * senderState
This packet's sender state.
T * getPtr()
get a pointer to the data ptr.
void dataDynamic(T *p)
Set the data pointer to a value that should have delete [] called on it.
MemCmd cmd
The command field of the packet.
@ ATOMIC_RETURN_OP
The request is an atomic that returns data.
gem5::Flags< FlagsType > Flags
TesterThread(const Params &p)
AddressManager * addrManager
OutstandingReqTable outstandingAtomics
void validateAtomicResp(Location loc, int lane, Value ret_val)
ProtocolTester::SeqPort * port
OutstandingReqTable outstandingStores
void addOutstandingReqs(OutstandingReqTable &req_table, Addr addr, int lane, Location loc, Value stored_val=AddressManager::INVALID_VALUE)
OutstandingReqTable outstandingLoads
OutstandingReq popOutstandingReq(OutstandingReqTable &req_table, Addr address)
const Episode::Action * curAction
TesterThreadEvent threadEvent
const std::string & getName() const
std::string printAddress(Addr addr) const
void validateLoadResp(Location loc, int lane, Value ret_val)
std::unique_ptr< AtomicOpFunctor > AtomicOpFunctorPtr
#define panic(...)
This implements a cprintf based panic() function.
Copyright (c) 2024 Arm Limited All rights reserved.
std::shared_ptr< Request > RequestPtr
Tick curTick()
The universal simulation clock.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.