34 #include "debug/RubyTest.hh"
44 : m_num_writers(_num_writers), m_num_readers(_num_readers),
61 DPRINTF(RubyTest,
"initiating\n");
73 if (
m_status == ruby::TesterStatus_Idle) {
75 }
else if (
m_status == ruby::TesterStatus_Ready) {
80 "initiating action/check - failed: action/check is pending\n");
87 DPRINTF(RubyTest,
"initiating prefetch\n");
116 req->setContext(
index);
122 uint8_t *
data =
new uint8_t[1];
130 DPRINTF(RubyTest,
"successfully initiated prefetch.\n");
137 "prefetch initiation failed because Port was busy.\n");
145 DPRINTF(RubyTest,
"initiating Flush\n");
167 DPRINTF(RubyTest,
"initiating Flush - successful\n");
174 DPRINTF(RubyTest,
"initiating Action\n");
175 assert(
m_status == ruby::TesterStatus_Idle);
190 req->setContext(
index);
201 uint8_t *writeData =
new uint8_t[1];
205 DPRINTF(RubyTest,
"Seq write: index %d data 0x%x check 0x%x\n",
index,
213 DPRINTF(RubyTest,
"initiating action - successful\n");
214 DPRINTF(RubyTest,
"status before action update: %s\n",
215 (ruby::TesterStatus_to_string(
m_status)).c_str());
216 m_status = ruby::TesterStatus_Action_Pending;
225 DPRINTF(RubyTest,
"failed to initiate action - sequencer not ready\n");
228 DPRINTF(RubyTest,
"status after action update: %s\n",
229 (ruby::TesterStatus_to_string(
m_status)).c_str());
235 DPRINTF(RubyTest,
"Initiating Check\n");
236 assert(
m_status == ruby::TesterStatus_Ready);
255 req->setContext(
index);
267 DPRINTF(RubyTest,
"initiating check - successful\n");
268 DPRINTF(RubyTest,
"status before check update: %s\n",
269 ruby::TesterStatus_to_string(
m_status).c_str());
270 m_status = ruby::TesterStatus_Check_Pending;
279 DPRINTF(RubyTest,
"failed to initiate check - cpu port not ready\n");
282 DPRINTF(RubyTest,
"status after check update: %s\n",
283 ruby::TesterStatus_to_string(
m_status).c_str());
295 assert(
data != NULL);
297 DPRINTF(RubyTest,
"RubyTester Callback\n");
300 if (
m_status == ruby::TesterStatus_Action_Pending) {
301 DPRINTF(RubyTest,
"Action callback write value: %d, currently %d\n",
307 m_status = ruby::TesterStatus_Ready;
311 DPRINTF(RubyTest,
"Check %#x, State=Idle store_count: %d\n",
314 DPRINTF(RubyTest,
"Action callback return data now %d\n",
316 }
else if (
m_status == ruby::TesterStatus_Check_Pending) {
317 DPRINTF(RubyTest,
"Check callback\n");
319 for (
int byte_number=0; byte_number<
CHECK_SIZE; byte_number++) {
320 if (uint8_t(
m_value + byte_number) !=
data->getByte(byte_number)) {
321 panic(
"Action/check failure: proc: %d address: %#x data: %s "
322 "byte_number: %d m_value+byte_number: %d byte: %d %s"
324 proc, address,
data, byte_number,
326 (
int)
data->getByte(byte_number), *
this, curTime);
329 DPRINTF(RubyTest,
"Action/check success\n");
340 panic(
"Unexpected TesterStatus: %s proc: %d data: %s m_status: %s "
344 DPRINTF(RubyTest,
"proc: %d, Address: 0x%x\n", proc,
346 DPRINTF(RubyTest,
"Callback done\n");
353 assert(
m_status == ruby::TesterStatus_Idle ||
354 m_status == ruby::TesterStatus_Ready);
364 assert(
m_status == ruby::TesterStatus_Idle);
372 assert(
m_status == ruby::TesterStatus_Idle ||
373 m_status == ruby::TesterStatus_Ready);
376 DPRINTF(RubyTest,
"Check %#x, State=Idle, picked initiating node %d\n",
386 << (int)
m_value <<
", status: "
387 <<
m_status <<
", initiating node: "
390 <<
"]" << std::flush;
397 "[%#x, value: %d, status: %s, initiating node: %d, store_count: %d]\n",
399 ruby::TesterStatus_to_string(
m_status).c_str(),