source: firmware/FTU/ftu_definitions.vhd @ 9928

Last change on this file since 9928 was 9928, checked in by weitzel, 10 years ago
first version of RS485 interface added to FTU firmware; not yet connected to main control state machine
File size: 3.0 KB
Line 
1----------------------------------------------------------------------------------
2-- Company:        ETH Zurich, Institute for Particle Physics
3-- Engineer:       Q. Weitzel
4--
5-- Create Date:    July 2010
6-- Design Name:   
7-- Module Name:    ftu_definitions
8-- Project Name:
9-- Target Devices:
10-- Tool versions:
11-- Description:    library file for FTU design                                                                         
12--
13-- Dependencies:
14--
15-- Revision:
16-- Revision 0.01 - File Created
17-- Revision 0.02 - New package "ftu_constants" added, Aug 2010, Q. Weitzel
18-- Additional Comments:
19--
20----------------------------------------------------------------------------------
21
22
23library IEEE;
24use IEEE.STD_LOGIC_1164.all;
25use IEEE.STD_LOGIC_ARITH.ALL;
26use IEEE.STD_LOGIC_UNSIGNED.ALL;
27-- use IEEE.NUMERIC_STD.ALL;
28
29package ftu_array_types is
30
31  --enable signals to switch on/off pixels in trigger (9 pixels per patch)
32  type enable_array_type is array (0 to 3) of std_logic_vector(15 downto 0);
33  constant DEFAULT_ENABLE : enable_array_type := ("0000000111111111", --patch A
34                                                  "0000000111111111", --patch B
35                                                  "0000000111111111", --patch C
36                                                  "0000000111111111");--patch D
37
38  --DAC values to steer trigger thresholds, 12bit octal DAC, 2.5V reference voltage
39  --First 4 values: patches A-D, DACs 5-7 not used, last value: majority coincidence
40  type dac_array_type is array (0 to 7) of integer range 0 to 2**12 - 1;
41  constant DEFAULT_DAC : dac_array_type := (500, 500, 500, 500, 0, 0, 0, 100);
42
43  --array to hold current values of rate counters (as integers)
44  type rate_array_type is array (0 to 4) of integer range 0 to 2**16 - 1;
45 
46end ftu_array_types;
47
48
49library IEEE;
50use IEEE.STD_LOGIC_1164.all;
51use IEEE.STD_LOGIC_ARITH.ALL;
52use IEEE.STD_LOGIC_UNSIGNED.ALL;
53-- use IEEE.NUMERIC_STD.ALL;
54
55package ftu_constants is
56
57  --internal FPGA clock frequency and rate counter frequency
58  constant INT_CLK_FREQUENCY : integer := 50000000;  -- 50MHz
59  constant COUNTER_FREQUENCY : integer :=  1000000;  -- has to be smaller than INT_CLK_FREQUENCY
60  constant CNTR_FREQ_DIVIDER : integer :=   500000;  -- for simulation, should normally be 1
61   
62  --32byte dual-port RAM, port A: 8byte, port B: 16byte
63  constant RAM_ADDR_WIDTH_A : integer := 5;
64  constant RAM_ADDR_WIDTH_B : integer := 4;
65  constant RAM_ADDR_RATIO   : integer := 2;
66
67  --normalization time for trigger counters
68  constant DEFAULT_PRESCALING : integer := 59; --30s integration time
69
70  constant NO_OF_ENABLE       : integer := 4;
71  constant NO_OF_DAC          : integer := 8;
72  constant NO_OF_DAC_NOT_USED : integer := 3;
73  constant NO_OF_COUNTER      : integer := 5;
74
75  --communication with FTM
76  constant RS485_BAUD_RATE   : integer := 100000;  -- bits / sec in our case
77  constant RS485_BLOCK_WIDTH : integer := 128;     -- 16 byte protocol
78  constant RS485_START_DELIM : std_logic_vector(7 downto 0) := "01000000";  -- start delimiter
79  constant FTM_ADDRESS       : std_logic_vector(7 downto 0) := "11000000";  -- 192
80 
81end ftu_constants;
Note: See TracBrowser for help on using the repository browser.