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

Subversion Repositories versatile_mem_ctrl

[/] [versatile_mem_ctrl/] [trunk/] [rtl/] [verilog/] [versatile_mem_ctrl_defines.v] - Blame information for rev 111

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 111 unneback
//=tab Main
2
 
3
// Number of WB groups
4
//=select
5
//`define WB_GRPS_1 // 1
6
//`define WB_GRPS_2 // 2
7
`define WB_GRPS_3 // 3
8
//`define WB_GRPS_4 // 4
9
//`define WB_GRPS_5 // 5
10
//`define WB_GRPS_6 // 6
11
//`define WB_GRPS_7 // 7
12
//`define WB_GRPS_8 // 8
13
//=end
14
 
15
`ifdef WB_GRPS_2
16
    `define WB_GRPS_1
17
    `define NR_OF_WB_GRPS 2
18
    `define NR_OF_PORTS 2
19
`endif
20
`ifdef WB_GRPS_3
21
    `define WB_GRPS_1
22
    `define WB_GRPS_2
23
    `define NR_OF_WB_GRPS 3
24
    `define NR_OF_PORTS 3
25
`endif
26
`ifdef WB_GRPS_4
27
    `define WB_GRPS_1
28
    `define WB_GRPS_2
29
    `define WB_GRPS_3
30
    `define NR_OF_WB_GRPS 4
31
    `define NR_OF_PORTS 4
32
`endif
33
`ifdef WB_GRPS_5
34
    `define WB_GRPS_1
35
    `define WB_GRPS_2
36
    `define WB_GRPS_3
37
    `define WB_GRPS_4
38
    `define NR_OF_WB_GRPS 5
39
    `define NR_OF_PORTS 5
40
`endif
41
`ifdef WB_GRPS_6
42
    `define WB_GRPS_1
43
    `define WB_GRPS_2
44
    `define WB_GRPS_3
45
    `define WB_GRPS_4
46
    `define WB_GRPS_5
47
    `define NR_OF_WB_GRPS 6
48
    `define NR_OF_PORTS 6
49
`endif
50
`ifdef WB_GRPS_7
51
    `define WB_GRPS_1
52
    `define WB_GRPS_2
53
    `define WB_GRPS_3
54
    `define WB_GRPS_4
55
    `define WB_GRPS_5
56
    `define WB_GRPS_6
57
    `define NR_OF_WB_GRPS 7
58
    `define NR_OF_PORTS 7
59
`endif
60
`ifdef WB_GRPS_8
61
    `define WB_GRPS_1
62
    `define WB_GRPS_2
63
    `define WB_GRPS_3
64
    `define WB_GRPS_4
65
    `define WB_GRPS_5
66
    `define WB_GRPS_6
67
    `define WB_GRPS_7
68
    `define NR_OF_WB_GRPS 8
69
    `define NR_OF_PORTS 8
70
`endif
71
 
72
// Clock domain crossing WB1
73
//=select
74
//`define WB1_MEM_CLK // mem clk domain
75
`define WB1_CLK // wb1 clk domain
76
//=end
77
// Clock domain crossing WB1
78
//=select
79
//`define WB2_MEM_CLK // mem clk domain
80
`define WB2_CLK // wb2 clk domain
81
//=end
82
// Clock domain crossing WB1
83
//=select
84
`define WB3_MEM_CLK // mem clk domain
85
//`define WB3_CLK // wb3 clk domain
86
//=end
87
// Clock domain crossing WB1
88
//=select
89
//`define WB4_MEM_CLK // mem clk domain
90
`define WB4_CLK // wb4 clk domain
91
//=end
92
// Clock domain crossing WB1
93
//=select
94
//`define WB5_MEM_CLK // mem clk domain
95
`define WB5_CLK // wb5 clk domain
96
//=end
97
// Clock domain crossing WB1
98
//=select
99
//`define WB6_MEM_CLK // mem clk domain
100
`define WB6_CLK // wb6 clk domain
101
//=end
102
// Clock domain crossing WB1
103
//=select
104
//`define WB7_MEM_CLK // mem clk domain
105
`define WB7_CLK // wb7 clk domain
106
//=end
107
// Clock domain crossing WB1
108
//=select
109
//`define WB8_MEM_CLK // mem clk domain
110
`define WB8_CLK // wb8 clk domain
111
//=end
112
 
113
// Module base name
114
`define BASE versatile_mem_ctrl_
115
 
