FreeCalypso > hg > fc-sim-sniff
annotate fpga/sniffer-pps/pps_catcher.v @ 57:eb4274e7f4da
simsniff-dec: decode SELECT file IDs
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 04 Oct 2023 03:54:00 +0000 |
parents | 0f74428c177c |
children |
rev | line source |
---|---|
28
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 * This Verilog module is our PPS catcher. It is a state machine that analyzes |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 * the stream of Rx characters from the primary sniffer and detects the |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 * positions of these two special chars: |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 * |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 * - the PPS1 byte of the card's PPS response; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 * - the PCK byte concluding that PPS response *if* PPS1 indicated a speed |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 * enhancement mode which we support. |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 */ |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 module pps_catcher (IntClk, SIM_RST_sync, Rx_strobe, Rx_char, |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 pos_PPS_resp_PPS1, pos_PPS_resp_PCK); |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 input IntClk; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 input SIM_RST_sync; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 input Rx_strobe; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 input [7:0] Rx_char; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 output pos_PPS_resp_PPS1, pos_PPS_resp_PCK; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 /* state machine */ |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 localparam |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 INITIAL = 5'h00, |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 ATR_T0 = 5'h01, |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 ATR_TAn = 5'h02, |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 ATR_TBn = 5'h03, |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 ATR_TCn = 5'h04, |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 ATR_TDn = 5'h05, |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 ATR_HIST = 5'h06, |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 ATR_TCK = 5'h07, |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 READY_FOR_PPS = 5'h08, |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 REQ_PPS0 = 5'h09, |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 REQ_PPS1 = 5'h0A, |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 REQ_PPS2 = 5'h0B, |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 REQ_PPS3 = 5'h0C, |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 REQ_PCK = 5'h0F, |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 READY_FOR_RESP = 5'h10, |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 RESP_PPS0 = 5'h11, |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 RESP_PPS1 = 5'h12, |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 RESP_PPS2 = 5'h13, |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 RESP_PPS3 = 5'h14, |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 RESP_PCK = 5'h17, |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 DONE = 5'h1F |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 ; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 reg [4:0] state; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 reg [3:0] Y, K; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 reg have_TCK; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 always @(posedge IntClk) |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 if (!SIM_RST_sync) |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 begin |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54 state <= INITIAL; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 have_TCK <= 1'b0; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 end |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 else case (state) |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58 INITIAL: |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
59 if (Rx_strobe) |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
60 begin |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
61 if (Rx_char == 8'h3B) |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62 state <= ATR_T0; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
63 else |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
64 state <= DONE; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
65 end |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
66 ATR_T0: |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
67 if (Rx_strobe) |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
68 begin |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
69 Y <= Rx_char[7:4]; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
70 K <= Rx_char[3:0]; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
71 state <= ATR_TAn; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
72 end |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
73 ATR_TAn: |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
74 if (!Y[0] || Rx_strobe) |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
75 state <= ATR_TBn; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
76 ATR_TBn: |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
77 if (!Y[1] || Rx_strobe) |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
78 state <= ATR_TCn; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
79 ATR_TCn: |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
80 if (!Y[2] || Rx_strobe) |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
81 state <= ATR_TDn; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
82 ATR_TDn: |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
83 if (!Y[3]) |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
84 state <= ATR_HIST; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
85 else if (Rx_strobe) |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
86 begin |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
87 Y <= Rx_char[7:4]; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
88 if (Rx_char[3:0] != 4'h0) |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
89 have_TCK <= 1'b1; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
90 state <= ATR_TAn; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
91 end |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
92 ATR_HIST: |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
93 if (K == 4'd0) |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
94 state <= ATR_TCK; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
95 else if (Rx_strobe) |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
96 K <= K - 4'd1; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
97 ATR_TCK: |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
98 if (!have_TCK || Rx_strobe) |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
99 state <= READY_FOR_PPS; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
100 READY_FOR_PPS: |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
101 if (Rx_strobe) |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
102 begin |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
103 if (Rx_char == 8'hFF) |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
104 state <= REQ_PPS0; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
105 else |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
106 state <= DONE; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
107 end |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
108 REQ_PPS0: |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
109 if (Rx_strobe) |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
110 begin |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
111 Y <= Rx_char[7:4]; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
112 state <= REQ_PPS1; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
113 end |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
114 REQ_PPS1: |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
115 if (!Y[0] || Rx_strobe) |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
116 state <= REQ_PPS2; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
117 REQ_PPS2: |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
118 if (!Y[1] || Rx_strobe) |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
119 state <= REQ_PPS3; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
120 REQ_PPS3: |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
121 if (!Y[2] || Rx_strobe) |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
122 state <= REQ_PCK; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
123 REQ_PCK: |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
124 if (Rx_strobe) |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
125 state <= READY_FOR_RESP; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
126 READY_FOR_RESP: |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
127 if (Rx_strobe) |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
128 begin |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
129 if (Rx_char == 8'hFF) |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
130 state <= RESP_PPS0; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
131 else |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
132 state <= DONE; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
133 end |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
134 RESP_PPS0: |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
135 if (Rx_strobe) |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
136 begin |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
137 Y <= Rx_char[7:4]; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
138 if (Rx_char[4]) |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
139 state <= RESP_PPS1; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
140 else |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
141 state <= DONE; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
142 end |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
143 RESP_PPS1: |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
144 if (Rx_strobe) |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
145 begin |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
146 if (Rx_char[7:2] == 6'b100101) |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
147 state <= RESP_PPS2; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
148 else |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
149 state <= DONE; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
150 end |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
151 RESP_PPS2: |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
152 if (!Y[1] || Rx_strobe) |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
153 state <= RESP_PPS3; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
154 RESP_PPS3: |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
155 if (!Y[2] || Rx_strobe) |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
156 state <= RESP_PCK; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
157 RESP_PCK: |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
158 if (Rx_strobe) |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
159 state <= DONE; |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
160 endcase |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
161 |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
162 assign pos_PPS_resp_PPS1 = (state == RESP_PPS1); |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
163 assign pos_PPS_resp_PCK = (state == RESP_PCK); |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
164 |
0f74428c177c
fpga/sniffer-pps: first version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
165 endmodule |