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

Subversion Repositories esoc

[/] [esoc/] [trunk/] [Sources/] [logixa/] [esoc_search_engine_sa_store.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_sa_store
19 53 lmaarsen
-- Last modified : Tue Aug 19 08:05:17 2014.
20 42 lmaarsen
--------------------------------------------------------------------------------
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_sa_store is
31
  port(
32
    clk_search             : in     std_logic;
33
    reset                  : in     std_logic;
34
    search_eof             : in     std_logic;
35
    search_key             : in     std_logic_vector(63 downto 0);
36
    search_sa_overload_cnt : out    std_logic;
37
    search_sa_store_d      : out    STD_LOGIC_VECTOR(79 downto 0);
38
    search_sa_store_full   : in     STD_LOGIC;
39
    search_sa_store_wr     : out    STD_LOGIC;
40
    search_sof             : in     std_logic);
41
end entity esoc_search_engine_sa_store;
42
 
43
--------------------------------------------------------------------------------
44
-- Object        : Architecture work.esoc_search_engine_sa_store.esoc_search_engine_sa_store
45 53 lmaarsen
-- Last modified : Tue Aug 19 08:05:17 2014.
46 42 lmaarsen
--------------------------------------------------------------------------------
47
 
48
 
49
architecture esoc_search_engine_sa_store of esoc_search_engine_sa_store is
50
 
51
type   store_sa_states is (idle, wait_sa, wait_full);
52
signal store_sa_state: store_sa_states;
53
 
54
begin
55
 
56
--=============================================================================================================
57
-- Process                : proces store SA address for further processing
58
-- Description  : 
59
--=============================================================================================================    
60
store_sa:   process(clk_search, reset)
61
            begin
62
              if reset = '1' then
63
                search_sa_store_wr        <= '0';
64
                search_sa_store_d         <= (others => '0');
65
                search_sa_overload_cnt    <= '0';
66
                store_sa_state            <= idle;
67
 
68
              elsif clk_search'event and clk_search = '1' then
69
                -- clear one-clock active signals
70
                search_sa_store_wr <= '0';
71
                search_sa_overload_cnt <= '0';
72
 
73
                -- define unused bits to avoid inferred latch warning during analysis & synthesis
74
                search_sa_store_d(esoc_search_entry_valid) <= '0';
75 53 lmaarsen
                search_sa_store_d(esoc_search_entry_aging) <= '0';
76 42 lmaarsen
                search_sa_store_d(esoc_search_entry_unused2 downto esoc_search_entry_unused1) <= (others => '0');
77
 
78
                case store_sa_state is
79
                  when idle       =>  -- wait for start of frame, first data is VID + DA, skip DA, store VID, wait for SA and port number ... report when storage is full!
80
                                      if search_sof = '1' then
81
                                        if search_sa_store_full = '0' then
82
                                          search_sa_store_d(esoc_search_entry_vlan+11 downto esoc_search_entry_vlan) <= search_key(esoc_search_bus_vlan+11 downto esoc_search_bus_vlan);
83
                                          store_sa_state <= wait_sa;
84
                                        else
85
                                          search_sa_overload_cnt <= '1';
86
                                          store_sa_state <= wait_full;
87
                                        end if;
88
                                      end if;
89
 
90
                  when wait_sa    =>  -- get Source Port + SA and calculate hash pointer (additional delay may be required after synthesis, due to large XOR tree)  
91
                                      search_sa_store_d(esoc_search_entry_destination+15 downto esoc_search_entry_destination) <= search_key(esoc_search_bus_sport+15 downto esoc_search_bus_sport);
92
                                      search_sa_store_d(esoc_search_entry_mac+47 downto esoc_search_entry_mac)                 <= search_key(esoc_search_bus_mac+47 downto esoc_search_bus_mac);
93
                                      search_sa_store_wr <= '1';
94
                                      store_sa_state <= idle;
95
 
96
                  when wait_full  =>  if search_sa_store_full = '0' then
97
                                        store_sa_state <= idle;
98
                                      end if;
99
 
100
                  when others     =>  store_sa_state <= idle;
101
                end case;
102
              end if;
103
            end process;
104
end architecture esoc_search_engine_sa_store ; -- of esoc_search_engine_sa_store
105
 

powered by: WebSVN 2.1.0

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