/*
- * Copyright (c) 2011-2017 ARM Limited
+ * Copyright (c) 2011-2018 ARM Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
// and the cache responding flag should always be the same
assert(is_express_snoop == cache_responding);
- // determine the destination based on the address
- PortID master_port_id = findPort(pkt->getAddr());
+ // determine the destination based on the destination address range
+ AddrRange addr_range = RangeSize(pkt->getAddr(), pkt->getSize());
+ PortID master_port_id = findPort(addr_range);
// test if the crossbar should be considered occupied for the current
// port, and exclude express snoops from the check
// device responsible for the address range something is
// wrong, hence there is nothing further to do as the packet
// would be going back to where it came from
- assert(master_port_id == findPort(pkt->getAddr()));
+ AddrRange addr_range M5_VAR_USED =
+ RangeSize(pkt->getAddr(), pkt->getSize());
+ assert(findPort(addr_range) == master_port_id);
}
bool
// even if we had a snoop response, we must continue and also
// perform the actual request at the destination
- PortID master_port_id = findPort(pkt->getAddr());
+ AddrRange addr_range = RangeSize(pkt->getAddr(), pkt->getSize());
+ PortID master_port_id = findPort(addr_range);
if (sink_packet) {
DPRINTF(CoherentXBar, "%s: Not forwarding %s\n", __func__,
}
}
- PortID dest_id = findPort(pkt->getAddr());
+ PortID dest_id = findPort(RangeSize(pkt->getAddr(), pkt->getSize()));
masterPorts[dest_id]->sendFunctional(pkt);
}
/*
- * Copyright (c) 2011-2015 ARM Limited
+ * Copyright (c) 2011-2015, 2018 ARM Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
assert(!pkt->isExpressSnoop());
// determine the destination based on the address
- PortID master_port_id = findPort(pkt->getAddr());
+ AddrRange addr_range = RangeSize(pkt->getAddr(), pkt->getSize());
+ PortID master_port_id = findPort(addr_range);
// test if the layer should be considered occupied for the current
// port
unsigned int pkt_cmd = pkt->cmdToIndex();
// determine the destination port
- PortID master_port_id = findPort(pkt->getAddr());
+ AddrRange addr_range = RangeSize(pkt->getAddr(), pkt->getSize());
+ PortID master_port_id = findPort(addr_range);
// stats updates for the request
pktCount[slave_port_id][master_port_id]++;
}
// determine the destination port
- PortID dest_id = findPort(pkt->getAddr());
+ AddrRange addr_range = RangeSize(pkt->getAddr(), pkt->getSize());
+ PortID dest_id = findPort(addr_range);
// forward the request to the appropriate destination
masterPorts[dest_id]->sendFunctional(pkt);
}
PortID
-BaseXBar::findPort(Addr addr)
+BaseXBar::findPort(AddrRange addr_range)
{
// we should never see any address lookups before we've got the
// ranges of all connected slave modules
assert(gotAllAddrRanges);
// Check the address map interval tree
- auto i = portMap.contains(addr);
+ auto i = portMap.contains(addr_range);
if (i != portMap.end()) {
return i->second;
}
// Check if this matches the default range
if (useDefaultRange) {
- if (defaultRange.contains(addr)) {
- DPRINTF(AddrRanges, " found addr %#llx on default\n",
- addr);
+ if (addr_range.isSubset(defaultRange)) {
+ DPRINTF(AddrRanges, " found addr %s on default\n",
+ addr_range.to_string());
return defaultPortID;
}
} else if (defaultPortID != InvalidPortID) {
- DPRINTF(AddrRanges, "Unable to find destination for addr %#llx, "
- "will use default port\n", addr);
+ DPRINTF(AddrRanges, "Unable to find destination for %s, "
+ "will use default port\n", addr_range.to_string());
return defaultPortID;
}
// we should use the range for the default port and it did not
// match, or the default port is not set
- fatal("Unable to find destination for addr %#llx on %s\n", addr,
+ fatal("Unable to find destination for %s on %s\n", addr_range.to_string(),
name());
}
/*
- * Copyright (c) 2011-2015 ARM Limited
+ * Copyright (c) 2011-2015, 2018 ARM Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
*/
virtual void recvRangeChange(PortID master_port_id);
- /** Find which port connected to this crossbar (if any) should be
- * given a packet with this address.
+ /**
+ * Find which port connected to this crossbar (if any) should be
+ * given a packet with this address range.
*
- * @param addr Address to find port for.
+ * @param addr_range Address range to find port for.
* @return id of port that the packet should be sent out of.
*/
- PortID findPort(Addr addr);
+ PortID findPort(AddrRange addr_range);
/**
* Return the address ranges the crossbar is responsible for.