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

Subversion Repositories xmatchpro

[/] [xmatchpro/] [trunk/] [xmw4-comdec/] [xmatch_sim7/] [src/] [mask_word.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       = MASK_WORD    --
19
--  version      = 1.0         --
20
--  last update  = 3/05/01    --
21
--  author       = Jose Nunez  --
22
---------------------------------
23
 
24
 
25
-- FUNCTION
26
-- 4 bit mask element of the CAM array.
27
 
28
 
29
--  PIN LIST
30
--  SEARCH    = input search mask word
31
--  PREVIOUS  = mask word from the previous location in the array
32
--  MOVE      = movement control
33
--  CLEAR     = asynchronous clear of the data latch (active LOW)
34
--  CLK       = master clock
35
--  DOUT      = output of the mask latch
36
--  MATCH     = indicates a match between search bit and mask bit (active LOW)
37
 
38
 
39
library ieee;
40
use ieee.std_logic_1164.all;
41
library dzx;
42
use dzx.bit_utils.all;
43
 
44
entity MASK_WORD is
45
port
46
(
47
        SEARCH : in bit_vector(3 downto 0);
48
        PREVIOUS : in bit_vector(3 downto 0);
49
        MOVE : in bit;
50
        CLEAR : in bit ;
51
        RESET : in bit;
52
        CLK : in bit ;
53
        DOUT : out bit_vector(3 downto 0);
54
        SAME_LENGTH_2 : out bit;
55
        SAME_LENGTH_3 : out bit;
56
        SAME_LENGTH_4 : out bit;
57
        MATCH : out bit_vector(3 downto 0)
58
);
59
end MASK_WORD;
60
 
61
 
62
architecture WORD1 of MASK_WORD is
63
 
64
component MASK_BIT
65
port
66
(
67
        SEARCH : in bit;
68
        PREVIOUS : in bit;
69
        MOVE : in bit;
70
        CLEAR : in bit;
71
    RESET : in bit;
72
        CLK : in bit ;
73
        DOUT : out bit;
74
        MATCH : out bit
75
);
76
 
77
end component;
78
 
79
signal MATCH_AUX : bit_vector(3 downto 0);
80
 
81
signal SAME_LENGTH_2_AUX : bit;
82
 
83
signal SAME_LENGTH_3_AUX : bit;
84
 
85
signal SAME_LENGTH_4_AUX : bit;
86
 
87
signal SAME_LENGTH_AUX : bit;
88
 
89
 
90
 
91
signal DOUT_AUX : bit_vector(3 downto 0);
92
 
93
begin
94
 
95
M_WORD : for I in 3 downto 0 generate
96
 
97
        WORD_BIT: MASK_BIT
98
        port map
99
        (
100
                SEARCH =>SEARCH(I),
101
                PREVIOUS =>PREVIOUS(I),
102
                MOVE =>MOVE,
103
                CLEAR =>CLEAR,
104
                 RESET =>RESET,
105
                CLK =>CLK,
106
                DOUT =>DOUT_AUX(I),
107
                MATCH =>MATCH_AUX(I)
108
        );
109
 
110
end generate;
111
 
112
SAME_LENGTH_AUX <= nor_bits(SEARCH xor DOUT_AUX); -- same length detected
113
MATCH <= MATCH_AUX;
114
 
115
 
116
 
117
-- which length
118
 
119
 
120
SAME_LENGTH_2_AUX <= SEARCH(3) and SEARCH(2) and not(SEARCH(1)) and not(SEARCH(0));
121
 
122
SAME_LENGTH_3_AUX <= SEARCH(3) and SEARCH(2) and SEARCH(1) and not(SEARCH(0));
123
 
124
SAME_LENGTH_4_AUX <= SEARCH(3) and SEARCH(2) and SEARCH(1) and SEARCH(0);
125
 
126
 
127
 
128
 
129
 
130
SAME_LENGTH_2 <= SAME_LENGTH_AUX and SAME_LENGTH_2_AUX;
131
 
132
SAME_LENGTH_3 <= SAME_LENGTH_AUX and SAME_LENGTH_3_AUX;
133
 
134
SAME_LENGTH_4 <= SAME_LENGTH_AUX and SAME_LENGTH_4_AUX;
135
 
136
 
137
DOUT <= DOUT_AUX;
138
 
139
end WORD1;
140
 
141
 
142
 
143
 
144
 

powered by: WebSVN 2.1.0

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