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

Subversion Repositories sdhc-sc-core

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 180 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        : WbClkDomain-Rtl-ea.vhdl
30
-- Owner       : Rainer Kastl
31
-- Description : Top level of wishbone clock domain
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 WbClkDomain is
44
        port (
45
                iWbClk      : in std_ulogic;
46
                iWbRstSync  : in std_ulogic;
47
                iCyc        : in std_ulogic;
48
                iLock       : in std_ulogic;
49
                iStb        : in std_ulogic;
50
                iWe         : in std_ulogic;
51
                iCti        : in std_ulogic_vector(2 downto 0);
52
                iBte        : in std_ulogic_vector(1 downto 0);
53
                iSel        : in std_ulogic_vector(0 downto 0);
54
                iAdr        : in std_ulogic_vector(6 downto 4);
55
                iDat        : in std_ulogic_vector(31 downto 0);
56
                oDat        : out std_ulogic_vector(31 downto 0);
57
                oAck        : out std_ulogic;
58
                oErr        : out std_ulogic;
59
                oRty        : out std_ulogic;
60
                iWriteFifo  : in aiWriteFifo;
61
                iReadFifo   : in aiReadFifo;
62
                oWriteFifo  : out aoWriteFifo;
63
                oReadFifo   : out aoReadFifo;
64
                oWbToSdCtrl : out aSdWbSlaveToSdController;
65
                iSdCtrlToWb : in aSdControllerToSdWbSlave
66
        );
67
 
68
end entity WbClkDomain;
69
 
70
architecture Rtl of WbClkDomain is
71
 
72
        signal iWbCtrl                      : aWbSlaveCtrlInput;
73
        signal oWbCtrl                      : aWbSlaveCtrlOutput;
74
        signal iWbDat                       : aSdWbSlaveDataInput;
75
        signal oWbDat                       : aSdWbSlaveDataOutput;
76
 
77
begin
78
 
79
        SdWbSlave_inst : entity work.SdWbSlave
80
        port map (
81
                iClk                => iWbClk,
82
                iRstSync            => iWbRstSync,
83
 
84
                -- wishbone
85
                iWbCtrl             => iWbCtrl,
86
                oWbCtrl             => oWbCtrl,
87
                iWbDat              => iWbDat,
88
                oWbDat              => oWbDat,
89
 
90
                -- To sd controller
91
                iController         => iSdCtrlToWb,
92
                oController         => oWbToSdCtrl,
93
 
94
                -- To write fifo
95
                oWriteFifo          => oWriteFifo,
96
                iWriteFifo          => iWriteFifo,
97
 
98
                -- To read fifo
99
                oReadFifo           => oReadFifo,
100
                iReadFifo           => iReadFifo
101
        );
102
 
103
        -- map wishbone signals to internal signals
104
        iWbCtrl <= (
105
                           Cyc  => iCyc,
106
                           Lock => iLock,
107
                           Stb  => iStb,
108
                           We   => iWe,
109
                           Cti  => iCti,
110
                           Bte  => iBte
111
                   );
112
 
113
        oAck <= oWbCtrl.Ack;
114
        oErr <= oWbCtrl.Err;
115
        oRty <= oWbCtrl.Rty;
116
        oDat <= oWbDat.Dat;
117
 
118
        iWbDat <= (
119
                          Sel => iSel,
120
                          Adr => iAdr,
121
                          Dat => iDat
122
                  );
123
 
124
 
125
end architecture Rtl;
126
 

powered by: WebSVN 2.1.0

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