# US 2023/0273638 A1 · Clock Disciplining and Synchronizing

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2023/0273638 A1
- Document ID: US20230273638A1
- Status: Published application
- Kind: A1
- Application number: 17/681,194
- Filed: 2022-02-25
- Published: 2023-08-31
- Earliest claimed: 2022-02-25
- Assignees: FMAD Engineering (SNG) Pte. Ltd.
- Applicants: FMAD Engineering (SNG) Pte. Ltd.
- Inventors: Aaron Foo
- Web page: https://patentgrep.com/patent/US20230273638A1

## CPC

- G06F 1/08: Clock generators with changeable or programmable clock frequency
- G06F 1/12: Synchronisation of different clock signals {provided by a plurality of clock generators}
- G06F 1/04: Generating or distributing clock signals or signals derived directly therefrom
- G06F 1/14: Time supervision arrangements, e.g. real time clock
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

An embodiment may involve receiving a signal indicative of an edge of a reference clock, wherein the reference clock has a fixed clock period, wherein a hardware clock signal generator ticks at a variable clock period, and wherein a local time value is increased by a local time increment on ticks of the hardware clock signal generator; reading the local time value and writing it to a memory as a current time value; determining a difference between the current time value and a previous time value that was written to the memory in response to receiving a previous signal from the reference clock; based on the difference, determining an adjustment to the local time increment so that the local time value increases at a rate that is closer to that of the reference clock; and modifying the local time increment by the adjustment.

## Claims

### Claim 1

A method comprising:
receiving a signal indicative of an edge of a reference clock, wherein the reference clock has a fixed clock period, wherein a hardware clock signal generator ticks at a variable clock period, and wherein a local time value is increased by a local time increment on ticks of the hardware clock signal generator;
in response to receiving the signal, reading the local time value and writing it to a memory as a current time value;
determining a difference between the current time value and a previous time value that was written to the memory in response to receiving a previous signal from the reference clock, wherein the previous time value is based on a previous reading of the local time value;
based on the difference, determining an adjustment to the local time increment so that the local time value increases at a rate that is closer to that of the reference clock; and
modifying the local time increment by the adjustment.

### Claim 2 (depends on 1)

The method of claim 1, wherein the signal is a pulse-per-second (PPS) signal and the fixed clock period is one second.

### Claim 3 (depends on 1)

The method of claim 1, wherein receiving the signal causes an interrupt to trigger execution of a software or firmware routine that reads the local time value and writes the local time value to the memory.

### Claim 4 (depends on 1)

The method of claim 1, wherein the edge of the reference clock is a rising edge.

### Claim 5 (depends on 1)

The method of claim 1, further comprising:
receiving a further signal indicative of a further edge of the reference clock;
in response to receiving the further signal, reading the local time value and writing it to the memory as a further current time value;
determining a further difference between the further current time value and the current time value;
based on the further difference, determining a further adjustment to the local time increment so that the local time value increases at a further rate that is closer to that of the reference clock; and
modifying the local time increment by the further adjustment.

### Claim 6 (depends on 1)

The method of claim 1, wherein the difference is greater than the fixed clock period, and wherein the difference being greater than the fixed clock period causes the adjustment to be negative.

### Claim 7 (depends on 1)

The method of claim 1, wherein the difference is less than the fixed clock period, and wherein the difference being less than the fixed clock period causes the adjustment to be positive.

### Claim 8 (depends on 1)

The method of claim 1, wherein a magnitude of the adjustment is proportional to an absolute value of the difference.

### Claim 9 (depends on 1)

The method of claim 1, wherein determining the difference between the current time value and the previous time value comprises determining a smoothed difference based on the difference and a weighting factor, and wherein determining the adjustment to the local time increment is based on the smoothed difference.

### Claim 10 (depends on 9)

The method of claim 9, wherein the smoothed difference is based on an exponentially-weighted moving average that uses the weighting factor.

### Claim 11 (depends on 1)

The method of claim 1, further comprising:
generating a timestamp from the local time value.

### Claim 12 (depends on 11)

The method of claim 11, further comprising:
writing the timestamp to a network packet stored in the memory or to metadata associated with the network packet.

### Claim 13 (depends on 11)

The method of claim 11, further comprising:
reading, from the memory, a latest timestamp that is based on the local time value and a time offset;
determining a new time offset that would phase-synchronize the latest timestamp with the signal on a boundary defined by the fixed clock period;
setting the time offset to the new time offset; and
applying the time offset to the latest timestamp.

### Claim 14 (depends on 13)

The method of claim 13, wherein determining the new time offset comprises:
determining a delta value to apply to the time offset; and
determining a smoothed delta value based on the delta value and a weighting factor, wherein setting the time offset is caused by an absolute value of the delta value being less than an absolute value of the smoothed delta value multiplied by a scaling factor.

### Claim 15 (depends on 14)

The method of claim 14, wherein the smoothed delta value is based on an exponentially-weighted moving average that uses the weighting factor.

### Claim 16 (depends on 13)

The method of claim 13, further comprising:
in response to receiving the signal, writing the latest timestamp to the memory.

### Claim 17

A computing device comprising:
an interface configured to receive signals from a reference clock, wherein the reference clock has a fixed clock period;
a hardware clock signal generator that ticks at a variable clock period;
memory configured to store a local time value, wherein the local time value is increased by a local time increment on ticks of the hardware clock signal generator;
an integrated circuit containing a state machine configured to: (i) detect a signal from the reference clock, and (ii) in response to detecting the signal, read the local time value and store it as a current time value;
one or more processors configured to execute program instructions that cause the computing device to:
determine a difference between the current time value and a previous time value that was stored in response to receiving a previous signal from the reference clock, wherein the previous time value is based on a previous reading of the local time value;
based on the difference, determine an adjustment to the local time increment so that the local time value increases at a rate that is closer to that of the reference clock; and
modify the local time increment by the adjustment.

### Claim 18 (depends on 17)

The computing device of claim 17, wherein the difference is greater than the fixed clock period, and wherein the difference being greater than the fixed clock period causes the adjustment to be negative.

### Claim 19 (depends on 17)

The computing device of claim 17, wherein the difference is less than the fixed clock period, and wherein the difference being less than the fixed clock period causes the adjustment to be positive.

### Claim 20 (depends on 17)

The computing device of claim 17, wherein the program instructions further cause the computing device to:
read a latest timestamp that is based on the local time value and a time offset;
determine a new time offset that would phase-synchronize the latest timestamp with the signal on a boundary defined by the fixed clock period;
set the time offset to the new time offset; and
apply the time offset to the latest timestamp.
