在另一个组件内调用组件;港口地图“;(非法声明)VHDL

在另一个组件内调用组件;港口地图“;(非法声明)VHDL,vhdl,fpga,hdl,modelsim,intel-fpga,Vhdl,Fpga,Hdl,Modelsim,Intel Fpga,在我的程序中,我面临着一个令人困惑的问题。我需要在程序中映射(调用)一个组件。此外,在组件内部,我需要进行另一个端口映射(调用),这在VHDL中是非法的。你有解决这个问题的替代方案吗。这是我的意思的一个例子 在这里我开始我的程序: library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity binary1 is port( N: in std_logic; d: out integer); end

在我的程序中,我面临着一个令人困惑的问题。我需要在程序中映射(调用)一个组件。此外,在组件内部,我需要进行另一个端口映射(调用),这在VHDL中是非法的。你有解决这个问题的替代方案吗。这是我的意思的一个例子

在这里我开始我的程序:

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

entity binary1 is
port( N: in std_logic;
  d: out integer);
end binary1 ;  


Architecture Behavior1 of binary1 is
下面是一个组件示例:

component binary_integer_1 is
port ( b1: in std_logic;
   int1: out integer);
end component;
用于调用组件的命令: 开始 s0:二进制_整数_1端口映射(n,d); 终端行为1

此外,以下是主要程序:

library ieee;
use ieee.std_logic_1164.all;
entity binary_integer_1 is
port ( b1: in std_logic;
int1: out integer);
end binary_integer_1;
architecture Behavior4 of binary_integer_1 is 
begin
process(b1)
begin
if b1 = '1' then
   int1 <= 1; 
   else
   int1 <= 0;
 end if;
 end process;
 end Behavior4;
ieee库;
使用ieee.std_logic_1164.all;
实体二进制_整数_1为
端口(b1:标准_逻辑中;
int1:输出整数);
结束二进制_整数_1;
二进制\整数\ 1的体系结构行为4为
开始
工艺(b1)
开始
如果b1='1',则

int1我做了一个三级设计层次结构的小例子。实体和体系结构对从下到上列出

entity comp1 is
    port (
        x:      in      integer;
        y:      out     integer 
    );
end entity;

architecture foo of comp1 is
begin
    y <= x after 2 ns;
end architecture;

entity comp2 is 
    port (
        a:      in  integer;
        b:      out integer
    );
end entity;

architecture fum of comp2 is
    component comp1 is
        port (
            x:      in      integer;
            y:      out     integer 
        );
    end component;

begin
INST_COMP1:
    comp1 port map (X => A, Y => B);
end architecture;

entity top is
end entity;

architecture fum of top is
     component comp2 is 
        port (
            a:      in  integer;
            b:      out integer
        );
    end component;

    signal a:   integer := 0;
    signal b:   integer;

begin
INST_COMP2:
    comp2 port map (a => a, b => b);

TEST:
    process 
    begin
        wait for 5 ns;
        a <= 1;
        wait for 5 ns;
        a <= 2;
        wait for 5 ns;
        a <= 3;
        wait for 5 ns;
        wait;
    end process;

end architecture;
实体comp1是
港口(
x:整数;
y:输出整数
);
终端实体;
comp1的体系结构foo是
开始
y A,y=>B);
终端架构;
实体顶部是
终端实体;
顶层的建筑风格是
组件comp2是
港口(
a:整数;
b:输出整数
);
端部元件;
信号a:整数:=0;
信号b:整数;
开始
仪表组件2:
comp2端口映射(a=>a,b=>b);
测试:
过程
开始
等待5ns;

a你的例子不清楚,你删掉的太多了。描述组件实例化的语言是非标准的。多一点代码会有帮助,任何实际的错误消息也会有帮助。“将一个设计实体连续分解为组件,并将这些组件绑定到可能以类似方式分解的其他设计实体,从而形成代表完整设计的设计实体层次结构。这种设计实体集合称为设计层次结构。”在LRM中,下一段你认为它是非法的(不是)。