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

Subversion Repositories xmatchpro

[/] [xmatchpro/] [trunk/] [xmw4-comdec/] [xmatch_sim7/] [src/] [miss_type_coder.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       = MISS_TYPE_CODER    --
19
--  version      = 1.0                    --
20
--  last update  = 10/05/01               --
21
--  author       = Jose Nunez         --
22
----------------------------------------
23
 
24
 
25
-- FUNCTION
26
-- miss type coder. Converts incoming miss type to a Huffman code word
27
-- and associated length.
28
 
29
 
30
-- PIN LIST
31
-- MASK        = mask indicatin how many bytes are valid in the search word
32
-- LITERAL DATA= the 4 bytes of literal data
33
-- CODE        = output Huffman code (left aligned)
34
-- LENGTH      = length (number of valid bits) in the output code
35
 
36
 
37
library ieee,dzx;
38
use ieee.std_logic_1164.all;
39
 
40
 
41
entity MISS_TYPE_CODER is
42
port
43
(
44
        MASK : in bit_vector(4 downto 0);
45
        LITERAL_DATA : in bit_vector(31 downto 0);
46
        CODE : out bit_vector(33 downto 0);
47
        LENGTH : out bit_vector(5 downto 0)
48
);
49
end MISS_TYPE_CODER;
50
 
51
 
52
architecture HUFFMAN of MISS_TYPE_CODER is
53
 
54
 
55
begin
56
 
57
MISS_TYPE : process(MASK, LITERAL_DATA)
58
variable BYTE4, BYTE3, BYTE2, BYTE1 : bit_vector(7 downto 0);
59
begin
60
 
61
BYTE4 := LITERAL_DATA(31 downto 24);
62
BYTE3 := LITERAL_DATA(23 downto 16);
63
BYTE2 := LITERAL_DATA(15 downto 8);
64
BYTE1 := LITERAL_DATA(7 downto 0);
65
 
66
-- generation of miss code
67
 
68
case MASK is
69
    when "10000" => CODE <= "1" & "000000000000000000000000000000000" ; LENGTH <= "000001";
70
    when "11000" => CODE <= "001" & BYTE4 & "00000000000000000000000" ; LENGTH <= "001011";
71
    when "11100" => CODE <= "0001"& BYTE4 & BYTE3 & "00000000000000" ;  LENGTH <= "010100";
72
    when "11110" => CODE <= "0000" & BYTE4 & BYTE3 & BYTE2 & "000000" ; LENGTH <= "011100";
73
    when "11111" => CODE <= "01" & BYTE4 & BYTE3 & BYTE2 & BYTE1 ;      LENGTH <= "100010";
74
    when others => CODE <= "0000000000000000000000000000000000" ; LENGTH <= "000000";
75
end case;
76
end process MISS_TYPE;
77
 
78
end HUFFMAN; -- end of architecture
79
 
80
 
81
 

powered by: WebSVN 2.1.0

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