Deleted Added
sdiff udiff text old ( 11393:48b748cc6497 ) new ( 11491:6ffc99023568 )
full compact
1/*
2 * Copyright (c) 2012-2013, 2016 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

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

52using namespace std;
53
54TrafficGen::TrafficGen(const TrafficGenParams* p)
55 : MemObject(p),
56 system(p->system),
57 masterID(system->getMasterId(name())),
58 configFile(p->config_file),
59 elasticReq(p->elastic_req),
60 progressCheck(p->progress_check),
61 noProgressEvent(this),
62 nextTransitionTick(0),
63 nextPacketTick(0),
64 currState(0),
65 port(name() + ".port", *this),
66 retryPkt(NULL),
67 retryPktTick(0),
68 updateEvent(this),
69 numSuppressed(0)

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

176 // trace player we would also have to restore the position in the
177 // trace playback and the tick offset
178 UNSERIALIZE_SCALAR(currState);
179}
180
181void
182TrafficGen::update()
183{
184 // shift our progress-tracking event forward
185 reschedule(noProgressEvent, curTick() + progressCheck, true);
186
187 // if we have reached the time for the next state transition, then
188 // perform the transition
189 if (curTick() >= nextTransitionTick) {
190 transition();
191 } else {
192 assert(curTick() >= nextPacketTick);
193 // get the next packet and try to send it
194 PacketPtr pkt = states[currState]->getNextPacket();

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

512 nextPacketTick = MaxTick;
513 nextTransitionTick = MaxTick;
514 signalDrainDone();
515 }
516 }
517}
518
519void
520TrafficGen::noProgress()
521{
522 fatal("TrafficGen %s spent %llu ticks without making progress",
523 name(), progressCheck);
524}
525
526void
527TrafficGen::regStats()
528{
529 // Initialise all the stats
530 using namespace Stats;
531
532 numPackets
533 .name(name() + ".numPackets")
534 .desc("Number of packets generated");

--- 18 unchanged lines hidden ---