A data transmission method, data transmission device and related device
By converting the first data into the second data with the first data less than the first data in the CXS data transmission device, and the corresponding conversion and compression between the devices, the problem of width and waste in the existing technology has been solved, the bandwidth is increased, and the bandwidth is increased. Utilization rate and data transmission efficiency.
Patent Information
- Application Number
- CN202410552936.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-06
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2044-05-06
AI Technical Summary
There is bandwidth waste in existing CXS data transmission equipment, resulting in low bandwidth utilization and data transmission efficiency.
By converting the first data in the target data to the second data with a bit width less than the first data, and the corresponding conversion and compression compression between the data transmission devices is used to reduce the redundant part in the data transmission.
It improves the bandwidth utilization rate and data transmission efficiency of data transmission equipment, reduce the transmission of redundant data, and improve the overall data processing performance.
Smart Images

Figure CN118353966B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data transmission method, a data transmission device and related devices. Background Art
[0002] CXS (Credited eXtensible Stream) data transmission devices usually serve as a connection bus, responsible for data transmission between the chip's protocol layer and the link layer or physical layer or adaptation layer. However, current CXS data transmission devices waste bandwidth, resulting in low bandwidth utilization of the data transmission devices and low data transmission efficiency. Summary of the invention
[0003] The present application discloses a data transmission method, a data transmission device and related devices to improve the bandwidth utilization rate and data transmission efficiency of the data transmission device.
[0004] In the first aspect, the present application discloses a data transmission method, which is applied to a first data transmission device, wherein the first data transmission device is communicatively connected with a second data transmission device, and the first data transmission device and the second data transmission device both include a CXS data transmission device. The data transmission method includes: obtaining target data to be transmitted, the target data including at least one data packet and first data; the first data is used to indicate the start position and end position of the data packet in the target data; converting the first data into corresponding second data; the bit width of the second data is smaller than the bit width of the first data; and transmitting the target data to the second data transmission device.
[0005] In some embodiments, converting the first data into corresponding second data includes: converting data of at least two fields in the first data into data of at least one field in the second data, the bit width of the data of the at least one field being smaller than the bit width of the data of the at least two fields.
[0006] In some embodiments, the first data includes first field data, second field data, third field data, fourth field data and fifth field data, the first field data is used to indicate the start number of data packets in the target data in each clock cycle, the second field data is used to indicate the start position of the data packets in the target data in each clock cycle, the third field data is used to indicate the end number of data packets in the target data in each clock cycle, the fourth field data is used to indicate whether the data packets ending in each clock cycle have errors, and the fifth field data is used to indicate the end position of the data packets in the target data in each clock cycle. The step of converting at least two field data in the first data into at least one field data (first data or second data) in the second data includes: converting the first field data and the second field data in the first data into the first field data in the second data, wherein the bit width of the first field data in the second data is smaller than the sum of the bit widths of the first field data and the second field data in the first data; and / or converting the third field data and part of the fifth field data in the first data into the second field data in the second data, wherein the bit width of the second field data in the second data is smaller than the sum of the bit widths of the third field data and part of the fifth field data in the first data.
[0007] In some embodiments, the bit width of the first field data in the first data is equal to n bits, the bit width of the second field data in the first data is greater than or equal to 2x bits and less than or equal to 4x bits, and the bit width of the first field data in the second data is equal to n bits; the bit width of the third field data in the first data is equal to n bits, the bit width of the fifth field data in the first data is greater than or equal to 2y bits and less than or equal to 4y bits, and the bit width of the second field data in the second data is equal to n bits; wherein, x=log2(m / 128), y=log2(m / 32), m is the width of the target data, and n is the maximum number of data packets in the target data within one clock cycle.
[0008] In some embodiments, the 5th field data in the first data includes n sub-field data, and the conversion of the 3rd field data and part of the 5th field data in the first data into the 2nd field data in the second data includes: converting the data from the 2nd bit to the y-1th bit of each sub-field data in the 3rd field data and the 5th field data in the first data into the 2nd field data in the second data; y=log2(m / 32), m is the width of the target data, and n is the maximum number of data packets in the target data within one clock cycle.
[0009] In some embodiments, it also includes: using the 4th field data in the first data as the 3rd field data in the second data; using the 0th to 1st bit data of each sub-field data in the 5th field data in the first data as the 4th to 3+nth field data in the second data.
[0010] In some embodiments, the bit width of the 3rd field data in the second data is equal to n bits; the bit width of the 4th field data to the 3+nth field data in the second data is greater than or equal to 4 bits and less than or equal to 8 bits.
[0011] In the second aspect, the present application discloses a data transmission method, which is applied to a second data transmission device, wherein the second data transmission device is communicatively connected to a first data transmission device, and the first data transmission device and the second data transmission device both include a CXS data transmission device. The data transmission method includes: obtaining target data output by the first data transmission device, wherein the target data includes at least one data packet and second data; converting the second data into corresponding first data; the first data is used to indicate the start position and end position of the data packet in the target data; and the bit width of the second data is smaller than the bit width of the first data.
[0012] In some embodiments, converting the second data into corresponding first data includes: converting at least one field data in the second data into at least two field data in the first data, and the bit width of the at least one field data is smaller than the bit width of the at least two field data.
[0013] In some embodiments, the first data includes first field data, second field data, third field data, fourth field data and fifth field data, the first field data is used to indicate the start number of data packets in the target data in each clock cycle, the second field data is used to indicate the start position of the data packets in the target data in each clock cycle, the third field data is used to indicate the end number of data packets in the target data in each clock cycle, the fourth field data is used to indicate whether the data packets ending in each clock cycle have errors, the fifth field data is used to indicate the end position of the data packets in the target data in each clock cycle, and the The step of converting at least one field data in the second data into at least two field data (second data) in the first data includes: converting the first field data in the second data into the first field data and the second field data in the first data, the bit width of the first field data in the second data being smaller than the sum of the bit widths of the first field data and the second field data in the first data; and / or converting the second field data in the second data into the third field data and part of the fifth field data in the first data, the bit width of the second field data in the second data being smaller than the sum of the bit widths of the third field data and part of the fifth field data in the first data.
[0014] In some embodiments, the bit width of the first field data in the first data is equal to n bits, the bit width of the second field data in the first data is greater than or equal to 2x bits and less than or equal to 4x bits, and the bit width of the first field data in the second data is equal to n bits; the bit width of the third field data in the first data is equal to n bits, the bit width of the fifth field data in the first data is greater than or equal to 2y bits and less than or equal to 4y bits, and the bit width of the second field data in the second data is equal to n bits; wherein, x=log2(m / 128), y=log2(m / 32), m is the width of the target data, and n is the maximum number of data packets in the target data within one clock cycle.
[0015] In some embodiments, the 5th field data in the first data includes n sub-field data, and converting the 2nd field data in the second data into the 3rd field data and part of the 5th field data in the first data includes: converting the 2nd field data in the second data into data from the 2nd bit to the y-1th bit of each sub-field data in the 3rd field data and the 5th field data in the first data; y=log2(m / 32), m is the width of the target data; n is the maximum number of data packets in the target data within one clock cycle.
[0016] In some embodiments, it also includes: using the 3rd field data in the second data as the 4th field data in the first data; using the 4th to 3+nth field data in the second data as the 0th to 1st bit data of each sub-field data in the 5th field data in the first data respectively.
[0017] In some embodiments, the bit width of the 3rd field data in the second data is equal to n bits; the bit width of the 4th field data to the 3+nth field data in the second data is greater than or equal to 4 bits and less than or equal to 8 bits.
[0018] In the third aspect, the present application also discloses a data transmission device, which includes a CXS data transmission device, and the data transmission device includes a storage unit and a processing unit; the storage unit is used to store instructions; the processing unit is used to execute the data transmission method described in any one of the above items according to the instructions stored in the storage unit.
[0019] In a fourth aspect, the present application further discloses a computer-readable storage medium storing instructions for causing a computer to execute any of the data transmission methods described above.
[0020] In the fifth aspect, the present application also discloses a system on chip, including a first data transmission device and a second data transmission device, the first data transmission device and the second data transmission device both include a CXS data transmission device, the first data transmission device is used to execute the data transmission method applied to the first data transmission device as described in any of the above items, and the second data transmission device is used to execute the data transmission method applied to the second data transmission device as described in any of the above items.
[0021] In a sixth aspect, the present application further discloses an electronic device, comprising the data transmission device as described above or the computer-readable storage medium as described above or the system on chip as described above.
[0022] The present application discloses a data transmission method, a data transmission device and related devices, wherein a first data transmission device obtains target data to be transmitted, converts first data in the target data into corresponding second data, wherein the bit width of the second data is smaller than the bit width of the first data, and then transmits the target data including the second data to a second data transmission device, thereby reducing the invalid transmission of part of the first data by compressing the first data in the target data into the second data, thereby improving the bandwidth utilization and data transmission efficiency of data transmission devices including CXS data transmission devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background technology, the drawings required for use in the embodiments of the present application or the background technology will be described below.
[0024] Figure 1 The figure is a schematic diagram of a chip's data transmission method.
[0025] Figure 2 This is a flow chart of a data transmission method disclosed in an embodiment of the present application.
[0026] Figure 3 This is a flow chart of a data transmission method disclosed in an embodiment of the present application.
[0027] Figure 4 A schematic diagram of a data transmission method of a chip disclosed in an embodiment of the present application.
[0028] Figure 5 This is a schematic diagram of another chip data transmission method disclosed in an embodiment of the present application. DETAILED DESCRIPTION
[0029] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0030] like Figure 1 As shown, Figure 1 This is a schematic diagram of a chip data transmission method. The protocol layer can transmit data to the second CXS data transmission device CXS2 of the link layer, physical layer or adaptation layer through the first CXS data transmission device CXS1. The link layer, physical layer or adaptation layer can also transmit data to the second CXS data transmission device CXS2 of the protocol layer through the first CXS data transmission device CXS1.
[0031] Among them, the CXS data transmission device can also be called the CXS interface device, which is a data transmission device that complies with the CXS protocol. The protocol layer can be an on-chip interconnect network or a CPU (Central Processing Unit) core, the link layer can be a PCIE (Peripheral Component Interconnect Express, a high-speed serial computer expansion bus) link layer, and the adaptation layer can be a UCIE (Universal Chiplet Interconnect Express, a universal chiplet interconnect technology) adaptation layer.
[0032] However, the inventors have found that the current CXS data transmission equipment wastes bandwidth. Specifically, the CXSCNTL data in the CXS data transmitted by the CXS data transmission equipment is redundant. The CXSCNTL data is used to indicate information such as the start position and end position of the data packet. For example, if the CXSCNTL data is 10 bits, the 10 bits of data can be encoded into 2 10 Type code, can represent 2 10 However, the CXSCNTL data actually has only 100 packet start situations, using 2 7 =128 codes can be used for representation, so there is 3 bits of redundancy in the CXSCNTL data, resulting in low bandwidth utilization of the data transmission equipment and low data transmission efficiency.
[0033] Based on this, the present application discloses a data transmission scheme, which converts the CXSCNTL data in the CXS data into data with a smaller bit width before transmitting it, such as converting 10-bit CXSCNTL data into 7-bit CXSCNTL data before transmitting it, to improve bandwidth utilization and data transmission efficiency.
[0034] As an optional implementation of the disclosure of the present application, the embodiment of the present application discloses a data transmission method, which is applied to a first data transmission device, the first data transmission device is communicatively connected with a second data transmission device, wherein the first data transmission device and the second data transmission device both include CXS data transmission devices. Figure 2 As shown, Figure 2 This is a flowchart of a data transmission method disclosed in an embodiment of the present application, the data transmission method comprising:
[0035] S101: Acquire target data to be transmitted, where the target data includes at least one data packet and first data, where the first data is used to indicate a start position and an end position of the data packet in the target data.
[0036] Taking the first data transmission device as a CXS data transmission device as an example, the target data is the CXS data to be transmitted by the CXS data transmission device. The target data includes at least one data packet and first data. Each data packet may include data transmitted by the data transmission device within one or more clock cycles. The first data includes CXSCNTL data, which is used to indicate information such as the start position and end position of the data packet in the target data.
[0037] S102: Convert the first data into corresponding second data, where the bit width of the second data is smaller than the bit width of the first data.
[0038] According to a preset mapping relationship between the first data and the second data, or according to a preset conversion formula between the first data and the second data, the first data is converted into corresponding second data, and the bit width of the second data is smaller than the bit width of the first data.
[0039] S103: Transmit the target data to a second data transmission device.
[0040] After the first data is converted into the corresponding second data, the second data will replace the first data in the target data, that is, the converted target data includes at least one data packet and the second data, and then the converted target data can be transmitted to the second data transmission device.
[0041] Based on this, before the first data transmission device outputs the target data, the invalid transmission of part of the first data (such as redundant 3-bit data) can be reduced by converting or compressing the first data into second data, thereby improving the bandwidth utilization and data transmission efficiency of the data transmission devices including the CXS data transmission device.
[0042] In some embodiments of the present application, data of at least two fields in the first data can be converted into data of at least one field in the second data, and the bit width of the data of at least one field is smaller than the bit width of the data of at least two fields. Because the inventors have found that not all fields in the first data (such as CXSCNTL data) have redundant data, only the data of at least two fields in the first data that have redundant data can be converted, which can reduce the workload of data conversion and improve data conversion efficiency.
[0043] In some embodiments, the first data includes first field data, second field data, third field data, fourth field data and fifth field data, the first field data is used to indicate the start number of data packets in the target data in each clock cycle, the second field data is used to indicate the start position of the data packets in the target data in each clock cycle, the third field data is used to indicate the end number of data packets in the target data in each clock cycle, the fourth field data is used to indicate whether there is an error in the data packet that ends in each clock cycle, and the fifth field data is used to indicate the end position of the data packet in the target data in each clock cycle.
[0044] Based on this, the first field data and the second field data in the first data can be converted into the first field data in the second data, and / or the third field data and part of the fifth field data in the first data can be converted into the second field data in the second data, the bit width of the first field data in the second data is smaller than the sum of the bit widths of the first field data and the second field data in the first data, and the bit width of the second field data in the second data is smaller than the sum of the bit widths of the third field data and part of the fifth field data in the first data.
[0045] Taking the first data as CXSCNTL data as an example, as shown in Table 1, the first field data of the CXSCNTL data includes data from the 0th bit to the n-1th bit, that is, the data of the START[n-1:0] field, the second field data of the CXSCNTL data includes data from the nth bit to the x+n-1th bit, that is, the data of the START0PTR[x-1:0], data from the x+nth bit to the 2x+n-1th bit, that is, the data of the START1PTR[x-1:0], data from the 2x+nth bit to the 3x+n-1th bit, that is, the data of the START2PTR[x-1:0], and data from the 3x+nth bit to the 4x+n-1th bit, that is, the data of the START3PTR[x-1:0] field, and the third field data of the CXSCNTL data includes data from the 4x+nth bit to the 4x+2n-1th bit, that is, the data of the END The 4th field data of CXSCNTL data includes data from the 4x+2n bit to the 4x+3n-1 bit, namely, data of the ENDERROR[n-1:0] field; the 5th field data of CXSCNTL data includes n subfield data, which are data from the 4x+3n bit to the 4x+3n+y-1 bit, namely, data from the END0PTR[y-1:0], data from the 4x+3n+y bit to the 4x+3n+2y-1 bit, namely, data from the END1PTR[y-1:0], data from the 4x+3n+2y bit to the 4x+3n+3y-1 bit, namely, data from the END2PTR[y-1:0], and data from the 4x+3n+3y bit to the 4x+3n+4y-1 bit, namely, data from the END3PTR[y-1:0] field.
[0046] Among them, n=4 in Table 1 is valid, which means that when n is equal to 4, the CXSCNTL data includes the data from the 3x+n bit to the 4x+n-1 bit, that is, the data of the START3PTR[x-1:0] field, and the CXSCNTL data includes the data from the 4x+3n+3y bit to the 4x+3n+4y-1 bit, that is, the data of the END3PTR[y-1:0] field. n≥3 in Table 1 is valid, which means that when n is greater than or equal to 3, the CXSCNTL data includes the data from the 2x+n bit to the 3x+n-1 bit, that is, the data of the START2PTR[x-1:0] field, and the CXSCNTL data includes the data from the 4x+3n+2y bit to the 4x+3n+3y-1 bit, that is, the data of the END2PTR[y-1:0] field. Each flit represents the data in each clock cycle.
[0047] The bit width of the first field data in the first data is equal to n bits, such as the bit width of the data in the START[n-1:0] field is equal to n bits; the bit width of the second field data in the first data is greater than or equal to 2x bits and less than or equal to 4x bits. If n is equal to 2, the second field data of the CXSCNTL data includes the data of the START0PTR[x-1:0] and START1PTR[x-1:0] fields, whose bit width is equal to 2x bits. If n is equal to 3, the second field data of the CXSCNTL data includes the data of the STA The data of the RT0PTR[x-1:0], START1PTR[x-1:0] and START2PTR[x-1:0] fields have a bit width of 3x bits. If n is 4, the second field data of the CXSCNTL data includes the data of the START0PTR[x-1:0], START1PTR[x-1:0], START2PTR[x-1:0] and START3PTR[x-1:0] fields, and its bit width is 4x bits; the bit width of the third field data in the first data is The bit width of the data in the 4th field of the first data is equal to n bits, such as the bit width of the data in the ENDERROR[n-1:0] field is equal to n bits; the bit width of the data in the 5th field of the first data is greater than or equal to 2y bits and less than or equal to 4y bits. If n is equal to 2, the data in the 5th field of the CXSCNTL data includes the data in the END0PTR[y-1:0] and END1PTR[y-1:0] fields, and its bit width is equal to 2y bits. In particular, if n is equal to 3, the data of the 5th field of CXSCNTL data includes the data of the END0PTR[y-1:0], END1PTR[y-1:0] and END2PTR[y-1:0] fields, and its bit width is equal to 3y bits. If n is equal to 4, the data of the 5th field of CXSCNTL data includes the data of the END0PTR[y-1:0], END1PTR[y-1:0], END2PTR[y-1:0] and END3PTR[y-1:0] fields, and its bit width is equal to 4y bits.
[0048] It should be noted that x=log2(m / 128), y=log2(m / 32), m is the width of the target data, and n is the maximum number of data packets in the target data within one clock cycle. Specifically, m is the value of the CXSDATAFLITWIDTH parameter in the CXS data, and n is the value of the CXSMAXPKTPERFLIT parameter. Normally, CXSCNTL data includes seven cases: n=2, m=256, n=2, m=512, n=2, m=1024, n=3, m=512, n=3, m=1024, n=4, m=512, and n=4, m=1024. The bit width of CXSCNTL data is w=n*(x+y+3).
[0049] Table 1
[0050]
[0051] Table 2
[0052]
[0053] In some embodiments of the present application, the first field data and the second field data of the first data may be converted into the first field data of the second data, and the third field data and part of the fifth field data of the first data may be converted into the second field data of the second data.
[0054] Taking the example that the first data is CXSCNTL data and the second data is CNTL_CODE data, as shown in Tables 1 and 2, the data of the START[n-1:0], START0PTR[x-1:0], START1PTR[x-1:0], START2PTR[x-1:0] and START3PTR[x-1:0] fields are converted into the data of the ST_CODE[n-1:0] field, and the data of the END[n-1:0] field and part of the data of the END0PTR[y-1:0], END1PTR[y-1:0], END2PTR[y-1:0] and END3PTR[y-1:0] fields are converted into the data of the END_CODE[n-1:0] field.
[0055] Among them, the data of the ST_CODE[n-1:0] field is the CNTL_CODE data, i.e., the first field data in the second data, i.e., the data from the 0th bit to the n-1th bit, and the data of the END_CODE[n-1:0] field is the CNTL_CODE data, i.e., the second field data in the second data, i.e., the data from the nth bit to the 2n-1th bit. Moreover, the bit width of the data of the ST_CODE[n-1:0] field, i.e., the first field data in the second data, is equal to n bits, and the bit width of the data of the END_CODE[n-1:0] field, i.e., the second field data in the second data, is equal to n bits. Based on this, after the first data is converted into the second data, the reduced bit width is greater than 2x+2y and less than 4x+4y.
[0056] Of course, the present application is not limited to this. In other embodiments, only the first field data and the second field data of the first data may be converted into the first field data of the second data, and the third field data to the fifth field data of the first data are respectively the second field data to the fourth field data of the second data. For example, only the data of the START[n-1:0], START0PTR[x-1:0], START1PTR[x-1:0], START2PTR[x-1:0] and START3PTR[x-1:0] fields are converted into the data of the ST_CODE[n-1:0] field. Based on this, after the first data is converted into the second data, the reduced bit width is greater than or equal to 2x and less than or equal to 4x.
[0057] In other embodiments, only the third field data and part of the fifth field data of the first data may be converted into the second field data of the second data. For example, only the data of the END[n-1:0] field and part of the data of the END0PTR[y-1:0], END1PTR[y-1:0], END2PTR[y-1:0], and END3PTR[y-1:0] fields are converted into the data of the END_CODE[n-1:0] field. Based on this, after the first data is converted into the second data, the reduced bit width is greater than 2y and less than 4y.
[0058] On this basis, in some embodiments, the data of the 2nd bit to the y-1th bit of each subfield data in the 3rd field data and the 5th field data in the first data can be converted into the 2nd field data in the second data. As shown in Table 1 and Table 2, the data of the END[n-1:0] field and the data of the END0PTR[y-1:2], END1PTR[y-1:2], END2PTR[y-1:2] and END3PTR[y-1:2] fields can be converted into the data of the END_CODE[n-1:0] field.
[0059] On this basis, in some embodiments, the 4th field data in the first data can also be used as the 3rd field data in the second data, and the data from the 0th bit to the 1st bit of each sub-field data in the 5th field data in the first data can be used as the 4th field data to the 3+nth field data in the second data. In other words, the data from the 0th bit to the 1st bit of each sub-field data in the 4th field data and the 5th field data in the first data are not converted or compressed.
[0060] As shown in Tables 1 and 2, the data of the ENDERROR[n-1:0] field can be used as the data of the ENDERR_CODE[n-1:0] field, and the data of the END0PTR[1:0] field, the data of the END1PTR[1:0] field, the data of the END2PTR[1:0] field, and the data of the END3PTR[1:0] field can be used as the data of the END0PTR_CODE[1:0] field, the data of the END1PTR_CODE[1:0] field, the data of the END2PTR_CODE[1:0] field, and the data of the END3PTR[1:0] field, respectively.
[0061] Among them, the data of the ENDERR_CODE[n-1:0] field is the CNTL_CODE data, that is, the 3rd field data of the second data, the data of the END0PTR_CODE[1:0] field is the CNTL_CODE data, that is, the 4th field data of the second data, the data of the END1PTR_CODE[1:0] field is the CNTL_CODE data, that is, the 5th field data of the second data, the data of the END2PTR_CODE[1:0] field is the CNTL_CODE data, that is, the 6th field data of the second data, and the data of the END3PTR_CODE[1:0] field is the CNTL_CODE data, that is, the 7th field data of the second data.
[0062] Moreover, the bit width of the data of the ENDERR_CODE[n-1:0] field, i.e., the 3rd field data of the second data, is equal to n bits, the bit width of the data of the END0PTR_CODE[1:0] field, i.e., the 4th field data of the second data, is equal to 2 bits, the bit width of the data of the END1PTR_CODE[1:0] field, i.e., the 5th field data of the second data, is equal to 2 bits, the bit width of the data of the END2PTR_CODE[1:0] field, i.e., the 6th field data of the second data, is equal to 2 bits, and the bit width of the data of the END3PTR_CODE[1:0] field, i.e., the 7th field data of the second data, is equal to 2 bits.
[0063] Among them, n=4 in Table 2 is valid, which means that when n is equal to 4, the CNTL_CODE data includes the seventh field data, that is, the data of the END3PTR_CODE[1:0] field. n≥3 in Table 2 is valid, which means that when n is greater than or equal to 3, the CNTL_CODE data includes the sixth field data, that is, the data of the END2PTR_CODE[1:0] field.
[0064] In the embodiment of the present application, the conversion method or compression method between the first data and the second data is simple in logic, easily meets the timing requirements, and does not increase too much delay.
[0065] In some embodiments, taking n=2 and m=256 as an example, x=1, y=3, and w=14 can be calculated according to the above formula. Substituting x=1, y=3, and n=2 into Table 1, CXSCNTL data, i.e., first data, can be obtained, as shown in Table 3. Substituting x=1, y=3, and n=2 into Table 2, CNTL_CODE data, i.e., second data, can be obtained, as shown in Table 4.
[0066] Table 3
[0067]
[0068] Table 4
[0069]
[0070] In some embodiments, as shown in Table 5, the values of START[1:0], START0PTR[0], and START1PTR[0] may be arranged and combined to convert to the corresponding value of CNTL_CODE[1:0]. For example, if the value of START[1:0] is "01", the value of START0PTR[0] is "1", and the value of START1PTR[0] is "-", then the corresponding value of CNTL_CODE[1:0] is "10".
[0071] As shown in Table 6, the values of END[1:0], END0PTR[2], and END1PTR[2] can be arranged and combined to convert to the corresponding value of CNTL_CODE[5:4]. For example, if the value of END[1:0] is "01", the value of END0PTR[2] is "0", and the value of END1PTR[2] is "-", then the corresponding value of CNTL_CODE[5:4] is "01".
[0072] Among them, "-" represents a value that does not matter, which may be "0" or "1". In general, "-" can be decoded into "0". Based on this, the CXSCNTL data with a bit width of 14, i.e., the first data, can be converted into the CNTL_CODE data with a bit width of 10, i.e., the second data, thereby reducing the invalid transmission of 4 bits of data, and further reducing 28.6% of redundant data transmission.
[0073] Table 5
[0074] START1PTR[0] START0PTR[0] START[1:0] CNTL_CODE[1:0] - - 00 00 - 1 01 10 - 0 01 01 1 0 11 11
[0075] Table 6
[0076] END1PTR[2] END0PTR[2] END[1:0] CNTL_CODE[5:4] - - 00 00 - 0 01 01 - 1 01 10 1 0 11 11
[0077] In other embodiments, taking n=4 and m=512 as an example, x=2, y=4, and w=36 can be calculated according to the above formula. Substituting x=2, y=4, and n=4 into Table 1 can obtain CXSCNTL data, as shown in Table 7. Substituting x=2, y=4, and n=4 into Table 2 can obtain CNTL_CODE data, as shown in Table 8.
[0078] Table 7
[0079]
[0080] Table 8
[0081]
[0082] In some embodiments, as shown in Table 9, the values of START[3:0], START0PTR[1:0], START1PTR[1:0], START2PTR[1:0], and START3PTR[1:0] may be arranged and combined to convert to the corresponding value of CNTL_CODE[3:0]. For example, if the value of START[3:0] is "0001", the value of START0PTR[1:0] is "00", the value of START1PTR[1:0] is "-", the value of START2PTR[1:0] is "-", and the value of START3PTR[1:0] is "-", then the corresponding value of CNTL_CODE[3:0] may be "0001".
[0083] As shown in Table 10, the values of END[3:0], END0PTR[3:2], END1PTR[3:2], END2PTR[3:2], and END3PTR[3:2] can be arranged and combined to convert to the corresponding value of CNTL_CODE[11:8]. For example, if the value of END[3:0] is "0001", the value of END0PTR[3:2] is "00", the value of END1PTR[3:2] is "-", the value of END2PTR[3:2] is "-", and the value of END3PTR[3:2] is "-", then the corresponding value of CNTL_CODE[11:8] is "0001".
[0084] Based on this, the CXSCNTL data with a bit width of 36, ie, the first data, can be converted into the CNTL_CODE data with a bit width of 20, ie, the second data, thereby reducing the invalid transmission of 16 bits of data and further reducing 28.6% of redundant data transmission.
[0085] Table 9
[0086]
[0087] Table 10
[0088]
[0089] It can be understood that the five cases of n=2, m=512, n=2, m=1024, n=3, m=512, n=3, m=1024, and n=4, m=1024 are similar to the above two cases and will not be described in detail here.
[0090] As another optional implementation of the content disclosed in the present application, the embodiment of the present application also discloses a data transmission method, which is applied to a second data transmission device, the second data transmission device is communicatively connected to the first data transmission device, and the first data transmission device and the second data transmission device both include a CXS data transmission device, such as Figure 3 As shown, Figure 3 This is a flowchart of a data transmission method disclosed in an embodiment of the present application. The data transmission method includes:
[0091] S201: Acquire target data output by a first data transmission device, where the target data includes at least one data packet and second data.
[0092] After the first data transmission device acquires the target data to be transmitted, it converts the target data including at least one data packet and the first data into target data including at least one data packet and the second data, and transmits the target data to the second data transmission device.
[0093] S202: Convert the second data into corresponding first data, where the first data is used to indicate the start position and the end position of the data packet in the target data, and the bit width of the second data is smaller than the bit width of the first data.
[0094] After the second data transmission device receives or obtains the target data including at least one data packet and the second data, it converts the second data into the corresponding first data, and obtains the target data including at least one data packet and the first data, so that the protocol layer or physical layer where the second data transmission device is located performs related operations based on the original target data including at least one data packet and the first data. In other words, the embodiment of the present application can achieve lossless compression of the first data.
[0095] Based on this, not only can the invalid transmission of part of the first data be reduced by converting or compressing the first data into the second data before the first data transmission device outputs the target data, thereby improving the bandwidth utilization and data transmission efficiency, but also the normal operation of the protocol layer or physical layer where the second data transmission device is located can be ensured by converting or decompressing the second data into the first data after the second data transmission device receives the target data. In other words, the improvement of bandwidth utilization and data transmission efficiency can be achieved without improving the protocol layer or physical layer where the second data transmission device is located.
[0096] In some embodiments of the present application, at least one field data in the second data can be converted into at least two field data in the first data, and the bit width of at least one field data is smaller than the bit width of at least two field data. That is, when the first data transmission device converts the data of at least two fields in the first data into the data of at least one field in the second data, the second data transmission device converts the data of at least one field in the second data into the data of at least two fields in the first data.
[0097] In some embodiments of the present application, the first data includes first field data, second field data, third field data, fourth field data and fifth field data, the first field data is used to indicate the start number of data packets in the target data in each clock cycle, the second field data is used to indicate the start position of the data packets in the target data in each clock cycle, the third field data is used to indicate the end number of data packets in the target data in each clock cycle, the fourth field data is used to indicate whether there is an error in the data packet that ends in each clock cycle, and the fifth field data is used to indicate the end position of the data packet in the target data in each clock cycle.
[0098] In the case where the first data transmission device converts the first field data and the second field data in the first data into the first field data in the second data, the second data transmission device converts the first field data in the second data into the first field data and the second field data in the first data, and the bit width of the first field data in the second data is smaller than the sum of the bit widths of the first field data and the second field data in the first data, and / or, in the case where the first data transmission device converts the third field data and part of the fifth field data in the first data into the second field data in the second data, the second data transmission device converts the second field data in the second data into the third field data and part of the fifth field data in the first data, and the bit width of the second field data in the second data is smaller than the sum of the bit widths of the third field data and part of the fifth field data in the first data.
[0099] In some embodiments, as shown in Table 1 and Table 2, taking the first data as CXSCNTL data and the second data as CNTL_CODE data as an example, the first data transmission device converts the data of the START[n-1:0], START0PTR[x-1:0], START1PTR[x-1:0], START2PTR[x-1:0], and START3PTR[x-1:0] fields into the data of the ST_CODE[n-1:0] field, and converts the data of the END[n-1:0] field and part of the data of the END0PTR[y-1:0], END1PTR[y-1:0], END2PTR[y-1:0], and END3PTR[y-1:0] fields into the data of the ST_CODE[n-1:0] field. In the case where the data is converted into the data of the END_CODE[n-1:0] field, the second data transmission device converts the data of the ST_CODE[n-1:0] field into the data of the START[n-1:0], START0PTR[x-1:0], START1PTR[x-1:0], START2PTR[x-1:0] and START3PTR[x-1:0] fields, and converts the data of the END_CODE[n-1:0] field into the data of the END[n-1:0] field and part of the data of the END0PTR[y-1:0], END1PTR[y-1:0], END2PTR[y-1:0] and END3PTR[y-1:0] fields.
[0100] In some embodiments of the present application, the 5th field data in the first data includes n sub-field data, and when the first data transmission device converts the 2nd bit to the y-1th bit of each sub-field data in the 3rd field data and the 5th field data in the first data into the 2nd field data in the second data, the second data transmission device converts the 2nd field data in the second data into the 3rd field data and the 5th field data in the first data and the 2nd bit to the y-1th bit of each sub-field data.
[0101] As shown in Tables 1 and 2, when the first data transmission device converts the data of the END[n-1:0] field and the data of the END0PTR[y-1:2], END1PTR[y-1:2], END2PTR[y-1:2] and END3PTR[y-1:2] fields into the data of the END_CODE[n-1:0] field, the second data transmission device converts the data of the END_CODE[n-1:0] field into the data of the END[n-1:0] field and the data of the END0PTR[y-1:2], END1PTR[y-1:2], END2PTR[y-1:2] and END3PTR[y-1:2] fields.
[0102] On this basis, in some embodiments of the present application, when the first data transmission device uses the 4th field data in the first data as the 3rd field data in the second data, and uses the 0th to 1st bit data of each sub-field data in the 5th field data in the first data as the 4th to 3+n field data in the second data, the second data transmission device uses the 3rd field data in the second data as the 4th field data in the first data, and uses the 4th to 3+n field data in the second data as the 0th to 1st bit data of each sub-field data in the 5th field data in the first data.
[0103] As shown in Tables 1 and 2, in the first data transmission device, the data of the ENDERROR[n-1:0] field is used as the data of the ENDERR_CODE[n-1:0] field, and the data of the END0PTR[1:0] field, the data of the END1PTR[1:0] field, the data of the END2PTR[1:0] field, and the data of the END3PTR[1:0] field are used as the data of the END0PTR_CODE[1:0] field, the data of the END1PTR_CODE[1:0] field, the data of the END2PTR_CODE[1:0] field, and the data of the END3PTR[1:0] field, respectively. In the case of data, the second data transmission device uses the data of the ENDERR_CODE[n-1:0] field as the data of the ENDERROR[n-1:0] field, and uses the data of the END0PTR_CODE[1:0] field, the data of the END1PTR_CODE[1:0] field, the data of the END2PTR_CODE[1:0] field, and the data of the END3PTR_CODE[1:0] field as the data of the END0PTR[1:0] field, the data of the END1PTR[1:0] field, the data of the END2PTR[1:0] field, and the data of the END3PTR_CODE[1:0] field, respectively.
[0104] It should be noted that the second data transmission device in the present application can use the same mapping relationship or conversion formula as the first data transmission device to achieve the reverse conversion or decompression of the second data and the first data, which will not be repeated here. It should also be noted that the bit position, field, meaning, bit width and value of the CXSCNTL data and CNTL_CODE data have been described in detail in the previous embodiments, which will not be repeated here.
[0105] As another optional implementation of the disclosure of the present application, an embodiment of the present application further discloses a data transmission device, the data transmission device includes a CXS data transmission device, the data transmission device includes a storage unit and a processing unit, the storage unit is used to store instructions, and the processing unit is used to execute the data transmission method disclosed in any of the above embodiments according to the instructions stored in the storage unit. The data transmission device can be a first data transmission device or a second data transmission device.
[0106] In some embodiments of the present application, Figure 4 As shown, Figure 4This is a schematic diagram of a data transmission method of a chip disclosed in an embodiment of the present application. The protocol layer compresses the first data in the target data into corresponding second data through the first CXS data transmission device CXS1, and transmits the target data including the second data to the second CXS data transmission device CXS2 of the link layer or the physical layer or the adaptation layer. The second CXS data transmission device CXS2 of the link layer or the physical layer or the adaptation layer decompresses the second data in the target data into the first data.
[0107] Alternatively, the link layer or physical layer or adaptation layer compresses the first data in the target data into corresponding second data through the first CXS data transmission device CXS1, and transmits the target data including the second data to the second CXS data transmission device CXS2 of the protocol layer, and the second CXS data transmission device CXS2 of the protocol layer decompresses the second data in the target data into the first data.
[0108] Of course, the present application is not limited to this. In other embodiments, such as Figure 5 As shown, Figure 5 A schematic diagram of a data transmission method of a chip disclosed in an embodiment of the present application, the protocol layer of the first chip compresses the first data in the target data into the corresponding second data through the first CXS data transmission device CXS1, and transmits the target data including the second data to the second CXS data transmission device CXS2 of the link layer, physical layer or adaptation layer of the first chip, the link layer, physical layer or adaptation layer of the first chip transmits the target data including the second data to the link layer, physical layer or adaptation layer of the second chip, the first CXS data transmission device CXS1 of the link layer, physical layer or adaptation layer of the second chip transmits the target data including the second data to the second CXS data transmission device CXS2 of the protocol layer of the second chip, and the second CXS data transmission device CXS2 of the protocol layer of the second chip decompresses the second data in the target data into the first data. Based on this, the target data in the transmission process can always be the compressed target data, that is, the target data including the second data, so as to improve the data transmission efficiency.
[0109] Alternatively, the protocol layer of the second chip compresses the first data in the target data into corresponding second data through the first CXS data transmission device CXS1, and transmits the target data including the second data to the protocol layer of the first chip through the link layer or physical layer or adaptation layer of the second chip and the link layer or physical layer or adaptation layer of the first chip, and the second CXS data transmission device CXS2 of the protocol layer of the first chip then decompresses the second data in the target data into the first data.
[0110] As another optional implementation of the contents disclosed in the present application, an embodiment of the present application further discloses a computer-readable storage medium, characterized in that instructions for enabling a computer to execute the data transmission method disclosed in any of the above embodiments are stored thereon.
[0111] As another optional implementation of the contents disclosed in the present application, an embodiment of the present application also discloses a system on chip, including a first data transmission device and a second data transmission device, the first data transmission device and the second data transmission device both include a CXS data transmission device, the first data transmission device is used to execute the data transmission method applied to the first data transmission device, and the second data transmission device is used to execute the data transmission method applied to the second data transmission device.
[0112] As another optional implementation of the disclosure of the present application, the present application also discloses an electronic device, including the data transmission device disclosed in any of the above embodiments, or the computer-readable storage medium disclosed in any of the above embodiments, or the system-on-chip disclosed in any of the above embodiments. The electronic device includes a smart phone or a tablet computer, etc.
[0113] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0114] The above embodiments only express several implementation methods of this specification, and the descriptions are relatively specific and detailed, but they cannot be understood as limiting the scope of the patent application. It should be pointed out that for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of this specification, which all belong to the protection scope of this specification. Therefore, the protection scope of the patent of this specification shall be based on the attached claims.
Claims
1. A data transmission method, characterized in that: Applied to a first data transmission device, the first data transmission device is communicatively connected with a second data transmission device, the first data transmission device and the second data transmission device both include CXS data transmission devices, and the data transmission method includes: Acquire target data to be transmitted, the target data comprising at least one data packet and first data; the first data is used to indicate the start position and end position of the data packet in the target data; the target data comprises CXS data; the first data comprises CXSCNTL data; Converting data of at least two fields in the first data into data of at least one field in the second data, wherein a bit width of the data of the at least one field is smaller than a bit width of the data of the at least two fields; The target data is transmitted to the second data transmission device.
2. The data transmission method according to claim 1, characterized in that: The first data includes first field data, second field data, third field data, fourth field data and fifth field data, wherein the first field data is used to indicate the start number of data packets in the target data in each clock cycle, the second field data is used to indicate the start position of the data packets in the target data in each clock cycle, the third field data is used to indicate the end number of data packets in the target data in each clock cycle, the fourth field data is used to indicate whether the data packets ending in each clock cycle have errors, and the fifth field data is used to indicate the end position of the data packets in the target data in each clock cycle, and the converting of at least two field data in the first data into at least one field data in the second data includes: Converting the first field data and the second field data in the first data into the first field data in the second data, wherein the bit width of the first field data in the second data is smaller than the sum of the bit widths of the first field data and the second field data in the first data; And / or, converting the third field data and part of the fifth field data in the first data into the second field data in the second data, the bit width of the second field data in the second data being smaller than the sum of the bit widths of the third field data and part of the fifth field data in the first data.
3. The data transmission method according to claim 2, characterized in that: The bit width of the first field data in the first data is equal to n bits, the bit width of the second field data in the first data is greater than or equal to 2x bits and less than or equal to 4x bits, and the bit width of the first field data in the second data is equal to n bits; The bit width of the third field data in the first data is equal to n bits, the bit width of the fifth field data in the first data is greater than or equal to 2y bits and less than or equal to 4y bits, and the bit width of the second field data in the second data is equal to n bits; Wherein, x=log2(m / 128), y=log2(m / 32), m is the width of the target data, and n is the maximum number of data packets in the target data within one clock cycle.
4. The data transmission method according to claim 2, characterized in that: The fifth field data in the first data includes n sub-field data, and the converting the third field data and part of the fifth field data in the first data into the second field data in the second data includes: Convert the data from the 2nd bit to the y-1th bit of each sub-field data in the 3rd field data and the 5th field data in the first data into the 2nd field data in the second data; y=log2(m / 32), m is the width of the target data, and n is the maximum number of data packets in the target data within one clock cycle.
5. The data transmission method according to claim 4, characterized in that: Also includes: Using the fourth field data in the first data as the third field data in the second data; The data from the 0th bit to the 1st bit of each sub-field data in the 5th field data in the first data are respectively used as the 4th field data to the 3+nth field data in the second data.
6. The data transmission method according to claim 5, characterized in that: The bit width of the 3rd field data in the second data is equal to n bits; the bit width of the 4th field data to the 3+nth field data in the second data is greater than or equal to 4 bits and less than or equal to 8 bits.
7. A data transmission method, characterized in that: Applied to a second data transmission device, the second data transmission device is communicatively connected with a first data transmission device, the first data transmission device and the second data transmission device both include CXS data transmission devices, and the data transmission method includes: Acquire target data output by the first data transmission device, wherein the target data includes at least one data packet and second data; Convert at least one field data in the second data into at least two field data in the first data; the first data is used to indicate the start position and end position of the data packet in the target data; the bit width of the at least one field data is smaller than the bit width of the at least two field data; the target data includes CXS data; the first data includes CXSCNTL data.
8. The data transmission method according to claim 7, characterized in that: The first data includes first field data, second field data, third field data, fourth field data and fifth field data, wherein the first field data is used to indicate the start number of data packets in the target data in each clock cycle, the second field data is used to indicate the start position of the data packets in the target data in each clock cycle, the third field data is used to indicate the end number of data packets in the target data in each clock cycle, the fourth field data is used to indicate whether the data packets ending in each clock cycle have errors, and the fifth field data is used to indicate the end position of the data packets in the target data in each clock cycle, and the converting at least one field data in the second data into at least two field data in the first data includes: Converting the first field data in the second data into the first field data and the second field data in the first data, wherein the bit width of the first field data in the second data is smaller than the sum of the bit widths of the first field data and the second field data in the first data; And / or, converting the second field data in the second data into the third field data and part of the fifth field data in the first data, the bit width of the second field data in the second data being smaller than the sum of the bit widths of the third field data and part of the fifth field data in the first data.
9. The data transmission method according to claim 8, characterized in that: The bit width of the first field data in the first data is equal to n bits, the bit width of the second field data in the first data is greater than or equal to 2x bits and less than or equal to 4x bits, and the bit width of the first field data in the second data is equal to n bits; The bit width of the third field data in the first data is equal to n bits, the bit width of the fifth field data in the first data is greater than or equal to 2y bits and less than or equal to 4y bits, and the bit width of the second field data in the second data is equal to n bits; Wherein, x=log2(m / 128), y=log2(m / 32), m is the width of the target data, and n is the maximum number of data packets in the target data within one clock cycle.
10. The data transmission method according to claim 8, characterized in that: The fifth field data in the first data includes n sub-field data, and the converting the second field data in the second data into the third field data and part of the fifth field data in the first data includes: Convert the second field data in the second data into the data from the second bit to the y-1th bit of each sub-field data in the third field data and the fifth field data in the first data; y=log2(m / 32), m is the width of the target data; n is the maximum number of data packets in the target data within one clock cycle.
11. The data transmission method according to claim 10, characterized in that: Also includes: Using the third field data in the second data as the fourth field data in the first data; The 4th field data to the 3+nth field data in the second data are used as the data of the 0th bit to the 1st bit of each sub-field data in the 5th field data in the first data.
12. The data transmission method according to claim 11, characterized in that: The bit width of the 3rd field data in the second data is equal to n bits; the bit width of the 4th field data to the 3+nth field data in the second data is greater than or equal to 4 bits and less than or equal to 8 bits.
13. A data transmission device, characterized in that: The data transmission device comprises a CXS data transmission device, and the data transmission device comprises a storage unit and a processing unit; The storage unit is used to store instructions; The processing unit is used to execute the data transmission method according to any one of claims 1 to 12 according to the instructions stored in the storage unit.
14. A computer-readable storage medium, characterized in that: Instructions for causing a computer to execute the data transmission method according to any one of claims 1 to 12 are stored thereon.
15. A system on chip, characterized in that: It includes a first data transmission device and a second data transmission device, wherein the first data transmission device and the second data transmission device both include CXS data transmission devices, the first data transmission device is used to execute the data transmission method described in any one of claims 1 to 6, and the second data transmission device is used to execute the data transmission method described in any one of claims 7 to 12.
16. An electronic device, characterized in that: Includes the data transmission device of claim 13 or the computer-readable storage medium of claim 14 or the system on chip of claim 15.
Citation Information
Patent Citations
Data reading method and device, data writing method and device, bandwidth conversion device and electronic equipment
CN116431079A
Technique for handling protocol conversion
US20220283972A1