--------------------------------------------------------------------------------
-- Title   : Registers initiation values
-- Project : TimEX3
--------------------------------------------------------------------------------
-- Description : values puts in the cPCI registers at statup or after a reset.
--               Any signals having a identical init value to the cPCI register
--               is definied here
--------------------------------------------------------------------------------
-- File     : registers_init.vhdl
-- Revision : x.x.x
-- Created  : March 06, 2013
-- Updated  : November 28, 2014
--------------------------------------------------------------------------------
-- Author       : Jean-Paul Ricaud
-- Organization : Synchrotron Soleil
-- Web          : http://www.synchrotron-soleil.fr
-- Email        : jean-paul.ricaud@synchrotron-soleil.fr
--------------------------------------------------------------------------------
-- Copyright (C) 2012 - 2014 Synchrotron Soleil
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU Lesser General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-- GNU Lesser General Public License for more details.
--
-- You should have received a copy of the GNU Lesser General Public License
-- along with this program.  If not, see <http://www.gnu.org/licenses/>
--------------------------------------------------------------------------------
--
--------------------------------------------------------------------------------
-- Modifications :
--
--------------------------------------------------------------------------------

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

library work;
use work.type_lib.all;

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
package registers_init is

  ------------------------------------------------------------------------------
  -- Registers init values
  ------------------------------------------------------------------------------
  -- Write registers
  constant c_test_reg_init   : std_logic_vector (31 downto 0) := X"00000000";
  constant c_status_reg_init : std_logic_vector (9 downto 0)  := "0000000000";
  constant c_cmd_reg_init    : std_logic_vector (31 downto 0) := X"00000000";

  constant c_wRegister_init : register_array := (
    -- *** Duplication ***
    -- time between 2 pulses (read only), maximum delay before a missing synchro is signaled
    X"00000000", X"000493E0",
    -- *** Top-Up ***
    -- beam lost hold off time, beam lost hold on width, gating hold off time, gating window time
    X"00000000", X"00000000", X"000001F4", X"000001F4",
    -- *** LINAC SPM multipulses ***
    -- time between 2 pulses (read only), maximum delay before a missing synchro is signaled
    X"00000000", X"000493E0",
    -- *** LINAC monitoring ***
    -- time between 2 SPM pulses (read only), maximum delay before a missing SPM is signaled,
    -- time between 2 LPM pulses (read only), maximum delay before a missing LPM is signaled,
    -- number of simultaneous SPM / LPM trigg (read only), reset the s_linacMONsimTrigg register
    X"00000000", X"000493E0", X"00000000", X"000493E0", X"00000000", X"00000000",
    -- *** Frequency divider ***
    -- time between 2 CLK_SR (read only), maximum delay before a missing CLK_SR is signaled
    X"00000000", X"000493E0");

  -- Read registers
  constant c_board_id     : std_logic_vector (31 downto 0) := X"4AC0FA5C"; -- board ID for TimEX3
  constant c_firmware_rev : std_logic_vector (31 downto 0) := X"000000BE"; -- firmware's version

end package registers_init;

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
package body registers_init is

end package body registers_init;

