refresh manager changed vector to map

This commit is contained in:
Janik Schlemminger
2014-04-10 10:22:16 +02:00
parent 4ef7c7ad78
commit 3ba934b45f
13 changed files with 64 additions and 47 deletions

View File

@@ -17,8 +17,8 @@ using namespace std;
namespace simulation {
Simulation::Simulation(sc_module_name name, string pathToResources, string traceName, DramSetup setup,
std::vector<Device> devices, bool silent) :
Simulation::Simulation(sc_module_name name, string pathToResources, string traceName,
DramSetup setup, std::vector<Device> devices, bool silent) :
traceName(traceName)
{
@@ -36,9 +36,9 @@ Simulation::Simulation(sc_module_name name, string pathToResources, string trace
controller = new Controller<>("controller");
//setup devices
for(auto& d : devices)
for (auto& d : devices)
{
if(d.burstLength == 0)
if (d.burstLength == 0)
d.burstLength = 8;
}
@@ -67,6 +67,11 @@ Simulation::Simulation(sc_module_name name, string pathToResources, string trace
auto& dbg = DebugManager::getInstance();
dbg.addToWhiteList(whiteList);
dbg.setDebugFile(traceName + ".txt");
if (silent)
{
dbg.writeToConsole = false;
dbg.writeToFile = false;
}
}
Simulation::~Simulation()
@@ -81,9 +86,9 @@ Simulation::~Simulation()
void Simulation::startSimulation()
{
clock_t begin = clock();
cout<<"Starting simulation"<<endl;
DebugManager::getInstance().printDebugMessage(name(), "Starting simulation");
player1->start();
player2->start();
@@ -93,6 +98,7 @@ void Simulation::startSimulation()
double elapsed_secs = double(end - begin) / CLOCKS_PER_SEC;
DebugManager::getInstance().printDebugMessage(name(),
"Simulation took " + to_string(elapsed_secs) + " seconds");
cout<<"took "<<(elapsed_secs)<<endl;
}
void Simulation::tracePlayerFinishedCallback(string name)