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

Subversion Repositories xmatchpro

[/] [xmatchpro/] [trunk/] [xmw4-comdec/] [xmatch_sim7/] [src/] [bsl_tc_2_d.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/00    --
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
use dzx.attributes.all;
54
 
55
entity BSL_TC_2_D 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
        FINISH_D_BUFFERS : out bit
65
);
66
 
67
end BSL_TC_2_D;
68
 
69
 
70
architecture COUNTER of BSL_TC_2_D is
71
 
72
 
73
 
74
-- indicates end of block (active LOW), i.e tuple count is equal
75
-- to decoded block size
76
signal EOB : bit;
77
 
78
-- indicates the number of tuples that have been processed
79
signal TUPLE_COUNT : bit_vector(29 downto 0);
80
 
81
 
82
begin
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 = '0') then
92
                TUPLE_COUNT <= "000000000000000000000000000000";
93
                elsif ((INC = '1') and (EOB = '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 <= '0';
104
        else
105
                                EOB <= '1';
106
    end if;
107
end process END_OF_BLOCK;
108
 
109
 
110
--  assign EOB to external EO_BLOCK signal                      
111
EO_BLOCK <= EOB;
112
 
113
-- or not(INC);
114
 
115
-- to stop the buffers when the last data has been read from them
116
 
117
-- FINISH_D_BUFFERS <= '0' when (TUPLE_COUNT & "00" + "0000000000001100" = BS_LATCH) else '1';          
118
 
119
FINISH_D_BUFFERS <= EOB;
120
 
121
end COUNTER;
122
 
123
 
124
 
125
 
126
 

powered by: WebSVN 2.1.0

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