diff --git a/src/lower.c b/src/lower.c index 591fcf8bc..9c1798038 100644 --- a/src/lower.c +++ b/src/lower.c @@ -6048,10 +6048,6 @@ static void lower_signal_assign_target(lower_unit_t *lu, target_part_t **ptr, lower_check_scalar_bounds(lu, src_reg, type, where, p->target); if (!type_is_homogeneous(type)) { - // XXX: debug for issue #972 - if (type_is_generic(type)) - fatal_at(tree_loc(where), "generic type was not rewritten"); - vcode_reg_t args[2] = { reject, after }; vcode_reg_t locus = lower_debug_locus(where); lower_for_each_field_2(lu, type, src_type, p->reg, src_reg, locus, diff --git a/src/rt/wave.c b/src/rt/wave.c index 76a818f81..f8eaf255f 100644 --- a/src/rt/wave.c +++ b/src/rt/wave.c @@ -521,7 +521,8 @@ static void fst_get_array_range(wave_dumper_t *wd, type_t type, } } - ffi_dim_t *dims = fst_get_ptr(wd, scope, where) + 2*sizeof(int64_t); + const ptrdiff_t slots = type_is_homogeneous(type) ? 2 : 1; + ffi_dim_t *dims = fst_get_ptr(wd, scope, where) + slots * sizeof(int64_t); *left = dims[dim].left; *right = ffi_array_right(dims[dim].left, dims[dim].length); @@ -758,11 +759,6 @@ static void fst_create_record_array_var(wave_dumper_t *wd, tree_t d, type_t elem = type_elem(type); const bool nested = type_is_array(elem); - // XXX: debug for #972 - if (count % length != 0) - warn_at(tree_loc(d), "record array has unexpected count=%d " - "length=%"PRIi64, count, length); - assert(count % length == 0); const int stride = count / length; diff --git a/test/regress/gold/issue972.dump b/test/regress/gold/issue972.dump new file mode 100644 index 000000000..d288d8f19 --- /dev/null +++ b/test/regress/gold/issue972.dump @@ -0,0 +1,16 @@ +#0 issue972.b.o[0].f 00000000000000000000000000000000 +#0 issue972.b.o[1].f 00000000000000000000000000000000 +#0 issue972.b.i[0].f 00000000000000000000000000000000 +#0 issue972.b.i[1].f 00000000000000000000000000000000 +#0 issue972.y[0].f 00000000000000000000000000000000 +#0 issue972.y[1].f 00000000000000000000000000000000 +#0 issue972.x[0].f 00000000000000000000000000000000 +#0 issue972.x[1].f 00000000000000000000000000000000 +#1000000 issue972.x[1].f 00000000000000000000000000000001 +#1000000 issue972.b.i[1].f 00000000000000000000000000000001 +#2000000 issue972.b.i[1].f 00000000000000000000000000000010 +#2000000 issue972.x[1].f 00000000000000000000000000000010 +#2000000 issue972.y[1].f 00000000000000000000000000000001 +#2000000 issue972.b.o[1].f 00000000000000000000000000000001 +#3000000 issue972.b.o[1].f 00000000000000000000000000000010 +#3000000 issue972.y[1].f 00000000000000000000000000000010 diff --git a/test/regress/issue972.vhd b/test/regress/issue972.vhd new file mode 100644 index 000000000..6094ec6e7 --- /dev/null +++ b/test/regress/issue972.vhd @@ -0,0 +1,29 @@ +entity issue972 is +end entity; + +architecture a of issue972 is + type t_rec is record + f : natural; + end record; + + type t_array is array (natural range <>) of t_rec; + + subtype t_ports is natural range 0 to 1; + + signal x, y : t_array(t_ports'high downto 0); + +begin + + x <= (0 => (f => 0), 1 => (f => 1)) after 1 ns, + (0 => (f => 0), 1 => (f => 2)) after 2 ns; + + b: block is + generic ( type t ); + generic map ( t => t_array ); + port ( i : in t; o : out t ); + port map ( x, y ); + begin + o <= i after 1 ns; + end block; + +end architecture; diff --git a/test/regress/testlist.txt b/test/regress/testlist.txt index e2bd140bd..b2c3befdc 100644 --- a/test/regress/testlist.txt +++ b/test/regress/testlist.txt @@ -1048,3 +1048,4 @@ issue978 normal,vhpi issue985 wave,2008,dump-arrays issue970 normal,gold,2019 issue983 normal,relaxed +issue972 wave,2008,dump-arrays