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

Subversion Repositories udp_ip__core

[/] [udp_ip__core/] [trunk/] [UDP_IP_CORE/] [UDP_IP_CORE__Spartan3/] [IPV4_LUT_INDEXER.vhd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 NikosAl
----------------------------------------------------------------------------------
2
-- Company: 
3
-- Engineer: 
4
-- 
5
-- Create Date:    22:11:55 11/27/2009 
6
-- Design Name: 
7
-- Module Name:    IPV4_LUT_INDEXER - Behavioral 
8
-- Project Name: 
9
-- Target Devices: 
10
-- Tool versions: 
11
-- Description: 
12
--
13
-- Dependencies: 
14
--
15
-- Revision: 
16
-- Revision 0.01 - File Created
17
-- Additional Comments: 
18
--
19
----------------------------------------------------------------------------------
20
library IEEE;
21
use IEEE.STD_LOGIC_1164.ALL;
22
use IEEE.STD_LOGIC_ARITH.ALL;
23
use IEEE.STD_LOGIC_UNSIGNED.ALL;
24
 
25
---- Uncomment the following library declaration if instantiating
26
---- any Xilinx primitives in this code.
27
--library UNISIM;
28
--use UNISIM.VComponents.all;
29
 
30
entity IPV4_LUT_INDEXER is
31
    Port ( rst : in  STD_LOGIC;
32
           clk : in  STD_LOGIC;
33
           transmit_enable : in  STD_LOGIC;
34
           LUT_index : out  STD_LOGIC_VECTOR (5 downto 0));
35
end IPV4_LUT_INDEXER;
36
 
37
architecture Behavioral of IPV4_LUT_INDEXER is
38
 
39
component dist_mem_64x8 is
40
  port (
41
    clk : in STD_LOGIC := 'X';
42
    a : in STD_LOGIC_VECTOR ( 5 downto 0 );
43
    qspo : out STD_LOGIC_VECTOR ( 7 downto 0 )
44
  );
45
end component;
46
 
47
component COUNTER_6B_LUT_FIFO_MODE is
48
    Port ( rst : in  STD_LOGIC;
49
           clk : in  STD_LOGIC;
50
           funct_sel : in  STD_LOGIC; -- 0 for lut addressing, 1 for fifo addressing -- only LUT support is used
51
           count_en : in  STD_LOGIC;
52
           value_O : inout  STD_LOGIC_VECTOR (5 downto 0));
53
end component;
54
 
55
component comp_6b_equal is
56
  port (
57
    qa_eq_b : out STD_LOGIC;
58
    clk : in STD_LOGIC := 'X';
59
    a : in STD_LOGIC_VECTOR ( 5 downto 0 );
60
    b : in STD_LOGIC_VECTOR ( 5 downto 0 )
61
  );
62
end component;
63
 
64
signal count_en_sig , count_end , rst_counter: std_logic :='0';
65
signal count_val: std_logic_Vector(5 downto 0):=(others=>'0');
66
signal count_en_sig_comb : std_logic;
67
constant lut_upper_address :std_logic_vector(5 downto 0):="100110"; -- position 38
68
 
69
begin
70
 
71
process(clk)
72
begin
73
if (rst='1' or count_end='1') then
74
        count_en_sig<='0';
75
        rst_counter<='1';
76
else
77
   rst_counter<='0';
78
        if clk'event and clk='1' then
79
                if (transmit_enable='1' and count_en_sig='0') then
80
                        count_en_sig<='1';
81
                end if;
82
        end if;
83
end if;
84
end process;
85
 
86
LUT_END_CHECK : comp_6b_equal port map (
87
qa_eq_b =>count_end,
88
    clk =>clk,
89
    a =>count_val,
90
    b =>lut_upper_address
91
 
92
);
93
 
94
count_en_sig_comb <=count_en_sig or transmit_enable;
95
 
96
 
97
 
98
LUT_INDEXER_MODULE : COUNTER_6B_LUT_FIFO_MODE port map (
99
        rst => rst_counter,
100
   clk => clk,
101
   funct_sel =>'0', -- for now only one function is supported
102
   count_en =>count_en_sig_comb,
103
   value_O =>count_val
104
);
105
 
106
LUT_index<=count_val;
107
 
108
 
109
end Behavioral;
110
 

powered by: WebSVN 2.1.0

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