0

I have the following :

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

I got the following error: Illegal reference to net "tb_real". How can I convert int unsigned to array logic?

1 Answer 1

2

Your problem is nothing to do with converting between types. Your problem is probably because you have not declared tb_real. Anything undeclared in System-verilog defaults to being a 1-bit wire; a wire is a kind of net and it is illegal to assign to nets from initial, always or final blocks. Hence, your error message.

I say "probably" because you have not give an MCVE.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.