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

Subversion Repositories xmatchpro

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

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

Line No. Rev Author Line
1 8 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       = MLD_LOGIC_3_1_2   --
19
--  version      = 1.0             --
20
--  last update  = 2/9/99                --
21
--  author       = Jose Nunez           --
22
--------------------------------------
23
 
24
 
25
-- FUNCTION
26
-- Match location decision logic.
27
-- This reads in the match types from each location in the CAM array
28
-- and decides which location provides the best hit in terms of the
29
-- minimum number of code bits output.
30
-- This is part 1 and only generates the propagation 
31
 
32
--  PIN LIST
33
--  TYPE_A/B/C/D = match type inputs. A = msb for each location
34
--                  D = lsb for each location.
35
--  DOWN_PRIORITY__6/5/4/3/2/1 = these are the priorities that have been propagated
36
--  COLUMN_OR = the result of the or of each column column 5 is full hit
37
 
38
library ieee,dzx;
39
use ieee.std_logic_1164.all;
40
use dzx.bit_utils.all;
41
 
42
 
43
entity MLD_LOGIC_3_1_2 is
44
port
45
(
46
      TYPE_A : in bit_vector(15 downto 0) ;
47
      TYPE_B : in bit_vector(15 downto 0) ;
48
      TYPE_C : in bit_vector(15 downto 0) ;
49
      TYPE_D : in bit_vector(15 downto 0) ;
50
          DOWN_PRIORITY_6 : out bit_vector(15 downto 0);
51
        DOWN_PRIORITY_5 : out bit_vector(15 downto 0);
52
          DOWN_PRIORITY_4 : out bit_vector(15 downto 0);
53
          DOWN_PRIORITY_3 : out bit_vector(15 downto 0);
54
          DOWN_PRIORITY_2 : out bit_vector(15 downto 0);
55
          DOWN_PRIORITY_1 : out bit_vector(15 downto 0);
56
          COLUMN_OR : out bit_vector(6 downto 1)
57
);
58
 
59
end MLD_LOGIC_3_1_2;
60
 
61
architecture DECIDE_3 of MLD_LOGIC_3_1_2 is
62
 
63
component MLD_DECODE
64
port
65
        (
66
        M_TYPE : in bit_vector(3 downto 0);
67
        PRIORITY : out bit_vector(5 downto 0)
68
        );
69
end component;
70
 
71
type MTYPE_ARRAY is array(0 to 15) of bit_vector(3 downto 0);
72
type PRI_ARRAY is array(0 to 15) of bit_vector(6 downto 1);
73
type PRI_TRANS_ARRAY is array(6 downto 1) of bit_vector(0 to 15);
74
 
75
signal MTYPE_IN : MTYPE_ARRAY;
76
signal PRIORITY : PRI_ARRAY;
77
signal TRANS_PRIORITY : PRI_TRANS_ARRAY;
78
-- signal SECOND_TRANS_PRI : PRI_TRANS_ARRAY;
79
 
80
begin
81
 
82
-- copy the 4 input vectors MTYPE_A/B/C/D into one array MTYPE_IN
83
-- also transpose the PRIORITY array
84
ASSIGN_ARRAYS : process (TYPE_A , TYPE_B , TYPE_C , TYPE_D)
85
begin
86
for I in 0 to 15 loop
87
        MTYPE_IN(I)(3) <= TYPE_A(I);
88
        MTYPE_IN(I)(2) <= TYPE_B(I);
89
        MTYPE_IN(I)(1) <= TYPE_C(I);
90
        MTYPE_IN(I)(0) <= TYPE_D(I);
91
end loop;
92
end process ASSIGN_ARRAYS;
93
 
94
ASSIGN2 : process (PRIORITY)
95
begin
96
for I in 6 downto 1 loop
97
        for J in 0 to 15 loop
98
                TRANS_PRIORITY(I)(J) <= PRIORITY(J)(I);
99
        end loop;
100
end loop;
101
end process ASSIGN2;
102
 
103
 
104
-- instantiate a match type to priority decoder for each location
105
PRI_DEC : for I in 0 to 15 generate
106
        LOC : MLD_DECODE port map (     M_TYPE => MTYPE_IN(I),
107
                                        PRIORITY => PRIORITY(I)
108
                                        );
109
end generate;
110
 
111
 
112
OR_GENERATION : for I in 1 to 6 generate
113
                        COLUMN_OR(I) <= Or_bits(TRANS_PRIORITY(I));
114
end generate;
115
 
116
 
117
DOWN_PRIORITY_6 <= TRANS_PRIORITY(6);
118
DOWN_PRIORITY_5 <= TRANS_PRIORITY(5);
119
DOWN_PRIORITY_4 <= TRANS_PRIORITY(4);
120
DOWN_PRIORITY_3 <= TRANS_PRIORITY(3);
121
DOWN_PRIORITY_2 <= TRANS_PRIORITY(2);
122
DOWN_PRIORITY_1 <= TRANS_PRIORITY(1);
123
 
124
 
125
end DECIDE_3;
126
 
127
 
128
 
129
 
130
 
131
 
132
 

powered by: WebSVN 2.1.0

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