Forum Discussion
Altera_Forum
Honored Contributor
10 years ago --- Quote Start --- It depends on the DDR2 memory model. Look at the code for the memory component and see if it has initialization generics. Look at the code and see how the memory array is implemented. If its implemented as a shared variable, you can use VHDL-2008 hierarchical access to initialize the variable. If you have a mixed-mode simulator, and use a Verilog memory model, then you can use $readmemh to load the memory. These various options depend on the memory model. I don't recall what Altera uses. I'd recommend creating a Qsys system with a DDR2 controller and then generating the example design. I've used this method to get the instantiation template for the memory model, and then copied that code into my own testbench. Try some of these ideas, and if you get stuck, let me know and I can try looking to see what I have used in the past. Cheers, Dave --- Quote End --- Hi Dave, So based on your answer, is it true that there isn't a straightforward way to initialise the ddr2 memory model by using some sort of statement in either HDL file or simulator command? I'm using Verilog memory model and Modelsim. Are you suggesting locating the memory array in the memory model and initialising it with $readmemb statement? When generate the Qsys system I tick the option to generate a verilog test-bench, inside this test-bench I can see an "Altera ddr2 memory model for Uniphy". I guess this is the memory model you referred to. However it seems that the model is a set of wrapper files and the signal names get more and more complex and I'm not sure where the memory array is.