首页 > 解决方案 > vhdl 中没有实际的常量接口

问题描述

我有以下实体,核心,包含我的组件之一,生成器。我向生成器传递了一个信号,该信号由核心的通用 m_r 和核心的信号开始之和组成。

然而,在尝试编译它时,我得到了 error: no actual for constant interface "m_r"指向该行的错误generator_imp : generator。我认为这与由 m_r 组成的 start_generator 有关,但是即使在谷歌上搜索了几个小时后,我仍然能够找到与这个特定问题相关的很少。有没有人遇到过这样的事情?

文件错误源于:


library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use work.my_components.all;

entity core is
  generic (
    m_r : unsigned(31 downto 0)  := x"00000001";
    step  : unsigned(31 downto 0)
  );
  port (
    clk              : in std_logic;
    reset            : in std_logic;
    start            : in unsigned(31 downto 0);
    f                : out std_logic
  );
end core;

architecture arch of core is

  signal start_generator       : unsigned(31 downto 0) := x"00000000";
  signal n                     : std_logic;

begin

  start_generator <= m_r + start;

generator_imp : generator
  generic map(
    step  => step
  )
  port map(
    clk               => clk,
    start             => start_generator,
    reset_in          => reset,
    padded_message    => padded_chunk,
    n                 => n
  );

end arch;


my_components 包:

library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;

package my_components is


    component generator is
        generic (
          step  : unsigned(31 downto 0)
        );
        port (
          clk                 : in    std_logic;
          start               : in    unsigned(31 downto 0);
          reset_in            : in    std_logic;
          padded_message      : out   std_logic_vector(511 downto 0);
          n                   : out   unsigned(31 downto 0)
        );
    end component;
end package my_components;

此外,实体核心是使用 for generate 循环在另一个组件“all”中生成的,如下所述。它也是 my_components 包的一部分,但为了保持此代码的可监督性,我在彻底检查组件中的所有端口名称是否与实体匹配后将其删除。for-generate 循环的工作原理如下:

library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use work.my_components.all;

entity all is
  port (
    clk : in std_logic
  );
end all;

architecture Behavioral of all is

  constant count : integer := 5;
  type f_array is array (0 to count -1) of std_logic;
  signal f_signals : found_array;

  signal reset         : std_logic := '0';

  signal start         : unsigned(31 downto 0) := x"11111111";
begin

  generate_cores : for I in 1 to mining_core_count - 1 generate
    core_imp: core
      generic map(
        m_r => to_unsigned(I,32),
        step  => to_unsigned(count, 32)
      )
      port map(
        clk           => clk,
        reset         => reset,
        start         => start,
        f             => f_signals(I)
      );
  end generate;

  core_zero : core
  generic map(
    m_r => x"00000000",
    step  => to_unsigned(count, 32)
  )
  port map(
    clk           => clk,
    reset         => reset,
    start         => start,
    f             => f_signals(0)
  );

end Behavioral;


标签: vhdl

解决方案


这可能是因为信号'start_generator'是并发部分的算术运算吗?这可能导致该信号被视为非恒定或稳定的输入端口。只是想大声..


推荐阅读