From cf0476e565c74082f011a6c428095e60a743b822 Mon Sep 17 00:00:00 2001 From: Richard Qin Date: Wed, 1 Apr 2026 00:58:22 +0800 Subject: feat: Complete CSR/privileged/exception interrupt path and fill in strict acceptance tests - Refactor trap/CSR data path in the Core, unified with trap_ctrl interface to drive CSR update and return process - Improve critical paths for exception/interrupt handling: ecall, illegal, load fault, external interrupt, mret/sret return - Adjust pipeline stage registers with flush/stall coordination, fix residual control signal issues in trap scenarios - Enhance decode and related pipeline module behavior consistency, fill in missing control signal propagation across registers - Expand core integration testing, add trap/interrupt scenarios and CLI dispatch that can be executed per case - Extend CSR unit test coverage: read/write semantics, privilege switching, delegation and nested returns, illegal access protection, etc. - Register new core scenario cases in CTest to form a regression-capable P2 strict acceptance suite Verification: - Build passed - Full CTest passed (22/22) --- rv64cpu/tb/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'rv64cpu/tb/CMakeLists.txt') diff --git a/rv64cpu/tb/CMakeLists.txt b/rv64cpu/tb/CMakeLists.txt index 7b660e8..361a6e7 100644 --- a/rv64cpu/tb/CMakeLists.txt +++ b/rv64cpu/tb/CMakeLists.txt @@ -204,12 +204,19 @@ add_verilator_target( ${RTL_CORE_DIR}/hazard_unit.sv ${RTL_CORE_DIR}/include/csr_pkg.sv ${RTL_CORE_DIR}/csr_unit.sv + ${RTL_CORE_DIR}/trap_ctrl.sv ${RTL_CORE_DIR}/richard_core.sv INCLUDE_DIRS ${RTL_COMMON_INCLUDES} TB_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/core/tb_core.cc EXTRA_FLAGS -Wno-PINCONNECTEMPTY ) +add_test(NAME tb_core_delegation COMMAND $ --case mret_sret_redirect) +add_test(NAME tb_core_interrupt_priority COMMAND $ --case branch_interrupt_priority) +add_test(NAME tb_core_double_exception COMMAND $ --case double_exception_flush) +add_test(NAME tb_core_mem_fault COMMAND $ --case mem_fault_pipeline) +add_test(NAME tb_core_mie_masking COMMAND $ --case mie_masking_response) + # ═══════════════════════════════════════════════════════════════════════════════════ # SoC Integration Test # ═══════════════════════════════════════════════════════════════════════════════════ -- cgit v1.2.3