WO2020062225A1 - Mac device and time point estimation method - Google Patents

Mac device and time point estimation method Download PDF

Info

Publication number
WO2020062225A1
WO2020062225A1 PCT/CN2018/109060 CN2018109060W WO2020062225A1 WO 2020062225 A1 WO2020062225 A1 WO 2020062225A1 CN 2018109060 W CN2018109060 W CN 2018109060W WO 2020062225 A1 WO2020062225 A1 WO 2020062225A1
Authority
WO
WIPO (PCT)
Prior art keywords
bit
time point
unit
bits
counter
Prior art date
Application number
PCT/CN2018/109060
Other languages
French (fr)
Chinese (zh)
Inventor
沈岚
朱久运
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN201880097191.4A priority Critical patent/CN112640355B/en
Priority to PCT/CN2018/109060 priority patent/WO2020062225A1/en
Publication of WO2020062225A1 publication Critical patent/WO2020062225A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L25/00Baseband systems
    • H04L25/38Synchronous or start-stop systems, e.g. for Baudot code
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L7/00Arrangements for synchronising receiver with transmitter

Definitions

  • the present application relates to the field of electronic communication technology, and in particular, to a MAC device and a time point estimation method.
  • the interface chip includes a media access control circuit (MAC) and a serializer / deserializer (serdes).
  • the MAC circuit further includes a MAC core unit and a physical coding sublayer.
  • PCS media access control circuit
  • PMA physical medium connection sublayer
  • the MAC core unit In the interface chip, the MAC core unit often needs to estimate the point in time when the PMA unit sends a specific bit to the serdes. For example, based on the Institute of Electrical and Electronics Engineers (Institute of Electrical and Electronics) IEEE 1588 protocol, the MAC core unit Need to estimate the time when the PMA unit sends the start bit of the 1588 message to serdes, and add a timestamp based on the time point to the 1588 message. For example, based on the y1731 protocol, the MAC core unit needs to estimate the PMA unit to serdes. When the start bit of the y1731 message is sent, the time stamp needs to be filled in the corresponding field segment of the y1731 message according to the y1731 protocol.
  • the conventional estimation methods can not meet the accuracy requirements of the MAC core unit 5G communication estimated time point, therefore, the estimated MAC core unit The accuracy of the time point needs to be further improved.
  • the embodiments of the present application provide a MAC device and a time point estimation method to improve the accuracy of the estimated time point.
  • an embodiment of the present application provides a media access control MAC device, including: a MAC core unit and a physical medium connection sublayer PMA unit; wherein the PMA unit is configured to obtain a first time point of a first bit, After that, the first time point is sent to the MAC core unit; wherein the first time point of the first bit is the time point when the PMA unit sends the first bit; the MAC core unit is used to receive the target bit to be sent , Based on the first time point and the number of bits between the target bit and the first bit, estimate the second time point at which the PMA unit sends the target bit; wherein the first bit and the target bit are PMA The bits in a data stream that a unit sends continuously.
  • the obtained first time point when the PMA unit sends the first bit is a more accurate time point.
  • the PMA unit in the MAC device can continuously send out data streams, between the second time point at which the PMA unit sends the target bit and the first time point at which the first bit is sent
  • the time interval can be obtained by more accurately estimating the number of bits between the target bit and the first bit. Therefore, based on the number of bits between the target bit and the first bit, and the first point in time when the PMA sends the first bit, the MAC core unit can more accurately estimate the The second time point is conducive to improving the accuracy of the time point estimated by the MAC core unit.
  • the PMA unit is directly connected to the MAC core unit; the PMA unit may directly send the first time point to the MAC core unit through the connection with the MAC core unit.
  • the PMA unit may send the first time point to the MAC core unit via the PCS unit.
  • the PMA unit is further configured to: receive a first signal and a data stream sent by the MAC core unit to the PMA unit through the PCS unit; wherein the first signal is used to instruct the PMA unit to receive from the PCS unit The first bit in the data stream.
  • the PMA unit can determine and determine the first bit in the received data stream according to the first signal, and then can obtain the first time point of the first bit.
  • the first bit may be a bit that meets a preset rule in a data stream sent by the MAC core unit to the PCS unit, where the preset rule includes an interval between any adjacent first bits.
  • the preset number of bits may be a bit that meets a preset rule in a data stream sent by the MAC core unit to the PCS unit, where the preset rule includes an interval between any adjacent first bits.
  • the MAC core unit can update the first time point after sending a preset number of bits. Since there will also be a certain error between the clock of the MAC core unit and the clock of the PMA unit, updating the first time point at an interval can reduce the error accumulation between the clocks of the two units, thereby further increasing the time estimated by the MAC core unit. Point precision.
  • the MAC core unit is further configured to enable a first counter, where the first counter is used to count the number of bits that the MAC core unit continues to receive after receiving the first bit; At the first point in time and the number of bits between the target bit and the first bit, the first counter is stopped before the second point in time when the PMA unit sends the target bit; the value recorded by the first counter is then Is the number of bits spaced between the target bit and the first bit.
  • the MAC core unit is further configured to: count the number of received bits through the second counter; when the second counter accumulates 64 bits, restart the second counter and update the current value of the first counter. An additional 2 bits are added to the recorded value.
  • the PCS unit encodes the data stream received from the MAC core unit, and encodes every 64 bits. One encoding adds 2 bits to the data stream.
  • the second counter adds 2 to the currently recorded value of the first counter every 64 bits, so that the counting result of the first counter includes the increased number of bits of the PCS unit code, thereby making the counting result more accurate. , Further improving the accuracy of the time point estimated by the MAC core unit.
  • the first signal may be a pulse signal.
  • the target bit may be a start bit of a 1588 packet; the MAC core unit may also be configured to add or update a timestamp in the 1588 packet according to a second time point obtained by estimation. .
  • an embodiment of the present application provides a media access control MAC device, which includes: a MAC core unit and a physical medium connection sublayer PMA unit; wherein the PMA unit is configured to obtain a third time of a second bit And the third time point is sent to the MAC core unit; the third time point of the second bit is the time point when the PMA unit receives the second bit; the MAC core unit is used to receive the target bit, and Three time points, and the number of bits between the target bit and the second bit, estimate the fourth point in time when the PMA unit receives the target bit; where the target bit and the second bit are consecutively received by the PMA unit Bits in the data stream.
  • the PMA unit may send the third time point to the MAC core unit via the PCS unit.
  • the MAC core unit is further configured to: receive a second signal and a data stream sent by the PMA unit to the MAC core unit through the PCS unit; the second signal is used to instruct the MAC core unit to send the data from the PCS The second bit in the data stream received by the unit.
  • Some MAC core units cannot identify the function of the first bit from the data stream. With the above scheme, the MAC core unit can determine the second bit in the received data stream according to the second signal, so that the number of bits that continue to be received after receiving the second bit can be recorded.
  • the second bit may be a bit that satisfies a preset rule in a data stream sent by the PMA unit to the PCS unit, where the preset rule includes an interval between any adjacent second bit bits. Set the number of bits.
  • the MAC core unit is further configured to: enable a third counter, and the third counter is used to count the number of bits that the MAC core unit continues to receive after receiving the second signal; At the time point and the number of bits between the target bit and the second bit, it is estimated that the third counter is stopped before the fourth time point when the PMA unit receives the target bit; the value recorded by the third counter is the target bit The number of bits spaced from the second bit.
  • the MAC core unit is further configured to: count the number of received bits by a fourth counter; when the fourth counter accumulates 64 bits, restart the fourth counter and reset the An additional 2 bits are added to the value currently recorded by the three counters.
  • the PCS unit decodes the data stream received from the PMA unit. Decoding is performed every 64 bits. A decoding will deduct 2 bits from the data stream. With the above scheme, the fourth counter adds 2 to the currently recorded value of the third counter every 64 bits, so that the counting result of the third counter includes the number of bits subtracted by the PCS unit code, thereby making the counting result more accurate. , Which can further improve the accuracy of the time point estimated by the MAC core unit.
  • the second signal is a pulse signal.
  • an embodiment of the present application provides a time point estimation method, including: obtaining a first time point of a first bit; wherein the first time point of the first bit is a time point of transmitting the first bit; Receive the target bit to be transmitted, and estimate the second time point at which the target bit is sent according to the first time point and the number of bits between the target bit and the first bit; the first bit and the target bit Bits in a continuously transmitted data stream.
  • a first counter may also be turned on.
  • the first counter is configured to count the number of bits that are continuously received after the first bit is received, and according to the first time point and the target bit. The number of bits between the first bit and the first bit. Stop the first counter before the second time point when the target bit is estimated to be sent; the value recorded by the first counter can be used as the interval between the target bit and the first bit. The number of spaced bits.
  • the number of received bits can also be counted by the second counter; when the second counter accumulates 64 bits, the second counter is restarted and an additional value is added to the currently recorded value of the first counter. Add 2 bits.
  • the target bit may be a start bit of a 1588 packet; the MAC core unit may also add or update a time stamp in the 1588 packet according to the second time point obtained by the estimation.
  • an embodiment of the present application provides another method for estimating a time point, including: acquiring a third time point of a second bit; wherein the third time point of the second bit is a time point of receiving the second bit Receive the target bit, and estimate the fourth point in time when the target bit is received according to the third point in time, and the number of bits between the target bit and the second bit; in which the target bit and the second bit Bits are bits in a continuously received data stream.
  • a third counter may also be turned on.
  • the third counter is used to count the number of bits that are continuously received after the second bit is received; according to the third time point, and the target bit The number of bits between the second and second bits can be stopped before the fourth time point when the target bit is estimated to be received; the value recorded by the third counter can be used as the target bit and the second bit The number of bits spaced between bits.
  • the number of received bits can also be counted by a fourth counter; when the fourth counter accumulates 64 bits, the fourth counter is restarted and an additional value is added to the currently recorded value of the third counter. Add 2 bits.
  • an embodiment of the present application further provides a chip, which includes a MAC device and a parallel / serializer serdes, and a PMA unit in the MAC device is connected to the serdes; wherein the MAC device is the first aspect as described above, or Any implementation manner of one aspect, or a MAC device provided by the second aspect, or any implementation manner of the second aspect.
  • an embodiment of the present application further provides an electronic device, where the electronic device includes the chip provided by the fifth aspect.
  • an embodiment of the present application further provides a program, which when executed on the device, will cause the device to implement the third aspect, or any implementation manner of the third aspect, or the fourth aspect, or Time point estimation method provided by any implementation manner of the fourth aspect
  • FIG. 1 is a schematic diagram of a wireless network communication system architecture
  • FIG. 2 is a schematic diagram of an interface chip structure
  • FIG. 3 is a schematic diagram of a data flow relationship between a MAC core unit and a PMA unit according to an embodiment of the present application
  • FIG. 4 is a schematic flowchart of a time point estimation method according to an embodiment of the present application.
  • FIG. 5 is a schematic diagram of a first signal inside a MAC device according to an embodiment of the present application.
  • FIG. 6 is a schematic flowchart of a possible time point estimation method according to an embodiment of the present application.
  • FIG. 7 is a schematic flowchart of a time point estimation method according to an embodiment of the present application.
  • the network elements in the system often need to estimate the transmission or reception time point of a specific bit.
  • the estimation of the transmission or reception time point of a specific bit is performed by the interface chip in the network element. of.
  • FIG. 1 is a schematic diagram of a wireless network communication system architecture.
  • the wireless communication system includes multiple base stations (such as base station 41 and base station 42), multiple network elements (NE) (such as NE31, NE32, NE33, NE34, NE35 and NE36), a global positioning system (GPS) signal receiver 1, and a radio network controller (RNC) 2 and the like.
  • NE network elements
  • GPS global positioning system
  • RNC radio network controller
  • the GPS signal receiver 1 in FIG. 1 is used to generate a time signal with nanosecond accuracy by using a GPS to tame a crystal oscillator.
  • the time signal generated by the GPS signal receiver 1 is used for periodic time synchronization of the entire clock network.
  • the clock network is a network composed of multiple network elements in FIG. 1 and can also be referred to as a precision timing protocol.
  • PTP Precision timing protocol
  • the network elements in the PTP system can generally be divided into a boundary clock (BC) node, an ordinary clock (OC) node and a transparent clock (TC) node according to their position and function in the network.
  • the BC node such as NE31 in FIG. 1, has multiple 1588 ports, one of which can be a slave port, and the other ports can be master ports.
  • the BC node synchronizes the frequency and time of the clock with the upper-level device through the slave port (see GPS signal receiver 1 in Figure 1). After that, synchronization packets are sent to multiple lower-level devices (such as NE32 and NE33 in Figure 1) through multiple master ports.
  • the synchronization message includes a timestamp, and the time pointed to by the timestamp is obtained by the BC node according to the time signal received by the slave port and the processing delay of the BC node itself.
  • An OC node such as NE35 and NE36 in Figure 1, is usually the start or end device of the clock network. It has only one 1588 port, and this port can only be used as a slave port or a master port.
  • TC nodes such as NE32, NE33, and NE34 in Figure 1, have multiple 1588 ports.
  • the TC node forwards all received synchronization messages, measures the dwell time of the synchronization messages after passing through the TC nodes, and updates the time stamp in the synchronization messages.
  • a BC node and a TC node when they need to add (or update) a timestamp to the 1588 message.
  • the timestamp is used to instruct the BC node or TC node to send a 1588 message.
  • the BC node and the TC node generally need to configure an interface chip to add a time stamp to the 1588 message by estimating the transmission time point of the start bit of the 1588 message.
  • FIG. 2 is a schematic structural diagram of an interface chip.
  • the interface chip 200 includes: a MAC circuit 201 and a serdes 202, wherein the MAC circuit 201 further includes a MAC core unit 2011, a PCS unit 2012, and a PMA unit 2013.
  • the MAC core unit 2011 is often used to estimate the time point when the PMA unit sends a specific bit to the serdes. Taking a 1588 message based on the IEEE1588 protocol as an example, the MAC core unit 2011 is often used to estimate the time point when the PMA unit 2013 sends the start bit to serdes202 when the start bit of the 1588 message is received, and then according to the time point Timestamp 1588 packets. After that, the MAC core unit 2011 sends the timestamped 1588 message to the PCS unit 2012. The PCS unit 2012 physically encodes and scrambles the 1588 message, and then sends the physically encoded 1588 message to the PMA unit 2013. The PMA unit 2013 is used for bit width conversion to match the transmitted bit width with the received bit width of serdes202, thereby sending a 1588 message to serdes202, and sending the 1588 message to other network elements via serdes202.
  • FIG. 3 exemplarily illustrates a data flow relationship between the MAC core unit 2011 and the PMA unit 2013.
  • the MAC core unit 2011 in FIG. 3 can send 80-bit data to the PMA unit 2013 via the PCS unit 2012 within a unit time T.
  • the PMA unit 2013 sent 40bit data to serdes202 within unit time T.
  • FIG. 3 after the MAC core unit 2011 sends 80-bit data to the PCS unit 2012 within the first unit time T1, it stops sending data to the PCS unit 2012 within the second bit time T2.
  • the third unit time T3 continue to send 80bit data to the PCS unit 2012, and in the fourth unit time, stop sending data to the PCS unit 2012.
  • the MAC core unit 2011 mostly estimates the target bit (such as the start bit of a 1588 message) and the estimated delay of the target bit in the MAC circuit 201.
  • the MAC circuit 201 estimates the target bit.
  • the time sent to serdes202 For example, when the time point at which the MAC core unit 2011 receives the target bit is ta and the estimated delay is tdelay, the time point at which the estimated MAC circuit 201 sends the target bit to serdes 202 is ta + tdelay.
  • the MAC core unit 2011 estimates the time delay of the target bit in the MAC circuit 201, it is generally estimated according to factors such as the logical architecture and transmission bandwidth of the PCS unit 2012 and the PMA unit 2013. However, the PCS unit 2012 and the PMA unit 2013 will have different logical architectures under different system designs. As a result, the algorithm for estimating the delay needs to be adjusted differently, and the versatility is poor. Moreover, the delay caused by the target bit passing through the asynchronous first-in-first-out (AFIFO) queue in the PMA unit 2013 is uncertain and cannot be accurately estimated, causing the PMA unit 2013 sent by the MAC core unit 2011 to be sent. The accuracy of the time point of the target bit cannot meet the requirements of 5G communication.
  • AFIFO asynchronous first-in-first-out
  • an embodiment of the present application provides a MAC device to improve the accuracy of estimating the time point when the PMA unit 2013 sends the target bit.
  • the device may be the MAC circuit 201 in the interface chip 200 in FIG. 2, or may be an independent chip, which is not limited in this application.
  • the following uses the MAC circuit 201 in the interface chip 200 as an example for description. Therefore, the MAC device provided in the embodiment of the present application may also be represented by the MAC device 201.
  • the PMA unit 2013 is configured to obtain a first time point of a first bit, and send the first time point to the MAC core unit.
  • the first point in time of the first bit is the point in time when the PMA unit sends the first bit.
  • the first bit may be a bit in a data stream sent by the MAC core unit 2011 to the PMA unit 2013 via the PCS unit 2012.
  • the first bit may be any bit in a data stream sent by the MAC core unit 2011 to the PCS unit 2012.
  • the first bit may also be It is a bit in the data stream sent by the MAC core unit 2011 to the PCS unit 2012 that meets a preset rule.
  • the MAC core unit 2011 determines a preset number of bits per interval to determine the currently sent bit as the first bit.
  • the MAC core unit 2011 determines the 60th bit data sent in T1 as the first bit bit1.
  • the data stream sent by the MAC core unit 2011 to the PCS unit 2012 includes, but is not limited to, various types of messages and code streams. For the PCS unit 2012 and the PMA unit 2013, the specific content of the data stream can be distinguished without Process the received data stream directly.
  • the PMA unit 2013 After receiving the data stream from the PCS unit 2012, the PMA unit 2013 performs a process such as bit width conversion on the received data stream, and then continuously sends the processed data stream. The first bit is also included in the data stream continuously sent by the PMA unit.
  • the PMA unit 2013 may obtain a first time point at which the first bit is transmitted through an internal clock circuit thereof.
  • the first time point at which the PMA unit 2013 collects and sends the first bit bit1 in FIG. 3 is t1.
  • the PMA unit 2013 may send the first time point to the MAC core unit 2011 via the PCS unit 2012.
  • the PMA unit 2013 and the MAC core unit 2011 are directly connected through a wire, and the PMA unit 2013 is directly connected to the MAC core unit 2011 with a first time point.
  • This application provides a PMA unit 2013 with a first time point transmission to the MAC core unit 2011 by adding a wire between the PMA unit 2013 and the MAC core unit 2011. Path, and the structure is simple to implement, low in cost, and higher in transmission speed.
  • the MAC core unit 2011 is configured to receive a target bit to be transmitted, and estimate based on the first time point and the number of bits between the target bit and the first bit.
  • the data stream where the target bit is located is passed through the MAC core unit 2011 and the PCS unit 2012, the data stream where the target bit is located is sent by the PMA unit 2013.
  • the above-mentioned first time point may be the first time point at which the MAC core unit last received and buffered from the PMA unit 2013.
  • the 20th bit received by the MAC core unit 2011 within the third unit time T3 is the target bit bit0. Then, the MAC core unit 2011 may send the bit The first time point estimates the second time point at which the PMA unit 2013 sends bit0.
  • the interval between bit0 and bit1 is 40 bits. Since PMA unit 2013 sends data continuously, the MAC core unit 2011 can determine the time between sending bit0 and sending bit1 of PMA unit 2013 by calculating the time when 40 bits of data is sent by PMA unit 2013. The time interval between the two, combined with the first time point of sending bit 1 obtained in advance, can obtain the second time point of sending bit 0 by the PMA unit 2013.
  • the MAC core unit 2011 estimates the second time point at which the PMA unit 2013 sends the target bit according to the first point in time and the number of bits between the target bit and the first bit.
  • the second time point can be estimated according to the following formula 1:
  • t1 is the first time point
  • t2 is the second time point
  • n is the number of bits between the target bit and the first bit
  • UI is the transmission time for the PMA unit 2013 to send 1-bit data.
  • the UI may be obtained according to the bandwidth of the serdes 202. For example, when the bandwidth of the serdes 202 is 10.3125 Gbps, the value of the UI may be 1 / 10.3125 Gbps ⁇ 97 ps.
  • the MAC core unit 2011 After the MAC core unit 2011 obtains the second time point, it can add (or update) a timestamp to the 1588 message according to the second time point, and add (or update) the 1588 message with the timestamp.
  • the PCS unit 2012 sends it to the PMA unit 2013, and the PMA unit 2013 sends a 1588 packet to serdes202.
  • the obtained first time point when the PMA unit 2013 sends the first bit is a more accurate time point.
  • the PMA unit 2013 between the second time point at which the target bit is transmitted and the first time point at which the first bit is transmitted The time interval can be obtained by relatively accurately estimating the number of bits between the target bit and the first bit. Therefore, the MAC core unit 2011 can more accurately estimate the transmission target of the PMA unit 2013 based on the number of bits between the target bit and the first bit, and the first time point when the PMA unit 2013 sends the first bit.
  • the second time point of the bit is conducive to improving the accuracy of the time point at which the estimated PMA unit 2013 sends the target bit.
  • the error can be controlled within 1 ns, which can meet the needs of 5G communication.
  • the first bit may not have a fixed feature.
  • PMA units 2013 When most PMA units 2013 send data streams, they will fail to identify the first bit in the data stream, resulting in PMA unit 2013 being unable to obtain the first point in time of the first bit.
  • the PMA unit 2013 in the embodiment of the present application is further configured to receive the first signal and data stream sent by the MAC core unit 2011 to the PMA unit 2013 via the PCS unit 2012.
  • the first signal is used to indicate a first bit in a data stream received by the PMA unit from the PCS unit.
  • the first signal may be a pulse signal.
  • the first signal is a parallel signal of the first bit in the data stream, and the two are synchronized in time.
  • the PMA unit receives the first bit from the PCS unit, it also receives the first signal.
  • the PMA unit can determine that the currently received bit is the first bit.
  • the PMA unit further processes the first signal of the data stream in parallel, and uses the time point when the first signal parallel processing is completed as the first time point.
  • the MAC core unit 2011 when the MAC core unit 2011 sends the first bit, the first signal is sent in parallel, and the first signal is used as the parallel signal of the first bit.
  • the MAC core unit 2011 may send the first signal through out-of-band transmission, so that the transmission bandwidth of the data stream is not occupied.
  • the first signal is always parallel to the first bit in the PCS unit 2012 and the PMA unit 2013. For example, when the first signal passes through the PCS unit 2012 and the PMA unit 2013, it will undergo the same processing process as the first bit. Therefore, the same transmission delay as that of the first bit will be generated, so as to keep parallel with the first bit.
  • the PMA unit 2013 finishes processing the first signal, it also finishes sending the first bit, so the time point at which the first bit is sent can be determined according to the time point when the processing of the first signal is completed, that is, the first time point.
  • the PMA unit 2013 may use the processing result of the first signal as a trigger condition for obtaining a first time point.
  • the PMA unit 2013 obtains the current time point from the clock circuit as the first time point.
  • the MAC core unit 2011 needs to estimate the second time point at which the PMA unit 2013 sends the target bit according to the number of bits between the target bit and the first bit.
  • the MAC core unit 2011 is further configured to enable a first counter, where the first counter is used to count the number of bits that the MAC core unit 2011 continues to receive after receiving the first bit; The first counter is stopped before the second time point at which the PMA unit 2013 sends the target bit is estimated based on the first time point and the number of bits between the target bit and the first bit. At this time, the first counter records The value of can be used as the number of bits between the target bit and the first bit.
  • the MAC core unit 2011 after receiving the first bit bit1, the MAC core unit 2011 starts a first counter.
  • the first counter starts to record the number of bits that the MAC core unit 2011 continues to send after sending the first bit bit1.
  • the MAC core unit 2011 stops the first counter.
  • the value recorded by the first counter is the bit number of 40 bits, which is the interval between bit0 and bit1.
  • the PCS unit 2012 will encode the data stream sent by the MAC core unit 2011 based on the provisions of the IEEE 802.3 protocol. Usually, the encoding is performed every 64 bits. Each encoding will add 2 bits to the data stream. . For example, if the size of the data stream sent by the MAC core unit 2011 to the PCS unit 2012 is 128 bits, after being encoded by the PCS unit 2012, the size of the data stream sent by the PCS unit 2012 to the PMA unit 2013 becomes 132 bit. The encoding of the data stream by the PCS unit 2012 will change the size of the data stream, which is not conducive to improving the accuracy of the estimated second time point.
  • the MAC core unit 2011 is further configured to: use a second counter to count the number of transmitted bits; when the second counter accumulates 64 bits, restart the second counter and restart the An additional 2 bits are added to the currently recorded value of a counter.
  • the second counter after the restart may continue to count the number of bits sent by the MAC core unit 2011 from zero.
  • the MAC core unit 2011 adds 2 to the currently recorded value of the first counter through the second counter every 64 bits, so that the counting result of the first counter includes an increase in the data stream due to the encoding of the PCS unit 2012. The number of bits, thereby making the counting result more accurate, and further improving the accuracy of the estimated second time point.
  • the embodiment of the present application further provides another MAC device, which can more accurately estimate the time point when the PMA unit receives the target bit.
  • the structure of the MAC device for estimating the time point when the PMA unit receives the target bit provided in the embodiment of the present application is similar to that of the foregoing MAC device for estimating the time point when the PMA unit sends the target bit. Therefore, the embodiment of the present application
  • the MAC device 201 shown in FIG. 2 will continue to be used as an example to describe the MAC device for estimating the time point when the PMA unit receives the target bit.
  • the PMA unit 2013 is configured to obtain a third time point of the second bit and send the third time point to the MAC core unit 2011.
  • the third point in time of the second bit is the point in time when the PMA unit receives the second bit.
  • the PMA unit 2013 may continuously receive a data stream from the serdes 202, and the data stream may be in various forms such as a message and a code stream.
  • the PMA unit 2013 performs processing such as bit width conversion on the received data stream and sends it to the PCS unit 2012.
  • the PCS unit 2014 performs decoding and other processing on the received data stream and sends it to the MAC core unit 2011.
  • the second bit may be any bit in the data stream sent by the PMA unit 2013 to the PCS unit 2012, or the data stream sent by the PMA unit 2013 to the PCS unit 2012 satisfies a preset rule.
  • the PMA unit 2013 presets the number of bits every interval to determine that the currently sent bit is the first bit.
  • the PMA unit 2013 in the MAC device 201 can send the third time point via the PCS unit. Send to MAC core unit 2011.
  • the MAC core unit 2011 is configured to receive a target bit, and estimate a fourth time point at which the PMA unit 2013 receives the target bit according to the third time point and the number of bits between the target bit and the second bit.
  • the target bit is a bit in the data stream received by the PMA unit 2012 and is sent to the MAC core unit 2011 via the PMA unit 2013 and the PCS unit 2012.
  • the MAC core unit 2011 estimates the fourth time point according to the following formula 2:
  • t3 is the third time point
  • t4 is the fourth time point
  • m is the number of bits between the target bit and the second bit
  • UI is the transmission time for the PMA unit 2013 to receive 1-bit data.
  • the UI may be obtained according to the bandwidth of the serdes 202.
  • the PMA unit 2013 in the MAC device 201 can continuously receive the data stream from the serdes 202, the PMA unit 2013 is between the fourth time point when the target bit is received and the third time point when the second bit is received
  • the time interval can be obtained by relatively accurately estimating the number of bits between the target bit and the second bit. Therefore, the MAC core unit 2011 can accurately estimate the number of bits received by the PMA unit 2013 based on the number of bits between the target bit and the second bit, and the third time point when the PMA unit 2013 receives the second bit.
  • the fourth time point of the target bit is the fourth time point of the target bit.
  • the second bit may not have a fixed feature. Therefore, most MAC core units 2011 do not have the function of identifying the second bit in the data stream when receiving the data stream. Based on this, the MAC core unit 2011 is also used to: receive the second signal and data stream sent by the PMA unit 2013 to the MAC core unit 2011 via the PCS unit 2012; the second signal is used to instruct the MAC core unit 2011 to receive data from the PCS unit 2012 The second bit in the stream.
  • the second signal may be a pulse signal.
  • the second signal may also be a parallel signal of the second bit. The parallel relationship between the second signal and the second bit is similar to the parallel relationship between the first signal and the first bit. This embodiment of the present application will not repeat them.
  • the MAC core unit 2011 needs to estimate the fourth time point when the PMA unit 2013 receives the target bit according to the number of bits between the fourth bit and the third bit.
  • the MAC core unit 2011 is further configured to enable a third counter, and the third counter is used to count the number of bits that the MAC core unit 2011 continues to receive after receiving the second bit; At the third point in time and the number of bits between the target bit and the second bit, it is estimated that before the fourth point in time when the PMA unit 2013 sends the target bit, the third counter is stopped; the value recorded by the third counter can be The number of bits used as the interval between the target bit and the second bit.
  • the MAC core unit 2011 may determine whether the second bit is received according to the second signal. After receiving the second signal, the MAC core unit 2011 starts a third counter and starts counting the number of bits that continue to be received after receiving the second bit.
  • the PCS unit 2012 has a decoding function. Decoding is performed once every 64 bits. One decoding will deduct 2 bits from the data stream received by the PCS unit 2012.
  • the MAC core unit 2011 is further configured to: count the number of received bits through a fourth counter; and in the fourth counter, When 64 bits are accumulated, the fourth counter is restarted and an additional 2 bits are added to the currently recorded value of the third counter.
  • the MAC core unit 2011 adds 2 to the currently recorded value of the first counter through the fourth counter every 64 bits, so that the counting result of the first counter includes the PMA unit 2013 due to the decoding of the PCS unit 2012.
  • the number of bits subtracted from the received data stream makes the counting result more accurate, thereby improving the accuracy of the fourth time point obtained by the estimation.
  • the embodiment of the present application further provides a time point estimation method, which can estimate a time point at which a target bit is transmitted.
  • the point-in-time estimation method provided in the embodiment of the present application may be implemented by software.
  • a processor inside a device that sends a target bit may call a program instruction stored in a memory to execute the method provided in the embodiment of the present application.
  • Point-in-time estimation method may also be implemented by a combination of hardware and software, for example, a MAC device shown in FIG. 2.
  • the embodiment of the present application uses the MAC device shown in FIG. 2 as an example to introduce the time point estimation method provided in the embodiment of the present application.
  • FIG. 4 is a schematic flowchart of a time point estimation method according to an embodiment of the present application. As shown in FIG. 4, the method mainly includes the following steps:
  • the PMA unit 2013 obtains a first time point of a first bit.
  • the first time point of the first bit is the time point when the PMA unit 2013 sends the first bit.
  • the PMA unit sends the first time point to the MAC core unit 2011.
  • the MAC core unit 2011 receives the target bit to be transmitted, and estimates the second time point at which the PMA unit 2013 sends the target bit according to the first time point and the number of bits between the target bit and the first bit. .
  • the MAC core unit 2011 when the MAC core unit 2011 sends the data stream including the first bit to the PMA unit 2013 via the PCS unit 2012, the MAC core unit 2011 may also send a first signal to the PMA unit 2013 via the PCS unit 2012;
  • the signal is a parallel signal of the first bit; when the PMA unit 2013 processes the data stream, the first signal and the first bit are processed in parallel, and the time when the first bit and the parallel processing complete the first signal is taken as the The first point in time.
  • the first signal may be a pulse signal.
  • FIG. 5 uses a 1588 message as an example, which is a schematic diagram of a first signal inside a MAC device according to an embodiment of the present application, where a start bit of a 1588 message is a target bit.
  • the MAC core unit 2011 sends the first signal and the first bit bit1 to the PMA unit 2013 in parallel, where the first signal is transmitted out of band and does not occupy the transmission bandwidth of the data stream where bit1 is located.
  • the PMA unit 2013 processes and sends bit1, and obtains the time point when the processing of the first signal is completed as the first time point t1. After that, the PMA unit 2013 sends the first time point t1 to the MAC core unit 2011.
  • the MAC core unit 2011 When the MAC core unit 2011 receives the target bit, it estimates the second time point t2 according to the first time point t1, the number of bits spaced between the target bit and bit1. After that, the MAC core unit 2011 adds (or updates) a timestamp to the 1588 message according to the second time point t2, and sends the 1588 message with the timestamp added (or updated) to the PMA unit 2013 via the PCS unit 2012. After the PMA unit 2013 receives and processes the 1588 message, it sends the processed 1588 message.
  • the MAC core unit 2011 may also enable a first counter.
  • the first counter is used to count the number of bits that the MAC core unit 2011 continues to receive after receiving the first bit; the MAC core The unit 2011 stops the first counter before estimating the second time point at which the PMA unit 2013 sends the target bit based on the first time point and the number of bits between the target bit and the first bit. At this time, the first counter The value recorded by the counter can be used as the number of bits between the target bit and the first bit.
  • FIG. 6 is a schematic flowchart of a possible time point estimation method provided by an embodiment of the present application. As shown in FIG. 6, it mainly includes the following steps:
  • the MAC core unit 2011 sends a first signal to the PMA unit 2013 via the PCS unit 2012, and starts a first counter.
  • S602 The PMA unit 2013 completes processing of the first signal, and obtains the time point when the processing completes the first signal as the first time point.
  • the PMA unit 2013 sends the acquired first time point to the MAC core unit 2011.
  • the MAC core unit 2011 receives and buffers the first time point.
  • the MAC core unit 2011 estimates the second time point according to the value currently recorded by the first counter and the first time point.
  • a 1588 message is time stamped (or updated) according to the estimated second time point.
  • the MAC core unit 2011 sends (adds or updates) a 1588 packet to the PMA unit 2013 via the PCS unit 2012.
  • S607 The MAC core unit 2011 determines whether the first time point needs to be updated. If yes, go back to S601; if not, go back to S605.
  • the MAC core unit 2011 may determine a first bit from the received data stream according to a preset bit-bit interval. When a first bit that satisfies a preset rule is received, the MAC core unit 2011 may It can be considered that the first time point needs to be updated.
  • the MAC core unit 2011 may also count the number of bits transmitted by using a second counter; when the MAC core unit 2011 accumulates 64 bits, the second counter is restarted and the first counter An additional 2 bits are added to the value currently recorded by the counter.
  • an embodiment of the present application further provides a method for estimating a point in time, which can estimate a point in time when a target bit is received.
  • the point-in-time estimation method provided in the embodiment of the present application may be implemented by software.
  • a processor inside a device receiving a target bit may call a program instruction stored in a memory to execute the method provided in the embodiment of the present application.
  • Point-in-time estimation method may also be implemented by a combination of hardware and software, for example, a MAC device shown in FIG. 2.
  • the embodiment of the present application uses the MAC device shown in FIG. 2 as an example to introduce the time point estimation method provided in the embodiment of the present application.
  • FIG. 7 is a schematic flowchart of a time point estimation method according to an embodiment of the present application. As shown in FIG. 7, the method mainly includes the following steps:
  • the PMA unit 2013 obtains a third time point of the second bit, and sends the third time point to the MAC core unit 2011.
  • the third point in time of the second bit is the point in time when the second bit is received by the PMA unit 2013.
  • the second bit is a bit in a data stream continuously received by the PMA unit 2013.
  • the PMA unit sends the data where the second bit is located to the MAC core unit 2011 through the PCS unit 2012.
  • the MAC core unit 2011 receives the second bit from the PCS unit 2012, and receives the third time point sent by the PMA unit 2013.
  • the MAC core unit 2011 may further buffer the third time point.
  • the MAC core unit 2011 receives the target bit, and estimates the fourth time point at which the PMA unit 2013 receives the target bit according to the third time point and the number of bits between the target bit and the second bit.
  • the PMA unit will continue to send the received data to the MAC core unit through the PCS unit 2012.
  • the MAC core unit 2011 receives the data stream sent by the PCS2012, and when receiving the target bit, it can execute S703.
  • the PMA unit 2013 may further generate a second signal; when the received second bit is processed, the second signal is processed in parallel; and the PCS unit 2012 sends the processing to the MAC core unit 2011
  • the second signal is sent in parallel to the MAC core unit 2011 via the PCS unit 2012; the MAC core unit 2011 receives the second signal and the second bit sent in parallel by the PCS unit 2012; The number of bits that continue to be received after the second bit.
  • the second signal may be a pulse signal.
  • the second bit is a bit in the data stream sent by the PMA unit 2013 to the PCS unit 2012 that meets a preset rule; the preset rule includes a preset interval between any adjacent second bits The number of bits.
  • the MAC core unit 2011 may further enable a third counter.
  • the third counter is used to count the number of bits that the MAC core unit 2011 continues to receive after receiving the second signal; the MAC core unit 2011
  • the third counter can be stopped before the fourth time point at which the PMA unit 2013 sends the target bit is estimated based on the third time point and the number of bits between the target bit and the second bit.
  • the third counter The recorded value can be used as the number of bits between the target bit and the second bit.
  • the MAC core unit 2011 may also count the number of received bits through a fourth counter; when the fourth counter accumulates 64 bits, restart the fourth counter and record the An additional 2 bits are added to the value.
  • an embodiment of the present application further provides a chip, which includes a MAC device provided by any one of the foregoing embodiments.
  • the chip further includes serdes.
  • serdes is connected to the PMA unit in the MAC device. It should be understood that there may be two separate circuit structures between the serdes and the MAC device, or they may be integrated into the same circuit structure.
  • serdes may also be integrated with the PMA unit in the same circuit structure.
  • the PCS unit, PMA The unit and the serdes unit may be integrated in the same circuit structure, etc., which are not limited in the embodiment of the present application.
  • an embodiment of the present application further provides an electronic device including the MAC device provided in any one of the foregoing embodiments, and capable of performing the time point estimation method shown in FIG. 4 and / or FIG. 7.
  • the embodiment of the present application further provides a program, which when executed on a certain device, will cause the device to implement the time point estimation method provided by any of the above embodiments.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Synchronisation In Digital Transmission Systems (AREA)

