Fix for pull-request #131

This commit is contained in:
Éder F. Zulian
2016-10-28 19:40:10 +02:00
parent 959efef573
commit 26e1f6ac37
4 changed files with 4 additions and 16 deletions

View File

@@ -194,7 +194,6 @@ void Simulation::stop()
wait(sc_time(200, SC_NS));
} while(pending_payloads != 0);
report("\nTerminating simulation");
for (auto controller : controllers) {
controller->terminateSimulation();
}
@@ -203,9 +202,6 @@ void Simulation::stop()
rec->closeConnection();
}
sc_stop();
double elapsed_secs = double(clock() - simulationStartTime) / CLOCKS_PER_SEC;
report("Simulation took " + to_string(elapsed_secs) + " seconds");
}

View File

@@ -107,7 +107,6 @@ private:
// Transaction Recorders (one per channel). They generate the output databases.
std::vector<TlmRecorder*> tlmRecorders;
clock_t simulationStartTime;
void report(std::string message);
void setupTlmRecorders(const string &traceName, const string &pathToResources, const std::vector<Device> &devices);
void instantiateModules(const string &traceName, const string &pathToResources, const std::vector<Device> &devices);

View File

@@ -225,17 +225,12 @@ void SimulationManager::bindSockets()
void SimulationManager::runSimulation(string traceName)
{
// int pid = fork();
// int status = 0;
// if (pid == 0)
// {
report("\n\nStarting simulation:");
report(headline);
report(" -> setup: \t\t" + getFileName(traceName));
report(" -> memspec: \t\t" + Configuration::getInstance().memSpec.MemoryId);
cout << endl;
//simulationStartTime = clock();
simStartTime = clock();
for (auto player : players) {
player->nextPayload();
@@ -243,12 +238,9 @@ void SimulationManager::runSimulation(string traceName)
sc_set_stop_mode(SC_STOP_FINISH_DELTA);
sc_start();
double elapsed_secs = double(clock() - simStartTime) / CLOCKS_PER_SEC;
report("\nSimulation took " + to_string(elapsed_secs) + " seconds\n");
delete simulation;
// _Exit(0);
//}
//waitpid(pid, &status, 0);
}
void SimulationManager::startTraceAnalyzer()

View File

@@ -85,6 +85,7 @@ private:
// and initiate transactions targeting the memory)
std::vector<TracePlayer*> players;
Simulation* simulation;
clock_t simStartTime;
//TLM 2.0 Protocol Checkers
std::vector<tlm_utils::tlm2_base_protocol_checker<>*> playersTlmCheckers;