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

Subversion Repositories the_wizardry_project

[/] [the_wizardry_project/] [trunk/] [Wizardry/] [VHDL/] [Wizardry Top Level/] [Address Generation/] [NIDS Components/] [EmPAC/] [lut_ppt.vhd] - Blame information for rev 19

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 19 mcwaccent
----------------------------------------------------------------------------------
2
--
3
--  This file is a part of Technica Corporation Wizardry Project
4
--
5
--  Copyright (C) 2004-2009, Technica Corporation  
6
--
7
--  This program is free software: you can redistribute it and/or modify
8
--  it under the terms of the GNU General Public License as published by
9
--  the Free Software Foundation, either version 3 of the License, or
10
--  (at your option) any later version.
11
--
12
--  This program is distributed in the hope that it will be useful,
13
--  but WITHOUT ANY WARRANTY; without even the implied warranty of
14
--  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
--  GNU General Public License for more details.
16
--
17
--  You should have received a copy of the GNU General Public License
18
--  along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
--
20
----------------------------------------------------------------------------------
21
----------------------------------------------------------------------------------
22
-- Module Name: lut_ppt - Behavioral 
23
-- Project Name: Wizardry
24
-- Target Devices: Virtex 4 ML401
25
-- Description: Keeps track of which ports have been encountered and 
26
-- Revision: 1.0
27
-- Additional Comments: 
28
--
29
----------------------------------------------------------------------------------library IEEE;
30
use IEEE.STD_LOGIC_1164.ALL;
31
use IEEE.STD_LOGIC_ARITH.ALL;
32
use IEEE.STD_LOGIC_UNSIGNED.ALL;
33
use work.port_block_constants.all;
34
---- Uncomment the following library declaration if instantiating
35
---- any Xilinx primitives in this code.
36
--library UNISIM;
37
--use UNISIM.VComponents.all;
38
 
39
entity lut_ppt is
40
    Port ( clock : in  STD_LOGIC;
41
           reset : in  STD_LOGIC;
42
           enable_lut_search : in  STD_LOGIC;
43
           load_lut : in  STD_LOGIC;
44
           lut_data : in  STD_LOGIC_VECTOR (16 downto 0);
45
           lut_info : out  lut_check;
46
           lut_ptr : out  integer range 0 to MAX_NUM_PORTS_2_FIND-1);
47
end lut_ppt;
48
 
49
architecture Behavioral of lut_ppt is
50
 
51
signal lut : array_table;
52
signal lut_ptr_s : integer range 0 to MAX_NUM_PORTS_2_FIND-1 := 0;
53
 
54
begin
55
 
56
--search_lut:process(clock,reset,enable_lut_search,lut,lut_data)
57
--variable lut_find : lut_check;
58
--begin
59
--      if reset = '1' then
60
--              lut_find.in_lut := false;
61
--              lut_find.lut_pointer := 0;
62
--      else
63
--              if rising_edge(clock) then
64
--                      if enable_lut_search = '1' then
65
--                              for i in 0 to MAX_NUM_PORTS_2_FIND -1 loop
66
--                                      if(lut(i) = lut_data) then
67
--                                              lut_find.in_lut := true;
68
--                                              lut_find.lut_pointer := i;
69
--                                              exit;
70
--                                      else
71
--                                              lut_find.in_lut := false;
72
--                                              lut_find.lut_pointer := 0;
73
--                                      end if;
74
--                              end loop;
75
--                      else
76
--                              lut_find := lut_find;
77
--                      end if;
78
--              end if;
79
--      end if;
80
--lut_info <= lut_find;
81
--end process;
82
 
83
search_lut:process(clock,reset,enable_lut_search,lut,lut_data)
84
variable lut_find : lut_check;
85
begin
86
        if reset = '1' then
87
                lut_find.in_lut := false;
88
                lut_find.lut_pointer := 0;
89
        else
90
                if rising_edge(clock) then
91
                        if enable_lut_search = '1' then
92
                                lut_find := check_lut(lut,lut_data);
93
                        else
94
                                lut_find := lut_find;
95
                        end if;
96
                end if;
97
        end if;
98
        lut_info <= lut_find;
99
end process;
100
 
101
process(clock,reset,load_lut,lut_ptr_s,lut_data)
102
begin
103
        if reset = '1' then
104
                lut_ptr_s <= 0;
105
        else
106
                if rising_edge(clock) then
107
                        if load_lut = '1' then
108
                                if lut_ptr_s = MAX_NUM_PORTS_2_FIND-1 then
109
                                        lut_ptr_s <= lut_ptr_s;
110
                                else
111
                                        lut_ptr_s <= lut_ptr_s + 1;
112
                                end if;
113
                        else
114
                                lut_ptr_s <= lut_ptr_s;
115
                        end if;
116
                end if;
