A circuit, method, computer storage medium and terminal for anti-torsion processing
Through the anti-skew control module, the data signal in the D-PHY interface is sampled and the delay information is determined, and the phase offset of the clock signal and the data signal is adjusted to solve the transmission error problem caused by the phase offset in the D-PHY interface. The phase calibration circuit is simplified and the implementation cost is reduced.
Patent Information
- Application Number
- CN202311645572.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-01
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2043-12-01
AI Technical Summary
The phase offset of data and clock signals in the existing D-PHY interface leads to transmission errors, and the phase interpolation technology is complex and costly to implement, making it difficult to simplify the phase calibration circuit.
The data signal is sampled through the anti-skew control module to determine the delay information, and the phase offset of the clock signal and the data signal is adjusted based on the information, which simplifies the composition of the phase calibration circuit.
It achieves simplification of phase calibration, reduces system complexity and implementation costs, and ensures the stability and reliability of high-speed data transmission.
Smart Images

Figure CN117667815B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to, but is not limited to, signal and processing technology, and in particular to a circuit, method, computer storage medium and terminal for anti-torsion processing. Background Art
[0002] D-PHY (one of the Mobile Industry Processor Interface (MIPI) protocols) is a high-speed serial data transmission protocol for mobile devices and embedded systems, which can achieve high-speed and low-power data transmission. In the D-PHY interface, the data transmission rate is very high, and the clock signal and data signal will be affected by external environmental changes such as voltage or transmission line distance, causing phase shift, which will lead to transmission errors and data corruption. Therefore, a technology is needed to reduce the phase shift between the clock and data signals.
[0003] D-PHY Deskew technology ensures the reliability and accuracy of data transmission by calibrating the phase of data signals and clock signals. The D-PHY Deskew control structure can optimize the performance of the D-PHY interface and ensure the stability and reliability of high-speed data transmission, thereby meeting the needs of high-speed data transmission in mobile devices and embedded systems.
[0004] Related technologies generally use phase interpolation technology to achieve phase shift and then phase calibration. It requires multi-phase clocks to superimpose input phases according to different weights to achieve phase shift. The implementation system of phase interpolation technology is highly complex and requires phase-locked loops and other circuits, resulting in high implementation costs. How to simplify the circuit composition of phase calibration has become a problem to be solved. Summary of the invention
[0005] The following is a summary of the subject matter described in detail in this application. This summary is not intended to limit the scope of the claims.
[0006] The embodiments of the present disclosure provide a circuit, method, computer storage medium and terminal for anti-skew processing, which can simplify the circuit composition of phase calibration.
[0007] The present disclosure provides a circuit for anti-twist processing, including: a receiving data channel, a clock signal channel, an anti-twist control module and an anti-twist module; wherein:
[0008] The receiving data channel is set to: receive input data signals, the data signals are alternating standard sequences;
[0009] The clock signal channel is set to: receive the input clock signal;
[0010] The anti-torsion control module is connected to the receiving data channel and is configured to: obtain sampling data obtained by sampling the data signal of the data signal channel through the clock signal of the clock signal channel of a preset duration, and determine the delay information according to the obtained sampling data;
[0011] The anti-torsion skew module is connected to the anti-torsion skew control module and is configured to: perform phase offset adjustment on the clock signal and the data signal according to the delay information determined by the anti-torsion skew control module.
[0012] On the other hand, the present disclosure also provides a method for anti-torsion processing, including:
[0013] Acquire sampling data obtained by sampling a data signal of a data signal channel through a clock signal of a clock signal channel of a preset duration, and determine delay information according to the obtained sampling data;
[0014] According to the determined delay information, a phase offset adjustment is performed on the clock signal and the data signal.
[0015] On the other hand, an embodiment of the present disclosure further provides a computer storage medium, wherein the computer storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned anti-torsion processing method is implemented.
[0016] In another aspect, an embodiment of the present disclosure further provides a terminal, comprising: a memory and a processor, wherein the memory stores a computer program; wherein:
[0017] The processor is configured to execute the computer program in the memory;
[0018] When the computer program is executed by the processor, the above-mentioned anti-torsion processing method is implemented.
[0019] Compared with the related art, the data signal is sampled and the delay information is determined through the anti-torsion control module, and the phase offset adjustment is realized through the delay information, which simplifies the circuit composition of the phase calibration.
[0020] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by implementing the present application. Other advantages of the present application can be realized and obtained by the schemes described in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The accompanying drawings are used to provide an understanding of the technical solution of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present application and do not constitute a limitation on the technical solution of the present application.
[0022] Figure 1is a structural block diagram of a circuit for anti-skew processing according to an embodiment of the present disclosure;
[0023] Figure 2 is a schematic diagram of an anti-torsion module according to an embodiment of the present disclosure;
[0024] Figure 3 It is a schematic diagram of the composition of the anti-skew delay unit according to an embodiment of the present disclosure;
[0025] Figure 4 A schematic diagram of a phase shift of a clock signal and a data signal according to an embodiment of the present disclosure;
[0026] Figure 5 A schematic diagram of another phase offset of a clock signal and a data signal according to an embodiment of the present disclosure;
[0027] Figure 6 It is a schematic diagram of the sampling data of the rising edge and the falling edge of the embodiment of the present disclosure;
[0028] Figure 7 It is a flowchart of an embodiment of the present disclosure. DETAILED DESCRIPTION
[0029] The present application describes multiple embodiments, but the description is exemplary rather than restrictive, and it is obvious to those skilled in the art that there may be more embodiments and implementations within the scope of the embodiments described in the present application. Although many possible feature combinations are shown in the drawings and discussed in the specific embodiments, many other combinations of the disclosed features are also possible. Unless specifically limited, any feature or element of any embodiment may be used in combination with any other feature or element in any other embodiment, or may replace any other feature or element in any other embodiment.
[0030] The present application includes and contemplates combinations of features and elements known to those of ordinary skill in the art. The embodiments, features and elements disclosed in the present application may also be combined with any conventional features or elements to form a unique invention scheme defined by the claims. Any features or elements of any embodiment may also be combined with features or elements from other invention schemes to form another unique invention scheme defined by the claims. Therefore, it should be understood that any feature shown and / or discussed in the present application may be implemented individually or in any appropriate combination. Therefore, except for the limitations made according to the attached claims and their equivalents, the embodiments are not subject to other restrictions. In addition, various modifications and changes may be made within the scope of protection of the attached claims.
[0031] In addition, when describing representative embodiments, the specification may have presented the method and / or process as a specific sequence of steps. However, to the extent that the method or process does not rely on the specific order of the steps described herein, the method or process should not be limited to the steps of the specific order described. As will be understood by those of ordinary skill in the art, other sequences of steps are also possible. Therefore, the specific sequence of the steps set forth in the specification should not be interpreted as a limitation to the claims. In addition, the claims for the method and / or process should not be limited to the steps of performing them in the order written, and those skilled in the art can easily understand that these sequences can be changed and still remain within the spirit and scope of the embodiments of the present application.
[0032] Figure 1 FIG. 1 is a block diagram of a circuit for performing deskew processing according to an embodiment of the present disclosure. Figure 1 As shown, it includes: a receiving data channel (RX data lane), a clock signal channel (RX clock lane), an anti-torsion control (Deskew Control) module and an anti-torsion (Deskew) module; wherein,
[0033] The receiving data channel is configured to: receive an input data signal, the data signal is an alternating standard sequence, and may be a clock pattern data (clock pattern) composed of a sequence of alternating 01s; the clock pattern data in the embodiment of the present disclosure may be periodic data similar to clock (010101…0101); the data signal includes a data positive signal (DP) and a data negative signal (DN);
[0034] The clock signal channel is configured to: receive an input clock signal; the clock signal in the embodiment of the present disclosure may include a clock positive signal (CKP) and a clock negative signal (CKN);
[0035] The anti-torsion control module is connected to the receiving data channel and is configured to: obtain sampling data obtained by sampling the data signal of the data signal channel through the clock signal of the clock signal channel of a preset duration, and determine the delay information according to the obtained sampling data;
[0036] The anti-torsion skew module is connected to the anti-torsion skew control module and is configured to: perform phase offset adjustment on the clock signal and the data signal according to the delay information determined by the anti-torsion skew control module.
[0037] In an exemplary embodiment, the anti-torsion deskew module of the embodiment of the present disclosure is further configured to: output the clock signal after the phase offset is adjusted to a clock path (clock path, a path in a clock signal channel for transmitting a clock signal), and output the data signal after the phase offset is adjusted to a data path (data path, a path in a receiving data channel for transmitting a data signal);
[0038] In an exemplary embodiment, the embodiment of the present disclosure further includes a high speed receiving (HS-RX, high speed rxceive) module between the receiving data channel and the anti-skew module, which is configured as follows:
[0039] Preprocessing the data signal and clock signal output to the deskew module;
[0040] The preprocessing includes one or any combination of the following processing: acquisition, amplification and filtering.
[0041] In an exemplary embodiment, the embodiment of the present disclosure further includes a deserializer connected to the output end of the anti-skew module, configured as follows:
[0042] The clock signal on the clock path and the data signal on the data path are converted from serial signals to parallel signals and then output.
[0043] In an exemplary embodiment, the anti-torsion control module of the embodiment of the present disclosure includes: a sampling unit, a delay determination unit and a control code determination unit; wherein,
[0044] The sampling unit is configured to: sample the data signal of the receiving data channel through a clock signal of a preset duration to obtain sampled data;
[0045] Determine the delay unit setting as follows: according to the sampling data, count and accumulate the number of 0s and 1s of the sampling data of the rising edge and the number of 0s and 1s of the sampling data of the falling edge according to a preset accumulation period; determine the delay information according to the result of the count accumulation statistics, wherein the accumulation period is determined by a preset statistical threshold.
[0046] The statistical threshold of the embodiment of the present disclosure can be calculated by those skilled in the art according to Tskewcal and the sampling frequency, for example, according to (Tskewcal*LSB) / (4*2*T*UI 2 )Tskewcal is a well-known term in the DPHY protocol, referring to the deskew calculation time, which is defined in the DPHY1.2 protocol.
[0047] In an exemplary embodiment, the embodiment of the present disclosure can store sampled data through data<7:0>, that is, an array or memory with a data bit width of 8, wherein the odd bits of data<7:0> can represent the sampled data of the rising edge, and the even bits can represent the sampled data of the falling edge, and the sampled data has both 0 and 1.
[0048] In an exemplary embodiment, the embodiment of the present disclosure determines that the delay unit is set to count and accumulate the number of 0s and 1s of the sampled data of the rising edge and the number of 0s and 1s of the sampled data of the falling edge according to a preset accumulation period, and each count accumulation includes:
[0049] When the value of the accumulated statistics of the counts of 0 and / or 1 of the rising edge sampling data reaches the statistical threshold, it is determined that the accumulated statistics of the rising edge counts are finished;
[0050] When the value of the count accumulation statistics of 0 and / or 1 of the sampling data of the falling edge reaches the statistical threshold, it is determined that the count accumulation statistics of the falling edge is finished.
[0051] The disclosed embodiment counts the number of 0s and 1s on the rising edge and the number of 0s and 1s on the falling edge of the sampled data through a counter, providing counting support for determining the delay information based on the statistical results. The clock model data (01010101…0101) is input to the input end of the anti-skew module. When a request signal and preset valid data are received, the number of 0s and 1s in the rising edge sampled data and the number of 0s and 1s in the falling edge sampled data can be counted through the counter, and the counting and accumulation are performed according to a preset accumulation period, which is determined by M_th. When the counting statistical value of the counter reaches M_th, one counting is completed.
[0052] In an exemplary embodiment, the embodiment of the present disclosure determines that the delay unit is set to judge the delay information according to the result of the count accumulation statistics, including:
[0053] Each time when the rising edge count accumulation statistics are finished, the following processing is performed: according to the result of the rising edge count accumulation statistics, the data corresponding to the rising edge is determined; the data corresponding to the determined rising edge is recorded, and when the recorded data corresponding to the rising edge reaches a preset length, the rising edge is detected according to the data corresponding to the rising edge; the instant sampling position of each detected rising edge is determined; when the number of detected rising edges is greater than or equal to the preset number, the delay information of the rising edge is determined according to the determined instant sampling position of the rising edge;
[0054] Each time when the cumulative statistics of the falling edge count is determined to be finished, the following processing is performed: based on the results of the cumulative statistics of the falling edge count, the data corresponding to the falling edge is determined; the data corresponding to the determined falling edge is recorded, and when the recorded data corresponding to the falling edge reaches a preset length, the falling edge is detected according to the data corresponding to the falling edge; the instantaneous sampling position of each detected falling edge is determined; when the number of detected falling edges is greater than or equal to a preset number, the delay information of the falling edge is determined according to the determined instantaneous sampling position of the falling edge.
[0055] The preset number of the embodiment of the present disclosure can be set to 2 or 3. The larger the value, the higher the processing accuracy. In an exemplary embodiment, the preset duration of the embodiment of the present disclosure can be set by a technician based on the analysis of the preset number. For example, the preset duration is set to be equal to two unit intervals (2UI). A clock with a 2UI clock period can ensure that no matter where the starting position of the sampled data is, two rising edges and falling edges can be found.
[0056] In the embodiment of the present disclosure, when the data corresponding to the recorded rising edge and falling edge reaches a preset length, edge detection of the rising edge and falling edge is performed to determine whether it is a rising edge or a falling edge of a unit interval (UI); if it is not a rising edge or a falling edge of a UI, the embodiment of the present disclosure can set an interval of several cycles to continue the above-mentioned statistics on the sampled data until an edge of a unit interval UI is found, and the statistics are terminated.
[0057] In an exemplary embodiment, the embodiment of the present disclosure determines that the delay unit is set to determine the data corresponding to the rising edge according to the result of the cumulative statistics of the rising edge count, including:
[0058] When the value of the count accumulation statistics of the sampling data 0 of the rising edge at the end of the count accumulation statistics reaches the statistical threshold (M_th), the data corresponding to the rising edge is determined to be 0;
[0059] When the count accumulation statistics end, the value of the count accumulation statistics of the sampling data 1 of the rising edge reaches M_th, or the values of the count accumulation statistics of the sampling data 0 and 1 of the rising edge both reach M_th, the data corresponding to the rising edge is determined to be 1.
[0060] In an exemplary embodiment, the embodiment of the present disclosure determines that the delay unit is set to determine the data corresponding to the falling edge according to the result of the cumulative statistics of the falling edge count, including:
[0061] When the count accumulation statistics end, the value of the count accumulation statistics of the sampling data of the falling edge 0 reaches M_th, it is determined that the data corresponding to the falling edge is 0;
[0062] When the count accumulation statistics end and the count accumulation statistics value of the sampling data 1 of the falling edge reaches M_th, or when the count accumulation statistics value of the sampling data 0 and 1 of the falling edge both reach M_th, the data corresponding to the falling edge is determined to be 1.
[0063] In an exemplary instance, when the embodiment of the present disclosure records the data corresponding to the determined rising edge, the determined data can be sent to the rising edge shift register; when recording the data corresponding to the determined falling edge, the determined data can be sent to the falling edge shift register; and by determining whether the rising edge shift register and the falling edge shift register are full, it is determined whether the recorded data corresponding to the rising edge and the recorded data corresponding to the falling edge reach a preset length.
[0064] In an exemplary embodiment, after recording the data corresponding to the rising edge and the data corresponding to the falling edge, the method of the embodiment of the present disclosure clears the results of the count accumulation statistics used to determine the data corresponding to the rising edge and the count accumulation statistics used to determine the data corresponding to the falling edge.
[0065] In an exemplary embodiment, the instantaneous sampling position (cur_setting) of the rising edge of the embodiment of the present disclosure is the instantaneous sampling position of the second to last data in the data corresponding to the rising edge of the preset length; the instantaneous sampling position of the falling edge is the instantaneous sampling position of the second to last data in the data corresponding to the falling edge of the preset length;
[0066] Among them, the initial values of the instantaneous sampling position of the data corresponding to the rising edge and the instantaneous sampling position of the data corresponding to the falling edge are both 0. Every time the data corresponding to a rising edge is determined, the preset minimum delay step (LSB) is added to the instantaneous sampling position of the data corresponding to the previous rising edge to obtain the instantaneous sampling position of the current data; every time the data corresponding to a falling edge is determined, the LSB is added to the instantaneous sampling position of the data corresponding to the previous falling edge to obtain the instantaneous sampling position of the current data.
[0067] Based on the above calculation, the embodiment of the present disclosure realizes the real-time synchronous update of the instant sampling position, and obtains the instant sampling position of each data.
[0068] In an exemplary embodiment, the embodiment of the present disclosure determines that the delay unit is configured to determine the delay information of the rising edge according to the determined instantaneous sampling position of the rising edge, including:
[0069] When the number of detected rising edges is greater than or equal to a preset number, and the instantaneous sampling position of each rising edge is less than or equal to a preset maximum sampling position threshold (MAX_SETTING), the instantaneous sampling positions of two of the preset number of detected rising edges are averaged, and the result of the average is added with a preset offset and then a first limiting processing is performed according to the maximum sampling position threshold, and the result of the first limiting processing is used as the delay information of the rising edge.
[0070] The maximum sampling position threshold (MAX_SETTING) of the disclosed embodiment is the maximum setting value fed back to the anti-torsion delay unit. This value is calculated based on 2UI and LSB. For example, 1.5UI / LSB is calculated and rounded up to an integer power of 2, that is, the sampling length is between 1.5UI and 2UI (ensuring that 3 edges are obtained); the disclosed embodiment calculates the value range of the maximum sampling position threshold [1, 127] based on the currently supported clock frequency and all the LSBs it supports; the larger the value of the maximum sampling position threshold of the disclosed embodiment, the better.
[0071] In an exemplary embodiment, the embodiment of the present disclosure determines that the delay unit is configured to determine the delay information of the falling edge according to the determined instantaneous sampling position of the falling edge, including:
[0072] When the number of detected falling edges is greater than or equal to the preset number, and the instantaneous sampling position of each falling edge is less than or equal to the maximum position threshold, the instantaneous sampling positions of two of the preset number of detected falling edges are averaged, and the result of the average is added with a preset offset and then a second limiting processing is performed according to the maximum sampling position threshold, and the result of the second limiting processing is used as the delay information of the falling edge.
[0073] The embodiment of the present disclosure achieves correction of a certain deviation by adding an offset calculation, and avoids errors in the instant sampling position caused by the deviation correction through the first limiting process and the second limiting process.
[0074] In an exemplary embodiment, the embodiment of the present disclosure determines that the delay unit is set to add a preset offset to the average result and then perform a first limiting process according to the maximum sampling position threshold, including:
[0075] The instant sampling positions of two of the preset number of rising edges are averaged. When the average result plus the preset offset is greater than the maximum sampling position threshold, the value of the average result plus the offset is assigned as the maximum sampling position threshold.
[0076] In an exemplary embodiment, the embodiment of the present disclosure determines that the delay unit is set to add a preset offset to the average result and then perform a second limiting process according to the maximum sampling position threshold, including:
[0077] The instant sampling positions of two of the preset number of falling edges are averaged. When the average result plus the preset offset is greater than the maximum sampling position threshold, the value of the average result plus the offset is assigned as the maximum sampling position threshold.
[0078] In an exemplary embodiment, the embodiment of the present disclosure determines that the delay unit is further configured as:
[0079] Before the number of detected rising edges is greater than or equal to the preset number, when the instantaneous sampling position of the rising edge is greater than the maximum sampling position threshold MAX_SETTING, the feedback data is incorrect;
[0080] Before the number of detected falling edges is greater than or equal to the preset number, when the instantaneous sampling position of the falling edge is greater than the maximum sampling position threshold MAX_SETTING, the feedback data is incorrect.
[0081] In an exemplary embodiment, the anti-torsion module of the embodiment of the present disclosure includes a coding delay controller and a delay device; wherein,
[0082] The coding delay controller is configured to: generate a control code for phase offset adjustment according to the received delay information;
[0083] The delay device is configured to: encode delay information according to the control code to adjust the phase offset of the clock signal or the data signal to obtain a desired phase shift;
[0084] The delay information includes: the delay step length and the total delay duration.
[0085] In an exemplary embodiment, the embodiment of the present disclosure can determine the control code for phase offset adjustment through a calibration algorithm including a self-calibration anti-skew algorithm, and the anti-skew module includes an anti-skew delay unit, and the anti-skew delay unit can shift the data signal or the clock signal to a point where the two are orthogonal to each other according to the delay information; Figure 2 Schematic diagram of the anti-torsion module according to the embodiment of the present disclosure, Figure 2 As shown, the anti-torsion control module feeds back the delay information to the anti-torsion delay unit in the anti-torsion module, and the delay adjustment is achieved through the anti-torsion unit. Figure 3 This is a schematic diagram of the composition of the anti-skew delay unit according to the embodiment of the present disclosure, see Figure 3 The working principle of the anti-skew delay unit in the embodiment of the present disclosure is: a control code for phase shift adjustment is generated according to the received delay information, and the control code is given to the coding delay controller, so as to set the coarse adjustment delay unit and the fine adjustment delay unit of the delay controller respectively, and then obtain the phase shift required by the clock signal or the data signal; wherein the coarse adjustment delay unit controls the total delay length of the data, and the fine adjustment delay unit controls the step length of the delay.
[0086] According to the statistical results, the anti-skew control module of the embodiment of the present disclosure monitors the skew of the clock signal and the data signal in real time, and generates a control code for adjusting and controlling (adjusting and controlling by a self-calibration anti-skew algorithm) the anti-skew delay time of the anti-skew delay unit in real time according to the change of the skew, and then controls the clock or data phase shift through the generated control code; in an exemplary embodiment, the embodiment of the present disclosure controls the clock or data phase shift through the generated control code, so that the data signal or the clock signal moves to a phase difference of 0.5 UI between the two. Figure 4 and Figure 5 A schematic diagram of the phase shift of the clock signal and the data signal according to the embodiment of the present disclosure is shown in FIG. Figure 4 or Figure 5 , the embodiment of the present disclosure maintains the synchronization of the clock signal and the data signal.
[0087] The present disclosure also provides a method for anti-torsion processing, including:
[0088] Step 501, obtaining sampling data obtained by sampling a data signal of a data signal channel through a clock signal of a clock signal channel of a preset duration, and determining delay information according to the obtained sampling data;
[0089] Step 502: According to the determined delay information, phase offset adjustment is performed on the clock signal and the data signal.
[0090] The above-mentioned processing of sampling the data signal and determining the delay information in the embodiment of the present disclosure can be implemented by a circuit with a simple structure. The anti-torsion module realizes phase offset adjustment through the delay information, which simplifies the circuit composition of the phase calibration.
[0091] On the other hand, an embodiment of the present disclosure further provides a computer storage medium, in which a computer program is stored. When the computer program is executed by a processor, the above-mentioned anti-torsion processing method is implemented.
[0092] In another aspect, an embodiment of the present disclosure further provides a terminal, comprising: a memory and a processor, wherein a computer program is stored in the memory;
[0093] The processor is configured to execute the computer program in the memory;
[0094] When the computer program is executed by a processor, the above-mentioned anti-torsion processing method is implemented.
[0095] The following briefly describes the embodiments of the present disclosure through application examples. The application examples are only used to illustrate the embodiments of the present disclosure and are not used to limit the protection scope of the embodiments of the present disclosure.
[0096] Application Examples
[0097] The process of determining the delay information in the embodiment of the present disclosure includes: inputting the clock pattern data of 01010101…0101 through the data signal channel (data lane), inputting the clock signal of two unit interval (2UI) clock cycles through the clock lane, first giving Figure 2 The initial value of the anti-torsion control module input at the MUX control end is 0. Figure 6 The schematic diagram of the sampling data of the rising edge and the falling edge of the embodiment of the present disclosure is as follows: the anti-torsion control module collects data through the rising edge and the falling edge of the clock respectively, and the counter counts the data respectively. Figure 1 The number of 0s and 1s of the odd and even bits of the sampled data in the image is used to determine the delay information according to the instantaneous sampling position of the detected edge, and output it to the anti-torsion deskew module at the MUX control end; Figure 7 Schematic diagram of the process of the embodiment of the present disclosure, as shown in Figure 7 As shown, including:
[0098] Step 1) Initialize all registers, including: registers for storing sampling data, the number of 0s in the rising edge sampling data, the number of 1s in the rising edge sampling data, the number of 0s in the falling edge sampling data, and the number of 1s in the falling edge sampling data; the registers can be general registers used for internal operations, used to store sampling data, participate in statistical operations and operation results.
[0099] Step 2) When the anti-torsion module receives a preset request signal and valid data (the preset request signal and valid data may be a preset trigger instruction), the rising edge and falling edge of the clock (reference Figure 6 , 0->1 is the rising edge, 1->0 is the falling edge) respectively samples the output data, and counts and accumulates the number of 0 and 1 of the obtained sampling data according to the preset accumulation period; the number of 0 in the accumulated rising edge sampling data is pcnt0, the number of 1 in the accumulated rising edge sampling data is pcnt1, the number of 0 in the accumulated falling edge sampling data is ncnt0, and the number of 1 in the accumulated falling edge sampling data is ncnt1. During the accumulation process, pcnt1, pcnt0, ncnt1 and ncnt0 are continuously compared with M_th. When pcnt0>=M_th or pcnt1>=M_th, the counting statistics of the sampling data of the rising edge are stopped; when ncnt0>=M_th or ncnt1>=M_th, the counting statistics of the sampling data of the falling edge are stopped, and it is determined that the accumulation period is reached, and the counting statistics of 0 / 1 for the sampling data are stopped.
[0100] Step 3) Compare the numerical values of pcnt1, pcnt0, ncnt1 and ncnt0 to determine whether the data corresponding to the rising edge and the falling edge are 1 or 0; the disclosed embodiment can determine the data corresponding to the rising edge and the falling edge according to pcnt0, pcnt1, ncnt0 and ncnt1. When pcnt0 reaches M_th first, the data corresponding to the rising edge is determined to be 0. When pcnt1 reaches M_th first or pcnt0 and pcnt1 reach M_th at the same time, the data corresponding to the rising edge is determined to be 1; when ncnt0 reaches M_th first, the data corresponding to the falling edge is determined to be 0. When ncnt1 reaches M_th first or ncnt0 and ncnt1 reach M_th at the same time, the data corresponding to the falling edge is determined to be 1; the determined data corresponding to the rising edge is sent to the rising edge shift register for storage, and the determined data corresponding to the falling edge is sent to the falling edge shift register for storage. The lengths of the shift register and the falling edge shift register are equal, and both can take values of 3 to 8. The higher the accuracy requirement, the longer the length. Initialize the rising edge instant sampling position (cur_setting) and the falling edge instant sampling position (cur_setting) to 0. Each time a data corresponding to a rising edge is determined, the minimum step length (LSB) of the sampled data is accumulated to the rising edge instant sampling position (cur_setting) as the instant sampling position of the data corresponding to the current rising edge. Each time a data corresponding to a falling edge is determined, the minimum step length (LSB) of the sampled data is accumulated to the falling edge instant sampling position cur_setting as the instant sampling position of the data corresponding to the current falling edge. Among them, LSB is the delay step length of the pre-set anti-torsion delay module. Clear pcnt0, pcnt1, ncnt0 and ncnt1 of the determined data.
[0101] Step 4) When the rising-edge shift register and the falling-edge shift register are filled with data, respectively determine the number of rising-edge edges pedge_cnt detected in the rising-edge sampled data and the number of falling-edge edges nedge_cnt detected in the falling-edge sampled data; for the rising edge, if pedge_cnt < p, where p is the preset number in the embodiments of the present disclosure, taking 2 or 3, p can be configured through the register (EN_ONE_EDGE) of the single-edge flip-flop, the number of rising-edge edges that the sampled data of the rising edge needs to detect should at least include p, and determine whether the data in the rising-edge shift register is a rising-edge edge; in the embodiments of the present disclosure, if the configured shift register length is 4, according to the common knowledge of those skilled in the art, data such as 4’h1110 / 4’h0001 / 4’h0111 / 4’h1000 are all determined to be rising-edge edges. If a rising-edge edge is determined according to the data in the rising-edge shift register, then pedge_cnt is incremented by 1 (pedge_cnt++); if the data in the rising-edge shift register is determined not to be a rising-edge edge, jump to step 2 for sampling and statistics; if pedge_cnt >= p, directly enter step 5); for the falling edge, if nedge_cnt < p, determine whether it is a falling-edge edge according to the data in the falling-edge shift register. If it is determined to be a falling-edge edge according to the data in the falling-edge shift register, then nedge_cnt is incremented by 1 (nedge_cnt++); if it is determined not to be a falling-edge edge according to the data in the falling-edge shift register, jump to the processing of sampling and counting statistics; if nedge_cnt >= p, directly enter step 5).
[0102] Step 5) When a rising-edge edge is detected, determine that the cur_setting of the rising-edge edge ≤ MAX_SETTING, and calculate the instantaneous sampling intermediate value according to the instantaneous sampling position of each detected rising edge (in the embodiments of the present disclosure, it is the result of averaging the instantaneous sampling positions of two of the preset number of detected rising-edge edges. The sampling intermediate value (centersetting) is represented as pcenter_code_setting, and reference can be made to Figure 6, based on the average of the instantaneous sampling positions of more than two rising edges, for example, when there are three rising edges, the instantaneous sampling position of the first rising edge, the instantaneous sampling position of the second rising edge and the instantaneous sampling position of the third rising edge are averaged to obtain the above-mentioned instantaneous sampling intermediate value;), the instantaneous sampling intermediate value is added with the offset value and then subjected to the first limiting processing to obtain the delay information of the rising edge; before the number of rising edges detected by the embodiment of the present disclosure is greater than or equal to the preset number, when the instantaneous sampling position of the rising edge is greater than the maximum sampling position threshold, the feedback data is erroneous; similarly, the judgment processing of the delay information of the falling edge is performed, and the best_code_setting is obtained by averaging the rising edge delay information and the falling edge delay information and outputted to the coding delay controller.
[0103] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
Claims
1. A circuit for deskew processing, characterized in that: include: Receive data channel, clock signal channel, anti-torsion control module and anti-torsion module; wherein, The receiving data channel is set to: receive input data signals, the data signals are alternating standard sequences; The clock signal channel is set to: receive the input clock signal; The anti-torsion control module is connected to the receiving data channel, and the anti-torsion control module includes: a sampling unit and a delay determination unit; wherein, The sampling unit is configured to: sample the data signal of the receiving data channel through the clock signal of the clock signal channel of the preset duration to obtain the sampled data; The delay unit is set to: count and accumulate the number of 0 and 1 of the sampling data of the rising edge and the number of 0 and 1 of the sampling data of the falling edge according to the preset accumulation period according to the sampling data; determine the delay information according to the result of the count accumulation statistics; wherein the accumulation period is determined by a preset statistical threshold; the number of 0 and 1 of the sampling data of the rising edge and the number of 0 and 1 of the sampling data of the falling edge are counted and accumulated according to the preset accumulation period, and each count accumulation statistics includes: when the value of the count accumulation statistics of 0 and / or 1 of the sampling data of the rising edge reaches the statistical threshold, it is determined that the count accumulation statistics of the rising edge is finished; when the value of the count accumulation statistics of 0 and / or 1 of the sampling data of the falling edge reaches the statistical threshold, it is determined that the count accumulation statistics of the falling edge is finished; the delay unit is set to determine the delay information according to the result of the count accumulation statistics, including: each time it is determined that the count accumulation statistics of the rising edge is finished, the following processing is performed: according to the rising edge count accumulation statistics, the count accumulation statistics of the falling edge is finished; The data corresponding to the rising edge is determined based on the result of the accumulated statistics of the edge count; the data corresponding to the determined rising edge is recorded, and when the recorded data corresponding to the rising edge reaches a preset length, the rising edge is detected according to the data corresponding to the rising edge; the instant sampling position of each detected rising edge is determined; when the number of detected rising edges is greater than or equal to the preset number, the delay information of the rising edge is determined according to the determined instant sampling position of the rising edge; each time the accumulated statistics of the falling edge count is determined, the following processing is performed: the data corresponding to the falling edge is determined based on the result of the accumulated statistics of the falling edge count; the data corresponding to the determined falling edge is recorded, and when the recorded data corresponding to the falling edge reaches a preset length, the falling edge is detected according to the data corresponding to the falling edge; the instant sampling position of each detected falling edge is determined; when the number of detected falling edges is greater than or equal to the preset number, the delay information of the falling edge is determined according to the determined instant sampling position of the falling edge; The anti-torsion skew module is connected to the anti-torsion skew control module and is configured to: perform phase offset adjustment on the clock signal and the data signal according to the delay information determined by the anti-torsion skew control module.
2. The circuit according to claim 1, characterized in that The delay determination unit is configured to determine data corresponding to the rising edge according to the result of cumulative statistics of the rising edge count, including: When the count accumulation statistics are completed and the value of the count accumulation statistics of the sampling data of the rising edge 0 reaches a preset statistical threshold, it is determined that the data corresponding to the rising edge is 0; When the count accumulation statistics ends, when the value of the count accumulation statistics of 1 of the sampling data of the rising edge reaches the statistical threshold, or when the values of the count accumulation statistics of 0 and 1 of the sampling data of the rising edge both reach the statistical threshold, it is determined that the data corresponding to the rising edge is 1.
3. The circuit according to claim 1, characterized in that The delay determination unit is configured to determine data corresponding to the falling edge according to the result of cumulative statistics of falling edge counts, including: When the count accumulation statistics are completed and the value of the count accumulation statistics of the sampled data of the falling edge is 0 reaches a preset statistical threshold, it is determined that the data corresponding to the falling edge is 0; When the count accumulation statistics ends, when the value of the count accumulation statistics of 1 of the sampling data of the falling edge reaches the statistical threshold, or when the values of the count accumulation statistics of 0 and 1 of the sampling data of the falling edge both reach the statistical threshold, it is determined that the data corresponding to the falling edge is 1.
4. The circuit according to claim 1, characterized in that: The instant sampling position of the rising edge is the instant sampling position of the second to last data in the data corresponding to the rising edge of the preset length; The instant sampling position of the falling edge is the instant sampling position of the second to last data in the data corresponding to the falling edge of the preset length; Among them, the initial values of the instantaneous sampling position of the data corresponding to the rising edge and the instantaneous sampling position of the data corresponding to the falling edge are both 0. Every time the data corresponding to the rising edge is determined, the preset minimum delay step LSB is added to the instantaneous sampling position of the data corresponding to the previous rising edge to obtain the instantaneous sampling position of the current data; every time the data corresponding to the falling edge is determined, the LSB is added to the instantaneous sampling position of the data corresponding to the previous falling edge to obtain the instantaneous sampling position of the current data.
5. The circuit according to claim 1, characterized in that The delay determination unit is configured to determine the delay information of the rising edge according to the determined instantaneous sampling position of the rising edge, including: When the number of the detected rising edges is greater than or equal to the preset number, and the instantaneous sampling position of each of the rising edges is less than or equal to the preset maximum sampling position threshold, the instantaneous sampling positions of two of the preset number of rising edges detected are averaged, and the result of the average is added with a preset offset and then a first limiting processing is performed according to the maximum sampling position threshold, and the result of the first limiting processing is used as the delay information of the rising edge.
6. The circuit according to claim 1, characterized in that The delay determination unit is configured to determine the delay information of the falling edge according to the determined instantaneous sampling position of the falling edge, including: When the number of the detected falling edges is greater than or equal to the preset number, and the instantaneous sampling position of each of the falling edges is less than or equal to the maximum position threshold, the instantaneous sampling positions of two of the preset number of falling edges detected are averaged, and the result of the average is added with a preset offset and then a second limiting processing is performed according to the maximum sampling position threshold, and the result of the second limiting processing is used as the delay information of the falling edge.
7. The circuit according to claim 5, characterized in that The delay determination unit is configured to perform a first limiting process according to a maximum sampling position threshold after adding a preset offset to the average result, including: The instant sampling positions of two of the preset number of rising edges are averaged, and when the average result plus the preset offset is greater than the maximum sampling position threshold, the value of the average result plus the offset is assigned as the maximum sampling position threshold.
8. The circuit according to claim 6, characterized in that The delay determination unit is configured to perform a second limiting process according to a maximum sampling position threshold after adding a preset offset to the average result, including: The instant sampling positions of two of the preset number of falling edges are averaged, and when the average result plus the preset offset is greater than the maximum sampling position threshold, the value of the average result plus the offset is assigned as the maximum sampling position threshold.
9. The circuit according to claim 1, characterized in that The delay determination unit is further configured to: Before the number of the detected rising edges reaches the preset number, when the instantaneous sampling position of the rising edge is greater than the preset maximum sampling position threshold, the feedback data is erroneous; Before the number of the detected falling edges reaches the preset number, when the instantaneous sampling position of the falling edge is greater than the maximum sampling position threshold, the feedback data is incorrect.
10. The circuit according to any one of claims 1 to 9, characterized in that: The anti-torsion module includes a coding delay controller and a delay device; wherein, The coding delay controller is configured to: generate a control code for phase offset adjustment according to the received delay information; The delay device is configured to: encode delay information according to the control code to adjust the phase offset of the clock signal or the data signal to obtain the required phase shift; The delay information includes: the delay step length and the total delay duration.
11. A method for anti-torsion processing, characterized in that: include: Acquire sampling data obtained by sampling a data signal of a receiving data channel through a clock signal of a clock signal channel of a preset duration; According to the sampling data, the number of 0s and 1s of the sampling data at the rising edge and the number of 0s and 1s of the sampling data at the falling edge are counted and accumulated according to a preset accumulation period; Determine the delay information according to the result of the count accumulation statistics; wherein the accumulation period is determined by a preset statistical threshold; According to the determined delay information, a phase offset adjustment is performed on the clock signal and the data signal; Among them, the number of 0s and 1s of the sampling data of the rising edge and the number of 0s and 1s of the sampling data of the falling edge are counted and accumulated according to a preset accumulation period, and each count accumulation includes: when the value of the count accumulation statistics of 0 and / or 1 of the sampling data of the rising edge reaches the statistical threshold, it is determined that the count accumulation statistics of the rising edge is finished; when the value of the count accumulation statistics of 0 and / or 1 of the sampling data of the falling edge reaches the statistical threshold, it is determined that the count accumulation statistics of the falling edge is finished; the delay information is judged according to the result of the count accumulation statistics, including: each time it is determined that the count accumulation statistics of the rising edge is finished, the following processing is performed: according to the result of the count accumulation statistics of the rising edge, the data corresponding to the rising edge is determined; the data corresponding to the determined rising edge is recorded, and when the recorded data corresponding to the rising edge reaches a preset length When the rising edge is detected according to the data corresponding to the rising edge; the instantaneous sampling position of each detected rising edge is determined; when the number of detected rising edges is greater than or equal to the preset number, the delay information of the rising edge is determined according to the determined instantaneous sampling position of the rising edge; each time the falling edge count accumulation statistics are determined to be finished, the following processing is performed: according to the result of the falling edge count accumulation statistics, the data corresponding to the falling edge is determined; the data corresponding to the determined falling edge is recorded, and when the recorded data corresponding to the falling edge reaches the preset length, the falling edge is detected according to the data corresponding to the falling edge; the instantaneous sampling position of each detected falling edge is determined; when the number of detected falling edges is greater than or equal to the preset number, the delay information of the falling edge is determined according to the determined instantaneous sampling position of the falling edge.
12. A computer storage medium, wherein a computer program is stored in the computer storage medium, and when the computer program is executed by a processor, the anti-torsion processing method according to claim 11 is implemented.
13. A terminal, comprising: A memory and a processor, wherein the memory stores a computer program; wherein, The processor is configured to execute the computer program in the memory; When the computer program is executed by the processor, the anti-skew processing method according to claim 11 is implemented.
Citation Information
Patent Citations
Method, apparatus and system for deskewing parallel interface links
US9832006B1
