Line 1... |
Line 1... |
\documentclass{gqtekspec}
|
\documentclass{gqtekspec}
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
%%
|
|
%% Filename: spec.tex
|
|
%%
|
|
%% Project: CMod S6 System on a Chip, ZipCPU demonstration project
|
|
%%
|
|
%% Purpose:
|
|
%%
|
|
%% Creator: Dan Gisselquist, Ph.D.
|
|
%% Gisselquist Technology, LLC
|
|
%%
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
%%
|
|
%% Copyright (C) 2015-2016, Gisselquist Technology, LLC
|
|
%%
|
|
%% This program is free software (firmware): you can redistribute it and/or
|
|
%% modify it under the terms of the GNU General Public License as published
|
|
%% by the Free Software Foundation, either version 3 of the License, or (at
|
|
%% your option) any later version.
|
|
%%
|
|
%% This program is distributed in the hope that it will be useful, but WITHOUT
|
|
%% ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
|
|
%% FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
%% for more details.
|
|
%%
|
|
%% You should have received a copy of the GNU General Public License along
|
|
%% with this program. (It's in the $(ROOT)/doc directory, run make with no
|
|
%% target there if the PDF file isn't present.) If not, see
|
|
%% <http://www.gnu.org/licenses/> for a copy.
|
|
%%
|
|
%% License: GPL, v3, as defined and found on www.gnu.org,
|
|
%% http://www.gnu.org/licenses/gpl.html
|
|
%%
|
|
%%
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
%%
|
|
%%
|
\usepackage{import}
|
\usepackage{import}
|
\usepackage{bytefield}
|
\usepackage{bytefield}
|
\project{CMod S6 SoC}
|
\project{CMod S6 SoC}
|
\title{Specification}
|
\title{Specification}
|
\author{Dan Gisselquist, Ph.D.}
|
\author{Dan Gisselquist, Ph.D.}
|
Line 24... |
Line 61... |
|
|
You should have received a copy of the GNU General Public License along
|
You should have received a copy of the GNU General Public License along
|
with this program. If not, see \texttt{http://www.gnu.org/licenses/} for a copy.
|
with this program. If not, see \texttt{http://www.gnu.org/licenses/} for a copy.
|
\end{license}
|
\end{license}
|
\begin{revisionhistory}
|
\begin{revisionhistory}
|
|
0.5 & 2/13/2017 & Gisselquist & Draft updates to support the 8-bit byte ZipCPU
|
|
\\\hline
|
0.3 & 5/23/2016 & Gisselquist & Draft for comment, includes ZipOS and PMod
|
0.3 & 5/23/2016 & Gisselquist & Draft for comment, includes ZipOS and PMod
|
pin mapping\\\hline
|
pin mapping\\\hline
|
0.2 & 5/14/2016 & Gisselquist & Updated Draft, still not complete \\\hline
|
0.2 & 5/14/2016 & Gisselquist & Updated Draft, still not complete \\\hline
|
0.1 & 4/22/2016 & Gisselquist & First Draft \\\hline
|
0.1 & 4/22/2016 & Gisselquist & First Draft \\\hline
|
\end{revisionhistory}
|
\end{revisionhistory}
|
Line 154... |
Line 193... |
reloaded with the primary configuration file which will contain an image of
|
reloaded with the primary configuration file which will contain an image of
|
the CPU. The CPU will then begin following the instructions found in flash
|
the CPU. The CPU will then begin following the instructions found in flash
|
memory.
|
memory.
|
|
|
|
|
|
\chapter{Getting Started}
|
|
\section{Building the Compiler}
|
|
%% git clone
|
|
%% Setting zip_param_cis to zero
|
|
%% Setting ZIP_DIVIDE to zero
|
|
%% Setting ZIP_PIPELINED to zero -- Disables the ZIP_ATOMIC instructions
|
|
%% Setting ZIP_THUMB to zero -- Disables the CIS instructions
|
|
\section{Building the ADEPT Utilities}
|
|
% Install the digilent adept utilities
|
|
% Expand the tar file
|
|
% tar -xvzf digilent.adept.utilities_2.2.1-x86_64.tar.gz
|
|
% Install them
|
|
% cd digilent.adept.utilities_2.2.1-x86_64.tar.gz
|
|
% sudo ./install.sh
|
|
% Answer Y to install the binaries into /usr/local/bin, and again
|
|
% to place the manual pages into /usr/local/man.
|
|
% Install the Digilent ADEPT Runtime
|
|
% Answer Y to store the libraries into /usr/local/lib64/digilent/adept
|
|
% Answer Y to install system binaries into /usr/sbin
|
|
% Answer Y to install data into /usr/share/digilent/adept/data
|
|
% Answer Y to install runtime configuration data files into /etc
|
|
%
|
|
\section{Building and Running the Host Software}
|
|
\section{Building the Board Software}
|
|
\section{Building the ZipOS}
|
|
|
\chapter{Software}
|
\chapter{Software}
|
This chapter provides an overview of the software that is available to support
|
This chapter provides an overview of the software that is available to support
|
the S6~SoC. This includes not only the RTL, the Makefiles, and the software
|
the S6~SoC. This includes not only the RTL, the Makefiles, and the software
|
that will run on the Zip~CPU within the S6~SoC, but also the support software
|
that will run on the Zip~CPU within the S6~SoC, but also the support software
|
necessary for communicating with the S6~SoC in its alternate configuration.
|
necessary for communicating with the S6~SoC in its alternate configuration.
|
Line 301... |
Line 366... |
``Hello, world!'' This program sends the string, ``Hello, world!''
|
``Hello, world!'' This program sends the string, ``Hello, world!''
|
over the UART connection once per second. It is a very valuable
|
over the UART connection once per second. It is a very valuable
|
program because, if you can get this program running, you know you have
|
program because, if you can get this program running, you know you have
|
a lot of things working and working correctly. For example, running
|
a lot of things working and working correctly. For example, running
|
this program means you can run the {\tt zip-gcc} compiler, load
|
this program means you can run the {\tt zip-gcc} compiler, load
|
the auxiliar configuration, load the program info flash memory, load
|
the auxiliary configuration, load the program info flash memory, load
|
the primary configuration, and read from the UART port. It also means
|
the primary configuration, and read from the UART port. It also means
|
that you must have the UART port properly configured and wired to your
|
that you must have the UART port properly configured and wired to your
|
CMod board.
|
CMod board.
|
\item {\tt doorbell}: This annoying program verifies the functionality of the
|
\item {\tt doorbell}: This annoying program verifies the functionality of the
|
audio device by playing a doorbell sound to the audio port. It will
|
audio device by playing a doorbell sound to the audio port. It will
|
Line 407... |
Line 472... |
In a similar fashion, if the timeout is negative, then any pending
|
In a similar fashion, if the timeout is negative, then any pending
|
timeout is cleared.
|
timeout is cleared.
|
|
|
\item {\tt void post(unsigned event\_mask)}
|
\item {\tt void post(unsigned event\_mask)}
|
|
|
Certain devices, such as the real--time clock and the doorbell
|
Certain software devices, such as the real--time clock and the doorbell
|
reader, need the ability of being able to post events to any listener
|
reader, need the ability of being able to post events to any listener
|
within the O/S. The POST system call allows them to POST events in
|
within the O/S. The POST system call allows them to POST events in
|
this manner.
|
this manner.
|
|
|
Were the ZipOS to be closer to a secure O/S, it might restrict what
|
Were the ZipOS to be closer to a secure O/S, it might restrict what
|
Line 635... |
Line 700... |
There are several address regions on the S6~SoC, as shown in
|
There are several address regions on the S6~SoC, as shown in
|
Tbl.~\ref{tbl:memregions}.
|
Tbl.~\ref{tbl:memregions}.
|
\begin{table}[htbp]
|
\begin{table}[htbp]
|
\begin{center}\begin{tabular}{|p{0.75in}|p{0.75in}|p{0.5in}|p{3.0in}|}\hline
|
\begin{center}\begin{tabular}{|p{0.75in}|p{0.75in}|p{0.5in}|p{3.0in}|}\hline
|
\rowcolor[gray]{0.85} Start & End & & Purpose \\\hline\hline
|
\rowcolor[gray]{0.85} Start & End & & Purpose \\\hline\hline
|
\scalebox{0.9}{\tt 0x000100} & \scalebox{0.9}{\tt 0x000107} & R/W & Peripheral I/O Control \\\hline
|
\scalebox{0.9}{\tt 0x0000400} & \scalebox{0.9}{\tt 0x00043f} & R/W & Peripheral I/O Control \\\hline
|
\scalebox{0.9}{\tt 0x000200} & \scalebox{0.9}{\tt 0x000201} & R/(W) & Debugging scope\\\hline
|
\scalebox{0.9}{\tt 0x0000800} & \scalebox{0.9}{\tt 0x00080f} & R/(W) & Debugging scope\\\hline
|
\scalebox{0.9}{\tt 0x000400} & \scalebox{0.9}{\tt 0x00043f} & R/W & Internal Configuration Access Port\\\hline
|
\scalebox{0.9}{\tt 0x0004000} & \scalebox{0.9}{\tt 0x03fff} & R/W & 16kB On-Chip Block RAM \\\hline
|
\scalebox{0.9}{\tt 0x000800} & \scalebox{0.9}{\tt 0x000803} & R/W & RTC Clock (if present)\\\hline
|
\scalebox{0.9}{\tt 0x1000000} & \scalebox{0.9}{\tt 0x7fffff} & R & 16~MB SPI Flash memory\\\hline
|
\scalebox{0.9}{\tt 0x002000} & \scalebox{0.9}{\tt 0x002fff} & R/W & 16kB On-Chip Block RAM \\\hline
|
|
\scalebox{0.9}{\tt 0x400000} & \scalebox{0.9}{\tt 0x7fffff} & R & 16~MB SPI Flash memory\\\hline
|
|
\end{tabular}
|
\end{tabular}
|
\caption{Address Regions}\label{tbl:memregions}
|
\caption{Address Regions}\label{tbl:memregions}
|
\end{center}\end{table}
|
\end{center}\end{table}
|
In general, the address regions that are made up of RAM or flash act like
|
In general, the address regions that are made up of RAM or flash act like
|
memory. The RAM can be read and written, and the flash acts like read only
|
memory. The RAM can be read and written, and the flash acts like read only
|
memory.\footnote{The Flash can be written, but only by an external command
|
memory.\footnote{The Flash can be written, but only by an external command
|
while in the alternate configuration.}
|
while in the alternate configuration.} Furthermore, {\em only} the RAM offers
|
|
the capability of byte-wise writes across the bus.
|
|
|
This isn't quite true with the other address regions. Accessing the I/O
|
This isn't quite true with the other address regions. Accessing the I/O
|
region, while it will act like a memory, it may also have side-effects. For
|
region, while it will act like a memory, it may also have side-effects. For
|
example, reading from the debugging scope device's data port will read a word
|
example, reading from the debugging scope device's data port will read a word
|
from the scope's buffer and advance the buffer pointer. (More on that later.)
|
from the scope's buffer and advance the buffer pointer. (More on that later.)
|
|
|
Finally, to keep the address decoder simple, many of these addresses are
|
Finally, to keep the address decoder simple, many of these addresses are
|
multiply mapped. Hence you may find the I/O peripherals mapped throughout the
|
multiply mapped. Hence you may find the I/O peripherals mapped throughout the
|
{\tt 0x0100}--{\tt 0x01ff} address region. Other memory addresses are similarly
|
{\tt 0x0400}--{\tt 0x07ff} address region. Other memory addresses are similarly
|
overmapped. This overmapping was a resource minimization feature, to get the
|
overmapped. This overmapping was a resource minimization feature, to get the
|
bus to fit within a minimum number of FPGA resources.
|
bus to fit within a minimum number of FPGA resources. For this reason,
|
|
addresses not explicitly defined in this specification are undefined.
|
|
Likewise, attempting to write a byte or half-word to anything other than RAM
|
|
will have undefined results.
|
|
|
\section{Peripheral I/O Control}
|
\section{Peripheral I/O Control}
|
Tbl.~\ref{tbl:ioregs}
|
Tbl.~\ref{tbl:ioregs}
|
\begin{table}[htbp]
|
\begin{table}[htbp]
|
\begin{center}\begin{reglist}
|
\begin{center}\begin{reglist}
|
PIC &\scalebox{0.8}{\tt 0x0100} & 32 & R/W & Interrupt Controller \\\hline
|
PIC &\scalebox{0.8}{\tt 0x0400} & 32 & R/W & Interrupt Controller \\\hline
|
BUSERR &\scalebox{0.8}{\tt 0x0101} & 32 & R & Last Bus Error Address\\\hline
|
BUSERR &\scalebox{0.8}{\tt 0x0404} & 32 & R & Last Bus Error Address\\\hline
|
TIMA &\scalebox{0.8}{\tt 0x0102} & 32 & R/W & ZipTimer A\\\hline
|
TIMER &\scalebox{0.8}{\tt 0x0408} & 32 & R/W & ZipTimer\\\hline
|
TIMB &\scalebox{0.8}{\tt 0x0103} & 32 & R/W & ZipTimer B\\\hline
|
WDOG &\scalebox{0.8}{\tt 0x040c} & 32 & R/W & Watchdog Timer\\\hline
|
PWM &\scalebox{0.8}{\tt 0x0104} & 32 & R/W & PWM Audio Controller\\\hline
|
PWM &\scalebox{0.8}{\tt 0x0410} & 32 & R/W & PWM Audio Controller\\\hline
|
SPIO &\scalebox{0.8}{\tt 0x0105} & 32 & R/W & Special Purpose I/O, Keypad, LED Controller \\\hline
|
SPIO &\scalebox{0.8}{\tt 0x0414} & 32 & R/W & Special Purpose I/O, Keypad, LED Controller \\\hline
|
GPIO &\scalebox{0.8}{\tt 0x0106} & 32 & R/W & GPIO Controller \\\hline
|
GPIO &\scalebox{0.8}{\tt 0x0418} & 32 & R/W & GPIO Controller \\\hline
|
UART &\scalebox{0.8}{\tt 0x0107} & 32 & R/W & UART data\\\hline
|
UART &\scalebox{0.8}{\tt 0x041c} & 32 & R/W & UART data\\\hline
|
VERSION &\scalebox{0.8}{\tt 0x0108} & 32 & R & Build date\\\hline
|
VERSION &\scalebox{0.8}{\tt 0x0420} & 32 & R & Build date\\\hline
|
\end{reglist}
|
\end{reglist}
|
\caption{I/O Peripheral Registers}\label{tbl:ioregs}
|
\caption{I/O Peripheral Registers}\label{tbl:ioregs}
|
\end{center}\end{table}
|
\end{center}\end{table}
|
shows the addresses of various I/O peripherals included as part of the SoC.
|
shows the addresses of various I/O peripherals included as part of the SoC.
|
We'll walk through each of these peripherals in turn, describing how they work.
|
We'll walk through each of these peripherals in turn, describing how they work.
|
Line 749... |
Line 816... |
|
|
Interrupts are acknowledged in a fashion similar to enabling interrupts. By
|
Interrupts are acknowledged in a fashion similar to enabling interrupts. By
|
writing a `1' to the active bit mask, the interrupt will be acknowledged and
|
writing a `1' to the active bit mask, the interrupt will be acknowledged and
|
reset, whereas writing a `0' leaves the interrupt untouched. In this fashion,
|
reset, whereas writing a `0' leaves the interrupt untouched. In this fashion,
|
as individual interrupts are handled, a `1' may be written to this bottom mask
|
as individual interrupts are handled, a `1' may be written to this bottom mask
|
to clear the interrupt. Be aware, however, that any interrupt acknowledgement
|
to clear the interrupt. Be aware, however, that any write for the purpose of
|
may also globally enable or disable interrupts.
|
acknowledging an interrupt will also globally enable or disable interrupts.
|
|
|
\subsection{Last Bus Error Address}
|
\subsection{Last Bus Error Address}
|
The Bus Error peripheral simply records the address of the last bus error,
|
The Bus Error peripheral simply records the address of the last bus error,
|
and sets an interrupt upon receiving a bus error. (The interrupt itself
|
and sets an interrupt upon receiving a bus error. (The interrupt itself
|
is kind of useless ...) The address can be useful when debugging. While the
|
is kind of useless ...) The address can be useful when debugging. While the
|
Line 763... |
Line 830... |
Another use for this is upon any reboot, it is possible to read the address
|
Another use for this is upon any reboot, it is possible to read the address
|
of the last bus error and perhaps learn something of what caused the CPU to
|
of the last bus error and perhaps learn something of what caused the CPU to
|
restart.
|
restart.
|
|
|
\subsection{ZipTimer}
|
\subsection{ZipTimer}
|
The S6~SoC contains two ZipTimers, available for the CPU to use. These are
|
The S6~SoC contains two ZipTimers, one general purpose and one watchdog,
|
countdown timers. Writing any non--zero value to them will cause them to
|
available for the CPU to use. These are both countdown timers. Writing any
|
immediately start counting down from that value towards zero, and to interrupt
|
non--zero value to them will cause them to immediately start counting down
|
the CPU upon the transition to zero. Writing a new value while the timer is
|
from that value towards zero, and to interrupt the CPU upon the transition to
|
|
zero. Writing a new value while the timer is
|
running will cause that new value to automatically load into the timer and
|
running will cause that new value to automatically load into the timer and
|
start counting from there. Writing a zero to the timer disables the timer, and
|
start counting from there. Writing a zero to the timer disables the timer, and
|
causes it to stop.
|
causes it to stop.
|
|
|
ZipTimer A can be set to auto reload by setting the top bit as well as the
|
The general purpose ZipTimer can be set to auto reload by setting the top bit
|
interval. When so set, the timer will automatically
|
as well as the interval. When so set, the timer will automatically
|
load it's last set value upon reaching zero and interrupting the CPU. This
|
load it's last set value upon reaching zero and interrupting the CPU. This
|
effectively turns it into an interrupt timer if desired. To set this feature,
|
effectively turns it into an interrupt timer if desired. To set this feature,
|
write to the timer the number of clock ticks before an interrupt, but also set
|
write to the timer the number of clock ticks before an interrupt, but also set
|
the high order bit. In this fashion, writing a {\tt 0x8001387f} will interrupt
|
the high order bit. In this fashion, writing a {\tt 0x8001387f} will interrupt
|
the CPU every millisecond, starting one millisecond after the write takes place
|
the CPU every millisecond, starting one millisecond after the write takes place
|
(assuming an 80~MHz system clock).\footnote{Note that, since the timer spends
|
(assuming an 80~MHz system clock).\footnote{Note that, since the timer spends
|
a cycle at zero, setting it for a 80,000 cycle period requires setting the
|
a cycle at zero, setting it for a 80,000 cycle period requires setting the
|
timer value to one less than 80,000.}
|
timer value to one less than 80,000.}
|
|
|
ZipTimer B has been wired for a different purpose. ZipTimer B does not support
|
The watchdog timer has been wired for a different purpose. It does not support
|
auto reload, nor will it interrupt the CPU. Instead, ZipTimer B has been wired
|
auto reload, nor will it interrupt the CPU. When this timer transitions to
|
as a watchdog timer. When this timer transitions to zero, the CPU will be
|
zero, the CPU will be rebooted. One way to use this timer would be in
|
rebooted. One way to use this timer would be in conjunction with the ZipTimer
|
conjunction with the general purpose timer, and to write a number to it upon
|
A, and to write a number to it upon any entry to the interrupt service routine.
|
any entry to the interrupt service routine. If given enough time, this would
|
If given enough time, this would cause the CPU to reboot if for any reason it
|
cause the CPU to reboot if for any reason it locked up and failed to interrupt
|
locked up.
|
at the general timer interrupt request time.
|
|
|
The ZipOS uses ZipTimer~A for task swapping. By setting the timer for
|
The ZipOS uses the ZipTimer for task swapping. By setting the timer for
|
1~ms, the ZipOS examines every task for a potential task swap every millisecond.
|
1~ms, the ZipOS examines every task for a potential task swap every millisecond.
|
Of course, if the various tasks are running from Flash at 52~clocks per
|
Of course, if the various tasks are running from Flash at 52~clocks per
|
instruction, this means that as few as 1,538~instructions may be executed
|
instruction, this means that as few as 1,538~instructions may be executed
|
between timer interrupts, but this can be tuned if necessary for better
|
between timer interrupts, but this can be tuned if necessary for better
|
performance.
|
performance.
|
Line 945... |
Line 1013... |
|
|
\subsection{UART Data Register}
|
\subsection{UART Data Register}
|
Moving on to the UART \ldots although the UART module itself
|
Moving on to the UART \ldots although the UART module itself
|
within the S6~SoC is highly configurable, as built
|
within the S6~SoC is highly configurable, as built
|
the UART can only handle 9600~Baud, 8--data bits, no parity, and one stop bit.
|
the UART can only handle 9600~Baud, 8--data bits, no parity, and one stop bit.
|
Changing this involves changing the constant {\tt uart\_setup} within
|
Changing this involves changing the constant {\tt UART\_SETUP} within
|
{\tt busmaster.v}. Further, the UART has only a single byte data buffer, so
|
{\tt toplevel.v}. Further, the UART has only a single byte data buffer, so
|
reading from the port has a real--time requirement associated with it: the
|
reading from the port has a real--time requirement associated with it: the
|
data buffer must be emptied before the next value is read.
|
data buffer must be emptied before the next value is read.
|
Attempts to read from this port will either return an 8--bit data value from
|
Attempts to read from this port will either return an 8--bit data value from
|
the port, or if no values are available it will return an {\tt 0x0100}
|
the port, or if no values are available it will return an {\tt 0x0100}
|
indicating that fact. In general, reading from the UART port involves first
|
indicating that fact. In general, reading from the UART port involves first
|
waiting for the interrupt to be ready, second reading from the port itself,
|
waiting for the interrupt to be ready, second reading from the port itself,
|
and then third immediately clearing the interrupt. (The interrupt cannot
|
and then third immediately clearing the interrupt. (The interrupt cannot
|
be cleared while data is waiting.) Writing to the UART port is done in a
|
be cleared while data is waiting.) Writing to the UART port is done in a
|
similar fashion. First, wait until the UART transmit interrupt is asserted
|
similar fashion. First, wait until the UART transmit interrupt is asserted
|
(this will likely be most of the time), second write to the UART port, and
|
(this will likely be most of the time), second, write to the UART port, and
|
then third clear the interrupt. As with the read interrupt, clearing the
|
then third, clear the interrupt. As with the read interrupt, clearing the
|
transmit interrupt prior to writing to the port will have no effect. Likewise,
|
transmit interrupt prior to writing to the port will have no effect. Likewise,
|
clearing the transmit interrupt after the byte has been written will have no
|
clearing the transmit interrupt after the byte has been written will have no
|
affect either.
|
affect either.
|
|
|
\section{Debugging Scope}
|
\section{Debugging Scope}
|
Line 969... |
Line 1037... |
register. It needs to be internally wired to 32--wires, internal to the
|
register. It needs to be internally wired to 32--wires, internal to the
|
S6~SoC, that will be of interest when debugging. For further details on how
|
S6~SoC, that will be of interest when debugging. For further details on how
|
to configure and use this scope, please see the {\tt WBSCOPE} project on
|
to configure and use this scope, please see the {\tt WBSCOPE} project on
|
OpenCores.
|
OpenCores.
|
|
|
\section{Internal Configuration Access Port}
|
|
The Internal Configuration Access Port (ICAP) provides access to the internal
|
|
configuration details of the FPGA. This access was designed so as to provide
|
|
the CPU with the capability to command a different FPGA load. In particular,
|
|
the code in Fig.~\ref{fig:reload} should reconfigure the FPGA from any given
|
|
Quad SPI {\tt address}.\footnote{According to Xilinx's technical support, this
|
|
will only work if the JTAG port is not busy--such as when the USB port is
|
|
disconnected.}
|
|
\begin{figure}\begin{center}\begin{tabbing}
|
|
{\tt warmboot(uint32 address) \{} \\
|
|
\hbox to 0.25in{}\={\tt uint32\_t *icape6 = (volatile uint32\_t *)0x{\em <ICAPE port address>};}\\
|
|
\>{\tt icape6[13] = (address<<2)\&0x0ffff;}\\
|
|
\>{\tt icape6[14] = ((address>>14)\&0x0ff)|((0x03)<<8);}\\
|
|
\>{\tt icape6[4] = 14;}\\
|
|
\>{\em // The CMod~S6 is now reconfiguring itself from the new address.}\\
|
|
\>{\em // If all goes well, this routine will never return.}\\
|
|
{\tt \}}
|
|
\end{tabbing}
|
|
\caption{Spartan--6 ICAPE Usage}\label{fig:reload}
|
|
\end{center}\end{figure}
|
|
|
|
One subtle problem with this port is that it will not work if the CMod is
|
|
plugged in to the USB JTAG port. It will only work if the CMod has been
|
|
provided with an independent power supply, leaving the USB JTAG unplugged.
|
|
|
|
For further details, please see either the {\tt WBICAPETWO} project on
|
|
OpenCores as well as Xilinx's ``Spartan-6 FPGA Configuration User Guide''.
|
|
|
|
\section{Real--Time Clock}
|
|
|
|
The Real Time Clock will be included if there is enough area to support it.
|
|
(There isn't currently \ldots)
|
|
The four registers of this port correspond to a clock, a timer, a stopwatch,
|
|
and an alarm. If space is tight, the timer and stopwatch, or indeed the entire
|
|
clock, may be removed from the design. For further details regarding how to
|
|
set and use this clock, please see the {\tt RTCCLOCK} project on OpenCores.
|
|
|
|
There is currently not enough area on the chip to support the Real--Time Clock
|
|
together with all of the other peripherals listed here. You can adjust whether
|
|
the clock is included or not by adjusting the {\tt `define} lines at the top
|
|
of {\tt busmaster.v}. For example, it may be possible to get the RTC back by
|
|
disabling the ICAPE2 interface.
|
|
|
|
In place of the RTC capability, the ZipOS offers a software based RTC capability
|
|
to simulate the clock register of this port.
|
|
|
|
\section{On-Chip Block RAM}
|
\section{On-Chip Block RAM}
|
|
|
The block RAM is the fastest memory available to the processor. It is also
|
The block RAM is the fastest memory available to the processor. It is also
|
the {\em only} writeable memory available to the processor. Hence all
|
the {\em only} writeable memory available to the processor. Hence all
|
non-constant program data {\em must} be placed into block RAM. The Zip~CPU
|
non-constant program data {\em must} be placed into block RAM. The Zip~CPU
|
Line 1033... |
Line 1055... |
and the third section for any program and data. These regions are shown in
|
and the third section for any program and data. These regions are shown in
|
Tbl.~\ref{tbl:flash-addresses}.
|
Tbl.~\ref{tbl:flash-addresses}.
|
\begin{table}[htbp]
|
\begin{table}[htbp]
|
\begin{center}\begin{tabular}{|p{0.75in}|p{0.75in}|p{0.5in}|p{3.0in}|}\hline
|
\begin{center}\begin{tabular}{|p{0.75in}|p{0.75in}|p{0.5in}|p{3.0in}|}\hline
|
\rowcolor[gray]{0.85} Start & End & & Purpose \\\hline\hline
|
\rowcolor[gray]{0.85} Start & End & & Purpose \\\hline\hline
|
\scalebox{0.9}{\tt 0x400000} & \scalebox{0.9}{\tt 0x43ffff} & R & Primary configuration space\\\hline
|
\scalebox{0.9}{\tt 0x1000000} & \scalebox{0.9}{\tt 0x10fffff} & R & Primary configuration space\\\hline
|
\scalebox{0.9}{\tt 0x440000} & \scalebox{0.9}{\tt 0x47ffff} & R & Alternate configuration space\\\hline
|
\scalebox{0.9}{\tt 0x1100000} & \scalebox{0.9}{\tt 0x11fffff} & R & Alternate configuration space\\\hline
|
\scalebox{0.9}{\tt 0x480000} & \scalebox{0.9}{\tt 0x7fffff} & R & Zip~CPU program memory\\\hline
|
\scalebox{0.9}{\tt 0x1200000} & \scalebox{0.9}{\tt 0x1ffffff} & R & Zip~CPU program memory\\\hline
|
\end{tabular}
|
\end{tabular}
|
\caption{Flash Address Regions}\label{tbl:flash-addresses}
|
\caption{Flash Address Regions}\label{tbl:flash-addresses}
|
\end{center}\end{table}
|
\end{center}\end{table}
|
The host program {\tt zipload} can be used to load a Zip~CPU program and
|
The host program {\tt zipload} can be used to load a Zip~CPU program and
|
configuration files into this address space. To use it, first load the
|
configuration files into this address space. To use it, first load the
|