Altera_Forum
Honored Contributor
15 years agoHow to initialize 2-d memory?
Dear Forum,
I'd like to put a subsystem on a PLD which is a lookup table pretending to be the output of an ADC. I use the following verilog to initialize the lookup table. `define W 10 /* ADC bit width */ `define N 40 /* modulo count */ reg [2*W-1:0] count_to_volt[0:N-1]/* synthesis ram_init_file = "memarray3.mif" */; However, I'd really like 4 channels, reg [2*W-1:0] count_to_volt_channel[0:3][0:N-1]/* synthesis What goes here? */; but I don't know how to initialize the above 2-d memory array. At present my solution is just to use the first form four times with names count_to_volt1,...,count_to_volt4, but this is messy and it would be neater to use the 2-d memory. So, how do I persuade Quartus to initialize a 2-d memory? Yours sincerely Stephen