Test if the "NumberOfTracePlayers" is defined in the XML file.
This commit is contained in:
@@ -125,10 +125,9 @@ void SimulationManager::parseSimulationBatch(XMLElement* simulation)
|
||||
}
|
||||
}
|
||||
|
||||
addTraceSetup(batch, simulation);
|
||||
addTraceSetups(batch, simulation);
|
||||
|
||||
simulationBatches.push_back(batch);
|
||||
|
||||
}
|
||||
|
||||
void SimulationManager::runSimulation(string traceName, DramSetup dramSetup, vector<Device> traceSetup)
|
||||
@@ -154,14 +153,15 @@ void SimulationManager::startTraceAnalyzer()
|
||||
system(run_tpr.c_str());
|
||||
}
|
||||
|
||||
void SimulationManager::addTraceSetup(SimulationBatch &batch, tinyxml2::XMLElement *simulation)
|
||||
void SimulationManager::addTraceSetups(SimulationBatch &batch, tinyxml2::XMLElement *simulation)
|
||||
{
|
||||
vector<Device> devices;
|
||||
XMLElement *tracesetups = simulation->FirstChildElement("tracesetups");
|
||||
XMLElement *simconfig = simulation->FirstChildElement("simconfig");
|
||||
unsigned int numberOfTracePlayers = 1;
|
||||
XMLElement *ntp = simconfig->FirstChildElement("NumberOfTracePlayers");
|
||||
unsigned int numberOfTracePlayers;
|
||||
ntp->QueryUnsignedAttribute("value", &numberOfTracePlayers);
|
||||
if (ntp != NULL)
|
||||
ntp->QueryUnsignedAttribute("value", &numberOfTracePlayers);
|
||||
|
||||
for (XMLElement *tracesetup = tracesetups->FirstChildElement("tracesetup"); tracesetup != NULL; tracesetup = tracesetup->NextSiblingElement("tracesetup")) {
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
* Authors:
|
||||
* Janik Schlemminger
|
||||
* Matthias Jung
|
||||
* Eder F. Zulian
|
||||
*/
|
||||
|
||||
#ifndef SIMULATIONMANAGER_H_
|
||||
@@ -72,7 +73,7 @@ private:
|
||||
|
||||
void runSimulation(std::string traceName, DramSetup dramSetup, std::vector<Device> traceSetup);
|
||||
void parseSimulationBatch(tinyxml2::XMLElement* simulation);
|
||||
void addTraceSetup(SimulationBatch& batch, tinyxml2::XMLElement* element);
|
||||
void addTraceSetups(SimulationBatch &batch, tinyxml2::XMLElement *element);
|
||||
|
||||
void report(std::string message);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user