summaryrefslogtreecommitdiff
path: root/src/mem/noncoherent_xbar.cc
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2014-12-02 06:07:56 -0500
committerAndreas Hansson <andreas.hansson@arm.com>2014-12-02 06:07:56 -0500
commit5c84157c291dceb8040ab4dd29142a4d141fd2ed (patch)
tree11d8233de2e4effc934cda648b3c863de376eafb /src/mem/noncoherent_xbar.cc
parentea5ccc70417db08379027ca7344e50cba53063dd (diff)
downloadgem5-5c84157c291dceb8040ab4dd29142a4d141fd2ed.tar.xz
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.
Diffstat (limited to 'src/mem/noncoherent_xbar.cc')
-rw-r--r--src/mem/noncoherent_xbar.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mem/noncoherent_xbar.cc b/src/mem/noncoherent_xbar.cc
index bc51be5a2..476b8314f 100644
--- a/src/mem/noncoherent_xbar.cc
+++ b/src/mem/noncoherent_xbar.cc
@@ -171,6 +171,8 @@ NoncoherentXBar::recvTimingResp(PacketPtr pkt, PortID master_port_id)
// determine the destination based on what is stored in the packet
PortID slave_port_id = pkt->getDest();
+ assert(slave_port_id != InvalidPortID);
+ assert(slave_port_id < respLayers.size());
// test if the layer should be considered occupied for the current
// port