我有大量这样的实体实例:
GPIO : entity L_PicoBlaze.pb_GPIO_Adapter
generic map (
[...]
)
port map (
Clock => CPU_Clock, -- Clock : in STD_LOGIC;
Reset => '0', -- Reset : in STD_LOGIC; -- line 645
[...]
);
上面的代码适用于:
- ISE XST 14.7
- Quartus II 13.x
- ISE iSim 14.7
我也确信,我成功地使用 Vivado 2013.x 编译了我的设计!!!
Vivado (2014.4) Synth 提示 '0'
有 3 种可能的类型解析:
[Synth 8-2396] 靠近字符 '0' ; 3 个可见类型与此处匹配 ["D:/git/.../PicoBlaze/System.vhdl":645]
重置声明如下:
重置:在 STD_LOGIC 中
我可以通过使用限定表达式来解决这个问题:
GPIO : entity L_PicoBlaze.pb_GPIO_Adapter
generic map (
[...]
)
port map (
Clock => CPU_Clock,
Reset => STD_LOGIC'('0'), -- line 645
[...]
);
我认为 (a) 看起来很糟糕,(b) 是 Synth 中的一个错误。
我认为 ISE XST 和其他工具正在执行反向/向后类型推断来确定正确的文字类型。
有人也遇到过这个问题吗?
如果我在端口映射中写入“0”、x“00..00”或“00..00”,我的编码风格是否很糟糕?
编辑 1 - 最小和完整示例:
library IEEE;
use IEEE.std_logic_1164.all;
entity top is
port (
Clock : in STD_LOGIC;
Reset : in STD_LOGIC;
OUTPUT : out STD_LOGIC
);
end entity;
architecture rtl of top is
begin
toggle : entity work.TFF
port map (
Clock => Clock,
Reset => '0', -- line 17
Q => Output
);
end;
-- a simple toggle flip flop
library IEEE;
use IEEE.std_logic_1164.all;
entity TFF is
port (
Clock : in STD_LOGIC;
Reset : in STD_LOGIC;
Q : out STD_LOGIC
);
end entity;
architecture rtl of TFF is
signal Q_r : STD_LOGIC := '0';
begin
process(Clock)
begin
if rising_edge(Clock) then
if (Reset = '1') then
Q_r <= '0';
else
Q_r <= not Q_r;
end if;
end if;
end process;
Q <= Q_r;
end;
Vivado 2014.4 错误消息:
[Synth 8-2396] 靠近字符 '0' ; 3 个可见类型与此处匹配 ["D:/Temp/OverloadTest/overload.vhdl":17]
编辑2:
我找到了一个工作示例:我只是将实体 tff 的声明放在顶级声明的前面。看来来自 Vivado 的 [Synth 8-2396] close .....visible types match here 错误消息只是一种笨拙的方式告诉我们,它无法找到对整个组件的引用/文件?
我需要一些时间重新检查我的文件列表 (>300) 是否有丢失的文件/组件。
最佳答案
这不一定回答您的问题,但确实解决了您在评论链中的问题:
So Vivado 2013.4 has the same problems :( ... I used an empty project and added one source file (see above). After that I hit 'Run Synthesis'. I also tried to enable VHDL-2008 with this TCL command: set_property vhdl_version vhdl_2008 [current_fileset] and run synthesis again -> no change. How can I contact Xilinx? Webcases are abolished ... the forum?
参见AR# 62291 ,看来您仍然可以通过打开 Webcase
操作打开新的 Webcase 问题。
我从您的原始代码片段编写的测试用例恰好在测试用例与其被测直接实体实例化单元(标记为GPIO
)之间具有正确的声明/规范顺序:
library ieee;
use ieee.std_logic_1164.all;
-- use ieee.numeric_std.all;
entity pb_GPIO_Adapter is
generic (foo: natural := 42);
port (
Clock: in std_logic;
Reset: in std_logic;
dummy: out std_logic
);
end entity;
architecture foo of pb_GPIO_Adapter is
begin
DUMB:
process (Clock, Reset)
variable dumbit: std_logic := '0';
begin
if Reset = '1' then
dumbit := '0';
elsif rising_edge(Clock) then
dumbit := not dumbit;
end if;
dummy <= dumbit;
end process;
end architecture;
library ieee;
use ieee.std_logic_1164.all;
entity fum is
end entity;
architecture fie of fum is
signal dummy: std_logic;
signal CPU_Clock: std_logic := '0';
signal Reset: std_logic;
begin
GPIO:
entity work.pb_GPIO_Adapter -- work substituted for L_PicoBlaze
generic map (
foo => 42
)
port map (
Clock => CPU_Clock, -- Clock : in STD_LOGIC;
Reset => '0', -- Reset : in STD_LOGIC;
dummy => dummy
);
CLOCK:
process
begin
wait for 10 ns;
CPU_Clock <= not CPU_Clock;
if Now > 200 ns then
wait;
end if;
end process;
end architecture;
请注意,我(对我来说)自然地得到了正确的分析顺序。我本想在您的“最小可验证和完整”示例中提高顺序,但在评论中被剪断了。您还可能会注意到长评论问题和答案链是不可搜索的,在那里获得的任何内容对其他 stackoverflow 用户没有任何好处。
查看 AR# 62291(顺便说一下 Vivado 2014.3),我们在解决方案下看到 -
The error occurs because an RTL file is out of sync and the type of a signal is not properly declared.
请注意,该语言不是 VHDL 术语。
这与 Xilinx 之前神秘的 XST 错误消息相符,表明在综合之前至少仍然需要分析和详细阐述设计规范。我们本来可以期待更好的。至少比某些竞争对手更容易通过 Xilinx 的错误代码(例如 [Synth 8-2396])查找信息。
无论如何,您的 MVCe 中也有同样的内容,并且内容的分析顺序错误,这告诉我们可以通过苦差事来修复它。
您还可以在 AR# 62291 中注明链接中有一个标记为 open Webcase
的操作项,它将引导您进入 WebCase Support Page您可以在其中登录并打开新的 Webcase 问题。
我认为,一旦您发现设计中的分析顺序问题并纠正它,您就会恢复正常。
这个故事的寓意是,Xilinx 网络支持应该是解决相对较新的 Vivado 问题的首要联系点。
通过 vivado 建立问题和答案标记您也可以回答您自己的问题。目前只有六个带有该标签的问题,这可能有助于吸引更多问题和答案。 (六个 Vivado 标记问题均未接受答案)。
关于vhdl - Vivado 是否已忘记进行类型推断?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27495907/