From ffbbff3cbf089996ee4a73f5b1ee70c3cf1bc2e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89der=20Ferreira=20Zulian?= Date: Mon, 22 Jun 2015 12:44:20 +0200 Subject: [PATCH] Small changes in code and README file. Cosmetic changes in code. Small improvements in the README text. --- README.md | 38 ++++++++++--------- dram/src/common/Utils.h | 1 + dram/src/controller/Controller.h | 2 +- dram/src/controller/core/ControllerCore.cpp | 1 - dram/src/controller/core/ControllerCore.h | 2 +- .../core/configuration/Configuration.cpp | 8 ++-- dram/src/simulation/Simulation.cpp | 3 +- 7 files changed, 29 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 5a395b2e..83b65478 100644 --- a/README.md +++ b/README.md @@ -5,18 +5,13 @@ Generic DRAM controller simulator **DRAMSys** [1] and related tools. ## Basic Setup -In a terminal window execute the commands that follow. - -Go to your home directory. +Open a terminal window, go to your home directory, create a directory for your +projects and change to it. ``` bash $ cd -``` - -Create a directory for your projects. - -``` bash $ mkdir projects +$ cd projects ``` Clone the repository. @@ -104,6 +99,14 @@ $ qmake ../dramSys/dramSys.pro $ make ``` +The result of the compilation is an executable binary file **dramSys** +generated inside the build directory. The program can be executed with the +command below. + +``` bash +$ ./dramSys +``` + ### DRAMSys Configuration The **dramSys** executable supports one argument which is a XML file that @@ -115,7 +118,7 @@ The XML code below shows a typic configuration: ``` xml - + @@ -124,22 +127,22 @@ The XML code below shows a typic configuration: - + - + - + - + @@ -168,7 +171,8 @@ configuration structure. #### Simulation Setups -Every possible combination of memory specification, address mapping and memory configuration corresponds to a **simulation setup**. +Every possible combination of memory specification, address mapping and memory +configuration corresponds to a **simulation setup**. DRAMSys executes all the **trace setups** listed in the configuration file for each of the simulation setups. @@ -325,10 +329,10 @@ Below are listed the configuration sections and configuration fields. trace player. Some attributes are self-explanatory while others require some previous -knowhow of memory technologies or some knowledge of the simulator source code. +knowhow of memory technologies. -Resources of the simulator are available in the **resources** directory its -sub-directories. +Resources of the simulator are available inside of the **resources** directory +and its sub-directories. ``` bash $ cd /projects/dram.vp.system/dram/resources diff --git a/dram/src/common/Utils.h b/dram/src/common/Utils.h index bfa0c126..8bd41d90 100644 --- a/dram/src/common/Utils.h +++ b/dram/src/common/Utils.h @@ -32,6 +32,7 @@ * Authors: * Robert Gernhardt * Matthias Jung + * Eder F. Zulian */ #ifndef UTILS_COMMON_UTILS_H_ diff --git a/dram/src/controller/Controller.h b/dram/src/controller/Controller.h index b3b49abc..66cf672b 100644 --- a/dram/src/controller/Controller.h +++ b/dram/src/controller/Controller.h @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include "/opt/systemc-2.3.0/include/systemc" #include "/opt/systemc-2.3.0/include/tlm" diff --git a/dram/src/controller/core/ControllerCore.cpp b/dram/src/controller/core/ControllerCore.cpp index 7c11943f..10830362 100644 --- a/dram/src/controller/core/ControllerCore.cpp +++ b/dram/src/controller/core/ControllerCore.cpp @@ -227,4 +227,3 @@ void ControllerCore::printDebugMessage(string message) DebugManager::getInstance().printDebugMessage(ControllerCore::senderName, message); } - diff --git a/dram/src/controller/core/ControllerCore.h b/dram/src/controller/core/ControllerCore.h index 2cf29e92..455aa53a 100644 --- a/dram/src/controller/core/ControllerCore.h +++ b/dram/src/controller/core/ControllerCore.h @@ -80,5 +80,5 @@ private: std::map commandChecker; }; - #endif /* CONTROLLER_H_ */ + diff --git a/dram/src/controller/core/configuration/Configuration.cpp b/dram/src/controller/core/configuration/Configuration.cpp index aa321acd..d3c35a58 100644 --- a/dram/src/controller/core/configuration/Configuration.cpp +++ b/dram/src/controller/core/configuration/Configuration.cpp @@ -117,6 +117,10 @@ void Configuration::setParameter(std::string name, std::string value) PowerAnalysis = string2bool(value); else if(name == "Debug") Debug = string2bool(value); + else if (name == "NumberOfTracePlayers") + NumberOfTracePlayers = string2int(value); + else if (name == "NumberOfMemChannels") + NumberOfMemChannels = string2int(value); // Specification for ErrorChipSeed, ErrorCSVFile path and ErrorStoreMode else if(name == "ErrorChipSeed") ErrorChipSeed = string2int(value); @@ -124,10 +128,6 @@ void Configuration::setParameter(std::string name, std::string value) ErrorCSVFile = value; else if(name == "ErrorStoreMode") ErrorStoreMode = StringToEnum(value); - else if (name == "NumberOfTracePlayers") - NumberOfTracePlayers = string2int(value); - else if (name == "NumberOfMemChannels") - NumberOfMemChannels = string2int(value); else { SC_REPORT_FATAL("Configuration", ("Parameter " + name + " not defined in Configuration").c_str()); diff --git a/dram/src/simulation/Simulation.cpp b/dram/src/simulation/Simulation.cpp index 98003184..efd4c1ee 100644 --- a/dram/src/simulation/Simulation.cpp +++ b/dram/src/simulation/Simulation.cpp @@ -128,12 +128,11 @@ void Simulation::instantiateModules(const string &pathToResources, const std::ve void Simulation::bindSockets() { - size_t i = 0; for (auto player : players) { player->iSocket.bind(arbiter->tSocket); } - for (i = 0; i < Configuration::getInstance().NumberOfMemChannels; i++) { + for (size_t i = 0; i < Configuration::getInstance().NumberOfMemChannels; i++) { arbiter->iSocket.bind(controllers[i]->tSocket); controllers[i]->iSocket.bind(drams[i]->tSocket); }