diff options
Diffstat (limited to 'testsuite/gna/issue241')
-rw-r--r-- | testsuite/gna/issue241/arr.vhdl | 17 | ||||
-rw-r--r-- | testsuite/gna/issue241/rec.vhdl | 21 | ||||
-rw-r--r-- | testsuite/gna/issue241/test.vhdl | 64 | ||||
-rwxr-xr-x | testsuite/gna/issue241/testsuite.sh | 17 |
4 files changed, 119 insertions, 0 deletions
diff --git a/testsuite/gna/issue241/arr.vhdl b/testsuite/gna/issue241/arr.vhdl new file mode 100644 index 000000000..6d59a2871 --- /dev/null +++ b/testsuite/gna/issue241/arr.vhdl @@ -0,0 +1,17 @@ +entity arr is +end; + +architecture behav of arr is + type arr_type is array (natural range <>) of natural; + constant a : arr_type (2 downto 1) := (1 | 2 => 3); + constant b : boolean := a (1) = a (2); +begin + process + begin + case true is + when b => null; + when false => null; + end case; + wait; + end process; +end behav; diff --git a/testsuite/gna/issue241/rec.vhdl b/testsuite/gna/issue241/rec.vhdl new file mode 100644 index 000000000..372f74469 --- /dev/null +++ b/testsuite/gna/issue241/rec.vhdl @@ -0,0 +1,21 @@ +entity rec is +end; + +architecture behav of rec is + type rec_type is record + a, b : natural; + end record; + + constant r1 : rec_type := (a | b => 2); + constant b : boolean := r1.a = r1.b; +begin + process + variable a : integer := 5; + begin + case a = 5 is + when b => null; + when false => null; + end case; + wait; + end process; +end behav; diff --git a/testsuite/gna/issue241/test.vhdl b/testsuite/gna/issue241/test.vhdl new file mode 100644 index 000000000..41c430e8c --- /dev/null +++ b/testsuite/gna/issue241/test.vhdl @@ -0,0 +1,64 @@ +LIBRARY ieee; +USE ieee.std_logic_1164.ALL; + +PACKAGE test_ctrl_parameter_pkg IS + + TYPE device_t IS ( + DEVICE_NONAME, + DEVICE_TEST + ); + +----------------------------------------------------------------------------- +-- DDR SDRAM device definitions +----------------------------------------------------------------------------- + + TYPE mem_device_t IS ( + TEST_1, + TEST_2, + TEST_3 + ); + + TYPE mem_device_array_t IS ARRAY (natural RANGE <>) OF mem_device_t; + + CONSTANT C_TEST_BUS_ARRAY_SIZE : natural := 10; + + SUBTYPE test_device_type_t IS + mem_device_array_t(0 TO C_TEST_BUS_ARRAY_SIZE - 1); + + CONSTANT DEFAULT_TEST_DEVICE_TYPE_ARRAY : test_device_type_t := + (OTHERS => TEST_1); + + TYPE device_test_parameters_t IS RECORD + test_devices : test_device_type_t; + END RECORD; + + CONSTANT DEFAULT_DEVICE_TEST_PARAMETERS : + device_test_parameters_t := ( + test_devices => DEFAULT_TEST_DEVICE_TYPE_ARRAY); + + TYPE device_test_parameters_array_t IS ARRAY (natural RANGE <>) OF + device_test_parameters_t; + + SUBTYPE constrained_device_test_parameters_array_t IS + device_test_parameters_array_t(0 TO device_t'pos(device_t'high)); + + CONSTANT DEVICE_TEST_PARAMETERS : + constrained_device_test_parameters_array_t := ( + device_t'pos(DEVICE_TEST) => + ( + test_devices => (1 | 2 => TEST_1, 3 => TEST_2, OTHERS => TEST_3) + ), + OTHERS => DEFAULT_DEVICE_TEST_PARAMETERS + ); + +END test_ctrl_parameter_pkg; + + +ENTITY test IS +END ENTITY test; + +ARCHITECTURE rtl OF test IS + +BEGIN + +END ARCHITECTURE rtl; diff --git a/testsuite/gna/issue241/testsuite.sh b/testsuite/gna/issue241/testsuite.sh new file mode 100755 index 000000000..5cd0b1223 --- /dev/null +++ b/testsuite/gna/issue241/testsuite.sh @@ -0,0 +1,17 @@ +#! /bin/sh + +. ../../testenv.sh + +export GHDL_STD_FLAGS=--std=08 +analyze test.vhdl +elab_simulate test + +analyze rec.vhdl +elab_simulate rec + +analyze arr.vhdl +elab_simulate arr + +clean + +echo "Test successful" |