Files
DRAMSys/dram/src/simulation/main.cpp

43 lines
911 B
C++

/*
* main.cpp
*
* Created on: Mar 16, 2014
* Author: robert
*/
#include <iostream>
#include <string>
#include "SimulationManager.h"
using namespace std;
using namespace simulation;
string pathOfFile(string file)
{
return file.substr(0, file.find_last_of('/'));
}
void startTraceAnalyzer(string traceName)
{
string p = getenv("trace");
string run_tpr = p + " " + traceName;
system(run_tpr.c_str());
}
int sc_main(int argc, char **argv)
{
sc_set_time_resolution(1, SC_NS);
string resources = pathOfFile(argv[0]) + string("/../resources/");
string stl1 = "chstone-mips_32.stl";
unsigned int burstlength1 = 4;
string stl2 = "empty.stl";
unsigned int burstlength2 = 2;
string traceName = "tpr.tdb";
SimulationManager simulationManager("sim", stl1,burstlength1, stl2,burstlength2, traceName, resources);
simulationManager.startSimulation();
startTraceAnalyzer(traceName);
return 0;
}