---------------------------------------------------------------------------
-- File           : p_commands.vhd
-- Author(s)      : Nikola Avramovic
-- Created        : February 16th, 2019
---------------------------------------------------------------------------
-- Description    : Commands constants defined for generator and monitor
---------------------------------------------------------------------------

---------------------------------------------------------------------------

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

package p_commands is

   ----------------------------------------------------------------
   -- Generator commands (32 bits), commands values is not allowed
   ----------------------------------------------------------------
   -- choose to which pattern generator will be send set of commands
   constant C_GEN_CMD_INIT_PATTERN_GEN   : std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FF90";
   constant C_GEN_CMD_INIT_PORT_GEN      : std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FF91";
      -- commands for pattern generator
   constant C_GEN_CMD_IDLE               : std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FFA0";
   constant C_GEN_CMD_START              : std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FFA1";
   constant C_GEN_CMD_END                : std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FFA2";
   constant C_GEN_CMD_FRAME_NO           : std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FFA3";
   constant C_GEN_CMD_FRAME_LENGTH       : std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FFA4";
   constant C_GEN_CMD_FRAME_SEED         : std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FFA5";
   constant C_GEN_CMD_SEED_INCREMENT     : std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FFA6";
   constant C_GEN_CMD_RANDOM_DATA        : std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FFA7";
   constant C_GEN_CMD_LINEAR_DATA        : std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FFA8";
   constant C_GEN_CMD_CRC_EN             : std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FFA9";
   -- commands for port generator
   constant C_GEN_CMD_SET_FRAG           : std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FFB1";
   constant C_GEN_CMD_PRIORITY_INPUT     : std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FFB2";
   constant C_GEN_CMD_NO_OF_FARGMENT     : std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FFB3";
   constant C_GEN_CMD_PACKET_CRC_EN      : std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FFB4";
   constant C_GEN_CMD_FRAME_WAIT_PRIORITY: std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FFB5";
   constant C_GEN_CMD_FRAME_WAIT_FRAG    : std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FFB6";
   constant C_GEN_CMD_PREAMBLE_LENGTH    : std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FFB7";
   constant C_GEN_CMD_SFD                : std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FFB8";
   constant C_GEN_CMD_SMD_I              : std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FFB9";
   constant C_GEN_CMD_SMD_C              : std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FFBA";
   constant C_GEN_CMD_TERMINATED         : std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FFBB";

   ----------------------------------------------------------------
   -- Monitor commands (32 bits), commands values is not allowed
   ----------------------------------------------------------------
   -- choose to which pattern generator will be send set of commands
   constant C_MON_CMD_INIT_PATTERN_MON   : std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FF92";
   constant C_MON_CMD_INIT_PORT_MON      : std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FF93";
      -- commands for pattern generator
   constant C_MON_CMD_IDLE               : std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FFC0";
   constant C_MON_CMD_START              : std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FFC1";
   constant C_MON_CMD_END                : std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FFC2";
   constant C_MON_CMD_FRAME_NO           : std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FFC3";
   constant C_MON_CMD_FRAME_LENGTH       : std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FFC4";
   constant C_MON_CMD_FRAME_SEED         : std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FFC5";
   constant C_MON_CMD_SEED_INCREMENT     : std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FFC6";
   constant C_MON_CMD_RANDOM_DATA        : std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FFC7";
   constant C_MON_CMD_LINEAR_DATA        : std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FFC8";
   constant C_MON_CMD_CRC_EN             : std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FFC9";
   constant C_MON_CMD_SCOREBOARD_EN      : std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FFCA";
   -- commands for port generator
   constant C_MON_CMD_PRIORITY_OUTPUT    : std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FFD1";
   constant C_MON_CMD_SET_FRAG           : std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FFD2";
   constant C_MON_CMD_NO_OF_FARGMENT     : std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FFD3";
   constant C_MON_CMD_PACKET_CRC_EN      : std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FFD4";
   constant C_MON_CMD_PREAMBLE_LENGTH    : std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FFD7";
   constant C_MON_CMD_SFD                : std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FFD8";
   constant C_MON_CMD_SMD_I              : std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FFD9";
   constant C_MON_CMD_SMD_C              : std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FFDA";
   constant C_MON_CMD_TERMINATED         : std_logic_vector(C_WORD_LENGTH-1 downto 0)  := X"FFDB";

end package;
