Added SystemC library selection.
This commit is contained in:
@@ -39,11 +39,6 @@ project(DRAMSys)
|
||||
set(CMAKE_CXX_STANDARD 11 CACHE STRING "C++ Version")
|
||||
set(DCMAKE_SH "CMAKE_SH-NOTFOUND" CACHE STRING "Ignore sh.exe error on Windows")
|
||||
|
||||
# Add sqlite3 Dependency:
|
||||
set(BUILD_ENABLE_RTREE ON CACHE BOOL "Enable R-Tree Feature")
|
||||
set(BUILD_ENABLE_RTREE ON)
|
||||
add_subdirectory(library/src/common/third_party/sqlite-amalgamation)
|
||||
|
||||
# Add DRAMSysLibrary:
|
||||
add_subdirectory(library)
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ target_include_directories(DRAMSys_gem5
|
||||
)
|
||||
|
||||
target_link_libraries(DRAMSys_gem5
|
||||
systemc
|
||||
${SYSTEMC_LIBRARY}
|
||||
DRAMSysLibrary
|
||||
${GEM5_LIBRARY}
|
||||
)
|
||||
)
|
||||
|
||||
@@ -35,16 +35,31 @@ cmake_minimum_required(VERSION 3.10)
|
||||
# Project Name
|
||||
project(DRAMSysLibrary)
|
||||
|
||||
# Configuration:
|
||||
set(CMAKE_CXX_STANDARD 11 CACHE STRING "C++ Version")
|
||||
set(DCMAKE_SH="CMAKE_SH-NOTFOUND")
|
||||
|
||||
# Add sqlite3 Dependency:
|
||||
set(BUILD_ENABLE_RTREE ON CACHE BOOL "Enable R-Tree Feature")
|
||||
set(BUILD_ENABLE_RTREE ON)
|
||||
add_subdirectory(src/common/third_party/sqlite-amalgamation)
|
||||
|
||||
# Add DRAMPower:
|
||||
add_subdirectory(src/common/third_party/DRAMPower)
|
||||
|
||||
# Add SystemC:
|
||||
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build Shared Libs")
|
||||
add_subdirectory(src/common/third_party/systemc)
|
||||
|
||||
# Configuration:
|
||||
set(CMAKE_CXX_STANDARD 11 CACHE STRING "C++ Version")
|
||||
set(DCMAKE_SH="CMAKE_SH-NOTFOUND")
|
||||
if(DEFINED ENV{DRAMSYS_PCT})
|
||||
find_library(SYSTEMC_LIBRARY vsi_systemc_dynamic PATH "/software/Synopsys_CoWare/N-2017.12/VPProducts/SLS/linux/common/libso-gcc-5.2.0-64")
|
||||
message("Building with PCT SystemC")
|
||||
elseif(DEFINED ENV{SYSTEMC_HOME} AND DEFINED ENV{SYSTEMC_TARGET_ARCH})
|
||||
find_library(SYSTEMC_LIBRARY systemc PATH $ENV{SYSTEMC_HOME}/lib-$ENV{SYSTEMC_TARGET_ARCH}/)
|
||||
message("Building with existing SystemC")
|
||||
else()
|
||||
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build Shared Libs")
|
||||
add_subdirectory(src/common/third_party/systemc)
|
||||
set(SYSTEMC_LIBRARY systemc)
|
||||
message("Building with SystemC submodule")
|
||||
endif()
|
||||
|
||||
include_directories(
|
||||
src/common
|
||||
@@ -166,8 +181,20 @@ target_include_directories(DRAMSysLibrary
|
||||
PUBLIC src/common/third_party/DRAMPower/src
|
||||
PUBLIC src/common/third_party/sqlite-amalgamation/
|
||||
)
|
||||
|
||||
if(DEFINED ENV{DRAMSYS_PCT})
|
||||
target_include_directories(DRAMSysLibrary
|
||||
PUBLIC /software/Synopsys_CoWare/N-2017.12/VPProducts/SLS/linux/common/include
|
||||
PUBLIC /software/Synopsys_CoWare/N-2017.12/VPProducts/SLS/linux/common/include/tlm
|
||||
)
|
||||
elseif(DEFINED ENV{SYSTEMC_HOME} AND DEFINED ENV{SYSTEMC_TARGET_ARCH})
|
||||
target_include_directories(DRAMSysLibrary
|
||||
PUBLIC $ENV{SYSTEMC_HOME}/include
|
||||
)
|
||||
endif()
|
||||
|
||||
target_link_libraries(DRAMSysLibrary
|
||||
SystemC::systemc
|
||||
${SYSTEMC_LIBRARY}
|
||||
sqlite3::sqlite3
|
||||
DRAMPower
|
||||
)
|
||||
|
||||
@@ -43,4 +43,7 @@ add_executable(DRAMSys main.cpp)
|
||||
target_include_directories(DRAMSys
|
||||
PUBLIC ../library/src/simulation/
|
||||
)
|
||||
target_link_libraries(DRAMSys systemc DRAMSysLibrary)
|
||||
target_link_libraries(DRAMSys
|
||||
${SYSTEMC_LIBRARY}
|
||||
DRAMSysLibrary
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user