diff --git a/DRAMSys/library/src/configuration/Configuration.cpp b/DRAMSys/library/src/configuration/Configuration.cpp index e7cf4209..41d8a994 100644 --- a/DRAMSys/library/src/configuration/Configuration.cpp +++ b/DRAMSys/library/src/configuration/Configuration.cpp @@ -38,8 +38,6 @@ * Luiza Correa */ -#include - #include "Configuration.h" #include "memspec/MemSpecDDR3.h" #include "memspec/MemSpecDDR4.h" @@ -227,15 +225,6 @@ void Configuration::setParameter(const std::string &name, const nlohmann::json & useMalloc = value; else if (name == "CheckTLM2Protocol") checkTLM2Protocol = value; - else if (name == "ECCControllerMode") - { - if (value == "Disabled") - eccMode = ECCMode::Disabled; - else if (value == "Hamming") - eccMode = ECCMode::Hamming; - else - SC_REPORT_FATAL("Configuration", "Unsupported ECC mode!"); - } // Specification for ErrorChipSeed, ErrorCSVFile path and StoreMode else if (name == "ErrorChipSeed") errorChipSeed = value; @@ -294,19 +283,6 @@ void Configuration::setPathToResources(const std::string &path) temperatureSim.setPathToResources(path); } -// Changes the number of bytes depeding on the ECC Controller. This function is needed for modules which get data directly or indirectly from the ECC Controller -unsigned int Configuration::adjustNumBytesAfterECC(unsigned nBytes) const -{ - // Manipulate the number of bytes only if there is an ECC Controller selected - if (eccMode == ECCMode::Disabled) - return nBytes; - else // if (eccMode == ECCMode::Hamming) - { - assert(pECC != nullptr); - return pECC->AllocationSize(nBytes); - } -} - void Configuration::loadSimConfig(Configuration &config, const std::string &simconfigUri) { json doc = parseJSON(simconfigUri); diff --git a/DRAMSys/library/src/configuration/Configuration.h b/DRAMSys/library/src/configuration/Configuration.h index a7538f24..71f590eb 100644 --- a/DRAMSys/library/src/configuration/Configuration.h +++ b/DRAMSys/library/src/configuration/Configuration.h @@ -45,7 +45,6 @@ #include #include "memspec/MemSpec.h" -#include "../error/eccbaseclass.h" #include "TemperatureSimConfig.h" class Configuration @@ -97,8 +96,6 @@ public: bool thermalSimulation = false; bool simulationProgressBar = false; bool checkTLM2Protocol = false; - enum class ECCMode {Disabled, Hamming} eccMode = ECCMode::Disabled; - ECCBaseClass *pECC = nullptr; bool useMalloc = false; unsigned long long int addressOffset = 0; @@ -115,7 +112,6 @@ public: // Temperature Simulation related TemperatureSimConfig temperatureSim; - unsigned int adjustNumBytesAfterECC(unsigned bytes) const; void setPathToResources(const std::string &path); static void loadMCConfig(Configuration &config, const std::string &_mcconfigUri); diff --git a/DRAMSys/library/src/error/errormodel.cpp b/DRAMSys/library/src/error/errormodel.cpp index b44b463d..51e72a2b 100644 --- a/DRAMSys/library/src/error/errormodel.cpp +++ b/DRAMSys/library/src/error/errormodel.cpp @@ -58,8 +58,7 @@ void errorModel::init() bytesPerColumn = std::log2(Configuration::getInstance().memSpec->dataBusWidth); // Adjust number of bytes per column dynamically to the selected ecc controller - bytesPerColumn = Configuration::getInstance().adjustNumBytesAfterECC( - bytesPerColumn); + //TODO: bytesPerColumn = Configuration::getInstance().adjustNumBytesAfterECC(bytesPerColumn); numberOfRows = Configuration::getInstance().memSpec->numberOfRows; numberOfBitErrorEvents = 0; diff --git a/DRAMSys/library/src/simulation/DRAMSys.cpp b/DRAMSys/library/src/simulation/DRAMSys.cpp index 796a46d1..f4b7f96d 100644 --- a/DRAMSys/library/src/simulation/DRAMSys.cpp +++ b/DRAMSys/library/src/simulation/DRAMSys.cpp @@ -74,9 +74,6 @@ DRAMSys::DRAMSys(const sc_core::sc_module_name &name, bool initAndBind) : sc_module(name), tSocket("DRAMSys_tSocket") { - // Initialize ecc pointer - ecc = nullptr; - logo(); // Read Configuration Setup: @@ -121,8 +118,6 @@ DRAMSys::DRAMSys(const sc_core::sc_module_name &name, DRAMSys::~DRAMSys() { - delete ecc; - delete arbiter; for (auto dram : drams) @@ -182,15 +177,6 @@ void DRAMSys::instantiateModules(const std::string &pathToResources, TemperatureController::getInstance(); Configuration &config = Configuration::getInstance(); - // Create new ECC Controller - if (config.eccMode == Configuration::ECCMode::Hamming) - ecc = new ECCHamming("ECCHamming"); - else if (config.eccMode == Configuration::ECCMode::Disabled) - ecc = nullptr; - - // Save ECC Controller into the configuration struct to adjust it dynamically - config.pECC = ecc; - // Create arbiter if (config.arbiter == Configuration::Arbiter::Simple) arbiter = new ArbiterSimple("arbiter", pathToResources + "configs/amconfigs/" + amconfig); @@ -241,8 +227,7 @@ void DRAMSys::instantiateModules(const std::string &pathToResources, if (Configuration::getInstance().checkTLM2Protocol) { str = "TLMCheckerController" + std::to_string(i); - tlm_utils::tlm2_base_protocol_checker<> *controllerTlmChecker = - new tlm_utils::tlm2_base_protocol_checker<>(str.c_str()); + auto* controllerTlmChecker = new tlm_utils::tlm2_base_protocol_checker<>(str.c_str()); controllersTlmCheckers.push_back(controllerTlmChecker); } } @@ -252,15 +237,7 @@ void DRAMSys::bindSockets() { Configuration &config = Configuration::getInstance(); - // If ECC Controller enabled, put it between Trace and arbiter - if (config.eccMode == Configuration::ECCMode::Hamming) - { - assert(ecc != nullptr); - tSocket.bind(ecc->t_socket); - ecc->i_socket.bind(arbiter->tSocket); - } - else if (config.eccMode == Configuration::ECCMode::Disabled) - tSocket.bind(arbiter->tSocket); + tSocket.bind(arbiter->tSocket); if (config.checkTLM2Protocol) { diff --git a/DRAMSys/library/src/simulation/DRAMSys.h b/DRAMSys/library/src/simulation/DRAMSys.h index cb6063c9..1f17d9a6 100644 --- a/DRAMSys/library/src/simulation/DRAMSys.h +++ b/DRAMSys/library/src/simulation/DRAMSys.h @@ -77,9 +77,6 @@ protected: std::vector*> controllersTlmCheckers; - // All transactions pass first through the ECC Controller - ECCBaseClass *ecc; - // TODO: Each DRAM has a reorder buffer (check this!) ReorderBuffer *reorder; diff --git a/DRAMSys/library/src/simulation/DRAMSysRecordable.cpp b/DRAMSys/library/src/simulation/DRAMSysRecordable.cpp index 62fbc6b1..a11dc841 100644 --- a/DRAMSys/library/src/simulation/DRAMSysRecordable.cpp +++ b/DRAMSys/library/src/simulation/DRAMSysRecordable.cpp @@ -102,8 +102,7 @@ void DRAMSysRecordable::setupTlmRecorders(const std::string &traceName) std::string recorderName = "tlmRecorder" + std::to_string(i); - TlmRecorder *tlmRecorder = - new TlmRecorder(recorderName, dbName); + auto* tlmRecorder = new TlmRecorder(recorderName, dbName); tlmRecorder->recordMcConfig(Configuration::mcconfigUri); tlmRecorder->recordMemspec(Configuration::memspecUri); @@ -128,15 +127,6 @@ void DRAMSysRecordable::instantiateModules(const std::string &traceName, // They need to be ready before creating some modules. setupTlmRecorders(traceName); - // Create new ECC Controller - if (config.eccMode == Configuration::ECCMode::Hamming) - ecc = new ECCHamming("ECCHamming"); - else if (config.eccMode == Configuration::ECCMode::Disabled) - ecc = nullptr; - - // Save ECC Controller into the configuration struct to adjust it dynamically - config.pECC = ecc; - // Create arbiter if (config.arbiter == Configuration::Arbiter::Simple) arbiter = new ArbiterSimple("arbiter", pathToResources + "configs/amconfigs/" + amconfig); @@ -187,8 +177,7 @@ void DRAMSysRecordable::instantiateModules(const std::string &traceName, if (config.checkTLM2Protocol) { str = "TLMCheckerController" + std::to_string(i); - tlm_utils::tlm2_base_protocol_checker<> *controllerTlmChecker = - new tlm_utils::tlm2_base_protocol_checker<>(str.c_str()); + auto* controllerTlmChecker = new tlm_utils::tlm2_base_protocol_checker<>(str.c_str()); controllersTlmCheckers.push_back(controllerTlmChecker); } } @@ -198,15 +187,7 @@ void DRAMSysRecordable::bindSockets() { Configuration &config = Configuration::getInstance(); - // If ECC Controller enabled, put it between Trace and arbiter - if (config.eccMode == Configuration::ECCMode::Hamming) - { - assert(ecc != nullptr); - tSocket.bind(ecc->t_socket); - ecc->i_socket.bind(arbiter->tSocket); - } - else if (config.eccMode == Configuration::ECCMode::Disabled) - tSocket.bind(arbiter->tSocket); + tSocket.bind(arbiter->tSocket); if (config.checkTLM2Protocol) { diff --git a/DRAMSys/library/src/simulation/dram/Dram.cpp b/DRAMSys/library/src/simulation/dram/Dram.cpp index c5c14d28..a578e6af 100644 --- a/DRAMSys/library/src/simulation/dram/Dram.cpp +++ b/DRAMSys/library/src/simulation/dram/Dram.cpp @@ -65,8 +65,6 @@ using namespace DRAMPower; Dram::Dram(const sc_module_name &name) : sc_module(name), tSocket("socket") { Configuration &config = Configuration::getInstance(); - // Adjust number of bytes per burst dynamically to the selected ecc controller - bytesPerBurst = config.adjustNumBytesAfterECC(bytesPerBurst); storeMode = config.storeMode;