Abstract

An MAC device and a time point estimation method. The MAC device comprises: an MAC core unit and a physical medium attachment (PMA) unit; wherein the PMA unit is configured to acquire a first time point of a first bit, and send the first time point to the MAC core unit; the first time point of the first bit is a time point at which the PMA unit sends the first bit; the MAC core unit is configured to receive a target bit to be sent, and estimate, according to the first time point and the number of bits between the target bit and the first bit, a second time point at which the PMA unit sends the target bit. The solution above helps to improve the accuracy of the estimated second time point.

Description

一种MAC装置及时间点估算方法MAC device and time point estimation method 技术领域Technical field
本申请涉及电子通信技术领域,尤其涉及一种MAC装置及时间点估算方法。The present application relates to the field of electronic communication technology, and in particular, to a MAC device and a time point estimation method.
背景技术Background technique
无线网络通信系统中,网元之间的消息交互大多通过接口芯片实现。通常,接口芯片中包括媒体接入控制电路(media access control,MAC)和串行/并行器(serializer/deserializer,serdes),其中MAC电路进一步包括MAC核心(core)单元、物理编码子层(physical coding sublayer,PCS)单元和物理介质连接子层(physical medium attachment,PMA)单元。In a wireless network communication system, message exchanges between network elements are mostly implemented through interface chips. Generally, the interface chip includes a media access control circuit (MAC) and a serializer / deserializer (serdes). The MAC circuit further includes a MAC core unit and a physical coding sublayer. A coding sublayer (PCS) unit and a physical medium connection sublayer (PMA) unit.
在接口芯片中,MAC核心单元常需要估算PMA单元向serdes发送某一特定的比特位的时间点,例如,基于电气和电子工程师协会(institute of electrical and electronics engineers,IEEE)1588协议,MAC核心单元需要估算PMA单元向serdes发送1588报文的起始比特位的时间点,并将根据该时间点生成时间戳添加入1588报文,又例如,基于y1731协议,MAC核心单元需要估算PMA单元向serdes发送y1731报文的起始比特位的时间点,并需要根据y1731协议将时间戳填充在y1731报文的对应域段。In the interface chip, the MAC core unit often needs to estimate the point in time when the PMA unit sends a specific bit to the serdes. For example, based on the Institute of Electrical and Electronics Engineers (Institute of Electrical and Electronics) IEEE 1588 protocol, the MAC core unit Need to estimate the time when the PMA unit sends the start bit of the 1588 message to serdes, and add a timestamp based on the time point to the 1588 message. For example, based on the y1731 protocol, the MAC core unit needs to estimate the PMA unit to serdes. When the start bit of the y1731 message is sent, the time stamp needs to be filled in the corresponding field segment of the y1731 message according to the y1731 protocol.
然而,随着第五代(5 th generation,5G)移动通信的到来,现有的估算方法已无法满足5G通信对MAC核心单元所估算的时间点的精度要求,因此,MAC核心单元所估算的时间点的精度还有待进一步提高。 However, as the fifth generation (5 th generation, 5G) advent of mobile communications, the conventional estimation methods can not meet the accuracy requirements of the MAC core unit 5G communication estimated time point, therefore, the estimated MAC core unit The accuracy of the time point needs to be further improved.
发明内容Summary of the Invention
本申请实施例提供了一种MAC装置及时间点估算方法,用以提高估算的时间点的精度。The embodiments of the present application provide a MAC device and a time point estimation method to improve the accuracy of the estimated time point.
第一方面,本申请实施例提供一种媒体接入控制MAC装置,包括:MAC核心单元和物理介质连接子层PMA单元;其中,PMA单元,用于获取第一比特位的第一时间点,之后,将第一时间点发送给MAC核心单元;其中,第一比特位的第一时间点为PMA单元发送该第一比特位的时间点;MAC核心单元,用于接收待发送的目标比特位,根据上述第一时间点,以及目标比特位与第一比特位之间间隔的比特位数,估算PMA单元发送目标比特位的第二时间点;其中,第一比特位和目标比特位为PMA单元连续发送的数据流中的比特位。In a first aspect, an embodiment of the present application provides a media access control MAC device, including: a MAC core unit and a physical medium connection sublayer PMA unit; wherein the PMA unit is configured to obtain a first time point of a first bit, After that, the first time point is sent to the MAC core unit; wherein the first time point of the first bit is the time point when the PMA unit sends the first bit; the MAC core unit is used to receive the target bit to be sent , Based on the first time point and the number of bits between the target bit and the first bit, estimate the second time point at which the PMA unit sends the target bit; wherein the first bit and the target bit are PMA The bits in a data stream that a unit sends continuously.
采用上述方案,所获取的PMA单元发送第一比特位的第一时间点为较为准确的时间点。并在此基础上,由于MAC装置中的PMA单元可以连续地向外发送数据流,因此,PMA单元向外发送目标比特位的第二时间点与发送第一比特位的第一时间点之间的时间间隔,是可以通过目标比特位与第一比特位之间间隔的比特位数较为准确地估算获得的。因此,MAC核心单元通过目标比特位与第一比特位之间间隔的比特位数,以及PMA发送第一比特位的第一时间点,便可以较为准确地估算获取PMA单元发送的目标比特位的第二时间点,有利于提高MAC核心单元所估算的时间点的精度。With the above solution, the obtained first time point when the PMA unit sends the first bit is a more accurate time point. And based on this, since the PMA unit in the MAC device can continuously send out data streams, between the second time point at which the PMA unit sends the target bit and the first time point at which the first bit is sent The time interval can be obtained by more accurately estimating the number of bits between the target bit and the first bit. Therefore, based on the number of bits between the target bit and the first bit, and the first point in time when the PMA sends the first bit, the MAC core unit can more accurately estimate the The second time point is conducive to improving the accuracy of the time point estimated by the MAC core unit.
在一种可能的实现方式中,PMA单元与MAC核心单元直接连接;PMA单元可以通过与MAC核心单元之间的连接直接将第一时间点发送给MAC核心单元。In a possible implementation manner, the PMA unit is directly connected to the MAC core unit; the PMA unit may directly send the first time point to the MAC core unit through the connection with the MAC core unit.
由于部分MAC核心单元与PMA单元之间是单向传输的,不存在PMA单元向MAC 核心单元传输的路径。采用上述方案,通过在PMA单元与MAC核心单元之间添加直接连接,从而为PMA单元提供了向MAC核心单元发送第一时间点的路径。Because part of the MAC core unit and the PMA unit are transmitted unidirectionally, there is no path for the PMA unit to transmit to the MAC core unit. With the above solution, by adding a direct connection between the PMA unit and the MAC core unit, a path is provided for the PMA unit to send the first point in time to the MAC core unit.
在另一种可能的实现方式中,PMA单元可以经PCS单元将第一时间点发送给MAC核心单元。In another possible implementation manner, the PMA unit may send the first time point to the MAC core unit via the PCS unit.
在一种可能的实现方式中,PMA单元还用于:接收所述MAC核心单元经PCS单元向PMA单元发送的第一信号和数据流;其中,第一信号用于指示PMA单元从PCS单元接收的数据流中的第一比特位。In a possible implementation manner, the PMA unit is further configured to: receive a first signal and a data stream sent by the MAC core unit to the PMA unit through the PCS unit; wherein the first signal is used to instruct the PMA unit to receive from the PCS unit The first bit in the data stream.
大部分PMA单元无法从数据流中识别第一比特位的功能。采用上述方案,PMA单元可以根据第一信号确定确定接收到数据流中的第一比特位,进而可以获取第一比特位的第一时间点。Most PMA units do not recognize the function of the first bit from the data stream. With the above solution, the PMA unit can determine and determine the first bit in the received data stream according to the first signal, and then can obtain the first time point of the first bit.
在一种可能的实现方式中,第一比特位可以为MAC核心单元向PCS单元发送的数据流中满足预设规则的比特位;其中,预设规则包括任意相邻第一比特位之间间隔预设比特位数。In a possible implementation manner, the first bit may be a bit that meets a preset rule in a data stream sent by the MAC core unit to the PCS unit, where the preset rule includes an interval between any adjacent first bits. The preset number of bits.
采用上述方案,使得MAC核心单元可以每发送预设比特位数之后更新一次第一时间点。由于MAC核心单元的时钟与PMA单元的时钟之间也会存在一定的误差,间隔更新第一时间点可以降低上述两个单元的时钟之间的误差积累,从而进一步提高MAC核心单元所估算的时间点的精度。By adopting the foregoing solution, the MAC core unit can update the first time point after sending a preset number of bits. Since there will also be a certain error between the clock of the MAC core unit and the clock of the PMA unit, updating the first time point at an interval can reduce the error accumulation between the clocks of the two units, thereby further increasing the time estimated by the MAC core unit. Point precision.
在一种可能的实现方式中,MAC核心单元在根据第一时间点,以及目标比特位与第一比特位之间间隔的比特位数,估算PMA单元发送目标比特位的第二时间点时,具体用于:根据公式t2=t1+n*UI估算第二时间点;其中,t1为第一时间点;t2为第二时间点;n为目标比特位与第一比特位之间间隔的比特位数;UI为所述PMA单元发送1比特数据的传输时间。In a possible implementation manner, when the MAC core unit estimates the second time point when the PMA unit sends the target bit according to the first time point and the number of bits between the target bit and the first bit, Specifically used to estimate the second point in time according to the formula t2 = t1 + n * UI; where t1 is the first point in time; t2 is the second point in time; n is the bit spaced between the target bit and the first bit Number of bits; UI is the transmission time for sending 1-bit data by the PMA unit.
在一种可能的实现方式中,MAC核心单元还用于:开启第一计数器,第一计数器用于对MAC核心单元在接收到第一比特位之后,继续接收的比特位数进行计数;在根据第一时间点,以及目标比特位与第一比特位之间间隔的比特位数,估算PMA单元发送目标比特位的第二时间点之前,停止第一计数器;此时第一计数器记录的数值便为目标比特位与第一比特位之间间隔的比特位数。In a possible implementation manner, the MAC core unit is further configured to enable a first counter, where the first counter is used to count the number of bits that the MAC core unit continues to receive after receiving the first bit; At the first point in time and the number of bits between the target bit and the first bit, the first counter is stopped before the second point in time when the PMA unit sends the target bit; the value recorded by the first counter is then Is the number of bits spaced between the target bit and the first bit.
在一种可能的实现方式中,MAC核心单元还用于:通过第二计数器对接收的比特位数进行计数;在第二计数器累计64比特位时,重启第二计数器并在第一计数器的当前记录的数值中额外增加2比特位。In a possible implementation manner, the MAC core unit is further configured to: count the number of received bits through the second counter; when the second counter accumulates 64 bits, restart the second counter and update the current value of the first counter. An additional 2 bits are added to the recorded value.
PCS单元会对从MAC核心单元接收的数据流进行编码,每隔64比特进行一次编码,一次编码会在数据流中增加2比特。采用上述方案,通过第二计数器每隔64比特位在第一计数器当前记录的数值中加2,使第一计数器的计数结果中包含了PCS单元编码增加的比特位数,从而使计数结果更加准确,进一步提高了MAC核心单元所估算的时间点的精度。The PCS unit encodes the data stream received from the MAC core unit, and encodes every 64 bits. One encoding adds 2 bits to the data stream. By using the above scheme, the second counter adds 2 to the currently recorded value of the first counter every 64 bits, so that the counting result of the first counter includes the increased number of bits of the PCS unit code, thereby making the counting result more accurate. , Further improving the accuracy of the time point estimated by the MAC core unit.
在一种可能的实现方式中,第一信号可以为脉冲信号。In a possible implementation manner, the first signal may be a pulse signal.
在一种可能的实现方式中,目标比特位可以是1588报文的起始比特位;MAC核心单元还可以用于:根据估算获得的第二时间点,添加或更新1588报文中的时间戳。In a possible implementation manner, the target bit may be a start bit of a 1588 packet; the MAC core unit may also be configured to add or update a timestamp in the 1588 packet according to a second time point obtained by estimation. .
第二方面,本申请实施例提供一种媒体接入控制MAC装置,该装置包括:MAC核心单元和物理介质连接子层PMA单元;其中,PMA单元,用于获取第二比特位的第三时 间点,并将第三时间点发送给MAC核心单元;其中,第二比特位的第三时间点为PMA单元接收第二比特位的时间点;MAC核心单元,用于接收目标比特位,根据第三时间点,以及目标比特位与第二比特位之间间隔的比特位数,估算PMA单元接收到目标比特位的第四时间点;其中,目标比特位和第二比特位为PMA单元连续接收的数据流中的比特位。In a second aspect, an embodiment of the present application provides a media access control MAC device, which includes: a MAC core unit and a physical medium connection sublayer PMA unit; wherein the PMA unit is configured to obtain a third time of a second bit And the third time point is sent to the MAC core unit; the third time point of the second bit is the time point when the PMA unit receives the second bit; the MAC core unit is used to receive the target bit, and Three time points, and the number of bits between the target bit and the second bit, estimate the fourth point in time when the PMA unit receives the target bit; where the target bit and the second bit are consecutively received by the PMA unit Bits in the data stream.
在一种可能的实现方式中,PMA单元可以经PCS单元将第三时间点发送给MAC核心单元。In a possible implementation manner, the PMA unit may send the third time point to the MAC core unit via the PCS unit.
在一种可能的实现方式中,MAC核心单元还用于:接收PMA单元经PCS单元向MAC核心单元发送的第二信号和数据流;第二信号用于指示所述MAC核心单元从所述PCS单元接收的数据流中的第二比特位。In a possible implementation manner, the MAC core unit is further configured to: receive a second signal and a data stream sent by the PMA unit to the MAC core unit through the PCS unit; the second signal is used to instruct the MAC core unit to send the data from the PCS The second bit in the data stream received by the unit.
部分MAC核心单元无法从数据流中识别第一比特位的功能。采用上述方案,MAC核心单元可以根据第二信号确定接收到数据流中的第二比特位,从而可以记录接收到第二比特位之后继续接收的比特位数。Some MAC core units cannot identify the function of the first bit from the data stream. With the above scheme, the MAC core unit can determine the second bit in the received data stream according to the second signal, so that the number of bits that continue to be received after receiving the second bit can be recorded.
在一种可能的实现方式中,第二比特位可以为PMA单元向PCS单元发送的数据流中满足预设规则的比特位;其中,预设规则包括任意相邻第二比特位之间间隔预设比特位数。In a possible implementation manner, the second bit may be a bit that satisfies a preset rule in a data stream sent by the PMA unit to the PCS unit, where the preset rule includes an interval between any adjacent second bit bits. Set the number of bits.
在一种可能的实现方式中,MAC核心单元在根据第三时间点,目标比特位与第二比特位之间间隔的比特位数,估算PMA单元接收到目标比特位的第四时间点时,具体用于:根据公式t4=t3+m*UI估算第四时间点;其中,t3为第三时间点;t4为第四时间点;m为目标比特位与第二比特位之间间隔的比特位数;UI为PMA单元接收1比特数据的传输时间。In a possible implementation manner, when the MAC core unit estimates the fourth time point when the PMA unit receives the target bit according to the third time point, the number of bits between the target bit and the second bit, It is specifically used to estimate the fourth time point according to the formula t4 = t3 + m * UI; where t3 is the third time point; t4 is the fourth time point; m is the interval between the target bit and the second bit Number of bits; UI is the transmission time for the PMA unit to receive 1-bit data.
在一种可能的实现方式中,MAC核心单元还用于:开启第三计数器,第三计数器用于对MAC核心单元在接收第二信号之后,继续接收的比特位数进行计数;在根据第三时间点,以及目标比特位与第二比特位之间间隔的比特位数,估算PMA单元接收到目标比特位的第四时间点之前,停止第三计数器;第三计数器记录的数值为目标比特位与第二比特位之间间隔的比特位数。In a possible implementation manner, the MAC core unit is further configured to: enable a third counter, and the third counter is used to count the number of bits that the MAC core unit continues to receive after receiving the second signal; At the time point and the number of bits between the target bit and the second bit, it is estimated that the third counter is stopped before the fourth time point when the PMA unit receives the target bit; the value recorded by the third counter is the target bit The number of bits spaced from the second bit.
在一种可能的实现方式中,MAC核心单元还用于:通过第四计数器对接收的比特位数进行计数;在所述第四计数器累计64比特位时,重启所述第四计数器并在第三计数器当前记录的数值中额外增加2比特位。In a possible implementation manner, the MAC core unit is further configured to: count the number of received bits by a fourth counter; when the fourth counter accumulates 64 bits, restart the fourth counter and reset the An additional 2 bits are added to the value currently recorded by the three counters.
PCS单元会对从PMA单元接收的数据流进行解编码处理。每隔64比特进行一次解编码,一次解编码会在数据流中扣除2比特。采用上述方案,通过第四计数器每隔64比特位在第三计数器当前记录的数值中加2,使第三计数器的计数结果中包含了PCS单元编码扣除的比特位数,从而使计数结果更加准确,进一步可以提高MAC核心单元所估算的时间点的精度。The PCS unit decodes the data stream received from the PMA unit. Decoding is performed every 64 bits. A decoding will deduct 2 bits from the data stream. With the above scheme, the fourth counter adds 2 to the currently recorded value of the third counter every 64 bits, so that the counting result of the third counter includes the number of bits subtracted by the PCS unit code, thereby making the counting result more accurate. , Which can further improve the accuracy of the time point estimated by the MAC core unit.
在一种可能的实现方式中,第二信号为脉冲信号。In a possible implementation manner, the second signal is a pulse signal.
第三方面,本申请实施例提供一种时间点估算方法,包括:获取第一比特位的第一时间点;其中,第一比特位的第一时间点为发送第一比特位的时间点;接收待发送的目标比特位,根据第一时间点,以及目标比特位与第一比特位之间间隔的比特位数,估算发送目标比特位的第二时间点;第一比特位和目标比特位为连续发送的数据流中的比特位。In a third aspect, an embodiment of the present application provides a time point estimation method, including: obtaining a first time point of a first bit; wherein the first time point of the first bit is a time point of transmitting the first bit; Receive the target bit to be transmitted, and estimate the second time point at which the target bit is sent according to the first time point and the number of bits between the target bit and the first bit; the first bit and the target bit Bits in a continuously transmitted data stream.
在一种可能的实现方式中,可以根据公式t2=t1+n*UI估算第二时间点;其中,t1为第一时间点;t2为第二时间点;n为目标比特位与第一比特位之间间隔的比特位数;UI为发送1比特数据的传输时间。In a possible implementation manner, the second time point can be estimated according to the formula t2 = t1 + n * UI; where t1 is the first time point; t2 is the second time point; n is the target bit and the first bit The number of bits between bits; UI is the transmission time for sending 1-bit data.
在一种可能的实现方式中,还可以开启第一计数器,第一计数器用于对在接收到第一比特位之后,继续接收的比特位数进行计数;在根据第一时间点,以及目标比特位与第一比特位之间间隔的比特位数,估算发送目标比特位的第二时间点之前,停止第一计数器;第一计数器记录的数值便可以作为目标比特位与第一比特位之间间隔的比特位数。In a possible implementation manner, a first counter may also be turned on. The first counter is configured to count the number of bits that are continuously received after the first bit is received, and according to the first time point and the target bit. The number of bits between the first bit and the first bit. Stop the first counter before the second time point when the target bit is estimated to be sent; the value recorded by the first counter can be used as the interval between the target bit and the first bit. The number of spaced bits.
在一种可能的实现方式中,还可以通过第二计数器对接收的比特位数进行计数;在第二计数器累计64比特位时,重启第二计数器并在第一计数器的当前记录的数值中额外增加2比特位。In a possible implementation manner, the number of received bits can also be counted by the second counter; when the second counter accumulates 64 bits, the second counter is restarted and an additional value is added to the currently recorded value of the first counter. Add 2 bits.
在一种可能的实现方式中,目标比特位可以是1588报文的起始比特位;MAC核心单元还可以根据估算获得的第二时间点,添加或更新1588报文中的时间戳。In a possible implementation manner, the target bit may be a start bit of a 1588 packet; the MAC core unit may also add or update a time stamp in the 1588 packet according to the second time point obtained by the estimation.
第四方面,本申请实施例提供另外一种时间点估算方法,包括:获取第二比特位的第三时间点;其中,第二比特位的第三时间点为接收第二比特位的时间点;接收目标比特位,根据第三时间点,以及目标比特位与第二比特位之间间隔的比特位数,估算接收到目标比特位的第四时间点;其中,目标比特位和第二比特位为连续接收的数据流中的比特位。In a fourth aspect, an embodiment of the present application provides another method for estimating a time point, including: acquiring a third time point of a second bit; wherein the third time point of the second bit is a time point of receiving the second bit Receive the target bit, and estimate the fourth point in time when the target bit is received according to the third point in time, and the number of bits between the target bit and the second bit; in which the target bit and the second bit Bits are bits in a continuously received data stream.
在一种可能的实现方式中,可以根据公式t4=t3+m*UI估算第四时间点;其中,t3为第三时间点;t4为第四时间点;m为目标比特位与第二比特位之间间隔的比特位数;UI为接收1比特数据的传输时间。In a possible implementation manner, the fourth time point can be estimated according to the formula t4 = t3 + m * UI; where t3 is the third time point; t4 is the fourth time point; m is the target bit and the second bit The number of bits between bits; UI is the transmission time for receiving 1-bit data.
在一种可能的实现方式中,还可以开启第三计数器,第三计数器用于对在接收到第二比特位之后,继续接收的比特位数进行计数;在根据第三时间点,以及目标比特位与第二比特位之间间隔的比特位数,估算接收到目标比特位的第四时间点之前,还可以停止第三计数器;第三计数器记录的数值便可以作为目标比特位与第二比特位之间间隔的比特位数。In a possible implementation manner, a third counter may also be turned on. The third counter is used to count the number of bits that are continuously received after the second bit is received; according to the third time point, and the target bit The number of bits between the second and second bits can be stopped before the fourth time point when the target bit is estimated to be received; the value recorded by the third counter can be used as the target bit and the second bit The number of bits spaced between bits.
在一种可能的实现方式中,还可以通过第四计数器对接收到的比特位数进行计数;在第四计数器累计64比特位时,重启第四计数器并在第三计数器当前记录的数值中额外增加2比特位。In a possible implementation manner, the number of received bits can also be counted by a fourth counter; when the fourth counter accumulates 64 bits, the fourth counter is restarted and an additional value is added to the currently recorded value of the third counter. Add 2 bits.
第五方面,本申请实施例还提供一种芯片,该芯片包括MAC装置和并行/串行器serdes,MAC装置中的PMA单元与serdes连接;其中,MAC装置为如上述第一方面,或第一方面的任一种实现方式,或第二方面,或第二方面的任一种实现方式所提供的MAC装置。In a fifth aspect, an embodiment of the present application further provides a chip, which includes a MAC device and a parallel / serializer serdes, and a PMA unit in the MAC device is connected to the serdes; wherein the MAC device is the first aspect as described above, or Any implementation manner of one aspect, or a MAC device provided by the second aspect, or any implementation manner of the second aspect.
第六方面,本申请实施例还提供一种电子设备,该电子设备包括如上述第五方面所提供的芯片。According to a sixth aspect, an embodiment of the present application further provides an electronic device, where the electronic device includes the chip provided by the fifth aspect.
第七方面,本申请实施例还提供一种程序,该程序在装置上执行时,将会使该装置实现上述第三方面,或第三方面的任一种实现方式,或第四方面,或第四方面的任一种实现方式提供的时间点估算方法In a seventh aspect, an embodiment of the present application further provides a program, which when executed on the device, will cause the device to implement the third aspect, or any implementation manner of the third aspect, or the fourth aspect, or Time point estimation method provided by any implementation manner of the fourth aspect
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1为一种无线网络通信系统架构示意图;FIG. 1 is a schematic diagram of a wireless network communication system architecture;
图2为一种接口芯片结构示意图;FIG. 2 is a schematic diagram of an interface chip structure;
图3为本申请实施例提供的一种MAC核心单元与PMA单元中数据流关系示意图;3 is a schematic diagram of a data flow relationship between a MAC core unit and a PMA unit according to an embodiment of the present application;
图4为本申请实施例提供的一种时间点估算方法流程示意图;4 is a schematic flowchart of a time point estimation method according to an embodiment of the present application;
图5为本申请实施例提供的一种MAC装置内部第一信号示意图;FIG. 5 is a schematic diagram of a first signal inside a MAC device according to an embodiment of the present application; FIG.
图6为本申请实施例提供的一种可能的时间点估算方法流程示意图;6 is a schematic flowchart of a possible time point estimation method according to an embodiment of the present application;
图7为本申请实施例提供的一种时间点估算方法流程示意图。FIG. 7 is a schematic flowchart of a time point estimation method according to an embodiment of the present application.
具体实施方式detailed description
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application.
在无线网络通信系统中,系统中的网元常需要对特定比特位的发送或接收时间点进行估算,通常,对特定比特位的发送或接收时间点的估算是由网元中的接口芯片进行的。In a wireless network communication system, the network elements in the system often need to estimate the transmission or reception time point of a specific bit. Generally, the estimation of the transmission or reception time point of a specific bit is performed by the interface chip in the network element. of.
以下以1588协议为例对接口芯片的应用环境进行介绍:The following uses the 1588 protocol as an example to introduce the application environment of the interface chip:
图1为一种无线网络通信系统架构示意图,如图1所示,无线通信系统包括多个基站(如基站41和基站42)、多个网元(networ element,NE)(如NE31、NE32、NE33、NE34、NE35和NE36)、全球定位系统(global positioning system,GPS)信号接收器1,以及无线网络控制器(radio network controller,RNC)2等。FIG. 1 is a schematic diagram of a wireless network communication system architecture. As shown in FIG. 1, the wireless communication system includes multiple base stations (such as base station 41 and base station 42), multiple network elements (NE) (such as NE31, NE32, NE33, NE34, NE35 and NE36), a global positioning system (GPS) signal receiver 1, and a radio network controller (RNC) 2 and the like.
图1中的GPS信号接收器1用于通过GPS驯服晶振产生纳秒级精度的时间信号。GPS信号接收器1所产生的时间信号用于整个时钟网络周期性的时间同步,其中,时钟网络是由图1中多个网元构成的网络,又可称为精确定时协议(precision timing protocol,PTP)系统。PTP系统中的网元根据在网络中的位置和功能一般可以分为边界时钟(boundary clock,BC)节点、普通时钟(ordinary clock,OC)节点和透明时钟(transparent clock,TC)节点。The GPS signal receiver 1 in FIG. 1 is used to generate a time signal with nanosecond accuracy by using a GPS to tame a crystal oscillator. The time signal generated by the GPS signal receiver 1 is used for periodic time synchronization of the entire clock network. Among them, the clock network is a network composed of multiple network elements in FIG. 1 and can also be referred to as a precision timing protocol. PTP) system. The network elements in the PTP system can generally be divided into a boundary clock (BC) node, an ordinary clock (OC) node and a transparent clock (TC) node according to their position and function in the network.
其中,BC节点,如图1中NE31,有多个1588端口,其中一个端口可作为从(slave)端口,其它端口可作为主(master)端口。BC节点通过slave端口,将时钟的频率和时间同步于上一级设备(如图1中GPS信号接收器1)。之后,通过多个master端口,向多个下一级设备(如图1中NE32和NE33)发送同步报文。同步报文中包括时间戳,该时间戳所指向的时间是BC节点根据slave端口收到的时间信号以及BC节点本身的处理时延获得的。Among them, the BC node, such as NE31 in FIG. 1, has multiple 1588 ports, one of which can be a slave port, and the other ports can be master ports. The BC node synchronizes the frequency and time of the clock with the upper-level device through the slave port (see GPS signal receiver 1 in Figure 1). After that, synchronization packets are sent to multiple lower-level devices (such as NE32 and NE33 in Figure 1) through multiple master ports. The synchronization message includes a timestamp, and the time pointed to by the timestamp is obtained by the BC node according to the time signal received by the slave port and the processing delay of the BC node itself.
OC节点,如图1中NE35和NE36,通常是时钟网络的始端或末端设备,只有一个1588端口,且该端口只能作为slave端口或master端口。An OC node, such as NE35 and NE36 in Figure 1, is usually the start or end device of the clock network. It has only one 1588 port, and this port can only be used as a slave port or a master port.
TC节点,如图1中NE32、NE33、NE34,有多个1588端口。TC节点转发收到的所有同步报文,并测量同步报文经过TC节点的驻留时间,同时更新同步报文中的时间戳。TC nodes, such as NE32, NE33, and NE34 in Figure 1, have multiple 1588 ports. The TC node forwards all received synchronization messages, measures the dwell time of the synchronization messages after passing through the TC nodes, and updates the time stamp in the synchronization messages.
通常,BC节点和TC节点在向下一级设备发送1588报文时,都需要在1588报文中添加(或更新)时间戳,该时间戳用于指示BC节点或TC节点发送1588报文的时间点,因此,BC节点和TC节点一般需要配置接口芯片以通过估算1588报文起始比特位的发送时间点为1588报文添加时间戳。Generally, when a BC node and a TC node send a 1588 message to a lower-level device, they need to add (or update) a timestamp to the 1588 message. The timestamp is used to instruct the BC node or TC node to send a 1588 message. At the time point, therefore, the BC node and the TC node generally need to configure an interface chip to add a time stamp to the 1588 message by estimating the transmission time point of the start bit of the 1588 message.
图2为一种接口芯片结构示意图,如图2所示,接口芯片200包括:MAC电路201和serdes202,其中,MAC电路201进一步包括MAC核心单元2011、PCS单元2012和PMA单元2013。FIG. 2 is a schematic structural diagram of an interface chip. As shown in FIG. 2, the interface chip 200 includes: a MAC circuit 201 and a serdes 202, wherein the MAC circuit 201 further includes a MAC core unit 2011, a PCS unit 2012, and a PMA unit 2013.
在接口芯片200中,MAC核心单元2011常被用于估算PMA单元向serdes发送某一特定比特位的时间点。以基于IEEE1588协议的1588报文为例,MAC核心单元2011常用于在接收到1588报文的起始比特位时,估算PMA单元2013向serdes202发送起始比特位的时间点,继而根据该时间点为1588报文添加时间戳。之后,MAC核心单元2011将添加了时间戳的1588报文发送给PCS单元2012。PCS单元2012对1588报文进行物理编码以及加扰,之后,将完成物理编码的1588报文发送给PMA单元2013。PMA单元2013用于位宽变换,使发送位宽与serdes202的接收位宽相匹配,从而将1588报文发送给serdes202, 经serdes202将1588报文发送给其它网元。In the interface chip 200, the MAC core unit 2011 is often used to estimate the time point when the PMA unit sends a specific bit to the serdes. Taking a 1588 message based on the IEEE1588 protocol as an example, the MAC core unit 2011 is often used to estimate the time point when the PMA unit 2013 sends the start bit to serdes202 when the start bit of the 1588 message is received, and then according to the time point Timestamp 1588 packets. After that, the MAC core unit 2011 sends the timestamped 1588 message to the PCS unit 2012. The PCS unit 2012 physically encodes and scrambles the 1588 message, and then sends the physically encoded 1588 message to the PMA unit 2013. The PMA unit 2013 is used for bit width conversion to match the transmitted bit width with the received bit width of serdes202, thereby sending a 1588 message to serdes202, and sending the 1588 message to other network elements via serdes202.
图3示例性示出了一种MAC核心单元2011与PMA单元2013中数据流关系示意图,图3中MAC核心单元2011在单位时间T内可以经PCS单元2012向PMA单元2013发送80bit数据,PMA单元2013在单位时间T内向serdes202发送40bit数据。图3中MAC核心单元2011在第一个单位时间T1内向PCS单元2012发送80bit数据后,在第二个位时间T2内停止向PCS单元2012发送数据。在第三个单位时间T3内继续向PCS单元2012发送80bit数据,在第四个单位时间内停止向PCS单元2012发送数据。对于PMA单元2013而言,其保持单位时间内发送40bit数据的速度连续向serdes202发送数据。FIG. 3 exemplarily illustrates a data flow relationship between the MAC core unit 2011 and the PMA unit 2013. The MAC core unit 2011 in FIG. 3 can send 80-bit data to the PMA unit 2013 via the PCS unit 2012 within a unit time T. The PMA unit 2013 sent 40bit data to serdes202 within unit time T. In FIG. 3, after the MAC core unit 2011 sends 80-bit data to the PCS unit 2012 within the first unit time T1, it stops sending data to the PCS unit 2012 within the second bit time T2. In the third unit time T3, continue to send 80bit data to the PCS unit 2012, and in the fourth unit time, stop sending data to the PCS unit 2012. For the PMA unit 2013, it maintains the speed of sending 40bit data per unit time to continuously send data to serdes202.
目前,MAC核心单元2011多根据其接收到目标比特位(如1588报文起始比特位)的时间点和估算的目标比特位在MAC电路201中的时延估算MAC电路201将该目标比特位发送给serdes202的时间。例如,MAC核心单元2011接收到目标比特位的时间点为ta,估算的时延为tdelay,则估算的MAC电路201将目标比特位发送给serdes202的时间点为ta+tdelay。At present, the MAC core unit 2011 mostly estimates the target bit (such as the start bit of a 1588 message) and the estimated delay of the target bit in the MAC circuit 201. The MAC circuit 201 estimates the target bit. The time sent to serdes202. For example, when the time point at which the MAC core unit 2011 receives the target bit is ta and the estimated delay is tdelay, the time point at which the estimated MAC circuit 201 sends the target bit to serdes 202 is ta + tdelay.
MAC核心单元2011在估算目标比特位在MAC电路201中的时延时,一般会根据PCS单元2012和PMA单元2013的逻辑架构、传输带宽等因素进行估算。然而,PCS单元2012和PMA单元2013在不同的系统设计下会有不同的逻辑架构,导致估算时延的算法需要作不同的调整,通用性较差。而且,目标比特位经过PMA单元2013中的异步先入先出(asynchronous first input first output,AFIFO)队列所造成的延迟存在不确定性,无法准确估计,导致MAC核心单元2011所估算的PMA单元2013发送目标比特位的时间点的精度无法满足5G通信的要求。When the MAC core unit 2011 estimates the time delay of the target bit in the MAC circuit 201, it is generally estimated according to factors such as the logical architecture and transmission bandwidth of the PCS unit 2012 and the PMA unit 2013. However, the PCS unit 2012 and the PMA unit 2013 will have different logical architectures under different system designs. As a result, the algorithm for estimating the delay needs to be adjusted differently, and the versatility is poor. Moreover, the delay caused by the target bit passing through the asynchronous first-in-first-out (AFIFO) queue in the PMA unit 2013 is uncertain and cannot be accurately estimated, causing the PMA unit 2013 sent by the MAC core unit 2011 to be sent. The accuracy of the time point of the target bit cannot meet the requirements of 5G communication.
基于此,本申请实施例提供一种MAC装置,以提高估算PMA单元2013发送目标比特位的时间点的精度。该装置可以为图2中接口芯片200中的MAC电路201,也可以为一独立的芯片,本申请对此并不多作限定。以下以接口芯片200中的MAC电路201为例进行说明,因此本申请实施例所提供的MAC装置也可以以MAC装置201表示。Based on this, an embodiment of the present application provides a MAC device to improve the accuracy of estimating the time point when the PMA unit 2013 sends the target bit. The device may be the MAC circuit 201 in the interface chip 200 in FIG. 2, or may be an independent chip, which is not limited in this application. The following uses the MAC circuit 201 in the interface chip 200 as an example for description. Therefore, the MAC device provided in the embodiment of the present application may also be represented by the MAC device 201.
在图2所示的MAC装置201中,PMA单元2013用于获取第一比特位的第一时间点,并将第一时间点发送给MAC核心单元。其中,第一比特位的第一时间点为PMA单元发送第一比特位的时间点。In the MAC device 201 shown in FIG. 2, the PMA unit 2013 is configured to obtain a first time point of a first bit, and send the first time point to the MAC core unit. The first point in time of the first bit is the point in time when the PMA unit sends the first bit.
在本申请实施例中,第一比特位可以是MAC核心单元2011经PCS单元2012向PMA单元2013发送的数据流中的比特位。在一种可能的实现方式中,第一比特位可以是MAC核心单元2011向PCS单元2012发送的数据流中的任一比特位,在另一种可能的实现方式中,第一比特位也可以是MAC核心单元2011向PCS单元2012发送的数据流中满足预设规则的比特位,例如,MAC核心单元2011每间隔预设比特位数确定当前发送的比特位为第一比特位。如图3中,MAC核心单元2011确定在T1内发送的第60bit数据作为第一比特位bit1。其中,MAC核心单元2011向PCS单元2012发送的数据流包括但不限于各种类型的报文、码流等,对于PCS单元2012和PMA单元2013而言,可以不区分数据流中的具体内容而直接对接收到的数据流进行处理。In the embodiment of the present application, the first bit may be a bit in a data stream sent by the MAC core unit 2011 to the PMA unit 2013 via the PCS unit 2012. In a possible implementation manner, the first bit may be any bit in a data stream sent by the MAC core unit 2011 to the PCS unit 2012. In another possible implementation manner, the first bit may also be It is a bit in the data stream sent by the MAC core unit 2011 to the PCS unit 2012 that meets a preset rule. For example, the MAC core unit 2011 determines a preset number of bits per interval to determine the currently sent bit as the first bit. As shown in FIG. 3, the MAC core unit 2011 determines the 60th bit data sent in T1 as the first bit bit1. The data stream sent by the MAC core unit 2011 to the PCS unit 2012 includes, but is not limited to, various types of messages and code streams. For the PCS unit 2012 and the PMA unit 2013, the specific content of the data stream can be distinguished without Process the received data stream directly.
PMA单元2013在从PCS单元2012接收到数据流后,对所接收的数据流进行位宽变换等处理,之后,连续发送处理后的数据流。其中,在PMA单元连续发送的数据流中也包括了上述第一比特位。After receiving the data stream from the PCS unit 2012, the PMA unit 2013 performs a process such as bit width conversion on the received data stream, and then continuously sends the processed data stream. The first bit is also included in the data stream continuously sent by the PMA unit.
在本申请实施例中,PMA单元2013可以通过其内部的时钟电路获取发送第一比特位的第一时间点。例如,图3中PMA单元2013采集发送第一比特位bit1的第一时间点为t1。In the embodiment of the present application, the PMA unit 2013 may obtain a first time point at which the first bit is transmitted through an internal clock circuit thereof. For example, the first time point at which the PMA unit 2013 collects and sends the first bit bit1 in FIG. 3 is t1.
在一种可能的实现方式中,PMA单元2013在采集了第一时间点之后,可以经PCS单 元2012将第一时间点发送给MAC核心单元2011。In a possible implementation manner, after collecting the first time point, the PMA unit 2013 may send the first time point to the MAC core unit 2011 via the PCS unit 2012.
在另一种可能的实现方式中,如图2所示,PMA单元2013与MAC核心单元2011之间通过导线直接连接,PMA单元2013通过与MAC核心单元2011之间的导线直接将第一时间点发送给MAC核心单元2011。对于现有的大多数PCS单元2012,并不支持双向传输,本申请通过在PMA单元2013与MAC核心单元2011之间增加导线为PMA单元2013提供了向MAC核心单元2011发送第一时间点的传输路径,而且该结构实现简单、成本低廉、传输速度也更高。In another possible implementation manner, as shown in FIG. 2, the PMA unit 2013 and the MAC core unit 2011 are directly connected through a wire, and the PMA unit 2013 is directly connected to the MAC core unit 2011 with a first time point. Send to MAC core unit 2011. For most existing PCS units 2012, two-way transmission is not supported. This application provides a PMA unit 2013 with a first time point transmission to the MAC core unit 2011 by adding a wire between the PMA unit 2013 and the MAC core unit 2011. Path, and the structure is simple to implement, low in cost, and higher in transmission speed.
在图2所示的MAC装置201中,MAC核心单元2011,用于接收待发送的目标比特位,根据第一时间点,以及目标比特位与第一比特位之间间隔的比特位数,估算PMA单元2013发送目标比特位的第二时间点。其中,目标比特位所在的数据流经MAC核心单元2011和PCS单元2012传递之后,会由PMA单元2013发送目标比特位所在的数据流。上述第一时间点可以是MAC核心单元最后一次从PMA单元2013接收并缓存的第一时间点。In the MAC device 201 shown in FIG. 2, the MAC core unit 2011 is configured to receive a target bit to be transmitted, and estimate based on the first time point and the number of bits between the target bit and the first bit. The second time point at which the PMA unit 2013 sends the target bit. Among them, after the data stream where the target bit is located is passed through the MAC core unit 2011 and the PCS unit 2012, the data stream where the target bit is located is sent by the PMA unit 2013. The above-mentioned first time point may be the first time point at which the MAC core unit last received and buffered from the PMA unit 2013.
如图3中,MAC核心单元2011在第三个单位时间T3内接收的第20bit为目标比特bit0,则MAC核心单元2011可以根据bit0与bit1之间间隔的比特位数以及PMA单元2013发送bit1的第一时间点估算PMA单元2013发送bit0的第二时间点。图3中bit0和bit1之间间隔40bit,由于PMA单元2013是连续发送数据流的,因此,MAC核心单元2011通过计算PMA单元2013发送40bit数据的时间便可以确定PMA单元2013发送bit0与发送bit1之间的时间间隔,结合预先获得的发送bit1的第一时间点,便可以获取PMA单元2013发送bit0的第二时间点。As shown in FIG. 3, the 20th bit received by the MAC core unit 2011 within the third unit time T3 is the target bit bit0. Then, the MAC core unit 2011 may send the bit The first time point estimates the second time point at which the PMA unit 2013 sends bit0. In Figure 3, the interval between bit0 and bit1 is 40 bits. Since PMA unit 2013 sends data continuously, the MAC core unit 2011 can determine the time between sending bit0 and sending bit1 of PMA unit 2013 by calculating the time when 40 bits of data is sent by PMA unit 2013. The time interval between the two, combined with the first time point of sending bit 1 obtained in advance, can obtain the second time point of sending bit 0 by the PMA unit 2013.
在一种可能的实现方式中,MAC核心单元2011在根据第一时间点,以及目标比特位与第一比特位之间间隔的比特位数,估算PMA单元2013发送目标比特位的第二时间点时,可以根据以下公式一估算第二时间点:In a possible implementation manner, the MAC core unit 2011 estimates the second time point at which the PMA unit 2013 sends the target bit according to the first point in time and the number of bits between the target bit and the first bit. , The second time point can be estimated according to the following formula 1:
t2=t1+n*UI(一)t2 = t1 + n * UI (1)
其中,t1为第一时间点;t2为第二时间点;n为目标比特位与第一比特位之间间隔的比特位数;UI为PMA单元2013发送1比特数据的传输时间。在本申请实施例中,UI可以根据serdes202的带宽计算获得,例如,在serdes202带宽为10.3125Gbps时,UI的取值可以为1/10.3125Gbps≈97ps。Among them, t1 is the first time point; t2 is the second time point; n is the number of bits between the target bit and the first bit; UI is the transmission time for the PMA unit 2013 to send 1-bit data. In the embodiment of the present application, the UI may be obtained according to the bandwidth of the serdes 202. For example, when the bandwidth of the serdes 202 is 10.3125 Gbps, the value of the UI may be 1 / 10.3125 Gbps ≈ 97 ps.
对于1588报文,MAC核心单元2011在获取第二时间点之后,便可以根据第二时间点为1588报文添加(或更新)时间戳,并将添加(或更新)了时间戳的1588报文经PCS单元2012发送给PMA单元2013,由PMA单元2013将1588报文发送serdes202。For the 1588 message, after the MAC core unit 2011 obtains the second time point, it can add (or update) a timestamp to the 1588 message according to the second time point, and add (or update) the 1588 message with the timestamp. The PCS unit 2012 sends it to the PMA unit 2013, and the PMA unit 2013 sends a 1588 packet to serdes202.
采用上述方案,所获取的PMA单元2013发送第一比特位的第一时间点为较为准确的时间点。并在此基础上,由于MAC装置201中的PMA单元2013可以连续地发送数据流,因此,PMA单元2013发送目标比特位的第二时间点与发送第一比特位的第一时间点之间的时间间隔,是可以通过目标比特位与第一比特位之间间隔的比特位数较为准确地估算获得的。因此,MAC核心单元2011通过目标比特位与第一比特位之间间隔的比特位数,以及PMA单元2013发送第一比特位的第一时间点,便可以较为准确地估算获取PMA单元2013发送目标比特位的第二时间点,有利于提高估算获得的PMA单元2013发送目标比特位的时间点的精度,一般可以将误差控制在1ns之内,可以满足5G通信的需求。With the above solution, the obtained first time point when the PMA unit 2013 sends the first bit is a more accurate time point. And based on this, since the PMA unit 2013 in the MAC device 201 can continuously send data streams, the PMA unit 2013 between the second time point at which the target bit is transmitted and the first time point at which the first bit is transmitted The time interval can be obtained by relatively accurately estimating the number of bits between the target bit and the first bit. Therefore, the MAC core unit 2011 can more accurately estimate the transmission target of the PMA unit 2013 based on the number of bits between the target bit and the first bit, and the first time point when the PMA unit 2013 sends the first bit. The second time point of the bit is conducive to improving the accuracy of the time point at which the estimated PMA unit 2013 sends the target bit. Generally, the error can be controlled within 1 ns, which can meet the needs of 5G communication.
在本申请实施例中,第一比特位可以没有固定的特征。大部分PMA单元2013在发送数据流时,会无法识别数据流中的第一比特位,导致PMA单元2013无法获取第一比特位 的第一时间点。基于此,本申请实施例中PMA单元2013还用于:接收MAC核心单元2011经PCS单元2012向PMA单元2013发送的第一信号和数据流。其中,第一信号用于指示PMA单元从PCS单元接收的数据流中的第一比特位。在本申请实施例中,第一信号可以为脉冲信号。In the embodiment of the present application, the first bit may not have a fixed feature. When most PMA units 2013 send data streams, they will fail to identify the first bit in the data stream, resulting in PMA unit 2013 being unable to obtain the first point in time of the first bit. Based on this, the PMA unit 2013 in the embodiment of the present application is further configured to receive the first signal and data stream sent by the MAC core unit 2011 to the PMA unit 2013 via the PCS unit 2012. The first signal is used to indicate a first bit in a data stream received by the PMA unit from the PCS unit. In the embodiment of the present application, the first signal may be a pulse signal.
在一种可能的实现方式中,第一信号为数据流中第一比特位的并行信号,二者在时间上同步。当PMA单元从PCS单元接收到第一比特位时,也会接收到第一信号。在接收到第一信号时,PMA单元便可以确定当前接收的比特位为第一比特位。In a possible implementation manner, the first signal is a parallel signal of the first bit in the data stream, and the two are synchronized in time. When the PMA unit receives the first bit from the PCS unit, it also receives the first signal. When receiving the first signal, the PMA unit can determine that the currently received bit is the first bit.
在一种可能的实现方式中,PMA单元还会并行处理数据流第一信号,将第一信号并行处理完成的时间点作为第一时间点。In a possible implementation manner, the PMA unit further processes the first signal of the data stream in parallel, and uses the time point when the first signal parallel processing is completed as the first time point.
采用上述方案,MAC核心单元2011在发送第一比特位的时,并行发送第一信号,由第一信号作为第一比特位的并行信号。在本申请实施例中,MAC核心单元2011可以通过带外传输发送第一信号,从而不占用数据流的传输带宽。第一信号在PCS单元2012和PMA单元2013中始终保持与第一比特位的并行,例如,第一信号在经过PCS单元2012和PMA单元2013时,会经历与第一比特位相同的处理过程,因此会产生与第一比特位相同的传输时延,从而保持与第一比特位的并行。因此,PMA单元2013在处理完成第一信号时,也完成了发送第一比特位,因此可以根据处理完成第一信号的时间点确定发送第一比特位的时间点,即第一时间点。例如,PMA单元2013可以将第一信号的处理结果作为获取第一时间点的触发条件,在处理完成第一信号时,PMA单元2013便从时钟电路获取当前的时间点作为第一时间点。With the above solution, when the MAC core unit 2011 sends the first bit, the first signal is sent in parallel, and the first signal is used as the parallel signal of the first bit. In the embodiment of the present application, the MAC core unit 2011 may send the first signal through out-of-band transmission, so that the transmission bandwidth of the data stream is not occupied. The first signal is always parallel to the first bit in the PCS unit 2012 and the PMA unit 2013. For example, when the first signal passes through the PCS unit 2012 and the PMA unit 2013, it will undergo the same processing process as the first bit. Therefore, the same transmission delay as that of the first bit will be generated, so as to keep parallel with the first bit. Therefore, when the PMA unit 2013 finishes processing the first signal, it also finishes sending the first bit, so the time point at which the first bit is sent can be determined according to the time point when the processing of the first signal is completed, that is, the first time point. For example, the PMA unit 2013 may use the processing result of the first signal as a trigger condition for obtaining a first time point. When the first signal is processed, the PMA unit 2013 obtains the current time point from the clock circuit as the first time point.
在本申请实施例中,MAC核心单元2011需要根据目标比特位与第一比特位之间间隔的比特位数估算PMA单元2013发送目标比特位的第二时间点。在一种可能的实现方式中,MAC核心单元2011还用于:开启第一计数器,第一计数器用于对MAC核心单元2011在接收到第一比特位之后,继续接收的比特位数进行计数;在根据第一时间点,以及目标比特位与第一比特位之间间隔的比特位数,估算PMA单元2013发送目标比特位的第二时间点之前,停止第一计数器,此时第一计数器记录的数值便可以作为目标比特位与第一比特位之间间隔的比特位数。In the embodiment of the present application, the MAC core unit 2011 needs to estimate the second time point at which the PMA unit 2013 sends the target bit according to the number of bits between the target bit and the first bit. In a possible implementation manner, the MAC core unit 2011 is further configured to enable a first counter, where the first counter is used to count the number of bits that the MAC core unit 2011 continues to receive after receiving the first bit; The first counter is stopped before the second time point at which the PMA unit 2013 sends the target bit is estimated based on the first time point and the number of bits between the target bit and the first bit. At this time, the first counter records The value of can be used as the number of bits between the target bit and the first bit.
例如图3中,MAC核心单元2011在接收到第一比特位bit1之后,启动第一计数器,第一计数器开始记录MAC核心单元2011在发送了第一比特位bit1之后,继续发送的比特位数。MAC核心单元2011在接收到目标比特位bit0后,停止第一计数器,此时第一计数器记录的数值便为bit0与bit1之间间隔的比特位数40bit。For example, in FIG. 3, after receiving the first bit bit1, the MAC core unit 2011 starts a first counter. The first counter starts to record the number of bits that the MAC core unit 2011 continues to send after sending the first bit bit1. After receiving the target bit bit0, the MAC core unit 2011 stops the first counter. At this time, the value recorded by the first counter is the bit number of 40 bits, which is the interval between bit0 and bit1.
在MAC装置201中,PCS单元2012会基于IEEE 802.3协议的规定对MAC核心单元2011发送的数据流进行编码,通常每隔64比特位进行一次编码,每次编码会在数据流中增加2比特位。例如,MAC核心单元2011向PCS单元2012发送的数据流大小为128bit,则经PCS单元2012编码后,PCS单元2012向PMA单元2013发送的数据流大小变为132bit。PCS单元2012对数据流进行编码,会使数据流的大小发生变化,不利于提高所估算的第二时间点的精度。In the MAC device 201, the PCS unit 2012 will encode the data stream sent by the MAC core unit 2011 based on the provisions of the IEEE 802.3 protocol. Usually, the encoding is performed every 64 bits. Each encoding will add 2 bits to the data stream. . For example, if the size of the data stream sent by the MAC core unit 2011 to the PCS unit 2012 is 128 bits, after being encoded by the PCS unit 2012, the size of the data stream sent by the PCS unit 2012 to the PMA unit 2013 becomes 132 bit. The encoding of the data stream by the PCS unit 2012 will change the size of the data stream, which is not conducive to improving the accuracy of the estimated second time point.
基于此,在一种可能的实现方式中,MAC核心单元2011还用于:通过第二计数器对发送的比特位数进行计数;在第二计数器累计64比特位时,重启第二计数器并在第一计数器的当前记录的数值中额外增加2比特位。重启后的第二计数器可以从零开始继续对MAC核心单元2011发送的比特位数进行计数。Based on this, in a possible implementation manner, the MAC core unit 2011 is further configured to: use a second counter to count the number of transmitted bits; when the second counter accumulates 64 bits, restart the second counter and restart the An additional 2 bits are added to the currently recorded value of a counter. The second counter after the restart may continue to count the number of bits sent by the MAC core unit 2011 from zero.
采用上述方案,MAC核心单元2011通过第二计数器每隔64比特位在第一计数器当前记录的数值中加2,使第一计数器的计数结果中包含了由于PCS单元2012编码而在数据流中增加的比特位数,从而使计数结果更加准确,进一步提高了所估算的第二时间点的精度。With the above scheme, the MAC core unit 2011 adds 2 to the currently recorded value of the first counter through the second counter every 64 bits, so that the counting result of the first counter includes an increase in the data stream due to the encoding of the PCS unit 2012. The number of bits, thereby making the counting result more accurate, and further improving the accuracy of the estimated second time point.
基于相同的技术构思,本申请实施例还提供另外一种MAC装置,该MAC装置可以更为精确地估算PMA单元接收到目标比特位的时间点。本申请实施例所提供的用于估算PMA单元接收到目标比特位的时间点MAC装置,结构与前述用于估算PMA单元发送目标比特位的时间点的MAC装置的结构类似,因此本申请实施例将继续以图2所示的MAC装置201为例对用于估算PMA单元接收到目标比特位的时间点的MAC装置进行说明。Based on the same technical concept, the embodiment of the present application further provides another MAC device, which can more accurately estimate the time point when the PMA unit receives the target bit. The structure of the MAC device for estimating the time point when the PMA unit receives the target bit provided in the embodiment of the present application is similar to that of the foregoing MAC device for estimating the time point when the PMA unit sends the target bit. Therefore, the embodiment of the present application The MAC device 201 shown in FIG. 2 will continue to be used as an example to describe the MAC device for estimating the time point when the PMA unit receives the target bit.
在图2所示的MAC装置201中,PMA单元2013用于获取第二比特位的第三时间点,并将第三时间点发送给MAC核心单元2011。其中,第二比特位的第三时间点为PMA单元接收第二比特位的时间点。In the MAC device 201 shown in FIG. 2, the PMA unit 2013 is configured to obtain a third time point of the second bit and send the third time point to the MAC core unit 2011. The third point in time of the second bit is the point in time when the PMA unit receives the second bit.
在本申请实施例中,PMA单元2013可以连续从serdes202接收数据流,数据流可以为报文、码流等多种形式。PMA单元2013对接收的数据流进行位宽变换等处理后,发送给PCS单元2012。PCS单元2014对所接收的数据流进行解编码等处理之后发送给MAC核心单元2011。In the embodiment of the present application, the PMA unit 2013 may continuously receive a data stream from the serdes 202, and the data stream may be in various forms such as a message and a code stream. The PMA unit 2013 performs processing such as bit width conversion on the received data stream and sends it to the PCS unit 2012. The PCS unit 2014 performs decoding and other processing on the received data stream and sends it to the MAC core unit 2011.
在本申请实施例中,第二比特位可以为PMA单元2013向PCS单元2012发送的数据流中的任一比特位,也可以是PMA单元2013向PCS单元2012发送的数据流中满足预设规则的比特位,例如,PMA单元2013每间隔预设比特位数确定当前发送的比特位为第一比特位。In the embodiment of the present application, the second bit may be any bit in the data stream sent by the PMA unit 2013 to the PCS unit 2012, or the data stream sent by the PMA unit 2013 to the PCS unit 2012 satisfies a preset rule. For example, the PMA unit 2013 presets the number of bits every interval to determine that the currently sent bit is the first bit.
由于本申请实施例中PMA单元2013发送第三时间点的传输方向与MAC装置201中所接收的数据流的传输方向相同,因此,MAC装置201中PMA单元2013可以经PCS单元将第三时间点发送给MAC核心单元2011。Since the transmission direction at the third time point sent by the PMA unit 2013 in the embodiment of the present application is the same as the transmission direction of the data stream received in the MAC device 201, the PMA unit 2013 in the MAC device 201 can send the third time point via the PCS unit. Send to MAC core unit 2011.
MAC核心单元2011,用于接收目标比特位,根据第三时间点,以及目标比特位与第二比特位之间间隔的比特位数,估算PMA单元2013接收到目标比特位的第四时间点。其中,目标比特位是PMA单元2012所接收的数据流中的比特位,经PMA单元2013和PCS单元2012发送给MAC核心单元2011。The MAC core unit 2011 is configured to receive a target bit, and estimate a fourth time point at which the PMA unit 2013 receives the target bit according to the third time point and the number of bits between the target bit and the second bit. The target bit is a bit in the data stream received by the PMA unit 2012 and is sent to the MAC core unit 2011 via the PMA unit 2013 and the PCS unit 2012.
例如,MAC核心单元2011根据以下公式二估算第四时间点:For example, the MAC core unit 2011 estimates the fourth time point according to the following formula 2:
t4=t3+m*UI(二)t4 = t3 + m * UI (2)
其中,t3为第三时间点;t4为第四时间点;m为目标比特位与第二比特位之间间隔的比特位数;UI为PMA单元2013接收1比特数据的传输时间。在本申请实施例中,UI可以根据serdes202的带宽计算获得。Among them, t3 is the third time point; t4 is the fourth time point; m is the number of bits between the target bit and the second bit; UI is the transmission time for the PMA unit 2013 to receive 1-bit data. In the embodiment of the present application, the UI may be obtained according to the bandwidth of the serdes 202.
采用上述方案,由于MAC装置201中的PMA单元2013可以连续地从serdes202接收数据流,因此,PMA单元2013接收目标比特位的第四时间点与接收第二比特位的第三时间点之间的时间间隔是可以通过目标比特位与第二比特位之间间隔的比特位数较为准确地估算获得的。因此,MAC核心单元2011通过目标比特位与第二比特位之间间隔的比特位数,以及PMA单元2013接收第二比特位的第三时间点,便可以较为准确地估算获取PMA单元2013接收到目标比特位的第四时间点。With the above scheme, since the PMA unit 2013 in the MAC device 201 can continuously receive the data stream from the serdes 202, the PMA unit 2013 is between the fourth time point when the target bit is received and the third time point when the second bit is received The time interval can be obtained by relatively accurately estimating the number of bits between the target bit and the second bit. Therefore, the MAC core unit 2011 can accurately estimate the number of bits received by the PMA unit 2013 based on the number of bits between the target bit and the second bit, and the third time point when the PMA unit 2013 receives the second bit. The fourth time point of the target bit.
在本申请实施例中,第二比特位可以没有固定的特征。因此,大部分MAC核心单元 2011在接收数据流时,并不具备识别数据流中第二比特位的功能。基于此,MAC核心单元2011还用于:接收PMA单元2013经PCS单元2012向MAC核心单元2011发送的第二信号和数据流;第二信号用于指示MAC核心单元2011从PCS单元2012接收的数据流中的第二比特位。在一种可能的实现方式中,该第二信号可以为脉冲信号。在本申请实施例中,第二信号也可以为的第二比特位的并行信号,第二信号与第二比特位之间的并行关系与第一信号与第一比特位之间的并行关系类似,本申请实施例不再赘述。In the embodiment of the present application, the second bit may not have a fixed feature. Therefore, most MAC core units 2011 do not have the function of identifying the second bit in the data stream when receiving the data stream. Based on this, the MAC core unit 2011 is also used to: receive the second signal and data stream sent by the PMA unit 2013 to the MAC core unit 2011 via the PCS unit 2012; the second signal is used to instruct the MAC core unit 2011 to receive data from the PCS unit 2012 The second bit in the stream. In a possible implementation manner, the second signal may be a pulse signal. In the embodiment of the present application, the second signal may also be a parallel signal of the second bit. The parallel relationship between the second signal and the second bit is similar to the parallel relationship between the first signal and the first bit. This embodiment of the present application will not repeat them.
在本申请实施例中,MAC核心单元2011需要根据第四比特位与第三比特位之间间隔的比特位数估算PMA单元2013接收目标比特位的第四时间点。在一种可能的实现方式中,MAC核心单元2011还用于开启第三计数器,第三计数器用于对MAC核心单元2011在接收第二比特位之后,继续接收的比特位数进行计数;在根据第三时间点,以及目标比特位与第二比特位之间间隔的比特位数,估算PMA单元2013发送目标比特位的第四时间点之前,停止第三计数器;第三计数器记录的数值便可以作为目标比特位与第二比特位之间间隔的比特位数。In the embodiment of the present application, the MAC core unit 2011 needs to estimate the fourth time point when the PMA unit 2013 receives the target bit according to the number of bits between the fourth bit and the third bit. In a possible implementation manner, the MAC core unit 2011 is further configured to enable a third counter, and the third counter is used to count the number of bits that the MAC core unit 2011 continues to receive after receiving the second bit; At the third point in time and the number of bits between the target bit and the second bit, it is estimated that before the fourth point in time when the PMA unit 2013 sends the target bit, the third counter is stopped; the value recorded by the third counter can be The number of bits used as the interval between the target bit and the second bit.
在一种可能的实现方式中,MAC核心单元2011可以根据第二信号确定是否收到了第二比特位。在接收到第二信号后,MAC核心单元2011开启第三计数器,开始对接收到第二比特位之后继续接收的比特位数进行计数。In a possible implementation manner, the MAC core unit 2011 may determine whether the second bit is received according to the second signal. After receiving the second signal, the MAC core unit 2011 starts a third counter and starts counting the number of bits that continue to be received after receiving the second bit.
在MAC装置201中,PCS单元2012具有解编码功能,每隔64个比特位进行一次解编码,一次解编码会扣除PCS单元2012所接收的数据流中的2个比特位。为了提高MAC核心单元2011所估算的第四时间点的精度,在一种可能的实现方式中,MAC核心单元2011还用于:通过第四计数器对接收的比特位数进行计数;在第四计数器累计64比特位时,重启第四计数器并在所述第三计数器的当前记录的数值中额外增加2比特位。In the MAC device 201, the PCS unit 2012 has a decoding function. Decoding is performed once every 64 bits. One decoding will deduct 2 bits from the data stream received by the PCS unit 2012. In order to improve the accuracy of the fourth time point estimated by the MAC core unit 2011, in a possible implementation manner, the MAC core unit 2011 is further configured to: count the number of received bits through a fourth counter; and in the fourth counter, When 64 bits are accumulated, the fourth counter is restarted and an additional 2 bits are added to the currently recorded value of the third counter.
采用上述方案,MAC核心单元2011通过第四计数器每隔64比特位在第一计数器当前记录的数值中加2,使第一计数器的计数结果中包含了由于PCS单元2012解编码而在PMA单元2013所接收的数据流中扣除的比特位数,从而使计数结果更加准确,进而提高了估算获得的第四时间点的精度。With the above scheme, the MAC core unit 2011 adds 2 to the currently recorded value of the first counter through the fourth counter every 64 bits, so that the counting result of the first counter includes the PMA unit 2013 due to the decoding of the PCS unit 2012. The number of bits subtracted from the received data stream makes the counting result more accurate, thereby improving the accuracy of the fourth time point obtained by the estimation.
基于相同的技术构思,本申请实施例还提供一种时间点估算方法,该方法可以估算发送目标比特位的时间点。应理解,本申请实施例所提供的时间点估算方法可以通过软件实现,例如,由发送目标比特位的装置内部的处理器通过调用存储器中存储的程序指令,以执行本申请实施例所提供的时间点估算方法。此外,本申请实施例所提供的也可以通过硬件与软件相结合的方式实现,例如,通过图2所示的MAC装置实现。为了便于理解,本申请实施例以图2所示的MAC装置为例,对本申请实施例所提供的时间点估算方法进行介绍。图4为本申请实施例提供的一种时间点估计方法流程示意图,如图4所示,主要包括以下步骤:Based on the same technical concept, the embodiment of the present application further provides a time point estimation method, which can estimate a time point at which a target bit is transmitted. It should be understood that the point-in-time estimation method provided in the embodiment of the present application may be implemented by software. For example, a processor inside a device that sends a target bit may call a program instruction stored in a memory to execute the method provided in the embodiment of the present application. Point-in-time estimation method. In addition, what is provided in the embodiment of the present application may also be implemented by a combination of hardware and software, for example, a MAC device shown in FIG. 2. For ease of understanding, the embodiment of the present application uses the MAC device shown in FIG. 2 as an example to introduce the time point estimation method provided in the embodiment of the present application. FIG. 4 is a schematic flowchart of a time point estimation method according to an embodiment of the present application. As shown in FIG. 4, the method mainly includes the following steps:
S401:PMA单元2013获取第一比特位的第一时间点。S401: The PMA unit 2013 obtains a first time point of a first bit.
其中,第一比特位的第一时间点为PMA单元2013发送第一比特位的时间点。The first time point of the first bit is the time point when the PMA unit 2013 sends the first bit.
S402:PMA单元将第一时间点发送给MAC核心单元2011。S402: The PMA unit sends the first time point to the MAC core unit 2011.
S403:MAC核心单元2011接收待发送的目标比特位,根据第一时间点,以及目标比特位与第一比特位之间间隔的比特位数,估算PMA单元2013发送目标比特位的第二时间点。S403: The MAC core unit 2011 receives the target bit to be transmitted, and estimates the second time point at which the PMA unit 2013 sends the target bit according to the first time point and the number of bits between the target bit and the first bit. .
在一种可能的实现方式中,MAC核心单元2011在经PCS单元2012向PMA单元2013发送包括第一比特位的数据流时,还可以经PCS单元2012向PMA单元2013发送第一信号;第一信号为第一比特位的并行信号;PMA单元2013在对数据流进行处理时,并行处理第一信号和第一比特位,并将第一比特位和并行处理完成第一信号的时间点作为所述第一时间点。其中,第一信号可以为脉冲信号。In a possible implementation manner, when the MAC core unit 2011 sends the data stream including the first bit to the PMA unit 2013 via the PCS unit 2012, the MAC core unit 2011 may also send a first signal to the PMA unit 2013 via the PCS unit 2012; The signal is a parallel signal of the first bit; when the PMA unit 2013 processes the data stream, the first signal and the first bit are processed in parallel, and the time when the first bit and the parallel processing complete the first signal is taken as the The first point in time. The first signal may be a pulse signal.
图5以1588报文为例,为本申请实施例提供的一种MAC装置内部第一信号示意图,其中,1588报文的起始比特位为目标比特位。如图5所示,MAC核心单元2011向PMA单元2013并行发送第一信号和第一比特位bit1,其中,第一信号采用带外传输,不占用bit1所在数据流的传输带宽。PMA单元2013处理并发送bit1,获取处理完成第一信号的时间点作为第一时间点t1。之后,PMA单元2013将第一时间点t1发送给MAC核心单元2011。MAC核心单元2011在接收到目标比特位时,根据第一时间点t1、目标比特位与bit1之间间隔的比特位数,估算第二时间点t2。之后,MAC核心单元2011根据第二时间点t2为1588报文添加(或更新)时间戳,并将添加(或更新)了时间戳的1588报文经PCS单元2012发送给PMA单元2013。PMA单元2013接收并处理1588报文后,发送处理后的1588报文。FIG. 5 uses a 1588 message as an example, which is a schematic diagram of a first signal inside a MAC device according to an embodiment of the present application, where a start bit of a 1588 message is a target bit. As shown in FIG. 5, the MAC core unit 2011 sends the first signal and the first bit bit1 to the PMA unit 2013 in parallel, where the first signal is transmitted out of band and does not occupy the transmission bandwidth of the data stream where bit1 is located. The PMA unit 2013 processes and sends bit1, and obtains the time point when the processing of the first signal is completed as the first time point t1. After that, the PMA unit 2013 sends the first time point t1 to the MAC core unit 2011. When the MAC core unit 2011 receives the target bit, it estimates the second time point t2 according to the first time point t1, the number of bits spaced between the target bit and bit1. After that, the MAC core unit 2011 adds (or updates) a timestamp to the 1588 message according to the second time point t2, and sends the 1588 message with the timestamp added (or updated) to the PMA unit 2013 via the PCS unit 2012. After the PMA unit 2013 receives and processes the 1588 message, it sends the processed 1588 message.
在一种可能的实现方式中,MAC核心单元2011可以根据公式t2=t1+n*UI估算第二时间点,其中,t1为第一时间点;t2为第二时间点;n为目标比特位与第一比特位之间间隔的比特位数;UI为PMA单元2013发送1比特数据的传输时间。In a possible implementation manner, the MAC core unit 2011 may estimate the second time point according to the formula t2 = t1 + n * UI, where t1 is the first time point; t2 is the second time point; n is the target bit The number of bits spaced from the first bit; UI is the transmission time for the PMA unit 2013 to send 1-bit data.
在一种可能的实现方式中,MAC核心单元2011还可以开启第一计数器,第一计数器用于对MAC核心单元2011在接收到第一比特位之后,继续接收的比特位数进行计数;MAC核心单元2011在根据第一时间点,以及目标比特位与第一比特位之间间隔的比特位数,估算PMA单元2013发送目标比特位的第二时间点之前,停止第一计数器,此时第一计数器记录的数值可以作为目标比特位与第一比特位之间间隔的比特位数。In a possible implementation manner, the MAC core unit 2011 may also enable a first counter. The first counter is used to count the number of bits that the MAC core unit 2011 continues to receive after receiving the first bit; the MAC core The unit 2011 stops the first counter before estimating the second time point at which the PMA unit 2013 sends the target bit based on the first time point and the number of bits between the target bit and the first bit. At this time, the first counter The value recorded by the counter can be used as the number of bits between the target bit and the first bit.
以1588报文为例,图6为本申请实施例提供的一种可能的时间点估算方法流程示意图,如图6所示,主要包括以下步骤:Taking a 1588 message as an example, FIG. 6 is a schematic flowchart of a possible time point estimation method provided by an embodiment of the present application. As shown in FIG. 6, it mainly includes the following steps:
S601:MAC核心单元2011经PCS单元2012向PMA单元2013发送第一信号,并开启第一计数器。S601: The MAC core unit 2011 sends a first signal to the PMA unit 2013 via the PCS unit 2012, and starts a first counter.
S602:PMA单元2013处理完成第一信号,并获取处理完成第一信号的时间点作为第一时间点。S602: The PMA unit 2013 completes processing of the first signal, and obtains the time point when the processing completes the first signal as the first time point.
S603:PMA单元2013将获取的第一时间点发送给MAC核心单元2011。S603: The PMA unit 2013 sends the acquired first time point to the MAC core unit 2011.
S604:MAC核心单元2011接收并缓存第一时间点。S604: The MAC core unit 2011 receives and buffers the first time point.
S605:MAC核心单元2011在接收到1588报文的起始比特位时,根据第一计数器当前记录的数值以及第一时间点,估算第二时间点。并根据估算的第二时间点为1588报文添加(或更新)时间戳。S605: When receiving the start bit of the 1588 packet, the MAC core unit 2011 estimates the second time point according to the value currently recorded by the first counter and the first time point. A 1588 message is time stamped (or updated) according to the estimated second time point.
S606:MAC核心单元2011经PCS单元2012向PMA单元2013发送添加(或更新)了时间戳的1588报文。S606: The MAC core unit 2011 sends (adds or updates) a 1588 packet to the PMA unit 2013 via the PCS unit 2012.
S607:MAC核心单元2011判断是否需要更新第一时间点。若是,则返回执行S601;若否,则返回执行S605。S607: The MAC core unit 2011 determines whether the first time point needs to be updated. If yes, go back to S601; if not, go back to S605.
在本申请实施例中,MAC核心单元2011可以根据预设的比特位数间隔,从所接收到的数据流中确定第一比特位,在接收到了满足预设规则的第一比特位时,便可以认为需要 更新第一时间点。In the embodiment of the present application, the MAC core unit 2011 may determine a first bit from the received data stream according to a preset bit-bit interval. When a first bit that satisfies a preset rule is received, the MAC core unit 2011 may It can be considered that the first time point needs to be updated.
在一种可能的实现方式中,MAC核心单元2011还可以通过第二计数器对发送的比特位数进行计数;MAC核心单元2011在第二计数器累计64比特位时,重启第二计数器并在第一计数器当前记录的数值中额外增加2比特位。In a possible implementation manner, the MAC core unit 2011 may also count the number of bits transmitted by using a second counter; when the MAC core unit 2011 accumulates 64 bits, the second counter is restarted and the first counter An additional 2 bits are added to the value currently recorded by the counter.
基于相同的技术构思,本申请实施例还提供一种时间点估算方法,该方法可以估算接收到目标比特位的时间点。应理解,本申请实施例所提供的时间点估算方法可以通过软件实现,例如,由接收目标比特位的装置内部的处理器通过调用存储器中存储的程序指令,以执行本申请实施例所提供的时间点估算方法。此外,本申请实施例所提供的也可以通过硬件与软件相结合的方式实现,例如,通过图2所示的MAC装置实现。为了便于理解,本申请实施例以图2所示的MAC装置为例,对本申请实施例所提供的时间点估算方法进行介绍。图7为本申请实施例提供的一种时间点估算方法流程示意图,如图7所示,主要包括以下步骤:Based on the same technical concept, an embodiment of the present application further provides a method for estimating a point in time, which can estimate a point in time when a target bit is received. It should be understood that the point-in-time estimation method provided in the embodiment of the present application may be implemented by software. For example, a processor inside a device receiving a target bit may call a program instruction stored in a memory to execute the method provided in the embodiment of the present application. Point-in-time estimation method. In addition, what is provided in the embodiment of the present application may also be implemented by a combination of hardware and software, for example, a MAC device shown in FIG. 2. For ease of understanding, the embodiment of the present application uses the MAC device shown in FIG. 2 as an example to introduce the time point estimation method provided in the embodiment of the present application. FIG. 7 is a schematic flowchart of a time point estimation method according to an embodiment of the present application. As shown in FIG. 7, the method mainly includes the following steps:
S701:PMA单元2013获取第二比特位的第三时间点,并将第三时间点发送给MAC核心单元2011。S701: The PMA unit 2013 obtains a third time point of the second bit, and sends the third time point to the MAC core unit 2011.
其中,第二比特位的第三时间点为PMA单元2013接收到第二比特位的时间点。在本申请实施例中,第二比特位是PMA单元2013连续接收的数据流中的比特位。如图7所示,PMA单元会将第二比特位所在的数据流经PCS单元2012发送给MAC核心单元2011。The third point in time of the second bit is the point in time when the second bit is received by the PMA unit 2013. In the embodiment of the present application, the second bit is a bit in a data stream continuously received by the PMA unit 2013. As shown in FIG. 7, the PMA unit sends the data where the second bit is located to the MAC core unit 2011 through the PCS unit 2012.
S702:MAC核心单元2011接收来自PCS单元2012的第二比特位,以及,接收PMA单元2013发送的第三时间点,MAC核心单元2011还可以进一步缓存第三时间点。S702: The MAC core unit 2011 receives the second bit from the PCS unit 2012, and receives the third time point sent by the PMA unit 2013. The MAC core unit 2011 may further buffer the third time point.
S703:MAC核心单元2011接收目标比特位,根据第三时间点,以及目标比特位与第二比特位之间间隔的比特位数,估算PMA单元2013接收到目标比特位的第四时间点。S703: The MAC core unit 2011 receives the target bit, and estimates the fourth time point at which the PMA unit 2013 receives the target bit according to the third time point and the number of bits between the target bit and the second bit.
如图7所示,PMA单元会持续将接收到的数据流经PCS单元2012发送给MAC核心单元。MAC核心单元2011接收PCS2012发送的数据流,在接收到目标比特位时,便可以执行S703。As shown in Figure 7, the PMA unit will continue to send the received data to the MAC core unit through the PCS unit 2012. The MAC core unit 2011 receives the data stream sent by the PCS2012, and when receiving the target bit, it can execute S703.
在一种可能的实现方式中,PMA单元2013还可以生成第二信号;在对接收到的第二比特位进行处理时,并行处理第二信号;在经PCS单元2012向MAC核心单元2011发送处理后的第二比特位时,经PCS单元2012向MAC核心单元2011并行发送第二信号;MAC核心单元2011接收PCS单元2012并行发送的第二信号和第二比特位;根据第二信号,记录接收到第二比特位之后继续接收的比特位数。其中,第二信号可以为脉冲信号。In a possible implementation manner, the PMA unit 2013 may further generate a second signal; when the received second bit is processed, the second signal is processed in parallel; and the PCS unit 2012 sends the processing to the MAC core unit 2011 When the second bit is later, the second signal is sent in parallel to the MAC core unit 2011 via the PCS unit 2012; the MAC core unit 2011 receives the second signal and the second bit sent in parallel by the PCS unit 2012; The number of bits that continue to be received after the second bit. The second signal may be a pulse signal.
在一种可能的实现方式中,第二比特位为PMA单元2013向PCS单元2012发送的数据流中满足预设规则的比特位;预设规则包括任意相邻第二比特位之间间隔预设比特位数。In a possible implementation manner, the second bit is a bit in the data stream sent by the PMA unit 2013 to the PCS unit 2012 that meets a preset rule; the preset rule includes a preset interval between any adjacent second bits The number of bits.
在一种可能的实现方式中,MAC核心单元2011可以根据以下公式估算第四时间点:t4=t3+m*UI,其中,t3为第三时间点;t4为第四时间点;m为目标比特位与第二比特位之间间隔的比特位数;UI为PMA单元2013接收1比特数据的传输时间。In a possible implementation manner, the MAC core unit 2011 can estimate the fourth time point according to the following formula: t4 = t3 + m * UI, where t3 is the third time point; t4 is the fourth time point; m is the target The number of bits between the bit and the second bit; UI is the transmission time for the PMA unit 2013 to receive 1-bit data.
在一种可能的实现方式中,MAC核心单元2011还可以开启第三计数器,第三计数器用于对MAC核心单元2011在接收第二信号之后,继续接收的比特位数进行计数;MAC核心单元2011在根据第三时间点,以及目标比特位与第二比特位之间间隔的比特位数,估算PMA单元2013发送目标比特位的第四时间点之前,可以停止第三计数器,此时第三计数器记录的数值便可以作为目标比特位与第二比特位之间间隔的比特位数。In a possible implementation manner, the MAC core unit 2011 may further enable a third counter. The third counter is used to count the number of bits that the MAC core unit 2011 continues to receive after receiving the second signal; the MAC core unit 2011 The third counter can be stopped before the fourth time point at which the PMA unit 2013 sends the target bit is estimated based on the third time point and the number of bits between the target bit and the second bit. At this time, the third counter The recorded value can be used as the number of bits between the target bit and the second bit.
在一种可能的实现方式中,MAC核心单元2011还可以通过第四计数器对接收的比特 位数进行计数;在第四计数器累计64比特位时,重启第四计数器并在第三计数器当前记录的数值中额外增加2比特位。In a possible implementation manner, the MAC core unit 2011 may also count the number of received bits through a fourth counter; when the fourth counter accumulates 64 bits, restart the fourth counter and record the An additional 2 bits are added to the value.
基于相同的技术构思,本申请实施例还提供一种芯片,该芯片包括如上述任一实施例提供的MAC装置。在一种可能的实现方式中,该芯片还包括serdes。serdes与MAC装置中的PMA单元相连接。应理解,serdes与MAC装置之间既可以是两个单独的电路结构,也可以集成于同一电路结构中,例如,serdes也可以与PMA单元集成于同一电路结构中,又例如,PCS单元、PMA单元和serdes单元可以集成于同一电路结构中等等,本申请实施例对此并不多作限定。Based on the same technical concept, an embodiment of the present application further provides a chip, which includes a MAC device provided by any one of the foregoing embodiments. In a possible implementation manner, the chip further includes serdes. serdes is connected to the PMA unit in the MAC device. It should be understood that there may be two separate circuit structures between the serdes and the MAC device, or they may be integrated into the same circuit structure. For example, serdes may also be integrated with the PMA unit in the same circuit structure. For example, the PCS unit, PMA The unit and the serdes unit may be integrated in the same circuit structure, etc., which are not limited in the embodiment of the present application.
基于相同的技术构思,本申请实施例还提供一种电子设备,该电子设备包括如上述任一实施例提供的MAC装置,能够执行图4和/或图7所示的时间点估算方法。Based on the same technical concept, an embodiment of the present application further provides an electronic device including the MAC device provided in any one of the foregoing embodiments, and capable of performing the time point estimation method shown in FIG. 4 and / or FIG. 7.
基于相同的技术构思,本申请实施例还提供一种程序,该程序在某一装置上执行时,将会使该装置实现上述任一种实施例提供的时间点估算方法。Based on the same technical concept, the embodiment of the present application further provides a program, which when executed on a certain device, will cause the device to implement the time point estimation method provided by any of the above embodiments.
以上所述,以上实施例仅用以对本申请的技术方案进行了详细介绍,但以上实施例的说明只是用于帮助理解本申请实施例的方法,不应理解为对本申请实施例的限制。本技术领域的技术人员可轻易想到的变化或替换,都应涵盖在本申请实施例的保护范围之内。As mentioned above, the above embodiments are only used to introduce the technical solution of the present application in detail, but the description of the above embodiments is only used to help understand the methods of the embodiments of the present application, and should not be construed as limiting the embodiments of the present application. Changes or substitutions that can be easily conceived by those skilled in the art should be covered within the protection scope of the embodiments of the present application.

