Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20797 Discussions

Initializing Multiple Altsyncram Instantiations

Altera_Forum
Honored Contributor II
1,010 Views

I am using the MegaWizard Plug-In Manager to create a new custom variation of the altsyncram megafunction. I know that the MegaWizard allows me to assign a .mif file to initialize the contents of this altsyncram variation. 

 

My question is: How do I implement multiple instances of the same altsyncram variation in my design AND assign a unique .mif file to each instance? 

 

For example, I use the MegaWizard to create an 8x16 dual-port RAM and save the output file RAM_8X16.v. If I am just using one instance of this RAM in my design, I can assign an initialization file (ex., RAM_8X16_INIT.mif) with the MegaWizard tool and all is well. But what if I want to instantiate TWO of the same 8x16 dual-port RAM's in my design (ex., RAM_1 and RAM_2) and initialize them both with unique values? The MegaWizard tool assigns the .mif file to the output file (RAM_8X16.v), not the unique RAM_1 and RAM_2 identifiers....so there doesn't seem to be any way to assign unique .mif files to each instance unless I create TWO different MegaWizard output files with different file names....I know this strategy will work, it just seems incredibly clunky and inefficient...
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
234 Views

You first add a mif file to your core. Once done then you can port map the core wrapper manually at instantiation 

and 1) either edit each with its file name. 

or 2) if you want to use a loop then you can declare a 2D string and call each file name by its index in string: 

 

type name_array is array(1 to 10) of string(8 downto 1);  

signal filename : name_array := -- assign your file names here 

assuming they are 10 names each 8 characters.
0 Kudos
Reply