CN112640355B - A MAC device and time point estimation method - Google Patents

A MAC device and time point estimation method Download PDF

Info

Publication number
CN112640355B
CN112640355B CN201880097191.4A CN201880097191A CN112640355B CN 112640355 B CN112640355 B CN 112640355B CN 201880097191 A CN201880097191 A CN 201880097191A CN 112640355 B CN112640355 B CN 112640355B
Authority
CN
China
Prior art keywords
bit
time point
unit
bits
mac
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201880097191.4A
Other languages
Chinese (zh)
Other versions
CN112640355A (en
Inventor
沈岚
朱久运
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Publication of CN112640355A publication Critical patent/CN112640355A/en
Application granted granted Critical
Publication of CN112640355B publication Critical patent/CN112640355B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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

Landscapes

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

Abstract

一种MAC装置及时间点估算方法,MAC装置包括:MAC核心单元和物理介质连接子层PMA单元;其中,PMA单元用于获取第一比特位的第一时间点,将第一时间点发送给MAC核心单元;其中,第一比特位的第一时间点为PMA单元发送第一比特位的时间点;MAC核心单元,用于接收待发送的目标比特位,根据第一时间点,以及目标比特位与第一比特位之间间隔的比特位数,估算PMA单元发送目标比特位的第二时间点。采用上述方案有利于提高所估算的第二时间点的精度。

Figure 201880097191

A MAC device and a time point estimation method, the MAC device includes: a MAC core unit and a physical medium connection sublayer PMA unit; wherein the PMA unit is used to obtain a first time point of a first bit, and send the first time point to a 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, according to the first time point, and the target bit The number of bits spaced between the bit and the first bit, and the second time point at which the PMA unit transmits the target bit is estimated. Using the above solution is beneficial to improve the accuracy of the estimated second time point.

Figure 201880097191

Description

一种MAC装置及时间点估算方法A MAC device and time point estimation method

技术领域technical field

本申请涉及电子通信技术领域,尤其涉及一种MAC装置及时间点估算方法。The present application relates to the technical field of electronic communication, 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 mediumattachment,PMA)单元。In a wireless network communication system, message interaction between network elements is mostly realized through interface chips. Usually, the interface chip includes a media access control circuit (media access control, MAC) and a serializer/deserializer (serializer/deserializer, serdes), wherein the MAC circuit further includes a MAC core (core) unit, a physical coding sublayer (physical coding sublayer). coding sublayer, PCS) unit and physical medium attachment sublayer (physical medium attachment, PMA) unit.

