UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

AR# 18775

6.1i XST - XST does not support a negative address range for inferring ROMs and RAMs

Description

Keywords: ROM, RAM, address, range, negative, integer, XST

Urgency: Standard

General Description :
XST does not support ROM or RAM with a negative address which causes the behavioral simulation to be different from the XST-implemented design.

The following is an example of incorrect code:

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.numeric_std.all;

entity kk is
Port (dato : in std_logic_vector(3 downto 0);
vout : out std_logic_vector(7 downto 0) );
end kk;

architecture Behavioral of kk is
type sigmoid_type is array (integer range -8 to 7) of std_logic_vector(7
downto 0); -- Wrong Line
constant sigmoid: sigmoid_type:=(
"00000000","00000001","00000010","00000011","00000100","00000101","00000110","00000111",
"00001000","00001001","00001010","00001011","00001100","00001101","00001110","00001111");
begin

vout <= sigmoid(to_integer(signed(dato))); -- Change this line.

end Behavioral;

Solution

To work around this issue, refer to the following example of correct code:

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.numeric_std.all;

entity kk is
Port (dato : in std_logic_vector(3 downto 0);
vout : out std_logic_vector(7 downto 0) );
end kk;

architecture Behavioral of kk is
type sigmoid_type is array (integer range 0 to 15) of std_logic_vector(7
downto 0);
constant sigmoid: sigmoid_type:=(
"00000000","00000001","00000010","00000011","00000100","00000101","00000110","00000111",
"00001000","00001001","00001010","00001011","00001100","00001101","00001110","00001111");
begin

vout <= sigmoid(to_integer(unsigned(dato)));

end Behavioral;
AR# 18775
Date Created 01/14/2004
Last Updated 03/08/2006
Status Archive
Type General Article