117
        end if;
118
end process;
119
 
120
process(clock,reset,load_lut,lut_data,lut_ptr_s)
121
begin
122
        if rising_edge(clock) then
123
                if reset = '1' then
124
                        for i in 0 to MAX_NUM_PORTS_2_FIND-1 loop
125
                                lut(i) <= (others => '0');
126
                        end loop;
127
                elsif load_lut = '1' then
128
                        if lut_ptr_s = MAX_NUM_PORTS_2_FIND-1 then
129
                                lut(lut_ptr_s) <= lut(lut_ptr_s);
130
                        else
131
                                lut(lut_ptr_s) <= lut_data;
132
                        end if;
133
                else
134
                        lut(lut_ptr_s) <= lut(lut_ptr_s);
135
                end if;
136
        end if;
137
end process;
138
 
139
lut_ptr <= lut_ptr_s;
140
end Behavioral;
141
 
142
------------------------------------------------------------------------------------
143
---- Company: 
144
---- Engineer: 
145
---- 
146
---- Create Date:    16:02:26 03/18/2008 
147
---- Design Name: 
148
---- Module Name:    lut_ppt - Behavioral 
149
---- Project Name: 
150
---- Target Devices: 
151
---- Tool versions: 
152
---- Description: 
153
----
154
---- Dependencies: 
155
----
156
---- Revision: 
157
---- Revision 0.01 - File Created
158
---- Additional Comments: 
159
----
160
------------------------------------------------------------------------------------
161
--library IEEE;
162
--use IEEE.STD_LOGIC_1164.ALL;
163
--use IEEE.STD_LOGIC_ARITH.ALL;
164
--use IEEE.STD_LOGIC_UNSIGNED.ALL;
165
--use work.port_block_constants.all;
166
------ Uncomment the following library declaration if instantiating
167
------ any Xilinx primitives in this code.
168
----library UNISIM;
169
----use UNISIM.VComponents.all;
170
--
171
--entity lut_ppt is
172
--    Port ( clock : in  STD_LOGIC;
173
--           reset : in  STD_LOGIC;
174
--           enable_lut_search : in  STD_LOGIC;
175
--           load_lut : in  STD_LOGIC;
176
--           lut_data : in  STD_LOGIC_VECTOR (16 downto 0);
177
--           lut_info : out  lut_check;
178
--           lut_ptr : out  integer range 0 to MAX_NUM_PORTS_2_FIND-1);
179
--end lut_ppt;
180
--
181
--architecture Behavioral of lut_ppt is
182
--
183
--signal lut : array_table;
184
--signal lut_ptr_s : integer range 0 to MAX_NUM_PORTS_2_FIND-1 := 0;
185
--
186
--begin
187
--
188
--search_lut:process(clock,reset,load_lut,enable_lut_search,lut_ptr_s)
189
--variable lut_find : lut_check;
190
--variable lut_ptr_v : integer;
191
--begin
192
--              if reset = '1' then
193
--                      lut_ptr_s <= 0;
194
--                      lut_find.in_lut := false;
195
--                      lut_find.lut_pointer := 0;
196
--                      for i in 0 to MAX_NUM_PORTS_2_FIND-1 loop
197
--                              lut(i) <= (others => '0');
198
--                      end loop;
199
--                      
200
--              elsif rising_Edge(clock) then
201
--                      if enable_lut_search = '1' then--search lut--_empty_delay_0 = '0' then
202
--                                      lut_find := check_lut(lut,lut_data);
203
--                      else
204
--                              lut_find := lut_find;
205
--                      end if;
206
--                      
207
--                      if (load_lut = '1') then        --store value into lut
208
--                              if lut_ptr_s = MAX_NUM_PORTS_2_FIND-1 then
209
--                                      lut(lut_ptr_s) <= lut(lut_ptr_s);
210
--                                      lut_ptr_s <= lut_ptr_s;
211
--                              else
212
--                                      lut(lut_ptr_s) <= lut_data;
213
--                                      lut_ptr_s <= lut_ptr_s + 1;
214
--                              end if;
215
--                      else
216
--                                      lut(lut_ptr_s) <= lut(lut_ptr_s);
217
--                                      lut_ptr_s <= lut_ptr_s;
218
--                      end if;
219
----                            else --everything remains the same
220
----                                    lut_find.in_lut := lut_find.in_lut;
221
----                                    lut_find.lut_pointer := lut_find.lut_pointer;
222
----                                    lut(lut_ptr) <= lut(lut_ptr);
223
----                                    lut_ptr <= lut_ptr;
224
----                    end if;
225
--              end if;
226
----    end if;
227
--      lut_info <= lut_find;
228
--end process;
229
--lut_ptr <= lut_ptr_s;
230
--end Behavioral;
231
 

powered by: WebSVN 2.1.0

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