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 16

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 16 rudi
//  $Id: mc_defines.v,v 1.4 2001-11-29 02:16:28 rudi Exp $
41 4 rudi
//
42 16 rudi
//  $Date: 2001-11-29 02:16:28 $
43
//  $Revision: 1.4 $
44 4 rudi
//  $Author: rudi $
45
//  $Locker:  $
46
//  $State: Exp $
47
//
48
// Change History:
49
//               $Log: not supported by cvs2svn $
50 16 rudi
//               Revision 1.3  2001/09/10 13:44:17  rudi
51
//               *** empty log message ***
52
//
53 11 rudi
//               Revision 1.2  2001/08/10 08:16:21  rudi
54
//
55
//               - Changed IO names to be more clear.
56
//               - Uniquifyed define names to be core specific.
57
//               - Removed "Refresh Early" configuration
58
//
59 8 rudi
//               Revision 1.1  2001/07/29 07:34:41  rudi
60
//
61
//
62
//               1) Changed Directory Structure
63
//               2) Fixed several minor bugs
64
//
65 4 rudi
//               Revision 1.3  2001/06/12 15:19:49  rudi
66
//
67
//
68 16 rudi
//              Minor changes after running lint, and a small bug
69
//              fix reading csr and ba_mask registers.
70 4 rudi
//
71
//               Revision 1.2  2001/06/03 11:37:17  rudi
72
//
73
//
74
//               1) Fixed Chip Select Mask Register
75
//                      - Power On Value is now all ones
76
//                      - Comparison Logic is now correct
77
//
78
//               2) All resets are now asynchronous
79
//
80
//               3) Converted Power On Delay to an configurable item
81
//
82
//               4) Added reset to Chip Select Output Registers
83
//
84
//               5) Forcing all outputs to Hi-Z state during reset
85
//
86
//               Revision 1.1.1.1  2001/05/13 09:39:38  rudi
87
//               Created Directory Structure
88
//
89
//
90
//
91
//
92
 
93
`timescale 1ns / 10ps
94
 
95
/////////////////////////////////////////////////////////////////////
96
//
97
// This define selects how the WISHBONE interface determines if
98
// the internal register file is selected.
99
// This should be a simple address decoder. "wb_addr_i" is the
100
// WISHBONE address bus (32 bits wide).
101 11 rudi
//`define       MC_REG_SEL              (wb_addr_i[31:29] == 3'h6)
102
`define MC_REG_SEL              (wb_addr_i[31:29] == 3'b011)
103 4 rudi
 
104
// This define selects how the WISHBONE interface determines if
105
// the memory is selected.
106
// This should be a simple address decoder. "wb_addr_i" is the
107
// WISHBONE address bus (32 bits wide).
108 8 rudi
`define MC_MEM_SEL              (wb_addr_i[31:29] == 3'h0)
109 4 rudi
 
110
/////////////////////////////////////////////////////////////////////
111
//
112
// This are the default Power-On Reset values for Chip Select
113
//
114
 
115 16 rudi
// This will be defined by the run script for my test bench ...
116
//`define RUDIS_TB 1
117
 
118 4 rudi
// Defines which chip select is used for Power On booting
119
 
120 16 rudi
// To run my default testbench default boot CS must be 3 !!!
121
`ifdef RUDIS_TB
122
`define MC_DEF_SEL              3'h3
123
`else
124
`define MC_DEF_SEL              3'h0
125
`endif
126
 
127 4 rudi
// Defines the default (reset) TMS value for the DEF_SEL chip select
128 8 rudi
`define MC_DEF_POR_TMS  32'hffff_ffff
129 4 rudi
 
130
 
131
/////////////////////////////////////////////////////////////////////
132
//
133
// Define how many Chip Selects to Implement
134
//
135 8 rudi
`define MC_HAVE_CS1     1
136 11 rudi
//`define MC_HAVE_CS2   1
137
//`define MC_HAVE_CS3   1
138
//`define MC_HAVE_CS4   1
139
//`define MC_HAVE_CS5   1
140
//`define MC_HAVE_CS6   1
141
//`define MC_HAVE_CS7   1
142 4 rudi
 
143
 
144 16 rudi
// To run my default testbench those need to there !!!
145
`ifdef RUDIS_TB
146
`define MC_HAVE_CS2     1
147
`define MC_HAVE_CS3     1
148
`define MC_HAVE_CS4     1
149
`define MC_HAVE_CS5     1
150
`endif
151
 
152 4 rudi
/////////////////////////////////////////////////////////////////////
153
//
154
// Init Refresh
155
//
156
// Number of Refresh Cycles to perform during SDRAM initialization.
157
// This varies between SDRAM manufacturer. Typically this value is
158
// between 2 and 8. This number must be smaller than 16.
159 8 rudi
`define MC_INIT_RFRC_CNT        2
160 4 rudi
 
161
/////////////////////////////////////////////////////////////////////
162
//
163
// Power On Delay
164
//
165
// Most if SDRAMs require some time to initialize before they can be used
166
// after power on. If the Memory Controller shall stall after power on to
167
// allow SDRAMs to finish the initialization process uncomment the below
168
// define statement
169 8 rudi
`define MC_POR_DELAY    1
170 4 rudi
 
171
// This value defines how many MEM_CLK cycles the Memory Controller should
172
// stall. Default is 2.5uS. At a 10nS MEM_CLK cycle time, this would 250
173
// cycles.
174 8 rudi
`define MC_POR_DELAY_VAL        8'd250
175 4 rudi
 
176
 
177
// ===============================================================
178
// ===============================================================
179
// Various internal defines (DO NOT MODIFY !)
180
// ===============================================================
181
// ===============================================================
182
 
183
// Register settings encodings
184 8 rudi
`define MC_BW_8                 2'h0
185
`define MC_BW_16                2'h1
186
`define MC_BW_32                2'h2
187 4 rudi
 
188 8 rudi
`define MC_MEM_TYPE_SDRAM       3'h0
189
`define MC_MEM_TYPE_SRAM        3'h1
190
`define MC_MEM_TYPE_ACS         3'h2
191
`define MC_MEM_TYPE_SCS         3'h3
192 4 rudi
 
193 8 rudi
`define MC_MEM_SIZE_64          2'h0
194
`define MC_MEM_SIZE_128         2'h1
195
`define MC_MEM_SIZE_256         2'h2
196
 
197
// Command Valid, Ras_, Cas_, We_
198
`define MC_CMD_NOP              4'b0111
199
`define MC_CMD_PC               4'b1010
200
`define MC_CMD_ACT              4'b1011
201
`define MC_CMD_WR               4'b1100
202
`define MC_CMD_RD               4'b1101
203
`define MC_CMD_BT               4'b1110
204
`define MC_CMD_ARFR             4'b1001
205
`define MC_CMD_LMR              4'b1000
206
`define MC_CMD_XRD              4'b1111
207
`define MC_CMD_XWR              4'b1110
208
 
209
`define MC_SINGLE_BANK          1'b0
210
`define MC_ALL_BANKS            1'b1
211
 

powered by: WebSVN 2.1.0

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