How to force hdl coder to generate one vhd file for each single RAM library block used in the model.

5 views (last 30 days)
Hi all,
I have a question regarding the vhd structure of the files which is generated by the hdl coder from simulink.
I am using lot of DualPortRAM blocks in my model. In the past I was using the MATLAB2012 version and the hdl coder generated one single file for each DualPortRAM instance. E.g. 2 DualPortRAM blocks in the model resulted in the 2 vhd files "DualPortRAM_128x18b_0.vhd and DualPortRAM_128x18b_1.vhd". With this structure altera quartus generated in the folowing synthesis prozess 2 *.mif files for each of this RAM blocks and I was able to use this mif files for RAM initialization data. Now I switch to MATLAB2014b and the hdl coder chnaged the vhd file structure. Now just one vhd file is generated for DualPorRAM and than referenced by the relevant model pieces. That of course is not bad (from the design point of view), but the folowing synthesis prozess in quartus creates just one *.mif file for the different RAM ranges of the same type and I can not initialize the single RAM ranges with different data.
Is it possible to do something in order to get the old vhd file structure? Maybe someone has also a different idea how to solve the whole RAM initialization problem.

Answers (1)

Tim McBrayer
Tim McBrayer on 4 Dec 2014
There is no option to disable the sharing of RAM files. Any identical RAMs will create multiple instances of the same RAM entity/architecture.
If you absolutely require different RAM files with identical contents, there is a workaround you could try. Make the RAMs different in some way; e.g. if one RAM is 128 entries by 18 bits, make the other have 129 entries, or 17 bits, or something like this. This is clearly not optimal, but will instantiate your files separately.

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!