X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmem%2Fqport.hh;h=dd5caa084d07fb6343a09e566d8c6347aa665bda;hb=d2fd3b2ec2c265eb9ed3bdcc1db3e4c3feee3846;hp=39612d22f9a99477cf0e0942a7b1b33c032fb1ad;hpb=c2d2ea99e3efe13bc50d410e2eeae9dd6757e57f;p=gem5.git diff --git a/src/mem/qport.hh b/src/mem/qport.hh index 39612d22f..dd5caa084 100644 --- a/src/mem/qport.hh +++ b/src/mem/qport.hh @@ -56,20 +56,18 @@ * queue is a parameter to allow tailoring of the queue implementation * (used in the cache). */ -class QueuedPort : public Port +class QueuedSlavePort : public SlavePort { protected: /** Packet queue used to store outgoing requests and responses. */ - PacketQueue &queue; + SlavePacketQueue &queue; /** This function is notification that the device should attempt to send a * packet again. */ virtual void recvRetry() { queue.retry(); } - virtual void recvRangeChange() { } - public: /** @@ -79,23 +77,80 @@ class QueuedPort : public Port * behaviuor in a subclass, and provide the latter to the * QueuePort constructor. */ - QueuedPort(const std::string& name, MemObject* owner, PacketQueue &queue) : - Port(name, owner), queue(queue) + QueuedSlavePort(const std::string& name, MemObject* owner, + SlavePacketQueue &queue) : + SlavePort(name, owner), queue(queue) { } - virtual ~QueuedPort() { } + virtual ~QueuedSlavePort() { } + + /** + * Schedule the sending of a timing response. + * + * @param pkt Packet to send + * @param when Absolute time (in ticks) to send packet + */ + void schedTimingResp(PacketPtr pkt, Tick when) + { queue.schedSendTiming(pkt, when); } /** Check the list of buffered packets against the supplied * functional request. */ bool checkFunctional(PacketPtr pkt) { return queue.checkFunctional(pkt); } + unsigned int drain(DrainManager *dm) { return queue.drain(dm); } +}; + +class QueuedMasterPort : public MasterPort +{ + + protected: + + /** Packet queue used to store outgoing requests and responses. */ + MasterPacketQueue &queue; + + /** This function is notification that the device should attempt to send a + * packet again. */ + virtual void recvRetry() { queue.retry(); } + + public: + /** - * Hook for draining the queued port. + * Create a QueuedPort with a given name, owner, and a supplied + * implementation of a packet queue. The external definition of + * the queue enables e.g. the cache to implement a specific queue + * behaviuor in a subclass, and provide the latter to the + * QueuePort constructor. + */ + QueuedMasterPort(const std::string& name, MemObject* owner, + MasterPacketQueue &queue) : + MasterPort(name, owner), queue(queue) + { } + + virtual ~QueuedMasterPort() { } + + /** + * Schedule the sending of a timing request. * - * @param de an event which is used to signal back to the caller - * @returns a number indicating how many times process will be called + * @param pkt Packet to send + * @param when Absolute time (in ticks) to send packet */ - unsigned int drain(Event *de) { return queue.drain(de); } + void schedTimingReq(PacketPtr pkt, Tick when) + { queue.schedSendTiming(pkt, when); } + + /** + * Schedule the sending of a timing snoop response. + * + * @param pkt Packet to send + * @param when Absolute time (in ticks) to send packet + */ + void schedTimingSnoopResp(PacketPtr pkt, Tick when) + { queue.schedSendTiming(pkt, when, true); } + + /** Check the list of buffered packets against the supplied + * functional request. */ + bool checkFunctional(PacketPtr pkt) { return queue.checkFunctional(pkt); } + + unsigned int drain(DrainManager *dm) { return queue.drain(dm); } }; #endif // __MEM_QPORT_HH__