From 66c3d84926634cff9448a5eb4e25e1b1feec89fa Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Mon, 14 Jul 2025 22:24:41 +0200 Subject: [PATCH 1/9] 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 From 129864caf92eaeffb732315de0d4b47a9e3bab8f Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Mon, 14 Jul 2025 22:28:53 +0200 Subject: [PATCH 2/9] cleans include statements --- src/vp/rst_gen.h | 1 + src/vp/system.cpp | 8 ++++---- src/vp/system.h | 4 ++-- src/vp/tb.cpp | 4 ++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/vp/rst_gen.h b/src/vp/rst_gen.h index 020c69a..4729933 100644 --- a/src/vp/rst_gen.h +++ b/src/vp/rst_gen.h @@ -7,6 +7,7 @@ #pragma once #include + namespace tgc_vp { class rst_gen : public sc_core::sc_module { diff --git a/src/vp/system.cpp b/src/vp/system.cpp index 1afe451..e0ed289 100644 --- a/src/vp/system.cpp +++ b/src/vp/system.cpp @@ -4,11 +4,11 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include "../vp/system.h" +#include "system.h" -#include "minres/timer.h" -#include "minres/uart.h" -#include "scc/utilities.h" +#include +#include +#include namespace tgc_vp { using namespace sc_core; diff --git a/src/vp/system.h b/src/vp/system.h index bc833d1..a3769e9 100644 --- a/src/vp/system.h +++ b/src/vp/system.h @@ -7,8 +7,8 @@ #ifndef _PLATFORM_H_ #define _PLATFORM_H_ -#include "minres/irq.h" -#include "minres/timer.h" +#include +#include #include #include #include diff --git a/src/vp/tb.cpp b/src/vp/tb.cpp index 78bb751..2189e3e 100644 --- a/src/vp/tb.cpp +++ b/src/vp/tb.cpp @@ -4,9 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ -#include "../vp/tb.h" - +#include "tb.h" #include + namespace tgc_vp { SC_HAS_PROCESS(tb); From 132bbbac5e46a99a1fdfbbe8e9b17f3fec6815d1 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Mon, 14 Jul 2025 22:53:15 +0200 Subject: [PATCH 3/9] fixes namespaces to match directory hierarchy --- src/sc_main.cpp | 2 +- src/vp/rst_gen.h | 28 ---------------------------- src/vp/system.cpp | 5 +++-- src/vp/system.h | 14 +++++++------- src/vp/tb.cpp | 7 ++++--- src/vp/tb.h | 12 ++++++------ 6 files changed, 21 insertions(+), 47 deletions(-) delete mode 100644 src/vp/rst_gen.h diff --git a/src/sc_main.cpp b/src/sc_main.cpp index 9460ce9..21c2276 100644 --- a/src/sc_main.cpp +++ b/src/sc_main.cpp @@ -85,7 +85,7 @@ int sc_main(int argc, char* argv[]) { /////////////////////////////////////////////////////////////////////////// // instantiate top level /////////////////////////////////////////////////////////////////////////// - auto i_system = scc::make_unique("tb"); + auto i_system = scc::make_unique("tb"); /////////////////////////////////////////////////////////////////////////// // add non-implemented 'enableTracing' properties /////////////////////////////////////////////////////////////////////////// diff --git a/src/vp/rst_gen.h b/src/vp/rst_gen.h deleted file mode 100644 index 4729933..0000000 --- a/src/vp/rst_gen.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2019 -2021 MINRES Technolgies GmbH - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#pragma once - -#include - -namespace tgc_vp { - -class rst_gen : public sc_core::sc_module { - SC_HAS_PROCESS(rst_gen); - -public: - rst_gen(sc_core::sc_module_name const& nm) { SC_THREAD(run); } - sc_core::sc_out rst_n{"rst_n"}; - -private: - void run() { - rst_n.write(false); - wait(100_ns); - rst_n.write(true); - } -}; - -} /* namespace tgc_vp */ diff --git a/src/vp/system.cpp b/src/vp/system.cpp index e0ed289..d30763c 100644 --- a/src/vp/system.cpp +++ b/src/vp/system.cpp @@ -10,7 +10,8 @@ #include #include -namespace tgc_vp { +namespace vp { + using namespace sc_core; using namespace vpvper::minres; @@ -89,4 +90,4 @@ void system::gen_reset() { rst_s = 1; } -} // namespace tgc_vp +} // namespace vp diff --git a/src/vp/system.h b/src/vp/system.h index a3769e9..c6a6594 100644 --- a/src/vp/system.h +++ b/src/vp/system.h @@ -4,15 +4,15 @@ * SPDX-License-Identifier: Apache-2.0 */ -#ifndef _PLATFORM_H_ -#define _PLATFORM_H_ +#ifndef SRC_VP_SYSTEM_H_ +#define SRC_VP_SYSTEM_H_ -#include -#include #include #include #include +#include #include +#include #include #include #include @@ -25,7 +25,7 @@ #include #include -namespace tgc_vp { +namespace vp { class system : public sc_core::sc_module { public: @@ -70,6 +70,6 @@ private: #include "../vp/gen/PipelinedMemoryBusToApbBridge.h" }; -} // namespace tgc_vp +} // namespace vp -#endif /* _PLATFORM_H_ */ +#endif /* SRC_VP_SYSTEM_H_ */ diff --git a/src/vp/tb.cpp b/src/vp/tb.cpp index 2189e3e..b8515eb 100644 --- a/src/vp/tb.cpp +++ b/src/vp/tb.cpp @@ -7,13 +7,13 @@ #include "tb.h" #include -namespace tgc_vp { +namespace vp { SC_HAS_PROCESS(tb); tb::tb(const sc_core::sc_module_name& nm) : sc_core::sc_module(nm) { top.erst_n(rst_n); - rst_gen.rst_n(rst_n); + rst_gen.rst_o(rst_n); top.pins_o(pins_o); top.pins_i(pins_i); top.pins_oe_o(pins_oe_o); @@ -25,5 +25,6 @@ tb::tb(const sc_core::sc_module_name& nm) spi(0)(qspi_mem.spi_t); top.clk_i(clk_i); clk_i = 10_ns; + rst_gen.active_level = false; } -} // namespace tgc_vp +} // namespace vp diff --git a/src/vp/tb.h b/src/vp/tb.h index 1136a08..aeba73f 100644 --- a/src/vp/tb.h +++ b/src/vp/tb.h @@ -7,19 +7,19 @@ #ifndef SRC_VP_TB_H_ #define SRC_VP_TB_H_ +#include "system.h" +#include #include #include #include -#include "rst_gen.h" -#include "system.h" -namespace tgc_vp { +namespace vp { class tb : public sc_core::sc_module { public: tb(sc_core::sc_module_name const& nm); - tgc_vp::system top{"top"}; - tgc_vp::rst_gen rst_gen{"rst_gen"}; + vp::system top{"top"}; + vpvper::generic::rst_gen rst_gen{"rst_gen"}; sc_core::sc_signal rst_n{"rst_n"}; sc_core::sc_vector> pins_o{"pins_o", 32}; sc_core::sc_vector> pins_oe_o{"pins_oe_o", 32}; @@ -33,6 +33,6 @@ public: sc_core::sc_signal clk_i{"clk_i"}; }; -} /* namespace tgc_vp */ +} // namespace vp #endif /* SRC_VP_TB_H_ */ From 4ad04d60eac1d67fc3fe8d1e168d418a57d0b3fe Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Mon, 14 Jul 2025 23:06:45 +0200 Subject: [PATCH 4/9] updates dbt-rise-riscv --- dbt-rise-riscv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbt-rise-riscv b/dbt-rise-riscv index 2ed2e62..383699c 160000 --- a/dbt-rise-riscv +++ b/dbt-rise-riscv @@ -1 +1 @@ -Subproject commit 2ed2e62ad1012ca947cb312e6ee1bb57ae0a44fb +Subproject commit 383699c2ef51a4e9e5e60fe077a2ef995d907188 From a483a8b4a880ddee902622b5277c1548085cdd84 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Tue, 15 Jul 2025 07:42:00 +0200 Subject: [PATCH 5/9] fixes memory layout to match moonlight subsystem --- src/vp/system.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vp/system.cpp b/src/vp/system.cpp index d30763c..ab0069b 100644 --- a/src/vp/system.cpp +++ b/src/vp/system.cpp @@ -25,7 +25,7 @@ system::system(sc_core::sc_module_name nm) ahb_router.initiator.at(0)(qspi.xip_sck); ahb_router.set_target_range(0, 0xE0000000, 16_MB); ahb_router.initiator.at(1)(mem_ram.target); - ahb_router.set_target_range(1, 0x80000000, 32_kB); + ahb_router.set_target_range(1, 0xC0000000, 128_kB); ahb_router.initiator.at(2)(apbBridge.target[0]); ahb_router.set_target_range(2, 0xF0000000, 256_MB); From 10cd887ae628e36eea5f952456af205d97fd2094 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Tue, 15 Jul 2025 07:42:40 +0200 Subject: [PATCH 6/9] adds LINK_TARGET for FW to start from ram --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9163e77..6de9fa3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -91,5 +91,6 @@ if(FW_BUILD) FetchContent_Populate(riscvfw) endif() set(BOARD moonlight) + set(LINK_TARGET ram) add_subdirectory(${riscvfw_SOURCE_DIR}) endif() From 5a62c03d6efeeb23aa1401b209aae3d714404a70 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Tue, 15 Jul 2025 11:00:09 +0200 Subject: [PATCH 7/9] updates dbt-rise-rsicv and makes gprof configurable --- CMakeLists.txt | 11 +++++++---- dbt-rise-core | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6de9fa3..7418014 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,6 +8,7 @@ option(ENABLE_COVERAGE "Enable code coverage" OFF) option(ENABLE_SANITIZER "Enable address sanitizer" OFF) option(ENABLE_CLANGTIDY "Enable static analysis with clang-tidy." OFF) option(ENABLE_FW_BUILD "Enable build of firmware of MIRES Firmware repo." OFF) +option(ENABLE_GPROF "Enable gprof profiling" OFF) set(SCC_LIB_ONLY ON) set(CMAKE_CXX_STANDARD_REQUIRED ON) @@ -19,13 +20,15 @@ include(GNUInstallDirs) # add address sanitizer if(ENABLE_SANITIZER) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-omit-frame-pointer -fsanitize=address,thread") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer -fsanitize=address,thread") 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(ENABLE_GPROF) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pg") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg") +endif() if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") add_compile_options(/vmg /wd26812) # suppress Warnung C26812: "enum class" gegenüber "enum" (Enum.3) bevorzugen endif() diff --git a/dbt-rise-core b/dbt-rise-core index 97c9e85..4d1bf6d 160000 --- a/dbt-rise-core +++ b/dbt-rise-core @@ -1 +1 @@ -Subproject commit 97c9e858fce834d6739b41e0d16924bde3d52e95 +Subproject commit 4d1bf6daed1958597987b4f5b3d851c9a42e478c From 896ccf6b697adbcf35f2f7db33541b06a518a3a8 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Tue, 15 Jul 2025 11:21:44 +0200 Subject: [PATCH 8/9] update eclipse launch configs --- .launch/RISCV-VP asmjit dhrystone.launch | 50 +++++++++++++++++++ ...aunch => RISCV-VP interp dhrystone.launch} | 1 + 2 files changed, 51 insertions(+) create mode 100644 .launch/RISCV-VP asmjit dhrystone.launch rename .launch/{TGC-VP interp dhrystone.launch => RISCV-VP interp dhrystone.launch} (96%) diff --git a/.launch/RISCV-VP asmjit dhrystone.launch b/.launch/RISCV-VP asmjit dhrystone.launch new file mode 100644 index 0000000..0e52b02 --- /dev/null +++ b/.launch/RISCV-VP asmjit dhrystone.launch @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.launch/TGC-VP interp dhrystone.launch b/.launch/RISCV-VP interp dhrystone.launch similarity index 96% rename from .launch/TGC-VP interp dhrystone.launch rename to .launch/RISCV-VP interp dhrystone.launch index 426b3ba..4036fa0 100644 --- a/.launch/TGC-VP interp dhrystone.launch +++ b/.launch/RISCV-VP interp dhrystone.launch @@ -30,6 +30,7 @@ + From 52a149140096c22b12cc3ac8f299656ccb3440e9 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Sun, 20 Jul 2025 11:12:17 +0200 Subject: [PATCH 9/9] changes used c++ standard to c++20 --- .gitignore | 1 + CMakePresets.json | 35 ++++++++++++++++++++++------------- dbt-rise-core | 2 +- dbt-rise-riscv | 2 +- scc | 2 +- src/vp/system.h | 2 +- 6 files changed, 27 insertions(+), 17 deletions(-) diff --git a/.gitignore b/.gitignore index 63dc490..d2d7f29 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ CMakeSettings.json /.cache /CMakeUserPresets.json /.envrc.* +.clangd diff --git a/CMakePresets.json b/CMakePresets.json index 6103d55..7128e62 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -10,31 +10,40 @@ }, "configurePresets": [ { - "name": "Debug", + "name": "Base", + "generator": "Ninja", + "binaryDir": "${sourceDir}/build/${presetName}", "cacheVariables": { "CMAKE_POLICY_DEFAULT_CMP0091": "NEW", - "CMAKE_BUILD_TYPE": "Debug", - "CMAKE_CXX_STANDARD": "17", - "CMAKE_PROJECT_TOP_LEVEL_INCLUDES":"scc/cmake/conan_provider.cmake", - "CMAKE_EXPORT_COMPILE_COMMANDS": "ON" + "CMAKE_CXX_STANDARD": "20", + "CMAKE_INSTALL_PREFIX": "${sourceDir}/install/${presetName}", + "CMAKE_EXPORT_COMPILE_COMMANDS": "ON", + "CMAKE_PROJECT_TOP_LEVEL_INCLUDES": "scc/cmake/conan_provider.cmake", + "WITH_TCC": "OFF" + } + }, + { + "name": "Debug", + "inherits": "Base", + "displayName": "Debug build", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug" } }, { "name": "RelWithDebInfo", + "inherits": "Base", + "displayName": "RelWithDebInfo build", "cacheVariables": { - "CMAKE_POLICY_DEFAULT_CMP0091": "NEW", - "CMAKE_BUILD_TYPE": "RelWithDebInfo", - "CMAKE_CXX_STANDARD": "17", - "CMAKE_PROJECT_TOP_LEVEL_INCLUDES":"scc/cmake/conan_provider.cmake" + "CMAKE_BUILD_TYPE": "RelWithDebInfo" } }, { "name": "Release", + "inherits": "Base", + "displayName": "Release build", "cacheVariables": { - "CMAKE_POLICY_DEFAULT_CMP0091": "NEW", - "CMAKE_BUILD_TYPE": "Release", - "CMAKE_CXX_STANDARD": "17", - "CMAKE_PROJECT_TOP_LEVEL_INCLUDES":"scc/cmake/conan_provider.cmake" + "CMAKE_BUILD_TYPE": "Release" } } ] diff --git a/dbt-rise-core b/dbt-rise-core index 4d1bf6d..2627112 160000 --- a/dbt-rise-core +++ b/dbt-rise-core @@ -1 +1 @@ -Subproject commit 4d1bf6daed1958597987b4f5b3d851c9a42e478c +Subproject commit 2627112886005ba7e7415972bd9e76424c219e91 diff --git a/dbt-rise-riscv b/dbt-rise-riscv index 383699c..a13689b 160000 --- a/dbt-rise-riscv +++ b/dbt-rise-riscv @@ -1 +1 @@ -Subproject commit 383699c2ef51a4e9e5e60fe077a2ef995d907188 +Subproject commit a13689b3826b4f7b27fa400208599184e3956580 diff --git a/scc b/scc index 8e6b9d8..3179717 160000 --- a/scc +++ b/scc @@ -1 +1 @@ -Subproject commit 8e6b9d87cd9cd442f9a307ea6b5e3cb06f64de55 +Subproject commit 3179717f71478bf25f11a3961808fa7920ae7932 diff --git a/src/vp/system.h b/src/vp/system.h index c6a6594..3ae7b54 100644 --- a/src/vp/system.h +++ b/src/vp/system.h @@ -47,7 +47,7 @@ public: system(sc_core::sc_module_name nm); private: - sysc::riscv_vp::core_complex<> core_complex{"core_complex"}; + sysc::riscv::core_complex<> core_complex{"core_complex"}; scc::router<> ahb_router, apbBridge; vpvper::minres::gpio_tl gpio0{"gpio0"}; vpvper::minres::uart_tl uart0{"uart0"};