Removed Boost Library

This commit is contained in:
Matthias Jung
2017-02-19 22:17:25 +01:00
parent 3cf07166d2
commit bd80c11adc
9 changed files with 89 additions and 106 deletions

View File

@@ -11,26 +11,27 @@ CONFIG += no_keywords
CONFIG += python
unix:!macx {
QMAKE_CXXFLAGS += -std=c++11
CONFIG += qwt
QMAKE_CXXFLAGS += -Xlinker -export-dynamic
QMAKE_RPATHDIR += $${libqwt_home}
message(Linker options QMAKE_RPATHDIR is $${QMAKE_RPATHDIR})
# Python library and header files
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.5m
}
message(Getting python headers from $${python_headers})
QMAKE_CXXFLAGS += -std=c++11
CONFIG += qwt
QMAKE_CXXFLAGS += -Xlinker -export-dynamic
QMAKE_RPATHDIR += $${libqwt_home}
message(Linker options QMAKE_RPATHDIR is $${QMAKE_RPATHDIR})
# Python library and header files
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.5m
}
message(Getting python headers from $${python_headers})
CONFIG(python){
LIBS += -L$${python_home} -lpython3.5m
INCLUDEPATH += $${python_headers}
@@ -38,15 +39,36 @@ unix:!macx {
}
macx: {
CONFIG += c++11
QMAKE_CXXFLAGS += -std=c++0x -stdlib=libc++
QMAKE_LFLAGS += -F$$(LIBQWT_HOME)
LIBS += -F$$(LIBQWT_HOME) -framework qwt
INCLUDEPATH += $$(LIBQWT_HEADERS)
DEPENDPATH += $$replace(LIBQWT_HOME, lib, )
INCLUDEPATH += $$(PYTHON_HEADERS)
LIBS += -L$$(PYTHON_HOME) -lpython3.6
CONFIG-=app_bundle
message(Building on a MAC)
# Python library and header files
python_home = $$(PYTHON_HOME)
isEmpty(python_home) {
python_home = /usr/local/Cellar/python3/3.6.0/Frameworks/Python.framework/Versions/3.6/lib/
}
message(Python home is $${python_home})
python_headers = $$(PYTHON_HEADERS)
isEmpty(python_headers) {
python_headers = /usr/local/Cellar/python3/3.6.0/Frameworks/Python.framework/Versions/3.6/Headers/
}
message(Getting python headers from $${python_headers})
CONFIG += c++11
QMAKE_CXXFLAGS += -std=c++0x -stdlib=libc++
QMAKE_LFLAGS += -F$$(LIBQWT_HOME)
LIBS += -F$$(LIBQWT_HOME) -framework qwt
INCLUDEPATH += $$(LIBQWT_HEADERS)
DEPENDPATH += $$replace(LIBQWT_HOME, lib, )
#DEPENDPATH += $$(python_headers)
#INCLUDEPATH += $$(python_headers)
#LIBS += -L$$(python_home) -lpython3.6
INCLUDEPATH += /usr/local/Cellar/python3/3.6.0/Frameworks/Python.framework/Versions/3.6/Headers/
LIBS += -L/usr/local/Cellar/python3/3.6.0/Frameworks/Python.framework/Versions/3.6/lib/ -lpython3.6
CONFIG-=app_bundle
}
# QWT library and header files
@@ -158,6 +180,5 @@ FORMS += \
evaluationtool.ui
# Additional Files:
# scripts (DRAMSys/analyzer/scripts)
include(scripts/scripts.pri)

View File

@@ -1,6 +1,7 @@
TARGET = DRAMSys
TEMPLATE = lib
CONFIG += staticlib
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt
@@ -22,28 +23,13 @@ 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
@@ -60,7 +46,6 @@ macx: {
}
QMAKE_CXXFLAGS += -isystem $${systemc_home}/include
QMAKE_CXXFLAGS += -isystem $${libboost_headers}
SOURCES += \
src/common/third_party/tinyxml2/tinyxml2.cpp \

View File

@@ -19,8 +19,12 @@ message(SystemC target architecture is $${systemc_target_arch})
INCLUDEPATH += src/simulation/
INCLUDEPATH += $${systemc_home}/include
INCLUDEPATH += src/common/third_party/DRAMPower/src
INCLUDEPATH += src/common/third_party/DRAMPower/src/libdrampower
LIBS += -lsqlite3
LIBS += -L$${systemc_home}/lib-$${systemc_target_arch} -lsystemc
LIBS += -L../../DRAMSys/simulator/src/common/third_party/DRAMPower/src/ -ldrampower
LIBS += -L$${OUT_PWD} -ldramSys
SOURCES += src/simulation/main.cpp

View File

@@ -38,7 +38,6 @@
#include <iostream>
#include <algorithm>
#include <boost/filesystem.hpp>
#include "TlmRecorder.h"
#include "protocol.h"
@@ -219,9 +218,15 @@ void TlmRecorder::Transaction::setPhaseEnd(string name, sc_time end)
void TlmRecorder::openDB(std::string name)
{
boost::filesystem::wpath file(name);
if(boost::filesystem::exists(file))
boost::filesystem::remove(file);
ifstream f(name.c_str());
if(f.good())
{
if(remove(name.c_str()) != 0)
{
SC_REPORT_FATAL("TlmRecorder", "Error deleting file" );
}
}
if (sqlite3_open(name.c_str(), &db) != SQLITE_OK)
{
SC_REPORT_FATAL("Error in TraceRecorder", "Error cannot open database");

View File

@@ -43,7 +43,6 @@
#include <string>
#include <ostream>
#include <tlm.h>
#include <boost/preprocessor.hpp>
#include <iomanip>
#include "dramExtension.h"
#include "third_party/tinyxml2/tinyxml2.h"
@@ -127,45 +126,5 @@ double queryDoubleParameter(tinyxml2::XMLElement* node, std::string name);
void setUpDummy(tlm::tlm_generic_payload& payload, Bank& bank);
#define DEFINE_ENUM_CLASS_WITH_STRING_CONVERSIONS_TOSTRING_CASE(r, data, elem) \
case data::elem : return BOOST_PP_STRINGIZE(elem);
#define DEFINE_ENUM_CLASS_WITH_STRING_CONVERSIONS_TOENUM_IF(r, data, elem) \
if (BOOST_PP_SEQ_TAIL(data) == BOOST_PP_STRINGIZE(elem)) \
return BOOST_PP_SEQ_HEAD(data)::elem; else
#define DEFINE_ENUM_CLASS_WITH_STRING_CONVERSIONS(enumName, enumerators) \
enum class enumName { \
BOOST_PP_SEQ_ENUM(enumerators) \
}; \
\
inline const char *EnumToString(enumName v) \
{ \
switch (v) { \
BOOST_PP_SEQ_FOR_EACH( \
DEFINE_ENUM_CLASS_WITH_STRING_CONVERSIONS_TOSTRING_CASE, \
enumName, \
enumerators \
) \
default: return "[Unknown " BOOST_PP_STRINGIZE(name) "]"; \
} \
} \
\
inline enumName StringToEnum(std::string s) \
{ \
BOOST_PP_SEQ_FOR_EACH( \
DEFINE_ENUM_CLASS_WITH_STRING_CONVERSIONS_TOENUM_IF, \
(enumName)(s), \
enumerators \
) \
{ \
SC_REPORT_FATAL("Configuration", \
("Invalid string \"" + s + "\" for conversion into enum \"" \
+ BOOST_PP_STRINGIZE(enumName) + "\"").c_str() \
); \
\
} \
}
#endif /* UTILS_COMMON_H_ */

View File

@@ -40,7 +40,6 @@
#include "Configuration.h"
#include "ConfigurationLoader.h"
#include "boost/lexical_cast.hpp"
#include "../../../common/xmlAddressdecoder.h"
using namespace std;
@@ -54,22 +53,36 @@ Configuration::Configuration()
int string2bool(string s)
{
try {
bool x = boost::lexical_cast<bool>( s );
return x;
} catch( boost::bad_lexical_cast const& ) {
if(s=="0")
{
return 0;
}
else if(s=="1")
{
return 1;
}
else
{
SC_REPORT_FATAL("Configuration", ("Could not convert to bool: " + s).c_str());
throw;
}
}
int string2int(string s)
{
try {
int x = boost::lexical_cast<int>( s );
return x;
} catch( boost::bad_lexical_cast const& ) {
SC_REPORT_FATAL("Configuration", ("Could not convert to int: " + s).c_str());
return std::stoi(s);
}
StorageMode string2StoreMode(string s)
{
if(s == "NoStorage")
return StorageMode::NoStorage;
else if(s == "Store")
return StorageMode::Store;
else if (s == "ErrorModel")
return StorageMode::ErrorModel;
else
{
SC_REPORT_FATAL("Configuration", ("Unknown StorageMode: " + s).c_str());
throw;
}
}
@@ -179,7 +192,7 @@ void Configuration::setParameter(std::string name, std::string value)
else if(name == "ErrorCSVFile")
ErrorCSVFile = value;
else if(name == "StoreMode")
StoreMode = StringToEnum(value);
StoreMode = string2StoreMode(value);
// Temperature Simulation related
else if (name == "TemperatureScale") {
if (value != "Celsius" && value != "Fahrenheit" && value != "Kelvin") {

View File

@@ -45,8 +45,7 @@
#include "thermalSimConfig.h"
#include "../../../common/Utils.h"
enum class StorageMode;
DEFINE_ENUM_CLASS_WITH_STRING_CONVERSIONS(StorageMode, (NoStorage)(Store)(ErrorModel))
enum class StorageMode{NoStorage, Store, ErrorModel};
enum class EPowerDownMode{NoPowerDown, Staggered, TimeoutPDN, TimeoutSREF};

View File

@@ -194,8 +194,6 @@ struct Dram : sc_module
firstAccess = SC_ZERO_TIME;
lastAccess = SC_ZERO_TIME;
printDebugMessage(string("StorageMode: ") + EnumToString(StoreMode));
// For each bank in a channel a error Model is created:
if(StoreMode == StorageMode::ErrorModel)
{

View File

@@ -42,7 +42,6 @@
#include "DRAMSys.h"
#include "TraceSetup.h"
#include "ExampleInitiator.h"
using namespace std;