Go to the documentation of this file.
45 #include "debug/ProtocolTest.hh"
55 _requestorId(
p.
system->getRequestorId(this)),
56 numCpuPorts(
p.port_cpu_ports_connection_count),
57 numDmaPorts(
p.port_dma_ports_connection_count),
58 numVectorPorts(
p.port_cu_vector_ports_connection_count),
59 numSqcPorts(
p.port_cu_sqc_ports_connection_count),
60 numScalarPorts(
p.port_cu_scalar_ports_connection_count),
61 numTokenPorts(
p.port_cu_token_ports_connection_count),
62 numCusPerSqc(
p.cus_per_sqc),
63 numCusPerScalar(
p.cus_per_scalar),
64 numWfsPerCu(
p.wavefronts_per_cu),
65 numWisPerWf(
p.workitems_per_wavefront),
66 numCuTokens(
p.max_cu_tokens),
67 numAtomicLocs(
p.num_atomic_locations),
68 numNormalLocsPerAtomic(
p.num_normal_locs_per_atomic),
69 episodeLength(
p.episode_length),
70 maxNumEpisodes(
p.max_num_episodes),
71 debugTester(
p.debug_tester),
72 cpuThreads(
p.cpu_threads),
73 dmaThreads(
p.dma_threads),
84 DPRINTF(ProtocolTest,
"Creating %s\n",
93 DPRINTF(ProtocolTest,
"Creating %s\n",
102 DPRINTF(ProtocolTest,
"Creating %s\n",
111 DPRINTF(ProtocolTest,
"Creating %s\n",
120 DPRINTF(ProtocolTest,
"Creating %s\n",
142 warn(
"Data race check is not enabled\n");
147 if (
p.random_seed != 0) {
148 srand(
p.random_seed);
160 std::stringstream
ss;
161 ss <<
"GPU Ruby test's configurations" << std::endl
162 <<
"\tNumber of CPUs: " <<
numCpus << std::endl
163 <<
"\tNumber of DMAs: " <<
numDmas << std::endl
164 <<
"\tNumber of CUs: " <<
numCus << std::endl
165 <<
"\tNumber of wavefronts per CU: " <<
numWfsPerCu << std::endl
166 <<
"\tWavefront size: " <<
numWisPerWf << std::endl
167 <<
"\tNumber of atomic locations: " <<
numAtomicLocs << std::endl
168 <<
"\tNumber of non-atomic locations: "
173 <<
"\tRandom seed: " <<
p.random_seed
201 DPRINTF(ProtocolTest,
"Attach threads to ports\n");
204 for (
int cpu_id = 0; cpu_id <
numCpus; ++cpu_id) {
205 cpuThreads[cpu_id]->attachTesterThreadToPorts(
this,
208 cpuThreads[cpu_id]->scheduleDeadlockCheckEvent();
212 for (
int dma_id = 0; dma_id <
numDmas; ++dma_id) {
213 dmaThreads[dma_id]->attachTesterThreadToPorts(
this,
216 dmaThreads[dma_id]->scheduleDeadlockCheckEvent();
221 int vectorPortId = 0;
223 int scalarPortId = 0;
225 for (
int cu_id = 0; cu_id <
numCus; ++cu_id) {
226 vectorPortId = cu_id;
232 wfs[wfId]->attachTesterThreadToPorts(
this,
237 wfs[wfId]->scheduleWakeup();
238 wfs[wfId]->scheduleDeadlockCheckEvent();
246 if (if_name !=
"cpu_ports" && if_name !=
"dma_ports" &&
247 if_name !=
"cu_vector_ports" && if_name !=
"cu_sqc_ports" &&
248 if_name !=
"cu_scalar_ports" && if_name !=
"cu_token_ports") {
252 if (if_name ==
"cpu_ports") {
254 panic(
"ProtocolTester: unknown cpu port %d\n", idx);
256 }
else if (if_name ==
"dma_ports") {
258 panic(
"ProtocolTester: unknown dma port %d\n", idx);
260 }
else if (if_name ==
"cu_vector_ports") {
262 panic(
"ProtocolTester: unknown cu vect port %d\n", idx);
264 }
else if (if_name ==
"cu_sqc_ports") {
266 panic(
"ProtocolTester: unknown cu sqc port %d\n", idx);
268 }
else if (if_name ==
"cu_token_ports") {
270 panic(
"ProtocolTester: unknown cu token port %d\n", idx);
273 assert(if_name ==
"cu_scalar_ports");
275 panic(
"ProtocolTester: unknown cu scal port %d\n", idx);
305 if (!th->checkDRF(atomic_loc, loc, isStore))
310 if (!th->checkDRF(atomic_loc, loc, isStore))
315 if (!th->checkDRF(atomic_loc, loc, isStore))
329 t->printAllOutstandingReqs(
ss);
333 t->printAllOutstandingReqs(
ss);
337 t->printAllOutstandingReqs(
ss);
347 panic(
"GPU Ruby Tester: Failed!\n");
356 safe_cast<ProtocolTester::SenderState*>(pkt->
senderState);
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
virtual Port & getPort(const std::string &if_name, PortID idx=InvalidPortID)
Get a port with a given name and index.
std::vector< DmaThread * > dmaThreads
ProtocolTester(const Params &p)
virtual void hitCallback(PacketPtr pkt)=0
std::vector< GMTokenPort * > cuTokenPorts
std::vector< TokenManager * > cuTokenManagers
std::vector< RequestPort * > dmaPorts
std::vector< RequestPort * > cpuPorts
std::vector< RequestPort * > cuSqcPorts
OutputStream * create(const std::string &name, bool binary=false, bool no_gz=false)
Creates a file in this directory (optionally compressed).
std::string csprintf(const char *format, const Args &...args)
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
void ccprintf(cp::Print &print)
void exitSimLoop(const std::string &message, int exit_code, Tick when, Tick repeat, bool serialize)
Schedule an event to exit the simulation loop (returning to Python) at the end of the current cycle (...
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
std::ostream * stream() const
Get the output underlying output stream.
void close(OutputStream *file)
Closes an output file and free the corresponding OutputFile.
std::vector< CpuThread * > cpuThreads
virtual std::string name() const
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
std::vector< RequestPort * > cuScalarPorts
void dumpErrorLog(std::stringstream &ss)
bool checkDRF(Location atomic_loc, Location loc, bool isStore) const
SenderState * senderState
This packet's sender state.
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
int numNormalLocsPerAtomic
ProtocolTesterParams Params
Ports are used to interface objects to each other.
virtual bool recvTimingResp(PacketPtr pkt)
Receive a timing response from the peer.
AddressManager::Location Location
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
AddressManager * addrManager
std::vector< RequestPort * > cuVectorPorts
#define panic(...)
This implements a cprintf based panic() function.
std::vector< GpuWavefront * > wfs
Generated on Tue Sep 21 2021 12:25:09 for gem5 by doxygen 1.8.17