HOME PREVIOUS NEXT

Using Altera LPM ROM

Using LPM ROM module is similar to RAM, except that ROM module must be supplied with ROM data in an external file. ROM data file is in MIF (Memory Initialization File) format or HEX (Intel-Format Hexadecimal) format. The file should be placed at the same directory as EDF netlist file of the design.

This example demonstrates usage of an LPM ROM module. Add a normal module, "rom", at the top level design hierarchy. Under the rom module, insert LPM_ROM module from predefined module library under "LPM Components" category. Set parameters of the LPM module as shown below.

At the rom module, set its interface ports as below:

Edit the rom module's VHDL content as shown below:

architecture rom_arch of rom is

    signal HIGH : STD_LOGIC;

    ....
    ....

begin

    HIGH <= '1';

    U_LPM_ROM: LPM_ROM
        port map (ADDRESS,HIGH,HIGH,HIGH,Q);

end rom_arch;

Using a text editor, create the rom data file named "rom.mif" as below. Save the file in directory where you will save the EDF file generated from FPGA Express.

DEPTH = 16;           % Memory depth and width are required    %
WIDTH = 8;            % Enter a decimal number                 %

ADDRESS_RADIX = HEX;  % Address and value radixes are optional %
DATA_RADIX = HEX;     % Enter BIN, DEC, HEX, or OCT; unless    %
                      % otherwise specified, radixes = HEX     %

-- Specify values for addresses, which can be single address or range

CONTENT
    BEGIN

[0..F] : 0;           % Range--Every address from 0 to F = 0   %
6      : F;           % Single address--Address 6 = F          %
8      : F E 5;	      % Range starting from specific address-- %	
                      % Addr[8] = F, Addr[9] = E, Addr[A] = 5  %
END ;

You can then generate the rom module from the VHDLMG for synthesis and implementation following normal procedures.


HOME PREVIOUS NEXT
1