RubyPort.cc (12357:86b87f330638) RubyPort.cc (12395:322bb93e5f06)
1/*
2 * Copyright (c) 2012-2013 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

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

221 assert(success);
222 return true;
223 }
224 }
225 }
226 panic("Should never reach here!\n");
227}
228
1/*
2 * Copyright (c) 2012-2013 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

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

221 assert(success);
222 return true;
223 }
224 }
225 }
226 panic("Should never reach here!\n");
227}
228
229Tick
230RubyPort::PioSlavePort::recvAtomic(PacketPtr pkt)
231{
232 RubyPort *ruby_port = static_cast<RubyPort *>(&owner);
233 // Only atomic_noncaching mode supported!
234 if (!ruby_port->system->bypassCaches()) {
235 panic("Ruby supports atomic accesses only in noncaching mode\n");
236 }
237
238 for (size_t i = 0; i < ruby_port->master_ports.size(); ++i) {
239 AddrRangeList l = ruby_port->master_ports[i]->getAddrRanges();
240 for (auto it = l.begin(); it != l.end(); ++it) {
241 if (it->contains(pkt->getAddr())) {
242 return ruby_port->master_ports[i]->sendAtomic(pkt);
243 }
244 }
245 }
246 panic("Could not find address in Ruby PIO address ranges!\n");
247}
248
229bool
230RubyPort::MemSlavePort::recvTimingReq(PacketPtr pkt)
231{
232 DPRINTF(RubyPort, "Timing request for address %#x on port %d\n",
233 pkt->getAddr(), id);
234 RubyPort *ruby_port = static_cast<RubyPort *>(&owner);
235
236 if (pkt->cacheResponding())

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

290 pkt->getAddr(), RequestStatus_to_string(requestStatus));
291 }
292
293 addToRetryList();
294
295 return false;
296}
297
249bool
250RubyPort::MemSlavePort::recvTimingReq(PacketPtr pkt)
251{
252 DPRINTF(RubyPort, "Timing request for address %#x on port %d\n",
253 pkt->getAddr(), id);
254 RubyPort *ruby_port = static_cast<RubyPort *>(&owner);
255
256 if (pkt->cacheResponding())

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

310 pkt->getAddr(), RequestStatus_to_string(requestStatus));
311 }
312
313 addToRetryList();
314
315 return false;
316}
317
318Tick
319RubyPort::MemSlavePort::recvAtomic(PacketPtr pkt)
320{
321 RubyPort *ruby_port = static_cast<RubyPort *>(&owner);
322 // Only atomic_noncaching mode supported!
323 if (!ruby_port->system->bypassCaches()) {
324 panic("Ruby supports atomic accesses only in noncaching mode\n");
325 }
326
327 // Check for pio requests and directly send them to the dedicated
328 // pio port.
329 if (pkt->cmd != MemCmd::MemFenceReq) {
330 if (!isPhysMemAddress(pkt->getAddr())) {
331 assert(ruby_port->memMasterPort.isConnected());
332 DPRINTF(RubyPort, "Request address %#x assumed to be a "
333 "pio address\n", pkt->getAddr());
334
335 // Save the port in the sender state object to be used later to
336 // route the response
337 pkt->pushSenderState(new SenderState(this));
338
339 // send next cycle
340 Tick req_ticks = ruby_port->memMasterPort.sendAtomic(pkt);
341 return ruby_port->ticksToCycles(req_ticks);
342 }
343
344 assert(getOffset(pkt->getAddr()) + pkt->getSize() <=
345 RubySystem::getBlockSizeBytes());
346 }
347
348 // Find appropriate directory for address
349 // This assumes that protocols have a Directory machine,
350 // which has its memPort hooked up to memory. This can
351 // fail for some custom protocols.
352 MachineID id = ruby_port->m_controller->mapAddressToMachine(
353 pkt->getAddr(), MachineType_Directory);
354 RubySystem *rs = ruby_port->m_ruby_system;
355 AbstractController *directory =
356 rs->m_abstract_controls[id.getType()][id.getNum()];
357 return directory->recvAtomic(pkt);
358}
359
298void
299RubyPort::MemSlavePort::addToRetryList()
300{
301 RubyPort *ruby_port = static_cast<RubyPort *>(&owner);
302
303 //
304 // Unless the requestor do not want retries (e.g., the Ruby tester),
305 // record the stalled M5 port for later retry when the sequencer

--- 265 unchanged lines hidden ---
360void
361RubyPort::MemSlavePort::addToRetryList()
362{
363 RubyPort *ruby_port = static_cast<RubyPort *>(&owner);
364
365 //
366 // Unless the requestor do not want retries (e.g., the Ruby tester),
367 // record the stalled M5 port for later retry when the sequencer

--- 265 unchanged lines hidden ---