}
// nothing else to do; writeback doesn't expect response
assert(!pkt->needsResponse());
- std::memcpy(blk->data, pkt->getConstPtr<uint8_t>(), blkSize);
+ pkt->writeDataToBlock(blk->data, blkSize);
DPRINTF(Cache, "%s new state is %s\n", __func__, blk->print());
incHitCount(pkt);
// populate the time when the block will be ready to access.
}
// nothing else to do; writeback doesn't expect response
assert(!pkt->needsResponse());
- std::memcpy(blk->data, pkt->getConstPtr<uint8_t>(), blkSize);
+ pkt->writeDataToBlock(blk->data, blkSize);
DPRINTF(Cache, "%s new state is %s\n", __func__, blk->print());
incHitCount(pkt);
blk->status &= ~BlkDirty;
pkt->allocate();
- std::memcpy(pkt->getPtr<uint8_t>(), blk->data, blkSize);
+ pkt->setDataFromBlock(blk->data, blkSize);
return pkt;
}
blk->status &= ~BlkDirty;
pkt->allocate();
- std::memcpy(pkt->getPtr<uint8_t>(), blk->data, blkSize);
+ pkt->setDataFromBlock(blk->data, blkSize);
return pkt;
}
assert(pkt->hasData());
assert(pkt->getSize() == blkSize);
- std::memcpy(blk->data, pkt->getConstPtr<uint8_t>(), blkSize);
+ pkt->writeDataToBlock(blk->data, blkSize);
}
// We pay for fillLatency here.
blk->whenReady = clockEdge() + fillLatency * clockPeriod() +
private:
/**
- * A pointer to the data being transfered. It can be differnt
- * sizes at each level of the heirarchy so it belongs in the
+ * A pointer to the data being transferred. It can be different
+ * sizes at each level of the hierarchy so it belongs to the
* packet, not request. This may or may not be populated when a
- * responder recieves the packet. If not populated it memory should
+ * responder receives the packet. If not populated memory should
* be allocated.
*/
PacketDataPtr data;
}
/**
- * Copy data from the packet to the provided block pointer, which
- * is aligned to the given block size.
+ * Copy data from the packet to the memory at the provided pointer.
+ * @param p Pointer to which data will be copied.
*/
void
writeData(uint8_t *p) const
}
/**
- * Copy data from the packet to the memory at the provided pointer.
+ * Copy data from the packet to the provided block pointer, which
+ * is aligned to the given block size.
+ * @param blk_data Pointer to block to which data will be copied.
+ * @param blkSize Block size in bytes.
*/
void
writeDataToBlock(uint8_t *blk_data, int blkSize) const