Deleted Added
sdiff udiff text old ( 9208:2451e60d4555 ) new ( 9245:e215ee9db617 )
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

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

522 testDrainComplete();
523}
524
525void
526RubyPort::testDrainComplete()
527{
528 //If we weren't able to drain before, we might be able to now.
529 if (drainEvent != NULL) {
530 unsigned int drainCount = getDrainCount(drainEvent);
531 DPRINTF(Drain, "Drain count: %u\n", drainCount);
532 if (drainCount == 0) {
533 DPRINTF(Drain, "RubyPort done draining, processing drain event\n");
534 drainEvent->process();
535 // Clear the drain event once we're done with it.
536 drainEvent = NULL;
537 }
538 }
539}
540
541unsigned int
542RubyPort::getDrainCount(Event *de)
543{
544 int count = 0;
545 //
546 // If the sequencer is not empty, then requests need to drain.
547 // The outstandingCount is the number of requests outstanding and thus the
548 // number of times M5's timing port will process the drain event.
549 //
550 count += outstandingCount();
551
552 DPRINTF(Config, "outstanding count %d\n", outstandingCount());
553
554 // To simplify the draining process, the sequencer's deadlock detection
555 // event should have been descheduled.
556 assert(isDeadlockEventScheduled() == false);
557
558 if (pio_port.isConnected()) {
559 count += pio_port.drain(de);
560 DPRINTF(Config, "count after pio check %d\n", count);
561 }
562
563 for (CpuPortIter p = slave_ports.begin(); p != slave_ports.end(); ++p) {
564 count += (*p)->drain(de);
565 DPRINTF(Config, "count after slave port check %d\n", count);

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

578
579unsigned int
580RubyPort::drain(Event *de)
581{
582 if (isDeadlockEventScheduled()) {
583 descheduleDeadlockEvent();
584 }
585
586 int count = getDrainCount(de);
587
588 // Set status
589 if (count != 0) {
590 drainEvent = de;
591
592 DPRINTF(Drain, "RubyPort not drained\n");
593 changeState(SimObject::Draining);
594 return count;
595 }
596
597 changeState(SimObject::Drained);
598 return 0;
599}
600
601void
602RubyPort::M5Port::hitCallback(PacketPtr pkt)
603{
604 bool needsResponse = pkt->needsResponse();
605
606 //

--- 89 unchanged lines hidden ---