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

Subversion Repositories mem_ctrl

[/] [mem_ctrl/] [trunk/] [rtl/] [verilog/] [mc_defines.v] - Blame information for rev 18

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

Line No. Rev Author Line
1 4 rudi
/////////////////////////////////////////////////////////////////////
2
////                                                             ////
3
////  WISHBONE Memory Controller Definitions                     ////
4
////                                                             ////
5
////                                                             ////
6
////  Author: Rudolf Usselmann                                   ////
7
////          rudi@asics.ws                                      ////
8
////                                                             ////
9
////                                                             ////
10
////  Downloaded from: http://www.opencores.org/cores/mem_ctrl/  ////
11
////                                                             ////
12
/////////////////////////////////////////////////////////////////////
13
////                                                             ////
14
//// Copyright (C) 2000 Rudolf Usselmann                         ////
15
////                    rudi@asics.ws                            ////
16
////                                                             ////
17
//// This source file may be used and distributed without        ////
18
//// restriction provided that this copyright statement is not   ////
19
//// removed from the file and that any derivative work contains ////
20
//// the original copyright notice and the associated disclaimer.////
21
////                                                             ////
22
////     THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY     ////
23
//// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED   ////
24
//// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS   ////
25
//// FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL THE AUTHOR      ////
26
//// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,         ////
27
//// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES    ////
28
//// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE   ////
29
//// GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR        ////
30
//// BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF  ////
31
//// LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT  ////
32
//// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT  ////
33
//// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE         ////
34
//// POSSIBILITY OF SUCH DAMAGE.                                 ////
35
////                                                             ////
36
/////////////////////////////////////////////////////////////////////
37
 
38
//  CVS Log
39
//
40 18 rudi
//  $Id: mc_defines.v,v 1.5 2001-12-11 02:47:19 rudi Exp $
41 4 rudi
//
42 18 rudi
//  $Date: 2001-12-11 02:47:19 $
43
//  $Revision: 1.5 $
44 4 rudi
//  $Author: rudi $
45
//  $Locker:  $
46
//  $State: Exp $
47
//
48
// Change History:
49
//               $Log: not supported by cvs2svn $
50 18 rudi
//               Revision 1.4  2001/11/29 02:16:28  rudi
51
//
52
//
53
//               - More Synthesis cleanup, mostly for speed
54
//               - Several bug fixes
55
//               - Changed code to avoid auto-precharge and
56
//                 burst-terminate combinations (apparently illegal ?)
57
//                 Now we will do a manual precharge ...
58
//
59 16 rudi
//               Revision 1.3  2001/09/10 13:44:17  rudi
60
//               *** empty log message ***
61
//
62 11 rudi
//               Revision 1.2  2001/08/10 08:16:21  rudi
63
//
64
//               - Changed IO names to be more clear.
65
//               - Uniquifyed define names to be core specific.
66
//               - Removed "Refresh Early" configuration
67
//
68 8 rudi
//               Revision 1.1  2001/07/29 07:34:41  rudi
69
//
70
//
71
//               1) Changed Directory Structure
72
//               2) Fixed several minor bugs
73
//
74 4 rudi
//               Revision 1.3  2001/06/12 15:19:49  rudi
75
//
76
//
77 16 rudi
//              Minor changes after running lint, and a small bug
78
//              fix reading csr and ba_mask registers.
79 4 rudi
//
80
//               Revision 1.2  2001/06/03 11:37:17  rudi
81
//
82
//
83
//               1) Fixed Chip Select Mask Register
84
//                      - Power On Value is now all ones
85
//                      - Comparison Logic is now correct
86
//
87
//               2) All resets are now asynchronous
88
//
89
//               3) Converted Power On Delay to an configurable item
90
//
91
//               4) Added reset to Chip Select Output Registers
92
//
93
//               5) Forcing all outputs to Hi-Z state during reset
94
//
95
//               Revision 1.1.1.1  2001/05/13 09:39:38  rudi
96
//               Created Directory Structure
97
//
98
//
99
//
100
//
101
 
