Timekeeping circuit
The time keeping circuit addresses storage challenges in time synchronization by using a single 100-bit time count value to calculate transmission and reception times, reducing memory needs while maintaining synchronization accuracy.
Patent Information
- Application Number
- JP2021018643
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2021-02-09
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2041-02-09
AI Technical Summary
Conventional time synchronization technologies require significant storage space to hold time count values of about 100 bits for calculating arrival delay times, necessitating large storage areas for transmission and reception count values.
A time keeping circuit that utilizes a time counter with a control counter and holding circuits to calculate transmission and reception times using a single 100-bit time count value, reducing the required storage space by half compared to conventional methods.
The circuit efficiently calculates transmission and reception times for time synchronization with minimal storage requirements, achieving time synchronization with reduced memory needs.
Smart Images

Figure 0007565817000002 
Figure 0007565817000003 
Figure 0007565817000004
Abstract
Description
[Technical field]
[0001] The present disclosure relates to a time keeping circuit. [Background technology]
[0002] 2. Description of the Related Art Conventionally, there is a technology (hereinafter referred to as a "time synchronization technology") in which a slave device connected to a master device via a network synchronizes the time with the master device. In this time synchronization technology, when a slave device transmits a packet to a master device, the slave device measures the arrival delay time, which is the time it takes for the packet to reach the master device after being transmitted from the slave device. The slave device achieves time synchronization with the master device using the ratio between the clock frequency of the master device and the clock frequency of the slave device, and the arrival delay time. The arrival delay time can be calculated by the slave device from four times t1, t2, t3, and t4. Time t1 is the time in the slave device when the slave device transmits a first packet to the master device. Time t2 is the time in the master device when the master device receives the first packet. Time t3 is the time in the master device when the master device transmits a second packet including both times t2 and t3 to the slave device. Time t4 is the time in the slave device when the slave device receives the second packet.
[0003] Incidentally, Patent Document 1 discloses a slave device that achieves time synchronization with a master device by using a transmission time, a transmission count value, a reception time, and a reception count value instead of the four times t1, t2, t3, and t4. The transmission time is the time when the master device transmits a Sync frame, and the transmission count value is the count value of a slave counter possessed by the master device. The reception time is the time when the slave device receives the Sync frame, and the reception count value is the count value of a slave counter possessed by the slave device. [Prior art documents] [Patent documents]
[0004] [Patent Document 1] International Publication No. 2019 / 003320 Summary of the Invention [Problem to be solved by the invention]
[0005] The time in the slave device and the time in the master device are generally expressed as a time count value of about 100 bits so that time for several decades can be expressed with an accuracy of less than a nanosecond. Therefore, a conventional slave device has a problem in that it needs to secure a storage area capable of holding four times t1, t2, t3, and t4, each expressed as a time count value of about 100 bits, in order to calculate the arrival delay time used for time synchronization with the master device. The slave device disclosed in Patent Document 1 also needs to secure a memory area capable of holding a transmission count value and a reception count value, which are represented by a time count value of about 100 bits, and also needs to secure a memory area capable of holding a transmission time and a reception time.
[0006] The present disclosure has been made to solve the problems described above, and aims to provide a time keeping circuit that can calculate the transmission time of a transmitted packet and the reception time of a received packet, which are the times required to calculate the arrival delay time, by simply holding a single time count value of about 100 bits. [Means for solving the problem]
[0007] A time holding circuit according to the present disclosure includes a time counter having a time count value, and a control counter having a control count value that varies within a range from a first value to a second value, the control count value being incremented each time the time count value is incremented, and the control count value being reset to the first value at the timing next after the control count value reaches the second value, a first holding circuit that holds the control count value at the timing when a transmission packet is transmitted as a first control count value, a second holding circuit that holds the control count value at the timing when a reception packet is received as a second control count value, and a third holding circuit that holds the time count value at the timing immediately before the control count value is reset to the first value as a time count value for calculation; a first calculation time count value is a calculation time count value at a timing when the control count value is reset for the first time after the transmission packet is transmitted, and a second calculation time count value is a calculation time count value at a timing when the control count value is reset for the first time after the reception packet is received; The first control count value and the second control count value are used as the transmission time of the transmission packet. 1. The difference between the sum of the calculation time count value and the second value is calculated, and the sum is set as the reception time of the received packet. Second The calculation circuit includes a calculation circuit that calculates the sum of the calculation time count value and the difference between the second value. Effect of the Invention
[0008] According to the present disclosure, by simply storing one time count value of about 100 bits, it is possible to calculate the transmission time of a transmitted packet and the reception time of a received packet as the times required to calculate the arrival delay time. [Brief description of the drawings]
[0009] [Figure 1] 1 is a configuration diagram showing a system including a master device 1 and a slave device 2-1. [Diagram 2] 1 is a configuration diagram showing a time keeping circuit 5 according to a first embodiment. [Diagram 3] 4 is a timing chart showing the time calculation operation in the time keeping circuit 5. [Figure 4] 1 is a configuration diagram showing a system including a master device 1 and slave devices 2-1 to 2-3. [Diagram 5]FIG. 11 is a configuration diagram showing a time keeping circuit 5 according to a second embodiment. [Figure 6] 4 is a timing chart showing the time calculation operation in the time keeping circuit 5. [Figure 7] 1 is a configuration diagram showing a system including a master device 1 and slave devices 2-1 and 2-2. [Figure 8] FIG. 11 is a configuration diagram showing a time keeping circuit 5 according to a third embodiment. [Figure 9] 4 is a timing chart showing the time calculation operation in the time keeping circuit 5. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0010] In order to describe the present disclosure in more detail, embodiments of the present disclosure will be described below with reference to the accompanying drawings.
[0011] Embodiment 1 FIG. 1 is a configuration diagram showing a system including a master device 1 and a slave device 2-1. In the system shown in FIG. 1, the slave device 2-1 realizes time synchronization with the master device 1. The master device 1 and the slave device 2-1 are connected via a network such as Ethernet. The master device 1 and the slave device 2-1 transmit and receive Ethernet frames including time information. The time indicated by the time information is expressed as a count value of about 100 bits so that time for several decades can be expressed with an accuracy of less than a nanosecond. The master device 1 has a time counter that has a count value of about 100 bits so that it can represent several decades' worth of time with an accuracy of less than a nanosecond. The slave device 2-1 includes a first pulse output circuit 3, a second pulse output circuit 4, a time holding circuit 5 and a time synchronization circuit 6 in order to achieve time synchronization with the master device 1. 1, the slave device 2-1 includes a first pulse output circuit 3, a second pulse output circuit 4, a time keeping circuit 5, and a time synchronization circuit 6. However, this is merely an example, and the master device 1 may also include the first pulse output circuit 3, the second pulse output circuit 4, the time keeping circuit 5, and the time synchronization circuit 6.
[0012] The first pulse output circuit 3 outputs a first pulse to the time keeping circuit 5 at the same timing that the transmitting section of the slave device 2-1 transmits a transmission packet as an Ethernet frame. The second pulse output circuit 4 outputs a second pulse to the time keeping circuit 5 at the timing when the Ethernet frame transmitted from the master device 1 is received as a received packet by the receiving section of the slave device 2-1. The time keeping circuit 5 calculates the transmission time of the transmitted packet and the reception time of the received packet as the times required for calculating the arrival delay time MLD. The time synchronization circuit 6 calculates the arrival delay time MLD using the transmission time of the transmitted packet and the reception time of the received packet. The time synchronization circuit 6 realizes time synchronization with the master device 1 by using the arrival delay time MLD.
[0013] FIG. 2 is a configuration diagram showing the time keeping circuit 5 according to the first embodiment. The time holding circuit 5 shown in FIG. 2 includes input ports 11-1 and 11-2, a time counter 12, a control counter 13, a first holding circuit 14, a second holding circuit 15, a third holding circuit 16 and an arithmetic circuit 17.
[0014] The input port 11-1 is a port for receiving the first pulse output from the first pulse output circuit 3. The first pulse received by the input port 11-1 is applied to a first holding circuit 14. The input port 11-2 is a port for receiving the second pulse output from the second pulse output circuit 4. The second pulse received by the input port 11 - 2 is applied to a second holding circuit 15 .
[0015] The time counter 12 has a time count value and outputs the time count value to the third holding circuit 16. The time count value is represented by about 100 bits so that it can represent several decades of time with an accuracy of, for example, a nanosecond or less.
[0016] The control counter 13 has a control count value that varies in a range from a first value to a second value, the first value being, for example, 0 and the second value being, for example, 4. The control count value of the control counter 13 is incremented every time the time count value of the time counter 12 is incremented. The control count value of the control counter 13 is reset to the first value the next time it reaches the second value. The control counter 13 outputs the control count value to a first holding circuit 14, a second holding circuit 15, a third holding circuit 16 and an arithmetic circuit 17, respectively.
[0017] The first holding circuit 14 holds, as a first control count value, the control count value at the timing when the transmission packet is transmitted from the slave device 2-1. That is, when a first pulse is output from the input port 11-1, the first holding circuit 14 holds the control count value held by the control counter 13 as a first control count value. The first holding circuit 14 outputs the held first control count value to the arithmetic circuit 17.
[0018] The second holding circuit 15 holds, as a second control count value, the control count value at the timing when the slave device 2-1 receives the receive packet. That is, when a second pulse is output from the input port 11-2, the second holding circuit 15 holds the control count value held by the control counter 13 as a second control count value. The second holding circuit 15 outputs the held second control count value to the arithmetic circuit 17.
[0019] The third holding circuit 16 holds, as a calculation time count value, the time count value at the timing immediately before the control count value of the control counter 13 is reset to the first value. The third holding circuit 16 outputs the held calculation time count value to the calculation circuit 17.
[0020] The arithmetic circuit 17 includes a selector 18 and a calculator 19 . The calculation circuit 17 calculates the difference between the sum of the first control count value output from the first holding circuit 14 and the calculation time count value output from the third holding circuit 16 and the second value as the transmission time of the transmission packet. The calculation circuit 17 calculates the difference between the sum of the second control count value output from the second holding circuit 15 and the calculation time count value output from the third holding circuit 16 and the second value as the reception time of the received packet.
[0021] When the control count value held by the control counter 13 is, for example, a first value, the selector 18 outputs the first control count value output from the first holding circuit 14 to the calculator 19 . The selector 18 outputs the second control count value output from the second holding circuit 15 to the calculator 19 when the control count value held by the control counter 13 is, for example, the first value+1.
[0022] The calculator 19 calculates the difference between the sum of the first control count value output from the selector 18 and the calculation time count value output from the third holding circuit 16 and the second value as the transmission time of the transmission packet. The calculator 19 calculates the difference between the sum of the second control count value output from the selector 18 and the calculation time count value output from the third holding circuit 16 and the second value as the reception time of the received packet. The calculator 19 outputs to the time synchronization circuit 6 the transmission time of the transmitted packet and the reception time of the received packet.
[0023] Next, the operation of the system shown in FIG. 1 will be described. FIG. 3 is a timing chart showing the time calculation operation in the time keeping circuit 5. As shown in FIG. When attempting to synchronize time with the master device 1, the slave device 2-1 calculates a transmission delay time MLD, which is the time it takes for a packet to reach the master device 1 after being transmitted from the slave device 2-1. The calculation process of the arrival delay time MLD by the slave device 2-1 will be specifically described below.
[0024] The transmitting section of the slave device 2-1 transmits a transmission packet to the master device 1 when calculating the arrival delay time MLD. When the master device 1 receives the transmission packet transmitted from the slave device 2-1, it obtains from its own time counter a count value indicating the time t2 at which the transmission packet was received. The master device 1 returns a response packet including a count value indicating time t2 to the slave device 2-1. The response packet includes a count value indicating time t3 when the response packet was returned, in addition to the count value indicating time t2.
[0025] The first pulse output circuit 3 of the slave device 2-1 outputs a first pulse to the time keeping circuit 5 at the same timing that the transmitter of the slave device 2-1 transmits a transmission packet. The second pulse output circuit 4 of the slave device 2-1 outputs a second pulse to the time keeping circuit 5 at the timing when the response packet transmitted from the master device 1 is received as a received packet by the receiving section of the slave device 2-1.
[0026] When the input port 11-1 of the time holding circuit 5 receives the first pulse from the first pulse output circuit 3, it outputs the first pulse to the first holding circuit . When the input port 11 - 2 of the time holding circuit 5 receives the second pulse from the second pulse output circuit 4 , it outputs the second pulse to the second holding circuit 15 .
[0027] The first holding circuit 14 holds the control count value held by the control counter 13 as a first control count value when a first pulse is output from the input port 11-1. In time keeping circuit 5 shown in FIG. 2, the control count value of control counter 13 changes as follows: 0→1→2→3→4→0→. . . 4→0→. . . In the example of FIG. 3, when the control count value is “1”, the first pulse is output from the input port 11-1, so that the first holding circuit 14 holds “1” as the first control count value. The first holding circuit 14 outputs the held first control count value to a selector 18 of an arithmetic circuit 17 .
[0028] The second holding circuit 15 holds the control count value held by the control counter 13 as a second control count value when a second pulse is output from the input port 11-2. In the example of FIG. 3, when the control count value is “4”, the second pulse is output from input port 11-2, so that second holding circuit 15 holds “4” as the second control count value. The second holding circuit 15 outputs the held second control count value to a selector 18 of an arithmetic circuit 17 .
[0029] The time counter 12 has a time count value, and outputs the time count value to the third holding circuit 16. The time indicated by the time information is represented by a time count value of about 100 bits. In time holding circuit 5 shown in FIG. 2, the time count value of time counter 12 transitions as follows: n+0→n+1→n+2→···→n+18.
[0030] When the control count value held by the control counter 13 is reset to the first value, the third holding circuit 16 holds the time count value at the timing immediately before the control count value is reset as a calculation time count value. That is, when the control count value of the control counter 13 is reset to "0", the third holding circuit 16 holds the time count value when the control count value is "4" as the calculation time count value. In the example of FIG. 3, when the control count value is “4”, the time count values are “n+1”, “n+6”, “n+11”, and “n+16”, so when the control count value is reset to “0”, the time count values of “n+1”, “n+6”, “n+11”, and “n+16” are each held in turn in the third holding circuit 16 as time count values for calculation. The third holding circuit 16 outputs the held calculation time count value to the calculator 19 of the calculation circuit 17 .
[0031] The selector 18 outputs the first control count value "1" to the calculator 19 at the timing when the control count value held by the control counter 13 first becomes "0" after the first control count value is held in the first holding circuit 14. That is, when the control count value held by the control counter 13 becomes “0” and the third holding circuit 16 holds “n+6” as the calculation time count value, the selector 18 outputs the first control count value “1” output from the first holding circuit 14 to the calculator 19. The calculator 19 calculates, as the transmission time t1 of the transmission packet, the difference between the sum of the first control count value “1” output from the selector 18 and the calculation time count value “n+6” output from the third holding circuit 16 and the second value “4”, as shown in the following equation (1). t1=1+(n+6)-4=n+3 (1) The calculator 19 outputs to the time synchronization circuit 6 a count value indicating the transmission time t1 of the transmission packet.
[0032] The selector 18 outputs the second control count value "4" to the calculator 19 at the timing when the control count value held by the control counter 13 first becomes "1" after the second control count value is held in the second holding circuit 15. That is, when the control count value held by the control counter 13 becomes “1” and the third holding circuit 16 holds “n+6” as the calculation time count value, the selector 18 outputs the second control count value “4” output from the second holding circuit 15 to the calculator 19. The calculator 19 calculates, as the reception time t4 of the received packet, the difference between the sum of the second control count value “4” output from the selector 18 and the calculation time count value “n+6” output from the third holding circuit 16 and the second value “4”, as shown in the following equation (2). t4=4+(n+6)-4=n+6 (2) The calculator 19 outputs to the time synchronization circuit 6 a count value indicating the reception time t4 of the received packet.
[0033] When the calculator 19 outputs a count value indicating the transmission time t1 of a transmission packet, the time synchronization circuit 6 stores the count value indicating the transmission time t1 in an internal memory. When the calculator 19 outputs a count value indicating the reception time t4 of the received packet, the time synchronization circuit 6 acquires the count value indicating the reception time t4 of the received packet and acquires the count value indicating the transmission time t1 from the internal memory. The time synchronization circuit 6 also acquires the count value indicating the time t2 and the count value indicating the time t3, which are included in the response packet received by the receiver of the slave device 2-1.
[0034] The time synchronization circuit 6 calculates the arrival delay time MLD using the transmission time t1, the reception time t2, the transmission time t3, and the reception time t4, as shown in the following formula (3). TIFF0007565817000001.tif30166In equations (3) and (4), NRR is the ratio of the clock frequency in master device 1 to the clock frequency in slave device 2-1. t3' is the time when master device 1 transmits a response packet to the transmission packet to slave device 2-1 when a transmission packet similar to the transmission packet is transmitted from the transmission unit of slave device 2-1 to master device 1 a certain time before the transmission packet. The time count value indicating time t3' is included in the response packet. Also, t4' is the time when the reception unit of slave device 2-1 receives the response packet, and is calculated using equation (2). The time synchronization circuit 6 realizes time synchronization with the master device 1 by using the arrival delay time MLD. The process of implementing time synchronization with the master device 1 using the arrival delay time MLD is a known technique, and therefore a detailed description thereof will be omitted.
[0035] In the above-described first embodiment, the time holding circuit 5 is configured to include a time counter 12 having a time count value, a control counter 13 having a control count value which changes within a range from a first value to a second value, the control count value being incremented each time the time count value is incremented, and the control count value being reset to the first value at the timing next after the control count value reaches the second value, a first holding circuit 14 which holds the control count value at the timing when a transmission packet is transmitted as the first control count value, a second holding circuit 15 which holds the control count value at the timing when a reception packet is received as the second control count value, a third holding circuit 16 which holds the time count value at the timing just before the control count value is reset to the first value as a time count value for calculation, and a calculation circuit 17 which calculates the difference between the sum of the first control count value and the time count value for calculation and the second value as the transmission time of the transmission packet, and calculates the difference between the sum of the second control count value and the time count value for calculation and the second value as the reception time of the reception packet. Therefore, the time keeping circuit 5 only needs to hold one time count value of about 100 bits to calculate the transmission time of a transmission packet and the reception time of a reception packet, which are times required to calculate the arrival delay time.
[0036] The time count value of about 100 bits here is only the calculation time count value held by the third holding circuit 16. The first control count value held by the first holding circuit 14 and the second control count value held by the second holding circuit 15 are each represented by 3 bits. The internal memory of the time synchronization circuit 6 needs to hold the count value indicating the transmission time t1 from the time when the calculator 19 outputs the count value indicating the transmission time t1 until the calculator 19 outputs the count value indicating the reception time t4 of the received packet. Therefore, the slave device 2-1 as a whole needs to secure a storage area for holding the calculation time count value and the count value indicating the transmission time t1. However, this storage area is about half the storage area that a conventional slave device needs to secure for holding the four times t1, t2, t3, and t4.
[0037] 1, slave device 2-1 achieves time synchronization with master device 1. However, this is merely an example, and multiple slave devices 2-1 to 2-3 may achieve time synchronization with master device 1, as shown in FIG. FIG. 4 is a configuration diagram showing a system including a master device 1 and slave devices 2-1 to 2-3. For slave device 2-2 to achieve time synchronization with master device 1, slave device 2-2 needs to transmit a transmission packet to master device 1 via slave device 2-1 and receive a response packet transmitted from master device 1 via slave device 2-1. Furthermore, for slave device 2-3 to achieve time synchronization with master device 1, slave device 2-3 needs to transmit a transmission packet to master device 1 via slave device 2-1 and receive a response packet transmitted from master device 1 via slave device 2-1. For this reason, slave device 2-1 needs to have two input ports for transmitting and receiving with slave device 2-2, and two input ports for transmitting and receiving with slave device 2-3, in addition to input ports 11-1 and 11-2. In addition to the first hold circuit 14, the slave device 2-1 needs to have a first hold circuit for a transmission packet to be transmitted to the slave device 2-2 and a first hold circuit for a transmission packet to be transmitted to the slave device 2-3. Furthermore, in addition to second hold circuit 15, slave device 2-1 needs to include a second hold circuit for packets received from slave device 2-2 and a second hold circuit for packets received from slave device 2-3. That is, the slave device 2-1 needs to have six input ports, three first holding circuits, and three second holding circuits.
[0038] Embodiment 2 In the second embodiment, a time keeping circuit 5 including a bit extracting circuit 20 instead of the control counter 13 will be described.
[0039] The configuration of a system including a slave device 2-1 including a time keeping circuit 5 according to the second embodiment and a master device 1 is similar to the configuration of the system according to the first embodiment, and a configuration diagram showing the system according to the second embodiment is shown in FIG. Fig. 5 is a configuration diagram showing a time keeping circuit 5 according to embodiment 2. In Fig. 5, the same reference numerals as in Fig. 2 indicate the same or corresponding parts, and therefore a description thereof will be omitted. The bit extraction circuit 20 extracts one or more bits from among the multiple bits representing the time count value of the time counter 12 as the control count value of the control counter 13, and holds the value represented by the extracted bits. The value represented by the extracted bits varies within a range from a first value to a second value. The value represented by the extracted bits is incremented every time the time count value is incremented. The value represented by the extracted bits is reset to the first value the next time the value represented by the bit reaches the second value. The bit extracting circuit 20 outputs the control count value, which is the value represented by the extracted bit, to each of the first holding circuit 14, the second holding circuit 15 and the selector 18.
[0040] The number of bits extracted by the bit extraction circuit 20 may be any number as long as it is a power of 2 of the number of the input ports 11-1, 11-2. In the time keeping circuit 5 shown in FIG. 5, the number of input ports 11-1, 11-2 is two, so the number of bits extracted by the bit extraction circuit 20 may be, for example, one, two, or four. When the number of bits extracted by the bit extraction circuit 20 is one, the bit extracted by the bit extraction circuit 20 is the least significant bit of the multiple bits representing the time count value. In this case, the bit extraction circuit 20 outputs "0" or "1" represented by the least significant bit. When the number of bits extracted by the bit extraction circuit 20 is two, the bits extracted by the bit extraction circuit 20 are the two least significant bits of the multiple bits representing the time count value. In this case, the bit extraction circuit 20 outputs "0", "1", "2" or "3" represented by the two least significant bits. When the number of bits extracted by the bit extraction circuit 20 is three, the bits extracted by the bit extraction circuit 20 are the lowest three bits of the multiple bits representing the time count value. In this case, the bit extraction circuit 20 outputs "0", "1", "2", "3", "4", "5", "6", or "7" represented by the lowest two bits. FIG. 6 is a timing chart showing the time calculation operation in the time keeping circuit 5. As shown in FIG. FIG. 6 shows an example in which the bit extraction circuit 20 extracts bits representing "0", "1", "2" or "3".
[0041] Next, the operation of the slave device 2-1 will be described. The transmitting section of the slave device 2-1 transmits a transmission packet to the master device 1 when calculating the arrival delay time MLD. When the master device 1 receives the transmission packet transmitted from the slave device 2-1, it obtains from its own time counter a count value indicating the time t2 at which the transmission packet was received. The master device 1 returns a response packet including a count value indicating time t2 to the slave device 2-1. The response packet includes a count value indicating time t3 when the response packet was returned, in addition to the count value indicating time t2.
[0042] The first pulse output circuit 3 of the slave device 2-1 outputs a first pulse to the time keeping circuit 5 at the same timing that the transmitter of the slave device 2-1 transmits a transmission packet. The second pulse output circuit 4 of the slave device 2-1 outputs a second pulse to the time keeping circuit 5 at the timing when the response packet transmitted from the master device 1 is received as a received packet by the receiving section of the slave device 2-1.
[0043] When the input port 11-1 of the time holding circuit 5 receives the first pulse from the first pulse output circuit 3, it outputs the first pulse to the first holding circuit . When the input port 11 - 2 of the time holding circuit 5 receives the second pulse from the second pulse output circuit 4 , it outputs the second pulse to the second holding circuit 15 .
[0044] The first holding circuit 14 holds, as a first control count value, the value represented by the bit extracted by the bit extracting circuit 20 when the first pulse is output from the input port 11-1. 5, the value represented by the bit extracted by bit extraction circuit 20 changes as follows: 0→1→2→3→0→...3→0→... In this case, the first value is "0" and the second value is "3". In the example of FIG. 6, when the value represented by the bit extracted by the bit extraction circuit 20 is “1”, a first pulse is output from the input port 11-1, and therefore the first holding circuit 14 holds “1” as the first control count value. The first holding circuit 14 outputs the held first control count value to a selector 18 of an arithmetic circuit 17 .
[0045] The second holding circuit 15 holds the value represented by the bit extracted by the bit extracting circuit 20 as a second control count value when a second pulse is output from the input port 11-2. In the example of FIG. 6, when the value represented by the bit extracted by the bit extraction circuit 20 is “0”, a second pulse is output from the input port 11-2, and therefore the second holding circuit 15 holds “0” as the second control count value. The second holding circuit 15 outputs the held second control count value to a selector 18 of an arithmetic circuit 17 .
[0046] The time counter 12 has a time count value, and outputs the time count value to each of the third holding circuit 16 and the bit extraction circuit 20. In time holding circuit 5 shown in FIG. 5, the time count value of time counter 12 transitions as follows: n+0→n+1→n+2→···→n+18.
[0047] When the value represented by the bit extracted by the bit extraction circuit 20 is reset to "0", the third holding circuit 16 holds the time count value at the timing just before the value represented by the bit is reset to "0" as the time count value for calculation. That is, when the value represented by the bit extracted by the bit extraction circuit 20 is reset to "0", the third holding circuit 16 holds the time count value when the value represented by the bit is "3" as the time count value for calculation. In the example of Figure 6, when the value represented by the bit is "3", the time count values are "n+1", "n+5", "n+9", and "n+13", so when the control count value is reset to "0", the time count values of "n+1", "n+5", "n+9", and "n+13" are each held in turn in the third holding circuit 16 as the calculation time count values. The third holding circuit 16 outputs the held calculation time count value to the calculator 19 of the calculation circuit 17 .
[0048] The selector 18 outputs the first control count value "1" to the calculator 19 at the timing when the value represented by the bit extracted by the bit extraction circuit 20 first becomes "0" after the first control count value is held in the first holding circuit 14. That is, when the value represented by the bit extracted by the bit extraction circuit 20 becomes “0” and the third holding circuit 16 holds “n+5” as the calculation time count value, the selector 18 outputs “1”, which is the first control count value output from the first holding circuit 14, to the calculator 19. The calculator 19 calculates, as the transmission time t1 of the transmission packet, the difference between the sum of the first control count value “1” output from the selector 18 and the calculation time count value “n+5” output from the third holding circuit 16 and the second value “3”, as shown in the following equation (5). t1=1+(n+5)-3=n+3 (5) The calculator 19 outputs to the time synchronization circuit 6 a count value indicating the transmission time t1 of the transmission packet.
[0049] The selector 18 outputs the second control count value, "0", to the calculator 19 at the timing when the value represented by the bit extracted by the bit extraction circuit 20 becomes "1" for the second time after the first control count value is held in the second holding circuit 15. That is, when the value represented by the bit extracted by the bit extraction circuit 20 becomes “1” and the third holding circuit 16 holds “n+9” as the calculation time count value, the selector 18 outputs “0”, which is the second control count value output from the second holding circuit 15, to the calculator 19. The calculator 19 calculates, as the reception time t4 of the received packet, the difference between the sum of the second control count value “0” output from the selector 18 and the calculation time count value “n+9” output from the third holding circuit 16 and the second value “3”, as shown in the following equation (6). t4=0+(n+9)-3=n+6 (6) The calculator 19 outputs to the time synchronization circuit 6 a count value indicating the reception time t4 of the received packet.
[0050] When the calculator 19 outputs a count value indicating the transmission time t1 of a transmission packet, the time synchronization circuit 6 stores the count value indicating the transmission time t1 in an internal memory. When the calculator 19 outputs a count value indicating the reception time t4 of the received packet, the time synchronization circuit 6 acquires the count value indicating the reception time t4 of the received packet and acquires the count value indicating the transmission time t1 from the internal memory. The time synchronization circuit 6 also acquires the count value indicating the time t2 and the count value indicating the time t3, which are included in the response packet received by the receiver of the slave device 2-1.
[0051] The time synchronization circuit 6 calculates the arrival delay time MLD using the transmission time t1, the reception time t2, the transmission time t3, and the reception time t4, as shown in the above formula (3). The time synchronization circuit 6 realizes time synchronization with the master device 1 by using the arrival delay time MLD.
[0052] In the above-mentioned second embodiment, the time keeping circuit 5 shown in Fig. 5 is configured to include a bit extraction circuit 20 instead of the control counter 13. The bit extraction circuit 20 extracts one or more bits from the multiple bits representing the time count value of the time counter 12 as the control count value of the control counter 13, and holds the value represented by the extracted bits. Therefore, like the time keeping circuit 5 shown in Fig. 2, the time keeping circuit 5 shown in Fig. 5 only needs to hold one time count value of about 100 bits to calculate the sending time of a transmitted packet and the receiving time of a received packet as the times required to calculate the arrival delay time.
[0053] Embodiment 3 In the third embodiment, a time holding circuit 5 including two sets of input ports 11-1 and 11-2, a first holding circuit 14, a second holding circuit 15, and an arithmetic circuit 17 will be described.
[0054] FIG. 7 is a configuration diagram showing a system including master devices 1-1 and 1-2 and a slave device 2-1. The master devices 1-1 and 1-2 each have a time counter having a count value of about 100 bits so as to be able to represent several decades' worth of time with an accuracy of less than a nanosecond. In the system shown in FIG. 7, the slave device 2-1 realizes time synchronization with, for example, the master device 1-1 or the master device 1-2. Here, an example will be described in which the slave device 2-1 achieves time synchronization with the master device 1-1 or the master device 1-2. However, this is merely an example, and for example, the slave device 2-1 may achieve time synchronization with the master device 1-1 and also with the master device 1-2. Furthermore, the slave device 2-1 may achieve time synchronization with the master device 1-1 or a slave device other than the slave device 2-1. In the system shown in FIG. 7, the slave device 2-1 includes a first pulse output circuit 3, a second pulse output circuit 4, a first pulse output circuit 3', a second pulse output circuit 4', a time holding circuit 5, and a time synchronization circuit 6.
[0055] First pulse output circuit 3' outputs a first pulse to time keeping circuit 5 at the same timing that the transmitting section of slave device 2-1 transmits a transmission packet as an Ethernet frame to master device 1-2. The second pulse output circuit 4' outputs a second pulse to the time keeping circuit 5 at the timing when the Ethernet frame transmitted from the master device 1-2 is received as a received packet by the receiving section of the slave device 2-1.
[0056] Fig. 8 is a configuration diagram showing a time keeping circuit 5 according to embodiment 3. In Fig. 8, the same reference numerals as in Fig. 2 denote the same or corresponding parts, and therefore a description thereof will be omitted. The time holding circuit 5 shown in FIG. 8 includes input ports 11-1 and 11-2, a time counter 12, a control counter 13, a first holding circuit 14, a second holding circuit 15, a third holding circuit 16 and an arithmetic circuit 17. Furthermore, the time holding circuit 5 shown in FIG. 8 includes input ports 11-1' and 11-2', a first holding circuit 14', a second holding circuit 15' and an arithmetic circuit 17'. The time counter 12, the control counter 13 and the third holding circuit 16 are shared by the two sets.
[0057] The input port 11-1' is a port for receiving the first pulse output from the first pulse output circuit 3'. The first pulse received by the input port 11-1' is applied to a first holding circuit 14'. The input port 11-2' is a port for receiving the second pulse output from the second pulse output circuit 4'. The second pulse received by the input port 11-2' is applied to a second holding circuit 15'.
[0058] The first holding circuit 14' holds, as a first control count value, the control count value at the timing when the transmission packet is transmitted from the transmitting section of the slave device 2-1. That is, the first holding circuit 14' holds the control count value held by the control counter 13 as a first control count value when the first pulse is output from the input port 11-1. The first holding circuit 14' outputs the held first control count value to the arithmetic circuit 17'.
[0059] The second holding circuit 15' holds, as a second control count value, the control count value at the timing when the reception packet is received by the receiving section of the slave device 2-1. That is, the second holding circuit 15' holds the control count value held by the control counter 13 as a second control count value when the second pulse is output from the input port 11-2'. The second holding circuit 15' outputs the held second control count value to the arithmetic circuit 17'.
[0060] The arithmetic circuit 17' includes a selector 18' and an arithmetic unit 19'. The calculation circuit 17' calculates, as the transmission time of the transmission packet, the difference between the sum of the first control count value output from the first holding circuit 14' and the calculation time count value output from the third holding circuit 16 and the second value. The calculation circuit 17' calculates the difference between the sum of the second control count value output from the second holding circuit 15' and the calculation time count value output from the third holding circuit 16 and the second value as the reception time of the received packet.
[0061] When the control count value held by the control counter 13 is, for example, a first value, the selector 18' outputs the first control count value output from the first holding circuit 14' to a calculator 19'. When the control count value held by the control counter 13 is, for example, the first value+1, the selector 18' outputs the second control count value output from the second holding circuit 15' to the calculator 19'.
[0062] The calculator 19' calculates the difference between the sum of the first control count value output from the selector 18' and the calculation time count value output from the third holding circuit 16 and the second value as the transmission time of the transmission packet. The calculator 19' calculates the difference between the sum of the second control count value output from the selector 18' and the calculation time count value output from the third holding circuit 16 and the second value as the reception time of the received packet. The calculator 19 ′ outputs to the time synchronization circuit 6 the transmission time of the transmitted packet and the reception time of the received packet.
[0063] Next, the operation of the system shown in FIG. 7 will be described. FIG. 9 is a timing chart showing the time calculation operation in the time keeping circuit 5. As shown in FIG. When slave device 2-1 achieves time synchronization with master device 1-1, the transmitter transmits a transmission packet to master device 1-1. When master device 1-1 receives the transmission packet transmitted from slave device 2-1, it obtains from its own time counter a count value indicating time t2 at which the transmission packet was received. Master device 1-1 returns a response packet including a count value indicating time t2 to slave device 2-1. The response packet includes a count value indicating time t3 when the response packet was returned, in addition to the count value indicating time t2.
[0064] The first pulse output circuit 3 of the slave device 2-1 outputs a first pulse to the time keeping circuit 5 at the same timing that the transmitter of the slave device 2-1 transmits a transmission packet. The second pulse output circuit 4 of the slave device 2-1 outputs a second pulse to the time keeping circuit 5 at the timing when the response packet transmitted from the master device 1-1 is received as a received packet by the receiving section of the slave device 2-1.
[0065] The operations of the input ports 11-1, 11-2, time counter 12, control counter 13, first holding circuit 14, second holding circuit 15, third holding circuit 16, arithmetic circuit 17 and time synchronization circuit 6 in the time holding circuit 5 are the same as those in embodiment 1, so detailed explanations will be omitted. In the example of Figure 9, the calculator 19 outputs "n+3" to the time synchronization circuit 6 as a count value indicating the transmission time t1 of the transmitted packet, and outputs "n+6" to the time synchronization circuit 6 as a count value indicating the reception time t4 of the received packet.
[0066] When the slave device 2-1 achieves time synchronization with the master device 1-2, the transmitter transmits a transmission packet to the master device 1-2. When master device 1-2 receives the transmission packet transmitted from slave device 2-1, it obtains from its own time counter a count value indicating time t2 at which the transmission packet was received. Master device 1-2 returns a response packet including a count value indicating time t2 to slave device 2-1. The response packet includes a count value indicating time t3 when the response packet was returned, in addition to the count value indicating time t2.
[0067] The first pulse output circuit 3' of the slave device 2-1 outputs a first pulse to the time keeping circuit 5 at the same timing that the transmitter of the slave device 2-1 transmits a transmission packet. The second pulse output circuit 4' of the slave device 2-1 outputs a second pulse to the time keeping circuit 5 at the timing when the response packet transmitted from the master device 1-2 is received as a received packet by the receiving section of the slave device 2-1.
[0068] When the input port 11-1' of the time holding circuit 5 receives the first pulse from the first pulse output circuit 3', it outputs the first pulse to the first holding circuit 14'. When the input port 11-2' of the time holding circuit 5 receives the second pulse from the second pulse output circuit 4', it outputs the second pulse to the second holding circuit 15'.
[0069] The first holding circuit 14' holds the control count value held by the control counter 13 as a first control count value when a first pulse is output from the input port 11-1'. In time keeping circuit 5 shown in FIG. 8, the control count value of control counter 13 changes as follows: 0→1→2→3→4→0→. . . 4→0→. . . In the example of FIG. 9, when the control count value is “2”, the first pulse is output from the input port 11-1′, so that the first holding circuit 14′ holds “2” as the first control count value. The first holding circuit 14' outputs the held first control count value to a selector 18' of an arithmetic circuit 17'.
[0070] The second holding circuit 15' holds the control count value held by the control counter 13 as a second control count value when a second pulse is output from the input port 11-2'. In the example of FIG. 9, when the control count value is “3”, the second pulse is output from the input port 11-2′, so that the second holding circuit 15′ holds “3” as the second control count value. The second holding circuit 15' outputs the held second control count value to a selector 18' of an arithmetic circuit 17'.
[0071] The time counter 12 has a time count value, and outputs the time count value to the third holding circuit 16 . In time holding circuit 5 shown in FIG. 8, the time count value of time counter 12 transitions as follows: n+0→n+1→n+2→···→n+18.
[0072] When the control count value held by the control counter 13 is reset to the first value, the third holding circuit 16 holds the time count value at the timing immediately before the control count value is reset as a calculation time count value. That is, when the control count value of the control counter 13 is reset to "0", the third holding circuit 16 holds the time count value when the control count value is "4" as the calculation time count value. In the example of FIG. 9, when the control count value is “4”, the time count values are “n+1”, “n+6”, “n+11”, and “n+16”, so when the control count value is reset to “0”, the time count values of “n+1”, “n+6”, “n+11”, and “n+16” are each held in turn in the third holding circuit 16 as time count values for calculation. The third holding circuit 16 outputs the held calculation time count value to each of the calculator 19 and calculator 19'.
[0073] The selector 18' outputs the first control count value "2" to the calculator 19' at the timing when the control count value held by the control counter 13 first becomes "0" after the first control count value is held in the first holding circuit 14'. That is, when the control count value held by the control counter 13 becomes "0" and the third holding circuit 16 holds "n+6" as the calculation time count value, the selector 18' outputs the first control count value "2" output from the first holding circuit 14' to the calculator 19'. The calculator 19' calculates, as the transmission time t1 of the transmission packet, the difference between the sum of the first control count value "2" output from the selector 18' and the calculation time count value "n+6" output from the third holding circuit 16 and the second value "4", as shown in the following equation (7). t1=2+(n+6)-4=n+4 (7) The calculator 19' outputs to the time synchronization circuit 6 a count value indicating the transmission time t1 of the transmission packet.
[0074] The selector 18' outputs the second control count value "3" to the calculator 19' at the timing when the control count value held by the control counter 13 first becomes "1" after the second control count value is held in the second holding circuit 15'. That is, when the control count value held by the control counter 13 becomes “1” and the third holding circuit 16 holds “n+6” as the calculation time count value, the selector 18′ outputs the second control count value “3” output from the second holding circuit 15′ to the calculator 19′. The calculator 19' calculates, as the reception time t4 of the received packet, the difference between the sum of the second control count value "3" output from the selector 18' and the calculation time count value "n+6" output from the third holding circuit 16 and the second value "4", as shown in the following equation (8). t4=3+(n+6)-4=n+5 (8) The calculator 19' outputs to the time synchronization circuit 6 a count value indicating the reception time t4 of the received packet.
[0075] When the calculator 19 outputs a count value indicating the transmission time t1 of a transmission packet, the time synchronization circuit 6 stores the count value indicating the transmission time t1 in an internal memory. When the calculator 19 outputs a count value indicating the reception time t4 of the received packet, the time synchronization circuit 6 acquires the count value indicating the reception time t4 of the received packet and acquires the count value indicating the transmission time t1 from the internal memory. The time synchronization circuit 6 also acquires the count value indicating the time t2 and the count value indicating the time t3, which are included in the response packet received by the receiver of the slave device 2-1.
[0076] The time synchronization circuit 6 calculates the arrival delay time MLD using the transmission time t1, the reception time t2, the transmission time t3, and the reception time t4, as shown in the above formula (3). The time synchronization circuit 6 uses the arrival delay time MLD to achieve time synchronization with the master device 1-2.
[0077] As described above, the time keeping circuit 5 shown in FIG. 8, like the time keeping circuit 5 shown in FIG. 2, only needs to hold one time count value of about 100 bits, and can calculate the sending time of a transmitted packet and the receiving time of a received packet, which are the times required to calculate the arrival delay time.
[0078] In addition, the present disclosure allows free combination of the respective embodiments, modification of any of the components of each embodiment, or omission of any of the components of each embodiment. [Explanation of symbols]
[0079] 1,1-1,1-2 master device, 2-1,2-2,2-3 slave device, 3,3' first pulse output circuit, 4,4' second pulse output circuit, 5 time holding circuit, 6 time synchronization circuit, 11-1,11-2,11-1',11-2' input port, 12 time counter, 13 control counter, 14,14' first holding circuit, 15,15' second holding circuit, 16 third holding circuit, 17,17' arithmetic circuit, 18,18' selector, 19,19' arithmetic unit, 20 bit extraction circuit.
Claims
1. a time counter having a time count value; a control counter having a control count value that changes within a range from a first value to a second value, the control count value being incremented every time the time count value is incremented, and the control count value being reset to the first value at the timing next when the control count value reaches the second value; a first holding circuit that holds the control count value at a timing when a transmission packet is transmitted as a first control count value; a second holding circuit that holds the control count value at a timing when the reception packet is received as a second control count value; a third holding circuit that holds the time count value at a timing immediately before the control count value is reset to the first value as a calculation time count value; the calculation time count value at the timing when the control count value is reset for the first time after the timing when the transmission packet is transmitted is defined as a first calculation time count value; the calculation time count value at a timing when the control count value is first reset after the timing when the reception packet is received is set as a second calculation time count value; a calculation circuit that calculates, as a transmission time of the transmission packet, a difference between the sum of the first control count value and the first calculation time count value and the second value, and calculates, as a reception time of the reception packet, a difference between the sum of the second control count value and the second calculation time count value and the second value; A time keeping circuit comprising:
2. The first holding circuit includes: when the first pulse is output from a first pulse output circuit which outputs a first pulse at a timing when the transmission packet is transmitted, a control count value held by the control counter is held as a first control count value; The second holding circuit includes:
2. The time holding circuit according to claim 1, wherein when a second pulse is output from a second pulse output circuit that outputs a second pulse at the timing when the received packet is received, the control count value held by the control counter is held as a second control count value.
3. A bit extraction circuit is provided instead of the control counter, The time holding circuit according to claim 1, characterized in that the bit extraction circuit extracts one or more bits from a plurality of bits representing the time count value possessed by the time counter as the control count value possessed by the control counter, and holds the value represented by the extracted bits.
Citation Information
Patent Citations
Media reproduction apparatus
JP2005311697A
Communication device and delay detection method
WO2012035629A1
Communication system, master device and slave device
WO2019003320A1