116
// Memory type
117
//=select
118
//`define RAM // RAM
119
`define SDR // SDR
120
//`define DDR2 // DDR2
121
//`define DDR3 // DDR3
122
//=end
123
 
124
// Shadow RAM
125
`define SHADOW_RAM
126
 
127
//=tab RAM
128
// Number of bits in address
129
`define RAM_ADR_SIZE 16
130
// Capacity in KBytes
131
`define RAM_MEM_SIZE_KB 48
132
`ifdef RAM_MEM_SIZE_KB
133
`define RAM_MEM_SIZE `RAM_MEM_SIZE_KB*1024
134
`endif
135
 
136
// Memory init
137
`define RAM_MEM_INIT_DUMMY
138
`ifndef RAM_MEM_INIT_DUMMY
139
    `define RAM_MEM_INIT 0
140
`else
141
    `define RAM_MEM_INIT 1
142
`endif
143
 
144
// Memory init file
145
`define RAM_MEM_INIT_FILE "ram_init.v"
146
 
147
`ifdef RAM
148
`define WB_ADR_SIZE `RAM_ADR_SIZE
149
`endif
150
 
151
//=tab SDR SDRAM
152
 
153
// External data bus size
154
`define SDR_EXT_DAT_SIZE 16
155
 
156
// Memory part
157
//=select Memory part
158
//`define MT48LC4M16 // Micron 4M16, 8MB
159
`define MT48LC16M16 // Micron 16M16, 32MB
160
//`define MT48LC32M16 // Micron 32M16, 64MB
161
//=end
162
 
163
// SDRAM clock frequency
164
// set refresh counter timeout
165
// all rows should be refreshed every 64 ms
166
// SDRAM CLK frequency
167
//=select SDRAM CLK
168
`define SDR_SDRAM_CLK_64 // SDRAM_CLK_64
169
//`define SDR_SDRAM_CLK_75 // SDRAM_CLK_75
170
//`define SDR_SDRAM_CLK_125 // SDRAM_CLK_125
171
//`define SDR_SDRAM_CLK_133 // SDRAM_CLK_133
172
//`define SDR_SDRAM_CLK_154 // SDRAM_CLK_154
173
//=end
174
 
175
`ifdef MT48LC4M16
176
// using 1 of MT48LC4M16
177
// SDRAM data width is 16
178
`define SDR_SDRAM_DATA_WIDTH 16
179
`define SDR_SDRAM_DATA_WIDTH_16
180
`define SDR_COL_SIZE 8
181
`define SDR_ROW_SIZE 12
182
`define SDR_ROW_SIZE_12
183
`define SDR_BA_SIZE 2
184
`endif //  `ifdef MT48LC4M16
185
 
186
`ifdef MT48LC16M16
187
// using 1 of MT48LC16M16
188
// SDRAM data width is 16
189
`define SDR_SDRAM_DATA_WIDTH 16
190
`define SDR_SDRAM_DATA_WIDTH_16
191
`define SDR_COL_SIZE 9
192
`define SDR_ROW_SIZE 13
193
`define SDR_ROW_SIZE_13
194
`define SDR_BA_SIZE 2
195
`endif //  `ifdef MT48LC16M16
196
 
197
`ifdef MT48LC32M16
198
// using 1 of MT48LC32M16
199
// SDRAM data width is 16
200
`define SDR_SDRAM_DATA_WIDTH 16
201
`define SDR_SDRAM_DATA_WIDTH_16
202
`define SDR_COL_SIZE 10
203
`define SDR_ROW_SIZE 13
204
`define SDR_ROW_SIZE_13
205
`define SDR_BA_SIZE 2
206
`endif //  `ifdef MT48LC16M16
207
 
208
// Refresh whole memory every 64 ms
209
// Refresh each row every 64 ms
210
// refresh timeout = 64 ms / Tperiod / number_of_rows
211
 
212
// 64 MHz, row_size=12
213
// 64ms / (1/64MHz) / 2^12 = 1000
214
// ./VersatileCounter.php 10 1000
215
// 0101100100
216
 
217
`ifdef SDR_SDRAM_CLK_64
218
    `ifdef SDR_ROW_SIZE_12
