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

Subversion Repositories xmatchpro

[/] [xmatchpro/] [trunk/] [xmw4-comdec/] [xmatch_sim7/] [src/] [assembler.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       = ASSEMBLER     --
19
--  version      = 2.0           --
20
--  last update  = 6/06/01       --
21
--  author       = Jose Nunez    --
22
-----------------------------------
23
 
24
 
25
-- FUNCTION
26
-- assembler for the uncompressed data.
27
 
28
 
29
-- PIN LIST
30
 
31
-- DATA_IN      = uncompressed data from the engine
32
-- MASK                 = 4 bit indicating which bytes are valid
33
-- WRITE_OLD    = write operation done shift out used data
34
-- DATA_OLD             = 56 bits of old data
35
-- LENGTH_OLD   = length of old data
36
-- WRITE_NEW    = write data to buffer
37
-- DATA_NEW     = 56 bits of new data
38
-- LENGTH_NEW   = length of new data
39
 
40
 
41
 
42
 
43
library ieee,dzx;
44
use ieee.std_logic_1164.all;
45
use dzx.bit_arith.all;
46
use dzx.bit_utils.all;
47
use dzx.attributes.all;
48
 
49
entity ASSEMBLER is
50
port
51
(
52
        ENABLE : in bit;
53
    DATA_IN : in bit_vector(31 downto 0);
54
        MASK_IN : in bit_vector(3 downto 0);
55
        DATA_OLD : in bit_vector(55 downto 0);
56
        LENGTH_OLD : in bit_vector(2 downto 0); --only 7 bytes
57
        DATA_NEW : out bit_vector(55 downto 0);
58
        LENGTH_NEW : out bit_vector(2 downto 0);
59
        WRITE : out bit
60
 
61
);
62
 
63
 
64
 
65
end ASSEMBLER;
66
 
67
 
68
architecture ASSEMBLE2 of ASSEMBLER is
69
 
70
begin
71
 
72
 
73
CALCULATE_LENGTH : process(ENABLE, MASK_IN, LENGTH_OLD)
74
variable TEMP_LENGTH : bit_vector(2 downto 0);
75
 
76
begin
77
 
78
TEMP_LENGTH := LENGTH_OLD;
79
 
80
if(TEMP_LENGTH(2) = '1') then
81
         TEMP_LENGTH(2) := '0';
82
end if;
83
 
84
if (ENABLE = '0') then
85
 
86
        case MASK_IN is
87
 
88
        when "1000" =>
89
                TEMP_LENGTH := TEMP_LENGTH + "001";
90
        when "1100" =>
91
                TEMP_LENGTH := TEMP_LENGTH + "010";
92
        when "1110" =>
93
                TEMP_LENGTH := TEMP_LENGTH + "011";
94
        when "1111" =>
95
                TEMP_LENGTH := TEMP_LENGTH + "100";
96
        when others =>
97
                TEMP_LENGTH := TEMP_LENGTH;
98
 
99
        end case;
100
 
101
 
102
else
103
 
104
        TEMP_LENGTH := TEMP_LENGTH;
105
 
106
end if;
107
 
108
 
109
WRITE <= TEMP_LENGTH(2);
110
LENGTH_NEW <= TEMP_LENGTH;
111
 
112
 
113
end process CALCULATE_LENGTH;
114
 
115
 
116
 
117
 
118
CONCATENATE_DATA : process(DATA_OLD, DATA_IN, LENGTH_OLD)
119
 
120
begin
121
 
122
        case LENGTH_OLD is
123
 
124
        when "000" => DATA_NEW <= DATA_IN & x"000000";
125
        when "001" => DATA_NEW <= DATA_OLD(55 downto 48) & DATA_IN & x"0000";
126
        when "010" => DATA_NEW <= DATA_OLD(55 downto 40) & DATA_IN & x"00";
127
        when "011" => DATA_NEW <= DATA_OLD(55 downto 32) & DATA_IN;
128
        when "100" => DATA_NEW <= DATA_IN & x"000000";
129
        when "101" => DATA_NEW <= DATA_OLD(23 downto 16) & DATA_IN & x"0000";
130
        when "110" => DATA_NEW <= DATA_OLD(23 downto 8) & DATA_IN & x"00";
131
        when "111" => DATA_NEW <= DATA_OLD(23 downto 0) & DATA_IN;
132
 
133
        end case;
134
 
135
end process CONCATENATE_DATA;
136
 
137
 
138
 
139
end ASSEMBLE2; -- end of architecture
140
 
141
 
142
 
143
 
144
 
145
 
146
 

powered by: WebSVN 2.1.0

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