-
Notifications
You must be signed in to change notification settings - Fork 3
/
README.txt
352 lines (275 loc) · 11.1 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
######################################
Soundwire Analyzer for Saleae Logic UI
######################################
.. This is a ReStructured Text document
:Copyright:
Copyright(c) 2023 Cirrus Logic, Inc and
Cirrus Logic International Semiconductor Ltd. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
.. contents:: Table of Contents
*******
SUMMARY
*******
This is an analyzer plugin for the Saleae Logic UI version 2.x.
It allows decoding command and status from SoundWire buses.
Limitations
===========
- Only supports single data line (does not support multi-lane).
- BRA transactions are not decoded or reported.
- There must be at least 16 consecutive frames for the analyzer to
find frame sync.
- DP (dataport) data is not extracted or reported.
- Not compatible with Logic UI 1.x versions.
********
BUILDING
********
Build prerequisites:
- C++ compiler.
- cmake.
- an internet connection to fetch the Saleae SDK.
Windows
=======
- Install Visual C++
- Install cmake (https://cmake.org/download/)
The analyzer binary will be in SoundWireAnalyzer/Analyzers
Linux
=====
On a Debian-based system (such as Ubuntu) the prerequisites can normally
be installed using apt, something like::
sudo apt-get install build-essential cmake
To build the analyzer::
cd SoundWireAnalyzer
cmake .
cmake --build .
To build::
cd SoundWireAnalyzer
mkdir build
cd build
cmake ..
cmake --build .
or for a Release build::
cmake --build . --config=Release
The analyzer binary will be in SoundWireAnalyzer/Analyzers
**********
INSTALLING
**********
Saleae instructions are here:
https://support.saleae.com/faq/technical-faq/setting-up-developer-directory
**********
HOW TO USE
**********
Electrical considerations
=========================
The SoundWire bus is very sensitive to capacitive/inductive loading
and signal length. For best results it is recommended to:
- Keep the test lead length as short at possible
- Use inputs on the Saleae Logic as far apart as possible. For example
use channel 0 for SDW_CLOCK and channel 15 for SDW_DATA
- Ground the channels adjacent to the used channel. For example if channels
0 and 15 are used for SDW_CLOCK and SDW_DATA, ground channels 1 and 14.
- Connect as many of the ground wires as possible
- Ground unused channels.
The Saleae Pro8 and Pro16 use low-hysteresis comparator inputs, which
are described by Saleae here:
https://support.saleae.com/user-guide/supported-voltages#logic-pro-8-and-logic-pro-16
There may be some glitches on the capture as the logic level crosses the
comparator threshold. If the SoundWire analyzer does not decode the
capture, or reports a large number of sync loss or parity errors this
could be due to these glitches. The Logic UI glitch filter might be able
to remove the glitches. However, when the glitches are occurring on the
data line very close to the clock edge it is not always possible for the
glitch filter to identify what the correct state should be at the time
the clock edge occurs.
For example if the next data level should be 1, like this::
_________________
CLOCK ______________|
_______________________
DATA ________|
but glitches to 0 across the clock edge like this::
_________________
CLOCK ______________|
__ _______________
DATA _______| |____|
The first glitch is actually to the correct level and it is the longer
glitch that is to the incorrect level. If the glitch filter is set to
remove the shorter glitch it will give the wrong level at the clock
edge::
_________________
CLOCK ______________|
_______________
DATA _______________|
but if it is set to also remove the longer glitch this give the same
result that the data line is not reported as high until after the clock
edge.
It may be useful to put a Schmitt-triggered buffer between the
SoundWire bus and the Saleae Logic input to provide a faster edge.
Sampling rate
=============
Unlike many protocols the minimum sampling rate does not scale with
clock frequency. In other words, if you halve the SDW_CLOCK frequency
that does not mean that you can halve the Saleae sampling frequency.
The SoundWire specification allows the data line to change 4ns after
a clock edge. This is independent of SDW_CLOCK frequency. To correctly
distinguish that the data edge occurred after the clock edge would
require a sampling frequency of at least 250MS/s. (that is, one sample
every 4 ns).
It is recommended to always use a sample rate of 250MS/s or more. A
lower rate could lead to capturing an incorrect data line state at the
clock edge.
As a compensation against the small time window the SoundWire analyzer
takes the data line state from the sample *before* the clock edge. The
data line typically changes state soon after the clock edge and
therefore is stable in the sample before the clock edge. So for
example if the clock edge is seen at sample n, the data level is taken
from sample n-1::
Samples: |n-1| n |
_________ ______________
CLOCK |________________________|
________________________
DATA _______| |_____________
Analyzer settings
=================
SoundWire Clock
---------------
Set to the channel used to capture the SoundWire clock.
SoundWire Data
--------------
Set to the channel used to capture the SoundWire data.
Num Rows
--------
Set the number of rows in SoundWire frames. This should normally
be set to 'auto' and the analyzer will attempt to auto-detect the
number of rows per frame. Change this setting to a number to force
the analyzer to look for frames of a specific size.
Num Cols
--------
Set the number of columns in SoundWire frames. This should normally
be set to 'auto' and the analyzer will attempt to auto-detect the
number of columns per frame. Change this setting to a number to
force the analyzer to look for frames of a specific size.
Suppress duplicate pings in table
---------------------------------
If enabled a PING will only be added to the table view if it reports
a different status from the previous PING. The SoundWire specification
requires the Manager (bus controller) to send PING requests when it
does not have any read/write command to send. This leads to a huge
number of PINGs that are identical.
It is recommended to enable this.
Annotate decoded bit values
---------------------------
If enabled the data channel trace will be annoted with 0 and 1 to show
the NRZI-decoded data bit values.
This adds decoding time and memory overhead so it is recommended to
leave this disabled if not needed.
Annotate frame starts
---------------------
If enabled the clock channel trace will be annotated with a green dot
on the first clock edge of every frame.
This adds decoding time and memory overhead so it is recommended to
leave this disabled if not needed.
Annotate trace
--------------
Show annotation "bubbles" on the clock and data traces. These show
the PING status, read/write commands, parity errors and sync loss.
This adds decoding time and memory overhead so it is recommended to
leave this disabled if not needed. Generally the table view is more
useful than the trace annotations.
Show in protocol results table
------------------------------
Enable this to show decoded frames in the analyzer table view.
Stream to terminal
------------------
This option does nothing in the SoundWire analyzer but it always
displayed by the Logic UI.
********************
INTERPRETING RESULTS
********************
Clock annotation
================
If 'Annotate trace' is enabled an annotation "bubble" will be placed
above the clock trace.
The clock annotation shows the parity state and the control word
value (in hexadecimal). For example a normal frame will show something
like this about the clock::
Par: ok 200053b11aad
If the SSP bit is set on a frame the clock annotation will indicate
this::
SSP Par: ok 040000b10098
Data annotation
===============
If 'Annotate trace' is enabled an annotation "bubble" will be placed
above the data trace.
The data annotation shows a decode of control words. The meaning of
bits in a control word vary depending whether it is PING, read or write
command.
For PINGs the annotation shows the state reported by every SoundWire
peripheral ID. The states are shown as:
=========== =========
Status Shown as
----------- ---------
No response \-
Ok Ok
Alert Al
=========== =========
For read and write commands the annotation format is::
RD [DevId] @Address=Value RESPONSE
WR [DevId] @Address=Value RESPONSE
Where:
- RD/WR indicates whether it is a read or a write
- DevId is the SoundWire device ID of the target peripheral
- Address is the register address in hexadecimal
- Value is the register value in hexadecimal
- RESPONSE is decoded from the ACK/NAK bits to one of
OK, IGNORED or FAIL.
Table view
==========
Table view columns are:
============ =======
Column title Purpose
------------ -------
type Show frame type. One of:
- READ
- WRITE
- PING
- shape
- BUS RESET
- SYNC LOST
value Value of the command word
DevId Target Peripheral of read or write command
Reg Register address of read or write command
Data Register value of read or write command
ACK ACK bit state (true or false)
NAK NAK bit state (true or false)
Preq State of PREQ bit (true if any Peripheral asserted PREQ)
SSP SSP bit state (true or false). Only valid for PING.
Par Parity status (OK or BAD)
Dsync Dynamic sync word value
P0 to P15 Status reported by each Peripheral in a PING command.
One of OK or AL (AL = alert).
If the Peripheral did not respond the table cell will
be empty.
If the status bits were invalid the table cell will
show ??.
============ =======
The special frame 'type' are:
========= ===============
shape Indicates the frame shape detected by the analyzer.
The shape is shown as rows x columns.
BUS RESET Indicates that a sequence of 4096 logic '1' was detected.
SYNC LOST Indicates that the analyzer lost sync. This means:
- Dynamic sync word out-of-sequence
- Static sync word not correct
========= ===============
*****************
EXPORTING RESULTS
*****************
Use the "Export Table" option in Logic UI. This exports the table view
and allows selecting which data to export.