simulation bug fix -> stop after termination delta cycle
This commit is contained in:
@@ -22,13 +22,15 @@ namespace simulation {
|
||||
|
||||
void Simulation::setupDebugManager(bool silent, const string& traceName)
|
||||
{
|
||||
SC_THREAD(stop);
|
||||
|
||||
vector<string> whiteList;
|
||||
if (!silent)
|
||||
{
|
||||
whiteList.push_back(controller->name());
|
||||
whiteList.push_back(player2->name());
|
||||
whiteList.push_back(player1->name());
|
||||
whiteList.push_back(this->senderName);
|
||||
whiteList.push_back(this->name());
|
||||
whiteList.push_back(TlmRecorder::senderName);
|
||||
whiteList.push_back(ControllerCore::senderName);
|
||||
whiteList.push_back(PowerDownManagerBankwise::senderName);
|
||||
@@ -43,9 +45,9 @@ void Simulation::setupDebugManager(bool silent, const string& traceName)
|
||||
}
|
||||
}
|
||||
|
||||
Simulation::Simulation(string name, string pathToResources, string traceName, DramSetup setup, std::vector<Device> devices,
|
||||
Simulation::Simulation(sc_module_name name, string pathToResources, string traceName, DramSetup setup, std::vector<Device> devices,
|
||||
bool silent) :
|
||||
traceName(traceName), senderName(name), dramSetup(setup)
|
||||
traceName(traceName), dramSetup(setup)
|
||||
|
||||
{
|
||||
xmlAddressDecoder::addressConfigURI = pathToResources + string("configs/amconfigs/") + setup.addressmapping;
|
||||
@@ -105,6 +107,7 @@ void Simulation::start()
|
||||
player2->start();
|
||||
player3->start();
|
||||
player4->start();
|
||||
sc_set_stop_mode(SC_STOP_FINISH_DELTA);
|
||||
sc_start();
|
||||
}
|
||||
|
||||
@@ -115,13 +118,15 @@ void inline Simulation::transactionFinished()
|
||||
if (remainingTransactions == 0)
|
||||
{
|
||||
cout<<endl;
|
||||
stop();
|
||||
terminateSimulation.notify();
|
||||
}
|
||||
}
|
||||
void Simulation::stop()
|
||||
{
|
||||
wait(terminateSimulation);
|
||||
report("\nTerminating simulation");
|
||||
controller->terminateSimulation();
|
||||
wait(sc_time(50, SC_NS));
|
||||
TlmRecorder::getInstance().closeConnection();
|
||||
sc_stop();
|
||||
|
||||
@@ -131,7 +136,7 @@ void Simulation::stop()
|
||||
|
||||
void Simulation::report(string message)
|
||||
{
|
||||
DebugManager::getInstance().printDebugMessage(senderName, message);
|
||||
DebugManager::getInstance().printDebugMessage(this->name(), message);
|
||||
cout << message << endl;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user