High-speed serial-to-parallel conversion interface word synchronization method and circuit for FPGA chip
By designing a high-speed serial-parallel conversion interface word synchronization method and circuit in the FPGA chip, the problem of difficulty in identifying the serial data byte boundary at the receiving end is solved, and the accurate checksum adjustment of the parallel data signal is realized, and the word synchronization efficiency is improved. Circuit simplicity.
Patent Information
- Application Number
- CN201911398757.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-12-30
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2039-12-30
AI Technical Summary
In the data processing of serial signal input, it is difficult for the receiver to accurately identify the byte boundary of the serial data, resulting in the serial-parallel conversion circuit outputting incorrect bytes, affecting the accuracy of the input data of the subsequent circuit.
By designing a high-speed serial-parallel conversion interface word synchronization method and circuit in the FPGA chip, the serial-parallel conversion module is used to convert the received serial data signal into parallel data signal, and compare it with the preset word synchronization characters to generate word synchronization control Repeat word synchronization operation until the parallel data signal is consistent with the word synchronization characters to ensure the output parallel data signal is accurate.
It effectively avoids outputting incorrect data, saves word synchronization time, improves word synchronization efficiency, simplifies the circuit structure, and reduces the number of slip operations.
Smart Images

Figure CN111130560B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of FPGA technology, and in particular relates to a high-speed serial-to-parallel conversion interface word synchronization method and circuit for FPGA chips. Background Art
[0002] Data is typically transmitted serially between integrated circuits at high data rates. An integrated circuit receives a serial data signal from another integrated circuit. The receiving integrated circuit may convert the serial data in the serial data signal into parallel data to allow the digital logic to operate at a lower speed. For example, the receiving integrated circuit may convert the incoming serial data signal into consecutive bytes or words of parallel data while converting from a faster clock domain to a slower byte clock domain.
[0003] In the data processing of serial signal input, the receiver needs to perform various forms of word synchronization after receiving the data before it can be used by subsequent circuits. For example, the serial data received by the receiver may be continuous data with 8 bits as one byte, but the receiver does not know where each byte starts and ends. The receiver needs to convert the received data into serial-to-parallel and use the converted parallel data as input data for the next stage. If word synchronization is not performed, the serial-to-parallel conversion circuit may send the wrong byte beginning to other circuits and generate incorrect input. Summary of the invention
[0004] In order to solve the above problems existing in the prior art, the present invention provides a high-speed serial-to-parallel conversion interface word synchronization method and circuit for FPGA chips. The technical problem to be solved by the present invention is achieved by the following technical solutions:
[0005] One aspect of the present invention provides a high-speed serial-to-parallel conversion interface word synchronization method for an FPGA chip, comprising:
[0006] S1: Convert the received serial data signal into a parallel data signal using a serial-to-parallel conversion module;
[0007] S2: Compare the parallel data signal with a preset word synchronization character to obtain a word synchronization control signal;
[0008] S3: Repeating the word synchronization operation in the serial-to-parallel conversion process according to the word synchronization control signal until the parallel data signal is consistent with a preset word synchronization character;
[0009] S4: Obtain the correct boundary of the serial data signal, and output the parallel data signal after completing word synchronization.
[0010] In one embodiment of the present invention, the S1 includes:
[0011] S11: pre-set and store word synchronization characters;
[0012] S12: inputting a dual-edge serial data signal and performing rising edge sampling and falling edge sampling on the dual-edge serial data signal to obtain a rising edge sampling signal and a falling edge sampling signal;
[0013] S13: Perform serial-to-parallel conversion on the rising edge sampling signal and the falling edge sampling signal simultaneously to obtain a group of parallel data signals.
[0014] In one embodiment of the present invention, the S13 includes:
[0015] S131: Shifting the rising edge sampling signal and the falling edge sampling signal multiple times using multiple shift registers to obtain multiple shift data signals;
[0016] S132: In response to the selection signal, using a plurality of data selectors to select the plurality of shifted data to obtain a plurality of selection data signals;
[0017] S133: In response to the update signal, sampling and updating the plurality of selected data signals and acquiring a plurality of updated data signals;
[0018] S134: In response to the clock conversion signal, transmit the plurality of update data signals as a group of parallel data signals to the comparison module.
[0019] In one embodiment of the present invention, the S2 includes:
[0020] The parallel data signal is compared with a preset word synchronization character to determine whether they are the same. If so, the word synchronization control signal is always at a low level; if not, the word synchronization control signal is pulled high for one clock cycle.
[0021] In one embodiment of the present invention, S3 includes:
[0022] If the parallel data signal is consistent with the word synchronization character, the current parallel data signal is used as the final parallel data signal and output; if the parallel data signal is inconsistent with the word synchronization character, a selection signal and an update signal are generated according to the word synchronization control signal, and another group of parallel data signals of the serial data signal are obtained in response to the selection signal and the update signal and steps S2 and S3 are repeated.
[0023] In one embodiment of the present invention, the S3 further includes:
[0024] If the parallel data signal is inconsistent with the word synchronization character, the word synchronization control signal is sent from the comparison module to the control module, and the control module generates a selection signal and an update signal according to the word synchronization control signal, controls the current parallel data signal to shift right by at least one bit, and moves at least one lowest bit of the next group of parallel data to at least one highest bit of the current parallel data, to form a second parallel data signal and output it; compares whether the second parallel data signal is consistent with the word synchronization character, and repeats steps S2 and S3 until the obtained parallel data signal is consistent with the word synchronization character.
[0025] Another aspect of the present invention provides a high-speed serial-to-parallel conversion interface word synchronization circuit for an FPGA chip, which is used to execute any of the methods in the above embodiments. The circuit includes a sampling module, a serial-to-parallel conversion module, a comparison module and a control module, wherein:
[0026] The sampling module is used to perform rising edge sampling and falling edge sampling on the received dual-edge serial data signal to obtain a rising edge sampling signal and a falling edge sampling signal;
[0027] The serial-to-parallel conversion module is connected to the sampling module and the control module, and is used to perform serial-to-parallel conversion on the rising edge sampling signal and the falling edge sampling signal to obtain a parallel data signal, and perform a word synchronization process in the serial-to-parallel conversion according to the control signal generated by the control module;
[0028] The comparison module is connected to the serial-to-parallel conversion module, and is used to compare whether the parallel data signal is consistent with a preset word synchronization character, and generate a word synchronization control signal according to the comparison result;
[0029] The control module is used to generate a selection signal and an update signal according to the word synchronization control signal, and control the serial-to-parallel conversion module to finally output a parallel data signal consistent with the word synchronization character in a parallel data signal shifting manner.
[0030] In one embodiment of the present invention, the sampling module includes a rising edge trigger and a falling edge trigger, wherein the first input end of the rising edge trigger inputs the dual-edge serial data signal, the second input end inputs the serial clock signal, and the output end is connected to the serial-to-parallel conversion module, and the rising edge trigger is used to perform rising edge sampling on the dual-edge serial data signal;
[0031] The first input end of the falling edge trigger inputs the dual-edge serial data signal, the second input end inputs the serial clock signal, and the output end is connected to the serial-to-parallel conversion module. The falling edge trigger is used to perform falling edge sampling on the dual-edge serial data signal.
[0032] In one embodiment of the present invention, the serial-to-parallel conversion module includes a shift register unit, a data selector unit, an update register unit and a clock domain conversion register unit connected in sequence, wherein:
[0033] The shift register unit is used to shift the rising edge sampling signal and the falling edge sampling signal multiple times to obtain multiple shift data signals;
[0034] The data selector unit is connected to the control module and is used to select the multiple shift data signals according to the selection signal from the control module to obtain multiple selection data signals;
[0035] The update register unit is connected to the control module and is used to sample and update the multiple selection data signals according to the update signal from the control module to obtain multiple update data signals;
[0036] The clock domain conversion register unit is connected to the control module and is used to transmit the multiple update data signals as parallel data signals to the comparison module or output them according to the divided clock signal.
[0037] In one embodiment of the present invention, when the parallel data signal is inconsistent with the word synchronization character, the comparison module sends a word synchronization control signal to the control module, and the control module generates a selection signal and an update signal according to the word synchronization control signal, controls the current parallel data signal to shift right by at least one bit, and moves at least one lowest bit of the next group of parallel data signals to at least one highest bit of the current parallel data signal to form the next group of parallel data signals.
[0038] Compared with the prior art, the present invention has the following beneficial effects:
[0039] 1. The high-speed serial-to-parallel conversion interface word synchronization method and circuit for FPGA chip of the present invention can check and adjust the output parallel data signal, output the parallel data signal after word synchronization to the next level circuit, and avoid outputting erroneous data.
[0040] 2. The high-speed serial-to-parallel conversion interface word synchronization method and circuit for FPGA chips of the present invention can obtain accurately aligned parallel data after fewer slip operations during the serial-to-parallel conversion process, thereby saving word synchronization time and improving word synchronization efficiency.
[0041] 3. The high-speed serial-to-parallel conversion interface word synchronization method and circuit for FPGA chip of the present invention can be implemented simultaneously in the serial-to-parallel conversion process, does not require a special module to achieve word synchronization, and has a simple circuit structure.
[0042] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 It is a flow chart of a high-speed serial-to-parallel conversion interface word synchronization method for an FPGA chip provided by an embodiment of the present invention;
[0044] Figure 2 It is a module diagram of a high-speed serial-to-parallel conversion interface word synchronization circuit for an FPGA chip provided by an embodiment of the present invention;
[0045] Figure 3 It is another module diagram of a high-speed serial-to-parallel conversion interface word synchronization circuit for an FPGA chip provided by an embodiment of the present invention;
[0046] Figure 4 is a structural schematic diagram of a serial-to-parallel conversion module provided by an embodiment of the present invention;
[0047] Figure 5 is a schematic diagram of a parallel data shifting process when an odd number of slip pulses are encountered in a 1:10 mode provided by an embodiment of the present invention;
[0048] Figure 6 It is a schematic diagram of a parallel data shifting process when an even number of slip pulses are encountered in a 1:10 mode provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0049] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined purpose of the invention, the following is a detailed description of a high-speed serial-to-parallel conversion interface word synchronization method and circuit for FPGA chips proposed in accordance with the present invention, in combination with the accompanying drawings and specific implementation methods.
[0050] The above and other technical contents, features and effects of the present invention are clearly presented in the following detailed description of the specific implementation modes in conjunction with the accompanying drawings. Through the description of the specific implementation modes, the technical means and effects adopted by the present invention to achieve the predetermined purpose can be more deeply and specifically understood. However, the attached drawings are only for reference and explanation purposes and are not used to limit the technical solutions of the present invention.
[0051] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants are intended to cover non-exclusive inclusion, so that an article or device including a series of elements includes not only those elements, but also other elements that are not explicitly listed. In the absence of more restrictions, the elements defined by the statement "including one..." do not exclude the existence of other identical elements in the article or device including the elements.
[0052] Embodiment 1
[0053] See also Figure 1 , Figure 1 The invention provides a flowchart of a high-speed serial-to-parallel conversion interface word synchronization method for an FPGA chip.
[0054] It should be noted that in order to achieve word synchronization, the transmitter needs to send a word synchronization character for a long time before sending valid data (the same as the word synchronization character data stored in the comparison module, but this time it is serial data), so that the receiving end has enough time to achieve word synchronization. The word synchronization process described below is based on the premise that the transmitter sends the same word synchronization character.
[0055] The high-speed serial-to-parallel conversion interface word synchronization method for FPGA chip of this embodiment includes:
[0056] S1: Convert the received serial data signal into a parallel data signal using a serial-to-parallel conversion module;
[0057] S2: Compare the parallel data signal with a preset word synchronization character to obtain a word synchronization control signal;
[0058] S3: Repeating the word synchronization operation in the serial-to-parallel conversion process according to the word synchronization control signal until the parallel data signal is consistent with a preset word synchronization character;
[0059] S4: Obtain the correct boundary of the serial data signal, and output the parallel data signal after completing word synchronization.
[0060] In the serial-to-parallel conversion process of this embodiment, the receiving end and the transmitting end add word synchronization characters to ensure the integrity of the code group so as to complete the correct segmentation of the character string, that is, the transmitting end sends the word synchronization character before sending the valid data packet. If the parallel data output by the receiving end is inconsistent with the word synchronization character, the receiving end performs a word synchronization operation, and repeats this process until the parallel data output by the receiving end is consistent with the word synchronization character. The word synchronization character represents the accurate parallel signal expected to be obtained after the serial data signal is serial-to-parallel converted.
[0061] Furthermore, the S1 includes:
[0062] S11: pre-set and store word synchronization characters;
[0063] Specifically, before sending a valid data packet, the transmitting end sends a word synchronization character and stores the word synchronization character.
[0064] S12: inputting a dual-edge serial data signal and performing rising edge sampling and falling edge sampling on the dual-edge serial data signal to obtain a rising edge sampling signal and a falling edge sampling signal;
[0065] In this embodiment, rising edge sampling and falling edge sampling are performed respectively by a rising edge trigger and a falling edge trigger. Specifically, the first input end of the rising edge trigger inputs the dual-edge serial data signal di, and the second input end inputs the serial clock signal, and the rising edge trigger is used to perform rising edge sampling on the dual-edge serial data signal to obtain a rising edge sampling signal di_p; the first input end of the falling edge trigger inputs the dual-edge serial data signal di, and the second input end inputs the serial clock signal, and the falling edge trigger is used to perform falling edge sampling on the dual-edge serial data signal to obtain a falling edge sampling signal di_n.
[0066] S13: Perform serial-to-parallel conversion on the rising edge sampling signal and the falling edge sampling signal simultaneously to obtain a group of parallel data signals.
[0067] Further, the S13 includes:
[0068] S131: Shifting the rising edge sampling signal and the falling edge sampling signal multiple times using multiple shift registers to obtain multiple shift data signals;
[0069] In this embodiment, the rising edge sampling signal and the falling edge sampling signal are shifted multiple times respectively by using a plurality of shift registers connected in sequence, that is, each time the sampling signal passes through a shift register, the signal is delayed by one clock cycle. Taking 1:8 serial-to-parallel conversion (that is, each 8-bit serial signal is a group of parallel data) as an example, 8 shift registers are required, wherein four shift registers are connected to each other to shift the rising edge sampling signal to obtain four rising edge shift signals, and the four rising edge shift signals are each one clock cycle apart; the remaining four shift registers are connected to each other to shift the falling edge sampling signal to obtain four falling edge shift signals, and the four falling edge shift signals are each one clock cycle apart, thereby obtaining eight shift signals. It should be noted that the shift operation of data by the shift register is a conventional operation, and the specific implementation method is not described in detail here.
[0070] S132: In response to the selection signal, using a plurality of data selectors to select the plurality of shifted data to obtain a plurality of selection data signals;
[0071] In this step, the multiple shift signals obtained in the previous step are transmitted to the corresponding data selector, and the data selector selects and outputs the multiple shift signals.
[0072] S133: In response to the update signal, sampling and updating the plurality of selected data signals and acquiring a plurality of updated data signals;
[0073] S134: In response to the clock conversion signal, transmit the plurality of update data signals as a group of parallel data signals to the comparison module.
[0074] Further, the S2 includes:
[0075] The parallel data signal is compared with a preset word synchronization character to determine whether they are the same. If so, the word synchronization control signal is always at a low level; if not, the word synchronization control signal is pulled high for one clock cycle.
[0076] Further, the S3 includes:
[0077] If the parallel data signal is consistent with the word synchronization character, the current parallel data signal is used as the final parallel data signal and output; if the parallel data signal is inconsistent with the word synchronization character, a selection signal and an update signal are generated according to the word synchronization control signal, and another group of parallel data signals of the serial data signal are obtained in response to the selection signal and the update signal and steps S2 and S3 are repeated.
[0078] Furthermore, the S3 further includes:
[0079] If the parallel data signal is inconsistent with the word synchronization character, the word synchronization control signal is sent from the comparison module to the control module, and the control module generates a selection signal and an update signal according to the word synchronization control signal, controls the current parallel data signal to shift right by at least one bit, and moves at least one lowest bit of the next group of parallel data to at least one highest bit of the current parallel data, to form a second parallel data signal and output it; compares whether the second parallel data signal is consistent with the word synchronization character, and repeats steps S2 and S3 until the obtained parallel data signal is consistent with the word synchronization character.
[0080] Furthermore, at this time, the correct boundary for converting the serial character string to the parallel character is found, and then the parallel data signal after completing word synchronization is output.
[0081] The high-speed serial-to-parallel conversion interface word synchronization method for FPGA chip of the present invention can check and adjust the output parallel data signal, output the parallel data signal after word synchronization to the next level circuit, and avoid outputting erroneous data.
[0082] Embodiment 2
[0083] On the basis of the above embodiments, this embodiment provides a high-speed serial-to-parallel conversion interface word synchronization circuit for an FPGA chip, which is used to execute the method in the first embodiment.
[0084] See also Figure 2 , Figure 2The present invention provides a block diagram of a high-speed serial-to-parallel conversion interface word synchronization circuit for an FPGA chip. The high-speed serial-to-parallel conversion interface word synchronization circuit comprises a sampling module 101, a serial-to-parallel conversion module 102, a comparison module 103 and a control module 104, wherein the sampling module 101 is used to perform rising edge sampling and falling edge sampling on the received dual-edge serial data signal to obtain a rising edge sampling signal and a falling edge sampling signal; the serial-to-parallel conversion module 102 is connected to the sampling module 101 and the control module 104, the serial-to-parallel conversion module 102 is used to perform serial-to-parallel conversion on the rising edge sampling signal and the falling edge sampling signal to obtain a parallel data signal, and perform a word synchronization process in the serial-to-parallel conversion according to the control signal generated by the control module 104; the comparison module 103 is connected to the serial-to-parallel conversion module 102, and is used to compare whether the parallel data signal is consistent with a preset word synchronization character, and generate a word synchronization control signal according to the comparison result; the control module 104 is used to generate a selection signal and an update signal according to the word synchronization control signal, and control the serial-to-parallel conversion module 102 to finally output a parallel data signal consistent with the word synchronization character in a parallel data signal shifting manner. Preferably, the circuit of this embodiment further includes a storage module (not shown in the drawings), which is connected to the comparison module 103 and is used to store pre-input word synchronization characters.
[0085] For further information, see Figure 3 , Figure 3 It is another module diagram of a high-speed serial-to-parallel conversion interface word synchronization circuit for an FPGA chip provided by an embodiment of the present invention. The sampling module 101 includes a rising edge trigger 1011 and a falling edge trigger 1012, wherein the first input end of the rising edge trigger 1011 inputs a dual-edge serial data signal, the second input end inputs a serial clock signal, and the output end is connected to the serial-to-parallel conversion module 102, and the rising edge trigger 1011 is used to perform rising edge sampling on the dual-edge serial data signal; the first input end of the falling edge trigger 1012 inputs a dual-edge serial data signal, the second input end inputs a serial clock signal, and the output end is connected to the serial-to-parallel conversion module 102, and the falling edge trigger 1012 is used to perform falling edge sampling on the dual-edge serial data signal.
[0086] In this embodiment, rising edge sampling and falling edge sampling are performed respectively by a rising edge trigger and a falling edge trigger. Specifically, the first input end of the rising edge trigger inputs the dual-edge serial data signal di, and the second input end inputs the serial clock signal, and the rising edge trigger is used to perform rising edge sampling on the dual-edge serial data signal to obtain a rising edge sampling signal di_p; the first input end of the falling edge trigger inputs the dual-edge serial data signal di, and the second input end inputs the serial clock signal, and the falling edge trigger is used to perform falling edge sampling on the dual-edge serial data signal to obtain a falling edge sampling signal di_n.
[0087] For further information, see Figure 4 , Figure 4 The serial-to-parallel conversion module 102 of this embodiment includes a shift register unit 1021, a data selector unit 1022, an update register unit 1023 and a clock domain conversion register unit 1024 connected in sequence.
[0088] The shift register unit 1021 is used to shift the rising edge sampling signal and the falling edge sampling signal multiple times to obtain multiple shift data signals. In this embodiment, the shift register unit 1021 includes multiple shift registers (not shown in the drawings) connected in sequence, and the rising edge sampling signal and the falling edge sampling signal are shifted multiple times, that is, each time the sampling signal passes through a shift register, the signal is delayed by one clock cycle. Taking 1:10 serial-to-parallel conversion (that is, each 10-bit serial signal is a group of parallel signals) as an example, 10 shift registers are required, wherein five shift registers are connected to each other to shift the rising edge sampling signal to obtain five rising edge shift signals, and the five rising edge shift signals are each one clock cycle apart; the remaining five shift registers are connected to each other to shift the falling edge sampling signal to obtain five falling edge shift signals, and the five falling edge shift signals are each one clock cycle apart, thereby obtaining ten shift signals.
[0089] Furthermore, the data selector unit 1022 is connected to the control module 104 and is used to select the multiple shift data signals according to the selection signal from the control module 104 to obtain multiple selected data signals. The data selector unit 1022 of this example includes multiple data selectors. Taking the 1:10 serial-to-parallel conversion as an example, 10 data selectors are required. Specifically, Figure 4The shift register unit 1021 includes 10 shift registers connected in sequence (not shown in the drawings), assuming that they are named as the first shift register, the second shift register, ... the ninth shift register and the tenth shift register from top to bottom in the drawings, wherein the data input end of the fifth shift register is a rising edge sampling signal, the input end of the fourth shift register is the fifth shift register output signal, the input end of the third shift register is the fourth shift register output signal, the input end of the second shift register is the third shift register output signal, and the input end of the first shift register is the second shift register output signal, which is used to shift the rising edge sampling signal multiple times; the input end of the sixth shift register is a falling edge sampling signal, the input end of the seventh shift register is the sixth shift register output signal, the input end of the eighth shift register is the seventh shift register output signal, the input end of the ninth shift register is the eighth shift register output signal, and the input end of the tenth shift register is the ninth shift register output signal, which is used to shift the falling edge sampling signal multiple times; and the clock input ends of all the shift registers are connected to the serial clock signal eclk. Furthermore, the data selector unit 1022 of the present embodiment includes 10 data selectors, which are named as a first data selector, a second data selector, ..., a ninth data selector and a tenth data selector from top to bottom in the drawing.As shown in the figure, the first input end of the first data selector is connected to the output end of the first shift register, the first input end of the second data selector is connected to the output end of the second shift register, the first input end of the third data selector is connected to the output end of the third shift register, and so on, the first input end of the tenth data selector is connected to the output end of the tenth shift register; in addition, the second input end of the first data selector is connected to the output end of the tenth shift register, the second input end of the second data selector is connected to the output end of the ninth shift register, the second input end of the third data selector is connected to the output end of the eighth shift register, the second input end of the fourth data selector is connected to the output end of the seventh shift register, the second input end of the fifth data selector is connected to the output end of the sixth shift register, and the second input end of the sixth data selector is connected to the output end of the eighth shift register. The second input end is connected to the output end of the rising edge sampling signal, the second input end of the seventh data selector is connected to the output end of the fifth shift register, the second input end of the eighth data selector is connected to the output end of the fourth shift register, the second input end of the ninth data selector is connected to the output end of the third shift register, and the second input end of the tenth data selector is connected to the output end of the second shift register; the control signal input ends of all data selectors are connected to the selection signal output end of the control module 104, which is used to receive the selection signal sel from the control module 104. When the selection signal sel is at a high level, each data selector outputs the data signal input from the second input end, and when the selection signal sel is at a low level, each data selector outputs the data signal input from the first input end, thereby realizing the selected output of the signal.
[0090] The update register unit 1023 is connected to the control module 104 and is used to sample and update the multiple selection data signals according to the update signal from the control module 104 to obtain multiple update data signals.
[0091] The parallel data signals can be updated at the same time by the update signal update from the control module 104 and transmitted to the clock domain conversion register unit 1024. Specifically, when the update signal update is at a high level and at the rising edge of the clock, the multiple data from the data selector unit 1022 are sampled.
[0092] The clock domain conversion register unit 1024 is connected to the control module 104, and is used to sample the multiple update data signals according to the divided clock signal sclk and transmit them as parallel data signals to the comparison module 104 or output them. Specifically, the divided clock signal sclk is a divided clock of the serial clock signal eclk. For example, if a 1:4 serial-to-parallel conversion is implemented, a 2-division frequency is required, a 1:8 conversion is implemented by a 4-division frequency, and a 1:10 conversion is implemented by a 5-division frequency. eclk is the clock required for serial data, and sclk is the clock required for parallel data.
[0093] Further, the comparison module 103 compares whether the parallel data signal output by the clock domain conversion register unit 1024 is the same as the pre-set word synchronization character. If so, it means that the current parallel data signal is correct, and the current parallel data signal is transmitted to the subsequent circuit; if not, the comparison module 103 sends a word synchronization control signal to the control module 104, and the control module 104 generates a selection signal and an update signal according to the word synchronization control signal, controls the current parallel data signal to shift right by at least one bit, and moves at least one lowest bit of the next group of parallel data signals to at least one highest bit of the current parallel data signal, so as to form the next group of parallel data signal word synchronization characters.
[0094] Specifically, if the current parallel data signal is inconsistent with the word synchronization character, the comparison module 103 sends a word synchronization control signal slip pulse to the control module 104, and the control module 104 generates a selection signal sel and an update signal update according to the slip pulse, controls the current parallel data signal to shift right by at least one bit, and moves at least one lowest bit of the next group of parallel data to at least one highest bit of the current parallel data, to form a second parallel data signal and output it; the comparison module 103 continues to compare whether the second parallel data signal is consistent with the word synchronization character, and repeats the above steps until the obtained parallel data signal is consistent with the word synchronization character.
[0095] According to different serial-to-parallel conversion modes, this embodiment is divided into two ways to achieve word synchronization:
[0096] For 1:4, 1:8, and 1:10 modes: Each time a slip pulse is encountered, the output parallel data is shifted right by one bit, and the lowest bit of the next set of data is moved to the highest bit of the current data. For details, see Figure 5 , Figure 5 is a schematic diagram of the parallel data shifting process when an odd number of slip pulses are encountered in the 1:10 mode provided by an embodiment of the present invention. Taking the 1:10 mode as an example, the following is a specific implementation method: when an odd number of slip pulses are encountered, the sel signal is pulled high, the output parallel data is shifted right by one bit, and the lowest bit of the next group of data is shifted to the highest bit of the current data; please refer to Figure 6 , Figure 6 This is a schematic diagram of the parallel data shifting process when an even number of slip pulses is encountered in the 1:10 mode provided by an embodiment of the present invention. When an even number of slip pulses is encountered, the sel signal is 0, and the counter controlling the update signal stops counting one clock cycle, then the update signal is updated one clock cycle later, and the shift register does not stop, so there will be two bits of data overflow, and at the same time, the lower two bits of the next group of data will be filled in. Since the sel signal is 0, it is equivalent to shifting one bit to the right compared to the odd number of slip pulses.
[0097] For 1:7 mode: each time a slip pulse is encountered, the output parallel data is shifted right by two bits, and the lower two bits of the next set of data are moved to the upper two bits of the current data. Each time a slip pulse is encountered, the counter controlling the update signal will stop counting for one clock cycle, so the update signal will be updated one clock cycle later, and the shift register will not stop, so two bits of data will overflow, and the lower two bits of the next set of data will be filled in.
[0098] Next, taking the 1:7 mode as an example, the serial-to-parallel conversion method of this embodiment is compared with the serial-to-parallel conversion method of the prior art. Please refer to Table 1 and Table 2. Table 1 is a list of parallel data cycle numbers for word synchronization achieved in the existing 1:7 mode, and Table 2 is a list of parallel data cycle numbers for word synchronization achieved in the 1:7 mode of the embodiment of the present invention. By comparing Table 1 and Table 2, it can be seen that for the serial-to-parallel conversion method of the prior art, a maximum of 9 slip operations are required when implementing 1:7, while the embodiment of the present invention only requires a maximum of 7 slip operations at 1:7, which shows that the circuit and method of the embodiment of the present invention can save serial-to-parallel conversion time and improve serial-to-parallel conversion efficiency.
[0099] Table 1 List of the number of parallel data cycles for word synchronization in the existing 1:7 mode
[0100] Operations performed by slip Output Mode (1:7) initial [6][5][4][3][2][1][0] 1 [0][6][5][4][3][2][1] 2 [4][3][2][1][0][6][5] 3 [5][4][3][2][1][0][6] 4 [2][1][0][6][5][4][3] 5 [3][2][1][0][6][5][4] 6 [0][6][5][4][3][2][1] 7 [1][0][6][5][4][3][2] 8 [5][4][3][2][1][0][6] 9 [6][5][4][3][2][1][0]
[0101] Table 2 List of parallel data cycles for word synchronization in Embodiment 1:7 mode of the present invention
[0102] Operations performed by slip Output Mode (1:7) initial [6][5][4][3][2][1][0] 1 [1][0][6][5][4][3][2] 2 [3][2][1][0][6][5][4] 3 [5][4][3][2][1][0][6] 4 [0][6][5][4][3][2][1] 5 [2][1][0][6][5][4][3] 6 [4][3][2][1][0][6][5] 7 [6][5][4][3][2][1][0]
[0103] In summary, the high-speed serial-to-parallel conversion interface word synchronization method and circuit for FPGA chips of this embodiment can obtain accurately aligned parallel data after fewer slip operations during the serial-to-parallel conversion process, thereby improving the word synchronization efficiency. The high-speed serial-to-parallel conversion interface word synchronization method for FPGA chips of this embodiment can be implemented simultaneously during the serial-to-parallel conversion process, does not require a special module to achieve word synchronization, has a simple circuit structure, and can improve the word synchronization efficiency.
[0104] The above contents are further detailed descriptions of the present invention in combination with specific preferred embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, several simple deductions or substitutions can be made without departing from the concept of the present invention, which should be regarded as falling within the protection scope of the present invention.
Claims
1. A high-speed serial-to-parallel conversion interface word synchronization method for FPGA chip, characterized in that: include: S1: Convert the received serial data signal into a parallel data signal using a serial-to-parallel conversion module; S2: Compare the parallel data signal with a preset word synchronization character to obtain a word synchronization control signal; The S2 includes: Comparing whether the parallel data signal is the same as the preset word synchronization character, if yes, the word synchronization control signal is always at a low level; if no, the word synchronization control signal is pulled high for one clock cycle; S3: Repeating the word synchronization operation in the serial-to-parallel conversion process according to the word synchronization control signal until the parallel data signal is consistent with a preset word synchronization character; The S3 includes: If the parallel data signal is consistent with the word synchronization character, the current parallel data signal is used as the final parallel data signal and output; if the parallel data signal is inconsistent with the word synchronization character, a selection signal and an update signal are generated according to the word synchronization control signal, and another group of parallel data signals of the serial data signal are obtained in response to the selection signal and the update signal, and steps S2 and S3 are repeated; The S3 further includes: If the parallel data signal is inconsistent with the word synchronization character, the word synchronization control signal is sent from the comparison module to the control module, and the control module generates a selection signal and an update signal according to the word synchronization control signal, controls the current parallel data signal to shift right by at least one bit, and moves at least one lowest bit of the next group of parallel data to at least one highest bit of the current parallel data, so as to form a second parallel data signal and output it; compares whether the second parallel data signal is consistent with the word synchronization character, and repeats steps S2 and S3 until the obtained parallel data signal is consistent with the word synchronization character; S4: Obtain the correct boundary of the serial data signal, and output the parallel data signal after completing word synchronization.
2. The high-speed serial-to-parallel conversion interface word synchronization method for FPGA chip according to claim 1, characterized in that: The S1 includes: S11: pre-set and store word synchronization characters; S12: inputting a dual-edge serial data signal and performing rising edge sampling and falling edge sampling on the dual-edge serial data signal to obtain a rising edge sampling signal and a falling edge sampling signal; S13: Perform serial-to-parallel conversion on the rising edge sampling signal and the falling edge sampling signal simultaneously to obtain a group of parallel data signals.
3. The high-speed serial-to-parallel conversion interface word synchronization method for FPGA chip according to claim 2, characterized in that: The S13 includes: S131: Shifting the rising edge sampling signal and the falling edge sampling signal multiple times using multiple shift registers to obtain multiple shift data signals; S132: In response to the selection signal, using a plurality of data selectors to select the plurality of shifted data to obtain a plurality of selection data signals; S133: In response to the update signal, sampling and updating the plurality of selected data signals and acquiring a plurality of updated data signals; S134: In response to the clock conversion signal, transmit the plurality of update data signals as a group of parallel data signals to the comparison module.
4. A high-speed serial-to-parallel conversion interface word synchronization circuit for an FPGA chip, used to execute the method according to any one of claims 1 to 3, characterized in that: The circuit comprises a sampling module (101), a serial-to-parallel conversion module (102), a comparison module (103) and a control module (104), wherein: The sampling module (101) is used to perform rising edge sampling and falling edge sampling on the received dual-edge serial data signal to obtain a rising edge sampling signal and a falling edge sampling signal; The serial-to-parallel conversion module (102) is connected to the sampling module (101) and the control module (104), and is used to perform serial-to-parallel conversion on the rising edge sampling signal and the falling edge sampling signal to obtain a parallel data signal, and to perform a word synchronization process in the serial-to-parallel conversion according to the control signal generated by the control module (104); The comparison module (103) is connected to the serial-to-parallel conversion module (102) and is used to compare whether the parallel data signal is consistent with a preset word synchronization character, and generate a word synchronization control signal according to the comparison result; The control module (104) is used to generate a selection signal and an update signal according to the word synchronization control signal, and control the serial-to-parallel conversion module (102) to finally output a parallel data signal consistent with the word synchronization character in a parallel data signal shifting manner.
5. The high-speed serial-to-parallel conversion interface word synchronization circuit for FPGA chip according to claim 4, characterized in that: The sampling module (101) comprises a rising edge trigger (1011) and a falling edge trigger (1012), wherein the first input end of the rising edge trigger (1011) inputs the dual-edge serial data signal, the second input end inputs the serial clock signal, and the output end is connected to the serial-to-parallel conversion module (102), and the rising edge trigger (1011) is used to perform rising edge sampling on the dual-edge serial data signal; The first input end of the falling edge trigger (1012) inputs the dual-edge serial data signal, the second input end inputs the serial clock signal, and the output end is connected to the serial-to-parallel conversion module (102). The falling edge trigger (1012) is used to perform falling edge sampling on the dual-edge serial data signal.
6. The high-speed serial-to-parallel conversion interface word synchronization circuit for FPGA chip according to claim 5, characterized in that: The serial-to-parallel conversion module (102) comprises a shift register unit (1021), a data selector unit (1022), an update register unit (1023) and a clock domain conversion register unit (1024) which are connected in sequence, wherein: The shift register unit (1021) is used to perform multiple shifts on the rising edge sampling signal and the falling edge sampling signal respectively to obtain multiple shifted data signals; The data selector unit (1022) is connected to the control module (104) and is used to select the multiple shift data signals according to the selection signal from the control module (104) to obtain multiple selection data signals; The update register unit (1023) is connected to the control module (104) and is used to sample and update the multiple selected data signals according to the update signal from the control module (104) to obtain multiple update data signals; The clock domain conversion register unit (1024) is connected to the control module (104) and is used to transmit the multiple update data signals as parallel data signals to the comparison module (103) or output them according to the divided clock signal.
7. The high-speed serial-to-parallel conversion interface word synchronization circuit for FPGA chip according to any one of claims 4 to 6, characterized in that: When the parallel data signal is inconsistent with the word synchronization character, the comparison module (103) sends a word synchronization control signal to the control module (104), and the control module (104) generates a selection signal and an update signal according to the word synchronization control signal, controls the current parallel data signal to shift right by at least one bit, and moves at least one lowest bit of the next group of parallel data signals to at least one highest bit of the current parallel data signal, so as to form the next group of parallel data signals.
Citation Information
Patent Citations
High-speed serial-parallel conversion interface word synchronization circuit for FPGA chip
CN211046907U