Claims (26)

  1. 一种媒体接入控制MAC装置,其特征在于,包括:MAC核心单元和物理介质连接子层PMA单元;A medium access control MAC device, comprising: a MAC core unit and a physical medium connection sublayer PMA unit;
    所述PMA单元,用于获取第一比特位的第一时间点,将所述第一时间点发送给所述MAC核心单元;所述第一比特位的第一时间点为所述PMA单元发送所述第一比特位的时间点;The PMA unit is configured to obtain a first time point of a first bit, and send the first time point to the MAC core unit; the first time point of the first bit is sent by the PMA unit A time point of the first bit;
    所述MAC核心单元,用于接收待发送的目标比特位,根据所述第一时间点,以及所述目标比特位与所述第一比特位之间间隔的比特位数,估算所述PMA单元发送所述目标比特位的第二时间点;所述第一比特位和所述目标比特位为所述PMA单元连续发送的数据流中的比特位。The MAC core unit is configured to receive a target bit to be transmitted, and estimate the PMA unit according to the first time point and a number of bits of an interval between the target bit and the first bit. The second time point at which the target bit is sent; the first bit and the target bit are bits in a data stream continuously sent by the PMA unit.
  2. 如权利要求1所述的MAC装置,其特征在于,所述PMA单元还用于:The MAC device according to claim 1, wherein the PMA unit is further configured to:
    接收所述MAC核心单元经物理编码子层PCS单元向所述PMA单元发送的第一信号和数据流;所述第一信号用于指示所述PMA单元从所述PCS单元接收的数据流中的所述第一比特位。Receiving a first signal and a data stream sent by the MAC core unit to the PMA unit via a physical coding sublayer PCS unit; the first signal is used to instruct the PMA unit in a data stream received from the PCS unit The first bit.
  3. 如权利要求2所述的MAC装置,其特征在于,所述第一比特位为所述MAC核心单元向所述PCS单元发送的数据流中满足预设规则的比特位;所述预设规则包括任意相邻第一比特位之间间隔预设比特位数。The MAC device according to claim 2, wherein the first bit is a bit in a data stream sent by the MAC core unit to the PCS unit that satisfies a preset rule; the preset rule includes There is a preset number of bits between any adjacent first bits.
  4. 如权利要求1至3中任一项所述的MAC装置,其特征在于,所述MAC核心单元在根据所述第一时间点,以及所述目标比特位与所述第一比特位之间间隔的比特位数,估算所述PMA单元发送所述目标比特位的第二时间点时,具体用于:The MAC device according to any one of claims 1 to 3, wherein the MAC core unit is spaced according to the first time point, and between the target bit and the first bit. When estimating the second time point at which the PMA unit sends the target bit, is specifically used to:
    根据以下公式估算所述第二时间点:The second time point is estimated according to the following formula:
    t2=t1+n*UIt2 = t1 + n * UI
    其中,t1为所述第一时间点;t2为所述第二时间点;n为所述目标比特位与所述第一比特位之间间隔的比特位数;UI为所述PMA单元发送1比特数据的传输时间。Where t1 is the first point in time; t2 is the second point in time; n is the number of bits between the target bit and the first bit; UI is 1 sent by the PMA unit Transmission time of bit data.
  5. 如权利要求1至4中任一项所述的MAC装置,其特征在于,所述MAC核心单元还用于:The MAC device according to any one of claims 1 to 4, wherein the MAC core unit is further configured to:
    开启第一计数器,所述第一计数器用于对所述MAC核心单元在接收到所述第一比特位之后,继续接收的比特位数进行计数;Turning on a first counter, where the first counter is used to count the number of bits that the MAC core unit continues to receive after receiving the first bit;
    在根据所述第一时间点,以及所述目标比特位与所述第一比特位之间间隔的比特位数,估算所述PMA单元发送所述目标比特位的第二时间点之前,停止所述第一计数器;所述第一计数器记录的数值为所述的目标比特位与所述第一比特位之间间隔的比特位数。Stopping, before estimating the second point in time at which the PMA unit sends the target bit, based on the first point in time and the number of bits between the target bit and the first bit; The first counter; the value recorded by the first counter is the number of bits between the target bit and the first bit.
  6. 如权利要求5所述的MAC装置,其特征在于,所述MAC核心单元还用于:The MAC device according to claim 5, wherein the MAC core unit is further configured to:
    通过第二计数器对接收的比特位数进行计数;Counting the number of received bits through a second counter;
    在所述第二计数器累计64比特位时,重启所述第二计数器并在所述第一计数器当前记录的数值中额外增加2比特位。When the second counter accumulates 64 bits, restart the second counter and add an additional 2 bits to the value currently recorded by the first counter.
  7. 如权利要求2所述的MAC装置,其特征在于,所述第一信号为脉冲信号。The MAC device according to claim 2, wherein the first signal is a pulse signal.
  8. 如权利要求1至7中任一项所述的MAC装置,其特征在于,所述目标比特位为1588报文的起始比特位;The MAC device according to any one of claims 1 to 7, wherein the target bit is a start bit of a 1588 packet;
    所述MAC核心单元还用于:The MAC core unit is further configured to:
    根据估算获得的所述第二时间点,添加或更新所述1588报文中的时间戳。Add or update the timestamp in the 1588 packet according to the second time point obtained by the estimation.
  9. 一种媒体接入控制MAC装置,其特征在于,包括:MAC核心单元和物理介质连接子层PMA单元;A medium access control MAC device, comprising: a MAC core unit and a physical medium connection sublayer PMA unit;
    所述PMA单元,用于获取第二比特位的第三时间点,并将所述第三时间点发送给所述MAC核心单元;所述第二比特位的第三时间点为所述PMA单元接收所述第二比特位的时间点;The PMA unit is configured to obtain a third time point of the second bit and send the third time point to the MAC core unit; the third time point of the second bit is the PMA unit A point in time when the second bit is received;
    所述MAC核心单元,用于接收目标比特位,根据所述第三时间点,以及所述目标比特位与所述第二比特位之间间隔的比特位数,估算所述PMA单元接收到所述目标比特位的第四时间点;所述目标比特位和所述第二比特位为所述PMA单元连续接收的数据流中的比特位。The MAC core unit is configured to receive a target bit, and estimate, based on the third time point, and a number of bits of an interval between the target bit and the second bit, The fourth time point of the target bit; the target bit and the second bit are bits in a data stream continuously received by the PMA unit.
  10. 如权利要求9所述的MAC装置,其特征在于,所述MAC核心单元还用于:The MAC device according to claim 9, wherein the MAC core unit is further configured to:
    接收所述PMA单元经物理编码子层PCS单元向所述MAC核心单元发送的第二信号和数据流;所述第二信号用于指示所述MAC核心单元从所述PCS单元接收的数据流中的第二比特位。Receiving a second signal and a data stream sent by the PMA unit to the MAC core unit via a physical coding sub-layer PCS unit; the second signal is used to instruct the MAC core unit to receive a data stream from the PCS unit The second bit.
  11. 如权利要求10所述的MAC装置,其特征在于,所述第二比特位为所述PMA单元向所述PCS单元发送的数据流中满足预设规则的比特位;所述预设规则包括任意相邻第二比特位之间间隔预设比特位数。The MAC device according to claim 10, wherein the second bit is a bit in a data stream sent by the PMA unit to the PCS unit that satisfies a preset rule; the preset rule includes any There is a preset number of bits between adjacent second bits.
  12. 如权利要求9至11中任一项所述的MAC装置,其特征在于,所述MAC核心单元在根据所述第三时间点,以及所述目标比特位与所述第二比特位之间间隔的比特位数,估算所述PMA单元接收到所述目标比特位的第四时间点时,具体用于:The MAC device according to any one of claims 9 to 11, wherein the MAC core unit is spaced according to the third time point, and between the target bit and the second bit. When estimating the fourth time point when the PMA unit receives the target bit, it is specifically used to:
    根据以下公式估算所述第四时间点:The fourth time point is estimated according to the following formula:
    t4=t3+m*UIt4 = t3 + m * UI
    其中,t3为所述第三时间点;t4为所述第四时间点;m为所述目标比特位与所述第二比特位之间间隔的比特位数;UI为所述PMA单元接收1比特数据的传输时间。Where t3 is the third time point; t4 is the fourth time point; m is the number of bits between the target bit and the second bit; UI is 1 received by the PMA unit Transmission time of bit data.
  13. 如权利要求9至12中任一项所述的MAC装置,其特征在于,所述MAC核心单元还用于:The MAC device according to any one of claims 9 to 12, wherein the MAC core unit is further configured to:
    开启第三计数器,所述第三计数器用于对所述MAC核心单元在接收到所述第二比特位之后,继续接收的比特位数进行计数;Enabling a third counter, where the third counter is used to count the number of bits that the MAC core unit continues to receive after receiving the second bit;
    在根据所述第三时间点,以及所述目标比特位与所述第二比特位之间间隔的比特位数,估算所述PMA单元接收到所述目标比特位的第四时间点之前,停止所述第三计数器;所述第三计数器记录的数值为所述目标比特位与所述第二比特位之间间隔的比特位数。Stopping before estimating the fourth time point at which the PMA unit receives the target bit according to the third time point and the number of bits between the target bit and the second bit The third counter; and the value recorded by the third counter is the number of bits between the target bit and the second bit.
  14. 如权利要求13所述的MAC装置,其特征在于,所述MAC核心单元还用于:The MAC device according to claim 13, wherein the MAC core unit is further configured to:
    通过第四计数器对接收的比特位数进行计数;Counting the number of received bits through a fourth counter;
    在所述第四计数器累计64比特位时,重启所述第四计数器并在所述第三计数器当前记录的数值中额外增加2比特位。When the fourth counter accumulates 64 bits, restart the fourth counter and add an additional 2 bits to the value currently recorded by the third counter.
  15. 如权利要求10所述的MAC装置,其特征在于,所述第二信号为脉冲信号。The MAC device according to claim 10, wherein the second signal is a pulse signal.
  16. 一种时间点估算方法,其特征在于,包括:A point-in-time estimation method, including:
    获取第一比特位的第一时间点;所述第一比特位的第一时间点为发送所述第一比特位的时间点;Obtaining a first time point of a first bit; the first time point of the first bit is a time point of sending the first bit;
    接收待发送的目标比特位,根据所述第一时间点,以及所述目标比特位与所述第一比特位之间间隔的比特位数,估算发送所述目标比特位的第二时间点;所述第一比特位和所述目标比特位为连续发送的数据流中的比特位。Receiving a target bit to be sent, and estimating a second time point at which the target bit is sent according to the first point in time and the number of bits between the target bit and the first bit; The first bit and the target bit are bits in a continuously transmitted data stream.
  17. 如权利要求16所述的方法,其特征在于,根据所述第一时间点,以及所述目标比特位与所述第一比特位之间间隔的比特位数,估算发送所述目标比特位的第二时间点,包括:The method according to claim 16, characterized in that, based on the first point in time and the number of bits between the target bit and the first bit, an estimated Second time point, including:
    根据以下公式估算所述第二时间点:The second time point is estimated according to the following formula:
    t2=t1+n*UIt2 = t1 + n * UI
    其中,t1为所述第一时间点;t2为所述第二时间点;n为所述目标比特位与所述第一比特位之间间隔的比特位数;UI为发送1比特数据的传输时间。Among them, t1 is the first time point; t2 is the second time point; n is the number of bits between the target bit and the first bit; UI is transmission for sending 1-bit data time.
  18. 如权利要求16或17所述的方法,其特征在于,还包括:The method according to claim 16 or 17, further comprising:
    开启第一计数器,所述第一计数器用于对在接收到所述第一比特位之后,继续接收的比特位数进行计数;Turning on a first counter, which is used to count the number of bits that continue to be received after the first bit is received;
    根据所述第一时间点,以及所述目标比特位与所述第一比特位之间间隔的比特位数,估算发送所述目标比特位的第二时间点之前,还包括:According to the first time point and the number of bits spaced between the target bit and the first bit, before estimating the second time point when the target bit is sent, the method further includes:
    停止所述第一计数器;所述第一计数器记录的数值为所述目标比特位与所述第一比特位之间间隔的比特位数。Stopping the first counter; the value recorded by the first counter is the number of bits between the target bit and the first bit.
  19. 如权利要求18所述的方法,其特征在于,所述方法还包括:The method of claim 18, further comprising:
    通过第二计数器对接收的比特位数进行计数;Counting the number of received bits through a second counter;
    在所述第二计数器累计64比特位时,重启所述第二计数器并在所述第一计数器当前记录的数值中额外增加2比特位。When the second counter accumulates 64 bits, restart the second counter and add an additional 2 bits to the value currently recorded by the first counter.
  20. 如权利要求16至19中任一项所述的方法,其特征在于,所述目标比特位为1588报文的起始比特位;The method according to any one of claims 16 to 19, wherein the target bit is a start bit of a 1588 packet;
    所述方法还包括:The method further includes:
    根据估算获得的所述第二时间点,添加或更新所述1588报文中的时间戳。Add or update the timestamp in the 1588 packet according to the second time point obtained by the estimation.
  21. 一种时间点估算方法,其特征在于,包括:A point-in-time estimation method, including:
    获取第二比特位的第三时间点;所述第二比特位的第三时间点为接收所述第二比特位的时间点;Obtaining a third time point of the second bit; the third time point of the second bit is the time point of receiving the second bit;
    接收目标比特位,根据所述第三时间点,以及所述目标比特位与所述第二比特位之间间隔的比特位数,估算接收到所述目标比特位的第四时间点;所述目标比特位和所述第二比特位为连续接收的数据流中的比特位。Receiving a target bit, and estimating a fourth time point at which the target bit is received according to the third point in time, and the number of bits between the target bit and the second bit; The target bit and the second bit are bits in a continuously received data stream.
  22. 如权利要求21所述的方法,其特征在于,根据所述第三时间点,以及所述目标比特位与所述第二比特位之间间隔的比特位数,估算接收到所述目标比特位的第四时间点,包括:The method according to claim 21, wherein the target bit is estimated to be received according to the third point in time and the number of bits between the target bit and the second bit The fourth time point, including:
    根据以下公式估算所述第四时间点:The fourth time point is estimated according to the following formula:
    t4=t3+m*UIt4 = t3 + m * UI
    其中,t3为所述第三时间点;t4为所述第四时间点;m为所述目标比特位与所述第二比特位之间间隔的比特位数;UI为所述接收1比特数据的传输时间。Where t3 is the third time point; t4 is the fourth time point; m is the number of bits between the target bit and the second bit; UI is the received 1-bit data Transmission time.
  23. 如权利要求21或22所述的方法,其特征在于,还包括:The method according to claim 21 or 22, further comprising:
    开启第三计数器,所述第三计数器用于对在接收到所述第二比特位之后,继续接收的 比特位数进行计数;Turning on a third counter, which is used to count the number of bits that continue to be received after the second bit is received;
    根据所述第三时间点,以及所述目标比特位与所述第二比特位之间间隔的比特位数,估算接收到所述目标比特位的第四时间点之前,还包括:According to the third point in time and the number of bits spaced between the target bit and the second bit, estimating the fourth point in time before receiving the target bit further includes:
    停止所述第三计数器;所述第三计数器记录的数值为所述目标比特位与所述第二比特位之间间隔的比特位数。Stopping the third counter; the value recorded by the third counter is the number of bits between the target bit and the second bit.
  24. 如权利要求23所述的方法,其特征在于,所述方法还包括:The method of claim 23, further comprising:
    通过第四计数器对接收到的比特位数进行计数;Counting the number of received bits through a fourth counter;
    在所述第四计数器累计64比特位时,重启所述第四计数器并在所述第三计数器当前记录的数值中额外增加2比特位。When the fourth counter accumulates 64 bits, restart the fourth counter and add an additional 2 bits to the value currently recorded by the third counter.
  25. 一种芯片,其特征在于,包括如MAC装置和并行/串行器serdes;A chip characterized by including, for example, a MAC device and a parallel / serializer serdes;
    所述MAC装置中的PMA单元与所述serdes连接;所述MAC装置为如权利要求1至15中任一项所述的MAC装置。The PMA unit in the MAC device is connected to the serdes; the MAC device is the MAC device according to any one of claims 1 to 15.
  26. 一种电子设备,其特征在于,包括如权利要求25所述的芯片。An electronic device, comprising the chip according to claim 25.
