From c2d2ea99e3efe13bc50d410e2eeae9dd6757e57f Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Thu, 22 Mar 2012 06:36:27 -0400 Subject: MEM: Split SimpleTimingPort into PacketQueue and ports This patch decouples the queueing and the port interactions to simplify the introduction of the master and slave ports. By separating the queueing functionality from the port itself, it becomes much easier to distinguish between master and slave ports, and still retain the queueing ability for both (without code duplication). As part of the split into a PacketQueue and a port, there is now also a hierarchy of two port classes, QueuedPort and SimpleTimingPort. The QueuedPort is useful for ports that want to leave the packet transmission of outgoing packets to the queue and is used by both master and slave ports. The SimpleTimingPort inherits from the QueuedPort and adds the implemention of recvTiming and recvFunctional through recvAtomic. The PioPort and MessagePort are cleaned up as part of the changes. --HG-- rename : src/mem/tport.cc => src/mem/packet_queue.cc rename : src/mem/tport.hh => src/mem/packet_queue.hh --- src/mem/mport.hh | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/mem/mport.hh') diff --git a/src/mem/mport.hh b/src/mem/mport.hh index 062dcca0b..7f167c227 100644 --- a/src/mem/mport.hh +++ b/src/mem/mport.hh @@ -31,6 +31,7 @@ #ifndef __MEM_MPORT_HH__ #define __MEM_MPORT_HH__ +#include "mem/mem_object.hh" #include "mem/tport.hh" /* @@ -40,27 +41,21 @@ * the underpinnings of SimpleTimingPort, but it tweaks some of the external * functions. */ - class MessagePort : public SimpleTimingPort { + public: - MessagePort(std::string pname, MemObject *_owner = NULL) : - SimpleTimingPort(pname, _owner) + MessagePort(const std::string &name, MemObject *owner) : + SimpleTimingPort(name, owner) {} virtual ~MessagePort() {} - void - recvFunctional(PacketPtr pkt) - { - recvAtomic(pkt); - } + protected: Tick recvAtomic(PacketPtr pkt); - protected: - virtual Tick recvMessage(PacketPtr pkt) = 0; // Accept and ignore responses. -- cgit v1.2.3