From da6a7b1263cf624790f06a5f944366fb113dffc8 Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Fri, 26 May 2006 13:48:35 -0400 Subject: Add names to memory Port objects for tracing. --HG-- extra : convert_revision : ddf30084e343e8656e4812ab20356292b35507ee --- src/mem/port.hh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/mem/port.hh') diff --git a/src/mem/port.hh b/src/mem/port.hh index 1b1920c03..e8a20235a 100644 --- a/src/mem/port.hh +++ b/src/mem/port.hh @@ -69,9 +69,28 @@ typedef std::list >::iterator AddrRangeIter; */ class Port { + private: + + /** Descriptive name (for DPRINTF output) */ + const std::string portName; + public: + /** + * Constructor. + * + * @param _name Port name for DPRINTF output. Should include name + * of memory system object to which the port belongs. + */ + Port(const std::string &_name) + : portName(_name) + { } + + /** Return port name (for DPRINTF). */ + const std::string &name() const { return portName; } + virtual ~Port() {}; + // mey be better to use subclasses & RTTI? /** Holds the ports status. Keeps track if it is blocked, or has calculated a range change. */ @@ -224,6 +243,10 @@ class Port class FunctionalPort : public Port { public: + FunctionalPort(const std::string &_name) + : Port(_name) + {} + virtual bool recvTiming(Packet *pkt) { panic("FuncPort is UniDir"); } virtual Tick recvAtomic(Packet *pkt) { panic("FuncPort is UniDir"); } virtual void recvFunctional(Packet *pkt) { panic("FuncPort is UniDir"); } -- cgit v1.2.3