Dear CRU Team,
i have a few questions concerning the sending of the RST- and SYNC-Trigger in CTP emulator mode with the PatPlayer.
Before data taking i send the RST-trigger to the FECs via the PatPlayer. The command line is shown below
python ./patplayer.py -i 4:0.0 --idle 0xffffffffffff --sync 0xff0000fffff --reset 0xfffffff00000 --sync-length=32 --reset-length=32 --sync-delay=0 --trg-rst
According to the description, this should manually send the reset pattern via the GBT downlink to the FECs.
Next, i set up the PatPlayer to send the SYNC pattern:
python ./cru-sw/COMMON/patplayer.py -i 04:00.0 --idle 0xffffffffffff --sync 0xff0000fffff --reset 0xfffffff00000 --sync-length=32 --reset-length=32 --sync-delay=0 --sync-trg-sel 9
Since we use the CTP Emulator, it will create the SOT trigger (Bit 9). This is used as the input to the PatPlayer for sending the SYNC, “–sync-trg-sel 9”.
So far this seems to work, we can take data and we see the SYNC pattern in the data stream. However, the SYNCs are miss-aligned, not only by one clock cycle between links but also within a link (which contains 5 SYNC patterns from the 5 SAMPA streams per link). The only explanation for this is that the SAMPAs have not been reset before, so the data streams are miss-aligned. Below is the output from the decoder with the SYNC positions:
Links present
1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0
Processing data for link 0
Num packets : 248
4 : SYNC found at P : 0 F : 163 P : 2656 H : 2
0 : SYNC found at P : 0 F : 166 P : 2704 H : 3
1 : SYNC found at P : 0 F : 166 P : 2704 H : 3
2 : SYNC found at P : 0 F : 166 P : 2704 H : 1
3 : SYNC found at P : 0 F : 166 P : 2704 H : 1
Processing data for link 1
Num packets : 248
0 : SYNC found at P : 0 F : 163 P : 1018464 H : 3
1 : SYNC found at P : 0 F : 163 P : 1018464 H : 3
2 : SYNC found at P : 0 F : 164 P : 1018480 H : 3
3 : SYNC found at P : 0 F : 164 P : 1018480 H : 3
4 : SYNC found at P : 0 F : 165 P : 1018496 H : 3
Processing data for link 2
Num packets : 248
2 : SYNC found at P : 0 F : 161 P : 2034240 H : 2
3 : SYNC found at P : 0 F : 161 P : 2034240 H : 2
4 : SYNC found at P : 0 F : 161 P : 2034240 H : 2
0 : SYNC found at P : 0 F : 168 P : 2034352 H : 2
1 : SYNC found at P : 0 F : 168 P : 2034352 H : 2
Processing data for link 3
Num packets : 248
0 : SYNC found at P : 0 F : 162 P : 3050064 H : 1
1 : SYNC found at P : 0 F : 162 P : 3050064 H : 1
2 : SYNC found at P : 0 F : 162 P : 3050064 H : 1
3 : SYNC found at P : 0 F : 162 P : 3050064 H : 1
4 : SYNC found at P : 0 F : 162 P : 3050064 H : 1
Processing data for link 4
Num packets : 248
0 : SYNC found at P : 0 F : 168 P : 4065968 H : 1
1 : SYNC found at P : 0 F : 168 P : 4065968 H : 1
2 : SYNC found at P : 0 F : 168 P : 4065968 H : 1
3 : SYNC found at P : 0 F : 168 P : 4065968 H : 1
4 : SYNC found at P : 0 F : 168 P : 4065968 H : 1
Processing data for link 5
Num packets : 124
0 : SYNC found at P : 0 F : 162 P : 5081680 H : 1
1 : SYNC found at P : 0 F : 162 P : 5081680 H : 1
2 : SYNC found at P : 0 F : 162 P : 5081680 H : 2
3 : SYNC found at P : 0 F : 162 P : 5081680 H : 2
4 : SYNC found at P : 0 F : 162 P : 5081680 H : 1
Processing data for link 6
Num packets : 248
0 : SYNC found at P : 0 F : 166 P : 6097552 H : 1
1 : SYNC found at P : 0 F : 166 P : 6097552 H : 1
2 : SYNC found at P : 0 F : 166 P : 6097552 H : 1
3 : SYNC found at P : 0 F : 166 P : 6097552 H : 1
4 : SYNC found at P : 0 F : 166 P : 6097552 H : 1
Processing data for link 7
Num packets : 124
2 : SYNC found at P : 0 F : 160 P : 8129072 H : 3
3 : SYNC found at P : 0 F : 160 P : 8129072 H : 3
0 : SYNC found at P : 0 F : 161 P : 8129088 H : 1
1 : SYNC found at P : 0 F : 161 P : 8129088 H : 1
4 : SYNC found at P : 0 F : 161 P : 8129088 H : 1
Processing data for link 8
Num packets : 124
2 : SYNC found at P : 0 F : 164 P : 7113328 H : 1
3 : SYNC found at P : 0 F : 164 P : 7113328 H : 1
4 : SYNC found at P : 0 F : 164 P : 7113328 H : 3
0 : SYNC found at P : 0 F : 165 P : 7113344 H : 0
1 : SYNC found at P : 0 F : 165 P : 7113344 H : 0
Processing data for link 9
Num packets : 124
2 : SYNC found at P : 0 F : 163 P : 9144928 H : 1
3 : SYNC found at P : 0 F : 163 P : 9144928 H : 1
0 : SYNC found at P : 0 F : 164 P : 9144944 H : 1
1 : SYNC found at P : 0 F : 164 P : 9144944 H : 1
4 : SYNC found at P : 0 F : 164 P : 9144944 H : 1
The interesting columns are the “F - Frame” and the “H - Halfword”. It indicates for each stream the position of the SYNC, so in which frame and where in the frame the SYNC was found. The deviation in the frame position between different links could vary, due to some latency differences in the upstream path. However, they are quite large. But i also see a deviation within a link in both, the frame and the half-word. This means the SAMPAs have not been reset (aligned) before.
What i am missing? Do i use the PatPlayer correctly for sending the reset manually?
Cheers,
Torsten