43 lines
916 B
C++
43 lines
916 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_PS);
|
|
|
|
string resources = pathOfFile(argv[0]) + string("/../resources/");
|
|
string stl1 = "chstone-sha_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,false);
|
|
simulationManager.startSimulation();
|
|
startTraceAnalyzer(traceName);
|
|
return 0;
|
|
}
|
|
|