OpenCores
URL https://opencores.org/ocsvn/esoc/esoc/trunk

Subversion Repositories esoc

[/] [esoc/] [trunk/] [Sources/] [logixa/] [esoc_search_engine.vhd] - Blame information for rev 53

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 42 lmaarsen
--------------------------------------------------------------------------------
2 53 lmaarsen
--
3
-- This VHDL file was generated by EASE/HDL 7.4 Revision 4 from HDL Works B.V.
4
--
5
-- Ease library  : work
6
-- HDL library   : work
7
-- Host name     : S212065
8
-- User name     : df768
9
-- Time stamp    : Tue Aug 19 08:05:18 2014
10
--
11
-- Designed by   : L.Maarsen
12
-- Company       : LogiXA
13
-- Project info  : eSoC
14
--
15 42 lmaarsen
--------------------------------------------------------------------------------
16 53 lmaarsen
 
17 42 lmaarsen
--------------------------------------------------------------------------------
18
-- Object        : Entity work.esoc_search_engine
19
-- Last modified : Mon Apr 14 12:49:54 2014.
20
--------------------------------------------------------------------------------
21
 
22
 
23
 
24
library ieee, std, work;
25
use ieee.std_logic_1164.all;
26
use std.textio.all;
27
use ieee.numeric_std.all;
28
use work.package_esoc_configuration.all;
29
 
30
entity esoc_search_engine is
31
  port(
32
    clk_control         : in     std_logic;
33
    clk_search          : in     std_logic;
34
    ctrl_address        : in     std_logic_vector(15 downto 0);
35
    ctrl_rd             : in     std_logic;
36
    ctrl_rddata         : out    std_logic_vector(31 downto 0);
37
    ctrl_wait           : out    std_logic;
38
    ctrl_wr             : in     std_logic;
39
    ctrl_wrdata         : in     std_logic_vector(31 downto 0);
40
    reset               : in     std_logic;
41
    search_eof          : in     std_logic;
42
    search_key          : in     std_logic_vector(63 downto 0);
43
    search_port_stalled : in     std_logic_vector(esoc_port_count-1 downto 0);
44
    search_result       : out    std_logic_vector(esoc_port_count-1 downto 0);
45
    search_result_av    : out    std_logic;
46
    search_sof          : in     std_logic);
47
end entity esoc_search_engine;
48
 
49
--------------------------------------------------------------------------------
50
-- Object        : Architecture work.esoc_search_engine.esoc_search
51
-- Last modified : Mon Apr 14 12:49:54 2014.
52
--------------------------------------------------------------------------------
53
 
54
architecture esoc_search of esoc_search_engine is
55
 
56
  signal q_b                       : STD_LOGIC_VECTOR(79 downto 0);
57
  signal sa_wren                   : STD_LOGIC := '1';
58
  signal data_b                    : STD_LOGIC_VECTOR(79 downto 0);
59
  signal address_b                 : STD_LOGIC_VECTOR(12 downto 0);
60
  signal wren_a                    : STD_LOGIC := '1';
61
  signal address_a                 : STD_LOGIC_VECTOR(12 downto 0);
62
  signal data_a                    : STD_LOGIC_VECTOR(79 downto 0);
63
  signal q_a                       : STD_LOGIC_VECTOR(79 downto 0);
64
  signal search_sa_drop_cnt        : std_logic;
65
  signal search_entry_age_time     : std_logic_vector(11 downto 0);
66
  signal wrreq                     : STD_LOGIC;
67
  signal data                      : STD_LOGIC_VECTOR(79 downto 0);
68
  signal wrfull                    : STD_LOGIC;
69
  signal rdreq                     : std_logic;
70
  signal q                         : STD_LOGIC_VECTOR(79 downto 0);
71
  signal rdempty                   : STD_LOGIC;
72
  signal search_sa_overload_cnt    : std_logic;
73
  signal rdusedw                   : STD_LOGIC_VECTOR(6 downto 0);
74
  signal search_entry_age_time_ena : std_logic;
75
  signal clk_en                    : std_logic;
76
  signal esoc_clk_en_gen_div       : integer;
77
  signal Net_0                     : STD_LOGIC;
78
  signal rden_b                    : STD_LOGIC := '1';
79
 
80
  component esoc_search_engine_da
