From d0ea8ff08849f45196fa6c8d69d5a408d9cbbafd Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Wed, 4 Apr 2007 13:56:38 -0400 Subject: The MemoryObject tha owns a port should delete it if it so chooses when deletePortRefs() is called on it with that port as a parameter. In this way a MemoryObject can keep a functional port around and give it to anyone who wants to do functional accesses rather than creating a new one each time. src/mem/bus.cc: src/mem/bus.hh: src/mem/cache/cache_impl.hh: only keep around one func port we give to anyone who wants it. Otherwise we can run out of port ids reasonably quickly if a lot of functional accesses are happening (e.g. remote debugging, dprintk, etc) --HG-- extra : convert_revision : 6a9e3e96f51cedaab6de1b36cf317203899a3716 --- src/mem/bus.hh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/mem/bus.hh') diff --git a/src/mem/bus.hh b/src/mem/bus.hh index 6706b6c77..0dd7547c5 100644 --- a/src/mem/bus.hh +++ b/src/mem/bus.hh @@ -63,6 +63,7 @@ class Bus : public MemObject Event * drainEvent; + static const int defaultId = -3; //Make it unique from Broadcast struct DevMap { @@ -249,6 +250,9 @@ class Bus : public MemObject /** Port that handles requests that don't match any of the interfaces.*/ BusPort *defaultPort; + BusPort *funcPort; + int funcPortId; + /** Has the user specified their own default responder? */ bool responderSet; @@ -266,7 +270,8 @@ class Bus : public MemObject bool responder_set) : MemObject(n), busId(bus_id), clock(_clock), width(_width), tickNextIdle(0), drainEvent(NULL), busIdle(this), inRetry(false), - maxId(0), defaultPort(NULL), responderSet(responder_set) + maxId(0), defaultPort(NULL), funcPort(NULL), funcPortId(-4), + responderSet(responder_set) { //Both the width and clock period must be positive if (width <= 0) -- cgit v1.2.3