RubyPort.cc (10910:32f3d1c454ec) RubyPort.cc (10912:b99a6662d7c2)
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

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

395 drainManager->signalDrainDone();
396 // Clear the drain manager once we're done with it.
397 drainManager = NULL;
398 }
399 }
400}
401
402unsigned int
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

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

395 drainManager->signalDrainDone();
396 // Clear the drain manager once we're done with it.
397 drainManager = NULL;
398 }
399 }
400}
401
402unsigned int
403RubyPort::getChildDrainCount(DrainManager *dm)
404{
405 int count = 0;
406
407 if (memMasterPort.isConnected()) {
408 count += memMasterPort.drain(dm);
409 DPRINTF(Config, "count after pio check %d\n", count);
410 }
411
412 for (CpuPortIter p = slave_ports.begin(); p != slave_ports.end(); ++p) {
413 count += (*p)->drain(dm);
414 DPRINTF(Config, "count after slave port check %d\n", count);
415 }
416
417 for (std::vector<PioMasterPort *>::iterator p = master_ports.begin();
418 p != master_ports.end(); ++p) {
419 count += (*p)->drain(dm);
420 DPRINTF(Config, "count after master port check %d\n", count);
421 }
422
423 DPRINTF(Config, "final count %d\n", count);
424 return count;
425}
426
427unsigned int
428RubyPort::drain(DrainManager *dm)
429{
430 if (isDeadlockEventScheduled()) {
431 descheduleDeadlockEvent();
432 }
433
434 //
435 // If the RubyPort is not empty, then it needs to clear all outstanding
436 // requests before it should call drainManager->signalDrainDone()
437 //
438 DPRINTF(Config, "outstanding count %d\n", outstandingCount());
439 bool need_drain = outstandingCount() > 0;
440
403RubyPort::drain(DrainManager *dm)
404{
405 if (isDeadlockEventScheduled()) {
406 descheduleDeadlockEvent();
407 }
408
409 //
410 // If the RubyPort is not empty, then it needs to clear all outstanding
411 // requests before it should call drainManager->signalDrainDone()
412 //
413 DPRINTF(Config, "outstanding count %d\n", outstandingCount());
414 bool need_drain = outstandingCount() > 0;
415
441 //
442 // Also, get the number of child ports that will also need to clear
443 // their buffered requests before they call drainManager->signalDrainDone()
444 //
445 unsigned int child_drain_count = getChildDrainCount(dm);
446
447 // Set status
448 if (need_drain) {
449 drainManager = dm;
450
451 DPRINTF(Drain, "RubyPort not drained\n");
452 setDrainState(DrainState::Draining);
416 // Set status
417 if (need_drain) {
418 drainManager = dm;
419
420 DPRINTF(Drain, "RubyPort not drained\n");
421 setDrainState(DrainState::Draining);
453 return child_drain_count + 1;
422 return 1;
454 }
455
456 drainManager = NULL;
457 setDrainState(DrainState::Drained);
423 }
424
425 drainManager = NULL;
426 setDrainState(DrainState::Drained);
458 return child_drain_count;
427 return 0;
459}
460
461void
462RubyPort::MemSlavePort::hitCallback(PacketPtr pkt)
463{
464 bool needsResponse = pkt->needsResponse();
465
466 // Unless specified at configuraiton, all responses except failed SC

--- 104 unchanged lines hidden ---
428}
429
430void
431RubyPort::MemSlavePort::hitCallback(PacketPtr pkt)
432{
433 bool needsResponse = pkt->needsResponse();
434
435 // Unless specified at configuraiton, all responses except failed SC

--- 104 unchanged lines hidden ---