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

Subversion Repositories xmatchpro

[/] [xmatchpro/] [trunk/] [xmw4-comdec/] [xmatch_sim7/] [src/] [nfl_counters2.vhd] - Blame information for rev 9

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 9 eejlny
--This library is free software; you can redistribute it and/or
2
--modify it under the terms of the GNU Lesser General Public
3
--License as published by the Free Software Foundation; either
4
--version 2.1 of the License, or (at your option) any later version.
5
 
6
--This library is distributed in the hope that it will be useful,
7
--but WITHOUT ANY WARRANTY; without even the implied warranty of
8
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
9
--Lesser General Public License for more details.
10
 
11
--You should have received a copy of the GNU Lesser General Public
12
--License along with this library; if not, write to the Free Software
13
--Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
14
 
15
-- e_mail : j.l.nunez-yanez@byacom.co.uk
16
 
17
------------------------------------
18
--  ENTITY       = NFL_COUNTERS2  --
19
--  version      = 2.0            --
20
--  last update  = 08/08/01       --
21
--  author       = Jose Nunez     --
22
------------------------------------
23
 
24
 
25
-- FUNCTION
26
-- synchronous counters to provide the next free location (NFL)
27
-- and next free location minus 1 (NFL_MINUS_ONE).
28
 
29
--  PIN LIST
30
--  INC           = synchronous increment of counters (active HIGH).
31
--  COUNT_ENABLE  = enable counting (active LOW).
32
--  CLK           = master clock.
33
--  RESET         = asynchronous reset of counters (active LOW).
34
--  NFL_MINUS_ONE = next free location minus one.
35
--  TABLE_FULL    = indicates that the table is full and the counters have been frozen
36
 
37
library ieee,dzx;
38
use ieee.std_logic_1164.all;
39
use dzx.bit_arith.all;
40
use dzx.attributes.all;
41
 
42
entity NFL_COUNTERS2 is
43
port
44
(
45
      INC : in bit ;
46
      COUNT_ENABLE : in bit ;
47
      CLK : in bit ;
48
      RESET : in bit ;
49
      CLEAR : in bit;
50
      NFL_MINUS_ONE : out bit_vector(7 downto 0) ;
51
      TABLE_FULL : out bit
52
);
53
 
54
 
55
end NFL_COUNTERS2;
56
 
57
 
58
 
59
architecture COUNT3 of NFL_COUNTERS2 is
60
 
61
 
62
 
63
signal TEMP_NFL_M_ONE : bit_vector(7 downto 0);
64
 
65
 
66
 
67
 
68
begin
69
 
70
 
71
 
72
 
73
COUNTERS : process ( CLK , CLEAR)
74
 
75
 
76
 
77
begin
78
 
79
-- CAM array starts with 1 valid locations 
80
 
81
if (CLEAR = '0') then
82
 
83
        TEMP_NFL_M_ONE <= "00000000";
84
 
85
elsif ((CLK'event) and (CLK = '1')) then
86
 
87
 
88
 
89
                if( RESET = '0') then
90
 
91
 
92
 
93
                        TEMP_NFL_M_ONE <= "00000000";
94
 
95
 
96
                elsif ((INC = '1') and (COUNT_ENABLE = '0')) then            -- INC is full match active at one
97
 
98
                        if (TEMP_NFL_M_ONE = "00001111") then
99
 
100
                                TEMP_NFL_M_ONE <= TEMP_NFL_M_ONE;
101
 
102
                        else
103
 
104
                                TEMP_NFL_M_ONE <= TEMP_NFL_M_ONE + "00000001";
105
 
106
                        end if;
107
 
108
                end if;
109
 
110
end if;
111
 
112
end process COUNTERS;
113
 
114
 
115
TABLE_FULL <= '0' when TEMP_NFL_M_ONE = "00001111" else '1';
116
 
117
NFL_MINUS_ONE <= TEMP_NFL_M_ONE;
118
 
119
 
120
 
121
 
122
 
123
end COUNT3;
124
 
125
 

powered by: WebSVN 2.1.0

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