102
`timescale 1ns / 10ps
103
 
104
/////////////////////////////////////////////////////////////////////
105
//
106
// This define selects how the WISHBONE interface determines if
107
// the internal register file is selected.
108
// This should be a simple address decoder. "wb_addr_i" is the
109
// WISHBONE address bus (32 bits wide).
110 11 rudi
//`define       MC_REG_SEL              (wb_addr_i[31:29] == 3'h6)
111
`define MC_REG_SEL              (wb_addr_i[31:29] == 3'b011)
112 4 rudi
 
113
// This define selects how the WISHBONE interface determines if
114
// the memory is selected.
115
// This should be a simple address decoder. "wb_addr_i" is the
116
// WISHBONE address bus (32 bits wide).
117 8 rudi
`define MC_MEM_SEL              (wb_addr_i[31:29] == 3'h0)
118 4 rudi
 
119
/////////////////////////////////////////////////////////////////////
120
//
121
// This are the default Power-On Reset values for Chip Select
122
//
123
 
124 16 rudi
// This will be defined by the run script for my test bench ...
125 18 rudi
`define RUDIS_TB 1
126 16 rudi
 
127 4 rudi
// Defines which chip select is used for Power On booting
128
 
129 16 rudi
// To run my default testbench default boot CS must be 3 !!!
130
`ifdef RUDIS_TB
131
`define MC_DEF_SEL              3'h3
132
`else
133
`define MC_DEF_SEL              3'h0
134
`endif
135
 
136 4 rudi
// Defines the default (reset) TMS value for the DEF_SEL chip select
137 8 rudi
`define MC_DEF_POR_TMS  32'hffff_ffff
138 4 rudi
 
139
 
140
/////////////////////////////////////////////////////////////////////
141
//
142
// Define how many Chip Selects to Implement
143
//
144 8 rudi
`define MC_HAVE_CS1     1
145 11 rudi
//`define MC_HAVE_CS2   1
146
//`define MC_HAVE_CS3   1
147
//`define MC_HAVE_CS4   1
148
//`define MC_HAVE_CS5   1
149
//`define MC_HAVE_CS6   1
150
//`define MC_HAVE_CS7   1
151 4 rudi
 
152
 
153 16 rudi
// To run my default testbench those need to there !!!
154
`ifdef RUDIS_TB
155
`define MC_HAVE_CS2     1
156
`define MC_HAVE_CS3     1
157
`define MC_HAVE_CS4     1
158
`define MC_HAVE_CS5     1
159
`endif
160
 
161 4 rudi
/////////////////////////////////////////////////////////////////////
162
//
163
// Init Refresh
164
//
165
// Number of Refresh Cycles to perform during SDRAM initialization.
166
// This varies between SDRAM manufacturer. Typically this value is
167
// between 2 and 8. This number must be smaller than 16.
168 8 rudi
`define MC_INIT_RFRC_CNT        2
169 4 rudi
 
170
/////////////////////////////////////////////////////////////////////
171
//
172
// Power On Delay
173
//
174
// Most if SDRAMs require some time to initialize before they can be used
175
// after power on. If the Memory Controller shall stall after power on to
176
// allow SDRAMs to finish the initialization process uncomment the below
177
// define statement
178 8 rudi
`define MC_POR_DELAY    1
179 4 rudi
 
180
// This value defines how many MEM_CLK cycles the Memory Controller should
181
// stall. Default is 2.5uS. At a 10nS MEM_CLK cycle time, this would 250
182
// cycles.
183 8 rudi
`define MC_POR_DELAY_VAL        8'd250
184 4 rudi
 
185
 
186
// ===============================================================
187
// ===============================================================
188
// Various internal defines (DO NOT MODIFY !)
189
// ===============================================================
190
// ===============================================================
191
 
192
// Register settings encodings
193 8 rudi
`define MC_BW_8                 2'h0
194
`define MC_BW_16                2'h1
195
`define MC_BW_32                2'h2
196 4 rudi
 
197 8 rudi
`define MC_MEM_TYPE_SDRAM       3'h0
198
`define MC_MEM_TYPE_SRAM        3'h1
199
`define MC_MEM_TYPE_ACS         3'h2
200
`define MC_MEM_TYPE_SCS         3'h3
201 4 rudi
 
202 8 rudi
`define MC_MEM_SIZE_64          2'h0
203
`define MC_MEM_SIZE_128         2'h1
204
`define MC_MEM_SIZE_256         2'h2
205
 
206
// Command Valid, Ras_, Cas_, We_
207
`define MC_CMD_NOP              4'b0111
208
`define MC_CMD_PC               4'b1010
209
`define MC_CMD_ACT              4'b1011
210
`define MC_CMD_WR               4'b1100
211
`define MC_CMD_RD               4'b1101
212
`define MC_CMD_BT               4'b1110
213
`define MC_CMD_ARFR             4'b1001
214
`define MC_CMD_LMR              4'b1000
215
`define MC_CMD_XRD              4'b1111
216
`define MC_CMD_XWR              4'b1110
217
 
218
`define MC_SINGLE_BANK          1'b0
219
`define MC_ALL_BANKS            1'b1
220
 

powered by: WebSVN 2.1.0

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