在接口芯片中,MAC核心单元常需要估算PMA单元向serdes发送某一特定的比特位的时间点,例如,基于电气和电子工程师协会(institute ofelectrical and electronicsengineers,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 time point at which the PMA unit sends a specific bit to the serdes. For example, based on the Institute of Electrical and Electronics Engineers (IEEE) 1588 protocol, the MAC core unit needs to estimate The time point when the PMA unit sends the start bit of the 1588 message to the serdes, and adds the timestamp generated according to the time point to the 1588 message. For another example, based on the y1731 protocol, the MAC core unit needs to estimate that the PMA unit sends y1731 to the serdes The time point of the start bit of the message, and the timestamp needs to be filled in the corresponding field of the y1731 message according to the y1731 protocol.

然而,随着第五代(5th generation,5G)移动通信的到来,现有的估算方法已无法满足5G通信对MAC核心单元所估算的时间点的精度要求,因此,MAC核心单元所估算的时间点的精度还有待进一步提高。However, with the advent of the fifth generation ( 5th generation, 5G) mobile communication, the existing estimation methods have been unable to meet the accuracy requirements of the time point estimated by the MAC core unit for 5G communication. The accuracy of the time point needs to be further improved.

发明内容SUMMARY OF THE INVENTION

本申请实施例提供了一种MAC装置及时间点估算方法,用以提高估算的时间点的精度。Embodiments of the present application provide a MAC device and a time point estimation method, so as 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 medium access control MAC device, including: a MAC core unit and a physical medium connection sublayer PMA unit; wherein the PMA unit is used to obtain the first time point of the first bit, Then, 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. , according to the above-mentioned first time point, and the number of bits spaced 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 Bits in the data stream that the unit sends continuously.

采用上述方案,所获取的PMA单元发送第一比特位的第一时间点为较为准确的时间点。并在此基础上,由于MAC装置中的PMA单元可以连续地向外发送数据流,因此,PMA单元向外发送目标比特位的第二时间点与发送第一比特位的第一时间点之间的时间间隔,是可以通过目标比特位与第一比特位之间间隔的比特位数较为准确地估算获得的。因此,MAC核心单元通过目标比特位与第一比特位之间间隔的比特位数,以及PMA发送第一比特位的第一时间点,便可以较为准确地估算获取PMA单元发送的目标比特位的第二时间点,有利于提高MAC核心单元所估算的时间点的精度。With the above solution, the acquired first time point at which the PMA unit sends the first bit is a relatively accurate time point. And on this basis, since the PMA unit in the MAC device can continuously send out the data stream, therefore, between the second time point when the PMA unit sends the target bit and the first time point when the first bit is sent. The time interval can be estimated more accurately by the number of bits in the interval between the target bit and the first bit. Therefore, the MAC core unit can more accurately estimate the number of bits between the target bit and the first bit, and the first time point when the PMA sends the first bit, to obtain the target bit sent by the PMA unit. The second time point is beneficial to improve 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 with 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核心单元发送第一时间点的路径。Since part of the MAC core unit and the PMA unit are unidirectionally transmitted, there is no transmission path from the PMA unit 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 for the PMA unit to send the first time point to the MAC core unit is provided.

在另一种可能的实现方式中,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 the first signal and data stream sent by the MAC core unit to the PMA unit via 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 cannot identify 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 satisfies a preset rule in the data stream sent by the MAC core unit to the PCS unit; wherein the preset rule includes the interval between any adjacent first bits Preset number of bits.

采用上述方案,使得MAC核心单元可以每发送预设比特位数之后更新一次第一时间点。由于MAC核心单元的时钟与PMA单元的时钟之间也会存在一定的误差,间隔更新第一时间点可以降低上述两个单元的时钟之间的误差积累,从而进一步提高MAC核心单元所估算的时间点的精度。With the above solution, the MAC core unit can update the first time point every time after sending the preset number of bits. Since there is also a certain error between the clock of the MAC core unit and the clock of the PMA unit, updating the first time point at intervals can reduce the accumulation of errors between the clocks of the above two units, thereby further improving the time estimated by the MAC core unit point accuracy.

在一种可能的实现方式中,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 spaced between the target bit and the first bit, It is specifically used for: estimating the second time point according to the formula t2=t1+n*UI; wherein, t1 is the first time point; t2 is the second time point; n is the bit interval between the target bit and the first bit Number of bits; UI is the transmission time for the PMA unit to send 1-bit data.

在一种可能的实现方式中,MAC核心单元还用于:开启第一计数器,第一计数器用于对MAC核心单元在接收到第一比特位之后,继续接收的比特位数进行计数;在根据第一时间点,以及目标比特位与第一比特位之间间隔的比特位数,估算PMA单元发送目标比特位的第二时间点之前,停止第一计数器;此时第一计数器记录的数值便为目标比特位与第一比特位之间间隔的比特位数。In a possible implementation manner, the MAC core unit is further configured to: start a first counter, and the first counter is used to count the number of bits that the MAC core unit continues to receive after receiving the first bit; The first time point, and the number of bits spaced between the target bit and the first bit, stop the first counter before estimating the second time point when the PMA unit sends the target bit; at this time, the value recorded by the first counter is is the number of bits 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 bits received by using the second counter; when the second counter accumulates 64 bits, restart the second counter and restart the second counter at the current time 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, and one encoding adds 2 bits to the data stream. By adopting the above scheme, the second counter adds 2 to the value currently recorded by the first counter every 64 bits, so that the count result of the first counter includes the number of bits added by the PCS unit code, so that the count result is more accurate , which further improves the accuracy of the time point estimated by the MAC core unit.

在一种可能的实现方式中,第一信号可以为脉冲信号。In a possible implementation, the first signal may be a pulse signal.

在一种可能的实现方式中,目标比特位可以是1588报文的起始比特位;MAC核心单元还可以用于:根据估算获得的第二时间点,添加或更新1588报文中的时间戳。In a possible implementation manner, the target bit may be the start bit of the 1588 message; the MAC core unit may also be used to: add or update the timestamp in the 1588 message according to the estimated second time point .

第二方面,本申请实施例提供一种媒体接入控制MAC装置,该装置包括:MAC核心单元和物理介质连接子层PMA单元;其中,PMA单元,用于获取第二比特位的第三时间点,并将第三时间点发送给MAC核心单元;其中,第二比特位的第三时间点为PMA单元接收第二比特位的时间点;MAC核心单元,用于接收目标比特位,根据第三时间点,以及目标比特位与第二比特位之间间隔的比特位数,估算PMA单元接收到目标比特位的第四时间点;其中,目标比特位和第二比特位为PMA单元连续接收的数据流中的比特位。In a second aspect, an embodiment of the present application provides a medium access control MAC device, the device includes: a MAC core unit and a physical medium connection sublayer PMA unit; wherein the PMA unit is used to obtain the third time of the second bit. point, and send the third time point to the MAC core unit; wherein, 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, according to the first Three time points, and the number of bits spaced between the target bit and the second bit, estimate the fourth time point when the PMA unit receives the target bit; wherein, the target bit and the second bit are continuously 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 data stream sent by the PMA unit to the MAC core unit via 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 solution, the MAC core unit can determine the second bit in the received data stream according to the second signal, so as to record the number of bits that continue to be received after the second bit is received.

在一种可能的实现方式中,第二比特位可以为PMA单元向PCS单元发送的数据流中满足预设规则的比特位;其中,预设规则包括任意相邻第二比特位之间间隔预设比特位数。In a possible implementation manner, the second bit may be a bit that satisfies a preset rule in the data stream sent by the PMA unit to the PCS unit; wherein the preset rule includes a predetermined interval between any adjacent second 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 number of bits spaced between the target bit and the second bit at the third time point, It is specifically used for: estimating the fourth time point according to the formula t4=t3+m*UI; wherein, t3 is the third time point; t4 is the fourth time point; m is the bit 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; The time point, and the number of bits between the target bit and the second bit, stop the third counter before the estimated 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 bits received by a fourth counter; when the fourth counter accumulates 64 bits, restart the fourth counter and reset the number of bits in the fourth counter. 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, and one decoding will deduct 2 bits from the data stream. By adopting the above scheme, the fourth counter adds 2 to the value currently recorded by the third counter every 64 bits, so that the count result of the third counter includes the number of bits deducted by the PCS unit code, so that the count result is more accurate , the accuracy of the time point estimated by the MAC core unit can be further improved.

在一种可能的实现方式中,第二信号为脉冲信号。In a possible implementation manner, the second signal is a pulse signal.

第三方面,本申请实施例提供一种时间点估算方法,包括:获取第一比特位的第一时间点;其中,第一比特位的第一时间点为发送第一比特位的时间点;接收待发送的目标比特位,根据第一时间点,以及目标比特位与第一比特位之间间隔的比特位数,估算发送目标比特位的第二时间点;第一比特位和目标比特位为连续发送的数据流中的比特位。In a third aspect, an embodiment of the present application provides a method for estimating a time point, including: acquiring a first time point of a first bit; wherein, the first time point of the first bit is a time point of sending the first bit; Receive the target bit to be sent, and estimate the second time point for sending the target bit according to the first time point and the number of bits spaced 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; wherein, 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 in the interval between bits; UI is the transmission time to send 1-bit data.

在一种可能的实现方式中,还可以开启第一计数器,第一计数器用于对在接收到第一比特位之后,继续接收的比特位数进行计数;在根据第一时间点,以及目标比特位与第一比特位之间间隔的比特位数,估算发送目标比特位的第二时间点之前,停止第一计数器;第一计数器记录的数值便可以作为目标比特位与第一比特位之间间隔的比特位数。In a possible implementation manner, the first counter may also be started, and the first counter is used to count the number of bits that continue to be received after the first bit is received; at the first time point, and the target bit Stop the first counter before estimating the second time point of sending the target bit; the value recorded by the first counter can be used as the distance between the target bit and the first bit The number of bits in the interval.

在一种可能的实现方式中,还可以通过第二计数器对接收的比特位数进行计数;在第二计数器累计64比特位时,重启第二计数器并在第一计数器的当前记录的数值中额外增加2比特位。In a possible implementation manner, the number of bits received may also be counted by the second counter; when the second counter accumulates 64 bits, the second counter is restarted and an additional amount 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 the start bit of the 1588 message; the MAC core unit may also add or update the timestamp in the 1588 message according to the estimated second time point.

第四方面,本申请实施例提供另外一种时间点估算方法,包括:获取第二比特位的第三时间点;其中,第二比特位的第三时间点为接收第二比特位的时间点;接收目标比特位,根据第三时间点,以及目标比特位与第二比特位之间间隔的比特位数,估算接收到目标比特位的第四时间点;其中,目标比特位和第二比特位为连续接收的数据流中的比特位。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 the second bit; wherein the third time point of the second bit is the time point of receiving the second bit ; Receive the target bit, according to the third time point, and the number of bits spaced between the target bit and the second bit, estimate the fourth time point at which the target bit is received; wherein, 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; wherein, 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 in the interval between bits; UI is the transmission time to receive 1-bit data.

在一种可能的实现方式中,还可以开启第三计数器,第三计数器用于对在接收到第二比特位之后,继续接收的比特位数进行计数;在根据第三时间点,以及目标比特位与第二比特位之间间隔的比特位数,估算接收到目标比特位的第四时间点之前,还可以停止第三计数器;第三计数器记录的数值便可以作为目标比特位与第二比特位之间间隔的比特位数。In a possible implementation manner, a third counter may also be enabled, and the third counter is used to count the number of bits that continue to be received after the second bit is received; at the third time point, and the target bit The number of bits between the bit and the second bit, the third counter can also 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 in the interval between bits.

在一种可能的实现方式中,还可以通过第四计数器对接收到的比特位数进行计数;在第四计数器累计64比特位时,重启第四计数器并在第三计数器当前记录的数值中额外增加2比特位。In a possible implementation manner, the number of bits received may 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 value currently recorded by 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, the chip 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 as described in the above first aspect, or the first Any implementation manner of one aspect, or the second aspect, or the MAC apparatus provided by any implementation manner of the second aspect.

第六方面,本申请实施例还提供一种电子设备,该电子设备包括如上述第五方面所提供的芯片。In a sixth aspect, an embodiment of the present application further provides an electronic device, where the electronic device includes the chip provided in the fifth aspect.

第七方面,本申请实施例还提供一种程序,该程序在装置上执行时,将会使该装置实现上述第三方面,或第三方面的任一种实现方式,或第四方面,或第四方面的任一种实现方式提供的时间点估算方法In a seventh aspect, an embodiment of the present application further provides a program, which, when executed on a device, will enable the device to implement the above-mentioned third aspect, or any implementation manner of the third aspect, or the fourth aspect, or The point-in-time estimation method provided by any implementation manner of the fourth aspect

附图说明Description of drawings

图1为一种无线网络通信系统架构示意图;1 is a schematic diagram of a wireless network communication system architecture;

图2为一种接口芯片结构示意图;2 is a schematic structural diagram of an interface chip;

图3为本申请实施例提供的一种MAC核心单元与PMA单元中数据流关系示意图;3 is a schematic diagram of the relationship between a data flow in 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 provided by 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;

图6为本申请实施例提供的一种可能的时间点估算方法流程示意图;6 is a schematic flowchart of a possible time point estimation method provided by an embodiment of the present application;

图7为本申请实施例提供的一种时间点估算方法流程示意图。FIG. 7 is a schematic flowchart of a time point estimation method provided by an embodiment of the present application.

具体实施方式Detailed ways

为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。In order to make the purposes, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present application.

在无线网络通信系统中,系统中的网元常需要对特定比特位的发送或接收时间点进行估算,通常,对特定比特位的发送或接收时间点的估算是由网元中的接口芯片进行的。In a wireless network communication system, network elements in the system often need to estimate the sending or receiving time point of a specific bit. Usually, the estimation of the sending or receiving time point of a specific bit is performed by the interface chip in the network element. of.

以下以1588协议为例对接口芯片的应用环境进行介绍:The following takes 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 the architecture of a wireless network communication system. 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 (global positioning system, GPS) signal receiver 1, and a radio network controller (radio network controller, RNC) 2 and so on.

图1中的GPS信号接收器1用于通过GPS驯服晶振产生纳秒级精度的时间信号。GPS信号接收器1所产生的时间信号用于整个时钟网络周期性的时间同步,其中,时钟网络是由图1中多个网元构成的网络,又可称为精确定时协议(precision timing protocol,PTP)系统。PTP系统中的网元根据在网络中的位置和功能一般可以分为边界时钟(boundaryclock,BC)节点、普通时钟(ordinary clock,OC)节点和透明时钟(transparent clock,TC)节点。The GPS signal receiver 1 in FIG. 1 is used to tame the crystal oscillator by GPS to generate a time signal with nanosecond precision. The time signal generated by the GPS signal receiver 1 is used for the periodic time synchronization of the entire clock network, wherein the clock network is a network composed of multiple network elements in FIG. PTP) system. The network elements in the PTP system can generally be classified into boundary clock (BC) nodes, ordinary clock (OC) nodes and transparent clock (TC) nodes according to their positions and functions 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 Figure 1, has multiple 1588 ports, one of which can be used as a slave (slave) port, and the other ports can be used as a master (master) port. The BC node synchronizes the frequency and time of the clock with the upper-level equipment (such as GPS signal receiver 1 in Figure 1) through the slave port. Afterwards, it sends synchronization packets to multiple next-level devices (such as NE32 and NE33 in Figure 1) through multiple master ports. The synchronization packet includes a time stamp, and the time pointed to by the time stamp 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端口。The 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 packets, measures the residence time of the synchronization packets passing through the TC node, and updates the time stamp in the synchronization packets.

