aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/issue913/apackage.vhdl
blob: bd55d2ca27659b54f9b0e4399b12f2a8fc51d84d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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;