| 1 | ----------------------------------------------------------------------------------
|
|---|
| 2 | -- Company: ETH Zurich, Institute for Particle Physics
|
|---|
| 3 | -- Engineer: Q. Weitzel
|
|---|
| 4 | --
|
|---|
| 5 | -- Create Date: February 2011
|
|---|
| 6 | -- Design Name:
|
|---|
| 7 | -- Module Name: ftm_definitions
|
|---|
| 8 | -- Project Name:
|
|---|
| 9 | -- Target Devices:
|
|---|
| 10 | -- Tool versions:
|
|---|
| 11 | -- Description: library file for FTM design
|
|---|
| 12 | --
|
|---|
| 13 | -- Dependencies:
|
|---|
| 14 | --
|
|---|
| 15 | -- Revision:
|
|---|
| 16 | -- Revision 0.01 - File Created
|
|---|
| 17 | -- Additional Comments:
|
|---|
| 18 | --
|
|---|
| 19 | ----------------------------------------------------------------------------------
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 | library IEEE;
|
|---|
| 23 | use IEEE.STD_LOGIC_1164.all;
|
|---|
| 24 | use IEEE.STD_LOGIC_ARITH.ALL;
|
|---|
| 25 | use IEEE.STD_LOGIC_UNSIGNED.ALL;
|
|---|
| 26 | -- use IEEE.NUMERIC_STD.ALL;
|
|---|
| 27 |
|
|---|
| 28 | -- package ftm_array_types is
|
|---|
| 29 | -- end ftm_array_types;
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 | library IEEE;
|
|---|
| 33 | use IEEE.STD_LOGIC_1164.all;
|
|---|
| 34 | use IEEE.STD_LOGIC_ARITH.ALL;
|
|---|
| 35 | use IEEE.STD_LOGIC_UNSIGNED.ALL;
|
|---|
| 36 | -- use IEEE.NUMERIC_STD.ALL;
|
|---|
| 37 |
|
|---|
| 38 | package ftm_constants is
|
|---|
| 39 |
|
|---|
| 40 | --internal FPGA clock frequencies
|
|---|
| 41 | constant INT_CLK_FREQUENCY_1 : integer := 50000000; -- 50MHz
|
|---|
| 42 | constant INT_CLK_FREQUENCY_2 : integer := 250000000; -- 250MHz
|
|---|
| 43 |
|
|---|
| 44 | --FTM address and firmware ID
|
|---|
| 45 | constant FTM_ADDRESS : std_logic_vector(7 downto 0) := "11000000"; -- 192
|
|---|
| 46 | constant FIRMWARE_ID : std_logic_vector(7 downto 0) := "00000001"; -- firmware version
|
|---|
| 47 |
|
|---|
| 48 | --communication with FTUs
|
|---|
| 49 | constant FTU_RS485_BAUD_RATE : integer := 250000; -- bits / sec in our case
|
|---|
| 50 | constant FTU_RS485_TIMEOUT : integer := (INT_CLK_FREQUENCY_1 * 5) / 1000; -- 5ms @ 50MHz (250000 clk periods)
|
|---|
| 51 | constant FTU_RS485_BLOCK_WIDTH : integer := 224; -- 28 byte protocol
|
|---|
| 52 | constant FTU_RS485_START_DELIM : std_logic_vector(7 downto 0) := "01000000"; -- start delimiter "@"
|
|---|
| 53 |
|
|---|
| 54 | --CRC setup
|
|---|
| 55 | constant CRC_POLYNOMIAL : std_logic_vector(7 downto 0) := "00000111"; -- 8-CCITT
|
|---|
| 56 | constant CRC_INIT_VALUE : std_logic_vector(7 downto 0) := "11111111";
|
|---|
| 57 |
|
|---|
| 58 | --DNA identifier for simulation
|
|---|
| 59 | constant DNA_FOR_SIM : bit_vector := X"01710000E0000501";
|
|---|
| 60 |
|
|---|
| 61 | end ftm_constants;
|
|---|