---------------------------------------------------------------------------------------
-- Title          : Wishbone slave core for WR PTP Support Unit Controller
---------------------------------------------------------------------------------------
-- File           : wbgen2_pkg.vhd
-- Author         : auto-generated by wbgen2 from psu_wishbone_controller.wb
-- Created        : Sat Mar 21 20:51:34 2015
-- Standard       : VHDL'87
---------------------------------------------------------------------------------------
-- THIS FILE WAS GENERATED BY wbgen2 FROM SOURCE FILE psu_wishbone_controller.wb
-- DO NOT HAND-EDIT UNLESS IT'S ABSOLUTELY NECESSARY!
---------------------------------------------------------------------------------------

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

package psu_wbgen2_pkg is
  
  
  -- Input registers (user design -> WB slave)
  
  type t_psu_in_registers is record
    end record;
  
  constant c_psu_in_registers_init_value: t_psu_in_registers := (
    );
    
    -- Output registers (WB slave -> user design)
    
    type t_psu_out_registers is record
      pcr_psu_ena_o                            : std_logic;
      pcr_ignore_rx_pid_o                      : std_logic;
      pcr_holdover_clk_class_o                 : std_logic_vector(15 downto 0);
      rxpm_port_mask_o                         : std_logic_vector(31 downto 0);
      txpm_port_mask_o                         : std_logic_vector(31 downto 0);
      ptd_tx_ann_trig_o                        : std_logic;
      end record;
    
    constant c_psu_out_registers_init_value: t_psu_out_registers := (
      pcr_psu_ena_o => '0',
      pcr_ignore_rx_pid_o => '0',
      pcr_holdover_clk_class_o => x"0007",
      rxpm_port_mask_o => (others => '0'),
      txpm_port_mask_o => (others => '0'),
      ptd_tx_ann_trig_o => '0'
      );
    function "or" (left, right: t_psu_in_registers) return t_psu_in_registers;
    function f_x_to_zero (x:std_logic) return std_logic;
    function f_x_to_zero (x:std_logic_vector) return std_logic_vector;
end package;

package body psu_wbgen2_pkg is
function f_x_to_zero (x:std_logic) return std_logic is
begin
if x = '1' then
return '1';
else
return '0';
end if;
end function;
function f_x_to_zero (x:std_logic_vector) return std_logic_vector is
variable tmp: std_logic_vector(x'length-1 downto 0);
begin
for i in 0 to x'length-1 loop
if(x(i) = 'X' or x(i) = 'U') then
tmp(i):= '0';
else
tmp(i):=x(i);
end if; 
end loop; 
return tmp;
end function;
function "or" (left, right: t_psu_in_registers) return t_psu_in_registers is
variable tmp: t_psu_in_registers;
begin
return tmp;
end function;
end package body;
