A METHOD AND APPARATUS FOR HIGH PRECISION TIME STAMPING
20220303036 · 2022-09-22
Inventors
Cpc classification
H04J3/0685
ELECTRICITY
International classification
Abstract
Disclosed is a method of determining time in a digital processing system, comprising, in a present cycle of a first digital clock: accessing a reference time counter for a reference digital clock, wherein the reference time counter increments in value by a fixed amount at every cycle of the reference digital clock, the reference digital clock being of a higher accuracy than the first digital clock; accessing a first time counter for the first digital clock, wherein the first time counter increments in value by an updatable increment amount at each cycle of the first digital clock; and comparing at least one part of the reference time counter with at least one corresponding part of the first time counter. Based on the comparing, an adjustment is made to one or more attributes of the first time counter, so that first time counter at least approximates the reference time counter.
Claims
1. A method of determining time in a digital processing system, comprising, in a present cycle of a first digital clock: accessing a reference time counter for a reference digital clock, wherein the reference time counter increments in value by a fixed amount at every cycle of the reference digital clock, the reference digital clock being of a higher accuracy than the first digital clock; accessing a first time counter for the first digital clock, wherein the first time counter increments in value by an updatable increment amount at each cycle of the first digital clock; comparing at least one part of the reference time counter with at least one corresponding part of the first time counter; and if there is a discrepancy between the at least one part of the reference time counter and the at least one corresponding part of the first time counter, adjusting one or more attributes of the first time counter, so that first time counter at least approximates the reference time counter; wherein a time at the present cycle of the first digital clock is calculated from the first time counter.
2. The method of claim 1, wherein the at least one part of the reference time counter is one digital bit in the reference time counter, and the at least one corresponding part of the first time counter is a corresponding digital bit in the first time counter.
3. The method of claim 1, wherein the first time counter comprises an integral component and a fractional component.
4. The method of claim 3, wherein the at least one corresponding part of the first time counter is in the integral component of the first time counter.
5. The method of claim 1, wherein the one or more attributes comprises a present value of the first time counter.
6. The method of claim 5, wherein the present value of the first time counter is adjusted by being set to a present value of the reference time counter.
7. The method of claim 5, wherein the present value of the first time counter is adjusted by adding thereto or subtracting therefrom a predetermined value.
8. The method of claim 7, further comprising: comparing the present value associated with the reference time counter, with a previous value which is associated with the reference time counter and obtained in a previous cycle of the first time counter, wherein: if the present and previous values of the reference time counter are equal, the present value of the first time counter is decreased by the predetermined value; and if the present and previous values of the reference time counter are not equal, the present value of the first time counter is increased by the predetermined value.
9. (canceled)
10. The method of claim 1, wherein the one or more attributes comprise a variable increment amount by which the first time counter increments in value at each cycle of the first digital clock.
11. The method of claim 10, wherein adjusting the one or more attributes of the first time counter comprises updating the variable increment amount to provide an updated increment amount, to be added to a second time counter at a future cycle of the first digital clock.
12. The method of claim 11, wherein the updated increment amount is calculated by determining an average number of reference digital clock cycles elapsed per first digital cycle, over a measurement period.
13. (canceled)
14. (canceled)
15. The method of claim 1, wherein the first and reference counters are compared at each cycle of the first digital clock.
16. The method of claim 1, and further comprising determining a time stamp for an event in a digital processing system using a time, at a cycle of the first digital clock during which the event is detected.
17. The method of claim 16, further comprising: obtaining timing correction data from one or more hardware components of the digital processing system; and adjusting a present value of the first time counter based on the timing correction data to provide a precision time stamp value.
18. (canceled)
19. (canceled)
20. An apparatus for determining time for an event in a digital processing system, comprising: a first time counter associated with a first digital clock, wherein a value of the first time counter increments by a variable increment amount per cycle of the first digital clock; and a second time counter associated with a second digital clock, wherein a value of the second time counter increments by a fixed increment amount per cycle of the second digital clock; wherein the second digital clock is more accurate than the first digital clock.
21. The apparatus of claim 20, further comprising a controller which controls a value of the first time counter at each cycle of the first digital clock, so that the value of the first time counter at least approximates a value of the second time counter obtained in the same cycle of the first digital clock.
22. The apparatus of claim 21, wherein the controller determines an increment amount for the first time counter, so that the first time counter tends to increment at the same rate as the second time counter.
23. The apparatus of claim 22, wherein the controller is adapted to determine whether the first and second time counters have different values.
24. The apparatus of claim 23, wherein the controller determines whether the first and second time counters have different values at each cycle of the first digital clock.
25. The apparatus of claim 23, wherein the controller samples one bit of the second time counter and compares a simple bit of the second time counter with a corresponding bit of the first time counter.
26. (canceled)
27. (canceled)
28. The apparatus of claim 23, wherein the first time counter is set to have the same value as the second time counter, when the controller determines that the first and second time counters have different values.
29. The apparatus of claim 23, wherein the value of first time counter is increased or decreased by a pre-determined amount when the controller determines that the first and second time counters have different values.
30. The apparatus of claim 21, wherein the controller determines whether a present value of the second time counter obtained at a present cycle of the first digital clock differs from a previous value of the second time counter obtained at a previous cycle of the first digital clock.
31. The apparatus of claim 30, wherein the variable increment amount is updated when the controller determines that the present and previous values of the second time counter differ.
32. The apparatus of claim 31, wherein the variable increment amount is calculated over a measurement period and applied to the second time counter until it is again calculated over another measurement period.
33. (canceled)
34. The apparatus of claim 31, wherein the variable increment amount is updated by increasing or decreasing it by a predetermined value.
35. The apparatus of claim 31, further comprising a circuit component which determines an updated increment amount and updates the variable increment amount by the updated increment amount.
36. (canceled)
37. (canceled)
38. The apparatus of claim 20, further comprising a time adjustment component configured to receive timing correction data from one or more hardware components of the digital processing system and adjust the first time counter based on the timing correction data, to provide a precision time stamp value.
39. A method for obtaining high precision time information, comprising: obtaining or accessing a first time counter for a first digital clock which is incremented by a variable increment amount at each cycle of the first digital clock; and obtaining or accessing a second time counter for a second digital clock which is incremented by a fixed amount at each cycle of the second digital clock, the second digital clock being of a higher precision than the first digital clock; wherein the first time counter is adjusted so that it at least tends towards the second time counter.
40. (canceled)
Description
BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Embodiments will now be described by way of example only, with reference to the accompanying drawings in which
[0055]
[0056]
[0057]
[0058]
[0059]
[0060]
[0061]
DETAILED DESCRIPTION
[0062] In the following detailed description, reference is made to accompanying drawings which form a part of the detailed description. The illustrative embodiments described in the detailed description, depicted in the drawings and defined in the claims, are not intended to be limiting. Other embodiments may be utilised and other changes may be made without departing from the spirit or scope of the subject matter presented. It will be readily understood that the aspects of the present disclosure, as generally described herein and illustrated in the drawings can be arranged, substituted, combined, separated and designed in a wide variety of different configurations, all of which are contemplated in this disclosure.
[0063] In the following, there is disclosed a novel method and system for high precision time-stamping.
[0064] In most cases, are two clock domains are involved in the receipt, subsequent decoding if necessary, and then the time-stamping of, a network event (such as an incoming message). These include the reference clock domain and the network clock domain. The reference clock domain is a highly stable clock, typically from a temperature-controlled oscillator (OCXO) or atomic clock, that can be assumed to be the absolute source of time. The network clock is a lower quality clock that has been recovered from the data incoming from the network.
[0065] When the reference clock and network clock run at a similar frequency, the precise time of a network event (such as a received bit of information) can be calculated by first determining the offset of the event from the network clock edge, and then determining the offset of the network clock edge from the reference clock edge. Embodiments of this approach are described in the Applicant's application PCT/AU2017/051120, the contents of which are incorporated herein.
[0066] However, in many cases the reference clock is a very different frequency: to provide a common example, we will consider a reference frequency of 10.000000 Mhz and a network clock frequency of approximately 161.1328125 Mhz (10 Gigabit Ethernet rate divided by 64 bits per cycle). One approach would be to multiply the reference clock to the desired frequency using a Phase Locked Loop. A downside of this approach is that the PLL uses additional power and area.
[0067]
[0068] The SIPO component 120 converts the high-speed serial data to a parallel bus at a lower frequency that can be more readily processed. The gearbox 130, if included, converts the data width to a more natural size for the protocol. The receiver serial clock is divided by clock divider 115 and the receiver parallel clock signal is used to synchronise the digital receiver components. An additional reference clock 170 may be used by the time stamp counter 160 to input to the time stamp unit 180 which applies the time and data stamp to the signal data 190 passed on to the downstream processing system.
[0069] Previous approaches for improving the type of architecture shown in
[0070] The present invention uses a different approach. As shown in
[0071] The network clock domain receives information from a network clock 220, which can run at a much higher frequency than the reference clock 210, but is of a lower accuracy compared to the reference clock 210. That is, the time information provided reference clock 210 is closer to or is considered the “ground truth” time, where as the time provided by the network domain clock 220 is less precise.
[0072] The reference time counter 205 is incremented by a fixed amount (e.g. 1), whereas the network time counter 215 is incremented by a variable amount “delta” (A), where A is influenced by the more accurate reference clock 210, so as to synchronise the network time counter 215 with the reference time counter 205.
[0073] A controller 305 takes the input from the network time counter 215, which has a better granularity because of the higher frequency of the network clock 220, but as mentioned above, at the same time the network time counter 215 is adjusted so that it can match or synchronise with, as much as possible, the “ground truth” time provided by the reference clock 210. This is done by adjusting one or more attributes of the network time counter 215. The controller 305 provides the synchronised network domain time counter 215 to the time stamp unit 225, to produce an adjusted timestamp 230, which is then provided with the event data tor downstream processes 235. The controller 305 can be hardware implemented. For instance it can be a circuit, which may comprise logic gates (e.g., field programmable gate array).
[0074] The synchronisation between the network time counter 215 and the reference time counter 205 comprises two aspects. First, the amount by which the network time counter 215 increments (with each network clock cycle), i.e., A, is adjusted so that the network time counter 215 is incremented at the same rate as the reference time counter. Second, the actual value of the network time counter 215 is adjusted so that there is not an offset between the network time counter 215 and the reference time counter 205, when the network time counter 215 is incremented at the correct rate. Depending on the embodiment, either or both of these aspects are included in the control for the network time counter 215.
[0075] Referring to
[0076] The controller 305 operates in the network clock domain, with the aim to synchronise the integral portion 310 of the network time counter 215 with the reference time counter, and the aim that the increment approximates the period of the network clock (as a fraction of the reference clock).
[0077] To adjust the increment amount 4, and hence the rate by which the network time counter 215 is incremented, the controller 305 can include steps to adjust the value of increment amount at each network clock cycle. The controller 305 can also or instead include steps to, over a period of time (or over a predetermined number of network clock cycles), directly measure the increment amount 4 that is to be added to the network time counter 215 at each network clock cycle.
[0078] To correct for the offset between the value of the network time counter 215 and that of the reference time counter 205, the controller 305 can also adjust the actual network time counter 215 value. The controller 305 can, additionally or alternatively, force or set the network time counter 215 to have the same value as the reference time counter 205.
[0079] Specifically, the controller 305 operates by sampling one bit 320 of the reference time counter 205. This bit will be compared with the corresponding bit 325 in the integral component 310 of the network time counter 215. Thus the integral component 310 of the network time counter 215 and the reference time counter 205 have the same number of bits. In an embodiment, the bottom bit of the reference time counter 205 is sampled, but another bit can be chosen in another embodiment. Because the reference clock edge (rising or falling, depending on the embodiment) and also the network clock edge take time to propagate through a circuit, the phase offset will be different at different points in the circuit. By using only a single bit, this provides a single point at which the phase offset is measured, thus avoiding this problem. Using a single bit also avoids synchronization problems that arise when transferring bits between clock domains.
[0080] The sampled bit 320 of the reference time counter 205 is compared with the corresponding bit 325 of the network time counter 215. This comparison is performed by the controller 305, to determine if the two bits 320, 325 have the same value or different values, and accordingly adjust the increment amount (Δ)330 by which to change the network time counter 215 (and hence the network domain time stamp). Δ will initially be a pre-programmed value, and will be adjusted from the pre-programmed value.
[0081] In some embodiments, the controller 305 adds the existing (i.e. present) value of the increment amount Δ to the network time counter 215. The updated value for Δ will be added to the network time counter 215 at the next network clock cycle. In other embodiments, the controller 305 determines the updated value for the increment amount 330 (which will either be the same as the present value or adjusted from the present value), and then adds the updated value to the network time counter 215.
[0082] In one embodiment, the determination of how the network time counter 215 is adjusted, is made in the control loop 400 depicted in
[0083] Next, the controller 305 compares the value of the sampled bit 320 in the reference time counter 205, with the previous value of the same bit, i.e., the value of the same bit obtained at the previous network clock rising edge (step 414). In the case that the bottom bit (i.e. trailing bit) of the reference time counter 205 is sampled, equal (that is, unchanged) values of the bottom bit would indicate that the reference domain clock 210 is still in the same cycle even though the network domain clock 220 has progressed to the next cycle. Therefore, if the sampled bit of the reference time counter 205 has not changed value (arrow 416), the controller 305 will decrease the increment amount for the fractional component 315 of the network time counter 215 (i.e. A is decreased).
[0084] Conversely, unequal values (that is, changed value) of the bottom bit of indicate that the reference domain clock 210 has also progressed to the next cycle. Therefore, if the sampled bit of the reference time counter 205 has changed in value since the previous rising edge of the network clock (arrow 418), the controller 305 will increase the amount by which the value of the fractional component 315 increments (i.e. A is increased).
[0085] In the above, the amounts by which A is adjusted (i.e. increased or decreased) is, in a typical embodiment, the smallest possible digital value fraction for the fractional component 315 of the network time counter 215. The exact value by which A is adjusted is not an essential requirement in the presently disclosed invention. The skilled addressee will be able to determine, e.g. by using control theory or by setting a small number (such as 0.001) and fine tuning therefrom, the desired amount by which A is to be adjusted.
[0086] In another embodiment, the network time counter 215 is determined in the control loop 500 depicted in
[0087] If the values of the corresponding bits are not equal (arrow 510), the controller 305 compares the current values of the particular bit with its previous value, i.e., the value of the same bit which is captured at the previous network clock rising edge (step 512), to see if this bit has changed in value. If the current and the previous values are equal (arrow 514), the controller 305 subtracts a constant from the value of the network domain time stamp (step 518). If the current and the previous values are not equal (arrow 516), the controller 305 adds a constant from the value of the network domain time stamp (step 520). The constant is a predetermined amount, usually a small fractional value.
[0088] Steps 518 and 520 directly adjusts an offset between the reference time counter 205 and the network time counter 215, as opposed to adjusting the rate at which the network time counter 215 is incremented. The controller 305 in some forms of the embodiment may further adjust the present value of the increment amount (A) itself to produce an updated value for the increment amount A, so that at a later network clock cycle, the network time counter 215 is incremented by the updated value A.
[0089] In one example, the period of the network clock 220 is approximated by setting a measurement time period. The measurement time period is a fixed amount of time, or it is a fixed number of network clock cycles. The number of reference clock cycles in this measurement time period is counted, e.g., by reading the reference time counter at the beginning and again at end of that measurement time period, and taking the difference in the two readings. The number of reference clock cycles, divided by the number of network clock cycles during the measurement time period, is the updated value for the increment amount A.
[0090] Thus, to incorporate the above step of updating the value of the increment amount A, the controller 305 will regularly or as prompted by another network process, initiate a measurement period, and thereafter wait for the next rising edge of the network clock 210 (step 502) and then continue as described above in relation to steps 504, 506, and 512. After the network time counter 215 is adjusted by adding a constant (step 520) or by subtracting a constant (step 518), the controller 305 further checks whether the measurement period has ended (step 522). If the measurement period has not ended (arrow 524), the value of the increment value A is not updated, and the controller keeps waiting for the next network clock cycle (step 502). If on the other hand the measurement period has elapsed (arrow 526), the controller 305 determines the updated value for the increment amount A. The updated value is the number of reference clock cycles within the measurement period divided by the number of network clock cycles within the measurement period. The measurement period will then be reset. The next measurement period will follow immediately, after a predetermined amount of time or predetermined number of network clock cycles or reference clock cycles, or upon activation by the user or a network administrator.
[0091]
[0092] From step 612, the controller 305 will check whether it should update the value of the increment amount A. It does so by first checking whether the measurement period mentioned above in respect of
[0093]
[0094] Unlike the embodiment shown in
[0095] In
[0096] In the above embodiments, the network time counter 215 is progressing at a high frequency, in the sense that its value is being determined at a frequency that is determined by the high frequency of the network domain clock 210. However, each time this determination is made, it is made with reference to the more accurate network domain clock 220.
[0097] In the embodiments shown in
[0098] In the embodiment shown in
[0099] Generally, the embodiments shown in
[0100] The value of the network time counter 215, as determined in one of the embodiments described above, will thus be synchronised with the reference time counter in one or more aspects as described. The time stamp can then be determined using the more accurate time information from the reference clock.
[0101] Thus, when a network event is detected to occur, the event time can be more accurately determined. The event time can be even more accurately determined, by, e.g. taking into account the offset of the detected event from the network clock edge, or the delay times which arise in the digital processes in the network architecture, to further adjust the event time. These further adjustments specific to the event and the delay in processing the event data are described in the herein incorporated application, PCT/AU2017/051120.
[0102] Variations and modifications may be made to the parts previously described without departing from the spirit or ambit of the disclosure.
[0103] For example, the controller 305 can compare the two time counters 205, 215 at each falling edge of the network clock 210 and make the adjustments to the increment value A or the network domain counter's fractional component 315, rather than at every rising edge.
[0104] In the embodiments shown in
[0105] As another example, the controller 305 can be provided as part of the network side time stamp unit, or it can be provided in a module which is separate to the network side time stamp unit.
[0106] While the control paradigm 400, 500 can be considered a control “loop” which occurs at each rising (or falling) network clock edge, the controller 305 is not necessarily implemented as a loop. The circuit implementation can be determined by the person skilled in the art.
[0107] In
[0108] The novel method disclosed herein may use less area or power and/or provide better time stamping precision in some cases, particularly when the reference clock frequency is unrelated to the network clock domain.
[0109] In summary, disclosed is a method of determining time in a digital processing system, comprising, in a present cycle of a first digital clock: accessing a reference time counter for a reference digital clock, wherein the reference time counter increments in value by a fixed amount at every cycle of the reference digital clock, the reference digital clock being of a higher accuracy than the first digital clock; accessing a first time counter for the first digital clock, wherein the first time counter increments in value by an updatable increment amount at each cycle of the first digital clock; and comparing at least one part of the reference time counter with a at least one corresponding part of the first time counter. If there is a discrepancy between the at least one part of the reference time counter and the at least one corresponding part of the first time counter, the method comprises adjusting one or more attributes of the first time counter, so that first time counter at least approximates the reference time counter. A time at the present cycle of the first digital clock is calculated from the first time counter.
[0110] In the claims which follow and in the preceding description of the invention, except where the context requires otherwise due to express language or necessary implication, the word “comprise” or variations such as “comprises” or “comprising” is used in an inclusive sense, i.e. to specify the presence of the stated features but not to preclude the presence or addition of further features in various embodiments of the invention.