Skip to content

Commit

Permalink
perf_counters: Fix counter resetting to zero when no events
Browse files Browse the repository at this point in the history
events[i] can be '0 when there is nothing to count but that shouldn't
reset the current count.
  • Loading branch information
bluewww committed Oct 18, 2023
1 parent 8ab94b8 commit ec24257
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions core/perf_counters.sv
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,8 @@ module perf_counters import ariane_pkg::*; #(
for(int unsigned i = 1; i <= 6; i++) begin
if ((!debug_mode_i) && (!we_i)) begin
if (events[i] == 1)begin
generic_counter_d[i] = generic_counter_q[i] + 1'b1;end
else begin
generic_counter_d[i] = 'b0;end
generic_counter_d[i] = generic_counter_q[i] + 1'b1;
end
end
end

Expand Down

0 comments on commit ec24257

Please sign in to comment.