PCT/CN2018/109060 2018-09-30 2018-09-30 Mac device and time point estimation method WO2020062225A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201880097191.4A CN112640355B (en) 2018-09-30 2018-09-30 MAC device and time point estimation method
PCT/CN2018/109060 WO2020062225A1 (en) 2018-09-30 2018-09-30 Mac device and time point estimation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/109060 WO2020062225A1 (en) 2018-09-30 2018-09-30 Mac device and time point estimation method

Publications (1)

Publication Number Publication Date
WO2020062225A1 true WO2020062225A1 (en) 2020-04-02

Family

ID=69949572

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/109060 WO2020062225A1 (en) 2018-09-30 2018-09-30 Mac device and time point estimation method

Country Status (2)

Country Link
CN (1) CN112640355B (en)
WO (1) WO2020062225A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220006546A1 (en) * 2018-11-14 2022-01-06 Sanechips Technology Co., Ltd. Time Synchronization Method and Device, and Storage Medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102224702A (en) * 2008-10-01 2011-10-19 北电网络有限公司 Techniques for time transfer via signal encoding
CN104052588A (en) * 2013-03-14 2014-09-17 阿尔特拉公司 Methods to achieve accurate time stamp in ieee 1588 for system with fec encoder
US20150381338A1 (en) * 2014-06-30 2015-12-31 International Business Machines Corporation Latency-optimized physical coding sublayer
US20160337114A1 (en) * 2015-05-15 2016-11-17 Broadcom Corporation Apparatus and method for timestamping of data packets
CN108322280A (en) * 2017-12-12 2018-07-24 北京时代民芯科技有限公司 A kind of distributed computer network (DCN) clock synchronizing relay compensation method

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102244572B (en) * 2011-07-18 2017-06-06 中兴通讯股份有限公司 A kind of method and device for realizing that clock is synchronous
CN104113517A (en) * 2013-04-22 2014-10-22 华为技术有限公司 Timestamp generation method, device and system
CN105577349A (en) * 2014-10-31 2016-05-11 中国飞行试验研究院 Airborne network IEEE1588 protocol master-slave clock port synchronization method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102224702A (en) * 2008-10-01 2011-10-19 北电网络有限公司 Techniques for time transfer via signal encoding
CN104052588A (en) * 2013-03-14 2014-09-17 阿尔特拉公司 Methods to achieve accurate time stamp in ieee 1588 for system with fec encoder
US20150381338A1 (en) * 2014-06-30 2015-12-31 International Business Machines Corporation Latency-optimized physical coding sublayer
US20160337114A1 (en) * 2015-05-15 2016-11-17 Broadcom Corporation Apparatus and method for timestamping of data packets
CN108322280A (en) * 2017-12-12 2018-07-24 北京时代民芯科技有限公司 A kind of distributed computer network (DCN) clock synchronizing relay compensation method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220006546A1 (en) * 2018-11-14 2022-01-06 Sanechips Technology Co., Ltd. Time Synchronization Method and Device, and Storage Medium

