develop #2
|
@ -51,7 +51,9 @@
|
||||||
</win32>
|
</win32>
|
||||||
<defs>
|
<defs>
|
||||||
<def name="BUILD_SHARED_LIBS" type="BOOL" val="ON"/>
|
<def name="BUILD_SHARED_LIBS" type="BOOL" val="ON"/>
|
||||||
|
<def name="CMAKE_BUILD_TYPE" type="STRING" val="${config_name}"/>
|
||||||
</defs>
|
</defs>
|
||||||
|
<undefs/>
|
||||||
</storageModule>
|
</storageModule>
|
||||||
</cconfiguration>
|
</cconfiguration>
|
||||||
<cconfiguration id="cdt.managedbuild.toolchain.gnu.base.1318364290.125067248">
|
<cconfiguration id="cdt.managedbuild.toolchain.gnu.base.1318364290.125067248">
|
||||||
|
|
|
@ -8,7 +8,6 @@ set(ENABLE_SHARED TRUE CACHE BOOL "Build shared libraries")
|
||||||
|
|
||||||
|
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
include(Conan)
|
|
||||||
include(BuildType)
|
include(BuildType)
|
||||||
include(clang-format)
|
include(clang-format)
|
||||||
|
|
||||||
|
@ -35,8 +34,6 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
||||||
set(warnings "/W4 /WX /EHsc")
|
set(warnings "/W4 /WX /EHsc")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
setup_conan()
|
|
||||||
|
|
||||||
# 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)
|
||||||
|
@ -58,7 +55,7 @@ if(CCI_FOUND)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_subdirectory(scc)
|
add_subdirectory(scc)
|
||||||
add_subdirectory(components)
|
add_subdirectory(vp_components)
|
||||||
add_subdirectory(top)
|
add_subdirectory(top)
|
||||||
|
|
||||||
# CTest is a testing tool that can be used to test your project.
|
# CTest is a testing tool that can be used to test your project.
|
||||||
|
|
13
README.md
13
README.md
|
@ -8,8 +8,6 @@ A simple C++/SystemC/CMake project to test pysysc
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
pip install conan
|
|
||||||
conan remote add minres https://api.bintray.com/conan/minres/conan-repo
|
|
||||||
cd PySysC-SC
|
cd PySysC-SC
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
|
@ -18,15 +16,4 @@ cmake -DBUILD_SHARED_LIBS=ON ..
|
||||||
cmake --build .
|
cmake --build .
|
||||||
```
|
```
|
||||||
|
|
||||||
## Notes
|
|
||||||
|
|
||||||
If you encounter issues when linking wrt. c++11 symbols you might have run into GCC ABI incompatibility introduced from GCC 5.0 onwards. You can fix this by adding '-s compiler.libcxx=libstdc++11' to the conan call or changing compiler.libcxx to
|
|
||||||
```
|
|
||||||
compiler.libcxx=libstdc++11
|
|
||||||
```
|
|
||||||
in $HOME/.conan/profiles/default or run
|
|
||||||
|
|
||||||
```
|
|
||||||
conan profile update settings.compiler.libcxx=libstdc++11 default
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
[requires]
|
|
||||||
SystemC/2.3.3@minres/stable
|
|
||||||
SystemC-CCI/1.0.0@minres/stable
|
|
||||||
|
|
||||||
[generators]
|
|
||||||
cmake
|
|
||||||
|
|
||||||
[options]
|
|
||||||
SystemC:stdcxx=11
|
|
||||||
SystemC:shared=True
|
|
||||||
SystemC-CCI:stdcxx=11
|
|
||||||
SystemC-CCI:shared=True
|
|
|
@ -9,16 +9,17 @@ build_type='Debug'
|
||||||
logging.basicConfig(level=logging.DEBUG)
|
logging.basicConfig(level=logging.DEBUG)
|
||||||
###############################################################################
|
###############################################################################
|
||||||
myDir = os.path.dirname( os.path.realpath(__file__))
|
myDir = os.path.dirname( os.path.realpath(__file__))
|
||||||
res=pysysc.read_config_from_conan(os.path.join(myDir, 'conanfile.txt'), build_type)
|
|
||||||
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/incl'))
|
pysysc.add_include_path(os.path.join(myDir, 'scc/src/sysc'))
|
||||||
pysysc.add_library('scc.h', os.path.join(myDir, 'build/%s/lib/libscc.so'%build_type))
|
pysysc.add_include_path(os.path.join(myDir, 'scc/src/common'))
|
||||||
|
pysysc.add_include_path(os.path.join(myDir, 'scc/third_party'))
|
||||||
|
pysysc.add_library('scc_sysc.h', os.path.join(myDir, 'build/%s/scc/src/sysc/libscc-sysc.so'%build_type))
|
||||||
###############################################################################
|
###############################################################################
|
||||||
logging.debug("Loading Components lib")
|
logging.debug("Loading Components lib")
|
||||||
pysysc.add_include_path(os.path.join(myDir, 'components'))
|
pysysc.add_include_path(os.path.join(myDir, 'vp_components'))
|
||||||
pysysc.add_library('components.h', os.path.join(myDir, 'build/%s/lib/libcomponents.so'%build_type))
|
pysysc.add_library('components.h', os.path.join(myDir, 'build/%s/vp_components/libvp_components.so'%build_type))
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# configure
|
# configure
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
|
@ -12,16 +12,17 @@ logging.basicConfig(level=logging.INFO)
|
||||||
build_type='Debug'
|
build_type='Debug'
|
||||||
###############################################################################
|
###############################################################################
|
||||||
myDir = os.path.dirname( os.path.realpath(__file__))
|
myDir = os.path.dirname( os.path.realpath(__file__))
|
||||||
pysysc.read_config_from_conan(os.path.join(myDir, 'conanfile.txt'), build_type)
|
|
||||||
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/incl'))
|
pysysc.add_include_path(os.path.join(myDir, 'scc/src/sysc'))
|
||||||
pysysc.add_library('scc.h', os.path.join(myDir, 'build/%s/lib/libscc.so'%build_type))
|
pysysc.add_include_path(os.path.join(myDir, 'scc/src/common'))
|
||||||
|
pysysc.add_include_path(os.path.join(myDir, 'scc/third_party'))
|
||||||
|
pysysc.add_library('scc_sysc.h', os.path.join(myDir, 'build/%s/scc/src/sysc/libscc-sysc.so'%build_type))
|
||||||
###############################################################################
|
###############################################################################
|
||||||
logging.debug("Loading Components lib")
|
logging.debug("Loading Components lib")
|
||||||
pysysc.add_include_path(os.path.join(myDir, 'components'))
|
pysysc.add_include_path(os.path.join(myDir, 'vp_components'))
|
||||||
pysysc.add_library('components.h', os.path.join(myDir, 'build/%s/lib/libcomponents.so'%build_type))
|
pysysc.add_library('components.h', os.path.join(myDir, 'build/%s/vp_components/libvp_components.so'%build_type))
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# configure
|
# configure
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
2
scc
2
scc
|
@ -1 +1 @@
|
||||||
Subproject commit 385eed07957bed93669ae6c453d706414e95aebc
|
Subproject commit e98dde35c4b8502eb0abef51e34f45fad8c72b81
|
|
@ -1,4 +1,4 @@
|
||||||
cmake_minimum_required(VERSION 3.3)
|
cmake_minimum_required(VERSION 3.3)
|
||||||
set(APP_NAME top)
|
set(APP_NAME top)
|
||||||
add_executable(${APP_NAME} sc_main.cpp)
|
add_executable(${APP_NAME} sc_main.cpp)
|
||||||
target_link_libraries (${APP_NAME} LINK_PUBLIC components)
|
target_link_libraries (${APP_NAME} LINK_PUBLIC vp_components)
|
||||||
|
|
|
@ -6,8 +6,8 @@ set(LIB_SOURCES
|
||||||
)
|
)
|
||||||
|
|
||||||
# Define two variables in order not to repeat ourselves.
|
# Define two variables in order not to repeat ourselves.
|
||||||
set(LIBRARY_NAME components)
|
set(LIBRARY_NAME vp_components)
|
||||||
# Define the library
|
# Define the library
|
||||||
add_library(${LIBRARY_NAME} SHARED ${LIB_SOURCES})
|
add_library(${LIBRARY_NAME} SHARED ${LIB_SOURCES})
|
||||||
target_link_libraries (${LIBRARY_NAME} LINK_PUBLIC scc)
|
target_link_libraries (${LIBRARY_NAME} LINK_PUBLIC scc)
|
||||||
target_include_directories (components PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
target_include_directories (${LIBRARY_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
|
@ -5,8 +5,8 @@
|
||||||
* Author: eyck
|
* Author: eyck
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef COMPONENTS_CLKGEN_H_
|
#ifndef VP_COMPONENTS_CLKGEN_H_
|
||||||
#define COMPONENTS_CLKGEN_H_
|
#define VP_COMPONENTS_CLKGEN_H_
|
||||||
|
|
||||||
#include <systemc>
|
#include <systemc>
|
||||||
|
|
||||||
|
@ -20,4 +20,4 @@ protected:
|
||||||
void end_of_elaboration() override;
|
void end_of_elaboration() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* COMPONENTS_CLKGEN_H_ */
|
#endif /* VP_COMPONENTS_CLKGEN_H_ */
|
|
@ -5,8 +5,8 @@
|
||||||
* Author: eyck
|
* Author: eyck
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef COMPONENTS_RESETGEN_H_
|
#ifndef VP_COMPONENTS_RESETGEN_H_
|
||||||
#define COMPONENTS_RESETGEN_H_
|
#define VP_COMPONENTS_RESETGEN_H_
|
||||||
|
|
||||||
#include <systemc>
|
#include <systemc>
|
||||||
|
|
||||||
|
@ -23,4 +23,4 @@ protected:
|
||||||
void thread();
|
void thread();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* COMPONENTS_RESETGEN_H_ */
|
#endif /* VP_COMPONENTS_RESETGEN_H_ */
|
Loading…
Reference in New Issue