【问题标题】:Configuration from Multiple Architecture多架构配置
【发布时间】: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


    【解决方案1】:

    我发现不可能从单个实体的多个架构中实例化。可以使用第二种架构的另一个实体来代替。

    【讨论】:

    • 如果我为 INA4 提供默认值,它的工作原理就是如此。但这不是我在问题中所问的。它仍然只是使用最后分析的架构。我的问题是使用来自同一实体的两种不同架构作为不同的组件。在我的 AND_gate 实体中,有一个名为 and_3 的 3 输入和门,它不是最后一次分析的。它仍然不会用作该解决方案中的组件。
    • 我不是在谈论向架构添加默认值。正如您之前建议的那样,我正在谈论为实例化添加默认值。
    • 查看来自 Dropbox 的 structural_modelling.vhdl。您的 Structure 架构是否已修改为可以工作,并且架构 entity_instantiation 也可以正常工作并且符合 Xilinx 综合条件。这是为 AND_gate 的组件声明或实体声明添加默认值。
    猜你喜欢
    • 2017-01-06
    • 2023-04-06
    • 1970-01-01
    • 2022-01-02
    • 2013-03-31
    • 1970-01-01
    • 1970-01-01
    • 2020-06-03
    • 2017-08-10
    相关资源
    最近更新 更多