首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >组件实例化错误

组件实例化错误
EN

Stack Overflow用户
提问于 2017-06-29 12:56:30
回答 1查看 1.1K关注 0票数 2

对于以下VHDL代码:

代码语言:javascript
复制
library ieee;
use ieee.std_logic_1164.all;
entity dff is
  port(
      d, clk: in std_logic;
      q: out std_logic);
end dff;
architecture behave of dff is
  begin
    process(clk)
      begin
      if(clk = '1') then
        q<= d;
    end if;
  end process;
end behave; 

还有一个替罪羊:

代码语言:javascript
复制
library ieee;
use ieee.std_logic_1164.all;
entity dff is
end dff;
architecture behave of dff is
  component dff is
port(d, clk: in std_logic;
     q: out std_logic);


 end component;


    signal  d_in: std_logic;
    signal  clk_in: std_logic;
    signal  q_out: std_logic;

begin
  d_ff : dff port map( d_in, clk_in, q_out);
  process
    begin
      if(clk_in = '1') then
      q_out<= d_in;
      end if;
  end process;
end behave;  

当试图模拟Modelsim时,会显示以下错误:

#错误加载设计 以下组件端口不在实体上: 再产出Q C/C/C .=‘3’>再

EN

回答 1

Stack Overflow用户

发布于 2017-06-29 13:00:32

您的testbench的实体名也是dff。你需要给它取一个不同的名字(如dff_tb)。因此,在编译testbench时,它将覆盖另一个dff实体。

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44825766

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档