From 8eff2d4ccf380c505e832e67be77ce07f204e3d3 Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Tue, 12 Aug 2025 11:18:15 +0200 Subject: [PATCH] adds separate clock for aclints mtime register --- src/vp/system.cpp | 3 +++ src/vp/system.h | 1 + vpvper | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/vp/system.cpp b/src/vp/system.cpp index 543fd0b..3d48159 100644 --- a/src/vp/system.cpp +++ b/src/vp/system.cpp @@ -19,6 +19,8 @@ system::system(sc_core::sc_module_name nm) : sc_core::sc_module(nm) , NAMED(ahb_router, 3, 2) , NAMED(apbBridge, PipelinedMemoryBusToApbBridge_map.size(), 1) { + mtime_clk = (1.0 / 32768) * 1_sec; + core_complex.ibus(ahb_router.target[0]); core_complex.dbus(ahb_router.target[1]); @@ -53,6 +55,7 @@ system::system(sc_core::sc_module_name nm) qspi.rst_i(rst_s); core_complex.rst_i(rst_s); + aclint.mtime_clk_i(mtime_clk); aclint.mtime_o(mtime_s); aclint.mtime_int_o(mtime_int_s); aclint.msip_int_o(msip_int_s); diff --git a/src/vp/system.h b/src/vp/system.h index e9f0889..dfb2ca3 100644 --- a/src/vp/system.h +++ b/src/vp/system.h @@ -60,6 +60,7 @@ private: scc::memory<128_kB, scc::LT> mem_ram{"mem_ram"}; scc::memory<8_kB, scc::LT> boot_rom{"boot_rom"}; + sc_core::sc_signal mtime_clk{"mtime_clk"}; sc_core::sc_signal rst_s{"rst_s"}, mtime_int_s{"mtime_int_s"}, msip_int_s{"msip_int_s"}; sc_core::sc_vector> irq_int_s{"irq_int_s", 32}, local_int_s{"local_int_s", 16}; diff --git a/vpvper b/vpvper index ec61cb9..923024b 160000 --- a/vpvper +++ b/vpvper @@ -1 +1 @@ -Subproject commit ec61cb97a50cd8c71df1c64c3a43c1947a9f6af4 +Subproject commit 923024bd82902bd15f55dd5e108d5823cb0c4add