【发布时间】:2022-01-16 07:54:34
【问题描述】:
我正在尝试学习结构建模。所以在我的库代码中,我只有具有 2 个架构的“AND_gate”实体。 and_3 是我的第一个 3 输入架构,and_4 是我的第二个 4 输入架构。 我正在尝试将它们用作组件,但配置有问题。
and_4 是最后分析的,所以 AND1 和 AND2 可以正常工作,因为它们使用的是 and_4。
所以我的问题是当我尝试绘制 RTL Schematic 时,我的项目没有使用 AND3 和 AND4。我需要为他们配置 and_3 架构。
...
architecture Structure of Structural_Modelling is
component AND_gate is
Port ( INA1 : in STD_LOGIC;
INA2 : in STD_LOGIC;
INA3 : in STD_LOGIC;
INA4 : in STD_LOGIC;
OA : out STD_LOGIC);
end component;
for AND3 : AND_gate use entity work.AND_gate(and_3);
for AND4 : AND_gate use entity work.AND_gate(and_3);
signal wire1, wire2, wire3, wire4 : STD_LOGIC;
begin
AND1 : AND_gate port map (nx,y,t,nw,wire1);
AND2 : AND_gate port map (x,y,nt,nw,wire2);
AND3 : AND_gate port map (y,z,w,wire3);
AND4 : AND_gate port map (ny,nz,nw,wire4);
end Structure;
这是我的组件库的 VHDL 代码:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity AND_gate is
Port ( INA1 : in STD_LOGIC;
INA2 : in STD_LOGIC;
INA3 : in STD_LOGIC;
INA4 : in STD_LOGIC;
OA : out STD_LOGIC);
end AND_gate;
architecture and_3 of AND_gate is
begin
OA <= INA1 and INA2 and INA3 ; -- 3 input AND gate
end and_3;
architecture and_4 of AND_gate is
begin
OA <= INA1 and INA2 and INA3 and INA4 ; -- 4 input AND gate
end and_4;
【问题讨论】:
标签: configuration architecture logic vhdl