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

Subversion Repositories xmatchpro

[/] [xmatchpro/] [trunk/] [xmw4-comdec/] [xmatch_sim7/] [src/] [RLI_DCU.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       =  RLI_DCU    --
19
--  version      =  1.0        --
20
--  last update  =  25/11/99   --
21
--  author       =  Jose Nunez --
22
---------------------------------
23
 
24
 
25
-- FUNCTION
26
-- RLI decoding control unit
27
 
28
 
29
--  PIN LIST
30
--  RL_DETECTED : detection of a RL code in the main decoder
31
--  LOCATION_IN : decoded location in the main decoder
32
--  MATCH_TYPE_IN : decoded match type in the main decoder
33
--  END_COUNT : end of RLI count indication
34
--  CLEAR : asyncronus clear 
35
--  CLK : master clock
36
--  LOCATION_OUT : location output of the DCU
37
--  MATCH_TYPE_OUT : match type output of the DCU
38
--  SET_LENGTH_TO_ZERO : run length active no more data needed
39
 
40
 
41
library ieee;
42
use ieee.std_logic_1164.all;
43
 
44
entity RLI_DCU is
45
port
46
(
47
      RL_DETECTED : in bit;
48
      LOCATION_IN : in bit_vector(3 downto 0);
49
      MATCH_TYPE_IN : in bit_vector(3 downto 0);
50
        MASK_IN : in bit_vector(4 downto 0);
51
        FULL_HIT_IN : in bit;
52
          END_COUNT : in bit;
53
          CLEAR : in bit;
54
          RESET : in bit;
55
          CLK : in bit ;
56
          LOCATION_OUT : out bit_vector(3 downto 0);
57
          MATCH_TYPE_OUT : out bit_vector(3 downto 0);
58
          MASK_OUT : out bit_vector(4 downto 0);
59
          FULL_HIT_OUT : out bit;
60
          SET_LENGTH_TO_ZERO : out bit
61
);
62
end RLI_DCU;
63
 
64
architecture STRUCTURAL of RLI_DCU is
65
 
66
signal CURRENT_STATE : bit_vector(1 downto 0);
67
signal NEXT_STATE : bit_vector(1 downto 0);
68
 
69
 
70
begin
71
 
72
STATES : process (FULL_HIT_IN,RL_DETECTED,CURRENT_STATE,LOCATION_IN,MATCH_TYPE_IN,END_COUNT)
73
begin
74
case CURRENT_STATE is
75
        when "00" =>  -- state 0 normal output
76
                if (RL_DETECTED = '1') then
77
                        NEXT_STATE <= "01";
78
                else
79
                        NEXT_STATE <= CURRENT_STATE;
80
                end if;
81
                LOCATION_OUT <= LOCATION_IN;
82
                MATCH_TYPE_OUT <= MATCH_TYPE_IN;
83
                FULL_HIT_OUT <= FULL_HIT_IN;
84
                SET_LENGTH_TO_ZERO <= '0';
85
 
86
         when "01" =>  -- state 1 length set to zero
87
                if (END_COUNT = '1') then
88
                        NEXT_STATE <= "00";
89
                else
90
                        NEXT_STATE <= CURRENT_STATE;
91
                end if;
92
                LOCATION_OUT <= LOCATION_IN;
93
                MATCH_TYPE_OUT <= "0000";
94
                FULL_HIT_OUT <= '0'; -- active at zero
95
                SET_LENGTH_TO_ZERO <= '1';
96
        when "10" =>
97
                NEXT_STATE <= "00";
98
                LOCATION_OUT <= "0000";
99
                MATCH_TYPE_OUT <= "0000";
100
                FULL_HIT_OUT <= '0';
101
                SET_LENGTH_TO_ZERO <= '0';
102
 
103
        when others =>
104
 
105
                NEXT_STATE <= "00";
106
                LOCATION_OUT <= "0000";
107
                MATCH_TYPE_OUT <= "0000";
108
                SET_LENGTH_TO_ZERO <= '0';
109
                FULL_HIT_OUT <= '1';
110
 
111
 
112
 
113
end  case;
114
end process STATES;
115
 
116
MASK_OUT <= MASK_IN;
117
 
118
FLIP_FLOPS : process(CLK, CLEAR, NEXT_STATE)
119
begin
120
 
121
if (CLEAR = '0') then
122
        CURRENT_STATE <= "00"; --state 0
123
elsif ((CLK'event) and (CLK='1')) then
124
        if (RESET = '0') then
125
                CURRENT_STATE <= "00"; --state 0
126
        else
127
                CURRENT_STATE <= NEXT_STATE;
128
        end if;
129
end if;
130
 
131
end process FLIP_FLOPS;
132
 
133
 
134
 
135
 
136
 
137
end STRUCTURAL;
138
 

powered by: WebSVN 2.1.0

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