219
        `define SDR_RFR_LENGTH 10
220
        `define SDR_RFR_WRAP_VALUE 0101100100
221
    `endif
222
    `ifdef SDR_ROW_SIZE_13
223
        `define SDR_RFR_LENGTH 9
224
        `define SDR_RFR_WRAP_VALUE 001000011
225
    `endif
226
`endif
227
`ifdef SDR_SDRAM_CLK_75
228
    `ifdef SDR_ROW_SIZE_12
229
        `define SDR_RFR_LENGTH 11
230
        `define SDR_RFR_WRAP_VALUE 00110001101
231
    `endif
232
    `ifdef SDR_ROW_SIZE_13
233
        `define SDR_RFR_LENGTH 10
234
        `define SDR_RFR_WRAP_VALUE 0110111101
235
    `endif
236
`endif
237
`ifdef SDR_SDRAM_CLK_125
238
    `ifdef SDR_ROW_SIZE_12
239
        `define SDR_RFR_LENGTH 11
240
        `define SDR_RFR_WRAP_VALUE 10001000001
241
    `endif
242
    `ifdef SDR_ROW_SIZE_13
243
        `define SDR_RFR_LENGTH 10
244
        `define SDR_RFR_WRAP_VALUE 1010000111
245
    `endif
246
`endif
247
`ifdef SDR_SDRAM_CLK_133
248
    `ifdef SDR_ROW_SIZE_12
249
        `define SDR_RFR_LENGTH 12
250
        `define SDR_RFR_WRAP_VALUE 101100000111
251
    `endif
252
    `ifdef SDR_ROW_SIZE_13
253
        `define SDR_RFR_LENGTH 11
254
        `define SDR_RFR_WRAP_VALUE 11111111010
255
    `endif
256
`endif
257
`ifdef SDR_SDRAM_CLK_154
258
    `ifdef SDR_ROW_SIZE_12
259
        `define SDR_RFR_LENGTH 12
260
        `define SDR_RFR_WRAP_VALUE 000101011110
261
    `endif
262
    `ifdef SDR_ROW_SIZE_13
263
        `define SDR_RFR_LENGTH 11
264
        `define SDR_RFR_WRAP_VALUE 00111101010
265
    `endif
266
`endif
267
 
268
 
269
// Disable burst
270
//`define SDR_NO_BURST
271
// Enable 4 beat wishbone busrt
272
`define SDR_BEAT4
273
// Enable 8 beat wishbone busrt
274
`define SDR_BEAT8
275
// Enable 16 beat wishbone busrt
276
`define SDR_BEAT16
277
 
278
// tRFC
279
`define SDR_TRFC 9
280
// tRP
281
`define SDR_TRP 2
282
// tRCD
283
`define SDR_TRCD 2
284
// tMRD
285
`define SDR_TMRD 2
286
 
287
// LMR
288
// [12:10] reserved
289
// [9]     WB, write burst; 0 - programmed burst length, 1 - single location
290
// [8:7]   OP Mode, 2'b00
291
// [6:4]   CAS Latency; 3'b010 - 2, 3'b011 - 3
292
// [3]     BT, Burst Type; 1'b0 - sequential, 1'b1 - interleaved
293
// [2:0]   Burst length; 3'b000 - 1, 3'b001 - 2, 3'b010 - 4, 3'b011 - 8, 3'b111 - full page
294
// LMR: Write burst
295
`define SDR_INIT_WB 1'b0
296
// LMR: CAS latency
297
`define SDR_INIT_CL 3'b010
298
// LMR: Burst type
299
`define SDR_INIT_BT 1'b0
300
// LMR: Burst length
301
`define SDR_INIT_BL 3'b001
302
 
303
`ifdef SDR
304
    `ifdef SDR_SDRAM_DATA_WIDTH_16
305
        `define WB_ADR_SIZE `SDR_BA_SIZE+`SDR_COL_SIZE+`SDR_ROW_SIZE+1
306
    `endif
307
`endif
308
//=tab DDR2 SDRAM
309
 
310
// Use existing Avalon compatible IP
311
`define DDR2_AVALON
312
// IP module name
313
`define DDR2_IP_NAME ALTERA_DDR2

powered by: WebSVN 2.1.0

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