全局静态误差(modelsim 与 quartus)

gro*_*rel 5 vhdl modelsim quartus

这个简单的测试会在使用 modelsim 编译时导致错误,而 Quartus 可以完成整个综合/拟合过程。

library ieee;
use ieee.std_logic_1164.all;

entity submodule is
port(
  four_bits_input  : in  std_logic_vector(3 downto 0);
  four_bits_output : out std_logic_vector(3 downto 0)
);
end entity;

architecture behav of submodule is
begin
  four_bits_output <= four_bits_input;
end architecture;

-------------------------------------------------------

library ieee;
use ieee.std_logic_1164.all;

entity globally_static_test is
port (
  one_bits_input   : in std_logic;
  three_bits_input : in std_logic_vector(2 downto 0);
  four_bits_output : out std_logic_vector(3 downto 0)
);
end entity;

architecture behav of globally_static_test is
begin

submodule_inst : entity work.submodule
port map(
   four_bits_input  => one_bits_input & three_bits_input  -- Modelsim Error is here.
  ,four_bits_output => four_bits_output
);

end architecture;
Run Code Online (Sandbox Code Playgroud)

Modelsim 错误是众所周知的:

(vcom-1436) 形式“four_bits_input”的实际表达式(中缀表达式)不是全局静态的。

我在不同的公司和几个项目中经常在包装器中看到这种类型的影响。

我的问题是:“谁才是真正正确的?Modelsim 或 Quartus”。

编辑 :

我首先用以下版本进行了测试

  • Modelsim v10.5b 英特尔 FPGA 入门版 - VHDL 2002
  • Quartus Prime 17.1 - VHDL 1993

然后我将 Modelsim 编译选项更改为使用 VHDL 2008,错误就消失了。

小智 0

您不应该在端口段中使用串联形式,因此请定义一个信号,并为其提供串联形式。