diff --git a/DRAMSys/analyzer/paths.pro b/DRAMSys/analyzer/paths.pro index b19fe4eb..df8d2f74 100644 --- a/DRAMSys/analyzer/paths.pro +++ b/DRAMSys/analyzer/paths.pro @@ -1,15 +1,39 @@ -#This file has to be included after CONFIG has been adjusted and before the path variables are used -#It has to be adjusted to your paths +# This file has to be included after CONFIG has been adjusted and before the +# path variables are used. +# It has to be adjusted to your paths or at your choice set the proper +# environment variables to reflect your paths. + +libqwt_home = $$(LIBQWT_HOME) +isEmpty(libqwt_home) { + libqwt_home = /opt/qwt/lib +} +message(LIBQWT path is $${libqwt_home}) + +libqwt_headers = $$(LIBQWT_HEADERS) +isEmpty(libqwt_headers) { + libqwt_headers = /opt/qwt/include +} +message(Getting LIBQWT headers from $${libqwt_headers}) CONFIG(qwt){ - LIBS += -L/opt/qwt/lib/ -lqwt -lutil - INCLUDEPATH += /opt/qwt/include + LIBS += -L$${libqwt_home}/ -lqwt -lutil + INCLUDEPATH += $${libqwt_headers} } +python_home = $$(PYTHON_HOME) +isEmpty(python_home) { + python_home = /opt/python/lib +} +message(Python home is $${python_home}) + +python_headers = $$(PYTHON_HEADERS) +isEmpty(python_headers) { + python_headers = /opt/python/include/python3.4m +} +message(Getting python headers from $${python_headers}) CONFIG(python){ - LIBS += -L/opt/python/lib -lpython3.4m - INCLUDEPATH += /opt/python/include/python3.4m -# LIBS += -lpython3.3m -# INCLUDEPATH += /usr/include/python3.3 + LIBS += -L$${python_home} -lpython3.4m + INCLUDEPATH += $${python_headers} } + diff --git a/DRAMSys/simulator/resources/configs/memconfigs/fifo.xml b/DRAMSys/simulator/resources/configs/memconfigs/fifo.xml index 03ba02c7..98e7786d 100644 --- a/DRAMSys/simulator/resources/configs/memconfigs/fifo.xml +++ b/DRAMSys/simulator/resources/configs/memconfigs/fifo.xml @@ -8,6 +8,6 @@ - + diff --git a/DRAMSys/simulator/resources/configs/memconfigs/fifoStrict.xml b/DRAMSys/simulator/resources/configs/memconfigs/fifoStrict.xml index a1b0749e..dda1dd24 100644 --- a/DRAMSys/simulator/resources/configs/memconfigs/fifoStrict.xml +++ b/DRAMSys/simulator/resources/configs/memconfigs/fifoStrict.xml @@ -8,6 +8,6 @@ - + diff --git a/DRAMSys/simulator/simulator.pro b/DRAMSys/simulator/simulator.pro index 3c908dbe..9741a915 100644 --- a/DRAMSys/simulator/simulator.pro +++ b/DRAMSys/simulator/simulator.pro @@ -7,27 +7,53 @@ CONFIG -= qt system(cd ../../DRAMSys/simulator/src/common/third_party/DRAMPower; make lib;) -LIBS += -L/opt/systemc/lib-linux64 -lsystemc -LIBS += -L/opt/boost/lib -lboost_filesystem -lboost_system +systemc_home = $$(SYSTEMC_HOME) +isEmpty(systemc_home) { + systemc_home = /opt/systemc +} +message(SystemC home is $${systemc_home}) + +systemc_target_arch = $$(SYSTEMC_TARGET_ARCH) +isEmpty(systemc_target_arch) { + systemc_target_arch = linux64 +} +message(SystemC target architecture is $${systemc_target_arch}) + +QMAKE_RPATHDIR += $${systemc_home}/lib-$${systemc_target_arch} +message(Linker options QMAKE_RPATHDIR is $${QMAKE_RPATHDIR}) + +libboost_home = $$(LIBBOOST_HOME) +isEmpty(libboost_home) { + libboost_home = /opt/boost/lib +} +message(LIBBOOST home is $${libboost_home}) + +LIBS += -L$${systemc_home}/lib-$${systemc_target_arch} -lsystemc +LIBS += -L$${libboost_home} -lboost_filesystem -lboost_system LIBS += -lsqlite3 LIBS += -lpthread LIBS += -L../../DRAMSys/simulator/src/common/third_party/DRAMPower/src/ -ldrampower -INCLUDEPATH += /opt/systemc/include -INCLUDEPATH += /opt/boost/include +libboost_headers = $$(LIBBOOST_HEADERS) +isEmpty(libboost_headers) { + libboost_headers = /opt/boost/include +} +message(Getting LIBOOST headers from $${libboost_headers}) + +INCLUDEPATH += $${systemc_home}/include +INCLUDEPATH += $${libboost_headers} INCLUDEPATH += src/common/third_party/DRAMPower/src INCLUDEPATH += src/common/third_party/DRAMPower/src/libdrampower - DEFINES += TIXML_USE_STL DEFINES += SC_INCLUDE_DYNAMIC_PROCESSES release { DEFINES += NDEBUG } -QMAKE_CXXFLAGS += -std=c++11 -QMAKE_CXXFLAGS += -isystem /opt/systemc/include -QMAKE_CXXFLAGS += -isystem /opt/boost/include +QMAKE_CXXFLAGS += -std=c++11 -O0 -g +QMAKE_CXXFLAGS += -isystem $${systemc_home}/include +QMAKE_CXXFLAGS += -isystem $${libboost_headers} SOURCES += \ src/common/third_party/tinyxml2/tinyxml2.cpp \ @@ -142,14 +168,26 @@ isEmpty(thermalsim) { $$eval(thermalsim) { message(Thermal Simulation Feature Enabled) - LIBS += -L/opt/3D-ICE/lib -lthreed-ice-2.2.5 - LIBS += -L/opt/SuperLU_4.3/lib -lsuperlu_4.3 + libthreed_ice_home = $$(LIBTHREED_ICE_HOME) + isEmpty(libthreed_ice_home) { + libthreed_ice_home = /opt/3D-ICE/ + } + message(LIBTHREED_ICE_HOME path is $${libthreed_ice_home}) + + libsuperlu_home = $$(LIBSUPERLU_HOME) + isEmpty(libsuperlu_home) { + libsuperlu_home = /opt/SuperLU_4.3/ + } + message(LIBSUPERLU_HOME path is $${libthreed_ice_home}) + + LIBS += -L$${libthreed_ice_home}/lib -lthreed-ice-2.2.5 + LIBS += -L$${libsuperlu_home}/lib -lsuperlu_4.3 LIBS += -lblas message(Libraries: $${LIBS}) - INCLUDEPATH += /opt/3D-ICE/include - INCLUDEPATH += /opt/SuperLU_4.3/SRC - INCLUDEPATH += /opt/systemc/include + INCLUDEPATH += $${libthreed_ice_home}/include + INCLUDEPATH += $${libsuperlu_home}/SRC + INCLUDEPATH += $${systemc_home}/include INCLUDEPATH += src/common/third_party/icewrapper message(Include paths: $${INCLUDEPATH}) diff --git a/DRAMSys/simulator/src/common/third_party/icewrapper b/DRAMSys/simulator/src/common/third_party/icewrapper index 2179c985..37cde24d 160000 --- a/DRAMSys/simulator/src/common/third_party/icewrapper +++ b/DRAMSys/simulator/src/common/third_party/icewrapper @@ -1 +1 @@ -Subproject commit 2179c985a0692e7ab5ec58c35eb7fa69f34c2252 +Subproject commit 37cde24d8fee904e8875ec48dc0b0ebe87fd2d9a diff --git a/DRAMSys/simulator/src/controller/Controller.h b/DRAMSys/simulator/src/controller/Controller.h index a45df0c9..e081b518 100644 --- a/DRAMSys/simulator/src/controller/Controller.h +++ b/DRAMSys/simulator/src/controller/Controller.h @@ -43,11 +43,12 @@ #include #include -#include "/opt/systemc-2.3.0/include/systemc" -#include "/opt/systemc-2.3.0/include/tlm" -#include "/opt/systemc-2.3.0/include/tlm_utils/peq_with_cb_and_phase.h" -#include "/opt/systemc-2.3.0/include/tlm_utils/simple_initiator_socket.h" -#include "/opt/systemc-2.3.0/include/tlm_utils/simple_target_socket.h" +#include +#include +#include +#include +#include + #include "../common/dramExtension.h" #include "../common/DebugManager.h" #include "../common/protocol.h" diff --git a/DRAMSys/simulator/src/simulation/StlDataPlayer.h b/DRAMSys/simulator/src/simulation/StlDataPlayer.h index 16905881..fbe6a67a 100644 --- a/DRAMSys/simulator/src/simulation/StlDataPlayer.h +++ b/DRAMSys/simulator/src/simulation/StlDataPlayer.h @@ -89,7 +89,7 @@ public: payload->set_data_ptr(dataElement); // set data: - for(int i = 0; i < bytesPerColumn*burstlength ; i++) + for(unsigned i = 0; i < bytesPerColumn*burstlength ; i++) { dataElement[i] = (unsigned char)std::stoi(data.substr(i*2,2).c_str(),0,16); } diff --git a/DRAMSys/simulator/src/simulation/TracePlayer.h b/DRAMSys/simulator/src/simulation/TracePlayer.h index a376a93a..1c2b250b 100644 --- a/DRAMSys/simulator/src/simulation/TracePlayer.h +++ b/DRAMSys/simulator/src/simulation/TracePlayer.h @@ -113,7 +113,7 @@ void TracePlayer::setDataPointer(gp* payload, unsigned char * dataElem //check if payload takes ownership payload->set_data_length(size); payload->set_data_ptr(dataElement); - for(int i = 0; i < size; i++) + for(unsigned i = 0; i < size; i++) dataElement[i] = 0; } diff --git a/README.md b/README.md index 5bff33c3..217d2ef4 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ de.uni-kl.ems.dram.vp.system ============================ -Generic DRAM controller simulator **DRAMSys** [1] and related tools. +**DRAMSys** [1] is a flexible DRAM subsystem design space exploration +framework that consists of models reflecting the DRAM functionality, power +consumption, temperature behaviour and retention time errors. ## Basic Setup @@ -57,6 +59,90 @@ $ git merge upstream/master $ git push origin HEAD ``` +### Dependencies + +Make sure you have properly installed in your system the required libraries. +They are: + +- SystemC 2.3.1 and TLM 2.0 + + The sources can be downloaded from http://accellera.org/downloads/standards/systemc. + + For installation instructions see the installation notes file contained in + the release package. + +- qwt-6.1.3 + + ```bash + $ svn checkout svn://svn.code.sf.net/p/qwt/code/branches/qwt-6.1 + $ cd qwt-6.1 + $ qmake qwt.pro + $ make + $ sudo make install + ``` + + For further information refer to http://qwt.sourceforge.net/ + +- python3.4 + + In Debian like distros: + + ```bash + $ sudo apt-get install python3.4 + ``` + +- libboost_filesystem and libboost_system + + In Debian like distros: + + ```bash + $ sudo apt-get install libboost-all-dev + ``` + +- Others + + Some basic libraries may be already installed in your system. If not you can + install the following packages or equivalent ones for your distro. In Debian + like distros: + + ```bash + $ sudo apt-get install libc6 + $ sudo apt-get install libstdc++6 + $ sudo apt-get install sqlite3 + $ sudo apt-get install libsqlite3-dev + $ sudo apt-get install libqt5gui5 + $ sudo apt-get install libqt5sql5 + $ sudo apt-get install libqt5widgets5 + $ sudo apt-get install libqt5core5a + ``` + +To grant flexibility to the user the paths where to find some essential +libraries and headers can be specified with environment variables. You can add +such variables to you ~/.bashrc file or equivalent. + +```bash +# SystemC home and target architecture +export SYSTEMC_HOME= +export SYSTEMC_TARGET_ARCH=<[linux,linux64]> + +# DRAMSys libraries and headers +export PYTHON_HOME= +export PYTHON_HEADERS= +export LIBQWT_HOME= +export LIBQWT_HEADERS= +export LIBBOOST_HOME= +export LIBBOOST_HEADERS= +``` + +Users interested in thermal simulation can also add some extra environment +variables: + +```bash +# Necessary for thermal simulation +export LIBTHREED_ICE_HOME= +export LIBSUPERLU_HOME= +``` + ### Buiding with QTCreator Execute the *QTCreator*. @@ -228,7 +314,7 @@ Enable the error model in fr_fcfs.xml. - + @@ -478,11 +564,11 @@ Below are listed the configuration sections and configuration fields. - + - + ```