-- altera vhdl_input_version vhdl_2008
-- XXX: QSYS Fix (https://www.intel.com/content/www/us/en/support/programmable/articles/000079458.html)

library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;

use work.rtps_package.all;
use work.rtps_config_package.all;

entity key_holder is
    generic (
        LITTLE_ENDIAN   : std_logic := '0'
    );
    port (
        -- SYSTEM
        clk             : in std_logic;
        reset           : in std_logic;
        -- CONTROL
        start           : in std_logic;
        opcode          : in KEY_HOLDER_OPCODE_TYPE;
        ack             : out std_logic;
        decode_error    : out std_logic;
        abort           : in std_logic;
        -- INPUT
        ready_in        : out std_logic;
        valid_in        : in std_logic;
        data_in         : in std_logic_vector(WORD_WIDTH-1 downto 0);
        last_word_in    : in std_logic;
        -- OUTPUT
        ready_out       : in std_logic;  
        valid_out       : out std_logic;
        data_out        : out std_logic_vector(WORD_WIDTH-1 downto 0);
        last_word_out   : out std_logic
    );
end entity;
