summaryrefslogtreecommitdiff
path: root/src/mem/bus.hh
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2012-03-22 06:37:21 -0400
committerAndreas Hansson <andreas.hansson@arm.com>2012-03-22 06:37:21 -0400
commit9727b1be189ab9990d4cb6783c16a7dae1b43c97 (patch)
tree4b4a8ae72c07af936db44f57573c34ac6ae73a8a /src/mem/bus.hh
parentc2d2ea99e3efe13bc50d410e2eeae9dd6757e57f (diff)
downloadgem5-9727b1be189ab9990d4cb6783c16a7dae1b43c97.tar.xz
MEM: Unify bus access methods and prepare for master/slave split
This patch unifies the recvFunctional, recvAtomic and recvTiming to all be based on a similar structure: 1) extract information about the incoming packet, 2) send it out to the appropriate snoopers, 3) determine where it is going, and 4) forward it to the right destination. The naming of variables across the different access functions is now consistent as well. Additionally, the patch introduces the member functions releaseBus and retryWaiting to better distinguish between the two cases when we should tell a sender to retry. The first case is when the bus goes from busy to idle, and the second case is when it receives a retry from a destination that did not immediatelly accept a packet. As a very minor change, the MMU debug flag is no longer used in the bus.
Diffstat (limited to 'src/mem/bus.hh')
-rw-r--r--src/mem/bus.hh30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/mem/bus.hh b/src/mem/bus.hh
index 7fdf5db26..4ea92308a 100644
--- a/src/mem/bus.hh
+++ b/src/mem/bus.hh
@@ -54,14 +54,12 @@
#include <set>
#include <string>
-#include "base/hashmap.hh"
#include "base/range.hh"
#include "base/range_map.hh"
#include "base/types.hh"
#include "mem/mem_object.hh"
#include "mem/packet.hh"
#include "mem/port.hh"
-#include "mem/request.hh"
#include "params/Bus.hh"
#include "sim/eventq.hh"
@@ -137,18 +135,6 @@ class Bus : public MemObject
};
- class BusFreeEvent : public Event
- {
- Bus * bus;
-
- public:
- BusFreeEvent(Bus * _bus);
- void process();
- const char *description() const;
- };
-
- /** a globally unique id for this bus. */
- int busId;
/** the clock speed for the bus */
int clock;
/** cycles of overhead per transaction */
@@ -276,13 +262,27 @@ class Bus : public MemObject
/** Occupy the bus until until */
void occupyBus(Tick until);
+ /**
+ * Release the bus after being occupied and return to an idle
+ * state where we proceed to send a retry to any potential waiting
+ * port, or drain if asked to do so.
+ */
+ void releaseBus();
+
+ /**
+ * Send a retry to the port at the head of the retryList. The
+ * caller must ensure that the list is not empty.
+ */
+ void retryWaiting();
+
/** Ask everyone on the bus what their size is
* @param id id of the busport that made the request
* @return the max of all the sizes
*/
unsigned findBlockSize(int id);
- BusFreeEvent busIdle;
+ // event used to schedule a release of the bus
+ EventWrapper<Bus, &Bus::releaseBus> busIdleEvent;
bool inRetry;
std::set<int> inRecvRangeChange;