f = currState->fault;
} else {
RequestPtr req = new Request(l1desc_addr, sizeof(uint32_t), flag, masterId);
- PacketPtr pkt = new Packet(req, MemCmd::ReadReq, Packet::Broadcast);
+ PacketPtr pkt = new Packet(req, MemCmd::ReadReq);
pkt->dataStatic((uint8_t*)&currState->l1Desc.data);
port.sendFunctional(pkt);
doL1Descriptor();
currState->tc->getCpuPtr()->ticks(1));
doL2Descriptor();
} else {
- RequestPtr req = new Request(l2desc_addr, sizeof(uint32_t), 0, masterId);
- PacketPtr pkt = new Packet(req, MemCmd::ReadReq, Packet::Broadcast);
+ RequestPtr req = new Request(l2desc_addr, sizeof(uint32_t), 0,
+ masterId);
+ PacketPtr pkt = new Packet(req, MemCmd::ReadReq);
pkt->dataStatic((uint8_t*)&currState->l2Desc.data);
port.sendFunctional(pkt);
doL2Descriptor();
RequestPtr req = new Request(x86InterruptAddress(id, offset),
size, Request::UNCACHEABLE,
Request::intMasterId);
- PacketPtr pkt = new Packet(req, MemCmd::MessageReq, Packet::Broadcast);
+ PacketPtr pkt = new Packet(req, MemCmd::MessageReq);
pkt->allocate();
return pkt;
}
flags.set(Request::UNCACHEABLE, uncacheable);
RequestPtr request =
new Request(nextRead, oldRead->getSize(), flags, walker->masterId);
- read = new Packet(request, MemCmd::ReadReq, Packet::Broadcast);
+ read = new Packet(request, MemCmd::ReadReq);
read->allocate();
// If we need to write, adjust the read packet to write the modified
// value back to memory.
write = oldRead;
write->set<uint64_t>(pte);
write->cmd = MemCmd::WriteReq;
- write->setDest(Packet::Broadcast);
+ write->clearDest();
} else {
write = NULL;
delete oldRead->req;
Request::Flags flags = Request::PHYSICAL;
if (cr3.pcd)
flags.set(Request::UNCACHEABLE);
- RequestPtr request = new Request(topAddr, dataSize, flags, walker->masterId);
- read = new Packet(request, MemCmd::ReadReq, Packet::Broadcast);
+ RequestPtr request = new Request(topAddr, dataSize, flags,
+ walker->masterId);
+ read = new Packet(request, MemCmd::ReadReq);
read->allocate();
}
if (fault == NoFault &&
!memReq->getFlags().isSet(Request::NO_ACCESS)) {
PacketPtr pkt = new Packet(memReq,
- memReq->isLLSC() ?
- MemCmd::LoadLockedReq : MemCmd::ReadReq,
- Packet::Broadcast);
+ memReq->isLLSC() ?
+ MemCmd::LoadLockedReq :
+ MemCmd::ReadReq);
pkt->dataStatic(data);
break;
}
} else {
- PacketPtr pkt = new Packet(memReq,
- MemCmd::ReadReq,
- Packet::Broadcast);
+ PacketPtr pkt = new Packet(memReq, MemCmd::ReadReq);
pkt->dataStatic(&machInst);
icachePort->sendFunctional(pkt);
cache_req->dataPkt = new CacheReqPacket(cache_req,
cache_req->pktCmd,
- Packet::Broadcast,
cache_req->instIdx);
DPRINTF(InOrderCachePort, "[slot:%i]: Slot marked for %x\n",
cache_req->getSlot(),
cpu->dataMasterId(),
0);
- split_pkt = new Packet(cache_req->memReq, cache_req->pktCmd,
- Packet::Broadcast);
+ split_pkt = new Packet(cache_req->memReq, cache_req->pktCmd);
split_pkt->dataStatic(inst->splitMemData);
DPRINTF(InOrderCachePort, "Completing Split Access.\n");
{
public:
CacheReqPacket(CacheRequest *_req,
- Command _cmd, short _dest, int _idx = 0)
- : Packet(&(*_req->memReq), _cmd, _dest), cacheReq(_req),
+ Command _cmd, int _idx = 0)
+ : Packet(&(*_req->memReq), _cmd), cacheReq(_req),
instIdx(_idx), hasSlot(false), reqData(NULL), memReq(NULL)
{
}
// Build packet here.
- PacketPtr data_pkt = new Packet(mem_req,
- MemCmd::ReadReq, Packet::Broadcast);
+ PacketPtr data_pkt = new Packet(mem_req, MemCmd::ReadReq);
data_pkt->dataDynamicArray(new uint8_t[cacheBlkSize]);
cacheDataPC[tid] = block_PC;
ThreadContext *thread = cpu->tcBase(lsqID);
Tick delay;
- PacketPtr data_pkt =
- new Packet(req, MemCmd::ReadReq, Packet::Broadcast);
+ PacketPtr data_pkt = new Packet(req, MemCmd::ReadReq);
if (!TheISA::HasUnalignedMemAcc || !sreqLow) {
data_pkt->dataStatic(load_inst->memData);
delay = TheISA::handleIprRead(thread, data_pkt);
} else {
assert(sreqLow->isMmappedIpr() && sreqHigh->isMmappedIpr());
- PacketPtr fst_data_pkt =
- new Packet(sreqLow, MemCmd::ReadReq, Packet::Broadcast);
- PacketPtr snd_data_pkt =
- new Packet(sreqHigh, MemCmd::ReadReq, Packet::Broadcast);
+ PacketPtr fst_data_pkt = new Packet(sreqLow, MemCmd::ReadReq);
+ PacketPtr snd_data_pkt = new Packet(sreqHigh, MemCmd::ReadReq);
fst_data_pkt->dataStatic(load_inst->memData);
snd_data_pkt->dataStatic(load_inst->memData + sreqLow->getSize());
"addr %#x, data %#x\n",
store_idx, req->getVaddr(), data);
- PacketPtr data_pkt = new Packet(req, MemCmd::ReadReq,
- Packet::Broadcast);
+ PacketPtr data_pkt = new Packet(req, MemCmd::ReadReq);
data_pkt->dataStatic(load_inst->memData);
WritebackEvent *wb = new WritebackEvent(load_inst, data_pkt, this);
if (!lsq->cacheBlocked()) {
MemCmd command =
req->isLLSC() ? MemCmd::LoadLockedReq : MemCmd::ReadReq;
- PacketPtr data_pkt = new Packet(req, command, Packet::Broadcast);
+ PacketPtr data_pkt = new Packet(req, command);
PacketPtr fst_data_pkt = NULL;
PacketPtr snd_data_pkt = NULL;
} else {
// Create the split packets.
- fst_data_pkt = new Packet(sreqLow, command, Packet::Broadcast);
- snd_data_pkt = new Packet(sreqHigh, command, Packet::Broadcast);
+ fst_data_pkt = new Packet(sreqLow, command);
+ snd_data_pkt = new Packet(sreqHigh, command);
fst_data_pkt->dataStatic(load_inst->memData);
snd_data_pkt->dataStatic(load_inst->memData + sreqLow->getSize());
if (!TheISA::HasUnalignedMemAcc || !storeQueue[storeWBIdx].isSplit) {
// Build a single data packet if the store isn't split.
- data_pkt = new Packet(req, command, Packet::Broadcast);
+ data_pkt = new Packet(req, command);
data_pkt->dataStatic(inst->memData);
data_pkt->senderState = state;
} else {
// Create two packets if the store is split in two.
- data_pkt = new Packet(sreqLow, command, Packet::Broadcast);
- snd_data_pkt = new Packet(sreqHigh, command, Packet::Broadcast);
+ data_pkt = new Packet(sreqLow, command);
+ snd_data_pkt = new Packet(sreqHigh, command);
data_pkt->dataStatic(inst->memData);
snd_data_pkt->dataStatic(inst->memData + sreqLow->getSize());
#endif
// Build packet here.
- PacketPtr data_pkt = new Packet(memReq,
- Packet::ReadReq, Packet::Broadcast);
+ PacketPtr data_pkt = new Packet(memReq, Packet::ReadReq);
data_pkt->dataStatic(cacheData);
if (!icachePort.sendTiming(data_pkt)) {
(*sq_it).inst->seqNum, inst->seqNum, req->getVaddr(),
*(inst->memData));
- PacketPtr data_pkt = new Packet(req, Packet::ReadReq, Packet::Broadcast);
+ PacketPtr data_pkt = new Packet(req, Packet::ReadReq);
data_pkt->dataStatic(inst->memData);
WritebackEvent *wb = new WritebackEvent(inst, data_pkt, this);
PacketPtr data_pkt =
new Packet(req,
(req->isLLSC() ?
- MemCmd::LoadLockedReq : Packet::ReadReq),
- Packet::Broadcast);
+ MemCmd::LoadLockedReq : Packet::ReadReq));
data_pkt->dataStatic(inst->memData);
LSQSenderState *state = new LSQSenderState;
MemCmd command =
req->isSwap() ? MemCmd::SwapReq :
(req->isLLSC() ? MemCmd::WriteReq : MemCmd::StoreCondReq);
- PacketPtr data_pkt = new Packet(req, command, Packet::Broadcast);
+ PacketPtr data_pkt = new Packet(req, command);
data_pkt->dataStatic(inst->memData);
LSQSenderState *state = new LSQSenderState;
// Now do the access.
if (fault == NoFault && !req->getFlags().isSet(Request::NO_ACCESS)) {
Packet pkt = Packet(req,
- req->isLLSC() ? MemCmd::LoadLockedReq : MemCmd::ReadReq,
- Packet::Broadcast);
+ req->isLLSC() ? MemCmd::LoadLockedReq :
+ MemCmd::ReadReq);
pkt.dataStatic(data);
if (req->isMmappedIpr())
}
if (do_access && !req->getFlags().isSet(Request::NO_ACCESS)) {
- Packet pkt = Packet(req, cmd, Packet::Broadcast);
+ Packet pkt = Packet(req, cmd);
pkt.dataStatic(data);
if (req->isMmappedIpr()) {
//if(predecoder.needMoreBytes())
//{
icache_access = true;
- Packet ifetch_pkt = Packet(&ifetch_req, MemCmd::ReadReq,
- Packet::Broadcast);
+ Packet ifetch_pkt = Packet(&ifetch_req, MemCmd::ReadReq);
ifetch_pkt.dataStatic(&inst);
if (fastmem && system->isMemAddr(ifetch_pkt.getAddr()))
cmd = MemCmd::SwapReq;
}
}
- pkt = new Packet(req, cmd, Packet::Broadcast);
+ pkt = new Packet(req, cmd);
}
void
buildPacket(pkt2, req2, read);
req->setPhys(req1->getPaddr(), req->getSize(), req1->getFlags(), dataMasterId());
- PacketPtr pkt = new Packet(req, pkt1->cmd.responseCommand(),
- Packet::Broadcast);
+ PacketPtr pkt = new Packet(req, pkt1->cmd.responseCommand());
pkt->dataDynamicArray<uint8_t>(data);
pkt1->dataStatic<uint8_t>(data);
if (fault == NoFault) {
DPRINTF(SimpleCPU, "Sending fetch for addr %#x(pa: %#x)\n",
req->getVaddr(), req->getPaddr());
- ifetch_pkt = new Packet(req, MemCmd::ReadReq, Packet::Broadcast);
+ ifetch_pkt = new Packet(req, MemCmd::ReadReq);
ifetch_pkt->dataStatic(&inst);
DPRINTF(SimpleCPU, " -- pkt addr: %#x\n", ifetch_pkt->getAddr());
cmd = MemCmd::ReadReq;
port = safe_cast<RubyDirectedTester::CpuPort*>(m_directed_tester->
getCpuPort(m_active_read_node));
- pkt = new Packet(req, cmd, m_active_read_node);
+ pkt = new Packet(req, cmd);
} else if (m_status == InvalidateGeneratorStatus_Inv_Waiting) {
DPRINTF(DirectedTest, "initiating invalidating write\n");
cmd = MemCmd::WriteReq;
port = safe_cast<RubyDirectedTester::CpuPort*>(m_directed_tester->
getCpuPort(m_active_inv_node));
- pkt = new Packet(req, cmd, m_active_inv_node);
+ pkt = new Packet(req, cmd);
} else {
panic("initiate was unexpectedly called\n");
}
} else {
cmd = MemCmd::ReadReq;
}
- PacketPtr pkt = new Packet(req, cmd, m_active_node);
+ PacketPtr pkt = new Packet(req, cmd);
uint8_t* dummyData = new uint8_t;
*dummyData = 0;
pkt->dataDynamic(dummyData);
id, do_functional ? "functional " : "", req->getPaddr(),
blockAddr(req->getPaddr()), *result);
- PacketPtr pkt = new Packet(req, MemCmd::ReadReq, Packet::Broadcast);
- pkt->setSrc(0);
+ PacketPtr pkt = new Packet(req, MemCmd::ReadReq);
pkt->dataDynamicArray(new uint8_t[req->getSize()]);
MemTestSenderState *state = new MemTestSenderState(result);
pkt->senderState = state;
do_functional ? "functional " : "", req->getPaddr(),
blockAddr(req->getPaddr()), data & 0xff);
- PacketPtr pkt = new Packet(req, MemCmd::WriteReq, Packet::Broadcast);
- pkt->setSrc(0);
+ PacketPtr pkt = new Packet(req, MemCmd::WriteReq);
uint8_t *pkt_data = new uint8_t[req->getSize()];
pkt->dataDynamicArray(pkt_data);
memcpy(pkt_data, &data, req->getSize());
"Generated packet with destination %d, embedded in address %x\n",
destination, req->getPaddr());
- PacketPtr pkt = new Packet(req, requestType, 0);
- pkt->setSrc(0); //Not used
+ PacketPtr pkt = new Packet(req, requestType);
pkt->dataDynamicArray(new uint8_t[req->getSize()]);
pkt->senderState = NULL;
m_tester_ptr->masterId(), curTick(), m_pc.getAddress());
req->setThreadContext(index, 0);
- PacketPtr pkt = new Packet(req, cmd, port->idx);
+ PacketPtr pkt = new Packet(req, cmd);
// push the subblock onto the sender state. The sequencer will
// update the subblock on the return
cmd = MemCmd::FlushReq;
- PacketPtr pkt = new Packet(req, cmd, port->idx);
+ PacketPtr pkt = new Packet(req, cmd);
// push the subblock onto the sender state. The sequencer will
// update the subblock on the return
cmd = MemCmd::WriteReq;
// }
- PacketPtr pkt = new Packet(req, cmd, port->idx);
+ PacketPtr pkt = new Packet(req, cmd);
uint8_t* writeData = new uint8_t;
*writeData = m_value + m_store_count;
pkt->dataDynamic(writeData);
m_tester_ptr->masterId(), curTick(), m_pc.getAddress());
req->setThreadContext(index, 0);
- PacketPtr pkt = new Packet(req, MemCmd::ReadReq, port->idx);
+ PacketPtr pkt = new Packet(req, MemCmd::ReadReq);
uint8_t* dataArray = new uint8_t[CHECK_SIZE];
pkt->dataDynamicArray(dataArray);
for (ChunkGenerator gen(addr, size, peerBlockSize());
!gen.done(); gen.next()) {
Request *req = new Request(gen.addr(), gen.size(), flag, masterId);
- PacketPtr pkt = new Packet(req, cmd, Packet::Broadcast);
+ PacketPtr pkt = new Packet(req, cmd);
// Increment the data pointer on a write
if (data)
// all checks are done when the request is accepted on the slave
// side, so we are guaranteed to have space for the response
-
- DPRINTF(BusBridge, "recvTiming: src %d dest %d addr 0x%x\n",
- pkt->getSrc(), pkt->getDest(), pkt->getAddr());
+ DPRINTF(BusBridge, "recvTiming: response %s addr 0x%x\n",
+ pkt->cmdString(), pkt->getAddr());
DPRINTF(BusBridge, "Request queue size: %d\n", requestQueue.size());
// should only see requests on the slave side
assert(pkt->isRequest());
- DPRINTF(BusBridge, "recvTiming: src %d dest %d addr 0x%x\n",
- pkt->getSrc(), pkt->getDest(), pkt->getAddr());
+
+ DPRINTF(BusBridge, "recvTiming: request %s addr 0x%x\n",
+ pkt->cmdString(), pkt->getAddr());
DPRINTF(BusBridge, "Response queue size: %d outresp: %d\n",
responseQueue.size(), outstandingResponses);
// from original request
buf->fixResponse(pkt);
+ // the bridge assumes that at least one bus has set the
+ // destination field of the packet
+ assert(pkt->isDestValid());
DPRINTF(BusBridge, "response, new dest %d\n", pkt->getDest());
delete buf;
PacketPtr pkt = buf->pkt;
- DPRINTF(BusBridge, "trySend: origSrc %d dest %d addr 0x%x\n",
- buf->origSrc, pkt->getDest(), pkt->getAddr());
+ DPRINTF(BusBridge, "trySend: origSrc %d addr 0x%x\n",
+ buf->origSrc, pkt->getAddr());
// If the send was successful, make sure sender state was set to NULL
// otherwise we could get a NACK back of a packet that didn't expect a
PacketPtr pkt;
bool nackedHere;
Packet::SenderState *origSenderState;
- short origSrc;
+ Packet::NodeID origSrc;
bool expectResponse;
PacketBuffer(PacketPtr _pkt, Tick t, bool nack = false)
// test if the bus should be considered occupied for the current
// packet, and exclude express snoops from the check
if (!pkt->isExpressSnoop() && isOccupied(pkt, src_port)) {
- DPRINTF(Bus, "recvTiming: src %d dst %d %s 0x%x BUSY\n",
- src_id, pkt->getDest(), pkt->cmdString(), pkt->getAddr());
+ DPRINTF(Bus, "recvTiming: src %s %s 0x%x BUSY\n",
+ src_port->name(), pkt->cmdString(), pkt->getAddr());
return false;
}
- DPRINTF(Bus, "recvTiming: src %d dst %d %s 0x%x\n",
- src_id, pkt->getDest(), pkt->cmdString(), pkt->getAddr());
+ DPRINTF(Bus, "recvTiming: src %s %s 0x%x\n",
+ src_port->name(), pkt->cmdString(), pkt->getAddr());
Tick headerFinishTime = pkt->isExpressSnoop() ? 0 : calcPacketTiming(pkt);
Tick packetFinishTime = pkt->isExpressSnoop() ? 0 : pkt->finishTime;
// decide what to do based on the direction
if (pkt->isRequest()) {
- // the packet is a memory-mapped request and should be broadcasted to
- // our snoopers
- assert(pkt->getDest() == Packet::Broadcast);
-
- // forward to all snoopers but the source
+ // the packet is a memory-mapped request and should be
+ // broadcasted to our snoopers but the source
forwardTiming(pkt, src_id);
// remember if we add an outstanding req so we can undo it if
if (add_outstanding)
outstandingReq.erase(pkt->req);
- DPRINTF(Bus, "recvTiming: src %d dst %d %s 0x%x RETRY\n",
- src_id, pkt->getDest(), pkt->cmdString(), pkt->getAddr());
+ DPRINTF(Bus, "recvTiming: src %s %s 0x%x RETRY\n",
+ src_port->name(), pkt->cmdString(), pkt->getAddr());
addToRetryList(src_port);
occupyBus(headerFinishTime);
Packet::NodeID src_id = pkt->getSrc();
if (pkt->isRequest()) {
- DPRINTF(Bus, "recvTimingSnoop: src %d dst %d %s 0x%x\n",
- src_id, pkt->getDest(), pkt->cmdString(), pkt->getAddr());
+ DPRINTF(Bus, "recvTimingSnoop: src %d %s 0x%x\n",
+ src_id, pkt->cmdString(), pkt->getAddr());
// the packet is an express snoop request and should be
// broadcasted to our snoopers
- assert(pkt->getDest() == Packet::Broadcast);
assert(pkt->isExpressSnoop());
// forward to all snoopers
SlavePort* src_port = slavePorts[src_id];
if (isOccupied(pkt, src_port)) {
- DPRINTF(Bus, "recvTimingSnoop: src %d dst %d %s 0x%x BUSY\n",
- src_id, pkt->getDest(), pkt->cmdString(), pkt->getAddr());
+ DPRINTF(Bus, "recvTimingSnoop: src %s %s 0x%x BUSY\n",
+ src_port->name(), pkt->cmdString(), pkt->getAddr());
return false;
}
- DPRINTF(Bus, "recvTimingSnoop: src %d dst %d %s 0x%x\n",
- src_id, pkt->getDest(), pkt->cmdString(), pkt->getAddr());
+ DPRINTF(Bus, "recvTimingSnoop: src %s %s 0x%x\n",
+ src_port->name(), pkt->cmdString(), pkt->getAddr());
// get the destination from the packet
Packet::NodeID dest = pkt->getDest();
Tick
Bus::recvAtomic(PacketPtr pkt)
{
- DPRINTF(Bus, "recvAtomic: packet src %d dest %d addr 0x%x cmd %s\n",
- pkt->getSrc(), pkt->getDest(), pkt->getAddr(), pkt->cmdString());
+ DPRINTF(Bus, "recvAtomic: packet src %s addr 0x%x cmd %s\n",
+ slavePorts[pkt->getSrc()]->name(), pkt->getAddr(),
+ pkt->cmdString());
// we should always see a request routed based on the address
- assert(pkt->getDest() == Packet::Broadcast);
assert(pkt->isRequest());
// forward to all snoopers but the source
Tick
Bus::recvAtomicSnoop(PacketPtr pkt)
{
- DPRINTF(Bus, "recvAtomicSnoop: packet src %d dest %d addr 0x%x cmd %s\n",
- pkt->getSrc(), pkt->getDest(), pkt->getAddr(), pkt->cmdString());
+ DPRINTF(Bus, "recvAtomicSnoop: packet src %s addr 0x%x cmd %s\n",
+ masterPorts[pkt->getSrc()]->name(), pkt->getAddr(),
+ pkt->cmdString());
// we should always see a request routed based on the address
- assert(pkt->getDest() == Packet::Broadcast);
assert(pkt->isRequest());
// forward to all snoopers
// restore original packet state for remaining snoopers
pkt->cmd = orig_cmd;
pkt->setSrc(orig_src_id);
- pkt->setDest(Packet::Broadcast);
+ pkt->clearDest();
}
}
}
if (!pkt->isPrint()) {
// don't do DPRINTFs on PrintReq as it clutters up the output
DPRINTF(Bus,
- "recvFunctional: packet src %d dest %d addr 0x%x cmd %s\n",
- pkt->getSrc(), pkt->getDest(), pkt->getAddr(),
+ "recvFunctional: packet src %s addr 0x%x cmd %s\n",
+ slavePorts[pkt->getSrc()]->name(), pkt->getAddr(),
pkt->cmdString());
}
// we should always see a request routed based on the address
- assert(pkt->getDest() == Packet::Broadcast);
assert(pkt->isRequest());
// forward to all snoopers but the source
if (!pkt->isPrint()) {
// don't do DPRINTFs on PrintReq as it clutters up the output
DPRINTF(Bus,
- "recvFunctionalSnoop: packet src %d dest %d addr 0x%x cmd %s\n",
- pkt->getSrc(), pkt->getDest(), pkt->getAddr(),
+ "recvFunctionalSnoop: packet src %s addr 0x%x cmd %s\n",
+ masterPorts[pkt->getSrc()]->name(), pkt->getAddr(),
pkt->cmdString());
}
// we should always see a request routed based on the address
- assert(pkt->getDest() == Packet::Broadcast);
assert(pkt->isRequest());
// forward to all snoopers
class ForwardResponseRecord : public Packet::SenderState, public FastAlloc
{
Packet::SenderState *prevSenderState;
- int prevSrc;
+ Packet::NodeID prevSrc;
#ifndef NDEBUG
BaseCache *cache;
#endif
// block is invalid
cmd = needsExclusive ? MemCmd::ReadExReq : MemCmd::ReadReq;
}
- PacketPtr pkt = new Packet(cpu_pkt->req, cmd, Packet::Broadcast, blkSize);
+ PacketPtr pkt = new Packet(cpu_pkt->req, cmd, blkSize);
pkt->allocate();
return pkt;
Request *writebackReq =
new Request(tags->regenerateBlkAddr(blk->tag, blk->set), blkSize, 0,
Request::wbMasterId);
- PacketPtr writeback = new Packet(writebackReq, MemCmd::Writeback, -1);
+ PacketPtr writeback = new Packet(writebackReq, MemCmd::Writeback);
if (blk->isWritable()) {
writeback->setSupplyExclusive();
}
// create a prefetch memreq
Request *prefetchReq = new Request(*addrIter, blkSize, 0, masterId);
PacketPtr prefetch =
- new Packet(prefetchReq, MemCmd::HardPFReq, Packet::Broadcast);
+ new Packet(prefetchReq, MemCmd::HardPFReq);
prefetch->allocate();
prefetch->req->setThreadContext(pkt->req->contextId(),
pkt->req->threadId());
*/
Request *writebackReq = new Request(regenerateBlkAddr(tag_ptr->tag, 0),
blkSize, 0, Request::wbMasterId);
- PacketPtr writeback = new Packet(writebackReq, MemCmd::Writeback,
- -1);
+ PacketPtr writeback = new Packet(writebackReq, MemCmd::Writeback);
writeback->allocate();
memcpy(writeback->getPtr<uint8_t>(), tag_ptr->data, blkSize);
/*
+ * Copyright (c) 2012 ARM Limited
+ * All rights reserved
+ *
+ * The license below extends only to copyright in the software and shall
+ * not be construed as granting a license to any other intellectual
+ * property including but not limited to intellectual property relating
+ * to a hardware implementation of the functionality of the software
+ * licensed hereunder. You may use the software subject to the license
+ * terms below provided that you ensure that this notice is replicated
+ * unmodified and in its entirety in all distributions of the software,
+ * modified or unmodified, in source code or in binary form.
+ *
* Copyright (c) 2006 The Regents of The University of Michigan
* Copyright (c) 2010 Advanced Micro Devices, Inc.
* All rights reserved.
/// The time at which the first chunk of the packet will be transmitted
Tick firstWordTime;
- /// The special destination address indicating that the packet
- /// should be routed based on its address.
- static const NodeID Broadcast = -1;
-
/**
* A virtual base opaque structure used to hold state associated
* with the packet but specific to the sending device (e.g., an
NodeID getDest() const { assert(flags.isSet(VALID_DST)); return dest; }
/// Accessor function to set the destination index of the packet.
void setDest(NodeID _dest) { dest = _dest; flags.set(VALID_DST); }
+ /// Reset destination field, e.g. to turn a response into a request again.
+ void clearDest() { flags.clear(VALID_DST); }
Addr getAddr() const { assert(flags.isSet(VALID_ADDR)); return addr; }
unsigned getSize() const { assert(flags.isSet(VALID_SIZE)); return size; }
* not be valid. The command and destination addresses must be
* supplied.
*/
- Packet(Request *_req, MemCmd _cmd, NodeID _dest)
- : flags(VALID_DST), cmd(_cmd), req(_req), data(NULL),
- dest(_dest), bytesValidStart(0), bytesValidEnd(0),
+ Packet(Request *_req, MemCmd _cmd)
+ : cmd(_cmd), req(_req), data(NULL),
+ bytesValidStart(0), bytesValidEnd(0),
time(curTick()), senderState(NULL)
{
if (req->hasPaddr()) {
* a request that is for a whole block, not the address from the
* req. this allows for overriding the size/addr of the req.
*/
- Packet(Request *_req, MemCmd _cmd, NodeID _dest, int _blkSize)
- : flags(VALID_DST), cmd(_cmd), req(_req), data(NULL),
- dest(_dest), bytesValidStart(0), bytesValidEnd(0),
+ Packet(Request *_req, MemCmd _cmd, int _blkSize)
+ : cmd(_cmd), req(_req), data(NULL),
+ bytesValidStart(0), bytesValidEnd(0),
time(curTick()), senderState(NULL)
{
if (req->hasPaddr()) {
assert(wasNacked());
cmd = origCmd;
assert(needsResponse());
- setDest(Broadcast);
+ clearDest();
}
void
MasterPort::printAddr(Addr a)
{
Request req(a, 1, 0, Request::funcMasterId);
- Packet pkt(&req, MemCmd::PrintReq, Packet::Broadcast);
+ Packet pkt(&req, MemCmd::PrintReq);
Packet::PrintReqState prs(std::cerr);
pkt.senderState = &prs;
for (ChunkGenerator gen(addr, size, _port.peerBlockSize());
!gen.done(); gen.next()) {
req.setPhys(gen.addr(), gen.size(), 0, Request::funcMasterId);
- Packet pkt(&req, cmd, Packet::Broadcast);
+ Packet pkt(&req, cmd);
pkt.dataStatic(p);
_port.sendFunctional(&pkt);
p += gen.size();
RubySystem::getBlockSizeBytes(),0,
Request::funcMasterId);
MemCmd::Command requestType = MemCmd::FlushReq;
- Packet *pkt = new Packet(req, requestType, -1);
+ Packet *pkt = new Packet(req, requestType);
Sequencer* m_sequencer_ptr = m_seq_map[rec->m_cntrl_id];
assert(m_sequencer_ptr != NULL);
RubySystem::getBlockSizeBytes(),0, Request::funcMasterId);
}
- Packet *pkt = new Packet(req, requestType, -1);
+ Packet *pkt = new Packet(req, requestType);
pkt->dataStatic(traceRecord->m_data);
Sequencer* m_sequencer_ptr = m_seq_map[traceRecord->m_cntrl_id];
Request req(address.getAddress(), 0, 0, Request::funcMasterId);
for (CpuPortIter p = slave_ports.begin(); p != slave_ports.end(); ++p) {
if ((*p)->getMasterPort().isSnooping()) {
- Packet *pkt = new Packet(&req, MemCmd::InvalidationReq, -1);
+ Packet *pkt = new Packet(&req, MemCmd::InvalidationReq);
// send as a snoop request
(*p)->sendNextCycle(pkt, true);
}