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

Subversion Repositories ata

[/] [ata/] [trunk/] [rtl/] [vhdl/] [ocidec3/] [atahost_reg_buf.vhd] - Blame information for rev 33

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 27 rherveille
---------------------------------------------------------------------
2
----                                                             ----
3
----  OpenCores IDE Controller                                   ----
4
----                                                             ----
5
----  Author: Richard Herveille                                  ----
6
----          richard@asics.ws                                   ----
7
----          www.asics.ws                                       ----
8
----                                                             ----
9
---------------------------------------------------------------------
10
----                                                             ----
11
---- Copyright (C) 2001, 2002 Richard Herveille                  ----
12
----                          richard@asics.ws                   ----
13
----                                                             ----
14
---- This source file may be used and distributed without        ----
15
---- restriction provided that this copyright statement is not   ----
16
---- removed from the file and that any derivative work contains ----
17
---- the original copyright notice and the associated disclaimer.----
18
----                                                             ----
19
----     THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY     ----
20
---- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED   ----
21
---- TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS   ----
22
---- FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL THE AUTHOR      ----
23
---- OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,         ----
24
---- INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES    ----
25
---- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE   ----
26
---- GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR        ----
27
---- BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF  ----
28
---- LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT  ----
29
---- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT  ----
30
---- OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE         ----
31
---- POSSIBILITY OF SUCH DAMAGE.                                 ----
32
----                                                             ----
33
---------------------------------------------------------------------
34
 
35
--  CVS Log
36
--
37
--  $Id: atahost_reg_buf.vhd,v 1.1 2002-02-18 14:32:12 rherveille Exp $
38
--
39
--  $Date: 2002-02-18 14:32:12 $
40
--  $Revision: 1.1 $
41
--  $Author: rherveille $
42
--  $Locker:  $
43
--  $State: Exp $
44
--
45
-- Change History:
46
--               $Log: not supported by cvs2svn $
47
--
48
 
49
 
50
library ieee;
51
use ieee.std_logic_1164.all;
52
 
53
entity atahost_reg_buf is
54
        generic (
55
                WIDTH : natural := 8
56
        );
57
        port(
58
                clk    : in std_logic;
59
                nReset : in std_logic;
60
                rst    : in std_logic;
61
 
62
                D      : in std_logic_vector(WIDTH -1 downto 0);
63
                Q      : out std_logic_vector(WIDTH -1 downto 0);
64
                rd     : in std_logic;
65
                wr     : in std_logic;
66
                valid  : buffer std_logic
67
        );
68
end entity atahost_reg_buf;
69
 
70
architecture structural of atahost_reg_buf is
71
begin
72
        process(clk, nReset)
73
        begin
74
                if (nReset = '0') then
75
                        Q <= (others => '0');
76
                        valid <= '0';
77
                elsif (clk'event and clk = '1') then
78
                        if (rst = '1') then
79
                                Q <= (others => '0');
80
                                valid <= '0';
81
                        else
82
                                if (wr = '1') then
83
                                        Q <= D;
84
                                end if;
85
                                valid <= wr or (valid and not rd);
86
                        end if;
87
                end if;
88
        end process;
89
end architecture structural;

powered by: WebSVN 2.1.0

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