summaryrefslogtreecommitdiff
path: root/src/mem/noncoherent_bus.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/mem/noncoherent_bus.cc')
-rw-r--r--src/mem/noncoherent_bus.cc26
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()
{