Vhdl 如何将阵列信号路由到输入端

Vhdl 如何将阵列信号路由到输入端,vhdl,Vhdl,我有一个顶级VHDL模块,其中包含一个我声明为无符号数字数组的信号。我在这个顶级模块中有一个实例化的组件,我想将顶级模块中的数组路由到此组件。作出同样的声明 type array_type is array(5 downto 0) of unsigned (15 downto 0); 在这个组件中,它似乎不起作用。我已经知道如何将输入连接到包含数组的输出,但我不确定如何将信号连接到输入/输出 顶层模块示例 library IEEE; use IEEE.STD_LOGIC_1164.ALL; u

我有一个顶级VHDL模块,其中包含一个我声明为无符号数字数组的信号。我在这个顶级模块中有一个实例化的组件,我想将顶级模块中的数组路由到此组件。作出同样的声明

type array_type is array(5 downto 0) of unsigned (15 downto 0);
在这个组件中,它似乎不起作用。我已经知道如何将输入连接到包含数组的输出,但我不确定如何将信号连接到输入/输出

顶层模块示例

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;

entity top_level is
end top_level;

architecture str_arch of top_level is
   type array_type is array (5 downto 0) of unsigned (15 downto 0);
   signal example_array: array_type;
begin
instantiated_component: entity work.component(Behavioral)
   port map(array=>example_array);
end str_arch;
1) 在某处声明:

type array_type is array(5 downto 0) of unsigned (15 downto 0);
在另一个地方:

type array_type is array(5 downto 0) of unsigned (15 downto 0);
声明两种不同的类型!即使它们具有相同的名称(它们将具有完整的扩展名:某处.array\u类型和另一个.array\u类型)

2) VHDL是一种强类型语言,即使您声明的两种不同的“类型”具有相同的定义,您也不能将它们分配给另一种

一个简单的解决方案是使用相同类型的(来自软件包):

在子模块和to级别模块中:

use work.pkg.all; --if pkg is in the same library

IEEE Std 1076-2008 6.2类型声明,第3段:“通过细化不同类型定义创建的类型是不同类型……”。存在足够的信息来确定实际的
示例\u数组
具有一个独特的类型定义,该定义对于
组件
的实体声明不可用。由于sligor应答,共享声明被放置在包中,并通过use子句使其可见。
use work.pkg.all; --if pkg is in the same library