nickg / nvc

VHDL compiler and simulator
https://www.nickg.me.uk/nvc/
GNU General Public License v3.0
589 stars 75 forks source link

** Fatal: type kind T_ARRAY does not have item I_FIELDS #878

Closed augustofg closed 2 months ago

augustofg commented 2 months ago

NVC crashes when using the --dump-arrays flag. Sorry, I couldn't reduce to a simpler example (attached below):

$ ./run.sh
+ nvc --work=work --std=2008 -a --relaxed fofb_cc_version.vhd
+ nvc --work=work --std=2008 -a --relaxed fofb_cc_pkg.vhd
+ nvc --work=work --std=2008 -a --relaxed wb_skidpad.vhd
+ nvc --work=work --std=2008 -a --relaxed wishbone_pkg.vhd
+ nvc --work=work --std=2008 -a --relaxed wb_slave_adapter.vhd
+ nvc --work=work --std=2008 -a --relaxed xwb_register_link.vhd
+ nvc --work=work --std=2008 -a --relaxed ifc_common_pkg.vhd
+ nvc --work=work --std=2008 -a --relaxed biquad.vhd
+ nvc --work=work --std=2008 -a --relaxed iir_filt.vhd
+ nvc --work=work --std=2008 -a --relaxed dot_prod_pkg.vhd
+ nvc --work=work --std=2008 -a --relaxed fofb_sys_id_pkg.vhd
+ nvc --work=work --std=2008 -a --relaxed fofb_ctrl_pkg.vhd
+ nvc --work=work --std=2008 -a --relaxed wb_fofb_shaper_filt_regs.vhd
+ nvc --work=work --std=2008 -a --relaxed fofb_shaper_filt_pkg.vhd
+ nvc --work=work --std=2008 -a --relaxed xwb_fofb_shaper_filt.vhd
+ nvc --work=work --std=2008 -a --relaxed wb_fofb_shaper_filt_regs_consts_pkg.vhd
+ nvc --work=work --std=2008 -a --relaxed sim_wishbone.vhd
+ nvc --work=work --std=2008 -a --relaxed fofb_tb_pkg.vhd
+ nvc --work=work --std=2008 -a --relaxed xwb_fofb_shaper_filt_tb.vhd
+ nvc --std=2008 -e --no-collapse xwb_fofb_shaper_filt_tb
+ nvc -r --dump-arrays --exit-severity=error xwb_fofb_shaper_filt_tb --wave=xwb_fofb_shaper_filt_tb.fst --format=fst
** Fatal: type kind T_ARRAY does not have item I_FIELDS
[0x555fdf47ede5] ../src/object.c:253 object_lookup_failed
[0x555fdf478536] ../src/type.c:437 type_fields.cold
[0x555fdf5579fb] ../src/rt/wave.c:666 fst_create_record_var
[0x555fdf557727] ../src/rt/wave.c:698 fst_process_signal
[0x555fdf558030] ../src/rt/wave.c:847 fst_walk_design.lto_priv.0
[0x555fdf557f7c] ../src/rt/wave.c:856 fst_walk_design.lto_priv.0
[0x555fdf49036d] ../src/rt/wave.c:882 wave_dumper_restart
[0x555fdf49036d] ../src/rt/wave.c:840 run_cmd
[0x555fdf48b385] ../src/nvc.c:1924 process_command
[0x555fdf485c98] ../src/nvc.c:2060 main

Please report this bug at https://github.com/nickg/nvc/issues

nvc-dump-record-arr-issue.zip

nickg commented 2 months ago

It happens when the signal type is an array of an array of records. Something like:

    type t_rec is record
        x, y : natural;
    end record;

    type t_rec_array is array (natural range <>) of t_rec;
    type t_rec_array_array is array (natural range <>) of t_rec_array;

    signal s : t_rec_array_array(1 to 3)(1 to 2);
augustofg commented 2 months ago

Thank you @nickg !