aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/issue913/apackage.vhdl
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/gna/issue913/apackage.vhdl')
-rw-r--r--testsuite/gna/issue913/apackage.vhdl29
1 files changed, 29 insertions, 0 deletions
diff --git a/testsuite/gna/issue913/apackage.vhdl b/testsuite/gna/issue913/apackage.vhdl
new file mode 100644
index 000000000..bd55d2ca2
--- /dev/null
+++ b/testsuite/gna/issue913/apackage.vhdl
@@ -0,0 +1,29 @@
+library IEEE;
+
+use IEEE.Std_logic_1164.all;
+use IEEE.Numeric_std.all;
+package aPackage is
+
+ subtype T_DBYTE is std_logic_vector(7 downto 0);
+ type T_RECORD is record
+ flgA : std_logic;
+ flgB : std_logic;
+ flgC : std_logic;
+ flgD : std_logic;
+ counter : unsigned(3 downto 0);
+ end record T_RECORD;
+
+ function to_HKBYTE(inVal : T_RECORD) return T_DBYTE;
+end package aPackage;
+
+package body aPackage is
+
+ function to_HKBYTE(inVal : T_RECORD) return T_DBYTE is
+ begin
+ return (7 downto 4 => std_logic_vector(inVal.counter),
+ 3 => inVal.flgB, 2 => inVal.flgD,
+ 1=> inVal.flgC, 0 => inVal.flgA,
+ others => '0');
+ end to_HKBYTE;
+
+end package body aPackage;