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

Subversion Repositories xmatchpro

[/] [xmatchpro/] [trunk/] [xmw4-comdec/] [xmatch_sim7/] [src/] [bsl_tc_2_c.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       = BSL_TC_2      --
19
--  version      = 2.0         --
20
--  last update  = 22/05/01    --
21
--  author       = Jose Nunez  --
22
---------------------------------
23
 
24
--  FUNCTION
25
--  Latches the block size synchronously under the control of
26
--  the LOAD signal (active LOW). The 16 bit number indicates the number of
27
--  tuples in the block.
28
 
29
--  The tuple counter is fully synchronous and is incremented on each
30
--  clock cycle if INC signal is LOW.
31
 
32
--  When the tuple counter reaches the required number of tuples within
33
--  the block minus one, the END OF BLOCK signal is activated. The counter
34
--  then remains locked in this state until cleared or reset.
35
 
36
 
37
--  PIN LIST
38
--  BLOCK_SIZE  = input block size
39
--  LOAD        = load block size (active LOW)
40
--  INC         = increment tuple counter (active LOW)
41
--  CLEAR       = asynchronously clear the tuple counter (active LOW) and the block size
42
--  CLK         = clock
43
--  EO_BLOCK    = end of block signal (active LOW)
44
 
45
--  WARNING - dzx.bit_arith is an INTERGRAPH SPECIFIC LIBRARY
46
--            take note of this if porting to another system!
47
--            It is required to allow the addition of two bit
48
--            vectors in the process TUPLE_COUNTER.
49
 
50
library ieee,dzx;
51
use ieee.std_logic_1164.all;
52
use dzx.bit_arith.all;
53
 
54
 
55
entity BSL_TC_2_C is
56
port
57
(
58
      BLOCK_SIZE : in bit_vector(31 downto 0) ;
59
      INC : in bit ;
60
      CLEAR : in bit ;
61
        RESET : in bit;
62
      CLK : in bit ;
63
      EO_BLOCK : out bit
64
);
65
 
66
end BSL_TC_2_C;
67
 
68
 
69
architecture COUNTER of BSL_TC_2_C is
70
 
71
-- indicates end of block (active LOW), i.e tuple count is equal
72
-- to decoded block size
73
 
74
signal EOB : bit;
75
 
76
-- indicates the number of tuples that have been processed
77
 
78
signal TUPLE_COUNT : bit_vector(29 downto 0);
79
 
80
 
81
begin
82
 
83
 
84
TUPLE_COUNTER : process(CLK,CLEAR)
85
 
86
begin
87
        -- Since the increment is always with 4 bytes I use only 14 bit counter
88
        if (CLEAR = '0') then
89
                TUPLE_COUNT <= "000000000000000000000000000000";
90
        elsif ((CLK'event) and (CLK='1')) then
91
                if (RESET = '1') then
92
                        TUPLE_COUNT <= "000000000000000000000000000000";
93
                elsif (INC = '1') then
94
                        TUPLE_COUNT <= TUPLE_COUNT + "000000000000000000000000000001";
95
                end if;
96
        end if;
97
end process TUPLE_COUNTER;
98
 
99
 
100
END_OF_BLOCK : process (TUPLE_COUNT, BLOCK_SIZE)
101
begin
102
        if ((TUPLE_COUNT & "00") >= BLOCK_SIZE) then
103
                EOB <= '1';
104
                else
105
                                EOB <= '0';
106
        end if;
107
end process END_OF_BLOCK;
108
 
109
 
110
 
111
EO_BLOCK <= EOB;
112
 
113
 
114
 
115
end COUNTER;
116
 
117
 
118
 
119
 
120
 

powered by: WebSVN 2.1.0

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