Deleted Added
sdiff udiff text old ( 8922:17f037ad8918 ) new ( 8932:1b2c17565ac8 )
full compact
1/*
2 * Copyright (c) 2012 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 39 unchanged lines hidden (view full) ---

48#include "mem/ruby/eventqueue/RubyEventQueue.hh"
49#include "mem/ruby/system/System.hh"
50#include "sim/sim_exit.hh"
51#include "sim/system.hh"
52
53RubyTester::RubyTester(const Params *p)
54 : MemObject(p), checkStartEvent(this),
55 _masterId(p->system->getMasterId(name())),
56 m_checks_to_complete(p->checks_to_complete),
57 m_deadlock_threshold(p->deadlock_threshold),
58 m_wakeup_frequency(p->wakeup_frequency),
59 m_check_flush(p->check_flush)
60{
61 m_checks_completed = 0;
62
63 // create the ports
64 for (int i = 0; i < p->port_cpuPort_connection_count; ++i) {
65 ports.push_back(new CpuPort(csprintf("%s-port%d", name(), i),
66 this, i));
67 }
68
69 // add the check start event to the event queue
70 schedule(checkStartEvent, 1);
71}
72
73RubyTester::~RubyTester()
74{
75 delete m_checkTable_ptr;
76 for (int i = 0; i < ports.size(); i++)
77 delete ports[i];
78}
79
80void
81RubyTester::init()
82{
83 assert(ports.size() > 0);
84
85 m_last_progress_vector.resize(ports.size());
86 for (int i = 0; i < m_last_progress_vector.size(); i++) {
87 m_last_progress_vector[i] = 0;
88 }
89
90 m_num_cpu_sequencers = ports.size();
91
92 m_checkTable_ptr = new CheckTable(m_num_cpu_sequencers, this);
93}
94
95MasterPort &
96RubyTester::getMasterPort(const std::string &if_name, int idx)
97{
98 if (if_name != "cpuPort") {
99 // pass it along to our super class
100 return MemObject::getMasterPort(if_name, idx);
101 } else {
102 if (idx >= static_cast<int>(ports.size())) {
103 panic("RubyTester::getMasterPort: unknown index %d\n", idx);
104 }
105
106 return *ports[idx];
107 }
108}
109
110Tick
111RubyTester::CpuPort::recvAtomic(PacketPtr pkt)
112{
113 panic("RubyTester::CpuPort::recvAtomic() not implemented!\n");
114 return 0;

--- 17 unchanged lines hidden (view full) ---

132 // (includes sublock) and the packet, then return
133 delete senderState;
134 delete pkt->req;
135 delete pkt;
136 return true;
137}
138
139MasterPort*
140RubyTester::getCpuPort(int idx)
141{
142 assert(idx >= 0 && idx < ports.size());
143
144 return ports[idx];
145}
146
147void
148RubyTester::hitCallback(NodeID proc, SubBlock* data)
149{
150 // Mark that we made progress
151 m_last_progress_vector[proc] = g_eventQueue_ptr->getTime();
152
153 DPRINTF(RubyTest, "completed request for proc: %d\n", proc);
154 DPRINTF(RubyTest, "addr: 0x%x, size: %d, data: ",

--- 57 unchanged lines hidden ---