SA6CID wrote: >.... >So, I thought actually of the jitter added on the way between our >accurate source (GPS rx), until we can capture our timer. How much can >this be? As far as I see we don't have a capture mode for the HPET. But, >if we have to do it in software, we get more than 100 ns jitter. I just >measured 60-80 ns for a instruction cache miss, with Intels mlc software. >Overall I would guess > 500 ns, are there measurements on this?
>This then defines some lower bound of what can be archived for >synchronizing the clock off the OS. Also hardware time stamping on a >dedicated PPS card (or PTP ethernet card) does not help unless the clock >on the card is synchronized to the clock used by the OS. >.... On Intel processors newer than the core2 it appears that there are no input pins that can be polled or used as an interrupt source. Current AMD processors still have LINT0 and LINT1 pins that can be polled through the XAPIC interface, but using them would require modifying the motherboard to temporarily disconnect them from their usual sources. It seems likely that a transition on those pins could be timestamped within a few tens of ns. An option for Linux kernel 4.6 or newer on Skylake processors when using PTP on the chipset ethernet would be to use the PTP_SYS_OFFSET_PRECISE ioctl to eliminate the problem you mentioned in the quoted text. See https://patchwork.kernel.org/patch/8497611/ https://patchwork.kernel.org/patch/8497621/ https://lwn.net/Articles/670081/ It looks like the chipset and CPU share an "Always Running Timer" which the chipset can sample in sync with the ethernet PTP, USB[2] and audio timing registers, and it has a defined relationship to the CPU TSC. I didn't spot a way to timestamp a GPIO pin transition in the chipset datasheet, so this sort of kicks the can down the road when using PTP. It might be possible to use this to improve PPS over USB. Skylake chipsets have three 16550-compatible UARTS, so depending on how they are connected internally (might be on the LPC bus) the line status signals may have very low read latency. It looks like they are supported in Linux 4.3 and newer; has anyone tested them? For now I've focused on using parallel port cards for PPS capture. The machine I'm using has a Q67 chipset and i5-2500 processor (the Q67 is one of the last chipsets with native parallel PCI). There is no option in the BIOS to disable clock spread-spectrum so it's probably active. The system XO was replaced with an IDT525 so I can use 10MHz sources. I added a polling mode and PPS echo to the Linux 4.1 pps_parport driver. Using a Lava parallel PCI card, port reads and writes take an average of 962ns when done in a calibration loop with the processor TSC. For measurements I'm using a TIC hooked to the PPS input and echo output, and Miroslav Lichavar's ppsallan program[3]. The counter I'm using only has GPIB and I don't yet have an interface card, so I can only do short tests with it at the moment since I have to watch it. I've listed some results below with a test time of 1 minute. The system oscillator and PPS source is an Endrun Technologies Praecis Cf, so all the data below should be showing only the PPS capture error. --Driver in polling mode with no system load: The minimum observed interval between the PPS input and echo was 1.3us, maximum interval was 2.3us, eyeball-average 1.9us, and the 1t adev was 513ns. attachment: adev-praecis-lavanew-poll-noload-1min-04.plog --Driver in polling mode with high system load: min 1.3us, max 2.4us, avg 1.9us, 1t adev 549ns adev-praecis-lavanew-poll-load-1min-01.plog --Driver in interrupt mode with no system load: min 2.4us, max 3.1us, avg 2.7us, 1t adev 467ns adev-praecis-lavanew-int-noload-1min-01.plog --Driver in interrupt mode with high system load: min 2.4us, max 4.1us avg 2.8us, 1t adev 533ns adev-praecis-lavanew-int-load-1min-01.plog After subtracting the echo's port write time, polling mode can go below 400ns delay. This is below the 962ns read time, but is probably valid since the PPS edge could occur between when the card has decoded the read command and when it samples the port pins to place on the bus. 962ns latency seems very high for parallel PCI -- it should be able to achieve below 300ns. The lava card may be using wait cycles to throttle down to standard LPT speeds. The card uses an FPGA so it might be possible to improve its performance. It's also likely the processor-to-chipset link is adding significant latency. I also tested a PCIe parallel card that uses an OXPCIe952 chip. When attached to a PCH PCIe lane, read time was 1614ns and write time was 1626ns. Minimum obverved PPS echo delay was 1.9us when polling. When attached to a CPU lane, input&output time was 832ns. Over a 1-minute test in polling mode with no system load I observed a min. echo delay of 1.1us, max of 2.0us, average 1.6us adev-praecis-pciecpu-poll-noload-1min-01.plog 24-hours with no system load : adev-praecis-pciecpu-poll-noload-24h-01.plog I'll show some longer-term results from the counter once I get a GPIB card and write a logging program. [1] "Motivating Future Interconnects: A Differential Measurement Analysis of PCI Latency", Miller 2009 [2] 100-series-chipset-datasheet-vol-2.pdf section 18.2.83 [3] https://github.com/mlichvar/ppsallan
1 5.131523e-07 2 3.003817e-07 3 1.495022e-07 4 1.325977e-07 5 1.146199e-07 6 8.925670e-08 7 6.846168e-08 8 7.119547e-08 9 6.244324e-08 10 5.575237e-08 11 5.358464e-08 12 4.353758e-08 13 4.008664e-08 14 3.641291e-08 15 3.915471e-08 16 3.158741e-08 17 3.256183e-08 18 2.715190e-08 19 2.368019e-08 20 2.792263e-08
1 5.490315e-07 2 2.558903e-07 3 1.621170e-07 4 1.403059e-07 5 1.091003e-07 6 1.010472e-07 7 7.648958e-08 8 6.917703e-08 9 5.800176e-08 10 4.811617e-08 11 4.572611e-08 12 4.399791e-08 13 4.733521e-08 14 3.573640e-08 15 3.561330e-08 16 3.361808e-08 17 3.062916e-08 18 3.277479e-08 19 2.765465e-08 20 2.822886e-08
1 4.674477e-07 2 2.619136e-07 3 1.150210e-07 4 1.003796e-07 5 1.183005e-07 6 6.961220e-08 7 4.240854e-08 8 6.505765e-08 9 5.483422e-08 10 2.660889e-08 11 4.494864e-08 12 4.711499e-08 13 3.242710e-08 14 3.313677e-08 15 4.141250e-08 16 2.997846e-08 17 2.084596e-08 18 3.070363e-08 19 2.809733e-08 20 1.715949e-08
1 5.334596e-07 2 2.684370e-07 3 1.309004e-07 4 1.106486e-07 5 1.110092e-07 6 7.650308e-08 7 5.280246e-08 8 6.406923e-08 9 5.800195e-08 10 2.584037e-08 11 4.432707e-08 12 4.633839e-08 13 2.593430e-08 14 3.092057e-08 15 3.759244e-08 16 3.282915e-08 17 2.474659e-08 18 3.074465e-08 19 2.936978e-08 20 1.820604e-08
1 4.179668e-07 2 2.232419e-07 3 1.336701e-07 4 9.880738e-08 5 1.170319e-07 6 6.636173e-08 7 5.433969e-08 8 5.343639e-08 9 4.432094e-08 10 2.657573e-08 11 3.805454e-08 12 3.449389e-08 13 2.954138e-08 14 2.895681e-08 15 3.510315e-08 16 2.503389e-08 17 2.304845e-08 18 2.521735e-08 19 1.855160e-08 20 1.441521e-08
1 4.125106e-07 2 2.113344e-07 3 1.410809e-07 4 1.040744e-07 5 8.468242e-08 6 6.963067e-08 7 6.037577e-08 8 5.217735e-08 9 4.651747e-08 10 4.220586e-08 11 3.825767e-08 12 3.522220e-08 13 3.241933e-08 14 2.992990e-08 15 2.838129e-08 16 2.634920e-08 17 2.454170e-08 18 2.325784e-08 19 2.208636e-08 20 2.069886e-08 21 1.990012e-08 22 1.897164e-08 23 1.817062e-08 24 1.748477e-08 25 1.684410e-08 26 1.609020e-08 28 1.498051e-08 29 1.447901e-08 30 1.394538e-08 32 1.319068e-08 34 1.236524e-08 35 1.202811e-08 37 1.134474e-08 39 1.072591e-08 41 1.021890e-08 43 9.737264e-09 45 9.313501e-09 47 8.918021e-09 50 8.386799e-09 52 8.087672e-09 55 7.667343e-09 57 7.364722e-09 60 6.999207e-09 63 6.683981e-09 66 6.324339e-09 70 5.993511e-09 73 5.744584e-09 77 5.470566e-09 81 5.177119e-09 85 4.912698e-09 89 4.692292e-09 93 4.508384e-09 98 4.281313e-09 103 4.082111e-09 108 3.876563e-09 114 3.677142e-09 119 3.539900e-09 125 3.362647e-09 132 3.166400e-09 138 3.038825e-09 145 2.904290e-09 152 2.751747e-09 160 2.621765e-09 168 2.500582e-09 176 2.385769e-09 185 2.266454e-09 194 2.158364e-09 204 2.051264e-09 214 1.968589e-09 225 1.868239e-09 236 1.782771e-09 248 1.686400e-09 260 1.610053e-09 273 1.529941e-09 287 1.456705e-09 301 1.394077e-09 316 1.326222e-09 332 1.263310e-09 349 1.196252e-09 366 1.149154e-09 385 1.090274e-09 404 1.035853e-09 424 9.853283e-10 445 9.426540e-10 468 8.928879e-10 491 8.513920e-10 516 8.128931e-10 541 7.798190e-10 568 7.382322e-10 597 7.015088e-10 627 6.721704e-10 658 6.383759e-10 691 6.079085e-10 725 5.766714e-10 762 5.521325e-10 800 5.224431e-10 840 4.996151e-10 882 4.744899e-10 926 4.503216e-10 972 4.301413e-10 1021 4.117559e-10 1072 3.913043e-10 1125 3.721708e-10 1182 3.552982e-10 1241 3.359874e-10 1303 3.209181e-10 1368 3.055321e-10 1436 2.899680e-10 1508 2.786238e-10 1583 2.667205e-10 1663 2.535070e-10 1746 2.395827e-10 1833 2.289177e-10 1925 2.174776e-10 2021 2.084630e-10 2122 1.973732e-10 2228 1.879202e-10 2339 1.796674e-10 2456 1.708182e-10 2579 1.633726e-10 2708 1.555611e-10 2844 1.480056e-10 2986 1.402405e-10 3135 1.344444e-10 3292 1.272526e-10 3456 1.210737e-10 3629 1.150255e-10 3811 1.099642e-10 4001 1.052434e-10 4201 9.993113e-11 4411 9.511385e-11 4632 9.044609e-11 4863 8.641327e-11 5107 8.213197e-11 5362 7.834680e-11 5630 7.461104e-11 5911 7.085077e-11 6207 6.785506e-11 6517 6.457819e-11 6843 6.120268e-11 7185 5.853501e-11 7545 5.568287e-11 7922 5.280514e-11 8318 5.043646e-11 8734 4.848623e-11 9171 4.589323e-11 9629 4.376832e-11 10111 4.135030e-11 10616 3.950657e-11 11147 3.778661e-11 11704 3.573521e-11 12290 3.411630e-11 12904 3.249617e-11 13549 3.096168e-11 14227 2.955507e-11 14938 2.820784e-11 15685 2.689080e-11 16469 2.546538e-11 17293 2.427070e-11 18157 2.298513e-11 19065 2.197468e-11 20018 2.087403e-11 21019 1.998598e-11 22070 1.894444e-11 23174 1.817008e-11 24332 1.724824e-11 25549 1.637322e-11 26826 1.569310e-11 28168 1.487873e-11
_______________________________________________ time-nuts mailing list -- [email protected] To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts and follow the instructions there.
