traffic_gen.cc (10051:6157b07daac7) | traffic_gen.cc (10128:013bba88efab) |
---|---|
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 --- 207 unchanged lines hidden (view full) --- 216 // open input file 217 ifstream infile; 218 infile.open(configFile.c_str(), ifstream::in); 219 if (!infile.is_open()) { 220 fatal("Traffic generator %s config file not found at %s\n", 221 name(), configFile); 222 } 223 | 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 --- 207 unchanged lines hidden (view full) --- 216 // open input file 217 ifstream infile; 218 infile.open(configFile.c_str(), ifstream::in); 219 if (!infile.is_open()) { 220 fatal("Traffic generator %s config file not found at %s\n", 221 name(), configFile); 222 } 223 |
224 bool init_state_set = false; 225 |
|
224 // read line by line and determine the action based on the first 225 // keyword 226 string keyword; 227 string line; 228 229 while (getline(infile, line).good()) { 230 // see if this line is a comment line, and if so skip it 231 if (line.find('#') != 1) { --- 79 unchanged lines hidden (view full) --- 311 transitions.push_back(transition); 312 313 DPRINTF(TrafficGen, "Transition: %d -> %d\n", transition.from, 314 transition.to); 315 } else if (keyword == "INIT") { 316 // set the initial state as the active state 317 is >> currState; 318 | 226 // read line by line and determine the action based on the first 227 // keyword 228 string keyword; 229 string line; 230 231 while (getline(infile, line).good()) { 232 // see if this line is a comment line, and if so skip it 233 if (line.find('#') != 1) { --- 79 unchanged lines hidden (view full) --- 313 transitions.push_back(transition); 314 315 DPRINTF(TrafficGen, "Transition: %d -> %d\n", transition.from, 316 transition.to); 317 } else if (keyword == "INIT") { 318 // set the initial state as the active state 319 is >> currState; 320 |
321 init_state_set = true; 322 |
|
319 DPRINTF(TrafficGen, "Initial state: %d\n", currState); 320 } 321 } 322 } 323 | 323 DPRINTF(TrafficGen, "Initial state: %d\n", currState); 324 } 325 } 326 } 327 |
328 if (!init_state_set) 329 fatal("%s: initial state not specified (add 'INIT <id>' line " 330 "to the config file)\n", name()); 331 |
|
324 // resize and populate state transition matrix 325 transitionMatrix.resize(states.size()); 326 for (size_t i = 0; i < states.size(); i++) { 327 transitionMatrix[i].resize(states.size()); 328 } 329 330 for (vector<Transition>::iterator t = transitions.begin(); 331 t != transitions.end(); ++t) { --- 115 unchanged lines hidden --- | 332 // resize and populate state transition matrix 333 transitionMatrix.resize(states.size()); 334 for (size_t i = 0; i < states.size(); i++) { 335 transitionMatrix[i].resize(states.size()); 336 } 337 338 for (vector<Transition>::iterator t = transitions.begin(); 339 t != transitions.end(); ++t) { --- 115 unchanged lines hidden --- |