aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/synth/arr01/arr09.vhdl
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/synth/arr01/arr09.vhdl')
-rw-r--r--testsuite/synth/arr01/arr09.vhdl23
1 files changed, 23 insertions, 0 deletions
diff --git a/testsuite/synth/arr01/arr09.vhdl b/testsuite/synth/arr01/arr09.vhdl
new file mode 100644
index 000000000..37692f472
--- /dev/null
+++ b/testsuite/synth/arr01/arr09.vhdl
@@ -0,0 +1,23 @@
+library ieee;
+use ieee.std_logic_1164.all;
+use ieee.numeric_std.all;
+
+entity arr09 is
+ port (val : std_logic_vector(3 downto 0);
+ res : out character);
+end arr09;
+
+architecture behav of arr09 is
+ type map_type is array (natural range 0 to 15) of character;
+ constant cmap : map_type := "0123456789abcdef";
+
+ function convert (v : natural range 0 to 15) return character
+ is
+ variable r : character;
+ begin
+ r := cmap (v);
+ return r;
+ end convert;
+begin
+ res <= convert (3);
+end behav;