diff options
author | Andreas Hansson <andreas.hansson@arm.com> | 2012-07-09 12:35:36 -0400 |
---|---|---|
committer | Andreas Hansson <andreas.hansson@arm.com> | 2012-07-09 12:35:36 -0400 |
commit | 995e6e4670f52c52f798320055d74994e6539cda (patch) | |
tree | bd758d4a220f06412abe4a7484369b18ae1ea0be /src/mem/noncoherent_bus.cc | |
parent | 14f9c77dd36fef8ab509bc17ecbe422555daa9c6 (diff) | |
download | gem5-995e6e4670f52c52f798320055d74994e6539cda.tar.xz |
Bus: Add a notion of layers to the buses
This patch moves all flow control, arbitration and state information
into a bus layer. The layer is thus responsible for all the state
transitions, and for keeping hold of the retry list. Consequently the
layer is also responsible for the draining.
With this change, the non-coherent and coherent bus are given a single
layer to avoid changing any temporal behaviour, but the patch opens up
for adding more layers.
Diffstat (limited to 'src/mem/noncoherent_bus.cc')
-rw-r--r-- | src/mem/noncoherent_bus.cc | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/src/mem/noncoherent_bus.cc b/src/mem/noncoherent_bus.cc index 718bbebdd..e502a78a8 100644 --- a/src/mem/noncoherent_bus.cc +++ b/src/mem/noncoherent_bus.cc @@ -55,7 +55,7 @@ #include "mem/noncoherent_bus.hh" NoncoherentBus::NoncoherentBus(const NoncoherentBusParams *p) - : BaseBus(p) + : BaseBus(p), layer(*this, ".layer", p->clock) { // create the ports based on the size of the master and slave // vector ports, and the presence of the default port, the ports @@ -97,7 +97,7 @@ NoncoherentBus::recvTimingReq(PacketPtr pkt, PortID slave_port_id) // test if the bus should be considered occupied for the current // port - if (!tryTiming(src_port)) { + if (!layer.tryTiming(src_port)) { DPRINTF(NoncoherentBus, "recvTimingReq: src %s %s 0x%x BUSY\n", src_port->name(), pkt->cmdString(), pkt->getAddr()); return false; @@ -123,12 +123,12 @@ NoncoherentBus::recvTimingReq(PacketPtr pkt, PortID slave_port_id) DPRINTF(NoncoherentBus, "recvTimingReq: src %s %s 0x%x RETRY\n", src_port->name(), pkt->cmdString(), pkt->getAddr()); - failedTiming(src_port, headerFinishTime); + layer.failedTiming(src_port, headerFinishTime); return false; } - succeededTiming(packetFinishTime); + layer.succeededTiming(packetFinishTime); return true; } @@ -141,7 +141,7 @@ NoncoherentBus::recvTimingResp(PacketPtr pkt, PortID master_port_id) // test if the bus should be considered occupied for the current // port - if (!tryTiming(src_port)) { + if (!layer.tryTiming(src_port)) { DPRINTF(NoncoherentBus, "recvTimingResp: src %s %s 0x%x BUSY\n", src_port->name(), pkt->cmdString(), pkt->getAddr()); return false; @@ -161,11 +161,18 @@ NoncoherentBus::recvTimingResp(PacketPtr pkt, PortID master_port_id) // deadlock assert(success); - succeededTiming(packetFinishTime); + layer.succeededTiming(packetFinishTime); return true; } +void +NoncoherentBus::recvRetry() +{ + // only one layer that can deal with it + layer.recvRetry(); +} + Tick NoncoherentBus::recvAtomic(PacketPtr pkt, PortID slave_port_id) { @@ -201,6 +208,13 @@ NoncoherentBus::recvFunctional(PacketPtr pkt, PortID slave_port_id) masterPorts[dest_id]->sendFunctional(pkt); } +unsigned int +NoncoherentBus::drain(Event *de) +{ + // only one layer to worry about at the moment + return layer.drain(de); +} + NoncoherentBus* NoncoherentBusParams::create() { |