1 |
2 |
dgisselq |
\documentclass{gqtekspec}
|
2 |
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
3 |
|
|
%%
|
4 |
|
|
%% Filename: spec.tex
|
5 |
|
|
%%
|
6 |
|
|
%% Project: OpenArty, an entirely open SoC based upon the Arty platform
|
7 |
|
|
%%
|
8 |
|
|
%% Purpose:
|
9 |
|
|
%%
|
10 |
|
|
%% Creator: Dan Gisselquist, Ph.D.
|
11 |
|
|
%% Gisselquist Technology, LLC
|
12 |
|
|
%%
|
13 |
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
14 |
|
|
%%
|
15 |
|
|
%% Copyright (C) 2015-2016, Gisselquist Technology, LLC
|
16 |
|
|
%%
|
17 |
|
|
%% This program is free software (firmware): you can redistribute it and/or
|
18 |
|
|
%% modify it under the terms of the GNU General Public License as published
|
19 |
|
|
%% by the Free Software Foundation, either version 3 of the License, or (at
|
20 |
|
|
%% your option) any later version.
|
21 |
|
|
%%
|
22 |
|
|
%% This program is distributed in the hope that it will be useful, but WITHOUT
|
23 |
|
|
%% ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
|
24 |
|
|
%% FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
25 |
|
|
%% for more details.
|
26 |
|
|
%%
|
27 |
|
|
%% You should have received a copy of the GNU General Public License along
|
28 |
|
|
%% with this program. (It's in the $(ROOT)/doc directory, run make with no
|
29 |
|
|
%% target there if the PDF file isn't present.) If not, see
|
30 |
|
|
%% <http://www.gnu.org/licenses/> for a copy.
|
31 |
|
|
%%
|
32 |
|
|
%% License: GPL, v3, as defined and found on www.gnu.org,
|
33 |
|
|
%% http://www.gnu.org/licenses/gpl.html
|
34 |
|
|
%%
|
35 |
|
|
%%
|
36 |
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
37 |
|
|
%%
|
38 |
|
|
%%
|
39 |
|
|
\usepackage{import}
|
40 |
|
|
\usepackage{bytefield}
|
41 |
|
|
\project{OpenArty}
|
42 |
|
|
\title{Specification}
|
43 |
|
|
\author{Dan Gisselquist, Ph.D.}
|
44 |
|
|
\email{dgisselq (at) opencores.org}
|
45 |
|
|
\revision{Rev.~0.0}
|
46 |
|
|
\begin{document}
|
47 |
|
|
\pagestyle{gqtekspecplain}
|
48 |
|
|
\titlepage
|
49 |
|
|
\begin{license}
|
50 |
|
|
Copyright (C) \theyear\today, Gisselquist Technology, LLC
|
51 |
|
|
|
52 |
|
|
This project is free software (firmware): you can redistribute it and/or
|
53 |
|
|
modify it under the terms of the GNU General Public License as published
|
54 |
|
|
by the Free Software Foundation, either version 3 of the License, or (at
|
55 |
|
|
your option) any later version.
|
56 |
|
|
|
57 |
|
|
This program is distributed in the hope that it will be useful, but WITHOUT
|
58 |
|
|
ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
|
59 |
|
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
60 |
|
|
for more details.
|
61 |
|
|
|
62 |
|
|
You should have received a copy of the GNU General Public License along
|
63 |
|
|
with this program. If not, see \texttt{http://www.gnu.org/licenses/} for a copy.
|
64 |
|
|
\end{license}
|
65 |
|
|
\begin{revisionhistory}
|
66 |
36 |
dgisselq |
0.0 & 6/20/2016 & Gisselquist & First Draft \\\hline
|
67 |
|
|
0.0 & 10/21/2016 & Gisselquist & More Comments Added\\\hline
|
68 |
2 |
dgisselq |
\end{revisionhistory}
|
69 |
|
|
% Revision History
|
70 |
|
|
% Table of Contents, named Contents
|
71 |
|
|
\tableofcontents
|
72 |
|
|
\listoffigures
|
73 |
|
|
\listoftables
|
74 |
|
|
\begin{preface}
|
75 |
|
|
\end{preface}
|
76 |
|
|
|
77 |
36 |
dgisselq |
\chapter{Introduction}\label{ch:intro}
|
78 |
2 |
dgisselq |
\pagenumbering{arabic}
|
79 |
|
|
\setcounter{page}{1}
|
80 |
|
|
|
81 |
|
|
% What is old
|
82 |
|
|
% Arty, XuLA
|
83 |
|
|
% What does the old lack?
|
84 |
|
|
% Arty lacks open interfaces, instead using MIG and CoreGen w/ AXI bus
|
85 |
|
|
% What is new
|
86 |
|
|
% OpenArty has its own memory interface controller, and runs everything
|
87 |
|
|
% off of an open Wishbone bus structure.
|
88 |
|
|
% What does the new have that the old lacks
|
89 |
|
|
%
|
90 |
|
|
% What performance gain can be expected?
|
91 |
|
|
%
|
92 |
|
|
|
93 |
|
|
The goals of this project include:
|
94 |
|
|
\begin{enumerate}
|
95 |
|
|
\item Use entirely open interfaces
|
96 |
|
|
|
97 |
|
|
This means not using the Memory Interface Generator (MIG), the
|
98 |
|
|
Xilinx CoreGen IP, etc. Further, I wish to use all of Arty's on--board
|
99 |
|
|
hardware: Flash, DDR3-SDRAM, Ethernet, and everything else at their
|
100 |
|
|
full and fastest speed(s). For example, the flash will need to be
|
101 |
30 |
dgisselq |
clocked at 82~MHz, not the 50~MHz I've clocked it at before. The
|
102 |
2 |
dgisselq |
memory should also be able to support pipelined 32--bit interactions
|
103 |
30 |
dgisselq |
over the Wishbone bus at a 162~MHz clock. Finally, the Ethernet
|
104 |
2 |
dgisselq |
controller should be supported by a DMA capable interface that can
|
105 |
|
|
drive the ethernet at its full 100Mbps rate.
|
106 |
|
|
|
107 |
30 |
dgisselq |
\item Run using a 162.5~MHz clock, if for no other reason than to gain the
|
108 |
|
|
experience of building logic that can run that fast.\footnote{The
|
109 |
|
|
original goal was to run at 200~MHz. However, the memory controller
|
110 |
|
|
cannot run faster than 83~MHz. If we run it at 81.25~MHz and double
|
111 |
|
|
that clock to get our logic clock, that now places us at 162.5~MHz.
|
112 |
|
|
200~MHz is \ldots too fast for DDR3 transfers using the Artix--7 chip
|
113 |
|
|
on the Arty.}
|
114 |
2 |
dgisselq |
|
115 |
|
|
\item Modify the ZipCPU to support an MMU and a data cache, and perhaps even
|
116 |
|
|
a floating point unit.
|
117 |
|
|
|
118 |
|
|
\item The default configuration will also include three Pmods: a USBUART,
|
119 |
|
|
an SDCard, and the GPS Pmod.
|
120 |
|
|
\end{enumerate}
|
121 |
|
|
|
122 |
|
|
I intend to demonstrate this project with a couple programs:
|
123 |
|
|
\begin{enumerate}
|
124 |
|
|
\item NTP Server
|
125 |
|
|
\item A ZipOS that can actually load and run programs from the SD Card
|
126 |
36 |
dgisselq |
|
127 |
|
|
This will require a functioning memory management unit (MMU), which
|
128 |
|
|
will be a new addition to the ZipCPU created to support this project.
|
129 |
|
|
For those not familiar with MMU's, an MMU translates memory addresses
|
130 |
|
|
from a virtual address space to a physical address space. This allows
|
131 |
|
|
every program running on the ZipCPU to believe that they own the entire
|
132 |
|
|
memory address space, while allowing the operating system to allocate
|
133 |
|
|
actual physical memory addresses as necessary to support whatever
|
134 |
|
|
program needs more (or less) memory.
|
135 |
2 |
dgisselq |
\end{enumerate}
|
136 |
|
|
|
137 |
|
|
|
138 |
|
|
|
139 |
36 |
dgisselq |
|
140 |
|
|
|
141 |
|
|
\chapter{Architecture}\label{ch:architecture}
|
142 |
|
|
My philosophy in peripherals is to keep them simple. If there is a default
|
143 |
|
|
mode on the peripheral, setting that mode should not require turning any bits
|
144 |
|
|
on. If a peripheral encounters an error condition, a bit may be turned on to
|
145 |
|
|
indicate this fact, otherwise status bits will be left in the off position.
|
146 |
|
|
|
147 |
|
|
\subsection{Bus Structure}
|
148 |
|
|
The OpenArty project contains four bus masters, three of them within the CPU.
|
149 |
|
|
These masters are the instruction fetch unit, the data read/write unit,
|
150 |
|
|
and the direct memory access peripheral within the ZipCPU, as well as an
|
151 |
|
|
external debug port which can be commanded from over the main UART port
|
152 |
|
|
connecting the Arty to its host.
|
153 |
|
|
|
154 |
|
|
There is also a second minor peripheral bus located within the ZipCPU
|
155 |
|
|
ZipSystem. This bus provides access to a number of peripherals within the
|
156 |
|
|
ZipSystem, such as timers, counters, and the direct memory access controller.
|
157 |
|
|
This bus will also be used to configure the memory management unit once
|
158 |
|
|
integrated. This bus is only visible to the CPU, and located starting at
|
159 |
|
|
address {\tt 0xc0000000}.
|
160 |
|
|
|
161 |
|
|
The ZipCPU debug port is also available on the bus. This port, however, is
|
162 |
|
|
only visible to the external debug port. It can be found at address
|
163 |
|
|
{\tt 0x08000000} for the control register, and {\tt 0x08000001} for the
|
164 |
|
|
data register.
|
165 |
|
|
|
166 |
|
|
Once the MMU has been integrated, it will be placed between the instruction
|
167 |
|
|
fetch unit, data read/write unit, and the rest of the peripheral bus.
|
168 |
|
|
|
169 |
|
|
The actual bus chosen for this design is the Wishbone Bus, based upon the
|
170 |
|
|
pipeline mode defined in the B4 specification. All optional wires required
|
171 |
|
|
by this bus structure have been removed, such as the tag lines, the cycle
|
172 |
|
|
type identifier, the burst type, and so forth. This was done to simplify
|
173 |
|
|
the logic within the core.
|
174 |
|
|
|
175 |
|
|
However, because of the complicated bus structure--particularly because of the
|
176 |
|
|
number of masters and slaves on the bus and the speed for which the bus is
|
177 |
|
|
defined, there are a number of delays and arbiters placed on the bus. As a
|
178 |
|
|
result, the stall wire which is supposed to be depend upon combinational logic
|
179 |
|
|
only, has been registered at a number of locations. What this means is that
|
180 |
|
|
there are a variety of delays as commands propagate through the bus structure.
|
181 |
|
|
Most of these are variable, in that they can be turned on or off at build time,
|
182 |
|
|
or even that the stall line may (or may not) be registered as configured.
|
183 |
|
|
|
184 |
|
|
All interactions between bus masters and any peripherals passes through the
|
185 |
|
|
interconnect, located in {\tt busmaster.v}. This interconnect divides the
|
186 |
|
|
slaves into separate groups. The first group of slaves are those for which the
|
187 |
|
|
bus is supposed to provide fast access to. These are the DDR3 SDRAM, the
|
188 |
|
|
flash, the block RAM, and the network. The next group of slaves will have their
|
189 |
|
|
acknowledgements delayed by an additional clock. The final group of slaves
|
190 |
|
|
are those single register slaves whose results may be known ahead of any read,
|
191 |
|
|
and who only require one clock to access. These are grouped together and
|
192 |
|
|
controlled from within {\tt fastio.v}.
|
193 |
|
|
|
194 |
|
|
Further information about the Wishbone bus structure found within this core
|
195 |
|
|
can be found either on the Wishbone datasheet (Ch.~\ref{ch:wishbone}), or in
|
196 |
|
|
the memory map table in the Registers chapter (Ch.~\ref{ch:registers}).
|
197 |
|
|
|
198 |
|
|
\subsection{DDR3 SDRAM}
|
199 |
|
|
|
200 |
|
|
{\em It is the intention of this project to use a completely open source
|
201 |
|
|
DDR3 SDRAM controller. While the controller has been written, it has yet to
|
202 |
|
|
be successfully connected to the physical pins of the port. Until that time,
|
203 |
|
|
the design is running using a Wishbone to AXI bus bridge. Memory may still
|
204 |
|
|
be read or written, after an initial pipeline delay of roughly 27~clocks per
|
205 |
|
|
access, at one access per clock.}
|
206 |
|
|
|
207 |
|
|
{\em The open source SDRAM controller should be able to achieve a delay closer
|
208 |
|
|
to 9~clocks per access--once I figure out how to connect it to the PHY.}
|
209 |
|
|
|
210 |
|
|
\subsection{Flash}
|
211 |
|
|
\subsection{Block RAM}
|
212 |
|
|
|
213 |
|
|
The block RAM on this board has been arranged into one 32kW section.
|
214 |
|
|
Programs that use block RAM will run fastest using the block RAM, both for
|
215 |
|
|
instructions as well as for memory.
|
216 |
|
|
|
217 |
|
|
\subsection{Ethernet}
|
218 |
|
|
|
219 |
|
|
The ether net controller has been split into three parts. The first part is
|
220 |
|
|
an area of packet memory. This part is simple: it acts like memory. The
|
221 |
|
|
receive memory is read only, whereas the transmit memory is both read and
|
222 |
|
|
write. Packets received by the controller will be found in the receive memory,
|
223 |
|
|
packets transmitted must be in the transmit area of memory. The octets
|
224 |
|
|
may be found in memory with the first octet in the most significant byte.
|
225 |
|
|
This is the easy part.
|
226 |
|
|
|
227 |
|
|
The format of the packets within this memory is a touch more interesting.
|
228 |
|
|
With no options turned on, the first 6~bytes are the destination MAC
|
229 |
|
|
address, the next 6~bytes will be the source MAC address, and the {\em next
|
230 |
|
|
4~bytes} will be the EtherType repeated twice. This was done to align the
|
231 |
|
|
packet, and particularly the IP header, onto word boundaries. If the hardware
|
232 |
|
|
CRC has been turned off, the packet must contain its own CRC as well as
|
233 |
|
|
ensuring that it has a minimum packet length (64 octets) when including that
|
234 |
|
|
CRC.
|
235 |
|
|
|
236 |
|
|
With all options turned on, however, things are a touch simpler. The first
|
237 |
|
|
two words of the packet contain the destination MAC (for a transmit packet)
|
238 |
|
|
or the source MAC (for a received packet), followed by the two--octet
|
239 |
|
|
EtherType. At this point the packet is word--aligned prior to the IP header.
|
240 |
|
|
Since broadcast packets are sent to a special destination MAC other than
|
241 |
|
|
our own, a flag in the command register will indicate this fact.
|
242 |
|
|
|
243 |
|
|
|
244 |
|
|
The second part of the controller is the MDIO interface. This follows from
|
245 |
|
|
the specification, and can be used to toggle the LED's on the ethernet,
|
246 |
|
|
to force the ethernet into a particular mode, either 10M or 100M, to control
|
247 |
|
|
auto--negotiation of the speed, and more. Reads or writes to MDIO memory
|
248 |
|
|
addresses will command reads or writes via the MDIO port from the FPGA to the
|
249 |
|
|
ethernet PHY. As the PHY can only handle 16--bit words, only 16~bits will
|
250 |
|
|
ever be transferred as a result of any read/write command, the top 16~bits
|
251 |
|
|
are automatically set to zero. Further details of this capability may be
|
252 |
|
|
found within the specification for the chip.
|
253 |
|
|
|
254 |
|
|
The MDIO interface may be ignored. If ignored, the defaults within the
|
255 |
|
|
interface will naturally set up the network connection in full duplex mode (if
|
256 |
|
|
your hardware supports it), at the highest speed the network will support.
|
257 |
|
|
However, if you ignore this interface you may not know what problems you are
|
258 |
|
|
suffering from this interface, if any. The {\tt netsetup} program has been
|
259 |
|
|
provided, among the host software, to help diagnose how the various MDIO
|
260 |
|
|
registers have been set, and what the status is that is being reported from
|
261 |
|
|
the PHY.
|
262 |
|
|
|
263 |
|
|
The third part of the controller is the packet command interface. This
|
264 |
|
|
consists of two command registers, one for reading and one for writing.
|
265 |
|
|
Before doing anything with the network, it must first be taken out of
|
266 |
|
|
reset. According to the specification for the network chip, this must
|
267 |
|
|
happen a minimum of one second after power up. This may be done by simply
|
268 |
|
|
writing to the transmit command register with the reset bit turned off.
|
269 |
|
|
|
270 |
|
|
To send a packet, simply write the number of octets in the packet to the
|
271 |
|
|
transmit control register and set the GO bit ({\tt 0x04000}). Other bits
|
272 |
|
|
in this control register can be used to turn off the hardware MAC generation
|
273 |
|
|
(and removal upon receive), the hardware CRC checking, and/or the hardware
|
274 |
|
|
IP header checksum validation (but not generation). The GO bit will remain
|
275 |
|
|
high while the packet is being sent, and only transition to low once the
|
276 |
|
|
packet is away. While the packet is being sent, a zero may be written to the
|
277 |
|
|
command register to cancel the packet--although this is not recommended.
|
278 |
|
|
|
279 |
|
|
Packets are automatically received without intervention. Once a packet has been
|
280 |
|
|
received, the available bit will be set in the receive command register and
|
281 |
|
|
a receive packet interrupt will be generated. The ethernet port will then
|
282 |
|
|
halt/stall until a user has reset the receive interface so that it may
|
283 |
|
|
receive the next packet. Without clearing this interface, the receive port
|
284 |
|
|
will not accept further packets. Other status bits in this interface are
|
285 |
|
|
used to indicate whether packets have been missed (because the interface was
|
286 |
|
|
busy), or thrown out due to some error such as a CRC error or a more general
|
287 |
|
|
error.\footnote{It should be possible to extend this interface so that further
|
288 |
|
|
packets may be read as long as the memory isn't yet full. This is left as an
|
289 |
|
|
exercise to others.}
|
290 |
|
|
|
291 |
|
|
\subsection{SD Card}
|
292 |
|
|
\subsection{GPS Tracking}
|
293 |
|
|
\subsection{Configuration port}
|
294 |
|
|
|
295 |
|
|
The registers associated with the ICAPE2 port have been made accessible
|
296 |
|
|
to the core via the {\tt wbicapetwo} core. More information about the meaning
|
297 |
|
|
of these registers can be found in Xilinx's ``7--Series FPGAs Configuration
|
298 |
|
|
User's Guide''.
|
299 |
|
|
|
300 |
|
|
Testing with the OpenArty board has tended to focus on the warmboot capability.
|
301 |
|
|
Using this capability, a user is able to command the FPGA to reload its
|
302 |
|
|
configuration. In support of this, two configuration areas have been
|
303 |
|
|
defined within memory. The first is the default configuration, found at
|
304 |
|
|
the beginning of the flash. This configuration is sometimes called the ``golden
|
305 |
|
|
configuration'' within Xilinx's documentation because it is the configuration
|
306 |
|
|
that the Xilinx device will always start up from after a power on reset. On
|
307 |
|
|
the OpenArty, a second configuration may immediately follow the first in flash.
|
308 |
|
|
Commanding the FPGA to reload it's configuration is as simple as
|
309 |
|
|
setting the WBSTAR (warm boot start address) register to the location of the
|
310 |
|
|
new configuration within the flash, and then writing a 15 (a.k.a. IPROG)
|
311 |
|
|
to the FPGA command register (offset 4 from the beginning of the ICAPE2
|
312 |
|
|
addresses). Examples of doing this are found in the
|
313 |
|
|
{\tt sw/host/zprog.sh} and {\tt sw/host/program.sh} scripts. The former
|
314 |
|
|
programs the default configuration and then switches to it,
|
315 |
|
|
|
316 |
|
|
This configuration capability makes it possible for a user to 1) reprogram
|
317 |
|
|
the flash with an experimental configuration in the second configuration
|
318 |
|
|
location, and 2) test the configuration without actually touching the board.
|
319 |
|
|
If the configuration doesn't work well enough to be communicated with, the
|
320 |
|
|
board may simply be powered down and it will come back up with the initial
|
321 |
|
|
or golden configuration. If the golden configuration ever gets corrupted,
|
322 |
|
|
or loaded with a configuration that will not work, then the user will need to
|
323 |
|
|
reload the FPGA from the JTAG port.
|
324 |
|
|
|
325 |
|
|
\subsection{OLED}
|
326 |
|
|
\subsection{Real Time Clock}
|
327 |
|
|
|
328 |
|
|
The Arty board contains a real time clock core together with a companion
|
329 |
|
|
real time date/calendar core. The clock core itself contains not only current
|
330 |
|
|
time, but also a stopwatch, seconds timer, and alarm. The real time date core
|
331 |
|
|
can be used to maintain the current date. The real--time clock core uses the
|
332 |
|
|
GPS PPS output, as schooled by the GPS tracking circuit, in order to synchronize
|
333 |
|
|
their subsecond timing to the GPS itself. Further, the real--time clock core
|
334 |
|
|
then creates a synchronization wire for the real--time date core.
|
335 |
|
|
|
336 |
|
|
Neither of these cores exports its subsecond precision to the rest of the
|
337 |
|
|
design. This must be done using either the internal GPS tracking wires, or
|
338 |
|
|
by reading the time information from the tracking test bench.
|
339 |
|
|
|
340 |
|
|
\subsection{LEDs}
|
341 |
|
|
|
342 |
|
|
The Arty board contains two sets of LEDs: a plain set of LEDs, and a colored
|
343 |
|
|
set of LEDs.
|
344 |
|
|
|
345 |
|
|
The plain set of LEDs is controlled simply from the LED register. This register
|
346 |
|
|
can be used to turn these LEDs on and off, either individually or as a whole.
|
347 |
|
|
It has been designed for atomic access, so only one write to this register
|
348 |
|
|
is necessary to set any particular LED.
|
349 |
|
|
|
350 |
|
|
The color LEDs are slightly different. Each color LED is supported by its
|
351 |
|
|
own register, which controls three pulse width modulation controllers. Three
|
352 |
|
|
groups of eight bits within the color LED register control the PWM thresholds,
|
353 |
|
|
first for red, then green, and then in the lowest bits for blue. These are
|
354 |
|
|
used to turn on and off the various color components of the LEDs. Using this
|
355 |
|
|
method, there are $2^{24}$ different colors each of these LEDs may be set
|
356 |
|
|
to.
|
357 |
|
|
|
358 |
|
|
\subsection{Buttons}
|
359 |
|
|
\subsection{Switches}
|
360 |
|
|
\subsection{Startup counter}
|
361 |
|
|
|
362 |
|
|
A startup counter has been placed into the basic peripheral I/O area. This
|
363 |
|
|
counter simply counts the clocks since startup. Upon rollover, the high
|
364 |
|
|
order bit remains set. This can be used to sequence the start up of components
|
365 |
|
|
within the design if so desired.
|
366 |
|
|
|
367 |
|
|
\subsection{GPS UART}
|
368 |
|
|
The GPS UART, debug control UART, as well as the auxilliary UART, are all
|
369 |
|
|
based upon the same underlying UART IP core, sometimes known as the WBUART32
|
370 |
|
|
core. The setup register is defined within the documentation for that core,
|
371 |
|
|
and provides for a large baud rate selection, 5-8 data bits, 1-2 stop bits,
|
372 |
|
|
and several parity choices. Within OpenArty, the GPS core is initialized
|
373 |
|
|
to 9.6~kBaud, 8 data bits, no parity, and one stop bit.
|
374 |
|
|
|
375 |
|
|
When a value is ready to be read from the GPS uart, the GPS interrupt line
|
376 |
|
|
will go high. Once read, and only when read, will this interrupt line reset.
|
377 |
|
|
If the read is successful, only bits within the bottom eight will be set.
|
378 |
|
|
If a read is attempted when there is no data, when the UART is in a reset
|
379 |
|
|
condition, or when there has been a framing or parity error (were parity
|
380 |
|
|
to be turned on), the upper bits of the UART port will be set.
|
381 |
|
|
|
382 |
|
|
In a like manner, the GPS device can be written to. Certain strings, if sent
|
383 |
|
|
to the UART, can be used to change the UARTs baud rate, its serial port
|
384 |
|
|
settings, or even its reporting interval. As with the read port, the transmit
|
385 |
|
|
port will interrupt the CPU when it is idle. Writing a character to this
|
386 |
|
|
port will reset the interrupt. Setting bits other than the bottom eight may
|
387 |
|
|
result in a break condition being set on this port as well.
|
388 |
|
|
|
389 |
|
|
Interacting with a controller can therefore be somewhat tricky. The
|
390 |
|
|
interrupt controller will trigger whenever the port is ready to be read from,
|
391 |
|
|
and will re--trigger every clock until the port has been read from. At this
|
392 |
|
|
point, the interrupt controller may be reset. If this is an auxilliary
|
393 |
|
|
interrupt controller, such as the bus interrupt controller or the ZipSystem's
|
394 |
|
|
auxiliary controller, the auxiliary controller will then need to be reset,
|
395 |
|
|
and the bit in the primary controller associated with the auxiliary controller
|
396 |
|
|
as well. It is for this reason that the UARTs have been placed on the
|
397 |
|
|
primary controller only.
|
398 |
|
|
|
399 |
|
|
It should also be possible to use the DMA to read from (or write to) either
|
400 |
|
|
UART port.
|
401 |
|
|
|
402 |
|
|
\subsection{Auxilliary UART}
|
403 |
|
|
|
404 |
|
|
The Auxilliary UART has roughly the same structure as the GPS UART, save that
|
405 |
|
|
it's default configuration is for a 115,200~Baud configuration with 8~data bits,
|
406 |
|
|
no stop bits, and no parity. Reads, writes, and interrupts are treated in
|
407 |
|
|
the same fashion.
|
408 |
|
|
|
409 |
|
|
\subsection{GPIO}
|
410 |
|
|
|
411 |
|
|
A General Purpose I/O controller has been placed within the design as well.
|
412 |
|
|
This controller can handle 16--generic input wires, and set 16--generic output
|
413 |
|
|
wires. A single register is used to read both input and output wire values,
|
414 |
|
|
as well as to set output values when written to.
|
415 |
|
|
|
416 |
|
|
However, to use this controller, you will need to manually configure it
|
417 |
|
|
(i.e.~change the Verilog source) within the core, in order to wire the various
|
418 |
|
|
GPIO values up to a device of interest. This was done for the simple reason
|
419 |
|
|
that wiring anything new up to the controller will require Verilog changes
|
420 |
|
|
anyway. For this reason, the controller has no way of setting wires to high
|
421 |
|
|
impedence, or pulling them up or down. Such control may be done within the
|
422 |
|
|
top level design if necessary.
|
423 |
|
|
|
424 |
|
|
This controller will set an interrupt if ever any of the input wires within
|
425 |
|
|
it are changed. The interrupt may be cleared in the interrupt controller.
|
426 |
|
|
|
427 |
|
|
\subsection{Linker Script}
|
428 |
|
|
|
429 |
|
|
A linker script has been created to capture the memory structure needed by
|
430 |
|
|
a program. This script may be found in {\tt sw/board/arty.ld}. It is a
|
431 |
|
|
sample script, using it is not required.
|
432 |
|
|
|
433 |
|
|
The script defines three types of memory to the linker: flash, block RAM, and
|
434 |
|
|
SDRAM. Programs using this script will naturally start in flash (acting as
|
435 |
|
|
a ROM memory). A bootloader must then be used to copy, from flash, those
|
436 |
|
|
sections of the program that are to be placed in block RAM or SDRAM into
|
437 |
|
|
their particular memory locations.
|
438 |
|
|
|
439 |
|
|
The block RAM locations are reserved for the user kernel, and specifically for
|
440 |
|
|
any part of the code in the {\tt .kernel} section. C attributes, or assembly
|
441 |
|
|
{\tt .section} commands, must be used to place items within this section.
|
442 |
|
|
A final symbol within this section, {\_top\_of\_stack}, is used so that the
|
443 |
|
|
initial boot loader knows what to set the initial kernel stack to.
|
444 |
|
|
|
445 |
|
|
The rest of the initial program's memory is placed into
|
446 |
|
|
SDRAM.\footnote{Hopefully,
|
447 |
|
|
I'll get a data cache running on the ZipCPU to speed this up.} At the end,
|
448 |
|
|
a {\tt \_top\_of\_heap} symbol is set to reference the final location in the
|
449 |
|
|
setup. This symbol can then be used as a starting point for a memory allocator.
|
450 |
|
|
|
451 |
|
|
An example bootloader is provided in {\tt sw/board} that can be linked with
|
452 |
|
|
any (bare metal, supervisor) program in order to properly load it into memory.
|
453 |
|
|
|
454 |
2 |
dgisselq |
\chapter{Software}
|
455 |
|
|
\section{Directory Structure}
|
456 |
|
|
\section{Zip CPU Tool Chain}
|
457 |
|
|
\section{Bench Test Software}
|
458 |
|
|
\section{Host Software}
|
459 |
|
|
\begin{itemize}
|
460 |
|
|
\item {\tt readflash}: As I am loathe to remove anything from
|
461 |
|
|
a device that came factory installed, the
|
462 |
|
|
{\tt readflash} program reads the original installed
|
463 |
|
|
configuration from the flash and dumps it to a file.
|
464 |
|
|
|
465 |
|
|
\item {\tt wbregs}: This program offers a capability very similar to the
|
466 |
|
|
PEEK and POKE capability Apple user's may remember from before the
|
467 |
|
|
days of Macintosh. {\tt wbregs <address>} will read from the
|
468 |
|
|
Wishbone bus the value at the given address. Likewise
|
469 |
|
|
{\tt wbregs <address> <value>} will write the given value into the
|
470 |
|
|
given address. While both address and value have the semantics of
|
471 |
|
|
numbers acceptable to {\tt strtoul()}, the address can also be a named
|
472 |
|
|
address. Supported names can be found in {\tt regdefs.cpp}, and their
|
473 |
|
|
register mapping in {\tt regdefs.h}.
|
474 |
|
|
\item {\tt ziprun}:
|
475 |
|
|
\item {\tt zipload}:
|
476 |
|
|
\end{itemize}
|
477 |
|
|
|
478 |
|
|
\section{Zip CPU Programs}
|
479 |
|
|
\begin{itemize}
|
480 |
|
|
\item {\tt ntpserver}:
|
481 |
|
|
\item {\tt goldenstart}:
|
482 |
|
|
\end{itemize}
|
483 |
|
|
\section{ZipOS}
|
484 |
|
|
\subsection{System Calls}
|
485 |
|
|
\begin{itemize}
|
486 |
|
|
\item {\tt int wait(unsigned event\_mask, int timeout)}
|
487 |
|
|
\item {\tt int clear(unsigned event\_mask, int timeout)}
|
488 |
|
|
\item {\tt void post(unsigned event\_mask)}
|
489 |
|
|
\item {\tt void yield(void) }
|
490 |
|
|
\item {\tt int read(int fid, void *buf, int len)}
|
491 |
|
|
\item {\tt int write(int fid, void *buf, int len)}
|
492 |
|
|
\item {\tt unsigned time(void) }
|
493 |
|
|
% \item SEMGET
|
494 |
|
|
% \item SEMPUT
|
495 |
|
|
\item {\tt void *malloc(void)}
|
496 |
|
|
\item {\tt void free(void *buf)}
|
497 |
|
|
% \item FORK
|
498 |
|
|
% \item opendir
|
499 |
|
|
% \item EXEC
|
500 |
|
|
% \item OPEN
|
501 |
|
|
\end{itemize}
|
502 |
|
|
\subsection{Scheduler}
|
503 |
|
|
|
504 |
36 |
dgisselq |
\chapter{Operation}\label{ch:operation}
|
505 |
2 |
dgisselq |
|
506 |
36 |
dgisselq |
\chapter{Registers}\label{ch:registers}
|
507 |
2 |
dgisselq |
There are several address regions on the S6~SoC, as shown in
|
508 |
|
|
Tbl.~\ref{tbl:memregions}.
|
509 |
|
|
\begin{table}[htbp]
|
510 |
|
|
\begin{center}\begin{tabular}{|p{2.25in}|p{0.6in}|p{0.45in}|p{2.0in}|}\hline
|
511 |
|
|
\rowcolor[gray]{0.85} Binary Address & Base & Size(W) & Purpose \\\hline\hline
|
512 |
|
|
\scalebox{0.9}{\tt 0000 0000 0000 0000 0001 000x xxxx} & \scalebox{0.9}{\tt 0x00000100} & \hfill 32 & Peripheral I/O Control \\\hline
|
513 |
|
|
\scalebox{0.9}{\tt 0000 0000 0000 0000 0001 0010 0yyx} & \scalebox{0.9}{\tt 0x00000120} & \hfill 8 & Debug scope control\\\hline
|
514 |
|
|
\scalebox{0.9}{\tt 0000 0000 0000 0000 0001 0010 10xx} & \scalebox{0.9}{\tt 0x00000128} & \hfill 4 & RTC control\\\hline
|
515 |
|
|
\scalebox{0.9}{\tt 0000 0000 0000 0000 0001 0010 11xx} & \scalebox{0.9}{\tt 0x0000012c} & \hfill 4 & SDCard controller\\\hline
|
516 |
|
|
\scalebox{0.9}{\tt 0000 0000 0000 0000 0001 0011 00xx} & \scalebox{0.9}{\tt 0x00000130} & \hfill 4 & GPS Clock loop control\\\hline
|
517 |
30 |
dgisselq |
\scalebox{0.9}{\tt 0000 0000 0000 0000 0001 0011 01xx} & \scalebox{0.9}{\tt 0x00000134} & \hfill 4 & OLEDrgb control\\\hline
|
518 |
|
|
\scalebox{0.9}{\tt 0000 0000 0000 0000 0001 0011 1xxx} & \scalebox{0.9}{\tt 0x00000138} & \hfill 8 & Network packet interface\\\hline
|
519 |
2 |
dgisselq |
\scalebox{0.9}{\tt 0000 0000 0000 0000 0001 0100 0xxx} & \scalebox{0.9}{\tt 0x00000140} & \hfill 8 & GPS Testbench\\\hline
|
520 |
|
|
\scalebox{0.9}{\tt 0000 0000 0000 0000 0001 0100 1xxx} & \scalebox{0.9}{\tt 0x00000148} & \hfill 8 & {\em Unused}\\\hline
|
521 |
|
|
\scalebox{0.9}{\tt 0000 0000 0000 0000 0001 0101 xxxx} & \scalebox{0.9}{\tt 0x00000150} & \hfill 16 & {\em Unused}\\\hline
|
522 |
|
|
\scalebox{0.9}{\tt 0000 0000 0000 0000 0001 011x xxxx} & \scalebox{0.9}{\tt 0x00000160} & \hfill 32 & {\em Unused}\\\hline
|
523 |
|
|
\scalebox{0.9}{\tt 0000 0000 0000 0000 0001 100x xxxx} & \scalebox{0.9}{\tt 0x00000180} & \hfill 32 & {\em Unused}\\\hline
|
524 |
|
|
\scalebox{0.9}{\tt 0000 0000 0000 0000 0001 101x xxxx} & \scalebox{0.9}{\tt 0x000001a0} & \hfill 32 & Ethernet configuration registers\\\hline
|
525 |
|
|
\scalebox{0.9}{\tt 0000 0000 0000 0000 0001 110x xxxx} & \scalebox{0.9}{\tt 0x000001c0} & \hfill 32 & Extended Flash Control Port\\\hline
|
526 |
|
|
\scalebox{0.9}{\tt 0000 0000 0000 0000 0001 111x xxxx} & \scalebox{0.9}{\tt 0x000001e0} & \hfill 32 & ICAPE2 Configuration Port\\\hline
|
527 |
30 |
dgisselq |
\scalebox{0.9}{\tt 0000 0000 0000 0000 10xx xxxx xxxx} & \scalebox{0.9}{\tt 0x00000800} & \hfill 1k & Ethernet RX Buffer\\\hline
|
528 |
|
|
\scalebox{0.9}{\tt 0000 0000 0000 0000 11xx xxxx xxxx} & \scalebox{0.9}{\tt 0x00000c00} & \hfill 1k & Ethernet TX Buffer\\\hline
|
529 |
2 |
dgisselq |
\scalebox{0.9}{\tt 0000 0000 0000 1xxx xxxx xxxx xxxx} & \scalebox{0.9}{\tt 0x00008000} & \hfill 32k & On-chip Block RAM\\\hline
|
530 |
|
|
\scalebox{0.9}{\tt 0000 01xx xxxx xxxx xxxx xxxx xxxx} & \scalebox{0.9}{\tt 0x00400000} & \hfill 4M & QuadSPI Flash\\\hline
|
531 |
30 |
dgisselq |
\scalebox{0.9}{\tt 0000 0100 0000 0000 0000 0000 0000} & \scalebox{0.9}{\tt 0x00400000} & & Configuration Start\\\hline
|
532 |
|
|
\scalebox{0.9}{\tt 0000 0100 0111 0000 0000 0000 0000} & \scalebox{0.9}{\tt 0x00470000} & & Alternate Configuration\\\hline
|
533 |
|
|
\scalebox{0.9}{\tt 0000 0100 1110 0000 0000 0000 0000} & \scalebox{0.9}{\tt 0x004e0000} & & CPU Reset Address\\\hline
|
534 |
2 |
dgisselq |
\scalebox{0.9}{\tt 01xx xxxx xxxx xxxx xxxx xxxx xxxx} & \scalebox{0.9}{\tt 0x04000000} & \hfill 64M & DDR3 SDRAM\\\hline
|
535 |
|
|
\scalebox{0.9}{\tt 1000 0000 0000 0000 0000 0000 000x} & \scalebox{0.9}{\tt 0x08000000} & \hfill 2 & ZipCPU debug control port---only visible to debug WB master\\\hline
|
536 |
|
|
\end{tabular}
|
537 |
|
|
\caption{Address Regions}\label{tbl:memregions}
|
538 |
|
|
\end{center}\end{table}
|
539 |
|
|
|
540 |
|
|
\begin{table}[htbp]
|
541 |
|
|
\begin{center}\begin{tabular}{|p{0.9in}|p{0.45in}|p{3.5in}|}\hline
|
542 |
|
|
\rowcolor[gray]{0.85} Base & Size(W) & Purpose \\\hline\hline
|
543 |
|
|
\scalebox{0.9}{\tt 0x0c0000000} & 1 & Primary Zip PIC\\\hline
|
544 |
|
|
\scalebox{0.9}{\tt 0x0c0000001} & 1 & Watchdog Timer\\\hline
|
545 |
|
|
\scalebox{0.9}{\tt 0x0c0000002} & 1 & Bus Watchdog Timer\\\hline
|
546 |
|
|
\scalebox{0.9}{\tt 0x0c0000003} & 1 & Alternate Zip PIC\\\hline
|
547 |
|
|
\scalebox{0.9}{\tt 0x0c0000004} & 1 & ZipTimer-A\\\hline
|
548 |
|
|
\scalebox{0.9}{\tt 0x0c0000005} & 1 & ZipTimer-B\\\hline
|
549 |
|
|
\scalebox{0.9}{\tt 0x0c0000006} & 1 & ZipTimer-C\\\hline
|
550 |
|
|
\scalebox{0.9}{\tt 0x0c0000007} & 1 & ZipJiffies\\\hline
|
551 |
|
|
\scalebox{0.9}{\tt 0x0c0000008} & 1 & Master task counter\\\hline
|
552 |
|
|
\scalebox{0.9}{\tt 0x0c0000009} & 1 & Master prefetch stall counter\\\hline
|
553 |
|
|
\scalebox{0.9}{\tt 0x0c000000a} & 1 & Master memory stall counter\\\hline
|
554 |
|
|
\scalebox{0.9}{\tt 0x0c000000b} & 1 & Master instruction counter\\\hline
|
555 |
|
|
\scalebox{0.9}{\tt 0x0c000000c} & 1 & User task counter\\\hline
|
556 |
|
|
\scalebox{0.9}{\tt 0x0c000000d} & 1 & User prefetch stall counter\\\hline
|
557 |
|
|
\scalebox{0.9}{\tt 0x0c000000e} & 1 & User memory stall counter\\\hline
|
558 |
|
|
\scalebox{0.9}{\tt 0x0c000000f} & 1 & User instruction counter\\\hline
|
559 |
|
|
\scalebox{0.9}{\tt 0x0c0000010} & 1 & DMA command register\\\hline
|
560 |
|
|
\scalebox{0.9}{\tt 0x0c0000011} & 1 & DMA length\\\hline
|
561 |
|
|
\scalebox{0.9}{\tt 0x0c0000012} & 1 & DMA source address\\\hline
|
562 |
|
|
\scalebox{0.9}{\tt 0x0c0000013} & 1 & DMA destination address\\\hline
|
563 |
|
|
\scalebox{0.9}{\tt 0x0c0000040} & 1 & {\em Reserved for MMU context register}\\\hline
|
564 |
|
|
\scalebox{0.9}{\tt 0x0c0000080} & 32 & {\em Reserved for MMU TLB}\\\hline
|
565 |
|
|
\end{tabular}
|
566 |
|
|
\caption{ZipSystem Addresses}\label{tbl:zipio}
|
567 |
|
|
\end{center}\end{table}
|
568 |
|
|
|
569 |
|
|
\section{Peripheral I/O Control}
|
570 |
|
|
Tbl.~\ref{tbl:ioregs}
|
571 |
|
|
\begin{table}[htbp]
|
572 |
|
|
\begin{center}\begin{reglist}
|
573 |
|
|
VERSION &\scalebox{0.8}{\tt 0x0100} & 32 & R & Build date\\\hline
|
574 |
|
|
PIC &\scalebox{0.8}{\tt 0x0101} & 32 & R/W & Bus Interrupt Controller \\\hline
|
575 |
|
|
BUSERR &\scalebox{0.8}{\tt 0x0102} & 32 & R & Last Bus Error Address\\\hline
|
576 |
|
|
PWRCOUNT &\scalebox{0.8}{\tt 0x0103} & 32 & R & Ticks since startup\\\hline
|
577 |
|
|
BTNSW &\scalebox{0.8}{\tt 0x0104} & 32 & R/W & Button/Switch controller\\\hline
|
578 |
|
|
LEDCTRL &\scalebox{0.8}{\tt 0x0105} & 32 & R/W & LED Controller \\\hline
|
579 |
|
|
AUXSETUP &\scalebox{0.8}{\tt 0x0106} & 29 & R/W & Auxilliary UART config\\\hline
|
580 |
|
|
GPSSETUP &\scalebox{0.8}{\tt 0x0107} & 29 & R/W & GPS UART config\\\hline
|
581 |
|
|
CLR-LEDx &\scalebox{0.8}{\tt 0x0108-b} & 32 & R/W & Color LED controller\\\hline
|
582 |
|
|
RTCDATE &\scalebox{0.8}{\tt 0x010c} & 32 & R/W & BCD Calendar Date\\\hline
|
583 |
36 |
dgisselq |
GPIO &\scalebox{0.8}{\tt 0x010d} & 32 & R/W & {\em Reserved for} GPIO controller\\\hline
|
584 |
2 |
dgisselq |
UARTRX &\scalebox{0.8}{\tt 0x010e} & 32 & R/W & Aux UART receive byte\\\hline
|
585 |
|
|
UARTTX &\scalebox{0.8}{\tt 0x010f} & 32 & R/W & Aux UART transmit byte\\\hline
|
586 |
|
|
GPSRX &\scalebox{0.8}{\tt 0x0110} & 32 & R/W & GPS UART receive byte\\\hline
|
587 |
|
|
GPSTX &\scalebox{0.8}{\tt 0x0111} & 32 & R/W & GPS UART transmit byte\\\hline
|
588 |
36 |
dgisselq |
GPSSECS &\scalebox{0.8}{\tt 0x0110} & 32 & R/W & {\em Reserved for a one-up seconds counter}\\\hline
|
589 |
|
|
GPSSUB &\scalebox{0.8}{\tt 0x0110} & 32 & R/W & GPS PPS tracking subsecond info\\\hline
|
590 |
|
|
GPSSTEP &\scalebox{0.8}{\tt 0x0111} & 32 & R/W & Current GPS step size, units TBD\\\hline
|
591 |
2 |
dgisselq |
% 0x010c-0x010f
|
592 |
|
|
\end{reglist}
|
593 |
|
|
\caption{I/O Peripheral Registers}\label{tbl:ioregs}
|
594 |
|
|
\end{center}\end{table}
|
595 |
|
|
shows the addresses of various I/O peripherals included as part of the SoC.
|
596 |
|
|
We'll walk through each of these peripherals in turn, describing how they work.
|
597 |
|
|
|
598 |
|
|
\subsection{Interrupt Controller}
|
599 |
|
|
The OpenArty design maintains three interrupt controllers. Two of them
|
600 |
|
|
are found within the ZipSystem, and the third is located on the bus
|
601 |
|
|
itself. Of these, the primary interrupt controller is located in the ZipSystem.
|
602 |
|
|
This interrupt controller accepts, as interrupt inputs, the outputs of both
|
603 |
|
|
the auxilliary interrupt controller as well as the bus interrupt controller.
|
604 |
|
|
Hence, even though the CPU only supports a single interrupt line, by using
|
605 |
|
|
these three interrupt controllers many more interrupts can be supported.
|
606 |
|
|
|
607 |
|
|
The primary interrupt controller handles interrupts from the sources listed
|
608 |
|
|
in Tbl.~\ref{tbl:sys-ints}. These interrupts are listed together with the
|
609 |
|
|
mask that would need to be used when referencing them to the interrupt
|
610 |
|
|
controller. In a similar fashion, the auxilliary interrupt controller accepts
|
611 |
|
|
inputs from the sources listed in Tbl.~\ref{tbl:aux-ints}. Finally, the
|
612 |
|
|
bus interrupt controller handles the interrupts from the sources listed in
|
613 |
|
|
Tbl.~\ref{tbl:bus-ints}.
|
614 |
|
|
|
615 |
|
|
\begin{table}[htbp]
|
616 |
|
|
\begin{center}\begin{tabular}{|p{0.9in}|p{0.75in}|p{0.75in}|p{3.00in}|}\hline
|
617 |
|
|
\rowcolor[gray]{0.85} Name & Bit Mask & DMAC ID &Description \\\hline\hline
|
618 |
36 |
dgisselq |
SYS\_DMAC & 0x0001 && The DMA controller is idle.\\\hline
|
619 |
|
|
SYS\_JIF & 0x0002 & 1 & A Jiffies timer has expired.\\\hline
|
620 |
|
|
SYS\_TMC & 0x0004 & 2 & Timer C has timed out.\\\hline
|
621 |
|
|
SYS\_TMB & 0x0008 & 3 & Timer C has timed out.\\\hline
|
622 |
|
|
SYS\_TMA & 0x0010 & 4 & Timer C has timed out.\\\hline
|
623 |
|
|
SYS\_AUX & 0x0020 & 5 & The auxilliary interrupt controller sends an interrupt\\\hline
|
624 |
|
|
SYS\_PPS & 0x0040 & 6 & An interrupt marking the top of the second\\\hline
|
625 |
|
|
SYS\_NETRX & 0x0080 & 7 & A packet has been received via the network\\\hline
|
626 |
|
|
SYS\_NETTX & 0x0100 & 8 & The network controller is idle, having sent its
|
627 |
2 |
dgisselq |
last packet\\\hline
|
628 |
36 |
dgisselq |
SYS\_UARTRX & 0x200 & 9 & A character has been received via the UART\\\hline
|
629 |
|
|
SYS\_UARTTX & 0x400 & 10 & The transmit UART is idle, and ready for its next
|
630 |
2 |
dgisselq |
character.\\\hline
|
631 |
36 |
dgisselq |
SYS\_GPSRX & 0x0800 & 11 & A character has been received via GPS\\\hline
|
632 |
|
|
SYS\_GPSTX & 0x1000 & 12 & The GPS serial port transmit is idle\\\hline
|
633 |
2 |
dgisselq |
SYS\_SDCARD & 0x2000 & 13 & The SD-Card controller has become idle\\\hline
|
634 |
36 |
dgisselq |
SYS\_OLED & 0x4000 & 14 & The OLED port is idle\\\hline
|
635 |
2 |
dgisselq |
\end{tabular}
|
636 |
|
|
\caption{Primary System Interrupts}\label{tbl:sys-ints}
|
637 |
|
|
\end{center}\end{table}
|
638 |
|
|
%%%%%%%%%%%%%
|
639 |
|
|
\begin{table}[htbp]
|
640 |
|
|
\begin{center}\begin{tabular}{|p{0.9in}|p{0.75in}|p{0.75in}|p{3.00in}|}\hline
|
641 |
|
|
\rowcolor[gray]{0.85} Name & Bit Mask & DMAC ID &Description \\\hline\hline
|
642 |
|
|
AUX\_UIC & 0x0001 & 16 & The user instruction counter has overflowed.\\\hline
|
643 |
|
|
AUX\_UPC & 0x0002 & 17 & The user prefetch stall counter has overflowed.\\\hline
|
644 |
|
|
AUX\_UOC & 0x0004 & 18 & The user ops stall counter has overflowed.\\\hline
|
645 |
|
|
AUX\_UTC & 0x0008 & 19 & The user clock tick counter has overflowed.\\\hline
|
646 |
|
|
AUX\_MIC & 0x0010 & 20 & The supervisor instruction counter has overflowed.\\\hline
|
647 |
|
|
AUX\_MPC & 0x0020 & 21 & The supervisor prefetch stall counter has overflowed.\\\hline
|
648 |
|
|
AUX\_MOC & 0x0040 & 22 & The supervisor ops stall counter has overflowed.\\\hline
|
649 |
|
|
AUX\_MTC & 0x0080 & 23 & The supervisor clock tick counter has overflowed.\\\hline
|
650 |
36 |
dgisselq |
AUX\_RTC & 0x0100 & 24& An alarm or timer has taken place (assuming the RTC
|
651 |
2 |
dgisselq |
is installed, and includes both alarm or timer)\\\hline
|
652 |
36 |
dgisselq |
AUX\_BTN & 0x0200 & 25 & A button has been pressed\\\hline
|
653 |
|
|
AUX\_SWITCH & 0x0400 & 26 & A switch has changed state\\\hline
|
654 |
|
|
AUX\_FLASH & 0x0800 & 27 & The flash controller has completed a write/erase cycle\\\hline
|
655 |
|
|
AUX\_SCOPE & 0x1000 & 28 & The Scope has completed its collection\\\hline
|
656 |
|
|
AUX\_GPIO & 0x2000 & 29 & The GPIO input lines have changed values.\\\hline
|
657 |
2 |
dgisselq |
\end{tabular}
|
658 |
|
|
\caption{Auxilliary System Interrupts}\label{tbl:aux-ints}
|
659 |
|
|
\end{center}\end{table}
|
660 |
|
|
|
661 |
|
|
\begin{table}[htbp]
|
662 |
|
|
\begin{center}\begin{tabular}{|p{0.9in}|p{0.75in}|p{3.75in}|}\hline
|
663 |
|
|
\rowcolor[gray]{0.85} Name & Bit Mask & Description \\\hline\hline
|
664 |
|
|
BUS\_BUTTON & 0x0001 & A Button has been pressed. \\\hline
|
665 |
|
|
BUS\_SWITCH & 0x0002 & The Scope has completed its collection\\\hline
|
666 |
|
|
BUS\_PPS & 0x0004 & Top of the second\\\hline
|
667 |
|
|
BUS\_RTC & 0x0008 & An alarm or timer has taken place (assuming the RTC
|
668 |
|
|
is installed, and includes both alarm or timer)\\\hline
|
669 |
|
|
BUS\_NETRX & 0x0010 & A packet has been received via the network\\\hline
|
670 |
|
|
BUS\_NETTX & 0x0020 & The network controller is idle, having sent its
|
671 |
|
|
last packet\\\hline
|
672 |
|
|
BUS\_UARTRX & 0x0040 & A character has been received via the UART\\\hline
|
673 |
|
|
BUS\_UARTTX & 0x0080 & The transmit UART is idle, and ready for its next
|
674 |
|
|
character.\\\hline
|
675 |
|
|
BUS\_GPIO & 0x0100 & The GPIO input lines have changed values.\\\hline
|
676 |
|
|
BUS\_FLASH & 0x0200 & The flash device has finished either its erase or
|
677 |
|
|
write cycle, and is ready for its next command. (Alternate
|
678 |
|
|
config only.)\\\hline
|
679 |
|
|
BUS\_SCOPE & 0x0400 & A scope has completed collecting.\\\hline
|
680 |
|
|
BUS\_GPSRX & 0x0800 & A character has been received via GPS\\\hline
|
681 |
|
|
BUS\_SDCARD & 0x1000 & The SD-Card controller has become idle\\\hline
|
682 |
|
|
BUS\_OLED & 0x2000 & The OLED interface has become idle\\\hline
|
683 |
|
|
BUS\_ZIP & 0x4000 & True if the ZipCPU has come to a halt\\\hline
|
684 |
|
|
\end{tabular}
|
685 |
|
|
\caption{Bus Interrupts}\label{tbl:bus-ints}
|
686 |
|
|
\end{center}\end{table}
|
687 |
|
|
|
688 |
|
|
\subsection{Last Bus Error Address}
|
689 |
|
|
\subsection{General Purpose I/O}
|
690 |
|
|
\subsection{UART Data Register}
|
691 |
|
|
\section{Debugging Scopes}
|
692 |
|
|
\section{Internal Configuration Access Port}
|
693 |
|
|
\section{Real--Time Clock}
|
694 |
|
|
\section{On-Chip Block RAM}
|
695 |
|
|
\section{Flash Memory}
|
696 |
|
|
\begin{table}
|
697 |
|
|
\begin{center}\begin{reglist}
|
698 |
|
|
ewreg &\scalebox{0.8}{\tt 0x0180} & 32 & R & Erase/write control and status\\\hline
|
699 |
|
|
status &\scalebox{0.8}{\tt 0x0181} & 8 & R/W & Bus Interrupt Controller \\\hline
|
700 |
|
|
nvconf &\scalebox{0.8}{\tt 0x0182} & 16 & R & Last Bus Error Address\\\hline
|
701 |
|
|
vconf &\scalebox{0.8}{\tt 0x0183} & 8 & R & Ticks since startup\\\hline
|
702 |
|
|
evonc &\scalebox{0.8}{\tt 0x0184} & 8 & R/W & Button/Switch controller\\\hline
|
703 |
|
|
lock &\scalebox{0.8}{\tt 0x0185} & 8 & R/W & LED Controller \\\hline
|
704 |
|
|
flagstatus&\scalebox{0.8}{\tt 0x0186} & 8 & R/W & Auxilliary UART config\\\hline
|
705 |
|
|
clear &\scalebox{0.8}{\tt 0x0187} & 8 & R/W & Clear status on write\\\hline
|
706 |
|
|
Device ID &\scalebox{0.8}{\tt 0x0188-}\hfill & 5x32 & R & Device ID\\
|
707 |
|
|
&\scalebox{0.8}{\tt -0x018c}\hfill & & & \\\hline
|
708 |
|
|
% asyncID &\scalebox{0.8}{\tt 0x018d} & 32 & R/W & Asynch Read ID. Write starts the ASynch read, 0xff returned until complete\\\hline
|
709 |
|
|
asyncOTP &\scalebox{0.8}{\tt 0x18e} & 32 & W & Asynch Read OTP. Write starts the ASynch read, 0xff returned until complete\\\hline
|
710 |
|
|
OTP &\scalebox{0.8}{\tt 0x0190-}\hfill &16x32 & R/W & OTP Memory\\
|
711 |
|
|
&\scalebox{0.8}{\hfill\tt -0x19f} & & & \\\hline
|
712 |
|
|
% 0x010c-0x010f
|
713 |
|
|
\end{reglist}
|
714 |
|
|
\caption{Flash control registers}\label{tbl:flctl}
|
715 |
|
|
\end{center}\end{table}
|
716 |
|
|
|
717 |
30 |
dgisselq |
\chapter{Wishbone Datasheet}\label{ch:wishbone}
|
718 |
2 |
dgisselq |
|
719 |
|
|
The master and slave interfaces have been simplified with the following
|
720 |
|
|
requirement: the {\tt STB} line is not allowed to be high unless the {\tt CYC}
|
721 |
|
|
line is high. In this fashion, a slave may often be able to ignore {\tt CYC}
|
722 |
|
|
and only act on the presence of {\tt STB}, knowing that {\tt CYC} must be
|
723 |
|
|
active at the same time.
|
724 |
|
|
|
725 |
30 |
dgisselq |
\chapter{Clocks}\label{ch:clocks}
|
726 |
2 |
dgisselq |
\begin{table}\begin{center}
|
727 |
|
|
\begin{clocklist}
|
728 |
30 |
dgisselq |
{\tt i\_clk\_100mhz} & Ext & \multicolumn{2}{c|}{100} &
|
729 |
2 |
dgisselq |
100~MHz Crystal Oscillator \\\hline
|
730 |
30 |
dgisselq |
{\em Future }{\tt s\_clk} & PLL & 152 & 166 & Internal Logic, Wishbone Clock \\\hline
|
731 |
|
|
{\tt s\_clk} & PLL & 83.33 & 75.76& DDR3 SDRAM Controller Clock \\\hline
|
732 |
|
|
\multicolumn{2}{|c|}{\tt mem\_clk\_200mhz} & 200~MHz & & MIG Reference clock for PHASERs\\\hline
|
733 |
|
|
{\tt ddr3\_ck\_}$x$ & DDR & 166.67 & 303 & DDR3 Command Clock\\\hline
|
734 |
|
|
{\tt o\_qspi\_sck} & DDR & 95 & & QSPI Flash clock \\\hline
|
735 |
|
|
{\tt o\_sd\_clk} & Logic & 50 & 0.100 & SD--Card clock \\\hline
|
736 |
|
|
{\tt o\_oled\_sck} & Logic & 166 & & OLED SPI clock \\\hline
|
737 |
|
|
{\tt o\_eth\_mdclk} & Logic & 25 & 2.5 & Ethernet MDIO controller clock\\\hline
|
738 |
2 |
dgisselq |
\end{clocklist}
|
739 |
|
|
\caption{OpenArty clocks}\label{tbl:clocks}
|
740 |
|
|
\end{center}\end{table}
|
741 |
|
|
|
742 |
|
|
\chapter{I/O Ports}
|
743 |
|
|
|
744 |
|
|
Table.~\ref{tbl:ioports}
|
745 |
|
|
\begin{table}[htbp]
|
746 |
|
|
\begin{center}
|
747 |
|
|
\begin{portlist}
|
748 |
|
|
i\_clk\_100mhz & 1 & Input & Clock\\\hline
|
749 |
|
|
o\_qspi\_cs\_n & 1 & Output & Quad SPI Flash chip select\\\hline
|
750 |
|
|
o\_qspi\_sck & 1 & Output & Quad SPI Flash clock\\\hline
|
751 |
|
|
io\_qspi\_dat & 4 & Input/Output & Four-wire SPI flash data bus\\\hline
|
752 |
|
|
i\_btn & 4 & Input & Inputs from the two on-board push-buttons\\\hline
|
753 |
|
|
i\_sw & 4 & Input & Inputs from the two on-board push-buttons\\\hline
|
754 |
|
|
o\_led & 4 & Output & Outputs controlling the four on-board LED's\\\hline
|
755 |
|
|
o\_clr\_led0 & 3 & Output & \\\hline
|
756 |
|
|
o\_clr\_led1 & 3 & Output & \\\hline
|
757 |
|
|
o\_clr\_led2 & 3 & Output & \\\hline
|
758 |
|
|
o\_clr\_led3 & 3 & Output & \\\hline
|
759 |
|
|
i\_uart\_rx & 1 & Input & UART receive input\\\hline
|
760 |
|
|
o\_uart\_tx & 1 & Output & UART transmit output\\\hline\hline
|
761 |
|
|
i\_aux\_rx & 1 & Input & Auxiliary/Pmod UART receive input\\\hline
|
762 |
|
|
o\_aux\_tx & 1 & Output & Auxiliary/Pmod UART transmit output\\\hline
|
763 |
|
|
i\_aux\_rts & 1 & Input & Auxiliary/Pmod UART receive input\\\hline
|
764 |
|
|
o\_aux\_cts & 1 & Output & Auxiliary/Pmod UART transmit output\\\hline\hline
|
765 |
|
|
i\_gps\_rx & 1 & Input & GPS/Pmod UART receive input\\\hline
|
766 |
|
|
o\_gps\_tx & 1 & Output & GPS/Pmod UART transmit output\\\hline
|
767 |
|
|
i\_gps\_pps & 1 & Input & GPS Part-per-second (PPS) signal\\\hline
|
768 |
|
|
i\_gps\_3df & 1 & Input & GPS\\\hline\hline
|
769 |
|
|
o\_oled\_cs\_n & 1 & Output & \\\hline
|
770 |
|
|
o\_oled\_sck & 1 & Output & \\\hline
|
771 |
|
|
o\_oled\_mosi & 1 & Output & \\\hline
|
772 |
|
|
i\_oled\_miso & 1 & Input & \\\hline
|
773 |
|
|
o\_oled\_reset & 1 & Output & \\\hline
|
774 |
|
|
o\_oled\_dc & 1 & Output & \\\hline
|
775 |
|
|
o\_oled\_en & 1 & Output & \\\hline
|
776 |
|
|
o\_oled\_pmen & 1 & Output & \\\hline\hline
|
777 |
|
|
o\_sd\_sck & 1 & Output & SD Clock\\\hline
|
778 |
|
|
i\_sd\_cd & 1 & Input & Card Detect\\\hline
|
779 |
|
|
i\_sd\_wp & 1 & Input & Write Protect\\\hline
|
780 |
|
|
io\_cmd & 1 & In/Output & SD Bi-directional command wire\\\hline
|
781 |
|
|
io\_sd & 4 & In/Output & SD Bi-directional data lines\\\hline\hline
|
782 |
|
|
o\_cls\_cs\_n & 1 & Output & CLS Display chip select\\\hline
|
783 |
|
|
o\_cls\_sck & 1 & Output & CLS Display clock\\\hline
|
784 |
|
|
o\_cls\_mosi & 1 & Output & CLS Display MOSI\\\hline
|
785 |
|
|
i\_cls\_miso & 1 & Input & CLS Display MISO\\\hline\hline
|
786 |
|
|
\end{portlist}
|
787 |
|
|
\caption{List of IO ports}\label{tbl:ioports}
|
788 |
|
|
\end{center}\end{table}
|
789 |
|
|
lists the various I/O ports associated with OpenArty.
|
790 |
|
|
|
791 |
|
|
|
792 |
|
|
% Appendices
|
793 |
|
|
% Index
|
794 |
|
|
\end{document}
|
795 |
|
|
|
796 |
|
|
|