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

时间:2017-06-15 07:31:24

标签: casting system-verilog

我有以下内容:

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

我收到以下错误:  非法引用net&#34; tb_real&#34;。 如何将int unsigned转换为数组逻辑?

1 个答案:

答案 0 :(得分:3)

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

我说“可能”因为你没有给MCVE

相关问题