Also Published As

Publication number Publication date
CN112640355A (en) 2021-04-09
CN112640355B (en) 2022-05-24

Similar Documents

Publication Publication Date Title
US9667370B2 (en) Communication device with peer-to-peer assist to provide synchronization
WO2014173267A1 (en) Timestamp generating method, device and system
Kusy et al. Elapsed time on arrival: a simple and versatile primitive for canonical time synchronisation services
US8879586B2 (en) Inband timestamping
WO2019127447A1 (en) Method, apparatus and system for time synchronization
WO2019165965A1 (en) Method, apparatus, and device for determining time information
CN108880723B (en) Clock synchronization method and device
CN110278065B (en) Method and equipment for compensating time delay
US11671194B2 (en) Technologies for high-precision timestamping of packets
CN109699199B (en) Message processing method and network equipment
US20160006526A1 (en) Systems and methods of network clock comparison
JP2015506626A (en) Method and apparatus for communicating time information between time recognition devices
US11349587B2 (en) Generating a timestamp
WO2009071029A1 (en) Synchronization system and method of time information and related equipment
WO2015196685A1 (en) Clock synchronization method and apparatus
CN113810145A (en) Receiver timestamp accuracy
WO2012009987A1 (en) Device, system and method for frame delay measurement
WO2022052609A1 (en) Time delay compensation method, apparatus and device, and computer-readable storage medium
US20220360350A1 (en) Method and apparatus for acquiring timestamp of data stream, storage medium, and electronic apparatus
CN109981235B (en) Flexe Group negotiation method and network element
US9065748B2 (en) Symmetrical latency with TDM circuit emulated service
WO2020062225A1 (en) Mac device and time point estimation method
CN113424466A (en) Method and device for clock synchronization
CN101420281B (en) Method and arrangement for transferring a time of day value between network elements
CN108155965A (en) SDH transmits IEC61588 methods

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18935411

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18935411

Country of ref document: EP

Kind code of ref document: A1