diff --git a/DRAMSys/simulator/resources/configs/memconfigs/fifo.xml b/DRAMSys/simulator/resources/configs/memconfigs/fifo.xml index 98e7786d..8df130c3 100644 --- a/DRAMSys/simulator/resources/configs/memconfigs/fifo.xml +++ b/DRAMSys/simulator/resources/configs/memconfigs/fifo.xml @@ -1,13 +1,14 @@ - - - - - - - - - - - + + + + + + + + + + + + diff --git a/DRAMSys/simulator/resources/configs/memconfigs/fifoStrict.xml b/DRAMSys/simulator/resources/configs/memconfigs/fifoStrict.xml index dda1dd24..ecece9af 100644 --- a/DRAMSys/simulator/resources/configs/memconfigs/fifoStrict.xml +++ b/DRAMSys/simulator/resources/configs/memconfigs/fifoStrict.xml @@ -1,13 +1,15 @@ - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/DRAMSys/simulator/resources/configs/memconfigs/fr_fcfs.xml b/DRAMSys/simulator/resources/configs/memconfigs/fr_fcfs.xml index 613280c3..f33160bb 100644 --- a/DRAMSys/simulator/resources/configs/memconfigs/fr_fcfs.xml +++ b/DRAMSys/simulator/resources/configs/memconfigs/fr_fcfs.xml @@ -1,21 +1,23 @@ - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/DRAMSys/simulator/src/controller/core/configuration/Configuration.cpp b/DRAMSys/simulator/src/controller/core/configuration/Configuration.cpp index a4304974..238c95eb 100644 --- a/DRAMSys/simulator/src/controller/core/configuration/Configuration.cpp +++ b/DRAMSys/simulator/src/controller/core/configuration/Configuration.cpp @@ -167,13 +167,13 @@ void Configuration::setParameter(std::string name, std::string value) SimulationProgressBar = string2bool(value); else if(name == "NumberOfDevicesOnDIMM") NumberOfDevicesOnDIMM = string2int(value); - // Specification for ErrorChipSeed, ErrorCSVFile path and ErrorStoreMode + // Specification for ErrorChipSeed, ErrorCSVFile path and StoreMode else if(name == "ErrorChipSeed") ErrorChipSeed = string2int(value); else if(name == "ErrorCSVFile") ErrorCSVFile = value; - else if(name == "ErrorStoreMode") - ErrorStoreMode = StringToEnum(value); + else if(name == "StoreMode") + StoreMode = StringToEnum(value); // Temperature Simulation related else if (name == "TemperatureScale") { if (value != "Celsius" && value != "Fahrenheit" && value != "Kelvin") { diff --git a/DRAMSys/simulator/src/controller/core/configuration/Configuration.h b/DRAMSys/simulator/src/controller/core/configuration/Configuration.h index 8d1c008e..7a117b7f 100644 --- a/DRAMSys/simulator/src/controller/core/configuration/Configuration.h +++ b/DRAMSys/simulator/src/controller/core/configuration/Configuration.h @@ -44,8 +44,8 @@ #include "thermalSimConfig.h" #include "../../../common/Utils.h" -enum class ErrorStorageMode; -DEFINE_ENUM_CLASS_WITH_STRING_CONVERSIONS(ErrorStorageMode, (NoStorage)(Store)(ErrorModel)) +enum class StorageMode; +DEFINE_ENUM_CLASS_WITH_STRING_CONVERSIONS(StorageMode, (NoStorage)(Store)(ErrorModel)) enum class EPowerDownMode{NoPowerDown, Staggered, TimeoutPDN, TimeoutSREF}; @@ -91,10 +91,10 @@ struct Configuration void setParameter(std::string name, std::string value); void setParameters(std::map parameterMap); - //Configs for Seed, csv file and ErrorStorageMode + //Configs for Seed, csv file and StorageMode unsigned int ErrorChipSeed; std::string ErrorCSVFile ="not defined."; - ErrorStorageMode ErrorStoreMode; + StorageMode StoreMode; // Temperature Simulation related TemperatureSimConfig temperatureSim; diff --git a/DRAMSys/simulator/src/simulation/Dram.h b/DRAMSys/simulator/src/simulation/Dram.h index 0088b5c6..a30843e6 100644 --- a/DRAMSys/simulator/src/simulation/Dram.h +++ b/DRAMSys/simulator/src/simulation/Dram.h @@ -86,7 +86,7 @@ struct Dram : sc_module sc_time lastAccess; // Error Model related: - ErrorStorageMode ErrorStoreMode = Configuration::getInstance().ErrorStoreMode; + StorageMode StoreMode = Configuration::getInstance().StoreMode; std::vector ememory; // Data Storage: @@ -198,10 +198,10 @@ struct Dram : sc_module firstAccess = SC_ZERO_TIME; lastAccess = SC_ZERO_TIME; - printDebugMessage(string("ErrorStorageMode: ") + EnumToString(ErrorStoreMode)); + printDebugMessage(string("StorageMode: ") + EnumToString(StoreMode)); // For each bank in a channel a error Model is created: - if(ErrorStoreMode == ErrorStorageMode::ErrorModel) + if(StoreMode == StorageMode::ErrorModel) { for (unsigned i = 0; i < Configuration::getInstance().memSpec.NumberOfBanks; i++) { errorModel *em; @@ -368,7 +368,7 @@ struct Dram : sc_module sendToController(payload, END_ACT, delay + getExecutionTime(Command::Activate, payload)); unsigned int row = DramExtension::getExtension(payload).getRow().ID(); - if (ErrorStoreMode == ErrorStorageMode::ErrorModel) + if (StoreMode == StorageMode::ErrorModel) { ememory[bank]->activate(row); } @@ -382,11 +382,11 @@ struct Dram : sc_module numberOfTransactionsServed++; //save data: - if (ErrorStoreMode == ErrorStorageMode::NoStorage) + if (StoreMode == StorageMode::NoStorage) { // Don't store data } - else if (ErrorStoreMode == ErrorStorageMode::Store) // Use Storage + else if (StoreMode == StorageMode::Store) // Use Storage { unsigned char *phyAddr = memory + payload.get_address(); memcpy(phyAddr, payload.get_data_ptr(), payload.get_data_length()); @@ -405,12 +405,12 @@ struct Dram : sc_module if(powerAnalysis == true){DRAMPower->doCommand(MemCommand::RD, bank, cycle);} // Load data: - if (ErrorStoreMode == ErrorStorageMode::Store) //use ErrorStorageMode + if (StoreMode == StorageMode::Store) //use StorageMode { unsigned char *phyAddr = memory + payload.get_address(); memcpy(payload.get_data_ptr(), phyAddr, payload.get_data_length()); } - else if(ErrorStoreMode == ErrorStorageMode::ErrorModel)// use ErrorStorageMode with errormodel + else if(StoreMode == StorageMode::ErrorModel)// use StorageMode with errormodel { ememory[bank]->load(payload); } @@ -423,11 +423,11 @@ struct Dram : sc_module if(powerAnalysis == true){DRAMPower->doCommand(MemCommand::WRA, bank, cycle);} //save data: - if (ErrorStoreMode == ErrorStorageMode::NoStorage) + if (StoreMode == StorageMode::NoStorage) { // Don't store data } - else if (ErrorStoreMode == ErrorStorageMode::Store) // Use Storage + else if (StoreMode == StorageMode::Store) // Use Storage { unsigned char *phyAddr = memory + payload.get_address(); @@ -445,12 +445,12 @@ struct Dram : sc_module if(powerAnalysis == true){DRAMPower->doCommand(MemCommand::RDA, bank, cycle);} // Load data: - if (ErrorStoreMode == ErrorStorageMode::Store) //use ErrorStorageMode + if (StoreMode == StorageMode::Store) //use StorageMode { unsigned char *phyAddr = memory + payload.get_address(); memcpy(payload.get_data_ptr(), phyAddr, payload.get_data_length()); } - else if(ErrorStoreMode == ErrorStorageMode::ErrorModel)// use ErrorStorageMode with errormodel + else if(StoreMode == StorageMode::ErrorModel)// use StorageMode with errormodel { ememory[bank]->load(payload); } @@ -463,7 +463,7 @@ struct Dram : sc_module sendToController(payload, END_REFA, delay + getExecutionTime(Command::AutoRefresh, payload)); unsigned int row = DramExtension::getExtension(payload).getRow().ID(); - if (ErrorStoreMode == ErrorStorageMode::ErrorModel) + if (StoreMode == StorageMode::ErrorModel) { ememory[bank]->refresh(row); } @@ -541,7 +541,7 @@ struct Dram : sc_module assert(trans.get_data_length() == bytesPerBurst); // TODO: This part is not tested yet, neither with traceplayers neither with GEM5 coupling - if (ErrorStoreMode == ErrorStorageMode::NoStorage) + if (StoreMode == StorageMode::NoStorage) { SC_REPORT_FATAL("DRAM", "Debug Transport is used in combination with NoStorage"); } @@ -557,10 +557,10 @@ struct Dram : sc_module if ( cmd == tlm::TLM_READ_COMMAND ) { - if (ErrorStoreMode == ErrorStorageMode::Store) // Use Storage + if (StoreMode == StorageMode::Store) // Use Storage { unsigned char *phyAddr = memory + trans.get_address(); - memcpy(trans.get_data_ptr(), phyAddr, trans.get_data_length()); + memcpy(ptr, phyAddr, trans.get_data_length()); } else { @@ -571,10 +571,10 @@ struct Dram : sc_module else if ( cmd == tlm::TLM_WRITE_COMMAND ) { - if (ErrorStoreMode == ErrorStorageMode::Store) // Use Storage + if (StoreMode == StorageMode::Store) // Use Storage { unsigned char *phyAddr = memory + trans.get_address(); - memcpy(phyAddr, trans.get_data_ptr(), trans.get_data_length()); + memcpy(phyAddr, ptr, trans.get_data_length()); } else { diff --git a/DRAMSys/simulator/src/simulation/Simulation.cpp b/DRAMSys/simulator/src/simulation/Simulation.cpp index 947e1c33..d1adf4aa 100644 --- a/DRAMSys/simulator/src/simulation/Simulation.cpp +++ b/DRAMSys/simulator/src/simulation/Simulation.cpp @@ -51,7 +51,7 @@ #include "../simulation/TemperatureController.h" #include "../controller/Controller.h" -#define USE_EXAMPLE_INITIATOR 0 +#define USE_EXAMPLE_INITIATOR 1 using namespace std; @@ -125,7 +125,7 @@ void Simulation::instantiateModules(const string &traceName, const string &pathT // When data should be stored during the simulation the StlDataPlayer is needed. // Else: no data should be stored, for instance to get a faster simulation // or if you simply dont care about the data the normal StlPlayer is used. - if(Configuration::getInstance().ErrorStoreMode == ErrorStorageMode::NoStorage) + if(Configuration::getInstance().StoreMode == StorageMode::NoStorage) { StlPlayer *newPlayer = new StlPlayer(playerStr.c_str(), pathToResources + string("traces/") + devices[i].trace, devices[i].clkMhz, this); player = newPlayer; diff --git a/DRAMSys/tests/error/fr_fcfs.xml b/DRAMSys/tests/error/fr_fcfs.xml index 04104bb3..f5a42db0 100644 --- a/DRAMSys/tests/error/fr_fcfs.xml +++ b/DRAMSys/tests/error/fr_fcfs.xml @@ -1,21 +1,23 @@ - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/DRAMSys/tests/simple/fifoStrict.xml b/DRAMSys/tests/simple/fifoStrict.xml index dda1dd24..270d9037 100644 --- a/DRAMSys/tests/simple/fifoStrict.xml +++ b/DRAMSys/tests/simple/fifoStrict.xml @@ -1,13 +1,15 @@ - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/README.md b/README.md index a85fa5cd..c8d4551a 100644 --- a/README.md +++ b/README.md @@ -377,7 +377,8 @@ Enable the error model in fr_fcfs.xml. - + + ``` @@ -638,7 +639,7 @@ Below are listed the configuration sections and configuration fields. - + ``` @@ -673,7 +674,7 @@ Below are listed the configuration sections and configuration fields. - Seed to initialize the random error generator. - *ErrorCSVFile* (string) - CSV file with error injection information. - - *ErrorStoreMode* (enum ErrorStorageMode) + - *StoreMode* (enum StorageMode) - "NoStorage": no storage - "Store": store data without error model - "ErrorModel": store data with error model [6]