General Description: How do I infer ROM for Virtex, Virtex-E and Virtex-II?
解决方案
1
FPGA Express versions 3.3 and above have the ability to infer ROM primitives for Virtex designs if the syntax described below is used. Three points must be noted:
1. Be sure to define at least 75% of the states. (50% of the states may be defined if the "infer_mux" attribute is used.)
2. These components will be written into the EDIF netlist as LUT4s, not ROM16X1s. Either one will be implemented identically.
3. This feature is only applicable to Virtex-based architectures.
Currently, FPGA Express can not infer RAM.
Beginning with FPGA Express 3.5 for Virtex, Virtex-E, and Virtex-II, block RAM for ROMs (rather than LUTs) will be inferred in the following cases:
For Virtex and Virtex-E: Block RAM will be inferred when the address line is at least 10 bits, and the data line is 3 bits or greater. Also, block RAM will be inferred when the address line is 11 or 12 bits; no minimum data width is required.
For Virtex-II: Block RAM will be inferred for ROM if the address line is between 10 to 14 bits; no minimum data width is required.
For more information on the "infer_mux" attribute, please refer to (Xilinx Answer 11331).
- The following VHDL code will be implemented in eight LUTs (two for each output bit):
process (ADDRESS) begin case ADDRESS is when "00000" => output <= "1110" ; when "00001" => output <= "0100" ; when "00010" => output <= "1101" ; when "00011" => output <= "0001" ; when "00100" => output <= "0010" ; when "00101" => output <= "1111" ; when "00110" => output <= "1011" ; when "00111" => output <= "1000" ; when "01000" => output <= "0011" ; when "01001" => output <= "1010" ; when "01010" => output <= "0110" ; when "01011" => output <= "1100" ; when "01100" => output <= "0101" ; when "01101" => output <= "1001" ; when "01110" => output <= "0000" ; when "01111" => output <= "0111" ; when "10000" => output <= "0000" ; when "10001" => output <= "1111" ; when "10010" => output <= "0111" ; when "10011" => output <= "0100" ; when "10100" => output <= "1110" ; when "10101" => output <= "0010" ; when "10110" => output <= "1101" ; when "10111" => output <= "0001" ; when "11000" => output <= "1010" ; when "11001" => output <= "0110" ; when "11010" => output <= "1100" ; when "11011" => output <= "1011" ; when "11100" => output <= "1001" ; when "11101" => output <= "0101" ; when "11110" => output <= "0011" ; when "11111" => output <= "1101" ; when others => output <= "1101"; end case; end process;
- The following VHDL code will be implemented in eight LUTs (two for each output bit) using the "infer_mux" attribute:
process (ADDRESS) begin case ADDRESS is -- synopsys infer_mux when "00000" => output <= "1110" ; when "00001" => output <= "0100" ; when "00010" => output <= "1101" ; when "00011" => output <= "0001" ; when "00100" => output <= "0010" ; when "00101" => output <= "1111" ; when "00110" => output <= "1011" ; when "00111" => output <= "1000" ; when "01000" => output <= "0011" ; when "01001" => output <= "1010" ; when "01010" => output <= "0110" ; when "01011" => output <= "1100" ; when "01100" => output <= "0101" ; when "01101" => output <= "1001" ; when "01110" => output <= "0000" ; when "01111" => output <= "0111" ; when "10000" => output <= "0000" ; when others => output <= "1101"; end case; end process;
NOTE: A bug in FPGA Express prevents a ROM that is using Block RAM from being properly inferred.