Virtex-6 または Spartan-6 デバイスをターゲットにすると XST で次のエラー メッセージが表示されますが、ほかの古いデバイスだとエラーは発生しません。
この問題が発生するのはなぜですか。
ERROR:HDLCompiler:607 -"<file>.vhd" Line xx: Multiple declarations of my_const included via multiple use clauses; none are made directly visible
"<file>.vhd" Line aa. my_const is declared here
"<file>.vhd" Line bb Another match is here
library ieee;
use ieee.std_logic_1164.all;
package pack_0017_1 is
constant my_const: std_logic := '1';
end package;
-----------------------------------
library ieee;
use ieee.std_logic_1164.all;
package pack_0017_2 is
constant my_const: std_logic:= '0';
end package;
-----------------------------------
library ieee;
use ieee.std_logic_1164.all;
library work;
use work.pack_0017_1.all;
use work.pack_0017_2.all;
entity ex_0017 is
port(in_port : in std_logic;
out_port: out std_logic);
end ex_0017;
architecture beh of ex_0017 is
begin
out_port <= in_port and my_const; -- Note: Error points here
end
上記のコード例では、my_const 定数が異なる 2 つのパッケージ (pack_0017_1 および pack_0017_2) で宣言されています。
この両方のパッケージが ex_0017 ブロックで use 節を介して使用されています。
このコードは、VHDL LRM に準拠していません。
次に、この問題を解決する方法を 2 つ示します。
library ieee;
use ieee.std_logic_1164.all;
package pack_0017_1 is
constant my_const: std_logic := '1';
end package;
-----------------------------------
library ieee;
use ieee.std_logic_1164.all;
package pack_0017_2 is
constant my_const: std_logic:= '0';
end package;
-----------------------------------
library ieee;
use ieee.std_logic_1164.all;
entity ex_0017 is
port(in_port : in std_logic;
out_port: out std_logic);
end ex_0017;
architecture beh of ex_0017 is
begin
out_port <= in_port and work.pack_0017_1.my_const;
end;
ISE Design Suite 11.2 では、XST で Virtex-6 および Spartan-6 ファミリ用に新しい VHDL/Verilog パーサーが使用されるようになっています。
この変更の詳細は、(ザイリンクス アンサー 32927) を参照してください。
AR# 32983 | |
---|---|
日付 | 03/23/2015 |
ステータス | アクティブ |
種類 | 一般 |
ツール |