From e317d8b9ff611f16e116946054ac9a90cb453300 Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Wed, 22 Aug 2012 11:39:56 -0400 Subject: Port: Extend the QueuedPort interface and use where appropriate This patch extends the queued port interfaces with methods for scheduling the transmission of a timing request/response. The methods are named similar to the corresponding sendTiming(Snoop)Req/Resp, replacing the "send" with "sched". As the queues are currently unbounded, the methods always succeed and hence do not return a value. This functionality was previously provided in the subclasses by calling PacketQueue::schedSendTiming with the appropriate parameters. With this change, there is no need to introduce these extra methods in the subclasses, and the use of the queued interface is more uniform and explicit. --- src/mem/ruby/system/RubyPort.cc | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) (limited to 'src/mem/ruby/system/RubyPort.cc') diff --git a/src/mem/ruby/system/RubyPort.cc b/src/mem/ruby/system/RubyPort.cc index c829bf66e..c8580bb5c 100644 --- a/src/mem/ruby/system/RubyPort.cc +++ b/src/mem/ruby/system/RubyPort.cc @@ -196,7 +196,10 @@ RubyPort::M5Port::recvTimingReq(PacketPtr pkt) "Request for address 0x%#x is assumed to be a pio request\n", pkt->getAddr()); - return ruby_port->pio_port.sendNextCycle(pkt); + // send next cycle + ruby_port->pio_port.schedTimingReq(pkt, curTick() + + g_eventQueue_ptr->getClock()); + return true; } assert(Address(pkt->getAddr()).getOffset() + pkt->getSize() <= @@ -647,30 +650,14 @@ RubyPort::M5Port::hitCallback(PacketPtr pkt) // turn packet around to go back to requester if response expected if (needsResponse) { DPRINTF(RubyPort, "Sending packet back over port\n"); - sendNextCycle(pkt); + // send next cycle + schedTimingResp(pkt, curTick() + g_eventQueue_ptr->getClock()); } else { delete pkt; } DPRINTF(RubyPort, "Hit callback done!\n"); } -bool -RubyPort::M5Port::sendNextCycle(PacketPtr pkt, bool send_as_snoop) -{ - //minimum latency, must be > 0 - queue.schedSendTiming(pkt, curTick() + (1 * g_eventQueue_ptr->getClock()), - send_as_snoop); - return true; -} - -bool -RubyPort::PioPort::sendNextCycle(PacketPtr pkt) -{ - //minimum latency, must be > 0 - queue.schedSendTiming(pkt, curTick() + (1 * g_eventQueue_ptr->getClock())); - return true; -} - AddrRangeList RubyPort::M5Port::getAddrRanges() const { -- cgit v1.2.3