34 #include "debug/RubyTest.hh"
41 : m_num_writers(_num_writers), m_num_readers(_num_readers),
51 RubyAccessMode_NUM - 1));
58 DPRINTF(RubyTest,
"initiating\n");
72 }
else if (
m_status == TesterStatus_Ready) {
77 "initiating action/check - failed: action/check is pending\n");
84 DPRINTF(RubyTest,
"initiating prefetch\n");
118 uint8_t *
data =
new uint8_t[1];
126 DPRINTF(RubyTest,
"successfully initiated prefetch.\n");
134 "prefetch initiation failed because Port was busy.\n");
142 DPRINTF(RubyTest,
"initiating Flush\n");
163 DPRINTF(RubyTest,
"initiating Flush - successful\n");
170 DPRINTF(RubyTest,
"initiating Action\n");
171 assert(
m_status == TesterStatus_Idle);
196 uint8_t *writeData =
new uint8_t[1];
200 DPRINTF(RubyTest,
"Seq write: index %d data 0x%x check 0x%x\n", index,
208 DPRINTF(RubyTest,
"initiating action - successful\n");
209 DPRINTF(RubyTest,
"status before action update: %s\n",
210 (TesterStatus_to_string(
m_status)).c_str());
211 m_status = TesterStatus_Action_Pending;
221 DPRINTF(RubyTest,
"failed to initiate action - sequencer not ready\n");
224 DPRINTF(RubyTest,
"status after action update: %s\n",
225 (TesterStatus_to_string(
m_status)).c_str());
231 DPRINTF(RubyTest,
"Initiating Check\n");
232 assert(
m_status == TesterStatus_Ready);
255 DPRINTF(RubyTest,
"Seq read: index %d\n", index);
262 DPRINTF(RubyTest,
"initiating check - successful\n");
263 DPRINTF(RubyTest,
"status before check update: %s\n",
264 TesterStatus_to_string(
m_status).c_str());
265 m_status = TesterStatus_Check_Pending;
275 DPRINTF(RubyTest,
"failed to initiate check - cpu port not ready\n");
278 DPRINTF(RubyTest,
"status after check update: %s\n",
279 TesterStatus_to_string(
m_status).c_str());
291 assert(data != NULL);
293 DPRINTF(RubyTest,
"RubyTester Callback\n");
296 if (
m_status == TesterStatus_Action_Pending) {
297 DPRINTF(RubyTest,
"Action callback write value: %d, currently %d\n",
307 DPRINTF(RubyTest,
"Check %s, State=Idle store_count: %d\n",
310 DPRINTF(RubyTest,
"Action callback return data now %d\n",
312 }
else if (
m_status == TesterStatus_Check_Pending) {
313 DPRINTF(RubyTest,
"Check callback\n");
315 for (
int byte_number=0; byte_number<
CHECK_SIZE; byte_number++) {
316 if (uint8_t(
m_value + byte_number) != data->
getByte(byte_number)) {
317 panic(
"Action/check failure: proc: %d address: %s data: %s "
318 "byte_number: %d m_value+byte_number: %d byte: %d %s"
320 proc, address, data, byte_number,
322 (
int)data->
getByte(byte_number), *
this, curTime);
325 DPRINTF(RubyTest,
"Action/check success\n");
336 panic(
"Unexpected TesterStatus: %s proc: %d data: %s m_status: %s "
337 "time: %d\n", *
this, proc, data,
m_status, curTime);
340 DPRINTF(RubyTest,
"proc: %d, Address: 0x%x\n", proc,
342 DPRINTF(RubyTest,
"Callback done\n");
359 assert(
m_status == TesterStatus_Idle);
370 DPRINTF(RubyTest,
"Check %s, State=Idle, picked initiating node %d\n",
380 << (int)
m_value <<
", status: "
381 <<
m_status <<
", initiating node: "
384 <<
"]" << std::flush;
391 "[%#x, value: %d, status: %s, initiating node: %d, store_count: %d]\n",
A MasterPort is a specialisation of a BaseMasterPort, which implements the default protocol for the t...
RubyTester::SenderState SenderState
Cycles is a wrapper class for representing cycle counts, i.e.
void print(std::ostream &out) const
void pickInitiatingNode()
MasterPort * getReadableCpuPort(int idx)
bool isInstOnlyCpuPort(int idx)
void performCallback(NodeID proc, SubBlock *data, Cycles curTime)
void setContext(ContextID context_id)
Set up Context numbers.
bool sendTimingReq(PacketPtr pkt)
Attempt to send a timing request to the slave port by calling its corresponding receive function...
RubyTester * m_tester_ptr
std::enable_if< std::is_integral< T >::value, T >::type random()
Use the SFINAE idiom to choose an implementation based on whether the type is integral or floating po...
The request should be prefetched into the exclusive state.
Tick curTick()
The current simulated tick.
bool isInstDataCpuPort(int idx)
const RequestPtr req
A pointer to the original request.
RubyAccessMode m_access_mode
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
uint8_t getByte(int offset) const
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
Addr makeLineAddress(Addr addr)
MasterPort * getWritableCpuPort(int idx)
void setByte(int offset, uint8_t data)
SenderState * senderState
This packet's sender state.
The request was an instruction fetch.
Check(Addr address, Addr pc, int _num_writers, int _num_readers, RubyTester *_tester)
void changeAddress(Addr address)
void dataDynamic(T *p)
Set the data pointer to a value that should have delete [] called on it.
const T * getConstPtr() const
Command
List of all commands associated with a packet.
The request is a prefetch.
void incrementCheckCompletions()
ProbePointArg< PacketInfo > Packet
Packet probe point.