diff options
Diffstat (limited to 'testsuite/vests/vhdl-93/clifton-labs/compliant/functional/types/array-types')
6 files changed, 128 insertions, 0 deletions
diff --git a/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/types/array-types/character-index-constant.vhdl b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/types/array-types/character-index-constant.vhdl new file mode 100644 index 000000000..6c031dd8f --- /dev/null +++ b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/types/array-types/character-index-constant.vhdl @@ -0,0 +1,15 @@ +entity test is +end test; + +architecture only of test is + type int_array_char_index_unconstrained is array (character range <>) of integer; + subtype int_array_char_index_constrained is int_array_char_index_unconstrained('0' to '9'); + CONSTANT my_constant : int_array_char_index_constrained := ( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ); +begin -- only + p: process + begin -- process p + assert my_constant('0') = 0 report "TEST FAILED" severity FAILURE; + report "TEST PASSED" severity NOTE; + wait; + end process p; +end only; diff --git a/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/types/array-types/colors_2d_array.vhdl b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/types/array-types/colors_2d_array.vhdl new file mode 100644 index 000000000..c3da438e1 --- /dev/null +++ b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/types/array-types/colors_2d_array.vhdl @@ -0,0 +1,29 @@ +entity test is +end test; + +architecture only of test is + type colors is ( 'R', 'O', 'Y', 'G', 'B', 'I', 'V', 'X' ); + type color_table_t is array ( 1 to 3, 1 to 3 ) of colors; + CONSTANT primary_table : color_table_t := ( + -- 'R' 'B' 'Y' + ( 'R', 'V', 'O' ), -- 'R' + ( 'V', 'B', 'G' ), -- 'B' + ( 'O', 'G', 'Y' ) -- 'Y' + ); +begin -- only + test: process + begin -- process test + assert primary_table( 1, 1 ) = 'R' report "TEST FAILED" severity failure; + assert primary_table( 1, 2 ) = 'V' report "TEST FAILED" severity failure; + assert primary_table( 1, 3 ) = 'O' report "TEST FAILED" severity failure; + assert primary_table( 2, 1 ) = 'V' report "TEST FAILED" severity failure; + assert primary_table( 2, 2 ) = 'B' report "TEST FAILED" severity failure; + assert primary_table( 2, 3 ) = 'G' report "TEST FAILED" severity failure; + assert primary_table( 3, 1 ) = 'O' report "TEST FAILED" severity failure; + assert primary_table( 3, 2 ) = 'G' report "TEST FAILED" severity failure; + assert primary_table( 3, 3 ) = 'Y' report "TEST FAILED" severity failure; + + report "TEST PASSED"; + wait; + end process test; +end only; diff --git a/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/types/array-types/integer-array-using-tick-range.vhdl b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/types/array-types/integer-array-using-tick-range.vhdl new file mode 100644 index 000000000..1e8b0abe5 --- /dev/null +++ b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/types/array-types/integer-array-using-tick-range.vhdl @@ -0,0 +1,21 @@ +entity test is +end test; + +architecture only of test is +begin -- only +p: process + type integerArray is array (0 to 9) of integer; + variable myArray : integerArray; +begin -- process p + for i in myArray'range loop + myArray(i) := i; + end loop; -- i + for i in myArray'range loop + assert myArray(i) = i report "TEST FAILED myArray(i) = " & + integer'image(myArray(i)) & " - was supposed to be " & + integer'image(i) severity FAILURE; + end loop; -- i + report "TEST PASSED" severity NOTE; + wait; +end process p; +end only; diff --git a/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/types/array-types/simple-integer-array.vhdl b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/types/array-types/simple-integer-array.vhdl new file mode 100644 index 000000000..f5bc596e4 --- /dev/null +++ b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/types/array-types/simple-integer-array.vhdl @@ -0,0 +1,22 @@ +entity test is +end test; + +architecture only of test is +begin -- only +p: process + type integerArray is array (0 to 2) of integer; + variable myArray : integerArray; +begin -- process p + myArray(0) := 0; + myArray(1) := 1; + myArray(2) := 2; + + assert myArray(0) = 0 report "TEST FAILED" severity FAILURE; + assert myArray(1) = 1 report "TEST FAILED" severity FAILURE; + assert myArray(2) = 2 report "TEST FAILED" severity FAILURE; + + report "TEST PASSED" severity NOTE; + + wait; +end process p; +end only; diff --git a/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/types/array-types/subprogram-dynamic-type.vhdl b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/types/array-types/subprogram-dynamic-type.vhdl new file mode 100644 index 000000000..a2f537174 --- /dev/null +++ b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/types/array-types/subprogram-dynamic-type.vhdl @@ -0,0 +1,20 @@ +entity test is +end test; + +architecture only of test is + procedure proc ( + constant a : in bit_vector; + constant l : in integer ) is + type dyn is range a'left downto 0; + begin + assert dyn'left = l report "TEST FAILED" severity FAILURE; + end proc; +begin -- only + doit: process + begin -- process doit + proc( "0000", 3 ); + proc( "00000", 4 ); + report "TEST PASSED"; + wait; + end process doit; +end only; diff --git a/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/types/array-types/unconstrained_argument.vhdl b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/types/array-types/unconstrained_argument.vhdl new file mode 100644 index 000000000..d530af926 --- /dev/null +++ b/testsuite/vests/vhdl-93/clifton-labs/compliant/functional/types/array-types/unconstrained_argument.vhdl @@ -0,0 +1,21 @@ +entity test is +end test; + +architecture only of test is + function get_left ( + constant input_array : bit_vector) + return bit is + begin + return input_array(input_array'left); + end get_left; +begin -- only + process + constant argument1 : bit_vector( 0 to 3 ) := "0000"; + constant argument2 : bit_vector( 0 to 4 ) := "11111"; + begin -- process + assert get_left( argument1 ) = '0' report "TEST FAILED" severity failure; + assert get_left( argument2 ) = '1' report "TEST FAILED" severity failure; + report "TEST PASSED"; + wait; + end process; +end only; |