OpenCores
URL https://opencores.org/ocsvn/sdhc-sc-core/sdhc-sc-core/trunk

Subversion Repositories sdhc-sc-core

[/] [sdhc-sc-core/] [trunk/] [grpSd/] [unitSdWbClkDomainSync/] [src/] [SdWbClkDomainSync-Rtl-ea.vhdl] - Blame information for rev 185

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 182 rkastl
-- SDHC-SC-Core
2
-- Secure Digital High Capacity Self Configuring Core
3
-- 
4
-- (C) Copyright 2010, Rainer Kastl
5
-- All rights reserved.
6
-- 
7
-- Redistribution and use in source and binary forms, with or without
8
-- modification, are permitted provided that the following conditions are met:
9
--     * Redistributions of source code must retain the above copyright
10
--       notice, this list of conditions and the following disclaimer.
11
--     * Redistributions in binary form must reproduce the above copyright
12
--       notice, this list of conditions and the following disclaimer in the
13
--       documentation and/or other materials provided with the distribution.
14
--     * Neither the name of the <organization> nor the
15
--       names of its contributors may be used to endorse or promote products
16
--       derived from this software without specific prior written permission.
17
-- 
18
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS  "AS IS" AND
19
-- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
-- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
-- DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
22
-- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
-- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24
-- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25
-- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
-- 
29
-- File        : SdWbClkDomainSync-Rtl-ea.vhdl
30
-- Owner       : Rainer Kastl
31
-- Description : Synchronization between Sd and Wb clk domains
32
-- Links       : 
33
-- 
34
 
35
library ieee;
36
use ieee.std_logic_1164.all;
37
use ieee.numeric_std.all;
38
use work.Global.all;
39
use work.Wishbone.all;
40
use work.Sd.all;
41
use work.SdWb.all;
42
 
43
entity SdWbClkDomainSync is
44
        generic (
45
                gUseSameClocks : boolean := false
46
        );
47
        port (
48
                iWbClk       : in std_ulogic;
49
                iWbRstSync   : in std_ulogic;
50
                iSdClk       : in std_ulogic;
51
                iSdRstSync   : in std_ulogic;
52
 
53
                iWbCtrl      : in aSdWbSlaveToSdController;
54
                iWbWriteFifo : in aoWriteFifo;
55
                iWbReadFifo  : in aoReadFifo;
56
 
57
                iSdCtrl      : in aSdControllerToSdWbSlave;
58
                iSdWriteFifo : in aoReadFifo;
59
                iSdReadFifo  : in aoWriteFifo;
60
 
61
                oWbCtrlSync  : out aSdControllerToSdWbSlave;
62
                oWbWriteFifo : out aiWriteFifo;
63
                oWbReadFifo  : out aiReadFifo;
64
 
65
                oSdCtrlSync  : out aSdWbSlaveToSdController;
66
                oSdWriteFifo : out aiReadFifo;
67
                oSdReadFifo  : out aiWriteFifo
68
        );
69
end entity SdWbClkDomainSync;
70
 
71
architecture Rtl of SdWbClkDomainSync is
72
 
73
        signal ReadFifoQTemp    : std_logic_vector(31 downto 0);
74
        signal WriteFifoQTemp   : std_logic_vector(31 downto 0);
75
 
76
begin
77
 
78
        SdWbControllerSync_inst: entity work.SdWbControllerSync
79
        generic map (
80
                gUseSameClocks => gUseSameClocks
81
        )
82
        port map (
83
                iWbClk        => iWbClk,
84
                iWbRstSync    => iWbRstSync,
85
                iSdClk        => iSdClk,
86
                iSdRstSync    => iSdRstSync,
87
                iSdWb         => iWbCtrl,
88
                oSdWb         => oWbCtrlSync,
89
                iSdController => iSdCtrl,
90
                oSdController => oSdCtrlSync
91
        );
92
 
93
        WriteDataFifo_inst: entity work.WriteDataFifo
94
        port map (
95
                data    => std_logic_vector(iWbWriteFifo.data),
96
                rdclk   => iSdClk,
97
                rdreq   => iSdWriteFifo.rdreq,
98
                wrclk   => iWbClk,
99
                wrreq   => iWbWriteFifo.wrreq,
100
                q       => ReadFifoQTemp,
101
                rdempty => oSdWriteFifo.rdempty,
102
                wrfull  => oWbWriteFifo.wrfull
103
        );
104
        oSdWriteFifo.q <= std_ulogic_vector(ReadFifoQTemp);
105
 
106
        ReadDataFifo_inst: entity work.WriteDataFifo
107
        port map (
108
                data    => std_logic_vector(iSdReadFifo.data),
109
                rdclk   => iWbClk,
110
                rdreq   => iWbReadFifo.rdreq,
111
                wrclk   => iSdClk,
112
                wrreq   => iSdReadFifo.wrreq,
113
                q       => WriteFifoQTemp,
114
                rdempty => oWbReadFifo.rdempty,
115
                wrfull  => oSdReadFifo.wrfull
116
        );
117
        oWbReadFifo.q <= std_ulogic_vector(WriteFifoQTemp);
118
 
119
end architecture Rtl;
120
 

powered by: WebSVN 2.1.0

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