Forum Discussion
Altera_Forum
Honored Contributor
10 years agoError 10251 - cannot fall outside the declared range
Hello,
i have got a little problem with array of registers. This is error message: --- Quote Start --- Error (10251): Verilog HDL error at File.v(160): index 5 cannot fall outside the declared range [3:0] for dimension 0 of array "Modulator" --- Quote End --- This is simplified module with all lines corelated with array "Modulator":
module File# (parameter LFO1B=4'b0101)(input Modulator_LFO1B)
wire Modulator ;
assign Modulator=Modulator_LFO1B;
endmodule
Do you know what is going on? Kind Regards L.1 Reply
- Altera_Forum
Honored Contributor
modulator is declared as an array of four six bit (ie, [5:0]) values, indexed as 0, 1, 2, 3 (ie, [3:0]).
Your default parameter value is asking for index 4'b0101 which is 5. 5 is greater than 3. QED. So either change the default value to be in range 0..3, or in the module instantiation override the default parameter value. OR if you really mean for the array index to be a four bit value then it should be declared as [15:0] instead:
since array selects are index values MIN to MAX (or MAX to MIN) and not address field widths.wire Modulator ;