diff --git a/DRAMSys/simulator/main.cpp b/DRAMSys/simulator/main.cpp index f6a6bda9..d2716f80 100644 --- a/DRAMSys/simulator/main.cpp +++ b/DRAMSys/simulator/main.cpp @@ -39,6 +39,7 @@ #include #include #include +#include #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 players; diff --git a/README.md b/README.md index 49690723..e1023a48 100644 --- a/README.md +++ b/README.md @@ -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