return;
}
- assert(AddrRange(pkt->getAddr(),
- pkt->getAddr() + (pkt->getSize() - 1)).isSubset(range));
+ assert(pkt->getAddrRange().isSubset(range));
uint8_t *hostAddr = pmemAddr + pkt->getAddr() - range.start();
void
AbstractMemory::functionalAccess(PacketPtr pkt)
{
- assert(AddrRange(pkt->getAddr(),
- pkt->getAddr() + pkt->getSize() - 1).isSubset(range));
+ assert(pkt->getAddrRange().isSubset(range));
uint8_t *hostAddr = pmemAddr + pkt->getAddr() - range.start();
assert(is_express_snoop == cache_responding);
// determine the destination based on the destination address range
- AddrRange addr_range = RangeSize(pkt->getAddr(), pkt->getSize());
- PortID master_port_id = findPort(addr_range);
+ PortID master_port_id = findPort(pkt->getAddrRange());
// 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
- AddrRange addr_range M5_VAR_USED =
- RangeSize(pkt->getAddr(), pkt->getSize());
- assert(findPort(addr_range) == master_port_id);
+ assert(findPort(pkt->getAddrRange()) == master_port_id);
}
bool
// even if we had a snoop response, we must continue and also
// perform the actual request at the destination
- AddrRange addr_range = RangeSize(pkt->getAddr(), pkt->getSize());
- PortID master_port_id = findPort(addr_range);
+ PortID master_port_id = findPort(pkt->getAddrRange());
if (sink_packet) {
DPRINTF(CoherentXBar, "%s: Not forwarding %s\n", __func__,
}
}
- PortID dest_id = findPort(RangeSize(pkt->getAddr(), pkt->getSize()));
+ PortID dest_id = findPort(pkt->getAddrRange());
masterPorts[dest_id]->sendFunctional(pkt);
}
assert(!pkt->isExpressSnoop());
// determine the destination based on the address
- AddrRange addr_range = RangeSize(pkt->getAddr(), pkt->getSize());
- PortID master_port_id = findPort(addr_range);
+ PortID master_port_id = findPort(pkt->getAddrRange());
// test if the layer should be considered occupied for the current
// port
unsigned int pkt_cmd = pkt->cmdToIndex();
// determine the destination port
- AddrRange addr_range = RangeSize(pkt->getAddr(), pkt->getSize());
- PortID master_port_id = findPort(addr_range);
+ PortID master_port_id = findPort(pkt->getAddrRange());
// stats updates for the request
pktCount[slave_port_id][master_port_id]++;
}
// determine the destination port
- AddrRange addr_range = RangeSize(pkt->getAddr(), pkt->getSize());
- PortID dest_id = findPort(addr_range);
+ PortID dest_id = findPort(pkt->getAddrRange());
// forward the request to the appropriate destination
masterPorts[dest_id]->sendFunctional(pkt);
InvalidCmd, "InvalidateResp" }
};
+AddrRange
+Packet::getAddrRange() const
+{
+ return RangeSize(getAddr(), getSize());
+}
+
bool
Packet::trySatisfyFunctional(Printable *obj, Addr addr, bool is_secure, int size,
uint8_t *_data)
#include <cassert>
#include <list>
+#include "base/addr_range.hh"
#include "base/cast.hh"
#include "base/compiler.hh"
#include "base/flags.hh"
unsigned getSize() const { assert(flags.isSet(VALID_SIZE)); return size; }
+ /**
+ * Get address range to which this packet belongs.
+ *
+ * @return Address range of this packet.
+ */
+ AddrRange getAddrRange() const;
+
Addr getOffset(unsigned int blk_size) const
{
return getAddr() & Addr(blk_size - 1);
PhysicalMemory::access(PacketPtr pkt)
{
assert(pkt->isRequest());
- AddrRange addr_range = RangeSize(pkt->getAddr(), pkt->getSize());
- const auto& m = addrMap.contains(addr_range);
+ const auto& m = addrMap.contains(pkt->getAddrRange());
assert(m != addrMap.end());
m->second->access(pkt);
}
PhysicalMemory::functionalAccess(PacketPtr pkt)
{
assert(pkt->isRequest());
- AddrRange addr_range = RangeSize(pkt->getAddr(), pkt->getSize());
- const auto& m = addrMap.contains(addr_range);
+ const auto& m = addrMap.contains(pkt->getAddrRange());
assert(m != addrMap.end());
m->second->functionalAccess(pkt);
}