@@ -48,12 +48,13 @@ module addr_decode_dync #(
4848 // / The address decoder expects three fields in `rule_t`:
4949 // /
5050 // / typedef struct packed {
51- // / int unsigned idx;
52- // / addr_t start_addr;
53- // / addr_t end_addr;
51+ // / idx_t idx;
52+ // / addr_t start_addr;
53+ // / addr_t end_addr;
5454 // / } rule_t;
5555 // /
56- // / - `idx`: index of the rule, has to be < `NoIndices`
56+ // / - `idx`: The index to be returned for a matching rule. Usually an integer but can
57+ // / be any type of data.
5758 // / - `start_addr`: start address of the range the rule describes, value is included in range
5859 // / - `end_addr`: end address of the range the rule describes, value is NOT included in range
5960 // / if `end_addr == '0` end of address space is assumed
@@ -64,15 +65,10 @@ module addr_decode_dync #(
6465 parameter type rule_t = logic ,
6566 // / Whether this is a NAPOT (base and mask) or regular range decoder
6667 parameter bit Napot = 0 ,
67- // / Whether to assert maximum indices.
68- parameter bit AssertIndices = 1'b1 ,
69- // / Dependent parameter, do **not** overwite!
70- // /
71- // / Width of the `idx_o` output port.
68+ // / The output index type `idx_t` can be specified either with the width `IdxWidth`
69+ // / or directly with the type `idx_t`. By default, it will use the maximum index
70+ // / `NoIndices` to calculate the required width.
7271 parameter int unsigned IdxWidth = cf_math_pkg :: idx_width(NoIndices),
73- // / Dependent parameter, do **not** overwite!
74- // /
75- // / Type of the `idx_o` output port.
7672 parameter type idx_t = logic [IdxWidth- 1 : 0 ]
7773) (
7874 // / Address to decode.
@@ -132,7 +128,6 @@ module addr_decode_dync #(
132128 $sformatf (" Input address has %d bits and address map has %d bits." ,
133129 $bits (addr_i), $bits (addr_map_i[0 ].start_addr)))
134130 `ASSUME_I (norules_0, NoRules > 0 , $sformatf (" At least one rule needed" ))
135- `ASSUME_I (noindices_0, NoIndices > 0 || ! AssertIndices, $sformatf (" At least one index needed" ))
136131 end
137132
138133 `ASSERT_FINAL (more_than_1_bit_set, $onehot0 (matched_rules) || config_ongoing_i,
@@ -157,15 +152,6 @@ module addr_decode_dync #(
157152 Rule> IDX: %h START: %h END: %h \n \
158153 #####################################################" ,
159154 i ,addr_map_i[i].idx, addr_map_i[i].start_addr, addr_map_i[i].end_addr))
160- // check the SLV ids
161- `ASSUME_I (check_idx, addr_map_i[i].idx < NoIndices|| ! AssertIndices,
162- $sformatf (" This rule has a IDX that is not allowed!!!\n \
163- Violating rule %d .\n \
164- Rule> IDX: %h START: %h END: %h \n \
165- Rule> MAX_IDX: %h \n \
166- #####################################################" ,
167- i, addr_map_i[i].idx, addr_map_i[i].start_addr, addr_map_i[i].end_addr,
168- (NoIndices- 1 )))
169155 for (int unsigned j = i + 1 ; j < NoRules; j++ ) begin
170156 // overlap check
171157 `ASSUME_I (check_overlap, Napot ||
0 commit comments