-------------------------------------------------------------------------------- 0 | -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- 2 | architecture RTL of FIFO is -------------------------------------------------------------------------------- 3 | -------------------------------------------------------------------------------- 4 | function PARITY -------------------------------------------------------------------------------- 5 | (signal X : in std_logic_vector; -------------------------------------------------------------------------------- 6 | signal Y : out std_logic) return integer; -------------------------------------------------------------------------------- 7 | -------------------------------------------------------------------------------- 8 | impure function PARITY -------------------------------------------------------------------------------- 9 | (signal X : in std_logic_vector; -------------------------------------------------------------------------------- 10 | signal Y : out std_logic) return integer; -------------------------------------------------------------------------------- 11 | -------------------------------------------------------------------------------- 12 | pure function PARITY -------------------------------------------------------------------------------- 13 | (signal X : in std_logic_vector; -------------------------------------------------------------------------------- 14 | signal Y : out std_logic) return integer; -------------------------------------------------------------------------------- 15 | -------------------------------------------------------------------------------- 16 | function Proc_1 (constant In1: in Integer; variable O1: out Integer) return string; -------------------------------------------------------------------------------- 17 | -------------------------------------------------------------------------------- 18 | function Proc_2 (signal Sig: inout Bit) return string; -------------------------------------------------------------------------------- 19 | -------------------------------------------------------------------------------- 20 | function sum2num(signal a: in signed(3 downto 0); -------------------------------------------------------------------------------- 21 | signal b: in signed(3 downto 0); -------------------------------------------------------------------------------- 22 | signal sum : out signed (3 downto 0)) return std_logic_vector; -------------------------------------------------------------------------------- 23 | -------------------------------------------------------------------------------- 24 | -- Test parameter keyword -------------------------------------------------------------------------------- 25 | function Proc_2 parameter (signal Sig: inout Bit) return integer; -------------------------------------------------------------------------------- 26 | -------------------------------------------------------------------------------- 27 | -- Test subprogram header -------------------------------------------------------------------------------- 28 | function Proc_2 -------------------------------------------------------------------------------- 29 | generic (G1: INTEGER; G2: INTEGER := G1; G3, G4, G5, G6: INTEGER) -------------------------------------------------------------------------------- 30 | parameter (signal Sig: inout Bit) return natural; -------------------------------------------------------------------------------- 31 | -------------------------------------------------------------------------------- 32 | -- Test subprogram header with generic_map_aspect -------------------------------------------------------------------------------- 33 | function Proc_2 -------------------------------------------------------------------------------- 34 | generic (G1: INTEGER; G2: INTEGER := G1; G3, G4, G5, G6: INTEGER) -------------------------------------------------------------------------------- 35 | generic map (complex_fixed_left => 3, complex_fixed_right => -12, -------------------------------------------------------------------------------- 36 | complex_fixed_formal_pkg => fixed_dsp_pkg) -------------------------------------------------------------------------------- 37 | parameter (signal Sig: inout Bit) return string; -------------------------------------------------------------------------------- 38 | -------------------------------------------------------------------------------- 39 | begin -------------------------------------------------------------------------------- 40 | -------------------------------------------------------------------------------- 41 | -------------------------------------------------------------------------------- 42 | end architecture RTL;