Altera_Forum
Honored Contributor
9 years agoIs there any way to initialize onchip-ram with auto-generated data instead of an .mif
Hello every one
I have some puzzle in using altsyncram module, and I need your help! In my design, I want to initialize a altsyncram in a parameterized module. The data filling to ram should be generated with the parameter passed to this parameterized module. But it seems that altsyncram can only be initialized by a .mif file. How can I reach my purpose? The another way to workaround it is to use verilog to declare a ram register array by specifying 'ramstyle' property with "M-RAM", just like the following code:(* ramstyle = "M-RAM" *) reg ram; But the ram constructed by this way can only be accessed by one port. Dual port accessing code will cause synopsys to allocate double onchip ram blocks, and that should be avoid in my design. I had tried to generate .mif file in the intial block of module, and it didn't work because quartus II didn't support the system function such as $fopen, $fprintf, etc... So, could anyone tell me how to initialize altsyncram programmatically in verilog? Or anyway to generate .mif file programmatically through verilog by calling a script? Or How to generate a TRUE Dual-port ram without using IP core such as altsyncram etc? Thanks very much!