--	Package File Template
--
--	Purpose: This package defines supplemental types, subtypes, 
--		 constants, and functions 


library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
use IEEE.MATH_REAL.ALL;

package emac_types is
	
	-- Constants
	type mac_addr_t is array (0 to 5) of unsigned (7 downto 0);
	
	-- Types
	type tx_ctrl_in_t is record
		Gbps_en				: std_logic;
		reset				: std_logic;
		fcs_gen_en			: std_logic;
		tx_size				: unsigned(15 downto 0);
		pkt_commit_en		: std_logic;
		pkt_alloc_en		: std_logic;
	end record;

	type tx_ctrl_out_t is record
		tx_size				: unsigned(15 downto 0);
		pkt_done			: std_logic;
		pkt_alloc_req		: std_logic;
		pkt_armed			: std_logic;
		reset_busy			: std_logic;
	end record;
	
	type rx_ctrl_in_t is record
		Gbps_en				: std_logic;
		reset				: std_logic;
		fcs_chk_en			: std_logic;
		pkt_req_en			: std_logic;
		pkt_free_en			: std_logic;
		mac_addr			: mac_addr_t;
		promiscious			: std_logic;
	end record;

	type rx_ctrl_out_t is record
		pkt_avail			: std_logic;
		pkt_valid			: std_logic;
		pkt_bcast			: std_logic;
		pkt_mac_match		: std_logic;
		rx_size				: unsigned(15 downto 0);
		reset_busy			: std_logic;
	end record;

	-- Functions
	
end emac_types;


package body emac_types is

end emac_types;