通常,BC节点和TC节点在向下一级设备发送1588报文时,都需要在1588报文中添加(或更新)时间戳,该时间戳用于指示BC节点或TC节点发送1588报文的时间点,因此,BC节点和TC节点一般需要配置接口芯片以通过估算1588报文起始比特位的发送时间点为1588报文添加时间戳。Usually, when the BC node and the TC node send the 1588 message to the lower-level device, they need to add (or update) a timestamp in the 1588 message, and the timestamp is used to indicate the BC node or the TC node to send the 1588 message. Therefore, the BC node and the TC node generally need to configure the interface chip to add a time stamp to the 1588 message by estimating the sending 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 certain bit to the serdes. Taking the 1588 message based on the IEEE1588 protocol as an example, the MAC core unit 2011 is often used to estimate the time point at which the PMA unit 2013 sends the start bit to the serdes202 when receiving the start bit of the 1588 message, and then according to the time point Add timestamp to 1588 packets. After that, the MAC core unit 2011 sends the timestamp-added 1588 message to the PCS unit 2012 . The PCS unit 2012 physically encodes and scrambles the 1588 packet, and then sends the physically encoded 1588 packet to the PMA unit 2013 . The PMA unit 2013 is used for bit width conversion, so that the sending bit width matches the receiving bit width of the serdes 202, thereby sending the 1588 message to the serdes 202, and then sending the 1588 message to other network elements through the serdes 202.

图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 shows a schematic diagram of the data flow relationship between the MAC core unit 2011 and the PMA unit 2013. In FIG. 3, the MAC core unit 2011 can send 80bit data to the PMA unit 2013 via the PCS unit 2012 within the unit time T. The PMA unit 2013 sends 40bit data to serdes202 within unit time T. In FIG. 3, after the MAC core unit 2011 sends 80 bits of data to the PCS unit 2012 in the first unit time T1, it stops sending data to the PCS unit 2012 in the second bit time T2. Continue to send 80-bit data to the PCS unit 2012 within the third unit time T3, and stop sending data to the PCS unit 2012 within the fourth unit time. For the PMA unit 2013, it keeps sending data to the serdes 202 continuously at the speed of sending 40 bits of data per unit time.

目前,MAC核心单元2011多根据其接收到目标比特位(如1588报文起始比特位)的时间点和估算的目标比特位在MAC电路201中的时延估算MAC电路201将该目标比特位发送给serdes202的时间。例如,MAC核心单元2011接收到目标比特位的时间点为ta,估算的时延为tdelay,则估算的MAC电路201将目标比特位发送给serdes202的时间点为ta+tdelay。At present, the MAC core unit 2011 estimates the target bit by the MAC circuit 201 according to the time point when it receives the target bit (eg, the start bit of the 1588 message) and the estimated time delay of the target bit in the MAC circuit 201. Time sent to serdes202. For example, if the time when the MAC core unit 2011 receives the target bit is ta, and the estimated delay is tdelay, the estimated time when the MAC circuit 201 sends the target bit to the serdes 202 is ta+tdelay.

