addr, RubySystem::getBlockSizeBytes(), 0, m_masterId);
PacketPtr pkt = Packet::createWrite(req);
- uint8_t *newData = new uint8_t[RubySystem::getBlockSizeBytes()];
- pkt->dataDynamic(newData);
- memcpy(newData, block.getData(0, RubySystem::getBlockSizeBytes()),
- RubySystem::getBlockSizeBytes());
+ pkt->allocate();
+ pkt->setData(block.getData(0, RubySystem::getBlockSizeBytes()));
SenderState *s = new SenderState(id);
pkt->pushSenderState(s);
RequestPtr req = std::make_shared<Request>(addr, size, 0, m_masterId);
PacketPtr pkt = Packet::createWrite(req);
- uint8_t *newData = new uint8_t[size];
- pkt->dataDynamic(newData);
- memcpy(newData, block.getData(getOffset(addr), size), size);
+ pkt->allocate();
+ pkt->setData(block.getData(getOffset(addr), size));
SenderState *s = new SenderState(id);
pkt->pushSenderState(s);
(type == RubyRequestType_RMW_Read) ||
(type == RubyRequestType_Locked_RMW_Read) ||
(type == RubyRequestType_Load_Linked)) {
- memcpy(pkt->getPtr<uint8_t>(),
- data.getData(getOffset(request_address),
- pkt->getSize()),
- pkt->getSize());
+ pkt->setData(
+ data.getData(getOffset(request_address), pkt->getSize()));
} else {
data.setData(pkt->getPtr<uint8_t>(),
getOffset(request_address), pkt->getSize());
if (pkt->getPtr<uint8_t>() &&
srequest->m_type != RubyRequestType_ATOMIC_NO_RETURN) {
/* atomics are done in memory, and return the data *before* the atomic op... */
- memcpy(pkt->getPtr<uint8_t>(),
- data.getData(getOffset(request_address),
- pkt->getSize()),
- pkt->getSize());
+ pkt->setData(
+ data.getData(getOffset(request_address), pkt->getSize()));
} else {
DPRINTF(MemoryAccess,
"WARNING. Data not transfered from Ruby to M5 for type " \
(type == RubyRequestType_RMW_Read) ||
(type == RubyRequestType_Locked_RMW_Read) ||
(type == RubyRequestType_Load_Linked)) {
- memcpy(pkt->getPtr<uint8_t>(),
- data.getData(getOffset(request_address), pkt->getSize()),
- pkt->getSize());
+ pkt->setData(
+ data.getData(getOffset(request_address), pkt->getSize()));
DPRINTF(RubySequencer, "read data %s\n", data);
} else if (pkt->req->isSwap()) {
std::vector<uint8_t> overwrite_val(pkt->getSize());
- memcpy(&overwrite_val[0], pkt->getConstPtr<uint8_t>(),
- pkt->getSize());
- memcpy(pkt->getPtr<uint8_t>(),
- data.getData(getOffset(request_address), pkt->getSize()),
- pkt->getSize());
+ pkt->writeData(&overwrite_val[0]);
+ pkt->setData(
+ data.getData(getOffset(request_address), pkt->getSize()));
data.setData(&overwrite_val[0],
getOffset(request_address), pkt->getSize());
DPRINTF(RubySequencer, "swap data %s\n", data);