Skip to content

Commit afb1410

Browse files
authored
Merge pull request #75 from Minres/develop
prepare next release
2 parents 7385e60 + 00a378f commit afb1410

175 files changed

Lines changed: 5689 additions & 12341 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
/.project
66
/build/
77
/.cproject
8+
/.venv

CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ option(SC_WITH_PHASE_CALLBACKS "Whether SystemC is built with simulation phase c
1414
option(SC_WITH_PHASE_CALLBACK_TRACING "whether SystemC was build with phase callbacks for tracing. It needs to match the SystemC build configuration" OFF)
1515
set(SCC_ARCHIVE_DIR_MODIFIER "" CACHE STRING "additional directory levels to store static library archives")
1616
set(SCC_LIBRARY_DIR_MODIFIER "" CACHE STRING "additional directory levels to store libraries")
17+
option(WITH_SCP4SCC "adds SCP compatibility layer for SCC, cannot be used together with a copy of SCP" OFF)
1718

1819
include(Common)
1920

@@ -120,7 +121,7 @@ if (ENABLE_CLANG_TIDY)
120121
endif()
121122
endif()
122123

123-
find_package(Boost 1.70 REQUIRED COMPONENTS system date_time) # header only libraries must not be added here
124+
find_package(Boost REQUIRED QUIET COMPONENTS system date_time) # header only libraries must not be added here
124125
find_package(lz4 QUIET)
125126
if(NOT ${lz4_FOUND})
126127
find_package(PkgConfig QUIET)
@@ -182,8 +183,6 @@ if(SystemC_FOUND)
182183
target_link_libraries(scc INTERFACE ${Boost_datetime_LIBRARY})
183184
endif()
184185
target_link_libraries(scc INTERFACE scc-util scc-sysc components interfaces scv-tr)
185-
target_link_libraries(scc INTERFACE ${FMT_TARGET} spdlog::spdlog)
186-
187186
set_target_properties(scc PROPERTIES
188187
PUBLIC_HEADER ${CMAKE_CURRENT_SOURCE_DIR}/src/scc.h
189188
)
@@ -196,6 +195,9 @@ if(SystemC_FOUND)
196195
$<TARGET_OBJECTS:scv-tr>
197196
)
198197
set_target_properties(scc_shared PROPERTIES CXX_VISIBILITY_PRESET hidden)
198+
if(TARGET Boost::stacktrace_backtrace)
199+
target_link_libraries(scc_shared PUBLIC Boost::stacktrace_backtrace dl)
200+
endif()
199201
add_library(scc::scc_shared ALIAS scc_shared)
200202
endif()
201203
install(TARGETS scc

README.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ Here is a short list of features.
1515

1616
* Automatic tracer
1717

18-
The tracer(s) allow to automatically discover signals and sc_variables (see below) and register them with the trace file. If the configurer is being used the tracing can be controlled on an per-instance base
18+
The tracer(s) allow to automatically discover signals and sc_variables (see below) and register them with the trace file. If the configurer is being used the tracing can be controlled on an per-instance base
1919

20-
* Various optimized trace file implementations
20+
* Various optimized trace file implementations
2121
* compressed VCD
2222
* FST (used by [GTKWave](http://gtkwave.sourceforge.net/) and [Surfer](https://surfer-project.org/))
2323

@@ -60,7 +60,7 @@ The full documentation can be found at the [Github pages](https://minres.github.
6060
Build notes
6161
=======================================
6262

63-
If SystemC is build using cmake with `SC_WITH_PHASE_CALLBACK_TRACING=ON` (which is the default for SystemC 2.3.4), tracing will not work. Either SystemC is being installed with SC_WITH_PHASE_CALLBACK_TRACING=ON (which is the prefered way as this setting is in sync with the automake configure configuration, see https://github.com/accellera-official/systemc/issues/24) or the SCC is being build using `SC_WITH_PHASE_CALLBACK_TRACING=ON`.
63+
If SystemC is build using cmake with `SC_WITH_PHASE_CALLBACK_TRACING=ON` (which is the default for SystemC 2.3.4), tracing will not work. Either SystemC is being installed with SC_WITH_PHASE_CALLBACK_TRACING=ON (which is the prefered way as this setting is in sync with the automake configure configuration, see <https://github.com/accellera-official/systemc/issues/24>) or the SCC is being build using `SC_WITH_PHASE_CALLBACK_TRACING=ON`.
6464

6565
Build instructions using conan
6666
=======================================
@@ -72,11 +72,11 @@ On Linux
7272

7373
The suggested build steps are:
7474

75-
- create a build directory and enter into it
76-
- execute cmake with applicable options
77-
- execute build
78-
- install build
79-
- run tests
75+
* create a build directory and enter into it
76+
* execute cmake with applicable options
77+
* execute build
78+
* install build
79+
* run tests
8080

8181
For example:
8282

@@ -91,6 +91,9 @@ For example:
9191
9292
```
9393

94+
> **_NOTE:_** **Do not install SCC in the same installation directory as SystemC.**
95+
SCC follows the convention of mapping C++ namespaces directly into the directory hierarchy. As many SCC components are related to TLM 2.0, a significant portion of the SCC code resides in the `tlm` namespace, which results in the creation of a `tlm` directory under SCC's `include` folder. The SystemC itself also provides a `tlm` header file (or directory) in its own include path. If SCC and SystemC are installed into the same prefix, this results in a clash to create a directory where a file or another directory already exists—causing installation errors. Install SCC and SystemC into separate directories.
96+
9497
On Windows
9598
=======================================
9699

cmake/FindSLSSystemC.cmake

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ This module provides the following imported targets, if found:
1616
The SystemC Verification library
1717
``SystemC::cci``
1818
The SystemC CCI library
19+
``SystemC::ftblocks``
20+
The SNPS FTBlocks library
1921
2022
Result Variables
2123
^^^^^^^^^^^^^^^^
@@ -78,6 +80,12 @@ SET(_CCI_HINTS
7880
${_COMMON_HINTS}
7981
)
8082

83+
SET(_FTB_HINTS
84+
$ENV{SNPS_VP_HOME}/IP_common/FT_blocks/include
85+
$ENV{SNPS_VP_HOME}/IP_common/FT_blocks/lib/linux.$ENV{SNPS_VP_COMPILER}-64
86+
${_COMMON_HINTS}
87+
)
88+
8189
SET(_COMMON_PATHS
8290
/usr/include/systemc
8391
/usr/lib
@@ -148,7 +156,7 @@ if(SLSSystemC_FOUND)
148156
set(SystemC_FOUND True)
149157
get_filename_component(SNPS_LIB_DIR ${SnpsVP_LIBRARY} DIRECTORY)
150158
set(SystemC_LIBRARY_DIRS ${SNPS_LIB_DIR})
151-
set(SystemC_LIBRARIES sc_main ${SNPS_LIBS})
159+
set(SystemC_LIBRARIES ${SNPS_LIBS})
152160
set(SystemC_INCLUDE_DIRS ${TLM_INCLUDE_DIR} ${SystemC_INCLUDE_DIR})
153161
set(SystemC_DEFINITIONS ${PC_SystemC_CFLAGS_OTHER})
154162
endif()
@@ -182,9 +190,23 @@ FIND_LIBRARY(SCV_LIBRARY
182190
PATHS ${_COMMON_PATHS}
183191
)
184192

193+
FIND_PATH(FTB_INCLUDE_DIR
194+
NAMES snps_port_handler.h
195+
HINTS ${_FTB_HINTS}
196+
PATHS ${_COMMON_PATHS}
197+
)
198+
199+
FIND_LIBRARY(FTB_LIBRARY
200+
NAMES ftblocks
201+
HINTS ${_FTB_HINTS}
202+
PATHS ${_COMMON_PATHS}
203+
)
204+
185205
mark_as_advanced(
186206
SCV_INCLUDE_DIR
187207
SCV_LIBRARY
208+
FTB_INCLUDE_DIR
209+
FTB_LIBRARY
188210
)
189211

190212
find_package_handle_standard_args(SCV
@@ -211,3 +233,27 @@ if(SCV_FOUND AND NOT TARGET SystemC::scv)
211233
)
212234
endif()
213235

236+
find_package_handle_standard_args(FTB
237+
FOUND_VAR FTB_FOUND
238+
REQUIRED_VARS
239+
FTB_LIBRARY
240+
FTB_INCLUDE_DIR
241+
VERSION_VAR 2.0.1
242+
)
243+
244+
if(FTB_FOUND)
245+
set(FTB_LIBRARIES ${FTB_LIBRARY})
246+
set(FTB_INCLUDE_DIRS ${FTB_INCLUDE_DIR})
247+
set(FTB_DEFINITIONS ${PC_FTB_CFLAGS_OTHER})
248+
endif()
249+
250+
if(FTB_FOUND AND NOT TARGET SystemC::ftblocks)
251+
add_library(SystemC::ftblocks UNKNOWN IMPORTED)
252+
253+
set_target_properties(SystemC::ftblocks PROPERTIES
254+
IMPORTED_LOCATION "${FTB_LIBRARY}"
255+
INTERFACE_COMPILE_OPTIONS "${PC_FTB_CFLAGS_OTHER}"
256+
INTERFACE_INCLUDE_DIRECTORIES "${FTB_INCLUDE_DIR}"
257+
)
258+
endif()
259+

cmake/SystemCPackage.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ if(NOT SystemC_FOUND)
33
if(USE_CWR_SYSTEMC)
44
find_package(SLSSystemC REQUIRED)
55
set(SystemC_LIBRARIES SystemC::systemc)
6-
elseif(USE_VCS_SYSTEMC)
7-
find_package(VCSSystemC REQUIRED)
6+
elseif(USE_VCS_SYSTEMC)
7+
find_package(VCSSystemC REQUIRED)
88
set(SystemC_LIBRARIES SystemC::systemc)
99
elseif(USE_NCSC_SYSTEMC)
1010
find_package(XMSystemC REQUIRED)

cmake/clang-format.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ file(GLOB_RECURSE ALL_SOURCE_FILES ${CLANG_FORMAT_CXX_FILE_EXTENSIONS})
66
# Don't include some common build folders
77
set(CLANG_FORMAT_EXCLUDE_PATTERNS ${CLANG_FORMAT_EXCLUDE_PATTERNS} "/CMakeFiles/" "cmake")
88

9+
message(STATUS "Enumerating files for clang-format")
910
# get all project files file
1011
foreach (SOURCE_FILE ${ALL_SOURCE_FILES})
1112
foreach (EXCLUDE_PATTERN ${CLANG_FORMAT_EXCLUDE_PATTERNS})
@@ -15,6 +16,7 @@ foreach (SOURCE_FILE ${ALL_SOURCE_FILES})
1516
endif ()
1617
endforeach ()
1718
endforeach ()
19+
message(STATUS "Done enumerating files for clang-format")
1820

1921
set(FORMAT_TARGET_NAME format)
2022
if(NOT CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)

0 commit comments

Comments
 (0)