A method for implementing 10B8B decoding

By establishing a decoding mapping table in the block RAM and performing read operations, it solves the problem of resource occupancy and large delay of the traditional lookup table method, and achieves faster 10B/8B decoding, which is suitable for high-speed serial buses.

CN118074864BActive Publication Date: 2024-08-30无锡芯湖湾信息科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410212261.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-27
Publication Date
2024-08-30
Estimated Expiration
2044-02-27

AI Technical Summary

Technical Problem

The traditional 10B/8B decoding method based on lookup tables takes up a lot of logic resources and has a large decoding delay, and cannot meet the decoding speed and resource usage requirements of high-speed serial buses.

Method used

Block RAM is used for 10B/8B decoding. By establishing a decoding mapping table and importing it into the block RAM, the read operation of the block RAM is used to achieve fast decoding, reduce latency and save logic resources.

Benefits of technology

It achieves faster decoding speed, reduces decoding delay to 2 clock cycles, and reduces the use of logic resources, making it suitable for commercial FPGAs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118074864B
    Figure CN118074864B
Patent Text Reader

Abstract

The present invention relates to the field of decoding technology, and in particular to a method for implementing 10B8B decoding. First, a decoding mapping table is established, and then the established decoding mapping table is imported into a block RAM. Finally, when decoding is performed, the data to be decoded is used as the read address of the block RAM, and each read operation completes one decoding. Compared with the traditional method, the present invention improves the decoding speed, reduces the decoding delay, and saves logic resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of decoding technology, and in particular to a method for implementing 10B8B decoding. Background Art

[0002] 10B / 8B decoding is the decoding mechanism currently used by many high-speed serial buses, such as USB3.0, 1394b, SerialATA, PCI Express, Infini-band, Fibre Channel, RapidIO and other buses or networks.

[0003] One of the characteristics of 10B / 8B decoding is to ensure DC balance. Using 10B / 8B decoding can keep the number of "0" and "1" sent basically the same, and the number of consecutive "1" or "0" does not exceed 5 bits, that is, a "0" or "1" must be inserted after every 5 consecutive "1" or "0", so as to ensure the DC balance of the signal. That is to say, DC imbalance will not occur when the link times out. Through 10B / 8B decoding, it can be ensured that the transmitted data string can be correctly restored at the receiving end. In addition, the use of some special codes (K code in PCI-Express bus) can help the receiving end to restore the work, and can detect data bit transmission errors at an early stage to suppress the continued occurrence of errors.

[0004] like Figure 5 As shown in the figure, 10B / 8B decoding decodes the serial data in units of 8 bits to obtain a 10-bit data. Assuming that the original 8-bit data is represented by HGFEDCBA from high to low, the 8-bit data is divided into two subgroups: the high 3-bit HGF and the low 5-bit EDCBA. After 5B / 6B decoding, the low 5-bit EDCBA is mapped to ABCDEI; the high 3-bit is decoded by 3B / 4B and mapped to FGHJ, and finally ABCDEIFGHJ is synthesized and sent.

[0005] Divide the 8-bit data into two groups of 3 bits and 5 bits, corresponding to 4 bits and 6 bits in 10 bits respectively. If the number of "0" and "1" in each 4-bit and 6-bit group is equal, it is called a perfectly balanced code, but the number of these perfectly balanced codes cannot meet our requirements. Because in the 4-bit sub-group, only 6 of the 16 decodings are perfectly balanced, which is not enough for the 8 decoding values ​​of 3 bits. At the same time, only 20 decodings in the 6-bit sub-group are perfectly balanced, which is not enough for the 32 decoding values ​​of 5 bits. Therefore, in the 10B / 8B decoding process, a polarity deviation (running disparity, RD) parameter is used to represent the imbalance. The value of RD can be 0 or 1. RD = 1 means that the number of "1" is more than the number of "0", and RD = 0 means that the number of "0" is more than the number of "1".

[0006] During the decoding process, 5B / 6B decoding comes first and 3B / 4B decoding comes later. The RD used for the current 5B / 6B decoding is the RD generated by the previous byte decoding (the initialized RD value when receiving or sending the first transmission character), and the RD used for 3B / 4B decoding is the RD generated by the previous adjacent 5B / 6B decoding. However, the RD value generated by the entire byte decoding is obtained by 3B / 4B decoding.

[0007] like Figure 6 As shown, the specific process of decoding 10B to 8B based on the lookup table is as follows:

[0008] 1) Module input: 10B data to be decoded.

[0009] 2) Signal type judgment: If it is a control signal, the output k_char=1; if it is a data signal, the output k_char=0.

[0010] 3) Data grouping: The input 10B data is divided into 6B data of the lower 6 bits and 4B data of the upper 4 bits, which are used as the input of the 5B6B decoding module and the 3B4B decoding module respectively.

[0011] 4) 6B decoding to 5B: Observe the input 6B data and find the corresponding 5B data in the 5B6B mapping table as the output of the 5B6B decoding module.

[0012] 5) 4B decoding to 3B: Observe the input 4B data and find the corresponding 3B data in the 3B4B mapping table as the output of the 3B4B decoding module.

[0013] 6) Module output: Combine the 3B data output by the 3B4B decoding module and the 5B data output by the 5B6B decoding module to obtain the decoded 8B data, and output the data type judgment signal k_char.

