From 3cf07166d2f65a13712b535a7961fe8e882168a9 Mon Sep 17 00:00:00 2001 From: Matthias Jung Date: Sun, 19 Feb 2017 20:34:04 +0100 Subject: [PATCH] Morphed project into library --- DRAMSys/{dram.vp.system.pro => DRAMSys.pro} | 4 +- DRAMSys/simulator/library.pro | 215 ++++++++++++++++++ DRAMSys/simulator/simulator.pro | 200 +--------------- .../simulator/src/simulation/TraceSetup.cpp | 1 - 4 files changed, 223 insertions(+), 197 deletions(-) rename DRAMSys/{dram.vp.system.pro => DRAMSys.pro} (86%) create mode 100644 DRAMSys/simulator/library.pro diff --git a/DRAMSys/dram.vp.system.pro b/DRAMSys/DRAMSys.pro similarity index 86% rename from DRAMSys/dram.vp.system.pro rename to DRAMSys/DRAMSys.pro index 9fa840ef..03bb867e 100644 --- a/DRAMSys/dram.vp.system.pro +++ b/DRAMSys/DRAMSys.pro @@ -1,7 +1,8 @@ TEMPLATE = subdirs thermalsim = $$(THERMALSIM) -isEmpty(thermalsim) { +isEmpty(thermalsim) +{ thermalsim = false } @@ -11,6 +12,7 @@ $$eval(thermalsim) { message(Thermal Simulation Feature Disabled) } +SUBDIRS += simulator/library.pro SUBDIRS += simulator/simulator.pro SUBDIRS += analyzer/traceAnalyzer.pro diff --git a/DRAMSys/simulator/library.pro b/DRAMSys/simulator/library.pro new file mode 100644 index 00000000..6a0bc61e --- /dev/null +++ b/DRAMSys/simulator/library.pro @@ -0,0 +1,215 @@ +TARGET = DRAMSys + +TEMPLATE = lib +CONFIG += console +CONFIG -= app_bundle +CONFIG -= qt + +system(cd ../../DRAMSys/simulator/src/common/third_party/DRAMPower; make src/libdrampower.a;) + +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 + +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 + +unix:!macx { + QMAKE_CXXFLAGS += -std=c++11 -O0 -g +} + +macx: { + CONFIG += c++11 + QMAKE_CXXFLAGS += -std=c++0x -stdlib=libc++ -O0 -g +} + +QMAKE_CXXFLAGS += -isystem $${systemc_home}/include +QMAKE_CXXFLAGS += -isystem $${libboost_headers} + +SOURCES += \ + src/common/third_party/tinyxml2/tinyxml2.cpp \ + src/common/xmlAddressdecoder.cpp \ + src/common/Utils.cpp \ + src/common/TlmRecorder.cpp \ + src/common/dramExtension.cpp \ + src/common/DebugManager.cpp \ + src/controller/core/configuration/Configuration.cpp \ + src/controller/core/powerdown/PowerDownManagerTimeout.cpp \ + src/controller/core/powerdown/PowerDownManagerBankwise.cpp \ + src/controller/core/powerdown/PowerDownManager.cpp \ + src/controller/scheduler/ThreadLoad.cpp \ + src/controller/scheduler/PARBS.cpp \ + src/controller/scheduler/Fr_Fcfs.cpp \ + src/controller/scheduler/Fifo.cpp \ + src/controller/core/refresh/RefreshManagerBankwise.cpp \ + src/controller/core/refresh/RefreshManager.cpp \ + src/controller/core/scheduling/checker/WriteChecker.cpp \ + src/controller/core/scheduling/checker/RefreshChecker.cpp \ + src/controller/core/scheduling/checker/ReadChecker.cpp \ + src/controller/core/scheduling/checker/PrechargeChecker.cpp \ + src/controller/core/scheduling/checker/PrechargeAllChecker.cpp \ + src/controller/core/scheduling/checker/PowerDownChecker.cpp \ + src/controller/core/scheduling/checker/ActivateChecker.cpp \ + src/controller/core/scheduling/ScheduledCommand.cpp \ + src/controller/core/TimingCalculation.cpp \ + src/controller/core/Slots.cpp \ + src/controller/core/ControllerCore.cpp \ + src/simulation/MemoryManager.cpp \ + src/simulation/TemperatureController.cpp \ + src/controller/scheduler/readwritegrouper.cpp \ + src/controller/core/configuration/ConfigurationLoader.cpp \ + src/controller/core/powerdown/NoPowerDown.cpp \ + src/controller/Command.cpp \ + src/controller/ControllerState.cpp \ + src/controller/RowBufferStates.cpp \ + src/controller/scheduler/IScheduler.cpp \ + src/controller/scheduler/FifoStrict.cpp \ + src/error/errormodel.cpp \ + src/controller/Controller.cpp \ + src/simulation/TracePlayer.cpp \ + src/simulation/StlPlayer.cpp \ + src/controller/core/powerdown/PowerDownManagerTimeoutBankwise.cpp \ + src/simulation/TraceSetup.cpp \ + src/simulation/DRAMSys.cpp \ + src/simulation/Setup.cpp + +HEADERS += \ + src/common/third_party/tinyxml2/tinyxml2.h \ + src/common/xmlAddressdecoder.h \ + src/common/Utils.h \ + src/common/TlmRecorder.h \ + src/common/tlm2_base_protocol_checker.h \ + src/common/protocol.h \ + src/common/dramExtension.h \ + src/common/DebugManager.h \ + src/controller/core/configuration/Configuration.h \ + src/controller/core/powerdown/PowerDownManagerTimeout.h \ + src/controller/core/powerdown/PowerDownManagerBankwise.h \ + src/controller/core/powerdown/PowerDownManager.h \ + src/controller/scheduler/ThreadLoad.h \ + src/controller/scheduler/PARBS.h \ + src/controller/scheduler/Fr_Fcfs.h \ + src/controller/scheduler/Fifo.h \ + src/controller/Controller.h \ + src/controller/core/refresh/RefreshManagerBankwise.h \ + src/controller/core/refresh/RefreshManager.h \ + src/controller/core/refresh/IRefreshManager.h \ + src/controller/core/scheduling/checker/WriteChecker.h \ + src/controller/core/scheduling/checker/RefreshChecker.h \ + src/controller/core/scheduling/checker/ReadChecker.h \ + src/controller/core/scheduling/checker/PrechargeChecker.h \ + src/controller/core/scheduling/checker/PrechargeAllChecker.h \ + src/controller/core/scheduling/checker/PowerDownChecker.h \ + src/controller/core/scheduling/checker/ICommandChecker.h \ + src/controller/core/scheduling/checker/ActivateChecker.h \ + src/controller/core/scheduling/Trigger.h \ + src/controller/core/scheduling/ScheduledCommand.h \ + src/controller/core/TimingCalculation.h \ + src/controller/core/Slots.h \ + src/controller/core/ControllerCore.h \ + src/simulation/TracePlayer.h \ + src/simulation/MemoryManager.h \ + src/simulation/Dram.h \ + src/simulation/Arbiter.h \ + src/common/libDRAMPower.h \ + src/controller/scheduler/readwritegrouper.h \ + src/simulation/ReorderBuffer.h \ + src/controller/core/configuration/MemSpec.h \ + src/controller/core/configuration/thermalSimConfig.h \ + src/simulation/StlPlayer.h \ + src/simulation/TracePlayerListener.h \ + src/simulation/TraceGenerator.h \ + src/simulation/TemperatureController.h \ + src/controller/core/powerdown/NoPowerDown.h \ + src/controller/Command.h \ + src/controller/RowBufferStates.h \ + src/controller/ControllerState.h \ + src/controller/core/powerdown/IPowerDownManager.h \ + src/controller/scheduler/IScheduler.h \ + src/controller/scheduler/FifoStrict.h \ + src/controller/IController.h \ + src/controller/core/configuration/ConfigurationLoader.h \ + src/error/errormodel.h \ + src/simulation/ExampleInitiator.h \ + src/controller/core/powerdown/PowerDownManagerTimeoutBankwise.h \ + src/simulation/TraceSetup.h \ + src/simulation/DRAMSys.h \ + src/simulation/Setup.h + +thermalsim = $$(THERMALSIM) +isEmpty(thermalsim) { + thermalsim = false +} + +$$eval(thermalsim) { + message(Thermal Simulation Feature Enabled) + + 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.4 + LIBS += -L$${libsuperlu_home}/lib -lsuperlu_4.3 + LIBS += -lblas + message(Libraries: $${LIBS}) + + INCLUDEPATH += $${libthreed_ice_home}/include + INCLUDEPATH += $${libsuperlu_home}/SRC + INCLUDEPATH += $${systemc_home}/include + message(Include paths: $${INCLUDEPATH}) + + QMAKE_CXXFLAGS += -DTHERMALSIM + message(Compiler flags: $${QMAKE_CXXFLAGS}) + +} else { + message(Thermal Simulation Feature Disabled) +} + +# Additional Files: +# resources folder (DRAMSys/simulator/resources) +include(resources/resources.pri) + diff --git a/DRAMSys/simulator/simulator.pro b/DRAMSys/simulator/simulator.pro index a4f0fd90..02dfd04e 100644 --- a/DRAMSys/simulator/simulator.pro +++ b/DRAMSys/simulator/simulator.pro @@ -1,12 +1,10 @@ -TARGET = dramSys +TARGET = DRAMSys TEMPLATE = app CONFIG += console CONFIG -= app_bundle CONFIG -= qt -system(cd ../../DRAMSys/simulator/src/common/third_party/DRAMPower; make src/libdrampower.a;) - systemc_home = $$(SYSTEMC_HOME) isEmpty(systemc_home) { systemc_home = /opt/systemc @@ -19,198 +17,10 @@ isEmpty(systemc_target_arch) { } 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}) +INCLUDEPATH += src/simulation/ +INCLUDEPATH += $${systemc_home}/include 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 - -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 - -unix:!macx { - QMAKE_CXXFLAGS += -std=c++11 -O0 -g -} - -macx: { - CONFIG += c++11 - QMAKE_CXXFLAGS += -std=c++0x -stdlib=libc++ -O0 -g -} - -QMAKE_CXXFLAGS += -isystem $${systemc_home}/include -QMAKE_CXXFLAGS += -isystem $${libboost_headers} - -SOURCES += \ - src/common/third_party/tinyxml2/tinyxml2.cpp \ - src/common/xmlAddressdecoder.cpp \ - src/common/Utils.cpp \ - src/common/TlmRecorder.cpp \ - src/common/dramExtension.cpp \ - src/common/DebugManager.cpp \ - src/controller/core/configuration/Configuration.cpp \ - src/controller/core/powerdown/PowerDownManagerTimeout.cpp \ - src/controller/core/powerdown/PowerDownManagerBankwise.cpp \ - src/controller/core/powerdown/PowerDownManager.cpp \ - src/controller/scheduler/ThreadLoad.cpp \ - src/controller/scheduler/PARBS.cpp \ - src/controller/scheduler/Fr_Fcfs.cpp \ - src/controller/scheduler/Fifo.cpp \ - src/controller/core/refresh/RefreshManagerBankwise.cpp \ - src/controller/core/refresh/RefreshManager.cpp \ - src/controller/core/scheduling/checker/WriteChecker.cpp \ - src/controller/core/scheduling/checker/RefreshChecker.cpp \ - src/controller/core/scheduling/checker/ReadChecker.cpp \ - src/controller/core/scheduling/checker/PrechargeChecker.cpp \ - src/controller/core/scheduling/checker/PrechargeAllChecker.cpp \ - src/controller/core/scheduling/checker/PowerDownChecker.cpp \ - src/controller/core/scheduling/checker/ActivateChecker.cpp \ - src/controller/core/scheduling/ScheduledCommand.cpp \ - src/controller/core/TimingCalculation.cpp \ - src/controller/core/Slots.cpp \ - src/controller/core/ControllerCore.cpp \ - src/simulation/MemoryManager.cpp \ - src/simulation/main.cpp \ - src/simulation/TemperatureController.cpp \ - src/controller/scheduler/readwritegrouper.cpp \ - src/controller/core/configuration/ConfigurationLoader.cpp \ - src/controller/core/powerdown/NoPowerDown.cpp \ - src/controller/Command.cpp \ - src/controller/ControllerState.cpp \ - src/controller/RowBufferStates.cpp \ - src/controller/scheduler/IScheduler.cpp \ - src/controller/scheduler/FifoStrict.cpp \ - src/error/errormodel.cpp \ - src/controller/Controller.cpp \ - src/simulation/TracePlayer.cpp \ - src/simulation/StlPlayer.cpp \ - src/controller/core/powerdown/PowerDownManagerTimeoutBankwise.cpp \ - src/simulation/TraceSetup.cpp \ - src/simulation/DRAMSys.cpp \ - src/simulation/Setup.cpp - -HEADERS += \ - src/common/third_party/tinyxml2/tinyxml2.h \ - src/common/xmlAddressdecoder.h \ - src/common/Utils.h \ - src/common/TlmRecorder.h \ - src/common/tlm2_base_protocol_checker.h \ - src/common/protocol.h \ - src/common/dramExtension.h \ - src/common/DebugManager.h \ - src/controller/core/configuration/Configuration.h \ - src/controller/core/powerdown/PowerDownManagerTimeout.h \ - src/controller/core/powerdown/PowerDownManagerBankwise.h \ - src/controller/core/powerdown/PowerDownManager.h \ - src/controller/scheduler/ThreadLoad.h \ - src/controller/scheduler/PARBS.h \ - src/controller/scheduler/Fr_Fcfs.h \ - src/controller/scheduler/Fifo.h \ - src/controller/Controller.h \ - src/controller/core/refresh/RefreshManagerBankwise.h \ - src/controller/core/refresh/RefreshManager.h \ - src/controller/core/refresh/IRefreshManager.h \ - src/controller/core/scheduling/checker/WriteChecker.h \ - src/controller/core/scheduling/checker/RefreshChecker.h \ - src/controller/core/scheduling/checker/ReadChecker.h \ - src/controller/core/scheduling/checker/PrechargeChecker.h \ - src/controller/core/scheduling/checker/PrechargeAllChecker.h \ - src/controller/core/scheduling/checker/PowerDownChecker.h \ - src/controller/core/scheduling/checker/ICommandChecker.h \ - src/controller/core/scheduling/checker/ActivateChecker.h \ - src/controller/core/scheduling/Trigger.h \ - src/controller/core/scheduling/ScheduledCommand.h \ - src/controller/core/TimingCalculation.h \ - src/controller/core/Slots.h \ - src/controller/core/ControllerCore.h \ - src/simulation/TracePlayer.h \ - src/simulation/MemoryManager.h \ - src/simulation/Dram.h \ - src/simulation/Arbiter.h \ - src/common/libDRAMPower.h \ - src/controller/scheduler/readwritegrouper.h \ - src/simulation/ReorderBuffer.h \ - src/controller/core/configuration/MemSpec.h \ - src/controller/core/configuration/thermalSimConfig.h \ - src/simulation/StlPlayer.h \ - src/simulation/TracePlayerListener.h \ - src/simulation/TraceGenerator.h \ - src/simulation/TemperatureController.h \ - src/controller/core/powerdown/NoPowerDown.h \ - src/controller/Command.h \ - src/controller/RowBufferStates.h \ - src/controller/ControllerState.h \ - src/controller/core/powerdown/IPowerDownManager.h \ - src/controller/scheduler/IScheduler.h \ - src/controller/scheduler/FifoStrict.h \ - src/controller/IController.h \ - src/controller/core/configuration/ConfigurationLoader.h \ - src/error/errormodel.h \ - src/simulation/ExampleInitiator.h \ - src/controller/core/powerdown/PowerDownManagerTimeoutBankwise.h \ - src/simulation/TraceSetup.h \ - src/simulation/DRAMSys.h \ - src/simulation/Setup.h - -thermalsim = $$(THERMALSIM) -isEmpty(thermalsim) { - thermalsim = false -} - -$$eval(thermalsim) { - message(Thermal Simulation Feature Enabled) - - 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.4 - LIBS += -L$${libsuperlu_home}/lib -lsuperlu_4.3 - LIBS += -lblas - message(Libraries: $${LIBS}) - - INCLUDEPATH += $${libthreed_ice_home}/include - INCLUDEPATH += $${libsuperlu_home}/SRC - INCLUDEPATH += $${systemc_home}/include - message(Include paths: $${INCLUDEPATH}) - - QMAKE_CXXFLAGS += -DTHERMALSIM - message(Compiler flags: $${QMAKE_CXXFLAGS}) - -} else { - message(Thermal Simulation Feature Disabled) -} - -# Additional Files: -# resources folder (DRAMSys/simulator/resources) -include(resources/resources.pri) +LIBS += -L$${OUT_PWD} -ldramSys +SOURCES += src/simulation/main.cpp diff --git a/DRAMSys/simulator/src/simulation/TraceSetup.cpp b/DRAMSys/simulator/src/simulation/TraceSetup.cpp index 6ebb0f35..56df4b14 100644 --- a/DRAMSys/simulator/src/simulation/TraceSetup.cpp +++ b/DRAMSys/simulator/src/simulation/TraceSetup.cpp @@ -104,7 +104,6 @@ void traceSetup::tracePlayerTerminates() if (finishedTracePlayers == NumberOfTracePlayers) { - //simulation->terminateSimulation.notify(); sc_stop(); } }