source: firmware/FTM/test_firmware/FTM_test4/ftm_test4_definitions.vhd@ 18066

Last change on this file since 18066 was 10046, checked in by vogler, 14 years ago
Test firmware for FTM hardware testing
  • Property svn:executable set to *
File size: 5.7 KB
Line 
1-- Package File Template
2--
3-- Purpose: This package defines supplemental types, subtypes,
4-- constants, and functions
5
6
7library IEEE;
8use IEEE.STD_LOGIC_1164.all;
9use IEEE.STD_LOGIC_ARITH.ALL;
10use IEEE.STD_LOGIC_UNSIGNED.ALL;
11-- use IEEE.NUMERIC_STD.ALL;
12
13package ftm_definitions is
14
15
16-- Declare constants
17
18-- Network Settings
19 type mac_type is array (0 to 2) of std_logic_vector (15 downto 0);
20 constant MAC_ADDRESS : mac_type := (X"0011", X"9561", X"97B4");
21
22 type ip_type is array (0 to 3) of integer;
23 constant NETMASK : ip_type := (255, 255, 248, 0);
24 constant IP_ADDRESS : ip_type := (192, 33, 99, 226);
25 constant GATEWAY : ip_type := (192, 33, 96, 1);
26 constant FIRST_PORT : integer := 5000;
27
28 constant PACKAGE_VERSION : std_logic_vector(7 downto 0) := X"01";
29 constant PACKAGE_SUB_VERSION : std_logic_vector(7 downto 0) := X"02";
30 constant PACKAGE_HEADER_LENGTH : integer := 22;
31 constant PACKAGE_END_LENGTH : integer := 2; -- CRC and END-Flag
32
33 constant W5300_S_INC : std_logic_vector(6 downto 0) := "1000000"; -- socket address offset
34
35-- W5300 Registers
36 constant W5300_BASE_ADR : std_logic_vector (9 downto 0) := (others => '0');
37 constant W5300_MR : std_logic_vector (9 downto 0) := W5300_BASE_ADR + X"0";
38 constant W5300_IR : std_logic_vector (9 downto 0) := W5300_BASE_ADR + X"2";
39 constant W5300_IMR : std_logic_vector (9 downto 0) := W5300_BASE_ADR + X"4";
40 constant W5300_SHAR : std_logic_vector (9 downto 0) := W5300_BASE_ADR + X"8";
41 constant W5300_GAR : std_logic_vector (9 downto 0) := W5300_BASE_ADR + X"10";
42 constant W5300_SUBR : std_logic_vector (9 downto 0) := W5300_BASE_ADR + X"14";
43 constant W5300_SIPR : std_logic_vector (9 downto 0) := W5300_BASE_ADR + X"18";
44 constant W5300_RTR : std_logic_vector (9 downto 0) := W5300_BASE_ADR + X"1C";
45 constant W5300_RCR : std_logic_vector (9 downto 0) := W5300_BASE_ADR + X"1E";
46 constant W5300_TMS01R : std_logic_vector (9 downto 0) := W5300_BASE_ADR + X"20";
47 constant W5300_TMS23R : std_logic_vector (9 downto 0) := W5300_BASE_ADR + X"22";
48 constant W5300_TMS45R : std_logic_vector (9 downto 0) := W5300_BASE_ADR + X"24";
49 constant W5300_TMS67R : std_logic_vector (9 downto 0) := W5300_BASE_ADR + X"26";
50 constant W5300_RMS01R : std_logic_vector (9 downto 0) := W5300_BASE_ADR + X"28";
51 constant W5300_RMS23R : std_logic_vector (9 downto 0) := W5300_BASE_ADR + X"2A";
52 constant W5300_RMS45R : std_logic_vector (9 downto 0) := W5300_BASE_ADR + X"2C";
53 constant W5300_RMS67R : std_logic_vector (9 downto 0) := W5300_BASE_ADR + X"2E";
54 constant W5300_MTYPER : std_logic_vector (9 downto 0) := W5300_BASE_ADR + X"30";
55
56 constant W5300_S0_MR : std_logic_vector (9 downto 0) := W5300_BASE_ADR + "1000000000" + X"0";
57 constant W5300_S0_CR : std_logic_vector (9 downto 0) := W5300_BASE_ADR + "1000000000" + X"2";
58 constant W5300_S0_IMR : std_logic_vector (9 downto 0) := W5300_BASE_ADR + "1000000000" + X"4";
59 constant W5300_S0_IR : std_logic_vector (9 downto 0) := W5300_BASE_ADR + "1000000000" + X"6";
60 constant W5300_S0_SSR : std_logic_vector (9 downto 0) := W5300_BASE_ADR + "1000000000" + X"8";
61 constant W5300_S0_PORTR : std_logic_vector (9 downto 0) := W5300_BASE_ADR + "1000000000" + X"A";
62 constant W5300_S0_DPORTR : std_logic_vector (9 downto 0) := W5300_BASE_ADR + "1000000000" + X"12";
63 constant W5300_S0_DIPR : std_logic_vector (9 downto 0) := W5300_BASE_ADR + "1000000000" + X"14";
64 constant W5300_S0_TX_WRSR : std_logic_vector (9 downto 0) := W5300_BASE_ADR + "1000000000" + X"20";
65 constant W5300_S0_TX_FSR : std_logic_vector (9 downto 0) := W5300_BASE_ADR + "1000000000" + X"24";
66 constant W5300_S0_RX_RSR : std_logic_vector (9 downto 0) := W5300_BASE_ADR + "1000000000" + X"28";
67 constant W5300_S0_TX_FIFOR : std_logic_vector (9 downto 0) := W5300_BASE_ADR + "1000000000" + X"2E";
68 constant W5300_S0_RX_FIFOR : std_logic_vector (9 downto 0) := W5300_BASE_ADR + "1000000000" + X"30";
69-- End W5300 registers
70
71--
72 constant W5300_TX_FIFO_SIZE_8B : integer := 15360; -- Socket TX FIFO-Size in Bytes
73 constant W5300_TX_FIFO_SIZE : integer := (W5300_TX_FIFO_SIZE_8B / 2); -- Socket TX FIFO-Size in 16 Bit Words
74
75 constant RAM_SIZE_64B : integer := 4096;
76 constant RAM_SIZE_16B : integer := RAM_SIZE_64B * 4;
77
78
79
80
81
82-- TYPE definitions
83-- type roi_max_type is array (0 to 8) of std_logic_vector (10 downto 0);
84-- type roi_array_type is array (0 to 35) of integer range 0 to 1024;
85-- type drs_s_cell_array_type is array (0 to 3) of std_logic_vector (9 downto 0);
86-- type adc_data_array_type is array (0 to 3) of std_logic_vector (11 downto 0);
87
88-- type dac_array_type is array (0 to 7) of integer range 0 to 2**16 - 1;
89-- type sensor_array_type is array (0 to 3) of integer range 0 to 2**16 - 1;
90
91-- constant DEFAULT_ROI : roi_array_type := (115, 125, 100, 102, 155, 101, 0, 101, 106,
92-- 181, 121, 189, 101, 101, 187, 56, 187, 101,
93-- 2, 141, 101, 100, 10, 100, 178, 101, 174,
94-- 12, 181, 100, 102, 101, 102, 0, 101, 108);
95-- constant DEFAULT_ROI : roi_array_type := (others => 50);
96
97-- constant DEFAULT_DAC : dac_array_type := (5001, 5002, 5003, 5004, 5005, 5006, 5007, 5008);
98-- constant DEFAULT_DAC : dac_array_type := (others => 0);
99
100-- Commands
101 constant CMD_START : std_logic_vector := X"C0";
102 constant CMD_STOP : std_logic_vector := X"30";
103 constant CMD_TRIGGER : std_logic_vector := X"A0";
104 constant CMD_TRIGGER_C : std_logic_vector := X"B0";
105 constant CMD_TRIGGER_S : std_logic_vector := X"20";
106 constant CMD_READ : std_logic_vector := X"0A";
107 constant CMD_WRITE : std_logic_vector := X"05";
108
109-- DRS Registers
110-- constant DRS_WRITE_SHIFT_REG : std_logic_vector := "1101";
111
112-- Declare functions and procedure
113
114
115end ftm_definitions;
116
117
Note: See TracBrowser for help on using the repository browser.