From 25878916c34475e51414aab9f1f5e0e80f85df74 Mon Sep 17 00:00:00 2001 From: Luis Donatien Date: Tue, 11 Mar 2025 16:06:49 +0100 Subject: [PATCH] Modification debug interface output halted status --- doc/02_user/integration.rst | 1 + doc/03_reference/debug.rst | 2 ++ dv/riscv_compliance/rtl/cve2_riscv_compliance.sv | 1 + rtl/cve2_core.sv | 6 ++++++ rtl/cve2_top.sv | 2 ++ rtl/cve2_top_tracing.sv | 2 ++ 6 files changed, 14 insertions(+) diff --git a/doc/02_user/integration.rst b/doc/02_user/integration.rst index ce53056f6..29534a8ac 100644 --- a/doc/02_user/integration.rst +++ b/doc/02_user/integration.rst @@ -63,6 +63,7 @@ Instantiation Template // Debug interface .debug_req_i (), + .debug_halted_o (), .dm_halt_addr_i (), .dm_exception_addr_i (), .crash_dump_o (), diff --git a/doc/03_reference/debug.rst b/doc/03_reference/debug.rst index e8d85d80e..87123633e 100644 --- a/doc/03_reference/debug.rst +++ b/doc/03_reference/debug.rst @@ -23,6 +23,8 @@ Interface +==================================+=====================+======================================================================================+ | ``debug_req_i`` | input | Request to enter Debug Mode | +----------------------------------+---------------------+--------------------------------------------------------------------------------------+ +| ``debug_halted_o`` | output | Asserted if core enters Debug Mode | ++----------------------------------+---------------------+--------------------------------------------------------------------------------------+ | ``dm_halt_addr_i`` | input | Address to jump to when entering Debug Mode (default 0x1A110800) | +----------------------------------+---------------------+--------------------------------------------------------------------------------------+ | ``dm_exception_addr_i`` | input | Address to jump to when an exception occurs while in Debug Mode (default 0x1A110808) | diff --git a/dv/riscv_compliance/rtl/cve2_riscv_compliance.sv b/dv/riscv_compliance/rtl/cve2_riscv_compliance.sv index 79b1e89e2..2ff1f7f34 100644 --- a/dv/riscv_compliance/rtl/cve2_riscv_compliance.sv +++ b/dv/riscv_compliance/rtl/cve2_riscv_compliance.sv @@ -167,6 +167,7 @@ module cve2_riscv_compliance ( .scramble_req_o ( ), .debug_req_i ('b0 ), + .debug_halted_o ( ), .dm_halt_addr_i (32'h00000000 ), .dm_exception_addr_i (32'h00000000 ), .crash_dump_o ( ), diff --git a/rtl/cve2_core.sv b/rtl/cve2_core.sv index 3eaefafd7..440cc3681 100644 --- a/rtl/cve2_core.sv +++ b/rtl/cve2_core.sv @@ -62,6 +62,7 @@ module cve2_core import cve2_pkg::*; #( // Debug Interface input logic debug_req_i, + output logic debug_halted_o, input logic [31:0] dm_halt_addr_i, input logic [31:0] dm_exception_addr_i, output crash_dump_t crash_dump_o, @@ -611,6 +612,11 @@ module cve2_core import cve2_pkg::*; #( assign crash_dump_o.last_data_addr = lsu_addr_last; assign crash_dump_o.exception_addr = csr_mepc; + /////////////////////// + // Debug output // + /////////////////////// + + assign debug_halted_o = debug_mode; // Explict INC_ASSERT block to avoid unused signal lint warnings were asserts are not included `ifdef INC_ASSERT diff --git a/rtl/cve2_top.sv b/rtl/cve2_top.sv index 3c8c02bee..d8c9b5983 100644 --- a/rtl/cve2_top.sv +++ b/rtl/cve2_top.sv @@ -57,6 +57,7 @@ module cve2_top import cve2_pkg::*; #( // Debug Interface input logic debug_req_i, + output logic debug_halted_o, input logic [31:0] dm_halt_addr_i, input logic [31:0] dm_exception_addr_i, output crash_dump_t crash_dump_o, @@ -194,6 +195,7 @@ module cve2_top import cve2_pkg::*; #( .irq_pending_o(irq_pending), .debug_req_i, + .debug_halted_o, .dm_halt_addr_i, .dm_exception_addr_i, .crash_dump_o, diff --git a/rtl/cve2_top_tracing.sv b/rtl/cve2_top_tracing.sv index 56c330f33..1f7ca6de4 100644 --- a/rtl/cve2_top_tracing.sv +++ b/rtl/cve2_top_tracing.sv @@ -52,6 +52,7 @@ module cve2_top_tracing import cve2_pkg::*; #( // Debug Interface input logic debug_req_i, + output logic debug_halted_o, input logic [31:0] dm_halt_addr_i, input logic [31:0] dm_exception_addr_i, output crash_dump_t crash_dump_o, @@ -146,6 +147,7 @@ module cve2_top_tracing import cve2_pkg::*; #( .irq_nm_i, .debug_req_i, + .debug_halted_o, .dm_halt_addr_i, .dm_exception_addr_i, .crash_dump_o,