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

Subversion Repositories sd_card_controller

[/] [sd_card_controller/] [trunk/] [syn/] [quartus/] [src/] [sdc_controller_top.v] - Blame information for rev 8

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 rozpruwacz
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
//// WISHBONE SD Card Controller IP Core                          ////
4
////                                                              ////
5
//// sdc_controller_top.v                                         ////
6
////                                                              ////
7
//// This file is part of the WISHBONE SD Card                    ////
8
//// Controller IP Core project                                   ////
9 8 rozpruwacz
//// http://opencores.org/project,sd_card_controller              ////
10 3 rozpruwacz
////                                                              ////
11
//// Description                                                  ////
12
//// Top level entity of synthesis test project.                  ////
13
////                                                              ////
14
//// Author(s):                                                   ////
15
////     - Marek Czerski, ma.czerski@gmail.com                    ////
16
////                                                              ////
17
//////////////////////////////////////////////////////////////////////
18
////                                                              ////
19
//// Copyright (C) 2013 Authors                                   ////
20
////                                                              ////
21
//// This source file may be used and distributed without         ////
22
//// restriction provided that this copyright statement is not    ////
23
//// removed from the file and that any derivative work contains  ////
24
//// the original copyright notice and the associated disclaimer. ////
25
////                                                              ////
26
//// This source file is free software; you can redistribute it   ////
27
//// and/or modify it under the terms of the GNU Lesser General   ////
28
//// Public License as published by the Free Software Foundation; ////
29
//// either version 2.1 of the License, or (at your option) any   ////
30
//// later version.                                               ////
31
////                                                              ////
32
//// This source is distributed in the hope that it will be       ////
33
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
34
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
35
//// PURPOSE. See the GNU Lesser General Public License for more  ////
36
//// details.                                                     ////
37
////                                                              ////
38
//// You should have received a copy of the GNU Lesser General    ////
39
//// Public License along with this source; if not, download it   ////
40
//// from http://www.opencores.org/lgpl.shtml                     ////
41
////                                                              ////
42
////////////////////////////////////////////////////////////////////// 
43
 
44
module sdc_controller_top(
45
           // WISHBONE common
46
           wb_clk_i, wb_rst_i, wb_dat_i, wb_dat_o_reg,
47
           // WISHBONE slave
48
           wb_adr_i, wb_sel_i, wb_we_i, wb_cyc_i, wb_stb_i, wb_ack_o_reg,
49
           // WISHBONE master
50
           m_wb_adr_o_reg, m_wb_sel_o_reg, m_wb_we_o_reg,
51
           m_wb_dat_o_reg, m_wb_dat_i, m_wb_cyc_o_reg,
52
           m_wb_stb_o_reg, m_wb_ack_i,
53
           m_wb_cti_o_reg, m_wb_bte_o_reg,
54
           //SD BUS
55
           sd_cmd_dat_i, sd_cmd_out_o_reg, sd_cmd_oe_o_reg, //card_detect,
56
           sd_dat_dat_i, sd_dat_out_o_reg, sd_dat_oe_o_reg, sd_clk_o_pad,
57
           int_cmd_reg, int_data_reg
58
       );
59
 
60
input wb_clk_i;
61
input wb_rst_i;
62
input [31:0] wb_dat_i;
63
output reg [31:0] wb_dat_o_reg;
64
input [7:0] wb_adr_i;
65
input [3:0] wb_sel_i;
66
input wb_we_i;
67
input wb_cyc_i;
68
input wb_stb_i;
69
output reg wb_ack_o_reg;
70
output reg [31:0] m_wb_adr_o_reg;
71
output reg [3:0] m_wb_sel_o_reg;
72
output reg m_wb_we_o_reg;
73
input [31:0] m_wb_dat_i;
74
output reg [31:0] m_wb_dat_o_reg;
75
output reg m_wb_cyc_o_reg;
76
output reg m_wb_stb_o_reg;
77
input m_wb_ack_i;
78
output reg [2:0] m_wb_cti_o_reg;
79
output reg [1:0] m_wb_bte_o_reg;
80
input [3:0] sd_dat_dat_i;
81
output reg [3:0] sd_dat_out_o_reg;
82
output reg sd_dat_oe_o_reg;
83
input sd_cmd_dat_i;
84
output reg sd_cmd_out_o_reg;
85
output reg sd_cmd_oe_o_reg;
86
output sd_clk_o_pad;
87
output reg int_cmd_reg;
88
output reg int_data_reg;
89
 
