Deleted Added
sdiff udiff text old ( 12823:ba630bc7a36d ) new ( 13564:9bbd53a77887 )
full compact
1/*
2 * Copyright (c) 2012,2015,2018 ARM Limited
3 * All rights reserved.
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated

--- 33 unchanged lines hidden (view full) ---

44#include "mem/packet_queue.hh"
45
46#include "base/trace.hh"
47#include "debug/Drain.hh"
48#include "debug/PacketQueue.hh"
49
50PacketQueue::PacketQueue(EventManager& _em, const std::string& _label,
51 const std::string& _sendEventName,
52 bool force_order,
53 bool disable_sanity_check)
54 : em(_em), sendEvent([this]{ processSendEvent(); }, _sendEventName),
55 _disableSanityCheck(disable_sanity_check),
56 forceOrder(force_order),
57 label(_label), waitingOnRetry(false)
58{
59}
60
61PacketQueue::~PacketQueue()
62{
63}
64

--- 34 unchanged lines hidden (view full) ---

99 }
100
101 pkt->popLabel();
102
103 return found;
104}
105
106void
107PacketQueue::schedSendTiming(PacketPtr pkt, Tick when)
108{
109 DPRINTF(PacketQueue, "%s for %s address %x size %d when %lu ord: %i\n",
110 __func__, pkt->cmdString(), pkt->getAddr(), pkt->getSize(), when,
111 forceOrder);
112
113 // we can still send a packet before the end of this tick
114 assert(when >= curTick());
115
116 // express snoops should never be queued
117 assert(!pkt->isExpressSnoop());
118
119 // add a very basic sanity check on the port to ensure the

--- 14 unchanged lines hidden (view full) ---

134 // scheduled, but there is an unfortunate corner case where the
135 // x86 page-table walker and timing CPU send out a new request as
136 // part of the receiving of a response (called by
137 // PacketQueue::sendDeferredPacket), in which we end up calling
138 // ourselves again before we had a chance to update waitingOnRetry
139 // assert(waitingOnRetry || sendEvent.scheduled());
140
141 // this belongs in the middle somewhere, so search from the end to
142 // order by tick; however, if forceOrder is set, also make sure
143 // not to re-order in front of some existing packet with the same
144 // address
145 auto i = transmitList.end();
146 --i;
147 while (i != transmitList.begin() && when < i->tick &&
148 !(forceOrder && i->pkt->getAddr() == pkt->getAddr()))
149 --i;
150
151 // emplace inserts the element before the position pointed to by
152 // the iterator, so advance it one step
153 transmitList.emplace(++i, when, pkt);
154}
155
156void

--- 90 unchanged lines hidden (view full) ---

247bool
248ReqPacketQueue::sendTiming(PacketPtr pkt)
249{
250 return masterPort.sendTimingReq(pkt);
251}
252
253SnoopRespPacketQueue::SnoopRespPacketQueue(EventManager& _em,
254 MasterPort& _masterPort,
255 bool force_order,
256 const std::string _label)
257 : PacketQueue(_em, _label, name(_masterPort, _label), force_order),
258 masterPort(_masterPort)
259{
260}
261
262bool
263SnoopRespPacketQueue::sendTiming(PacketPtr pkt)
264{
265 return masterPort.sendTimingSnoopResp(pkt);
266}
267
268RespPacketQueue::RespPacketQueue(EventManager& _em, SlavePort& _slavePort,
269 bool force_order,
270 const std::string _label)
271 : PacketQueue(_em, _label, name(_slavePort, _label), force_order),
272 slavePort(_slavePort)
273{
274}
275
276bool
277RespPacketQueue::sendTiming(PacketPtr pkt)
278{
279 return slavePort.sendTimingResp(pkt);
280}