From 5e858b2754fcfa60c5152547a3d661045fc7d3f2 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Tue, 23 Jun 2026 16:33:35 +0200 Subject: [PATCH 1/3] updates XM SystemC detection --- CMakeLists.txt | 8 +- CMakePresets.json | 21 +- README.md | 48 ++++- cmake/FindXMSystemC.cmake | 186 +++++++----------- cmake/SystemCPackage.cmake | 2 +- examples/transaction_recording/CMakeLists.txt | 41 ++-- .../scv_tr_recording_example.cpp | 49 +++-- src/sysc/CMakeLists.txt | 35 +++- src/sysc/scc/fst_trace.hh | 4 +- src/sysc/tlm/nw/tlm_array.h | 108 ++++++++++ src/sysc/tlm/nw/tlm_network_gp.h | 6 +- src/sysc/tlm/scc/qk/sc_time_syncronizer.cpp | 8 +- tests/quantum_keeper_mt/top_module.h | 5 +- third_party/axi_chi | 2 +- third_party/lwtr4sc | 2 +- 15 files changed, 339 insertions(+), 186 deletions(-) create mode 100644 src/sysc/tlm/nw/tlm_array.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 442435d8..f161ddde 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,7 @@ project(scc VERSION 2025.12 LANGUAGES CXX C) option(USE_CWR_SYSTEMC "Use Synopsys Virtualizer SystemC" OFF) option(USE_NCSC_SYSTEMC "Cadence Xcelium SystemC" OFF) +option(USE_NCSC_SYSTEMC3 "Cadence Xcelium SystemC version 3.0" OFF) option(BUILD_SCC_DOCUMENTATION "Create and install the HTML based API documentation (requires Doxygen)" OFF) option(FULL_TRACE_TYPE_LIST "Test for extended set of templated datatypes" OFF) #Note: this needs to match the SystemC kernel build options @@ -33,8 +34,9 @@ if(CMAKE_PROJECT_NAME STREQUAL "scc") endif(APPLE) set(Boost_NO_BOOST_CMAKE ON) # Don't do a find_package in config mode before searching for a regular boost install. option(ENABLE_CLANG_TIDY "Add clang-tidy automatically to builds" OFF) - option(BUILD_SCC_LIB_ONLY "Build only the library (no examples" OFF) + option(BUILD_SCC_LIB_ONLY "Build only the library (no examples, no tests)" OFF) option(INSTALL_DEPENDENCIES "Should dependencies be installed when installing SCC" OFF) + option(NCSC_LINK_CHECK "If NCSC is used, check if the libraries veing built link in an example" OFF) set(CLANG_FORMAT_EXCLUDE_PATTERNS "/third_party/" "/build/" ".direnv") if(ENABLE_CLANG_FORMAT) find_package(ClangFormat) @@ -139,7 +141,7 @@ if(SystemC_FOUND) add_subdirectory(src/components) add_subdirectory(src/sysc) add_subdirectory(third_party) - if(NOT BUILD_SCC_LIB_ONLY) + if(NOT BUILD_SCC_LIB_ONLY AND NOT (USE_NCSC_SYSTEMC OR USE_NCSC_SYSTEMC3)) if(NOT (DEFINED CMAKE_CXX_CLANG_TIDY OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")) add_subdirectory(examples) endif() @@ -149,6 +151,8 @@ if(SystemC_FOUND) set(WITH_SCP4SCC ON) add_subdirectory(tests) endif() + elseif(USE_NCSC_SYSTEMC OR USE_NCSC_SYSTEMC3 AND NCSC_LINK_CHECK) + add_subdirectory(examples/transaction_recording) endif() # Define the scc library diff --git a/CMakePresets.json b/CMakePresets.json index 1f298501..cf79e8f8 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -14,7 +14,6 @@ "generator": "Ninja", "binaryDir": "${sourceDir}/build/${presetName}", "cacheVariables": { - "CMAKE_POLICY_DEFAULT_CMP0091": "NEW", "CMAKE_CXX_STANDARD": "17", "CMAKE_INSTALL_PREFIX": "${sourceDir}/install/${presetName}", "CMAKE_EXPORT_COMPILE_COMMANDS": "ON", @@ -61,6 +60,26 @@ "CMAKE_BUILD_TYPE": "Release", "BUILD_SCC_DOCUMENTATION": "ON" } + }, + { + "name": "NCSC_RelWithDebInfo", + "inherits": "Base", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "RelWithDebInfo", + "USE_NCSC_SYSTEMC": "ON", + "NCSC_LINK_CHECK": "ON", + "CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}" + } + }, + { + "name": "NCSC3_RelWithDebInfo", + "inherits": "Base", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "RelWithDebInfo", + "USE_NCSC_SYSTEMC3": "ON", + "NCSC_LINK_CHECK": "ON", + "CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}" + } } ], "testPresets": [ diff --git a/README.md b/README.md index b5527f70..bc8b8f73 100644 --- a/README.md +++ b/README.md @@ -77,12 +77,15 @@ The full documentation can be found at the [Github pages](https://minres.github. Build notes ======================================= -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 ) or the SCC is being build using `SC_WITH_PHASE_CALLBACK_TRACING=ON`. +If SystemC 2.x 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=OFF (which is the prefered way as this setting is in sync with the automake configure configuration, see ) or the SCC is being build using `SC_WITH_PHASE_CALLBACK_TRACING=ON`. Build instructions using conan ======================================= -The repo is cmake based and (preferably) uses conan. Make sure that you have at least cmake 3.24 and conan version >2.0 installed. Other combinations may work, but are not tested. +The repo is cmake based and (preferably) uses conan. +Make sure that you have at least cmake 3.24 and conan version >2.0 installed. +Other combinations may work, but are not tested. On Linux ======================================= @@ -101,22 +104,25 @@ For example: cmake --preset Release -DCMAKE_INSTALL_PREFIX= cmake --build build/Release -j16 - cmake --build build/Release --target test + cmake --build build/Release --target test cmake --build build/Release --target install - build//Release/examples/ace-axi/ace_axi_example - build//Release/examples/axi-axi/axi_axi_example + build/Release/examples/ace-axi/ace_axi_example + build/Release/examples/axi-axi/axi_axi_example ``` > **_NOTE:_** **Do not install SCC in the same installation directory as SystemC.** -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. +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. On Windows ======================================= ``` cmake --preset Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX= -cmake --build build/Release --config Release cmake --build build/Release --config Release --target install ``` @@ -135,3 +141,31 @@ The script can also be downloaded and run with the install dir as argument: curl https://raw.githubusercontent.com/Minres/SystemC-Components/develop/contrib/install_wo_conan.sh >install_wo_conan.sh bash install_wo_conan.sh ``` + +Building and installing SCC for Cadence Xcelium +=============================================== + +You need to setup your environment and make Xcelium available. This means ncroot and ncsc need to be found by the shell. + +``` +cmake --preset NCSC_RelWithDebInfo -DCMAKE_INSTALL_PREFIX= +cmake --build build/NCSC_RelWithDebInfo --parallel --target install +``` + +If the used version of Xcelium supports SystemC 3.x the commands become: + +``` +cmake --preset NCSC3_RelWithDebInfo -DCMAKE_INSTALL_PREFIX= +cmake --build build/NCSC3_RelWithDebInfo --parallel --target install +``` + +Building the library for 32bit (the Xcelium default - sic!) works atm only for a standalone build as there is no mechanism to tell conan to build in 32bit. The following commands might help in non-conan builds: + +``` +CXXFLAGS="-m32" CFLAGS="-m32" LDFLAGS="-m32" \ + cmake -S . -B build/NCSC_RelWithDebInfo -Wno-dev -DCMAKE_INSTALL_PREFIX= \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=OFF -DBUILD_SCC_LIB_ONLY=ON -DCMAKE_CXX_STANDARD=17 \ + -DBoost_NO_SYSTEM_PATHS=TRUE -DBOOST_ROOT= -DBoost_NO_WARN_NEW_VERSIONS=ON +cmake --build build/NCSC_RelWithDebInfo --parallel --target install +``` + diff --git a/cmake/FindXMSystemC.cmake b/cmake/FindXMSystemC.cmake index 61a8f9a6..6c789834 100644 --- a/cmake/FindXMSystemC.cmake +++ b/cmake/FindXMSystemC.cmake @@ -40,9 +40,7 @@ This will define the following variables: Libraries needed to link to SCV. #]=======================================================================] -set(NCSC_LIBS systemc_sh xmscCoSim_sh xmscCoroutines_sh) -#set(NCSC_LIBS systemc_sh xmscCoroutines_sh ovm scBootstrap_sh) - +# find install location and version of XCelium find_program(ncroot_EXECUTABLE ncroot) if(NOT ncroot_EXECUTABLE) message(FATAL_ERROR "No ncroot in PATH") @@ -50,87 +48,79 @@ endif() execute_process( COMMAND ${ncroot_EXECUTABLE} - OUTPUT_VARIABLE NCROOT_PATH + OUTPUT_VARIABLE CDSROOT_PATH ) -string(STRIP ${NCROOT_PATH} NCROOT_PATH) -message("Using Xcelium at ${NCROOT_PATH}") - - -SET(_COMMON_HINTS - ${NCROOT_PATH}/tools/systemc/include - ${NCROOT_PATH}/tools/systemc/lib/64bit - ) - -SET(_SYSTEMC_HINTS - ${_COMMON_HINTS} - ) - -SET(_TLM_HINTS - ${NCROOT_PATH}/tools/systemc/include/tlm2 - ${_COMMON_HINTS} - ) - -SET(_SCV_HINTS - ${_COMMON_HINTS} - ) +string(STRIP ${CDSROOT_PATH} CDSROOT_PATH) -SET(_COMMON_PATHS - ${NCROOT_PATH}/tools/systemc/include - ${NCROOT_PATH}/tools/systemc/lib - /usr/include - /usr/lib - ) - -FIND_PATH(SystemC_INCLUDE_DIR - NAMES systemc - HINTS ${_SYSTEMC_HINTS} - PATHS ${_COMMON_PATHS} -) - -FIND_PATH(TLM_INCLUDE_DIR - NAMES tlm - HINTS ${_TLM_HINTS} - PATHS ${_COMMON_PATHS} -) +find_program(ncsc_EXECUTABLE ncsc) +if(NOT ncsc_EXECUTABLE) + message(FATAL_ERROR "No ncsc in PATH") +endif() +execute_process( + COMMAND ${ncsc_EXECUTABLE} -version + OUTPUT_VARIABLE NCSC_OUTPUT + ) +separate_arguments(NCSC_OUTPUT_LIST NATIVE_COMMAND ${NCSC_OUTPUT}) +list(GET NCSC_OUTPUT_LIST 2 NCSC_VERSION_STRING) +string(SUBSTRING ${NCSC_VERSION_STRING} 0 2 NCSC_VERSION_MAJOR) +string(SUBSTRING ${NCSC_VERSION_STRING} 3 2 NCSC_VERSION_MINOR) +set(NCSC_VERSION ${NCSC_VERSION_MAJOR}${NCSC_VERSION_MINOR}) +message(STATUS "Xcelium is at ${CDSROOT_PATH}, version is ${NCSC_VERSION_MAJOR}.${NCSC_VERSION_MINOR}") +# if we reach here we found Xcelium +set(XMSystemC_FOUND True) +# check if we build 32 or 64bit +file(WRITE "${CMAKE_BINARY_DIR}/test_arch_size.cpp" " +#include +int main( int argc, char** argv ){ + return sizeof(void*); +}") +set(CMAKE_TRY_COMPILE_CONFIGURATION ${CMAKE_BUILD_TYPE}) +TRY_RUN(RUN_RESULT_VAR COMPILE_RESULT_VAR + ${CMAKE_BINARY_DIR} + ${CMAKE_BINARY_DIR}/test_arch_size.cpp + RUN_OUTPUT_VARIABLE IS_64_SYSTEM) +if(${RUN_RESULT_VAR} EQUAL 8) + set(BITS_MOD 64bit) + set(LIB_MOD 64) +endif() +# set default values of variables +set(NCSC_ROOT_PATH ${CDSROOT_PATH}/tools.lnx86/systemc) +set(NCSC_LIBS systemc_sh scBootstrap_sh xmscCoroutines_sh) +set(NCSC_LIB_PATHS ${CDSROOT_PATH}/tools.lnx86/systemc/lib/${BITS_MOD}/gnu) +set(GCC_LIB_PATH ${CDSROOT_PATH}/tools.lnx86/cdsgcc/gcc/install/lib${LIB_MOD}) +# check if there is and will be used SystemC 3 +if(NCSC_VERSION GREATER_EQUAL 2603 AND USE_NCSC_SYSTEMC3) + set(SystemC_VERSION 3.0.1) + set(NCSC_ROOT_PATH ${CDSROOT_PATH}/tools.lnx86/systemc_301) + set(NCSC_LIB_PATHS ${CDSROOT_PATH}/tools.lnx86/systemc_301/lib/${BITS_MOD}/gnu) +else() + set(SystemC_VERSION 2.3.4 CACHE STRING "SystemC Version") +endif() +# seed the include directories +set(NCSC_SystemC_INCLUDE_DIRS ${NCSC_ROOT_PATH}/include;${CDSROOT_PATH}/tools.lnx86/tbsc/include;${CDSROOT_PATH}/tools.lnx86/vic/include;${NCSC_ROOT_PATH}/include/factory;${NCSC_ROOT_PATH}/include/tlm2) +# find needed libraries foreach(LIB_NAME ${NCSC_LIBS}) FIND_LIBRARY(${LIB_NAME}_LIBRARY NAMES ${LIB_NAME} - HINTS ${_SYSTEMC_HINTS} - PATHS ${_COMMON_PATHS} + HINTS ${NCSC_LIB_PATHS} + PATHS ${NCSC_LIB_PATHS} ) - set(LIB_FILE_NAMES ${LIB_FILE_NAMES} ${${LIB_NAME}_LIBRARY}) - set(LIB_VAR_NAMES ${LIB_VAR_NAMES} ${LIB_NAME}_LIBRARY) + list(APPEND LIB_FILE_NAMES ${${LIB_NAME}_LIBRARY}) + list(APPEND LIB_VAR_NAMES ${LIB_NAME}_LIBRARY) endforeach() mark_as_advanced( - SystemC_INCLUDE_DIR - SystemC_LIBRARY + NCSC_SystemC_INCLUDE_DIRS + NCSC_SystemC_LIBRARIES ${LIB_VAR_NAMES} ) -if (SystemC_INCLUDE_DIR) - file(STRINGS "${SystemC_INCLUDE_DIR}/sysc/cosim/xmsc_ver.h" version-file - REGEX "#define[ \t]SC_VERSION_(MAJOR|MINOR|PATCH).*") - if (NOT version-file) - message(AUTHOR_WARNING "SystemC_INCLUDE_DIR found, but xmsc_ver.h is missing") - endif() - list(GET version-file 0 major-line) - list(GET version-file 1 minor-line) - list(GET version-file 2 patch-line) - string(REGEX REPLACE "^#define[ \t]+SC_VERSION_MAJOR[ \t]+([0-9]+)$" "\\1" SC_VERSION_MAJOR ${major-line}) - string(REGEX REPLACE "^#define[ \t]+SC_VERSION_MINOR[ \t]+([0-9]+)$" "\\1" SC_VERSION_MINOR ${minor-line}) - string(REGEX REPLACE "^#define[ \t]+SC_VERSION_PATCH[ \t]+([0-9]+)$" "\\1" SC_VERSION_PATCH ${patch-line}) - set(SystemC_VERSION ${SC_VERSION_MAJOR}.${SC_VERSION_MINOR}.${SC_VERSION_PATCH} CACHE STRING "SystemC Version") -endif() - - include(FindPackageHandleStandardArgs) find_package_handle_standard_args(XMSystemC REQUIRED_VARS ${LIB_VAR_NAMES} - SystemC_INCLUDE_DIR - TLM_INCLUDE_DIR + NCSC_SystemC_INCLUDE_DIRS VERSION_VAR SystemC_VERSION ) @@ -138,62 +128,28 @@ if(XMSystemC_FOUND) set(SystemC_FOUND True) get_filename_component(NCSC_LIB_DIR ${systemc_sh_LIBRARY} DIRECTORY) set(SystemC_LIBRARY_DIRS ${NCSC_LIB_DIR}) - set(SystemC_LIBRARIES ${NCSC_LIBS} ${NCROOT_PATH}/tools/lib/64bit/libudm.so) - set(SystemC_INCLUDE_DIRS ${TLM_INCLUDE_DIR} ${SystemC_INCLUDE_DIR}) - set(SystemC_DEFINITIONS ${PC_SystemC_CFLAGS_OTHER} NCSC) + set(SystemC_LIBRARIES ${NCSC_LIBS}) + set(SystemC_INCLUDE_DIRS ${NCSC_SystemC_INCLUDE_DIRS}) + set(SystemC_DEFINITIONS NCSC) endif() + if(SystemC_FOUND AND NOT TARGET SystemC::systemc) add_library(SystemC::systemc UNKNOWN IMPORTED) set_target_properties(SystemC::systemc PROPERTIES IMPORTED_LOCATION ${systemc_sh_LIBRARY} INTERFACE_COMPILE_DEFINITIONS "${SystemC_DEFINITIONS}" - # INTERFACE_COMPILE_OPTIONS "${SystemC_OPTIONS}" INTERFACE_INCLUDE_DIRECTORIES "${SystemC_INCLUDE_DIRS}" - INTERFACE_LINK_DIRECTORIES "${SystemC_LIBRARY_DIRS}" + INTERFACE_LINK_DIRECTORIES "${SystemC_LIBRARY_DIRS};${GCC_LIB_PATH}" INTERFACE_LINK_LIBRARIES "${SystemC_LIBRARIES}" ) + if(UNIX) + set_target_properties(SystemC::systemc PROPERTIES + INTERFACE_LINK_OPTIONS "LINKER:-rpath,${NCSC_LIB_PATHS}:${GCC_LIB_PATH}" + ) + if(NCSC_VERSION GREATER_EQUAL 2509) + #target_compile_options(SystemC::systemc PUBLIC -Wno-free-nonheap-object) + add_compile_options(-Wno-free-nonheap-object) + endif() + endif() endif() - -FIND_PATH(SCV_INCLUDE_DIR - NAMES scv.h - HINTS ${_SCV_HINTS} - PATHS ${_COMMON_PATHS} -) - -FIND_LIBRARY(SCV_LIBRARY - NAMES scv - HINTS ${_SCV_HINTS} - PATHS ${_COMMON_PATHS} -) - -mark_as_advanced( - SCV_INCLUDE_DIR - SCV_LIBRARY -) - -if(NOT SCV_INCLUDE_DIR MATCHES "SCV_INCLUDE_DIR-NOTFOUND") - find_package_handle_standard_args(SCV - FOUND_VAR SCV_FOUND - REQUIRED_VARS - SCV_LIBRARY - SCV_INCLUDE_DIR - VERSION_VAR 2.0.1 - ) - - if(SCV_FOUND) - set(SCV_LIBRARIES ${SCV_LIBRARY}) - set(SCV_INCLUDE_DIRS ${SCV_INCLUDE_DIR}) - set(SCV_DEFINITIONS ${PC_SCV_CFLAGS_OTHER}) - endif() - - if(SCV_FOUND AND NOT TARGET SystemC::scv) - add_library(SystemC::scv UNKNOWN IMPORTED) - set_target_properties(SystemC::scv PROPERTIES - IMPORTED_LOCATION "${SCV_LIBRARY}" - INTERFACE_COMPILE_OPTIONS "${PC_SCV_CFLAGS_OTHER}" - INTERFACE_INCLUDE_DIRECTORIES "${SCV_INCLUDE_DIR}" - ) - endif() -endif() - diff --git a/cmake/SystemCPackage.cmake b/cmake/SystemCPackage.cmake index 87c08ed8..e15d946f 100644 --- a/cmake/SystemCPackage.cmake +++ b/cmake/SystemCPackage.cmake @@ -6,7 +6,7 @@ if(NOT SystemC_FOUND) elseif(USE_VCS_SYSTEMC) find_package(VCSSystemC REQUIRED) set(SystemC_LIBRARIES SystemC::systemc) - elseif(USE_NCSC_SYSTEMC) + elseif(USE_NCSC_SYSTEMC OR USE_NCSC_SYSTEMC3) find_package(XMSystemC REQUIRED) set(SystemC_LIBRARIES SystemC::systemc) elseif(USE_MTI_SYSTEMC) diff --git a/examples/transaction_recording/CMakeLists.txt b/examples/transaction_recording/CMakeLists.txt index 17f4641b..27afe1ea 100644 --- a/examples/transaction_recording/CMakeLists.txt +++ b/examples/transaction_recording/CMakeLists.txt @@ -5,26 +5,25 @@ if(APPLE) set_target_properties (transaction_recording PROPERTIES LINK_FLAGS -Wl,-U,_sc_main,-U,___sanitizer_start_switch_fiber,-U,___sanitizer_finish_switch_fiber) endif() +if(USE_NCSC_SYSTEMC OR USE_NCSC_SYSTEMC3) + target_link_libraries (transaction_recording LINK_PUBLIC ${CDSROOT_PATH}/tools.lnx86/systemc/lib/${BITS_MOD}/gnu/sc_main.o) + add_test(NAME tx_rec_example COMMAND transaction_recording) +else() + add_executable (transaction_recording_ftr scv_tr_recording_example.cpp ) + target_compile_definitions(transaction_recording_ftr PUBLIC FTR) + target_link_libraries (transaction_recording_ftr LINK_PUBLIC scc) + if(APPLE) + set_target_properties (transaction_recording_ftr PROPERTIES LINK_FLAGS + -Wl,-U,_sc_main,-U,___sanitizer_start_switch_fiber,-U,___sanitizer_finish_switch_fiber) + endif() + add_test(NAME tx_rec_ftr_example COMMAND transaction_recording_ftr) - -add_executable (transaction_recording_ftr scv_tr_recording_example.cpp ) -target_compile_definitions(transaction_recording_ftr PUBLIC FTR) -target_link_libraries (transaction_recording_ftr LINK_PUBLIC scc) -if(APPLE) - set_target_properties (transaction_recording_ftr PROPERTIES LINK_FLAGS - -Wl,-U,_sc_main,-U,___sanitizer_start_switch_fiber,-U,___sanitizer_finish_switch_fiber) -endif() - - -add_executable (transaction_recording_cftr scv_tr_recording_example.cpp ) -target_compile_definitions(transaction_recording_cftr PUBLIC CFTR) -target_link_libraries (transaction_recording_cftr LINK_PUBLIC scc) -if(APPLE) - set_target_properties (transaction_recording_cftr PROPERTIES LINK_FLAGS - -Wl,-U,_sc_main,-U,___sanitizer_start_switch_fiber,-U,___sanitizer_finish_switch_fiber) + add_executable (transaction_recording_cftr scv_tr_recording_example.cpp ) + target_compile_definitions(transaction_recording_cftr PUBLIC CFTR) + target_link_libraries (transaction_recording_cftr LINK_PUBLIC scc) + if(APPLE) + set_target_properties (transaction_recording_cftr PROPERTIES LINK_FLAGS + -Wl,-U,_sc_main,-U,___sanitizer_start_switch_fiber,-U,___sanitizer_finish_switch_fiber) + endif() + add_test(NAME tx_rec_cftr_example COMMAND transaction_recording_cftr) endif() - - -add_test(NAME tx_rec_example COMMAND transaction_recording) -add_test(NAME tx_rec_ftr_example COMMAND transaction_recording_ftr) -add_test(NAME tx_rec_cftr_example COMMAND transaction_recording_cftr) \ No newline at end of file diff --git a/examples/transaction_recording/scv_tr_recording_example.cpp b/examples/transaction_recording/scv_tr_recording_example.cpp index 2dc9f8f9..ae96f42e 100644 --- a/examples/transaction_recording/scv_tr_recording_example.cpp +++ b/examples/transaction_recording/scv_tr_recording_example.cpp @@ -20,11 +20,16 @@ #include #include #include +#ifdef HAS_SCV +#include +#define SCVNS +#else #include +#define SCVNS ::scv_tr:: +#endif using namespace sc_core; using namespace sc_dt; -using namespace scv_tr; // hack to fake a true fifo_mutex #define fifo_mutex sc_mutex @@ -91,14 +96,14 @@ class rw_pipelined_transactor : public rw_task_if, public pipelined_bus_ports { fifo_mutex addr_phase; fifo_mutex data_phase; - scv_tr_stream pipelined_stream; - scv_tr_stream addr_stream; - scv_tr_stream data_stream; - scv_tr_generator, sc_uint<8>> read_gen; - scv_tr_generator write_gen; - scv_tr_generator> addr_gen; - scv_tr_generator<_scv_tr_generator_default_data, sc_uint<8>> rdata_gen; - scv_tr_generator> wdata_gen; + SCVNS scv_tr_stream pipelined_stream; + SCVNS scv_tr_stream addr_stream; + SCVNS scv_tr_stream data_stream; + SCVNS scv_tr_generator, sc_uint<8>> read_gen; + SCVNS scv_tr_generator write_gen; + SCVNS scv_tr_generator> addr_gen; + SCVNS scv_tr_generator> rdata_gen; + SCVNS scv_tr_generator> wdata_gen; public: rw_pipelined_transactor(sc_module_name nm) @@ -119,9 +124,9 @@ class rw_pipelined_transactor : public rw_task_if, public pipelined_bus_ports { rw_task_if::data_t rw_pipelined_transactor::read(const addr_t* addr) { addr_phase.lock(); - scv_tr_handle h = read_gen.begin_transaction(*addr); + SCVNS scv_tr_handle h = read_gen.begin_transaction(*addr); h.record_attribute("data_size", sizeof(data_t)); - scv_tr_handle h1 = addr_gen.begin_transaction(*addr, "addr_phase", h); + SCVNS scv_tr_handle h1 = addr_gen.begin_transaction(*addr, "addr_phase", h); wait(clk->posedge_event()); bus_addr = *addr; rw = false; @@ -134,7 +139,7 @@ rw_task_if::data_t rw_pipelined_transactor::read(const addr_t* addr) { addr_phase.unlock(); data_phase.lock(); - scv_tr_handle h2 = rdata_gen.begin_transaction("data_phase", h); + SCVNS scv_tr_handle h2 = rdata_gen.begin_transaction("data_phase", h); wait(data_rdy->posedge_event()); data_t data = bus_data.read(); wait(data_rdy->negedge_event()); @@ -147,9 +152,9 @@ rw_task_if::data_t rw_pipelined_transactor::read(const addr_t* addr) { void rw_pipelined_transactor::write(const write_t* req) { addr_phase.lock(); - scv_tr_handle h = write_gen.begin_transaction(*req); + SCVNS scv_tr_handle h = write_gen.begin_transaction(*req); h.record_attribute("data_size", sizeof(data_t)); - scv_tr_handle h1 = addr_gen.begin_transaction(req->addr, "addr_phase", h); + SCVNS scv_tr_handle h1 = addr_gen.begin_transaction(req->addr, "addr_phase", h); wait(clk->posedge_event()); bus_addr = req->addr; rw = true; @@ -162,7 +167,7 @@ void rw_pipelined_transactor::write(const write_t* req) { addr_phase.unlock(); data_phase.lock(); - scv_tr_handle h2 = wdata_gen.begin_transaction(req->data, "data_phase", h); + SCVNS scv_tr_handle h2 = wdata_gen.begin_transaction(req->data, "data_phase", h); bus_data = req->data; wait(data_rdy->posedge_event()); wait(data_rdy->negedge_event()); @@ -305,16 +310,16 @@ int sc_main(int argc, char* argv[]) { auto start = std::chrono::system_clock::now(); scc::init_logging(scc::LogConfig().logLevel(scc::log::DEBUG)); #if defined(CFTR) - scv_tr_ftr_init(true); - scv_tr_db db("my_db"); + SCVNS scv_tr_ftr_init(true); + SCVNS scv_tr_db db("my_db"); sc_trace_file* tf = scc::create_fst_trace_file("my_db"); #elif defined(FTR) - scv_tr_ftr_init(false); - scv_tr_db db("my_db"); + SCVNS scv_tr_ftr_init(false); + SCVNS scv_tr_db db("my_db"); sc_trace_file* tf = scc::create_fst_trace_file("my_db"); #else scv_tr::scv_tr_text_init(); - scv_tr_db db("my_db.txlog"); + SCVNS scv_tr_db db("my_db.txlog"); sc_trace_file* tf = sc_core::sc_create_vcd_trace_file("my_db"); #endif // create signals @@ -354,7 +359,11 @@ int sc_main(int argc, char* argv[]) { // run the simulation sc_start(10.0, SC_US); +#if defined(FTR) scc::close_fst_trace_file(tf); +#else + sc_core::sc_close_vcd_trace_file(tf); +#endif auto int_us = std::chrono::duration_cast(std::chrono::system_clock::now() - start); SCCINFO() << "simulation duration " << int_us.count() << "µs"; return 0; diff --git a/src/sysc/CMakeLists.txt b/src/sysc/CMakeLists.txt index 5f65c156..0f6fd4f4 100644 --- a/src/sysc/CMakeLists.txt +++ b/src/sysc/CMakeLists.txt @@ -24,6 +24,30 @@ else() message(FATAL_ERROR "No usable SystemC installation found") endif() +set(CMAKE_TRY_COMPILE_CONFIGURATION ${CMAKE_BUILD_TYPE}) +set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) +try_compile(COMPILE_RESULT + #SOURCES "${CMAKE_BINARY_DIR}/test_mylib.cpp" + SOURCE_FROM_CONTENT + test_mylib.cpp + " + #include + int sc_main(int argc, char* argv[]) { + auto t1 = sc_core::SC_POST_END_OF_ELABORATION; + return 0; + } + " + LINK_LIBRARIES SystemC::systemc + OUTPUT_VARIABLE COMPILE_OUTPUT + NO_LOG +) +if(${COMPILE_RESULT}) + set(HAVE_STAGE_CALLBACKS ON) + message(STATUS "${PROJECT_NAME}: building with stage callbacks") +else() + message(STATUS "${PROJECT_NAME}: building without stage callbacks") +endif() + set(LIB_SOURCES scc/utilities.cpp scc/tracer_base.cpp @@ -52,7 +76,7 @@ set(LIB_SOURCES tlm/scc/memory_map_collector.cpp ) -if(DEFINED SC_VERSION_MAJOR AND SC_VERSION_MAJOR GREATER 2) +if(HAVE_STAGE_CALLBACKS) list(APPEND LIB_SOURCES tlm/scc/qk/global_time_keeper.cpp tlm/scc/qk/sc_time_syncronizer.cpp @@ -79,10 +103,13 @@ if(ZLIB_FOUND) message(STATUS "${PROJECT_NAME}: building zlib based parts") list(APPEND LIB_SOURCES scc/scv/scv_tr_compressed.cpp - scc/fst_trace.cpp - # scc/vcd_mt_trace.cpp ) - set(WITH_FST ON) + if(HAVE_STAGE_CALLBACKS) + list(APPEND LIB_SOURCES + scc/fst_trace.cpp + ) + set(WITH_FST ON) + endif() endif() if(ENABLE_SQLITE) diff --git a/src/sysc/scc/fst_trace.hh b/src/sysc/scc/fst_trace.hh index 5ebd32c2..9d3aa59d 100644 --- a/src/sysc/scc/fst_trace.hh +++ b/src/sysc/scc/fst_trace.hh @@ -52,7 +52,7 @@ struct fst_trace_file : public sc_core::sc_trace_file, protected: #define DECL_TRACE_METHOD_A(tp) void trace(const tp& object, const std::string& name) override; #define DECL_TRACE_METHOD_B(tp) void trace(const tp& object, const std::string& name, int width) override; -#if(SYSTEMC_VERSION >= 20171012) || defined(NCSC) +#if (SYSTEMC_VERSION >= 20171012) || defined(NCSC) DECL_TRACE_METHOD_A(sc_core::sc_event) DECL_TRACE_METHOD_A(sc_core::sc_time) #endif @@ -90,7 +90,7 @@ protected: void trace(const unsigned int& object, const std::string& name, const char** enum_literals) override; #define DECL_REGISTER_METHOD_A(tp) observer::notification_handle* observe(tp const& o, std::string const& nm) override; -#if(SYSTEMC_VERSION >= 20171012) +#if (SYSTEMC_VERSION >= 20171012) DECL_REGISTER_METHOD_A(sc_core::sc_event) DECL_REGISTER_METHOD_A(sc_core::sc_time) #endif diff --git a/src/sysc/tlm/nw/tlm_array.h b/src/sysc/tlm/nw/tlm_array.h new file mode 100644 index 00000000..30b3a461 --- /dev/null +++ b/src/sysc/tlm/nw/tlm_array.h @@ -0,0 +1,108 @@ +/***************************************************************************** + + Licensed to Accellera Systems Initiative Inc. (Accellera) under one or + more contributor license agreements. See the NOTICE file distributed + with this work for additional information regarding copyright ownership. + Accellera licenses this file to you under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with the + License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied. See the License for the specific language governing + permissions and limitations under the License. + + *****************************************************************************/ + +#ifndef TLM_NW_TLM_ARRAY_H_INCLUDED_ +#define TLM_NW_TLM_ARRAY_H_INCLUDED_ + +#include + +#if defined(_MSC_VER) && !defined(SC_WIN_DLL_WARN) +#pragma warning(push) +#pragma warning(disable : 4251) // DLL import for std::string,vector +#endif + +namespace tlm { +namespace nw { +// This implements a lean and fast array class that supports array expansion on +// request. The class is primarily used for storing the pointers to the extensions. +// +// Individual array elements can be accessed through the [] operators, and the +// array length is returned by the size() method. +// +// The size can be dynamically expanded using the expand(uint) method. There +// is no shrinking mechanism implemented, because the extension mechanism +// does not require this feature. Bear in mind that calling the expand method +// may invalidate all direct pointers into the array. + +// the tlm_array shall always be used with T=tlm_extension_base* +template class tlm_array : private std::vector { + typedef std::vector base_type; + typedef typename base_type::size_type size_type; + +public: + // constructor: + tlm_array(size_type size = 0) + : base_type(size) + , m_entries() { + // m_entries.reserve(size); // optional + } + + // copy constructor: + // tlm_array(const tlm_array& orig) = default; + + // destructor: + // ~tlm_array() = default; + + // operators for dereferencing: + using base_type::operator[]; + + // array size: + using base_type::size; + + // expand the array if needed: + void expand(size_type new_size) { + if(new_size > size()) { + base_type::resize(new_size); + // m_entries.reserve(new_size); // optional + } + } + + static const char* const kind_string; + const char* kind() const { return kind_string; } + + // this function shall get a pointer to a array slot + // it stores this slot in a cache of active slots + void insert_in_cache(T* p) { + // sc_assert( (p-&(*this)[0]) < size() ); + m_entries.push_back(p - &(*this)[0]); + } + + // this functions clears all active slots of the array + void free_entire_cache() { + while(m_entries.size()) { + if((*this)[m_entries.back()]) // we make sure no one cleared the slot manually + (*this)[m_entries.back()]->free(); //...and then we call free on the content of the slot + (*this)[m_entries.back()] = 0; // afterwards we set the slot to NULL + m_entries.pop_back(); + } + } + +protected: + std::vector m_entries; +}; + +template const char* const tlm_array::kind_string = "tlm_array"; + +#if defined(_MSC_VER) && !defined(SC_WIN_DLL_WARN) +#pragma warning(pop) +#endif +} // namespace nw +} // namespace tlm + +#endif /* TLM_CORE_TLM2_TLM_ARRAY_H_INCLUDED_ */ diff --git a/src/sysc/tlm/nw/tlm_network_gp.h b/src/sysc/tlm/nw/tlm_network_gp.h index fee4ef24..50c1c592 100644 --- a/src/sysc/tlm/nw/tlm_network_gp.h +++ b/src/sysc/tlm/nw/tlm_network_gp.h @@ -17,12 +17,12 @@ #ifndef _TLM_NW_TLM_NETWROK_GP_H_ #define _TLM_NW_TLM_NETWROK_GP_H_ +#include "tlm_array.h" #include #include #ifdef CWR_SYSTEMC #include #else -#include #include #endif #include @@ -67,7 +67,7 @@ struct tlm_network_payload_base { explicit tlm_network_payload_base(tlm_base_mm_interface* mm) : m_extensions(max_num_extensions()) , m_mm(mm) - , m_ref_count(0){}; + , m_ref_count(0) {}; /** * virtual destructor. */ @@ -181,7 +181,7 @@ struct tlm_network_payload_base { void resize_extensions(); private: - tlm::tlm_array m_extensions; + tlm::nw::tlm_array m_extensions; tlm_base_mm_interface* m_mm; unsigned int m_ref_count; }; diff --git a/src/sysc/tlm/scc/qk/sc_time_syncronizer.cpp b/src/sysc/tlm/scc/qk/sc_time_syncronizer.cpp index ac17d72f..4fa12090 100644 --- a/src/sysc/tlm/scc/qk/sc_time_syncronizer.cpp +++ b/src/sysc/tlm/scc/qk/sc_time_syncronizer.cpp @@ -1,10 +1,6 @@ #include "sc_time_syncronizer.h" #include "global_time_keeper.h" #include -#include -#include -#include -#include #include #include @@ -54,7 +50,11 @@ void sc_time_syncronizer::sc_method() { } if(state == sync_state::INITIAL) state = sync_state::PROCESSING; +#ifdef NCSC + auto time_to_next_evt = sc_core::sc_time_to_pending_activity(); +#else auto time_to_next_evt = sc_core::sc_time_to_pending_activity(sc_core::sc_get_curr_simcontext()); +#endif if(sc_core::sc_get_curr_simcontext()->pending_activity_at_current_time()) { #ifdef DEBUG_MT_SCHEDULING SCCTRACEALL(__PRETTY_FUNCTION__) << "yield to next delta cycle (pending activity time: " << time_to_next_evt << ")"; diff --git a/tests/quantum_keeper_mt/top_module.h b/tests/quantum_keeper_mt/top_module.h index a08e34e7..26a785c4 100644 --- a/tests/quantum_keeper_mt/top_module.h +++ b/tests/quantum_keeper_mt/top_module.h @@ -8,10 +8,7 @@ #include #include #include -#include -#include -#include -#include +#include #include #include #include diff --git a/third_party/axi_chi b/third_party/axi_chi index e9c84766..30228c19 160000 --- a/third_party/axi_chi +++ b/third_party/axi_chi @@ -1 +1 @@ -Subproject commit e9c84766e709613068938b978288d9f355971f31 +Subproject commit 30228c1943a2da11c823132e281907a14ea0b251 diff --git a/third_party/lwtr4sc b/third_party/lwtr4sc index 34936a31..4178e382 160000 --- a/third_party/lwtr4sc +++ b/third_party/lwtr4sc @@ -1 +1 @@ -Subproject commit 34936a310d616fdfc74108eca8778853d2c05b21 +Subproject commit 4178e3820457b6bc8d6af390cbf7232d86520c03 From d1dcaff0612c79df0efd29fa5f04b0cacb0fa33b Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Wed, 24 Jun 2026 11:21:44 +0200 Subject: [PATCH 2/3] fixes version dependend inclusion and build --- cmake/FindXMSystemC.cmake | 14 ++++++++++---- src/components/scc/clock_if_mixins.h | 2 +- src/sysc/CMakeLists.txt | 10 +++------- src/sysc/scc/fst_trace.cpp | 10 +++++----- src/sysc/scc/fst_trace.hh | 6 +++--- 5 files changed, 22 insertions(+), 20 deletions(-) diff --git a/cmake/FindXMSystemC.cmake b/cmake/FindXMSystemC.cmake index 6c789834..86e7a884 100644 --- a/cmake/FindXMSystemC.cmake +++ b/cmake/FindXMSystemC.cmake @@ -85,18 +85,24 @@ if(${RUN_RESULT_VAR} EQUAL 8) set(LIB_MOD 64) endif() # set default values of variables -set(NCSC_ROOT_PATH ${CDSROOT_PATH}/tools.lnx86/systemc) set(NCSC_LIBS systemc_sh scBootstrap_sh xmscCoroutines_sh) -set(NCSC_LIB_PATHS ${CDSROOT_PATH}/tools.lnx86/systemc/lib/${BITS_MOD}/gnu) set(GCC_LIB_PATH ${CDSROOT_PATH}/tools.lnx86/cdsgcc/gcc/install/lib${LIB_MOD}) +set(NCSC_ROOT_PATH ${CDSROOT_PATH}/tools.lnx86/systemc) +set(NCSC_LIB_PATHS ${CDSROOT_PATH}/tools.lnx86/systemc/lib/${BITS_MOD}/gnu) # check if there is and will be used SystemC 3 if(NCSC_VERSION GREATER_EQUAL 2603 AND USE_NCSC_SYSTEMC3) - set(SystemC_VERSION 3.0.1) set(NCSC_ROOT_PATH ${CDSROOT_PATH}/tools.lnx86/systemc_301) set(NCSC_LIB_PATHS ${CDSROOT_PATH}/tools.lnx86/systemc_301/lib/${BITS_MOD}/gnu) + set(SC_VERSION_MAJOR 3) + set(SC_VERSION_MINOR 0) + set(SC_VERSION_PATCH 1) else() - set(SystemC_VERSION 2.3.4 CACHE STRING "SystemC Version") + set(SC_VERSION_MAJOR 2) + set(SC_VERSION_MINOR 3) + set(SC_VERSION_PATCH 4) endif() +set(SystemC_VERSION ${SC_VERSION_MAJOR}.${SC_VERSION_MINOR}.${SC_VERSION_PATCH} CACHE STRING "SystemC Version") + # seed the include directories set(NCSC_SystemC_INCLUDE_DIRS ${NCSC_ROOT_PATH}/include;${CDSROOT_PATH}/tools.lnx86/tbsc/include;${CDSROOT_PATH}/tools.lnx86/vic/include;${NCSC_ROOT_PATH}/include/factory;${NCSC_ROOT_PATH}/include/tlm2) # find needed libraries diff --git a/src/components/scc/clock_if_mixins.h b/src/components/scc/clock_if_mixins.h index c9fed1a8..643e2c71 100644 --- a/src/components/scc/clock_if_mixins.h +++ b/src/components/scc/clock_if_mixins.h @@ -88,7 +88,7 @@ class ticking_clock : public BASE } #ifdef CWR_SYSTEMC void handle_clock_parameters_updated(scml_clock_if* clk_if) override { this->set_clock_period(clk_if->get_period()); } - void handle_clock_deleted(scml_clock_if*) override{}; + void handle_clock_deleted(scml_clock_if*) override {}; #endif }; /** diff --git a/src/sysc/CMakeLists.txt b/src/sysc/CMakeLists.txt index 0f6fd4f4..f08782aa 100644 --- a/src/sysc/CMakeLists.txt +++ b/src/sysc/CMakeLists.txt @@ -101,15 +101,11 @@ endif() if(ZLIB_FOUND) message(STATUS "${PROJECT_NAME}: building zlib based parts") + set(WITH_FST ON) list(APPEND LIB_SOURCES scc/scv/scv_tr_compressed.cpp - ) - if(HAVE_STAGE_CALLBACKS) - list(APPEND LIB_SOURCES - scc/fst_trace.cpp - ) - set(WITH_FST ON) - endif() + scc/fst_trace.cpp + ) endif() if(ENABLE_SQLITE) diff --git a/src/sysc/scc/fst_trace.cpp b/src/sysc/scc/fst_trace.cpp index 93ac9881..4f130fd9 100644 --- a/src/sysc/scc/fst_trace.cpp +++ b/src/sysc/scc/fst_trace.cpp @@ -56,7 +56,7 @@ struct fst_trace { virtual uintptr_t get_hash() = 0; - virtual ~fst_trace(){}; + virtual ~fst_trace() {}; const std::string name; fstHandle fst_hndl{0}; @@ -233,7 +233,7 @@ fst_trace_file::fst_trace_file(const char* name, std::function& enable) strftime(tbuf, 199, "%b %d, %Y\t%H:%M:%S", p_tm); fstWriterSetDate(m_fst, tbuf); // fstWriterSetFileType(m_fst, FST_FT_VERILOG); -#if SC_VERSION_MAJOR < 3 +#if IEEE_1666_SYSTEMC < 202301L #if defined(WITH_SC_TRACING_PHASE_CALLBACKS) // remove from hierarchy sc_object::detach(); @@ -276,7 +276,7 @@ template bool changed(trace::fst_trace* trace) { all_traces.emplace_back(this, &changed, new trace::fst_trace_t(object, name)); \ } -#if(SYSTEMC_VERSION >= 20171012) || defined(NCSC) +#if (SYSTEMC_VERSION >= 20171012) || defined(NCSC) void fst_trace_file::trace(const sc_core::sc_event& object, const std::string& name) {} void fst_trace_file::trace(const sc_core::sc_time& object, const std::string& name) {} #endif @@ -333,7 +333,7 @@ void fst_trace_file::trace(const unsigned int& object, const std::string& name, return &all_traces.back(); \ } -#if(SYSTEMC_VERSION >= 20171012) +#if (SYSTEMC_VERSION >= 20171012) observer::notification_handle* fst_trace_file::observe(const sc_core::sc_event& object, const std::string& name) { return nullptr; } observer::notification_handle* fst_trace_file::observe(const sc_core::sc_time& object, const std::string& name) { return nullptr; } #endif @@ -446,7 +446,7 @@ void fst_trace_file::init() { triggered_traces.reserve(all_traces.size()); } -#if SC_VERSION_MAJOR >= 3 +#if IEEE_1666_SYSTEMC >= 202301L void fst_trace_file::stage_callback(const sc_core::sc_stage& stage) { cycle(false); } #endif diff --git a/src/sysc/scc/fst_trace.hh b/src/sysc/scc/fst_trace.hh index 9d3aa59d..a6f5747c 100644 --- a/src/sysc/scc/fst_trace.hh +++ b/src/sysc/scc/fst_trace.hh @@ -39,7 +39,7 @@ class fst_trace; } struct fst_trace_file : public sc_core::sc_trace_file, public observer -#if SC_VERSION_MAJOR >= 3 +#if IEEE_1666_SYSTEMC >= 202301L , public sc_core::sc_stage_callback_if #endif @@ -138,8 +138,8 @@ private: // avoid hidden overload warnings virtual void trace(sc_trace_file*) const; #endif -#if SC_VERSION_MAJOR >= 3 - void stage_callback(const sc_core::sc_stage& stage); +#if IEEE_1666_SYSTEMC >= 202301L + void stage_callback(const sc_core::sc_stage& stage) override; #endif void init(); std::function check_enabled; From 0b15e57a0bdca2afae5a8bcbf1cdd4f7dcfe7b0d Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Wed, 24 Jun 2026 12:38:31 +0200 Subject: [PATCH 3/3] applies clang-format --- src/components/scc/clock_if_mixins.h | 2 +- src/sysc/scc/fst_trace.cpp | 6 +++--- src/sysc/tlm/nw/tlm_network_gp.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/scc/clock_if_mixins.h b/src/components/scc/clock_if_mixins.h index 643e2c71..c9fed1a8 100644 --- a/src/components/scc/clock_if_mixins.h +++ b/src/components/scc/clock_if_mixins.h @@ -88,7 +88,7 @@ class ticking_clock : public BASE } #ifdef CWR_SYSTEMC void handle_clock_parameters_updated(scml_clock_if* clk_if) override { this->set_clock_period(clk_if->get_period()); } - void handle_clock_deleted(scml_clock_if*) override {}; + void handle_clock_deleted(scml_clock_if*) override{}; #endif }; /** diff --git a/src/sysc/scc/fst_trace.cpp b/src/sysc/scc/fst_trace.cpp index 4f130fd9..3e482b1a 100644 --- a/src/sysc/scc/fst_trace.cpp +++ b/src/sysc/scc/fst_trace.cpp @@ -56,7 +56,7 @@ struct fst_trace { virtual uintptr_t get_hash() = 0; - virtual ~fst_trace() {}; + virtual ~fst_trace(){}; const std::string name; fstHandle fst_hndl{0}; @@ -276,7 +276,7 @@ template bool changed(trace::fst_trace* trace) { all_traces.emplace_back(this, &changed, new trace::fst_trace_t(object, name)); \ } -#if (SYSTEMC_VERSION >= 20171012) || defined(NCSC) +#if(SYSTEMC_VERSION >= 20171012) || defined(NCSC) void fst_trace_file::trace(const sc_core::sc_event& object, const std::string& name) {} void fst_trace_file::trace(const sc_core::sc_time& object, const std::string& name) {} #endif @@ -333,7 +333,7 @@ void fst_trace_file::trace(const unsigned int& object, const std::string& name, return &all_traces.back(); \ } -#if (SYSTEMC_VERSION >= 20171012) +#if(SYSTEMC_VERSION >= 20171012) observer::notification_handle* fst_trace_file::observe(const sc_core::sc_event& object, const std::string& name) { return nullptr; } observer::notification_handle* fst_trace_file::observe(const sc_core::sc_time& object, const std::string& name) { return nullptr; } #endif diff --git a/src/sysc/tlm/nw/tlm_network_gp.h b/src/sysc/tlm/nw/tlm_network_gp.h index 50c1c592..2c2c87be 100644 --- a/src/sysc/tlm/nw/tlm_network_gp.h +++ b/src/sysc/tlm/nw/tlm_network_gp.h @@ -67,7 +67,7 @@ struct tlm_network_payload_base { explicit tlm_network_payload_base(tlm_base_mm_interface* mm) : m_extensions(max_num_extensions()) , m_mm(mm) - , m_ref_count(0) {}; + , m_ref_count(0){}; /** * virtual destructor. */