MAC核心单元2011在估算目标比特位在MAC电路201中的时延时,一般会根据PCS单元2012和PMA单元2013的逻辑架构、传输带宽等因素进行估算。然而,PCS单元2012和PMA单元2013在不同的系统设计下会有不同的逻辑架构,导致估算时延的算法需要作不同的调整,通用性较差。而且,目标比特位经过PMA单元2013中的异步先入先出(asynchronousfirst input first output,AFIFO)队列所造成的延迟存在不确定性,无法准确估计,导致MAC核心单元2011所估算的PMA单元2013发送目标比特位的时间点的精度无法满足5G通信的要求。The time delay of the MAC core unit 2011 in estimating the target bit in the MAC circuit 201 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 have different logic structures under different system designs, resulting in different adjustments to the algorithm for estimating the delay, and the generality is poor. Moreover, the delay caused by the target bits passing through the asynchronous first-in-first-out (AFIFO) queue in the PMA unit 2013 is uncertain and cannot be accurately estimated, which causes the PMA unit 2013 estimated by the MAC core unit 2011 to send the target The accuracy of the bit time point 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 at which 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 description takes the MAC circuit 201 in the interface chip 200 as an example. Therefore, the MAC device provided in this embodiment of the present application may also be represented by the MAC device 201 .

在图2所示的MAC装置201中,PMA单元2013用于获取第一比特位的第一时间点,并将第一时间点发送给MAC核心单元。其中,第一比特位的第一时间点为PMA单元发送第一比特位的时间点。In the MAC apparatus 201 shown in FIG. 2 , the PMA unit 2013 is configured to acquire the first time point of the first bit, and send the first time point to the MAC core unit. The first time point of the first bit is the time point 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 this embodiment of the present application, the first bit may be a bit in the 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 the data stream sent by the MAC core unit 2011 to the PCS unit 2012, and in another possible implementation, the first bit may also be It is the bits that satisfy the preset rule in the data stream sent by the MAC core unit 2011 to the PCS unit 2012. For example, the MAC core unit 2011 determines that the currently sent bit is the first bit every preset number of bits. As shown in FIG. 3 , the MAC core unit 2011 determines the 60th bit of data sent in T1 as the first bit bit1. Among them, 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, code streams, etc. For the PCS unit 2012 and the PMA unit 2013, the specific content in the data stream may not be distinguished. 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 processing such as bit-width conversion on the received data stream, and then continuously transmits the processed data stream. Wherein, the above-mentioned first bit is also included in the data stream continuously sent by the PMA unit.

在本申请实施例中,PMA单元2013可以通过其内部的时钟电路获取发送第一比特位的第一时间点。例如,图3中PMA单元2013采集发送第一比特位bit1的第一时间点为t1。In this embodiment of the present application, the PMA unit 2013 may obtain the first time point at which the first bit is sent through its internal clock circuit. For example, in FIG. 3 , the first time point when the PMA unit 2013 collects and transmits the first bit bit1 is t1.

在一种可能的实现方式中,PMA单元2013在采集了第一时间点之后,可以经PCS单元2012将第一时间点发送给MAC核心单元2011。In a possible implementation manner, after the PMA unit 2013 collects the first time point, the first time point may be sent 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 directly connects the first time point through the wire with the MAC core unit 2011 Sent to the MAC core unit 2011. For most of the existing PCS units 2012, bidirectional transmission is not supported. This application provides the PMA unit 2013 with the transmission of the first time point to the MAC core unit 2011 by adding a wire between the PMA unit 2013 and the MAC core unit 2011. Moreover, the structure is simple in implementation, 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 the target bit to be sent, and estimate the number of bits between the target bit and the first bit according to the first time point and the interval between the target bit and the first bit. The second time point at which the PMA unit 2013 transmits the target bit. Wherein, after the data stream where the target bit is located is transmitted through the MAC core unit 2011 and the PCS unit 2012, the PMA unit 2013 sends the data stream where the target bit is located. The above-mentioned first time point may be the first time point that the MAC core unit receives and buffers from the PMA unit 2013 for the last time.

如图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 in the third unit time T3 is the target bit bit0, then the MAC core unit 2011 can send the bit1 according to the number of bits in the interval between bit0 and bit1 and the PMA unit 2013 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 the PMA unit 2013 continuously sends data streams, the MAC core unit 2011 can determine the difference between the bit0 and bit1 sent by the PMA unit 2013 by calculating the time for the PMA unit 2013 to send 40bit data. In combination with the pre-obtained first time point at which bit1 is sent, the second time point at which the PMA unit 2013 sends bit0 can be obtained.

在一种可能的实现方式中,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 time point and the number of bits spaced 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。Wherein, t1 is the first time point; t2 is the second time point; n is the number of bits spaced between the target bit and the first bit; UI is the transmission time for the PMA unit 2013 to send 1-bit data. In this embodiment of the present application, the UI may be obtained by calculation according to the bandwidth of the serdes202. For example, when the bandwidth of the serdes202 is 10.3125Gbps, the value of the UI may be 1/10.3125Gbps≈97ps.

对于1588报文,MAC核心单元2011在获取第二时间点之后,便可以根据第二时间点为1588报文添加(或更新)时间戳,并将添加(或更新)了时间戳的1588报文经PCS单元2012发送给PMA单元2013,由PMA单元2013将1588报文发送serdes202。For the 1588 packet, after acquiring the second time point, the MAC core unit 2011 can add (or update) a timestamp to the 1588 packet according to the second time point, and add (or update) the timestamped 1588 packet It is sent to the PMA unit 2013 via the PCS unit 2012, and the PMA unit 2013 sends the 1588 message to the serdes202.

采用上述方案,所获取的PMA单元2013发送第一比特位的第一时间点为较为准确的时间点。并在此基础上,由于MAC装置201中的PMA单元2013可以连续地发送数据流,因此,PMA单元2013发送目标比特位的第二时间点与发送第一比特位的第一时间点之间的时间间隔,是可以通过目标比特位与第一比特位之间间隔的比特位数较为准确地估算获得的。因此,MAC核心单元2011通过目标比特位与第一比特位之间间隔的比特位数,以及PMA单元2013发送第一比特位的第一时间点,便可以较为准确地估算获取PMA单元2013发送目标比特位的第二时间点,有利于提高估算获得的PMA单元2013发送目标比特位的时间点的精度,一般可以将误差控制在1ns之内,可以满足5G通信的需求。With the above solution, the acquired first time point at which the PMA unit 2013 sends the first bit is a relatively accurate time point. And on this basis, since the PMA unit 2013 in the MAC device 201 can continuously send the data stream, the PMA unit 2013 sends the second time point of the target bit and the first time point when the first bit is sent. The time interval can be estimated more accurately by the number of bits in the interval between the target bit and the first bit. Therefore, the MAC core unit 2011 can more accurately estimate and obtain the transmission target of the PMA unit 2013 according to the number of bits spaced 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 beneficial to improve the estimated accuracy of the time point at which the PMA unit 2013 sends the target bit. Generally, the error can be controlled within 1 ns, which can meet the requirements of 5G communication.

