cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ronagyl_adi
Observer
Observer
783 Views
Registered: ‎05-11-2018

2018.2 array of typedefs initialization

In Vivado 2017.4 and 2018.2,

the following code makes the simulator kernel to crash:

 

`timescale 1ns / 1ps
module test( );

  typedef struct {
    int value;
    string text;
  } tmp_t;

  const tmp_t c0 = '{1, "abcd"};
  const tmp_t c1 = '{2, "vf"};
  const tmp_t c2 = '{3, "gd"};

  tmp_t int_array[0:2] =  {c0, c1, c2};

  initial begin
    #2ns;
    $display("DBG: %s", int_array[0].text);
    $display("DBG: %s", int_array[1].text);
    $display("DBG: %s", int_array[2].text);
  end
endmodule

FATAL_ERROR: Vivado Simulator kernel has discovered an exceptional condition from which it cannot recover. Process will terminate.

 

In other simulators (e.g. Riviera PRO) works well.

Is this a coding error or a tool issue ?

 

Thanks,

Laszlo

 

0 Kudos
1 Reply
graces
Moderator
Moderator
756 Views
Registered: ‎07-16-2008

It looks to be a tool issue.

The following alternative assignment works fine in Vivado Simulator.

tmp_t int_array[0:2] = '{
'{1, "abcd"},
'{2, "vf"},
'{3, "gd"}
};

 

I'll file a CR to have dev team enhance the sv support.

-----------------------------------------------------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
If starting with Versal take a look at our Versal Design Process Hub and our Versal Blogs.
-----------------------------------------------------------------------------------------------------------------------
0 Kudos