Skip to content

Commit f7b8b76

Browse files
committed
hw: prevent negative index in user_pkg
1 parent 871dcef commit f7b8b76

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rtl/user_pkg.sv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ package user_pkg;
2525
localparam bit [31:0] UserRomAddrOffset = croc_pkg::UserBaseAddr; // 32'h2000_0000;
2626
localparam bit [31:0] UserRomAddrRange = 32'h0000_1000; // every subordinate has at least 4KB
2727

28-
localparam int unsigned NumDemuxSbrRules = NumUserDomainSubordinates; // number of address rules in the decoder
28+
localparam int unsigned NumDemuxSbrRules = (NumUserDomainSubordinates > 0) ? NumUserDomainSubordinates : 1; // number of address rules in the decoder
2929
localparam int unsigned NumDemuxSbr = NumDemuxSbrRules + 1; // additional OBI error, used for signal arrays
3030

3131
// Enum for bus indices

0 commit comments

Comments
 (0)