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

Subversion Repositories esoc

[/] [esoc/] [trunk/] [Sources/] [logixa/] [esoc_search_engine_sa_store.vhd] - Rev 46

Go to most recent revision | Compare with Previous | Blame | View Log

--------------------------------------------------------------------------------
----                                                                        ----
---- Ethernet Switch on Configurable Logic IP Core                          ----
----                                                                        ----
---- This file is part of the ESoCL project                                 ----
---- http://www.opencores.org/cores/esoc/                                   ----
----                                                                        ----
---- Description: see design description ESoCL_dd_71022001.pdf              ----
----                                                                        ----
---- To Do: see roadmap description ESoCL_dd_71022001.pdf                   ----
----        and/or release bulleting ESoCL_rb_71022001.pdf                  ----
----                                                                        ----
---- Author(s): L.Maarsen                                                   ----
---- Bert Maarsen, lmaarsen@opencores.org                                   ----
----                                                                        ----
--------------------------------------------------------------------------------
----                                                                        ----
---- Copyright (C) 2009 Authors and OPENCORES.ORG                           ----
----                                                                        ----
---- This source file may be used and distributed without                   ----
---- restriction provided that this copyright statement is not              ----
---- removed from the file and that any derivative work contains            ----
---- the original copyright notice and the associated disclaimer.           ----
----                                                                        ----
---- This source file is free software; you can redistribute it             ----
---- and/or modify it under the terms of the GNU Lesser General             ----
---- Public License as published by the Free Software Foundation;           ----
---- either version 2.1 of the License, or (at your option) any             ----
---- later version.                                                         ----
----                                                                        ----
---- This source is distributed in the hope that it will be                 ----
---- useful, but WITHOUT ANY WARRANTY; without even the implied             ----
---- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR                ----
---- PURPOSE. See the GNU Lesser General Public License for more            ----
---- details.                                                               ----
----                                                                        ----
---- You should have received a copy of the GNU Lesser General              ----
---- Public License along with this source; if not, download it             ----
---- from http://www.opencores.org/lgpl.shtml                               ----
----                                                                        ----
--------------------------------------------------------------------------------
-- Object        : Entity work.esoc_search_engine_sa_store
-- Last modified : Mon Apr 14 12:50:14 2014.
--------------------------------------------------------------------------------
 
 
 
library ieee, std, work;
use ieee.std_logic_1164.all;
use std.textio.all;
use ieee.numeric_std.all;
use work.package_esoc_configuration.all;
 
entity esoc_search_engine_sa_store is
  port(
    clk_search             : in     std_logic;
    reset                  : in     std_logic;
    search_eof             : in     std_logic;
    search_key             : in     std_logic_vector(63 downto 0);
    search_sa_overload_cnt : out    std_logic;
    search_sa_store_d      : out    STD_LOGIC_VECTOR(79 downto 0);
    search_sa_store_full   : in     STD_LOGIC;
    search_sa_store_wr     : out    STD_LOGIC;
    search_sof             : in     std_logic);
end entity esoc_search_engine_sa_store;
 
--------------------------------------------------------------------------------
-- Object        : Architecture work.esoc_search_engine_sa_store.esoc_search_engine_sa_store
-- Last modified : Mon Apr 14 12:50:14 2014.
--------------------------------------------------------------------------------
 
 
architecture esoc_search_engine_sa_store of esoc_search_engine_sa_store is
 
type   store_sa_states is (idle, wait_sa, wait_full);
signal store_sa_state: store_sa_states;
 
begin
 
--=============================================================================================================
-- Process		  : proces store SA address for further processing
-- Description	: 
--=============================================================================================================    
store_sa:   process(clk_search, reset)
            begin
              if reset = '1' then
                search_sa_store_wr        <= '0';
                search_sa_store_d         <= (others => '0');
                search_sa_overload_cnt    <= '0';
                store_sa_state            <= idle;
 
              elsif clk_search'event and clk_search = '1' then
                -- clear one-clock active signals
                search_sa_store_wr <= '0';
                search_sa_overload_cnt <= '0';
 
                -- define unused bits to avoid inferred latch warning during analysis & synthesis
                search_sa_store_d(esoc_search_entry_valid) <= '0';
                search_sa_store_d(esoc_search_entry_update) <= '0';
                search_sa_store_d(esoc_search_entry_unused2 downto esoc_search_entry_unused1) <= (others => '0');
 
                case store_sa_state is 
                  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!
                                      if search_sof = '1' then
                                        if search_sa_store_full = '0' then
                                          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);
                                          store_sa_state <= wait_sa;
                                        else
                                          search_sa_overload_cnt <= '1';
                                          store_sa_state <= wait_full;
                                        end if;
                                      end if;
 
                  when wait_sa    =>  -- get Source Port + SA and calculate hash pointer (additional delay may be required after synthesis, due to large XOR tree)  
                                      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);
                                      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);
                                      search_sa_store_wr <= '1';
                                      store_sa_state <= idle;
 
                  when wait_full  =>  if search_sa_store_full = '0' then
                                        store_sa_state <= idle;
                                      end if;
 
                  when others     =>  store_sa_state <= idle;
                end case;                      
              end if;
            end process;
end architecture esoc_search_engine_sa_store ; -- of esoc_search_engine_sa_store
 
 

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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