diff options
author | Steve Reinhardt <stever@eecs.umich.edu> | 2006-05-26 13:48:35 -0400 |
---|---|---|
committer | Steve Reinhardt <stever@eecs.umich.edu> | 2006-05-26 13:48:35 -0400 |
commit | da6a7b1263cf624790f06a5f944366fb113dffc8 (patch) | |
tree | 16110f2f8efa8b98a42d3b85c43a3a7b8ae1f1ce /src/mem/port.hh | |
parent | cf826ae296a4277bdf2ce46e4484295efde5a3c2 (diff) | |
download | gem5-da6a7b1263cf624790f06a5f944366fb113dffc8.tar.xz |
Add names to memory Port objects for tracing.
--HG--
extra : convert_revision : ddf30084e343e8656e4812ab20356292b35507ee
Diffstat (limited to 'src/mem/port.hh')
-rw-r--r-- | src/mem/port.hh | 23 |
1 files changed, 23 insertions, 0 deletions
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<Range<Addr> >::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"); } |