【发布时间】:2018-04-25 07:50:08
【问题描述】:
我正在尝试通过 VHDL-2008 分层名称访问数组。我可以访问整个数组,但是当我尝试访问单个数组元素时,出现编译错误:
ACOM: Error: COMP96_0015: tb.vhd : (13, 43): ':' expected.
是否可以访问单个数组元素?正确的语法是什么?
这是我的代码:
待测物
library ieee;
use ieee.std_logic_1164.all;
entity dut is
end entity dut;
architecture rtl of dut is
type t_data is array (natural range <>) of std_logic_vector(7 downto 0);
signal s_data : t_data(0 to 15) := (others=>(others=>'1'));
begin
--don't care
end architecture rtl;
TB
library ieee;
use ieee.std_logic_1164.all;
entity tb is
end entity tb;
architecture sim of tb is
signal s_data_0 : std_logic_vector(7 downto 0);
begin
s_data_0 <= << signal i_dut.s_data(0) : std_logic_vector(7 downto 0) >>;
i_dut : entity work.dut;
end architecture sim;
【问题讨论】:
标签: vhdl