47 #include "debug/RubyTest.hh"
55 m_checkTable_ptr(nullptr),
56 m_num_cpus(p->num_cpus),
57 m_checks_to_complete(p->checks_to_complete),
58 m_deadlock_threshold(p->deadlock_threshold),
61 m_wakeup_frequency(p->wakeup_frequency),
62 m_check_flush(p->check_flush),
63 m_num_inst_only_ports(p->port_cpuInstPort_connection_count),
64 m_num_inst_data_ports(p->port_cpuInstDataPort_connection_count)
80 for (
int i = 0;
i < p->port_cpuInstPort_connection_count; ++
i) {
85 for (
int i = 0;
i < p->port_cpuInstDataPort_connection_count; ++
i) {
92 for (
int i = 0;
i < p->port_cpuDataPort_connection_count; ++
i) {
132 if (if_name !=
"cpuInstPort" && if_name !=
"cpuInstDataPort" &&
133 if_name !=
"cpuDataPort") {
137 if (if_name ==
"cpuInstPort") {
139 panic(
"RubyTester::getMasterPort: unknown inst port %d\n",
146 }
else if (if_name ==
"cpuInstDataPort") {
148 panic(
"RubyTester::getMasterPort: unknown inst+data port %d\n",
157 assert(if_name ==
"cpuDataPort");
161 if (idx > (static_cast<int>(
readPorts.size()) -
163 panic(
"RubyTester::getMasterPort: unknown data port %d\n",
208 assert(idx >= 0 && idx <
readPorts.size());
227 DPRINTF(RubyTest,
"completed request for proc: %d", proc);
228 DPRINTFR(RubyTest,
" addr: 0x%x, size: %d, data: ",
230 for (
int byte = 0; byte < data->
getSize(); byte++) {
238 assert(check_ptr != NULL);
248 assert(check_ptr != NULL);
264 for (
int processor = 0; processor <
size; processor++) {
267 panic(
"Deadlock detected: current_time: %d last_progress_time: %d "
268 "difference: %d processor: %d\n",
278 out <<
"[RubyTester]" << std::endl;
282 RubyTesterParams::create()
A MasterPort is a specialisation of a BaseMasterPort, which implements the default protocol for the t...
Cycles is a wrapper class for representing cycle counts, i.e.
const std::string & name()
int m_num_inst_data_ports
int m_num_inst_only_ports
MasterPort * getReadableCpuPort(int idx)
bool isInstOnlyCpuPort(int idx)
void performCallback(NodeID proc, SubBlock *data, Cycles curTime)
std::vector< Cycles > m_last_progress_vector
CheckStartEvent checkStartEvent
RubyTester(const Params *p)
Cycles curCycle() const
Determine the current cycle, corresponding to a tick aligned to a clock edge.
uint64_t m_checks_completed
Tick curTick()
The current simulated tick.
bool isInstDataCpuPort(int idx)
std::string csprintf(const char *format, const Args &...args)
const RequestPtr req
A pointer to the original request.
virtual BaseMasterPort & getMasterPort(const std::string &if_name, PortID idx=InvalidPortID)
Get a master port with a given name and index.
uint8_t getByte(int offset) const
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
CheckTable * m_checkTable_ptr
MasterPort * getWritableCpuPort(int idx)
std::vector< MasterPort * > writePorts
void print(std::ostream &out) const
void hitCallback(NodeID proc, SubBlock *data)
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 (...
virtual const std::string name() const
SenderState * senderState
This packet's sender state.
The MemObject class extends the ClockedObject with accessor functions to get its master and slave por...
virtual void init()
init() is called after all C++ SimObjects have been created and all ports are connected.
A BaseMasterPort is a protocol-agnostic master port, responsible only for the structural connection t...
virtual bool recvTimingResp(PacketPtr pkt)
Receive a timing response from the slave port.
void schedule(Event &event, Tick when)
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
std::vector< MasterPort * > readPorts
Check * getCheck(Addr address)
uint64_t m_checks_to_complete
virtual BaseMasterPort & getMasterPort(const std::string &if_name, PortID idx=InvalidPortID)
Get a master port with a given name and index.