1 |
2 |
dgisselq |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
2 |
|
|
%%
|
3 |
|
|
%% Filename: spec.tex
|
4 |
|
|
%%
|
5 |
|
|
%% Project: Wishbone scope
|
6 |
|
|
%%
|
7 |
|
|
%% Purpose: This LaTeX file contains all of the documentation/description
|
8 |
|
|
%% currently provided with this Wishbone scope core. It's not
|
9 |
|
|
%% nearly as interesting as the PDF file it creates, so I'd
|
10 |
|
|
%% recommend reading that before diving into this file. You
|
11 |
|
|
%% should be able to find the PDF file in the SVN distribution
|
12 |
|
|
%% together with this PDF file and a copy of the GPL-3.0 license
|
13 |
|
|
%% this file is distributed under. If not, just type 'make'
|
14 |
|
|
%% in the doc directory and it (should) build without a problem.
|
15 |
|
|
%%
|
16 |
|
|
%%
|
17 |
|
|
%% Creator: Dan Gisselquist
|
18 |
|
|
%% Gisselquist Technology, LLC
|
19 |
|
|
%%
|
20 |
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
21 |
|
|
%%
|
22 |
|
|
%% Copyright (C) 2015, Gisselquist Technology, LLC
|
23 |
|
|
%%
|
24 |
|
|
%% This program is free software (firmware): you can redistribute it and/or
|
25 |
|
|
%% modify it under the terms of the GNU General Public License as published
|
26 |
|
|
%% by the Free Software Foundation, either version 3 of the License, or (at
|
27 |
|
|
%% your option) any later version.
|
28 |
|
|
%%
|
29 |
|
|
%% This program is distributed in the hope that it will be useful, but WITHOUT
|
30 |
|
|
%% ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
|
31 |
|
|
%% FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
32 |
|
|
%% for more details.
|
33 |
|
|
%%
|
34 |
|
|
%% You should have received a copy of the GNU General Public License along
|
35 |
|
|
%% with this program. (It's in the $(ROOT)/doc directory, run make with no
|
36 |
|
|
%% target there if the PDF file isn't present.) If not, see
|
37 |
|
|
%% <http://www.gnu.org/licenses/> for a copy.
|
38 |
|
|
%%
|
39 |
|
|
%% License: GPL, v3, as defined and found on www.gnu.org,
|
40 |
|
|
%% http://www.gnu.org/licenses/gpl.html
|
41 |
|
|
%%
|
42 |
|
|
%%
|
43 |
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
44 |
|
|
\documentclass{gqtekspec}
|
45 |
|
|
\project{Wishbone Scope}
|
46 |
|
|
\title{Specification}
|
47 |
|
|
\author{Dan Gisselquist, Ph.D.}
|
48 |
|
|
\email{dgisselq (at) opencores.org}
|
49 |
|
|
\revision{Rev.~0.1}
|
50 |
|
|
\begin{document}
|
51 |
|
|
\pagestyle{gqtekspecplain}
|
52 |
|
|
\titlepage
|
53 |
|
|
\begin{license}
|
54 |
|
|
Copyright (C) \theyear\today, Gisselquist Technology, LLC
|
55 |
|
|
|
56 |
|
|
This project is free software (firmware): you can redistribute it and/or
|
57 |
|
|
modify it under the terms of the GNU General Public License as published
|
58 |
|
|
by the Free Software Foundation, either version 3 of the License, or (at
|
59 |
|
|
your option) any later version.
|
60 |
|
|
|
61 |
|
|
This program is distributed in the hope that it will be useful, but WITHOUT
|
62 |
|
|
ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
|
63 |
|
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
64 |
|
|
for more details.
|
65 |
|
|
|
66 |
|
|
You should have received a copy of the GNU General Public License along
|
67 |
|
|
with this program. If not, see \hbox{<http://www.gnu.org/licenses/>} for a
|
68 |
|
|
copy.
|
69 |
|
|
\end{license}
|
70 |
|
|
\begin{revisionhistory}
|
71 |
|
|
0.1 & 6/22/2015 & Gisselquist & First Draft \\\hline
|
72 |
|
|
\end{revisionhistory}
|
73 |
|
|
% Revision History
|
74 |
|
|
% Table of Contents, named Contents
|
75 |
|
|
\tableofcontents
|
76 |
|
|
% \listoffigures
|
77 |
|
|
\listoftables
|
78 |
|
|
\begin{preface}
|
79 |
|
|
|
80 |
|
|
This, then, was and is the genesis of this project.
|
81 |
|
|
\end{preface}
|
82 |
|
|
|
83 |
|
|
\chapter{Introduction}
|
84 |
|
|
\pagenumbering{arabic}
|
85 |
|
|
\setcounter{page}{1}
|
86 |
|
|
|
87 |
|
|
The wishbone Scope is a debugging tool for reading results from the chip after
|
88 |
|
|
events have taken place. In general, the scope records data until some
|
89 |
|
|
trigger has taken place, and then continues for some user programmable hold off.
|
90 |
|
|
Once the holdoff has been reached, the scope stops recording and asserts an
|
91 |
|
|
interrupt. At this time, data may be read from the scope in order from oldest
|
92 |
|
|
to most recent. That's the basics, now for two extra details.
|
93 |
|
|
|
94 |
|
|
First, the trigger and data that the scope records is implementation dependent.
|
95 |
|
|
The scope itself is designed to be easily reconfigurable from one build to the
|
96 |
|
|
next so that the actual configuration may even be build dependent.
|
97 |
|
|
|
98 |
|
|
Second, the scope is built to be able to run off of a separate clock from the
|
99 |
|
|
bus that commands and controls it. This is configurable, set the parameter
|
100 |
|
|
``SYNCHRONOUS'' to `1' to run off of a single clock. When running off of two
|
101 |
|
|
clocks, it means that actions associated with commands issued to the scope, such
|
102 |
|
|
as manual triggering or being disabled or released, will not act synchronously
|
103 |
|
|
with the scope itself.
|
104 |
|
|
|
105 |
|
|
Third, the data clock associated with the scope has a clock enable line
|
106 |
|
|
associated with it. Depending on how often the clock enable line is enabled
|
107 |
|
|
may determine how fast the scope is primed, triggered, and eventually completes
|
108 |
|
|
its collection.
|
109 |
|
|
|
110 |
|
|
% \chapter{Architecture}
|
111 |
|
|
\chapter{Operation}
|
112 |
|
|
|
113 |
|
|
So how shall one use the scope? First, before using the scope, the holdoff
|
114 |
|
|
needs to be set. The scope is designed so that setting the scope control value
|
115 |
|
|
to the holdoff alone will reset the scope from whatever condition it was in,
|
116 |
|
|
freeing it to run. Once running, then upon every clock enabled clock, one
|
117 |
|
|
sample of data is read into the scope and recorded. Once every memory value
|
118 |
|
|
is filled, the scope has been {\tt PRIMED}. Once the scope has been
|
119 |
|
|
{\tt PRIMED}, it will then be responsive to its trigger. Should the trigger be
|
120 |
|
|
active on a clock--enabled input, the scope will then be {\tt TRIGGERED}. It
|
121 |
|
|
will then count for the number of clocks in the holdoff before stopping collection, placing it in the {\tt STOPPED} state. If the holdoff is zero, the last
|
122 |
|
|
sample in the buffer will be the sample containing the trigger.
|
123 |
|
|
|
124 |
|
|
There are two further commands that will affect the operation of the scope. The
|
125 |
|
|
first is the {\tt MANUAL} trigger command/bit. This will cause the scope to
|
126 |
|
|
trigger immediately if set. If coupled with a {\tt RESET} command, the trigger
|
127 |
|
|
will first wait until it is {\tt PRIMED} before the manual trigger takes
|
128 |
|
|
effect.
|
129 |
|
|
|
130 |
|
|
The last command that can affect the operation of the scope is the {\tt DISABLE}
|
131 |
|
|
command/bit. This command will prevent the scope from triggering, or if
|
132 |
|
|
triggered, prevent the scope from generating an interrupt.
|
133 |
|
|
|
134 |
|
|
\chapter{Registers}
|
135 |
|
|
|
136 |
|
|
This scope core supports two registers, as listed in
|
137 |
|
|
Tbl.~\ref{tbl:reglist}. The first is the control register, whereas the second
|
138 |
|
|
is the data register.
|
139 |
|
|
\begin{table}[htbp]
|
140 |
|
|
\begin{center}
|
141 |
|
|
\begin{reglist}
|
142 |
|
|
WBSCOPE & 0 & 32 & R/W & Configuration, control, and status of the
|
143 |
|
|
scope.\\\hline
|
144 |
|
|
WBSCOPEDATA & 1 & 32 & R & Read out register, to read out the data
|
145 |
|
|
from the core.\\\hline
|
146 |
|
|
\end{reglist}\caption{List of Registers}\label{tbl:reglist}
|
147 |
|
|
\end{center}\end{table}
|
148 |
|
|
Each register will be discussed in detail in this chapter.
|
149 |
|
|
|
150 |
|
|
\section{Control Register}
|
151 |
|
|
The bits in the control register are defined in Tbl.~\ref{tbl:control}.
|
152 |
|
|
\begin{table}[htbp]
|
153 |
|
|
\begin{center}
|
154 |
|
|
\begin{bitlist}
|
155 |
|
|
31 & R/W & RESET\_n. Write a `0' to this register to command a reset.
|
156 |
|
|
Reading a `1' from this register means the reset has not finished
|
157 |
|
|
crossing clock domains and is still pending.\\\hline
|
158 |
|
|
30 & R & STOPPED, indicates that all collection has stopped.\\\hline
|
159 |
|
|
29 & R & TRIGGERRED, indicates that a trigger has been recognized, and that
|
160 |
|
|
the scope is counting for holdoff samples before stopping.\\\hline
|
161 |
|
|
28 & R & PRIMED, indicates that the memory has been filled, and that the
|
162 |
|
|
scope is now waiting on a trigger.\\\hline
|
163 |
|
|
27 & R/W & MANUAL, set to invoke a manual trigger.\\\hline
|
164 |
|
|
26 & R/W & DISABLE, set to disable the internal trigger. The scope may still
|
165 |
|
|
be triggered manually.\\\hline
|
166 |
|
|
25 & R & RZERO, this will be true whenever the scope's internal address
|
167 |
|
|
register is pointed at the beginning of the memory.\\\hline
|
168 |
|
|
20--24 & R & LGMEMLEN, the base two logarithm of the memory length. Thus,
|
169 |
|
|
the memory internal to the scope is given by 1<<LGMEMLEN. \\\hline
|
170 |
|
|
0--19 & R/W & Unsigned holdoff\\\hline
|
171 |
|
|
\end{bitlist}
|
172 |
|
|
\caption{Control Register}\label{tbl:control}
|
173 |
|
|
\end{center}\end{table}
|
174 |
|
|
|
175 |
|
|
\section{Data Register}
|
176 |
|
|
|
177 |
|
|
This is perhaps the simplest register to explain. Before the core stops
|
178 |
|
|
recording, reads from this register will produce reads of the bits going into
|
179 |
|
|
the core, save only that they have not been protected from any meta-stability
|
180 |
|
|
issues. This is useful for reading what's going on when the various lines are
|
181 |
|
|
stuck. After the core stops recording, reads from this register return values
|
182 |
|
|
from the stored memory. Further, after recording has stopped, every read
|
183 |
|
|
increments an internal memory address, so that after $N$ reads (for however
|
184 |
|
|
long the internal memory is), the entire memory has been returned over the bus.
|
185 |
|
|
If you would like some assurance that you are reading from the beginning of the
|
186 |
|
|
memory, check the control register's {\tt RZERO} flag.
|
187 |
|
|
|
188 |
|
|
\chapter{Clocks}
|
189 |
|
|
|
190 |
|
|
This scope supports two clocks: a wishbone bus clock, and a data clock.
|
191 |
|
|
If the internal parameter ``SYNCHRONOUS'' is set to zero, proper transfers
|
192 |
|
|
will take place between these two clocks. Setting this parameter to a one
|
193 |
|
|
will save some flip flops and logic in implementation.
|
194 |
|
|
|
195 |
|
|
\chapter{Wishbone Datasheet}\label{chap:wishbone}
|
196 |
|
|
Tbl.~\ref{tbl:wishbone}
|
197 |
|
|
\begin{table}[htbp]
|
198 |
|
|
\begin{center}
|
199 |
|
|
\begin{wishboneds}
|
200 |
|
|
Revision level of wishbone & WB B4 spec \\\hline
|
201 |
|
|
Type of interface & Slave, Read/Write, pipeline reads supported \\\hline
|
202 |
|
|
Port size & 32--bit \\\hline
|
203 |
|
|
Port granularity & 32--bit \\\hline
|
204 |
|
|
Maximum Operand Size & 32--bit \\\hline
|
205 |
|
|
Data transfer ordering & (Irrelevant) \\\hline
|
206 |
|
|
Clock constraints & None.\\\hline
|
207 |
|
|
Signal Names & \begin{tabular}{ll}
|
208 |
|
|
Signal Name & Wishbone Equivalent \\\hline
|
209 |
|
|
{\tt i\_wb\_clk} & {\tt CLK\_I} \\
|
210 |
|
|
{\tt i\_wb\_cyc} & {\tt CYC\_I} \\
|
211 |
|
|
{\tt i\_wb\_stb} & {\tt STB\_I} \\
|
212 |
|
|
{\tt i\_wb\_we} & {\tt WE\_I} \\
|
213 |
|
|
{\tt i\_wb\_addr} & {\tt ADR\_I} \\
|
214 |
|
|
{\tt i\_wb\_data} & {\tt DAT\_I} \\
|
215 |
|
|
{\tt o\_wb\_ack} & {\tt ACK\_O} \\
|
216 |
|
|
{\tt o\_wb\_stall} & {\tt STALL\_O} \\
|
217 |
|
|
{\tt o\_wb\_data} & {\tt DAT\_O}
|
218 |
|
|
\end{tabular}\\\hline
|
219 |
|
|
\end{wishboneds}
|
220 |
|
|
\caption{Wishbone Datasheet}\label{tbl:wishbone}
|
221 |
|
|
\end{center}\end{table}
|
222 |
|
|
is required by the wishbone specification, and so
|
223 |
|
|
it is included here. The big thing to notice is that this core
|
224 |
|
|
acts as a wishbone slave, and that all accesses to the wishbone scope
|
225 |
|
|
registers become 32--bit reads and writes to this interface.
|
226 |
|
|
|
227 |
|
|
\chapter{IO Ports}
|
228 |
|
|
|
229 |
|
|
The ports are listed in Table.~\ref{tbl:ioports}.
|
230 |
|
|
\begin{table}[htbp]
|
231 |
|
|
\begin{center}
|
232 |
|
|
\begin{portlist}
|
233 |
|
|
i\_clk & 1 & Input & \\\hline
|
234 |
|
|
i\_ce & 1 & Input & Clock Enable. Set this high to clock data in and
|
235 |
|
|
out.\\\hline
|
236 |
|
|
i\_trigger & 1 & Input &
|
237 |
|
|
\\\hline
|
238 |
|
|
i\_data & 32 & Input &
|
239 |
|
|
\\\hline
|
240 |
|
|
i\_wb\_clk & 1 & Input & The clock that the wishbone interface runs on.
|
241 |
|
|
\\\hline
|
242 |
|
|
i\_wb\_cyc & 1 & Input & Indicates a wishbone bus cycle is active when high.
|
243 |
|
|
\\\hline
|
244 |
|
|
i\_wb\_stb & 1 & Input & Indicates a wishbone bus cycle for this peripheral
|
245 |
|
|
when high. \\\hline
|
246 |
|
|
i\_wb\_we & 1 & Input & Write enable, allows configuring the part.
|
247 |
|
|
\\\hline
|
248 |
|
|
i\_wb\_addr & 1 & Input & A single address line, set to zero to access the
|
249 |
|
|
configuration and control regiseter, to one to access the data
|
250 |
|
|
register. \\\hline
|
251 |
|
|
i\_wb\_data & 32 & Input & Data used when writing to the control register,
|
252 |
|
|
ignored otherwise. \\\hline
|
253 |
|
|
o\_wb\_ack & 1 & Output & Wishbone acknowledgement. This line will go high
|
254 |
|
|
on the clock after any wishbone access, as long as the wishbone
|
255 |
|
|
{\tt i\_wb\_cyc} line remains high (i.e., no ack's if you
|
256 |
|
|
terminate the cycle early).
|
257 |
|
|
\\\hline
|
258 |
|
|
o\_wb\_stall & 1 & Output & Required by the wishbone spec, but always set to
|
259 |
|
|
zero in this implementation.
|
260 |
|
|
\\\hline
|
261 |
|
|
o\_wb\_data & 32 & Output & Values read, either control or data, headed back
|
262 |
|
|
to the wishbone bus.
|
263 |
|
|
\\\hline
|
264 |
|
|
\end{portlist}
|
265 |
|
|
\caption{List of IO ports}\label{tbl:ioports}
|
266 |
|
|
\end{center}\end{table}
|
267 |
|
|
% Appendices
|
268 |
|
|
% Index
|
269 |
|
|
\end{document}
|
270 |
|
|
|
271 |
|
|
|