Skip to content

Commit 0dcd95b

Browse files
committed
Fix too small cast
HartSelLen is the number of bits required to represent NrHarts values, but it is just shy of one bit to represent NrHarts itself.
1 parent bd74ae7 commit 0dcd95b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/dm_csrs.sv

+1-1
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ module dm_csrs #(
538538
// default assignment
539539
haltreq_o = '0;
540540
resumereq_o = '0;
541-
if (selected_hart < HartSelLen'(NrHarts)) begin
541+
if (selected_hart < (HartSelLen+1)'(NrHarts)) begin
542542
haltreq_o[selected_hart] = dmcontrol_q.haltreq;
543543
resumereq_o[selected_hart] = dmcontrol_q.resumereq;
544544
end

0 commit comments

Comments
 (0)