refactoring of debugManager
This commit is contained in:
@@ -5,8 +5,6 @@
|
||||
* Author: robert
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include <iostream>
|
||||
#include <systemc.h>
|
||||
#include <fstream>
|
||||
@@ -26,50 +24,42 @@ using namespace std;
|
||||
|
||||
string pathOfFile(string file)
|
||||
{
|
||||
return file.substr(0,file.find_last_of('/'));
|
||||
return file.substr(0, file.find_last_of('/'));
|
||||
}
|
||||
|
||||
int sc_main(int argc, char **argv) {
|
||||
string resources = pathOfFile(argv[0]) + string("/../resources/");
|
||||
int sc_main(int argc, char **argv)
|
||||
{
|
||||
string resources = pathOfFile(argv[0]) + string("/../resources/");
|
||||
|
||||
xmlAddressDecoder::URI = resources + string("configs/addressConfig.xml");
|
||||
tlmDBPhaseRecorder *recorder = new tlmDBPhaseRecorder("tpr.tdb", resources + string("scripts/createTraceDB.sql"));
|
||||
TracePlayer<> player("player",resources + string("traces/mediabench-h263encode_32.stl"));
|
||||
|
||||
//DebugManager::getInstance().whiteList.push_back(pair<Sender, Importance>(Sender::TracePlayer, Importance::Info));
|
||||
cout << "Toplevel: build player" << std::endl;
|
||||
tlmDBPhaseRecorder recorder("tpr.tdb", resources + string("scripts/createTraceDB.sql"));
|
||||
TracePlayer<> player("player", resources + string("traces/mediabench-h263encode_32.stl"));
|
||||
Dram<> dram("dram");
|
||||
cout << "Toplevel: build dram" << std::endl;
|
||||
Arbiter<> arbiter("arbiter");
|
||||
cout << "Toplevel: build arbiter" << std::endl;
|
||||
ControllerWrapper<> controller("controller",*recorder);
|
||||
cout << "Toplevel: build controller" << std::endl;
|
||||
ControllerWrapper<> controller("controller", recorder);
|
||||
|
||||
cout << "Toplevel: binding sockets" << std::endl;
|
||||
player.iSocket.bind(arbiter.tSockets[0]);
|
||||
arbiter.iSocket.bind(controller.tSocket);
|
||||
controller.iSocket.bind(dram.tSocket);
|
||||
|
||||
cout << "Toplevel: simulation start" << std::endl;
|
||||
//DebugManager::getInstance().addToWhiteList(Sender::TraceRecorder);
|
||||
|
||||
cout << "Toplevel: simulation start" << std::endl;
|
||||
clock_t begin = clock();
|
||||
sc_start();
|
||||
|
||||
clock_t end = clock();
|
||||
|
||||
double elapsed_secs = double(end - begin) / CLOCKS_PER_SEC;
|
||||
|
||||
cout << "Simulation took " << elapsed_secs << " seconds. You better optimize your model ! " << endl;
|
||||
|
||||
delete recorder;
|
||||
recorder.closeConnection();
|
||||
cout << "Simulation took " << elapsed_secs << " seconds." << endl;
|
||||
|
||||
string testingScript = resources + string("/scripts/tests.py");
|
||||
string runTestCommand = string("python ") + testingScript + string(" tpr.tdb");
|
||||
//system(runTestCommand.c_str());
|
||||
|
||||
string run_tpr = "/home/jonny/git/analyzer/build-traceAnalyzer-Desktop-Debug/traceAnalyzer tpr.tdb";
|
||||
string run_tpr =
|
||||
"/home/jonny/git/analyzer/build-traceAnalyzer-Desktop-Debug/traceAnalyzer tpr.tdb";
|
||||
system(run_tpr.c_str());
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user