annotate doc/PPS-catcher-FSM @ 58:95ed46b5f8f1 default tip

doc/Sniffing-hw-setup: mv-sniffer is here
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 04 Oct 2023 05:55:09 +0000
parents 1068f9fd41d5
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
34
c2fc75655937 doc/PPS-catcher-FSM: it has been implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 24
diff changeset
1 This document describes the PPS catcher state machine that has been implemented
48
1068f9fd41d5 doc: project rename
Mychaela Falconia <falcon@freecalypso.org>
parents: 34
diff changeset
2 in the FPGA part of FreeCalypso SIMsniff, using a sort of verbal pseudocode.
24
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 INITIAL:
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 This state will be entered upon reset (held in this state while RST is low).
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 Must receive 8'h3B to proceed to state T0, otherwise transition to DONE.
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 ATR_T0:
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 Whatever byte we receive in this state, we latch the upper nibble in the Y
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 register and the lower nibble in the K register - then proceed to TAn.
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 ATR_TAn:
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 Advance to TBn if Y register indicates no TAn OR we got a byte.
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 ATR_TBn:
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 Advance to TCn if Y register indicates no TBn OR we got a byte.
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 ATR_TCn:
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 Advance to TDn if Y register indicates no TCn OR we got a byte.
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 ATR_TDn:
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 If Y register indicates no TDn, advance to state ATR_HIST.
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 ELSE wait for byte; upon byte Rx, do the following:
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 - latch the upper nibble in the Y register;
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 - if lower nibble != 0, set TCK present flag;
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 - always go back to TAn.
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 ATR_HIST:
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 If K == 0, advance to state ATR_TCK.
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 ELSE wait for byte; upon byte Rx, decrement K and remain in this state.
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 ATR_TCK:
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44 Advance to READY_FOR_PPS if Have_TCK flag is false OR we got a byte.
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46 READY_FOR_PPS:
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48 Wait for Rx byte. If the byte equals 8'hFF, proceed to REQ_PPS0,
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
49 otherwise DONE.
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
50
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
51 REQ_PPS0:
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
53 Wait for Rx byte; latch 3 bits of the received byte and proceed to REQ_PPS1.
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
54
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
55 REQ_PPS1:
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
56
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
57 Advance to REQ_PPS2 if register indicates no PPS1 OR we got a byte.
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
58
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
59 REQ_PPS2:
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
60
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
61 Advance to REQ_PPS3 if register indicates no PPS2 OR we got a byte.
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
62
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
63 REQ_PPS3:
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
64
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
65 Advance to REQ_PCK if register indicates no PPS3 OR we got a byte.
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
66
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
67 REQ_PCK:
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
68
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
69 Wait for Rx byte; ignore the received value and go to READY_FOR_RESP.
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
70
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
71 READY_FOR_RESP:
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
72
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
73 Wait for Rx byte. If the byte equals 8'hFF, proceed to RESP_PPS0,
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
74 otherwise DONE.
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
75
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
76 RESP_PPS0:
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
77
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
78 Wait for Rx byte. If PPS1 indicator bit is cleared, go to DONE. Otherwise,
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
79 latch the 3 bits like in REQ_PPS0 and proceed to RESP_PPS1.
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
80
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
81 RESP_PPS1:
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
82
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
83 Wait for Rx byte. The upper 6 bits must match 6'b100101 - if mismatch, go to
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
84 DONE. If the upper bits match, latch the two lsbs - they will be the speed
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
85 enhancement multiplier bits - and proceed to RESP_PPS2.
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
86
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
87 RESP_PPS2:
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
88
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
89 Advance to RESP_PPS3 if register indicates no PPS2 OR we got a byte.
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
90
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
91 RESP_PPS3:
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
92
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
93 Advance to RESP_PCK if register indicates no PPS3 OR we got a byte.
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
94
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
95 RESP_PCK:
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
96
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
97 Wait for Rx byte. Upon getting this final byte, trigger the speed enhancement
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
98 switch and go to DONE.
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
99
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
100 DONE:
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
101
f1e7795557b1 doc/PPS-catcher-FSM: initial description
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
102 Final state, nothing more happens.