diff options
-rw-r--r-- | ghw/ghwlib.c | 15 | ||||
-rw-r--r-- | testsuite/gna/issue668/golden_repro2.txt | 118 | ||||
-rw-r--r-- | testsuite/gna/issue668/golden_wb_demux_tb.txt | 119 | ||||
-rwxr-xr-x | testsuite/gna/issue668/testsuite.sh | 16 |
4 files changed, 260 insertions, 8 deletions
diff --git a/ghw/ghwlib.c b/ghw/ghwlib.c index 0d320ff07..cb90fbcdf 100644 --- a/ghw/ghwlib.c +++ b/ghw/ghwlib.c @@ -863,6 +863,19 @@ ghw_read_type (struct ghw_handler *h) sr->nbr_scalars); } break; + case ghdl_rtik_subtype_unbounded_record: + { + struct ghw_subtype_unbounded_record *sur; + + sur = malloc (sizeof (struct ghw_subtype_unbounded_record)); + sur->kind = t; + sur->name = ghw_read_strid (h); + sur->base = (struct ghw_type_record *) ghw_read_typeid (h); + h->types[i] = (union ghw_type *) sur; + if (h->flag_verbose > 1) + printf ("subtype unbounded record: %s\n", sur->name); + } + break; default: fprintf (stderr, "ghw_read_type: unknown type %d\n", t); return -1; @@ -2092,6 +2105,7 @@ ghw_disp_subtype_definition (struct ghw_handler *h, union ghw_type *t) ghw_disp_record_subtype_bounds (sr); } break; case ghdl_rtik_subtype_unbounded_array: + case ghdl_rtik_subtype_unbounded_record: { struct ghw_subtype_unbounded_record *sur = &t->sur; @@ -2203,6 +2217,7 @@ ghw_disp_type (struct ghw_handler *h, union ghw_type *t) case ghdl_rtik_subtype_scalar: case ghdl_rtik_subtype_record: case ghdl_rtik_subtype_unbounded_array: + case ghdl_rtik_subtype_unbounded_record: { struct ghw_type_common *c = &t->common; printf ("subtype %s is ", c->name); diff --git a/testsuite/gna/issue668/golden_repro2.txt b/testsuite/gna/issue668/golden_repro2.txt new file mode 100644 index 000000000..bea1d0975 --- /dev/null +++ b/testsuite/gna/issue668/golden_repro2.txt @@ -0,0 +1,118 @@ +type std_ulogic is ('U', 'X', '0', '1', 'Z', 'W', 'L', 'H', '-'); -- WKT:3 +type integer is range <>; +subtype natural is integer range 0 to 2147483647; +type std_ulogic_vector is array (natural range <>) of std_ulogic; +subtype my_vector is std_ulogic_vector; +type t_wishbone_master_out is record + dat: my_vector; +end record; +subtype t_wishbone_slave_in is t_wishbone_master_out; +design + package standard: + package textio: + package std_logic_1164: + package wishbone_pkg2: + instance repro2: + signal wbs_s: t_wishbone_master_out(dat (31 downto 0)): #1-#32 + process stimulus: + block dut: + port-in wbs_i: t_wishbone_master_out(dat (31 downto 0)): #1-#32 +Time is 0 fs +#1: 'U' (0) +#2: 'U' (0) +#3: 'U' (0) +#4: 'U' (0) +#5: 'U' (0) +#6: 'U' (0) +#7: 'U' (0) +#8: 'U' (0) +#9: 'U' (0) +#10: 'U' (0) +#11: 'U' (0) +#12: 'U' (0) +#13: 'U' (0) +#14: 'U' (0) +#15: 'U' (0) +#16: 'U' (0) +#17: 'U' (0) +#18: 'U' (0) +#19: 'U' (0) +#20: 'U' (0) +#21: 'U' (0) +#22: 'U' (0) +#23: 'U' (0) +#24: 'U' (0) +#25: 'U' (0) +#26: 'U' (0) +#27: 'U' (0) +#28: 'U' (0) +#29: 'U' (0) +#30: 'U' (0) +#31: 'U' (0) +#32: 'U' (0) +Time is 0 fs +#1: '1' (3) +#2: '1' (3) +#3: '0' (2) +#4: '1' (3) +#5: '1' (3) +#6: '1' (3) +#7: '1' (3) +#8: '0' (2) +#9: '1' (3) +#10: '0' (2) +#11: '1' (3) +#12: '0' (2) +#13: '1' (3) +#14: '1' (3) +#15: '0' (2) +#16: '1' (3) +#17: '1' (3) +#18: '0' (2) +#19: '1' (3) +#20: '1' (3) +#21: '1' (3) +#22: '1' (3) +#23: '1' (3) +#24: '0' (2) +#25: '1' (3) +#26: '1' (3) +#27: '1' (3) +#28: '0' (2) +#29: '1' (3) +#30: '1' (3) +#31: '1' (3) +#32: '1' (3) +Time is 100000000 fs +#1: '1' (3) +#2: '1' (3) +#3: '0' (2) +#4: '1' (3) +#5: '1' (3) +#6: '1' (3) +#7: '1' (3) +#8: '0' (2) +#9: '1' (3) +#10: '0' (2) +#11: '1' (3) +#12: '0' (2) +#13: '1' (3) +#14: '1' (3) +#15: '0' (2) +#16: '1' (3) +#17: '1' (3) +#18: '0' (2) +#19: '1' (3) +#20: '1' (3) +#21: '1' (3) +#22: '1' (3) +#23: '1' (3) +#24: '0' (2) +#25: '1' (3) +#26: '1' (3) +#27: '1' (3) +#28: '0' (2) +#29: '1' (3) +#30: '1' (3) +#31: '1' (3) +#32: '1' (3) diff --git a/testsuite/gna/issue668/golden_wb_demux_tb.txt b/testsuite/gna/issue668/golden_wb_demux_tb.txt index e69de29bb..c0bf55311 100644 --- a/testsuite/gna/issue668/golden_wb_demux_tb.txt +++ b/testsuite/gna/issue668/golden_wb_demux_tb.txt @@ -0,0 +1,119 @@ +type std_ulogic is ('U', 'X', '0', '1', 'Z', 'W', 'L', 'H', '-'); -- WKT:3 +type integer is range <>; +subtype natural is integer range 0 to 2147483647; +type std_ulogic_vector is array (natural range <>) of std_ulogic; +subtype std_logic_vector is std_ulogic_vector; +type t_wishbone_master_out is record + dat: std_logic_vector; +end record; +subtype t_wishbone_slave_in is t_wishbone_master_out; +design + package standard: + package textio: + package std_logic_1164: + package numeric_std: + package wishbone_pkg: + instance wb_demux_tb: + signal wbs_i: t_wishbone_master_out(dat (31 downto 0)): #1-#32 + process stimulus: + instance dut: + port-in wbs_i: t_wishbone_master_out(dat (31 downto 0)): #1-#32 +Time is 0 fs +#1: 'U' (0) +#2: 'U' (0) +#3: 'U' (0) +#4: 'U' (0) +#5: 'U' (0) +#6: 'U' (0) +#7: 'U' (0) +#8: 'U' (0) +#9: 'U' (0) +#10: 'U' (0) +#11: 'U' (0) +#12: 'U' (0) +#13: 'U' (0) +#14: 'U' (0) +#15: 'U' (0) +#16: 'U' (0) +#17: 'U' (0) +#18: 'U' (0) +#19: 'U' (0) +#20: 'U' (0) +#21: 'U' (0) +#22: 'U' (0) +#23: 'U' (0) +#24: 'U' (0) +#25: 'U' (0) +#26: 'U' (0) +#27: 'U' (0) +#28: 'U' (0) +#29: 'U' (0) +#30: 'U' (0) +#31: 'U' (0) +#32: 'U' (0) +Time is 0 fs +#1: '1' (3) +#2: '1' (3) +#3: '0' (2) +#4: '1' (3) +#5: '1' (3) +#6: '1' (3) +#7: '1' (3) +#8: '0' (2) +#9: '1' (3) +#10: '0' (2) +#11: '1' (3) +#12: '0' (2) +#13: '1' (3) +#14: '1' (3) +#15: '0' (2) +#16: '1' (3) +#17: '1' (3) +#18: '0' (2) +#19: '1' (3) +#20: '1' (3) +#21: '1' (3) +#22: '1' (3) +#23: '1' (3) +#24: '0' (2) +#25: '1' (3) +#26: '1' (3) +#27: '1' (3) +#28: '0' (2) +#29: '1' (3) +#30: '1' (3) +#31: '1' (3) +#32: '1' (3) +Time is 100000000 fs +#1: '1' (3) +#2: '1' (3) +#3: '0' (2) +#4: '1' (3) +#5: '1' (3) +#6: '1' (3) +#7: '1' (3) +#8: '0' (2) +#9: '1' (3) +#10: '0' (2) +#11: '1' (3) +#12: '0' (2) +#13: '1' (3) +#14: '1' (3) +#15: '0' (2) +#16: '1' (3) +#17: '1' (3) +#18: '0' (2) +#19: '1' (3) +#20: '1' (3) +#21: '1' (3) +#22: '1' (3) +#23: '1' (3) +#24: '0' (2) +#25: '1' (3) +#26: '1' (3) +#27: '1' (3) +#28: '0' (2) +#29: '1' (3) +#30: '1' (3) +#31: '1' (3) +#32: '1' (3) diff --git a/testsuite/gna/issue668/testsuite.sh b/testsuite/gna/issue668/testsuite.sh index 62af85327..07f3ca8d4 100755 --- a/testsuite/gna/issue668/testsuite.sh +++ b/testsuite/gna/issue668/testsuite.sh @@ -3,15 +3,15 @@ . ../../testenv.sh export GHDL_STD_FLAGS=--std=08 -for item in wb_demux_tb repro2; do - analyze "$item".vhdl - elab "$item" +for f in wb_demux_tb repro2; do + analyze "$f".vhdl + elab "$f" - if ghdl_has_feature "$item" ghw; then - elab_simulate "$item" --dump-rti - elab_simulate "$item" --wave="$item".ghw - ghw_diff "$item" - rm -f "$item".txt "$item".ghw + if ghdl_has_feature "$f" ghw; then + elab_simulate "$f" --dump-rti + elab_simulate "$f" --wave="$f".ghw + ghw_diff "$f" + rm -f "$f".txt "$f".ghw fi done |