diff --git a/DRAMSys/library/library.pro b/DRAMSys/library/library.pro
index 095f0c77..88b450ef 100644
--- a/DRAMSys/library/library.pro
+++ b/DRAMSys/library/library.pro
@@ -139,7 +139,8 @@ SOURCES += \
src/configuration/memspec/MemSpecWideIO.cpp \
src/configuration/memspec/MemSpecLPDDR4.cpp \
src/controller/checker/CheckerDDR4.cpp \
- src/simulation/DramLPDDR4.cpp
+ src/simulation/DramLPDDR4.cpp \
+ src/controller/checker/CheckerLPDDR4.cpp
HEADERS += \
src/common/third_party/tinyxml2/tinyxml2.h \
@@ -212,7 +213,8 @@ HEADERS += \
src/configuration/memspec/MemSpecDDR4.h \
src/configuration/memspec/MemSpecLPDDR4.h \
src/controller/checker/CheckerDDR4.h \
- src/simulation/DramLPDDR4.h
+ src/simulation/DramLPDDR4.h \
+ src/controller/checker/CheckerLPDDR4.h
#src/common/third_party/json/include/nlohmann/json.hpp \
thermalsim = $$(THERMALSIM)
diff --git a/DRAMSys/library/resources/configs/simulator/lpddr4.xml b/DRAMSys/library/resources/configs/simulator/lpddr4.xml
new file mode 100644
index 00000000..87b02763
--- /dev/null
+++ b/DRAMSys/library/resources/configs/simulator/lpddr4.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/DRAMSys/library/resources/simulations/lpddr4-example.xml b/DRAMSys/library/resources/simulations/lpddr4-example.xml
new file mode 100644
index 00000000..6f227578
--- /dev/null
+++ b/DRAMSys/library/resources/simulations/lpddr4-example.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ddr3_example.stl
+
+
diff --git a/DRAMSys/library/src/common/TlmRecorder.cpp b/DRAMSys/library/src/common/TlmRecorder.cpp
index 97c6709b..8944286e 100644
--- a/DRAMSys/library/src/common/TlmRecorder.cpp
+++ b/DRAMSys/library/src/common/TlmRecorder.cpp
@@ -358,21 +358,21 @@ void TlmRecorder::insertCommandLengths()
{
MemSpec *memSpec = Configuration::getInstance().memSpec;
- sqlite3_bind_int(insertCommandLengthsStatement, 1, memSpec->clACT);
- sqlite3_bind_int(insertCommandLengthsStatement, 2, memSpec->clPRE);
- sqlite3_bind_int(insertCommandLengthsStatement, 3, memSpec->clPREA);
- sqlite3_bind_int(insertCommandLengthsStatement, 4, memSpec->clRD);
- sqlite3_bind_int(insertCommandLengthsStatement, 5, memSpec->clRDA);
- sqlite3_bind_int(insertCommandLengthsStatement, 6, memSpec->clWR);
- sqlite3_bind_int(insertCommandLengthsStatement, 7, memSpec->clWRA);
- sqlite3_bind_int(insertCommandLengthsStatement, 8, memSpec->clREFA);
- sqlite3_bind_int(insertCommandLengthsStatement, 9, memSpec->clREFB);
- sqlite3_bind_int(insertCommandLengthsStatement, 10, memSpec->clPDEA);
- sqlite3_bind_int(insertCommandLengthsStatement, 11, memSpec->clPDXA);
- sqlite3_bind_int(insertCommandLengthsStatement, 12, memSpec->clPDEP);
- sqlite3_bind_int(insertCommandLengthsStatement, 13, memSpec->clPDXP);
- sqlite3_bind_int(insertCommandLengthsStatement, 14, memSpec->clSREFEN);
- sqlite3_bind_int(insertCommandLengthsStatement, 15, memSpec->clSREFEX);
+ sqlite3_bind_int(insertCommandLengthsStatement, 1, memSpec->commandLength[Command::ACT]);
+ sqlite3_bind_int(insertCommandLengthsStatement, 2, memSpec->commandLength[Command::PRE]);
+ sqlite3_bind_int(insertCommandLengthsStatement, 3, memSpec->commandLength[Command::PREA]);
+ sqlite3_bind_int(insertCommandLengthsStatement, 4, memSpec->commandLength[Command::RD]);
+ sqlite3_bind_int(insertCommandLengthsStatement, 5, memSpec->commandLength[Command::RDA]);
+ sqlite3_bind_int(insertCommandLengthsStatement, 6, memSpec->commandLength[Command::WR]);
+ sqlite3_bind_int(insertCommandLengthsStatement, 7, memSpec->commandLength[Command::WRA]);
+ sqlite3_bind_int(insertCommandLengthsStatement, 8, memSpec->commandLength[Command::REFA]);
+ sqlite3_bind_int(insertCommandLengthsStatement, 9, memSpec->commandLength[Command::REFB]);
+ sqlite3_bind_int(insertCommandLengthsStatement, 10, memSpec->commandLength[Command::PDEA]);
+ sqlite3_bind_int(insertCommandLengthsStatement, 11, memSpec->commandLength[Command::PDXA]);
+ sqlite3_bind_int(insertCommandLengthsStatement, 12, memSpec->commandLength[Command::PDEP]);
+ sqlite3_bind_int(insertCommandLengthsStatement, 13, memSpec->commandLength[Command::PDXP]);
+ sqlite3_bind_int(insertCommandLengthsStatement, 14, memSpec->commandLength[Command::SREFEN]);
+ sqlite3_bind_int(insertCommandLengthsStatement, 15, memSpec->commandLength[Command::SREFEX]);
executeSqlStatement(insertCommandLengthsStatement);
}
diff --git a/DRAMSys/library/src/configuration/memspec/MemSpec.cpp b/DRAMSys/library/src/configuration/memspec/MemSpec.cpp
index 1dd1c790..d7e77ab3 100644
--- a/DRAMSys/library/src/configuration/memspec/MemSpec.cpp
+++ b/DRAMSys/library/src/configuration/memspec/MemSpec.cpp
@@ -42,6 +42,11 @@
using namespace tlm;
+MemSpec::MemSpec()
+{
+ commandLength = std::vector(numberOfCommands(), 1);
+}
+
const std::vector &MemSpec::getBanks() const
{
static std::vector banks;
@@ -62,6 +67,11 @@ sc_time MemSpec::getWriteAccessTime() const
return clk * (BurstLength / DataRate);
}
+unsigned MemSpec::getCommandLength(Command command) const
+{
+ return commandLength[command];
+}
+
//sc_time MemSpec::getMinExecutionTimeForPowerDownCmd(Command command) const
//{
// if (command == Command::PDEA || command == Command::PDEP)
diff --git a/DRAMSys/library/src/configuration/memspec/MemSpec.h b/DRAMSys/library/src/configuration/memspec/MemSpec.h
index 687eedb9..84ae02ba 100644
--- a/DRAMSys/library/src/configuration/memspec/MemSpec.h
+++ b/DRAMSys/library/src/configuration/memspec/MemSpec.h
@@ -39,7 +39,7 @@
#define MEMSPEC_H
#include
-#include