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

Subversion Repositories xmatchpro

[/] [xmatchpro/] [trunk/] [xmw4-comdec/] [xmatch_sim7/] [src/] [BUFFER_COUNTER_READ.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       = BUFFER_COUNTER_READ         --
19
--  version      = 1.0                         --
20
--  last update  = 30/5/00                     --
21
--  author       = Jose Nunez                  --
22
-------------------------------------------------
23
 
24
 
25
-- FUNCTION
26
-- 8 bit counter for the read and write on dual port ram buffers
27
 
28
 
29
--  PIN LIST
30
--  ENABLE = enable count 
31
--  CLEAR = asyncronus clear of the counter
32
--  CLK   = master clock
33
--  COUNT = count output
34
 
35
 
36
library ieee,dzx;
37
use ieee.std_logic_1164.all;
38
use dzx.bit_arith.all;
39
use dzx.bit_utils.all;
40
 
41
entity BUFFER_COUNTER_READ is
42
 
43
port (
44
     ENABLE : in bit;
45
          CLEAR : in bit;
46
          CLEAR_COUNTERS : in bit;
47
          CLK : in bit;
48
          COUNT : out bit_vector(8 downto 0)
49
     );
50
 
51
end BUFFER_COUNTER_READ;
52
 
53
architecture STRUCTURAL of BUFFER_COUNTER_READ is
54
 
55
signal COUNT_AUX : bit_vector(8 downto 0);
56
 
57
 
58
begin
59
 
60
 
61
 
62
COUNTING : process (CLK,CLEAR,ENABLE,CLEAR_COUNTERS)
63
 
64
begin
65
        -- asynchronous RESET signal forces all outputs LOW
66
      if (CLEAR = '0') then
67
            COUNT_AUX <= "000000000";
68
            -- check for +ve clock edge
69
          elsif ((CLK'event) and (CLK = '1')) then
70
                    if (CLEAR_COUNTERS = '1') then
71
                              COUNT_AUX <= "000000000";
72
         elsif( ENABLE = '1') then
73
                           COUNT_AUX <= COUNT_AUX+"000000001";
74
                          else
75
                             COUNT_AUX <= COUNT_AUX;
76
                          end if;
77
         end if;
78
 
79
end process COUNTING;
80
 
81
COUNT <= COUNT_AUX;
82
 
83
end STRUCTURAL;

powered by: WebSVN 2.1.0

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