Data transmission method and related product
By using data encapsulation and packet assembly methods, the problems of blocking and locking in data transmission between chips are solved, achieving efficient data transmission and meeting the interconnection requirements of high bandwidth and low power consumption between chips.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-24
- Publication Date
- 2026-03-24
AI Technical Summary
Existing technologies suffer from data blocking and locking issues in inter-chip data transmission, especially when using the AXI protocol, which cannot achieve multi-channel data transmission, resulting in low transmission efficiency.
Data blocks are encapsulated into data packets conforming to the chip protocol using data encapsulation and packet assembly methods. A target virtual channel is selected for transmission through a preset arbitration strategy. A state machine is used to control the packet assembly process to ensure that the data packets conform to the format requirements of the data logic interface and are sent directly through the data logic interface.
It achieves high-bandwidth, low-power data interconnection between chips, avoiding data blocking and locking, and improving transmission efficiency and accuracy.
Smart Images

Figure CN121728176A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of communication technology, specifically to a data transmission method, apparatus, electronic device, computer-readable storage medium, and computer program product. Background Technology
[0002] A chiplet protocol refers to the rules and standards used to connect and manage communication between chiplets. It ensures that small chips with different functions and manufactured using different processes can work together efficiently and reliably. Chiplet technology breaks down traditional monolithic chips into multiple modular chips and integrates them through advanced packaging. The chiplet protocol defines key mechanisms such as data transmission, routing, consistency, and reliability. Chiplet protocols are typically divided into a physical layer (defining electrical characteristics and pin layout) and a protocol stack (specifying data packet format, flow control, error handling, etc.) to achieve reliable end-to-end transmission. Summary of the Invention
[0003] This disclosure provides a data transmission method, apparatus, electronic device, computer-readable storage medium, and computer program product.
[0004] In a first aspect, embodiments of this disclosure propose a data transmission method applied to a data sending end. The method includes: encapsulating a first data block received from a service port of the data sending end into a first data packet; based on the service port, assembling the first data packet into a second data packet; and sending the second data packet to a data receiving end through a data logic interface based on a preset data transmission protocol. The data logic interface corresponds to the preset data transmission protocol, and the second data packet is formatted data conforming to the specifications of the data logic interface.
[0005] In some embodiments, a service port includes multiple virtual channels, and a storage module is configured corresponding to the service port; encapsulating a first data block received from the service port of the data sending end into a first data packet includes: writing the first data block received from the service port of the data sending end into the storage module, wherein the storage module stores the first data block according to the virtual channel corresponding to the first data block; determining a target virtual channel from multiple virtual channels using a preset arbitration strategy, and encapsulating the first data block corresponding to the target virtual channel in the storage module into a first data packet corresponding to the target virtual channel.
[0006] In some embodiments, determining a target virtual channel from multiple virtual channels by using a preset arbitration policy includes: determining the virtual channels that can be transmitted from the multiple virtual channels according to the valid status fields and available status fields of each virtual channel; wherein, the valid status field is used to identify whether a first data block corresponding to the virtual channel is stored in the storage module, and the available status field is used to identify whether the data receiving end can receive the first data block of the virtual channel; using the preset arbitration policy to determine the target virtual channel from the virtual channels that can be transmitted.
[0007] In some embodiments, the preset arbitration policy includes priority polling or weighted fair queue.
[0008] In some embodiments, the number of service ports is N, where N is a positive integer greater than 0; packetizing a first data packet group into a second data packet based on the service ports includes: obtaining the data to be packetized according to the first data packets read from the N service ports to the data link; based on the current state of the state machine and the N service ports, packetizing the data to be packetized into a data packet with a preset data length in accordance with a preset port order to obtain the second data packet; wherein, the current state of the state machine is used to indicate the port number of the last first data packet that enters the data link currently.
[0009] In some embodiments, the current state of the state machine includes N port states set in one-to-one correspondence with the N service ports; packetizing the data to be packetized into a data packet with a preset data length in accordance with a preset port order based on the current state of the state machine and the data to be packetized corresponding to the N service ports to obtain the second data packet includes: when the state machine is in the state of the i-th service port and the first cumulative length of the first cumulative data to be packetized is greater than or equal to the preset data length for the first time, determining the first target service port and jumping the current state of the state machine from the state of the i-th service port to the first target service port state corresponding to the first target service port; wherein, the first cumulative data to be packetized is obtained by sequentially adding the remaining data that was not packetized in the previous beat in the i-th service port and the data to be packetized of p service ports according to a first preset rule; the first preset rule is: polling the N service ports in accordance with the preset port order and starting to add from the next service port after the i-th service port; the first target service port is the service port corresponding to the addition of p service ports; packetizing according to the remaining data and the order of the data to be packetized from the next service port after the i-th service port to the service port corresponding to the first target service port in accordance with the polling order to obtain the second data packet with the preset data length; wherein, 0 < i ≤ N, 0 < p < N, and both i and p are positive integers.
[0010] In some embodiments, based on the current state of the state machine and N service ports, the data to be packaged into data packets of a preset data length according to a preset port order to obtain a second data packet, the method further includes: when the state machine is in the state of the i-th service port and the second cumulative length corresponding to the second cumulative data to be packaged is less than the preset data length, determining whether the sum of the second cumulative length and the length of the data to be packaged in the i-th service port after re-polling is greater than or equal to the preset data length; wherein, the second cumulative data to be packaged is obtained by sequentially accumulating the remaining data in the i-th service port that was not packaged in the previous cycle according to a first preset rule and then adding the data to be packaged in N-1 service ports; if the sum of the second cumulative length and the length of the data to be packaged in the i-th service port after re-polling is greater than or equal to the preset data length, the current state of the state machine is kept in the state of the i-th service port; the remaining data, the data to be packaged in the order of the N-1 consecutive service ports starting from the next service port after the i-th service port according to the polling order, and the data to be packaged in the i-th service port after re-polling are packaged to obtain a second data packet of the preset data length.
[0011] In some embodiments, the current state of the state machine further includes an idle state. Based on the current state of the state machine and N service ports, the data to be packaged is packaged into a data packet of a preset data length according to a preset port order to obtain a second data packet. The process further includes: when the state machine is in the i-th service port state and the sum of the second cumulative length and the length of the data to be packaged in the i-th service port after the second polling is less than the preset data length, the current state of the state machine is switched from the i-th service port state to the idle state; the remaining data, the data to be packaged from the next service port after the i-th service port according to the polling order, the data to be packaged from the i-th service port after the second polling, and multiple empty bubble packets are packaged in the order to obtain a second data packet of the preset data length.
[0012] In some embodiments, the current state of the state machine further includes a no-operation state. Based on the current state of the state machine and the data to be packetized corresponding to N service ports, according to the preset port order, the data to be packetized is packetized into a data packet with a preset data length to obtain a second data packet, and it further includes: when the state machine is in the no-operation state, determining the starting service port for packetization according to the previous state of the state machine; when the third cumulative length corresponding to the third cumulative data to be packetized is greater than or equal to the preset data length for the first time, determining a second target service port, and changing the current state of the state machine from the no-operation state to the second target service port state corresponding to the second target service port; the third cumulative data to be packetized is obtained by polling the N service ports in the preset port order, starting from the starting service port, and successively adding the data to be packetized of p service ports; the second target service port is the service port corresponding to the addition of q service ports; where 0 < q ≤ N and q is a positive integer; packetizing the data to be packetized in the order from the starting service port to the second target port according to the polling order to obtain a second data packet with a preset data length.
[0013] In some embodiments, based on the current state of the state machine and N service ports, according to the preset port order, the data to be packetized is packetized into a data packet with a preset data length to obtain a second data packet, and it further includes: when the state machine is in the no-operation state and the fourth cumulative length corresponding to the fourth cumulative data to be packetized obtained by adding the data to be packetized of the N service ports is less than the preset data length, keeping the current state of the state machine in the no-operation state; packetizing the data to be packetized of the N service ports and the order of multiple null packets in the order of polling the N service ports in the preset port order starting from the starting service port to obtain a second data packet with a preset data length.
[0014] In a second aspect, the present disclosure further provides a data transmission method, which is applied to a data receiving end. The method further includes: based on a preset data transmission protocol, parsing the second data packet received through a data logic interface to obtain the packet length information of the first data packet; where the data logic interface corresponds to the preset data transmission protocol, and the second data packet is formatted data conforming to the specification of the data logic interface; the second data includes the first data packet; determining the data length of the first data packet according to the packet length information; and obtaining the first data packet according to the data offset and the data length.
[0015] In some embodiments, the packet length information includes a data type field, a header data field, a payload data field, and a full byte enable field; where the data type field is used to identify the service port corresponding to the first data packet; the header data field is used to identify whether the first data packet carries a communication request; the payload data field is used to identify whether the first data packet carries the data corresponding to the communication request; and the full byte enable field is used to identify whether all the data in the first data packet is valid.
[0016] In some embodiments, when the full-byte enable field indicates that there are invalid bytes in the data of the first data packet, the packet length information also includes a byte enable field, which is used to identify the validity of each byte in the first data packet.
[0017] In some embodiments, the second data packet includes multiple first data packets; obtaining the first data packet according to the data offset and the data length includes: starting from the initial data offset, according to the arrangement order of each first data packet in the second data packet, sequentially adding the data offset of the previous first data packet to its data length to obtain the data offset of the next first data packet, and sequentially extracting data according to the data offset to obtain each first data packet.
[0018] Thirdly, embodiments of this disclosure also provide a data transmission apparatus, which includes: a packet encapsulation module for encapsulating a first data block received from a service port of a data sending end into a first data packet; a packet assembly module for assembling the first data packet into a second data packet based on the service port; and a sending module for sending the second data packet to a data receiving end through a data logic interface based on a preset data transmission protocol; wherein the data logic interface corresponds to the preset data transmission protocol, and the second data packet is formatted data conforming to the specifications of the data logic interface.
[0019] This embodiment of the disclosure encapsulates a first data block into a first data packet; furthermore, the first data packet is grouped according to the service port so that the obtained second data packet can meet the format requirements of the data logic interface of the preset data transmission protocol, and the second data packet can be directly sent to the data receiving end through the data logic interface, omitting the external conversion logic, and realizing high bandwidth and low power consumption interconnection between cores. Attached Figure Description
[0020] Other features, objects, and advantages of this disclosure will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings: Figure 1 A flowchart illustrating a data transmission method provided in this embodiment of the disclosure; Figure 2 A circuit diagram for packaging provided in an embodiment of this disclosure; Figures 3a-3b These are schematic diagrams illustrating the state machine transitions when there are two service ports, as provided in this embodiment of the disclosure. Figures 4a-4d These are schematic diagrams illustrating the state machine transitions when there are four service ports, as provided in this embodiment of the disclosure. Figure 5 A flowchart illustrating yet another data transmission method provided in this disclosure embodiment; Figure 6 This is a schematic diagram illustrating how a first data packet is obtained from a second data packet, as provided in an embodiment of this disclosure. Figure 7 This is a structural block diagram of a data transmission device provided in an embodiment of the present disclosure; Figure 8 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0021] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding; these should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description. It should be noted that, unless otherwise specified, the embodiments and features described in this disclosure can be combined with each other.
[0022] In related technologies, the AXI (Advanced eXtensible Interface) protocol is typically used in the data ports of chiplet transport protocols for inter-chip data transmission. However, the AXI protocol generally achieves data transmission through handshake signals, which can only achieve single-channel data transmission. This may lead to data blocking or locking during the data transmission process.
[0023] Based on this, this disclosure provides a data transmission method.
[0024] Figure 1 A flowchart illustrating a data transmission method provided in an embodiment of this disclosure.
[0025] See Figure 1 The process specifically includes the following steps: Step 101: Encapsulate the first data block received from the service port of the data sending end into a first data packet.
[0026] Specifically, a service port is a physical or logical communication interface that can be used to distinguish the direction of communication and functional roles. For example, a request port or a response port.
[0027] The first data block can be a flit (flow control unit) or a segmented message. After the first data block enters the service port, it can be used to generate a complete first data packet according to encapsulation rules. The first data packet is generally a data packet encapsulated with a specific frame structure for data transmission. Optionally, the frame structure corresponding to the first data packet can be determined according to the data transmission protocol of the data sending end; this disclosure does not impose any limitations on this.
[0028] Step 102: Based on the service port, reassemble the first data packet into a second data packet.
[0029] The number of service ports can be one or more. The first data block received by each service port is encapsulated into the first data packet corresponding to that service port. When assembling packets, packet assembly rules can be pre-set based on the service ports to assemble the first data packets corresponding to each service port into the second data packet.
[0030] Step 103: Based on the preset data transmission protocol, send the second data packet to the data receiving end through the data logic interface.
[0031] The data logic interface corresponds to the preset data transmission protocol, and the second data packet is formatted data that conforms to the specifications of the data logic interface.
[0032] Specifically, the preset data transmission protocol refers to the protocol used for data transmission between the data sender and the data receiver. The data logic interface corresponds to the preset data transmission protocol and refers to the standardized data logic interface between the protocol layer and the adaptation layer in the preset transmission protocol. Optionally, the preset transmission protocol can be a chiplet protocol to implement chiplet interconnection. The chiplet protocol can be the UCIe (Universal Chiplet Interconnect Express) protocol, supporting high-bandwidth, low-latency interconnection. Correspondingly, the data logic interface can be an FDI (Field Device Integration) interface. Of course, the chiplet protocol can also be other protocols, such as CXL (Compute Express Link), and correspondingly, the data logic interface can also be other types of communication protocol interfaces; this disclosure does not limit this.
[0033] The data format of the first data packet is different from that of the data logic interface specification. Therefore, the first data packet cannot be transmitted directly through the data logic interface. It needs to be converted into data in a format that conforms to the data logic interface specification before it can be transmitted to the data receiving end through the data logic interface.
[0034] This embodiment of the present disclosure encapsulates a first data block into a first data packet, and then groups the first data packet according to the service port, so that the obtained second data packet can meet the format requirements of the data logic interface of the preset data transmission protocol. The second data packet can be directly sent to the data receiving end through the data logic interface, omitting the external conversion logic and realizing high bandwidth and low power consumption interconnection between chiplets.
[0035] In response to the above Figure 1 In step 101, after the service port receives the first data block, it first stores the first data block, and then encapsulates the first data block based on a preset arbitration strategy. A specific implementation method is given below.
[0036] In some embodiments, a service port includes multiple virtual channels, and a storage module is configured corresponding to the service port; encapsulating a first data block received from the service port of the data sending end into a first data packet includes: writing the first data block received from the service port of the data sending end into the storage module; the storage module storing the first data block according to the virtual channel corresponding to the first data block; determining a target virtual channel from multiple virtual channels using a preset arbitration strategy, and encapsulating the first data block corresponding to the target virtual channel in the storage module into a first data packet corresponding to the target virtual channel.
[0037] Specifically, a service port is a physical or logical communication interface that can be used to distinguish communication direction and functional roles. A service port can also be divided into multiple virtual channels (VCs) based on data logic. A virtual channel refers to a logical data flow channel used to achieve multi-path concurrent transmission on the same physical link, avoid deadlock, and improve throughput.
[0038] Each service port is configured with a separate storage module. After receiving the first data block, the service port first parses the channel attributes carried by the first data block (which can be explicit fields, implicit hashes, or storage location indexes) to determine the virtual channel it belongs to. Then, the first data block is written into the storage module, and the virtual channel corresponding to the first data block and the address of the storage module to which the first data block is written are recorded through a management table or other means. This achieves the separate management of first data blocks corresponding to different virtual channels by writing the first data blocks into the storage module according to their corresponding virtual channels. This ensures that the order of the first data packets in the same virtual channel remains unchanged, and different virtual channels can independently control flow or arbitrate, thus ensuring that the first data packets do not experience head-blocking during transmission; each virtual channel can independently perform credit counting.
[0039] Furthermore, each service port is also configured with a separate encapsulation module. For each service port, the corresponding encapsulation module first selects a target virtual channel from multiple target virtual channels corresponding to that service port according to a preset arbitration strategy, and then reads the first data block corresponding to the target virtual channel from the storage module and encapsulates it to obtain the first data packet.
[0040] Furthermore, in some embodiments, a target virtual channel is determined from multiple virtual channels using a preset arbitration strategy, including: determining a transmissible virtual channel from multiple virtual channels based on the valid status field and available status field of each virtual channel; wherein the valid status field is used to identify whether the storage module stores the first data block of the corresponding virtual channel, and the available status field is used to identify whether the data receiver can receive the first data block of the virtual channel; and determining the target virtual channel from the transmissible virtual channels using a preset arbitration strategy.
[0041] Specifically, Figure 2 This is a circuit diagram for packaging provided in an embodiment of the present disclosure.
[0042] like Figure 2 As shown, this circuit diagram is illustrated using a single service port as an example. Here, `to tx riu` and `from txriu` are bidirectional buses, originating from the arbitrator and the storage module's buffer, respectively, used for reading addresses, enabling reads, and sending data back. `req[X]` includes `req[0]`, `req[1]`, and `req[2]`, representing the selection signals for three virtual channels, used to identify whether the corresponding virtual channel participates in arbitration. Each `req[X]` signal is determined by the available status field `ivcX_avail` and the valid status field `rivct_ivcX_vld`. `rivct_ivcX_vld` indicates whether the corresponding virtual channel has a first data block in the storage module's buffer; simultaneously, `ivcX_avail` indicates whether the corresponding virtual channel has remaining credit available for this transmission. Only when the corresponding virtual channel has a first data block in its buffer and has remaining credit will the corresponding `req[X]` indicate that the virtual channel can participate in arbitration. `ivcid_req` is used to raise the request after a virtual channel wins arbitration, initiating the actual read pointer and reading the first data block corresponding to the winning virtual channel. `ack` is used to update the next winning virtual channel after the read operation is complete. `rrb` is an arbitrator used to select a target virtual channel from multiple eligible virtual channels according to a preset arbitration strategy.
[0043] In some embodiments, the preset arbitration strategy includes priority round-robin or weighted fair queue to prevent starvation.
[0044] The data transmission method provided in this embodiment of the present disclosure, by mapping virtual channels one-to-one with the cache area in the storage module, ensures that the first data blocks of different virtual channels are physically isolated before encapsulation, thus guaranteeing that the first data blocks of the same virtual channel are kept in order and that there is no head blocking between the first data blocks of different virtual channels; furthermore, the same first data packet only contains the first data blocks belonging to the same virtual channel, and the encapsulation module performs independent data encapsulation on each virtual channel to ensure end-to-end reliability by virtual channel.
[0045] Furthermore, when encapsulating the first data block into the first data packet, the size and format of the encapsulated first data packet may not be exactly the same depending on the different data transmission requests.
[0046] In some embodiments, the first data packet may include a data type field Type, a header field Head, a tail field Tail, a payload field HasPld, and a full-byte enable field FullBe. The type and size of the first data packet are determined by the values of each field in the first data packet.
[0047] The following explanation uses two business ports, request port and response port, as an example to illustrate each field. Here, flit represents the first data block.
[0048] Type=0 corresponds to the first data packet obtained from the request port packet being a request data packet (REQ-PKT), and Type=1 corresponds to the first data packet obtained from the response port packet being a response data packet (RSP-PKT). Head=1 indicates that this flit is the first data block of the header (hereinafter referred to as: head flit), where the head flit is generally used to carry key header information such as destination address, control commands, and transaction type. Tail=1 indicates that this flit is the first data block of the tail (hereinafter referred to as: tail flit), where the tail flit can generally be used to mark the end of the data packet and may carry checksum or control information, indicating that the data transmission of the current transaction has been completed. Head=0 and Tail=0 indicate that this flit is the first data block of the body (hereinafter referred to as: body flit), where the body flit is generally located after the head flit and is used to carry the actual data payload. It usually does not carry address or control commands and only contains valid data. HasPld=1 indicates that this flit contains payload data; HasPld=0 indicates that this flit does not contain payload. Data; among which, payload data refers to the core data in a message, frame, packet or message that is actually needed by the business / application, which is different from the overhead parts such as control headers, check codes, and synchronization words that are only used for transmission.
[0049] Optionally, the first data packet may also include fields such as TrId and Priority. TrId is a tool / library that identifies the true format of a file through its binary signature. The format library can be dynamically expanded for use in scenarios such as forensics, recovery, and email screening. Priority is used to identify the priority level.
[0050] For Type=0, that is, for the first data block from the request port, this first data block includes read request data and write request data. The read request data only includes the read request, while the write request data includes the write request and carries the target write data. Therefore, for the first data block from the request port, the length of the encapsulated first data packet has two cases: Head=1 and Head=0. When Head=1, there are three packet lengths: (1) When HasPld=0. The flit only has a Header and does not carry a Payload. That is, it corresponds to a read request and does not need to carry data. This case corresponds to the first packet length, such as 16 bytes; (2) When HasPld=1 and FullBe=1. That is, the flit has both a Header and a Payload. It corresponds to a write request, carries data, and all data is valid. This case corresponds to the second packet length, such as 80 bytes; (3) When HasPld=1 and FullBe=0. The flit has both a Header and a Payload. It corresponds to a write request, carries data, and there is invalid data in the data. Furthermore, the first data packet also includes a byte validity field strobebe, which is used to identify the validity of each byte. This case corresponds to the third packet length, such as 88 bytes.
[0051] Since the first scenario only includes a request and does not carry data, while the second and third scenarios include both requests and data, the first packet has the shortest length. Furthermore, in the second scenario, all data is valid, so there is no need to use a byte validity field to identify the validity of each byte. However, in the third scenario, invalid data exists, requiring an additional byte validity field to identify which data is valid; therefore, the third packet is longer than the second packet. Additionally, the specific lengths of the first, second, and third packets can be flexibly determined based on actual configuration, and this disclosure does not impose any limitations on this.
[0052] When head=0, HasPld must be 1. That is, for the same request, since there is already a Header, the subsequent first data packet does not need to include the Header, but only the Payload. At this time, there are no two packet lengths: (1) When FullBe=1. This flit only contains the Payload, and all data is valid. This case corresponds to the fourth packet length, such as 68 bytes. Compared with the second packet length, since it does not include the Header, the fourth packet length is less than the second packet length; (2) When FullBe=0. This flit only contains the Payload, and there is invalid data in the data. Therefore, it also includes the Strobe field to identify which data is valid. This case corresponds to the fifth packet length, such as 76 bytes. Since the fifth packet length does not include the Header, the fifth packet length is less than the third packet length; and since the fifth packet length includes the Strobe field, the fifth packet length is greater than the fourth packet length.
[0053] Similar to Type=0 above, for Type=1, that is, for the first data block from the response port, this first data block includes read response data and write response data. The read response data only includes the read response, while the write response data includes the write response and carries the target write data. Therefore, for the first data block from the request port, the length of the encapsulated first data packet has two cases: Head=1 and Head=0. When Head=1, there are two packet lengths: (1) When HasPld=0, the flit only has a Header and does not carry a Payload. That is, it corresponds to a read response and does not need to carry data. This case corresponds to the sixth packet length, such as 4 bytes; (2) When HasPld=1, the flit has both a Header and a Payload. That corresponds to a write response and carries data. This case corresponds to the seventh packet length, such as 68 bytes.
[0054] When Head=0, the flit contains only the payload, and the packet length is fixed at the seventh packet length, for example, 68 bytes.
[0055] Similarly, the specific lengths of the sixth, seventh, and eighth packages can be flexibly determined according to the actual configuration, and this disclosure does not impose any restrictions on them.
[0056] In response to the above Figure 1 In step 102, after encapsulating the first data block into a first data packet, the first data packet can be assembled into a second data packet that meets the requirements of the data interface.
[0057] In some embodiments, the number of service ports is N, where N is a positive integer greater than 0; based on the service ports, the first data packet is packaged into a second data packet, including: obtaining data to be packaged according to the first data packets read from the N service ports to the data link; wherein the data to be packaged corresponds to a service port; based on the current state of the state machine and the N service ports, the data to be packaged is packaged into a data packet of a preset data length according to a preset port order to obtain the second data packet; wherein the current state of the state machine is used to indicate the port number of the last first data packet entering the data link.
[0058] The obtained packet-assembly data can correspond to N service ports, or it can correspond to only a portion of the service ports. In other words, during the process of reading the first data packet from the N service ports to the data link, each service port may have a corresponding first data packet read out to obtain packet-assembly data, in which case the packet-assembly data corresponds to the N service ports; alternatively, only the first data packets corresponding to some service ports may be read out to obtain packet-assembly data, in which case the packet-assembly data corresponds to only some service ports, meaning that there may be service ports with empty packet-assembly data.
[0059] Specifically, the number of first data packets entering the data link per clock cycle (also called per beat) can be determined based on the bit width of the data transmitted in the data link and the size of each first data packet. As mentioned above, since the service ports and data types corresponding to the first data packets are different, the sizes of the first data packets may vary, ranging from the length of the first packet to the length of the seventh packet, etc. Therefore, the number of first data packets entering the data link per clock cycle may also be different; for example, 1 to 2 first data packets may be selected to enter the data link each time. Then, the first data packets entering the data link are used as data to be assembled into second data packets. When there are N service ports, the target service port with the corresponding data volume can be selected from the N service ports according to a preset port order based on the amount of first data packets that can enter the data link per clock cycle. The first data packets corresponding to the target service port then enter the data link to participate in packet assembly. Each target service port receives one first data packet per clock cycle.
[0060] The number of target service ports is less than or equal to N. On one hand, the number of target service ports is related to the amount of data in the first data packet that can enter the data link each clock cycle. If the amount of data in the first data packet that can enter the data link each clock cycle is less than the total amount of data packets from the first data packets entering the data link from N service ports, then the number of target service ports is less than N, and only the first data packets from a subset of service ports can be selected for data linking.
[0061] On the other hand, during the process of reading the first data packet from N service ports to the data link, the first data packet must exist in the corresponding service port before it can be read onto the data link. Optionally, if no corresponding first data block enters the service port within a certain period, the service port cannot obtain the first data packet from the first data block, resulting in no corresponding first data packet being read onto the data link. Furthermore, if a corresponding first data block enters the service port, but fails to encapsulate it into a first data packet for some reason, this will also result in no corresponding first data packet being read onto the data link. Therefore, the packet data to be assembled and read onto the data link may correspond to N service ports, or the first data packet corresponding to a service port may be empty.
[0062] The preset port order allows polling of N service ports in a specific sequence. Based on the current state of the state machine, the port number of the last first data packet entering the data link can be determined, thus enabling the assembly of data packets for the next service port based on port polling.
[0063] The preset data length is the length of data that meets the data interface's data format. In other words, the length of the second data packet obtained by assembling the packets is the preset data length.
[0064] This embodiment of the disclosure assembles the data to be assembled based on N service ports to obtain a second data packet. This ensures that during the assembly process, the first data packets of the same service port are assembled sequentially, and there is no service blockage between the first data packets of different service ports, thereby improving the efficiency and accuracy of data assembly.
[0065] In some embodiments, the current state of the state machine includes N port states that are set one-to-one with the N service ports.
[0066] Further, based on the current state of the state machine and N service ports, the data to be packetized is packetized into a data packet with a preset data length in accordance with the preset port order, to obtain a second data packet, including: when the state machine is in the state of the i-th service port and the first cumulative length corresponding to the first cumulative data to be packetized is greater than or equal to the preset data length for the first time, determining the first target service port, and jumping the current state of the state machine from the state of the i-th service port to the first target service port state corresponding to the first target service port; wherein, the first cumulative data to be packetized is obtained by sequentially adding the remaining data not packetized in the previous beat in the i-th service port and the data to be packetized of p service ports in accordance with the first preset rule; the first preset rule is: polling the N service ports in accordance with the preset port order, and starting to add from the next service port after the i-th service port; the first target service port is the service port corresponding to the addition of p service ports; packetizing in accordance with the remaining data and the order of the data to be packetized from the next service port after the i-th service port to the service port corresponding to the first target service port in accordance with the polling order, to obtain a second data packet with a preset data length; wherein, 0 < i ≤ N, 0 < p < N, and both i and p are positive integers.
[0067] Specifically, after each first data packet participates in packetization, there may be a first data packet remaining untransmitted from the previous beat in the data to be packetized of the corresponding service port. When packetizing, it is necessary to first let the first data packet remaining untransmitted from the previous beat participate in packetization, and then, in accordance with the port polling order, sequentially take the first data packets from other service ports for packetization until the total amount of the first data packets taken out can form a second data packet, packetize in accordance with the order, and jump the current state of the state machine to the first target service port state corresponding to the first target service port that finally enters the data link.
[0068] Among them, after the current packetization is completed, there may also be remaining data not packetized in the first data packet corresponding to the first target service port, which can participate in the next packetization in accordance with the above rules. In this way, it can be ensured that during the packetization process, the first data packets of the same service port are packetized in order, and there will be no service blockage between the first data packets of different service ports, improving the efficiency and accuracy of data packetization.
[0069] In some embodiments, based on the current state of the state machine and N service ports, the data to be packaged into data packets of a preset data length according to a preset port order to obtain a second data packet, the method further includes: when the state machine is in the state of the i-th service port and the second cumulative length corresponding to the second cumulative data to be packaged is less than the preset data length, determining whether the sum of the second cumulative length and the length of the data to be packaged in the i-th service port after re-polling is greater than or equal to the preset data length; wherein, the second cumulative data to be packaged is obtained by sequentially accumulating the remaining data in the i-th service port that was not packaged in the previous cycle according to a first preset rule and then adding the data to be packaged in N-1 service ports; if the sum of the second cumulative length and the length of the data to be packaged in the i-th service port after re-polling is greater than or equal to the preset data length, the current state of the state machine is kept in the state of the i-th service port; the remaining data, the data to be packaged in the order of the N-1 consecutive service ports starting from the next service port after the i-th service port according to the polling order, and the data to be packaged in the i-th service port after re-polling are packaged to obtain a second data packet of the preset data length.
[0070] Specifically, if after polling all N service ports, the remaining un-packed data from the previous cycle in service port i, combined with the data to be packaged from the next N-1 consecutive service ports following service port i in polling order, still cannot form a second data packet, and a new first data packet enters service port i in the current cycle, then the data to be packaged from service port i continues to be accumulated. If all the accumulated data to be packaged can form a second data packet, then the packets are packaged in the following order: the remaining data, the data to be packaged from the next N-1 consecutive service ports following service port i in polling order, and the data to be packaged from service port i after another poll. That is, during packet packaging, the data to be packaged from service port i after another poll is packaged last to ensure that the first data packets corresponding to the same service port are packaged in order, and that there is no header blocking between first data packets from different service ports.
[0071] In some embodiments, the current state of the state machine further includes an idle state. Based on the current state of the state machine and N service ports, the data to be packaged is packaged into a data packet of a preset data length according to a preset port order to obtain a second data packet. The process further includes: when the state machine is in the i-th service port state and the sum of the second cumulative length and the length of the data to be packaged in the i-th service port after the second polling is less than the preset data length, the current state of the state machine is switched from the i-th service port state to the idle state; the remaining data, the data to be packaged from the next service port after the i-th service port according to the polling order, the data to be packaged from the i-th service port after the second polling, and multiple empty bubble packets are packaged in the order to obtain a second data packet of the preset data length.
[0072] Specifically, when the data to be assembled from all N service ports is accumulated and still cannot form a second data packet, a bubble packet is used to fill the gap, ensuring that the resulting second data packet meets the preset data length. In the UCIe / FDI protocol, the bubble packet (NOP-PKT, or NOP-TLP) is a placeholder packet that does not contain any valid transaction data and is only used to fill the remaining bandwidth. The purpose of the bubble packet is to fill the remaining bytes of the current flit, ensuring that the preset data length is met, resulting in a second data packet of fixed length.
[0073] Specifically, when the data to be assembled from all N service ports is accumulated and still cannot form a second data packet, the difference between the preset data length and the length corresponding to the accumulated data from all N service ports is calculated to obtain the length of the bubble packet to be inserted. Then, the bubble packet is inserted to fill the gap so that the second data packet formed meets the preset data length.
[0074] This disclosure ensures that the link remains synchronized by inserting bubbly packets to fix the data length of the second data packet.
[0075] In some embodiments, the current state of the state machine further includes an idle state. Based on the current state of the state machine and N service ports, according to a preset port order, the data to be packetized is packetized into data packets with a preset data length to obtain a second data packet. It further includes: when the state machine is in the idle state, determining the starting service port for packetization according to the previous state of the state machine; when the third cumulative length of the third cumulative data to be packetized is greater than or equal to the preset data length for the first time, determining a second target service port, and jumping the current state of the state machine from the idle state to the second target service port state corresponding to the second target service port; where 0 < q ≤ N and q is a positive integer; the third cumulative data to be packetized is obtained by polling the N service ports in the preset port order, starting from the starting service port, and successively accumulating the data to be packetized of p service ports; the second target service port is the service port corresponding to the accumulated q service ports; packetize in the order of the data to be packetized from the starting service port to the second target port according to the polling order to obtain a second data packet with a preset data length.
[0076] Specifically, when currently in the idle state, first determine which service port is being polled among the current N service ports, and continue polling starting from this service port to obtain the starting service port for this packetization, so as to ensure packetization of the first data packet according to the preset port order and prevent head-of-line blocking. Among them, if the previous step entered the idle state from a port state, the starting service port is determined according to the port state before entering the idle state; if the previous step entered the idle state from the idle state, the starting service port is determined according to the service port corresponding to the last first data packet sent in the idle state.
[0077] Then, starting from the data to be packetized corresponding to the starting service port, poll in the preset port order, successively accumulate the data to be packetized of multiple service ports until the accumulated data to be packetized reaches the data to be packetized of the second target service port for the first time and can form a second data packet for packetization; at the same time, the current state of the state machine jumps to the corresponding second target service port state. Among them, there may also be remaining data in the data to be packetized corresponding to the second target service port, and the next packetization can start from the next service port of the second target service port and continue packetization according to the packetization rules in the above embodiments. This can ensure that in the packetization process, the first data packets of the same service port are packetized in order, and there is no service blocking between the first data packets of different service ports, improving the efficiency and accuracy of data packetization.
[0078] In some embodiments, based on the current state of the state machine and N service ports, the data to be assembled is packaged into a data packet of a preset data length according to a preset port order to obtain a second data packet. The method further includes: when the state machine is in an idle state and the fourth cumulative length corresponding to the fourth cumulative data to be assembled obtained by accumulating the data to be assembled from the N service ports is less than the preset data length, maintaining the current state of the state machine in an idle state; and assembling the data to be assembled from the N service ports and multiple empty packets in a sequential manner, starting from the initial service port and following a preset port order, to obtain a second data packet of the preset data length.
[0079] Specifically, when the current state machine is in an idle state, all the data to be assembled from the N service ports still cannot form a second data packet of a preset data length. At this point, the current state of the state machine remains in the idle state. Then, empty bubble packets are used to fill the gaps, combining the empty bubble packets with all the data to be assembled from the N service ports to form a second data packet of the preset data length. At this time, there is no remaining data in any of the service ports. Then, in the next cycle, packet assembly continues according to the packet assembly rules described in the above embodiment.
[0080] In some embodiments, a "Pre-bubble Valid Port" field can be set to identify the port number of the last valid packet before entering / maintaining the no-operation state, i.e., to identify the service port number that actually transmitted data in the previous cycle, thus determining the starting service port for the next cycle. The "Pre-bubble Valid Port" field is only recorded when the current cycle is filled with a bubble packet. When leaving the no-operation state, the state machine uses the value of the "Pre-bubble Valid Port" field to determine the order of service ports during packet assembly, thereby ensuring that the strict polling order remains uninterrupted.
[0081] Furthermore, a second data packet can be divided into multiple second data blocks based on the data transmission channel. That is, during the packet assembly process, multiple second data blocks are sent within the transmission cycle of a second data packet. At least one of the multiple second data blocks has valid service data of a first length and flow control data of a second length; the other second data blocks include valid service data of a specific third length, and the sum of the first length and the second length is the same as the third length.
[0082] Specifically, in the transport protocol, a second data packet can be called a Flit, and the transmission period of a Flit can be represented as a Flit cycle. A Flit transmission cycle refers to the total number of clock cycles that a protocol layer (such as UCIe / PCIe / CXL / Raw, etc.) takes to transmit a complete Flit. The data block corresponding to a Flit can be represented as an FDI Flit, which refers to the physical layer data unit that divides the Flit packet into individual packets. In other words, an FDI Flit refers to the fixed-length data amount transmitted within one clock cycle. The multiple second data blocks required for one Flit cycle can be represented by `flit-cnt`, indicating that one Flit cycle includes `flit-cnt` FDI Flits.
[0083] For example, if the FDI bit width of the transmission protocol is 32 bits and the Flit transmitted by the protocol layer is 256 bits, then one Flit cycle contains 8 FDI Flits; the sending end outputs 8 FDI Flits with flit_cnt values from 0 to 7 in sequence, and when the receiving end detects flit-cnt=7, it reassembles the first 8 FDI Flits into a complete protocol layer Flit.
[0084] Data transmission modes in transport protocols (such as UCIe) include Standard Package (SP) mode and Advanced Package (AP) mode. In the UCIe specification, SP and AP modes are distinctions based on physical layer encapsulation / electrical implementation, not on two different "transport protocols" or "data formats." Therefore, their differences in "data" requirements mainly manifest in physical layer resource consumption and throughput efficiency, without altering the Flit length, packet format, or FDI bit width of upper-layer protocols (PCIe, CXL, Raw).
[0085] Specifically, in SP mode, the number of data channels is typically 16 lanes, while in AP mode, it is typically 64 lanes. Therefore, the number of raw bits that can be transferred in a single cycle is four times that of SP. In other words, for the same Flit (corresponding to the size of the second data packet), such as (68B / 256B Flit), SP mode requires more clock cycles to complete the transfer; AP mode can complete it in fewer cycles. The packet length, CRC, sequence number, etc., seen by the upper layer are exactly the same; only the "physical pipeline is thicker." UCIe has completely identical requirements for the packet length, Flit structure, CRC, retransmission mechanism, etc. of "data" in SP / AP modes; the differences are limited to the number of physical layer lanes, bandwidth density, and energy consumption, thus affecting transmission time and energy efficiency, rather than the data format itself.
[0086] In order to ensure high-bandwidth transmission while still transmitting flow control information in real time, any one of the multiple FDI Flits within a Flit cycle can be selected to transmit flow control data.
[0087] In the same mode, the length of the FDI Flit is fixed. Therefore, the length of the effective service data in the FDI Flit with flow control data within the cycle is the same as the length of the flow control data carried and the full length of the FDI Flit. The remaining FDI Flits are pure service packets, which only contain effective service data with a length corresponding to the length of the FDI Flit.
[0088] Optionally, flow control data is used to describe information such as the corresponding credit amount, virtual channel status, and link errors within the current period. Thus, credit return can be completed within the same period by parsing the flow control data in the second data packet, without requiring additional ticks.
[0089] The embodiments disclosed herein utilize a differentiated structure in which at least one FDI Flit contains flow control data, the remaining FDI Flits contain pure service data, and all FDI Flits have equal lengths. This structure enables high-speed data transmission and instant release of information transmission to be completed simultaneously within a single cycle, significantly reducing the risk of link idle rate and data header congestion.
[0090] For example, assuming there are two service ports, a request port and a response port, the first data packet can be collectively referred to as MTNS-PKT, including the first data packet corresponding to the request port (REQ_MTNS-PKT) and the first data packet corresponding to the response port (RSP_MTNS-PKT). The second data packet can be referred to as an FDI Flit. The following explanation uses the example of assembling REQ_MTNS-PKT and RSP_MTNS-PKT into an FDI Flit corresponding to a chiplet FDI interface.
[0091] In this embodiment, the packet assembly process is illustrated using the Latency_Optimized 256B with Optional Bytes Flit format. Each FDI Flit contains at most one new REQ_MTNS-PKT, one new RSP_MTNS-PKT, and part of the remaining MTNS-PKT from the previous clock cycle. The format of this FDI Flit is that one Flit cycle consists of four FDI Flits. These four FDI Flits are matched according to flit_cnt=0,1,2,3. When flit_cnt=0,1,3, the FDI Flit size is 64 bytes; when flit_cnt=2, the FDI Flit size is 62 bytes. When flit_cnt=2, it also includes 2 bytes of flow control data. The packet assembly process is as follows: The request port and response port correspond to Port0 and Port1 respectively. An FDIFlit packet is polled sequentially from Port0 to Port1. Each clock cycle, 1-2 MTNS-PKTs (including REQ_MTNS-PKT and / or RSP_MTNS-PKT) are selected to enter the data link and encapsulated as an FDI Flit. The state machine defines three states: Port0 State (corresponding to Port0), Port1 State (corresponding to Port1), and No-Operation State (NOP State). Each state indicates the port number of the last MTNS-PKT entering the data link. The remaining state information of the state machine is shown in Table 1 below. Table 1. State information of the state machine
[0092] Where size is the size of each type of MTNS-PKT; the amount of untransmitted data represents the number of untransmitted data items remaining after the state machine transmits data in the current state, denoted by a, b, and c; the actual size is the amount of data that can participate in packet assembly in the current frame of the gear box of this channel. For each port, the actual size is the sum of size and the amount of data to be transmitted. If X=0, it means that there is no data in this channel.
[0093] The transition conditions for each state in the state machine will be explained below: Figures 3a-3b These are schematic diagrams illustrating the state machine transitions when there are two service ports, as provided in this embodiment of the disclosure.
[0094] See Figure 3aWhen the state machine is currently in the Port0 State, it means that the port number of the last MTNS-PKT entering the data link is Port0. In other words, it means that after sending the MTNS-PKT corresponding to Port0, the remaining data volume is aW, which is used for transmission in the next clock cycle. The size of the second data packet is represented by flit_sizeW, and the jump condition is as follows: If a+X1≥flit_size, the data enters Port1 State in the order of Port0-Port1. The remaining untransmitted a W data in Port0 is combined with the MTNS-PKT corresponding to Port1 and sent to the data link for transmission. At this time, the remaining b W data in Port1 is not transmitted.
[0095] If X0>a and X0+X1≥flit_size, meaning that in addition to the untransmitted a W data from the previous frame, there is still an MTNS_PKT corresponding to the next Port0, then the Port0 State is maintained, and the remaining untransmitted a W data from the previous Port0, the MTNS_PKT corresponding to Port1, and the MTNS_PKT corresponding to the next Port0 are grouped into packets in the order of packetization and transmitted into the data link. At this time, the remaining a W data in Port0 is not transmitted.
[0096] If X0+X1<flit_size, enter NOP State, and assemble the remaining untransmitted a W data of Port0, the MTNS_PKT corresponding to Port1, the MTNS_PKT corresponding to the next Port0, and N NOP-PKT (bubble data packets) in sequence, and then transmit them through the data link (that is, X0+X1+X2=flit_size).
[0097] See Figure 3b , with the above Figure 3a The corresponding implementation is similar. When the state machine is currently in Port1 State, it means that after sending the MTNS-PKT corresponding to Port1, the remaining bW data will continue to be transmitted in the next clock cycle. The transition conditions are as follows: If b + X0 ≥ flit_size, enter Port0 State, combine the remaining untransmitted b W data from Port1 with the MTNS-PKT corresponding to Port0, and send it to the data link for transmission. At this time, the remaining a W data from Port0 has not been transmitted.
[0098] If X1>b and X1+X0≥flit_size, meaning there is an MTNS-PKT corresponding to the next Port1 in addition to the bw data that was not fully transmitted in the previous frame, then remain in the Port1 State and assemble the remaining untransmitted bw data of Port1, the MTNS-PKT corresponding to Port0, and the MTNS-PKT corresponding to the next Port1 in that order.
[0099] If X1+X0<flit_size, enter NOP State, and assemble the remaining untransmitted b W data of Port1, the MTNS-PKT corresponding to Port0, the MTNS_PKT corresponding to the next Port0, and N NOP-TLPs into a packet and transmit it into the data link (i.e. X1+X0+X2=flit_size).
[0100] Additionally, when the state machine is currently in the NOP state, it indicates that a bubble packet has been sent. Its state transition is related to x_2_nop. Specifically, when the previous state of the state machine was non-NOP, x_2_nop represents the state before entering the NOP state; when the previous state of the state machine was NOP, x_2_nop represents the state corresponding to the type of the last MTNS-PKT sent in the NOP state. The transition conditions are as follows: If x_2_nop=1, then the packet assembly order is Port1, Port0, and the jump conditions are as follows: (a) If X1≥flit_size, enter Port1 State, assemble the MTNS-PKT corresponding to Port1 into packets, and transmit them through the data link. At this time, the remaining b W data of Port1 has not been transmitted.
[0101] (b) If X1+X0≥flit_size, enter Port0 State, assemble the MTNS-PKT corresponding to Port1 and the MTNS-PKT corresponding to Port0 into a packet, and transmit it through the data link. At this time, the remaining a W data in Port0 has not been transmitted.
[0102] (c) If X1+X0<flit_size, then maintain the NOP State, and group the MTNS-PKT corresponding to Port1, the MTNS-PKT corresponding to Port0, and N NOP-PKTs into a packet and transmit it into the data link (i.e. X1+X0+N=flit_size). At this time, the value of x_2_nop is equal to the state of the last MTNS-PKT entering the data link.
[0103] If X0 > 0, then x_2_nop = 1; if X0 = 0 and X1 > 0, then x_2_nop = 2; if X1 = 0 and X2 = 0, then x_2_nop remains unchanged.
[0104] When x_2_nop=2, the packet assembly order is Port0, Port1, and the jump conditions are as follows: (a) If X0≥flit_size, enter Port0 State, assemble the MTNS-PKT corresponding to Port0 into packets, and transmit them through the data link. At this time, the remaining a W data in Port0 has not been transmitted.
[0105] (b) If X0+X1≥flit_size, enter Port1 State, assemble the MTNS-PKT corresponding to Port0 and the MTNS-PKT corresponding to Port1 into a packet, and transmit it through the data link. At this time, the remaining b W data in Port1 has not been transmitted.
[0106] (c) If X0 + X1 < flit_size, then maintain the NOP State, and group the MTNS-PKT corresponding to Port0, the MTNS-PKT corresponding to Port1, and N NOP-PKTs into a packet and transmit it into the data link (i.e., X0 + X1 + N = flit_size). At this time, the x_2_nop value is equal to the state of the last MTNS-PKT entering the data link.
[0107] If X1>0, then x_2_nop=2; if X1=0 and X0>0, then x_2_nop=1; if X1=0 and X2=0, then x_2_nop remains unchanged.
[0108] For example, taking AP mode as an example, an Fdi Flit contains 254B of payload and 2B of flow control data. An AP FDI cycle is defined as consisting of two Fdi Flits. When flit_cnt=0 and flit_size=256B (64DW), the Fdi Flit consists of 254B of payload + 2B of flow control data. The remaining 2B of payload in flit_size corresponding to flit_cnt=0 is transmitted when flit_cnt=1. When flit_cnt=1 and flit_size=252B (63DW), the Fdi Flit consists of the remaining data in the previous second data packet (2B) + 252B of payload + 2B of flow control data.
[0109] Fdi Flit packet assembly polls in the order of Port0-Port1-Port2-Port3, selecting 2-4 MTNS-PKTs to enter the data link each clock cycle. The state machine defines five states: Port0 State, Port1 State, Port2 State, Port3 State, and NOP State. Each state indicates the port number of the last MTNS-PKT entering the data link. The state information of the remaining states is shown in Table 2. Table 2. State information of the state machine
[0110] Similar to the above embodiments, size is the size of the first data packet of each type; the amount of untransmitted data represents the number of untransmitted data remaining after the state machine sends data in the current state, denoted by a, b, c, d, and e; the actual size is the amount of data that can participate in packet assembly in the current frame in the gear box of this channel. If X=0, it means that there is no data in the channel corresponding to this service interface.
[0111] Figures 4a-4d These are schematic diagrams illustrating the state machine transitions when there are four service ports, as provided in this embodiment of the disclosure.
[0112] See Figure 4a When the state machine is currently in Port0 State, it means that Port0 MTNS-PKT has been sent. The remaining aDW data will continue to be transmitted in the next clock cycle. The transition conditions are as follows: If a+X1≥flit_size, enter Port1 State, combine the remaining untransmitted a W data from Port0 with the MTNS-PKT corresponding to Port1, and transmit them through the data link. At this time, the remaining b W data from Port1 has not been transmitted.
[0113] If a+X1+X2≥flit_size, enter Port2 State, and combine the remaining untransmitted a W data of Port0, the MTNS-PKT corresponding to Port1 and the MTNS-PKT corresponding to Port2 into a packet and transmit it through the data link. At this time, the remaining c W data of Port2 has not been transmitted.
[0114] If a+X1+X2+X3≥flit_size, enter Port3 State, and assemble the remaining untransmitted aW data of Port0, the MTNS-PKT corresponding to Port1, the MTNS-PKT corresponding to Port2, and the MTNS-PKT corresponding to Port3 into a packet and transmit it through the data link. At this time, the remaining dW data of Port3 has not been transmitted.
[0115] If X0>a, and X0+X1+X2+X3≥flit_size, meaning that in addition to the untransmitted aW data from the previous frame, there is still an MTNS_PKT corresponding to the next Port0, then remain in the Port0 State. The remaining untransmitted aW data from the previous Port0, the MTNS_PKT corresponding to Port1, Port2, Port3, and the MTNS_PKT corresponding to the next Port0 are grouped into packets in that order and transmitted into the data link. At this time, the remaining aW data in Port0 is not transmitted.
[0116] If X0+X1+X2+X3<flit_size, enter the NOP State, and assemble the remaining untransmitted aW data of Port0, the MTNS_PKT corresponding to Port1, the MTNS_PKT corresponding to Port2, the MTNS_PKT corresponding to Port3, the MTNS_PKT corresponding to the next Port0, and N NOP-PKTs in sequence into packets and transmit them on the data link (i.e., X0+X1+X2+X3+N=flit_size).
[0117] See Figure 4b When the state machine is currently in Port1 State, it indicates that Port1 MTNS-PKT has been sent. The remaining data (bW) will continue to be transmitted in the next clock cycle. The transition conditions are as follows: If b+X2≥flit_size, enter Port2 State, combine the remaining untransmitted bW data from Port1 with the corresponding MTNS-PKT from Port2, and send it to the 248 B data link for transmission. At this time, the remaining cW data from Port2 has not been transmitted.
[0118] If b+X2+X3≥flit_size, enter Port3 State, and combine the remaining untransmitted bW data of Port1, the MTNS-PKT corresponding to Port2, and the MTNS-PKT corresponding to Port3 into a packet, and transmit it through the 248 B data link. At this time, there is still dW data remaining to be transmitted in Port3.
[0119] If b+X2+X3+X1≥flit_size, enter Port0 State, and combine the remaining untransmitted bW data of Port1, the MTNS-PKT corresponding to Port2, the MTNS-PKT corresponding to Port3, and the MTNS-PKT corresponding to Port0 into a packet, and enter the 248B data link for transmission. At this time, the remaining dW data of Port0 is not transmitted.
[0120] If X1>b and X2+X3+X4+X5+X1≥flit_size, meaning that in addition to the untransmitted bw data from the previous frame, there is still an MTNS-PKT corresponding to the next Port1 in the gear box, then remain in the Port1 State and group the remaining untransmitted bw data from Port1, the MTNS-PKT corresponding to Port2, the MTNS-PKT corresponding to Port3, the MTNS-PKT corresponding to Port0, and the MTNS-PKT corresponding to the next Port1 in that order.
[0121] If X2+X3+X0+X1<flit_size, enter the NOP State, and assemble the remaining untransmitted bW data of Port1, the MTNS-PKT corresponding to Port2, the MTNS-PKT corresponding to Port3, the MTNS-PKT corresponding to Port0, and N NOP-TLPs into a packet and transmit it through the 248 B data link (i.e., X2+X3+X0+X1+N=flit_size).
[0122] See Figure 4c When the state machine is currently in Port2 State, it means that Port 2 MTNS-PKT has been sent. The remaining cDW data will continue to be transmitted in the next clock cycle. The transition conditions are as follows: If c + X3 ≥ flit_size, enter Port 3 State, combine the remaining untransmitted c W data from Port 2 State with the MTNS-PKT corresponding to Port 3, and transmit it through the 248 B data link. At this time, the remaining dW data in Port 3 is not transmitted.
[0123] If c + X3 + X0 ≥ flit_size, enter Port0 State, and combine the remaining untransmitted c W data of Port2, the MTNS-PKT corresponding to Port3 and the MTNS-PKT corresponding to Port0 into a packet, and enter the 248 B data link for transmission. At this time, the remaining a W data of Port0 has not been transmitted.
[0124] If c + X3 + X0 + X1 ≥ flit_size, enter Port1 State, and combine the remaining untransmitted c W data of Port 2, the MTNS-PKT corresponding to Port3, the MTNS-PKT corresponding to Port0, and the MTNS-PKT corresponding to Port1 into a packet and transmit it through the 248B data link. At this time, the remaining b W data of Port1 has not been transmitted.
[0125] (4) If X2>c and X2+X3+X0+X1≥flit_size, that is, in addition to the cW data that was not fully transmitted in the previous frame, there is still the MTNS-PKT corresponding to the next Port2 in the gear box, then stay in the Port2 State and assemble the packets in the order of the remaining untransmitted cW data of Port2, the MTNS-PKT corresponding to Port3, the MTNS-PKT corresponding to Port0, the MTNS-PKT corresponding to Port1, and the MTNS-PKT corresponding to the next Port2.
[0126] If X3+X0+X1+X2<flit_size, enter the NOP State. Packetize the remaining untransmitted cW data of Port2, the MTNS-PKT corresponding to Port3, the MTNS-PKT corresponding to Port0, the MTNS-PKT corresponding to Port1, and the MTNS-PKT corresponding to the next Port2 in that order, and then transmit them through the 248 B data link (i.e., X3+X0+X1+X2+N=flit_size). At this time, the Next State is the Port 3 State, and c=0.
[0127] See Figure 4d When the state machine is currently in the Port3 State, it indicates that a Port3 MTNS-PKT has been sent. The transition conditions are as follows: If d+X0≥flit_size, enter Port0 State, combine the remaining untransmitted d W data of Port3 with the MTNS-PKT corresponding to Port0, and transmit it through the 248 B data link. At this time, the remaining a W data of Port0 has not been transmitted.
[0128] If d+X0+X1≥flit_size, enter Port1 State, and assemble the remaining untransmitted dW data of Port3, the MTNS-PKT corresponding to Port0 and the MTNS-PKT corresponding to Port1 into a packet, and transmit it through the 248 B data link. At this time, the remaining bW data of Port1 has not been transmitted.
[0129] If d+X0+X1+X2≥flit_size, enter Port2 State, and assemble the remaining untransmitted d W data of Port3, the MTNS-PKT corresponding to Port0, the MTNS-PKT corresponding to Port1, and the MTNS-PKT corresponding to Port2 into a packet, and transmit it into the 248B data link. At this time, the remaining cW data of Port2 has not been transmitted.
[0130] If X3>d, and X0+X1+X2+X3≥flit_size, meaning that in addition to the untransmitted d W data from the previous frame, there is still an MTNS-PKT request corresponding to the next Port3 in the gear box, then remain in Port3State and assemble packets in the following order: the remaining untransmitted cW data of Port3, the MTNS-PKT corresponding to Port0, the MTNS-PKT corresponding to Port1, the MTNS-PKT corresponding to Port, and the MTNS-PKT corresponding to the next Port3.
[0131] If X0+X1+X2+X3<flit_size, enter NOP State, and assemble packets according to the order of the remaining untransmitted d W data of Port3, the MTNS-PKT corresponding to Port0, the MTNS-PKT corresponding to Port1, the MTNS-PKT corresponding to Port2, and the MTNS-PKT corresponding to the next Port3, and then transmit them on the 248 B data link (i.e., X3+X0+X1+X2+N=flit_size).
[0132] Additionally, when the state machine is currently in the NOP State, it indicates that an NOP flit has been sent, and its state transition is related to x_2_nop: If x_2_nop=1, then the packet assembly order is Port1, Port2, Port3, Port0, and the jump conditions are as follows: (a) If X1+X2+X3≥flit_size, enter Port3 State, and assemble the MTNS-PKT corresponding to Port1, the MTNS-PKT corresponding to Port2 and the MTNS-PKT corresponding to Port3 into packets and transmit them in the data link. At this time, the remaining d W data in Port3 has not been transmitted.
[0133] (b) If X1+X2+X3+X0≥flit_size, enter Port0 State, and assemble the MTNS-PKT corresponding to Port1, Port2, Port3 and Port0 into packets and transmit them through the data link. At this time, the remaining aW data in Port0 has not been transmitted.
[0134] (c) If X1+X2+X3+X0<flit_size, then maintain the NOP State, and assemble the MTNS-PKT corresponding to Port1, the MTNS-PKT corresponding to Port2, the MTNS-PKT corresponding to Port3, the MTNS-PKT corresponding to Port0, and N NOP-PKTs into packets and transmit them into the data link (i.e., X0+X1+X2+X3+N=flit_size). At this time, the x_2_nop value is equal to the state of the last MTNS-PKT entering the data link.
[0135] (2) If x_2_nop=2, then the packet assembly order is Port2, Port3, Port0, Port1, and the jump conditions are as follows: (a) If X2+X3+X0≥flit_size, enter Port0 State, and assemble the MTNS-PKT corresponding to Port2, the MTNS-PKT corresponding to Port3 and the MTNS-PKT corresponding to Port0 into packets and transmit them in the data link. At this time, the remaining a W data in Port0 has not been transmitted.
[0136] (b) If X2+X3+X0+X1≥flit_size, enter Port1 State, and assemble the MTNS-PKT corresponding to Port2, Port3, Port0 and Port1 into packets and transmit them through the data link. At this time, the remaining bW data of Port1 has not been transmitted.
[0137] (c) If X2+X3+X0+X1<flit_size, then maintain the NOP State, and assemble the MTNS-PKT corresponding to Port2, the MTNS-PKT corresponding to Port3, the MTNS-PKT corresponding to Port0, the MTNS-PKT corresponding to Port1, and N NOP-PKTs into a packet and transmit it into the data link (i.e. X0+X1+X2+X3+N=flit_size). At this time, the value of x_2_nop is equal to the state of the last MTNS-PKT entering the data link.
[0138] (3) If x_2_nop=3, then the packet assembly order is Port3, Port0, Port1, Port2, and the jump conditions are as follows: (a) If X3+X0+X1≥flit_size, enter Port1 State, and assemble the MTNS-PKT corresponding to Port3, the MTNS-PKT corresponding to Port0 and the MTNS-PKT corresponding to Port1 into packets and transmit them in the data link. At this time, the remaining bW data in Port1 has not been transmitted.
[0139] (b) If X3+X0+X1+X2≥flit_size, enter Port2 State, and assemble the MTNS-PKT corresponding to Port3, the MTNS-PKT corresponding to Port0, the MTNS-PKT corresponding to Port1 and the MTNS-PKT corresponding to Port2 into packets and transmit them in the data link. At this time, the remaining c W data in Port2 has not been transmitted.
[0140] (c) If X3+X0+X1+X2<flit_size, then maintain the NOP State, and assemble the MTNS-PKT corresponding to Port3, the MTNS-PKT corresponding to Port0, the MTNS-PKT corresponding to Port1, the MTNS-PKT corresponding to Port2, and N NOP-PKTs into a packet and transmit it into the data link (i.e. X0+X1+X2+X3+N=flit_size). At this time, the x_2_nop value is equal to the state of the last MTNS-PKT entering the data link.
[0141] (4) If x_2_nop=5 or 0, then the packet assembly order is Port0, Port1, Port2, Port3. The jump conditions are as follows: (a) If X0+X1+X2≥flit_size, enter Port2 State, and assemble the MTNS-PKT corresponding to Port0, the MTNS-PKT corresponding to Port1 and the MTNS-PKT corresponding to Port2 into packets and transmit them in the data link. At this time, the remaining cW data in Port2 has not been transmitted.
[0142] (b) If X0+X1+X2+X3≥flit_size, enter Port3 State, and assemble the MTNS-PKT corresponding to Port0, Port1, Port2 and Port3 into packets and transmit them through the data link. At this time, the remaining cW data in Port3 has not been transmitted.
[0143] (c) If X0+X1+X2+X3<flit_size, then maintain the NOP State, and assemble the MTNS-PKT corresponding to Port0, the MTNS-PKT corresponding to Port1, the MTNS-PKT corresponding to Port2, the MTNS-PKT corresponding to Port3, and N NOP-PKTs into a packet and transmit it into the data link (i.e. X0+X1+X2+X3+N=flit_size). At this time, the value of x_2_nop is equal to the state of the last MTNS-PKT entering the data link.
[0144] Similar to the above embodiments, when pre_state is not NOP, x_2_nop represents the state before entering NOP; when pre_state is NOP, x_2_nop represents the state corresponding to the type of the last PKT sent by the NOP state.
[0145] Furthermore, after the first data packet is packaged into a second data packet and sent to the data receiving end through the data logic interface, the data receiving end can also restore the second data packet into the first data packet for subsequent use.
[0146] Secondly, this disclosure also provides another data transmission method, which can be applied to a data receiving end, such as the data receiving end in this disclosure.
[0147] Figure 5 A flowchart of yet another data transmission method provided in an embodiment of this disclosure.
[0148] See Figure 5 The process 500 specifically includes the following steps: Step 501: Based on the preset data transmission protocol, parse the second data packet received through the data logic interface to obtain the packet length information of the first data packet.
[0149] The data logic interface corresponds to a preset data transmission protocol, and the second data packet is formatted data that conforms to the specifications of the data logic interface; the second data packet includes the first data packet.
[0150] Specifically, the preset data transmission protocol refers to the protocol used for data transmission between the data sender and the data receiver. The data logic interface corresponds to the preset data transmission protocol and refers to the standardized data logic interface between the protocol layer and the adaptation layer in the preset transmission protocol. Optionally, the preset transmission protocol can be a chiplet protocol to implement chiplet interconnection. The chiplet protocol can be the UCIe (Universal Chiplet Interconnect Express) protocol, supporting high-bandwidth, low-latency interconnection. Correspondingly, the data logic interface can be an FDI (Field Device Integration) interface. Of course, the chiplet protocol can also be other protocols, such as CXL (Compute Express Link), and correspondingly, the data logic interface can also be other types of communication protocol interfaces; this disclosure does not limit this.
[0151] The second data packet can only be received through the data logic interface using the preset data transmission protocol if it conforms to the data logic interface specification. After receiving the second data packet, the data receiving end can first parse it into the first data packet, and then further convert the first data packet into a data format usable by the data receiving end.
[0152] Specifically, the data receiving end first parses the header or control field of the second data packet to obtain the packet length information carried therein. This packet length information describes the actual byte / word (W) length of the first data packet within the second data packet, rather than the entire length of the second data packet.
[0153] Step 502: Determine the data length of the first data packet based on the packet length information.
[0154] Specifically, the parsed packet length information is analyzed to obtain the data length of the first data packet. If there are multiple first data packets within the second data packet, the data length of each first data packet can be parsed sequentially based on the packet length information.
[0155] The length of the first data packet can be different. The specific length of the first data packet can be determined by referring to the embodiment of the first aspect above, which will not be repeated here.
[0156] Step 503: Obtain the first data packet based on the data offset and data length.
[0157] Specifically, the first data packet can be obtained by truncating bytes of that data length from the current parsing position as the starting offset. Furthermore, when there are multiple first data packets in the second data packet, the offset can be updated after obtaining the first data packet to locate the next first data packet.
[0158] This disclosure provides an embodiment that parses the second data packet to obtain the packet length information of the first data packet, and combines this with the data offset to obtain the first data packet. This disclosure requires no additional control channel, utilizing the existing second data packet header to achieve packet boundary self-description; it also supports continuous splicing of variable-length first data packets, allowing the data receiver to precisely cut the packets according to length, avoiding bit errors or boundary misalignment; and it ensures that the amount of data read and released matches packet by packet, eliminating the risk of data header blocking.
[0159] In some embodiments, the second data packet includes multiple first data packets; obtaining the first data packet according to the data offset and the data length includes: starting from the initial data offset, according to the arrangement order of each first data packet in the second data packet, sequentially adding the data offset of the previous first data packet to its data length to obtain the data offset of the next first data packet, and sequentially extracting data according to the data offset to obtain each first data packet.
[0160] Specifically, when the second data packet includes multiple first data packets, the packet length information of each first data packet can be parsed out. Then, using the current parsing position as the starting offset, bytes corresponding to the data length of the first first data packet can be extracted to obtain the complete first first data packet. Furthermore, after obtaining the first data packet, the offset is updated to locate the next first data packet. Based on the updated offset and the data length of the second first data packet, the second first data packet is obtained, and so on, until all the first data packets in the second data packet are obtained.
[0161] The initial data offset can be 0, that is, the first data packet is placed at the beginning of the second data packet; alternatively, the initial data offset can also be non-zero, for example, flow control data is placed at the beginning of the second data packet first, and then the first data packet is placed. This disclosure does not limit this.
[0162] This disclosure improves the accuracy of obtaining the first data packets by starting with an initial data offset, adding the data offset of the previous first data packet to its data length according to the arrangement order of each first data packet in the second data packet, obtaining the data offset of the next first data packet, and extracting data sequentially according to the data offset to obtain each first data packet.
[0163] In some embodiments, the packet length information includes a data type field, a header data field, a payload data field, and a full-byte enable field; wherein, the data type field is used to identify the service port corresponding to the first data packet; the header data field is used to identify whether the first data packet carries a communication request; the payload data field is used to identify whether the first data packet carries data corresponding to the communication request; and the full-byte enable field is used to identify whether all the data in the first data packet is valid.
[0164] For details regarding the data type field, header data field, payload data field, and full-byte enable field, please refer to the description in the relevant section of the first aspect above; they will not be repeated here.
[0165] This disclosure improves the accuracy of obtaining the first data packet by setting multiple fields in the packet length information, which allows the information carried by the first data packet to be determined based on each field.
[0166] In some embodiments, when the full-byte enable field indicates that there are invalid bytes in the data of the first data packet, the packet length information also includes a byte enable field, which is used to identify the validity of each byte in the first data packet.
[0167] For details regarding the byte enable field, please refer to the description in the relevant section of the first aspect above, which will not be repeated here.
[0168] This embodiment of the disclosure saves bandwidth and improves data transmission efficiency by setting a full-byte enable field and only including the byte enable field in the packet length information when the full-byte enable field indicates that there are invalid bytes in the data of the first data packet. When the full-byte enable field indicates that all the data in the first data packet is valid, the packet length information does not include the byte enable field.
[0169] Figure 6 This is a schematic diagram illustrating how a first data packet is obtained from a second data packet, as provided in an embodiment of this disclosure. Wherein, in Figure 6 Taking the example that a second data packet can contain a maximum of three first data packets, that is, using the example from the first aspect above where an FDI Flit can contain a maximum of one REQ_MTNS-PKT, one RSP_MTNS-PKT, and the remaining data from the previous frame, we can illustrate this further. Converting the FDI Flit to REQ_MTNS-PKT / RSP_MTNS-PKT, each FDI Flit can parse a maximum of three MTNS-PKTs.
[0170] See Figure 6A 64-byte (32-word) FDI Flit can contain a maximum of three MTNS-PKTs (one remaining MTNS-PKT, one new REQ_MTNS-PKT, and one new RSP_MTNS-PKT). Therefore, in this embodiment, three basic detection units can be set as check_a, check_b, and check_c. These three detection units can detect the conversion of 32W data into MTNS-PKTs. Each detection unit contains an initial displacement mov_x_num (x is a, b, c) to obtain the values of the Type, Head, Tail, HasPld, and FullBe fields corresponding to the new MTNS-PKT, thereby obtaining the type and size of the MTNS-PKT. Then, the corresponding data is extracted and converted into REQ_MTNS-PKTs and RSP_MTNS-PKTs. The specific workflow is as follows: The initial offset (mov_a_num) of the 32-word data corresponding to the first FDI Flit on the data link is equal to 0. Furthermore, the data length of the first data packet can be determined based on the field values corresponding to type_a, head, HasPld, and FullBe. Specifically: If type_a[0]=0, it corresponds to the request port.
[0171] Furthermore, if head=1, it corresponds to MTNS head Flit, and the packet length includes the following cases: ① HasPld=0, packet length is 8 words. ② HasPld=1, FullBe=1, packet length is 40 words. ③ HasPld=1, FullBe=0, packet length is 44 words.
[0172] If head=0, it corresponds to MTNS body / tail Flit. The packet length includes the following cases: ①FullBe=1, the packet length is 34 words; ②FullBe=0, the packet length is 38 words.
[0173] If type_a[0]=1, it corresponds to the response port.
[0174] Furthermore, if head=1, it corresponds to MTNS head Flit, and the packet length includes the following cases: ①HasPld=0, packet length is 2 words. ②HadPld=1, packet length is 34 words.
[0175] When head=0, the packet length is fixed at 34 words.
[0176] Furthermore, mov_b_num can be obtained based on the packet length of type_a, which is equal to mov_a_num + type_a_size (in words). The positions of type_b and type_c can be obtained by analogy, and then MTNS-PKT can be extracted from FDI Flit.
[0177] Furthermore, according to the MTNS-PKT packet rules, the MTNS-PKT can be restored to the first data block and allocated to the request port and response port of the data receiving end respectively. After being stored by the storage module, the first data block corresponding to the virtual channel that can be processed by the subsequent stage can be read out and forwarded.
[0178] The data transmission method disclosed herein involves the data sending end storing a first data block according to a corresponding virtual channel, arbitrarily selecting a target virtual channel that can be transmitted, reading out the first data block corresponding to the target virtual channel and encapsulating it into a first data packet, and then assembling the first data packets from multiple channels into a second data packet; the data receiving end extracts the second data packet from the data interface, unpacks it into a first data packet and further obtains a first data block, stores it according to the virtual channel corresponding to the first data block, and forwards it to the subsequent stage.
[0179] This embodiment of the disclosure encapsulates the first data unit into a first data packet corresponding to each virtual channel according to its corresponding virtual channel. This ensures that the first data blocks in the same virtual channel are ordered and the first data blocks in different virtual channels are parallel, thus eliminating head-end interference. Furthermore, by grouping the first data packet according to the service port, the resulting second data packet can meet the format requirements of the data interface. The second data packet can be directly sent to the data receiving end through the data interface, omitting external conversion logic and realizing high-bandwidth, low-power interconnection between cores.
[0180] Based on the same inventive concept as the above-described data transmission method, this disclosure also provides a data transmission device.
[0181] Figure 7 This is a structural block diagram of a data transmission device provided in an embodiment of the present disclosure.
[0182] Further reference Figure 7 As an implementation of the methods shown in the above figures, this device embodiment is similar to... Figure 1 The method embodiments shown correspond to those described.
[0183] like Figure 7 As shown, the data transmission device 700 of this embodiment may include a data sending end and a data receiving end, wherein the data sending end includes: a packet encapsulation module 701, a packet assembly module 702 and a sending module 703.
[0184] The packetization module 701 is used to encapsulate a first data block received from the service port of the data sending end into a first data packet; the packet assembly module 702 is used to assemble the first data packet into a second data packet based on the service port; and the sending module 703 is used to send the second data packet to the data receiving end through a data logic interface based on a preset data transmission protocol. The data logic interface corresponds to the preset data transmission protocol, and the second data packet is formatted data that conforms to the data logic interface specification.
[0185] In some embodiments, the service port includes multiple virtual channels, and the service port is configured with a corresponding storage module; the packet module 701 is specifically used to: write a first data block received from the service port of the data sending end into the storage module; wherein, the storage module stores the first data block according to the virtual channel corresponding to the first data block; determine the target virtual channel from the multiple virtual channels using a preset arbitration strategy, and encapsulate the first data block corresponding to the target virtual channel in the storage module into a first data packet corresponding to the target virtual channel.
[0186] In some embodiments, the packet module 701 is further configured to: determine a transmittable virtual channel from multiple virtual channels based on the valid status field and the available status field of each virtual channel; wherein the valid status field is used to identify whether the storage module stores the first data block of the corresponding virtual channel, and the available status field is used to identify whether the data receiver can receive the first data block of the virtual channel; and determine the target virtual channel from the transmittable virtual channels using a preset arbitration strategy.
[0187] In some embodiments, the preset arbitration strategy includes priority round-robin or weighted fair queue.
[0188] In some embodiments, the number of service ports is N, where N is a positive integer greater than 0; the packet assembly module 702 is specifically used to: read the first data packet from the N service ports to the data link to obtain the data to be assembled, wherein the data to be assembled corresponds to the service port; based on the current state of the state machine and the N service ports, assemble the data to be assembled into a data packet of a preset data length according to a preset port order to obtain a second data packet; wherein the current state of the state machine is used to indicate the port number of the last first data packet entering the data link.
[0189] In some embodiments, the current state of the state machine includes N port states respectively set corresponding to N service ports; the packet assembly module 702 is specifically configured to: when the state machine is in the state of the i-th service port and the first cumulative length of the first cumulative data to be packet-assembled is greater than or equal to the preset data length for the first time, determine the first target service port, and jump the current state of the state machine from the state of the i-th service port to the first target service port state corresponding to the first target service port; wherein, the first cumulative data to be packet-assembled is obtained by sequentially adding the remaining data that was not packet-assembled in the previous cycle of the i-th service port to the data to be packet-assembled of p service ports according to the first preset rule; the first preset rule is: polling the N service ports in the preset port order, and starting to accumulate from the next service port of the i-th service port; the first target service port is the service port corresponding to the accumulated p service ports; packet-assembling is performed according to the remaining data and the order of the data to be packet-assembled from the next service port of the i-th service port to the service port corresponding to the first target service port in the polling order, to obtain a second data packet with the preset data length; wherein, 0 < i ≤ N, 0 < p < N, and both i and p are positive integers.
[0190] In some embodiments, the packet assembly module 702 is specifically configured to: when the state machine is in the state of the i-th service port and the second cumulative length of the second cumulative data to be packet-assembled is less than the preset data length, determine whether the sum of the second cumulative length and the length of the data to be packet-assembled of the i-th service port after polling again is greater than or equal to the preset data length; wherein, the second cumulative data to be packet-assembled is obtained by sequentially adding the remaining data that was not packet-assembled in the previous cycle of the i-th service port to the data to be packet-assembled of N - 1 service ports according to the first preset rule; when the sum of the second cumulative length and the length of the data to be packet-assembled of the i-th service port after polling again is greater than or equal to the preset data length, keep the current state of the state machine in the state of the i-th service port; packet-assembling is performed according to the remaining data, the order of the data to be packet-assembled of N - 1 consecutive service ports starting from the next service port of the i-th service port in the polling order, and the data to be packet-assembled of the i-th service port after polling again, to obtain a second data packet with the preset data length.
[0191] In some embodiments, the current state of the state machine further includes a no-operation state, and the packet assembly module 702 is specifically configured to: when the state machine is in the state of the i-th service port and the sum of the second cumulative length and the length of the data to be packet-assembled of the i-th service port after polling again is less than the preset data length, jump the current state of the state machine from the state of the i-th service port to the no-operation state; packet-assembling is performed according to the remaining data, the order of the data to be packet-assembled of N - 1 consecutive service ports starting from the next service port of the i-th service port in the polling order, the data to be packet-assembled of the i-th service port after polling again, and the order of multiple empty packets, to obtain a second data packet with the preset data length.
[0192] In some embodiments, the packet assembly module 702 is specifically configured to: when the state machine is in the idle operation state, determine the starting service port for packet assembly according to the previous state of the state machine; when the third cumulative length of the third cumulative packet assembly data to be assembled is greater than or equal to the preset data length for the first time, determine the second target service port, and change the current state of the state machine from the idle operation state to the second target service port state corresponding to the second target service port; where 0 < q ≤ N, and q is a positive integer; the third cumulative packet assembly data to be assembled is obtained by polling N service ports in the preset port order, starting from the starting service port, and successively adding the packet assembly data of p service ports; the second target service port is the service port corresponding to the addition of q service ports; assemble the packet assembly data in the order from the starting service port to the second target port according to the polling order to obtain a second data packet with the preset data length.
[0193] In some embodiments, the packet assembly module 702 is specifically configured to: when the state machine is in the idle operation state and the fourth cumulative length of the fourth cumulative packet assembly data obtained by adding the packet assembly data of N service ports is less than the preset data length, keep the current state of the state machine in the idle operation state; poll N service ports in the preset port order starting from the starting service port, and assemble the packet assembly data of N service ports and the order of multiple empty packets to obtain a second data packet with the preset data length.
[0194] In some embodiments, the data receiving end is specifically configured to: based on the preset data transmission protocol, parse the second data packet received through the data logic interface to obtain the packet length information of the first data packet; where the data logic interface corresponds to the preset data transmission protocol, and the second data packet is formatted data conforming to the specification of the data logic interface; the second data includes the first data packet; determine the data length of the first data packet according to the packet length information; obtain the first data packet according to the data offset and the data length.
[0195] In some embodiments, the packet length information includes a data type field, a header data field, a payload data field, and a full byte enable field; where the data type field is used to identify the service port corresponding to the first data packet; the header data field is used to identify whether the first data packet carries a communication request; the payload data field is used to identify whether the first data packet carries the data corresponding to the communication request; the full byte enable field is used to identify whether all the data in the first data packet is valid.
[0196] In some embodiments, when the full byte enable field indicates that there are invalid bytes in the data of the first data packet, the packet length information further includes a byte enable field, which is used to identify the validity of each byte in the first data packet.
[0197] In some embodiments, the second data packet includes multiple first data packets; the data receiving end is further configured to: starting from an initial data offset, sequentially add the data offset of the previous first data packet to its data length according to the arrangement order of each first data packet within the second data packet to obtain the data offset of the next first data packet, and sequentially extract data according to the data offset to obtain each first data packet. Optionally, the initial data offset can be 0, or it can be non-zero based on actual needs; this disclosure does not limit this.
[0198] In this embodiment, the specific processing of the packet encapsulation module 701, packet assembly module 702, and sending module 703 in the data transmission device 700, and the resulting technical effects, can be found by referring to [reference needed]. Figure 1 The relevant descriptions of steps 101-103 in the corresponding embodiments will not be repeated here.
[0199] The specific implementation details and technical effects of the data transmission device embodiments provided in this disclosure are the same as the implementation details and technical effects of the data transmission method embodiments described above, and will not be repeated here.
[0200] This embodiment exists as a device embodiment corresponding to the above method embodiment. The data transmission device provided in this embodiment encapsulates the first data unit into a first data packet; further, it groups the first data packet according to the service port so that the obtained second data packet can meet the format requirements of the data interface and can be directly sent to the data receiving end through the data interface, omitting the external conversion logic and realizing high bandwidth and low power consumption interconnection between cores.
[0201] According to embodiments of this disclosure, this disclosure also provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to implement the data transmission method described in any of the above embodiments.
[0202] Figure 8 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this disclosure. For example... Figure 8 As shown, the electronic device 800 of this embodiment includes a processor 801 and a memory 802; wherein, the memory 802 is used to store computer execution instructions; the processor 801 is used to execute the computer execution instructions stored in the memory to implement the various steps performed by the electronic device in the above embodiment. For details, please refer to the relevant descriptions in the foregoing method embodiments. For example, the electronic device 800 can be a general-purpose processor, a graphics processing device, a neural network computing device, or a graph neural network computing device.
[0203] In some embodiments, the memory 802 can be either standalone or integrated with the processor 801.
[0204] When the memory 802 is set up independently, the electronic device also includes a bus 803 for connecting the memory 802 and the processor 801.
[0205] It should be understood that the processor 801 described above can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly manifested as being executed by a hardware processor, or being executed by a combination of hardware and software modules within the processor.
[0206] The memory 802 may include high-speed RAM memory, and may also include non-volatile memory NVM, such as at least one disk storage device, and may also be a USB flash drive, portable hard drive, read-only memory, disk or optical disc, etc.
[0207] Bus 803 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0208] This disclosure also provides a computer storage medium storing computer execution instructions, which, when executed by a processor, implement the data transmission method steps of any of the above method embodiments.
[0209] This disclosure also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the data transmission method according to any of the above embodiments.
[0210] In the several embodiments provided by this invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or modules, and may be electrical, mechanical, or other forms.
[0211] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to implement the solution of this embodiment according to actual needs.
[0212] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The unit composed of the above modules can be implemented in hardware or in the form of hardware plus software functional units.
[0213] The integrated modules described above, implemented as software functional modules, can be stored in a computer-readable storage medium. These software functional modules, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute partial steps of the methods in the various embodiments of this application.
[0214] The aforementioned storage medium can be implemented from any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The storage medium can be any available medium accessible to general-purpose or special-purpose computers.
[0215] An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Alternatively, the storage medium can be an integral part of the processor. Both the processor and the storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and storage medium can exist as discrete components in an electronic device or host device.
[0216] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0217] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification.
[0218] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0219] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A data transmission method, characterized in that, Applied to the data sending end, the method includes: The first data block received from the service port of the data sending end is encapsulated into a first data packet; Based on the aforementioned service port, the first data packet is grouped into a second data packet; Based on a preset data transmission protocol, the second data packet is sent to the data receiving end through a data logic interface; wherein, the data logic interface corresponds to the preset data transmission protocol, and the second data packet is formatted data conforming to the specifications of the data logic interface.
2. The method according to claim 1, characterized in that, The service port includes multiple virtual channels, and each service port is configured with a storage module. The encapsulation of the first data block received from the service port of the data sending end into a first data packet includes: The first data block received from the service port of the data sending end is written into the storage module; wherein, the storage module stores the first data block according to the virtual channel corresponding to the first data block; A target virtual channel is determined from the plurality of virtual channels using a preset arbitration strategy, and the first data block corresponding to the target virtual channel in the storage module is encapsulated into a first data packet corresponding to the target virtual channel.
3. The method according to claim 2, characterized in that, The step of determining the target virtual channel from the plurality of virtual channels using a preset arbitration strategy includes: Based on the valid status field and available status field of each virtual channel, a transmittable virtual channel is determined from the plurality of virtual channels; wherein, the valid status field is used to identify whether the storage module stores the first data block of the corresponding virtual channel, and the available status field is used to identify whether the data receiving end can receive the first data block of the virtual channel; The target virtual channel is determined from the transmittable virtual channels using a preset arbitration strategy.
4. The method according to claim 1, characterized in that, The number of service ports is N, where N is a positive integer greater than 0; the step of assembling the first data packet into a second data packet based on the service ports includes: Based on the first data packets read from N service ports to the data link, the data to be assembled is obtained; wherein, the data to be assembled corresponds to the service port; Based on the current state of the state machine and the N service ports, the data to be assembled is packaged into data packets of a preset data length according to a preset port order to obtain the second data packet; wherein, the current state of the state machine is used to indicate the port number of the last first data packet entering the data link.
5. The method according to claim 4, characterized in that, The current state of the state machine includes N port states that are set one-to-one with the N service ports; Based on the current state of the state machine, and according to a preset port order, the data to be assembled from multiple service ports is grouped into a data packet of a preset data length to obtain the second data packet, including: When the state machine is in the i-th service port state and the first cumulative length of the first cumulative data to be packetized is greater than or equal to the preset data length for the first time, determine the first target service port, and jump the current state of the state machine from the i-th service port state to the first target service port state corresponding to the first target service port; wherein, the first cumulative data to be packetized is obtained by sequentially accumulating the remaining data that was not packetized in the previous beat in the i-th service port and the data to be packetized of p service ports according to the first preset rule; the first preset rule is: polling N service ports in the preset port order, and starting to accumulate from the service port after the i-th service port; the first target service port is the service port corresponding to the accumulated p service ports; Packetize according to the remaining data and the order of the data to be packetized from the service port after the i-th service port to the service port corresponding to the first target service port in the polling order to obtain the second data packet with the preset data length; where 0 < i ≤ N, 0 < p < N, and both i and p are positive integers.
6. The method according to claim 5, characterized in that, The process of packetizing the data to be packetized into data packets with a preset data length based on the current state of the state machine and N service ports in the preset port order to obtain the second data packet further includes: When the state machine is in the i-th service port state and the second cumulative length of the second cumulative data to be packetized is less than the preset data length, determine whether the sum of the second cumulative length and the length of the data to be packetized of the i-th service port after re-polling is greater than or equal to the preset data length; wherein, the second cumulative data to be packetized is obtained by sequentially accumulating the remaining data that was not packetized in the previous beat in the i-th service port and the data to be packetized of N - 1 service ports according to the first preset rule; When the sum of the second cumulative length and the length of the data to be packetized of the i-th service port after re-polling is greater than or equal to the preset data length, keep the current state of the state machine in the i-th service port state; Packetize according to the order of the remaining data, the data to be packetized of N - 1 consecutive service ports starting from the service port after the i1-th service port in the polling order, and the data to be packetized of the i-th service port after re-polling to obtain the second data packet with the preset data length.
7. The method according to claim 6, characterized in that, The current state of the state machine further includes an idle operation state. The process of packetizing the data to be packetized into data packets with a preset data length based on the current state of the state machine and N service ports in the preset port order to obtain the second data packet further includes: When the state machine is in the i-th service port state and the sum of the second cumulative length and the length of the data to be packetized of the i-th service port after re-polling is less than the preset data length, jump the current state of the state machine from the i-th service port state to the idle operation state; Packetize the data in the order of the remaining data, the data to be packetized of N - 1 consecutive service ports starting from the next service port of the i-th service port in the polling order, the data to be packetized of the i-th service port after re-polling, and multiple null packets, to obtain the second data packet with the preset data length.
8. The method according to claim 5, characterized in that, The current state of the state machine further includes a null operation state. Packetizing the data to be packetized into a data packet with a preset data length based on the current state of the state machine and N service ports according to a preset port order to obtain the second data packet further includes: When the state machine is in the null operation state, determine the starting service port for packetization according to the previous state of the state machine; When the third cumulative length corresponding to the third cumulative data to be packetized is greater than or equal to the preset data length for the first time, determine the second target service port, and change the current state of the state machine from the null operation state to the second target service port state corresponding to the second target service port; where 0 < q ≤ N and q is a positive integer; the third cumulative data to be packetized is obtained by polling N service ports in the preset port order, starting from the starting service port, and successively adding the data to be packetized of p service ports; the second target service port is the service port corresponding to the addition of q service ports; Packetize the data to be packetized in the order from the starting service port to the second target port in the polling order to obtain the second data packet with the preset data length.
9. The method according to claim 8, characterized in that, Packetizing the data to be packetized into a data packet with a preset data length based on the current state of the state machine and N service ports according to a preset port order to obtain the second data packet further includes: When the state machine is in the null operation state and the fourth cumulative length corresponding to the fourth cumulative data to be packetized obtained by adding the data to be packetized of N service ports is less than the preset data length, keep the current state of the state machine in the null operation state; Poll N service ports in the preset port order starting from the starting service port, and packetize the data to be packetized of N service ports and multiple null packets in order to obtain the second data packet with the preset data length.
10. A data transmission method, characterized in that, Applied to the data receiving end, the method includes: Based on a preset data transmission protocol, parse the second data packet received through a data logic interface to obtain the packet length information of the first data packet; where the data logic interface corresponds to the preset data transmission protocol, and the second data packet is formatted data conforming to the specification of the data logic interface; the second data includes the first data packet; Determine the data length of the first data packet according to the packet length information; Obtain the first data packet according to the data offset and the data length.
11. The method according to claim 10, characterized in that, The packet length information includes a data type field, a header data field, a payload data field, and a full byte enable field; The data type field is used to identify the service port corresponding to the first data packet; the header data field is used to identify whether the first data packet carries a communication request; the payload data field is used to identify whether the first data packet carries data corresponding to the communication request; and the full-byte enable field is used to identify whether all the data in the first data packet is valid.
12. The method according to claim 11, characterized in that, When the full-byte enable field indicates that there are invalid bytes in the data in the first data packet, the packet length information also includes a byte enable field, which is used to identify the validity of each byte in the first data packet.
13. The method according to claim 10, characterized in that, The second data packet includes multiple copies of the first data packet; The step of obtaining the first data packet based on the data offset and the data length includes: Starting from the initial data offset, according to the arrangement order of each first data packet in the second data packet, the data offset of the previous first data packet is added to its data length to obtain the data offset of the next first data packet, and data is extracted sequentially according to the data offset to obtain each first data packet.
14. A data transmission device, characterized in that, The device, applied to a data transmitting end, includes: The packetization module is used to encapsulate a first data block received from the service port of the data sending end into a first data packet; A packet assembly module is used to assemble the first data packet into a second data packet based on the service port; The sending module is used to send the second data packet to the data receiving end through a data logic interface based on a preset data transmission protocol; wherein the data logic interface corresponds to the preset data transmission protocol, and the second data packet is formatted data conforming to the specification of the data logic interface.
15. An electronic device, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the data transmission method according to any one of claims 1-13.
16. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the data transmission method according to any one of claims 1-13.