Go to the documentation of this file.
43 #include "debug/ProtocolTest.hh"
53 _requestorId(
p.
system->getRequestorId(this)),
54 numCpuPorts(
p.port_cpu_ports_connection_count),
55 numDmaPorts(
p.port_dma_ports_connection_count),
56 numVectorPorts(
p.port_cu_vector_ports_connection_count),
57 numSqcPorts(
p.port_cu_sqc_ports_connection_count),
58 numScalarPorts(
p.port_cu_scalar_ports_connection_count),
59 numTokenPorts(
p.port_cu_token_ports_connection_count),
60 numCusPerSqc(
p.cus_per_sqc),
61 numCusPerScalar(
p.cus_per_scalar),
62 numWfsPerCu(
p.wavefronts_per_cu),
63 numWisPerWf(
p.workitems_per_wavefront),
64 numCuTokens(
p.max_cu_tokens),
65 numAtomicLocs(
p.num_atomic_locations),
66 numNormalLocsPerAtomic(
p.num_normal_locs_per_atomic),
67 episodeLength(
p.episode_length),
68 maxNumEpisodes(
p.max_num_episodes),
69 debugTester(
p.debug_tester),
70 cpuThreads(
p.cpu_threads),
71 dmaThreads(
p.dma_threads),
82 DPRINTF(ProtocolTest,
"Creating %s\n",
91 DPRINTF(ProtocolTest,
"Creating %s\n",
100 DPRINTF(ProtocolTest,
"Creating %s\n",
109 DPRINTF(ProtocolTest,
"Creating %s\n",
118 DPRINTF(ProtocolTest,
"Creating %s\n",
140 warn(
"Data race check is not enabled\n");
145 if (
p.random_seed != 0) {
146 srand(
p.random_seed);
158 std::stringstream
ss;
159 ss <<
"GPU Ruby test's configurations" << std::endl
160 <<
"\tNumber of CPUs: " <<
numCpus << std::endl
161 <<
"\tNumber of DMAs: " <<
numDmas << std::endl
162 <<
"\tNumber of CUs: " <<
numCus << std::endl
163 <<
"\tNumber of wavefronts per CU: " <<
numWfsPerCu << std::endl
164 <<
"\tWavefront size: " <<
numWisPerWf << std::endl
165 <<
"\tNumber of atomic locations: " <<
numAtomicLocs << std::endl
166 <<
"\tNumber of non-atomic locations: "
171 <<
"\tRandom seed: " <<
p.random_seed
199 DPRINTF(ProtocolTest,
"Attach threads to ports\n");
202 for (
int cpu_id = 0; cpu_id <
numCpus; ++cpu_id) {
203 cpuThreads[cpu_id]->attachTesterThreadToPorts(
this,
206 cpuThreads[cpu_id]->scheduleDeadlockCheckEvent();
210 for (
int dma_id = 0; dma_id <
numDmas; ++dma_id) {
211 dmaThreads[dma_id]->attachTesterThreadToPorts(
this,
214 dmaThreads[dma_id]->scheduleDeadlockCheckEvent();
219 int vectorPortId = 0;
221 int scalarPortId = 0;
223 for (
int cu_id = 0; cu_id <
numCus; ++cu_id) {
224 vectorPortId = cu_id;
230 wfs[wfId]->attachTesterThreadToPorts(
this,
235 wfs[wfId]->scheduleWakeup();
236 wfs[wfId]->scheduleDeadlockCheckEvent();
244 if (if_name !=
"cpu_ports" && if_name !=
"dma_ports" &&
245 if_name !=
"cu_vector_ports" && if_name !=
"cu_sqc_ports" &&
246 if_name !=
"cu_scalar_ports" && if_name !=
"cu_token_ports") {
250 if (if_name ==
"cpu_ports") {
252 panic(
"ProtocolTester: unknown cpu port %d\n", idx);
254 }
else if (if_name ==
"dma_ports") {
256 panic(
"ProtocolTester: unknown dma port %d\n", idx);
258 }
else if (if_name ==
"cu_vector_ports") {
260 panic(
"ProtocolTester: unknown cu vect port %d\n", idx);
262 }
else if (if_name ==
"cu_sqc_ports") {
264 panic(
"ProtocolTester: unknown cu sqc port %d\n", idx);
266 }
else if (if_name ==
"cu_token_ports") {
268 panic(
"ProtocolTester: unknown cu token port %d\n", idx);
271 assert(if_name ==
"cu_scalar_ports");
273 panic(
"ProtocolTester: unknown cu scal port %d\n", idx);
303 if (!th->checkDRF(atomic_loc, loc, isStore))
308 if (!th->checkDRF(atomic_loc, loc, isStore))
313 if (!th->checkDRF(atomic_loc, loc, isStore))
327 t->printAllOutstandingReqs(
ss);
331 t->printAllOutstandingReqs(
ss);
335 t->printAllOutstandingReqs(
ss);
345 panic(
"GPU Ruby Tester: Failed!\n");
354 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 Sun Jul 30 2023 01:56:53 for gem5 by doxygen 1.8.17