在本申请实施例中,第一比特位可以没有固定的特征。大部分PMA单元2013在发送数据流时,会无法识别数据流中的第一比特位,导致PMA单元2013无法获取第一比特位的第一时间点。基于此,本申请实施例中PMA单元2013还用于:接收MAC核心单元2011经PCS单元2012向PMA单元2013发送的第一信号和数据流。其中,第一信号用于指示PMA单元从PCS单元接收的数据流中的第一比特位。在本申请实施例中,第一信号可以为脉冲信号。In this embodiment of the present application, the first bit may not have a fixed feature. Most of the PMA units 2013 cannot identify the first bit in the data stream when sending the data stream, so that the PMA unit 2013 cannot obtain the first time point of the first bit. Based on this, in this embodiment of the present application, the PMA unit 2013 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 the first bit in the data stream received by the PMA unit from the PCS unit. In this 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. The first signal is also received when the PMA unit receives the first bit from the PCS unit. 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 also processes the first signal of the data stream in parallel, and takes the time point when the parallel processing of the first signal 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 sending the first bit, the MAC core unit 2011 sends the first signal in parallel, and the first signal is used as the parallel signal of the first bit. In this embodiment of the present application, the MAC core unit 2011 may send the first signal through out-of-band transmission, so as not to occupy the transmission bandwidth of the data stream. The first signal is always kept in parallel with 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 the first bit is generated, thereby maintaining parallelism with the first bit. Therefore, when the PMA unit 2013 finishes processing the first signal, it also finishes sending the first bit. Therefore, the time point for sending the first bit, ie, the first time point, can be determined according to the time point when processing the first signal is completed. For example, the PMA unit 2013 may use the processing result of the first signal as a trigger condition for obtaining the first time point, and 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 this 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 spaced 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, and 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; Before estimating 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 spaced between the target bit and the first bit, the first counter is stopped, and 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, and 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 bit bit0, the MAC core unit 2011 stops the first counter, and the value recorded by the first counter at this time is 40 bits of bits in 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 stipulations of the IEEE 802.3 protocol, usually every 64 bits is encoded, and each encoding will add 2 bits to the data stream . For example, the size of the data stream sent by the MAC core unit 2011 to the PCS unit 2012 is 128 bits, and 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 bits. When the PCS unit 2012 encodes the data stream, the size of the data stream will change, 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: count the number of bits sent by using the second counter; when the second counter accumulates 64 bits, restart the second counter and start the second counter in the first An additional 2 bits are added to the currently recorded value of a counter. The restarted second counter 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 solution, the MAC core unit 2011 adds 2 to the value currently recorded by the first counter every 64 bits through the second counter, so that the counting result of the first counter includes the increase in the data stream due to the encoding of the PCS unit 2012 , so that the counting result is more accurate, and the accuracy of the estimated second time point is further improved.

基于相同的技术构思,本申请实施例还提供另外一种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 by the embodiment of the present application is similar to the structure of the aforementioned MAC device for estimating the time point when the PMA unit sends the target bit. The MAC device for estimating the time point at which the PMA unit receives the target bit will continue to be described by taking the MAC device 201 shown in FIG. 2 as an example.

在图2所示的MAC装置201中,PMA单元2013用于获取第二比特位的第三时间点,并将第三时间点发送给MAC核心单元2011。其中,第二比特位的第三时间点为PMA单元接收第二比特位的时间点。In the MAC apparatus 201 shown in FIG. 2 , the PMA unit 2013 is configured to acquire the third time point of the second bit, and send the third time point to the MAC core unit 2011 . The third time point of the second bit is the time point when the PMA unit receives the second bit.

在本申请实施例中,PMA单元2013可以连续从serdes202接收数据流,数据流可以为报文、码流等多种形式。PMA单元2013对接收的数据流进行位宽变换等处理后,发送给PCS单元2012。PCS单元2014对所接收的数据流进行解编码等处理之后发送给MAC核心单元2011。In this embodiment of the present application, the PMA unit 2013 can continuously receive data streams from the serdes 202, and the data streams can be in various forms such as messages and code streams. The PMA unit 2013 performs bit width conversion on the received data stream, and then sends it to the PCS unit 2012 . The PCS unit 2014 performs decoding and other processing on the received data stream, and then sends it to the MAC core unit 2011 .

在本申请实施例中,第二比特位可以为PMA单元2013向PCS单元2012发送的数据流中的任一比特位,也可以是PMA单元2013向PCS单元2012发送的数据流中满足预设规则的比特位,例如,PMA单元2013每间隔预设比特位数确定当前发送的比特位为第一比特位。In this 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 may be any bit in the data stream sent by the PMA unit 2013 to the PCS unit 2012 that satisfies a preset rule For example, the PMA unit 2013 determines that the currently sent bit is the first bit every preset bit number.

由于本申请实施例中PMA单元2013发送第三时间点的传输方向与MAC装置201中所接收的数据流的传输方向相同,因此,MAC装置201中PMA单元2013可以经PCS单元将第三时间点发送给MAC核心单元2011。Since the transmission direction of the third time point sent by the PMA unit 2013 in this 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 may send the third time point through the PCS unit Sent to the 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 the target bit, and estimate the fourth time point when the PMA unit 2013 receives the target bit according to the third time point and the number of bits spaced between the target bit and the second bit. The target bit is the 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的带宽计算获得。Wherein, 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 this embodiment of the present application, the UI can be calculated and obtained according to the bandwidth of the serdes202.

采用上述方案,由于MAC装置201中的PMA单元2013可以连续地从serdes202接收数据流,因此,PMA单元2013接收目标比特位的第四时间点与接收第二比特位的第三时间点之间的时间间隔是可以通过目标比特位与第二比特位之间间隔的比特位数较为准确地估算获得的。因此,MAC核心单元2011通过目标比特位与第二比特位之间间隔的比特位数,以及PMA单元2013接收第二比特位的第三时间点,便可以较为准确地估算获取PMA单元2013接收到目标比特位的第四时间点。With the above solution, since the PMA unit 2013 in the MAC device 201 can continuously receive the data stream from the serdes 202, the PMA unit 2013 receives the fourth time point of the target bit and the third time point when the second bit is received. The time interval can be estimated more accurately by the number of bits in the interval between the target bit and the second bit. Therefore, the MAC core unit 2011 can more accurately estimate the number of bits received by the PMA unit 2013 through the number of bits spaced 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 this embodiment of the present application, the second bit may not have a fixed feature. Therefore, most of the 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 further configured 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 this embodiment of the present application, the second signal may also be a parallel signal of the second bit, and 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 , which is not repeated in this embodiment of the present application.

