Deleted Added
sdiff udiff text old ( 11393:48b748cc6497 ) new ( 11491:6ffc99023568 )
full compact
1/*
2 * Copyright (c) 2012-2013 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 nextTransitionTick(0),
61 nextPacketTick(0),
62 currState(0),
63 port(name() + ".port", *this),
64 retryPkt(NULL),
65 retryPktTick(0),
66 updateEvent(this),
67 numSuppressed(0)

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

174 // trace player we would also have to restore the position in the
175 // trace playback and the tick offset
176 UNSERIALIZE_SCALAR(currState);
177}
178
179void
180TrafficGen::update()
181{
182 // if we have reached the time for the next state transition, then
183 // perform the transition
184 if (curTick() >= nextTransitionTick) {
185 transition();
186 } else {
187 assert(curTick() >= nextPacketTick);
188 // get the next packet and try to send it
189 PacketPtr pkt = states[currState]->getNextPacket();

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

507 nextPacketTick = MaxTick;
508 nextTransitionTick = MaxTick;
509 signalDrainDone();
510 }
511 }
512}
513
514void
515TrafficGen::regStats()
516{
517 // Initialise all the stats
518 using namespace Stats;
519
520 numPackets
521 .name(name() + ".numPackets")
522 .desc("Number of packets generated");

--- 18 unchanged lines hidden ---