diff options
Diffstat (limited to 'mem/bus.cc')
-rw-r--r-- | mem/bus.cc | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/mem/bus.cc b/mem/bus.cc index acc941434..f84e38301 100644 --- a/mem/bus.cc +++ b/mem/bus.cc @@ -48,9 +48,16 @@ Bus::init() /** Function called by the port when the bus is recieving a Timing * transaction.*/ bool -Bus::recvTiming(Packet &pkt, int id) +Bus::recvTiming(Packet &pkt) { - return findPort(pkt.addr, id)->sendTiming(pkt); + Port *port; + if (pkt.dest == Packet::Broadcast) { + port = findPort(pkt.addr, pkt.src); + } else { + assert(pkt.dest > 0 && pkt.dest < interfaces.size()); + port = interfaces[pkt.dest]; + } + return port->sendTiming(pkt); } Port * @@ -82,17 +89,19 @@ Bus::findPort(Addr addr, int id) /** Function called by the port when the bus is recieving a Atomic * transaction.*/ Tick -Bus::recvAtomic(Packet &pkt, int id) +Bus::recvAtomic(Packet &pkt) { - return findPort(pkt.addr, id)->sendAtomic(pkt); + assert(pkt.dest == Packet::Broadcast); + return findPort(pkt.addr, pkt.src)->sendAtomic(pkt); } /** Function called by the port when the bus is recieving a Functional * transaction.*/ void -Bus::recvFunctional(Packet &pkt, int id) +Bus::recvFunctional(Packet &pkt) { - findPort(pkt.addr, id)->sendFunctional(pkt); + assert(pkt.dest == Packet::Broadcast); + findPort(pkt.addr, pkt.src)->sendFunctional(pkt); } /** Function called by the port when the bus is recieving a status change.*/ |