systemVerilog - 如何将 int unsigned 转换为数组逻辑?

systemVerilog - How can I convert int unsigned to array logic?

我有以下内容:

logic [15:0] tb_real_din, tb_image_din;
int unsigned counter;

   //write proc
   initial begin
      tb_last_dvalid = 1'b0;
      tb_we = 1'b0;
      #80ns;
      for (int i = 0 ; i <= 32; i++)
    begin
       counter = counter+1;
       tb_real = counter;
       tb_image = counter;
       if (i == 32)        
         tb_last_dvalid = 1'b1;
       #8ns;
       tb_we = 1'b1;
       #8ns;
       tb_we = 1'b0;
       tb_last_dvalid = 1'b0;      
    end     
   end // initial begin

我收到以下错误: 非法引用网络 "tb_real"。 如何将 int unsigned 转换为数组逻辑?

您的问题与类型之间的转换无关。你的问题可能是因为你没有声明tb_real。 System-verilog 中未声明的任何内容默认为 1 位 wirewire 是一种 net,从 initialalwaysfinal 块分配给网络是非法的。因此,您的错误消息。

我说"probably"是因为你还没有给出MCVE