traffic_gen.cc (11393:48b748cc6497) | traffic_gen.cc (11491:6ffc99023568) |
---|---|
1/* | 1/* |
2 * Copyright (c) 2012-2013 ARM Limited | 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), | 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), |
|
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{ | 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 |
|
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 | 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 |
|
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 --- | 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 --- |