在本申请实施例中,MAC核心单元2011需要根据第四比特位与第三比特位之间间隔的比特位数估算PMA单元2013接收目标比特位的第四时间点。在一种可能的实现方式中,MAC核心单元2011还用于开启第三计数器,第三计数器用于对MAC核心单元2011在接收第二比特位之后,继续接收的比特位数进行计数;在根据第三时间点,以及目标比特位与第二比特位之间间隔的比特位数,估算PMA单元2013发送目标比特位的第四时间点之前,停止第三计数器;第三计数器记录的数值便可以作为目标比特位与第二比特位之间间隔的比特位数。In this embodiment of the present application, the MAC core unit 2011 needs to estimate the fourth time point at which the PMA unit 2013 receives the target bit according to the number of bits in the interval between the fourth bit and the third bit. In a possible implementation manner, the MAC core unit 2011 is further configured to start a third counter, and the third counter is configured to count the number of bits that the MAC core unit 2011 continues to receive after receiving the second bit; At the third time point, and the number of bits spaced between the target bit and the second bit, before estimating the fourth time point when the PMA unit 2013 sends the target bit, stop the third counter; the value recorded by the third counter can be The number of bits 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 the third counter, and starts to count 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, and decoding is performed every 64 bits, and one decoding will deduct 2 bits in the data stream received by the PCS unit 2012 . In order to improve the precision 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 bits received through a 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所接收的数据流中扣除的比特位数,从而使计数结果更加准确,进而提高了估算获得的第四时间点的精度。Using the above solution, the MAC core unit 2011 adds 2 to the value currently recorded by the first counter every 64 bits through the fourth counter, so that the counting result of the first counter includes the data stored in the PMA unit 2013 due to the decoding by the PCS unit 2012. The number of bits deducted from the received data stream makes the counting result more accurate, thereby improving the precision of the estimated fourth time point.

基于相同的技术构思,本申请实施例还提供一种时间点估算方法,该方法可以估算发送目标比特位的时间点。应理解,本申请实施例所提供的时间点估算方法可以通过软件实现,例如,由发送目标比特位的装置内部的处理器通过调用存储器中存储的程序指令,以执行本申请实施例所提供的时间点估算方法。此外,本申请实施例所提供的也可以通过硬件与软件相结合的方式实现,例如,通过图2所示的MAC装置实现。为了便于理解,本申请实施例以图2所示的MAC装置为例,对本申请实施例所提供的时间点估算方法进行介绍。图4为本申请实施例提供的一种时间点估计方法流程示意图,如图4所示,主要包括以下步骤:Based on the same technical concept, the embodiments of the present application also provide a time point estimation method, which can estimate the time point at which the target bit is sent. It should be understood that the time point estimation method provided by the embodiments of the present application may be implemented by software. For example, the processor inside the device that sends the target bits calls the program instructions stored in the memory to execute the method provided by the embodiments of the present application. point-in-time estimation method. In addition, what is provided by the embodiments of the present application may also be implemented by a combination of hardware and software, for example, implemented by the MAC device shown in FIG. 2 . For ease of understanding, the embodiment of the present application takes the MAC device shown in FIG. 2 as an example to introduce the time point estimation method provided by the embodiment of the present application. FIG. 4 is a schematic flowchart of a time point estimation method provided by an embodiment of the present application, as shown in FIG. 4 , which mainly includes the following steps:

S401:PMA单元2013获取第一比特位的第一时间点。S401: The PMA unit 2013 obtains the first time point of the 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 sent, 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 spaced 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 the 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, it processes the first signal and the first bit in parallel, and takes the first bit and the time point when the parallel processing of the first signal is completed as the the first point in time. Wherein, 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 takes the 1588 packet as an example, which is a schematic diagram of a first signal inside a MAC device provided by an embodiment of the present application, wherein the start bit of the 1588 packet is the 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, wherein the first signal adopts out-of-band transmission and does not occupy the transmission bandwidth of the data stream where bit1 is located. The PMA unit 2013 processes and sends bit1, and acquires the time point at which 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 receiving the target bit, the MAC core unit 2011 estimates the second time point t2 according to the first time point t1 and the number of bits in the interval between the target bit and bit1. After that, the MAC core unit 2011 adds (or updates) a timestamp to the 1588 packet according to the second time point t2, and sends the 1588 packet to which the timestamp is added (or updated) to the PMA unit 2013 via the PCS unit 2012. After receiving and processing the 1588 message, the PMA unit 2013 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 position 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 start a first counter, and 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 when the PMA unit 2013 sends the target bit according to the first time point and the number of bits spaced between the target bit and the first bit. 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 the 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 the first counter.

S602:PMA单元2013处理完成第一信号,并获取处理完成第一信号的时间点作为第一时间点。S602: The PMA unit 2013 completes the processing of the first signal, and acquires the time point at which the processing of the first signal is completed 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 message, 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. And add (or update) a timestamp to the 1588 message according to the estimated second time point.

S606:MAC核心单元2011经PCS单元2012向PMA单元2013发送添加(或更新)了时间戳的1588报文。S606: The MAC core unit 2011 sends the 1588 message to which the timestamp is added (or updated) 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 this embodiment of the present application, the MAC core unit 2011 may determine the first bit from the received data stream according to a preset bit interval, and when receiving the first bit that satisfies the preset rule, 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 sent by using the second counter; when the second counter accumulates 64 bits, the MAC core unit 2011 restarts the second counter and restarts the second counter in the first 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, the embodiment of the present application also provides a time point estimation method, which can estimate the time point when the target bit is received. It should be understood that the time point estimation method provided by the embodiments of the present application may be implemented by software. For example, the processor inside the device that receives the target bits calls the program instructions stored in the memory to execute the method provided by the embodiments of the present application. point-in-time estimation method. In addition, what is provided by the embodiments of the present application may also be implemented by a combination of hardware and software, for example, implemented by the MAC device shown in FIG. 2 . For ease of understanding, the embodiment of the present application takes the MAC device shown in FIG. 2 as an example to introduce the time point estimation method provided by the embodiment of the present application. FIG. 7 is a schematic flowchart of a time point estimation method provided by an embodiment of the present application, as shown in FIG. 7 , which mainly includes the following steps:

S701:PMA单元2013获取第二比特位的第三时间点,并将第三时间点发送给MAC核心单元2011。S701: The PMA unit 2013 acquires the 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 time point of the second bit is the time point when the PMA unit 2013 receives the second bit. In this embodiment of the present application, the second bit is a bit in the data stream continuously received by the PMA unit 2013 . As shown in FIG. 7 , the PMA unit will send the data stream containing the second bit 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, and 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 when the PMA unit 2013 receives the target bit according to the third time point and the number of bits spaced between the target bit and the second bit.

如图7所示,PMA单元会持续将接收到的数据流经PCS单元2012发送给MAC核心单元。MAC核心单元2011接收PCS2012发送的数据流,在接收到目标比特位时,便可以执行S703。As shown in FIG. 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 PCS 2012, and can execute S703 when the target bit is received.

在一种可能的实现方式中,PMA单元2013还可以生成第二信号;在对接收到的第二比特位进行处理时,并行处理第二信号;在经PCS单元2012向MAC核心单元2011发送处理后的第二比特位时,经PCS单元2012向MAC核心单元2011并行发送第二信号;MAC核心单元2011接收PCS单元2012并行发送的第二信号和第二比特位;根据第二信号,记录接收到第二比特位之后继续接收的比特位数。其中,第二信号可以为脉冲信号。In a possible implementation manner, the PMA unit 2013 may also generate a second signal; when processing the received second bit, the second signal is processed in parallel; After the second bit, 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 that are sent in parallel by the PCS unit 2012; The number of bits to continue to receive after the second bit. Wherein, the second signal may be a pulse signal.