90
reg [31:0] wb_dat_i_reg;
91
wire [31:0] wb_dat_o;
92
reg [7:0] wb_adr_i_reg;
93
reg [3:0] wb_sel_i_reg;
94
reg wb_we_i_reg;
95
reg wb_cyc_i_reg;
96
reg wb_stb_i_reg;
97
wire wb_ack_o;
98
wire [31:0] m_wb_adr_o;
99
wire [3:0] m_wb_sel_o;
100
wire m_wb_we_o;
101
reg [31:0] m_wb_dat_i_reg;
102
wire [31:0] m_wb_dat_o;
103
wire m_wb_cyc_o;
104
wire m_wb_stb_o;
105
reg m_wb_ack_i_reg;
106
wire [2:0] m_wb_cti_o;
107
wire [1:0] m_wb_bte_o;
108
reg [3:0] sd_dat_dat_i_reg;
109
wire [3:0] sd_dat_out_o;
110
wire sd_dat_oe_o;
111
reg sd_cmd_dat_i_reg;
112
wire sd_cmd_out_o;
113
wire sd_cmd_oe_o;
114
wire int_cmd;
115
wire int_data;
116
 
117
always @(posedge wb_clk_i) begin
118
    wb_dat_i_reg <= wb_dat_i;
119
    wb_dat_o_reg <= wb_dat_o;
120
    wb_adr_i_reg <= wb_adr_i;
121
    wb_sel_i_reg <= wb_sel_i;
122
    wb_we_i_reg <= wb_we_i;
123
    wb_cyc_i_reg <= wb_cyc_i;
124
    wb_stb_i_reg <= wb_stb_i;
125
    wb_ack_o_reg <= wb_ack_o;
126
    m_wb_adr_o_reg <= m_wb_adr_o;
127
    m_wb_sel_o_reg <= m_wb_sel_o;
128
    m_wb_we_o_reg <= m_wb_we_o;
129
    m_wb_dat_i_reg <= m_wb_dat_i;
130
    m_wb_dat_o_reg <= m_wb_dat_o;
131
    m_wb_cyc_o_reg <= m_wb_cyc_o;
132
    m_wb_stb_o_reg <= m_wb_stb_o;
133
    m_wb_ack_i_reg <= m_wb_ack_i;
134
    m_wb_cti_o_reg <= m_wb_cti_o;
135
    m_wb_bte_o_reg <= m_wb_bte_o;
136
    sd_dat_dat_i_reg <= sd_dat_dat_i;
137
    sd_dat_out_o_reg <= sd_dat_out_o;
138
    sd_dat_oe_o_reg <= sd_dat_oe_o;
139
    sd_cmd_dat_i_reg <= sd_cmd_dat_i;
140
    sd_cmd_out_o_reg <= sd_cmd_out_o;
141
    sd_cmd_oe_o_reg <= sd_cmd_oe_o;
142
    int_cmd_reg <= int_cmd;
143
    int_data_reg <= int_data;
144
end
145
 
146
sdc_controller sdc_controller0 (
147
           wb_clk_i,
148
           wb_rst_i,
149
           wb_dat_i_reg,
150
           wb_dat_o,
151
           wb_adr_i_reg,
152
           wb_sel_i_reg,
153
           wb_we_i_reg,
154
           wb_cyc_i_reg,
155
           wb_stb_i_reg,
156
           wb_ack_o,
157
           m_wb_dat_o,
158
           m_wb_dat_i_reg,
159
           m_wb_adr_o,
160
           m_wb_sel_o,
161
           m_wb_we_o,
162
           m_wb_cyc_o,
163
           m_wb_stb_o,
164
           m_wb_ack_i_reg,
165
           m_wb_cti_o,
166
           m_wb_bte_o,
167
           sd_cmd_dat_i_reg,
168
           sd_cmd_out_o,
169
           sd_cmd_oe_o,
170
           sd_dat_dat_i_reg,
171
           sd_dat_out_o,
172
           sd_dat_oe_o,
173
           sd_clk_o_pad,
174
           wb_clk_i,
175
           int_cmd,
176
           int_data
177
    );
178
 
179
endmodule

powered by: WebSVN 2.1.0

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