Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
17252 Discussions

Error 10251 - cannot fall outside the declared range

Altera_Forum
Honored Contributor II
5,248 Views

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.
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
3,994 Views

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: 

 

wire Modulator ; 

 

since array selects are index values MIN to MAX (or MAX to MIN) and not address field widths.
0 Kudos
Reply