summaryrefslogtreecommitdiff
path: root/src/mem/bus.hh
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2012-07-09 12:35:37 -0400
committerAndreas Hansson <andreas.hansson@arm.com>2012-07-09 12:35:37 -0400
commit8caaac048ae49310b905e190b20459232ae7aa9d (patch)
treec46f4657b287505ae3fa89eda6c1bf43c4efc3c2 /src/mem/bus.hh
parent995e6e4670f52c52f798320055d74994e6539cda (diff)
downloadgem5-8caaac048ae49310b905e190b20459232ae7aa9d.tar.xz
Bus: Split the bus into separate request/response layers
This patch splits the existing buses into multiple layers. The non-coherent bus is split into a request and a response layer, and the coherent bus adds an additional layer for the snoop responses. The layer is modified to be templatised on the port type, such that the different layers can have retryLists with either master or slave ports. This patch also removes the dynamic cast from the retry, as previously promised when moving the recvRetry from the port base class to the master/slave port respectively. Overall, the split bus more closely reflects any modern on-chip bus and should be at step in the right direction. From this point, it would be reasonable straight forward to add separate layers (and thus contention points and arbitration) for each port and thus create a true crossbar. The regressions all produce the correct output, but have varying degrees of changes to their statistics. A separate patch will be pushed with the updates to the reference statistics.
Diffstat (limited to 'src/mem/bus.hh')
-rw-r--r--src/mem/bus.hh24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/mem/bus.hh b/src/mem/bus.hh
index c54532c65..d4c3b4724 100644
--- a/src/mem/bus.hh
+++ b/src/mem/bus.hh
@@ -82,11 +82,19 @@ class BaseBus : public MemObject
* point is to have three layers, for requests, responses, and
* snoop responses respectively (snoop requests are instantaneous
* and do not need any flow control or arbitration). This case is
- * similar to AHB and some OCP configurations. As a further
- * extensions beyond the three-layer bus, a future multi-layer bus
- * has with one layer per connected slave port provides a full or
- * partial crossbar, like AXI, OCP, PCIe etc.
+ * similar to AHB and some OCP configurations.
+ *
+ * As a further extensions beyond the three-layer bus, a future
+ * multi-layer bus has with one layer per connected slave port
+ * provides a full or partial crossbar, like AXI, OCP, PCIe etc.
+ *
+ * The template parameter, PortClass, indicates the destination
+ * port type for the bus. The retry list holds either master ports
+ * or slave ports, depending on the direction of the layer. Thus,
+ * a request layer has a retry list containing slave ports,
+ * whereas a response layer holds master ports.
*/
+ template <typename PortClass>
class Layer
{
@@ -129,7 +137,7 @@ class BaseBus : public MemObject
*
* @return True if the bus layer accepts the packet
*/
- bool tryTiming(Port* port);
+ bool tryTiming(PortClass* port);
/**
* Deal with a destination port accepting a packet by potentially
@@ -148,7 +156,7 @@ class BaseBus : public MemObject
*
* @param busy_time Time to spend as a result of a failed send
*/
- void failedTiming(SlavePort* port, Tick busy_time);
+ void failedTiming(PortClass* port, Tick busy_time);
/** Occupy the bus layer until until */
void occupyLayer(Tick until);
@@ -203,10 +211,10 @@ class BaseBus : public MemObject
Event * drainEvent;
/**
- * An array of pointers to ports that retry should be called
+ * An array of ports that retry should be called
* on because the original send failed for whatever reason.
*/
- std::list<Port*> retryList;
+ std::list<PortClass*> retryList;
/**
* Release the bus layer after being occupied and return to an