首页 > 解决方案 > VHDL-2008 分层信号访问阵列

问题描述

我正在尝试通过 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;

结核病

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

解决方案


来自另一个模拟器的错误消息解释了该问题:

** 错误:external_index.vhd(23): (vcom-1307) 外部名称必须表示整个对象,而不是对象的切片或索引名称。


推荐阅读