coding style
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
|
||||
traceSetup::traceSetup(std::string uri,
|
||||
std::string pathToResources,
|
||||
std::vector<TracePlayer *> * devices)
|
||||
std::vector<TracePlayer *> *devices)
|
||||
{
|
||||
// Load Simulation:
|
||||
tinyxml2::XMLDocument simulationdoc;
|
||||
@@ -71,13 +71,12 @@ traceSetup::traceSetup(std::string uri,
|
||||
std::string name = device->GetText();
|
||||
|
||||
int pos = name.rfind('.');
|
||||
if(pos == std::string::npos)
|
||||
{
|
||||
if (pos == std::string::npos) {
|
||||
throw std::runtime_error("Name of the trace file does not contain a valid extension.");
|
||||
}
|
||||
|
||||
// Get the extension and make it lower case
|
||||
std::string ext = name.substr(pos+1);
|
||||
std::string ext = name.substr(pos + 1);
|
||||
std::transform(ext.begin(), ext.end(), ext.begin(), ::tolower);
|
||||
|
||||
std::string stlFile = pathToResources + string("traces/") + name;
|
||||
@@ -86,17 +85,12 @@ traceSetup::traceSetup(std::string uri,
|
||||
// replace all '.' to '_'
|
||||
std::replace( moduleName.begin(), moduleName.end(), '.', '_');
|
||||
|
||||
TracePlayer * player;
|
||||
if(strcmp(ext.c_str(), "stl") == 0)
|
||||
{
|
||||
TracePlayer *player;
|
||||
if (strcmp(ext.c_str(), "stl") == 0) {
|
||||
player = new StlPlayer<false>(moduleName.c_str(), stlFile, playerClk, this);
|
||||
}
|
||||
else if(strcmp(ext.c_str(), "rstl") == 0)
|
||||
{
|
||||
} else if (strcmp(ext.c_str(), "rstl") == 0) {
|
||||
player = new StlPlayer<true>(moduleName.c_str(), stlFile, playerClk, this);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
std::string error = "Unsupported file extension in " + name;
|
||||
throw std::runtime_error(error);
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ class traceSetup : public TracePlayerListener
|
||||
public:
|
||||
traceSetup(std::string uri,
|
||||
std::string pathToResources,
|
||||
std::vector<TracePlayer*> * devices);
|
||||
std::vector<TracePlayer *> *devices);
|
||||
|
||||
virtual void tracePlayerTerminates() override;
|
||||
virtual void transactionFinished() override;
|
||||
|
||||
@@ -72,7 +72,7 @@ int sc_main(int argc, char **argv)
|
||||
SimulationXML = resources + "simulations/ddr3-example.xml";
|
||||
}
|
||||
|
||||
std::vector<TracePlayer*> players;
|
||||
std::vector<TracePlayer *> players;
|
||||
|
||||
// Instantiate DRAMSys:
|
||||
DRAMSys *dramSys = new DRAMSys("DRAMSys", SimulationXML, resources);
|
||||
|
||||
Reference in New Issue
Block a user