From e8def0bb86ce28ab784b658af9dc930dfdc65a39 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Sat, 6 Jul 2024 10:07:51 +0200 Subject: [PATCH 01/31] switches to Conan 2 --- .cproject | 13 +- .gitmodules | 3 + CMakeLists.txt | 22 +- CMakePresets.json | 40 ++++ CMakeUserPresets.json | 9 + Jenkinsfile | 11 +- Modulefile | 2 +- README.md | 5 +- build.log | 490 ++++++++++++++++++++++++++++++++++++++++++ cmake-conan | 1 + conanfile.txt | 43 ++++ requirements.txt | 2 +- scc | 2 +- 13 files changed, 605 insertions(+), 38 deletions(-) create mode 100644 CMakePresets.json create mode 100644 CMakeUserPresets.json create mode 100644 build.log create mode 160000 cmake-conan create mode 100644 conanfile.txt diff --git a/.cproject b/.cproject index 5484523..f7efdd6 100644 --- a/.cproject +++ b/.cproject @@ -14,7 +14,7 @@ - + @@ -64,10 +64,9 @@ - - + + - @@ -99,10 +98,9 @@ - - + + - @@ -121,6 +119,7 @@ + diff --git a/.gitmodules b/.gitmodules index 6211793..1ddda03 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "scc"] path = scc url = https://github.com/Minres/SystemC-Components.git +[submodule "cmake-conan"] + path = cmake-conan + url = https://github.com/conan-io/cmake-conan.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 808a583..9f923b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,11 +8,9 @@ option(FULL_TEST_SUITE "enable also long-running tests" OFF) option(ENABLE_SCV "Enable use of SCV" OFF) option(ENABLE_CLANG_TIDY "Enable clang-tidy checks" OFF) -include(ConanInline) include(GNUInstallDirs) include(BuildType) -set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_POSITION_INDEPENDENT_CODE ON) @@ -20,14 +18,6 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON) include(CheckCXXCompilerFlag) CHECK_CXX_COMPILER_FLAG("-march=native" COMPILER_SUPPORTS_MARCH_NATIVE) -if(COMPILER_SUPPORTS_MARCH_NATIVE) - if("${CMAKE_BUILD_TYPE}" STREQUAL "") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native") - elseif(NOT(${CMAKE_BUILD_TYPE} STREQUAL "RelWithDebInfo")) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native") - endif() -endif() - if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") set(warnings "-Wall -Wextra -Werror") set(CMAKE_CXX_FLAG_RELEASE "-O3 -DNDEBUG") @@ -39,11 +29,10 @@ endif() if(ENABLE_COVERAGE) include(CodeCoverage) append_coverage_compiler_flags() - set(COVERAGE_EXCLUDES "osci-lib/scc/*" "/engr/dev/tools/*") endif() -find_program(CLANG_TIDY_EXE NAMES "clang-tidy") if(ENABLE_CLANG_TIDY) + find_program(CLANG_TIDY_EXE NAMES "clang-tidy") if(CLANG_TIDY_EXE) message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}") #set(CLANG_TIDY_CHECKS "-*,modernize-*,-modernize-use-trailing-return-type,clang-analyzer-core.*,clang-analyzer-cplusplus.*") @@ -56,15 +45,6 @@ endif() set(CLANG_FORMAT_EXCLUDE_PATTERNS "/third_party/") find_package(ClangFormat) - -set(CONAN_CMAKE_SILENT_OUTPUT ON) -conan_check() -conan_configure(REQUIRES jsoncpp/1.9.5 yaml-cpp/0.6.3 spdlog/1.9.2 fmt/8.0.1 boost/1.85.0 gsl-lite/0.37.0 systemc/2.3.4 catch2/3.1.0 zlib/1.2.11 lz4/1.9.4 - GENERATORS cmake_find_package - OPTIONS fmt:header_only=True spdlog:header_only=True - ) -conan_install() - find_package(ZLIB) find_package(lz4) # This line finds the boost lib and headers. diff --git a/CMakePresets.json b/CMakePresets.json new file mode 100644 index 0000000..7db4d33 --- /dev/null +++ b/CMakePresets.json @@ -0,0 +1,40 @@ +{ + "version": 3, + "vendor": { + "conan": {} + }, + "cmakeMinimumRequired": { + "major": 3, + "minor": 24, + "patch": 0 + }, + "configurePresets": [ + { + "name": "Debug", + "cacheVariables": { + "CMAKE_POLICY_DEFAULT_CMP0091": "NEW", + "CMAKE_BUILD_TYPE": "Debug", + "CMAKE_CXX_STANDARD": "17", + "CMAKE_PROJECT_TOP_LEVEL_INCLUDES":"cmake-conan/conan_provider.cmake" + } + }, + { + "name": "RelWithDebInfo", + "cacheVariables": { + "CMAKE_POLICY_DEFAULT_CMP0091": "NEW", + "CMAKE_BUILD_TYPE": "RelWithDebInfo", + "CMAKE_CXX_STANDARD": "17", + "CMAKE_PROJECT_TOP_LEVEL_INCLUDES":"cmake-conan/conan_provider.cmake" + } + }, + { + "name": "Release", + "cacheVariables": { + "CMAKE_POLICY_DEFAULT_CMP0091": "NEW", + "CMAKE_BUILD_TYPE": "Release", + "CMAKE_CXX_STANDARD": "17", + "CMAKE_PROJECT_TOP_LEVEL_INCLUDES":"cmake-conan/conan_provider.cmake" + } + } + ] +} \ No newline at end of file diff --git a/CMakeUserPresets.json b/CMakeUserPresets.json new file mode 100644 index 0000000..3b9486d --- /dev/null +++ b/CMakeUserPresets.json @@ -0,0 +1,9 @@ +{ + "version": 4, + "vendor": { + "conan": {} + }, + "include": [ + "build/Debug/conan/build/Debug/generators/CMakePresets.json" + ] +} \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile index fa67378..39e8875 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -31,16 +31,17 @@ void checkout_project() { void setup_conan() { sh''' - pip3 install --user "conan<2.0" pyucis + python3 -mvenv .venv + . .venv/bin/activate + pip3 install -r requirements.txt conan profile new default --detect --force - conan remote list | grep minres > /dev/null - [ $? ] || conan remote add minres https://git.minres.com/api/packages/Tooling/conan ''' } void build_n_test_project() { sh''' - cmake -S . -B build + . .venv/bin/activate + cmake -S . -B build --preset Release cmake --build build -j12 cmake --build build --target test ''' @@ -97,7 +98,7 @@ pipeline { stage('Setup') { steps { setup_conan() }} stage('Build & check format') { steps { sh''' - cmake -S . -B build + cmake -S . -B build --preset Release cmake --build build --target format-check ''' }} diff --git a/Modulefile b/Modulefile index 5d602fb..4891e78 100644 --- a/Modulefile +++ b/Modulefile @@ -13,5 +13,5 @@ if { $distro == "CentOS" && ![info exists ::env(PROJECT)] && ![info exists ::env } module load tools/utilities -module load tools/cmake +module load tools/cmake/3.28 module load tools/clang/14.0 diff --git a/README.md b/README.md index 171f11e..98bb81b 100644 --- a/README.md +++ b/README.md @@ -12,9 +12,10 @@ In Console: module load ./Modulefile python3 -mvenv .venv . .venv/bin/activate - pip3 install conan==1.59.0 - cmake -S . -B build + pip3 install -r requirements.txt + cmake -S . -B build --preset Release cmake --build build -j30 + cmake --build build --target test \ No newline at end of file diff --git a/build.log b/build.log new file mode 100644 index 0000000..978a142 --- /dev/null +++ b/build.log @@ -0,0 +1,490 @@ +[ 1%] Building CXX object scc/third_party/scv-tr/src/CMakeFiles/scv-tr.dir/scv-tr/scv_introspection.cpp.o +[ 2%] Building CXX object scc/third_party/scv-tr/src/CMakeFiles/scv-tr.dir/scv-tr/scv_tr_text.cpp.o +[ 3%] Building CXX object scc/third_party/scv-tr/src/CMakeFiles/scv-tr.dir/scv-tr/scv_tr.cpp.o +[ 3%] Building CXX object scc/src/common/CMakeFiles/scc-util.dir/util/io-redirector.cpp.o +[ 4%] Building CXX object scc/third_party/scv-tr/src/CMakeFiles/scv-tr.dir/scv-tr/scv_report.cpp.o +[ 5%] Building C object scc/third_party/fst/CMakeFiles/fstapi.dir/fstapi.c.o +[ 6%] Building CXX object scc/src/common/CMakeFiles/scc-util.dir/util/watchdog.cpp.o +[ 8%] Building CXX object scc/src/common/CMakeFiles/scc-util.dir/util/lz4_streambuf.cpp.o +[ 9%] Building C object scc/third_party/fst/CMakeFiles/fstapi.dir/fastlz.c.o +[ 9%] Building CXX object scc/third_party/lwtr4sc/src/CMakeFiles/lwtr.dir/lwtr/util/lz4_streambuf.cpp.o +[ 9%] Building CXX object scc/third_party/lwtr4sc/src/CMakeFiles/lwtr.dir/lwtr/lwtr.cpp.o +[ 10%] Building CXX object scc/third_party/lwtr4sc/src/CMakeFiles/lwtr.dir/lwtr/lwtr_text.cpp.o +[ 11%] Building CXX object scc/third_party/cci-1.0.0/CMakeFiles/cciapi.dir/cci_cfg/cci_broker_manager.cpp.o +[ 12%] Building CXX object scc/third_party/lwtr4sc/src/CMakeFiles/lwtr.dir/lwtr/lwtr_ftr.cpp.o +[ 13%] Building CXX object scc/third_party/cci-1.0.0/CMakeFiles/cciapi.dir/cci_cfg/cci_originator.cpp.o +[ 14%] Building CXX object scc/third_party/cci-1.0.0/CMakeFiles/cciapi.dir/cci_cfg/cci_param_if.cpp.o +[ 15%] Building CXX object scc/third_party/cci-1.0.0/CMakeFiles/cciapi.dir/cci_cfg/cci_param_untyped_handle.cpp.o +[ 15%] Building CXX object scc/third_party/cci-1.0.0/CMakeFiles/cciapi.dir/cci_cfg/cci_param_untyped.cpp.o +[ 16%] Building CXX object scc/third_party/cci-1.0.0/CMakeFiles/cciapi.dir/cci_core/cci_value.cpp.o +[ 17%] Building CXX object scc/third_party/cci-1.0.0/CMakeFiles/cciapi.dir/cci_core/cci_name_gen.cpp.o +[ 18%] Building CXX object scc/third_party/cci-1.0.0/CMakeFiles/cciapi.dir/cci_cfg/cci_report_handler.cpp.o +[ 19%] Building CXX object scc/third_party/cci-1.0.0/CMakeFiles/cciapi.dir/cci_core/cci_value_converter.cpp.o +[ 20%] Building CXX object scc/third_party/cci-1.0.0/CMakeFiles/cciapi.dir/cci_utils/broker.cpp.o +[ 21%] Building CXX object scc/third_party/cci-1.0.0/CMakeFiles/cciapi.dir/cci_cfg/cci_broker_handle.cpp.o +[ 22%] Building CXX object scc/third_party/cci-1.0.0/CMakeFiles/cciapi.dir/cci_utils/consuming_broker.cpp.o +[ 23%] Linking C static library libfstapi.a +[ 23%] Built target fstapi +[ 24%] Linking CXX static library libcciapi.a +[ 24%] Built target cciapi +[ 25%] Linking CXX static library libscc-util.a +[ 25%] Built target scc-util +[ 26%] Building CXX object tests/io-redirector/CMakeFiles/io_redirector.dir/test.cpp.o +[ 26%] Linking CXX static library libscv-tr.a +[ 26%] Built target scv-tr +[ 27%] Linking CXX executable io_redirector +[ 27%] Built target io_redirector +[ 28%] Linking CXX static library liblwtr.a +[ 28%] Built target lwtr +[ 29%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/utilities.cpp.o +[ 30%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/sc_logic_7.cpp.o +[ 31%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/tracer_base.cpp.o +[ 31%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/tracer.cpp.o +[ 32%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/perf_estimator.cpp.o +[ 33%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/time_n_tick.cpp.o +[ 34%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/report.cpp.o +[ 35%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/scv/scv_tr_mtc.cpp.o +[ 36%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/value_registry.cpp.o +[ 37%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/mt19937_rng.cpp.o +[ 39%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/scv/scv_tr_ftr.cpp.o +[ 39%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/ordered_semaphore.cpp.o +[ 39%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/scv/scv_tr_lz4.cpp.o +[ 40%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/vcd_push_trace.cpp.o +[ 41%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/tlm/scc/scv/tlm_recorder.cpp.o +[ 42%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/tlm/scc/pe/parallel_pe.cpp.o +[ 43%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/vcd_pull_trace.cpp.o +[ 44%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/hierarchy_dumper.cpp.o +[ 45%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/cci_broker.cpp.o +[ 46%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/configurer.cpp.o +[ 46%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/configurable_tracer.cpp.o +[ 47%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/sc_thread_pool.cpp.o +[ 48%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/tlm/scc/lwtr/tlm2_lwtr.cpp.o +[ 50%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/signal_opt_ports.cpp.o +[ 51%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/scv/scv_tr_compressed.cpp.o +[ 52%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/fst_trace.cpp.o +[ 53%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/vcd_mt_trace.cpp.o +[ 54%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/scv/scv_tr_sqlite.cpp.o +[ 55%] Building C object scc/src/sysc/CMakeFiles/scc-sysc.dir/__/__/third_party/sqlite3/sqlite3.c.o +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/cci-1.0.0/cci_core/cci_callback.h:147:7: warning: Use of memory after it is freed [clang-analyzer-cplusplus.NewDelete] + m_cb->release(); + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/src/sysc/scc/configurer.cpp:524:13: note: Assuming 'attr' is non-null + if(auto attr = dynamic_cast*>(base_attr)) { + ^~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/src/sysc/scc/configurer.cpp:524:5: note: Taking true branch + if(auto attr = dynamic_cast*>(base_attr)) { + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/src/sysc/scc/configurer.cpp:532:9: note: Calling 'cci_param_typed::register_post_write_callback' + par->register_post_write_callback(params.back().first); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/cci-1.0.0/cci_cfg/cci_param_typed.h:874:1: note: Calling '~cci_callback_untyped_handle' +CCI_PARAM_TYPED_CALLBACK_IMPL_(post_write) +^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/cci-1.0.0/cci_cfg/cci_param_typed.h:855:58: note: expanded from macro 'CCI_PARAM_TYPED_CALLBACK_IMPL_' + return cci_param_untyped::register_##name##_callback(cb, get_originator());\ + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/cci-1.0.0/cci_core/cci_callback.h:220:9: note: Field 'm_cb' is non-null + if (m_cb) + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/cci-1.0.0/cci_core/cci_callback.h:220:5: note: Taking true branch + if (m_cb) + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/cci-1.0.0/cci_core/cci_callback.h:221:7: note: Calling 'callback_generic_adapt::release' + m_cb->release(); + ^~~~~~~~~~~~~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/cci-1.0.0/cci_core/cci_callback_impl.h:218:32: note: Assuming the condition is true + virtual void release() { if (!--m_refcnt) delete this; } + ^~~~~~~~~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/cci-1.0.0/cci_core/cci_callback_impl.h:218:28: note: Taking true branch + virtual void release() { if (!--m_refcnt) delete this; } + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/cci-1.0.0/cci_core/cci_callback_impl.h:218:45: note: Memory is released + virtual void release() { if (!--m_refcnt) delete this; } + ^~~~~~~~~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/cci-1.0.0/cci_core/cci_callback.h:221:7: note: Returning; memory was released + m_cb->release(); + ^~~~~~~~~~~~~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/cci-1.0.0/cci_cfg/cci_param_typed.h:874:1: note: Returning from '~cci_callback_untyped_handle' +CCI_PARAM_TYPED_CALLBACK_IMPL_(post_write) +^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/cci-1.0.0/cci_cfg/cci_param_typed.h:855:58: note: expanded from macro 'CCI_PARAM_TYPED_CALLBACK_IMPL_' + return cci_param_untyped::register_##name##_callback(cb, get_originator());\ + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/src/sysc/scc/configurer.cpp:532:9: note: Returning; memory was released + par->register_post_write_callback(params.back().first); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/src/sysc/scc/configurer.cpp:532:57: note: Calling '~cci_callback' + par->register_post_write_callback(params.back().first); + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/cci-1.0.0/cci_core/cci_callback.h:146:9: note: Field 'm_cb' is non-null + if (m_cb) + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/cci-1.0.0/cci_core/cci_callback.h:146:5: note: Taking true branch + if (m_cb) + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/cci-1.0.0/cci_core/cci_callback.h:147:7: note: Use of memory after it is freed + m_cb->release(); + ^~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:39:9: warning: The expression is an uninitialized value. The computed value will also be garbage [clang-analyzer-core.uninitialized.Assign] + buffer[len - 1]--; + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/src/sysc/scc/configurer.cpp:134:1: note: Calling 'PrettyWriter::Double' +FDECL(float, Double) +^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/src/sysc/scc/configurer.cpp:125:9: note: expanded from macro 'FDECL' + writer.FUNC(value); \ + ^~~~~~~~~~~~~~~~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/prettywriter.h:101:84: note: Calling 'Writer::WriteDouble' + bool Double(double d) { PrettyPrefix(kNumberType); return Base::EndValue(Base::WriteDouble(d)); } + ^~~~~~~~~~~~~~~~~~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/writer.h:350:13: note: Assuming the condition is false + if (internal::Double(d).IsNanOrInf()) { + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/writer.h:350:9: note: Taking false branch + if (internal::Double(d).IsNanOrInf()) { + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/writer.h:370:21: note: Calling 'dtoa' + char* end = internal::dtoa(d, buffer, maxDecimalPlaces_); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:221:22: note: Assuming 'maxDecimalPlaces' is >= 1 + RAPIDJSON_ASSERT(maxDecimalPlaces >= 1); + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/error/../rapidjson.h:437:36: note: expanded from macro 'RAPIDJSON_ASSERT' +#define RAPIDJSON_ASSERT(x) assert(x) + ^ +/usr/include/assert.h:90:27: note: expanded from macro 'assert' + (static_cast (expr) \ + ^~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:221:5: note: '?' condition is true + RAPIDJSON_ASSERT(maxDecimalPlaces >= 1); + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/error/../rapidjson.h:437:29: note: expanded from macro 'RAPIDJSON_ASSERT' +#define RAPIDJSON_ASSERT(x) assert(x) + ^ +/usr/include/assert.h:90:7: note: expanded from macro 'assert' + (static_cast (expr) \ + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:223:9: note: Assuming the condition is false + if (d.IsZero()) { + ^~~~~~~~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:223:5: note: Taking false branch + if (d.IsZero()) { + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:232:13: note: Assuming 'value' is >= 0 + if (value < 0) { + ^~~~~~~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:232:9: note: Taking false branch + if (value < 0) { + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:237:9: note: Calling 'Grisu2' + Grisu2(value, buffer, &length, &K); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:127:5: note: Calling 'DigitGen' + DigitGen(W, Wp, Wp.f - Wm.f, buffer, length, K); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:73:5: note: Loop condition is true. Entering loop body + while (kappa > 0) { + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:75:9: note: Control jumps to 'case 1:' at line 84 + switch (kappa) { + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:84:61: note: Execution continues on line 87 + case 1: d = p1; p1 = 0; break; + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:87:13: note: Assuming 'd' is 0 + if (d || *len) + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:87:13: note: Left side of '||' is false +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:87:9: note: Taking false branch + if (d || *len) + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:91:13: note: Assuming 'tmp' is <= 'delta' + if (tmp <= delta) { + ^~~~~~~~~~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:91:9: note: Taking true branch + if (tmp <= delta) { + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:93:13: note: Calling 'GrisuRound' + GrisuRound(buffer, *len, delta, tmp, kPow10[kappa] << -one.e, wp_w.f); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:36:12: note: Assuming 'rest' is < 'wp_w' + while (rest < wp_w && delta - rest >= ten_kappa && + ^~~~~~~~~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:36:12: note: Left side of '&&' is true +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:36:27: note: Assuming the condition is true + while (rest < wp_w && delta - rest >= ten_kappa && + ^~~~~~~~~~~~~~~~~~~~~~~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:36:12: note: Left side of '&&' is true + while (rest < wp_w && delta - rest >= ten_kappa && + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:37:13: note: Assuming the condition is true + (rest + ten_kappa < wp_w || /// closer + ^~~~~~~~~~~~~~~~~~~~~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:37:37: note: Left side of '||' is true + (rest + ten_kappa < wp_w || /// closer + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:39:9: note: The expression is an uninitialized value. The computed value will also be garbage + buffer[len - 1]--; + ^~~~~~~~~~~~~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/writer.h:373:13: warning: 2nd function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage] + PutUnsafe(*os_, static_cast(*p)); + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/src/sysc/scc/configurer.cpp:134:1: note: Calling 'PrettyWriter::Double' +FDECL(float, Double) +^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/src/sysc/scc/configurer.cpp:125:9: note: expanded from macro 'FDECL' + writer.FUNC(value); \ + ^~~~~~~~~~~~~~~~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/prettywriter.h:101:84: note: Calling 'Writer::WriteDouble' + bool Double(double d) { PrettyPrefix(kNumberType); return Base::EndValue(Base::WriteDouble(d)); } + ^~~~~~~~~~~~~~~~~~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/writer.h:350:13: note: Assuming the condition is false + if (internal::Double(d).IsNanOrInf()) { + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/writer.h:350:9: note: Taking false branch + if (internal::Double(d).IsNanOrInf()) { + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/writer.h:370:21: note: Calling 'dtoa' + char* end = internal::dtoa(d, buffer, maxDecimalPlaces_); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:221:22: note: Assuming 'maxDecimalPlaces' is >= 1 + RAPIDJSON_ASSERT(maxDecimalPlaces >= 1); + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/error/../rapidjson.h:437:36: note: expanded from macro 'RAPIDJSON_ASSERT' +#define RAPIDJSON_ASSERT(x) assert(x) + ^ +/usr/include/assert.h:90:27: note: expanded from macro 'assert' + (static_cast (expr) \ + ^~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:221:5: note: '?' condition is true + RAPIDJSON_ASSERT(maxDecimalPlaces >= 1); + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/error/../rapidjson.h:437:29: note: expanded from macro 'RAPIDJSON_ASSERT' +#define RAPIDJSON_ASSERT(x) assert(x) + ^ +/usr/include/assert.h:90:7: note: expanded from macro 'assert' + (static_cast (expr) \ + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:223:9: note: Assuming the condition is false + if (d.IsZero()) { + ^~~~~~~~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:223:5: note: Taking false branch + if (d.IsZero()) { + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:232:13: note: Assuming 'value' is >= 0 + if (value < 0) { + ^~~~~~~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:232:9: note: Taking false branch + if (value < 0) { + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:237:9: note: Calling 'Grisu2' + Grisu2(value, buffer, &length, &K); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:127:5: note: Calling 'DigitGen' + DigitGen(W, Wp, Wp.f - Wm.f, buffer, length, K); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:73:5: note: Loop condition is true. Entering loop body + while (kappa > 0) { + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:75:9: note: Control jumps to 'case 9:' at line 76 + switch (kappa) { + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:76:61: note: Execution continues on line 87 + case 9: d = p1 / 100000000; p1 %= 100000000; break; + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:87:13: note: Assuming 'd' is 0 + if (d || *len) + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:87:13: note: Left side of '||' is false +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:87:9: note: Taking false branch + if (d || *len) + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:91:13: note: Assuming 'tmp' is <= 'delta' + if (tmp <= delta) { + ^~~~~~~~~~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:91:9: note: Taking true branch + if (tmp <= delta) { + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:93:13: note: Calling 'GrisuRound' + GrisuRound(buffer, *len, delta, tmp, kPow10[kappa] << -one.e, wp_w.f); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:36:12: note: Assuming 'rest' is >= 'wp_w' + while (rest < wp_w && delta - rest >= ten_kappa && + ^~~~~~~~~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:36:24: note: Left side of '&&' is false + while (rest < wp_w && delta - rest >= ten_kappa && + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:93:13: note: Returning from 'GrisuRound' + GrisuRound(buffer, *len, delta, tmp, kPow10[kappa] << -one.e, wp_w.f); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:127:5: note: Returning from 'DigitGen' + DigitGen(W, Wp, Wp.f - Wm.f, buffer, length, K); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:237:9: note: Returning from 'Grisu2' + Grisu2(value, buffer, &length, &K); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:238:16: note: Calling 'Prettify' + return Prettify(buffer, length, K, maxDecimalPlaces); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:157:9: note: Assuming 'k' is < 0 + if (0 <= k && kk <= 21) { + ^~~~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:157:16: note: Left side of '&&' is false + if (0 <= k && kk <= 21) { + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:165:18: note: 'kk' is <= 0 + else if (0 < kk && kk <= 21) { + ^~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:165:21: note: Left side of '&&' is false + else if (0 < kk && kk <= 21) { + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:180:14: note: Assuming the condition is true + else if (-6 < kk && kk <= 0) { + ^~~~~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:180:14: note: Left side of '&&' is true +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:180:25: note: 'kk' is <= 0 + else if (-6 < kk && kk <= 0) { + ^~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:180:10: note: Taking true branch + else if (-6 < kk && kk <= 0) { + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:186:25: note: Assuming 'i' is >= 'offset' + for (int i = 2; i < offset; i++) + ^~~~~~~~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:186:9: note: Loop condition is false. Execution continues on line 188 + for (int i = 2; i < offset; i++) + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:188:13: note: Assuming the condition is false + if (length - kk > maxDecimalPlaces) { + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:188:9: note: Taking false branch + if (length - kk > maxDecimalPlaces) { + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:238:16: note: Returning from 'Prettify' + return Prettify(buffer, length, K, maxDecimalPlaces); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/writer.h:370:21: note: Returning from 'dtoa' + char* end = internal::dtoa(d, buffer, maxDecimalPlaces_); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/writer.h:372:32: note: Assuming 'p' is not equal to 'end' + for (char* p = buffer; p != end; ++p) + ^~~~~~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/writer.h:372:9: note: Loop condition is true. Entering loop body + for (char* p = buffer; p != end; ++p) + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/writer.h:372:32: note: Assuming 'p' is not equal to 'end' + for (char* p = buffer; p != end; ++p) + ^~~~~~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/writer.h:372:9: note: Loop condition is true. Entering loop body + for (char* p = buffer; p != end; ++p) + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/writer.h:372:32: note: Assuming 'p' is not equal to 'end' + for (char* p = buffer; p != end; ++p) + ^~~~~~~~ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/writer.h:372:9: note: Loop condition is true. Entering loop body + for (char* p = buffer; p != end; ++p) + ^ +/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/writer.h:373:13: note: 2nd function call argument is an uninitialized value + PutUnsafe(*os_, static_cast(*p)); + ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +[ 56%] Linking CXX static library libscc-sysc.a +[ 56%] Built target scc-sysc +[ 57%] Building CXX object tests/configuration/CMakeFiles/cci-example.dir/sc_main.cpp.o +[ 57%] Building CXX object tests/configurer/CMakeFiles/configurer.dir/sc_main.cpp.o +[ 59%] Building CXX object scc/third_party/axi_chi/CMakeFiles/tlm-interfaces.dir/chi/pe/chi_rn_initiator.cpp.o +[ 59%] Building CXX object scc/third_party/axi_chi/CMakeFiles/tlm-interfaces.dir/chi/chi_tlm.cpp.o +[ 60%] Building CXX object scc/third_party/axi_chi/CMakeFiles/tlm-interfaces.dir/chi/lwtr/chi_lwtr.cpp.o +[ 61%] Building CXX object scc/third_party/axi_chi/CMakeFiles/tlm-interfaces.dir/axi/fsm/base.cpp.o +[ 62%] Building CXX object scc/third_party/axi_chi/CMakeFiles/tlm-interfaces.dir/axi/axi_tlm.cpp.o +[ 63%] Building CXX object scc/third_party/axi_chi/CMakeFiles/tlm-interfaces.dir/axi/pe/ace_target_pe.cpp.o +[ 63%] Building CXX object scc/third_party/axi_chi/CMakeFiles/tlm-interfaces.dir/axi/pe/axi_target_pe.cpp.o +[ 64%] Building CXX object scc/third_party/axi_chi/CMakeFiles/tlm-interfaces.dir/axi/pe/axi_initiator.cpp.o +[ 65%] Building CXX object scc/third_party/axi_chi/CMakeFiles/tlm-interfaces.dir/axi/pe/reordering_target.cpp.o +[ 66%] Building CXX object scc/third_party/axi_chi/CMakeFiles/tlm-interfaces.dir/axi/pe/simple_initiator.cpp.o +[ 67%] Building CXX object scc/third_party/axi_chi/CMakeFiles/tlm-interfaces.dir/axi/scv/axi_ace_scv.cpp.o +[ 70%] Building CXX object scc/third_party/axi_chi/CMakeFiles/tlm-interfaces.dir/axi/checker/ace_protocol.cpp.o +[ 70%] Building CXX object scc/third_party/axi_chi/CMakeFiles/tlm-interfaces.dir/axi/checker/axi_protocol.cpp.o +[ 70%] Building CXX object scc/third_party/axi_chi/CMakeFiles/tlm-interfaces.dir/axi/lwtr/axi_ace_lwtr.cpp.o +[ 71%] Building CXX object scc/third_party/axi_chi/CMakeFiles/tlm-interfaces.dir/axi/pe/ordered_target.cpp.o +[ 72%] Linking CXX executable configurer +[ 72%] Built target configurer +[ 73%] Linking CXX executable cci-example +[ 73%] Built target cci-example +[ 74%] Linking CXX static library libtlm-interfaces.a +[ 74%] Built target tlm-interfaces +[ 74%] Building CXX object scc/src/bus_interfaces/CMakeFiles/busses.dir/ahb/ahb_tlm.cpp.o +[ 75%] Building CXX object scc/src/bus_interfaces/CMakeFiles/busses.dir/ahb/pin/initiator.cpp.o +[ 76%] Building CXX object scc/src/bus_interfaces/CMakeFiles/busses.dir/ahb/pe/ahb_initiator.cpp.o +[ 77%] Building CXX object scc/src/bus_interfaces/CMakeFiles/busses.dir/apb/pe/apb_initiator.cpp.o +[ 78%] Building CXX object scc/src/bus_interfaces/CMakeFiles/busses.dir/apb/pe/apb_target.cpp.o +[ 79%] Building CXX object scc/src/bus_interfaces/CMakeFiles/busses.dir/axi/axi_initiator.cpp.o +[ 80%] Building CXX object scc/src/bus_interfaces/CMakeFiles/busses.dir/axi/axi_target.cpp.o +[ 81%] Building CXX object scc/src/bus_interfaces/CMakeFiles/busses.dir/ahb/pe/ahb_target.cpp.o +[ 82%] Building CXX object scc/src/bus_interfaces/CMakeFiles/busses.dir/ahb/pin/target.cpp.o +[ 82%] Linking CXX static library libbusses.a +[ 82%] Built target busses +[ 83%] Linking CXX shared library libscc_shared.so +[ 84%] Building CXX object src/CMakeFiles/test_util.dir/factory.cpp.o +[ 85%] Linking CXX static library libtest_util.a +[ 85%] Built target test_util +[ 86%] Building CXX object tests/ahb_pin_level/CMakeFiles/ahb_pin_level.dir/bus_test.cpp.o +[ 87%] Building CXX object tests/cci_param_restricted/CMakeFiles/cci_param_restricted.dir/test.cpp.o +[ 88%] Building CXX object tests/ahb_pin_level/CMakeFiles/ahb_pin_level.dir/__/__/src/sc_main.cpp.o +[ 89%] Building CXX object tests/cci_param_restricted/CMakeFiles/cci_param_restricted.dir/__/__/src/sc_main.cpp.o +[ 90%] Building CXX object tests/ordered_semaphore/CMakeFiles/ordered_semaphore.dir/test.cpp.o +[ 91%] Building CXX object tests/ordered_semaphore/CMakeFiles/ordered_semaphore.dir/__/__/src/sc_main.cpp.o +[ 92%] Building CXX object tests/axi4_pin_level/CMakeFiles/axi4_pin_level.dir/narrow_burst_test.cpp.o +[ 92%] Building CXX object tests/ace_pin_level/CMakeFiles/ace_pin_level.dir/ace_narrow_burst_test.cpp.o +[ 93%] Building CXX object tests/axi4_pin_level/CMakeFiles/axi4_pin_level.dir/__/__/src/sc_main.cpp.o +[ 94%] Building CXX object tests/ace_pin_level/CMakeFiles/ace_pin_level.dir/__/__/src/sc_main.cpp.o +[ 94%] Built target scc_shared +[ 95%] Linking CXX executable ordered_semaphore + + SystemC 2.3.4-Accellera --- Jul 5 2024 07:23:11 + Copyright (c) 1996-2022 by all Contributors, + ALL RIGHTS RESERVED + + SystemC 2.3.4-Accellera --- Jul 5 2024 07:23:11 + Copyright (c) 1996-2022 by all Contributors, + ALL RIGHTS RESERVED +[ 95%] Built target ordered_semaphore +[ 96%] Linking CXX executable cci_param_restricted + + SystemC 2.3.4-Accellera --- Jul 5 2024 07:23:11 + Copyright (c) 1996-2022 by all Contributors, + ALL RIGHTS RESERVED + + SystemC 2.3.4-Accellera --- Jul 5 2024 07:23:11 + Copyright (c) 1996-2022 by all Contributors, + ALL RIGHTS RESERVED +[ 96%] Built target cci_param_restricted +[ 97%] Linking CXX executable axi4_pin_level +[ 98%] Linking CXX executable ace_pin_level + + SystemC 2.3.4-Accellera --- Jul 5 2024 07:23:11 + Copyright (c) 1996-2022 by all Contributors, + ALL RIGHTS RESERVED + + SystemC 2.3.4-Accellera --- Jul 5 2024 07:23:11 + Copyright (c) 1996-2022 by all Contributors, + ALL RIGHTS RESERVED +[ 98%] Built target axi4_pin_level +[100%] Linking CXX executable ahb_pin_level + + SystemC 2.3.4-Accellera --- Jul 5 2024 07:23:11 + Copyright (c) 1996-2022 by all Contributors, + ALL RIGHTS RESERVED + + SystemC 2.3.4-Accellera --- Jul 5 2024 07:23:11 + Copyright (c) 1996-2022 by all Contributors, + ALL RIGHTS RESERVED +[100%] Built target ace_pin_level + + SystemC 2.3.4-Accellera --- Jul 5 2024 07:23:11 + Copyright (c) 1996-2022 by all Contributors, + ALL RIGHTS RESERVED + + SystemC 2.3.4-Accellera --- Jul 5 2024 07:23:11 + Copyright (c) 1996-2022 by all Contributors, + ALL RIGHTS RESERVED +[100%] Built target ahb_pin_level diff --git a/cmake-conan b/cmake-conan new file mode 160000 index 0000000..eba63de --- /dev/null +++ b/cmake-conan @@ -0,0 +1 @@ +Subproject commit eba63de908a994299731b49e8c84dc3d1da7896e diff --git a/conanfile.txt b/conanfile.txt new file mode 100644 index 0000000..b402279 --- /dev/null +++ b/conanfile.txt @@ -0,0 +1,43 @@ +[requires] +jsoncpp/1.9.5 +yaml-cpp/0.6.3 +spdlog/1.9.2 +fmt/8.0.1 +boost/1.85.0 +gsl-lite/0.37.0 +systemc/2.3.4 +catch2/3.1.0 +zlib/1.2.11 +lz4/1.9.4 + +[options] +boost/*:fPIC=True +boost/*:header_only=False +boost/*:without_contract=True +boost/*:without_fiber=True +boost/*:without_graph=True +boost/*:without_graph_parallel=True +boost/*:without_iostreams=True +boost/*:without_json=True +boost/*:without_locale=True +boost/*:without_log=True +boost/*:without_math=True +boost/*:without_mpi=True +boost/*:without_nowide=True +boost/*:without_python=True +boost/*:without_random=True +boost/*:without_regex=True +boost/*:without_stacktrace=True +boost/*:without_test=True +boost/*:without_timer=True +boost/*:without_type_erasure=True +boost/*:without_wave=True +systemc/*:shared=False +systemc/*:disable_virtual_bind=False + +[generators] +CMakeDeps +CMakeToolchain + +[layout] +cmake_layout diff --git a/requirements.txt b/requirements.txt index f5ad00c..a646a0e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -conan<2.0 +conan>=2.0 diff --git a/scc b/scc index 803a6bb..d10d5f6 160000 --- a/scc +++ b/scc @@ -1 +1 @@ -Subproject commit 803a6bba4d979dad70e797236f8951080648df54 +Subproject commit d10d5f6e079f7583afbc72a8d214bddd2665f13a From 78d52ce741e6eac082f9d4e330ce6bb45ac90664 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Sat, 6 Jul 2024 10:16:34 +0200 Subject: [PATCH 02/31] removes generated preset file --- .gitignore | 1 + CMakeUserPresets.json | 9 --------- Jenkinsfile | 1 - 3 files changed, 1 insertion(+), 10 deletions(-) delete mode 100644 CMakeUserPresets.json diff --git a/.gitignore b/.gitignore index af81461..ffab976 100644 --- a/.gitignore +++ b/.gitignore @@ -47,3 +47,4 @@ /.direnv/ /.venv/ /.cache +/CMakeUserPresets.json diff --git a/CMakeUserPresets.json b/CMakeUserPresets.json deleted file mode 100644 index 3b9486d..0000000 --- a/CMakeUserPresets.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "version": 4, - "vendor": { - "conan": {} - }, - "include": [ - "build/Debug/conan/build/Debug/generators/CMakePresets.json" - ] -} \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile index 39e8875..3f73ad5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -34,7 +34,6 @@ void setup_conan() { python3 -mvenv .venv . .venv/bin/activate pip3 install -r requirements.txt - conan profile new default --detect --force ''' } From 7ebfb5897c2d725d513b3727f23992cc9db7c21b Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Sat, 6 Jul 2024 10:22:02 +0200 Subject: [PATCH 03/31] extends python package list to provide cmake and simplifies Jenkins --- Jenkinsfile | 13 +------------ requirements.txt | 1 + 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3f73ad5..5d39e8d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -29,17 +29,11 @@ void checkout_project() { ]) } -void setup_conan() { +void build_n_test_project() { sh''' python3 -mvenv .venv . .venv/bin/activate pip3 install -r requirements.txt - ''' -} - -void build_n_test_project() { - sh''' - . .venv/bin/activate cmake -S . -B build --preset Release cmake --build build -j12 cmake --build build --target test @@ -61,7 +55,6 @@ pipeline { agent {docker { image 'ubuntu-22.04' } } stages { stage('Checkout') { steps { checkout_project() }} - stage('Setup') { steps { setup_conan() }} stage('Build & test') { steps { build_n_test_project() }} } } @@ -69,7 +62,6 @@ pipeline { agent {docker { image 'ubuntu-20.04' } } stages { stage('Checkout') { steps { checkout_project() }} - stage('Setup') { steps { setup_conan() }} stage('Build & test') { steps { build_n_test_project() }} } } @@ -77,7 +69,6 @@ pipeline { agent {docker { image 'centos7' } } stages { stage('Checkout') { steps { checkout_project() }} - stage('Setup') { steps { setup_conan() }} stage('Build & test') { steps { build_n_test_project() }} } } @@ -85,7 +76,6 @@ pipeline { agent {docker { image 'rockylinux8' } } stages { stage('Checkout') { steps { checkout_project() }} - stage('Setup') { steps { setup_conan() }} stage('Build & test') { steps { build_n_test_project() }} } } @@ -94,7 +84,6 @@ pipeline { agent {docker { image 'ubuntu-riscv' } } stages { stage('Checkout') { steps { checkout_project() }} - stage('Setup') { steps { setup_conan() }} stage('Build & check format') { steps { sh''' cmake -S . -B build --preset Release diff --git a/requirements.txt b/requirements.txt index a646a0e..32d44c7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ conan>=2.0 +cmake \ No newline at end of file From 08c9e36faef86ddc910906aba82e3143ccfc6b06 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Sat, 6 Jul 2024 10:25:29 +0200 Subject: [PATCH 04/31] removes ubuntu 20.04 form list --- Jenkinsfile | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5d39e8d..3d668dd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -51,28 +51,28 @@ pipeline { stages { stage('SCC test pipeline') { parallel { - stage('U22.04') { + stage('ubuntu-22.04') { agent {docker { image 'ubuntu-22.04' } } stages { stage('Checkout') { steps { checkout_project() }} stage('Build & test') { steps { build_n_test_project() }} } } - stage('U20.04') { - agent {docker { image 'ubuntu-20.04' } } - stages { - stage('Checkout') { steps { checkout_project() }} - stage('Build & test') { steps { build_n_test_project() }} - } - } - stage('COS7') { +// stage('U20.04') { +// agent {docker { image 'ubuntu-20.04' } } +// stages { +// stage('Checkout') { steps { checkout_project() }} +// stage('Build & test') { steps { build_n_test_project() }} +// } +// } + stage('centos7') { agent {docker { image 'centos7' } } stages { stage('Checkout') { steps { checkout_project() }} stage('Build & test') { steps { build_n_test_project() }} } } - stage('RCK8') { + stage('rockylinux8') { agent {docker { image 'rockylinux8' } } stages { stage('Checkout') { steps { checkout_project() }} @@ -86,6 +86,9 @@ pipeline { stage('Checkout') { steps { checkout_project() }} stage('Build & check format') { steps { sh''' + python3 -mvenv .venv + . .venv/bin/activate + pip3 install -r requirements.txt cmake -S . -B build --preset Release cmake --build build --target format-check ''' From 29b8de6c16f294e86e890ef2b16df10c58f7f0b6 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Sat, 6 Jul 2024 10:37:34 +0200 Subject: [PATCH 05/31] updates Jenkinsfile --- Jenkinsfile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3d668dd..e5149a3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -69,7 +69,17 @@ pipeline { agent {docker { image 'centos7' } } stages { stage('Checkout') { steps { checkout_project() }} - stage('Build & test') { steps { build_n_test_project() }} + stage('Build & test') { steps { + sh''' + python3 -mvenv .venv + . .venv/bin/activate + pip3 install -r requirements.txt + conan install --requires 'b2/[*]' --build='*' + cmake -S . -B build --preset Release + cmake --build build -j12 + cmake --build build --target test + ''' + }} } } stage('rockylinux8') { From c6e480d13499384c4e954631ba53aa14b8d59354 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Sat, 6 Jul 2024 10:41:41 +0200 Subject: [PATCH 06/31] updates Jenkinsfile --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index e5149a3..50b2589 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -74,6 +74,7 @@ pipeline { python3 -mvenv .venv . .venv/bin/activate pip3 install -r requirements.txt + conan profile detect --force -vquiet conan install --requires 'b2/[*]' --build='*' cmake -S . -B build --preset Release cmake --build build -j12 From 8c25ce1ddfebc7db12d5efb994d402b96cbd9682 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Mon, 8 Jul 2024 21:57:29 +0200 Subject: [PATCH 07/31] updates cci --- build.log | 490 -------------------------------- conanfile.txt | 3 +- examples/ahb_bfm/sc_main.cpp | 2 +- scc | 2 +- tests/configuration/sc_main.cpp | 1 - 5 files changed, 4 insertions(+), 494 deletions(-) delete mode 100644 build.log diff --git a/build.log b/build.log deleted file mode 100644 index 978a142..0000000 --- a/build.log +++ /dev/null @@ -1,490 +0,0 @@ -[ 1%] Building CXX object scc/third_party/scv-tr/src/CMakeFiles/scv-tr.dir/scv-tr/scv_introspection.cpp.o -[ 2%] Building CXX object scc/third_party/scv-tr/src/CMakeFiles/scv-tr.dir/scv-tr/scv_tr_text.cpp.o -[ 3%] Building CXX object scc/third_party/scv-tr/src/CMakeFiles/scv-tr.dir/scv-tr/scv_tr.cpp.o -[ 3%] Building CXX object scc/src/common/CMakeFiles/scc-util.dir/util/io-redirector.cpp.o -[ 4%] Building CXX object scc/third_party/scv-tr/src/CMakeFiles/scv-tr.dir/scv-tr/scv_report.cpp.o -[ 5%] Building C object scc/third_party/fst/CMakeFiles/fstapi.dir/fstapi.c.o -[ 6%] Building CXX object scc/src/common/CMakeFiles/scc-util.dir/util/watchdog.cpp.o -[ 8%] Building CXX object scc/src/common/CMakeFiles/scc-util.dir/util/lz4_streambuf.cpp.o -[ 9%] Building C object scc/third_party/fst/CMakeFiles/fstapi.dir/fastlz.c.o -[ 9%] Building CXX object scc/third_party/lwtr4sc/src/CMakeFiles/lwtr.dir/lwtr/util/lz4_streambuf.cpp.o -[ 9%] Building CXX object scc/third_party/lwtr4sc/src/CMakeFiles/lwtr.dir/lwtr/lwtr.cpp.o -[ 10%] Building CXX object scc/third_party/lwtr4sc/src/CMakeFiles/lwtr.dir/lwtr/lwtr_text.cpp.o -[ 11%] Building CXX object scc/third_party/cci-1.0.0/CMakeFiles/cciapi.dir/cci_cfg/cci_broker_manager.cpp.o -[ 12%] Building CXX object scc/third_party/lwtr4sc/src/CMakeFiles/lwtr.dir/lwtr/lwtr_ftr.cpp.o -[ 13%] Building CXX object scc/third_party/cci-1.0.0/CMakeFiles/cciapi.dir/cci_cfg/cci_originator.cpp.o -[ 14%] Building CXX object scc/third_party/cci-1.0.0/CMakeFiles/cciapi.dir/cci_cfg/cci_param_if.cpp.o -[ 15%] Building CXX object scc/third_party/cci-1.0.0/CMakeFiles/cciapi.dir/cci_cfg/cci_param_untyped_handle.cpp.o -[ 15%] Building CXX object scc/third_party/cci-1.0.0/CMakeFiles/cciapi.dir/cci_cfg/cci_param_untyped.cpp.o -[ 16%] Building CXX object scc/third_party/cci-1.0.0/CMakeFiles/cciapi.dir/cci_core/cci_value.cpp.o -[ 17%] Building CXX object scc/third_party/cci-1.0.0/CMakeFiles/cciapi.dir/cci_core/cci_name_gen.cpp.o -[ 18%] Building CXX object scc/third_party/cci-1.0.0/CMakeFiles/cciapi.dir/cci_cfg/cci_report_handler.cpp.o -[ 19%] Building CXX object scc/third_party/cci-1.0.0/CMakeFiles/cciapi.dir/cci_core/cci_value_converter.cpp.o -[ 20%] Building CXX object scc/third_party/cci-1.0.0/CMakeFiles/cciapi.dir/cci_utils/broker.cpp.o -[ 21%] Building CXX object scc/third_party/cci-1.0.0/CMakeFiles/cciapi.dir/cci_cfg/cci_broker_handle.cpp.o -[ 22%] Building CXX object scc/third_party/cci-1.0.0/CMakeFiles/cciapi.dir/cci_utils/consuming_broker.cpp.o -[ 23%] Linking C static library libfstapi.a -[ 23%] Built target fstapi -[ 24%] Linking CXX static library libcciapi.a -[ 24%] Built target cciapi -[ 25%] Linking CXX static library libscc-util.a -[ 25%] Built target scc-util -[ 26%] Building CXX object tests/io-redirector/CMakeFiles/io_redirector.dir/test.cpp.o -[ 26%] Linking CXX static library libscv-tr.a -[ 26%] Built target scv-tr -[ 27%] Linking CXX executable io_redirector -[ 27%] Built target io_redirector -[ 28%] Linking CXX static library liblwtr.a -[ 28%] Built target lwtr -[ 29%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/utilities.cpp.o -[ 30%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/sc_logic_7.cpp.o -[ 31%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/tracer_base.cpp.o -[ 31%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/tracer.cpp.o -[ 32%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/perf_estimator.cpp.o -[ 33%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/time_n_tick.cpp.o -[ 34%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/report.cpp.o -[ 35%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/scv/scv_tr_mtc.cpp.o -[ 36%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/value_registry.cpp.o -[ 37%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/mt19937_rng.cpp.o -[ 39%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/scv/scv_tr_ftr.cpp.o -[ 39%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/ordered_semaphore.cpp.o -[ 39%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/scv/scv_tr_lz4.cpp.o -[ 40%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/vcd_push_trace.cpp.o -[ 41%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/tlm/scc/scv/tlm_recorder.cpp.o -[ 42%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/tlm/scc/pe/parallel_pe.cpp.o -[ 43%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/vcd_pull_trace.cpp.o -[ 44%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/hierarchy_dumper.cpp.o -[ 45%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/cci_broker.cpp.o -[ 46%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/configurer.cpp.o -[ 46%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/configurable_tracer.cpp.o -[ 47%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/sc_thread_pool.cpp.o -[ 48%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/tlm/scc/lwtr/tlm2_lwtr.cpp.o -[ 50%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/signal_opt_ports.cpp.o -[ 51%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/scv/scv_tr_compressed.cpp.o -[ 52%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/fst_trace.cpp.o -[ 53%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/vcd_mt_trace.cpp.o -[ 54%] Building CXX object scc/src/sysc/CMakeFiles/scc-sysc.dir/scc/scv/scv_tr_sqlite.cpp.o -[ 55%] Building C object scc/src/sysc/CMakeFiles/scc-sysc.dir/__/__/third_party/sqlite3/sqlite3.c.o -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/cci-1.0.0/cci_core/cci_callback.h:147:7: warning: Use of memory after it is freed [clang-analyzer-cplusplus.NewDelete] - m_cb->release(); - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/src/sysc/scc/configurer.cpp:524:13: note: Assuming 'attr' is non-null - if(auto attr = dynamic_cast*>(base_attr)) { - ^~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/src/sysc/scc/configurer.cpp:524:5: note: Taking true branch - if(auto attr = dynamic_cast*>(base_attr)) { - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/src/sysc/scc/configurer.cpp:532:9: note: Calling 'cci_param_typed::register_post_write_callback' - par->register_post_write_callback(params.back().first); - ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/cci-1.0.0/cci_cfg/cci_param_typed.h:874:1: note: Calling '~cci_callback_untyped_handle' -CCI_PARAM_TYPED_CALLBACK_IMPL_(post_write) -^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/cci-1.0.0/cci_cfg/cci_param_typed.h:855:58: note: expanded from macro 'CCI_PARAM_TYPED_CALLBACK_IMPL_' - return cci_param_untyped::register_##name##_callback(cb, get_originator());\ - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/cci-1.0.0/cci_core/cci_callback.h:220:9: note: Field 'm_cb' is non-null - if (m_cb) - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/cci-1.0.0/cci_core/cci_callback.h:220:5: note: Taking true branch - if (m_cb) - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/cci-1.0.0/cci_core/cci_callback.h:221:7: note: Calling 'callback_generic_adapt::release' - m_cb->release(); - ^~~~~~~~~~~~~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/cci-1.0.0/cci_core/cci_callback_impl.h:218:32: note: Assuming the condition is true - virtual void release() { if (!--m_refcnt) delete this; } - ^~~~~~~~~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/cci-1.0.0/cci_core/cci_callback_impl.h:218:28: note: Taking true branch - virtual void release() { if (!--m_refcnt) delete this; } - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/cci-1.0.0/cci_core/cci_callback_impl.h:218:45: note: Memory is released - virtual void release() { if (!--m_refcnt) delete this; } - ^~~~~~~~~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/cci-1.0.0/cci_core/cci_callback.h:221:7: note: Returning; memory was released - m_cb->release(); - ^~~~~~~~~~~~~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/cci-1.0.0/cci_cfg/cci_param_typed.h:874:1: note: Returning from '~cci_callback_untyped_handle' -CCI_PARAM_TYPED_CALLBACK_IMPL_(post_write) -^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/cci-1.0.0/cci_cfg/cci_param_typed.h:855:58: note: expanded from macro 'CCI_PARAM_TYPED_CALLBACK_IMPL_' - return cci_param_untyped::register_##name##_callback(cb, get_originator());\ - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/src/sysc/scc/configurer.cpp:532:9: note: Returning; memory was released - par->register_post_write_callback(params.back().first); - ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/src/sysc/scc/configurer.cpp:532:57: note: Calling '~cci_callback' - par->register_post_write_callback(params.back().first); - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/cci-1.0.0/cci_core/cci_callback.h:146:9: note: Field 'm_cb' is non-null - if (m_cb) - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/cci-1.0.0/cci_core/cci_callback.h:146:5: note: Taking true branch - if (m_cb) - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/cci-1.0.0/cci_core/cci_callback.h:147:7: note: Use of memory after it is freed - m_cb->release(); - ^~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:39:9: warning: The expression is an uninitialized value. The computed value will also be garbage [clang-analyzer-core.uninitialized.Assign] - buffer[len - 1]--; - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/src/sysc/scc/configurer.cpp:134:1: note: Calling 'PrettyWriter::Double' -FDECL(float, Double) -^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/src/sysc/scc/configurer.cpp:125:9: note: expanded from macro 'FDECL' - writer.FUNC(value); \ - ^~~~~~~~~~~~~~~~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/prettywriter.h:101:84: note: Calling 'Writer::WriteDouble' - bool Double(double d) { PrettyPrefix(kNumberType); return Base::EndValue(Base::WriteDouble(d)); } - ^~~~~~~~~~~~~~~~~~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/writer.h:350:13: note: Assuming the condition is false - if (internal::Double(d).IsNanOrInf()) { - ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/writer.h:350:9: note: Taking false branch - if (internal::Double(d).IsNanOrInf()) { - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/writer.h:370:21: note: Calling 'dtoa' - char* end = internal::dtoa(d, buffer, maxDecimalPlaces_); - ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:221:22: note: Assuming 'maxDecimalPlaces' is >= 1 - RAPIDJSON_ASSERT(maxDecimalPlaces >= 1); - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/error/../rapidjson.h:437:36: note: expanded from macro 'RAPIDJSON_ASSERT' -#define RAPIDJSON_ASSERT(x) assert(x) - ^ -/usr/include/assert.h:90:27: note: expanded from macro 'assert' - (static_cast (expr) \ - ^~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:221:5: note: '?' condition is true - RAPIDJSON_ASSERT(maxDecimalPlaces >= 1); - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/error/../rapidjson.h:437:29: note: expanded from macro 'RAPIDJSON_ASSERT' -#define RAPIDJSON_ASSERT(x) assert(x) - ^ -/usr/include/assert.h:90:7: note: expanded from macro 'assert' - (static_cast (expr) \ - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:223:9: note: Assuming the condition is false - if (d.IsZero()) { - ^~~~~~~~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:223:5: note: Taking false branch - if (d.IsZero()) { - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:232:13: note: Assuming 'value' is >= 0 - if (value < 0) { - ^~~~~~~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:232:9: note: Taking false branch - if (value < 0) { - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:237:9: note: Calling 'Grisu2' - Grisu2(value, buffer, &length, &K); - ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:127:5: note: Calling 'DigitGen' - DigitGen(W, Wp, Wp.f - Wm.f, buffer, length, K); - ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:73:5: note: Loop condition is true. Entering loop body - while (kappa > 0) { - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:75:9: note: Control jumps to 'case 1:' at line 84 - switch (kappa) { - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:84:61: note: Execution continues on line 87 - case 1: d = p1; p1 = 0; break; - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:87:13: note: Assuming 'd' is 0 - if (d || *len) - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:87:13: note: Left side of '||' is false -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:87:9: note: Taking false branch - if (d || *len) - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:91:13: note: Assuming 'tmp' is <= 'delta' - if (tmp <= delta) { - ^~~~~~~~~~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:91:9: note: Taking true branch - if (tmp <= delta) { - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:93:13: note: Calling 'GrisuRound' - GrisuRound(buffer, *len, delta, tmp, kPow10[kappa] << -one.e, wp_w.f); - ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:36:12: note: Assuming 'rest' is < 'wp_w' - while (rest < wp_w && delta - rest >= ten_kappa && - ^~~~~~~~~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:36:12: note: Left side of '&&' is true -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:36:27: note: Assuming the condition is true - while (rest < wp_w && delta - rest >= ten_kappa && - ^~~~~~~~~~~~~~~~~~~~~~~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:36:12: note: Left side of '&&' is true - while (rest < wp_w && delta - rest >= ten_kappa && - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:37:13: note: Assuming the condition is true - (rest + ten_kappa < wp_w || /// closer - ^~~~~~~~~~~~~~~~~~~~~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:37:37: note: Left side of '||' is true - (rest + ten_kappa < wp_w || /// closer - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:39:9: note: The expression is an uninitialized value. The computed value will also be garbage - buffer[len - 1]--; - ^~~~~~~~~~~~~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/writer.h:373:13: warning: 2nd function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage] - PutUnsafe(*os_, static_cast(*p)); - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/src/sysc/scc/configurer.cpp:134:1: note: Calling 'PrettyWriter::Double' -FDECL(float, Double) -^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/src/sysc/scc/configurer.cpp:125:9: note: expanded from macro 'FDECL' - writer.FUNC(value); \ - ^~~~~~~~~~~~~~~~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/prettywriter.h:101:84: note: Calling 'Writer::WriteDouble' - bool Double(double d) { PrettyPrefix(kNumberType); return Base::EndValue(Base::WriteDouble(d)); } - ^~~~~~~~~~~~~~~~~~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/writer.h:350:13: note: Assuming the condition is false - if (internal::Double(d).IsNanOrInf()) { - ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/writer.h:350:9: note: Taking false branch - if (internal::Double(d).IsNanOrInf()) { - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/writer.h:370:21: note: Calling 'dtoa' - char* end = internal::dtoa(d, buffer, maxDecimalPlaces_); - ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:221:22: note: Assuming 'maxDecimalPlaces' is >= 1 - RAPIDJSON_ASSERT(maxDecimalPlaces >= 1); - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/error/../rapidjson.h:437:36: note: expanded from macro 'RAPIDJSON_ASSERT' -#define RAPIDJSON_ASSERT(x) assert(x) - ^ -/usr/include/assert.h:90:27: note: expanded from macro 'assert' - (static_cast (expr) \ - ^~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:221:5: note: '?' condition is true - RAPIDJSON_ASSERT(maxDecimalPlaces >= 1); - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/error/../rapidjson.h:437:29: note: expanded from macro 'RAPIDJSON_ASSERT' -#define RAPIDJSON_ASSERT(x) assert(x) - ^ -/usr/include/assert.h:90:7: note: expanded from macro 'assert' - (static_cast (expr) \ - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:223:9: note: Assuming the condition is false - if (d.IsZero()) { - ^~~~~~~~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:223:5: note: Taking false branch - if (d.IsZero()) { - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:232:13: note: Assuming 'value' is >= 0 - if (value < 0) { - ^~~~~~~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:232:9: note: Taking false branch - if (value < 0) { - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:237:9: note: Calling 'Grisu2' - Grisu2(value, buffer, &length, &K); - ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:127:5: note: Calling 'DigitGen' - DigitGen(W, Wp, Wp.f - Wm.f, buffer, length, K); - ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:73:5: note: Loop condition is true. Entering loop body - while (kappa > 0) { - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:75:9: note: Control jumps to 'case 9:' at line 76 - switch (kappa) { - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:76:61: note: Execution continues on line 87 - case 9: d = p1 / 100000000; p1 %= 100000000; break; - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:87:13: note: Assuming 'd' is 0 - if (d || *len) - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:87:13: note: Left side of '||' is false -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:87:9: note: Taking false branch - if (d || *len) - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:91:13: note: Assuming 'tmp' is <= 'delta' - if (tmp <= delta) { - ^~~~~~~~~~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:91:9: note: Taking true branch - if (tmp <= delta) { - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:93:13: note: Calling 'GrisuRound' - GrisuRound(buffer, *len, delta, tmp, kPow10[kappa] << -one.e, wp_w.f); - ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:36:12: note: Assuming 'rest' is >= 'wp_w' - while (rest < wp_w && delta - rest >= ten_kappa && - ^~~~~~~~~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:36:24: note: Left side of '&&' is false - while (rest < wp_w && delta - rest >= ten_kappa && - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:93:13: note: Returning from 'GrisuRound' - GrisuRound(buffer, *len, delta, tmp, kPow10[kappa] << -one.e, wp_w.f); - ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:127:5: note: Returning from 'DigitGen' - DigitGen(W, Wp, Wp.f - Wm.f, buffer, length, K); - ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:237:9: note: Returning from 'Grisu2' - Grisu2(value, buffer, &length, &K); - ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:238:16: note: Calling 'Prettify' - return Prettify(buffer, length, K, maxDecimalPlaces); - ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:157:9: note: Assuming 'k' is < 0 - if (0 <= k && kk <= 21) { - ^~~~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:157:16: note: Left side of '&&' is false - if (0 <= k && kk <= 21) { - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:165:18: note: 'kk' is <= 0 - else if (0 < kk && kk <= 21) { - ^~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:165:21: note: Left side of '&&' is false - else if (0 < kk && kk <= 21) { - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:180:14: note: Assuming the condition is true - else if (-6 < kk && kk <= 0) { - ^~~~~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:180:14: note: Left side of '&&' is true -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:180:25: note: 'kk' is <= 0 - else if (-6 < kk && kk <= 0) { - ^~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:180:10: note: Taking true branch - else if (-6 < kk && kk <= 0) { - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:186:25: note: Assuming 'i' is >= 'offset' - for (int i = 2; i < offset; i++) - ^~~~~~~~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:186:9: note: Loop condition is false. Execution continues on line 188 - for (int i = 2; i < offset; i++) - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:188:13: note: Assuming the condition is false - if (length - kk > maxDecimalPlaces) { - ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:188:9: note: Taking false branch - if (length - kk > maxDecimalPlaces) { - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/internal/dtoa.h:238:16: note: Returning from 'Prettify' - return Prettify(buffer, length, K, maxDecimalPlaces); - ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/writer.h:370:21: note: Returning from 'dtoa' - char* end = internal::dtoa(d, buffer, maxDecimalPlaces_); - ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/writer.h:372:32: note: Assuming 'p' is not equal to 'end' - for (char* p = buffer; p != end; ++p) - ^~~~~~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/writer.h:372:9: note: Loop condition is true. Entering loop body - for (char* p = buffer; p != end; ++p) - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/writer.h:372:32: note: Assuming 'p' is not equal to 'end' - for (char* p = buffer; p != end; ++p) - ^~~~~~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/writer.h:372:9: note: Loop condition is true. Entering loop body - for (char* p = buffer; p != end; ++p) - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/writer.h:372:32: note: Assuming 'p' is not equal to 'end' - for (char* p = buffer; p != end; ++p) - ^~~~~~~~ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/writer.h:372:9: note: Loop condition is true. Entering loop body - for (char* p = buffer; p != end; ++p) - ^ -/scratch/eyck/workarea/MINRES/SystemC-Components-Test/scc/third_party/rapidjson-1.1/include/rapidjson/writer.h:373:13: note: 2nd function call argument is an uninitialized value - PutUnsafe(*os_, static_cast(*p)); - ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -[ 56%] Linking CXX static library libscc-sysc.a -[ 56%] Built target scc-sysc -[ 57%] Building CXX object tests/configuration/CMakeFiles/cci-example.dir/sc_main.cpp.o -[ 57%] Building CXX object tests/configurer/CMakeFiles/configurer.dir/sc_main.cpp.o -[ 59%] Building CXX object scc/third_party/axi_chi/CMakeFiles/tlm-interfaces.dir/chi/pe/chi_rn_initiator.cpp.o -[ 59%] Building CXX object scc/third_party/axi_chi/CMakeFiles/tlm-interfaces.dir/chi/chi_tlm.cpp.o -[ 60%] Building CXX object scc/third_party/axi_chi/CMakeFiles/tlm-interfaces.dir/chi/lwtr/chi_lwtr.cpp.o -[ 61%] Building CXX object scc/third_party/axi_chi/CMakeFiles/tlm-interfaces.dir/axi/fsm/base.cpp.o -[ 62%] Building CXX object scc/third_party/axi_chi/CMakeFiles/tlm-interfaces.dir/axi/axi_tlm.cpp.o -[ 63%] Building CXX object scc/third_party/axi_chi/CMakeFiles/tlm-interfaces.dir/axi/pe/ace_target_pe.cpp.o -[ 63%] Building CXX object scc/third_party/axi_chi/CMakeFiles/tlm-interfaces.dir/axi/pe/axi_target_pe.cpp.o -[ 64%] Building CXX object scc/third_party/axi_chi/CMakeFiles/tlm-interfaces.dir/axi/pe/axi_initiator.cpp.o -[ 65%] Building CXX object scc/third_party/axi_chi/CMakeFiles/tlm-interfaces.dir/axi/pe/reordering_target.cpp.o -[ 66%] Building CXX object scc/third_party/axi_chi/CMakeFiles/tlm-interfaces.dir/axi/pe/simple_initiator.cpp.o -[ 67%] Building CXX object scc/third_party/axi_chi/CMakeFiles/tlm-interfaces.dir/axi/scv/axi_ace_scv.cpp.o -[ 70%] Building CXX object scc/third_party/axi_chi/CMakeFiles/tlm-interfaces.dir/axi/checker/ace_protocol.cpp.o -[ 70%] Building CXX object scc/third_party/axi_chi/CMakeFiles/tlm-interfaces.dir/axi/checker/axi_protocol.cpp.o -[ 70%] Building CXX object scc/third_party/axi_chi/CMakeFiles/tlm-interfaces.dir/axi/lwtr/axi_ace_lwtr.cpp.o -[ 71%] Building CXX object scc/third_party/axi_chi/CMakeFiles/tlm-interfaces.dir/axi/pe/ordered_target.cpp.o -[ 72%] Linking CXX executable configurer -[ 72%] Built target configurer -[ 73%] Linking CXX executable cci-example -[ 73%] Built target cci-example -[ 74%] Linking CXX static library libtlm-interfaces.a -[ 74%] Built target tlm-interfaces -[ 74%] Building CXX object scc/src/bus_interfaces/CMakeFiles/busses.dir/ahb/ahb_tlm.cpp.o -[ 75%] Building CXX object scc/src/bus_interfaces/CMakeFiles/busses.dir/ahb/pin/initiator.cpp.o -[ 76%] Building CXX object scc/src/bus_interfaces/CMakeFiles/busses.dir/ahb/pe/ahb_initiator.cpp.o -[ 77%] Building CXX object scc/src/bus_interfaces/CMakeFiles/busses.dir/apb/pe/apb_initiator.cpp.o -[ 78%] Building CXX object scc/src/bus_interfaces/CMakeFiles/busses.dir/apb/pe/apb_target.cpp.o -[ 79%] Building CXX object scc/src/bus_interfaces/CMakeFiles/busses.dir/axi/axi_initiator.cpp.o -[ 80%] Building CXX object scc/src/bus_interfaces/CMakeFiles/busses.dir/axi/axi_target.cpp.o -[ 81%] Building CXX object scc/src/bus_interfaces/CMakeFiles/busses.dir/ahb/pe/ahb_target.cpp.o -[ 82%] Building CXX object scc/src/bus_interfaces/CMakeFiles/busses.dir/ahb/pin/target.cpp.o -[ 82%] Linking CXX static library libbusses.a -[ 82%] Built target busses -[ 83%] Linking CXX shared library libscc_shared.so -[ 84%] Building CXX object src/CMakeFiles/test_util.dir/factory.cpp.o -[ 85%] Linking CXX static library libtest_util.a -[ 85%] Built target test_util -[ 86%] Building CXX object tests/ahb_pin_level/CMakeFiles/ahb_pin_level.dir/bus_test.cpp.o -[ 87%] Building CXX object tests/cci_param_restricted/CMakeFiles/cci_param_restricted.dir/test.cpp.o -[ 88%] Building CXX object tests/ahb_pin_level/CMakeFiles/ahb_pin_level.dir/__/__/src/sc_main.cpp.o -[ 89%] Building CXX object tests/cci_param_restricted/CMakeFiles/cci_param_restricted.dir/__/__/src/sc_main.cpp.o -[ 90%] Building CXX object tests/ordered_semaphore/CMakeFiles/ordered_semaphore.dir/test.cpp.o -[ 91%] Building CXX object tests/ordered_semaphore/CMakeFiles/ordered_semaphore.dir/__/__/src/sc_main.cpp.o -[ 92%] Building CXX object tests/axi4_pin_level/CMakeFiles/axi4_pin_level.dir/narrow_burst_test.cpp.o -[ 92%] Building CXX object tests/ace_pin_level/CMakeFiles/ace_pin_level.dir/ace_narrow_burst_test.cpp.o -[ 93%] Building CXX object tests/axi4_pin_level/CMakeFiles/axi4_pin_level.dir/__/__/src/sc_main.cpp.o -[ 94%] Building CXX object tests/ace_pin_level/CMakeFiles/ace_pin_level.dir/__/__/src/sc_main.cpp.o -[ 94%] Built target scc_shared -[ 95%] Linking CXX executable ordered_semaphore - - SystemC 2.3.4-Accellera --- Jul 5 2024 07:23:11 - Copyright (c) 1996-2022 by all Contributors, - ALL RIGHTS RESERVED - - SystemC 2.3.4-Accellera --- Jul 5 2024 07:23:11 - Copyright (c) 1996-2022 by all Contributors, - ALL RIGHTS RESERVED -[ 95%] Built target ordered_semaphore -[ 96%] Linking CXX executable cci_param_restricted - - SystemC 2.3.4-Accellera --- Jul 5 2024 07:23:11 - Copyright (c) 1996-2022 by all Contributors, - ALL RIGHTS RESERVED - - SystemC 2.3.4-Accellera --- Jul 5 2024 07:23:11 - Copyright (c) 1996-2022 by all Contributors, - ALL RIGHTS RESERVED -[ 96%] Built target cci_param_restricted -[ 97%] Linking CXX executable axi4_pin_level -[ 98%] Linking CXX executable ace_pin_level - - SystemC 2.3.4-Accellera --- Jul 5 2024 07:23:11 - Copyright (c) 1996-2022 by all Contributors, - ALL RIGHTS RESERVED - - SystemC 2.3.4-Accellera --- Jul 5 2024 07:23:11 - Copyright (c) 1996-2022 by all Contributors, - ALL RIGHTS RESERVED -[ 98%] Built target axi4_pin_level -[100%] Linking CXX executable ahb_pin_level - - SystemC 2.3.4-Accellera --- Jul 5 2024 07:23:11 - Copyright (c) 1996-2022 by all Contributors, - ALL RIGHTS RESERVED - - SystemC 2.3.4-Accellera --- Jul 5 2024 07:23:11 - Copyright (c) 1996-2022 by all Contributors, - ALL RIGHTS RESERVED -[100%] Built target ace_pin_level - - SystemC 2.3.4-Accellera --- Jul 5 2024 07:23:11 - Copyright (c) 1996-2022 by all Contributors, - ALL RIGHTS RESERVED - - SystemC 2.3.4-Accellera --- Jul 5 2024 07:23:11 - Copyright (c) 1996-2022 by all Contributors, - ALL RIGHTS RESERVED -[100%] Built target ahb_pin_level diff --git a/conanfile.txt b/conanfile.txt index b402279..80c687f 100644 --- a/conanfile.txt +++ b/conanfile.txt @@ -9,7 +9,8 @@ systemc/2.3.4 catch2/3.1.0 zlib/1.2.11 lz4/1.9.4 - +rapidjson/cci.20230929 + [options] boost/*:fPIC=True boost/*:header_only=False diff --git a/examples/ahb_bfm/sc_main.cpp b/examples/ahb_bfm/sc_main.cpp index b01ad27..2c5fc8d 100644 --- a/examples/ahb_bfm/sc_main.cpp +++ b/examples/ahb_bfm/sc_main.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include #include diff --git a/scc b/scc index d10d5f6..c99c6d7 160000 --- a/scc +++ b/scc @@ -1 +1 @@ -Subproject commit d10d5f6e079f7583afbc72a8d214bddd2665f13a +Subproject commit c99c6d7fe30ef857a00e30d6b51e9cab2b738ce4 diff --git a/tests/configuration/sc_main.cpp b/tests/configuration/sc_main.cpp index f4886a0..d00620a 100644 --- a/tests/configuration/sc_main.cpp +++ b/tests/configuration/sc_main.cpp @@ -33,7 +33,6 @@ #include "top_module.h" #include -#include #include /** From 99b0d443d02f4a4f759ee9ab16e23d1e16c5fbe1 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Mon, 8 Jul 2024 22:19:45 +0200 Subject: [PATCH 08/31] updates scc --- scc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scc b/scc index c99c6d7..7e07770 160000 --- a/scc +++ b/scc @@ -1 +1 @@ -Subproject commit c99c6d7fe30ef857a00e30d6b51e9cab2b738ce4 +Subproject commit 7e0777089bc86d60557ebe25d34d3f7244d97b53 From c22518a1f4cce8303c0529593efc48016f5a6010 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Thu, 11 Jul 2024 07:30:09 +0200 Subject: [PATCH 09/31] updates SCC --- examples/ahb_bfm/sc_main.cpp | 148 ----------------------------------- scc | 2 +- 2 files changed, 1 insertion(+), 149 deletions(-) delete mode 100644 examples/ahb_bfm/sc_main.cpp diff --git a/examples/ahb_bfm/sc_main.cpp b/examples/ahb_bfm/sc_main.cpp deleted file mode 100644 index 2c5fc8d..0000000 --- a/examples/ahb_bfm/sc_main.cpp +++ /dev/null @@ -1,148 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace sc_core; -using namespace scc; - -class testbench : public sc_module, public scc::traceable { -public: - enum { WIDTH = 64 }; - tlm::scc::initiator_mixin> isck{"isck"}; - ahb::pin::initiator intor{"intor"}; - sc_core::sc_clock HCLK{"HCLK", 10_ns}; - sc_core::sc_signal HRESETn{"HRESETn"}; - sc_core::sc_signal> HADDR{"HADDR"}; - sc_core::sc_signal> HBURST{"HBURST"}; - sc_core::sc_signal HMASTLOCK{"HMASTLOCK"}; - sc_core::sc_signal> HPROT{"HPROT"}; - sc_core::sc_signal> HSIZE{"HSIZE"}; - sc_core::sc_signal> HTRANS{"HTRANS"}; - sc_core::sc_signal> HWDATA{"HWDATA"}; - sc_core::sc_signal HWRITE{"HWRITE"}; - sc_core::sc_signal> HRDATA{"HRDATA"}; - sc_core::sc_signal HREADY{"HREADY"}; - sc_core::sc_signal HRESP{"HRESP"}; - sc_core::sc_signal HSEL{"HSEL"}; - - ahb::pin::target target{"target"}; - tlm::scc::target_mixin> tsck{"tsck"}; - - testbench(sc_module_name nm) - : sc_module(nm) { - SC_HAS_PROCESS(testbench); - isck(intor.tsckt); - intor.HCLK_i(HCLK); - intor.HRESETn_i(HRESETn); - intor.HADDR_o(HADDR); - intor.HBURST_o(HBURST); - intor.HMASTLOCK_o(HMASTLOCK); - intor.HPROT_o(HPROT); - intor.HSIZE_o(HSIZE); - intor.HTRANS_o(HTRANS); - intor.HWDATA_o(HWDATA); - intor.HWRITE_o(HWRITE); - intor.HRDATA_i(HRDATA); - intor.HREADY_i(HREADY); - intor.HRESP_i(HRESP); - target.HCLK_i(HCLK); - target.HRESETn_i(HRESETn); - target.HADDR_i(HADDR); - target.HBURST_i(HBURST); - target.HMASTLOCK_i(HMASTLOCK); - target.HPROT_i(HPROT); - target.HSIZE_i(HSIZE); - target.HTRANS_i(HTRANS); - target.HWDATA_i(HWDATA); - target.HWRITE_i(HWRITE); - target.HSEL_i(HSEL); - target.HRDATA_o(HRDATA); - target.HREADY_o(HREADY); - target.HRESP_o(HRESP); - target.isckt(tsck); - SC_THREAD(run); - tsck.register_b_transport([this](tlm::tlm_generic_payload& gp, sc_time& delay) { - gp.set_response_status(tlm::TLM_OK_RESPONSE); - if(gp.is_write()) { - SCCINFO(SCMOD) << "Received write access to addr 0x" << std::hex << gp.get_address(); - } else { - memset(gp.get_data_ptr(), 0x55, gp.get_data_length()); - SCCINFO(SCMOD) << "Received read access from addr 0x" << std::hex << gp.get_address(); - } - }); - } - - void run() { - HRESETn.write(false); - for(size_t i = 0; i < 10; ++i) - wait(HCLK.posedge_event()); - HRESETn.write(true); - wait(HCLK.posedge_event()); - HSEL.write(true); - tlm::tlm_generic_payload gp; - uint8_t data[8]; - data[0] = 2; - data[1] = 4; - gp.set_address(0x1000); - gp.set_data_length(8); - gp.set_data_ptr(data); - gp.set_streaming_width(8); - gp.set_command(tlm::TLM_WRITE_COMMAND); - sc_time delay; - isck->b_transport(gp, delay); - gp.set_address(0x1020); - gp.set_data_length(8); - gp.set_data_ptr(data); - gp.set_streaming_width(8); - gp.set_command(tlm::TLM_READ_COMMAND); - delay = SC_ZERO_TIME; - isck->b_transport(gp, delay); - for(size_t i = 0; i < 10; ++i) - wait(HCLK.posedge_event()); - sc_stop(); - } -}; - -int sc_main(int argc, char* argv[]) { - sc_core::sc_report_handler::set_actions("/IEEE_Std_1666/deprecated", sc_core::SC_DO_NOTHING); - sc_report_handler::set_actions(SC_ID_MORE_THAN_ONE_SIGNAL_DRIVER_, SC_DO_NOTHING); - /////////////////////////////////////////////////////////////////////////// - // configure logging - /////////////////////////////////////////////////////////////////////////// - scc::init_logging(scc::log::DEBUG); - /////////////////////////////////////////////////////////////////////////// - // set up configuration and tracing - /////////////////////////////////////////////////////////////////////////// - scc::configurer cfg("ahb_bfm.json"); - scc::configurable_tracer trace("ahb_bfm", tracer::TEXT, true, true); - /////////////////////////////////////////////////////////////////////////// - // create modules/channels and trace - /////////////////////////////////////////////////////////////////////////// - testbench tb("tb"); - trace.add_control(); - { - std::ofstream of{"ahb_test.default.json"}; - if(of.is_open()) - cfg.dump_configuration(of); - } - cfg.configure(); - /////////////////////////////////////////////////////////////////////////// - // run the simulation - /////////////////////////////////////////////////////////////////////////// - try { - sc_core::sc_start(1_us); - if(!sc_core::sc_end_of_simulation_invoked()) - sc_core::sc_stop(); - } catch(sc_core::sc_report& rep) { - sc_core::sc_report_handler::get_handler()(rep, sc_core::SC_DISPLAY | sc_core::SC_STOP); - } - return 0; -} diff --git a/scc b/scc index 7e07770..440e1f6 160000 --- a/scc +++ b/scc @@ -1 +1 @@ -Subproject commit 7e0777089bc86d60557ebe25d34d3f7244d97b53 +Subproject commit 440e1f6c45592e3464314df6a7174211f2c7112d From 771f1fea26ac73a15b3cdfb9e78899a1e0410ccd Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Thu, 11 Jul 2024 07:58:43 +0200 Subject: [PATCH 10/31] updates scc --- scc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scc b/scc index 440e1f6..8a1046c 160000 --- a/scc +++ b/scc @@ -1 +1 @@ -Subproject commit 440e1f6c45592e3464314df6a7174211f2c7112d +Subproject commit 8a1046c48fc8d74801d2a41eacf5fa0a9cc8e439 From 8f8e8f928cbea97de1ec64495ae65b92f2df4e42 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Thu, 11 Jul 2024 20:10:13 +0200 Subject: [PATCH 11/31] updates scc --- scc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scc b/scc index 8a1046c..06ec2f7 160000 --- a/scc +++ b/scc @@ -1 +1 @@ -Subproject commit 8a1046c48fc8d74801d2a41eacf5fa0a9cc8e439 +Subproject commit 06ec2f720792ce0129430ab0db6ed408ac476457 From 614b1f921549c3d155712867d5f69161c7280998 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Tue, 6 Aug 2024 16:02:03 +0200 Subject: [PATCH 12/31] adds APB pinlevel adapter --- scc | 2 +- tests/CMakeLists.txt | 1 + tests/apb_pin_level/CMakeLists.txt | 9 + tests/apb_pin_level/bus_test.cpp | 255 +++++++++++++++++++++++++++++ tests/apb_pin_level/testbench.h | 89 ++++++++++ 5 files changed, 355 insertions(+), 1 deletion(-) create mode 100644 tests/apb_pin_level/CMakeLists.txt create mode 100644 tests/apb_pin_level/bus_test.cpp create mode 100644 tests/apb_pin_level/testbench.h diff --git a/scc b/scc index 06ec2f7..621a069 160000 --- a/scc +++ b/scc @@ -1 +1 @@ -Subproject commit 06ec2f720792ce0129430ab0db6ed408ac476457 +Subproject commit 621a0695aa072ec934c57d0894454aca08d3ccf7 diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 5e98656..0d161b8 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,6 +1,7 @@ add_subdirectory(io-redirector) add_subdirectory(ordered_semaphore) add_subdirectory(cci_param_restricted) +add_subdirectory(apb_pin_level) add_subdirectory(ahb_pin_level) add_subdirectory(axi4_pin_level) add_subdirectory(ace_pin_level) diff --git a/tests/apb_pin_level/CMakeLists.txt b/tests/apb_pin_level/CMakeLists.txt new file mode 100644 index 0000000..bd52313 --- /dev/null +++ b/tests/apb_pin_level/CMakeLists.txt @@ -0,0 +1,9 @@ +project (apb_pin_level) + +add_executable(${PROJECT_NAME} + bus_test.cpp + ${test_util_SOURCE_DIR}/sc_main.cpp +) +target_link_libraries (${PROJECT_NAME} PUBLIC test_util) + +catch_discover_tests(${PROJECT_NAME}) diff --git a/tests/apb_pin_level/bus_test.cpp b/tests/apb_pin_level/bus_test.cpp new file mode 100644 index 0000000..3cdff2f --- /dev/null +++ b/tests/apb_pin_level/bus_test.cpp @@ -0,0 +1,255 @@ + +#include "testbench.h" +#include +#include +#undef CHECK +#include +#include + +using namespace sc_core; +using namespace ahb; + +factory::add tb; +bool is_equal(tlm::tlm_generic_payload const& a, tlm::tlm_generic_payload const& b) { + auto ret = true; + ret &= a.get_command() == b.get_command(); + ret &= a.get_address() == b.get_address(); + ret &= a.get_data_length() == b.get_data_length(); + for(auto i = 0u; i < a.get_data_length(); ++i) + ret &= a.get_data_ptr()[i] == b.get_data_ptr()[i]; + // if(a.get_byte_enable_ptr() && b.get_byte_enable_ptr()) { + // ret &= a.get_byte_enable_length() == b.get_byte_enable_length(); + // for(auto i=0u; i tlm::tlm_generic_payload* prepare_trans(uint64_t start_address, unsigned len, unsigned width) { + static unsigned id{0}; + auto trans = tlm::scc::tlm_mm<>::get().allocate(len); + trans->set_address(start_address); + tlm::scc::setId(*trans, ++id); + auto ext = trans->get_extension(); + trans->set_data_length(len); + trans->set_streaming_width(len); + ext->set_instruction(); + return trans; +} + +inline void randomize(tlm::tlm_generic_payload& gp) { + static uint8_t req_cnt{0}; + for(size_t i = 0; i < gp.get_data_length(); ++i) { + *(gp.get_data_ptr() + i) = i % 2 ? i : req_cnt; + } + req_cnt++; +} + +template unsigned run_scenario(STATE& state, unsigned wait_states = 0) { + auto& dut = factory::get(); + dut.register_b_transport([&state, wait_states](tlm::tlm_base_protocol_types::tlm_payload_type& trans, sc_core::sc_time& d) { + if(trans.is_read()) { + for(size_t i = 0; i < trans.get_data_length(); ++i) { + *(trans.get_data_ptr() + i) = i % 2 ? i : (state.resp_cnt + 128); + } + state.read_tx.second.emplace_back(&trans); + } + if(trans.is_write()) + state.write_tx.second.emplace_back(&trans); + SCCDEBUG(__FUNCTION__) << "RX: " << trans; + for(unsigned i = 0; i < wait_states; ++i) + sc_core::wait(factory::get().clk.posedge_event()); + state.resp_cnt++; + trans.set_response_status(tlm::TLM_OK_RESPONSE); + }); + + dut.rst_n.write(false); + sc_start(state.ResetCycles * dut.clk.period()); + dut.rst_n.write(true); + sc_start(dut.clk.period()); + sc_start(dut.clk.period()); + + auto run1 = sc_spawn([&dut, &state]() { + unsigned int StartAddr{0x0}; + for(int i = 0; i < state.NumberOfIterations; ++i) { + tlm::scc::tlm_gp_shared_ptr trans = + prepare_trans(StartAddr, state.BurstLengthByte, state.BurstSizeBytes); + trans->set_command(tlm::TLM_READ_COMMAND); + SCCDEBUG(__FUNCTION__) << "task run1, iteration " << i << " TX: " << *trans; + sc_core::sc_time d; + dut.isck->b_transport(*trans, d); + state.read_tx.first.emplace_back(trans); + StartAddr += state.BurstSizeBytes; + } + SCCDEBUG(__FUNCTION__) << "task run1 finished"; + }); + auto run2 = sc_spawn([&dut, &state]() { + unsigned int StartAddr{0x2000}; + for(int i = 0; i < state.NumberOfIterations; ++i) { + tlm::scc::tlm_gp_shared_ptr trans = + prepare_trans(StartAddr, state.BurstLengthByte, state.BurstSizeBytes); + trans->set_command(tlm::TLM_WRITE_COMMAND); + randomize(*trans); + SCCDEBUG(__FUNCTION__) << "task run2, iteration " << i << " TX: " << *trans; + sc_core::sc_time d; + dut.isck->b_transport(*trans, d); + state.write_tx.first.emplace_back(trans); + StartAddr += state.BurstSizeBytes; + } + SCCDEBUG(__FUNCTION__) << "task run2 finished"; + }); + auto run3 = sc_spawn([&dut, &state]() { + unsigned int StartAddr{0x1000}; + for(int i = 0; i < state.NumberOfIterations; ++i) { + tlm::scc::tlm_gp_shared_ptr trans = + prepare_trans(StartAddr, state.BurstLengthByte, state.BurstSizeBytes); + trans->set_command(tlm::TLM_READ_COMMAND); + SCCDEBUG(__FUNCTION__) << "task run3, iteration " << i << " TX: " << *trans; + sc_core::sc_time d; + dut.isck->b_transport(*trans, d); + state.read_tx.first.emplace_back(trans); + StartAddr += state.BurstSizeBytes; + } + SCCDEBUG(__FUNCTION__) << "task run3 finished"; + }); + auto run4 = sc_spawn([&dut, &state]() { + unsigned int StartAddr{0x3000}; + for(int i = 0; i < state.NumberOfIterations; ++i) { + tlm::scc::tlm_gp_shared_ptr trans = + prepare_trans(StartAddr, state.BurstLengthByte, state.BurstSizeBytes); + trans->set_command(tlm::TLM_WRITE_COMMAND); + randomize(*trans); + SCCDEBUG(__FUNCTION__) << "task run4, iteration " << i << " TX: " << *trans; + sc_core::sc_time d; + dut.isck->b_transport(*trans, d); + state.write_tx.first.emplace_back(trans); + StartAddr += state.BurstSizeBytes; + } + SCCDEBUG(__FUNCTION__) << "task run4 finished"; + }); + + unsigned cycles{0}; + while(cycles < 1000 && !(run1.terminated() && run2.terminated() && run3.terminated() && run4.terminated())) { + sc_start(10 * dut.clk.period()); + cycles += 10; + } + return cycles; +} + +TEST_CASE("apb_read_write", "[APB][pin-level]") { + struct { + unsigned int ResetCycles{4}; + unsigned int BurstLengthByte{4}; + unsigned int BurstSizeBytes{4}; + unsigned int NumberOfIterations{1}; + std::pair, std::vector> read_tx; + std::pair, std::vector> write_tx; + unsigned resp_cnt{0}; + } state; + + auto cycles = run_scenario(state); + + REQUIRE(cycles < 1000); + REQUIRE(sc_report_handler::get_count(SC_ERROR) == 0); + REQUIRE(sc_report_handler::get_count(SC_WARNING) == 0); + + REQUIRE(state.resp_cnt == 4 * state.NumberOfIterations); + { + auto& e = state.write_tx; + auto const& send_tx = e.first; + auto const& recv_tx = e.second; + REQUIRE(send_tx.size() == recv_tx.size()); + for(auto i = 0; i < send_tx.size(); ++i) { + REQUIRE(send_tx[i]->get_response_status() == tlm::TLM_OK_RESPONSE); + CHECK(is_equal(*send_tx[i], *recv_tx[i])); + } + } + { + auto& e = state.read_tx; + auto const& send_tx = e.first; + auto const& recv_tx = e.second; + REQUIRE(send_tx.size() == recv_tx.size()); + for(auto i = 0; i < send_tx.size(); ++i) { + REQUIRE(send_tx[i]->get_response_status() == tlm::TLM_OK_RESPONSE); + CHECK(is_equal(*send_tx[i], *recv_tx[i])); + } + } +} + +TEST_CASE("apb_narrow_read_write", "[APB][pin-level]") { + struct { + unsigned int ResetCycles{4}; + unsigned int BurstLengthByte{1}; + unsigned int BurstSizeBytes{1}; + unsigned int NumberOfIterations{8}; + std::pair, std::vector> read_tx; + std::pair, std::vector> write_tx; + unsigned resp_cnt{0}; + } state; + + auto cycles = run_scenario(state); + + REQUIRE(cycles < 1000); + REQUIRE(sc_report_handler::get_count(SC_ERROR) == 0); + REQUIRE(sc_report_handler::get_count(SC_WARNING) == 0); + + REQUIRE(state.resp_cnt == 4 * state.NumberOfIterations); + { + auto& e = state.write_tx; + auto const& send_tx = e.first; + auto const& recv_tx = e.second; + REQUIRE(send_tx.size() == recv_tx.size()); + for(auto i = 0; i < send_tx.size(); ++i) + CHECK(is_equal(*send_tx[i], *recv_tx[i])); + } + { + auto& e = state.read_tx; + auto const& send_tx = e.first; + auto const& recv_tx = e.second; + REQUIRE(send_tx.size() == recv_tx.size()); + // Narrow reads cannot be checked as they arrive a word read at the target + // for(auto i = 0; i < send_tx.size(); ++i) + // CHECK(is_equal(*send_tx[i], *recv_tx[i])); + } +} + +TEST_CASE("apb_delayed_read_write", "[APB][pin-level]") { + struct { + unsigned int ResetCycles{4}; + unsigned int BurstLengthByte{4}; + unsigned int BurstSizeBytes{4}; + unsigned int NumberOfIterations{2}; + std::pair, std::vector> read_tx; + std::pair, std::vector> write_tx; + unsigned resp_cnt{0}; + } state; + + auto cycles = run_scenario(state, 2); + + REQUIRE(cycles < 1000); + REQUIRE(sc_report_handler::get_count(SC_ERROR) == 0); + REQUIRE(sc_report_handler::get_count(SC_WARNING) == 0); + + REQUIRE(state.resp_cnt == 4 * state.NumberOfIterations); + { + auto& e = state.write_tx; + auto const& send_tx = e.first; + auto const& recv_tx = e.second; + REQUIRE(send_tx.size() == recv_tx.size()); + for(auto i = 0; i < send_tx.size(); ++i) { + REQUIRE(send_tx[i]->get_response_status() == tlm::TLM_OK_RESPONSE); + CHECK(is_equal(*send_tx[i], *recv_tx[i])); + } + } + { + auto& e = state.read_tx; + auto const& send_tx = e.first; + auto const& recv_tx = e.second; + REQUIRE(send_tx.size() == recv_tx.size()); + for(auto i = 0; i < send_tx.size(); ++i) { + REQUIRE(send_tx[i]->get_response_status() == tlm::TLM_OK_RESPONSE); + CHECK(is_equal(*send_tx[i], *recv_tx[i])); + } + } +} diff --git a/tests/apb_pin_level/testbench.h b/tests/apb_pin_level/testbench.h new file mode 100644 index 0000000..bb14d26 --- /dev/null +++ b/tests/apb_pin_level/testbench.h @@ -0,0 +1,89 @@ +#ifndef _TESTBENCH_H_ +#define _TESTBENCH_H_ + +#include +#include +#include + +using namespace sc_core; + +class testbench : public sc_core::sc_module { +public: + enum { DATA_WIDTH = 32, ADDR_WIDTH = 32 }; + using addr_t = typename apb::pin::initiator::addr_t; + using data_t = apb::pin::initiator::data_t; + using strb_t = sc_dt::sc_uint; + sc_core::sc_time clk_period{10, sc_core::SC_NS}; + sc_core::sc_clock clk{"clk", clk_period, 0.5, sc_core::SC_ZERO_TIME, true}; + sc_core::sc_signal rst_n{"rst_n"}; + // initiator side + tlm::scc::initiator_mixin> isck{"isck"}; + apb::pin::initiator intor_bfm{"intor_bfm"}; + // signal accurate bus + sc_core::sc_signal PADDR{"PADDR"}; + sc_core::sc_signal> PPROT{"PPROT"}; + sc_core::sc_signal PNSE{"PNSE"}; + sc_core::sc_signal PSELx{"PSELx"}; + sc_core::sc_signal PENABLE{"PENABLE"}; + sc_core::sc_signal PWRITE{"PWRITE"}; + sc_core::sc_signal PWDATA{"PWDATA"}; + sc_core::sc_signal PSTRB{"PSTRB"}; + sc_core::sc_signal PREADY{"PREADY"}; + sc_core::sc_signal PRDATA{"PRDATA"}; + sc_core::sc_signal PSLVERR{"PSLVERR"}; + sc_core::sc_signal PWAKEUP{"PWAKEUP"}; + // target side + apb::pin::target tgt_bfm{"tgt_bfm"}; + tlm::scc::target_mixin> tsck{"tsck"}; + +public: + SC_HAS_PROCESS(testbench); + testbench() + : testbench("testbench") {} + testbench(sc_core::sc_module_name nm) + : sc_core::sc_module(nm) { + intor_bfm.PCLK_i(clk); + tgt_bfm.PCLK_i(clk); + // bfm to signals + isck(intor_bfm.tsckt); + intor_bfm.PRESETn_i(rst_n); + intor_bfm.PADDR_o(PADDR); + intor_bfm.PPROT_o(PPROT); + intor_bfm.PNSE_o(PNSE); + intor_bfm.PSELx_o(PSELx); + intor_bfm.PENABLE_o(PENABLE); + intor_bfm.PWRITE_o(PWRITE); + intor_bfm.PWDATA_o(PWDATA); + intor_bfm.PSTRB_o(PSTRB); + intor_bfm.PREADY_i(PREADY); + intor_bfm.PRDATA_i(PRDATA); + intor_bfm.PSLVERR_i(PSLVERR); + intor_bfm.PWAKEUP_o(PWAKEUP); + + tgt_bfm.PRESETn_i(rst_n); + tgt_bfm.PADDR_i(PADDR); + tgt_bfm.PPROT_i(PPROT); + tgt_bfm.PNSE_i(PNSE); + tgt_bfm.PSELx_i(PSELx); + tgt_bfm.PENABLE_i(PENABLE); + tgt_bfm.PWRITE_i(PWRITE); + tgt_bfm.PWDATA_i(PWDATA); + tgt_bfm.PSTRB_i(PSTRB); + tgt_bfm.PREADY_o(PREADY); + tgt_bfm.PRDATA_o(PRDATA); + tgt_bfm.PSLVERR_o(PSLVERR); + tgt_bfm.PWAKEUP_i(PWAKEUP); + + tgt_bfm.isckt(tsck); + tsck.register_b_transport([this](tlm::tlm_base_protocol_types::tlm_payload_type& trans, sc_core::sc_time& d) { + if(cb_delegate) + cb_delegate(trans, d); + }); + } + + void run1() {} + void register_b_transport(std::function cb) { cb_delegate = cb; } + std::function cb_delegate; +}; + +#endif // _TESTBENCH_H_ From 9a41d1ac80abbb6d4a5addd49f4d837554290b4f Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Wed, 7 Aug 2024 11:07:25 +0200 Subject: [PATCH 13/31] updates SCC to version 2024.07 --- scc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scc b/scc index 621a069..010aac1 160000 --- a/scc +++ b/scc @@ -1 +1 @@ -Subproject commit 621a0695aa072ec934c57d0894454aca08d3ccf7 +Subproject commit 010aac102a7bfda042debf09c51981ee55c723ac From 12f3ecd6f30a0345bf8de5e2483f80c4ba47c200 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Thu, 10 Oct 2024 12:53:33 +0200 Subject: [PATCH 14/31] adds test for tracing of sc_fixed datatypes --- .cproject | 6 +- scc | 2 +- tests/CMakeLists.txt | 1 + tests/sc_fixed_tracing/CMakeLists.txt | 3 + tests/sc_fixed_tracing/sc_main.cpp | 82 +++++++++++++++++++++++++++ 5 files changed, 90 insertions(+), 4 deletions(-) create mode 100644 tests/sc_fixed_tracing/CMakeLists.txt create mode 100644 tests/sc_fixed_tracing/sc_main.cpp diff --git a/.cproject b/.cproject index f7efdd6..f0cfc10 100644 --- a/.cproject +++ b/.cproject @@ -14,7 +14,7 @@ - + @@ -28,8 +28,8 @@ - - + + diff --git a/scc b/scc index 010aac1..966e575 160000 --- a/scc +++ b/scc @@ -1 +1 @@ -Subproject commit 010aac102a7bfda042debf09c51981ee55c723ac +Subproject commit 966e575aba7f2f4ffc8a422d522f7173c4c7d98c diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 0d161b8..1e275dc 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -7,6 +7,7 @@ add_subdirectory(axi4_pin_level) add_subdirectory(ace_pin_level) add_subdirectory(configuration) add_subdirectory(configurer) +add_subdirectory(sc_fixed_tracing) if(FULL_TEST_SUITE) add_subdirectory(sim_performance) endif() diff --git a/tests/sc_fixed_tracing/CMakeLists.txt b/tests/sc_fixed_tracing/CMakeLists.txt new file mode 100644 index 0000000..8dcb049 --- /dev/null +++ b/tests/sc_fixed_tracing/CMakeLists.txt @@ -0,0 +1,3 @@ +add_executable (sc_fixed_tracing sc_main.cpp) +target_link_libraries (sc_fixed_tracing LINK_PUBLIC scc-sysc) +add_test(NAME sc_fixed_tracing_test COMMAND sc_fixed_tracing ) \ No newline at end of file diff --git a/tests/sc_fixed_tracing/sc_main.cpp b/tests/sc_fixed_tracing/sc_main.cpp new file mode 100644 index 0000000..769b18f --- /dev/null +++ b/tests/sc_fixed_tracing/sc_main.cpp @@ -0,0 +1,82 @@ +#define SC_INCLUDE_FX +#include +#include +#include +#include +#include +#include +#include + +using namespace sc_dt; +using namespace std; + +struct testbench : public sc_core::sc_module { + scc::sc_variable> a{"a", sc_dt::sc_fixed<6, 4>()}; + scc::sc_variable> b_sc_sat{"b_sc_sat", 0}; + scc::sc_variable> a_qant{"a_qant", 0}; + scc::sc_variable> b_sc_rnd{"b_sc_rnd", 0}; + scc::sc_variable> b_sc_trn{"b_sc_trn", 0}; + sc_fixed<5, 3> a_fixed; + sc_dt::sc_fix a_fix{5, 3}; + sc_fxtype_params params{5, 4}; + sc_fxtype_context context{params}; + // becase we do not specify in b_fix constructor anything + // the parameters are taken form the latest created context + sc_fix b_fix; + sc_fix c_fix{5, 3}; + + testbench(sc_core::sc_module_name const& nm) + : sc_module(nm) { + SC_HAS_PROCESS(testbench); + SC_THREAD(run); + } + + void trace(sc_core::sc_trace_file* trf) const override { + a.trace(trf); + scc::sc_trace(trf, a_fixed, std::string(name()) + ".a_fixed"); + scc::sc_trace(trf, a_fix, std::string(name()) + ".a_fix"); + scc::sc_trace(trf, b_fix, std::string(name()) + ".b_fix"); + scc::sc_trace(trf, c_fix, std::string(name()) + ".c_fix"); + } + + void run() { + wait(1_ns); + init(); + wait(1_ns); + test_overflow_modes(); + wait(1_ns); + test_quantization_modes(); + wait(1_ns); + this->a = 2; + wait(1_ps); + sc_core::sc_stop(); + } + + void init() { + a_fixed = 1.75; + a_fix = 1.75; + b_fix = 1.75; + c_fix = 1.75; + } + void test_overflow_modes() { + a = -7; + b_sc_sat = *a; + } + + void test_quantization_modes() { + a_qant = -2.3125; + b_sc_rnd = *a_qant; + b_sc_trn = *a_qant; + } +}; + +int sc_main(int sc_argc, char* sc_argv[]) { + scc::init_logging(scc::log::INFO); + scc::configurer cfg(""); + scc::tracer trc("sc_fixed_tracing"); + testbench tb("tb"); + sc_core::sc_start(); + SCCINFO("sc_main") << "End Simulation."; + + return sc_core::sc_report_handler::get_count(sc_core::SC_ERROR) + sc_core::sc_report_handler::get_count(sc_core::SC_WARNING); +} // End of 'sc_main' From 2043e43140a08e77305be4714516b1b465c2cf60 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Thu, 10 Oct 2024 20:52:52 +0200 Subject: [PATCH 15/31] updates scc --- scc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scc b/scc index 966e575..66d3b8f 160000 --- a/scc +++ b/scc @@ -1 +1 @@ -Subproject commit 966e575aba7f2f4ffc8a422d522f7173c4c7d98c +Subproject commit 66d3b8f9ee209d7343448bf259b93cc4ab85218b From bc2ba8161de514884c07d2b25ef9695ee85097a6 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Wed, 11 Dec 2024 09:16:04 +0100 Subject: [PATCH 16/31] adds some testing for CXS TLM implementation --- CMakePresets.json | 9 ++++ scc | 2 +- tests/CMakeLists.txt | 1 + tests/cxs_tlm/CMakeLists.txt | 3 ++ tests/cxs_tlm/sc_main.cpp | 92 ++++++++++++++++++++++++++++++++++++ 5 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 tests/cxs_tlm/CMakeLists.txt create mode 100644 tests/cxs_tlm/sc_main.cpp diff --git a/CMakePresets.json b/CMakePresets.json index 7db4d33..d2c6882 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -18,6 +18,15 @@ "CMAKE_PROJECT_TOP_LEVEL_INCLUDES":"cmake-conan/conan_provider.cmake" } }, + { + "name": "DebugCXX11", + "cacheVariables": { + "CMAKE_POLICY_DEFAULT_CMP0091": "NEW", + "CMAKE_BUILD_TYPE": "Debug", + "CMAKE_CXX_STANDARD": "11", + "CMAKE_PROJECT_TOP_LEVEL_INCLUDES":"cmake-conan/conan_provider.cmake" + } + }, { "name": "RelWithDebInfo", "cacheVariables": { diff --git a/scc b/scc index 66d3b8f..8b9784d 160000 --- a/scc +++ b/scc @@ -1 +1 @@ -Subproject commit 66d3b8f9ee209d7343448bf259b93cc4ab85218b +Subproject commit 8b9784da1cd849e86df6a22b55bdaeec3572d762 diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 1e275dc..7004527 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -8,6 +8,7 @@ add_subdirectory(ace_pin_level) add_subdirectory(configuration) add_subdirectory(configurer) add_subdirectory(sc_fixed_tracing) +add_subdirectory(cxs_tlm) if(FULL_TEST_SUITE) add_subdirectory(sim_performance) endif() diff --git a/tests/cxs_tlm/CMakeLists.txt b/tests/cxs_tlm/CMakeLists.txt new file mode 100644 index 0000000..1a68c5b --- /dev/null +++ b/tests/cxs_tlm/CMakeLists.txt @@ -0,0 +1,3 @@ +add_executable (cxs_tlm sc_main.cpp) +target_link_libraries (cxs_tlm LINK_PUBLIC busses scc-sysc) +add_test(NAME cxs_tlm COMMAND cxs_tlm ) \ No newline at end of file diff --git a/tests/cxs_tlm/sc_main.cpp b/tests/cxs_tlm/sc_main.cpp new file mode 100644 index 0000000..8474fb9 --- /dev/null +++ b/tests/cxs_tlm/sc_main.cpp @@ -0,0 +1,92 @@ +#define SC_INCLUDE_FX +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace sc_dt; +using namespace std; +using namespace cxs; + +enum {PHIT_WIDTH=664}; +struct testbench : public sc_core::sc_module, +public tlm::nw::tlm_network_fw_transport_if, +public tlm::nw::tlm_network_bw_transport_if { + + using transaction_type = tlm_network_cxs_types::tlm_payload_type; + using phase_type = tlm_network_cxs_types::tlm_phase_type; + + sc_core::sc_clock clk{"clk", 1_ns}; + tlm_network_cxs_initiator_socket isck{"isck"}; + cxs_channel cxs_chan{"cxs_chan"}; + tlm_network_cxs_target_socket tsck{"tsck"}; + + testbench(sc_core::sc_module_name const& nm) + : sc_module(nm) { + isck(*this); + tsck(*this); + cxs_chan.rcv_clk_i(clk); + isck(cxs_chan.tsck); + cxs_chan.isck(tsck); + SC_HAS_PROCESS(testbench); + SC_THREAD(run); + cxs_chan.channel_delay.set_value(100_ns); + } + + void run() { + cxs::tlm_network_cxs_payload trans; + trans.set_command(cxs::CXS_CMD::DATA); + sc_core::sc_time t = sc_core::SC_ZERO_TIME; + isck->b_transport(trans, t); + tlm_cxs_shared_ptr trans_ptr = tlm_mm_cxs::get().allocate(); + auto phase{tlm::nw::REQUEST}; + auto status = isck->nb_transport_fw(*trans_ptr, phase, t); + if(status == tlm::TLM_UPDATED) { + sc_assert(phase==tlm::nw::CONFIRM); + } + wait(target_received_evt); + sc_core::sc_stop(); + } + + void b_transport(transaction_type& trans, sc_core::sc_time& t) override { + SCCINFO(SCMOD)<<"Received blocking transaction"; + } + + tlm::tlm_sync_enum nb_transport_fw(transaction_type& trans, phase_type& phase, sc_core::sc_time& t) override { + if(phase==tlm::nw::INDICATION) { + SCCINFO(SCMOD)<<"Received non-blocking transaction with phase " << phase.get_name(); + target_received_evt.notify(sc_core::SC_ZERO_TIME); + phase = tlm::nw::RESPONSE; + return tlm::TLM_UPDATED; + } + throw std::runtime_error("illegal request in forward path"); + } + + tlm::tlm_sync_enum nb_transport_bw(transaction_type& trans, phase_type& phase, sc_core::sc_time& t) override { + if(phase==tlm::nw::CONFIRM) { + return tlm::TLM_ACCEPTED; + } + throw std::runtime_error("illegal response in backward path"); + } + + unsigned int transport_dbg(transaction_type& trans) override { + return 0; + } + + sc_core::sc_event target_received_evt; +}; + +int sc_main(int sc_argc, char* sc_argv[]) { + scc::init_logging(scc::log::INFO); + scc::configurer cfg(""); + scc::tracer trc("cxs_tlm"); + testbench tb("tb"); + sc_core::sc_start(); + SCCINFO("sc_main") << "End Simulation."; + + return sc_core::sc_report_handler::get_count(sc_core::SC_ERROR) + sc_core::sc_report_handler::get_count(sc_core::SC_WARNING); +} // End of 'sc_main' From 56024ae892351b63f61ff3e21d17ec52fb54ab17 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Wed, 11 Dec 2024 09:18:37 +0100 Subject: [PATCH 17/31] applies clang format --- .cproject | 39 ++++++++++++++++++++++++++++++++++++++- scc | 2 +- tests/cxs_tlm/sc_main.cpp | 24 ++++++++++-------------- 3 files changed, 49 insertions(+), 16 deletions(-) diff --git a/.cproject b/.cproject index f0cfc10..88b07a7 100644 --- a/.cproject +++ b/.cproject @@ -14,7 +14,7 @@ - + @@ -106,6 +106,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -115,6 +151,7 @@ + diff --git a/scc b/scc index 8b9784d..f1d5dc5 160000 --- a/scc +++ b/scc @@ -1 +1 @@ -Subproject commit 8b9784da1cd849e86df6a22b55bdaeec3572d762 +Subproject commit f1d5dc53353c9094480004073bd30986299b3f2f diff --git a/tests/cxs_tlm/sc_main.cpp b/tests/cxs_tlm/sc_main.cpp index 8474fb9..44d5367 100644 --- a/tests/cxs_tlm/sc_main.cpp +++ b/tests/cxs_tlm/sc_main.cpp @@ -1,10 +1,10 @@ #define SC_INCLUDE_FX +#include #include #include #include #include #include -#include #include #include @@ -12,10 +12,10 @@ using namespace sc_dt; using namespace std; using namespace cxs; -enum {PHIT_WIDTH=664}; +enum { PHIT_WIDTH = 664 }; struct testbench : public sc_core::sc_module, -public tlm::nw::tlm_network_fw_transport_if, -public tlm::nw::tlm_network_bw_transport_if { + public tlm::nw::tlm_network_fw_transport_if, + public tlm::nw::tlm_network_bw_transport_if { using transaction_type = tlm_network_cxs_types::tlm_payload_type; using phase_type = tlm_network_cxs_types::tlm_phase_type; @@ -46,19 +46,17 @@ public tlm::nw::tlm_network_bw_transport_if { auto phase{tlm::nw::REQUEST}; auto status = isck->nb_transport_fw(*trans_ptr, phase, t); if(status == tlm::TLM_UPDATED) { - sc_assert(phase==tlm::nw::CONFIRM); + sc_assert(phase == tlm::nw::CONFIRM); } wait(target_received_evt); sc_core::sc_stop(); } - void b_transport(transaction_type& trans, sc_core::sc_time& t) override { - SCCINFO(SCMOD)<<"Received blocking transaction"; - } + void b_transport(transaction_type& trans, sc_core::sc_time& t) override { SCCINFO(SCMOD) << "Received blocking transaction"; } tlm::tlm_sync_enum nb_transport_fw(transaction_type& trans, phase_type& phase, sc_core::sc_time& t) override { - if(phase==tlm::nw::INDICATION) { - SCCINFO(SCMOD)<<"Received non-blocking transaction with phase " << phase.get_name(); + if(phase == tlm::nw::INDICATION) { + SCCINFO(SCMOD) << "Received non-blocking transaction with phase " << phase.get_name(); target_received_evt.notify(sc_core::SC_ZERO_TIME); phase = tlm::nw::RESPONSE; return tlm::TLM_UPDATED; @@ -67,15 +65,13 @@ public tlm::nw::tlm_network_bw_transport_if { } tlm::tlm_sync_enum nb_transport_bw(transaction_type& trans, phase_type& phase, sc_core::sc_time& t) override { - if(phase==tlm::nw::CONFIRM) { + if(phase == tlm::nw::CONFIRM) { return tlm::TLM_ACCEPTED; } throw std::runtime_error("illegal response in backward path"); } - unsigned int transport_dbg(transaction_type& trans) override { - return 0; - } + unsigned int transport_dbg(transaction_type& trans) override { return 0; } sc_core::sc_event target_received_evt; }; From 6df06684bc6322a3ca15b254b0d1348626553e51 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Wed, 11 Dec 2024 10:52:45 +0100 Subject: [PATCH 18/31] fixes project setup --- .cproject | 29 ++++++++++++++--------------- CMakePresets.json | 15 +++------------ cmake-conan | 2 +- 3 files changed, 18 insertions(+), 28 deletions(-) diff --git a/.cproject b/.cproject index 88b07a7..fea828d 100644 --- a/.cproject +++ b/.cproject @@ -28,10 +28,9 @@ - - + + - @@ -106,8 +105,8 @@ - - + + @@ -119,22 +118,22 @@ - - - - - - - - + + + + + + + + - - + + diff --git a/CMakePresets.json b/CMakePresets.json index d2c6882..86840c3 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -15,16 +15,7 @@ "CMAKE_POLICY_DEFAULT_CMP0091": "NEW", "CMAKE_BUILD_TYPE": "Debug", "CMAKE_CXX_STANDARD": "17", - "CMAKE_PROJECT_TOP_LEVEL_INCLUDES":"cmake-conan/conan_provider.cmake" - } - }, - { - "name": "DebugCXX11", - "cacheVariables": { - "CMAKE_POLICY_DEFAULT_CMP0091": "NEW", - "CMAKE_BUILD_TYPE": "Debug", - "CMAKE_CXX_STANDARD": "11", - "CMAKE_PROJECT_TOP_LEVEL_INCLUDES":"cmake-conan/conan_provider.cmake" + "CMAKE_PROJECT_TOP_LEVEL_INCLUDES": "cmake-conan/conan_provider.cmake" } }, { @@ -33,7 +24,7 @@ "CMAKE_POLICY_DEFAULT_CMP0091": "NEW", "CMAKE_BUILD_TYPE": "RelWithDebInfo", "CMAKE_CXX_STANDARD": "17", - "CMAKE_PROJECT_TOP_LEVEL_INCLUDES":"cmake-conan/conan_provider.cmake" + "CMAKE_PROJECT_TOP_LEVEL_INCLUDES": "cmake-conan/conan_provider.cmake" } }, { @@ -42,7 +33,7 @@ "CMAKE_POLICY_DEFAULT_CMP0091": "NEW", "CMAKE_BUILD_TYPE": "Release", "CMAKE_CXX_STANDARD": "17", - "CMAKE_PROJECT_TOP_LEVEL_INCLUDES":"cmake-conan/conan_provider.cmake" + "CMAKE_PROJECT_TOP_LEVEL_INCLUDES": "cmake-conan/conan_provider.cmake" } } ] diff --git a/cmake-conan b/cmake-conan index eba63de..c22bbf0 160000 --- a/cmake-conan +++ b/cmake-conan @@ -1 +1 @@ -Subproject commit eba63de908a994299731b49e8c84dc3d1da7896e +Subproject commit c22bbf0af0b73d5f0def24a9cdf4ce503ae79e5d From 82b219f2670965680f1475ead668eaf96f0736b9 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Wed, 11 Dec 2024 11:03:49 +0100 Subject: [PATCH 19/31] updates scc and adapts tests --- scc | 2 +- tests/axi4_pin_level/narrow_burst_test.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scc b/scc index f1d5dc5..fa87148 160000 --- a/scc +++ b/scc @@ -1 +1 @@ -Subproject commit f1d5dc53353c9094480004073bd30986299b3f2f +Subproject commit fa8714872700f47be77665ae2aee5d0bb34fc826 diff --git a/tests/axi4_pin_level/narrow_burst_test.cpp b/tests/axi4_pin_level/narrow_burst_test.cpp index 3119369..2de4521 100644 --- a/tests/axi4_pin_level/narrow_burst_test.cpp +++ b/tests/axi4_pin_level/narrow_burst_test.cpp @@ -150,7 +150,7 @@ void axi4_burst_alignment(bool pipelined_wrreq, bool write_bp) { auto& dut = factory::get(); dut.intor_bfm.pipelined_wrreq = pipelined_wrreq; - dut.tgt_pe.wr_data_accept_delay.value = write_bp ? 1 : 0; + dut.tgt_pe.wr_data_accept_delay.set_value(write_bp ? 1 : 0); auto cycles = run_scenario(state); REQUIRE(cycles < 1000); @@ -192,7 +192,7 @@ void axi4_narrow_burst(bool pipelined_wrreq, bool write_bp) { auto& dut = factory::get(); dut.intor_bfm.pipelined_wrreq = pipelined_wrreq; - dut.tgt_pe.wr_data_accept_delay.value = write_bp ? 1 : 0; + dut.tgt_pe.wr_data_accept_delay.set_value(write_bp ? 1 : 0); auto cycles = run_scenario(state); REQUIRE(cycles < 1000); From a8d883475d9bcdb25d3a6e2b97a55bd934a8b5a8 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Fri, 13 Dec 2024 20:34:58 +0100 Subject: [PATCH 20/31] applies clang-format --- tests/configuration/initiator.h | 2 +- tests/configuration/router.h | 2 +- tests/configuration/target.h | 2 +- tests/configuration/top_module.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/configuration/initiator.h b/tests/configuration/initiator.h index 4b5d938..fc071e8 100644 --- a/tests/configuration/initiator.h +++ b/tests/configuration/initiator.h @@ -134,6 +134,6 @@ private: */ void end_of_elaboration() { initiator_ID.lock(); } }; - // initiator +// initiator #endif // EXAMPLES_EX09_HIERARCHICAL_OVERRIDE_OF_PARAMETER_VALUES_INITIATOR_H_ diff --git a/tests/configuration/router.h b/tests/configuration/router.h index 6f25557..dd003e9 100644 --- a/tests/configuration/router.h +++ b/tests/configuration/router.h @@ -174,6 +174,6 @@ private: int addrSize; char stringName[50]; }; - // router +// router #endif // EXAMPLES_EX09_HIERARCHICAL_OVERRIDE_OF_PARAMETER_VALUES_ROUTER_H_ diff --git a/tests/configuration/target.h b/tests/configuration/target.h index ad4a688..aeb28fe 100644 --- a/tests/configuration/target.h +++ b/tests/configuration/target.h @@ -143,6 +143,6 @@ private: int* mem; }; - // target +// target #endif // EXAMPLES_EX09_HIERARCHICAL_OVERRIDE_OF_PARAMETER_VALUES_TARGET_H_ diff --git a/tests/configuration/top_module.h b/tests/configuration/top_module.h index 2ce77ee..1285f35 100644 --- a/tests/configuration/top_module.h +++ b/tests/configuration/top_module.h @@ -219,6 +219,6 @@ private: int targetSize; ///< Maximum target Size (preset value) int r_addr_max; ///< Maximum Router Table's memory range }; - // top_module +// top_module #endif // EXAMPLES_EX09_HIERARCHICAL_OVERRIDE_OF_PARAMETER_VALUES_TOP_MODULE_H_ From 89920683e94ab5580ab2034b71c7cd15d5640bd1 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Fri, 13 Dec 2024 20:35:17 +0100 Subject: [PATCH 21/31] updates initial CXS test --- scc | 2 +- tests/cxs_tlm/sc_main.cpp | 64 +++++++++++++++++++++++++-------------- 2 files changed, 43 insertions(+), 23 deletions(-) diff --git a/scc b/scc index fa87148..dc097db 160000 --- a/scc +++ b/scc @@ -1 +1 @@ -Subproject commit fa8714872700f47be77665ae2aee5d0bb34fc826 +Subproject commit dc097db73a29488e1aa11b823e423a55809fb843 diff --git a/tests/cxs_tlm/sc_main.cpp b/tests/cxs_tlm/sc_main.cpp index 44d5367..4d50866 100644 --- a/tests/cxs_tlm/sc_main.cpp +++ b/tests/cxs_tlm/sc_main.cpp @@ -1,5 +1,6 @@ + #define SC_INCLUDE_FX -#include +#include #include #include #include @@ -11,54 +12,71 @@ using namespace sc_dt; using namespace std; using namespace cxs; - -enum { PHIT_WIDTH = 664 }; +/* + * to be tested: + * PHITSIZE: 256, messages: 4*12bytes, 4*16bytes, 4x20bytes, 2x32bytes, 2x48bytes, 2x64bytes + */ +enum { PHIT_WIDTH = 256 }; struct testbench : public sc_core::sc_module, - public tlm::nw::tlm_network_fw_transport_if, - public tlm::nw::tlm_network_bw_transport_if { + public tlm::nw::tlm_network_fw_transport_if, + public tlm::nw::tlm_network_bw_transport_if { - using transaction_type = tlm_network_cxs_types::tlm_payload_type; - using phase_type = tlm_network_cxs_types::tlm_phase_type; + using transaction_type = cxs_packet_types::tlm_payload_type; + using phase_type = cxs_packet_types::tlm_phase_type; sc_core::sc_clock clk{"clk", 1_ns}; - tlm_network_cxs_initiator_socket isck{"isck"}; + sc_core::sc_signal rst{"rst"}; + cxs_pkt_initiator_socket<> isck{"isck"}; + cxs_transmitter tx{"tx"}; cxs_channel cxs_chan{"cxs_chan"}; - tlm_network_cxs_target_socket tsck{"tsck"}; + cxs_receiver rx{"rx"}; + cxs_pkt_target_socket<> tsck{"tsck"}; testbench(sc_core::sc_module_name const& nm) : sc_module(nm) { isck(*this); tsck(*this); - cxs_chan.rcv_clk_i(clk); - isck(cxs_chan.tsck); - cxs_chan.isck(tsck); + isck(tx.tsck); + tx.clk_i(clk); + tx.isck(cxs_chan.tsck); + cxs_chan.isck(rx.tsck); + rx.clk_i(clk); + rx.rst_i(rst); + rx.isck(tsck); SC_HAS_PROCESS(testbench); SC_THREAD(run); cxs_chan.channel_delay.set_value(100_ns); + rx.max_credit.set_value(15); } void run() { - cxs::tlm_network_cxs_payload trans; - trans.set_command(cxs::CXS_CMD::DATA); + rst = true; + for(auto i = 0u; i < 11u; ++i) + wait(clk.posedge_event()); + rst = false; + cxs::cxs_packet_payload trans; sc_core::sc_time t = sc_core::SC_ZERO_TIME; isck->b_transport(trans, t); - tlm_cxs_shared_ptr trans_ptr = tlm_mm_cxs::get().allocate(); + wait(t); + cxs_pkt_shared_ptr trans_ptr = cxs_pkt_mm::get().allocate(); + trans_ptr->get_data().resize(16); auto phase{tlm::nw::REQUEST}; auto status = isck->nb_transport_fw(*trans_ptr, phase, t); - if(status == tlm::TLM_UPDATED) { - sc_assert(phase == tlm::nw::CONFIRM); - } + sc_assert(phase == tlm::nw::CONFIRM); wait(target_received_evt); + wait(1_us); sc_core::sc_stop(); } - void b_transport(transaction_type& trans, sc_core::sc_time& t) override { SCCINFO(SCMOD) << "Received blocking transaction"; } + void b_transport(transaction_type& trans, sc_core::sc_time& t) override { + SCCINFO(SCMOD) << "Received blocking transaction at local time " << (sc_core::sc_time_stamp() + t); + } tlm::tlm_sync_enum nb_transport_fw(transaction_type& trans, phase_type& phase, sc_core::sc_time& t) override { - if(phase == tlm::nw::INDICATION) { + if(phase == tlm::nw::REQUEST) { SCCINFO(SCMOD) << "Received non-blocking transaction with phase " << phase.get_name(); target_received_evt.notify(sc_core::SC_ZERO_TIME); - phase = tlm::nw::RESPONSE; + phase = tlm::nw::CONFIRM; return tlm::TLM_UPDATED; } throw std::runtime_error("illegal request in forward path"); @@ -66,6 +84,7 @@ struct testbench : public sc_core::sc_module, tlm::tlm_sync_enum nb_transport_bw(transaction_type& trans, phase_type& phase, sc_core::sc_time& t) override { if(phase == tlm::nw::CONFIRM) { + confirmation_evt.notify(sc_core::SC_ZERO_TIME); return tlm::TLM_ACCEPTED; } throw std::runtime_error("illegal response in backward path"); @@ -73,11 +92,12 @@ struct testbench : public sc_core::sc_module, unsigned int transport_dbg(transaction_type& trans) override { return 0; } + sc_core::sc_event confirmation_evt; sc_core::sc_event target_received_evt; }; int sc_main(int sc_argc, char* sc_argv[]) { - scc::init_logging(scc::log::INFO); + scc::init_logging(scc::log::DEBUG); scc::configurer cfg(""); scc::tracer trc("cxs_tlm"); testbench tb("tb"); From a0bd767bc98975c999d3ee1701fb12d45ef3dd8a Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Wed, 18 Dec 2024 17:31:28 +0100 Subject: [PATCH 22/31] adds some more CXS channel testing --- .cproject | 4 +- scc | 2 +- src/factory.h | 4 +- src/sc_main.cpp | 6 +- tests/cxs_tlm/CMakeLists.txt | 11 ++- tests/cxs_tlm/csx_packet_test.cpp | 115 ++++++++++++++++++++++++++++++ tests/cxs_tlm/sc_main.cpp | 108 ---------------------------- tests/cxs_tlm/testbench.h | 79 ++++++++++++++++++++ 8 files changed, 211 insertions(+), 118 deletions(-) create mode 100644 tests/cxs_tlm/csx_packet_test.cpp delete mode 100644 tests/cxs_tlm/sc_main.cpp create mode 100644 tests/cxs_tlm/testbench.h diff --git a/.cproject b/.cproject index fea828d..bc9079e 100644 --- a/.cproject +++ b/.cproject @@ -28,8 +28,8 @@ - - + + diff --git a/scc b/scc index dc097db..eadb928 160000 --- a/scc +++ b/scc @@ -1 +1 @@ -Subproject commit dc097db73a29488e1aa11b823e423a55809fb843 +Subproject commit eadb9285757d639ce1acd854551c115ef84fc903 diff --git a/src/factory.h b/src/factory.h index 2c57fce..09e8cb3 100644 --- a/src/factory.h +++ b/src/factory.h @@ -25,7 +25,7 @@ public: add(const std::string& name, Args&&... args); }; - template static T& get(const std::string& name = ""); + template static T& get(const std::string& name = typeid(T).name()); void create(); @@ -50,7 +50,7 @@ private: std::map m_objects; }; -template factory::add::add(Args&&... args) { add("", args...); } +template factory::add::add(Args&&... args) { add(typeid(T).name(), args...); } template factory::add::add(const std::string& name, Args&&... args) { factory::get_instance().add_object(name, [args...]() -> object { diff --git a/src/sc_main.cpp b/src/sc_main.cpp index 6ff5088..eced2bc 100644 --- a/src/sc_main.cpp +++ b/src/sc_main.cpp @@ -27,8 +27,9 @@ int sc_main(int argc, char* argv[]) { scc::init_logging(LogConfig().logLevel(getenv("SCC_TEST_VERBOSE") ? log::TRACE : log::FATAL).logAsync(false).msgTypeFieldWidth(35)); // create tracer if environment variable SCC_TEST_TRACE is defined std::unique_ptr tracer; - if(getenv("SCC_TEST_TRACE")) - tracer = std::make_unique(my_name, scc::tracer::NONE, scc::tracer::ENABLE); + if(auto* test_trace = getenv("SCC_TEST_TRACE")) { + tracer = std::make_unique(my_name, scc::tracer::ENABLE, scc::tracer::ENABLE); + } int result = -1; if(setjmp(abrt) == 0) { // instantiate design(s) @@ -37,6 +38,7 @@ int sc_main(int argc, char* argv[]) { result = Catch::Session().run(argc, argv); // destroy design(s) sc_stop(); + SCCTRACE()<<"Test sequence finished"; factory::get_instance().destroy(); } return result; diff --git a/tests/cxs_tlm/CMakeLists.txt b/tests/cxs_tlm/CMakeLists.txt index 1a68c5b..ede8eff 100644 --- a/tests/cxs_tlm/CMakeLists.txt +++ b/tests/cxs_tlm/CMakeLists.txt @@ -1,3 +1,8 @@ -add_executable (cxs_tlm sc_main.cpp) -target_link_libraries (cxs_tlm LINK_PUBLIC busses scc-sysc) -add_test(NAME cxs_tlm COMMAND cxs_tlm ) \ No newline at end of file +project (cxs_tlm) +add_executable(${PROJECT_NAME} + csx_packet_test.cpp + ${test_util_SOURCE_DIR}/sc_main.cpp +) +target_link_libraries (${PROJECT_NAME} PUBLIC scc::busses test_util) + +catch_discover_tests(${PROJECT_NAME}) diff --git a/tests/cxs_tlm/csx_packet_test.cpp b/tests/cxs_tlm/csx_packet_test.cpp new file mode 100644 index 0000000..98f531b --- /dev/null +++ b/tests/cxs_tlm/csx_packet_test.cpp @@ -0,0 +1,115 @@ + +#include "testbench.h" +#include +#include +#undef CHECK +#include +#include + +using namespace sc_core; + +factory::add> tb8; +factory::add> tb9; +factory::add> tb10; + +template unsigned run_scenario(STATE& state) { + auto& dut = factory::get>(); + + dut.rst.write(true); + sc_start(state.reset_cycles * dut.clk.period()); + dut.rst.write(false); + sc_start(dut.clk.period()); + + auto run1 = sc_spawn([&dut, &state]() { + auto burst_cnt{0}; + for(auto size:state.packet_sizes) { + cxs_pkt_shared_ptr tx_pkt = cxs_pkt_mm::get().allocate(); + tx_pkt->get_data().resize(size); + auto phase{tlm::nw::REQUEST}; + sc_core::sc_time t = sc_core::SC_ZERO_TIME; + auto status = dut.isck->nb_transport_fw(*tx_pkt, phase, t); + REQUIRE(status == tlm::TLM_UPDATED); + REQUIRE(phase == tlm::nw::CONFIRM); + if(++burst_cnt==state.granularity) { + wait(dut.recv.data_written_event()); + while(!dut.recv.empty()) { + auto recv_pkt = dut.recv.front(); + dut.recv.pop_front(); + REQUIRE(tx_pkt==recv_pkt); + REQUIRE(recv_pkt->get_data().size()==state.packet_sizes[state.resp_cnt]); + state.resp_cnt++; + } + burst_cnt=0; + } + } + }); + + unsigned cycles{0}; + while(cycles < state.max_cycles && !(run1.terminated())) { + // while(cycles<1000 && !(run5.terminated())){ + sc_start(10 * dut.clk.period()); + cycles += 10; + } + return cycles; +} + +template +unsigned run_scenario(int width, STATE &state) +{ + switch (width) { + case 8: + case 256: + return run_scenario<256>(state); + case 9: + case 512: + return run_scenario<512>(state); + case 10: + case 1024: + return run_scenario<1024>(state); + } + return 0; +} + +TEST_CASE("single-packet", "[CXS][tlm-level]") { + struct { + unsigned int reset_cycles{4}; + unsigned int max_cycles = 5000; + std::vector packet_sizes; + unsigned granularity{1}; + unsigned resp_cnt{0}; + } state; + + + state.packet_sizes.assign({4, 8, 16, 32, 64, 128, 256, 1024}); + for(auto width=8; width<11; ++width) { + state.resp_cnt = 0; + auto cycles = run_scenario(width, state); + + REQUIRE(cycles < state.max_cycles); + REQUIRE(sc_report_handler::get_count(SC_ERROR) == 0); + REQUIRE(sc_report_handler::get_count(SC_WARNING) == 0); + + REQUIRE(state.resp_cnt == state.packet_sizes.size()); + } +} +/* +TEST_CASE("flit-alignment", "[CXS][tlm-level]") { + struct { + unsigned int reset_cycles{4}; + std::vector packet_sizes; + unsigned granularity{2}; + unsigned resp_cnt{0}; + } state; + + state.packet_sizes.assign({4, 32, 32, 8, 64, 128}); + state.resp_cnt = 0; + auto cycles = run_scenario(8, state); + + REQUIRE(cycles < 1000); + REQUIRE(sc_report_handler::get_count(SC_ERROR) == 0); + REQUIRE(sc_report_handler::get_count(SC_WARNING) == 0); + + REQUIRE(state.resp_cnt == state.packet_sizes.size()); +} + +*/ diff --git a/tests/cxs_tlm/sc_main.cpp b/tests/cxs_tlm/sc_main.cpp deleted file mode 100644 index 4d50866..0000000 --- a/tests/cxs_tlm/sc_main.cpp +++ /dev/null @@ -1,108 +0,0 @@ - -#define SC_INCLUDE_FX -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace sc_dt; -using namespace std; -using namespace cxs; -/* - * to be tested: - * PHITSIZE: 256, messages: 4*12bytes, 4*16bytes, 4x20bytes, 2x32bytes, 2x48bytes, 2x64bytes - */ -enum { PHIT_WIDTH = 256 }; -struct testbench : public sc_core::sc_module, - public tlm::nw::tlm_network_fw_transport_if, - public tlm::nw::tlm_network_bw_transport_if { - - using transaction_type = cxs_packet_types::tlm_payload_type; - using phase_type = cxs_packet_types::tlm_phase_type; - - sc_core::sc_clock clk{"clk", 1_ns}; - sc_core::sc_signal rst{"rst"}; - cxs_pkt_initiator_socket<> isck{"isck"}; - cxs_transmitter tx{"tx"}; - cxs_channel cxs_chan{"cxs_chan"}; - cxs_receiver rx{"rx"}; - cxs_pkt_target_socket<> tsck{"tsck"}; - - testbench(sc_core::sc_module_name const& nm) - : sc_module(nm) { - isck(*this); - tsck(*this); - isck(tx.tsck); - tx.clk_i(clk); - tx.isck(cxs_chan.tsck); - cxs_chan.isck(rx.tsck); - rx.clk_i(clk); - rx.rst_i(rst); - rx.isck(tsck); - SC_HAS_PROCESS(testbench); - SC_THREAD(run); - cxs_chan.channel_delay.set_value(100_ns); - rx.max_credit.set_value(15); - } - - void run() { - rst = true; - for(auto i = 0u; i < 11u; ++i) - wait(clk.posedge_event()); - rst = false; - cxs::cxs_packet_payload trans; - sc_core::sc_time t = sc_core::SC_ZERO_TIME; - isck->b_transport(trans, t); - wait(t); - cxs_pkt_shared_ptr trans_ptr = cxs_pkt_mm::get().allocate(); - trans_ptr->get_data().resize(16); - auto phase{tlm::nw::REQUEST}; - auto status = isck->nb_transport_fw(*trans_ptr, phase, t); - sc_assert(phase == tlm::nw::CONFIRM); - wait(target_received_evt); - wait(1_us); - sc_core::sc_stop(); - } - - void b_transport(transaction_type& trans, sc_core::sc_time& t) override { - SCCINFO(SCMOD) << "Received blocking transaction at local time " << (sc_core::sc_time_stamp() + t); - } - - tlm::tlm_sync_enum nb_transport_fw(transaction_type& trans, phase_type& phase, sc_core::sc_time& t) override { - if(phase == tlm::nw::REQUEST) { - SCCINFO(SCMOD) << "Received non-blocking transaction with phase " << phase.get_name(); - target_received_evt.notify(sc_core::SC_ZERO_TIME); - phase = tlm::nw::CONFIRM; - return tlm::TLM_UPDATED; - } - throw std::runtime_error("illegal request in forward path"); - } - - tlm::tlm_sync_enum nb_transport_bw(transaction_type& trans, phase_type& phase, sc_core::sc_time& t) override { - if(phase == tlm::nw::CONFIRM) { - confirmation_evt.notify(sc_core::SC_ZERO_TIME); - return tlm::TLM_ACCEPTED; - } - throw std::runtime_error("illegal response in backward path"); - } - - unsigned int transport_dbg(transaction_type& trans) override { return 0; } - - sc_core::sc_event confirmation_evt; - sc_core::sc_event target_received_evt; -}; - -int sc_main(int sc_argc, char* sc_argv[]) { - scc::init_logging(scc::log::DEBUG); - scc::configurer cfg(""); - scc::tracer trc("cxs_tlm"); - testbench tb("tb"); - sc_core::sc_start(); - SCCINFO("sc_main") << "End Simulation."; - - return sc_core::sc_report_handler::get_count(sc_core::SC_ERROR) + sc_core::sc_report_handler::get_count(sc_core::SC_WARNING); -} // End of 'sc_main' diff --git a/tests/cxs_tlm/testbench.h b/tests/cxs_tlm/testbench.h new file mode 100644 index 0000000..368a88a --- /dev/null +++ b/tests/cxs_tlm/testbench.h @@ -0,0 +1,79 @@ +#ifndef _TESTBENCH_H_ +#define _TESTBENCH_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace sc_core; +using namespace sc_dt; +using namespace std; +using namespace cxs; + +const char* sc_gen_unique_name( const char*, bool preserve_first ); +template +struct testbench : public sc_core::sc_module { + + using transaction_type = cxs_packet_types::tlm_payload_type; + using phase_type = cxs_packet_types::tlm_phase_type; + + sc_core::sc_clock clk{"clk", 1_ns}; + sc_core::sc_signal rst{"rst"}; + tlm::nw::initiator_mixin, cxs_packet_types> isck{"isck"}; + cxs_transmitter tx{"tx"}; + cxs_channel cxs_chan{"cxs_chan"}; + cxs_receiver rx{"rx"}; + tlm::nw::target_mixin,cxs_packet_types> tsck{"tsck"}; + + testbench() + : testbench(sc_core::sc_gen_unique_name("testbench", false)) {} + + testbench(sc_core::sc_module_name const& nm) + : sc_module(nm) { + isck.register_nb_transport_bw([this](transaction_type& trans, phase_type& phase, sc_core::sc_time& t) { + return this->nb_transport_fw(trans, phase, t); + }); + tsck.register_nb_transport_fw([this](transaction_type& trans, phase_type& phase, sc_core::sc_time& t) { + return this->nb_transport_fw(trans, phase, t); + }); + isck(tx.tsck); + tx.clk_i(clk); + tx.isck(cxs_chan.tsck); + cxs_chan.isck(rx.tsck); + rx.clk_i(clk); + rx.rst_i(rst); + rx.isck(tsck); + cxs_chan.channel_delay.set_value(100_ns); + rx.max_credit.set_value(15); + } + + tlm::tlm_sync_enum nb_transport_fw(transaction_type& trans, phase_type& phase, sc_core::sc_time& t) { + if(phase == tlm::nw::REQUEST) { + SCCINFO(SCMOD) << "Received non-blocking transaction with phase " << phase.get_name(); + recv.push_back(&trans); + phase = tlm::nw::CONFIRM; + return tlm::TLM_UPDATED; + } + throw std::runtime_error("illegal request in forward path"); + } + + tlm::tlm_sync_enum nb_transport_bw(transaction_type& trans, phase_type& phase, sc_core::sc_time& t) { + if(phase == tlm::nw::CONFIRM) { + confirmation_evt.notify(sc_core::SC_ZERO_TIME); + return tlm::TLM_ACCEPTED; + } + throw std::runtime_error("illegal response in backward path"); + } + + sc_core::sc_event confirmation_evt; + scc::fifo_w_cb recv; +}; + +#endif // _TESTBENCH_H_ From f8f1f2f54c13ccec2625e1f38fc201fa5b28d79e Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Wed, 18 Dec 2024 17:36:16 +0100 Subject: [PATCH 23/31] applies clang-format --- scc | 2 +- src/sc_main.cpp | 2 +- tests/cxs_tlm/csx_packet_test.cpp | 19 ++++++++----------- tests/cxs_tlm/testbench.h | 21 +++++++++------------ 4 files changed, 19 insertions(+), 25 deletions(-) diff --git a/scc b/scc index eadb928..5046e6e 160000 --- a/scc +++ b/scc @@ -1 +1 @@ -Subproject commit eadb9285757d639ce1acd854551c115ef84fc903 +Subproject commit 5046e6e54f4dc17e9673c4d5049c55632c926fea diff --git a/src/sc_main.cpp b/src/sc_main.cpp index eced2bc..e8322ca 100644 --- a/src/sc_main.cpp +++ b/src/sc_main.cpp @@ -38,7 +38,7 @@ int sc_main(int argc, char* argv[]) { result = Catch::Session().run(argc, argv); // destroy design(s) sc_stop(); - SCCTRACE()<<"Test sequence finished"; + SCCTRACE() << "Test sequence finished"; factory::get_instance().destroy(); } return result; diff --git a/tests/cxs_tlm/csx_packet_test.cpp b/tests/cxs_tlm/csx_packet_test.cpp index 98f531b..190ab12 100644 --- a/tests/cxs_tlm/csx_packet_test.cpp +++ b/tests/cxs_tlm/csx_packet_test.cpp @@ -22,7 +22,7 @@ template unsigned run_scenario(STATE& state) { auto run1 = sc_spawn([&dut, &state]() { auto burst_cnt{0}; - for(auto size:state.packet_sizes) { + for(auto size : state.packet_sizes) { cxs_pkt_shared_ptr tx_pkt = cxs_pkt_mm::get().allocate(); tx_pkt->get_data().resize(size); auto phase{tlm::nw::REQUEST}; @@ -30,16 +30,16 @@ template unsigned run_scenario(STATE& state) { auto status = dut.isck->nb_transport_fw(*tx_pkt, phase, t); REQUIRE(status == tlm::TLM_UPDATED); REQUIRE(phase == tlm::nw::CONFIRM); - if(++burst_cnt==state.granularity) { + if(++burst_cnt == state.granularity) { wait(dut.recv.data_written_event()); while(!dut.recv.empty()) { auto recv_pkt = dut.recv.front(); dut.recv.pop_front(); - REQUIRE(tx_pkt==recv_pkt); - REQUIRE(recv_pkt->get_data().size()==state.packet_sizes[state.resp_cnt]); + REQUIRE(tx_pkt == recv_pkt); + REQUIRE(recv_pkt->get_data().size() == state.packet_sizes[state.resp_cnt]); state.resp_cnt++; } - burst_cnt=0; + burst_cnt = 0; } } }); @@ -53,10 +53,8 @@ template unsigned run_scenario(STATE& state) { return cycles; } -template -unsigned run_scenario(int width, STATE &state) -{ - switch (width) { +template unsigned run_scenario(int width, STATE& state) { + switch(width) { case 8: case 256: return run_scenario<256>(state); @@ -79,9 +77,8 @@ TEST_CASE("single-packet", "[CXS][tlm-level]") { unsigned resp_cnt{0}; } state; - state.packet_sizes.assign({4, 8, 16, 32, 64, 128, 256, 1024}); - for(auto width=8; width<11; ++width) { + for(auto width = 8; width < 11; ++width) { state.resp_cnt = 0; auto cycles = run_scenario(width, state); diff --git a/tests/cxs_tlm/testbench.h b/tests/cxs_tlm/testbench.h index 368a88a..0d127dd 100644 --- a/tests/cxs_tlm/testbench.h +++ b/tests/cxs_tlm/testbench.h @@ -7,19 +7,18 @@ #include #include #include -#include -#include #include #include +#include +#include using namespace sc_core; using namespace sc_dt; using namespace std; using namespace cxs; -const char* sc_gen_unique_name( const char*, bool preserve_first ); -template -struct testbench : public sc_core::sc_module { +const char* sc_gen_unique_name(const char*, bool preserve_first); +template struct testbench : public sc_core::sc_module { using transaction_type = cxs_packet_types::tlm_payload_type; using phase_type = cxs_packet_types::tlm_phase_type; @@ -30,19 +29,17 @@ struct testbench : public sc_core::sc_module { cxs_transmitter tx{"tx"}; cxs_channel cxs_chan{"cxs_chan"}; cxs_receiver rx{"rx"}; - tlm::nw::target_mixin,cxs_packet_types> tsck{"tsck"}; + tlm::nw::target_mixin, cxs_packet_types> tsck{"tsck"}; testbench() : testbench(sc_core::sc_gen_unique_name("testbench", false)) {} testbench(sc_core::sc_module_name const& nm) : sc_module(nm) { - isck.register_nb_transport_bw([this](transaction_type& trans, phase_type& phase, sc_core::sc_time& t) { - return this->nb_transport_fw(trans, phase, t); - }); - tsck.register_nb_transport_fw([this](transaction_type& trans, phase_type& phase, sc_core::sc_time& t) { - return this->nb_transport_fw(trans, phase, t); - }); + isck.register_nb_transport_bw( + [this](transaction_type& trans, phase_type& phase, sc_core::sc_time& t) { return this->nb_transport_fw(trans, phase, t); }); + tsck.register_nb_transport_fw( + [this](transaction_type& trans, phase_type& phase, sc_core::sc_time& t) { return this->nb_transport_fw(trans, phase, t); }); isck(tx.tsck); tx.clk_i(clk); tx.isck(cxs_chan.tsck); From 2e4d0efb50537ad5aae2a6cd73bb4992ea63164d Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Wed, 18 Dec 2024 19:23:05 +0100 Subject: [PATCH 24/31] applies clang-tidy fixes --- CMakeLists.txt | 2 +- requirements.txt | 3 ++- scc | 2 +- tests/configuration/initiator.h | 2 +- tests/configuration/router.h | 2 +- tests/configuration/target.h | 2 +- tests/configuration/top_module.h | 2 +- 7 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9f923b6..30fb7c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,7 +43,7 @@ if(ENABLE_CLANG_TIDY) endif() endif() -set(CLANG_FORMAT_EXCLUDE_PATTERNS "/third_party/") +set(CLANG_FORMAT_EXCLUDE_PATTERNS "/third_party/" "/build/") find_package(ClangFormat) find_package(ZLIB) find_package(lz4) diff --git a/requirements.txt b/requirements.txt index 32d44c7..b7d8b70 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ conan>=2.0 -cmake \ No newline at end of file +cmake +clang-format==14.0 \ No newline at end of file diff --git a/scc b/scc index 5046e6e..dd8a539 160000 --- a/scc +++ b/scc @@ -1 +1 @@ -Subproject commit 5046e6e54f4dc17e9673c4d5049c55632c926fea +Subproject commit dd8a539df05a14ab320f81af08b0db17faf489cb diff --git a/tests/configuration/initiator.h b/tests/configuration/initiator.h index fc071e8..4b5d938 100644 --- a/tests/configuration/initiator.h +++ b/tests/configuration/initiator.h @@ -134,6 +134,6 @@ private: */ void end_of_elaboration() { initiator_ID.lock(); } }; -// initiator + // initiator #endif // EXAMPLES_EX09_HIERARCHICAL_OVERRIDE_OF_PARAMETER_VALUES_INITIATOR_H_ diff --git a/tests/configuration/router.h b/tests/configuration/router.h index dd003e9..6f25557 100644 --- a/tests/configuration/router.h +++ b/tests/configuration/router.h @@ -174,6 +174,6 @@ private: int addrSize; char stringName[50]; }; -// router + // router #endif // EXAMPLES_EX09_HIERARCHICAL_OVERRIDE_OF_PARAMETER_VALUES_ROUTER_H_ diff --git a/tests/configuration/target.h b/tests/configuration/target.h index aeb28fe..ad4a688 100644 --- a/tests/configuration/target.h +++ b/tests/configuration/target.h @@ -143,6 +143,6 @@ private: int* mem; }; -// target + // target #endif // EXAMPLES_EX09_HIERARCHICAL_OVERRIDE_OF_PARAMETER_VALUES_TARGET_H_ diff --git a/tests/configuration/top_module.h b/tests/configuration/top_module.h index 1285f35..2ce77ee 100644 --- a/tests/configuration/top_module.h +++ b/tests/configuration/top_module.h @@ -219,6 +219,6 @@ private: int targetSize; ///< Maximum target Size (preset value) int r_addr_max; ///< Maximum Router Table's memory range }; -// top_module + // top_module #endif // EXAMPLES_EX09_HIERARCHICAL_OVERRIDE_OF_PARAMETER_VALUES_TOP_MODULE_H_ From 1eba464c61979134ee7c17201a907c6e8b8b9583 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Wed, 18 Dec 2024 19:31:09 +0100 Subject: [PATCH 25/31] fixes namespace in CXS test --- tests/cxs_tlm/csx_packet_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/cxs_tlm/csx_packet_test.cpp b/tests/cxs_tlm/csx_packet_test.cpp index 190ab12..aa3325b 100644 --- a/tests/cxs_tlm/csx_packet_test.cpp +++ b/tests/cxs_tlm/csx_packet_test.cpp @@ -31,7 +31,7 @@ template unsigned run_scenario(STATE& state) { REQUIRE(status == tlm::TLM_UPDATED); REQUIRE(phase == tlm::nw::CONFIRM); if(++burst_cnt == state.granularity) { - wait(dut.recv.data_written_event()); + ::sc_core::wait(dut.recv.data_written_event()); while(!dut.recv.empty()) { auto recv_pkt = dut.recv.front(); dut.recv.pop_front(); From 085423620d48632b90c9c40cbb3744df45dfecd4 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Thu, 19 Dec 2024 11:59:00 +0100 Subject: [PATCH 26/31] adds multi-packet CXS test case --- scc | 2 +- tests/cxs_tlm/csx_packet_test.cpp | 53 ++++++++++++++++++++----------- tests/cxs_tlm/testbench.h | 4 +-- 3 files changed, 37 insertions(+), 22 deletions(-) diff --git a/scc b/scc index dd8a539..331b6d7 160000 --- a/scc +++ b/scc @@ -1 +1 @@ -Subproject commit dd8a539df05a14ab320f81af08b0db17faf489cb +Subproject commit 331b6d77ea5f9aed99bd0963a3bb234cf7c98b07 diff --git a/tests/cxs_tlm/csx_packet_test.cpp b/tests/cxs_tlm/csx_packet_test.cpp index aa3325b..8000a57 100644 --- a/tests/cxs_tlm/csx_packet_test.cpp +++ b/tests/cxs_tlm/csx_packet_test.cpp @@ -4,10 +4,11 @@ #include #undef CHECK #include +#include #include using namespace sc_core; - +namespace cxs { factory::add> tb8; factory::add> tb9; factory::add> tb10; @@ -22,22 +23,34 @@ template unsigned run_scenario(STATE& state) { auto run1 = sc_spawn([&dut, &state]() { auto burst_cnt{0}; + std::deque expected_pkt; for(auto size : state.packet_sizes) { cxs_pkt_shared_ptr tx_pkt = cxs_pkt_mm::get().allocate(); tx_pkt->get_data().resize(size); + SCCDEBUG("run_scenario") << "Transmitting packet with size " << size; auto phase{tlm::nw::REQUEST}; sc_core::sc_time t = sc_core::SC_ZERO_TIME; auto status = dut.isck->nb_transport_fw(*tx_pkt, phase, t); + expected_pkt.emplace_back(tx_pkt); + tx_pkt = nullptr; REQUIRE(status == tlm::TLM_UPDATED); REQUIRE(phase == tlm::nw::CONFIRM); if(++burst_cnt == state.granularity) { - ::sc_core::wait(dut.recv.data_written_event()); - while(!dut.recv.empty()) { - auto recv_pkt = dut.recv.front(); - dut.recv.pop_front(); - REQUIRE(tx_pkt == recv_pkt); - REQUIRE(recv_pkt->get_data().size() == state.packet_sizes[state.resp_cnt]); - state.resp_cnt++; + auto rec_cnt = 0u; + while(rec_cnt < burst_cnt) { + ::sc_core::wait(dut.recv.data_written_event()); + while(!dut.recv.empty()) { + auto recv_pkt = dut.recv.front(); + dut.recv.pop_front(); + tx_pkt = expected_pkt.front(); + expected_pkt.pop_front(); + REQUIRE(tx_pkt == recv_pkt); + REQUIRE(recv_pkt->get_data().size() == state.packet_sizes[state.resp_cnt]); + state.resp_cnt++; + rec_cnt++; + SCCDEBUG("run_scenario") << "Received packet with size " << recv_pkt->get_data().size() + << ", total number of packets is " << state.resp_cnt; + } } burst_cnt = 0; } @@ -89,24 +102,26 @@ TEST_CASE("single-packet", "[CXS][tlm-level]") { REQUIRE(state.resp_cnt == state.packet_sizes.size()); } } -/* -TEST_CASE("flit-alignment", "[CXS][tlm-level]") { + +TEST_CASE("multi-packet", "[CXS][tlm-level]") { struct { unsigned int reset_cycles{4}; + unsigned int max_cycles = 5000; std::vector packet_sizes; unsigned granularity{2}; unsigned resp_cnt{0}; } state; - state.packet_sizes.assign({4, 32, 32, 8, 64, 128}); - state.resp_cnt = 0; - auto cycles = run_scenario(8, state); + state.packet_sizes.assign({4, 8, 16, 32, 16, 64, 16, 128, 16, 256, 16, 1024}); + for(auto width = 8; width < 11; ++width) { + state.resp_cnt = 0; + auto cycles = run_scenario(width, state); - REQUIRE(cycles < 1000); - REQUIRE(sc_report_handler::get_count(SC_ERROR) == 0); - REQUIRE(sc_report_handler::get_count(SC_WARNING) == 0); + REQUIRE(cycles < state.max_cycles); + REQUIRE(sc_report_handler::get_count(SC_ERROR) == 0); + REQUIRE(sc_report_handler::get_count(SC_WARNING) == 0); - REQUIRE(state.resp_cnt == state.packet_sizes.size()); + REQUIRE(state.resp_cnt == state.packet_sizes.size()); + } } - -*/ +} // namespace cxs diff --git a/tests/cxs_tlm/testbench.h b/tests/cxs_tlm/testbench.h index 0d127dd..332d43d 100644 --- a/tests/cxs_tlm/testbench.h +++ b/tests/cxs_tlm/testbench.h @@ -15,7 +15,7 @@ using namespace sc_core; using namespace sc_dt; using namespace std; -using namespace cxs; +namespace cxs { const char* sc_gen_unique_name(const char*, bool preserve_first); template struct testbench : public sc_core::sc_module { @@ -72,5 +72,5 @@ template struct testbench : public sc_core::sc_module { sc_core::sc_event confirmation_evt; scc::fifo_w_cb recv; }; - +} // namespace cxs #endif // _TESTBENCH_H_ From 5be69cfa75dfda7455d94f341ec1577378ab2300 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Thu, 19 Dec 2024 13:34:55 +0100 Subject: [PATCH 27/31] cleans up Jenkinsfile --- Jenkinsfile | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 50b2589..0a1dd7b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -58,13 +58,6 @@ pipeline { stage('Build & test') { steps { build_n_test_project() }} } } -// stage('U20.04') { -// agent {docker { image 'ubuntu-20.04' } } -// stages { -// stage('Checkout') { steps { checkout_project() }} -// stage('Build & test') { steps { build_n_test_project() }} -// } -// } stage('centos7') { agent {docker { image 'centos7' } } stages { @@ -90,7 +83,6 @@ pipeline { stage('Build & test') { steps { build_n_test_project() }} } } - // stage('Format check') { agent {docker { image 'ubuntu-riscv' } } stages { From 2c18dd4d176afcc70824a878df9dd8d7e363b6e8 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Thu, 19 Dec 2024 16:29:21 +0100 Subject: [PATCH 28/31] removes CentOS 7 from Jenkins as OS it not supported anymore --- Jenkinsfile | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0a1dd7b..d9dbfe3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -58,24 +58,6 @@ pipeline { stage('Build & test') { steps { build_n_test_project() }} } } - stage('centos7') { - agent {docker { image 'centos7' } } - stages { - stage('Checkout') { steps { checkout_project() }} - stage('Build & test') { steps { - sh''' - python3 -mvenv .venv - . .venv/bin/activate - pip3 install -r requirements.txt - conan profile detect --force -vquiet - conan install --requires 'b2/[*]' --build='*' - cmake -S . -B build --preset Release - cmake --build build -j12 - cmake --build build --target test - ''' - }} - } - } stage('rockylinux8') { agent {docker { image 'rockylinux8' } } stages { @@ -84,7 +66,7 @@ pipeline { } } stage('Format check') { - agent {docker { image 'ubuntu-riscv' } } + agent {docker { image 'ubuntu-22.04' } } stages { stage('Checkout') { steps { checkout_project() }} stage('Build & check format') { steps { From 9fcd203f877096f82451943e601741aecbd8c410 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Thu, 19 Dec 2024 17:33:46 +0100 Subject: [PATCH 29/31] updates scc and adds burst packet handling --- scc | 2 +- tests/cxs_tlm/csx_packet_test.cpp | 50 +++++++++++++++++++++++++++++-- tests/cxs_tlm/testbench.h | 1 + 3 files changed, 49 insertions(+), 4 deletions(-) diff --git a/scc b/scc index 331b6d7..d6f2a80 160000 --- a/scc +++ b/scc @@ -1 +1 @@ -Subproject commit 331b6d77ea5f9aed99bd0963a3bb234cf7c98b07 +Subproject commit d6f2a80b1b8aa49506fd6e37e21c38149bcc3ba6 diff --git a/tests/cxs_tlm/csx_packet_test.cpp b/tests/cxs_tlm/csx_packet_test.cpp index 8000a57..8bfdcf3 100644 --- a/tests/cxs_tlm/csx_packet_test.cpp +++ b/tests/cxs_tlm/csx_packet_test.cpp @@ -13,9 +13,10 @@ factory::add> tb8; factory::add> tb9; factory::add> tb10; -template unsigned run_scenario(STATE& state) { +template unsigned run_scenario(STATE& state, unsigned burst_factor = 0) { auto& dut = factory::get>(); - + if(burst_factor) + dut.tx.burst_len.set_value(burst_factor); dut.rst.write(true); sc_start(state.reset_cycles * dut.clk.period()); dut.rst.write(false); @@ -66,7 +67,7 @@ template unsigned run_scenario(STATE& state) { return cycles; } -template unsigned run_scenario(int width, STATE& state) { +template unsigned run_scenario(int width, STATE& state, unsigned burst_factor = 0) { switch(width) { case 8: case 256: @@ -124,4 +125,47 @@ TEST_CASE("multi-packet", "[CXS][tlm-level]") { REQUIRE(state.resp_cnt == state.packet_sizes.size()); } } +TEST_CASE("single-packet-burst2", "[CXS][tlm-level]") { + struct { + unsigned int reset_cycles{4}; + unsigned int max_cycles = 5000; + std::vector packet_sizes; + unsigned granularity{1}; + unsigned resp_cnt{0}; + } state; + + state.packet_sizes.assign({4, 8, 16, 32, 64, 128, 256, 1024}); + for(auto width = 8; width < 11; ++width) { + state.resp_cnt = 0; + auto cycles = run_scenario(width, state, 2); + + REQUIRE(cycles < state.max_cycles); + REQUIRE(sc_report_handler::get_count(SC_ERROR) == 0); + REQUIRE(sc_report_handler::get_count(SC_WARNING) == 0); + + REQUIRE(state.resp_cnt == state.packet_sizes.size()); + } +} + +TEST_CASE("multi-packet-burst2", "[CXS][tlm-level]") { + struct { + unsigned int reset_cycles{4}; + unsigned int max_cycles = 5000; + std::vector packet_sizes; + unsigned granularity{2}; + unsigned resp_cnt{0}; + } state; + + state.packet_sizes.assign({4, 8, 16, 32, 16, 64, 16, 128, 16, 256, 16, 1024}); + for(auto width = 8; width < 11; ++width) { + state.resp_cnt = 0; + auto cycles = run_scenario(width, state, 2); + + REQUIRE(cycles < state.max_cycles); + REQUIRE(sc_report_handler::get_count(SC_ERROR) == 0); + REQUIRE(sc_report_handler::get_count(SC_WARNING) == 0); + + REQUIRE(state.resp_cnt == state.packet_sizes.size()); + } +} } // namespace cxs diff --git a/tests/cxs_tlm/testbench.h b/tests/cxs_tlm/testbench.h index 332d43d..00d99b9 100644 --- a/tests/cxs_tlm/testbench.h +++ b/tests/cxs_tlm/testbench.h @@ -42,6 +42,7 @@ template struct testbench : public sc_core::sc_module { [this](transaction_type& trans, phase_type& phase, sc_core::sc_time& t) { return this->nb_transport_fw(trans, phase, t); }); isck(tx.tsck); tx.clk_i(clk); + tx.rst_i(rst); tx.isck(cxs_chan.tsck); cxs_chan.isck(rx.tsck); rx.clk_i(clk); From 5490f0203f66388aeebe71fe16df41b096c54c81 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Mon, 6 Jan 2025 12:40:29 +0100 Subject: [PATCH 30/31] updates scc --- scc | 2 +- tests/axi4_pin_level/narrow_burst_test.cpp | 23 ++++++++++++---------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/scc b/scc index d6f2a80..e5439d3 160000 --- a/scc +++ b/scc @@ -1 +1 @@ -Subproject commit d6f2a80b1b8aa49506fd6e37e21c38149bcc3ba6 +Subproject commit e5439d3a32faaec0c1ac750c337597b48f855831 diff --git a/tests/axi4_pin_level/narrow_burst_test.cpp b/tests/axi4_pin_level/narrow_burst_test.cpp index 2de4521..65dd339 100644 --- a/tests/axi4_pin_level/narrow_burst_test.cpp +++ b/tests/axi4_pin_level/narrow_burst_test.cpp @@ -7,6 +7,7 @@ #include using namespace sc_core; +using tlm_gp_shared_ptr_vec = std::vector; factory::add tb; @@ -83,11 +84,12 @@ template unsigned run_scenario(STATE& state) { tlm::scc::tlm_gp_shared_ptr trans = prepare_trans(StartAddr, 4, state.BurstLengthByte, state.BurstSizeBytes, 1); trans->set_command(tlm::TLM_READ_COMMAND); - SCCDEBUG(__FUNCTION__) << "run1, iteration " << i << " TX: " << *trans; + SCCDEBUG("run1") << "iteration " << i << " TX: " << *trans; dut.intor_pe.transport(*trans, false); state.read_tx[axi::get_axi_id(*trans)].first.emplace_back(trans); StartAddr += state.BurstSizeBytes; } + SCCDEBUG("run1") << "finished " << state.NumberOfIterations << " iterations"; }); auto run2 = sc_spawn([&dut, &state]() { unsigned int StartAddr{0x2000}; @@ -96,11 +98,12 @@ template unsigned run_scenario(STATE& state) { prepare_trans(StartAddr, 4, state.BurstLengthByte, state.BurstSizeBytes, 2); trans->set_command(tlm::TLM_WRITE_COMMAND); randomize(*trans); - SCCDEBUG(__FUNCTION__) << "run2, iteration " << i << " TX: " << *trans; + SCCDEBUG("run2") << "iteration " << i << " TX: " << *trans; dut.intor_pe.transport(*trans, false); state.write_tx[axi::get_axi_id(*trans)].first.emplace_back(trans); StartAddr += state.BurstSizeBytes; } + SCCDEBUG("run2") << "finished " << state.NumberOfIterations << " iterations"; }); auto run3 = sc_spawn([&dut, &state]() { unsigned int StartAddr{0x1000}; @@ -108,11 +111,12 @@ template unsigned run_scenario(STATE& state) { tlm::scc::tlm_gp_shared_ptr trans = prepare_trans(StartAddr, 4, state.BurstLengthByte, state.BurstSizeBytes, 3); trans->set_command(tlm::TLM_READ_COMMAND); - SCCDEBUG(__FUNCTION__) << "run3, iteration " << i << " TX: " << *trans; + SCCDEBUG("run3") << "iteration " << i << " TX: " << *trans; dut.intor_pe.transport(*trans, false); state.read_tx[axi::get_axi_id(*trans)].first.emplace_back(trans); StartAddr += state.BurstSizeBytes; } + SCCDEBUG("run3") << "finished " << state.NumberOfIterations << " iterations"; }); auto run4 = sc_spawn([&dut, &state]() { unsigned int StartAddr{0x3000}; @@ -121,11 +125,12 @@ template unsigned run_scenario(STATE& state) { prepare_trans(StartAddr, 4, state.BurstLengthByte, state.BurstSizeBytes, 4); trans->set_command(tlm::TLM_WRITE_COMMAND); randomize(*trans); - SCCDEBUG(__FUNCTION__) << "run4, iteration " << i << " TX: " << *trans; + SCCDEBUG("run4") << "iteration " << i << " TX: " << *trans; dut.intor_pe.transport(*trans, false); state.write_tx[axi::get_axi_id(*trans)].first.emplace_back(trans); StartAddr += state.BurstSizeBytes; } + SCCDEBUG("run4") << "finished " << state.NumberOfIterations << " iterations"; }); unsigned cycles{0}; @@ -142,9 +147,8 @@ void axi4_burst_alignment(bool pipelined_wrreq, bool write_bp) { unsigned int BurstLengthByte{16}; unsigned int BurstSizeBytes{8}; unsigned int NumberOfIterations{8}; - std::unordered_map, std::vector>> read_tx; - std::unordered_map, std::vector>> - write_tx; + std::unordered_map> read_tx; + std::unordered_map> write_tx; unsigned resp_cnt{0}; } state; @@ -184,9 +188,8 @@ void axi4_narrow_burst(bool pipelined_wrreq, bool write_bp) { unsigned int BurstLengthByte{16}; unsigned int BurstSizeBytes{4}; unsigned int NumberOfIterations{8}; - std::unordered_map, std::vector>> read_tx; - std::unordered_map, std::vector>> - write_tx; + std::unordered_map> read_tx; + std::unordered_map> write_tx; unsigned resp_cnt{0}; } state; From ea802247da68d922988b643814f10bd012f737b8 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Thu, 9 Jan 2025 10:34:32 +0100 Subject: [PATCH 31/31] adds AXI4/ACEL unaligned addr burst tests --- .cproject | 2 +- scc | 2 +- src/sc_main.cpp | 4 +- tests/axi4_pin_level/CMakeLists.txt | 2 +- .../{narrow_burst_test.cpp => burst_test.cpp} | 97 +++++++++++++-- tests/axi4_pin_level/waves.gtkw | 116 ++++++++++++++++++ tests/cci_param_restricted/test.cpp | 2 +- 7 files changed, 213 insertions(+), 12 deletions(-) rename tests/axi4_pin_level/{narrow_burst_test.cpp => burst_test.cpp} (65%) create mode 100644 tests/axi4_pin_level/waves.gtkw diff --git a/.cproject b/.cproject index bc9079e..6826073 100644 --- a/.cproject +++ b/.cproject @@ -14,7 +14,7 @@ - + diff --git a/scc b/scc index e5439d3..bccc926 160000 --- a/scc +++ b/scc @@ -1 +1 @@ -Subproject commit e5439d3a32faaec0c1ac750c337597b48f855831 +Subproject commit bccc9269ff84181d1287dd6021ab5eb52f8909d0 diff --git a/src/sc_main.cpp b/src/sc_main.cpp index e8322ca..b1fe425 100644 --- a/src/sc_main.cpp +++ b/src/sc_main.cpp @@ -24,7 +24,9 @@ void ABRThandler(int sig) { longjmp(abrt, 1); } int sc_main(int argc, char* argv[]) { signal(SIGABRT, ABRThandler); auto my_name = util::split(argv[0], '/').back(); - scc::init_logging(LogConfig().logLevel(getenv("SCC_TEST_VERBOSE") ? log::TRACE : log::FATAL).logAsync(false).msgTypeFieldWidth(35)); + auto level = getenv("SCC_TEST_VERBOSE"); + auto log_lvl = level ? static_cast(std::min(strtoul(level, nullptr, 10) + 4, 7UL)) : log::FATAL; + scc::init_logging(LogConfig().logLevel(log_lvl).logAsync(false).msgTypeFieldWidth(35)); // create tracer if environment variable SCC_TEST_TRACE is defined std::unique_ptr tracer; if(auto* test_trace = getenv("SCC_TEST_TRACE")) { diff --git a/tests/axi4_pin_level/CMakeLists.txt b/tests/axi4_pin_level/CMakeLists.txt index ffcfa7b..53ff21a 100644 --- a/tests/axi4_pin_level/CMakeLists.txt +++ b/tests/axi4_pin_level/CMakeLists.txt @@ -1,7 +1,7 @@ project (axi4_pin_level) add_executable(${PROJECT_NAME} - narrow_burst_test.cpp + burst_test.cpp ${test_util_SOURCE_DIR}/sc_main.cpp ) target_link_libraries (${PROJECT_NAME} PUBLIC test_util) diff --git a/tests/axi4_pin_level/narrow_burst_test.cpp b/tests/axi4_pin_level/burst_test.cpp similarity index 65% rename from tests/axi4_pin_level/narrow_burst_test.cpp rename to tests/axi4_pin_level/burst_test.cpp index 65dd339..2315ec8 100644 --- a/tests/axi4_pin_level/narrow_burst_test.cpp +++ b/tests/axi4_pin_level/burst_test.cpp @@ -11,6 +11,55 @@ using tlm_gp_shared_ptr_vec = std::vector; factory::add tb; +//// DataTransfer() +//// ============== +// void DataTransfer(uint64_t Start_Address, unsigned axsize, unsigned axlen, unsigned Data_Bus_Bytes, axi::burst_e Mode, bool IsWrite) { +// auto Number_Bytes = 2u<= Upper_Wrap_Boundary) addr = Lower_Wrap_Boundary; +// } +// } else { +// addr = Aligned_Address + Number_Bytes; +// aligned = true; // All transfers after the first are aligned +// } +// } +// } +// return; +// } bool is_equal(tlm::tlm_generic_payload const& a, tlm::tlm_generic_payload const& b) { auto ret = true; ret &= a.get_command() == b.get_command(); @@ -39,7 +88,9 @@ tlm::tlm_generic_payload* prepare_trans(uint64_t start_address, unsigned addr_in ext->set_size(scc::ilog2(width)); sc_assert(len < (bus_cfg::BUSWIDTH / 8) || len % (bus_cfg::BUSWIDTH / 8) == 0); auto length = (len * 8 - 1) / (8 * width); - if(width == (bus_cfg::BUSWIDTH / 8) && start_address % (bus_cfg::BUSWIDTH / 8)) + // if(width == (bus_cfg::BUSWIDTH / 8) && start_address % (bus_cfg::BUSWIDTH / 8)) + // length++; + if(start_address % (bus_cfg::BUSWIDTH / 8) + width > (bus_cfg::BUSWIDTH / 8)) length++; ext->set_length(length); // ext->set_burst(len * 8 > bus_cfg::buswidth ? axi::burst_e::INCR : axi::burst_e::FIXED); @@ -82,7 +133,7 @@ template unsigned run_scenario(STATE& state) { unsigned int StartAddr{0x0}; for(int i = 0; i < state.NumberOfIterations; ++i) { tlm::scc::tlm_gp_shared_ptr trans = - prepare_trans(StartAddr, 4, state.BurstLengthByte, state.BurstSizeBytes, 1); + prepare_trans(StartAddr + (state.unaligned ? 2 : 0), 4, state.BurstLengthByte, state.BurstSizeBytes, 1); trans->set_command(tlm::TLM_READ_COMMAND); SCCDEBUG("run1") << "iteration " << i << " TX: " << *trans; dut.intor_pe.transport(*trans, false); @@ -95,7 +146,7 @@ template unsigned run_scenario(STATE& state) { unsigned int StartAddr{0x2000}; for(int i = 0; i < state.NumberOfIterations; ++i) { tlm::scc::tlm_gp_shared_ptr trans = - prepare_trans(StartAddr, 4, state.BurstLengthByte, state.BurstSizeBytes, 2); + prepare_trans(StartAddr + (state.unaligned ? 2 : 0), 4, state.BurstLengthByte, state.BurstSizeBytes, 2); trans->set_command(tlm::TLM_WRITE_COMMAND); randomize(*trans); SCCDEBUG("run2") << "iteration " << i << " TX: " << *trans; @@ -109,7 +160,7 @@ template unsigned run_scenario(STATE& state) { unsigned int StartAddr{0x1000}; for(int i = 0; i < state.NumberOfIterations; ++i) { tlm::scc::tlm_gp_shared_ptr trans = - prepare_trans(StartAddr, 4, state.BurstLengthByte, state.BurstSizeBytes, 3); + prepare_trans(StartAddr + (state.unaligned ? 2 : 0), 4, state.BurstLengthByte, state.BurstSizeBytes, 3); trans->set_command(tlm::TLM_READ_COMMAND); SCCDEBUG("run3") << "iteration " << i << " TX: " << *trans; dut.intor_pe.transport(*trans, false); @@ -122,7 +173,7 @@ template unsigned run_scenario(STATE& state) { unsigned int StartAddr{0x3000}; for(int i = 0; i < state.NumberOfIterations; ++i) { tlm::scc::tlm_gp_shared_ptr trans = - prepare_trans(StartAddr, 4, state.BurstLengthByte, state.BurstSizeBytes, 4); + prepare_trans(StartAddr + (state.unaligned ? 2 : 0), 4, state.BurstLengthByte, state.BurstSizeBytes, 4); trans->set_command(tlm::TLM_WRITE_COMMAND); randomize(*trans); SCCDEBUG("run4") << "iteration " << i << " TX: " << *trans; @@ -141,7 +192,8 @@ template unsigned run_scenario(STATE& state) { return cycles; } -void axi4_burst_alignment(bool pipelined_wrreq, bool write_bp) { +void axi4_burst_alignment(bool pipelined_wrreq, bool write_bp, bool unaligned = false) { + SCCINFO(__FUNCTION__) << "starting with pipelined_wrreq=" << pipelined_wrreq << " and write_bp=" << write_bp; struct { unsigned int ResetCycles{4}; unsigned int BurstLengthByte{16}; @@ -150,8 +202,10 @@ void axi4_burst_alignment(bool pipelined_wrreq, bool write_bp) { std::unordered_map> read_tx; std::unordered_map> write_tx; unsigned resp_cnt{0}; + bool unaligned{false}; } state; + state.unaligned = unaligned; auto& dut = factory::get(); dut.intor_bfm.pipelined_wrreq = pipelined_wrreq; dut.tgt_pe.wr_data_accept_delay.set_value(write_bp ? 1 : 0); @@ -176,13 +230,24 @@ void axi4_burst_alignment(bool pipelined_wrreq, bool write_bp) { auto const& recv_tx = e.second.second; REQUIRE(send_tx.size() == recv_tx.size()); for(auto i = 0; i < send_tx.size(); ++i) { + auto addr = send_tx[i]->get_address(); + if(addr % (testbench::bus_cfg::ADDRWIDTH / 8)) { + CHECK(send_tx[i]->get_data_length() <= recv_tx[i]->get_data_length()); + CHECK(send_tx[i]->get_byte_enable_length() <= recv_tx[i]->get_byte_enable_length()); + // adjust the length of the read due to misalignment + recv_tx[i]->set_data_length(send_tx[i]->get_data_length()); + recv_tx[i]->set_byte_enable_length(send_tx[i]->get_byte_enable_length()); + recv_tx[i]->set_streaming_width(send_tx[i]->get_streaming_width()); + } REQUIRE(send_tx[i]->get_response_status() == tlm::TLM_OK_RESPONSE); CHECK(is_equal(*send_tx[i], *recv_tx[i])); } } } -void axi4_narrow_burst(bool pipelined_wrreq, bool write_bp) { +void axi4_narrow_burst(bool pipelined_wrreq, bool write_bp, bool unaligned = false) { + SCCINFO(__FUNCTION__) << "starting with pipelined_wrreq=" << pipelined_wrreq << ", write_bp = " << write_bp + << " and unaligned=" << unaligned; struct { unsigned int ResetCycles{4}; unsigned int BurstLengthByte{16}; @@ -191,8 +256,10 @@ void axi4_narrow_burst(bool pipelined_wrreq, bool write_bp) { std::unordered_map> read_tx; std::unordered_map> write_tx; unsigned resp_cnt{0}; + bool unaligned{false}; } state; + state.unaligned = unaligned; auto& dut = factory::get(); dut.intor_bfm.pipelined_wrreq = pipelined_wrreq; dut.tgt_pe.wr_data_accept_delay.set_value(write_bp ? 1 : 0); @@ -221,16 +288,32 @@ void axi4_narrow_burst(bool pipelined_wrreq, bool write_bp) { TEST_CASE("axi4_burst_alignment", "[AXI][pin-level]") { axi4_burst_alignment(false, false); } +TEST_CASE("axi4_burst_alignment_unaligned_addr", "[AXI][pin-level]") { axi4_burst_alignment(false, false, true); } + TEST_CASE("axi4_narrow_burst", "[AXI][pin-level]") { axi4_narrow_burst(false, false); } +// TEST_CASE("axi4_narrow_burst_unaligned_addr", "[AXI][pin-level]") { axi4_narrow_burst(false, false, true); } + TEST_CASE("axi4_burst_alignment_with_bp", "[AXI][pin-level]") { axi4_burst_alignment(false, true); } +TEST_CASE("axi4_burst_alignment_with_bp_unaligned_addr", "[AXI][pin-level]") { axi4_burst_alignment(false, true, true); } + TEST_CASE("axi4_narrow_burst_with_bp", "[AXI][pin-level]") { axi4_narrow_burst(false, true); } +// TEST_CASE("axi4_narrow_burst_with_bp_unaligned_addr", "[AXI][pin-level]") { axi4_narrow_burst(false, true, true); } + TEST_CASE("axi4_burst_alignment_pipelined_write", "[AXI][pin-level]") { axi4_burst_alignment(true, false); } +TEST_CASE("axi4_burst_alignment_pipelined_write_unaligned_addr", "[AXI][pin-level]") { axi4_burst_alignment(true, false, true); } + TEST_CASE("axi4_narrow_burst_pipelined_write", "[AXI][pin-level]") { axi4_narrow_burst(true, false); } +// TEST_CASE("axi4_narrow_burst_pipelined_write_unaligned_addr", "[AXI][pin-level]") { axi4_narrow_burst(true, false, true); } + TEST_CASE("axi4_burst_alignment_pipelined_write_with_bp", "[AXI][pin-level]") { axi4_burst_alignment(true, true); } +TEST_CASE("axi4_burst_alignment_pipelined_write_with_bp_unaligned_addr", "[AXI][pin-level]") { axi4_burst_alignment(true, true, true); } + TEST_CASE("axi4_narrow_burst_pipelined_write_with_bp", "[AXI][pin-level]") { axi4_narrow_burst(true, true); } + +// TEST_CASE("axi4_narrow_burst_pipelined_write_with_bp_unaligned_addr", "[AXI][pin-level]") { axi4_narrow_burst(true, true, true); } diff --git a/tests/axi4_pin_level/waves.gtkw b/tests/axi4_pin_level/waves.gtkw new file mode 100644 index 0000000..222c184 --- /dev/null +++ b/tests/axi4_pin_level/waves.gtkw @@ -0,0 +1,116 @@ +[*] +[*] GTKWave Analyzer v3.3.118 (w)1999-2023 BSI +[*] Wed Jan 8 16:33:12 2025 +[*] +[dumpfile] "/scratch/eyck/workarea/MINRES/SystemC-Components-Test/axi4_pin_level.fst" +[dumpfile_mtime] "Wed Jan 8 16:32:32 2025" +[dumpfile_size] 7261 +[savefile] "/scratch/eyck/workarea/MINRES/SystemC-Components-Test/tests/axi4_pin_level/waves.gtkw" +[timestart] 0 +[size] 2560 1288 +[pos] -1 -1 +*-20.062529 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 +[treeopen] testbench. +[sst_width] 304 +[signals_width] 243 +[sst_expanded] 1 +[sst_vpaned_height] 396 +@28 +testbench.clk +testbench.rst +@800200 +-ar +@28 +testbench.ar_valid +testbench.ar_ready +@22 +testbench.ar_addr[31:0] +@28 +testbench.ar_burst[1:0] +@22 +testbench.ar_cache[3:0] +testbench.ar_id[3:0] +testbench.ar_len[7:0] +@28 +testbench.ar_lock +testbench.ar_prot[2:0] +@22 +testbench.ar_qos[3:0] +testbench.ar_region[3:0] +@28 +testbench.ar_size[2:0] +testbench.ar_user +@1000200 +-ar +@800200 +-r +@28 +testbench.r_valid +testbench.r_ready +testbench.r_last +@22 +testbench.r_data[63:0] +testbench.r_id[3:0] +@28 +testbench.r_resp[1:0] +testbench.r_trace +testbench.r_user +@1000200 +-r +@800200 +-aw +@28 +testbench.aw_valid +testbench.aw_ready +@22 +testbench.aw_id[3:0] +testbench.aw_addr[31:0] +@28 +testbench.aw_burst[1:0] +@22 +testbench.aw_cache[3:0] +testbench.aw_len[7:0] +@28 +testbench.aw_lock +testbench.aw_prot[2:0] +@22 +testbench.aw_qos[3:0] +testbench.aw_region[3:0] +@28 +testbench.aw_size[2:0] +testbench.aw_user +@1000200 +-aw +@800200 +-w +@29 +testbench.w_valid +testbench.w_ready +testbench.w_ack +@23 +testbench.w_data[63:0] +testbench.w_id[3:0] +@29 +testbench.w_last +@23 +testbench.w_strb[7:0] +@29 +testbench.w_trace +testbench.w_user +@1000200 +-w +@800200 +-b +@28 +testbench.b_valid +testbench.b_ready +@22 +testbench.b_id[3:0] +@28 +testbench.b_resp[1:0] +testbench.b_trace +testbench.b_user +@1000200 +-b +[pattern_trace] 1 +[pattern_trace] 0 diff --git a/tests/cci_param_restricted/test.cpp b/tests/cci_param_restricted/test.cpp index 925edbc..63d6d63 100644 --- a/tests/cci_param_restricted/test.cpp +++ b/tests/cci_param_restricted/test.cpp @@ -2,12 +2,12 @@ #define SC_INCLUDE_DYNAMIC_PROCESSES #include #endif +#include #include #include #include #include #include - using namespace sc_core; struct top : public sc_core::sc_module {