81
    port(
82
      clk_search           : in     std_logic;
83
      reset                : in     std_logic;
84
      search_eof           : in     std_logic;
85
      search_key           : in     std_logic_vector(63 downto 0);
86
      search_port_stalled  : in     std_logic_vector(esoc_port_count-1 downto 0);
87
      search_result        : out    std_logic_vector(esoc_port_count-1 downto 0);
88
      search_result_av     : out    std_logic;
89
      search_sof           : in     std_logic;
90
      search_table_address : out    STD_LOGIC_VECTOR(12 downto 0);
91
      search_table_data    : out    STD_LOGIC_VECTOR(79 downto 0);
92
      search_table_q       : in     STD_LOGIC_VECTOR(79 downto 0);
93
      search_table_rden    : out    STD_LOGIC;
94
      search_table_wren    : out    STD_LOGIC);
95
  end component esoc_search_engine_da;
96
 
97
  component esoc_search_engine_sa
98
    port(
99
      clk_search                : in     std_logic;
100
      reset                     : in     std_logic;
101
      search_aging_tick         : in     std_logic;
102
      search_entry_age_time     : in     std_logic_vector(11 downto 0);
103
      search_entry_age_time_ena : in     std_logic;
104
      search_sa_drop_cnt        : out    std_logic;
105
      search_sa_store_empty     : in     std_logic;
106
      search_sa_store_q         : in     std_logic_vector(79 downto 0);
107
      search_sa_store_rd        : out    std_logic;
108
      search_sa_store_words     : in     STD_LOGIC_VECTOR(6 downto 0);
109
      search_table_address      : out    STD_LOGIC_VECTOR(12 downto 0);
110
      search_table_data         : out    STD_LOGIC_VECTOR(79 downto 0);
111
      search_table_q            : in     STD_LOGIC_VECTOR(79 downto 0);
112
      search_table_rden         : out    STD_LOGIC;
113
      search_table_wren         : out    STD_LOGIC);
114
  end component esoc_search_engine_sa;
115
 
116
  component esoc_search_engine_control
117
    port(
118
      clk_control               : in     std_logic;
119
      clk_search                : in     std_logic;
120
      ctrl_address              : in     std_logic_vector(15 downto 0);
121
      ctrl_rd                   : in     std_logic;
122
      ctrl_rddata               : out    std_logic_vector(31 downto 0);
123
      ctrl_wait                 : out    std_logic;
124
      ctrl_wr                   : in     std_logic;
125
      ctrl_wrdata               : in     std_logic_vector(31 downto 0);
126
      reset                     : in     std_logic;
127
      search_entry_age_time     : out    std_logic_vector(11 downto 0);
128
      search_entry_age_time_ena : out    std_logic;
129
      search_sa_drop_cnt        : in     std_logic;
130
      search_sa_overload_cnt    : in     std_logic);
131
  end component esoc_search_engine_control;
132
 
133
  component esoc_ram_8kx80
134
    port(
135
      address_a : in     STD_LOGIC_VECTOR(12 downto 0);
136
      address_b : in     STD_LOGIC_VECTOR(12 downto 0);
137
      data_a    : in     STD_LOGIC_VECTOR(79 downto 0);
138
      data_b    : in     STD_LOGIC_VECTOR(79 downto 0);
139
      wren_a    : in     STD_LOGIC := '0';
140
      wren_b    : in     STD_LOGIC := '0';
141
      q_a       : out    STD_LOGIC_VECTOR(79 downto 0);
142
      q_b       : out    STD_LOGIC_VECTOR(79 downto 0);
143
      clock     : in     STD_LOGIC := '1';
144
      rden_a    : in     STD_LOGIC := '1';
145
      rden_b    : in     STD_LOGIC := '1');
146
  end component esoc_ram_8kx80;
147
 
148
  component esoc_search_engine_sa_store
149
    port(
150
      clk_search             : in     std_logic;
151
      reset                  : in     std_logic;
152
      search_eof             : in     std_logic;
153
      search_key             : in     std_logic_vector(63 downto 0);
154
      search_sa_overload_cnt : out    std_logic;
155
      search_sa_store_d      : out    STD_LOGIC_VECTOR(79 downto 0);
156
      search_sa_store_full   : in     STD_LOGIC;
157
      search_sa_store_wr     : out    STD_LOGIC;
158
      search_sof             : in     std_logic);
159
  end component esoc_search_engine_sa_store;
160
 
161
  component esoc_fifo_128x80
162
    port(
163
      aclr    : in     STD_LOGIC := '0';
164
      data    : in     STD_LOGIC_VECTOR(79 downto 0);
165
      rdclk   : in     STD_LOGIC;
166
      rdreq   : in     STD_LOGIC;
167
      wrclk   : in     STD_LOGIC;
168
      wrreq   : in     STD_LOGIC;
169
      q       : out    STD_LOGIC_VECTOR(79 downto 0);
170
      rdempty : out    STD_LOGIC;
171
      rdusedw : out    STD_LOGIC_VECTOR(6 downto 0);
172
      wrfull  : out    STD_LOGIC;
173
      wrusedw : out    STD_LOGIC_VECTOR(6 downto 0));
