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

Subversion Repositories xmatchpro

[/] [xmatchpro/] [trunk/] [xmw4-comdec/] [xmatch_sim7/] [src/] [cm_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       = CM_ASSEMBLER  --
19
--  version      = 1.0           --
20
--  last update  = 16/06/99      --
21
--  author       = Jose Nunez    --
22
-----------------------------------
23
 
24
 
25
-- FUNCTION
26
-- assembles the match location code and match type code into a single word
27
 
28
 
29
-- PIN LIST
30
-- CODE_A     = match location code (left justified)
31
-- MISS       = detects a possible miss
32
-- CODE_B     = match type code (left justified)
33
-- LENGTH_B   = match type code length
34
-- CODE_OUT   = assembled output code
35
-- LENGTH_OUT = output code length
36
 
37
 
38
library ieee,dzx;
39
use ieee.std_logic_1164.all;
40
use dzx.bit_arith.all;
41
use dzx.attributes.all;
42
 
43
entity CM_ASSEMBLER is
44
port
45
(
46
        CODE_A : in bit_vector(4 downto 0);
47
        LENGTH_A : in bit_vector(2 downto 0);
48
        MISS: in bit;
49
      CODE_B : in bit_vector(5 downto 0);
50
      LENGTH_B : in bit_vector(2 downto 0);
51
        CODE_OUT : out bit_vector(10 downto 0);
52
        LENGTH_OUT : out bit_vector(3 downto 0)
53
);
54
end CM_ASSEMBLER;
55
 
56
 
57
architecture NOSHIFTER of CM_ASSEMBLER is
58
 
59
begin
60
 
61
ASSEMBLE : process(CODE_A , LENGTH_A , CODE_B)
62
 
63
begin
64
 
65
case LENGTH_A is
66
 
67
when "001" => CODE_OUT <= CODE_A(4) & CODE_B & "0000";
68
when "010" => CODE_OUT <= CODE_A(4 downto 3) & CODE_B & "000";
69
when "011" => CODE_OUT <= CODE_A(4 downto 2) & CODE_B & "00";
70
when "100" => CODE_OUT <= CODE_A(4 downto 1) & CODE_B & "0";
71
when "101" => CODE_OUT <= CODE_A(4 downto 0) & CODE_B;
72
when others => CODE_OUT <= "00000000000";
73
 
74
end case;
75
 
76
end process ASSEMBLE;
77
 
78
 
79
LENGTH_OUT <= ('0' & LENGTH_A) + ('0' & LENGTH_B) when MISS = '0' else "0001";
80
 
81
 
82
 
83
end NOSHIFTER; -- end of architecture
84
 
85
 
86
 

powered by: WebSVN 2.1.0

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