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

Subversion Repositories xmatchpro

[/] [xmatchpro/] [trunk/] [xmw4-comdec/] [xmatch_sim7/] [src/] [parsing_unit.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       = PARSING_UNIT            --
19
--  version      = 1.0                     --
20
--  last update  = 30/05/00                --
21
--  author       = Jose Nunez              --
22
---------------------------------------------
23
 
24
 
25
-- FUNCTION
26
-- The parsing unit parses the input data in words using the space as the parser
27
 
28
--  PIN LIST
29
 
30
--  ENABLE = parsing unit active
31
--  DATA_IN_32  = data to be parse from the buffer
32
--  MASK = 4 bit indicatin how many bytes of the 32 are valid
33
--  DATA_OUT_32  = output data to the search register
34
--  CLEAR    = asynchronous clear
35
--  CLK      = master clock
36
 
37
 
38
library ieee;
39
use ieee.std_logic_1164.all;
40
 
41
entity PARSING_UNIT is
42
port
43
(
44
        ENABLE: in bit; -- buffer ready
45
        FINISH : in bit; -- all the data has been processed
46
        DATA_IN_32 : in bit_vector(31 downto 0);
47
        CLEAR : in bit ;
48
        CLK : in bit ;
49
        MASK : out bit_vector(4 downto 0);
50
    READ : out bit;
51
        START_ENGINE : out bit;
52
        FINISH_PARSING : out bit;
53
        DATA_OUT_32: out bit_vector(31 downto 0)
54
);
55
 
56
end PARSING_UNIT;
57
 
58
 
59
architecture STRUCTURAL of PARSING_UNIT is
60
 
61
 
62
component PARSER_REGISTER
63
port (
64
          ENABLE_IN : in bit;
65
          DATA_IN : in bit_vector(55 downto 0);
66
          LENGTH_IN : in bit_vector(2 downto 0);
67
          CLK : in bit;
68
          CLEAR : in bit;
69
          RESET : in bit;
70
          ENABLE_OUT : out bit;
71
          DATA_OUT : out bit_vector(55 downto 0);
72
          LENGTH_OUT: out bit_vector(2 downto 0)
73
         );
74
end component;
75
 
76
 
77
component PARSER
78
port (
79
          DATA_IN : in bit_vector(55 downto 0);
80
          LENGTH_IN : in bit_vector(2 downto 0);
81
          ENABLE : in bit; -- hold the state when the buffer is empty but still more data in the block
82
          FINISH : in bit; -- last block is over
83
          DATA_SEARCH : out bit_vector(31 downto 0);
84
          DATA_OUT : out bit_vector(55 downto 0);
85
          MASK : out bit_vector(4 downto 0);
86
          LENGTH_OUT : out bit_vector(2 downto 0)
87
         );
88
end component;
89
 
90
 
91
component PARSER_CONCATENATOR
92
port
93
        (
94
        DATA_IN_BUFFER : in bit_vector(31 downto 0);
95
        ENABLE : in bit;
96
        READ : in bit;
97
        DATA_OLD : in bit_vector(55 downto 0);
98
        LENGTH_OLD : in bit_vector(2 downto 0);
99
        DATA_NEW : out bit_vector(55 downto 0);
100
        LENGTH_NEW : out bit_vector(2 downto 0)
101
        );
102
end component;
103
 
104
signal DATA_NEW, DATA_REG, DATA_PARSER : bit_vector(55 downto 0);
105
signal LENGTH_NEW, LENGTH_REG, LENGTH_PARSER: bit_vector(2 downto 0);
106
signal ENABLE_INT : bit;
107
signal READ_NOW : bit;
108
signal READ_INT : bit;
109
 
110
begin
111
 
112
 
113
 
114
PARSER_REGISTER_1 : PARSER_REGISTER
115
port map (
116
          ENABLE_IN => READ_INT,
117
          DATA_IN =>DATA_NEW,
118
          LENGTH_IN =>LENGTH_NEW,
119
          CLK =>CLK,
120
          CLEAR =>CLEAR,
121
          RESET =>CLEAR,
122
          ENABLE_OUT => READ_NOW,
123
          DATA_OUT =>DATA_REG,
124
          LENGTH_OUT =>LENGTH_REG
125
         );
126
 
127
PARSER_1 : PARSER
128
port map(
129
          DATA_IN => DATA_PARSER,
130
          LENGTH_IN => LENGTH_PARSER,
131
          ENABLE => ENABLE,  -- hold the state when the buffer is empty but still more data in the block
132
          FINISH => FINISH, -- last block is over
133
          DATA_SEARCH => DATA_OUT_32,
134
          DATA_OUT => DATA_NEW,
135
          MASK => MASK,
136
          LENGTH_OUT => LENGTH_NEW
137
         );
138
 
139
 
140
PARSER_CONCATENATOR_1 : PARSER_CONCATENATOR
141
port map
142
        (
143
        DATA_IN_BUFFER =>DATA_IN_32,
144
        ENABLE => ENABLE,
145
        READ => READ_NOW,
146
        DATA_OLD => DATA_REG,
147
        LENGTH_OLD =>LENGTH_REG,
148
        DATA_NEW =>DATA_PARSER,
149
        LENGTH_NEW=> LENGTH_PARSER
150
        );
151
 
152
 
153
READ_INT <= not(LENGTH_NEW(2)); -- and ENABLE;
154
 
155
READ <= READ_INT;
156
 
157
START_ENGINE <= '1' when (ENABLE = '1' or (LENGTH_PARSER > "000" and FINISH = '1')) else '0';
158
 
159
FINISH_PARSING <= '1' when (LENGTH_PARSER= "000" and FINISH = '1') else '0';
160
 
161
end STRUCTURAL;

powered by: WebSVN 2.1.0

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