recording data strobe information now

This commit is contained in:
robert
2014-04-09 16:53:11 +02:00
parent e51deb97ec
commit abb3694391
8 changed files with 104 additions and 53 deletions

View File

@@ -18,35 +18,38 @@ using namespace std;
namespace simulation {
SimulationManager::SimulationManager(sc_module_name name, string memconfig, string memspec,
string stl1, unsigned int burstlength1, string stl2,
unsigned int burstlenght2, string traceName, string pathToResources,
bool silent) :
dram("dram"), arbiter("arbiter"), controller("controller"), player1("player1",
pathToResources + string("traces/") + stl1,burstlength1, this), player2("player2",
pathToResources + string("traces/") + stl2,burstlenght2, this), traceName(traceName)
string stl1, unsigned int burstlength1, string stl2, unsigned int burstlenght2,
string traceName, string pathToResources, bool silent) :
traceName(traceName)
{
SC_THREAD(terminationThread);
cout << pathToResources + string("configs/memconfigs/") + memconfig << endl;
cout << pathToResources + string("configs/memspecs/") + memspec << endl;
xmlAddressDecoder::addressConfigURI = pathToResources + string("configs/addressConfig.xml");
TlmRecorder::dbName = traceName;
TlmRecorder::sqlScriptURI = pathToResources + string("scripts/createTraceDB.sql");
Configuration::memconfigUri = pathToResources + string("configs/memconfigs/") + memconfig;
Configuration::memspecUri = pathToResources + string("configs/memspecs/") + memspec;
player1.iSocket.bind(arbiter.tSockets[0]);
player2.iSocket.bind(arbiter.tSockets[1]);
arbiter.iSocket.bind(controller.tSocket);
controller.iSocket.bind(dram.tSocket);
dram = new Dram<>("dram");
arbiter = new Arbiter<numberOfTracePlayers,128>("arbiter");
controller = new Controller<>("controller");
player1 = new TracePlayer<>("player1", pathToResources + string("traces/") + stl1, burstlength1,
this);
player2 = new TracePlayer<>("player2", pathToResources + string("traces/") + stl2, burstlenght2,
this);
player1->iSocket.bind(arbiter->tSockets[0]);
player2->iSocket.bind(arbiter->tSockets[1]);
arbiter->iSocket.bind(controller->tSocket);
controller->iSocket.bind(dram->tSocket);
vector<string> whiteList;
if(!silent)
if (!silent)
{
whiteList.push_back(controller.name());
whiteList.push_back(player2.name());
whiteList.push_back(player1.name());
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);
@@ -55,14 +58,24 @@ SimulationManager::SimulationManager(sc_module_name name, string memconfig, stri
DebugManager::getInstance().addToWhiteList(whiteList);
}
SimulationManager::~SimulationManager()
{
delete dram;
delete arbiter;
delete controller;
delete player1;
delete player2;
}
void SimulationManager::startSimulation()
{
clock_t begin = clock();
DebugManager::getInstance().printDebugMessage(name(), "Starting simulation");
player1.start();
player2.start();
player1->start();
player2->start();
sc_start();
clock_t end = clock();
@@ -87,13 +100,11 @@ void SimulationManager::terminationThread()
{
wait(terminateSimulation);
DebugManager::getInstance().printDebugMessage(this->name(), "Terminating simulation");
controller.terminateSimulation();
controller->terminateSimulation();
//waits for the termination of all pending powerdown phases in the dram system
wait(sc_time(50, SC_NS));
TlmRecorder::getInstance().closeConnection();
sc_stop();
}
} /* namespace simulation */