From 99b1e8fec500ff7478698512da3285f59c06b2f9 Mon Sep 17 00:00:00 2001 From: Robert Balas <13798471+bluewww@users.noreply.github.com> Date: Thu, 19 Oct 2023 16:24:48 +0200 Subject: [PATCH] perf_counters: Fix counter resetting to zero (#1546) --- core/perf_counters.sv | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/perf_counters.sv b/core/perf_counters.sv index 2213221b8e..d529c5b300 100644 --- a/core/perf_counters.sv +++ b/core/perf_counters.sv @@ -130,12 +130,11 @@ module perf_counters read_access_exception = 1'b0; update_access_exception = 1'b0; + // Increment the non-inhibited counters with active events for (int unsigned i = 1; i <= 6; i++) begin if ((!debug_mode_i) && (!we_i)) begin if ((events[i]) == 1 && (!mcountinhibit_i[i+2])) begin generic_counter_d[i] = generic_counter_q[i] + 1'b1; - end else begin - generic_counter_d[i] = 'b0; end end end