From 66c3d84926634cff9448a5eb4e25e1b1feec89fa Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Mon, 14 Jul 2025 22:24:41 +0200 Subject: [PATCH] updates dbt-rise-tgc to feature/updated_implementation --- .cproject | 2 +- .../TGC-VP interp dhrystone ce fast.launch | 2 +- .launch/TGC-VP interp dhrystone.launch | 20 ++++++- .vscode/launch.json | 6 +- CMakeLists.txt | 7 ++- CMakePresets.json | 7 ++- conanfile.py | 60 +++++++++++++++++++ conanfile.txt | 48 --------------- dbt-rise-core | 2 +- dbt-rise-riscv | 2 +- scc | 2 +- src/sc_main.cpp | 9 +-- src/vp/system.cpp | 5 +- src/vp/system.h | 7 +-- src/vp/tb.cpp | 6 +- src/vp/tb.h | 11 ++-- vpvper | 2 +- 17 files changed, 108 insertions(+), 90 deletions(-) create mode 100644 conanfile.py delete mode 100644 conanfile.txt diff --git a/.cproject b/.cproject index a0bd7a7..d7016c0 100644 --- a/.cproject +++ b/.cproject @@ -12,7 +12,7 @@ - + diff --git a/.launch/TGC-VP interp dhrystone ce fast.launch b/.launch/TGC-VP interp dhrystone ce fast.launch index 5668914..0331967 100644 --- a/.launch/TGC-VP interp dhrystone ce fast.launch +++ b/.launch/TGC-VP interp dhrystone ce fast.launch @@ -22,7 +22,7 @@ - + diff --git a/.launch/TGC-VP interp dhrystone.launch b/.launch/TGC-VP interp dhrystone.launch index 103965e..426b3ba 100644 --- a/.launch/TGC-VP interp dhrystone.launch +++ b/.launch/TGC-VP interp dhrystone.launch @@ -12,16 +12,16 @@ - + - + - + @@ -31,5 +31,19 @@ + + + + + + + + + + + + + + diff --git a/.vscode/launch.json b/.vscode/launch.json index 68a1a1f..0cf3870 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -40,10 +40,8 @@ "request": "launch", "name": "VP-Debug", "cwd": "${workspaceRoot}", - "valuesFormatting": "parseText", - "target": "./build/src/tgc-vp", - "printCalls": false, - "arguments": "-f fw/hello-world/hello" + "program": "${workspaceFolder}/out/build/Debug/src/riscv-vp", + "arguments": "--isa ? -f fw/hello-world/hello" }, ], "compounds": [ diff --git a/CMakeLists.txt b/CMakeLists.txt index d75e413..9163e77 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,12 +24,14 @@ if(ENABLE_SANITIZER) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=address") endif() +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pg") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg") if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") add_compile_options(/vmg /wd26812) # suppress Warnung C26812: "enum class" gegenüber "enum" (Enum.3) bevorzugen endif() find_package(elfio) -find_package(Boost REQUIRED COMPONENTS program_options QUIET) +find_package(Boost REQUIRED COMPONENTS program_options date_time QUIET) include(SystemCPackage) if(ENABLE_COVERAGE) @@ -57,6 +59,7 @@ endif () set(USE_SC_SIGNAL4IRQ ON) set(CLANG_FORMAT_EXCLUDE_PATTERNS /build/ /scc/ /dbt-rise-core/ /dbt-rise-riscv/) +set(USE_SC_SIGNAL4IRQ ON) add_subdirectory(scc) add_subdirectory(dbt-rise-core) add_subdirectory(dbt-rise-riscv) @@ -87,6 +90,6 @@ if(FW_BUILD) if(NOT riscvfw_POPULATED) FetchContent_Populate(riscvfw) endif() - set(BOARD ehrenberg) + set(BOARD moonlight) add_subdirectory(${riscvfw_SOURCE_DIR}) endif() diff --git a/CMakePresets.json b/CMakePresets.json index 3f20d85..6103d55 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -15,7 +15,8 @@ "CMAKE_POLICY_DEFAULT_CMP0091": "NEW", "CMAKE_BUILD_TYPE": "Debug", "CMAKE_CXX_STANDARD": "17", - "CMAKE_PROJECT_TOP_LEVEL_INCLUDES":"dbt-rise-riscv/cmake-conan/conan_provider.cmake" + "CMAKE_PROJECT_TOP_LEVEL_INCLUDES":"scc/cmake/conan_provider.cmake", + "CMAKE_EXPORT_COMPILE_COMMANDS": "ON" } }, { @@ -24,7 +25,7 @@ "CMAKE_POLICY_DEFAULT_CMP0091": "NEW", "CMAKE_BUILD_TYPE": "RelWithDebInfo", "CMAKE_CXX_STANDARD": "17", - "CMAKE_PROJECT_TOP_LEVEL_INCLUDES":"dbt-rise-riscv/cmake-conan/conan_provider.cmake" + "CMAKE_PROJECT_TOP_LEVEL_INCLUDES":"scc/cmake/conan_provider.cmake" } }, { @@ -33,7 +34,7 @@ "CMAKE_POLICY_DEFAULT_CMP0091": "NEW", "CMAKE_BUILD_TYPE": "Release", "CMAKE_CXX_STANDARD": "17", - "CMAKE_PROJECT_TOP_LEVEL_INCLUDES":"dbt-rise-riscv/cmake-conan/conan_provider.cmake" + "CMAKE_PROJECT_TOP_LEVEL_INCLUDES":"scc/cmake/conan_provider.cmake" } } ] diff --git a/conanfile.py b/conanfile.py new file mode 100644 index 0000000..5a25656 --- /dev/null +++ b/conanfile.py @@ -0,0 +1,60 @@ +import os + +from conan import ConanFile +from conan.tools.cmake import cmake_layout + + +class Pkg(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = ( + "CMakeDeps", + "CMakeToolchain", + ) + default_options = { + "llvm-core/*:targets": "X86", + "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": "True" + } + + def requirements(self): + self.requires("systemc/3.0.1") + self.requires("fmt/8.0.1") + self.requires("spdlog/1.9.2") + self.requires("boost/1.85.0") + self.requires("abseil/20250127.0") + self.requires("elfio/3.12") + self.requires("lz4/1.9.3") + self.requires("yaml-cpp/0.8.0") + self.requires("jsoncpp/1.9.5") + self.requires("zlib/1.2.12") + self.requires("asmjit/cci.20240531") + if "WITH_LLVM" in os.environ: + self.requires("llvm-core/19.1.7") + if os.path.isdir("dbt-rise-plugins"): + self.requires("lua/5.4.3") + + def build_requirements(self): + pass + + def layout(self): + cmake_layout(self) diff --git a/conanfile.txt b/conanfile.txt deleted file mode 100644 index 4c0e3fa..0000000 --- a/conanfile.txt +++ /dev/null @@ -1,48 +0,0 @@ -[requires] -yaml-cpp/0.8.0 -jsoncpp/1.9.5 -boost/1.85.0 -asmjit/cci.20240531 -elfio/3.12 -fmt/8.0.1 -spdlog/1.9.2 -gsl-lite/0.41.0 -lz4/1.9.3 -zlib/1.2.13 -seasocks/1.4.6 -systemc/2.3.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 -fmt/*:header_only=True -libiconv/*:shared=False -asmjit/*:shared=False -systemc/*:shared=True -systemc/*:disable_virtual_bind=False - -[generators] -CMakeDeps -CMakeToolchain - -[layout] -cmake_layout \ No newline at end of file diff --git a/dbt-rise-core b/dbt-rise-core index 7680458..97c9e85 160000 --- a/dbt-rise-core +++ b/dbt-rise-core @@ -1 +1 @@ -Subproject commit 7680458096f966db7ec3755d5b1f6c6b621a57ec +Subproject commit 97c9e858fce834d6739b41e0d16924bde3d52e95 diff --git a/dbt-rise-riscv b/dbt-rise-riscv index a7f8af2..2ed2e62 160000 --- a/dbt-rise-riscv +++ b/dbt-rise-riscv @@ -1 +1 @@ -Subproject commit a7f8af279bed3e8c46e3914d32b59c3a628fba1b +Subproject commit 2ed2e62ad1012ca947cb312e6ee1bb57ae0a44fb diff --git a/scc b/scc index 8c98137..8e6b9d8 160000 --- a/scc +++ b/scc @@ -1 +1 @@ -Subproject commit 8c981376f233847a5940c98398ea0ff4dfb6b7db +Subproject commit 8e6b9d87cd9cd442f9a307ea6b5e3cb06f64de55 diff --git a/src/sc_main.cpp b/src/sc_main.cpp index 9d90c3b..9460ce9 100644 --- a/src/sc_main.cpp +++ b/src/sc_main.cpp @@ -76,10 +76,11 @@ int sc_main(int argc, char* argv[]) { auto tx_trace_type = static_cast(trace_level >> 1); // bit3-bit1 define the kind of transaction trace auto trace_default_on = parser.is_set("trace-default-on"); - cfg.set_value("$$$scc_tracer$$$.tx_trace_type", static_cast(scc::tracer::file_type::FTR)); - cfg.set_value("$$$scc_tracer$$$.sig_trace_type", static_cast(scc::tracer::file_type::SC_VCD)); - tracer = - scc::make_unique(file_name, tx_trace_type, enable_sig_trace, trace_default_on); + if(parser.is_set("trace-default-off")) + cfg.set_value("scc_tracer.default_trace_enable", false); + cfg.set_value("scc_tracer.tx_trace_type", static_cast(scc::tracer::file_type::FTR)); + cfg.set_value("scc_tracer.sig_trace_type", static_cast(scc::tracer::file_type::FST)); + tracer = scc::make_unique(file_name, tx_trace_type, enable_sig_trace); } /////////////////////////////////////////////////////////////////////////// // instantiate top level diff --git a/src/vp/system.cpp b/src/vp/system.cpp index 257227f..1afe451 100644 --- a/src/vp/system.cpp +++ b/src/vp/system.cpp @@ -77,10 +77,7 @@ system::system(sc_core::sc_module_name nm) timer0.clear_i(t0_clear_i); timer0.tick_i(t0_tick_i); - qspi.ssclk_o(ssclk_o); - qspi.dq_o(dq_o); - qspi.dq_i(dq_i); - qspi.oe_o(dq_oe_o); + qspi.spi_i(mspi0); SC_METHOD(gen_reset); sensitive << erst_n; diff --git a/src/vp/system.h b/src/vp/system.h index 8dc1e0d..bc833d1 100644 --- a/src/vp/system.h +++ b/src/vp/system.h @@ -9,9 +9,7 @@ #include "minres/irq.h" #include "minres/timer.h" -#include #include -#include #include #include #include @@ -40,10 +38,7 @@ public: sc_core::sc_in uart0_rx_i{"uart0_rx_i"}; sc_core::sc_vector> t0_clear_i{"t0_clear_i", vpvper::minres::timer::CLEAR_CNT}; sc_core::sc_vector> t0_tick_i{"t0_tick_i", vpvper::minres::timer::TICK_CNT - 1}; - sc_core::sc_out ssclk_o{"ssclk_o"}; - sc_core::sc_vector> dq_o{"dq_o", 4}; - sc_core::sc_vector> dq_oe_o{"dq_oe_o", 4}; - sc_core::sc_vector> dq_i{"dq_i", 4}; + spi::spi_pkt_initiator_socket<> mspi0{"mspi0"}; sc_core::sc_in clk_i{"clk_i"}; diff --git a/src/vp/tb.cpp b/src/vp/tb.cpp index b81adc6..78bb751 100644 --- a/src/vp/tb.cpp +++ b/src/vp/tb.cpp @@ -21,10 +21,8 @@ tb::tb(const sc_core::sc_module_name& nm) top.uart0_tx_o(uart0_tx_o); top.t0_clear_i(t0_clear_i); top.t0_tick_i(t0_tick_i); - top.ssclk_o(ssclk_o); - top.dq_o(dq_o); - top.dq_i(dq_i); - top.dq_oe_o(dq_oe_o); + top.mspi0(spi()); + spi(0)(qspi_mem.spi_t); top.clk_i(clk_i); clk_i = 10_ns; } diff --git a/src/vp/tb.h b/src/vp/tb.h index b78d07f..1136a08 100644 --- a/src/vp/tb.h +++ b/src/vp/tb.h @@ -7,11 +7,12 @@ #ifndef SRC_VP_TB_H_ #define SRC_VP_TB_H_ +#include #include #include -#include "../vp/rst_gen.h" -#include "../vp/system.h" +#include "rst_gen.h" +#include "system.h" namespace tgc_vp { class tb : public sc_core::sc_module { @@ -27,10 +28,8 @@ public: sc_core::sc_signal uart0_rx_i{"uart0_rx_i"}; sc_core::sc_vector> t0_clear_i{"t0_clear_i", vpvper::minres::timer::CLEAR_CNT}; sc_core::sc_vector> t0_tick_i{"t0_tick_i", vpvper::minres::timer::TICK_CNT - 1}; - sc_core::sc_signal ssclk_o{"ssclk_o"}; - sc_core::sc_vector> dq_o{"dq_o", 4}; - sc_core::sc_vector> dq_oe_o{"dq_oe_o", 4}; - sc_core::sc_vector> dq_i{"dq_i", 4}; + spi::spi_channel spi{"spi", 1}; + vpvper::generic::spi_mem qspi_mem{"qspi_mem"}; sc_core::sc_signal clk_i{"clk_i"}; }; diff --git a/vpvper b/vpvper index cf7e348..77b5ffa 160000 --- a/vpvper +++ b/vpvper @@ -1 +1 @@ -Subproject commit cf7e348f626bd4afd897d321d3e8ff818e9e8ffe +Subproject commit 77b5ffa40d50f63f4adac0b32076d9da590a4c51