packet_queue.hh (8975:7f36d4436074) | packet_queue.hh (9342:6fec8f26e56d) |
---|---|
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 --- 43 unchanged lines hidden (view full) --- 52 * for the flow control of the port, but relies on the module 53 * notifying the queue when a transfer ends. 54 */ 55 56#include <list> 57 58#include "mem/port.hh" 59#include "sim/eventq.hh" | 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 --- 43 unchanged lines hidden (view full) --- 52 * for the flow control of the port, but relies on the module 53 * notifying the queue when a transfer ends. 54 */ 55 56#include <list> 57 58#include "mem/port.hh" 59#include "sim/eventq.hh" |
60#include "sim/drain.hh" |
|
60 61/** 62 * A packet queue is a class that holds deferred packets and later 63 * sends them using the associated slave port or master port. 64 */ | 61 62/** 63 * A packet queue is a class that holds deferred packets and later 64 * sends them using the associated slave port or master port. 65 */ |
65class PacketQueue | 66class PacketQueue : public Drainable |
66{ 67 private: 68 /** A deferred packet, buffered to transmit later. */ 69 class DeferredPacket { 70 public: 71 Tick tick; ///< The tick when the packet is ready to transmit 72 PacketPtr pkt; ///< Pointer to the packet to transmit 73 bool sendAsSnoop; ///< Should it be sent as a snoop or not --- 16 unchanged lines hidden (view full) --- 90 * be called in the future via SendEvent. */ 91 void processSendEvent(); 92 93 /** 94 * Event used to call processSendEvent. 95 **/ 96 EventWrapper<PacketQueue, &PacketQueue::processSendEvent> sendEvent; 97 | 67{ 68 private: 69 /** A deferred packet, buffered to transmit later. */ 70 class DeferredPacket { 71 public: 72 Tick tick; ///< The tick when the packet is ready to transmit 73 PacketPtr pkt; ///< Pointer to the packet to transmit 74 bool sendAsSnoop; ///< Should it be sent as a snoop or not --- 16 unchanged lines hidden (view full) --- 91 * be called in the future via SendEvent. */ 92 void processSendEvent(); 93 94 /** 95 * Event used to call processSendEvent. 96 **/ 97 EventWrapper<PacketQueue, &PacketQueue::processSendEvent> sendEvent; 98 |
98 /** If we need to drain, keep the drain event around until we're done | 99 /** If we need to drain, keep the drain manager around until we're done |
99 * here.*/ | 100 * here.*/ |
100 Event *drainEvent; | 101 DrainManager *drainManager; |
101 102 protected: 103 104 /** Label to use for print request packets label stack. */ 105 const std::string label; 106 107 /** Remember whether we're awaiting a retry from the bus. */ 108 bool waitingOnRetry; --- 93 unchanged lines hidden (view full) --- 202 203 /** 204 * Used by a port to notify the queue that a retry was received 205 * and that the queue can proceed and retry sending the packet 206 * that caused the wait. 207 */ 208 void retry(); 209 | 102 103 protected: 104 105 /** Label to use for print request packets label stack. */ 106 const std::string label; 107 108 /** Remember whether we're awaiting a retry from the bus. */ 109 bool waitingOnRetry; --- 93 unchanged lines hidden (view full) --- 203 204 /** 205 * Used by a port to notify the queue that a retry was received 206 * and that the queue can proceed and retry sending the packet 207 * that caused the wait. 208 */ 209 void retry(); 210 |
210 /** 211 * Hook for draining the packet queue. 212 * 213 * @param de An event which is used to signal back to the caller 214 * @return A number indicating how many times process will be called 215 */ 216 unsigned int drain(Event *de); | 211 unsigned int drain(DrainManager *dm); |
217}; 218 219class MasterPacketQueue : public PacketQueue 220{ 221 222 protected: 223 224 MasterPort& masterPort; --- 54 unchanged lines hidden --- | 212}; 213 214class MasterPacketQueue : public PacketQueue 215{ 216 217 protected: 218 219 MasterPort& masterPort; --- 54 unchanged lines hidden --- |