Compare commits
3 Commits
Author | SHA1 | Date |
---|---|---|
Eyck Jentzsch | 775872b190 | |
Eyck Jentzsch | 965a10c2f2 | |
Eyck Jentzsch | d620bea112 |
|
@ -9,7 +9,6 @@ include(GNUInstallDirs)
|
||||||
include(BuildType)
|
include(BuildType)
|
||||||
include(clang-format)
|
include(clang-format)
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 11)
|
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||||
|
@ -34,7 +33,7 @@ endif()
|
||||||
|
|
||||||
include(ConanInline)
|
include(ConanInline)
|
||||||
conan_check()
|
conan_check()
|
||||||
set(CONAN_BOOST_OPTIONS
|
set(BOOST_OPTIONS
|
||||||
boost:fPIC=True
|
boost:fPIC=True
|
||||||
boost:shared=True
|
boost:shared=True
|
||||||
boost:header_only=False
|
boost:header_only=False
|
||||||
|
@ -61,44 +60,27 @@ boost:without_timer=True
|
||||||
boost:without_type_erasure=True
|
boost:without_type_erasure=True
|
||||||
boost:without_wave=True
|
boost:without_wave=True
|
||||||
)
|
)
|
||||||
set(CONAN_PACKAGES boost/1.75.0)
|
set(CONAN_PACKAGE_LIST fmt/8.0.1 spdlog/1.9.2 zlib/1.2.11 boost/1.75.0 yaml-cpp/0.7.0 jsoncpp/1.9.5 lz4/1.9.3)
|
||||||
set(CONAN_SETTINGS ${CONAN_BOOST_OPTIONS})
|
set(CONAN_PACKAGE_OPTIONS fmt:header_only=True spdlog:header_only=True ${BOOST_OPTIONS})
|
||||||
if(NOT DEFINED ENV{SYSTEMC_HOME})
|
if(NOT USE_CWR_SYSTEMC AND NOT USE_NCSC_SYSTEMC AND NOT DEFINED ENV{SYSTEMC_HOME})
|
||||||
set(CONAN_PACKAGES ${CONAN_PACKAGES}
|
set(CONAN_PACKAGE_LIST ${CONAN_PACKAGE_LIST} systemc/2.3.3 systemc-cci/1.0.0)
|
||||||
systemc/2.3.3
|
set(CONAN_PACKAGE_OPTIONS ${CONAN_PACKAGE_OPTIONS} systemc-cci:shared=False)
|
||||||
systemc-cci/1.0.0
|
|
||||||
)
|
|
||||||
set(CONAN_SETTINGS ${CONAN_SETTINGS}
|
|
||||||
#systemc:phase_cb=False
|
|
||||||
systemc-cci:shared=False
|
|
||||||
)
|
|
||||||
endif()
|
endif()
|
||||||
conan_configure(REQUIRES ${CONAN_PACKAGES}
|
conan_configure(REQUIRES ${CONAN_PACKAGE_LIST}
|
||||||
GENERATORS cmake_find_package
|
GENERATORS cmake_find_package
|
||||||
OPTIONS ${CONAN_SETTINGS}
|
OPTIONS ${CONAN_PACKAGE_OPTIONS}
|
||||||
)
|
)
|
||||||
conan_install()
|
conan_install()
|
||||||
conan_setup(TARGETS)
|
set(CONAN_CMAKE_SILENT_OUTPUT ON)
|
||||||
|
|
||||||
# This line finds the boost lib and headers.
|
# This line finds the boost lib and headers.
|
||||||
set(Boost_NO_BOOST_CMAKE ON) # Don't do a find_package in config mode before searching for a regular boost install.
|
set(Boost_NO_BOOST_CMAKE ON) # Don't do a find_package in config mode before searching for a regular boost install.
|
||||||
find_package(Boost COMPONENTS program_options system thread REQUIRED)
|
find_package(Boost COMPONENTS program_options system thread REQUIRED)
|
||||||
|
|
||||||
# set-up SystemC and SCV
|
|
||||||
include(SystemCPackage)
|
include(SystemCPackage)
|
||||||
if(SystemC_FOUND)
|
find_package(spdlog REQUIRED)
|
||||||
include_directories(${SystemC_INCLUDE_DIRS})
|
find_package(fmt REQUIRED)
|
||||||
link_directories(${SystemC_LIBRARY_DIRS})
|
find_package(yaml-cpp REQUIRED)
|
||||||
else()
|
find_package(lz4 REQUIRED)
|
||||||
message( FATAL_ERROR "SystemC library not found." )
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(CCI_FOUND)
|
|
||||||
include_directories(${CCI_INCLUDE_DIRS})
|
|
||||||
link_directories(${CCI_LIBRARY_DIRS})
|
|
||||||
#else()
|
|
||||||
#message( FATAL_ERROR "SystemC CCI library not found." )
|
|
||||||
endif()
|
|
||||||
|
|
||||||
add_subdirectory(scc)
|
add_subdirectory(scc)
|
||||||
add_subdirectory(vp_components)
|
add_subdirectory(vp_components)
|
||||||
|
|
|
@ -3,30 +3,31 @@ import logging
|
||||||
from cppyy import gbl as cpp
|
from cppyy import gbl as cpp
|
||||||
import pysysc
|
import pysysc
|
||||||
import pysysc.structural as struct
|
import pysysc.structural as struct
|
||||||
|
import pysysc.scc as scc
|
||||||
from pysysc.structural import Connection, Module, Signal, Simulation
|
from pysysc.structural import Connection, Module, Signal, Simulation
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# setup and load
|
# setup and load
|
||||||
###############################################################################
|
###############################################################################
|
||||||
logging.basicConfig(level=logging.INFO)
|
logging.basicConfig(level=logging.DEBUG)
|
||||||
build_type='Debug'
|
build_type='Debug'
|
||||||
###############################################################################
|
###############################################################################
|
||||||
myDir = os.path.dirname( os.path.realpath(__file__))
|
myDir = os.path.dirname( os.path.realpath(__file__))
|
||||||
pysysc.load_systemc()
|
pysysc.load_systemc()
|
||||||
###############################################################################
|
###############################################################################
|
||||||
logging.debug("Loading SC-Components lib")
|
logging.debug("Loading SC-Components lib")
|
||||||
pysysc.add_include_path(os.path.join(myDir, 'scc/src/sysc'))
|
#pysysc.add_include_path(os.path.join(myDir, '../install/include'))
|
||||||
pysysc.add_include_path(os.path.join(myDir, 'scc/src/common'))
|
#pysysc.add_library('scc_util.h', os.path.join(myDir, '../install/lib64/libscc-util.so'))
|
||||||
pysysc.add_include_path(os.path.join(myDir, 'scc/third_party'))
|
#pysysc.add_library('scc_sysc.h', os.path.join(myDir, '../install/lib64/libscc-sysc.so'))
|
||||||
pysysc.add_library('scc_sysc.h', os.path.join(myDir, 'build/%s/scc/src/sysc/libscc-sysc.so'%build_type))
|
scc.load_lib(os.path.join(myDir, '../install'))
|
||||||
###############################################################################
|
###############################################################################
|
||||||
logging.debug("Loading Components lib")
|
logging.debug("Loading Components lib")
|
||||||
pysysc.add_include_path(os.path.join(myDir, 'vp_components'))
|
pysysc.add_include_path(os.path.join(myDir, 'vp_components'))
|
||||||
pysysc.add_library('components.h', os.path.join(myDir, 'build/%s/vp_components/libvp_components.so'%build_type))
|
pysysc.add_library('components.h', os.path.join(myDir, 'build/vp_components/libvp_components.so'))
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# configure
|
# configure
|
||||||
###############################################################################
|
###############################################################################
|
||||||
Simulation.setup(logging.root.level)
|
scc.setup(logging.root.level)
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# instantiate
|
# instantiate
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
@ -51,6 +52,6 @@ struct.dump_structure()
|
||||||
simcontext = cpp.sc_core.sc_get_curr_simcontext()
|
simcontext = cpp.sc_core.sc_get_curr_simcontext()
|
||||||
objects = cpp.sc_core.sc_get_top_level_objects(simcontext)
|
objects = cpp.sc_core.sc_get_top_level_objects(simcontext)
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
Simulation.configure(enable_vcd=True)
|
scc.configure(enable_trace=True)
|
||||||
Simulation.run()
|
Simulation.run()
|
||||||
logging.debug("Done")
|
logging.debug("Done")
|
||||||
|
|
2
scc
2
scc
|
@ -1 +1 @@
|
||||||
Subproject commit 1b28dadcb3510550fea0d7c383511e502bae2582
|
Subproject commit d6b718cebd9712374b0fbe145da2920800480fac
|
Loading…
Reference in New Issue