174
  end component esoc_fifo_128x80;
175
 
176
  component esoc_clk_en_gen
177
    port(
178
      clk     : in     std_logic;
179
      clk_div : in     integer;
180
      clk_en  : out    std_logic;
181
      reset   : in     std_logic);
182
  end component esoc_clk_en_gen;
183
 
184
begin
185
  --Destination MAC 
186
  --Address Processing
187
  --Source MAC Address 
188
  --Processing and aging control
189
  --MAC Address Table
190
  --Search Engine Control
191
  --SA, VID and 
192
  --Source port buffer 
193
  esoc_clk_en_gen_div <= clk_search_en_div_1s when esoc_mode = normal else clk_search_en_div_1s_sim;
194
 
195
  u0: esoc_search_engine_da
196
    port map(
197
      clk_search           => clk_search,
198
      reset                => reset,
199
      search_eof           => search_eof,
200
      search_key           => search_key,
201
      search_port_stalled  => search_port_stalled,
202
      search_result        => search_result,
203
      search_result_av     => search_result_av,
204
      search_sof           => search_sof,
205
      search_table_address => address_a,
206
      search_table_data    => data_a,
207
      search_table_q       => q_a,
208
      search_table_rden    => Net_0,
209
      search_table_wren    => wren_a);
210
 
211
  u1: esoc_search_engine_sa
212
    port map(
213
      clk_search                => clk_search,
214
      reset                     => reset,
215
      search_aging_tick         => clk_en,
216
      search_entry_age_time     => search_entry_age_time,
217
      search_entry_age_time_ena => search_entry_age_time_ena,
218
      search_sa_drop_cnt        => search_sa_drop_cnt,
219
      search_sa_store_empty     => rdempty,
220
      search_sa_store_q         => q,
221
      search_sa_store_rd        => rdreq,
222
      search_sa_store_words     => rdusedw,
223
      search_table_address      => address_b,
224
      search_table_data         => data_b,
225
      search_table_q            => q_b,
226
      search_table_rden         => rden_b,
227
      search_table_wren         => sa_wren);
228
 
229
  u3: esoc_search_engine_control
230
    port map(
231
      clk_control               => clk_control,
232
      clk_search                => clk_search,
233
      ctrl_address              => ctrl_address,
234
      ctrl_rd                   => ctrl_rd,
235
      ctrl_rddata               => ctrl_rddata,
236
      ctrl_wait                 => ctrl_wait,
237
      ctrl_wr                   => ctrl_wr,
238
      ctrl_wrdata               => ctrl_wrdata,
239
      reset                     => reset,
240
      search_entry_age_time     => search_entry_age_time,
241
      search_entry_age_time_ena => search_entry_age_time_ena,
242
      search_sa_drop_cnt        => search_sa_drop_cnt,
243
      search_sa_overload_cnt    => search_sa_overload_cnt);
244
 
245
  u2: esoc_ram_8kx80
246
    port map(
247
      address_a => address_a,
248
      address_b => address_b,
249
      data_a    => data_a,
250
      data_b    => data_b,
251
      wren_a    => wren_a,
252
      wren_b    => sa_wren,
253
      q_a       => q_a,
254
      q_b       => q_b,
255
      clock     => clk_search,
256
      rden_a    => Net_0,
257
      rden_b    => rden_b);
258
 
259
  u5: esoc_search_engine_sa_store
260
    port map(
261
      clk_search             => clk_search,
262
      reset                  => reset,
263
      search_eof             => search_eof,
264
      search_key             => search_key,
265
      search_sa_overload_cnt => search_sa_overload_cnt,
266
      search_sa_store_d      => data,
267
      search_sa_store_full   => wrfull,
268
      search_sa_store_wr     => wrreq,
269
      search_sof             => search_sof);
270
 
271
  u6: esoc_fifo_128x80
272
    port map(
273
      aclr    => reset,
274
      data    => data,
275
      rdclk   => clk_search,
276
      rdreq   => rdreq,
277
      wrclk   => clk_search,
278
      wrreq   => wrreq,
279
      q       => q,
280
      rdempty => rdempty,
281
      rdusedw => rdusedw,
282
      wrfull  => wrfull,
283
      wrusedw => open);
284
 
285
  u7: esoc_clk_en_gen
286
    port map(
287
      clk     => clk_search,
288
      clk_div => esoc_clk_en_gen_div,
289
      clk_en  => clk_en,
290
      reset   => reset);
291
 
292
end architecture esoc_search ; -- of esoc_search_engine
293
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.