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

Subversion Repositories embedded_risc

[/] [embedded_risc/] [trunk/] [Verilog/] [sdramctrl_rtl.v] - Blame information for rev 27

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 26 hosseinami
/*********************************************************
2
 MODULE:                Top Level SDRAM Controller ASIC Design Block
3
 
4
 FILE NAME:     sdramctrl_rtl.v
5
 VERSION:       1.0
6
 DATE:          April 8nd, 2002
7
 AUTHOR:                Hossein Amidi
8
 COMPANY:
9
 CODE TYPE:     Register Transfer Level
10
 
11
 DESCRIPTION:   This module is the top level RTL code of SDRAM Controller ASIC verilog
12
 code. It will instantiate the following blocks in the ASIC:
13
 
14
 1)     Command Interface
15
 2)     Finite State Machine
16
 3)     Data Port
17
 
18
 Hossein Amidi
19
 (C) April 2002
20
 
21
*********************************************************/
22
 
23
// DEFINES
24
`timescale 1ns / 10ps
25
 
26
// TOP MODULE
27
module sdram_ctrl(
28
                                                // Inputs
29
                                                clk0,
30
                                                clk0_2x,
31
                                                reset,
32
                                                paddr,
33
                                                cmd,
34
                                                dm,
35
                                                datain,
36
                                                // Outputs
37
                                                cmdack,
38
                                                addr,
39
                                                cs,
40
                                                ras,
41
                                                cas,
42
                                                we,
43
                                                dqm,
44
                                                cke,
45
                                                ba,
46
                                                dataout,
47
                                                // Inouts
48
                                                dq
49
                                                );
50
 
51
// Parameter
52
`include        "parameter.v"
53
 
54
 
55
// Inputs
56
input clk0;
57
input clk0_2x;
58
input reset;
59
input [padd_size - 1 : 0]paddr;
60
input [cmd_size  - 1 : 0]cmd;
61
input [dqm_size  - 1 : 0]dm;
62
input [data_size - 1 : 0]datain;
63
 
64
// Outputs
65
output cmdack;
66
output [add_size - 1 : 0]addr;
67
output [cs_size  - 1 : 0]cs;
68
output ras;
69
output cas;
70
output we;
71
output [dqm_size - 1 : 0]dqm;
72
output cke;
73
output [ba_size - 1 : 0]ba;
74
output [data_size - 1 : 0]dataout;
75
 
76
// Inouts
77
inout [data_size - 1 : 0]dq;
78
 
79
 
80
// Signal Declarations
81
wire clk0;
82
wire clk0_2x;
83
wire reset;
84
wire [padd_size - 1 : 0]paddr;
85
wire [padd_size - 1 : 0]wpaddr;
86
wire [cmd_size - 1 : 0]cmd;
87
wire [dqm_size - 1 : 0]dm;
88
wire cmack;
89
 
90
wire cmdack;
91
wire [add_size - 1 : 0]addr;
92
wire [cs_size - 1 : 0]cs;
93
wire ras;
94
wire cas;
95
wire we;
96
wire cke;
97
wire [ba_size - 1 : 0]ba;
98
 
99
wire nop;
100
wire reada;
101
wire writea;
102
wire refresh;
103
wire preacharge;
104
wire load_mod;
105
 
106
wire oe;
107
 
108
wire [cas_size - 1 : 0]cas_lat;
109
wire [rc_size - 1 : 0]ras_cas;
110
wire [ref_dur_size - 1 : 0]ref_dur;
111
wire page_mod;
112
wire [burst_size - 1 : 0]bur_len;
113
 
114
wire ref_ack;
115
wire ref_req;
116
wire resetn;
117
 
118
 
119
wire [add_size - 1 : 0]wsadd;
120
wire [ba_size - 1 : 0]wba;
121
wire [cs_size - 1 : 0]wcs;
122
wire wcke;
123
wire wras;
124
wire wcas;
125
wire wwe;
126
 
127
// Assignment statments
128
 
129
 
130
/*----------------------------Sub Level Module Instantiation------------------------*/
131
 
132
 
133
command_if cmdif_0(// Input
134
                                                .reset(reset),
135
                                                .clk0(clk0),
136
                                                .paddr(paddr),
137
                                                .cmd(cmd),
138
                                                .cmack(cmack),
139
                                                .ref_ack(ref_ack),
140
                                                // Output
141
                                                .cmdack(cmdack),
142
                                                .caddr(wpaddr),
143
                                                .nop(nop),
144
                                                .reada(reada),
145
                                                .writea(writea),
146
                                                .refresh(refresh),
147
                                                .preacharge(preacharge),
148
                                                .load_mod(load_mod),
149
                                                .cas_lat(cas_lat),
150
                                                .ras_cas(ras_cas),
151
                                                .ref_dur(ref_dur),
152
                                                .page_mod(page_mod),
153
                                                .bur_len(bur_len),
154
                                                .ref_req(ref_req)
155
                                                );
156
 
157
fsm  fsm_0(// Input
158
                                .reset(reset),
159
                                .clk0(clk0),
160
                                .nop(nop),
161
                                .reada(reada),
162
                                .writea(writea),
163
                                .refresh(refresh),
164
                                .preacharge(preacharge),
165
                                .load_mod(load_mod),
166
                                .caddr(wpaddr),
167
                                .cas_lat(cas_lat),
168
                                .ras_cas(ras_cas),
169
                                .ref_dur(ref_dur),
170
                                .page_mod(page_mod),
171
                                .bur_len(bur_len),
172
                                .ref_req(ref_req),
173
                                // Output
174
                                .sadd(wsadd),
175
                                .cs(wcs),
176
                                .ras(wras),
177
                                .cas(wcas),
178
                                .we(wwe),
179
                                .cke(wcke),
180
                                .ba(wba),
181
                                .oe(oe),
182
                                .ref_ack(ref_ack),
183
                                .cmack(cmack)
184
                                );
185
 
186
 
187
data_port data_0(       // Input
188
                                                .reset(reset),
189
                                                .clk0(clk0),
190
                                                .clk0_2x(clk0_2x),
191
                                                .dm(dm),
192
                                                .oe(oe),
193
                                                .datain(datain),
194
                                                .wsadd(wsadd),
195
                                                .wba(wba),
196
                                                .wcs(wcs),
197
                                                .wcke(wcke),
198
                                                .wras(wras),
199
                                                .wcas(wcas),
200
                                                .wwe(wwe),
201
                                                // Output
202
                                                .dqm(dqm),
203
                                                .dataout(dataout),
204
                                                .add(addr),
205
                                                .ba(ba),
206
                                                .cs(cs),
207
                                                .cke(cke),
208
                                                .ras(ras),
209
                                                .cas(cas),
210
                                                .we(we),
211
                                                // Inout
212
                                                .dq(dq)
213
                                                );
214
 
215
endmodule
216
 
217
 
218
 

powered by: WebSVN 2.1.0

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