corrected checkers for non-interleaving reads/writes. Added burst length to db. Added burst functionally to players
This commit is contained in:
@@ -17,13 +17,15 @@ using namespace std;
|
||||
|
||||
namespace simulation {
|
||||
|
||||
SimulationManager::SimulationManager(sc_module_name name, std::string stl1, std::string stl2,
|
||||
SimulationManager::SimulationManager(sc_module_name name, std::string stl1,
|
||||
unsigned int burstlength1, std::string stl2, unsigned int burstlenght2,
|
||||
std::string traceName, std::string pathToResources) :
|
||||
dram("dram"), arbiter("arbiter"), controller("controller"), player1("player1",
|
||||
pathToResources + string("traces/") + stl1, this), player2("player2",
|
||||
pathToResources + string("traces/") + stl2, this), traceName(traceName)
|
||||
pathToResources + string("traces/") + stl1,burstlength1, this), player2("player2",
|
||||
pathToResources + string("traces/") + stl2,burstlenght2, this), traceName(traceName)
|
||||
|
||||
{
|
||||
|
||||
SC_THREAD(terminationThread);
|
||||
xmlAddressDecoder::addressConfigURI = pathToResources + string("configs/addressConfig.xml");
|
||||
TlmRecorder::dbName = traceName;
|
||||
@@ -38,6 +40,7 @@ SimulationManager::SimulationManager(sc_module_name name, std::string stl1, std:
|
||||
whiteList.push_back(controller.name());
|
||||
whiteList.push_back(player2.name());
|
||||
whiteList.push_back(player1.name());
|
||||
whiteList.push_back(this->name());
|
||||
whiteList.push_back(TlmRecorder::senderName);
|
||||
whiteList.push_back(ControllerCore::senderName);
|
||||
whiteList.push_back(PowerDownManager::senderName);
|
||||
@@ -49,21 +52,21 @@ void SimulationManager::startSimulation()
|
||||
|
||||
clock_t begin = clock();
|
||||
|
||||
cout << "Toplevel: simulation start" << std::endl;
|
||||
DebugManager::getInstance().printDebugMessage(name(), "Starting simulation");
|
||||
player1.start();
|
||||
player2.start();
|
||||
sc_start();
|
||||
|
||||
clock_t end = clock();
|
||||
double elapsed_secs = double(end - begin) / CLOCKS_PER_SEC;
|
||||
cout << "Simulation took " << elapsed_secs << " seconds." << endl;
|
||||
cout << this->name();
|
||||
|
||||
string p = getenv("trace");
|
||||
string run_tpr = p + " " + traceName;
|
||||
system(run_tpr.c_str());
|
||||
DebugManager::getInstance().printDebugMessage(name(),
|
||||
"Simulation took " + to_string(elapsed_secs) + " seconds");
|
||||
}
|
||||
|
||||
void SimulationManager::tracePlayerFinishedCallback()
|
||||
void SimulationManager::tracePlayerFinishedCallback(string name)
|
||||
{
|
||||
|
||||
DebugManager::getInstance().printDebugMessage(this->name(), "Traceplayer " + name + " finshed");
|
||||
static int finishedPlayers = 0;
|
||||
finishedPlayers++;
|
||||
if (finishedPlayers == numberOfTracePlayers)
|
||||
@@ -75,9 +78,10 @@ void SimulationManager::tracePlayerFinishedCallback()
|
||||
void SimulationManager::terminationThread()
|
||||
{
|
||||
wait(terminateSimulation);
|
||||
DebugManager::getInstance().printDebugMessage(this->name(), "Terminating simulation");
|
||||
controller.terminateSimulation();
|
||||
//waits for the termination of all pending powerdown phases in the dram system
|
||||
wait(sc_time(50,SC_NS));
|
||||
wait(sc_time(50, SC_NS));
|
||||
TlmRecorder::getInstance().closeConnection();
|
||||
sc_stop();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user