1 |
454 |
ivang |
/* mc_dram.h - Memory Controller testbench SDRAM defines
|
2 |
|
|
Copyright (C) 2001 by Ivan Guzvinec, ivang@opencores.org
|
3 |
|
|
|
4 |
|
|
This file is part of OpenRISC 1000 Architectural Simulator.
|
5 |
|
|
|
6 |
|
|
This program is free software; you can redistribute it and/or modify
|
7 |
|
|
it under the terms of the GNU General Public License as published by
|
8 |
|
|
the Free Software Foundation; either version 2 of the License, or
|
9 |
|
|
(at your option) any later version.
|
10 |
|
|
|
11 |
|
|
This program is distributed in the hope that it will be useful,
|
12 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
|
|
GNU General Public License for more details.
|
15 |
|
|
|
16 |
|
|
You should have received a copy of the GNU General Public License
|
17 |
|
|
along with this program; if not, write to the Free Software
|
18 |
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
19 |
|
|
*/
|
20 |
|
|
|
21 |
|
|
#ifndef __MC_DRAM_H
|
22 |
|
|
#define __MC_DRAM_H
|
23 |
|
|
|
24 |
|
|
/* TEMPLATE SELECTION */
|
25 |
|
|
/* change #undef to #define */
|
26 |
|
|
#define _MC_TEST_TEMPLATE1
|
27 |
|
|
#undef _MC_TEST_TEMPLATE2
|
28 |
|
|
#undef _MC_TEST_TEMPLATE3
|
29 |
|
|
/* ------------------------ */
|
30 |
|
|
|
31 |
|
|
|
32 |
|
|
/* memory configuration that must reflect mcmem.cfg */
|
33 |
|
|
#define MC_SDRAM_CSMASK 0x02 /* 8 bit mask for 8 chip selects. 1 SDRAM at CS, 0 something else at CS */
|
34 |
|
|
/* bits: CS7|CS6|CS5|CS4|CS3|CS2|CS1|CS0 */
|
35 |
|
|
typedef struct MC_SDRAM_CS
|
36 |
|
|
{
|
37 |
|
|
unsigned long BW;
|
38 |
|
|
unsigned long MS;
|
39 |
|
|
unsigned long M;
|
40 |
|
|
} MC_SDRAM_CS;
|
41 |
|
|
|
42 |
|
|
MC_SDRAM_CS mc_sdram_cs[8] = {
|
43 |
|
|
{ 2, /* Bus Width : 0 - 8bit, 1 - 16bit, 2 - 32bit */
|
44 |
|
|
0, /* Memory Size : 0 - 64Mbit, 1 - 128Mbit, 2 - 256Mbit */
|
45 |
|
|
0x02 /* SELect mask */
|
46 |
|
|
},
|
47 |
|
|
{ 1, 0, 0x00 },
|
48 |
|
|
{ 2, 0, 0x06 },
|
49 |
|
|
{ 2, 0, 0x08 },
|
50 |
|
|
{ 2, 0, 0x0A },
|
51 |
|
|
{ 2, 0, 0x0C },
|
52 |
|
|
{ 2, 0, 0x0E },
|
53 |
|
|
{ 2, 0, 0x10 } };
|
54 |
|
|
|
55 |
|
|
/* SDRAM configuration tests flag defines */
|
56 |
|
|
#define MC_SDRAM_TEST0 0x00000001LU /*no parity, close row, BankAfterCol, R/W, single loc, seq. burst 1 */
|
57 |
|
|
#define MC_SDRAM_TEST1 0x00000002LU /*parity enabled*/
|
58 |
|
|
#define MC_SDRAM_TEST2 0x00000004LU /*keep row*/
|
59 |
|
|
#define MC_SDRAM_TEST3 0x00000008LU /*BankAfterRow*/
|
60 |
|
|
#define MC_SDRAM_TEST4 0x00000010LU /*RO*/
|
61 |
|
|
#define MC_SDRAM_TEST5 0x00000020LU /*prog. burst 1*/
|
62 |
|
|
#define MC_SDRAM_TEST6 0x00000040LU /* -||- 2*/
|
63 |
|
|
#define MC_SDRAM_TEST7 0x00000080LU /* -||- 4*/
|
64 |
|
|
#define MC_SDRAM_TEST8 0x00000100LU /* -||- 8*/
|
65 |
|
|
#define MC_SDRAM_TEST9 0x00000200LU /* -||- fullpage*/
|
66 |
|
|
#define MC_SDRAM_TEST10 0x00000400LU /*prog. burst int. 1*/
|
67 |
|
|
#define MC_SDRAM_TEST11 0x00000800LU /* -||- 2*/
|
68 |
|
|
#define MC_SDRAM_TEST12 0x00001000LU /* -||- 4*/
|
69 |
|
|
#define MC_SDRAM_TEST13 0x00002000LU /* -||- 8*/
|
70 |
|
|
#define MC_SDRAM_TEST14 0x00004000LU /* -||- fullpage*/
|
71 |
|
|
#define MC_SDRAM_TEST15 0x00008000LU /*prog. burst int. fullpage, keep row*/
|
72 |
|
|
#define MC_SDRAM_TEST16 0x00010000LU /* NOT DEFINED */
|
73 |
|
|
|
74 |
|
|
/* test type flag defines */
|
75 |
|
|
#define MC_SDRAM_SROW 0x00000001LU /* perform sequential row access test */
|
76 |
|
|
#define MC_SDRAM_RROW 0x00000010LU /* perform random row access test */
|
77 |
|
|
#define MC_SDRAM_SGRP 0x00000100LU /* perform sequential row-group access test */
|
78 |
|
|
#define MC_SDRAM_RGRP 0x00001000LU /* perform random row-group access test */
|
79 |
|
|
|
80 |
|
|
#define MC_SDRAM_ROWSH_0 16
|
81 |
|
|
#define MC_SDRAM_ROWSH_1 16
|
82 |
|
|
#define MC_SDRAM_ROWSH_2 15
|
83 |
|
|
#define MC_SDRAM_ROWSH_3 16
|
84 |
|
|
#define MC_SDRAM_ROWSH_4 16
|
85 |
|
|
#define MC_SDRAM_ROWSH_5 16
|
86 |
|
|
#define MC_SDRAM_ROWSH_6 17
|
87 |
|
|
#define MC_SDRAM_ROWSH_7 17
|
88 |
|
|
#define MC_SDRAM_ROWSH_8 17
|
89 |
|
|
|
90 |
|
|
|
91 |
|
|
/* TEMPLATE 1 */
|
92 |
|
|
#ifdef _MC_TEST_TEMPLATE1
|
93 |
|
|
#define MC_SDRAM_FLAGS 0x000004A8LU /* MC_TEST_ flags... see mc_common.h */
|
94 |
|
|
#define MC_SDRAM_TESTS 0x00000001LU /* mask for SDRAM configuration, see conf. test flag defines */
|
95 |
|
|
#define MC_SDRAM_ACC 0x00001010LU /* mask for test types */
|
96 |
|
|
|
97 |
|
|
/* memory sizes*/
|
98 |
|
|
#define MC_SDRAM_GROUPSIZE 5
|
99 |
|
|
/* MAX */
|
100 |
|
|
#define MC_SDRAM_ROWSIZE_0 8/* 16 * 1024 * 4 */
|
101 |
|
|
#define MC_SDRAM_ROWSIZE_1 8/* 16 * 1024 * 4 */
|
102 |
|
|
#define MC_SDRAM_ROWSIZE_2 8/* 8 * 1024 * 4 */
|
103 |
|
|
#define MC_SDRAM_ROWSIZE_3 8/* 16 * 1024 * 4 */
|
104 |
|
|
#define MC_SDRAM_ROWSIZE_4 8/* 16 * 1024 * 4 */
|
105 |
|
|
#define MC_SDRAM_ROWSIZE_5 8/* 16 * 1024 * 4 */
|
106 |
|
|
#define MC_SDRAM_ROWSIZE_6 8/* 32 * 1024 * 4 */
|
107 |
|
|
#define MC_SDRAM_ROWSIZE_7 8/* 32 * 1024 * 4 */
|
108 |
|
|
#define MC_SDRAM_ROWSIZE_8 8/* 32 * 1024 * 4 */
|
109 |
|
|
/* MAX */
|
110 |
|
|
#define MC_SDRAM_ROWS_0 25/* 512 */
|
111 |
|
|
#define MC_SDRAM_ROWS_1 25/* 256 */
|
112 |
|
|
#define MC_SDRAM_ROWS_2 25/* 256 */
|
113 |
|
|
#define MC_SDRAM_ROWS_3 25/* 1024 */
|
114 |
|
|
#define MC_SDRAM_ROWS_4 25/* 512 */
|
115 |
|
|
#define MC_SDRAM_ROWS_5 25/* 256 */
|
116 |
|
|
#define MC_SDRAM_ROWS_6 25/* 1024 */
|
117 |
|
|
#define MC_SDRAM_ROWS_7 25/* 512 */
|
118 |
|
|
#define MC_SDRAM_ROWS_8 25/* 256 */
|
119 |
|
|
|
120 |
|
|
#define MC_SDRAM_ROW_OFF 128
|
121 |
|
|
#endif /*_MC_TEST_TEMPLATE1*/
|
122 |
|
|
|
123 |
|
|
/* TEMPLATE 2 */
|
124 |
|
|
#ifdef _MC_TEST_TEMPLATE2
|
125 |
|
|
#define MC_SDRAM_FLAGS 0x000004A8LU /* MC_TEST_ flags... see mc_common.h */
|
126 |
|
|
#define MC_SDRAM_TESTS 0x00000001LU /* mask for SDRAM configuration, see conf. test flag defines */
|
127 |
|
|
#define MC_SDRAM_ACC 0x00001010LU /* mask for test types */
|
128 |
|
|
|
129 |
|
|
/* memory sizes*/
|
130 |
|
|
#define MC_SDRAM_GROUPSIZE 5
|
131 |
|
|
/* MAX */
|
132 |
|
|
#define MC_SDRAM_ROWSIZE_0 8/* 16 * 1024 * 4 */
|
133 |
|
|
#define MC_SDRAM_ROWSIZE_1 8/* 16 * 1024 * 4 */
|
134 |
|
|
#define MC_SDRAM_ROWSIZE_2 8/* 8 * 1024 * 4 */
|
135 |
|
|
#define MC_SDRAM_ROWSIZE_3 8/* 16 * 1024 * 4 */
|
136 |
|
|
#define MC_SDRAM_ROWSIZE_4 8/* 16 * 1024 * 4 */
|
137 |
|
|
#define MC_SDRAM_ROWSIZE_5 8/* 16 * 1024 * 4 */
|
138 |
|
|
#define MC_SDRAM_ROWSIZE_6 8/* 32 * 1024 * 4 */
|
139 |
|
|
#define MC_SDRAM_ROWSIZE_7 8/* 32 * 1024 * 4 */
|
140 |
|
|
#define MC_SDRAM_ROWSIZE_8 8/* 32 * 1024 * 4 */
|
141 |
|
|
/* MAX */
|
142 |
|
|
#define MC_SDRAM_ROWS_0 25/* 512 */
|
143 |
|
|
#define MC_SDRAM_ROWS_1 25/* 256 */
|
144 |
|
|
#define MC_SDRAM_ROWS_2 25/* 256 */
|
145 |
|
|
#define MC_SDRAM_ROWS_3 25/* 1024 */
|
146 |
|
|
#define MC_SDRAM_ROWS_4 25/* 512 */
|
147 |
|
|
#define MC_SDRAM_ROWS_5 25/* 256 */
|
148 |
|
|
#define MC_SDRAM_ROWS_6 25/* 1024 */
|
149 |
|
|
#define MC_SDRAM_ROWS_7 25/* 512 */
|
150 |
|
|
#define MC_SDRAM_ROWS_8 25/* 256 */
|
151 |
|
|
|
152 |
|
|
#define MC_SDRAM_ROW_OFF 128
|
153 |
|
|
#endif /*_MC_TEST_TEMPLATE2*/
|
154 |
|
|
|
155 |
|
|
/* TEMPLATE 3 */
|
156 |
|
|
#ifdef _MC_TEST_TEMPLATE3
|
157 |
|
|
#define MC_SDRAM_FLAGS 0x000004A8LU /* MC_TEST_ flags... see mc_common.h */
|
158 |
|
|
#define MC_SDRAM_TESTS 0x00000001LU /* mask for SDRAM configuration, see conf. test flag defines */
|
159 |
|
|
#define MC_SDRAM_ACC 0x00001010LU /* mask for test types */
|
160 |
|
|
|
161 |
|
|
/* memory sizes*/
|
162 |
|
|
#define MC_SDRAM_GROUPSIZE 5
|
163 |
|
|
/* MAX */
|
164 |
|
|
#define MC_SDRAM_ROWSIZE_0 8/* 16 * 1024 * 4 */
|
165 |
|
|
#define MC_SDRAM_ROWSIZE_1 8/* 16 * 1024 * 4 */
|
166 |
|
|
#define MC_SDRAM_ROWSIZE_2 8/* 8 * 1024 * 4 */
|
167 |
|
|
#define MC_SDRAM_ROWSIZE_3 8/* 16 * 1024 * 4 */
|
168 |
|
|
#define MC_SDRAM_ROWSIZE_4 8/* 16 * 1024 * 4 */
|
169 |
|
|
#define MC_SDRAM_ROWSIZE_5 8/* 16 * 1024 * 4 */
|
170 |
|
|
#define MC_SDRAM_ROWSIZE_6 8/* 32 * 1024 * 4 */
|
171 |
|
|
#define MC_SDRAM_ROWSIZE_7 8/* 32 * 1024 * 4 */
|
172 |
|
|
#define MC_SDRAM_ROWSIZE_8 8/* 32 * 1024 * 4 */
|
173 |
|
|
/* MAX */
|
174 |
|
|
#define MC_SDRAM_ROWS_0 25/* 512 */
|
175 |
|
|
#define MC_SDRAM_ROWS_1 25/* 256 */
|
176 |
|
|
#define MC_SDRAM_ROWS_2 25/* 256 */
|
177 |
|
|
#define MC_SDRAM_ROWS_3 25/* 1024 */
|
178 |
|
|
#define MC_SDRAM_ROWS_4 25/* 512 */
|
179 |
|
|
#define MC_SDRAM_ROWS_5 25/* 256 */
|
180 |
|
|
#define MC_SDRAM_ROWS_6 25/* 1024 */
|
181 |
|
|
#define MC_SDRAM_ROWS_7 25/* 512 */
|
182 |
|
|
#define MC_SDRAM_ROWS_8 25/* 256 */
|
183 |
|
|
|
184 |
|
|
#define MC_SDRAM_ROW_OFF 128
|
185 |
|
|
#endif /*_MC_TEST_TEMPLATE3*/
|
186 |
|
|
|
187 |
|
|
#endif
|