[0014] In short, the traditional implementation method based on the lookup table occupies more logic resources and has a large decoding delay, generally with a delay of several clock cycles. Summary of the invention

[0015] The present invention provides a method for implementing 10B8B decoding, which is based on the characteristics of block RAM and improves decoding speed, reduces decoding delay and saves logic resources compared with traditional methods.

[0016] In order to achieve the purpose of the present invention, the technical solution adopted is: a method for implementing 10B8B decoding, comprising the following steps:

[0017] S1. Establish a decoding mapping table: the data to be decoded is used as the address of the mapping table, and the data stored at the corresponding address is the decoded data and the K code mark;

[0018] S2, importing the established decoding mapping table into the block RAM;

[0019] S3. When decoding, the data to be decoded is used as the read address of the block RAM, and each read operation completes one decoding.

[0020] As an optimization solution of the present invention, in step S2, the block RAM is set as a dual-port or single-port RAM module or ROM module.

[0021] As an optimization solution of the present invention, in step S3, specifically:

[0022] S3-1: Connect the data to be decoded to the address bit;

[0023] S3-2: Decode enable signal is connected to read enable;

[0024] S3-3: The decoding clock is connected to the clock end of the RAM module or ROM module.

[0025] As an optimization solution of the present invention, at the rising edge of the clock, the data output bit [7-0] outputs the decoded data, and the data output bit [8] is a K code flag.

[0026] The present invention has a positive effect: current commercial FPGAs are all integrated with block RAM, which can be designed as RAM, FIFO, and ROM. Fast decoding can be performed based on block RAM, and one RAM read operation can achieve decoding (one clock cycle). The traditional method requires multiple time cycles, and the speed is increased and the delay is reduced. A single block RAM can be used to achieve this, and it does not occupy too many logic resources. The present invention reduces the decoding delay to 2 clock cycles and reduces the use of logic resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.

[0028] Figure 1 is a flow chart of the present invention;

[0029] Figure 2 It is a configuration diagram of a single-port ROM of an 18kb block RAM of the present invention;

[0030] Figure 3 It is a decoding connection relationship diagram of the present invention;

[0031] Figure 4 It is a timing diagram of the decoding process of the present invention;

[0032] Figure 5 This is the current 10B / 8B decoding schematic;

[0033] Figure 6 This is a flowchart of 10B8B decoding implementation based on a lookup table. DETAILED DESCRIPTION

[0034] like Figure 1 As shown, the present invention discloses a method for implementing 10B8B decoding. The technical solution of the present invention is explained in conjunction with XILINX FPGA. XILINX FPGA has an internal integrated 18Kb block RAM, each block RAM consists of an 18kb storage area and two completely independent access interfaces (port A and port B), such as Figure 2 As shown. Each 18kb block RAM can be configured as a memory with a capacity of 16K×1, 8K×2, 4K×4, 2K×9, 1K×18 or 512×36, and can be set as a dual-port or single-port RAM module or ROM module. In the present invention, the block RAM is configured as a 1K×18 single-port ROM module, as shown. Figure 2 As shown, ADDR<9..0> is a 10-bit address, RDEN is a read enable signal, and CLK is a ROM operating clock.

[0035] Step 1: Establish a decoding mapping table. The data to be decoded is used as the address of the mapping table. The data stored at the corresponding address is the decoded data and the K code flag. Take K28.5 as an example to illustrate the mapping process. The 8-bit data 28.5 is 101 11100 (decoded data), and its corresponding negative polarity (rd=0) K code is 0011111010. When establishing the mapping table, the storage content of the mapping table address 0011111010 is 1 101 11100 (the lower 8 bits are the decoded data, the highest bit indicates the K code or data, and it is the K code when K=1).

[0036] Step 2: Import the decoding mapping table created in step 1 into the block RAM. Initialize the mapping table created in step 1 in the XILINX VIVADO FPGA development environment Figure 2 18kb ROM.

[0037] Step 3: When decoding, the data to be decoded is used as the read address of the RAM in step 2. Each read operation completes a decoding. Figure 3 As shown, the data to be decoded D<9..0> is connected to ADDR<9..0>. The decoding enable signal decodeEn is connected to RDEN, and the decoding clock decodeCLK is connected to CLK. Taking the negative polarity K28.5 as an example to illustrate the decoding, the address 0011111010 (hexadecimal expression is 0FA) is given and decodeEn is set high. At the rising edge of the clock, the output of DOUT<7..0> is the negative polarity K28.5 decoded 101 11100 (hexadecimal expression is BC), and DOUT <8> For K code symbol, such as Figure 4 shown.

[0038] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for implementing 10B8B decoding, characterized in that: The steps include: S1. Establish a decoding mapping table: the data to be decoded is used as the address of the mapping table, and the data stored at the corresponding address is the decoded data and the K code mark; S2, importing the established decoding mapping table into the block RAM; S3, when decoding, the data to be decoded is used as the read address of the block RAM, and each read operation completes one decoding; In the step S2, the block RAM is set as a dual-port or single-port RAM module or ROM module; In the step S3, specifically: S3-1: Connect the data to be decoded to the address bit; S3-2: Decode enable signal is connected to read enable; S3-3: The decoding clock is connected to the clock end of the RAM module or ROM module; When the decoding clock is at the rising edge, the data output bits [7-0] output the decoded data, and the data output bit [8] is the K code flag.