在VHDL中初始化记录数组

moh*_*hit 9 arrays records signals vhdl

我的记录定义如下

type ifx_t is
record
  data                        : std_logic_vector(127 downto 0);
  address                     : std_logic_vector (19 downto 0); 
  WrReq                       : std_logic;-- 
  RdReq                       : std_logic; --
end record;
type Array_ifx_t is array (0 to 2) of ifx_t;
Run Code Online (Sandbox Code Playgroud)

我必须初始化这个记录数组的实例,我尝试了以下方式,它不起作用

signal pair_in       : Array_ifx_t:= (others =>((others =>'0'),(others=>'0'),'0','0')); 
Run Code Online (Sandbox Code Playgroud)

请帮助.

Mor*_*mer 9

如评论中所述,ModelSim在使用ModelSim编译问题代码时起作用.但是,对于使用元素的类型值,其他工具可能更严格Array_ifx_t.

对于命名记录元素的类型赋值和使用,我认为它给出了getter概述并避免了位置引用的错误,你可以使用以下命令进行初始化:

constant IFX_T_0S : ifx_t := (data => (others =>'0'),
                              address => (others=>'0'),
                              WrReq => '0',
                              RdReq => '0');

signal pair_in : Array_ifx_t:= (others => IFX_T_0S);
Run Code Online (Sandbox Code Playgroud)