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 では ROM および RAM の推論に負のアドレス範囲は使用できない

説明

キーワード : ROM, RAM, address, range, negative, integer, XST, アドレス, 範囲, 負, 整数

重要度 : 標準

概要 :
XST では 負のアドレスが設定された ROM および RAM がサポートされておらず、ビヘイビア シミュレーションの結果がインプリメントされたデザインと異なる場合があります。

次に、不正なコードの例を示します。

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;

ソリューション

次に正しいコードの例を示します。

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
日付 03/08/2006
ステータス アーカイブ
種類 一般
このページをブックマークに追加