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

Subversion Repositories xmatchpro

[/] [xmatchpro/] [trunk/] [xmw4-comdec/] [xmatch_sim7/] [src/] [parser_concatenator.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       = PARSER_CONCATENATOR     --
19
--  version      = 1.0                     --
20
--  last update  = 30/05/00                --
21
--  author       = Jose Nunez              --
22
---------------------------------------------
23
 
24
 
25
-- FUNCTION
26
-- The parser concatenator adds more data when required
27
 
28
--  PIN LIST
29
 
30
--  DATA_IN_BUFFER  = 32 bits of data comming from the buffer
31
--  DATA_OLD = old data
32
--  LENGTH_OLD = old length
33
--  DATA_NEW = new data negerated
34
--  LENGTH_OUT = new length generated 
35
 
36
library ieee;
37
use ieee.std_logic_1164.all;
38
 
39
entity PARSER_CONCATENATOR is
40
port
41
        (
42
        DATA_IN_BUFFER : in bit_vector(31 downto 0);
43
        ENABLE: in bit;
44
        READ : in bit;
45
        DATA_OLD : in bit_vector(55 downto 0);
46
        LENGTH_OLD : in bit_vector(2 downto 0);
47
        DATA_NEW : out bit_vector(55 downto 0);
48
        LENGTH_NEW : out bit_vector(2 downto 0)
49
        );
50
end PARSER_CONCATENATOR;
51
 
52
architecture STRUCTURAL of PARSER_CONCATENATOR is
53
 
54
begin
55
 
56
LENGTH_CALC : process(LENGTH_OLD,ENABLE, READ)
57
 
58
begin
59
 
60
if (ENABLE = '1' and READ = '1') then
61
   case LENGTH_OLD is
62
                when "011" => LENGTH_NEW <= "111";
63
                when "010" => LENGTH_NEW <= "110";
64
            when "001" => LENGTH_NEW <= "101";
65
                when "000" => LENGTH_NEW <= "100";
66
                when others => LENGTH_NEW <= LENGTH_OLD;
67
   end case;
68
else
69
        LENGTH_NEW <= LENGTH_OLD;
70
end if;
71
 
72
end process LENGTH_CALC;
73
 
74
 
75
CODE_CALC : process(LENGTH_OLD , DATA_IN_BUFFER , DATA_OLD)
76
 
77
begin
78
 
79
case LENGTH_OLD is
80
    when "000" => DATA_NEW(55 downto 0)  <= DATA_IN_BUFFER & "000000000000000000000000";
81
    when "001" => DATA_NEW(55 downto 0)  <= DATA_OLD(55 downto 48) & DATA_IN_BUFFER &  "0000000000000000";
82
    when "010" => DATA_NEW(55 downto 0)  <= DATA_OLD(55 downto 40) & DATA_IN_BUFFER & "00000000";
83
    when "011" => DATA_NEW(55 downto 0)  <= DATA_OLD(55 downto 32) & DATA_IN_BUFFER;
84
    when others   => DATA_NEW(55 downto 0) <= DATA_OLD(55 downto 0);
85
end case;
86
 
87
end process CODE_CALC;
88
 
89
end STRUCTURAL;

powered by: WebSVN 2.1.0

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