Global clock synchronization transmission method
The master device only sends high-bit count data packets, allowing the slave device to calculate and compare the global count data by itself, which solves the problems of large data transmission volume and high power consumption in the clock synchronization method in the existing technology, and achieves effective operation under small data volume. clock synchronization and low power consumption.
Patent Information
- Application Number
- CN202010066410.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-01-20
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2040-01-20
AI Technical Summary
The existing global clock synchronization method requires the master device to send a complete clock count data packet, resulting in a large amount of data transmission and high power consumption. When reducing the number of data transmissions, it may lead to an increase in clock synchronization errors, making it difficult to achieve effective synchronization with a small amount of data.
The master device only sends high-bit count data packets to the slave device. The slave device calculates the low-bit count data and compares all count data to determine whether clock synchronization is achieved, thereby reducing the amount of data sent and power consumption.
It achieves clock synchronization under a small amount of data transmission, reduces data communication power consumption, and maintains clock count synchronization between the master device and the slave device within the allowable error range.
Smart Images

Figure CN113138623B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a global clock synchronization transmission method, wherein the global clock synchronization transmission method mainly enables a master device to send only high-order count data so that a slave device can calculate low-order count data based on the high-order count data, thereby determining whether clock synchronization is achieved. Background Art
[0002] Global clocks have a wide range of applications. Global clocks can ensure that all hardware devices (chip modules or circuit boards) in the system have exactly the same time reference.
[0003] When multiple hardware devices work together, data communication between devices needs to be completed by sending and receiving data packets. In order to facilitate the synchronization of different types of data packets and distinguish the order of data packets of the same type, the data packet sending device usually adds a timestamp to the data packet.
[0004] Each data sending device must have its own separate counter. When multiple devices work together, each device usually needs to send and receive data packets.
[0005] Since each device uses its own separate counter, the timestamp of the data packet sent by each device is not related to the timestamp of the data packet received. At the same time, the timestamps of the data packets sent by different senders received by each device are also not related, which can easily cause confusion in the sending and receiving of data packets.
[0006] In practical applications, the counters of the collaborative working devices are usually synchronized through a clock synchronization algorithm so that the counting clocks of the devices are the same at the same time, or the clock counting error is within an acceptable range. When the clock synchronization algorithm is implemented, the clock synchronization algorithm mainly sends clock counting data packets to each slave device through the master device, so that the clock counts received by each slave device are consistent, thereby achieving the purpose of clock synchronization.
[0007] Taking the current clock synchronization algorithm as an example, the master device publishes a data packet at a certain interval. The data packet contains the clock count data generated by the master device counter. The slave device obtains the clock count data in the data packet to determine whether clock synchronization is achieved. However, since the data packet contains the entire clock count data, a large amount of data needs to be sent between the master device and the slave device, and the power consumption of data communication will also increase accordingly.
[0008] At present, the design of electronic products focuses on saving power. Some methods reduce the number of data transmissions, but this will prolong the time for the slave device to confirm clock synchronization, which may cause more serious errors between the master device and the slave device. This is not what the designer wants to see. Therefore, how to achieve clock synchronization with a smaller amount of data transmission is an urgent problem to be solved. Summary of the invention
[0009] In view of the above problems, the inventors have conducted research and improvements on the global clock synchronization transmission method based on their years of experience in related industries. The main purpose of the present invention is to provide a method for achieving global clock synchronization transmission by which a master device only needs to send part of the clock count data to a slave device.
[0010] To achieve the above-mentioned purpose, the global clock synchronization transmission method of the present invention is applied to a digital hardware system, wherein the digital hardware system includes a master device and at least one slave device. When implemented, the master device transmits a clock counting data packet to each slave device, wherein the clock counting data packet only carries a high-order counting data, and each slave device can calculate a low-order counting data based on the high-order counting data, so that each slave device stores all (high-order and low-order) counting data and then starts the counting operation. When each slave device receives the clock counting data packet again, the slave device can compare all (high-order and low-order) counting data to determine whether the slave device has achieved clock synchronization with the master device. Therefore, the master device only needs to transmit the high-order counting data to the slave device, so as to greatly reduce the amount of data sent and reduce the power consumption of data communication.
[0011] In order to make the purpose, technical features and effects of the present invention clearly understood, the following description is provided with accompanying drawings for your reference. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 This is a diagram of the hardware system architecture of the present invention.
[0013] Figure 2 It is an implementation flow chart of the present invention.
[0014] Figure 3 This is an embodiment (I) of the clock counting data packet structure of the present invention.
[0015] Figure 4 This is Embodiment 2 of the clock counting data packet structure of the present invention.
[0016] Figure 5 This is an embodiment (I) of setting the data packet interval period of the present invention.
[0017] Figure 6 This is an embodiment (two) of setting the data packet interval period of the present invention. DETAILED DESCRIPTION
[0018] Please refer to Figure 1", the figure shows the hardware system architecture diagram of the present invention. As shown in the figure, the digital hardware system 10 of the present invention mainly has a master device 101 and at least one slave device (102, 102', 102"), wherein the master device 101 and each slave device (102, 102', 102") respectively have a counter, and the counter can be used to perform counting tasks and compare counting data. The master device and the slave device can be chips on the same circuit board, or different circuit boards with chips installed can be connected by data lines.
[0019] The master device 101 and each slave device (102, 102', 102") are connected via data lines, which can be differential lines or single-ended lines. The master device 101 sends a clock count data packet of the master device to all slave devices (102, 102', 102") via the data lines.
[0020] After each slave device (102, 102', 102") receives the clock counting data packet from the master device 101, each slave device (102, 102', 102") can trigger a counter to count, and each slave device (102, 102', 102") compares the data of the clock counting data packet to adjust the counting data of the slave device counter, so that the error between the clock counting data of each slave device (102, 102', 102") and the clock counting data of the master device 101 is within a very small error range, that is, the counter of each slave device (102, 102', 102") locks the clock counter of the master device 101, and the slave device (102, 102', 102") can transmit this locking information through the data line that sends the counting clock, or establish a dedicated locking data line to send it to the master device 101, or, the slave device (102, 102', 102") may not send the locking information to the master device 101 to simplify the global clock synchronization procedure.
[0021] During the global clock synchronization transmission process, the master device 101 needs to periodically send the complete clock count data to the slave device (102, 102', 102") in the form of a data packet via the data line. The data line can be a dedicated data line specifically used for global clock synchronization, or it can be a universal data line for communication between devices. The data line of the present invention uses a dedicated data line specifically used for global clock synchronization, so that when other data is transmitted between the master device 101 and the slave device (102, 102', 102"), the time for the master device 101 to accurately send the clock count data will not be affected by the transmission of other data.
[0022] Please refer to Figure 2 ", shown in the figure is an implementation flow chart of the present invention. The hardware global clock synchronization transmission method S of the present invention is shown in the figure, which comprises:
[0023] (1) The master device sends the first clock counting data packet S1: After the device is initialized, the counter of the master device counts based on a clock counting cycle. After a clock counting cycle, the master device counter publishes a clock counting data packet to at least one slave device through the data line; the clock counting cycle is between 2 to the 16th power nanoseconds (ns) and 2 to the 32nd power nanoseconds, preferably 2 to the 24th power nanoseconds. The clock counting cycle can be set according to requirements, and a value with a low bit of zero is selected as the clock counting cycle, such as 65,536 nanoseconds (i.e., 2 to the 16th power nanoseconds). The clock counting cycle The setting of the period is based on power saving. In clock synchronization transmission, if the clock counting cycle is very short, the slave device can often receive the clock counting data packet of the master device to adjust the clock counting data of the slave device, which can ensure that the clock counting data of the slave device is synchronized or close to the clock counting data of the master device. However, the communication power consumption of the master device is also relatively increased. If the clock counting cycle is very long, the master device needs to wait for a long time to send a clock counting data packet to the slave device. In this way, the master device can save communication power consumption, but the interval time for the slave device to receive the data packet is long, which may cause a large synchronization error.
[0024] (2) Therefore, in this embodiment, 16,777,216 nanoseconds (about 16 ms) is the best embodiment, which can meet the counting error requirements of the master device and the slave device of most applications of about 100 nanoseconds. The clock counting data packet includes a packet header, a high-order counting data and a data packet tail, wherein the high-order counting data can be set according to the requirements, and can be selected as 8 bits (bit, also called bits), 24 bits or 40 bits, etc. In addition, the master counter further fills the low-order counting data with 0. For example, when the master device counts to 16,777,216 nanoseconds, the hexadecimal representation of the master device's count is 0x1000000, that is, the high-order counting data is 0x1 and the low-order counting data is 0x0. If the master device clock counter is set to 32 bits, the high-order counting data sent by the master device to the slave device should be 8 bits (8'b00000001), the lower bits are all 0 (24'b000000000000000000000000 (24'h0)) (the master device only sends the high-bit count data);
[0025] (3) The slave device starts clock counting after receiving the clock counting data packet S2: After the slave device is initialized, each slave device can respectively take out the high-order counting data in the data packet after receiving the clock counting data packet sent by the master device. Each slave device counter can further calculate the low-order counting data based on the high-order counting data in the data packet by zero padding, store all the data (i.e., the high-order counting data and the low-order counting data) and start counting operation;
[0026] (4) The master device updates the clock count data packet S3: When the master device counter counts to the specified clock count cycle (e.g., 16,777,216 nanoseconds) again, the master device counter updates the high-order count data in the clock count data packet, and publishes the updated clock count data packet to each slave device again. For example, when the master device counter counts to 33,554,432 nanoseconds (i.e., the next 16,777,216 nanoseconds), the master device counter is represented in hexadecimal as "0x2000000", i.e., the high order is "0x2" and the low order is "0x0". If the master device is a 32-bit counting device, the count sent by the master device to the slave device should be 8 high-order bits, i.e., 8'b00000010, and the low order bits are all 0, i.e., 24'b000000000000000000000000 (24'h0) (the master device only sends the high-order count data);
[0027] (5) The slave device compares the clock count data packet of the master device S4: After the slave device receives the clock count data packet of the master device again, the slave device compares the clock count data of the slave device counter with the count data in the data packet after the low-order zero padding. If the error between the clock count data of the master device and the clock count data of the slave device is within an error tolerance range, the slave device can determine that the clock count data of the slave device is synchronized with the clock count data of the master device, and wait for the next clock count data packet sent by the master device for the next comparison. If the clock count data of the master device and the clock count data of the slave device are not within the error tolerance range (i.e., the error is too large), the next step is performed. The error tolerance range can be set according to the application of the master device and the slave device. For example, in the digital video interface standard (DisplayPort) formulated by the Video Electronics Standards Association (VESA), the Global Time Code (GTC) is used for synchronization between Video and Audio. The standard requires that in the GTC maintenance phase, the clock count data error of the GTC master and the GTC slave is within an average of +-50 nanoseconds, and the maximum error cannot exceed +-100 nanoseconds.
[0028] (6) The slave device adjusts the clock count to synchronize S5: If the difference between the clock count data of the master device and the clock count data of the slave device is not within the allowable error range, the slave device adjusts the frequency of the slave device counting clock or adjusts the count increase value of each clock cycle of the slave device, and then repeats the above steps of "master device updates clock count data packet S3" and "slave device compares master device clock count data packet S4" until the clock count data value of the slave device is synchronized with the clock count data value of the master device again, that is, the error between the clock count data of the master device and the clock count data of the slave device is maintained within the allowable error range.
[0029] As mentioned above, the counter of each clock cycle of the master device increases by an integer power of 2. For example, if the clock of the master device uses 125MHz, the counter count of each clock cycle increases to 8, and each clock cycle is 8 nanoseconds. If the clock of the master device uses 62.5MHz, the counter count of each clock cycle increases to 16, which means that each clock cycle is 16 nanoseconds. In order to minimize the amount of counting data (bit, bit / bit) sent by the master device to the slave device, and at the same time maintain the data packet sending time between the master device and the slave device within a suitable range, the master device preferably selects 16,777,216 nanoseconds as the interval period of the data packet sending time, but is not limited to this, wherein 16,777,216 is 2 to the power of 24, so each time the master device sends clock counting data to the slave device, the master device only needs to send the high-order counting data (the part of the data that is not 0) in the clock counting data to the slave device, and does not send the low-order (24-bit) data, thereby reducing the amount of data sent by the master device.
[0030] Please refer to Figure 3 ", shown in the figure is an embodiment (one) of the clock counting data packet structure of the present invention. As shown in the figure, in the embodiment (one), the master device counter uses 24 bits as the low-order counting data. When the master device clock counter adopts a 32-bit counting specification, only the high-order counting data needs to be sent to the slave device 102 each time, that is, the master device clock counting data obtains the part of the high-order counting data, that is, 32 bits - 24 bits = 8 bits.
[0031] Please refer to Figure 4 ", shown in the figure is an embodiment (two) of the clock count data packet structure of the present invention. As shown in the figure, the master device counter uses 24 bits as the low-order count data. When the master device clock counter adopts a 64-bit count specification, only the high-order count data needs to be sent to the slave device 102 each time, that is, the master device clock count data obtains the part of the high-order count data, that is, 64 bits - 24 bits = 40 bits.
[0032] Please refer to Figure 5 ", shown in the figure is an embodiment (I) of the data packet interval period setting of the present invention, and shown in the figure is the interval time for the master device to send a clock counting data packet D and the next clock counting data packet D'. When the master device counter uses 16,777,216 nanoseconds as the clock counting period, and the master device clock adopts 125MHz counting, the clock count increases by 8 in each master clock cycle, then the interval period for sending the master device clock counting data packet (D, D') is 16,777,216÷8=2,097,152 master device clock counting periods.
[0033] Please refer to Figure 6", shown in the figure is an embodiment (two) of the data packet interval period setting of the present invention, and shown in the figure is the interval time between the master device sending a clock counting data packet D and the next clock counting data packet D'. When the master device counter uses 16,777,216 nanoseconds as the clock counting period, and the master device clock adopts 62.5MHz counting, the clock count increases by 16 in each master clock cycle, and the interval period of the master device data packet sending is 16777216÷16=1,048,576 master device clock counting cycles.
[0034] In summary, the global clock synchronization transmission method for a digital hardware system of the present invention mainly sends a clock counting data packet to multiple slave devices through a master device, so that the slave device can start counting or confirm whether clock synchronization is achieved after receiving the data packet, wherein only the high-order counting data is retained in the clock counting data packet sent by the master device. When the slave device receives the clock counting data packet, the slave device can calculate the low-order counting data based on the high-order counting data by padding with zeros, so that the slave device counter can compare all the counting data (i.e., the high-order counting data and the low-order counting data), and then confirm whether the slave device counter is synchronized with the master device counter, and correct it to be synchronized.
[0035] After the present invention is implemented, it can indeed achieve the purpose of providing a master device that only needs to send part of the clock counting data to the slave device to achieve global clock synchronous transmission.
[0036] The above description is only a preferred embodiment of the present invention and is not intended to limit the scope of the present invention. Any equivalent changes and modifications made by anyone familiar with the technology without departing from the spirit and scope of the present invention should be included in the patent scope of the present invention.
[0037]
Explanation of symbols
[0038] 10Digital Hardware System
[0039] 101 master device 102 slave device
[0040] 102' slave device 102" slave device
[0041] D clock counts packets
[0042] D' clock counts packets
[0043] S Hardware global clock synchronization transmission method
[0044] S1 master device sends the first clock count data packet
[0045] S2 starts counting the clock after receiving the clock counting data packet from the device
[0046] S3 master device updates clock count packet
[0047] S4 slave device compares master device clock count data packet
[0048] S5 slave adjusts the clock count to synchronize.
Claims
1. A global clock synchronization transmission method, characterized in that: Include: A master device sends a first clock counting data packet: after a master device is initialized, a master device counter counts based on a clock counting cycle, and after counting to the clock counting cycle, the master device counter publishes a clock counting data packet with a high-bit counting data to at least one slave device through a data line, and the clock counting data packet does not have a low-bit counting data; A step of starting to count clocks after a slave device receives a clock counting data packet: after each of the slave devices is initialized, each of the slave devices respectively receives the clock counting data packet sent by the master device, and each of the slave devices calculates a low-bit counting data based on the clock counting data packet, and the slave device counter stores the high-bit counting data and the low-bit counting data and starts counting; A master device updates a clock count data packet step: when the master device counter counts to the specified clock count cycle again, the master device counter updates the clock count data packet and publishes the updated clock count data packet to each of the slave devices; A step of comparing the clock counting data packet of the master device with the slave device: after each of the slave devices receives the clock counting data packet again, each of the slave devices compares the clock counting data of the counter of each of the slave devices with the counting data of the clock counting data packet after the low bits are padded with zeros. When the comparison error is within an error tolerance range, the slave device determines that the clock synchronization with the master device is achieved. When the comparison error is greater than the error tolerance range, the next step is performed. as well as A slave device adjusts the clock count to synchronization step: the slave device adjusts the frequency of the counting clock or adjusts the count increase value of each clock cycle, and then repeats the "master device updates the clock count data packet step" and the "slave device compares the master device clock count data packet step" until the clock count data of the slave device is synchronized with the clock count data of the master device again.
2. The global clock synchronization transmission method according to claim 1, characterized in that: The master device integrates the high-bit count data into the clock count data packet, and sends the clock count data packet to each of the slave devices.
3. The global clock synchronization transmission method according to claim 2, characterized in that: When the slave device starts to count the clock after receiving the clock counting data packet, each slave device receives the clock counting data packet respectively, and then calculates the low-order counting data based on the high-order counting data of the clock counting data packet after padding the low-order counting data with zeros.
4. The global clock synchronization transmission method according to claim 1, characterized in that: When the slave device adjusts the clock counting data to execute the synchronization step, the slave device adjusts the counting frequency of each of the clocks, or adjusts the count increment value of each of the clock cycles, so that the error is within the allowable error range.
5. The global clock synchronization transmission method according to claim 1, characterized in that: The clock counting period is designed to be 2 to the nth power nanoseconds.
