VHDL配置找不到组件
下面的代码工作不正常。我不断发现以下错误:VHDL配置找不到组件,vhdl,Vhdl,下面的代码工作不正常。我不断发现以下错误: **错误:HA\u Config.vhd(38):未找到组件实例“HA\u Inst:HA\u Comp”。 **错误:HA_Config.vhd(40):VHDL编译器正在退出 library ieee; use ieee.std_logic_1164.all; entity HA_Entity is port ( i_bit1 : in std_logic; i_bit2 : in std_logic; --
**错误:HA\u Config.vhd(38):未找到组件实例“HA\u Inst:HA\u Comp”。
**错误:HA_Config.vhd(40):VHDL编译器正在退出
library ieee;
use ieee.std_logic_1164.all;
entity HA_Entity is
port (
i_bit1 : in std_logic;
i_bit2 : in std_logic;
--
o_sum : out std_logic;
o_carry : out std_logic
);
end HA_Entity;
architecture HA_Arch of HA_Entity is
component HA_Comp is
port (
i_bit1 : in std_logic;
i_bit2 : in std_logic;
--
o_sum : out std_logic;
o_carry : out std_logic
);
end component HA_Comp;
begin
o_sum <= i_bit1 xor i_bit2;
o_carry <= i_bit1 and i_bit2;
end HA_Arch;
configuration HA_Config of HA_Entity is
for HA_Arch
for HA_Inst : HA_Comp
use entity HA_Entity(HA_Arch);
end for;
end for;
end HA_Config;
ieee库;
使用ieee.std_logic_1164.all;
实体HA_实体是
港口(
i_比特1:标准逻辑中;
i_比特2:标准逻辑中;
--
o_sum:输出标准逻辑;
o_执行:执行标准逻辑
);
结束哈乌实体;
HA_实体的架构HA_Arch是
组件HA_Comp是
港口(
i_比特1:标准逻辑中;
i_比特2:标准逻辑中;
--
o_sum:输出标准逻辑;
o_执行:执行标准逻辑
);
终端组件HA_Comp;
开始
o_sum配置将组件实例绑定到特定实体并
建筑学配置中的绑定部分是:
for HA_Inst : HA_Comp
use entity HA_Entity(HA_Arch);
end for;
但是没有组件HA_Comp
的名为HA_Inst
的组件实例,
仅是HA_Arch
的架构部分中声明的组件HA_Comp
,因此
错误:
未找到组件实例“HA_Inst:HA_Comp”
HA_Comp
实际上没有在任何地方使用,因此可以将其删除。还有,
看起来像循环引用,因为HA_实体
指定在内部使用
本身带有配置。。。哈乌实体。。。使用实体HA\u实体…
如果目的是允许不同的实现HA_Arch
,那么
可能看起来像:
library ieee;
use ieee.std_logic_1164.all;
entity HA_Entity is
port (
i_bit1 : in std_logic;
i_bit2 : in std_logic;
--
o_sum : out std_logic;
o_carry : out std_logic
);
end HA_Entity;
architecture HA_Arch of HA_Entity is
component HA_Comp is
port (
i_bit1 : in std_logic;
i_bit2 : in std_logic;
--
o_sum : out std_logic;
o_carry : out std_logic
);
end component HA_Comp;
begin
HA_Inst : component HA_Comp
port map(
i_bit1 => i_bit1,
i_bit2 => i_bit2,
o_sum => o_sum,
o_carry => o_carry);
end HA_Arch;
library ieee;
use ieee.std_logic_1164.all;
entity HA_Comp_Entity is
port (
i_bit1 : in std_logic;
i_bit2 : in std_logic;
--
o_sum : out std_logic;
o_carry : out std_logic
);
end HA_Comp_Entity;
architecture HA_Comp_Arch_1 of HA_Comp_Entity is
begin
o_sum <= i_bit1 xor i_bit2;
o_carry <= i_bit1 and i_bit2;
end HA_Comp_Arch_1;
use work.all;
configuration HA_Config of HA_Entity is
for HA_Arch
for HA_Inst : HA_Comp
use entity HA_Comp_Entity(HA_Comp_Arch_1);
end for;
end for;
end HA_Config;
ieee库;
使用ieee.std_logic_1164.all;
实体HA_实体是
港口(
i_比特1:标准逻辑中;
i_比特2:标准逻辑中;
--
o_sum:输出标准逻辑;
o_执行:执行标准逻辑
);
结束哈乌实体;
HA_实体的架构HA_Arch是
组件HA_Comp是
港口(
i_比特1:标准逻辑中;
i_比特2:标准逻辑中;
--
o_sum:输出标准逻辑;
o_执行:执行标准逻辑
);
终端组件HA_Comp;
开始
HA_Inst:组件HA_Comp
港口地图(
i_比特1=>i_比特1,
i_比特2=>i_比特2,
o_sum=>o_sum,
o_进位=>o_进位);
哈乌拱门尽头;
图书馆ieee;
使用ieee.std_logic_1164.all;
实体HA_Comp_实体为
港口(
i_比特1:标准逻辑中;
i_比特2:标准逻辑中;
--
o_sum:输出标准逻辑;
o_执行:执行标准逻辑
);
结束公司实体;
HA_Comp_实体的架构HA_Comp_Arch_1为
开始
o_sum“HA_Comp实际上没有在任何地方使用,所以可以删除。”我尝试删除它,但我在这行中添加了什么:对于HA_Inst:HA_Comp
?如果没有使用HA_Comp
,则不需要进行任何将其绑定到实体和体系结构的配置,因此整个HA_Inst的。。。
的末端为打捆针。然而,这可能不是意图,所以首先考虑为什么<代码> HaaCOMP P/CODE >,并更新设计来使用它。提供的示例代码可能是一个有用的模板。