Ability to specify a different resource folder

This commit is contained in:
Matthias Jung
2018-11-08 23:28:19 +01:00
parent 2f76b8f2d1
commit 8ba08e9bd4
2 changed files with 28 additions and 6 deletions

View File

@@ -39,6 +39,7 @@
#include <systemc.h>
#include <utility>
#include <vector>
#include <ctime>
#include "DRAMSys.h"
#include "TraceSetup.h"
@@ -61,16 +62,27 @@ int sc_main(int argc, char **argv)
{
sc_set_time_resolution(1, SC_PS);
// Get path of resources:
resources = pathOfFile(argv[0])
+ string("/../../DRAMSys/library/resources/");
string SimulationXML;
if (argc > 1) {
SimulationXML = argv[1];
} else {
// Run only with default config (ddr-example.xml):
if (argc == 1) {
// Get path of resources:
resources = pathOfFile(argv[0])
+ string("/../../DRAMSys/library/resources/");
SimulationXML = resources + "simulations/ddr3-example.xml";
}
// Run with specific config but default resource folders:
else if (argc == 2) {
// Get path of resources:
resources = pathOfFile(argv[0])
+ string("/../../DRAMSys/library/resources/");
SimulationXML = argv[1];
}
// Run with spefific config and specific resource folder:
else if (argc == 3) {
SimulationXML = argv[1];
resources = argv[2];
}
std::vector<TracePlayer *> players;

View File

@@ -182,6 +182,16 @@ $ cd simulator
$ ./DRAMSys
```
To run DRAMSys with a specific config:
```bash
$ ./DRAMSys ../../DRAMSys/library/resources/simulations/ddr3-example.xml
```
To run DRAMSys with a specific config and a resource folder somewhere else to the standard:
```bash
$ ./DRAMSys ../../DRAMSys/tests/example_ddr3/simulations/ddr3-example.xml ../../DRAMSys/tests/example_ddr3/
```
From the build directory use the commands below to execute the traceAnalyzer.
```bash