vhdl - 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;
解决方案
来自另一个模拟器的错误消息解释了该问题:
** 错误:external_index.vhd(23): (vcom-1307) 外部名称必须表示整个对象,而不是对象的切片或索引名称。
推荐阅读
- arrays - MongoDB。用于索引和查询具有数组字段的文档的文本索引
- html - 如何在网站中创建教程叠加功能?
- ios - Xamarin Forms IOS - 缺少推送通知权利
- http - “Cookie:foo=bar”是什么意思?
- python - 难以理解 matplotlib 轴
- animation - 两个涉及缩放和平移的动画的 SVG 同步
- python - 将多个 pandas 数据框写入 excel
- ios - UIcollectionview 自定义单元类到 didselectitem 在
- php - 通过 PhP 生成图像
- wpf - 从 MultiBinding StringFormat 中删除空格