From 6c6d728539d930db98f32697e5831e1e7a4df37b Mon Sep 17 00:00:00 2001 From: Flavien Solt Date: Sat, 22 Aug 2026 23:01:01 +0800 Subject: [PATCH 1/2] Fix segment micro-op exception handling --- hardware/src/segment_sequencer.sv | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/hardware/src/segment_sequencer.sv b/hardware/src/segment_sequencer.sv index afca58e22..1e1e99d32 100644 --- a/hardware/src/segment_sequencer.sv +++ b/hardware/src/segment_sequencer.sv @@ -176,8 +176,11 @@ module segment_sequencer import ara_pkg::*; import rvv_pkg::*; #( end // Wait for an answer from Ara's backend - if (ara_resp_valid_i) begin // If exception, stop the execution + if (ara_resp_valid_i) begin + // If exception, stop the execution and forward it to CVA6 if (ara_resp_i.exception.valid) begin + ara_resp_d = ara_resp_i; + state_d = SEGMENT_MICRO_OPS_END; // If no exception, continue with the micro ops end else begin // If over - stop in the next cycle @@ -195,8 +198,12 @@ module segment_sequencer import ara_pkg::*; import rvv_pkg::*; #( ara_resp_valid_o = 1'b0; // Stop injecting micro instructions ara_req_valid_o = 1'b0; - // Wait for idle to give the final load/store_complete - if (ara_idle_i && ara_req_ready_i) begin + // A previously issued micro operation can still report an exception + if (ara_resp_valid_i && ara_resp_i.exception.valid) begin + ara_resp_d = ara_resp_i; + state_d = SEGMENT_MICRO_OPS_END; + // Otherwise, wait for idle to give the final load/store_complete + end else if (ara_idle_i && ara_req_ready_i) begin state_d = SEGMENT_MICRO_OPS_END; end end From e225d8a641f479bf53b3b0f66d921fa456123250 Mon Sep 17 00:00:00 2001 From: Flavien Solt Date: Sat, 22 Aug 2026 23:18:48 +0800 Subject: [PATCH 2/2] Stop segment requests on exceptions --- hardware/src/segment_sequencer.sv | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hardware/src/segment_sequencer.sv b/hardware/src/segment_sequencer.sv index 1e1e99d32..44558644e 100644 --- a/hardware/src/segment_sequencer.sv +++ b/hardware/src/segment_sequencer.sv @@ -179,8 +179,10 @@ module segment_sequencer import ara_pkg::*; import rvv_pkg::*; #( if (ara_resp_valid_i) begin // If exception, stop the execution and forward it to CVA6 if (ara_resp_i.exception.valid) begin - ara_resp_d = ara_resp_i; - state_d = SEGMENT_MICRO_OPS_END; + ara_req_valid_o = 1'b0; + segment_cnt_en = 1'b0; + ara_resp_d = ara_resp_i; + state_d = SEGMENT_MICRO_OPS_END; // If no exception, continue with the micro ops end else begin // If over - stop in the next cycle