base.cc (12811:269967d5b4e4) base.cc (12812:8f14879aebe1)
1/*
2 * Copyright (c) 2012-2013, 2016-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

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

164 transition();
165 } else {
166 assert(curTick() >= nextPacketTick);
167 // get the next packet and try to send it
168 PacketPtr pkt = activeGenerator->getNextPacket();
169
170 // suppress packets that are not destined for a memory, such as
171 // device accesses that could be part of a trace
1/*
2 * Copyright (c) 2012-2013, 2016-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

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

164 transition();
165 } else {
166 assert(curTick() >= nextPacketTick);
167 // get the next packet and try to send it
168 PacketPtr pkt = activeGenerator->getNextPacket();
169
170 // suppress packets that are not destined for a memory, such as
171 // device accesses that could be part of a trace
172 if (system->isMemAddr(pkt->getAddr())) {
172 if (pkt && system->isMemAddr(pkt->getAddr())) {
173 numPackets++;
174 if (!port.sendTimingReq(pkt)) {
175 retryPkt = pkt;
176 retryPktTick = curTick();
177 }
173 numPackets++;
174 if (!port.sendTimingReq(pkt)) {
175 retryPkt = pkt;
176 retryPktTick = curTick();
177 }
178 } else {
178 } else if (pkt) {
179 DPRINTF(TrafficGen, "Suppressed packet %s 0x%x\n",
180 pkt->cmdString(), pkt->getAddr());
181
182 ++numSuppressed;
183 if (numSuppressed % 10000)
184 warn("%s suppressed %d packets with non-memory addresses\n",
185 name(), numSuppressed);
186

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

224 nextTransitionTick = MaxTick;
225 assert(!updateEvent.scheduled());
226 }
227}
228
229void
230BaseTrafficGen::scheduleUpdate()
231{
179 DPRINTF(TrafficGen, "Suppressed packet %s 0x%x\n",
180 pkt->cmdString(), pkt->getAddr());
181
182 ++numSuppressed;
183 if (numSuppressed % 10000)
184 warn("%s suppressed %d packets with non-memory addresses\n",
185 name(), numSuppressed);
186

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

224 nextTransitionTick = MaxTick;
225 assert(!updateEvent.scheduled());
226 }
227}
228
229void
230BaseTrafficGen::scheduleUpdate()
231{
232 // Has the generator run out of work? In that case, force a
233 // transition if a transition period hasn't been configured.
234 while (activeGenerator &&
235 nextPacketTick == MaxTick && nextTransitionTick == MaxTick) {
236 transition();
237 }
238
239 if (!activeGenerator)
240 return;
241
232 // schedule next update event based on either the next execute
233 // tick or the next transition, which ever comes first
234 const Tick nextEventTick = std::min(nextPacketTick, nextTransitionTick);
242 // schedule next update event based on either the next execute
243 // tick or the next transition, which ever comes first
244 const Tick nextEventTick = std::min(nextPacketTick, nextTransitionTick);
235 if (nextEventTick == MaxTick)
236 return;
237
238 DPRINTF(TrafficGen, "Next event scheduled at %lld\n", nextEventTick);
239
240 // The next transition tick may be in the past if there was a
241 // retry, so ensure that we don't schedule anything in the past.
242 schedule(updateEvent, std::max(curTick(), nextEventTick));
243}
244

--- 173 unchanged lines hidden ---
245
246 DPRINTF(TrafficGen, "Next event scheduled at %lld\n", nextEventTick);
247
248 // The next transition tick may be in the past if there was a
249 // retry, so ensure that we don't schedule anything in the past.
250 schedule(updateEvent, std::max(curTick(), nextEventTick));
251}
252

--- 173 unchanged lines hidden ---