-- MEMORY INITIALIZATION FILE -- EXAMPLE DATA FOR AN 8x8 ROM WIDTH = 8; % WIDTH OF OUTPUT IS REQUIRED, ENTER A DECIMAL VALUE % DEPTH = 8; % DEPTH OF MEMORY IS REQUIRED, ENTER A DECIMAL VALUE % ADDRESS_RADIX = HEX; % Address and data radixes are optional, default is hex % DATA_RADIX = HEX; % Valid radixes = BIN,DEC,HEX or OCT % CONTENT BEGIN 0 : 07; % ADDRESS : VALUE % 1 : 06; 2 : 05; 3 : 04; 4 : 03; 5 : 02; 6 : 01; 7 : 00; END; -- SHORTCUTS FOR SPECIFYING CONTENTS -- [0..FF] : 0; % Range--Every address from 0 to FF = 0% -- D : 7; % Single address--Address D = 7 % -- 6 : 9 C 8; % Range starting from specific address--% -- If there are multiple values for the same address only the last value is used
File->MegaWizard Plug-In Manager
Select "Create a new custom megafunction variation"
Click Next
Select Verilog HDL
Select storage-> LPM_ROM
Enter an output name such as "rom8x8"
Click Next
Select '3' for width of q output for this example
Uncheck 'address input port' under "Which ports should be registered?"
Click Next
Browse to the rom8x8.mif file that was created or downloaded from above
Click Next
A summary page shows the files to be created
Click Finish