在一种可能的实现方式中,第二比特位为PMA单元2013向PCS单元2012发送的数据流中满足预设规则的比特位;预设规则包括任意相邻第二比特位之间间隔预设比特位数。In a possible implementation manner, the second bit is a bit that satisfies a preset rule in the data stream sent by the PMA unit 2013 to the PCS unit 2012; the preset rule includes a preset interval between any adjacent second bits 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 may 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 in the interval 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 also 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 signal; the MAC core unit 2011 Before estimating the fourth time point at which the PMA unit 2013 sends the target bit according to the third time point and the number of bits spaced between the target bit and the second bit, the third counter may be stopped. 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 bits received by the fourth counter; when the fourth counter accumulates 64 bits, restart the fourth counter and record the number of bits currently recorded by the third counter. 2 extra bits are added to the value.

基于相同的技术构思,本申请实施例还提供一种芯片,该芯片包括如上述任一实施例提供的MAC装置。在一种可能的实现方式中,该芯片还包括serdes。serdes与MAC装置中的PMA单元相连接。应理解,serdes与MAC装置之间既可以是两个单独的电路结构,也可以集成于同一电路结构中,例如,serdes也可以与PMA单元集成于同一电路结构中,又例如,PCS单元、PMA单元和serdes单元可以集成于同一电路结构中等等,本申请实施例对此并不多作限定。Based on the same technical idea, an embodiment of the present application further provides a chip, where the chip includes the MAC device provided in any of the foregoing embodiments. In one possible implementation, the chip also includes serdes. The serdes are connected to the PMA unit in the MAC device. It should be understood that between the serdes and the MAC device can be two separate circuit structures, or can be integrated in the same circuit structure, for example, the serdes can also be integrated with the PMA unit in the same circuit structure, and for example, the PCS unit, the PMA unit The unit and the serdes unit may be integrated in the same circuit structure, etc., which is not limited in this 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, which includes the MAC device provided in any of the foregoing embodiments, and can execute the time point estimation method shown in FIG. 4 and/or FIG. 7 .

基于相同的技术构思,本申请实施例还提供一种程序,该程序在某一装置上执行时,将会使该装置实现上述任一种实施例提供的时间点估算方法。Based on the same technical concept, an embodiment of the present application further provides a program, which, when executed on a device, enables the device to implement the time point estimation method provided by any of the above embodiments.

以上所述,以上实施例仅用以对本申请的技术方案进行了详细介绍,但以上实施例的说明只是用于帮助理解本申请实施例的方法,不应理解为对本申请实施例的限制。本技术领域的技术人员可轻易想到的变化或替换,都应涵盖在本申请实施例的保护范围之内。As described above, the above embodiments are only used to introduce the technical solutions of the present application in detail, but the descriptions of the above embodiments are only used to help understand the methods of the embodiments of the present application, and should not be construed as limitations on the embodiments of the present application. Changes or substitutions that can be easily conceived by those skilled in the art should all fall within the protection scope of the embodiments of the present application.

Claims (26)

1. A medium access control, MAC, apparatus, comprising: the MAC core unit and the physical medium connection sub-layer PMA unit;
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; a first time point of the first bit is a time point when the PMA unit sends the first bit;
the MAC core unit is configured to receive a target bit to be sent, and estimate a second time point at which the PMA unit sends the target bit according to the first time point and a bit number of an interval between the target bit and the first bit; the first bit and the target bit are bits in a data stream continuously transmitted by the PMA unit.
2. The MAC apparatus of claim 1, the PMA unit further to:
receiving a first signal and a data stream which are transmitted to the PMA unit by the MAC core unit through a Physical Coding Sublayer (PCS) unit; the first signal is to indicate the first bit in a data stream received by the PMA unit from the PCS unit.
3. The MAC apparatus of claim 2, wherein the first bit is a bit that satisfies a preset rule in a data stream transmitted by the MAC core unit to the PCS unit; the preset rule comprises a preset bit number spaced between any adjacent first bits.
4. The MAC device according to any of claims 1 to 3, wherein the MAC core unit, when estimating a second point in time at which the PMA unit transmits the target bit based on the first point in time and a number of bits spaced between the target bit and the first bit, is specifically configured to:
estimating the second point in time according to the following formula:
t2=t1+n*UI
wherein 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; the UI is the transmission time for the PMA unit to send 1-bit data.
5. The MAC apparatus of any of claims 1 to 4, wherein the MAC core unit is further to:
starting a first counter, wherein the first counter is used for counting the number of bits continuously received after the MAC core unit receives the first bit;
stopping the first counter before estimating a second time point at which the PMA unit transmits the target bit according to the first time point and the number of bits spaced between the target bit and the first bit; the value recorded by the first counter is the number of bits of the interval between the target bit and the first bit.
6. The MAC apparatus of claim 5, wherein the MAC core unit is further to:
counting the number of received bits by a second counter;
and when the second counter accumulates 64 bits, restarting the second counter and additionally adding 2 bits in the value currently recorded by the first counter.
7. The MAC apparatus of claim 2, wherein the first signal is a pulse signal.
8. The MAC device according to any one of claims 1 to 7, wherein the target bit is a start bit of a 1588 message;
the MAC core element is further configured to:
and adding or updating the time stamp in the 1588 message according to the second time point obtained by estimation.
9. A medium access control, MAC, apparatus, comprising: the MAC core unit and the physical medium connection sub-layer PMA unit;
the PMA unit is configured to obtain a third time point of a second bit, and send the third time point to the MAC core unit; a third time point of the second bit is a time point of the PMA unit receiving the second bit;
the MAC core unit is configured to receive a target bit, and estimate a fourth time point at which the PMA unit receives the target bit according to the third time point and a bit number of an interval between the target bit and the second bit; the target bit and the second bit are bits in a data stream that is continuously received by the PMA unit.
10. The MAC apparatus of claim 9, wherein the MAC core unit is further to:
receiving a second signal and a data stream which are sent by the PMA unit to the MAC core unit through a Physical Coding Sublayer (PCS) unit; the second signal is to indicate a second bit in a data stream received by the MAC core unit from the PCS unit.
11. The MAC apparatus of claim 10, wherein the second bit is a bit that satisfies a preset rule in a data stream transmitted by the PMA unit to the PCS unit; the preset rule comprises a preset bit number spaced between any two adjacent second bits.
12. The MAC device of any of claims 9 to 11, wherein the MAC core unit, when estimating the fourth point in time at which the PMA unit receives the target bit based on the third point in time and a number of bits spaced between the target bit and the second bit, is specifically configured to:
estimating the fourth time point according to the following formula:
t4=t3+m*UI
wherein t3 is the third time point; t4 is the fourth time point; m is the number of bits of the interval between the target bit and the second bit; the UI is the transmission time for the PMA unit to receive 1-bit data.
13. The MAC apparatus of any of claims 9 to 12, wherein the MAC core unit is further to:
starting 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;
stopping the third counter before estimating a fourth time point at which the PMA unit receives the target bit based on the third time point and the number of bits spaced between the target bit and the second bit; the third counter records a value of the number of bits of the interval between the target bit and the second bit.
14. The MAC apparatus of claim 13, wherein the MAC core unit is further to:
counting the number of received bits by a fourth counter;
and when the fourth counter accumulates 64 bits, restarting the fourth counter and additionally adding 2 bits in the value currently recorded by the third counter.
15. The MAC apparatus of claim 10, wherein the second signal is a pulse signal.
16. A time point estimation method, comprising:
acquiring a first time point of a first bit; a 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 for sending the target bit according to the first time point and the bit number of the interval between the target bit and the first bit; the first bit and the target bit are bits in a continuously transmitted data stream.
17. The method of claim 16, wherein estimating a second point in time at which the target bit is transmitted based on the first point in time and a number of bits spaced between the target bit and the first bit comprises:
estimating the second point in time according to the following formula:
t2=t1+n*UI
wherein 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 transmitting 1-bit data.
18. The method of claim 16 or 17, further comprising:
starting a first counter, wherein the first counter is used for counting the number of bits which are continuously received after the first bit is received;
estimating, according to the first time point and the number of bits spaced between the target bit and the first bit, a time before a second time point when the target bit is transmitted, further comprising:
stopping the first counter; the value recorded by the first counter is the number of bits of the interval between the target bit and the first bit.
19. The method of claim 18, wherein the method further comprises:
counting the number of received bits by a second counter;
and when the second counter accumulates 64 bits, restarting the second counter and additionally adding 2 bits in the value currently recorded by the first counter.
20. The method according to any one of claims 16 to 19, wherein the target bit is a start bit of a 1588 message;
the method further comprises the following steps:
and adding or updating the time stamp in the 1588 message according to the second time point obtained by estimation.
21. A time point estimation method, comprising:
acquiring a third time point of the second bit; a third time point of the second bit is a time point of receiving the second bit;
receiving a target bit, and estimating a fourth time point of receiving the target bit according to the third time point and the bit number of the interval between the target bit and the second bit; the target bit and the second bit are bits in a continuously received data stream.
22. The method of claim 21, wherein estimating a fourth point in time at which the target bit is received based on the third point in time and the number of bits spaced between the target bit and the second bit comprises:
estimating the fourth time point according to the following formula:
t4=t3+m*UI
wherein t3 is the third time point; t4 is the fourth time point; m is the number of bits of the interval between the target bit and the second bit; UI is the transmission time to receive 1-bit data.
23. The method of claim 21 or 22, further comprising:
starting a third counter, wherein the third counter is used for counting the number of bits which are continuously received after the second bit is received;
estimating, before a fourth time point when the target bit is received, according to the third time point and the number of bits spaced between the target bit and the second bit, the method further includes:
stopping the third counter; the third counter records a value of the number of bits of the interval between the target bit and the second bit.
24. The method of claim 23, wherein the method further comprises:
counting the number of received bits by a fourth counter;
and when the fourth counter accumulates 64 bits, restarting the fourth counter and additionally adding 2 bits in the value currently recorded by the third counter.
25. A chip comprising, for example, MAC devices and parallel/serializer serdes;
the PMA unit in the MAC device is connected with the serdes; the MAC device as claimed in any one of claims 1 to 15.
26. An electronic device comprising the chip of claim 25.
CN201880097191.4A 2018-09-30 2018-09-30 A MAC device and time point estimation method Active CN112640355B (en)

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 (2)

