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");
112 req->setContext(index);
118 uint8_t *
data =
new uint8_t[1];
126 DPRINTF(RubyTest,
"successfully initiated prefetch.\n");
133 "prefetch initiation failed because Port was busy.\n");
141 DPRINTF(RubyTest,
"initiating Flush\n");
162 DPRINTF(RubyTest,
"initiating Flush - successful\n");
169 DPRINTF(RubyTest,
"initiating Action\n");
170 assert(
m_status == TesterStatus_Idle);
184 req->setContext(index);
195 uint8_t *writeData =
new uint8_t[1];
199 DPRINTF(RubyTest,
"Seq write: index %d data 0x%x check 0x%x\n", index,
207 DPRINTF(RubyTest,
"initiating action - successful\n");
208 DPRINTF(RubyTest,
"status before action update: %s\n",
209 (TesterStatus_to_string(
m_status)).c_str());
210 m_status = TesterStatus_Action_Pending;
219 DPRINTF(RubyTest,
"failed to initiate action - sequencer not ready\n");
222 DPRINTF(RubyTest,
"status after action update: %s\n",
223 (TesterStatus_to_string(
m_status)).c_str());
229 DPRINTF(RubyTest,
"Initiating Check\n");
230 assert(
m_status == TesterStatus_Ready);
248 req->setContext(index);
253 DPRINTF(RubyTest,
"Seq read: index %d\n", index);
260 DPRINTF(RubyTest,
"initiating check - successful\n");
261 DPRINTF(RubyTest,
"status before check update: %s\n",
262 TesterStatus_to_string(
m_status).c_str());
263 m_status = TesterStatus_Check_Pending;
264 DPRINTF(RubyTest,
"Check %#x, State=Check_Pending\n", m_address);
272 DPRINTF(RubyTest,
"failed to initiate check - cpu port not ready\n");
275 DPRINTF(RubyTest,
"status after check update: %s\n",
276 TesterStatus_to_string(
m_status).c_str());
288 assert(data != NULL);
290 DPRINTF(RubyTest,
"RubyTester Callback\n");
293 if (
m_status == TesterStatus_Action_Pending) {
294 DPRINTF(RubyTest,
"Action callback write value: %d, currently %d\n",
304 DPRINTF(RubyTest,
"Check %#x, State=Idle store_count: %d\n",
307 DPRINTF(RubyTest,
"Action callback return data now %d\n",
309 }
else if (
m_status == TesterStatus_Check_Pending) {
310 DPRINTF(RubyTest,
"Check callback\n");
312 for (
int byte_number=0; byte_number<
CHECK_SIZE; byte_number++) {
313 if (uint8_t(
m_value + byte_number) != data->
getByte(byte_number)) {
314 panic(
"Action/check failure: proc: %d address: %#x data: %s " 315 "byte_number: %d m_value+byte_number: %d byte: %d %s" 317 proc, address, data, byte_number,
319 (
int)data->
getByte(byte_number), *
this, curTime);
322 DPRINTF(RubyTest,
"Action/check success\n");
333 panic(
"Unexpected TesterStatus: %s proc: %d data: %s m_status: %s " 334 "time: %d\n", *
this, proc, data,
m_status, curTime);
337 DPRINTF(RubyTest,
"proc: %d, Address: 0x%x\n", proc,
339 DPRINTF(RubyTest,
"Callback done\n");
356 assert(
m_status == TesterStatus_Idle);
367 DPRINTF(RubyTest,
"Check %#x, State=Idle, picked initiating node %d\n",
377 << (int)
m_value <<
", status: " 378 <<
m_status <<
", initiating node: " 381 <<
"]" << std::flush;
388 "[%#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...
#define panic(...)
This implements a cprintf based panic() function.
RubyTester::SenderState SenderState
Cycles is a wrapper class for representing cycle counts, i.e.
void pickInitiatingNode()
MasterPort * getReadableCpuPort(int idx)
uint8_t getByte(int offset) const
bool isInstOnlyCpuPort(int idx)
std::shared_ptr< Request > RequestPtr
void performCallback(NodeID proc, SubBlock *data, Cycles curTime)
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...
Tick curTick()
The current simulated tick.
bool isInstDataCpuPort(int idx)
The request is a prefetch.
void print(std::ostream &out) const
RubyAccessMode m_access_mode
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
Addr makeLineAddress(Addr addr)
MasterPort * getWritableCpuPort(int idx)
The request was an instruction fetch.
void setByte(int offset, uint8_t data)
SenderState * senderState
This packet's sender state.
Check(Addr address, Addr pc, int _num_writers, int _num_readers, RubyTester *_tester)
void changeAddress(Addr address)
const T * getConstPtr() const
void dataDynamic(T *p)
Set the data pointer to a value that should have delete [] called on it.
Command
List of all commands associated with a packet.
The request should be prefetched into the exclusive state.
void incrementCheckCompletions()
ProbePointArg< PacketInfo > Packet
Packet probe point.