|
|
|
The Quartus® II/Synopsys® interface offers full support for the memory capabilities for ACEX® 1K, APEX 20K, APEX II, FLEX 10KE, Cyclone, Mercury, Stratix, and Stratix GX devices, including synchronous and asynchronous RAM and ROM, cycle-shared dual port RAM, dual-port RAM, single-clock FIFO, and dual-clock FIFO functions. You can use the genmem
at the UNIX prompt to display information on how to use this utility, as well as a list of the functions you can generate.
To instantiate a RAM or ROM function in VHDL:
genmem
<memory type>
<memory size> -vhdl
For example: genmem asynrom 256x15 -vhdl
Figure 1 shows a VHDL design that instantiates asyn_rom_256x15.vhd, a 256 x 15 ROM function.
Figure 1: VHDL Design File with ROM Instantiation (tstrom.vhd) |
LIBRARY ieee; USE ieee.std_logic_1164.all; |
ENTITY tstrom IS PORT ( addr : IN STD_LOGIC_VECTOR (7 DOWNTO 0); memenab : IN STD_LOGIC; q : OUT STD_LOGIC_VECTOR (14 DOWNTO 0)); END tstrom; |
ARCHITECTURE behavior OF tstrom IS COMPONENT asyn_rom_256x15 -- pragma translate_off GENERIC (LPM_FILE : string); |
-- pragma translate_on PORT (Address : IN STD_LOGIC_VECTOR(7 DOWNTO 0); MemEnab : IN STD_LOGIC; Q : OUT STD_LOGIC_VECTOR(14 DOWNTO 0) ); END COMPONENT; |
BEGIN u1: asyn_rom_256x15 -- pragma translate_off GENERIC MAP (LPM_FILE => "u1.hex") -- pragma translate_on PORT MAP (Address => addr, MemEnab => memenab, Q =>q); END behavior; |
LPM_FILE
parameter. See Figure 1. The file name must be the same as the instance name; for example, the u1
instance name must be unique throughout the whole project, and must contain only valid VHDL name characters. The initialization file must reside in the directory containing the project's design files.
|
-- pragma translate_off
-- pragma translate_on
--pragma translate_off
directive instructs the VHDL Compiler software to skip syntax checking until the --pragma translate_on
directive is read.
string
for the Generic Clause, you must also type the following command before you read the design:
hdlin_translate_off_skip_text=true
read -f db apex20k [<speed grade>].db update_lib apex20k [<speed grade>] <RAM/ROM function name>.lib |
write_lib apex20k
[<speed grade>] -o apex20k
[<speed grade>].db
- PLDWorld - |
|
Created by chm2web html help conversion utility. |