From 5c84157c291dceb8040ab4dd29142a4d141fd2ed Mon Sep 17 00:00:00 2001 From: Andreas Hansson Date: Tue, 2 Dec 2014 06:07:56 -0500 Subject: mem: Relax packet src/dest check and shift onus to crossbar This patch allows objects to get the src/dest of a packet even if it is not set to a valid port id. This simplifies (ab)using the bridge as a buffer and latency adapter in situations where the neighbouring MemObjects are not crossbars. The checks that were done in the packet are now shifted to the crossbar where the fields are used to index into the port arrays. Thus, the carrier of the information is not burdened with checking, and the crossbar can check not only that the destination is set, but also that the port index is within limits. --- src/mem/bridge.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/mem/bridge.cc') diff --git a/src/mem/bridge.cc b/src/mem/bridge.cc index 085c97b53..b26da57e3 100644 --- a/src/mem/bridge.cc +++ b/src/mem/bridge.cc @@ -242,9 +242,8 @@ Bridge::BridgeSlavePort::schedTimingResp(PacketPtr pkt, Tick when) pkt->setDest(req_state->origSrc); delete req_state; - // the bridge assumes that at least one crossbar has set the - // destination field of the packet - assert(pkt->isDestValid()); + // the bridge sets the destination irrespective of it is valid or + // not, as it is checked in the crossbar DPRINTF(Bridge, "response, new dest %d\n", pkt->getDest()); // If we're about to put this packet at the head of the queue, we -- cgit v1.2.3