Skip to content

Commit

Permalink
perf_counters: Fix counter resetting to zero (#1546)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluewww authored Oct 19, 2023
1 parent 588cf6e commit 99b1e8f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions core/perf_counters.sv
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 99b1e8f

Please sign in to comment.