Communication method, protocol conversion device and integrated circuit
By receiving and parsing the message attribute values in the integrated circuit, conversion between different communication protocols is achieved, which solves the communication challenges between IP cores and improves the functionality and efficiency of the integrated circuit.
Patent Information
- Application Number
- CN202111274571.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-29
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2041-10-29
AI Technical Summary
In integrated circuits, since IP cores use different communication protocols, achieving efficient communication becomes a challenge.
By receiving and parsing messages of the first type of communication protocol, obtaining message attribute values, and determining messages that comply with the second type of communication protocol based on these attribute values, conversion between different communication protocols is achieved.
It realizes information transmission between different communication protocols, increases the achievable functions of integrated circuits, and improves communication efficiency.
Smart Images

Figure CN116074396B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and more particularly to a communication method, a protocol conversion device and an integrated circuit. Background Art
[0002] As integrated circuits (ICs) become increasingly complex, they may contain hundreds of IP cores (Intellectual Property Cores). Due to the performance demands of integrated circuits, these cores may utilize different communication protocols. Therefore, enabling communication between these cores within an IC is a crucial issue. Summary of the Invention
[0003] In view of this, the embodiment of the present invention provides a communication method, a protocol conversion device and an integrated circuit
[0004] In a first aspect, an embodiment of the present invention provides a communication method, the method comprising:
[0005] receiving a first message from a first end, where the first message includes at least one command, response, and / or data, and is a first type communication protocol packet;
[0006] Parsing the first message to obtain message attribute values;
[0007] Determining a second message based on the message attribute value, where the second message is a second type of communication protocol packet that complies with a second type of communication protocol;
[0008] The second message is sent to the second end.
[0009] Optionally, the second type of communication protocol is a unidirectional communication protocol, and each second type of communication protocol packet that complies with the second type of communication protocol has the same field format.
[0010] Optionally, the second type of communication protocol packet includes a broadcast field, and the broadcast field is used to represent the broadcast address of the corresponding second type of communication protocol packet.
[0011] Optionally, the message attribute value includes a broadcast attribute value, and parsing the first message to obtain the message attribute value includes:
[0012] Parsing the first message to obtain information in a user-defined field in the first message;
[0013] Determine a broadcast attribute value according to the information in the user-defined field;
[0014] Determining, based on the message attribute value, the second message includes:
[0015] The broadcast field is determined according to the broadcast attribute value.
[0016] Optionally, the first type of communication protocol is a bidirectional communication protocol, the first type of communication protocol has multiple communication channels, and the first type of communication protocol packet corresponding to each communication channel has a corresponding field format.
[0017] Optionally, the first message includes a write command and write data, or the first message includes a read command, or the first message includes a write response, or the first message includes read data.
[0018] Optionally, the method further includes:
[0019] In response to the first message including a write command and a read command, determining a conversion order of the write command and the read command according to a predetermined algorithm;
[0020] In response to the first message including a write response and read data, a conversion order of the write response and the read data is determined according to the predetermined algorithm.
[0021] Optionally, sending the second message to the second end includes:
[0022] In response to the ready signal of the second end being high, the second message is sent to the second end.
[0023] Optionally, the method further includes:
[0024] In response to the buffer corresponding to the first message being not full, the command, response, and / or data in the first message are cached in the corresponding buffer respectively.
[0025] Optionally, the first message includes a write command and write data;
[0026] In response to a buffer corresponding to the first message being not full, caching the command, response, and / or data in the first message into the corresponding buffer respectively includes:
[0027] In response to a write command buffer corresponding to the write command channel being not full, buffering the write command in the write command buffer;
[0028] In response to a write data cache corresponding to the write data channel being not full, the write data is cached in the write data cache.
[0029] Optionally, the write data cache includes a first cache and a second cache;
[0030] The first cache is used to cache write data that is not transmitted in a whole packet, and the second cache is used to cache write data that is transmitted in a whole packet.
[0031] Optionally, the first type of communication protocol is a unidirectional communication protocol, and the second communication protocol is a bidirectional communication protocol.
[0032] Optionally, parsing the first message to obtain a message attribute value includes:
[0033] In response to the write command buffer corresponding to the second end being not full and the write data buffer being not full, the first message is parsed to obtain attribute values corresponding to the write command and the write data.
[0034] In a second aspect, an embodiment of the present invention provides a communication device, the device comprising:
[0035] a receiving unit configured to receive a first message from a first end, wherein the first message includes at least one command, response, and / or data, and is a first type communication protocol packet;
[0036] a parsing unit, configured to parse the first message and obtain a message attribute value;
[0037] a determining unit configured to determine, based on the message attribute value, a second message, wherein the second message is a second type of communication protocol packet that complies with a second type of communication protocol;
[0038] The sending unit is configured to send the second message to the second end.
[0039] In a third aspect, an embodiment of the present invention provides a protocol conversion device, which is configured to execute the method described in the first aspect of the embodiment of the present invention.
[0040] In a fourth aspect, an embodiment of the present invention provides an integrated circuit, comprising at least a first terminal, a second terminal, and a protocol conversion device;
[0041] wherein the first end and the second end support different communication protocols;
[0042] The protocol conversion device is configured to execute the method described in the first aspect of the embodiment of the present invention to achieve communication between the first end and the second end.
[0043] In a fifth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in the first aspect of the embodiment of the present invention is implemented.
[0044] In a sixth aspect, an embodiment of the present invention provides a computer program product, which, when executed on a computer, enables the computer to execute the method described in the first aspect of the embodiment of the present invention.
[0045] In an embodiment of the present invention, a first message is received from a first end, the first message is parsed to obtain a message attribute value, a second message is determined based on the message attribute value, and the second message is sent to a second end. The first message is a first-type communication protocol packet, the second message is a second-type communication protocol packet, and the first message includes at least one command, response, and / or data. Thus, this embodiment of the present invention can implement information transmission between different communication protocols, thereby increasing the achievable functionality of an integrated circuit. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The above and other objects, features and advantages of the present invention will become more apparent through the following description of the embodiments of the present invention with reference to the accompanying drawings, in which:
[0047] Figure 1 is a schematic diagram of a communication process of an integrated circuit in an embodiment of the present invention;
[0048] Figure 2 This is a schematic diagram of a protocol conversion process according to an embodiment of the present invention;
[0049] Figure 3 is a schematic diagram of a communication process of another integrated circuit in an embodiment of the present invention;
[0050] Figure 4 is a schematic diagram of a communication process of another integrated circuit in an embodiment of the present invention;
[0051] Figure 5-Figure 12 2 is a schematic diagram of communication protocol conversion according to an embodiment of the present invention;
[0052] Figure 13 is a flow chart of a communication method according to an embodiment of the present invention;
[0053] Figure 14 FIG. 1 is a schematic diagram of a communication device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0054] The present invention is described below based on the following embodiments, but the present invention is not limited to these embodiments. In the detailed description of the present invention below, certain specific details are described in detail. Those skilled in the art can fully understand the present invention without these details. To avoid obscuring the essence of the present invention, well-known methods, processes, procedures, components, and circuits are not described in detail.
[0055] Furthermore, persons of ordinary skill in the art will appreciate that the figures provided herein are for illustration purposes only and are not necessarily drawn to scale.
[0056] Unless the context clearly requires otherwise, words like “include”, “comprising” and the like in the specification should be interpreted as including rather than exclusive or exhaustive; that is, as “including but not limited to”.
[0057] In the description of the present invention, it should be understood that the terms "first", "second", etc. are used for descriptive purposes only and should not be understood to indicate or imply relative importance. In addition, in the description of the present invention, unless otherwise specified, "plurality" means two or more.
[0058] An integrated circuit according to an embodiment of the present invention includes at least one first terminal and at least one second terminal. The first terminal and the second terminal support different communication protocols and have different communication protocol interfaces. The first terminal supports a first type of communication protocol, and the second terminal supports a second type of communication protocol.
[0059] Figure 1 FIG. 1 is a schematic diagram of a communication process of an integrated circuit in an embodiment of the present invention. Figure 1 As shown, in this embodiment, the first type of communication protocol is a bidirectional communication protocol, and the second type of communication protocol is a unidirectional communication protocol. It should be understood that this embodiment is not limited to this. Other situations are also possible, such as the first type of communication protocol being a unidirectional communication protocol and the second type of communication protocol being a bidirectional communication protocol, or the first type of communication protocol and the second type of communication protocol being different bidirectional communication protocols, or the first type of communication protocol and the second type of communication protocol being different unidirectional communication protocols.
[0060] In an optional implementation, for the second type of communication protocol of this embodiment, the unidirectional communication protocol is a custom communication protocol that adopts a single-channel mode during unidirectional transmission. Each second type of communication protocol packet that complies with the second type of communication protocol has the same field format.
[0061] The process of transmitting a message from the first end to the second end also involves the broadcasting of the message, that is, sending the message to multiple devices. Therefore, further optionally, the second-class communication protocol packet includes a broadcast field, which is used to represent the broadcast address of the corresponding second-class communication protocol packet. Then, the broadcast address in the second-class communication protocol packet that complies with the second-class communication protocol can be used to directly determine which devices the message is sent to, without the need to send a broadcast instruction or send it multiple times, thereby improving the transmission efficiency of the broadcast. For example, assuming that the integrated circuit includes devices core0-5, where devices core0, core1, core2, and core3 need to read the same data, that is, the read data packet needs to be broadcast to devices core0-3 (i.e., the broadcast address), then the coremap field can be 001111. Among them, each flag bit in the coremap field indicates whether the corresponding device reads the data. Optionally, a flag bit of 1 indicates that the corresponding device reads the data, and a flag bit of 0 indicates that the corresponding device does not read the data. Optionally, the broadcast field can also be used to quickly query the broadcast status of the second-class communication protocol packet, that is, to determine whether the second-class communication protocol packet needs to be broadcast. If at least one flag bit in the broadcast field is 1, the broadcast status of the protocol packet indicates that broadcast is required. If all flag bits in the broadcast field are 0, the broadcast status of the protocol packet indicates that broadcast is not required. Therefore, in this embodiment, by setting a fixed broadcast field in the protocol packet, the broadcast attribute value of the message can be directly obtained without analyzing various information in the user-defined field, thereby improving communication efficiency.
[0062] In an optional implementation, for the first type of communication protocol in this embodiment, the bidirectional communication protocol has multiple communication channels, and the first type of communication protocol packets corresponding to each communication channel have corresponding field formats. For example, the AXI communication protocol has a write command channel, a write data channel, a write response channel, a read command channel, and a read data channel, and AXI protocol packets such as write command packets, write data packets, write response packets, read command packets, and read data packets are transmitted through each channel respectively. In the first type of communication protocol, the user-defined fields in the first type of communication protocol packets may include different information such as broadcast attribute values. Among them, if the first type of communication protocol packet needs to be broadcast, its user-defined fields include broadcast attribute values. If the first type of communication protocol packet does not need to be broadcast, its user-defined fields do not include broadcast attribute values. In other words, in the first type of communication protocol packet, the information in the user-defined fields is not fixed, and the user-defined fields need to be parsed to determine what information the user has customized.
[0063] In this embodiment, integrated circuit 1 is described using an example in which first terminal 11 in integrated circuit 1 sends an operation request to second terminal 12 and second terminal 12'. It should be understood that this embodiment can implement communication between the first terminal and the second terminal to achieve corresponding functions, or can implement communication between different first terminals using the second terminal as a relay, thereby improving communication efficiency.
[0064] In this embodiment, during the operation of the integrated circuit 1, the first end 11 sends a first message s1. The first message s1 is a first-class communication protocol packet, and the first message s1 includes at least one command, response and / or data. Optionally, the first message includes a write command and write data, or the first message includes a read command, or the first message includes a write response, or the first message includes read data. The protocol conversion unit 13 parses the first message s1, obtains the corresponding message attribute value, and determines the second message s1' based on the message attribute value, and sends the second message s1' to the second end 12. That is, the protocol conversion unit 13 converts the message attribute value under the first-class communication protocol into the message attribute value under the second-class communication protocol to form a second message. In this way, message conversion under different communication protocols can be achieved, thereby realizing communication between IP cores with different communication protocol interfaces.
[0065] In an optional implementation, the message attribute value includes a broadcast attribute value. The protocol conversion unit 13 parses the first message s1, obtains information in the user-defined field in the first message, determines the broadcast attribute value based on the information in the user-defined field, and determines the broadcast field based on the broadcast attribute value. Specifically, assuming that the integrated circuit includes devices core0-5, if the information in the user-defined field in the first message does not include broadcast information, that is, the first message does not need to be broadcast, then the broadcast attribute value determined based on the information in the user-defined field indicates that the first message does not need to be broadcast (for example, the broadcast attribute value is 0), and the broadcast field of the second message determined based on the broadcast attribute value can be 000000, that is, devices core0-5 do not need to read the first message. If the information in the user-defined field in the first message includes broadcast information, that is, the first message needs to be broadcast, and the broadcast address includes core0-3, then the broadcast attribute value determined based on the information in the user-defined field indicates the broadcast address, and the broadcast field of the second message determined based on the broadcast attribute value can be 001111, that is, devices core0-3 read the first message simultaneously.
[0066] In an optional implementation, if first end 11 needs to write data to second end 12, or write data to another first end using second end 12 as an intermediary, first message s1 includes a write command and write data. Optionally, first end 11 sends the write command and write data via different communication channels. For example, the write command may be sent via a write command channel, and the write data may be sent via a write data channel.
[0067] Optionally, different communication channels each have a corresponding cache. In response to the write command cache corresponding to the write command channel being not full, the write command is cached in the write command cache. In response to the write data cache corresponding to the write data channel being not full, the write data is cached in the write data cache. The protocol conversion unit 13 parses the write command and write data, obtains the message attribute values of the write command and write data, and determines the second message s1' based on the message attribute values of the write command and write data. Afterwards, the second end 12 receives the second message s1' in response to the ready signal (ready signal) being pulled high. That is, Figure 2 As shown, in this embodiment, when the first end 11 performs a write operation, the write command field and the write data field are respectively sent through different communication channels, and the protocol conversion unit 13 parses the write command field and the write data field, and converts the corresponding attribute values into attribute values under the second type of communication protocol to form a second message s1', that is, a write operation field under the second type of communication protocol is formed, and the write operation field is sent to the second end 12 through a single communication channel of the second type of communication protocol.
[0068] In an optional implementation, in response to the write command cache and / or write data cache being full, the ready signal of the channel corresponding to the full cache is pulled low, and the write operation is back-pressured, that is, the write operation cannot be performed until the corresponding cache is not full, so that the write command and write data can be cached.
[0069] In an optional implementation, a write command may correspond to multiple write data, that is, the write command indicates that multiple data are to be written to the same address. In this case, the present embodiment may pre-set a method for writing data. In an embodiment of the present invention, the pre-set method for writing data may include a non-whole packet transmission method and a whole packet transmission method. For example, for each write data of the same write command, a bypass non-whole packet transmission method may be adopted, that is, if a certain write data of the write command is cached in the cache, the write command and the write data are sent immediately when the ready signal of the corresponding second end is pulled high. For all write data of the same write command, a whole packet transmission method may also be adopted, that is, when all write data corresponding to the write command are cached in the cache, a data packet is formed based on the write command and all write data, and the data packet is sent when the ready signal of the corresponding second end is pulled high.
[0070] In an optional implementation, the second end 12' is a slave device of the second end 12. After the write request is responded to, the second end 12' receives and sends a first write response packet s2'. Optionally, in response to the write response cache corresponding to the write response channel of the first type of communication protocol being non-full, the protocol conversion unit 13' parses the first write response packet s2', obtains the attribute value of the first write response packet s2', determines the second write response packet s2 based on the attribute value of the first write response packet s2', sends the second write response packet s2 to the write response cache of the first type of communication protocol for caching, and sends the second write response packet s2 to the first end 11 when the ready signal of the write response channel is pulled high. In other optional implementations, the protocol conversion unit 13' may also have a corresponding cache. Thus, after the protocol conversion unit 13' receives the first write response packet s2', it parses the first write response packet s2', obtains the attribute value of the first write response packet s2', and determines and caches the second write response packet s2 based on the attribute value of the first write response packet s2'. When the write response cache corresponding to the write response channel of the first type of communication protocol is not full, the second write response packet s2 is sent to the write response cache for cache. Therefore, there is no need to first determine whether the write response cache of the first type of communication protocol is not full before performing protocol conversion, thereby reducing transmission delay.
[0071] In an optional implementation, if the first end 11 needs to read data from the second end 12, or read data from other first ends via the second end 12, the first message s1 includes a read command. Optionally, the first end 11 sends the read command via a read command channel.
[0072] Optionally, the read command channel has a corresponding read command cache. In this embodiment, in response to the read command cache corresponding to the read command channel being non-full, the read command is cached in the read command cache, and the read command is parsed via the protocol conversion unit 13 to obtain the message attribute value of the read command, and the second message s1' is determined based on the message attribute value of the read command, and when the ready signal of the second end 12 is high, the second message s1' is sent to the second end 12. That is, in this embodiment, when the first end 11 performs a read operation, the read command field is sent through the read command channel, the read command field is parsed by the protocol conversion unit 13, and the attribute value corresponding to the read command field is converted into an attribute value under the second type of communication protocol to form the second message s1', that is, the read command field under the second type of communication protocol is formed, and the read command field is sent to the second end 12 through the communication channel of the second type of communication protocol.
[0073] In an optional implementation, in response to the read command buffer being full, the ready signal of the read command channel is pulled low and the read operation is back-pressured, that is, the read operation cannot be executed until the read command buffer is not full to cache the read command.
[0074] In an optional implementation, the second end 12' is a slave device of the second end 12. After the read request is responded to, the second end 12' receives and sends a first read data packet s2'. Optionally, in response to the read data cache corresponding to the read data channel of the first type of communication protocol being non-full, the protocol conversion unit 13' parses the first read data packet s2', obtains the attribute value of the first read data packet s2', determines the second read data packet s2 based on the attribute value of the first read data packet s2', sends the second read data packet s2 to the read data cache of the first type of communication protocol for caching, and sends the second read data packet s2 to the first end 11 when the ready signal of the read data channel is pulled high. In other optional implementations, the protocol conversion unit 13' may also have a corresponding cache. Thus, after the protocol conversion unit 13' receives the first read data packet s2', it parses the first read data packet s2', obtains the attribute value of the first read data packet s2', and determines and caches the second read data packet s2 based on the attribute value of the first read data packet s2'. When the write response cache corresponding to the write response channel of the first type of communication protocol is not full, the second read data packet s2 is sent to the write response cache for cache. Therefore, there is no need to first determine whether the read data cache of the first type of communication protocol is not full before performing protocol conversion, thereby reducing transmission delay.
[0075] In an optional implementation, the first message may include a write command, write data, and a read command at the same time, that is, the first end 11 issues a write operation and a read operation at the same time. The protocol conversion unit 13 may use a predetermined algorithm to determine the conversion order of the write operation and the read operation, that is, the protocol conversion order of the write command and the write data and the protocol conversion order of the read command. Optionally, the predetermined algorithm may be a round robin method. It should be understood that other load balancing algorithms, such as weighted round robin, smooth weighted round robin, random method, weighted random method, etc., may be applied to this embodiment, and this embodiment is not limited thereto.
[0076] In an embodiment of the present invention, a protocol conversion unit is used to parse a first-type communication protocol packet, obtain corresponding attribute values, and obtain corresponding second-type communication protocol packets based on the attribute values obtained by the parsing, thereby realizing communication between devices with different communication protocol interfaces. In addition, the first-type communication protocol adopts multi-channel transmission during the transmission process (for example, in the first-type communication protocol, sending read and write commands adopts a write command channel, a write data channel, and a read command channel), while the second-type communication protocol adopts a single-channel transmission during the same-direction transmission process (receiving read and write commands adopts the same communication channel), thereby simplifying the transmission process. As a result, communication between different devices supporting the first-type communication protocol can be realized by using devices supporting the second-type communication protocol as a transit device, thereby improving communication efficiency.
[0077] Figure 3 FIG2 is a schematic diagram of another communication process of an integrated circuit in an embodiment of the present invention. In this embodiment, the first end supports a first type of communication protocol, and the second end supports a second type of communication protocol.
[0078] like Figure 3 As shown, the integrated circuit 2 is described by taking the second terminal 22 in the integrated circuit 2 as an example of sending an operation request to the first terminal 21. It should be understood that this embodiment can implement communication between the first terminal and the second terminal to achieve corresponding functions, and can also implement communication between different first terminals using the second terminal as a relay, thereby improving communication efficiency.
[0079] In this embodiment, during the operation of the integrated circuit 2, the second end 22 receives and sends a second message s3. The second message s3 is a second-type communication protocol packet, and the second message s3 includes at least one command and / or data. Furthermore, if the second message s3 includes a command and data, the command and data are transmitted together. The protocol conversion unit 23 parses the second message s3, obtains the corresponding message attribute value, and determines the first message s3' based on the message attribute value, and sends the first message s3' to the first end 21. That is, the protocol conversion unit 23 converts the message attribute value under the second-type communication protocol into the message attribute value under the first-type communication protocol to form a first message. Thus, message conversion under different communication protocols can be achieved, thereby enabling communication between IP cores with different communication protocol interfaces.
[0080] In an optional implementation, if the second end 22 needs to write data to the first end 21, or another first end writes data to the first end 21 via the second end 22, the second message s3 includes a write command and write data, wherein the write command and write data are transmitted together.
[0081] Optionally, the first end 21 receives the write command and write data through different communication channels, that is, the write command and write data are transmitted separately on the first end 21. For example, the first end 21 receives the write command through the write command channel and receives the write data through the write data channel.
[0082] Optionally, different communication channels each have a corresponding cache. Among them, the write command channel has a corresponding write command cache, and the write data channel has a corresponding write data cache. After the protocol conversion unit 23 parses and converts the second message s3, it obtains the write command field and the write data field and caches them in the write command cache and the write data cache, respectively. Therefore, in this embodiment, in response to the write command cache being not full and the write data cache being not full, the protocol conversion unit 23 parses the second message s3, obtains the message attribute value of the second message s3, determines the write command and write data (first message s3') based on the message attribute value of the second message s3, and caches the write command in the write command cache and the write data in the write data cache. Afterwards, in response to the ready signal of the write command channel being pulled high, the first end 21 receives the write command in the write command cache, and in response to the ready signal of the write data channel being pulled high, the first end 21 receives the write data in the write data cache.
[0083] In the above implementation, the protocol conversion unit 23 performs the protocol parsing operation only when both the write command cache and the write data cache are not full. When the write command cache and / or the write data cache are full, the back pressure write operation is performed, that is, the corresponding ready signal of the second end 22 is pulled low, so that it cannot send the second message s3. It should be understood that this embodiment is not limited to this. In other optional implementations, the protocol conversion unit 23 may have a corresponding cache. After receiving the second message s3, the protocol conversion unit 23 directly parses the second message s3, obtains the corresponding message attribute value, and generates the write command and write data based on the message attribute value, and then determines whether the write command cache and the write data cache under the first type of communication protocol are full. If the write command cache and the write data cache are not full, the write command and write data are sent to the write command cache and the write data cache respectively for caching. If the write command cache and the write data cache are full, the protocol conversion unit 23 may use its own cache to temporarily store the write command and write data until the write command cache and the write data cache are not full. If the write command buffer is full and the write data buffer is not full, the protocol conversion unit 23 uses its own buffer to temporarily store the write command and sends the write data to the write data buffer. If the write command buffer is not full and the write data buffer is full, the protocol conversion unit 23 uses its own buffer to temporarily store the write data and sends the write command to the write command buffer.
[0084] In an optional implementation, the second end 22 is a slave device of the second end 22'. After the write operation is responded to, the first end 21 receives and sends a first write response packet s4'. Optionally, in response to the write response buffer corresponding to the write response channel of the first type of communication protocol being non-full, the write response buffer receives the first write response packet s4', parses the first write response packet s4' via the protocol conversion unit 23', obtains the attribute value of the first write response packet s4', and determines the second write response packet s4 based on the attribute value of the first write response packet s4'. Thereafter, in response to the ready signal being pulled high, the second end 22' receives the second write response packet s4.
[0085] In an optional implementation, if second end 22 needs to read data from first end 21, or another first end reads data from first end 21 using second end 22 as an intermediary, second message s3 includes a read command. Optionally, first end 21 receives the read command via a read command channel. Optionally, the read command channel has a corresponding read command buffer.
[0086] In this embodiment, in response to the read command buffer being not full, the protocol conversion unit 23 parses the second message s3, obtains the message attribute value of the second message s3, determines the first message s3' (i.e., the read command field under the first type of communication protocol) based on the message attribute value of the second message s3, and transfers the first message s3' to the read command buffer. In response to the ready signal of the read command channel being high, the first end 21 receives the first message s3' through the command channel.
[0087] Similar to the write operation, in the above implementation, in response to the read command cache being full, the read operation is back-pressured, that is, the read operation cannot be performed until the read command cache is not full, so as to cache the read command. It should be understood that this embodiment is not limited to this. In other optional implementations, if the protocol conversion unit 23 has a corresponding cache, the protocol conversion unit 23 directly parses the second message s3 after receiving the second message s3, obtains the corresponding message attribute value, and determines the read command (that is, the first message s3') based on the message attribute value, and then determines whether the read command cache under the first type of communication protocol is full. Among them, if the read command cache is not full, the read command is sent to the read command cache. If the read command cache is full, the protocol conversion unit 23 can use its own cache to temporarily store the read command until the read command cache is not full.
[0088] In one optional implementation, the second end 22 is a slave device of the second end 22'. After the read operation is responded to, the first end 21 receives and sends a first read data packet s4'. Optionally, in response to the read data cache corresponding to the read data channel of the first type of communication protocol being not full, the read data cache receives the first read data packet s4', parses the first read data packet s4' via the protocol conversion unit 23', obtains attribute values of the first read data packet s4', and determines the second read data packet s4 based on the attribute values of the first read data packet s4'. Subsequently, in response to the ready signal being pulled high, the second end 22' receives the second read data packet s4.
[0089] In an optional implementation, the write response cache and the read data cache may not be empty at the same time. Since the second end 22' adopts a single-channel mode in the information transmission in the same direction, the second end 22' cannot receive the write response and the read data at the same time. Therefore, in this embodiment, when the write response cache and the read data cache are not empty at the same time, the protocol conversion unit 23' can use a predetermined algorithm to determine the order of sending the write response and the read data to the second end 22'. Optionally, the predetermined algorithm can be a round robin method. It should be understood that other load balancing algorithms, such as weighted round robin, smooth weighted round robin, random method, weighted random method, etc. can be applied to this embodiment, and this embodiment is not limited to this.
[0090] In an embodiment of the present invention, a protocol conversion unit is used to parse a second-type communication protocol packet, obtain corresponding attribute values, and obtain corresponding first-type communication protocol packets based on the attribute values obtained by the parsing, thereby realizing communication between devices with different communication protocol interfaces. In addition, the first-type communication protocol adopts multi-channel transmission during the transmission process (for example, in the first-type communication protocol, sending read and write commands adopts a write command channel, a write data channel, and a read command channel), while the second-type communication protocol adopts a single-channel transmission during the same-direction transmission process (receiving write responses and reading data adopts the same communication channel), thereby simplifying the transmission process. As a result, communication between different devices supporting the first-type communication protocol can be realized by using devices supporting the second-type communication protocol as a transit device, thereby improving communication efficiency.
[0091] Figure 41 is a schematic diagram of the communication process of another integrated circuit in an embodiment of the present invention. In this embodiment, the first type of communication protocol is the AXI (Advanced eXtensible Interface) communication protocol, and the second type of communication protocol is the SNNP (STC Non-Conformant Bus Protocol). Among them, SNNP is a customized non-standard bus protocol, which is a unidirectional transmission protocol and adopts a single-channel mode during the same-direction transmission process. In this embodiment, an IP core supporting the SNNP protocol interface is applied to the integrated circuit. In addition to achieving customized performance, it can also serve as a transfer for communication between IP cores supporting the AXI standard protocol to improve communication efficiency.
[0092] In this embodiment, the integrated circuit includes multiple AXI master devices and AXI slave devices that support the AXI communication protocol, and multiple SNNP master devices and SNNP slave devices that support the custom SNNP communication protocol. It can realize communication between AXI devices and SNNP devices, thereby realizing customized functions, and can also use SNNP devices as a transit to realize communication between AXI devices to improve communication efficiency.
[0093] In an optional implementation, the SNNP communication protocol packet includes the following fields:
[0094] TID SID XID OP STS ATTR ADDR BYTELEN QOS Coremap USER DATA
[0095] TID represents the routing destination, SID represents the routing source; XID represents the transaction ID, which is used to maintain order; OP is also known as OPCODE, which represents the type of marked service: read or write; STS represents the status response sent or returned; ATTR is also known as Memory Attribute, which represents memory attributes, such as bufferable, cacheable, read-allocate, and write-allocate; ADDR represents the current operation address; BYTELEN represents the number of bytes transmitted in a service, QOS is also known as Quality of Service, which represents the quality of service and can be used as a security level mark, Coremap is a broadcast field, which represents the broadcast address, USER represents a user-defined field, and DATA represents the transmitted data field. The above example takes the field format of the SNNP protocol packet including the Coremap field and the USER field as an example. It should be understood that in other optional implementations, specific bytes can also be set in the USER field to place broadcast information such as the broadcast address. This embodiment does not limit whether information such as the broadcast address is used as a separate field.
[0096] Among them, STS indicates whether the command is a request, a response, or the status of the command sent (error or correct). The detailed information of the STS field is:
[0097] Status[1:0] Status,2'h0:REQ,2'h1:RSP,2'h2:ERR,2'h3:FAIL
[0098] The specific meaning of STS in the corresponding SNNP protocol packet is determined based on the values assigned to 2'h0-2'h3. For example, STS can indicate a response failure.
[0099] In an optional implementation, the SNNP communication protocol packet also includes a custom broadcast field coremap field, which is used to characterize the broadcast status of the protocol packet (whether broadcasting is required) and the broadcast address. For example, assuming that the integrated circuit includes devices core0-5, wherein devices core0, core1, core2, and core3 need to read the same data, that is, the read data packet needs to be broadcast to devices core0-3, then the coremap field can be 001111. Among them, each flag bit of the coremap field represents whether the corresponding device reads the data. The coremap field can be located at the header of the SNNP communication protocol packet to facilitate identification of whether the SNNP communication protocol packet needs to be broadcast and the broadcast address. It should be understood that this embodiment does not limit the location of the coremap field.
[0100] The AXI communication protocol has five channels: a write command (AW), a write data (W), a write response (B), a read command (AR), and a read data (R). AXI communication protocol signals include the write command channel (shown in Table 1), the write data channel (shown in Table 2), the write response channel (shown in Table 3), the read command channel (shown in Table 4), and the read data channel (shown in Table 5).
[0101] Table 1 Write command channel signals
[0102] signal name Signal Source describe awid Master Write address ID awaddr Master Write Address awlen Master Write data length awsize Master The number of bytes per transfer awburst Master Transfer Type: FIXED, INCR, WRAP awcache Master Cache Type awprot Master Protection Type awqos Master Quality of Service (QoS) awuser Master User-defined signals awvalid Master Valid signal awready Slave Ready signal
[0103] Table 2 Write data channel signals
[0104] signal name Signal Source describe wid Master Write transfer ID wdata Master Write Data wuser Master User-defined signals wvalid Master Write Valid wready Slave Ready signal
[0105] Table 3 Write response channel signal
[0106] signal name Signal Source describe bid Slave Write transfer ID bresp Slave Write response status buser Slave User-defined signals bvalid Slave Write Valid bready Master Ready signal
[0107] Table 4 Read command channel signal
[0108]
[0109]
[0110] Table 5 Read data channel signal
[0111] signal name Signal Source describe rid Master Read transfer ID rdata Master Read Data ruser Master User-defined signals rvalid Master Read valid rready Slave Ready signal
[0112] In this embodiment, the fields contained in the SNNP communication protocol packet and the fields of the protocol packets of each channel in the AXI communication protocol are parsed to complete the mutual conversion between the protocol packets, thereby realizing communication between devices with different communication protocols.
[0113] Assume that the AXI device uses the SNNP device as a transfer to implement the write operation. Figure 4 As shown, the AXI master device 41 sends a write command Axi_aw_ch and write data Axi_w_ch through the AXI slave device 42. In response to the write command buffer Axi_aw_fifo being not full, the write command Axi_aw_ch is stored in the write command buffer Axi_aw_fifo. In response to the write command buffer Axi_aw_fifo being full, the ready signal corresponding to the write command channel is set low, and the write operation is back-pressured, which means that the current write operation needs to be delayed. In addition, in response to the write data buffer Axi_w_fifo being not full, the write data Axi_w_ch is stored in the write data buffer Axi_w_fifo. In response to the write data buffer Axi_aw_fifo being full, the ready signal corresponding to the write data channel is set low, and the write operation is back-pressured, which means that the current write operation needs to be delayed.
[0114] In an optional implementation, the write data channel also includes another write data buffer, Axi_w_info_fifo, for implementing full-packet transmission. Specifically, when the integrated circuit is configured for full-packet transmission using a write operation, multiple data items corresponding to the same write command are cached in the write data buffer, Axi_w_info_fifo. All data in a burst corresponding to the same write command is stored, and a single protocol packet is generated based on the write command and all data in the burst and transmitted.
[0115] In this embodiment, in response to the ready signal of the SNNP master device 45 being pulled high, that is, the SNNP master device is ready to receive data, the AXI-SNNP protocol conversion unit 43 parses the write command Axi_aw_ch in the write command buffer Axi_aw_fifo and the write data Axi_w_ch in the write data buffer Axi_w_fifo, obtains the attribute values of the write command Axi_aw_ch and the write data Axi_w_ch, determines the second message awSnnp based on the attribute values of the write command Axi_aw_ch and the write data Axi_w_ch, and sends the second message awSnnp to the SNNP master device 45. The second message awSnnp is a write operation protocol packet that complies with the SNNP communication protocol.
[0116] Figure 5-Figure 12 This is a schematic diagram of the communication protocol conversion of an embodiment of the present invention. Figure 5 As shown, this embodiment is a schematic diagram of converting a write command and write data that conforms to the AXI communication protocol into a write operation protocol packet that conforms to the SNNP communication protocol.
[0117] Among them, the write command and write data that conform to the AXI communication protocol are parsed to determine the attribute values of each attribute corresponding to the write operation task, such as the write address, write data length, number of bytes transmitted each time, transmission type, cache type, protection type, quality of service qos, user-defined signal, write transmission ID, write address ID, write data, etc. Figure 5The conversion relationship shown in the figure converts the attribute values of each attribute parsed into attribute values that comply with the SNNP communication protocol and assigns them to the write operation protocol packet that complies with the SNNP protocol. Among them, the write address Axi_awaddr is parsed based on the system address map System address map, the routing destination attribute value of the write address Axi_awaddr is converted and assigned to the field TID, the write address attribute value of the write address Axi_awaddr is converted and assigned to the field ADDR, the attribute value corresponding to the system source System define is converted and assigned to the field SID, the attribute value corresponding to the write transmission IDAxi_wid and the attribute value of the write address IDAxi_awidde are converted and assigned to the field XID, and the type of the write operation Axi The attribute value of write is converted and assigned to the field OP. The attribute value corresponding to the request requst is converted and assigned to the field STS. The attribute value corresponding to the cache type is assigned to the field ATTR. The attribute values corresponding to the write data length Axi_awlen, the number of bytes transferred per time Axi_awsize, and the transfer type Axi_awburst are converted and assigned to the field BYRELEN. The attribute value corresponding to the quality of service Axi_awqos is assigned to the field QOS. The attribute values corresponding to the user-defined signals Axi_awuser and Axi_wuser and the protection type Axi_awprot are assigned to the fields USER and Coremap. The value corresponding to the write data Axi_wdata is assigned to the field DATA, thereby forming the second message awSnnp. The broadcast attribute value is determined based on whether the user-defined signals Axi_awuser and Axi_wuser include broadcast information, and the determined broadcast attribute value is assigned to the field Coremap. The attribute values corresponding to other information in the user-defined signals Axi_awuser and Axi_wuser are assigned to the field USER. Thus, this embodiment can parse write commands and write data that conform to the AXI communication protocol, determine the attribute values of each attribute, assign values to each field of a protocol packet that conforms to the SNNP communication protocol based on the attribute values of each attribute, and determine the corresponding write operation protocol packet that conforms to the SNNP communication protocol. Thus, communication between an AXI device whose communication protocol interface is AXI and an SNNP device whose communication protocol interface is SNNP is implemented.
[0118] In this embodiment, after the SNNP master device 45 receives the second message awSnnp, it is forwarded through one or more SNNP slave devices, and the SNNP master device 45 sends the second message awSnnp to the SNNP slave device 47. It should be understood that the transmission between the SNNP master device 45 and the SNNP slave device 47 is the same protocol transmission, and the SNNP communication protocol is a unidirectional communication protocol, and a single-channel transmission mode is used for the same-directional transmission.
[0119] After the SNNP-AXI protocol conversion unit 49 parses and converts the second message awSnnp, it obtains the write command Axi_aw_ch and the write data Axi_w_ch, and caches the write command Axi_aw_ch and the write data Axi_w_ch in the write command buffer Axi_aw_fifo and the write data buffer Axi_w_fifo, respectively. Therefore, in this embodiment, in response to the write command buffer Axi_aw_fifo being not full and the write data buffer Axi_w_fifo being not full, the SNNP-AXI protocol conversion unit 49 parses the second message awSnnp, obtains the message attribute values of the second message awSnnp, determines the first message (i.e., the write command Axi_aw_ch and the write data Axi_w_ch) based on the attribute values of each attribute in the second message awSnnp, caches the write command Axi_aw_ch in the write command buffer Axi_aw_fifo, and caches the write data Axi_w_ch in the write data buffer Axi_w_fifo. Afterwards, in response to the ready signal of the write command channel being pulled high, AXI master 51 receives the write command Axi_aw_ch from the write command buffer Axi_aw_fifo. In response to the ready signal of the write data channel being pulled high, AXI master 51 receives the write data from the write data buffer Axi_w_fifo. Furthermore, AXI master 51 sends the write command Axi_aw_ch and write data Axi_w_ch to AXI slave 52 based on the AXI communication protocol.
[0120] like Figure 6 As shown in FIG, this embodiment is a schematic diagram of converting a write operation protocol packet that complies with the SNNP communication protocol into a write command and write data that complies with the AXI communication protocol. Among them, the second message awSnnp that complies with the SNNP communication protocol is parsed to determine the attribute values of each attribute corresponding to the current write operation task, such as the write address, write data length, number of bytes per transmission, transmission type, cache type, protection type, quality of service qos, broadcast information, user-defined signal, write transmission ID, write address ID, and write data, and based on Figure 6 The conversion relationship shown converts the parsed attribute values of each attribute into a write command Axi_aw_ch and write data Axi_w_ch that comply with the AXI communication protocol.
[0121] This embodiment can parse a write operation protocol packet that complies with the SNNP communication protocol, determine the attribute value of each attribute, assign values to each field of the protocol packet that complies with the AXI communication protocol based on the attribute value of each attribute, and determine the corresponding write command and write data that comply with the AXI communication protocol. This enables communication between an AXI device with an AXI communication protocol interface and an SNNP device with an SNNP communication protocol interface.
[0122] In this embodiment, after a write operation is responded to, the AXI slave device 52 sends a write response Axi_b_ch to the AXI master device 51. In response to the write response buffer Axi_b_fifo of the write response channel corresponding to the AXI master device 51 being non-full, the write response buffer Axi_b_fifo receives the write response Axi_b_ch sent by the AXI master device 51, and parses the write response Axi_b_ch via the AXI-SNNP protocol conversion unit 50, obtains the attribute value of the write response Axi_b_ch, and determines a write response packet bSnnp based on the attribute value of the write response Axi_b_ch. Subsequently, the SNNP master device 48 receives the write response packet bSnnp in response to the ready signal being pulled high. The write response packet bSnnp is a write response protocol packet that complies with the SNNP communication protocol.
[0123] like Figure 7 As shown in FIG, this embodiment is a schematic diagram of converting a write response packet that complies with the AXI communication protocol into a write response packet that complies with the SNNP communication protocol. The write response Axi_b_ch that complies with the AXI communication protocol is parsed to determine the attribute values of the write transmission ID, transmission type: write response, write response status, user-defined signal in the write response, etc. corresponding to this write response, and based on Figure 7 The conversion relationship is used to convert the attribute values of each attribute parsed into a write response packet bSnnp that complies with the SNNP communication protocol.
[0124] The attribute value of the write transmission identifier Axi_bid is converted and assigned to the XID field. The attribute value corresponding to the write response status Axi_bresp (the type and status of the response packet) is converted and assigned to the OP field and the STS field. The attribute value corresponding to the user-defined signal Axi_buser is assigned to the USER field and the Coremap field. The broadcast attribute value is determined based on whether the user-defined signal Axi_buser includes broadcast information, and the determined broadcast attribute value is assigned to the Coremap field. The attribute values corresponding to other information in the user-defined signal Axi_buser are assigned to the USER field. Other unassigned fields in the SNNP protocol packet are default values or empty. Thus, this embodiment can parse the write response Axi_b_ch that conforms to the AXI communication protocol, determine the attribute values of each attribute in the write response Axi_b_ch, assign values to each field of the protocol packet that conforms to the SNNP communication protocol based on the attribute values of each attribute in the write response Axi_b_ch, and determine the corresponding write response packet bSnnp that conforms to the SNNP communication protocol. Thus, communication between an AXI device whose communication protocol interface is AXI and an SNNP device whose communication protocol interface is SNNP is achieved.
[0125] In this embodiment, after the SNNP master device 48 receives the write response packet bSnnp, it is forwarded through one or more SNNP slave devices, and the SNNP master device 48 sends the write response packet bSnnp to the SNNP slave device 46. It should be understood that the transmission between the SNNP master device 48 and the SNNP slave device 46 is the same protocol transmission, and the SNNP communication protocol is a unidirectional communication protocol, and a single-channel transmission mode is used for the same-directional transmission.
[0126] In this embodiment, in response to the write response cache Axi_b_fifo corresponding to the AXI slave device 42 being non-full, the SNNP-AXI protocol conversion unit 44 parses the write response packet bSnnp, obtains the attribute value of the write response packet bSnnp, and determines the write response Axi_b_ch that complies with the Axi communication protocol based on the attribute value of the write response packet bSnnp, and sends the write response Axi_b_ch to the cache in the write response cache Axi_b_fifo. In response to the ready signal of the write response channel being pulled high, after the AXI slave device 42 receives the write response Axi_b_ch in the write response cache Axi_b_fifo, the AXI slave device 42 sends the write response Axi_b_ch to the AXI master device 41 based on the AXI communication protocol.
[0127] like Figure 8 As shown in FIG, this embodiment is a schematic diagram of converting a write response packet that complies with the SNNP communication protocol into a write response that complies with the AXI communication protocol. The write response packet bSnnp that complies with the SNNP communication protocol is parsed to determine the write transmission ID, transmission type: write response, write response status, user-defined signal in the write response, broadcast information and other attribute values corresponding to this write response, and based on Figure 8 The conversion relationship is used to convert the attribute values of each attribute parsed into a write response Axi_b_ch that complies with the AXI communication protocol. In this way, communication between an AXI device with an AXI communication protocol interface and an SNNP device with an SNNP communication protocol interface is achieved.
[0128] In the above embodiment, based on Figure 4-Figure 8 This article describes in detail the process of performing write operations between an AXI master 41, an AXI master 51, and its AXI slaves 42 and 52, using an SNNP device as an intermediary. This process involves converting Axi communication protocol packets into SNNP communication protocol packets, and vice versa. Thus, this embodiment enables both communication between Axi and SNNP devices and communication between Axi devices using SNNP as an intermediary, thereby improving communication efficiency while achieving multifunctionality in integrated circuits.
[0129] Assume that the AXI device uses the SNNP device as a relay to implement the read operation. Figure 4 As shown, the AXI master device 41 sends a read command Axi_ar_ch through the AXI slave device 42. In response to the read command buffer Axi_ar_fifo being not full, the read command Axi_ar_ch is stored in the read command buffer Axi_ar_fifo. In response to the read command buffer Axi_ar_fif being full, the ready signal corresponding to the read command channel is set low, and the read operation is backpressured, that is, the current read operation needs to be delayed.
[0130] In this embodiment, in response to the ready signal of the SNNP master device 45 being pulled high, that is, the SNNP master device is ready to receive data, the AXI-SNNP protocol conversion unit 43 parses the read command Axi_ar_ch in the read command buffer Axi_ar_fifo, obtains the attribute value of the read command Axi_ar_ch, determines the second message arSnnp based on the attribute value of the read command Axi_ar_ch, and sends the second message arSnnp to the SNNP master device 45. The second message arSnnp is a read command protocol packet that complies with the SNNP communication protocol.
[0131] like Figure 9 As shown in FIG, this embodiment is a schematic diagram of converting a read command conforming to the AXI communication protocol into a read command protocol packet conforming to the SNNP communication protocol.
[0132] Among them, the read that complies with the AXI communication protocol is parsed to determine the attribute values of each attribute corresponding to the read operation task, such as the read address, read data length, number of bytes transmitted each time, transmission type, cache type, protection type, quality of service qos, user-defined signal, and read address ID, and based on Figure 9The conversion relationship shown in the figure converts the attribute values of each attribute parsed into attribute values that comply with the SNNP communication protocol and assigns them to the read command protocol packet that complies with the SNNP protocol. Among them, the read address Axi_araddr is parsed based on the system address map System address map, the routing destination attribute value of the read address Axi_awaddr is converted and assigned to the field TID, the read address attribute value of the read address Axi_araddr is converted and assigned to the field TID, the attribute value corresponding to the system source System define is converted and assigned to the field SID, the attribute value corresponding to the read address ID Axi_arid is assigned to the field XID, and the type of the read operation Axi The attribute value of write is converted and assigned to the field OP. The attribute value corresponding to the request requst is converted and assigned to the field STS. The attribute value corresponding to the cache type is assigned to the field ATTR. The attribute values corresponding to the read data length Axi_arlen, the number of bytes transmitted each time Axi_arsize, and the transmission type Axi_arburst are converted and assigned to the field BYRELEN. The attribute value corresponding to the quality of service Axi_arqos is assigned to the field QOS. The attribute values corresponding to the user-defined signal Axi_aruser and the protection type Axi_arprot are assigned to the fields USER and Coremap, forming the second message arSnnp. The broadcast attribute value is determined based on whether the user-defined signal Axi_aruser includes broadcast information, the determined broadcast attribute value is assigned to the field Coremap, and the attribute values corresponding to other information in the user-defined signal Axi_aruser are assigned to the field USER. Thus, this embodiment can parse a read command that conforms to the AXI communication protocol, determine the attribute value of each attribute, assign values to each field of a protocol packet that conforms to the SNNP communication protocol based on the attribute value of each attribute, and determine the corresponding read command protocol packet that conforms to the SNNP communication protocol. Thus, communication between an AXI device whose communication protocol interface is AXI and an SNNP device whose communication protocol interface is SNNP is achieved.
[0133] In this embodiment, after the SNNP master device 45 receives the second message arSnnp, it is forwarded by one or more SNNP slave devices, and the SNNP master device 45 sends the second message arSnnp to the SNNP slave device 47. It should be understood that the transmission between the SNNP master device 45 and the SNNP slave device 47 is the same protocol transmission, and the SNNP communication protocol is a unidirectional communication protocol, and a single-channel transmission mode is adopted during the same-directional transmission.
[0134] In this embodiment, in response to the read command buffer Axi_ar_fifo being not full, the SNNP-AXI protocol conversion unit 49 parses the second message arSnnp, obtains the attribute values of the second message arSnnp, determines the read command Axi_ar_ch based on the attribute values of each attribute in the second message arSnnp, and caches the read command buffer Axi_ar_ch in the read command buffer Axi_ar_fifo. Subsequently, in response to the ready signal of the read command channel being pulled high, the AXI master device 51 receives the read command Axi_ar_ch in the read command buffer Axi_ar_fifo.
[0135] like Figure 10 As shown in FIG, this embodiment is a schematic diagram of converting a read command protocol packet conforming to the SNNP communication protocol into a read command conforming to the AXI communication protocol. The second message arsnnp conforming to the SNNP communication protocol is parsed to determine the attribute values of various attributes corresponding to the read operation task, such as the read address, read data length, number of bytes transmitted each time, transmission type, cache type, protection type, quality of service qos, broadcast information, user-defined signal, and read address ID. Figure 10 The conversion relationship shown converts the parsed attribute values of each attribute into a read command Axi_ar_ch that complies with the AXI communication protocol.
[0136] This embodiment can parse a read command protocol packet that conforms to the SNNP communication protocol, determine the attribute value of each attribute, assign values to each field of the protocol packet that conforms to the AXI communication protocol based on the attribute value of each attribute, and determine the corresponding read command that conforms to the AXI communication protocol. This enables communication between an AXI device with an AXI communication protocol interface and an SNNP device with an SNNP communication protocol interface.
[0137] In this embodiment, after a read operation is responded to, the AXI slave device 52 transmits read data Axi_r_ch to the AXI master device 51. In response to the Axi_r_fifo of the read data channel corresponding to the AXI master device 51 being not full, the Axi_r_fifo of the read data channel receives the read data Axi_r_ch. The AXI-SNNP protocol conversion unit 50 parses the read data Axi_r_ch, obtains attribute values of the read data Axi_r_ch, and determines a read data packet rSnnp based on the attribute values of the read data Axi_r_ch. Subsequently, the SNNP master device 48 receives the read data packet rSnnp in response to the ready signal being pulled high. The read data packet rSnnp is a read data protocol packet that complies with the SNNP communication protocol.
[0138] like Figure 11As shown in FIG, this embodiment is a schematic diagram of converting a read data packet conforming to the AXI communication protocol into a read data packet conforming to the SNNP communication protocol. The read data Axi_r_ch conforming to the AXI communication protocol is parsed to determine the read transmission ID, transmission type: read data, read data status, user-defined signals in the read data, and attribute values of the read data, and based on Figure 11 The conversion relationship is used to convert the attribute values of each attribute parsed into a read data packet rSnnp that complies with the SNNP communication protocol.
[0139] Among them, the attribute value of the read transmission identifier Axi_rid is converted and assigned to the field XID, the attribute value corresponding to the read data status Axi_rresp (type and status of the response packet) is converted and assigned to the field OP and field STS, the attribute value corresponding to the user-defined signal Axi_ruser is assigned to the field USER and field Coremap, and the attribute value corresponding to the read data Axi_rdata is assigned to DATA. Among them, the broadcast attribute value is determined based on whether the user-defined signal Axi_ruser includes broadcast information, the determined broadcast attribute value is assigned to the field Coremap, and the attribute value corresponding to other information in the user-defined signal Axi_ruser is assigned to the field USER. Among them, other unassigned fields in the SNNP protocol packet are default values or empty. Thus, this embodiment can parse read data Axi_r_ch that conforms to the AXI communication protocol, determine the attribute values of each attribute in the read data Axi_r_ch, assign values to each field of a protocol packet that conforms to the SNNP communication protocol based on the attribute values of each attribute in the read data Axi_r_ch, and determine the corresponding read data packet rSnnp that conforms to the SNNP communication protocol. This enables communication between an AXI device with an AXI communication protocol interface and an SNNP device with an SNNP communication protocol interface.
[0140] In this embodiment, after the SNNP master device 48 receives the read data packet rSnnp, it is forwarded through one or more SNNP slave devices, and the SNNP master device 48 sends the read data packet rSnnp to the SNNP slave device 46. It should be understood that the transmission between the SNNP master device 48 and the SNNP slave device 46 is the same protocol transmission, and the SNNP communication protocol is a unidirectional communication protocol, and a single-channel transmission mode is used for the same-directional transmission.
[0141] In this embodiment, in response to the Axi_r_fifo of the read data channel corresponding to the AXI slave device 42 being non-full, the SNNP-AXI protocol conversion unit 44 parses the read data packet rSnnp, obtains the attribute value of the read data packet rSnnp, and determines the read data Axi_r_ch that complies with the Axi communication protocol based on the attribute value of the read data packet rSnnp. The read data Axi_r_ch is sent to the Axi_r_fifo of the read data channel for buffering. In response to the ready signal of the read data channel being pulled high, the AXI slave device 42 receives the read data Axi_r_ch in the Axi_r_fifo of the read data channel. The AXI slave device 42 then sends the read data Axi_r_ch to the AXI master device 41 based on the AXI communication protocol.
[0142] like Figure 12 As shown in FIG, this embodiment is a schematic diagram of converting a read data packet conforming to the SNNP communication protocol into read data conforming to the AXI communication protocol. The read data packet rSnnp conforming to the SNNP communication protocol is parsed to determine the read transmission ID, transmission type, read data, read data status, broadcast information, user-defined signals in the read data, and attribute values of the read data, and based on Figure 12 The conversion relationship is used to convert the attribute values of each attribute parsed into read data Axi_r_ch that complies with the AXI communication protocol. In this way, communication between an AXI device with an AXI communication protocol interface and an SNNP device with an SNNP communication protocol interface is achieved.
[0143] In the above embodiment, based on Figures 9-12 This article describes in detail the process of performing read operations on AXI master devices 41, 51, and their AXI slave devices 42, 52, using SNNP devices as intermediaries. This process involves converting Axi communication protocol packets into SNNP communication protocol packets, and vice versa. Thus, this embodiment enables both communication between Axi and SNNP devices and communication between Axi devices using SNNP as intermediaries, thereby improving communication efficiency while achieving multifunctionality in integrated circuits.
[0144] Figure 13 FIG. 1 is a flow chart of a communication method according to an embodiment of the present invention. Figure 13 As shown, the communication method of the embodiment of the present invention includes the following steps:
[0145] Step S110: Receive a first message from the first end. The first message includes at least one command, response, and / or data. The first message is a first-class communication protocol packet that complies with a first-class communication protocol. Optionally, the first message includes a write command and write data, or includes a read command, or includes a write response, or includes read data.
[0146] Step S120: parse the first message to obtain message attribute values.
[0147] Step S130: Determine a second message based on the message attribute value, wherein the second message is a second-type communication protocol packet that complies with the second-type communication protocol.
[0148] Step S140: Send the second message to the second end.
[0149] In an optional implementation, the second-class communication protocol is a unidirectional communication protocol, and each second-class communication protocol packet conforming to the second-class communication protocol has the same field format. In this embodiment, the second-class communication protocol is a custom communication protocol that uses a single-channel mode during unidirectional transmission. For example, the above-mentioned SNNP communication protocol.
[0150] Optionally, the second type of communication protocol packet includes a broadcast field. The broadcast field is used to represent the broadcast address of the corresponding second type of communication protocol packet. For example, assuming that the integrated circuit includes devices core0-5, wherein devices core0, core1, core2, and core3 need to read the same data, that is, the read data packet needs to be broadcast to devices core0-3, then the coremap field can be 001111. Each flag bit in the coremap field represents whether the corresponding device reads the data. Optionally, a flag bit of 1 represents that the corresponding device reads the data, and a flag bit of 0 represents that the corresponding device does not read the data. Optionally, the broadcast status of the second type of communication protocol packet can also be quickly queried through the broadcast field, that is, to determine whether the second type of communication protocol packet needs to be broadcast. If at least one flag bit in the broadcast field is 1, it represents that the broadcast status of the protocol packet needs to be broadcast; if each flag bit in the broadcast field is 0, it represents that the broadcast status of the protocol packet does not need to be broadcast. Therefore, in this embodiment, by setting a fixed broadcast field in the protocol packet, the broadcast attribute value of the message can be directly obtained without analyzing the various information in the user-defined field, thereby improving communication efficiency. Furthermore, the broadcast field can optionally be embedded in the user-defined field. It should be understood that this embodiment is not limited to this.
[0151] In an optional implementation, the first-class communication protocol is a bidirectional communication protocol having multiple communication channels, and the first-class communication protocol packets corresponding to each communication channel have corresponding field formats. For example, the AXI standard communication protocol has a write command channel, a write data channel, a write response channel, a read command channel, and a read data channel, and AXI protocol packets such as write command packets, write data packets, write response packets, read command packets, and read data packets are transmitted through each channel.
[0152] In an optional implementation, since the second type of communication protocol uses the same communication channel for unidirectional transmission, if the first message includes both a write command and a read command, a predetermined algorithm needs to be used to determine the conversion order of the write command and the read command. Similarly, if the first message includes both a write response and read data, a predetermined algorithm needs to be used to determine the conversion order of the write response and the read data. Optionally, the predetermined algorithm can be a round-robin method. It should be understood that other load balancing algorithms, such as a weighted round-robin method, a smoothed weighted round-robin method, a random method, a weighted random method, etc., can be applied to this embodiment, and this embodiment is not limited thereto.
[0153] In an optional implementation, step S140 may specifically include sending the second message to the second terminal in response to the ready signal of the second terminal being high. In other words, when the second terminal is ready to receive information, the second message is sent to the second terminal.
[0154] In an optional implementation, the communication method of this embodiment further includes: in response to the cache corresponding to the first message being not full, caching the command, response, and / or data in the first message into the corresponding cache respectively.
[0155] Optionally, assuming that the first message includes a write command and write data, in this embodiment, in response to the write command buffer corresponding to the write command channel being not full, the write command is cached in the write command buffer, and in response to the write data buffer corresponding to the write data channel being not full, the write data is cached in the write data buffer.
[0156] In an optional implementation, the write data cache includes a first cache and a second cache. The first cache is used to cache write data that is not transmitted in a whole packet, and the second cache is used to cache write data that is transmitted in a whole packet. For details, please refer to Figure 4 The buffer Axi_w_fifo and the buffer Axi_w_info_fifo shown in FIG will not be repeated here.
[0157] In another optional implementation, the first type of communication protocol is a unidirectional communication protocol, and the second type of communication protocol is a bidirectional communication protocol. During a write operation, the first message is parsed and converted to obtain the write command and write data. Therefore, execution requires that both the write command cache and the write data cache corresponding to the second end are not full. Therefore, step S120 may specifically include: in response to the write command cache and the write data cache corresponding to the second end being not full, parsing the first message to obtain the attribute values corresponding to the write command and write data.
[0158] The embodiments of the present invention can implement the function of a device supporting a unidirectional communication protocol (such as the SNNP protocol) performing a write operation and a read operation on a device supporting a bidirectional communication protocol (such as the AXI protocol), and can also implement the function of a device supporting a bidirectional communication protocol (such as the AXI protocol) performing a write operation and a read operation on a device supporting a unidirectional communication protocol (such as the SNNP protocol). At the same time, it can implement the function of executing a write operation and a read operation between devices supporting a bidirectional communication protocol using a device supporting a unidirectional communication protocol as a transfer. For the specific implementation process, see Figure 1-12 The embodiments shown are not described in detail here.
[0159] In an embodiment of the present invention, a first message is received from a first end, the first message is parsed to obtain a message attribute value, a second message is determined based on the message attribute value, and the second message is sent to a second end. The first message is a first-type communication protocol packet, the second message is a second-type communication protocol packet, and the first message includes at least one command, response, and / or data. Thus, this embodiment of the present invention can implement information transmission between different communication protocols, thereby increasing the achievable functionality of an integrated circuit.
[0160] Figure 14 Schematic diagram of a communication device according to an embodiment of the present invention. Figure 14 As shown, the communication device 14 according to the embodiment of the present invention includes a receiving unit 141 , a parsing unit 142 , a determining unit 143 and a sending unit 144 .
[0161] The receiving unit 141 is configured to receive a first message from the first end, the first message including at least one command, response, and / or data, and the first message being a first type communication protocol packet. Optionally, the first message includes a write command and write data, or the first message includes a read command, or the first message includes a write response, or the first message includes read data. The parsing unit 142 is configured to parse the first message and obtain a message attribute value. The determining unit 143 is configured to determine a second message based on the message attribute value, the second message being a second type communication protocol packet that complies with the second type communication protocol. The sending unit 144 is configured to send the second message to the second end.
[0162] In an optional implementation, the second type of communication protocol is a unidirectional communication protocol, and each second type of communication protocol packet that complies with the second type of communication protocol has the same field format. Optionally, the second type of communication protocol packet includes a broadcast field, and the broadcast field is used to represent the corresponding second type of communication protocol packet broadcast address.
[0163] In an optional implementation, the message attribute value includes a broadcast attribute value. Parsing unit 142 includes a custom parsing subunit. The custom parsing subunit is configured to parse the first message, obtain information in a user-defined field in the first message, and determine a broadcast attribute value based on the information in the user-defined field. Determination unit 143 includes a broadcast field determination subunit. The broadcast field determination subunit is configured to determine the broadcast field in the first message based on the broadcast attribute value.
[0164] In an optional implementation, the first type of communication protocol is a bidirectional communication protocol having multiple communication channels, and the first type of communication protocol packet corresponding to each communication channel has a corresponding field format.
[0165] In an optional implementation, the communication device of an embodiment of the present invention further includes a first sequence determination unit and a second sequence determination unit. The first sequence determination unit is configured to, in response to the first message including a write command and a read command, determine a conversion order between the write command and the read command according to a predetermined algorithm. The second sequence determination unit is configured to, in response to the first message including a write response and read data, determine a conversion order between the write response and the read data according to the predetermined algorithm.
[0166] In an optional implementation, the first type of communication protocol is a unidirectional communication protocol, and the second communication protocol is a bidirectional communication protocol. The parsing unit is further configured to parse the first message in response to the write command buffer and the write data buffer corresponding to the second end being not full, and to obtain attribute values corresponding to the write command and the write data.
[0167] In an embodiment of the present invention, a first message is received from a first end, the first message is parsed to obtain a message attribute value, a second message is determined based on the message attribute value, and the second message is sent to a second end. The first message is a first-type communication protocol packet, the second message is a second-type communication protocol packet, and the first message includes at least one command, response, and / or data. Thus, this embodiment of the present invention can implement information transmission between different communication protocols, thereby increasing the achievable functionality of an integrated circuit.
[0168] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of protection of the present invention.
Claims
1. A communication method, characterized in that: The method comprises: receiving a first message from a first end, where the first message includes at least one command, a response, and / or data, the first message is a first-type communication protocol packet, and a user-defined field in the first-type communication protocol packet includes a broadcast attribute value; Parsing the first message to obtain message attribute values, where the message attribute values include the broadcast attribute value; Determining a second message based on the message attribute value, where the second message is a second-type communication protocol packet that complies with the second-type communication protocol, and the second message includes a broadcast field determined based on the broadcast attribute value, where the broadcast field is used to represent a broadcast address of the corresponding second-type communication protocol packet; The second message is sent to the second end.
2. The method according to claim 1, characterized in that The second type of communication protocol is a one-way communication protocol, and each second type of communication protocol packet conforming to the second type of communication protocol has the same field format.
3. The method according to claim 1, characterized in that The message attribute value includes a broadcast attribute value, and parsing the first message to obtain the message attribute value includes: Parsing the first message to obtain information in a user-defined field in the first message; Determine a broadcast attribute value according to the information in the user-defined field; Determining, based on the message attribute value, the second message includes: The broadcast field in the first message is determined according to the broadcast attribute value.
4. The method according to claim 1, wherein The first type of communication protocol is a bidirectional communication protocol having multiple communication channels, and the first type of communication protocol packet corresponding to each communication channel has a corresponding field format.
5. The method according to any one of claims 1 to 4, characterized in that The first message includes a write command and write data, or the first message includes a read command, or the first message includes a write response, or the first message includes read data; The method further comprises: In response to the first message including a write command and a read command, determining a conversion order of the write command and the read command according to a predetermined algorithm; In response to the first message including a write response and read data, a conversion order of the write response and the read data is determined according to the predetermined algorithm.
6. The method according to claim 1, characterized in that The first type of communication protocol is a one-way communication protocol, and the second type of communication protocol is a two-way communication protocol.
7. The method according to claim 6, characterized in that Parsing the first message to obtain a message attribute value includes: In response to the write command buffer corresponding to the second end being not full and the write data buffer being not full, the first message is parsed to obtain attribute values corresponding to the write command and the write data.
8. A communication device, characterized in that: The communication device comprises: a receiving unit configured to receive a first message from a first end, the first message including at least one command, response, and / or data, the first message being a first type communication protocol packet, the user-defined field in the first type communication protocol packet including a broadcast attribute value; a parsing unit configured to parse the first message and obtain message attribute values, wherein the message attribute values include the broadcast attribute value; a determining unit configured to determine, based on the message attribute value, a second message, where the second message is a second-type communication protocol packet that complies with the second-type communication protocol, and the second message includes a broadcast field determined based on the broadcast attribute value, where the broadcast field is used to represent a broadcast address of the corresponding second-type communication protocol packet; The sending unit is configured to send the second message to the second end.
9. An integrated circuit, characterized in that: The integrated circuit includes at least a first terminal, a second terminal and a protocol conversion unit; wherein the first end and the second end support different communication protocols; The protocol conversion unit is configured to execute the method according to any one of claims 1 to 7 to implement communication between the first end and the second end.
Citation Information
Patent Citations
Protocol conversion method and device and air conditioner system
CN106790282A