1 |
42 |
lmaarsen |
--------------------------------------------------------------------------------
|
2 |
|
|
-- Object : Package work.package_esoc_configuration
|
3 |
|
|
-- Last modified : Thu Oct 10 12:38:17 2013.
|
4 |
|
|
--------------------------------------------------------------------------------
|
5 |
|
|
|
6 |
|
|
|
7 |
|
|
|
8 |
|
|
library ieee, std;
|
9 |
|
|
use ieee.std_logic_1164.all;
|
10 |
|
|
use std.textio.all;
|
11 |
|
|
use ieee.numeric_std.all;
|
12 |
|
|
---------------------------------------------------------------------------------------------------------------
|
13 |
|
|
-- Package declaration: ESoC Configuration items
|
14 |
|
|
---------------------------------------------------------------------------------------------------------------
|
15 |
|
|
package package_esoc_configuration is
|
16 |
|
|
-- Manufacturer and device ID
|
17 |
|
|
constant esoc_id: std_logic_vector(31 downto 0):= X"71022" & X"001";
|
18 |
|
|
|
19 |
|
|
-- Version information (version.release)
|
20 |
|
|
constant esoc_version: integer := 1;
|
21 |
|
|
constant esoc_release: integer := 0;
|
22 |
|
|
|
23 |
|
|
-- Mode of operation
|
24 |
|
|
type esoc_modes is (normal, simulation);
|
25 |
|
|
constant esoc_mode: esoc_modes := simulation;
|
26 |
|
|
|
27 |
|
|
-- Boot from ROM
|
28 |
|
|
type esoc_brom_modes is (disabled, enabled);
|
29 |
|
|
constant esoc_brom_mode: esoc_brom_modes := disabled;
|
30 |
|
|
|
31 |
|
|
-- Port count configuration (maximum is 16)
|
32 |
|
|
constant esoc_port_count: integer := 8;
|
33 |
|
|
|
34 |
|
|
---------------------------------------------------------------------------------------------------------------
|
35 |
|
|
-- Package declaration: ESoC Address Mapping
|
36 |
|
|
---------------------------------------------------------------------------------------------------------------
|
37 |
|
|
-- Address mapping
|
38 |
|
|
constant esoc_base : integer := 0; -- Boundaries of eSoc memory
|
39 |
|
|
constant esoc_size : integer := 65280;
|
40 |
|
|
|
41 |
|
|
constant esoc_testbench_base : integer := 65280; -- Base address = 0xFF00
|
42 |
|
|
constant esoc_testbench_size : integer := 8;
|
43 |
|
|
|
44 |
|
|
constant esoc_search_engine_base : integer := 34832; -- Base address = 0x8810
|
45 |
|
|
constant esoc_search_engine_size : integer := 8;
|
46 |
|
|
|
47 |
|
|
constant esoc_bus_arbiter_base : integer := 34816; -- Base address = 0x8808 for ID 1
|
48 |
|
|
constant esoc_bus_arbiter_size : integer := 8; -- Base address = 0x8800 for ID 0
|
49 |
|
|
|
50 |
|
|
constant esoc_control_base : integer := 32768; -- Base address = 0x8000
|
51 |
|
|
constant esoc_control_size : integer := 8;
|
52 |
|
|
|
53 |
|
|
constant esoc_port_mac_base : integer := 0; -- Base address = port_base + port_nr * port_base_offset
|
54 |
|
|
constant esoc_port_mac_size : integer := 256;
|
55 |
|
|
constant esoc_port_mal_base : integer := 384;
|
56 |
|
|
constant esoc_port_mal_size : integer := 8;
|
57 |
|
|
constant esoc_port_proc_base : integer := 400;
|
58 |
|
|
constant esoc_port_proc_size : integer := 16;
|
59 |
|
|
constant esoc_port_base_offset : integer := 2048;
|
60 |
|
|
|
61 |
|
|
---------------------------------------------------------------------------------------------------------------
|
62 |
|
|
-- Package declaration: ESoC Design items
|
63 |
|
|
---------------------------------------------------------------------------------------------------------------
|
64 |
|
|
-- Configuration of clock and clock enables
|
65 |
|
|
constant clk_control_freq : integer := 50000000;
|
66 |
|
|
constant clk_data_freq : integer := 125000000;
|
67 |
|
|
constant clk_search_freq : integer := 100000000;
|
68 |
|
|
|
69 |
|
|
constant clk_search_en_div_1s : integer := clk_search_freq/1; -- 1s enable --> 100MHz / 1Hz
|
70 |
|
|
constant clk_search_en_div_1s_sim : integer := clk_search_freq/100000; -- 10us enable --> 100MHz / 100kHz
|
71 |
|
|
|
72 |
|
|
-- Number of metastability flip flops
|
73 |
|
|
constant esoc_meta_ffs : integer := 2;
|
74 |
|
|
|
75 |
|
|
-- Ethernet Packet Known Values
|
76 |
|
|
constant esoc_ethernet_uc_mc_bc : integer := 40; -- if bit 40 of the DA is 0 it is a uni cast else a multicast or even broadcast
|
77 |
|
|
constant esoc_ethernet_vlan_type : std_logic_vector(15 downto 0) := X"8100";
|
78 |
|
|
constant esoc_ethernet_vlan_qos : std_logic_vector(11 downto 0) := X"000";
|
79 |
|
|
constant esoc_ethernet_ipv4_type : std_logic_vector(15 downto 0) := X"0800";
|
80 |
|
|
constant esoc_ethernet_ipv6_type : std_logic_vector(15 downto 0) := X"8808";
|
81 |
|
|
|
82 |
|
|
-- Entity ESoC Port Mal[Inbound] to ESoC Port Processor[Search]
|
83 |
|
|
-- Record stored in Header Fifo format (start positions)
|
84 |
|
|
constant esoc_inbound_header_dmac_hi : integer := 80; -- Position of destination MAC in header fifo entry, length is 48 bits
|
85 |
|
|
constant esoc_inbound_header_dmac_lo : integer := 64; -- Position of destination and source MAC in header fifo entry, length is 48 bits
|
86 |
|
|
constant esoc_inbound_header_smac_hi : integer := 48; -- Position of destination and source MAC in header fifo entry, length is 48 bits
|
87 |
|
|
constant esoc_inbound_header_smac_lo : integer := 16; -- Position of source MAC in header fifo entry, length is 48 bits
|
88 |
|
|
constant esoc_inbound_header_vlan : integer := 4; -- Position of vlan ID in header fifo entry, length is 12 bits
|
89 |
|
|
constant esoc_inbound_header_unused3_flag : integer := 3; -- Position of ... flag in header fifo entry, length is 1 bit
|
90 |
|
|
constant esoc_inbound_header_unused2_flag : integer := 2; -- Position of ... flag in header fifo entry, length is 1 bit
|
91 |
|
|
constant esoc_inbound_header_unused1_flag : integer := 1; -- Position of ... flag in header fifo entry, length is 1 bit
|
92 |
|
|
constant esoc_inbound_header_vlan_flag : integer := 0; -- Position of vlan tagged packet flag in header fifo entry, length is 1 bit
|
93 |
|
|
|
94 |
|
|
-- Entity ESoC Port Mal[Inbound] to ESoC Port Processor[Inbound Control]
|
95 |
|
|
-- Record stored in Info Fifo format (start positions)
|
96 |
|
|
constant esoc_inbound_info_length : integer := 20; -- Position of packet length in info fifo entry
|
97 |
|
|
constant esoc_inbound_info_length_size : integer := 12; -- Size of packet length in info fifo entry
|
98 |
|
|
constant esoc_inbound_info_vlan_tci : integer := 4; -- Position of vlan tag in info fifo entry, length is 16 bits
|
99 |
|
|
constant esoc_inbound_info_unused3_flag : integer := 3; -- Position of ... flag in info fifo entry, length is 1 bit
|
100 |
|
|
constant esoc_inbound_info_unused2_flag : integer := 2; -- Position of ... flag in info fifo entry, length is 1 bit
|
101 |
|
|
constant esoc_inbound_info_unused1_flag : integer := 1; -- Position of ... flag in info fifo entry, length is 1 bit
|
102 |
|
|
constant esoc_inbound_info_vlan_flag : integer := 0; -- Position of vlan tagged packet flag in info fifo entry, length is 1 bit
|
103 |
|
|
|
104 |
|
|
-- Entity ESoC Port Processor[Outbound Control] to ESoC Port Mal[Outbound]
|
105 |
|
|
-- Record stored in Info Fifo format (start positions)
|
106 |
|
|
constant esoc_outbound_info_length : integer := 4; -- Position of packet length in info fifo entry
|
107 |
|
|
constant esoc_outbound_info_length_size : integer := 12; -- Size of packet length in info fifo entry
|
108 |
|
|
constant esoc_outbound_info_unused3_flag : integer := 3; -- Position of ... flag in info fifo entry, length is 1 bit
|
109 |
|
|
constant esoc_outbound_info_unused2_flag : integer := 2; -- Position of ... flag in info fifo entry, length is 1 bit
|
110 |
|
|
constant esoc_outbound_info_vlan_flag : integer := 1; -- Position of vlan tagged packet flag in info fifo entry, length is 1 bit
|
111 |
|
|
constant esoc_outbound_info_error_flag : integer := 0; -- Position of error flag in info fifo entry, length is 1 bit
|
112 |
|
|
|
113 |
|
|
-- Entity ESoC Port Processor[Inbound Control] to ESoC Port Processor[Outbound Control]
|
114 |
|
|
-- Record prepended for each packet transferred over data bus (start positions)
|
115 |
|
|
constant esoc_dbus_packet_info_sport : integer := 32; -- Position of ESoC source port in prependeded packet info DWORD, length is 4 bits
|
116 |
|
|
constant esoc_dbus_packet_info_length : integer := 20; -- Position of packet length in prependeded packet info DWORD
|
117 |
|
|
constant esoc_dbus_packet_info_length_size : integer := 12; -- Size of packet length in prependeded packet info DWORD
|
118 |
|
|
constant esoc_dbus_packet_info_vlan_tci : integer := 4; -- Position of vlan tag in prependeded packet info DWORD, length is 16 bits
|
119 |
|
|
constant esoc_dbus_packet_info_unused3_flag : integer := 3; -- Position of ... flag in prependeded packet info DWORD, length is 1 bit
|
120 |
|
|
constant esoc_dbus_packet_info_unused2_flag : integer := 2; -- Position of ... flag in prependeded packet info DWORD, length is 1 bit
|
121 |
|
|
constant esoc_dbus_packet_info_unused1_flag : integer := 1; -- Position of ... flag in prependeded packet info DWORD, length is 1 bit
|
122 |
|
|
constant esoc_dbus_packet_info_vlan_flag : integer := 0; -- Position of vlan tagged packet flag in prependeded packet info DWORD, length is 1 bit
|
123 |
|
|
|
124 |
|
|
-- Entity ESoC Port Processor[Search] to ESoC Search Engine
|
125 |
|
|
-- Record transferred over search bus (start positions)
|
126 |
|
|
constant esoc_search_bus_sport : integer := 48; -- Position of ESoC source port, length is 16 bits
|
127 |
|
|
constant esoc_search_bus_vlan : integer := 48; -- Position of VLAN ID in table entry, length is 12 bit
|
128 |
|
|
constant esoc_search_bus_mac : integer := 0; -- Position of MAC address in table entry, length is 48 bit
|
129 |
|
|
|
130 |
|
|
-- Entity ESoC Search Engine configuration
|
131 |
|
|
constant esoc_search_engine_col_depth : integer := 7; -- Depth of collision buffer in number of entries, valid values 0 up to 7, results in a depth of 0 to 7 additional entries.
|
132 |
|
|
constant esoc_search_engine_hash_delay : integer := 1; -- Hash delay is determined by XOR tree and RAM latency (=1 clock)
|
133 |
|
|
|
134 |
|
|
-- Entity ESoC Search Engine
|
135 |
|
|
-- Record in MAC/VLAN Learning table
|
136 |
|
|
constant esoc_search_entry_valid : integer := 79; -- Position of entry valid flag in table entry, length is 1 bit
|
137 |
53 |
lmaarsen |
constant esoc_search_entry_aging : integer := 78; -- Position of update flag for aging protocol in table entry, length is 1 bit
|
138 |
42 |
lmaarsen |
constant esoc_search_entry_unused2 : integer := 77; --
|
139 |
|
|
constant esoc_search_entry_unused1 : integer := 76; --
|
140 |
|
|
constant esoc_search_entry_destination : integer := 60; -- Position of destination ports in table entry, length is 16 bit
|
141 |
|
|
constant esoc_search_entry_vlan : integer := 48; -- Position of VLAN ID in table entry, length is 12 bit
|
142 |
|
|
constant esoc_search_entry_mac : integer := 0; -- Position of MAC address in table entry, length is 48 bit
|
143 |
|
|
|
144 |
|
|
end package_esoc_configuration;
|
145 |
|
|
|
146 |
|
|
---------------------------------------------------------------------------------------------------------------
|
147 |
|
|
-- Package definitions
|
148 |
|
|
---------------------------------------------------------------------------------------------------------------
|
149 |
|
|
package body package_esoc_configuration is
|
150 |
|
|
|
151 |
|
|
end package_esoc_configuration;
|
152 |
|
|
|
153 |
|
|
|
154 |
|
|
|
155 |
|
|
|
156 |
|
|
|
157 |
|
|
|
158 |
|
|
|
159 |
|
|
|
160 |
|
|
|