From a1671cf83af8032355ec13cae2a4141acd39a80b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89der=20Ferreira=20Zulian?= Date: Wed, 29 Jul 2015 15:17:17 +0200 Subject: [PATCH] Small changes and fixes Bringing some changes from packet_buffering branch to the master branch. --- DRAMSys/dramSys/src/common/TlmRecorder.h | 2 +- .../core/powerdown/PowerDownManagerTimeout.h | 2 +- DRAMSys/dramSys/src/error/flip_memory.cpp | 13 ++++++++++--- DRAMSys/dramSys/src/error/nest_map.cpp | 2 +- DRAMSys/dramSys/src/simulation/Dram.h | 4 ++-- DRAMSys/dramSys/src/simulation/main.cpp | 3 ++- 6 files changed, 17 insertions(+), 9 deletions(-) diff --git a/DRAMSys/dramSys/src/common/TlmRecorder.h b/DRAMSys/dramSys/src/common/TlmRecorder.h index c20c90e6..f302042c 100644 --- a/DRAMSys/dramSys/src/common/TlmRecorder.h +++ b/DRAMSys/dramSys/src/common/TlmRecorder.h @@ -130,7 +130,7 @@ private: sc_time simulationTimeCoveredByRecording; std::vector transactionTerminatingPhases; - sqlite3 *db; + sqlite3 *db = NULL; sqlite3_stmt *insertTransactionStatement, *insertRangeStatement, *updateRangeStatement, *insertPhaseStatement, *updatePhaseStatement, *insertGeneralInfoStatement, *insertDebugMessageStatement, *updateDataStrobeStatement; std::string insertTransactionString, insertRangeString, updateRangeString, insertPhaseString, updatePhaseString, insertGeneralInfoString, diff --git a/DRAMSys/dramSys/src/controller/core/powerdown/PowerDownManagerTimeout.h b/DRAMSys/dramSys/src/controller/core/powerdown/PowerDownManagerTimeout.h index 1b077fcc..e0b9ab0f 100644 --- a/DRAMSys/dramSys/src/controller/core/powerdown/PowerDownManagerTimeout.h +++ b/DRAMSys/dramSys/src/controller/core/powerdown/PowerDownManagerTimeout.h @@ -66,7 +66,7 @@ private: std::map powerDownPayloads; void sendPowerDownPayloads(ScheduledCommand& cmd); - PowerDownState powerDownState; + PowerDownState powerDownState = PowerDownState::Awake; void setPowerDownState(PowerDownState state); bool isInPowerDown(); }; diff --git a/DRAMSys/dramSys/src/error/flip_memory.cpp b/DRAMSys/dramSys/src/error/flip_memory.cpp index cd07f346..c65d15c7 100644 --- a/DRAMSys/dramSys/src/error/flip_memory.cpp +++ b/DRAMSys/dramSys/src/error/flip_memory.cpp @@ -90,7 +90,15 @@ flip_memory::flip_memory() flip_memory::~flip_memory() { - cout << endl << endl << endl << "Bit-Fehler: " << BIT_ERR << endl << endl << endl; + cout << endl << endl << endl << "Bit-Fehler: " << BIT_ERR << endl << endl << endl; + unsigned int maxWeakCells = errormap->getMaxWeakCells(); + for (unsigned int i = 0; i < maxWeakCells; i++) { + delete[] weakCells[i]; + } + + delete[] weakCells; + delete errormap; + } DecodedAddress flip_memory::getUnifiedNode(unsigned int addr) @@ -113,7 +121,7 @@ void flip_memory::initWeakCells() { unsigned int row, col, bit; - weakCells[i] = new unsigned int[4]; + weakCells[i] = new unsigned int[5]; row = (unsigned int) (rand() % ROWS_PER_BANK); col = (unsigned int) (rand() % COLS_PER_ROW); @@ -241,7 +249,6 @@ void flip_memory::load(tlm::tlm_generic_payload &trans) DecodedAddress no; no = getUnifiedNode(t_addr); - if (mem.count(t_addr) > 0) { for (unsigned int i = 0; i < t_len; i += BYTES_PER_COL) diff --git a/DRAMSys/dramSys/src/error/nest_map.cpp b/DRAMSys/dramSys/src/error/nest_map.cpp index 8355c684..f0bb4176 100644 --- a/DRAMSys/dramSys/src/error/nest_map.cpp +++ b/DRAMSys/dramSys/src/error/nest_map.cpp @@ -47,7 +47,7 @@ nest_map::nest_map(string fn) nest_map::~nest_map(void) { - delete tr; + delete[] tr; } // Read data from CSV file with filename "fn" and store it inside the errormap instance diff --git a/DRAMSys/dramSys/src/simulation/Dram.h b/DRAMSys/dramSys/src/simulation/Dram.h index f4f1fe44..9ecc1fbb 100644 --- a/DRAMSys/dramSys/src/simulation/Dram.h +++ b/DRAMSys/dramSys/src/simulation/Dram.h @@ -188,8 +188,8 @@ struct Dram : sc_module cout << "BIT_ERRORS Bank: " < 1) simulationToRun = argv[1]; else simulationToRun = resources + "simulations/sim-batch.xml"; + cout << "Simulation file is " << simulationToRun << endl; SimulationManager manager(resources); manager.loadSimulationsFromXML(simulationToRun);