From 841001b3747e41ba4553d062319de867a9639a9b Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Tue, 12 May 2020 08:30:21 +0200 Subject: testsuite/gna: add a test for #1300 --- testsuite/gna/issue1300/testsuite.sh | 6 ++++++ testsuite/gna/issue1300/wishbone_types_err2.vhdl | 20 ++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 testsuite/gna/issue1300/wishbone_types_err2.vhdl (limited to 'testsuite') diff --git a/testsuite/gna/issue1300/testsuite.sh b/testsuite/gna/issue1300/testsuite.sh index ec021a312..b5b72bdd9 100755 --- a/testsuite/gna/issue1300/testsuite.sh +++ b/testsuite/gna/issue1300/testsuite.sh @@ -3,9 +3,15 @@ . ../../testenv.sh export GHDL_STD_FLAGS=--std=08 + analyze wishbone_types.vhdl icache.vhdl elab_simulate icache clean +analyze wishbone_types_err2.vhdl icache.vhdl +elab_simulate icache + +clean + echo "Test successful" diff --git a/testsuite/gna/issue1300/wishbone_types_err2.vhdl b/testsuite/gna/issue1300/wishbone_types_err2.vhdl new file mode 100644 index 000000000..3111ab266 --- /dev/null +++ b/testsuite/gna/issue1300/wishbone_types_err2.vhdl @@ -0,0 +1,20 @@ +package wishbone_types is + type wb_slave_out_t is record + dat : bit_vector; + ack : bit; + stall : bit; + end record; + + -- Common subtypes + constant wb_cpu_data_bits : integer := 64; + subtype wb_cpu_in_t is wb_slave_out_t(dat(wb_cpu_data_bits-1 downto 0)); + + -- GHDL: Works +-- subtype wishbone_slave_out is wb_slave_out_t(dat(wb_cpu_data_bits-1 downto 0)); + + -- GHDL: Breaks + subtype wishbone_slave_out is wb_cpu_in_t; + + type wishbone_slave_out_vector is + array (natural range <>) of wb_cpu_in_t; +end package wishbone_types; -- cgit v1.2.3