Altera_Forum
Honored Contributor
14 years agoInitialization of multidimensional arrays
Hello,
I am developing video processing cores to Cyclone III devices by using Quartus II 10.1sp1. I am writing the program codes in Verilog HDL. Now I need for a 2 dimensional array filled up with predefined values. The size of the array should be flexible. The next declaration was set up: parameter [4:0] NUMBER_OF_TAPS = 5'd6; parameter [6:0] NUMBER_OF_PHASES = 7'd16; reg [31:0] coefficients [log2(NUMBER_OF_PHASES)-1:0][log2(NUMBER_OF_TAPS)-1:0] The 'coefficients' array has a parameterized size and must be initialized not for simulation purposes but at power up in the Cyclone III device. I have tried to make a .mif file but it seems to be 1-dimensional only. The initial parameters are the subject of coninuous change for experiment purposes so it would be nice to have them in an external file or in a simple array declaration and not in value-by-value form. Can anybody help me? Regards, Istvan