A method, device, FPGA and storage medium for accessing a daughter card
By dynamically selecting LVDS channels from logic slots in the FPGA and using a health scoring mechanism, the problems of high FPGA logic resource consumption and the impact of daughter card failures are solved, achieving higher scalability and reliability.
Patent Information
- Application Number
- CN202611042778.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-14
- Publication Date
- 2026-11-20
- Estimated Expiration
- 2046-07-14
AI Technical Summary
Multiple controllers in an FPGA consume a lot of logic resources, resulting in poor scalability, and daughter card failures may cause abnormal loops on the main control board.
By dynamically selecting LVDS channels through logic slots in the FPGA, access to different daughter cards can be achieved, avoiding the need to configure the registers and controllers corresponding to each daughter card separately. Resource utilization is optimized by using health scoring and exponential backoff retransmission mechanisms.
It saves FPGA logic resources, improves scalability, and avoids affecting access to other daughter cards when a daughter card fails, thus improving the reliability and stability of the system.
Smart Images

Figure CN122547729B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a method, apparatus, FPGA, and storage medium for accessing a daughter card. Background Technology
[0002] Low-Voltage Differential Signaling (LVDS) is a high-speed, low-power differential serial communication technology. It transmits signals via differential lines, using the voltage difference between the two transmission lines to characterize the logic state. It offers excellent anti-interference capabilities and is suitable for short-distance, high-speed data transmission.
[0003] In traditional master-controller multi-daughter-card solutions, the Central Processing Unit (CPU) acts as the master control board and can connect to multiple daughter cards. However, the number of CPU interfaces is limited. Therefore, the CPU can be connected to a Field-Programmable Gate Array (FPGA). Multiple independent LVDS controllers are instantiated within the FPGA, with each controller connecting to one daughter card. In this way, the CPU can connect to the transmit and receive channels of each daughter card through the FPGA. Furthermore, each controller is equipped with dedicated registers and data buffers to implement data transmission and reception between the CPU and the daughter cards.
[0004] However, the multiple control areas in an FPGA require a large amount of FPGA logic resources, and the required register resources increase linearly with the number of daughter cards to be connected, resulting in significant resource consumption and severely limiting scalability. Summary of the Invention
[0005] The purpose of this application is to provide a method, apparatus, FPGA, and storage medium for accessing a daughter card, in order to solve the problem of high FPGA logic resource consumption leading to poor scalability. The specific technical solution is as follows:
[0006] In a first aspect, embodiments of this application provide a method for accessing a daughter card, the method being applied to an FPGA, the FPGA connecting multiple daughter cards, the FPGA including a logic slot corresponding to each daughter card; the method includes:
[0007] Receive an access request sent by the main control CPU, the access request including the specified logical slot number corresponding to the specified sub-card that the main control CPU requests to access;
[0008] A first LVDS differential signal is generated based on the access request;
[0009] Enable the transmit logical slot indicated by the specified logical slot number;
[0010] The first LVDS differential signal is sent to the designated sub-card through the transmit logic slot.
[0011] In one possible implementation, after transmitting the first LVDS differential signal to the designated daughter card via the transmit logic slot, the method further includes:
[0012] Sample the second LVDS differential signal returned by the designated sub-card;
[0013] The second LVDS differential signal is decoded and verified;
[0014] After successful verification, the main control CPU is notified that the access request has been completed.
[0015] In one possible implementation, the decoding and verification of the second LVDS differential signal includes:
[0016] Detect whether a preset number of consecutive bytes in the serial data stream included in the second LVDS differential signal are not all 0s or not all 1s;
[0017] If not, return to the step of detecting whether a preset number of consecutive bytes in the serial data stream included in the second LVDS differential signal are not all 0s or not all 1s, until the detection results of a preset number of consecutive times are all negative, then determine that the LVDS channel between the card and the specified sub-card is faulty.
[0018] If a preset number of consecutive bytes are detected to be either not all 0s or not all 1s, then byte alignment detection is performed on the serial data stream included in the second LVDS differential signal.
[0019] If the byte alignment check passes, the serial data stream is then decoded and subjected to CRC verification.
[0020] If the CRC check passes, then the verification of the second LVDS differential signal is successful.
[0021] In one possible implementation, the access request further includes a read / write type, wherein if the read / write type is a read type, the second LVDS differential signal carries the read data;
[0022] After receiving the access request sent by the main control CPU, the method further includes:
[0023] Enable the receive logical slot indicated by the specified logical slot number so that the main control CPU can obtain the read data through the receive logical slot.
[0024] In one possible implementation, before transmitting the first LVDS differential signal to the designated daughter card via the transmit logic slot, the method further includes:
[0025] Obtain the health score of the LVDS channel between the FPGA and the designated daughter card;
[0026] If the health score is greater than or equal to a preset threshold, the first LVDS differential signal is sent to the designated sub-card through the transmission logic slot;
[0027] If the health score is less than a preset threshold, then the health range to which the health score belongs is determined, and the first LVDS differential signal is sent to the designated sub-card according to the sending strategy corresponding to the health range.
[0028] In one possible implementation, the health interval includes a first interval, a second interval, and a third interval, wherein the health scores of the first interval, the second interval, and the third interval decrease sequentially.
[0029] The sending strategy corresponding to the first interval is to limit the maximum bandwidth to a first proportion of the theoretical value of the maximum bandwidth, reduce the burst value by half, and only guarantee the transmission of messages from the highest priority queue and the second highest priority queue.
[0030] The sending strategy corresponding to the second interval is to limit the maximum bandwidth to a second proportion of the theoretical value of the maximum bandwidth, prohibit bursts, and only guarantee the sending of messages from the highest priority queue. The second proportion is less than the first proportion.
[0031] The sending strategy corresponding to the third interval is to limit the maximum bandwidth to a third proportion of the theoretical maximum bandwidth value, prohibit bursts, and only guarantee the sending of heartbeat messages. The third proportion is less than the second proportion.
[0032] In one possible implementation, the method further includes:
[0033] Link layer detection is performed on the information transmission between the FPGA and the designated sub-card to obtain the CRC error rate;
[0034] The protocol layer detection is performed on the information transmission between the FPGA and the designated sub-card to obtain the timeout detection result;
[0035] The information transmission between the FPGA and the designated daughter card is detected at the application layer to obtain the heartbeat success rate, latency jitter value and throughput achievement rate.
[0036] Get the send queue occupancy rate and buffer overflow count within a specified time period;
[0037] Based on at least two of the following: the CRC error rate, the timeout detection result, the heartbeat success rate, the latency jitter value, the throughput achievement rate, the transmit queue occupancy rate, and the number of buffer overflows, calculate and update the health score of the LVDS channel between the FPGA and the designated sub-card.
[0038] In one possible implementation, after transmitting the first LVDS differential signal to the designated daughter card via the transmit logic slot, the method further includes:
[0039] If the second LVDS differential signal is not received from the designated sub-card within a preset time period, the first LVDS differential signal is retransmitted through an exponential backoff retransmission mechanism.
[0040] If the number of times the first LVDS differential signal is retransmitted reaches a preset number, and the second LVDS differential signal is still not received within the preset time period, then a permanent protocol layer fault is determined to have occurred, and the transmit logical slot and receive logical slot indicated by the specified logical slot number are disabled.
[0041] Secondly, embodiments of this application provide an apparatus for accessing a daughter card, the apparatus being applied to an FPGA, the FPGA connecting multiple daughter cards, the FPGA including a logic slot corresponding to each daughter card; the apparatus includes:
[0042] The receiving module is used to receive an access request sent by the main control CPU, wherein the access request includes the specified logical slot number corresponding to the specified sub-card requested by the main control CPU;
[0043] The generation module is used to generate a first LVDS differential signal based on the access request;
[0044] The enabling module is used to enable the transmission logical slot indicated by the specified logical slot number;
[0045] The transmitting module is used to transmit the first LVDS differential signal to the designated sub-card through the transmitting logic slot.
[0046] In one possible implementation, the device further includes:
[0047] The sampling module is used to sample the second LVDS differential signal returned by the designated sub-card;
[0048] The verification module is used to decode and verify the second LVDS differential signal;
[0049] The notification module is used to notify the main control CPU that the access request has been completed after the verification module has successfully verified the access.
[0050] In one possible implementation, the verification module is used for:
[0051] Detect whether a preset number of consecutive bytes in the serial data stream included in the second LVDS differential signal are not all 0s or not all 1s;
[0052] If not, return to the step of detecting whether a preset number of consecutive bytes in the serial data stream included in the second LVDS differential signal are not all 0s or not all 1s, until the detection results of a preset number of consecutive times are all negative, then determine that the LVDS channel between the card and the specified sub-card is faulty.
[0053] If a preset number of consecutive bytes are detected to be either not all 0s or not all 1s, then byte alignment detection is performed on the serial data stream included in the second LVDS differential signal.
[0054] If the byte alignment check passes, the serial data stream is then decoded and subjected to CRC verification.
[0055] If the CRC check passes, then the verification of the second LVDS differential signal is successful.
[0056] In one possible implementation, the access request further includes a read / write type, wherein if the read / write type is a read type, the second LVDS differential signal carries the read data;
[0057] The enabling module is further configured to enable the receiving logical slot indicated by the specified logical slot number, so that the main control CPU can obtain the read data through the receiving logical slot.
[0058] In one possible implementation, the device further includes an acquisition module;
[0059] The acquisition module is used to acquire the health score of the LVDS channel between the FPGA and the designated daughter card;
[0060] The sending module is further configured to send the first LVDS differential signal to the designated sub-card through the sending logic slot if the health score is greater than or equal to a preset threshold.
[0061] The sending module is further configured to, if the health score is less than a preset threshold, determine the health range to which the health score belongs, and send the first LVDS differential signal to the designated sub-card according to the sending strategy corresponding to the health range.
[0062] In one possible implementation, the health interval includes a first interval, a second interval, and a third interval, wherein the health scores of the first interval, the second interval, and the third interval decrease sequentially.
[0063] The sending strategy corresponding to the first interval is to limit the maximum bandwidth to a first proportion of the theoretical value of the maximum bandwidth, reduce the burst value by half, and only guarantee the transmission of messages from the highest priority queue and the second highest priority queue.
[0064] The sending strategy corresponding to the second interval is to limit the maximum bandwidth to a second proportion of the theoretical value of the maximum bandwidth, prohibit bursts, and only guarantee the sending of messages from the highest priority queue. The second proportion is less than the first proportion.
[0065] The sending strategy corresponding to the third interval is to limit the maximum bandwidth to a third proportion of the theoretical maximum bandwidth value, prohibit bursts, and only guarantee the sending of heartbeat messages. The third proportion is less than the second proportion.
[0066] In one possible implementation, the device further includes:
[0067] The detection module is used to perform link layer detection on the information transmission between the FPGA and the designated sub-card to obtain the CRC error rate; perform protocol layer detection on the information transmission between the FPGA and the designated sub-card to obtain the timeout detection result; perform application layer detection on the information transmission between the FPGA and the designated sub-card to obtain the heartbeat success rate, latency jitter value and throughput achievement rate; and obtain the sending queue occupancy rate and buffer overflow count within a specified time period.
[0068] The update module is used to calculate and update the health score of the LVDS channel between the FPGA and the designated sub-card based on at least two of the following: the CRC error rate, the timeout detection result, the heartbeat success rate, the latency jitter value, the throughput achievement rate, the transmission queue occupancy rate, and the number of buffer overflows.
[0069] In one possible implementation, the device further includes a disabling module;
[0070] The transmitting module is further configured to retransmit the first LVDS differential signal through an exponential backoff retransmission mechanism if the receiving module does not receive the second LVDS differential signal from the designated sub-card within a preset time period.
[0071] The disable module is configured to determine that a permanent protocol layer fault has occurred if the number of times the first LVDS differential signal is retransmitted reaches a preset number and the second LVDS differential signal is still not received within the preset time period, and then disable the transmit logical slot and receive logical slot indicated by the specified logical slot number.
[0072] Thirdly, embodiments of this application provide an FPGA, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0073] Memory, used to store computer programs;
[0074] When a processor executes a program stored in memory, it implements the method described in the first aspect above.
[0075] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the method described in the first aspect above.
[0076] Fifthly, embodiments of this application also provide a computer program product containing instructions that, when run on a computer, cause the computer to perform the method described in the first aspect above.
[0077] Using the above technical solution, after the FPGA receives the access request sent by the main control CPU, it can open the transmit logic slot indicated by the specified logic slot number, and then send the first LVDS differential signal to the specified daughter card through the transmit logic slot. That is, the FPGA can dynamically select the LVDS channel corresponding to the daughter card to be accessed based on the specified logic slot number. In this way, access to different daughter cards can be realized through a set of control logic in the FPGA, without the need to configure the registers and controllers corresponding to each daughter card separately, which can save FPGA logic resources and improve scalability.
[0078] Of course, implementing any product or method of this application does not necessarily require achieving all of the advantages described above at the same time. Attached Figure Description
[0079] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other embodiments can be obtained based on these drawings.
[0080] Figure 1 This is a schematic diagram of an FPGA architecture in the prior art;
[0081] Figure 2 A flowchart illustrating a method for accessing a sub-card provided in an embodiment of this application;
[0082] Figure 3 A flowchart illustrating another method for accessing a sub-card provided in an embodiment of this application;
[0083] Figure 4 A flowchart illustrating a method for sending data from an FPGA to a daughter card, as provided in an embodiment of this application;
[0084] Figure 5 A flowchart illustrating a method for receiving data transmitted by an FPGA daughter card, as provided in an embodiment of this application;
[0085] Figure 6 A schematic diagram of an FPGA architecture provided in an embodiment of this application;
[0086] Figure 7 A schematic diagram of a device for accessing a sub-card provided in an embodiment of this application;
[0087] Figure 8 This is a schematic diagram of an FPGA structure provided in an embodiment of this application. Detailed Implementation
[0088] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art based on this application are within the scope of protection of this application.
[0089] In existing technologies, taking a dual-main-controller CPU + FPGA architecture as an example, such as... Figure 1 As shown, one CPU serves as the primary control board, and the other as the backup control board. Each CPU is connected to the FPGA via a low pin count (LPC) bus. Each FPGA includes N registers and N controllers, for example... Figure 1 The registers are A, B, ..., N, and the controllers are A, B, ..., N. Register A is a dedicated register for controller A, register B is a dedicated register for controller B, and so on.
[0090] Each controller connects to one sub-card, and there are receive and transmit channels between the controller and the sub-card. For example, controller A connects to sub-card 1, and the receive channel between controller A and sub-card 1 is LVDS_RX1 (referred to as receive channel 1), and the transmit channel is LVDS_TX1 (referred to as transmit channel 1); controller B connects to sub-card 2, and the receive channel between controller B and sub-card 2 is LVDS_RX2 (referred to as receive channel 2), and the transmit channel is LVDS_TX2 (referred to as transmit channel 2); controller N connects to sub-card N, and the receive channel between controller N and sub-card N is LVDS_RXN (referred to as receive channel N), and the transmit channel is LVDS_TXN (referred to as transmit channel N). In this embodiment, the sub-card can be a Complex Programmable Logic Device (CPLD).
[0091] exist Figure 1 In such scenarios, if it is necessary to expand the number of daughter cards, it will be necessary to further add registers and controllers to the FPGA, which consumes a lot of FPGA logic resources. Moreover, if a daughter card fails, it may incorrectly parse the idle code on the LVDS channel into a data frame header and frequently return LVDS response signals to the main control board. After the main control board continuously receives LVDS response signals, it will fall into an abnormal loop state, causing the main control board to also have abnormal access to the LVDS channels of other daughter cards.
[0092] To address the aforementioned issues, this application provides a method for accessing a daughter card. This method is applied to an FPGA, where multiple daughter cards are connected to the FPGA. The FPGA includes logic slots corresponding to each daughter card. Figure 2 As shown, the method includes:
[0093] S201. Receive an access request sent by the main control CPU. The access request includes the specified logical slot number corresponding to the specified sub-card that the main control CPU requests to access.
[0094] S202. Generate the first LVDS differential signal based on the access request;
[0095] S203. Enable the sending logical slot indicated by the specified logical slot number;
[0096] S204. Send the first LVDS differential signal to the designated sub-card through the sending logic slot.
[0097] Using this method, after receiving an access request from the main control CPU, the FPGA can open the transmit logic slot indicated by the specified logic slot number, and then send the first LVDS differential signal to the specified daughter card through the transmit logic slot. That is, the FPGA can dynamically select the LVDS channel corresponding to the daughter card to be accessed based on the specified logic slot number. In this way, access to different daughter cards can be realized through a set of control logic in the FPGA, without the need to configure the registers and controllers corresponding to each daughter card separately, which can save FPGA logic resources and improve scalability.
[0098] In the above S201, the access request also includes the data address to be accessed and the read / write type. The read / write type is either a write operation type or a read operation type. If the read / write type is a write operation type, the access request also includes the data to be written.
[0099] In S202 above, the FPGA encapsulates the access request into a command frame, then adds a start character to the command frame, performs Cyclic Redundancy Check (CRC) and 8B / 10B encoding to form a stable serial data stream, and then converts the encoded serial data stream into a first LVDS differential signal.
[0100] It should be noted that the execution order of S202 and S203 is not limited in this embodiment; they can be executed in parallel or sequentially. Figure 1 Taking the execution of S202 as an example, China and Israel will execute it first.
[0101] Regarding S204 above, in this embodiment, each daughter card corresponds to a logical slot number, which indicates the transmit and receive logical slots corresponding to a daughter card. The switching of each transmit logical slot is controlled by a switch control register (Tx_CTRL), and the switching of each receive logical slot is controlled by an enable register (Rx_EN). For example, assuming the FPGA connects to 5 daughter cards, where only the transmit logical slot corresponding to the first daughter card is open, and the receive logical slots corresponding to all other daughter cards are closed, then the value of the enable register is 10000, and the value of the receive logical slot is 00000. If it is necessary to close the transmit logical slot corresponding to the first daughter card, the value of the enable register is changed to 00000.
[0102] Since the specified logical slot number is the logical slot number corresponding to the specified sub-card, the first LVDS differential signal can be sent to the LVDS channel of the specified sub-card through the transmit logical slot indicated by the specified logical slot number, so that the first LVDS differential signal is transmitted to the specified sub-card through the LVDS channel.
[0103] In some embodiments of this application, such as Figure 3As shown, after sending the first LVDS differential signal to the designated daughter card via the transmission logic slot in S204 above, the method further includes:
[0104] S301, Sample the second LVDS differential signal returned by the specified sub-card.
[0105] S302. Decode and verify the second LVDS differential signal.
[0106] S303. After successful verification, notify the main control CPU that the access request has been completed.
[0107] Using this method, after receiving the second LVDS differential signal from the designated daughter card and completing the decoding and verification, the main control CPU can be notified that the access request has been completed, thus realizing communication between the designated daughter card and the main control CPU. There is no need to configure the registers and controllers corresponding to each daughter card separately, which can save FPGA logic resources and improve scalability.
[0108] In S301 above, the second LVDS differential signal can be sampled through the physical layer.
[0109] In the above S302, the second LVDS differential signal can be physically verified by the physical layer, and then the second LVDS differential signal can be processed by 8B / 10B decoding, and then CRC verification can be performed by the link layer.
[0110] In S303 above, if the verification in S302 above is successful, the FPGA notifies the main control CPU that the access request has been completed.
[0111] In some embodiments of this application, the above-mentioned S302, decoding and verifying the second LVDS differential signal, can be specifically implemented as follows:
[0112] Detect whether a preset number of consecutive bytes in the serial data stream included in the second LVDS differential signal are not all 0s or not all 1s; if not, return to the step of detecting whether a preset number of consecutive bytes in the serial data stream included in the second LVDS differential signal are not all 0s or not all 1s, until the detection result of a preset number of consecutive times is not, then determine that the LVDS channel between the card and the specified sub-card is faulty.
[0113] If a preset number of consecutive bytes are detected to be either not all 0s or not all 1s, then byte alignment detection is performed on the serial data stream included in the second LVDS differential signal; if the byte alignment detection passes, then the serial data stream is decoded and CRC checked; if the CRC check passes, then the second LVDS differential signal is confirmed to have been successfully checked.
[0114] This method detects link functionality by checking if a preset number of consecutive bytes are not all 0s or all 1s. If they are, it indicates a transition between 0s and 1s, meaning the link is normal, and byte alignment detection can continue. If a detection method only determines link functionality by detecting two frames of idle (IDLE) codes, the detection condition is too stringent and may misclassify a normal link as a fault. This embodiment changes the detection method to checking if a preset number of consecutive bytes are not all 0s or all 1s, improving the training success rate. Experiments show that the training success rate can be increased from 80% to 99%.
[0115] As an example, the preset number can be 20. That is, if 20 consecutive bytes are not all 0s or all 1s, a 0-1 transition is confirmed, thus indicating a normal link. The preset number of iterations can be 3. If the first check is negative, a second check can be performed. If the check is still negative, a third check is performed. If the check is still negative, a link fault is confirmed, indicating a fault in the LVDS channel between the FPGA and the designated daughter card. If any intermediate check is positive, byte alignment detection can begin.
[0116] The methods of byte alignment detection, decoding, and CRC verification are standard processing methods at the physical layer and link layer, and this application does not limit them.
[0117] In some embodiments of this application, the access request also includes a read / write type, wherein when the read / write type is a read type, the second LVDS differential signal carries the read data;
[0118] After receiving the access request sent by the main control CPU in S201 above, the method further includes: opening the receiving logical slot indicated by the specified logical slot number, so that the main control CPU can obtain the read data through the receiving logical slot.
[0119] Understandably, when the read / write type is read, after the FPGA notifies the main CPU that the access request has been completed, the main CPU can obtain the read data from the FPGA through the receive logic slot. That is, the main CPU can obtain the data read from each daughter card through the receive logic slot of each daughter card, without having to configure the corresponding registers and controllers of each daughter card separately, which can save FPGA logic resources and improve scalability.
[0120] In some embodiments of this application, before the above-described S204, which involves sending a first LVDS differential signal to a designated daughter card via a transmission logic slot, the method further includes:
[0121] Obtain the health score of the LVDS channel between the FPGA and the specified daughter card; if the health score is greater than or equal to a preset threshold, send the first LVDS differential signal to the specified daughter card through the sending logic slot; if the health score is less than the preset threshold, determine the health interval to which the health score belongs, and send the first LVDS differential signal to the specified daughter card according to the sending strategy corresponding to the health interval.
[0122] Using this method, if the health score is greater than or equal to a preset threshold, it indicates that the LVDS channel between the FPGA and the designated daughter card is in a relatively healthy state, and therefore the first LVDS differential signal can be transmitted normally. If the health score is less than the preset threshold, the first LVDS differential signal can be transmitted according to the transmission strategy corresponding to the health interval to which the health score belongs. This allows for different degrees of degraded transmission to attempt to mitigate and recover from faults in the LVDS channel, thereby improving reliability.
[0123] In some embodiments of this application, the health score range includes a first range, a second range, and a third range, with the health score decreasing sequentially in the first range, the second range, and the third range;
[0124] The sending strategy corresponding to the first interval is to limit the maximum bandwidth to a first proportion of the theoretical maximum bandwidth value, reduce the burst value by half, and only guarantee the transmission of messages in the highest priority queue and the second highest priority queue.
[0125] The sending strategy corresponding to the second interval is to limit the maximum bandwidth to a second proportion of the theoretical value of the maximum bandwidth, prohibit bursts, and only guarantee the sending of messages from the highest priority queue. The second proportion is less than the first proportion.
[0126] The sending strategy corresponding to the third interval is to limit the maximum bandwidth to a third proportion of the theoretical maximum bandwidth value, prohibit bursts, and prioritize the sending of heartbeat messages. The third proportion is less than the second proportion.
[0127] Using this method, the sending strategy can be determined according to the health range to which the current health score belongs. This can prioritize the sending of high-priority messages. When the health score is too low, only heartbeat messages can be sent, prioritizing the sending of heartbeat messages. Once the health score improves, the messages in the sending queue can be transmitted again, thus avoiding frequent message sending failures.
[0128] As an example, the first range can be 40-59 points, the second range can be 20-39 points, and the third range can be below 20 points, i.e. less than 20 points. The sending strategies corresponding to each health range are shown in Table 1.
[0129] Table 1
[0130] Among them, queue P0 refers to the highest priority sending queue, and queue P1 refers to the second highest priority sending queue.
[0131] In some embodiments of this application, the method further includes:
[0132] Perform link-layer detection on the information transmission between the FPGA and the designated daughter card to obtain the CRC error rate; perform protocol-layer detection on the information transmission between the FPGA and the designated daughter card to obtain the timeout detection result; perform application-layer detection on the information transmission between the FPGA and the designated daughter card to obtain the heartbeat success rate, latency jitter value, and throughput achievement rate; obtain the transmit queue occupancy rate and buffer overflow count within a specified time period; and calculate and update the health score of the LVDS channel between the FPGA and the designated daughter card based on at least two of the following: CRC error rate, timeout detection result, heartbeat success rate, latency jitter value, throughput achievement rate, transmit queue occupancy rate, and buffer overflow count.
[0133] Using this method, a health score can be calculated based on the detection results of the link layer, protocol layer, and application layer. This health score can accurately and comprehensively reflect the health of the LVDS channel between the FPGA and the specified daughter card, thereby enabling the subsequent transmission strategy to be accurately adjusted based on the health score, and achieving efficient fault isolation and automatic recovery.
[0134] Before the link layer detection, physical layer detection can also be performed. Physical layer detection includes clock and data recovery (CDR) status detection and byte alignment lock status detection.
[0135] Among them, CDR status detection refers to determining whether the CDR stably tracks the input data clock within a preset time by monitoring the output of the phase detector and the phase-locked loop locking signal. The specific judgment method is to perform phase error detection, locking signal verification and frequency offset detection, and then comprehensively determine the CDR locking result based on the results of these three detections.
[0136] Phase error monitoring: The error voltage output by the phase detector is sampled in real time, and the standard deviation of the sampled error voltage is calculated. If the error voltage fluctuation is less than ±5% of the peak-to-peak voltage (Vpp) within 100 consecutive unit intervals (UI) and there is no polarity jump, then the phase is determined to be stable.
[0137] Lock signal verification: Check the lock signal of the phase-locked loop. If the proportion of times the signal remains high within a 1μs observation window is >99.9% and the interval between unlock events is greater than 10ms, the lock is guaranteed to be persistent and reliable.
[0138] Frequency offset detection: The recovered clock is compared with the local reference clock by a digital frequency counter. If the offset between the two is less than ±100ppm for 10ms, the frequency offset is considered to be within the standard.
[0139] Then, a comprehensive judgment is made: if the three conditions of phase stability, valid LOCK signal and frequency offset meet the standard are met simultaneously for more than 10μs, then the CDR lock is determined to be completed; if any condition fails during operation for more than 1μs, a lockout alarm is triggered.
[0140] Byte alignment lock status detection refers to continuously detecting the K28.5 delimiter at the expected position. If the detection is correct N times in a row, it is determined to be byte alignment lock; otherwise, bitslip realignment is triggered.
[0141] Delimiter detection: Within the expected sampling window of 10 consecutive UIs, the synchronizer detects the K28.5 character (10'b0011111010 or 10'b1100000101). If it matches correctly at the same phase position 8 times consecutively, it is determined to be a byte boundary lock. The K28.5 character is a control character in the 8B / 10B encoding standard protocol.
[0142] Fault tolerance: Allows one K28.5 mismatch in every 1000 detections (counted as a soft error), but three consecutive mismatches will trigger the bitslip realignment process.
[0143] Lock maintenance: After locking, a verification check is performed every 1μs. If the number of mismatches is ≥2 within any 10μs window, the lock is considered lost and the Bitslip alignment process is restarted. The Bitslip realignment process can be found in the description in related technologies, and is not limited thereto in this embodiment.
[0144] Link layer detection refers to performing CRC check on the received frame. The hardware CRC engine calculates the 32-bit CRC value of the received frame in real time and compares it with the value of the CRC field carried in the data frame. If they match, the CRC check is considered successful; if they differ, an error counter is incremented by 1. The detection precision allows for CRC check on every received frame, with the latency introduced by the CRC check being less than 10ns.
[0145] The error rate of the most recent preset number of frames can be recorded by sliding a window to obtain the CRC error rate. For example, the CRC error rate of the most recent 10,000 frames can be recorded.
[0146] Furthermore, it can count the number of CRC check failures per unit time and determine whether the number exceeds the error threshold. If the error threshold is exceeded, an alarm can be triggered.
[0147] This application embodiment can set three error thresholds, namely, warning level threshold, degradation level threshold and fault level threshold.
[0148] The warning threshold is: 10 errors within 1 minute, in which case the bit error rate (BER) ≈ 1E-9.
[0149] The downgrade threshold is: 100 errors accumulated within 1 minute, in which case BER≈1E-8;
[0150] The fault level threshold is: 3 consecutive frames of CRC errors or more than 1,000 errors within 1 second.
[0151] Protocol layer detection refers to timeout detection of communication transactions. When each communication transaction starts, a timeout counter is started. If no valid response frame is received within a preset time window (e.g., 10ms), the timeout detection result is determined to be a timeout.
[0152] The communication transaction is initiated when the FPGA's main control logic successfully sends the last bit of the request frame (e.g., the first LVDS differential signal) and receives confirmation from the FPGA's physical layer that the transmission is complete.
[0153] Application layer detection includes heartbeat response statistics, latency jitter calculation, and throughput achievement rate calculation.
[0154] Among them, heartbeat response statistics refer to recording the response status of periodic heartbeat requests and calculating the response success rate within the most recent M periods as the heartbeat success rate. Latency jitter calculation refers to measuring the end-to-end latency of consecutive transactions and using the standard deviation, maximum value, or minimum value of the obtained end-to-end latency as the latency jitter value.
[0155] Throughput achievement rate refers to the percentage of valid data among all data transmitted between the FPGA and a daughter card.
[0156] The application layer can calculate a comprehensive score based on the detection results of the link layer, protocol layer, and application layer, thereby obtaining a health score, and cache the health score.
[0157] As an example, the health score can be calculated as a base score + weighted scores for each indicator - deductions for malfunctions. The normal range, weight, and scoring rules for each indicator are shown in Table 2.
[0158] Table 2
[0159] In some embodiments of this application, after the above-described S204, in which the first LVDS differential signal is sent to the designated daughter card via the transmission logic slot, the method further includes:
[0160] If the second LVDS differential signal is not received from the designated sub-card within a preset time period, the first LVDS differential signal is retransmitted through the exponential backoff retransmission mechanism. If the number of times the first LVDS differential signal is retransmitted reaches a preset number and the second LVDS differential signal is still not received within the preset time period, a permanent protocol layer fault is determined to have occurred, and the transmit and receive logical slots indicated by the specified logical slot number are disabled.
[0161] Using this method, if the number of times the first LVDS differential signal is retransmitted reaches a preset number, it indicates that the protocol layer transmission channel between the main control CPU and the specified sub-card is faulty. In this case, the specified logical slot is disabled, and thus the specified logical channel is disabled. This can prevent the failure of a sub-card or the failure of a sub-card's LVDS channel from affecting the main control CPU's access to other sub-cards.
[0162] The preset duration can be 10ms. If the second LVDS differential signal is not received from the designated sub-card within the preset duration, it indicates that the first LVDS differential signal transmission failed. When the access request is a read operation, the second LVDS differential signal can be a valid response frame carrying the read data; when the access request is a write operation, the second LVDS differential signal is a transmission completion confirmation frame.
[0163] The exponential backoff retransmission mechanism refers to a method of dynamically adjusting the retransmission waiting time when transmission fails. When the first transmission of the first LVDS differential signal fails, it can wait for a random time before retransmitting. If it fails again, the random waiting time is doubled, and then a random time is randomly selected from the doubled range. After waiting for the selected random time, it retransmits again. This process is repeated until the retransmission is successful or the preset number of retransmissions is reached. As an example, the preset number of retransmissions can be 3.
[0164] In conjunction with the above embodiments, the process of the FPGA sending data to the daughter card in this application embodiment is as follows: Figure 4 As shown, when data needs to be sent, the Layer 4 (L4) application layer determines whether the health score is greater than or equal to a preset threshold. If so, it sends data in normal mode; otherwise, it enters degraded mode. Degraded mode refers to selecting the sending strategy corresponding to the current health score for degraded sending based on the correspondence between the health score ranges and sending strategies in Table 1.
[0165] When it is determined that the data to be sent can be transmitted, the Layer 3 (L3) protocol layer encapsulates the data, and the Layer 2 (L2) link layer adds a CRC value to the encapsulated message. Then, according to the transmission strategy, it is sent to the daughter card through the Layer 1 (physical layer). After confirming successful transmission at the physical layer, the protocol layer starts a timer and waits for an acknowledgment (ACK) message from the daughter card. It then checks whether an ACK message from the daughter card is received before the timer expires. If an ACK message is received before the timer expires, normal transmission is considered complete; if no ACK message is received before the timer expires, the retransmission count is incremented by 1, and it is checked whether the consecutive retransmission count is greater than or equal to 3. If not, retransmission is performed through the L3 protocol layer, and the timer is restarted; if yes, the L2 link layer stops the transmission queue, i.e., stops transmitting messages in the transmission queue, and then the FPGA performs channel isolation, i.e., disables the transmit and receive logic slots between the FPGA and the daughter card.
[0166] In this embodiment of the application, a mask register (MASK_REG) corresponding to each logical slot is also provided. The result of the bitwise AND operation between the mask register and the enable register of the receiving logical slot represents the switch of each receiving logical slot, and the result of the bitwise AND operation between the mask register and the switch control register of the transmitting logical slot represents the switch of each transmitting logical slot.
[0167] For example, if the enable register value is 01000000 and the mask register value is 11111111, then the switch state of each receiving logic slot is 01000000 + 11111111 = 01000000.
[0168] When it's necessary to disable the transmit and receive logic slots corresponding to a daughter card, the corresponding position in the mask register for that daughter card can be set to 0. For example, if the value of the mask register is updated to 10111111, the on / off state of each receive logic slot will change to 00000000, thus disabling the receive logic slot corresponding to the second daughter card. In this way, LVDS differential signals between the daughter card and the host card can be isolated by setting the value of the mask register, eliminating the need to set controllers and registers for each daughter card. This reduces FPGA resource consumption, and by promptly disabling the logic slots corresponding to a daughter card with communication failure, normal communication with other daughter cards can still be maintained, avoiding system freezes caused by single points of failure.
[0169] The process of FPGA receiving data sent by the daughter card in this embodiment of the application is as follows: Figure 5 As shown, the L1 physical layer determines whether the phase is stable when sampling data.
[0170] If not, a lockout alarm is triggered, and clock retraining is performed. After the CDR clock is restored, the process returns to the step of determining whether the phase is stable.
[0171] If yes, check if 20 consecutive characters are not all 0s or all 1s. If yes, perform byte alignment check; if no, check if the number of consecutive checks has reached 3. If yes (reached 3 times), issue a link fault alarm; if no (not reached 3 times), return to the step of checking if 20 consecutive characters are not all 0s or all 1s.
[0172] During the byte alignment detection process, it is necessary to check whether there are 8 consecutive K28.5 matches.
[0173] If not, bitslip realignment is performed for resynchronization, i.e., byte synchronization is re-performed, and then byte alignment detection is performed again; if yes, 8B / 10B decoding is performed, and then CRC verification is performed by the L2 link layer to determine whether the CRC verification result is correct.
[0174] If so, it is determined that a valid data frame has been received. The L3 protocol layer then uses a timeout counter to determine whether the response has timed out. If it has timed out, a timeout alarm is triggered. If it has not timed out, it is determined that the response from the sub-card has been received normally.
[0175] If the CRC is incorrect, update the CRC error count and determine whether the CRC error count exceeds the error threshold. If it does, report a link failure; otherwise, continue to monitor the CRC error count when receiving subsequent data.
[0176] The following combination Figure 6 The method for accessing the sub-card provided in the embodiments of this application will be described, such as... Figure 6 As shown, the FPGA connects main control CPU1 and main control CPU2. Main control CPU1 is the primary main control board, and main control CPU2 is the backup main control board. The FPGA includes a primary / backup arbitration module, an LVDS bus module, an LVDS transmitting module, a physical layer transmitting module, an LVDS receiving module, a phase checking module, a physical layer receiving module, and a channel selection module.
[0177] The channel selection module can choose to enable or disable logical slots. Figure 6 Taking the connection of N daughter cards in an FPGA as an example, the FPGA includes N logic slots, namely slot 1, slot 2, ..., slot N. Each logic slot is further divided into a transmit logic slot and a receive logic slot.
[0178] When the master CPU1 sends an access request to the FPGA, assuming it requests access to daughter card 1, the access request carries the slot number of slot 1. If the master / backup arbitration module determines that the access request originates from the current master control board, it transmits the request to the LVDS bus module. The LVDS bus module encapsulates the access request into a command frame of a specific format. Then, the LVDS transmission module adds a start character, calculates the CRC, and performs 8B / 10B encoding on the command frame to form a stable serial data stream. The physical layer transmission module then converts this serial data stream into an LVDS differential signal. If the access request is a write request, the channel selection module opens the transmit logic slot in slot 1; if the access request is a read request, the channel selection module opens both the transmit and receive logic slots in slot 1. The LVDS differential signal can then be sent to daughter card 1 through the transmit logic slot in slot 1.
[0179] The subsequent physical layer receiving module of the FPGA can sample the LVDS differential signal returned by the daughter card. The phase checking module converts the serial data stream sampled by the physical layer receiving module into a parallel signature and performs phase alignment using BitSlip. Then, the LVDS receiving module searches the frame header, decodes the parallel signature in 8B / 10B format, and performs CRC verification. If the verification is successful, the LVDS bus module extracts the valid data and notifies the master control logic that the access request has been completed. If the daughter card's returned LVDS differential signal carries the read data, the master control CPU1 can obtain the read data through the receiving logic slot in slot 1.
[0180] Corresponding to the above method embodiments, this application also provides a device for accessing daughter cards. This device is applied to an FPGA, which connects to multiple daughter cards. The FPGA includes logic slots corresponding to each daughter card. Figure 7 As shown, the device includes:
[0181] The receiving module 701 is used to receive the access request sent by the main control CPU. The access request includes the specified logical slot number corresponding to the specified sub-card that the main control CPU requests to access.
[0182] Generation module 702 is used to generate a first LVDS differential signal based on the access request;
[0183] The enabling module 703 is used to enable the transmission logical slot indicated by the specified logical slot number;
[0184] The transmitting module 704 is used to transmit the first LVDS differential signal to a designated daughter card through the transmitting logic slot.
[0185] In some embodiments of this application, the device further includes:
[0186] The sampling module is used to sample the second LVDS differential signal returned by the specified sub-card;
[0187] The verification module is used to decode and verify the second LVDS differential signal;
[0188] The notification module is used to notify the main control CPU that the access request has been completed after the verification module has successfully verified the data.
[0189] In some embodiments of this application, the verification module is used for:
[0190] Detect whether a preset number of consecutive bytes in the serial data stream included in the second LVDS differential signal are not all 0s or all 1s;
[0191] If not, return to the step of detecting whether a preset number of consecutive bytes in the serial data stream included in the second LVDS differential signal are not all 0s or not all 1s, until the detection result of a preset number of consecutive times is negative, then determine that the LVDS channel between the card and the specified sub-card is faulty.
[0192] If a preset number of consecutive bytes are detected to be either not all 0s or not all 1s, then byte alignment detection is performed on the serial data stream included in the second LVDS differential signal.
[0193] If the byte alignment check passes, the serial data stream is decoded and CRC checked.
[0194] If the CRC check passes, then the check on the second LVDS differential signal is successful.
[0195] In some embodiments of this application, the access request also includes a read / write type, wherein when the read / write type is a read type, the second LVDS differential signal carries the read data;
[0196] The enabling module 703 is also used to enable the receiving logical slot indicated by the specified logical slot number, so that the main control CPU can obtain the read data through the receiving logical slot.
[0197] In some embodiments of this application, the device further includes an acquisition module;
[0198] The acquisition module is used to obtain the health score of the LVDS channel between the FPGA and the specified daughter card;
[0199] The sending module 704 is also used to send a first LVDS differential signal to a designated sub-card through a sending logic slot if the health score is greater than or equal to a preset threshold.
[0200] The sending module 704 is also used to determine the health interval to which the health score belongs if the health score is less than a preset threshold, and send the first LVDS differential signal to the designated sub-card according to the sending strategy corresponding to the health interval.
[0201] In some embodiments of this application, the health score range includes a first range, a second range, and a third range, with the health score decreasing sequentially in the first range, the second range, and the third range;
[0202] The sending strategy corresponding to the first interval is to limit the maximum bandwidth to a first proportion of the theoretical maximum bandwidth value, reduce the burst value by half, and only guarantee the transmission of messages in the highest priority queue and the second highest priority queue.
[0203] The sending strategy corresponding to the second interval is to limit the maximum bandwidth to a second proportion of the theoretical value of the maximum bandwidth, prohibit bursts, and only guarantee the sending of messages from the highest priority queue. The second proportion is less than the first proportion.
[0204] The sending strategy corresponding to the third interval is to limit the maximum bandwidth to a third proportion of the theoretical maximum bandwidth value, prohibit bursts, and only guarantee the sending of heartbeat messages. The third proportion is less than the second proportion.
[0205] In some embodiments of this application, the device further includes:
[0206] The detection module is used to perform link layer detection on the information transmission between the FPGA and the specified daughter card to obtain the CRC error rate; perform protocol layer detection on the information transmission between the FPGA and the specified daughter card to obtain the timeout detection result; perform application layer detection on the information transmission between the FPGA and the specified daughter card to obtain the heartbeat success rate, latency jitter value and throughput achievement rate; and obtain the sending queue occupancy rate and buffer overflow count within a specified time period.
[0207] The update module is used to calculate and update the health score of the LVDS channel between the FPGA and the specified daughter card based on at least two of the following: CRC error rate, timeout detection result, heartbeat success rate, latency jitter value, throughput achievement rate, transmit queue occupancy rate, and buffer overflow count.
[0208] In some embodiments of this application, the device further includes a disabling module;
[0209] The transmitting module 704 is also used to retransmit the first LVDS differential signal through an exponential backoff retransmission mechanism if the receiving module does not receive the second LVDS differential signal from the designated sub-card within a preset time period.
[0210] The disable module is used to determine that a permanent protocol layer fault has occurred if the number of times the first LVDS differential signal is retransmitted reaches a preset number and the second LVDS differential signal is still not received within a preset time period, and disables the transmit logical slot and receive logical slot indicated by the specified logical slot number.
[0211] This application also provides an FPGA, such as Figure 8 As shown, it includes a processor 801, a communication interface 802, a memory 803, and a communication bus 804, wherein the processor 801, the communication interface 802, and the memory 803 communicate with each other through the communication bus 804.
[0212] Memory 803 is used to store computer programs;
[0213] The processor 801, when executing the program stored in the memory 803, implements the method steps in the above method embodiments.
[0214] The communication bus mentioned in the FPGA above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0215] The communication interface is used for communication between the aforementioned electronic devices and other devices.
[0216] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0217] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0218] In another embodiment provided in this application, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements the steps of any of the above-described methods for accessing a sub-card.
[0219] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform the method of any of the access sub-cards described above.
[0220] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).
[0221] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0222] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the apparatus embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0223] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the scope of protection of this application.
Claims
1. A method for accessing a sub-card, characterized in that, The method is applied to an FPGA, wherein the FPGA connects to multiple daughter cards, and the FPGA includes logic slots corresponding to each daughter card; the method includes: Receive an access request sent by the main control CPU, the access request including the specified logical slot number corresponding to the specified sub-card that the main control CPU requests to access; A first LVDS differential signal is generated based on the access request; Enable the transmit logical slot indicated by the specified logical slot number; The first LVDS differential signal is sent to the designated sub-card through the transmit logic slot; The access request includes a read / write type. If the read / write type is read, after receiving the access request sent by the main control CPU, the method further includes: Enable the receive logical slot indicated by the specified logical slot number so that the main control CPU can obtain the read data through the receive logical slot.
2. The method according to claim 1, characterized in that, After transmitting the first LVDS differential signal to the designated daughter card through the transmit logic slot, the method further includes: Sample the second LVDS differential signal returned by the designated sub-card; The second LVDS differential signal is decoded and verified; After successful verification, the main control CPU is notified that the access request has been completed.
3. The method according to claim 2, characterized in that, The decoding and verification of the second LVDS differential signal includes: Detect whether a preset number of consecutive bytes in the serial data stream included in the second LVDS differential signal are not all 0s or not all 1s; If not, return to the step of detecting whether a preset number of consecutive bytes in the serial data stream included in the second LVDS differential signal are not all 0s or not all 1s, until the detection results of a preset number of consecutive times are all negative, then determine that the LVDS channel between the card and the specified sub-card is faulty. If a preset number of consecutive bytes are detected to be either not all 0s or not all 1s, then byte alignment detection is performed on the serial data stream included in the second LVDS differential signal. If the byte alignment check passes, the serial data stream is then decoded and subjected to CRC verification. If the CRC check passes, then the verification of the second LVDS differential signal is successful.
4. The method according to claim 2, characterized in that, When the read / write type is read, the second LVDS differential signal carries the read data.
5. The method according to any one of claims 1-4, characterized in that, Before transmitting the first LVDS differential signal to the designated daughter card through the transmit logic slot, the method further includes: Obtain the health score of the LVDS channel between the FPGA and the designated daughter card; If the health score is greater than or equal to a preset threshold, the first LVDS differential signal is sent to the designated sub-card through the transmission logic slot; If the health score is less than a preset threshold, then the health range to which the health score belongs is determined, and the first LVDS differential signal is sent to the designated sub-card according to the sending strategy corresponding to the health range.
6. The method according to claim 5, characterized in that, The health score range includes a first range, a second range, and a third range, with the health score decreasing sequentially from the first range to the second range and the third range. The sending strategy corresponding to the first interval is to limit the maximum bandwidth to a first proportion of the theoretical value of the maximum bandwidth, reduce the burst value by half, and only guarantee the transmission of messages from the highest priority queue and the second highest priority queue. The sending strategy corresponding to the second interval is to limit the maximum bandwidth to a second proportion of the theoretical value of the maximum bandwidth, prohibit bursts, and only guarantee the sending of messages from the highest priority queue. The second proportion is less than the first proportion. The sending strategy corresponding to the third interval is to limit the maximum bandwidth to a third proportion of the theoretical maximum bandwidth value, prohibit bursts, and only guarantee the sending of heartbeat messages. The third proportion is less than the second proportion.
7. The method according to claim 5, characterized in that, The method further includes: Link layer detection is performed on the information transmission between the FPGA and the designated sub-card to obtain the CRC error rate; The protocol layer detection is performed on the information transmission between the FPGA and the designated sub-card to obtain the timeout detection result; The information transmission between the FPGA and the designated daughter card is detected at the application layer to obtain the heartbeat success rate, latency jitter value and throughput achievement rate. Get the send queue occupancy rate and buffer overflow count within a specified time period; Based on at least two of the following: CRC error rate, timeout detection result, heartbeat success rate, latency jitter value, throughput achievement rate, transmit queue occupancy rate, and buffer overflow count, calculate and update the health score of the LVDS channel between the FPGA and the designated sub-card.
8. The method according to any one of claims 1-4, characterized in that, After transmitting the first LVDS differential signal to the designated daughter card through the transmit logic slot, the method further includes: If the second LVDS differential signal is not received from the designated sub-card within a preset time period, the first LVDS differential signal is retransmitted through an exponential backoff retransmission mechanism. If the number of times the first LVDS differential signal is retransmitted reaches a preset number, and the second LVDS differential signal is still not received within the preset time period, then a permanent protocol layer fault is determined to have occurred, and the transmit logical slot and receive logical slot indicated by the specified logical slot number are disabled.
9. A device for accessing a daughter card, characterized in that, The device is applied to an FPGA, the FPGA connecting multiple daughter cards, and the FPGA including logic slots corresponding to each daughter card; the device includes: The receiving module is used to receive an access request sent by the main control CPU, wherein the access request includes the specified logical slot number corresponding to the specified sub-card requested by the main control CPU; The generation module is used to generate a first LVDS differential signal based on the access request; The enabling module is used to enable the transmission logical slot indicated by the specified logical slot number; The transmitting module is used to transmit the first LVDS differential signal to the designated sub-card through the transmitting logic slot; The access request also includes a read / write type. When the read / write type is a read type, the enabling module is further configured to enable the receiving logical slot indicated by the specified logical slot number, so that the main control CPU can obtain the read data through the receiving logical slot.
10. The apparatus according to claim 9, characterized in that, The device further includes: The sampling module is used to sample the second LVDS differential signal returned by the designated sub-card; The verification module is used to decode and verify the second LVDS differential signal; The notification module is used to notify the main control CPU that the access request has been completed after the verification module has successfully verified the access.
11. The apparatus according to claim 10, characterized in that, The verification module is used for: Detect whether a preset number of consecutive bytes in the serial data stream included in the second LVDS differential signal are not all 0s or not all 1s; If not, return to the step of detecting whether a preset number of consecutive bytes in the serial data stream included in the second LVDS differential signal are not all 0s or not all 1s, until the detection results of a preset number of consecutive times are all negative, then determine that the LVDS channel between the card and the specified sub-card is faulty. If a preset number of consecutive bytes are detected to be either not all 0s or not all 1s, then byte alignment detection is performed on the serial data stream included in the second LVDS differential signal. If the byte alignment check passes, the serial data stream is then decoded and subjected to CRC verification. If the CRC check passes, then the verification of the second LVDS differential signal is successful.
12. The apparatus according to claim 10, characterized in that, When the read / write type is read, the second LVDS differential signal carries the read data.
13. The apparatus according to any one of claims 9-12, characterized in that, The device also includes an acquisition module; The acquisition module is used to acquire the health score of the LVDS channel between the FPGA and the designated daughter card; The sending module is further configured to send the first LVDS differential signal to the designated sub-card through the sending logic slot if the health score is greater than or equal to a preset threshold. The sending module is further configured to, if the health score is less than a preset threshold, determine the health range to which the health score belongs, and send the first LVDS differential signal to the designated sub-card according to the sending strategy corresponding to the health range.
14. The apparatus according to claim 13, characterized in that, The health score range includes a first range, a second range, and a third range, with the health score decreasing sequentially from the first range to the second range and the third range. The sending strategy corresponding to the first interval is to limit the maximum bandwidth to a first proportion of the theoretical value of the maximum bandwidth, reduce the burst value by half, and only guarantee the transmission of messages from the highest priority queue and the second highest priority queue. The sending strategy corresponding to the second interval is to limit the maximum bandwidth to a second proportion of the theoretical value of the maximum bandwidth, prohibit bursts, and only guarantee the sending of messages from the highest priority queue. The second proportion is less than the first proportion. The sending strategy corresponding to the third interval is to limit the maximum bandwidth to a third proportion of the theoretical maximum bandwidth value, prohibit bursts, and only guarantee the sending of heartbeat messages. The third proportion is less than the second proportion.
15. The apparatus according to claim 13, characterized in that, The device further includes: The detection module is used to perform link layer detection on the information transmission between the FPGA and the designated sub-card to obtain the CRC error rate; perform protocol layer detection on the information transmission between the FPGA and the designated sub-card to obtain the timeout detection result; perform application layer detection on the information transmission between the FPGA and the designated sub-card to obtain the heartbeat success rate, latency jitter value and throughput achievement rate; and obtain the sending queue occupancy rate and buffer overflow count within a specified time period. The update module is used to calculate and update the health score of the LVDS channel between the FPGA and the designated sub-card based on at least two of the following: the CRC error rate, the timeout detection result, the heartbeat success rate, the latency jitter value, the throughput achievement rate, the transmission queue occupancy rate, and the number of buffer overflows.
16. The apparatus according to any one of claims 9-12, characterized in that, The device also includes a disable module; The transmitting module is further configured to retransmit the first LVDS differential signal through an exponential backoff retransmission mechanism if the receiving module does not receive the second LVDS differential signal from the designated sub-card within a preset time period. The disable module is configured to determine that a permanent protocol layer fault has occurred if the number of times the first LVDS differential signal is retransmitted reaches a preset number and the second LVDS differential signal is still not received within the preset time period, and then disable the transmit logical slot and receive logical slot indicated by the specified logical slot number.
17. An FPGA, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the method described in any one of claims 1-8.
18. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method described in any one of claims 1-8.
Citation Information
Patent Citations
A switching network configuration method and system
CN101170431A
FPGA-based multipath signal selection method and system, electronic device and storage medium
CN114546931A
Control device and control system
CN218124727U