Publication Number Publication Date
CN112640355A CN112640355A (en) 2021-04-09
CN112640355B true CN112640355B (en) 2022-05-24

Family

ID=69949572

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201880097191.4A Active CN112640355B (en) 2018-09-30 2018-09-30 A MAC device and time point estimation method

Country Status (2)

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

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111193567B (en) * 2018-11-14 2023-09-26 深圳市中兴微电子技术有限公司 Time synchronization method, equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102244572A (en) * 2011-07-18 2011-11-16 中兴通讯股份有限公司 Clock synchronization method and device
CN104052588A (en) * 2013-03-14 2014-09-17 阿尔特拉公司 Methods to achieve accurate time stamp in ieee 1588 for system with fec encoder
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

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7995621B2 (en) * 2008-10-01 2011-08-09 Nortel Netwoeks Limited Techniques for time transfer via signal encoding
US9515816B2 (en) * 2014-06-30 2016-12-06 International Business Machines Corporation Latency-optimized physical coding sublayer
US10432337B2 (en) * 2015-05-15 2019-10-01 Avago Technologies International Sales Pte. Limited Apparatus and method for timestamping of data packets
CN108322280B (en) * 2017-12-12 2019-07-23 北京时代民芯科技有限公司 A kind of distributed computer network (DCN) clock synchronizing relay compensation method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102244572A (en) * 2011-07-18 2011-11-16 中兴通讯股份有限公司 Clock synchronization method and device
CN104052588A (en) * 2013-03-14 2014-09-17 阿尔特拉公司 Methods to achieve accurate time stamp in ieee 1588 for system with fec encoder
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

Also Published As

Publication number Publication date
CN112640355A (en) 2021-04-09
WO2020062225A1 (en) 2020-04-02

Similar Documents

Publication Publication Date Title
CN113810145B (en) Receiving end timestamp accuracy
KR101749202B1 (en) Method, apparatus, and system for generating timestamp
CN108650051B (en) Universal full hardware one-step 1588 clock synchronization device and method
US8879586B2 (en) Inband timestamping
US11671194B2 (en) Technologies for high-precision timestamping of packets
CN109699199B (en) Message processing method and network equipment
CN103563287B (en) Synchronization device and synchronization method
CN108880723B (en) Clock synchronization method and device
US20160006526A1 (en) Systems and methods of network clock comparison
CN114586297B (en) Synchronization method and equipment
CN101882990B (en) Method for selecting master clock based on PTP (Picture Transfer Protocol) and link quality, slave clock and system
CN102263629B (en) Method for time synchronization among boards, clock board and NE (network element) device
TW201530155A (en) Communications systems and methods for distributed power system measurement
CN105027489B (en) Precision clock protocol synchronization method and node
US12278695B2 (en) Method and apparatus for acquiring timestamp of data stream, storage medium, and electronic apparatus
WO2019169820A1 (en) High-precision time synchronization method
CN106877967B (en) IEEE1588 transparent clock residence time measurement method and its device
CN112640355B (en) A MAC device and time point estimation method
JP2014187633A (en) Serial communication system, receiver and serial communication method
CN113228564B (en) Stamping processing method and device
JP2015198399A (en) communication device
WO2013091240A1 (en) Method, device and system for data synchronization processing of external clock
CN117879747A (en) Method, device, equipment and storage medium for acquiring message time stamp
CN119382822A (en) A device and method for improving PTP timestamp accuracy based on phase shift coding
WO2018119705A1 (en) Detection method for transmission delay difference between uplink channels, and olt and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant