Order preserving device, electronic equipment and chip

By introducing an order-preserving device into the AXI bus, allocating new IDs and using virtual queues to process commands with the same command ID, the problem of host bandwidth reduction caused by deadlock in the AXI bus is solved, and the sequential consistency of command responses and bandwidth stability are achieved.

CN118568017APending Publication Date: 2024-08-30CHENGDU JAGUAR MICROSYSTEMS CO LTD +1
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202410615285.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-17
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

In the AXI bus, the command ID conflict between the master and the slave causes a deadlock, causing the host bandwidth to decrease.

Method used

Using an order-preserving device, the new command generation module allocates different new IDs to commands with the same command ID, and uses virtual queues to preserve the order of commands to ensure that the return order of response data is consistent with the order of commands issued by the host to avoid deadlocks. At the same time, it does not wait for the response content of the previous command.

Benefits of technology

It effectively avoids deadlock when the host and slave communicate through the AXI bus, keeps the bandwidth of the host stable, and ensures the sequence consistency of command responses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118568017A
    Figure CN118568017A
Patent Text Reader

Abstract

The invention relates to an order preserving device, electronic equipment and a chip. The order preserving device is characterized in that a new command generation module receives and analyzes a command to obtain a command ID, generates a new ID corresponding to the command ID and determines a queue number corresponding to the command ID; writing the new ID into a virtual queue corresponding to the queue number, generating a new command corresponding to the received command, and sending the new command to the AXI bus; the write controller receives and analyzes the response returned by the AXI bus to obtain a corresponding response ID and response data, and writes the response data into a storage space corresponding to the response ID in the response memory; the response ID corresponds to the new ID; and under the condition that the dequeuing controller receives all response data of the new command, when the new ID is the queue head ID of the virtual queue, reading all response data corresponding to the new command stored in the response memory according to the new ID, and outputting the response data. According to the method, the host can be prevented from being deadlocked when the equipment communicates through the AXI bus.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of AXI bus interconnection, and in particular to an order-preserving device, an electronic device and a chip applied to AXI bus interconnection. Background Art

[0002] like Figure 1 As shown, Master represents the host, Slave represents the slave, and Master0 and Master1 communicate with Slave0 and Slave1 through the AXI bus; in one case, Master0 sends two commands successively, the first command is sent to Slave0, command ID = 0, and the second command is sent to Slave1, command ID = 0, because the two commands have the same command ID value (command ID = 0), so the order of returning responses according to the AXI protocol requirements should be Sla0 returns first, and then Slave1 returns; at the same time, Master1 sends two commands successively, the first command is sent to Slave1, command ID = 1, and the second command is sent to Slave0, command ID = 1, because the two commands have the same command ID value, so the order of returning responses according to the AXI protocol requirements should be Sla1 returns first, and then Slave0 returns. In this case, the read reordering depth of Slave0 and Slave1 is both equal to 2. When Slave0 returns data to Master1, but Slave1 needs to get a response according to the AXI protocol, the AXI bus needs to suspend Slave0's response channel until Slave1 returns a response. At the same time, Slave1 returns data to Master0, but Slave0 needs to get a response according to the AXI protocol, so the AXI bus needs to suspend Slave1's response channel until Slave0 returns a response; that is, the two response channels are waiting for the other to complete the response first, so a deadlock occurs.

[0003] The above is an example of a second-order deadlock. In actual applications, the number of masters and slaves is more than 2, so there may be more masters deadlocked. Therefore, in order to avoid Master deadlock, the AXI bus adopts the following solution:

[0004] After the Master initiates a command to the Slave, the subsequent AXI bus will check at the command entry on the Master side to check whether the current command ID has appeared before and whether the destination of the current command ID is the last Slave to which it was directed. For example, after Master0 sends a command with command ID = 0 to Slave0, Master0 will send another command with command ID = 0 to Slave1. At this time, the address channel of Master0 will be suspended. It must wait for the response of Slave0 to return to Master0 before the address channel of Master0 will be opened again, thereby avoiding deadlock. However, this method will cause a significant decrease in the bandwidth of Master0. If the same command ID goes to different Slaves, the outstanding of Master0 is only 1. Summary of the invention

[0005] The purpose of the present application is to provide an order-preserving device, an electronic device and a chip to solve the problem of host bandwidth reduction caused by the need to avoid host deadlock when the host and the slave communicate through an AXI bus.

[0006] To achieve the above-mentioned purpose, according to a first aspect of the present application, there is provided an order-preserving device, comprising:

[0007] A new command generation module is used to receive and parse the command issued by the host corresponding to the sequence preservation device to obtain the corresponding command ID, generate a new ID corresponding to the command ID and determine the queue number corresponding to the command ID; write the new ID into the virtual queue corresponding to the queue number, generate a new command corresponding to the received command, and send the new command to the AXI bus, wherein the new command includes the new ID;

[0008] A write controller, used for receiving and parsing the response data returned by the AXI bus to obtain a corresponding response ID and response content, and writing the response content into a storage space corresponding to the response ID in the response memory; the response ID corresponds to the new ID;

[0009] A dequeue controller is used to read the response content corresponding to the new command stored in the response memory according to the new ID when all response data of the new command have been received and when the new ID is the head ID of the virtual queue, and output it to the corresponding host.

[0010] The ID is output to the corresponding host.

[0011] When the sequence-preserving device described in the first aspect of the present application is used, one side of the sequence-preserving device is connected to a host and the other side is connected to an AXI bus. The AXI bus is connected to at least one slave. If there are multiple hosts, multiple sequence-preserving devices can be set up to be connected one-to-one with the multiple hosts. Each sequence-preserving device can assign different new IDs (corresponding to the response ID in the response data returned by the slave) to the multiple commands with the same command ID issued by the host connected to it to distinguish the multiple commands with the same command ID, and use a virtual queue to preserve the order of multiple commands with the same command ID. Multiple commands with the same command ID enter the same virtual queue. Since the virtual queue follows the first-in-first-out principle, It ensures that the order in which response data is returned to the host connected to it is consistent with the order in which the host sends commands, which can avoid deadlock of the host. At the same time, a new command is generated according to the assigned new ID and sent to the corresponding slave, that is, the ID contained in the command sent to the slave is the new ID instead of the command ID carried by the original command. Therefore, when the current command to be sent by the host is the same as the command ID of the last command sent, there is no need to wait for the response content of the last command sent to be returned to the host, and it can be sent normally to the sequence preservation device connected to it for processing, which will not cause the host bandwidth to decrease. Therefore, the embodiment of the present application can solve the problem of host bandwidth reduction caused by the need to avoid host deadlock when the host and the slave communicate through the AXI bus.

[0012] According to a second aspect of the present application, there is provided an order-preserving device, including:

[0013] A new command generation module is used to receive and parse a command issued by any host to obtain a corresponding command ID and a host port number, generate a new ID corresponding to the command ID and determine a queue number corresponding to the command ID; write the new ID into a virtual queue corresponding to the queue number, generate a new command corresponding to the received command, and send the new command to the AXI bus, wherein the new command includes the new ID;

[0014] A write controller, used for receiving and parsing the response data returned by the AXI bus to obtain a corresponding response ID and response content, and writing the response content into a storage space corresponding to the response ID in the response memory; the response ID corresponds to the new ID;

[0015] A dequeue controller is used to read the response content corresponding to the new command stored in the response memory according to the new ID when all response data of the new command have been received and when the new ID is the head ID of the virtual queue, and output it to the host corresponding to the host port number.

[0016] According to the second aspect of the present application, when the sequence preservation device is used, one side of the sequence preservation device is connected to at least two hosts, and the other side is connected to an AXI bus, and the AXI bus is connected to at least one slave. The sequence preservation device can assign different new IDs (corresponding to the response ID in the response data returned by the slave) to the multiple commands with the same command ID issued by the at least two hosts to distinguish the multiple commands with the same command ID, and use a virtual queue to preserve the order of the multiple commands with the same command ID. The multiple commands with the same command ID enter the same virtual queue. Since the virtual queue follows the first-in-first-out principle, the response data returned to the host is guaranteed. The sequence is consistent with the sequence of commands issued by the host, which can avoid deadlock of the host; at the same time, a new command is generated according to the assigned new ID and sent to the corresponding slave, that is, the ID contained in the command sent to the slave is the new ID instead of the command ID carried by the original command. Therefore, when the current command to be sent by the host is the same as the command ID of the last command sent, there is no need to wait for the response content of the last command sent to return to the host, and it can be sent normally to the sequence preservation device for processing, which will not cause the host bandwidth to decrease; therefore, the embodiment of the present application can solve the problem of host bandwidth reduction caused by the need to avoid host deadlock when the host and the slave communicate through the AXI bus.

[0017] According to a third aspect of the present application, there is provided an electronic device, comprising a host, at least one slave, an AXI bus, and a sequence preservation device according to the first aspect above, wherein the host is communicatively connected to the sequence preservation device, the sequence preservation device is communicatively connected to the AXI bus, and the AXI bus is communicatively connected to the at least one slave.

[0018] According to a fourth aspect of the present application, an electronic device is provided, comprising at least two hosts, at least one slave, an AXI bus, and a sequence preservation device according to the second aspect above, wherein the at least two hosts are communicatively connected to the sequence preservation device, the sequence preservation device is communicatively connected to the AXI bus, and the AXI bus is communicatively connected to the at least one slave.

[0019] An embodiment of the present application further provides a chip, comprising the above-mentioned sequence preserving device.

[0020] Other features and advantages of the embodiments of the present application will be described in the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0022] Figure 1 It is a schematic diagram of the host mentioned in the background technology communicating with the slave through the AXI bus.

[0023] Figure 2 It is a schematic diagram of the structure of a sequence-preserving device in one embodiment of the present application.

[0024] Figure 3 A schematic diagram of an application scenario of the sequence preservation device in an embodiment of the present application.

[0025] Figure 4 A schematic diagram of another application scenario of the sequence preserving device in one embodiment of the present application.

[0026] Figure 5 Schematic diagram of the structure of a sequence-preserving device in another embodiment of the present application. DETAILED DESCRIPTION

[0027] The detailed description of the accompanying drawings is intended as an illustration of the currently preferred embodiment of the present application, and is not intended to represent the only form in which the present application can be implemented. It should be understood that the same or equivalent functions can be accomplished by different embodiments intended to be included in the spirit and scope of the present application.

[0028] See also Figures 2-3 , Embodiment 1 of the present application provides an order-preserving device, including a new command generation module, a write controller and a dequeue controller.

[0029] The new command generation module is used to receive and parse the command issued by the host corresponding to the sequence preservation device to obtain the corresponding command ID, generate a new ID corresponding to the command ID and determine the queue number corresponding to the command ID; write the new ID into the virtual queue corresponding to the queue number, and generate a new command corresponding to the received command, and send the new command to the AXI bus, wherein the new command includes the new ID.

[0030] Specifically, when this embodiment is used, one side of the sequence preservation device is connected to a host, and the other side is connected to at least one slave via an AXI bus, and the AXI bus is, for example, Design Ware AXI; if there are multiple hosts, then Figure 3 As shown, multiple sequence-preserving devices are set up to be connected one-to-one with multiple hosts, and each sequence-preserving device only receives and processes commands (read commands or write commands) from one host. Therefore, when each sequence-preserving device sends relevant data of the slave response to the host, it also only sends data to the host connected to it.

[0031] Exemplarily, Master0 (host) is connected to the sequence-preserving device. At time t1, Master0 sends command cmd1 to the sequence-preserving device. The new command generation module parses cmd1 to obtain command ID ID=0 and address information adr=1, generates a new ID RID=1 corresponding to ID=0, stores RID=1 in the virtual queue corresponding to ID=0, generates command cmd01 (including RID=1 and adr=1) corresponding to RID=1, sends cmd01 to the AXI bus, and the AXI bus sends cmd01 to S lave0 (a certain slave); at time t2, Master0 sends command cmd2 to the sequence preservation device, the new command generation module parses cmd2 to obtain command ID ID=0, address information adr=2, generates a new ID RID=2 corresponding to ID=0, stores RID=2 in the virtual queue corresponding to ID=0, and generates command cmd02 (including RID=2 and adr=2) corresponding to RID=2, sends cmd02 to the AXI bus, and the AXI bus sends cmd01 to Slave1 (a certain slave);

[0032] Therefore, the original ID=0 corresponds to the reordered RID=1 and RID=2, and the reordered RID=1 and RID=2 enter a virtual queue corresponding to ID=0 in order of generation time (t1→t2); by assigning unique RID=1 and RID=2 to cmd1 and cmd2 respectively, the two commands cmd1 and cmd2 with the same command ID (ID=0) are distinguished.

[0033] The write controller is used to receive and parse the response data returned by the AXI bus to obtain the corresponding response ID and response content, and write the response content into the storage space corresponding to the response ID in the response memory; the response ID corresponds to the new ID.

[0034] Specifically, the above example is continued to explain that after receiving cmd01, Slave0 parses cmd01 to obtain RID=1 and adr=1. When cmd01 is a read command, adr=1 is the read address. Slave0 reads data according to adr=1 and generates a response ID (RID'=1) according to RID=1. The value of RID' in response to cmd01 is equal to the RID of cmd01. The complete or partial content (response content) read out will be returned to AXI together with RID'=1 (response ID) as a response data. Bus, if the data to be read is less than or equal to the system bandwidth, it can be read once and returned to the AXI bus, and the complete content is returned at this time. If the data to be read is greater than the system bandwidth, it takes at least two times to read it and return it to the AXI bus, and the partial content is returned at this time; when cmd01 is a write command, adr=1 is the write address, Slave0 writes the data to be written into the storage space corresponding to adr=1, and returns the write operation result (response content) and RID'=1 (response ID) as a response data to the AXI bus.

[0035] After receiving cmd02, Slave1 parses cmd02 to obtain RID=2 and adr=2. When cmd02 is a read command, adr=2 is the read address. Slave1 reads data according to adr=2 and generates a response ID (RID'=2) according to RID=2. The value of RID' in response to cmd02 is equal to the RID of cmd02. The complete or partial content (response content) read out will be returned to the AXI bus together with RID'=2 (response ID) as a response data. If the data to be read is If the data is less than or equal to the system bandwidth, it can be read and returned to the AXI bus in one time, and the complete content is returned. If the data to be read is larger than the system bandwidth, it needs to be read at least twice to be read and returned to the AXI bus, and the partial content is returned. When cmd02 is a write command, adr=2 is the write address, Slave1 writes the data to be written into the storage space corresponding to adr=2, and returns the write operation result (response content) and RID'=2 (response ID) as a response data to the AXI bus.

[0036] Based on the above example, the AXI bus forwards the response data returned by Slave0 and Slave1 to the sequence preservation device of this embodiment. The write controller of the sequence preservation device parses the response data input by the AXI bus to obtain the response ID (RID'=1 or RID'=2) and the corresponding response content (complete or partial read data, or write operation results), and then stores the parsed response data in the storage space corresponding to the response ID (RID'=1 or RID'=2) in the response memory; it should be noted that the response memory can be integrated inside the sequence preservation device, or it can be implemented as a memory outside the sequence preservation device.

[0037] The dequeue controller is configured to read the response content corresponding to the new command stored in the response memory according to the new ID when all response data of the new command have been received and when the new ID is the head ID of the virtual queue, and output it to the corresponding host;

[0038] Specifically, the above example is further explained. The head of the virtual queue is RID=1, and the tail of the virtual queue is RID=2. If Slave0 responds to cmd01 and returns all response data to the order-preserving module of this embodiment through the AXI bus and stores them in the response memory; then the virtual queue meets the dequeue condition at this time, and RID=1 can perform a dequeue operation, and the dequeue operation includes: the dequeue controller reads the corresponding response content from the response memory according to RID=1, and outputs the corresponding response content and the command ID corresponding to RID=1 (i.e., ID=0) to Master0; after RID=1 completes the dequeue, the head of the virtual queue becomes RID=2. At this time, if Slave1 responds to cmd02, and returns all response data to the order-preserving module of this embodiment through the AXI bus and stores them in the response memory, RID=2 can also perform a dequeue operation, and the dequeue operation is the same as above, that is, the dequeue controller reads the corresponding response content from the response memory according to RID=2, and outputs the corresponding response content and ID=0 to Master0.

[0039] Based on the introduction of the above examples, it can be known that when the sequence preservation device of this embodiment is applied to the communication between Master0 and Slave0 and Slave1, if Master0 sends a command with ID=0 to Slave0, and then Master0 sends a command with ID=0 to Slave1, then the address channel of Master0 does not need to be paused and can be sent normally without causing deadlock and a significant decrease in the bandwidth of Master0.

[0040] Based on the description of the above embodiments, it can be known that when the sequence-preserving device of this embodiment is used, one side of the sequence-preserving device is connected to a host and the other side is connected to an AXI bus. The AXI bus is connected to at least one slave. If there are multiple hosts, multiple sequence-preserving devices can be set up to be connected one-to-one with the multiple hosts. Each sequence-preserving device can assign different new IDs (corresponding to the response ID in the response data returned by the slave) to multiple commands with the same command ID issued by the host connected to it to distinguish multiple commands with the same command ID, and use a virtual queue to preserve the order of multiple commands with the same command ID. Multiple commands with the same command ID enter the same virtual queue. Since the virtual queue follows the first-in-first-out principle , thereby ensuring that the order in which the response data is returned to the host connected to it is consistent with the order in which the host sends commands, which can avoid deadlock in the host; at the same time, a new command is generated according to the assigned new ID and sent to the corresponding slave, that is, the ID contained in the command sent to the slave is the new ID instead of the command ID carried by the original command. Therefore, when the current command to be sent by the host is the same as the command ID of the last command sent, there is no need to wait for the response content of the last command sent to be returned to the host, and it can be sent normally to the sequence preservation device connected to it for processing, which will not cause the host bandwidth to decrease; therefore, the embodiment of the present application can solve the problem of host bandwidth reduction caused by the need to avoid host deadlock when the host and the slave communicate through the AXI bus.

[0041] Based on Example 1, in some specific embodiments, a management module can be set up to manage all new IDs. When each sequence-preserving device generates a new ID, it applies to the management module for an idle new ID. For example, the new ID includes 1000 IDs, which are 1 to 1000 respectively. If the current new IDs = 1 to 500 are all used, then the current new IDs = 501 to 1000 are all idle. Because they are managed uniformly by the management module, the new commands output by different sequence-preserving devices will not contain the same new ID. If a new ID is dequeued, for example, new ID = 255 is dequeued, then new ID = 255 becomes idle again and can be used again.

[0042] Based on the first embodiment, in some specific embodiments, the new command generation module specifically includes an ID information table, a queue number determination module, a new ID generation module and a command generation module.

[0043] The ID information table is used to store the command ID of the received command and the queue number corresponding to the command ID;

[0044] Specifically, this embodiment further constructs an ID information table, which includes multiple storage units (table units), and the address (index) of each storage unit is the new ID. For example, the new ID includes 1000 IDs, which are 1 to 1000 respectively. Then the ID information table also has 1000 storage units, which correspond one to one to the 1000 new IDs; each command ID has a corresponding virtual queue, because the responses of multiple commands with the same command ID need to be returned to the host in order, and each virtual queue has a unique queue number to distinguish different queues.

[0045] The queue number determination module is used to generate a new queue number when the command ID is different from all IDs in the ID information table, and is also used to determine the queue number corresponding to an ID in the ID information table as the queue number of the command ID when the command ID is the same as an ID in the ID information table;

[0046] Specifically, the new command generation module obtains the command ID and generates a corresponding new ID. At this time, the command ID can be used to query whether the command ID is stored in the ID information table. If so, the corresponding queue number will also be stored in the ID information table. The queue number can be directly obtained from the ID information table; if not, a new unique queue number is generated.

[0047] The new ID generating module is used to generate a new ID for the received command (the command sent by the host);

[0048] The command generation module is used to generate and send a new command corresponding to the received command (the command sent by the host), and the new command includes the new ID.

[0049] Based on Example 1, in some specific embodiments, the sequence preservation device also includes a bitmap, which includes multiple bits, and the multiple bits correspond one-to-one to multiple new IDs. Each bit is used to record whether all response contents of a new command corresponding to a corresponding new ID have been completely written into the response memory.

[0050] Specifically, for example, the new ID includes 1000 IDs, which are 1 to 1000 respectively, then the bitmap also has 1000 bits, corresponding to the 1000 new IDs one by one, and the value of each bit is 1 or 0. 1 indicates whether the new command corresponding to the corresponding new ID has been executed by the slave, and all response data returned by the slave have been written into the storage space corresponding to the response memory and the new ID (the new ID corresponds to the response ID in the response data); 0 indicates that the new command corresponding to the corresponding new ID has not been executed by the slave, or all response data returned by the slave have not been written into the storage space corresponding to the new ID in the response memory.

[0051] Based on the first embodiment, in some specific embodiments, the sequence-preserving device further includes a head-of-line comparator;

[0052] The head of queue comparator is used to query whether the corresponding bit in the bitmap is 1 according to the head of queue ID of the virtual queue. If only one bit is 1, the virtual queue corresponding to the one bit is determined as the target virtual queue. If at least two bits are 1, at least two virtual queues corresponding to the at least two bits are scheduled according to a preset scheduling algorithm, and one of the virtual queues is selected as the target virtual queue.

[0053] Specifically, since each virtual queue corresponds to a command ID, there may be multiple virtual queues, and the multiple virtual queues are formed by virtual linked lists, and each virtual queue is formed by a linked list, and the virtual linked list includes multiple linked lists; the head comparator monitors whether the bit in the bitmap corresponding to the head ID (new ID) of each virtual queue is 1. If it is 1, it means that the head ID meets the dequeue condition. If the head IDs of multiple virtual queues meet the dequeue condition, scheduling is performed to determine the target virtual queue, and the scheduling algorithm includes but is not limited to the RR scheduling algorithm.

[0054] The dequeue controller is specifically used to read the corresponding response content from the response memory according to the head ID of the target virtual queue, and output it to the corresponding host; specifically, the dequeue controller performs a head dequeue operation of a target virtual queue each time.

[0055] Based on the first embodiment, in some specific embodiments, when the command is a read command, the new command generation module parses the read command to obtain the corresponding command ID, read address and Arlen information, and writes the command ID, the queue number corresponding to the command ID and the Arlen information into the storage unit with the new ID as the address in the ID information table; wherein the Arlen information is the amount of data to be read by the read command; the new command includes the new ID and the read address, and the response content corresponding to the read command is the returned read data;

[0056] Specifically, two ID information tables can be set, corresponding to the read channel and the write channel respectively. The new command generation module writes the command ID, the queue number corresponding to the command ID and the Arlen information into the storage unit with the new ID as the address in the ID information table of the read channel.

[0057] Based on the first embodiment, in some specific embodiments, the write controller is specifically used to parse any response data returned by the AXI bus in response to the read command to obtain a corresponding response ID and read data, increase the count value of the counter corresponding to the response ID by 1, obtain a write address according to the response ID and the current count value of the counter, and write the read data into the storage space corresponding to the write address in the response memory; wherein, when the response data is the last response data returned in response to the read command, the count value of the counter is cleared to zero;

[0058] Specifically, in the present embodiment, each response ID has a counter for calculating the address offset. A corresponding exclusive storage space is allocated to each response ID in the response memory. The exclusive storage space includes multiple addresses, with the response ID as the base address. If the target data to be read by the host is large and needs to be returned completely after multiple times, each time response data containing a response ID is received, the current count value of the counter corresponding to the response ID is increased by 1, and the current count value of the counter is used as the offset. In this way, the received response data is stored each time according to the write address calculated according to the base address + offset (response ID + current count value), and multiple response contents returned multiple times can be stored in sequence in one storage space; at the same time, after all the response contents returned by the slave response are stored in the response memory, the count value of the counter needs to be cleared to recycle the resources so as to facilitate the subsequent use by other command execution tasks.

[0059] Based on the first embodiment, in some specific embodiments, Figure 3 In the scheme shown, the dequeue controller is specifically used to read the corresponding command ID and Arlen information in the ID information table according to the head ID of the virtual queue (at this time as the read address / index of the ID information table). The new ID corresponds to the response ID, so the corresponding read data can be read from the response memory according to the head ID (as the read address), and the corresponding read data can be checked according to the Arlen information. If correct, the corresponding read data is output together with the command ID. If incorrect, the new command is sent to the AXI bus again to request the slave to execute the new command again, or an error code and the command ID are output to the corresponding host.

[0060] Specifically, the Arlen information is the amount of data that the corresponding slave should return in response to the read command. Therefore, the amount of data of the corresponding response data can be calculated and compared with the Arlen information. If they are consistent, it is correct. The corresponding response content is output to the host together with the command ID, and then the team head ID (new ID) is released, and a bit corresponding to the new ID on the bitmap is cleared to 0 to recycle resources. If they are inconsistent, it is an error. At this time, an error code can be returned to the host, and the sequence preservation device can also send a new command to read the data again.

[0061] The following is an example of a host requesting a slave to execute a read command. Assume that the maximum outstanding supported by the sequence preservation module is 64, that is, there are at most 64 commands with the same command ID from the same host, or there are 64 commands with completely different command IDs from the same host. Each command ID corresponds to a queue number, and each command ID can correspond to multiple new IDs. The execution flow of this example is as follows:

[0062] Step 1.1: The sequence preservation module M_AR_CHNL (master side read address channel) receives a command from the host, and its command ID = 8. The command ID is compared with the fixed position of each address in the ID information table. Assuming that the comparison fails (that is, there is no valid command ID = 8 in the ID information table), go to step 1.2; if there is a valid command ID = 8 in the ID information table, there is no need to generate a new queue number, and the queue number corresponding to the command ID is que = 3.

[0063] step1.2: At this time, the queue number generation module selects one from the idle queue, recorded as que=3, and the new ID generation module generates a new ID from the idle queue, recorded as RID=10.

[0064] step1.3: With RID=10 as the address, write the command ID, que, Arlen and other data into the ID information table, and write RID=10 into queue que3 of the virtual linked list.

[0065] step1.4: The command is issued from S_AR_CHNL (channel).

[0066] Step 1.5: The response comes in from S_R_CHNL (channel), with RID' (equal to RID) as the base address of the response memory. A table is maintained in the write controller to implement the counter function. Each address in the table corresponds to each RID'. The content of the table is the write offset of the response memory (counting starts from 0, and each time the content is written, it is increased by 1). At this time, the response content corresponding to RID'=10 needs to be written to the response memory. The write address corresponding to RID' is 0xA0~0XAF, and the read data is written to the response memory. At the same time, the address content corresponding to RID' in the table is +1;

[0067] step1.6: When the last response of RID' arrives, set the value of the RID'th bit in the bitmap to 1, that is, the 10th bit of the bitmap is 1 at this time;

[0068] step1.7: Check the content of address 10 in the ID information table and get que=3;

[0069] Step 1.8: The head comparator compares whether the bit in the bitmap corresponding to the RID of the head of the queue que3 in the virtual linked list is 1. If it is 1, it means that the response data of the RID of the head of the queue has been fully returned; if it is 0, it means that the response data of the RID of the head of the queue has not been returned or has not been fully returned, and the responses behind the RID in the virtual linked list have been fully returned;

[0070] step1.9: When the result of step1.8 is 1, the queue controller reads the virtual linked list, and then reads the response memory to obtain the read data. Step1.7 checks the ID information table to obtain the RID, and then a complete response can be obtained. M_R_CHNL (channel) is returned and output to the corresponding host; then the position of the RID in the ID information table is set to invalid, and RID=10 is released. If the queue of the virtual linked list is empty after reading the queue, the queue number que=3 is also released.

[0071] It should be noted that, in step 1.6, at most 64 bits of the bitmap may be 1 at the same time. If multiple bits are 1 at the same time, it is necessary to check the contents of multiple addresses in the ID information table at the same time; then according to step 1.8, check how many bits of the bitmap meet the conditions in the virtual linked list. If multiple bits meet the conditions at the same time, it is necessary to select one from the many qualified bits to read the virtual linked list. The RR scheduling algorithm can be used here.

[0072] Based on the first embodiment, in some specific embodiments, when the command is a write command, the new command generation module parses the write command to obtain the corresponding command ID, write address and write data, and writes the command ID and the queue number corresponding to the command ID into a storage unit with the new ID as the address; wherein the new command includes the new ID, write address and write data;

[0073] Specifically, two ID information tables can be set up, corresponding to the read channel and the write channel respectively. The new command generation module writes the command ID and the queue number corresponding to the command ID into the storage unit with the new ID as the address in the ID information table of the write channel; after receiving the new command, the slave writes the write data into the corresponding storage unit according to the write address, and generates a response ID according to the new ID, and returns the write operation result and the response ID as a response data to the sequence preservation device through the AXI bus.

[0074] Based on Example 1, in some specific embodiments, the write controller is specifically used to parse the response data returned by the AXI bus in response to the write command to obtain the corresponding response ID and the write operation result, and write the write operation result into the storage space corresponding to the response ID in the response memory.

[0075] Based on the first embodiment, in some specific embodiments, Figure 3 In the scheme shown, the dequeue controller is specifically used to read the corresponding command ID in the ID information table according to the head ID of the virtual queue (at this time serving as the read address / index of the ID information table), read the corresponding write operation result from the response memory according to the head ID (at this time serving as the read address), and output the corresponding write operation result together with the command ID to the corresponding host.

[0076] The following is an example of a host requesting a slave to execute a write command. Assume that the maximum outstanding supported by the sequence preservation module is 64, that is, there are at most 64 commands with the same command ID from the same host, or there are 64 commands with completely different command IDs from the same host. Each command ID corresponds to a queue number, and each command ID can correspond to multiple new IDs. The execution process of this example is as follows:

[0077] Step 2.1: The sequence preservation module M_AW_CHNL (master side read address channel) receives a command from the host, and its command ID = 8. The command ID is compared with the fixed position of each address in the ID information table. Assuming that the comparison fails (that is, there is no valid command ID = 8 in the ID information table), it enters step 2.2. If there is a valid command ID = 8 in the ID information table, there is no need to generate a new queue number. The queue number corresponding to the command ID is que = 3.

[0078] step2.2: At this time, the queue number generation module selects one from the idle queue, recorded as que=3, and the new ID generation module generates an ID from the idle queue, recorded as RID=10.

[0079] step2.3: Use RID=10 as the address, command ID and que as data to write into the ID information table; write the new ID into que3 of the virtual linked list.

[0080] step2.4: The command is issued from S_AW_CHNL (channel).

[0081] step2.5: The response comes in from S_B_CHNL (channel) with RID' (equal to the new ID) as the response memory address.

[0082] Step 2.6: Set the RID' bit of the bitmap to 1. That is, the 10th bit of the bitmap is 1 at this time.

[0083] step2.7: Check the content of address 10 in the ID information table to obtain the queue number que=3.

[0084] step2.8: The head comparator compares whether the bitmap position corresponding to the new ID of the head of the queue que3 in the virtual linked list is 1. If it is 1, it means that the responses of the new ID of the head of the queue have all been returned; if it is 0, it means that the response of the new ID has not been returned or has not been fully returned, and the responses after the new ID of the head of the queue in the virtual linked list have been fully returned.

[0085] step2.9: When the result of step2.8 is 1, the queue controller reads the virtual linked list, and then reads the response memory to obtain the read data. Step2.7 checks the ID information table to obtain the RID, and then a complete response can be obtained. M_R_CHNL (channel) is returned and output to the corresponding host; then the RID position in the ID information table is set to invalid, and RID=10 is released. If the queue of the virtual linked list is empty after reading the queue, the queue number que=3 is also released.

[0086] See also Figure 2 and 4 , Embodiment 2 of the present application provides an order-preserving device, including a new command generation module, a write controller and a dequeue controller.

[0087] The new command generation module is used to receive and parse a command issued by any host to obtain a corresponding command ID and a host port number, generate a new ID corresponding to the command ID, and determine the queue number corresponding to the command ID; write the new ID into a virtual queue corresponding to the queue number, and generate a new command corresponding to the received command, and send the new command to the AXI bus, wherein the new command includes the new ID.

[0088] Specifically, when this embodiment is applied, Figure 4 As shown, the sequence-preserving device is connected to at least two hosts on one side and to at least one slave on the other side via an AXI bus, wherein the AXI bus is, for example, Design Ware AXI. A sequence-preserving device can receive and process commands (read commands or write commands) from at least two hosts. Therefore, when each sequence-preserving device sends relevant data of a slave response to the host, it needs to distinguish which host the data is being sent to, and this can be determined by simply establishing an association between the host and the new ID.

[0089] For example, at time t1, Master0 (host) sends command cmd1 to the sequence preservation device, the new command generation module parses cmd1 to obtain command ID ID=0, address information adr=1, host port number Port=0, saves ID=0 and Port=0, generates a new ID RID=1 corresponding to ID=0, stores RID=1 in the virtual queue corresponding to ID=0, generates command cmd01 (including RID=1 and adr=1) corresponding to RID=1, sends cmd01 to the AXI bus, and the AXI bus sends cmd01 to the AXI bus. d01 is sent to Slave0 (a certain slave); at time t2, Master0 sends command cmd2 to the sequence preservation device, the new command generation module parses cmd2 to obtain command ID ID=0, address information adr=2, generates a new ID RID=2 corresponding to ID=0, stores RID=2 in the virtual queue corresponding to ID=0, generates command cmd02 (including RID=2 and adr=2) corresponding to RID=2, sends cmd02 to the AXI bus, and the AXI bus sends cmd01 to Slave1 (a certain slave);

[0090] Therefore, the original ID=0 corresponds to the reordered RID=1 and RID=2, and the reordered RID=1 and RID=2 enter a virtual queue corresponding to ID=0 in order of generation time (t1→t2); by assigning unique RID=1 and RID=2 to cmd1 and cmd2 respectively, the two commands cmd1 and cmd2 with the same command ID (ID=0) are distinguished.

[0091] The write controller is used to receive and parse the response data returned by the AXI bus to obtain the corresponding response ID and response content, and write the response content into the storage space corresponding to the response ID in the response memory; the response ID corresponds to the new ID.

[0092] Specifically, the above example is continued to explain that after receiving cmd01, Slave0 parses cmd01 to obtain RID=1 and adr=1. When cmd01 is a read command, adr=1 is the read address. Slave0 reads data according to adr=1 and generates a response ID (RID'=1) according to RID=1. The value of RID' in response to cmd01 is equal to the RID of cmd01. The complete or partial content (response content) read out will be returned to AXI together with RID'=1 (response ID) as a response data. Bus, if the data to be read is less than or equal to the system bandwidth, it can be read once and returned to the AXI bus, and the complete content is returned at this time. If the data to be read is greater than the system bandwidth, it takes at least two times to read it and return it to the AXI bus, and the partial content is returned at this time; when cmd01 is a write command, adr=1 is the write address, Slave0 writes the data to be written into the storage space corresponding to adr=1, and returns the write operation result (response content) and RID'=1 (response ID) as a response data to the AXI bus.

[0093] After receiving cmd02, Slave1 parses cmd02 to obtain RID=2 and adr=2. When cmd02 is a read command, adr=2 is the read address. Slave1 reads data according to adr=2 and generates a response ID (RID'=2) according to RID=2. The value of RID' in response to cmd02 is equal to the RID of cmd02. The complete or partial content (response content) read out will be returned to the AXI bus together with RID'=2 (response ID) as a response data. If the data to be read is If the data is less than or equal to the system bandwidth, it can be read and returned to the AXI bus in one time, and the complete content is returned. If the data to be read is larger than the system bandwidth, it needs to be read at least twice to be read and returned to the AXI bus, and the partial content is returned. When cmd02 is a write command, adr=2 is the write address, Slave1 writes the data to be written into the storage space corresponding to adr=2, and returns the write operation result (response content) and RID'=2 (response ID) as a response data to the AXI bus.

[0094] Based on the above example, the AXI bus forwards the response data returned by Slave0 and Slave1 to the sequence preservation device of this embodiment. The write controller of the sequence preservation device parses the response data input by the AXI bus to obtain the response ID (RID'=1 or RID'=2) and the corresponding response content (complete or partial read data, or write operation results), and then stores the parsed response data in the storage space corresponding to the response ID (RID'=1 or RID'=2) in the response memory; it should be noted that the response memory can be integrated inside the sequence preservation device, or it can be implemented as a memory outside the sequence preservation device.

[0095] The dequeue controller is configured to, when all response data of the new command have been received and the new ID is the head ID of the virtual queue, read the response content corresponding to the new command stored in the response memory according to the new ID, and output it to the host corresponding to the host port number;

[0096] Specifically, the above example is continued to explain that the head of the virtual queue is RID=1, and the tail of the virtual queue is RID=2. If Slave0 responds to cmd01 and returns all response data to the order-preserving module of this embodiment through the AXI bus and stores them in the response memory; then the virtual queue meets the dequeue condition at this time, and RID=1 can perform a dequeue operation, and the dequeue operation includes: the dequeue controller reads the corresponding response content from the response memory according to RID=1, and compares the corresponding response content with the command ID corresponding to RID=1 (i.e., ID=0 ) is output to Master0 corresponding to Port=0; after RID=1 completes the dequeue, the head of the virtual queue becomes RID=2. At this time, if Slave1 responds to cmd02 and returns all the response data to the order preservation module of this embodiment through the AXI bus and stores them in the response memory, RID=2 can also perform a dequeue operation. The dequeue operation is the same as above, that is, the dequeue controller reads the corresponding response content from the response memory according to RID=2, and outputs the corresponding response content together with ID=0 to Master0 corresponding to Port=0.

[0097] Based on the introduction of the above examples, it can be known that when the sequence preservation device of this embodiment is applied to the communication between Master0 and Slave0 and Slave1, if Master0 sends a command with ID=0 to Slave0, and then Master0 sends a command with ID=0 to Slave1, then the address channel of Master0 does not need to be paused and can be sent normally without causing deadlock and a significant decrease in the bandwidth of Master0.

[0098] Based on the description of the above embodiments, it can be known that when the sequence preservation device of this embodiment is used, one side of the sequence preservation device is connected to at least two hosts, and the other side is connected to the AXI bus, and the AXI bus is connected to at least one slave. The sequence preservation device can assign different new IDs (corresponding to the response ID in the response data returned by the slave) to the multiple commands with the same command ID issued by the at least two hosts to distinguish the multiple commands with the same command ID, and use the virtual queue to preserve the order of the multiple commands with the same command ID. The multiple commands with the same command ID enter the same virtual queue. Since the virtual queue follows the first-in-first-out principle, the response data returned to the slave is guaranteed. The order of the host is consistent with the order in which the host sends commands, which can avoid deadlock of the host; at the same time, a new command is generated according to the assigned new ID and sent to the corresponding slave, that is, the ID contained in the command sent to the slave is the new ID instead of the command ID carried by the original command. Therefore, when the current command to be sent by the host is the same as the command ID of the last command sent, there is no need to wait for the response content of the last command sent to return to the host, and it can be sent normally to the sequence preservation device for processing, which will not cause the host bandwidth to decrease; therefore, the embodiment of the present application can solve the problem of host bandwidth reduction caused by the need to avoid host deadlock when the host and the slave communicate through the AXI bus.

[0099] Based on Example 2, in some specific embodiments, a management module can be set up to manage all new IDs. When the sequence preservation device generates a new ID, it applies to the management module for an idle new ID. For example, the new ID includes 1000 IDs, which are 1 to 1000 respectively. If the current new IDs = 1 to 500 are all used, then the current new IDs = 501 to 1000 are all idle. Because they are managed uniformly by the management module, the new commands output by different sequence preservation devices will not contain the same new ID. If a new ID is dequeued, for example, new ID = 255 is dequeued, then new ID = 255 becomes idle again and can be used again.

[0100] Based on the second embodiment, in some specific embodiments, the new command generation module specifically includes an ID information table, a queue number determination module, a new ID generation module and a command generation module.

[0101] The ID information table is used to store the command ID and host port number of the received command and the queue number corresponding to the command ID;

[0102] Specifically, this embodiment further constructs an ID information table, which includes multiple storage units (table units), and the address (index) of each storage unit is the new ID. For example, the new ID includes 1000 IDs, which are 1 to 1000 respectively. Then the ID information table also has 1000 storage units, which correspond one to one to the 1000 new IDs; each command ID has a corresponding virtual queue, because the responses of multiple commands with the same command ID need to be returned to the host in order, and each virtual queue has a unique queue number to distinguish different queues.

[0103] The queue number determination module is used to generate a new queue number when the command ID is different from all IDs in the ID information table, and is also used to determine the queue number corresponding to an ID in the ID information table as the queue number of the command ID when the command ID is the same as an ID in the ID information table;

[0104] Specifically, the new command generation module obtains the command ID and generates a corresponding new ID. At this time, the command ID can be used to query whether the command ID is stored in the ID information table. If so, the corresponding queue number will also be stored in the ID information table. The queue number can be directly obtained from the ID information table; if not, a new unique queue number is generated.

[0105] The new ID generating module is used to generate a new ID for the received command (the command sent by the host);

[0106] The command generation module is used to generate and send a new command corresponding to the received command (the command sent by the host), and the new command includes the new ID.

[0107] Based on Example 2, in some specific embodiments, the sequence preservation device also includes a bitmap, which includes multiple bits, and the multiple bits correspond one-to-one to multiple new IDs. Each bit is used to record whether all response contents of a new command corresponding to a corresponding new ID have been completely written into the response memory.

[0108] Specifically, for example, the new ID includes 1000 IDs, which are 1 to 1000 respectively, then the bitmap also has 1000 bits, corresponding to the 1000 new IDs one by one, and the value of each bit is 1 or 0. 1 indicates whether the new command corresponding to the corresponding new ID has been executed by the slave, and all response data returned by the slave have been written into the storage space corresponding to the response memory and the new ID (the new ID corresponds to the response ID in the response data); 0 indicates that the new command corresponding to the corresponding new ID has not been executed by the slave, or all response data returned by the slave have not been written into the storage space corresponding to the new ID in the response memory.

[0109] Based on the second embodiment, in some specific embodiments, the sequence-preserving device further includes a head-of-line comparator;

[0110] The head of queue comparator is used to query whether the corresponding bit in the bitmap is 1 according to the head of queue ID of the virtual queue. If only one bit is 1, the virtual queue corresponding to the one bit is determined as the target virtual queue. If at least two bits are 1, at least two virtual queues corresponding to the at least two bits are scheduled according to a preset scheduling algorithm, and one of the virtual queues is selected as the target virtual queue.

[0111] Specifically, since each virtual queue corresponds to a command ID, there may be multiple virtual queues, and the multiple virtual queues are formed by virtual linked lists, and each virtual queue is formed by a linked list, and the virtual linked list includes multiple linked lists; the head comparator monitors whether the bit in the bitmap corresponding to the head ID (new ID) of each virtual queue is 1. If it is 1, it means that the head ID meets the dequeue condition. If the head IDs of multiple virtual queues meet the dequeue condition, scheduling is performed to determine the target virtual queue, and the scheduling algorithm includes but is not limited to the RR scheduling algorithm.

[0112] The dequeue controller is specifically used to read the corresponding response content from the response memory according to the queue head ID of the target virtual queue, and output it to the corresponding host;

[0113] Specifically, the dequeue controller executes a dequeue operation at the head of a target virtual queue each time, and can determine the corresponding host command according to the head ID (new ID), and can determine the corresponding host port number according to the host command, and further can determine the corresponding host.

[0114] Based on the second embodiment, in some specific embodiments, when the command is a read command, the new command generation module parses the read command to obtain the corresponding command ID, host port number, read address and Arlen information, and writes the command ID, host port number, queue number and Arlen information corresponding to the command ID into the storage unit with the new ID as the address in the ID information table; wherein the Arlen information is the amount of data to be read by the read command; the new command includes the new ID and the read address, and the response content corresponding to the read command is the returned read data;

[0115] Specifically, two ID information tables can be set up, corresponding to the read channel and the write channel respectively. The new command generation module writes the command ID, host port number, queue number corresponding to the command ID, and Arlen information into the storage unit with the new ID as the address in the ID information table of the read channel. By querying the ID information table, the command ID and host port number corresponding to the head ID (new ID) can be quickly determined.

[0116] Based on the second embodiment, in some specific embodiments, the write controller is specifically used to parse any response data returned by the AXI bus in response to the read command to obtain a corresponding response ID and read data, increase the count value of the counter corresponding to the response ID by 1, obtain a write address according to the response ID and the current count value of the counter, and write the read data into the storage space corresponding to the write address in the response memory; wherein, when the response data is the last response data returned in response to the read command, the count value of the counter is cleared to zero;

[0117] Specifically, in the present embodiment, each response ID has a counter for calculating the address offset. A corresponding exclusive storage space is allocated to each response ID in the response memory. The exclusive storage space includes multiple addresses, with the response ID as the base address. If the target data to be read by the host is large and needs to be returned completely after multiple times, each time response data containing a response ID is received, the current count value of the counter corresponding to the response ID is increased by 1, and the current count value of the counter is used as the offset. In this way, the received response data is stored each time according to the write address calculated according to the base address + offset (response ID + current count value), and multiple response contents returned multiple times can be stored in sequence in one storage space; at the same time, after all the response contents returned by the slave response are stored in the response memory, the count value of the counter needs to be cleared to recycle the resources so as to facilitate the subsequent use by other command execution tasks.

[0118] Based on the second embodiment, in some specific embodiments, Figure 4 In the scheme shown, the dequeue controller is specifically used to read the corresponding command ID, host port number and Arlen information in the ID information table according to the head ID of the virtual queue (at this time as the read address / index of the ID information table). The new ID corresponds to the response ID, so the corresponding read data can be read from the response memory according to the head ID (as the read address), and the corresponding read data can be checked according to the Arlen information. If correct, the corresponding read data is output together with the command ID. If incorrect, the new command is sent to the AXI bus again to request the slave to execute the new command again, or an error code and the command ID are output to the host corresponding to the host port number.

[0119] Specifically, the Arlen information is the amount of data that the corresponding slave should return in response to the read command. Therefore, the amount of data of the corresponding response data can be calculated and compared with the Arlen information. If they are consistent, it is correct. The corresponding response content is output to the host together with the command ID, and then the team head ID (new ID) is released, and a bit corresponding to the new ID on the bitmap is cleared to 0 to recycle resources. If they are inconsistent, it is an error. At this time, an error code can be returned to the host, and the sequence preservation device can also send a new command to read the data again.

[0120] The following is an example of a host requesting a slave to execute a read command. Assume that the maximum outstanding supported by the sequence preservation module is 64, that is, there are at most 64 commands with the same command ID from the same or different hosts, or there are 64 commands with completely different command IDs from the same or different hosts. Each command ID corresponds to a queue number, and each command ID can correspond to multiple new IDs. The execution flow of this example is as follows:

[0121] step3.1: The sequence preservation module M_AR_CHNL (master side read address channel) receives a command from a host, whose command ID = 8, host port number port = 0, and compares the command ID with the fixed position of each address in the ID information table. Assuming the comparison fails (that is, there is no valid command ID = 8 in the ID information table), go to step 3.2; if there is a valid command ID = 8 in the ID information table, there is no need to generate a new queue number, and the queue number corresponding to the command ID is que = 3.

[0122] step3.2: At this time, the queue number generation module selects one from the idle queue, recorded as que=3, and the new ID generation module generates a new ID from the idle queue, recorded as RID=10.

[0123] step3.3: With RID=10 as the address, write the command ID, port, que, Arlen and other data into the ID information table, and write RID=10 into queue que3 of the virtual linked list.

[0124] step3.4: The command is issued from S_AR_CHNL (channel).

[0125] Step 3.5: The response comes in from S_R_CHNL (channel), with RID' (equal to RID) as the base address of the response memory. A table is maintained in the write controller to implement the counter function. Each address in the table corresponds to each RID'. The content of the table is the write offset of the response memory (counting starts from 0, and each time the content is written, it is increased by 1). At this time, the response content corresponding to RID'=10 needs to be written to the response memory. The write address corresponding to RID' is 0xA0~0XAF, and the read data is written to the response memory. At the same time, the content of the address corresponding to RID' in the table is +1;

[0126] step3.6: When the last response of RID' arrives, set the value of the RID'th bit in the bitmap to 1, that is, the 10th bit of the bitmap is 1 at this time;

[0127] step3.7: Check the content of address 10 in the ID information table and get que=3;

[0128] Step 3.8: The head comparator compares whether the bit in the bitmap corresponding to the RID of the head of the queue que3 in the virtual linked list is 1. If it is 1, it means that the response data of the RID of the head of the queue has been fully returned; if it is 0, it means that the response data of the RID of the head of the queue has not been returned or has not been fully returned, and the responses after the RID in the virtual linked list have been fully returned;

[0129] step3.9: When the result of step3.8 is 1, the queue controller reads the virtual linked list, and then reads the response memory to obtain the read data. Step3.7 checks the ID information table to obtain the RID, and then a complete response can be obtained. M_R_CHNL (channel) is returned and output to the host corresponding to port = 0; then the position of RID in the ID information table is set to invalid, and RID = 10 is released. If the queue of the virtual linked list is empty after reading the queue, the queue number que = 3 is also released.

[0130] It should be noted that, in step 3.6, at most 64 bits of the bitmap may be 1 at the same time. If multiple bits are 1 at the same time, it is necessary to check the contents of multiple addresses in the ID information table at the same time; then according to step 3.8, check how many bits of the bitmap meet the conditions in the virtual linked list. If multiple bits meet the conditions at the same time, it is necessary to select one from the many qualified bits to read the virtual linked list. The RR scheduling algorithm can be used here.

[0131] Based on the second embodiment, in some specific embodiments, when the command is a write command, the new command generation module parses the write command to obtain the corresponding command ID, host port number, write address and write data, and writes the command ID, host port number and queue number corresponding to the command ID into a storage unit with the new ID as the address; wherein the new command includes the new ID, write address and write data;

[0132] Specifically, two ID information tables can be set up, corresponding to the read channel and the write channel respectively. The new command generation module writes the command ID, the host port number and the queue number corresponding to the command ID into the storage unit with the new ID as the address in the ID information table of the write channel; after receiving the new command, the slave writes the write data into the corresponding storage unit according to the write address, and generates a response ID according to the new ID, and returns the write operation result and the response ID as a response data to the sequence preservation device through the AXI bus.

[0133] Based on Example 2, in some specific embodiments, the write controller is specifically used to parse the response data returned by the AXI bus in response to the write command to obtain the corresponding response ID and the write operation result, and write the write operation result into the storage space corresponding to the response ID in the response memory.

[0134] Based on the second embodiment, in some specific embodiments, Figure 4 In the scheme shown, the dequeue controller is specifically used to read the corresponding command ID and host port number in the ID information table according to the head ID of the virtual queue (at this time as the read address / index of the ID information table), read the corresponding write operation result from the response memory according to the head ID (at this time as the read address), and output the corresponding write operation result together with the command ID to the host corresponding to the host port number.

[0135] The following is an example of a host requesting a slave to execute a write command. Assume that the maximum outstanding supported by the sequence preservation module is 64, that is, there are at most 64 commands with the same command ID from the same or different hosts, or there are 64 commands with completely different command IDs from the same or different hosts. Each command ID corresponds to a queue number, and each command ID can correspond to multiple new IDs. The execution process of this example is as follows:

[0136] step4.1: The sequence preservation module M_AW_CHNL (master side read address channel) receives a command from a host, whose command ID = 8, host port number port = 0, and compares the command ID with the fixed position of each address in the ID information table. Assuming the comparison fails (that is, there is no valid command ID = 8 in the ID information table), enter step 4.2. If there is a valid command ID = 8 in the ID information table, there is no need to generate a new queue number. The queue number corresponding to the command ID is que = 3.

[0137] step4.2: At this time, the queue number generation module selects one from the idle queue, recorded as que=3, and the new ID generation module generates an ID from the idle queue, recorded as RID=10.

[0138] step4.3: With RID=10 as the address, write the command ID, port, and que as data into the ID information table; write the new ID into que3 of the virtual linked list.

[0139] step4.4: The command is issued from S_AW_CHNL (channel).

[0140] step4.5: The response comes in from S_B_CHNL (channel) with RID' (equal to the new ID) as the response memory address.

[0141] Step 4.6: Set the RID' bit of the bitmap to 1. That is, the 10th bit of the bitmap is 1 at this time.

[0142] step4.7: Check the content of address 10 in the ID information table to obtain the queue number que=3.

[0143] step4.8: The head comparator compares whether the bitmap position corresponding to the new ID of the head of the queue que3 in the virtual linked list is 1. If it is 1, it means that the responses of the new ID of the head of the queue have all been returned; if it is 0, it means that the response of the new ID has not been returned or has not been fully returned, and the responses after the new ID of the head of the queue in the virtual linked list have been fully returned.

[0144] step4.9: When the result of step4.8 is 1, the queue controller reads the virtual linked list, and then reads the response memory to obtain the read data. Step4.7 checks the ID information table to obtain the RID, and then a complete response can be obtained. M_R_CHNL (channel) is returned and output to the host with port = 0; then the RID position in the ID information table is set to invalid, and RID = 10 is released. If the queue of the virtual linked list is empty after reading the queue, the queue number que = 3 is also released.

[0145] Embodiment 3 of the present application provides an electronic device, including a host, at least one slave, an AXI bus, and a sequence preservation device according to the above embodiment 1, wherein the host is communicatively connected to the sequence preservation device, the sequence preservation device is communicatively connected to the AXI bus, and the AXI bus is communicatively connected to the at least one slave.

[0146] Specifically, Figure 3 This is an example structure of the electronic device of this embodiment, including sequence preservation device 0 and sequence preservation device 1, which are respectively connected to host 0 and host 1. It should be noted that the working principles of the host, slave, sequence preservation device and AXI bus in the electronic device of this embodiment have been described in the details of embodiment 1, so they will not be repeated in this embodiment. For details, please refer to the contents of the above embodiment 1 to understand the technical details of the electronic device of this embodiment.

[0147] Embodiment 4 of the present application provides an electronic device, comprising at least two hosts, at least one slave, an AXI bus, and a sequence preservation device according to the above-mentioned embodiment 2, wherein the at least two hosts are communicatively connected to the sequence preservation device, the sequence preservation device is communicatively connected to the AXI bus, and the AXI bus is communicatively connected to the at least one slave.

[0148] Specifically, Figure 4 This is an example structure of the electronic device of this embodiment, and the sequence-preserving device is connected to host 0 and host 1. It should be noted that the working principles of the host, slave, sequence-preserving device and AXI bus in the electronic device of this embodiment have been described in detail in the second embodiment, so they will not be repeated in this embodiment. For details, please refer to the content of the second embodiment to understand the technical details of the electronic device of this embodiment.

[0149] Embodiment 5 of the present application provides a chip, comprising the sequence preserving device described in embodiment 1 or 2 above.

[0150] The embodiments of the present application have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many updates and modifications will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A sequence-preserving device, It is characterized in that include: A new command generation module, used for receiving and parsing the command issued by the host corresponding to the sequence preservation device to obtain the corresponding command ID, generating a new ID corresponding to the command ID and determining the queue number corresponding to the command ID; Writing the new ID into the virtual queue corresponding to the queue number, generating a new command corresponding to the received command, and sending the new command to the AXI bus, wherein the new command includes the new ID; A write controller, used for receiving and parsing the response data returned by the AXI bus to obtain a corresponding response ID and response content, and writing the response content into a storage space corresponding to the response ID in the response memory; The response ID corresponds to the new ID; A dequeue controller is used to read the response content corresponding to the new command stored in the response memory according to the new ID when all response data of the new command have been received and when the new ID is the head ID of the virtual queue, and output it to the corresponding host.

2. The sequence-preserving device according to claim 1, It is characterized in that The new command generation module specifically includes: ID information table, used to store the command ID of the received command and the queue number corresponding to the command ID; a queue number determination module, configured to generate a new queue number when the command ID is different from all IDs in the ID information table, and to determine the queue number corresponding to an ID in the ID information table as the queue number of the command ID when the command ID is the same as an ID in the ID information table; A new ID generation module, used to generate a new ID for a received command; The command generation module is used to generate and send a new command corresponding to the received command, wherein the new command includes the new ID.

3. The sequence-preserving device according to claim 2, It is characterized in that The sequence preserving device also includes a bitmap, which includes multiple bits, and the multiple bits correspond one-to-one to multiple new IDs. Each bit is used to record whether all response contents of a new command corresponding to a corresponding new ID have been written into the response memory.

4. The sequence-preserving device according to claim 3, It is characterized in that The sequence-preserving device further includes a head-of-line comparator; The head of queue comparator is used to query whether the corresponding bit in the bitmap is 1 according to the head of queue ID of the virtual queue. If only one bit is 1, the virtual queue corresponding to the one bit is determined as the target virtual queue. If at least two bits are 1, at least two virtual queues corresponding to the at least two bits are scheduled according to a preset scheduling algorithm, and one of the virtual queues is selected as the target virtual queue. The dequeue controller is specifically used to read the corresponding response content from the response memory according to the queue head ID of the target virtual queue, and output it to the corresponding host.

5. The sequence preservation device according to any one of claims 1 to 4, It is characterized in that When the command is a read command, the new command generation module parses the read command to obtain the corresponding command ID, read address and Arlen information, and writes the command ID, the queue number corresponding to the command ID and the Arlen information into the storage unit with the new ID as the address in the ID information table; wherein the Arlen information is the amount of data to be read by the read command; the new command includes the new ID and the read address, and the response content corresponding to the read command is the returned read data.

6. The sequence-preserving device according to claim 5, It is characterized in that The write controller is specifically used to parse any response data returned by the AXI bus in response to the read command to obtain the corresponding response ID and read data, increase the count value of the counter corresponding to the response ID by 1, obtain the write address according to the response ID and the current count value of the counter, and write the read data into the storage space corresponding to the write address in the response memory; wherein, when the response data is the last response data returned in response to the read command, the count value of the counter is cleared.

7. The sequence-preserving device according to claim 6, It is characterized in that The dequeue controller is specifically used to read the corresponding command ID and Arlen information in the ID information table according to the team head ID of the virtual queue, read the corresponding read data from the response memory according to the team head ID, and verify whether the corresponding read data is correct according to the Arlen information. If correct, the corresponding read data is output to the corresponding host together with the command ID.

8. The sequence preservation device according to any one of claims 1 to 4, It is characterized in that When the command is a write command, the new command generation module parses the write command to obtain the corresponding command ID, write address and write data, and writes the command ID and the queue number corresponding to the command ID into the storage unit with the new ID as the address; wherein the new command includes the new ID, write address and write data.

9. The sequence-preserving device according to claim 8, It is characterized in that The write controller is specifically used to parse the response data returned by the AXI bus in response to the write command to obtain the corresponding response ID and the write operation result, and write the write operation result into the storage space corresponding to the response ID in the response memory.

10. The sequence-preserving device according to claim 9, It is characterized in that The dequeue controller is specifically used to read the corresponding command ID in the ID information table according to the team head ID of the virtual queue, read the corresponding write operation result from the response memory according to the team head ID, and output the corresponding write operation result together with the command ID to the corresponding host.

11. A sequence-preserving device, It is characterized in that include: A new command generation module is used to receive and parse a command issued by any host to obtain a corresponding command ID and a host port number, generate a new ID corresponding to the command ID, and determine a queue number corresponding to the command ID; Writing the new ID into the virtual queue corresponding to the queue number, generating a new command corresponding to the received command, and sending the new command to the AXI bus, wherein the new command includes the new ID; A write controller, used for receiving and parsing the response data returned by the AXI bus to obtain a corresponding response ID and response content, and writing the response content into a storage space corresponding to the response ID in the response memory; The response ID corresponds to the new ID; A dequeue controller is used to read the response content corresponding to the new command stored in the response memory according to the new ID when all response data of the new command have been received and when the new ID is the head ID of the virtual queue, and output it to the host corresponding to the host port number.

12. The sequence-preserving device according to claim 11, It is characterized in that The new command generation module specifically includes: ID information table, used to store the command ID and host port number of the received command and the queue number corresponding to the command ID; a queue number determination module, configured to generate a new queue number when the command ID is different from all IDs in the ID information table, and to determine the queue number corresponding to an ID in the ID information table as the queue number of the command ID when the command ID is the same as an ID in the ID information table; A new ID generation module, used to generate a new ID for a received command; The command generation module is used to generate and send a new command corresponding to the received command, wherein the new command includes the new ID.

13. The sequence-preserving device according to claim 12, It is characterized in that The sequence preserving device also includes a bitmap, which includes multiple bits, and the multiple bits correspond one-to-one to multiple new IDs. Each bit is used to record whether all response contents of a new command corresponding to a corresponding new ID have been written into the response memory.

14. The sequence-preserving device according to claim 13, It is characterized in that The sequence-preserving device further includes a head-of-line comparator; The head of queue comparator is used to query whether the corresponding bit in the bitmap is 1 according to the head of queue ID of the virtual queue. If only one bit is 1, the virtual queue corresponding to the one bit is determined as the target virtual queue. If at least two bits are 1, at least two virtual queues corresponding to the at least two bits are scheduled according to a preset scheduling algorithm, and one of the virtual queues is selected as the target virtual queue. The dequeue controller is specifically used to read the corresponding response content from the response memory according to the queue head ID of the target virtual queue, and output it to the corresponding host.

15. The sequence preservation device according to any one of claims 11 to 14, It is characterized in that When the command is a read command, the new command generation module parses the read command to obtain the corresponding command ID, host port number, read address and Arlen information, and writes the command ID, host port number, queue number and Arlen information corresponding to the command ID into a storage unit with the new ID as the address in the ID information table; wherein the Arlen information is the amount of data to be read by the read command; the new command includes the new ID and the read address, and the response content corresponding to the read command is the returned read data.

16. The sequence-preserving device according to claim 15, It is characterized in that The write controller is specifically used to parse any response data returned by the AXI bus in response to the read command to obtain the corresponding response ID and read data, increase the count value of the counter corresponding to the response ID by 1, obtain the write address according to the response ID and the current count value of the counter, and write the read data into the storage space corresponding to the write address in the response memory; wherein, when the response data is the last response data returned in response to the read command, the count value of the counter is cleared.

17. The sequence-preserving device according to claim 16, It is characterized in that The dequeue controller is specifically used to read the corresponding command ID, host port number and Arlen information in the ID information table according to the team head ID of the virtual queue, read the corresponding read data from the response memory according to the team head ID, and verify whether the corresponding read data is correct according to the Arlen information. If correct, the corresponding read data is output together with the command ID to the host corresponding to the host port number.

18. The sequence preservation device according to any one of claims 11 to 14, It is characterized in that When the command is a write command, the new command generation module parses the write command to obtain the corresponding command ID, host port number, write address and write data, and writes the command ID, host port number and the queue number corresponding to the command ID into the storage unit with the new ID as the address; wherein the new command includes the new ID, write address and write data.

19. The sequence-preserving device according to claim 18, It is characterized in that The write controller is specifically used to parse the response data returned by the AXI bus in response to the write command to obtain the corresponding response ID and the write operation result, and write the write operation result into the storage space corresponding to the response ID in the response memory.

20. The sequence-preserving device according to claim 19, It is characterized in that The dequeue controller is specifically used to read the corresponding command ID and host port number in the ID information table according to the team head ID of the virtual queue, read the corresponding write operation result from the response memory according to the team head ID, and output the corresponding write operation result together with the command ID to the host corresponding to the host port number.

21. An electronic device, It is characterized in that The invention comprises a host, at least one slave, an AXI bus and a sequence preserving device according to any one of claims 1 to 10, wherein the host is communicatively connected to the sequence preserving device, the sequence preserving device is communicatively connected to the AXI bus, and the AXI bus is communicatively connected to the at least one slave.

22. An electronic device, It is characterized in that It comprises at least two hosts, at least one slave, an AXI bus and a sequence preserving device as described in any one of claims 11 to 20, wherein the at least two hosts are communicatively connected to the sequence preserving device, the sequence preserving device is communicatively connected to the AXI bus, and the AXI bus is communicatively connected to the at least one slave.

23. A chip, It is characterized in that The invention comprises the sequence preserving device as claimed in any one of claims 1 to 20.

Citation Information

Cited By

  • Method and device for achieving out-of-order transmission and order preservation of AXI bus and computer readable storage medium

    CN119862141A

  • Order preserving method and device for out-of-order transmission of AXI bus

    CN119862142A

  • Anti-deadlock method and device based on AXI bus data reordering

    CN120086029A

  • SOC chip based on AXI bus, electronic equipment and data transmission method

    CN122311123A