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

Subversion Repositories wbddr3

[/] [wbddr3/] [trunk/] [doc/] [src/] [spec.tex] - Blame information for rev 8

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

Line No. Rev Author Line
1 2 dgisselq
\documentclass{gqtekspec}
2
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3
%%
4
%% Filename:    spec.tex
5
%%
6
%% Project:     A wishbone controlled DDR3 SDRAM memory controller.
7
%%
8
%% Purpose:     This LaTeX file contains all of the documentation, or should I
9
%%              say all of the description necessary to produce the
10
%%      documentation, currently provided with the Wishbone controlled DDR3
11
%%      SDRAM core.  For those interested in this core, this file is not nearly
12
%%      as interesting as the PDF file this file is used to create.  Therefore,
13
%%      I recommend building and then reading that pdf file, spec.pdf, before
14
%%      diving into what's going on within this file.  You should be able to
15
%%      find the pdf file in this SVN distribution, together with this LaTeX
16
%%      file and a copy of the GPL-3.0 license this file is distributed under.
17
%%      If not, just type 'make' in the doc directory and it (should) build the
18
%%      pdf file without a problem.  (This, of course, assumes you have a valid
19
%%      and working LaTeX distribution, together with dvips and Ghostscript.)
20
%%
21
%%
22
%% Creator:     Dan Gisselquist, Ph.D.
23
%%              Gisselquist Technology, LLC
24
%%
25
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
26
%%
27
%% Copyright (C) 2015-2016, Gisselquist Technology, LLC
28
%%
29
%% This program is free software (firmware): you can redistribute it and/or
30
%% modify it under the terms of  the GNU General Public License as published
31
%% by the Free Software Foundation, either version 3 of the License, or (at
32
%% your option) any later version.
33
%%
34
%% This program is distributed in the hope that it will be useful, but WITHOUT
35
%% ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
36
%% FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
37
%% for more details.
38
%%
39
%% You should have received a copy of the GNU General Public License along
40
%% with this program.  (It's in the $(ROOT)/doc directory, run make with no
41
%% target there if the PDF file isn't present.)  If not, see
42
%% <http://www.gnu.org/licenses/> for a copy.
43
%%
44
%% License:     GPL, v3, as defined and found on www.gnu.org,
45
%%              http://www.gnu.org/licenses/gpl.html
46
%%
47
%%
48
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
49
%%
50
%%
51
\usepackage{import}
52
\project{WB DDR3 SDRAM Controller}
53
\title{Specification}
54
\author{Dan Gisselquist, Ph.D.}
55
\email{dgisselq (at) opencores.org}
56
\revision{Rev.~0.0}
57
\begin{document}
58
\pagestyle{gqtekspecplain}
59
\titlepage
60
\begin{license}
61
Copyright (C) \theyear\today, Owner
62
 
63
This project is free software (firmware): you can redistribute it and/or
64
modify it under the terms of  the GNU General Public License as published
65
by the Free Software Foundation, either version 3 of the License, or (at
66
your option) any later version.
67
 
68
This program is distributed in the hope that it will be useful, but WITHOUT
69
ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
70
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
71
for more details.
72
 
73
You should have received a copy of the GNU General Public License along
74
with this program.  If not, see \texttt{http://www.gnu.org/licenses/} for a copy.
75
\end{license}
76
\begin{revisionhistory}
77
0.0 & 6/20/2016 & D. Gisselquist & Initial Version\\\hline
78
\end{revisionhistory}
79
% Revision History
80
% Table of Contents, named Contents
81
\tableofcontents
82
\listoffigures
83
\listoftables
84
\begin{preface}
85
Now, just why am I building this?  Because wishbone's been so good to me?
86
Because I've never used AXI?  Because I dislike not being able to see
87
what goes on within a memory controller, and have no insight into why it's
88
performance is as fast (or slow) as it is?  Because Xilinx allows you to only
89
open 4 banks at a tim?  Or is it because, when I went to purchase my first
90
high speed FPGA circuit board, the vendor offered me the opportunity to
91
purchase a DMA controller with it?  As a micro businessman, I really can't
92
afford using someone else's stuff.  Time is cheap, money isn't nearly so cheap.
93
 
94
Hence, I offer my work to you as well.  I hope you find it useful.  Of course,
95
the normal caveats are available: I am available for hire, and I would be happy
96
to modify this core or even the license it is distributed under, for an
97
appropriate incentive.
98
\end{preface}
99
 
100
\chapter{Introduction}
101
\pagenumbering{arabic}
102
\setcounter{page}{1}
103
 
104
%
105
% Introduction
106
%
107
% This section contains the introduction to the core, describing both its
108
% use and its features.
109
%
110
The purpose of this core is to provide a GPL Wishbone Core capable of commanding
111
a DDR3 memory at full speed.  A particular design goal is that consecutive
112
reads or writes should only take one additional clock per read/write.
113
 
114
% What is old
115
Since the DDR3 memory specification is dated as of August, 2009, memory chips
116
have been built to this specification.  However, since DDR3 SDRAM's are rather
117
complex, and there is a lot of work required to manage them, controllers for
118
DDR3 SDRAM's remain primarily in the realm of proprietary.
119
 
120
% What does the old lack?
121
Currently, there are no DDR3 controllers present on OpenCores.  Sure,
122
there's a project named ``DDR3 SDRAM controller'', yet it has no data files
123
present with it.  This leaves the FPGA engineers with the choice of building
124
a controller for a very complex interface, or using a proprietary core from
125
Xilinx's Memory Interface Generator, for which there is no insight into how it
126
works, and then retooling their bus from wishbone to AXI.
127
 
128
% What is new
129
This core is designed to meet that need: it is both open (GPL), as well as
130
wishbone compliant.
131
% What does the new have that the old lacks
132
Further, this core offers 32--bit granularity to an interface that would
133
otherwise offer only 128--bit granularity.  This core also offers complete
134
pipelind performance.
135
% What performance gain can be expected?
136
Because of the pipeline performance, this core is very appropriate for filling
137
cache lines.  Because the core also offers non--pipelined performance, it is
138
also appropriate for random access from a CPU--whether by a write--through cache
139
or a CPU working without a cache.
140
 
141
\chapter{Architecture}
142
 
143
% This section describes the architecture of the block.  A block level diagram
144
% should be included describing the top level of the design.
145
 
146 8 dgisselq
\section{Strategies}
147
\subsection{Bank}
148
Currently, banks are activated (opened) when needed and only precharged
149
(closed) upon refresh request.  Further, upon any read or write from one bank,
150
the next bank is activated as well, under the assumption that the next bank
151
will be needed soon.  This is necessary to allow pipeline access with no stalls
152
through the memory controller.
153
 
154
This means that, upon any bank miss, a bank precharge followed by bank activate
155
command will be necessary.
156
 
157
\subsection{Refresh}
158
The current build will pause all operations for four subsequent refreshes,
159
at roughly every 4 refresh intervals, and then allow operations to resume.
160
This pause is independent of anything going on, and includes a mandatory
161
wait for any writes to finish, followed by a precharge command---regardless of
162
whether or not such is required.
163
 
164
This is non-optimal, and ripe for optimizing later.  A better strategy might
165
be to do singular refreshes after any single refresh period assuming the bus
166
is free, to only issue a precharge if the bus is busy, and to only wait
167
prior to that precharge if a write is busy.  This will be a later optimization.
168
 
169 2 dgisselq
\chapter{Operation}
170
 
171
% This section describes the operation of the core.  Specific sequences, such
172
% as startup sequences, as well as the modes and states of the block should be
173
% described.
174
%
175
 
176
When accessed from within an FPGA, this core should be simple to access:
177
Raise the {\tt i\_wb\_cyc} line at the beginning of every transaction.
178
Set {\tt i\_wb\_stb} (transaction strobe), {\tt i\_wb\_we} (Write enable,
179
true if writing or false otherwise), {\tt i\_wb\_addr} (address of value),
180
and {\tt i\_wb\_data} for every transaction.  You may move to the next
181
transaction any time {\tt i\_wb\_stb} is true on the same clock that
182
{\tt o\_wb\_stall} is false.  Transactions will be pipelined internally.  When
183
{\tt o\_wb\_ack} is true, a transaction has completed.  If that transaction
184
was a read transaction, {\tt o\_wb\_data}, will also be filled with the data
185
read from the memory device.
186
 
187
\chapter{Clocks}
188
 
189
% This section specifies all of the clocks.  All clocks, clock domain passes
190
% and the clock relations should be described.
191
 
192
% Name | Source |    Rates (MHz)    | Remarks | Description
193
%               | Max|Min|Resolution|
194
 
195
This design is centered around a DDR-1600 chip.  In order to run this chip
196
at speed, it requires a 200MHz clock.  Xilinx recommends a 160~MHz clock for
197
their design, so it should work at slower rates--I just don't know how much
198
slower the design will continue to work for.
199
 
200
If you wish to slow down the design, adjust the parameter {\tt CKREFI4} to be
201
the number of clocks expected in four timse 7.8~$\mu$s.
202
 
203
\chapter{Wishbone Datasheet}\label{chap:wishbone}
204
Tbl.~\ref{tbl:wishbone}
205
\begin{table}[htbp]
206
\begin{center}
207
\begin{wishboneds}
208
Revision level of wishbone & WB B4 spec \\\hline
209
Type of interface & Slave, Read/Write, pipeline mode supported \\\hline
210
Port size & 32--bit \\\hline
211
Port granularity & 32--bit \\\hline
212
Maximum Operand Size & 32--bit \\\hline
213
Data transfer ordering & (Irrelevant) \\\hline
214
Clock constraints & Designed for 200MHz, DDR1600\\\hline
215
Signal Names & \begin{tabular}{ll}
216
                Signal Name & Wishbone Equivalent \\\hline
217
                {\tt i\_wb\_clk} & {\tt CLK\_I} \\
218
                {\tt i\_wb\_cyc} & {\tt CYC\_I} \\
219
                {\tt i\_wb\_stb} & {\tt STB\_I} \\
220
                {\tt i\_wb\_we} & {\tt WE\_I} \\
221
                {\tt i\_wb\_addr} & {\tt ADR\_I} \\
222
                {\tt i\_wb\_data} & {\tt DAT\_I} \\
223
                {\tt o\_wb\_ack} & {\tt ACK\_O} \\
224
                {\tt o\_wb\_stall} & {\tt STALL\_O} \\
225
                {\tt o\_wb\_data} & {\tt DAT\_O}
226
                \end{tabular}\\\hline
227
\end{wishboneds}
228
\caption{Wishbone Datasheet}\label{tbl:wishbone}
229
\end{center}\end{table}
230
is required by the wishbone specification, and so
231
it is included here.  The big thing to notice is that all accesses to the
232
DDR3 SDRAM memory are via 32--bit reads and writes to this interface.  You may
233
also wish to note that the scope supports pipeline reading and writing, to
234
speed up reading the results out.  As a result, the memory interface speed
235
should approach one transfer per clock once the pipeline is loaded, although
236
there will be delays loading the pipeline.
237
 
238
Further, the Wishbone specification this core communicates with has been
239
simplified in this manner: The {\tt STB\_I} signal has been constrained so that
240
it will only be true if {\tt CYC\_I} is also true.  To interface this core
241
in an environment without this requirement, simply create the {\tt i\_wb\_stb}
242
by anding {\tt STB\_I} together with {\tt CYC\_I} before sending the strobe
243
logic into the core.
244
 
245
\chapter{I/O Ports}
246
% This section specifies all of the core IO ports
247
 
248
The wishbone ports to this core were discussed in the last chapter, and shown
249
in Tbl.~\ref{tbl:wishbone}.  The rest of the I/O ports to this core are listed
250
in Tbl.~\ref{tbl:ioports}.
251
\begin{table}[htbp]
252
\begin{center}
253
\begin{portlist}
254
{\tt i\_clk\_200mhz}   & 1 & Output & A 200 MHz clock input \\
255
{\tt o\_ddr\_reset\_n} & 1 & Output & Active low reset command to the chip\\
256
{\tt o\_ddr\_cke}      & 1 & Output & Clock Enable \\
257
{\tt o\_ddr\_cs\_n}    & 1 & Output & Chip select\\
258
{\tt o\_ddr\_ras\_n}   & 1 & Output & RAS\# Command input \\
259
{\tt o\_ddr\_cas\_n}   & 1 & Output & RAS\# Command input \\
260
{\tt o\_ddr\_we\_n}    & 1 & Output & WE\# Command input \\
261
{\tt o\_ddr\_dqs}      & 1 & Output & True if the FPGA should drive the DQS on this clock, false otherwise.  While not a DDR output, this needs to be converted to a DDR 2'b10 (if true) before it leaves the FPGA, or high impedence if false. \\
262
{\tt o\_ddr\_dm}       &  3 & Output & Data Mask, used to enable only those valid writes.  Although a DDR output, we treat it as SDR since all transactions are 32--bits (or more).\\
263
{\tt o\_ddr\_odt}      &  1 & Output & On--Die--Termination bit.  This will be true any time the data lines are being driven\\
264
{\tt o\_ddr\_bus\_dir} &  1 & Output & True if the FPGA will be driving the data bus lines during this clock, false otherwise\\
265
{\tt o\_ddr\_ba}       &  3 & Output & Bank Address, 0-7\\
266
{\tt o\_ddr\_addr}     & 16 & Output & Command address, either row or column\\
267
{\tt o\_ddr\_data}     & 32 & Output & The output to be sent to the chip.  This will need to be bumped to DDR rates before it actually hits the chip. \\
268
{\tt i\_ddr\_data}     & 32 & Input  & The data input from the chip.  This comes in at DDR rates, and needs a Xilinx primitive to bring it from 16'bits to 32'bits.\\
269
\end{portlist}
270
\caption{List of IO ports that are not Wishbone Related}\label{tbl:ioports}
271
\end{center}\end{table}
272
 
273
% Appendices
274
% A. May be added to outline different specifications.  (??)
275
 
276
 
277
% Index
278
\end{document}
279
 
280
 

powered by: WebSVN 2.1.0

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