[go: up one dir, main page]

WO2018107658A1 - Method and device for avoiding deadlock of bus, and storage medium - Google Patents

Method and device for avoiding deadlock of bus, and storage medium Download PDF

Info

Publication number
WO2018107658A1
WO2018107658A1 PCT/CN2017/085136 CN2017085136W WO2018107658A1 WO 2018107658 A1 WO2018107658 A1 WO 2018107658A1 CN 2017085136 W CN2017085136 W CN 2017085136W WO 2018107658 A1 WO2018107658 A1 WO 2018107658A1
Authority
WO
WIPO (PCT)
Prior art keywords
deadlock
matrix
slave
write address
address command
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2017/085136
Other languages
French (fr)
Chinese (zh)
Inventor
刘毅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sanechips Technology Co Ltd
Original Assignee
Sanechips Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sanechips Technology Co Ltd filed Critical Sanechips Technology Co Ltd
Publication of WO2018107658A1 publication Critical patent/WO2018107658A1/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4004Coupling between buses
    • G06F13/4027Coupling between buses using bus bridges
    • G06F13/4031Coupling between buses using bus bridges with arbitration
    • G06F13/4036Coupling between buses using bus bridges with arbitration and deadlock prevention
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure

Definitions

  • the present invention relates to the field of high performance chip design, and in particular, to a method, device and storage medium for preventing bus deadlock.
  • AXI (Advanced eXtensible Interface) bus protocol is a high performance and high bandwidth on-chip bus protocol proposed by ARM. It is widely used in system-on-chip (SOC).
  • the AXI bus adopts a read-write separation, address/control and data separation transmission mechanism by defining a read address channel (AR), a read data channel (R), a write address channel (AW), a write data channel (W), and a write response.
  • Channel (B) five independent transmission channels, greatly improving transmission efficiency.
  • data exchange between the multi-master device (Master) and the multi-slave device (Slave) is often performed through a bus interconnect Interconnect module (also known as a bus matrix).
  • the SOC is often composed of multiple Interconnect modules cascaded.
  • the Interconnect module is compatible with the Outstanding Transport Access and Out-of-Order (OoO) access mechanisms supported by the AXI protocol, which improves the transmission throughput on the one hand, but also increases the risk of bus deadlock on the other hand.
  • OoO Outstanding Transport Access and Out-of-Order
  • the Master marks each transmission with an ID number, and the Interconnect module passes The ID number of each Master is extended to distinguish different Masters. For the same Master, different transmissions are sent with the same ID number. Different transmissions must be performed in order, and the Slave can return the transmission of different ID numbers in OoO mode. This mechanism may form a Cyclic Dependence between handshake signals when multiple Masters access multiple Slaves at the same time, resulting in deadlocks. This type of deadlock is caused by Slave's out-of-order mechanism in response channels.
  • This type of deadlock is called a "reverse channel deadlock.”
  • the reverse channel deadlock can be circumvented by a single Slave (Single Slave) or the same ID can be used only for a single Slave (Single Slave Per ID) mechanism, wherein Single Slave Per The ID mechanism is described in CN102103560A.
  • FIG. 1 is a schematic diagram of a typical "forward channel deadlock" in the prior art.
  • Master0 sequentially sends AW01 and AW00 two write address commands to Slave1 and Slave0 in sequence; at the same time, Master1 successively sends AW10 and AW11 two write address commands to Slave0 and Slave1 in sequence; since Slave interface 0
  • the path delay between the interface 0 and the master interface 0 is smaller than the path delay between the SLAVE interface 1 and the master interface 0. Therefore, the AW00 is sent first, and the AW10 arrives at the Slave0 and obtains access to the master interface 0.
  • Master interface 0 turns on the W channel and waits for the number of writes.
  • the AW11 is sent first, before the AW01 arrives at the Slave1, and the master is obtained.
  • Interface 1 access rights.
  • Master interface 1 opens the W channel and waits for W11. Because it is later than W01 in time sequence, W00 must wait for W01 to send before it can send to Master interface 0.
  • W01 can only wait for W11 to be sent before it can be sent to the destination Master interface 1; similarly, because it is later than W10 in chronological order, W11 must wait for W10 to send before it can be sent to the destination Master interface. 1; At this time, since AW00 still occupies access to Slave0 (W00 is always in a waiting state), W10 can only wait for W00 to be sent before it can be sent to the destination Master interface 0, so the loop waiting situation is formed.
  • 2 is a schematic diagram of the cyclic dependency of the deadlock generated in FIG. 1. As shown in FIG. 2, W00 waits for W01, W01 waits for W11, W11 waits for W10, W10 waits for W00, and the bus transmission is deadlocked.
  • the Interconnect module adopts a single effective Slave (Slave Active Slave, SAS) mechanism.
  • SAS Selave Active Slave
  • the SAS mechanism stipulates that the Slave interface of the interconnect module can only initiate the next write address command after all the write data of the current transmission has been sent, thereby avoiding the "when the write address command of the subsequent write transfer arrives at the destination, The previous write data still blocks the necessary conditions for the forward deadlock on the Slave interface. Therefore, in the system of the Interconnect module of the multi-level Switch structure and the cascading of multiple Interconnect modules, a single/single Provider ID (SPI)+SAS mechanism is often used to simultaneously prevent possible Deadlock to the reverse AXI bus.
  • SPI Single/single Provider ID
  • the SAS mechanism is at the expense of the transmission efficiency of the AW channel in the outstanding transport access mechanism; for some slave devices, the AW write address command is received earlier (even if the write data does not arrive at this time), it can be written
  • the overhead process of the response operation is advanced, such as a double rate synchronous dynamic random access memory (DDR) controller.
  • the AW write address command can be used to perform row/column interleaving calculation in advance, thereby reducing write data. W channel handshake time. In this sense, the SAS anti-deadlock mechanism reduces the data throughput of the bus transmission to a certain extent and reduces the data efficiency of the bus transmission.
  • embodiments of the present invention provide a method, apparatus, and storage medium for preventing bus deadlock, so as to be able to effectively identify a write command that is in danger of a potential deadlock, thereby blocking a write command that causes a deadlock in time. .
  • Embodiments of the present invention provide a method for preventing a bus deadlock, including:
  • the write address command that caused the deadlock is determined and blocked.
  • the determining, according to the dynamic routing table, whether the bus generates a deadlock includes:
  • the determining whether the bus generates a deadlock according to the dynamic routing table and the relationship matrix includes:
  • the relationship matrix is a deadlock matrix; wherein the deadlock matrix is a matrix in the relationship matrix that can cause the bus to generate a deadlock;
  • the relationship matrix is the deadlock matrix, determining whether the deadlock matrix is a simplest deadlock matrix; wherein the simplest deadlock matrix is that the deadlock matrix can cause the bus to generate a deadlock And the simplest form of matrix;
  • the deadlock matrix is not the simplest deadlock matrix, converting the deadlock matrix into the simplest deadlock matrix;
  • the determining whether the relationship matrix is a deadlock matrix comprises:
  • the relationship matrix is not the deadlock matrix.
  • determining whether the deadlock matrix is the simplest deadlock matrix comprises:
  • the relationship matrix is the deadlock matrix, determine whether each of the row and each column of the deadlock matrix has two first identifiers;
  • the deadlock matrix is not the simplest deadlock matrix.
  • converting the deadlock matrix into the simplest deadlock matrix comprises:
  • the i ⁇ i order deadlock matrix is selected in the i ⁇ i order submatrices
  • the i ⁇ i order deadlock matrix is not the simplest deadlock matrix, the i ⁇ i order deadlock matrix is converted into the simplest deadlock matrix.
  • the m ⁇ k order deadlock matrix is not the simplest deadlock matrix
  • the m ⁇ k order deadlock matrix i ⁇ i order sub-matrices including:
  • the number of i rows and i columns is selected in the m ⁇ k order deadlock matrix, and the selected i row and i column numbers are selected and included. Generating the numbers in the i rows and i columns and generating the i ⁇ i order matrix;
  • converting the i ⁇ i order deadlock matrix into the simplest deadlock matrix comprises:
  • the i ⁇ i order deadlock matrix is not the simplest deadlock matrix, there are more than two of the first identified rows or columns in the i ⁇ i order deadlock matrix.
  • An identifier is set to the stated The second identifier is such that each of the row and each column of the i ⁇ i-order deadlock matrix has two first identifiers, to obtain the simplest deadlock matrix.
  • the status information of the write address command includes an interface name of the source interface, an interface name of the destination interface, information of the first timing closure register slice, and information of the second timing closure register slice, wherein the The information of a timing closure register slice is information of a timing convergence register slice that the write address command needs to pass from the source interface to the transmission path of the destination interface, and the information of the second timing convergence register slice is the current time.
  • the write address command has passed the information of the timing convergence register slice, the source interface is a slave interface connected to the master that sends the write address command, and the destination interface is the same as the command to receive the write address command.
  • the Master interface connected to the Slave.
  • the determining whether the bus generates a deadlock according to the dynamic routing table and the simplest deadlock matrix comprises:
  • the deadlock feature is the first master first Slave sends a first write address command, and then sends a second write address command to the second slave; the second master first sends a third write address command to the second slave, and then sends a fourth write address command to the first slave.
  • the second write address command arrives at the second slave before the third write address command; the fourth write address command arrives at the first slave before the first write address command.
  • the obtaining, by the minimum deadlock matrix and the dynamic routing table, a sending moment that the master sends a write address command to the slave includes:
  • determining whether the relationship between the master and the slave meets a deadlock feature according to a sending moment of the write address command and a delay in the path including:
  • the sending time of the second write address command to the second slave is greater than the sending time of the first master sending the first write address command to the first slave, and The arrival time of the second write address command reaching the second slave is less than the arrival time of the third write address command reaching the second slave; and the second master sends the fourth to the first slave
  • the sending time of the write address command is greater than the time when the second master sends the third write address command to the second slave, and the time when the fourth write address command reaches the first slave is less than the first The time at which the write address command arrives at the first slave; determining that the relationship between the master and the slave satisfies the deadlock feature.
  • the method determines whether the bus generates a deadlock according to the dynamic routing table, including:
  • the second master sends a sending moment of the second write address command to the first slave, and the arrival time of the first write address command reaching the first slave is greater than the arrival time of the second write address command reaching the first slave;
  • the third write address command is a write command sent to the second slave and transmitting a time greater than a sending time of the second write address command
  • the fourth write address command is a write command having a sending time greater than the third write address command
  • Type relationship matrix including:
  • the relationship between the master and the slave is that the master sends a write address command to the slave, setting a first identifier at a corresponding position of the incremental relationship matrix;
  • a second identifier is set at a corresponding position of the incremental relationship matrix.
  • the determining whether the bus generates a deadlock according to the incremental relationship matrix includes:
  • the embodiment of the invention further provides an apparatus for preventing bus deadlock, comprising:
  • a pre-processing module configured to establish a dynamic routing table, where the dynamic routing table is used to record status information of a write address command sent by the master device but not yet reaching the slave device slave;
  • the determining module is configured to determine, according to the dynamic routing table, whether the bus generates a deadlock
  • the processing module is configured to determine and block the write address command causing the deadlock if the bus generates a deadlock.
  • the determining module comprises:
  • a first processing unit configured to generate a relationship matrix according to a relationship between the master and the slave; wherein, if the master sends a write address command to the slave, the corresponding position of the relationship matrix is a first identifier, if the master Not sending the write address command to the slave, where a corresponding location of the relationship matrix is a second identifier;
  • the first determining unit is configured to determine whether the bus generates a deadlock according to the dynamic routing table and the relationship matrix.
  • the first determining unit is configured to determine whether the relationship matrix is a deadlock matrix; wherein the deadlock matrix is a matrix in the relationship matrix that can cause the bus to generate a deadlock;
  • the relationship matrix is the deadlock matrix, determining whether the deadlock matrix is a simplest deadlock matrix; wherein the simplest deadlock matrix is that the deadlock matrix can cause the bus to generate a deadlock And the simplest form of matrix;
  • the deadlock matrix is not the simplest deadlock matrix, converting the deadlock matrix into the simplest deadlock matrix;
  • the status information of the write address command includes an interface name of the source interface, an interface name of the destination interface, information of the first timing closure register slice, and information of the second timing closure register slice, wherein the The information of a timing closure register slice is information of a timing convergence register slice that the write address command needs to pass from the source interface to the transmission path of the destination interface, and the information of the second timing convergence register slice is the current time.
  • the write address command has passed the information of the timing convergence register slice, the source interface is a slave interface connected to the master that sends the write address command, and the destination interface is the same as the command to receive the write address command.
  • the Master interface connected to the Slave.
  • the processing module comprising:
  • An obtaining unit configured to acquire, according to the simplest deadlock matrix and the dynamic routing table, a sending moment that the master sends the write address command to the slave; according to the simplest deadlock matrix and the dynamic routing Obtaining, by the table, a delay in a path that the write address command sent by the master reaches the slave;
  • a second determining unit configured to determine, according to the sending time of the write address command and the delay in the path, whether the relationship between the master and the slave meets a deadlock feature;
  • the deadlock feature is that the first master first sends a first write address command to the first slave, and then sends a second write address command to the second slave; the second master first sends a third write address command to the second slave. Sending a fourth write address command to the first slave; and the second write address command reaches the second slave before the third write address command; the fourth write address command precedes the first a write address command arrives at the first slave;
  • the second processing unit is configured to determine that the bus generates a deadlock if the relationship between the master and the slave satisfies a deadlock feature.
  • the second determining unit is configured to determine whether the sending time of the first master sending the first write address command to the first slave is smaller than the first master to the second Slave sends a sending moment of the second write address command;
  • the sending time of the second write address command to the second slave is greater than the sending time of the first master sending the first write address command to the first slave, and The arrival time of the second write address command reaching the second slave is less than the arrival time of the third write address command reaching the second slave; and the second master sends the fourth to the first slave
  • the sending time of the write address command is greater than the time when the second master sends the third write address command to the second slave, and the time when the fourth write address command reaches the first slave is less than the first The time at which the write address command arrives at the first slave; determining that the relationship between the master and the slave satisfies the deadlock feature.
  • the determining module comprises:
  • the third determining unit is configured to determine, according to the dynamic routing table, whether the relationship between the master and the slave is in a pre-emptive manner; wherein, after the first sending, the first master sends the first write to the first slave.
  • the sending moment of the address command is smaller than the sending moment of the second master sending the second write address command to the first slave, and the arrival time of the first write address command reaching the first slave is greater than the second write address command reaching the first slave.
  • a third processing unit configured to generate an incremental type according to the second write address command, the third write address command, and the fourth write address command if the relationship between the master and the slave exists in the pre-start situation a relationship matrix; wherein the third write address command is an address command sent to the second slave and the transmission time is greater than a transmission time of the second write address command; and the fourth write address command is a transmission time greater than the first The address command of the three-write address command.
  • the third processing unit is configured to determine the second write address command and the third write address respectively if the relationship between the master and the slave exists in the pre-starting situation.
  • the relationship between the master and the slave is that the master sends a write address command to the slave, setting a first identifier at a corresponding position of the incremental relationship matrix;
  • a second identifier is set at a corresponding position of the incremental relationship matrix.
  • the embodiment of the invention further provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the foregoing method for preventing bus deadlock.
  • a method, device, and storage medium for preventing bus deadlock provided by an embodiment of the present invention, the method comprising: establishing a dynamic routing table for recording state information of a write address command issued by a master but not yet reaching a slave; determining a bus according to the dynamic routing table Will there be a deadlock; if the bus will produce a deadlock, determining and blocking the write address command that caused the deadlock; this effectively identifies the write address command that is at risk of a potential deadlock, thereby specifically preventing write address commands that would cause a bus deadlock.
  • the purpose of preventing bus deadlock is achieved, and the problem of data throughput reduction caused by adopting a unified anti-deadlock mechanism is avoided, and the data transmission efficiency of the bus is improved.
  • FIG. 1 is a schematic diagram of a typical "forward channel deadlock" in the prior art
  • FIG. 2 is a schematic diagram of the cyclic dependency of the deadlock generated in FIG. 1;
  • FIG. 3 is a schematic flowchart diagram of a method for preventing bus deadlock according to an embodiment of the present invention
  • FIG. 4 is a schematic flowchart diagram of another method for preventing bus deadlock according to an embodiment of the present invention.
  • FIG. 5 is a schematic flowchart diagram of still another method for preventing bus deadlock according to an embodiment of the present invention.
  • FIG. 6 is a schematic flowchart diagram of still another method for preventing bus deadlock according to an embodiment of the present invention.
  • FIG. 7 is a schematic diagram of a 3 ⁇ 4 order deadlock matrix according to an embodiment of the present invention.
  • FIG. 8 is a schematic diagram of a 3 ⁇ 3 matrix generated by FIG. 7 according to an embodiment of the present invention.
  • FIG. 9 is a schematic diagram of another 3 ⁇ 3 order matrix generated by FIG. 7 according to an embodiment of the present invention.
  • FIG. 10 is a schematic diagram of still another 3 ⁇ 3 order matrix generated by FIG. 7 according to an embodiment of the present invention.
  • FIG. 11 is a schematic diagram of still another 3 ⁇ 3 order matrix generated by FIG. 7 according to an embodiment of the present invention.
  • FIG. 12 is a schematic structural diagram of a system in which an Interconnect module is cascaded according to the present invention.
  • FIG. 13 is a schematic flowchart of still another method for preventing bus deadlock according to an embodiment of the present invention.
  • FIG. 14 is a simplified deadlock matrix according to an embodiment of the present invention.
  • FIG. 15 is a schematic diagram of the cyclic dependency relationship of the deadlock generated by FIG. 14 according to the embodiment.
  • 16 is a schematic diagram of another system of cascading Interconnect modules provided by the present invention.
  • FIG. 17 is a flowchart of a method for preventing bus deadlock according to an embodiment of the present invention.
  • FIG. 18 is still another schematic flowchart of a method for preventing bus deadlock according to an embodiment of the present invention.
  • FIG. 19 is another flowchart of a method for preventing bus deadlock according to an embodiment of the present invention.
  • 20 is a schematic diagram of an emergency mechanism for preventing bus deadlock according to an embodiment of the present invention.
  • FIG. 21 is a schematic structural diagram of another apparatus for preventing bus deadlock according to an embodiment of the present invention.
  • FIG. 22 is a schematic structural diagram of another apparatus for preventing bus deadlock according to an embodiment of the present invention.
  • FIG. 23 is a schematic structural diagram of another apparatus for preventing bus deadlock according to an embodiment of the present invention.
  • FIG. 24 is a schematic structural diagram of another apparatus for preventing bus deadlock according to an embodiment of the present invention.
  • FIG. 25 is a schematic structural diagram of another apparatus for preventing bus deadlock according to an embodiment of the present invention.
  • FIG. 3 is a schematic flowchart of a method for preventing a bus deadlock according to an embodiment of the present invention. As shown in FIG. 3, the method provided in this embodiment includes the following steps:
  • Step 101 Establish a dynamic routing table, where the dynamic routing table is used to record status information of a write address command sent by the master but not yet reach the slave.
  • the step 101 of establishing a dynamic routing table may be implemented by a device that prevents bus deadlock.
  • the dynamic routing table is an ever-changing routing table, which records the status information of the write address command sent by the master but has not yet reached the slave. If at some point in the future, the master sends a write address command has arrived. The corresponding Slave, then the status information of the write address command is deleted from the dynamic routing table.
  • Step 102 Determine, according to the dynamic routing table, whether the bus will generate a deadlock.
  • step 102 determines whether the bus will generate a deadlock according to the dynamic routing table, and may be implemented by a device that prevents bus deadlock. According to the dynamic routing table, it is determined whether the bus will generate a deadlock.
  • the dynamic routing table obtains the status information of the write address command sent by the master but has not yet reached the slave, and determines whether the bus will generate a deadlock according to the obtained status information of the write address command issued by the master but not yet reaching the slave.
  • Step 103 If the bus generates a deadlock, determine and block the write address command that caused the deadlock.
  • determining and blocking the write address command causing the deadlock can be implemented by a device that prevents the bus from being deadlocked.
  • the method for preventing bus deadlock establishes a dynamic routing table for recording status information of a write address command issued by the master but not yet reaching the slave; determining whether the bus will generate a deadlock according to the dynamic routing table; Generate a deadlock, determine and block the write address command that caused the deadlock; this can effectively identify the write address command that is at risk of potential deadlock, and thus specifically block the write address command that will cause the bus deadlock.
  • the purpose of preventing the bus deadlock is achieved, and the problem of reducing the address throughput caused by adopting the unified anti-deadlock mechanism is avoided, and the data transmission efficiency of the bus is improved.
  • FIG. 4 is a schematic flowchart of another method for preventing bus deadlock according to an embodiment of the present invention. As shown in FIG. 4, the method provided in this embodiment includes the following steps:
  • Step 201 The device for preventing bus deadlock establishes a dynamic routing table.
  • the dynamic routing table is used to record state information of a write address command sent by the master but not yet reach the slave.
  • Step 202 The device for preventing bus deadlock generates a relationship matrix according to the relationship between the master and the slave; wherein, if the master sends a write address command to the slave, the corresponding position of the relationship matrix is the first identifier, if the master does not send the write address to the slave The corresponding position of the command and relationship matrix is the second identifier.
  • the relationship matrix is a matrix of relationships between multiple masters and multiple slaves, that is, which masters of all masters send a matrix of write address commands to all slaves in all slaves, if the number of masters is 4, Slave The number is 5, 4 Masters are represented as Master0, Master1, Master2 and Master3, respectively, and 5 Slaves are respectively represented as Slave0. Slave1, Slave2, Slave3, and Slave4, then the relationship between the four Masters and the five Slaves can be represented by a 4 ⁇ 5 relational matrix (Master and Slave4 represent the rows and columns of the relational matrix, respectively), if Master1 sends a write to Slave2. The address command, then the position of the second row and the third column in the relation matrix is represented by the first identifier.
  • the first identifier is generally represented by a number "1”
  • the second representation is generally represented by a number "0”.
  • Step 203 The device for preventing bus deadlock determines whether the bus generates a deadlock according to the dynamic routing table and the relationship matrix.
  • determining whether the bus generates a deadlock according to the dynamic routing table and the relationship matrix means obtaining the write address of the master but not yet reaching the slave from the dynamic routing table according to the relationship between the master and the slave represented by the relationship matrix.
  • the status information of the command determines whether the bus will generate a deadlock based on the obtained status information of the write address command issued by the master but not yet reaching the slave.
  • Step 204 If the bus generates a deadlock, the device that prevents the bus deadlock determines and blocks the write address command that caused the deadlock.
  • the method for preventing bus deadlock establishes a dynamic routing table for recording state information of a write address command sent by the master but not yet reaching the slave; generating a relationship matrix according to the relationship between the master and the slave; The table and relationship matrix determine whether the bus will generate a deadlock; if the bus generates a deadlock, determine and block the write address command that caused the deadlock; this can effectively identify the write address command that is at risk of potential deadlock, and then Targeted blocking of the write address command that will cause the bus deadlock, thus achieving the purpose of preventing bus deadlock, while avoiding the problem of reducing the address throughput caused by the unified anti-deadlock mechanism, and improving the address transmission of the bus effectiveness.
  • FIG. 5 is a schematic flowchart of a method for preventing a bus deadlock according to an embodiment of the present invention. As shown in FIG. 5, the method provided in this embodiment includes the following steps:
  • Step 301 The device for preventing bus deadlock establishes a dynamic routing table.
  • the dynamic routing table is configured to record state information of a write address command sent by the master but not yet reach the slave.
  • Step 302 The device for preventing bus deadlock generates a relationship matrix according to the relationship between the master and the slave; wherein, if the master sends a write address command to the slave, the corresponding position of the relationship matrix is the first identifier, and if the master does not send the write address to the slave The corresponding position of the command and relationship matrix is the second identifier.
  • Step 303 The device for preventing bus deadlock determines whether the relationship matrix is a deadlock matrix; wherein the deadlock matrix is a matrix in the relationship matrix that can cause the bus to deadlock.
  • determining whether the relationship matrix is a deadlock matrix includes: determining whether each row and each column of the relationship matrix respectively have at least two first identifiers; if each row and each column of the relationship matrix respectively have at least two first identifiers, The relationship matrix is determined to be a deadlock matrix; if there is no at least two first identifiers in a row or a column of the relationship matrix, it is determined that the relationship matrix is not a deadlock matrix.
  • determining whether the relationship matrix is a deadlock matrix includes: determining whether each row and each column of the relationship matrix respectively exist at least 2 The number is "1"; if there are at least two numbers "1" in each row and each column of the relationship matrix, the relationship matrix is determined to be a deadlock matrix; if there is no at least two numbers "1" in one row or column of the relationship matrix, Make sure the relationship matrix is not a deadlock matrix. If it is determined that a relationship matrix is not a deadlock matrix, then the relationship between multiple masters and multiple slaves that the relationship matrix reacts does not cause a bus deadlock. Correspondingly, the write address command sent by the master to the slave in the relation matrix is not blocked.
  • Step 304 If the relationship matrix is a deadlock matrix, the device for preventing the bus deadlock determines whether the deadlock matrix is the simplest deadlock matrix; wherein the simple deadlock matrix is a deadlock matrix, the bus can be deadlocked, and the form The simplest matrix.
  • the relationship matrix is a deadlock matrix
  • the method includes: if the relationship matrix is a deadlock matrix, determining whether each row and each column of the deadlock matrix have two first identifiers; if each row and each column of the relationship matrix has two first identifiers, determining a deadlock matrix It is the simplest deadlock matrix; if there are more than two first identifiers in a row or a column of the relation matrix, it is determined that the deadlock matrix is not the simplest deadlock matrix.
  • determining whether the deadlock matrix is the simplest deadlock matrix includes: determining whether each row and each column of the deadlock matrix is There are 2 numbers “1”; if there are 2 numbers "1" in each row and column of the relationship matrix, it is determined that the deadlock matrix is the simplest deadlock matrix; if there are more than 2 rows or columns of the relationship matrix The number "1" determines that the deadlock matrix is not the simplest deadlock matrix.
  • Step 305 If the deadlock matrix is not the simplest deadlock matrix, the device for preventing bus deadlock converts the deadlock matrix into a simple deadlock matrix.
  • Step 306 Determine whether the bus generates a deadlock according to the dynamic routing table and the simplest deadlock matrix.
  • Step 307 If the bus generates a deadlock, the device that prevents the bus deadlock determines and blocks the write address command that caused the deadlock.
  • the method for preventing bus deadlock establishes a dynamic routing table for recording state information of a write address command issued by the master but not yet reaching the slave; generating a relationship matrix according to the relationship between the master and the slave; determining the relationship matrix Whether it is the simplest deadlock matrix; if the relational matrix is not the simplest deadlock matrix, the relational matrix is converted into the simplest deadlock matrix; according to the dynamic routing table and the simplest deadlock matrix, it is judged whether the bus will generate a deadlock; Generate a deadlock, determine and block the write address command that caused the deadlock; this can effectively identify the write address command that is at risk of potential deadlock, and thus specifically block the write address command that will cause the bus deadlock.
  • the purpose of preventing the bus deadlock is achieved, and the problem of reducing the address throughput caused by adopting the unified anti-deadlock mechanism is avoided, and the data transmission efficiency of the bus is improved.
  • FIG. 6 is a schematic flowchart of still another method for preventing bus deadlock according to an embodiment of the present invention. As shown in FIG. 6, step 305 is included in the method provided in this embodiment. The following steps:
  • Step 305a if the m ⁇ k order deadlock matrix is not the simplest deadlock matrix, the device for preventing bus deadlock is obtained according to the m ⁇ k order deadlock matrix.
  • the i ⁇ i order sub-matrices include: selecting the number of i rows and i columns in the m ⁇ k order deadlock matrix, and selecting from the selected i rows and i columns, and simultaneously included in the i rows and i columns. Number i ⁇ i order matrix; selection i ⁇ i order matrix, get i ⁇ i order matrix.
  • FIG. 8 is a schematic diagram of another 3 ⁇ 3 matrix generated by FIG. 7 according to an embodiment of the present invention.
  • FIG. 10 is a schematic diagram of still another 3 ⁇ 3 matrix generated by FIG. 7 according to an embodiment of the present invention.
  • FIG. 11 is a schematic diagram of another 3 ⁇ 3 matrix generated by FIG. 7 according to an embodiment of the present invention.
  • the number of the first column, the second column, and the third column in the three rows and four columns of the 3 ⁇ 4 order deadlock matrix is selected, and the selected number is selected in three rows and four columns.
  • the number in the first column, the second column, and the third column of the number generates a 3 ⁇ 3 order matrix; as shown in FIG.
  • the first of the three rows and four columns of the 3 ⁇ 4 order deadlock matrix is selected.
  • the number of the column, the third column, and the fourth column is selected from the selected number and the number of the first column, the third column, and the fourth column included in the three rows and four columns simultaneously generates a 3 ⁇ 3 order a matrix; as shown in FIG. 10, the number of the first column, the second column, and the fourth column in the three rows and four columns of the 3 ⁇ 4 order deadlock matrix is selected, from the selected number Select a number in the first column, the second column, and the fourth column of the three rows and four columns to generate a 3 ⁇ 3 matrix; as shown in FIG. 11, select a 3 ⁇ 4 order deadlock matrix.
  • the number of the second column, the third column, and the fourth column in the three rows and four columns, and the second column, the third column, and the fourth column of the three rows and four columns are selected from the selected number.
  • the number in the number produces a 3 ⁇ 3 order matrix.
  • Step 305b the device for preventing bus deadlock from The i ⁇ i order deadlock matrix is selected in the i ⁇ i order submatrices.
  • the i ⁇ i order deadlock matrix is selected from the i ⁇ i order submatrices.
  • an i ⁇ i order submatrix satisfying at least two first identifiers in each row and each column is selected as an i ⁇ i order deadlock matrix.
  • Step 305c The device for preventing bus deadlock determines whether the i ⁇ i-order deadlock matrix is the simplest deadlock matrix.
  • determining whether the i ⁇ i-order deadlock matrix is the simplest deadlock matrix is to see whether each row and each column of the i ⁇ i-order deadlock matrix exists and only two first identifiers exist.
  • Step 305d If the i ⁇ i order deadlock matrix is not the simplest deadlock matrix, the device for preventing bus deadlock converts the i ⁇ i order deadlock matrix into the simplest deadlock matrix.
  • the redundant first identifier in the row or column in which the i ⁇ i-order deadlock matrix has more than two first identifiers is set to the second.
  • the identifier is such that there are only two first identifiers for each row and each column of the i ⁇ i-order deadlock matrix, and the simplest deadlock matrix is obtained.
  • the i ⁇ i order deadlock matrix is not the simplest deadlock matrix (ie, the number NE of the first identifier is greater than 2i)
  • the i ⁇ i order deadlock matrix is actually converted into the simplest deadlock matrix.
  • the i ⁇ i-order deadlock matrix after a certain first identifier is set to the second identifier by the exhaustive method is listed one by one, and for an i ⁇ i-order deadlock matrix, it can be listed.
  • the m ⁇ k order deadlock matrix is not the simplest deadlock matrix
  • the m ⁇ k order deadlock matrix is processed step by step, and finally the i ⁇ i order is the simplest dead.
  • the lock matrix according to the dynamic routing table and the simplest deadlock matrix to determine whether the bus will generate a deadlock; if the bus will generate a deadlock, determine and block the write address command causing the deadlock; this can effectively identify the occurrence of the
  • the write address command of the potential deadlock risk in turn, specifically blocks the write address command that will cause the bus deadlock, thereby achieving the purpose of preventing the bus deadlock, and avoiding the data throughput caused by the unified anti-deadlock mechanism.
  • the problem of reduction increases the data transmission efficiency of the bus.
  • the status information of the write command includes an interface name of the source interface, an interface name of the destination interface, information of the first timing convergence register slice, and information of the second timing convergence register slice, wherein the information of the first timing convergence register slice is The information of the timing convergence register slice that the address command is to pass from the source interface to the transmission path of the destination interface, and the information of the second timing convergence register slice is the information of the timing convergence register slice that the current address write address command has passed, and the source interface is The slave interface connected to the master that sends the write address command.
  • the destination interface is the master interface connected to the slave that receives the write address command.
  • FIG. 12 is a schematic structural diagram of an Interconnect module cascaded according to the present invention. As shown in FIG. 12, the Interconnect module cascaded system has two Interconnect modules (bus matrix), which are a bus matrix 0 and a bus matrix respectively. 1.
  • a Swich structure is composed of Slave interface 00, Slave interface 01, Master interface 00 and Master interface 01; in the bus matrix 1, it is composed of Slave interface 10, Slave interface 11, Master interface 10 and Master interface 11.
  • a Swich structure is composed of Slave interface 00, Slave interface 01, Master interface 00 and Master interface 01; in the bus matrix 1, it is composed of Slave interface 10, Slave interface 11, Master interface 10 and Master interface 11.
  • Master has 3 Master0, Master1 and Master2, Slave also has three, Slave0, Slave1 and Slave2; Master0 sends a write command to Slave0 through bus matrix 0, and sends a write address command to Slave1 through bus matrix 0 and bus matrix 1; Master1 sends a write command to Slave0 through bus matrix 0, and sends a write command to Slave1 through bus matrix 0 and bus matrix 1; Master2 sends write commands to Slave1 and Slave2 through bus matrix 1, respectively.
  • timing convergence register slice 0 timing convergence register slice
  • timing convergence register slice 1 timing convergence register slice
  • Master interface 01 timing convergence register
  • timing closure register slice 3 timing closure register slice
  • timing closure register slice timing convergence register slice 4
  • the dynamic routing table established according to the system of the Interconnect module cascade shown in FIG. 12 is as shown in Table 1, wherein the delay coordinate Regj(i) represents the information of the first timing convergence register slice and the second timing convergence register slice.
  • Information, i indicates the sequence number of the converged register slice on the path (starting from 0), and j indicates the label of the corresponding timing closure register slice.
  • FIG. 13 is a schematic flowchart diagram of another method for preventing bus deadlock according to an embodiment of the present invention.
  • the bus is determined according to a dynamic routing table and a simple deadlock matrix. Will there be a deadlock, including:
  • Step 401 The device for preventing bus deadlock acquires, according to the simple deadlock matrix and the dynamic routing table, a sending moment at which the master sends a write address command to the slave.
  • the step 401 includes: acquiring information of the second timing convergence register slice of the write address command in the dynamic routing table according to the simplest deadlock matrix; acquiring time information of the current time; and converge according to the current time information and the second timing
  • the information of the register slice calculates the transmission time at which the Master sends a write address command to the slave.
  • each timing convergence register slice is certain, so it is only necessary to obtain the current time information and then obtain the current time.
  • the transmission timing of the write-write address command can be reversed.
  • Step 402 The device for preventing bus deadlock acquires a delay in a path of the write address command sent by the master to the slave according to the simple deadlock matrix and the dynamic routing table.
  • the step 402 includes: acquiring information of the first timing convergence register slice in the dynamic routing table according to the simplest deadlock matrix; and calculating the master according to the information of the first timing convergence register fragment. The delay in the path of the sent write address command to the slave.
  • the information of the timing convergence register slice that the write address command needs to pass in the transmission path can be obtained, and the register fragment is converge according to the timing that needs to pass in the transmission path.
  • the information can be used to calculate the delay of the write address command in the transmission path.
  • Step 403 The device for preventing the bus deadlock determines whether the relationship between the master and the slave meets the deadlock feature according to the sending moment of the write address command and the delay in the path; wherein the deadlock feature is the first master first a slave sends a first write address command, and then sends a second write address command to the second slave; the second master first sends a third write address command to the second slave, and then sends a fourth write address command to the first slave; and The second write address command arrives at the second slave before the third write address command; the fourth write address command arrives at the first slave before the first write address command.
  • the arrival time of the write address command can be calculated according to the transmission time of the write address command plus the delay in the transmission path of the write address command.
  • the step 403 includes: determining whether the sending time of the first master sending the first write address command to the first slave is smaller than the sending time of the first master sending the second write address command to the second slave; determining that the second master is the second Whether the sending time of the third write address command sent by the slave is smaller than the sending time of the fourth write address command sent by the second master to the first slave; determining whether the arrival time of the second write address command reaching the second slave is less than the third write address command When the arrival time of the second slave is reached, it is determined whether the arrival time of the fourth write address command to reach the first slave is less than the arrival time of the first write address command to reach the first slave; if the first master sends the second write address command to the second slave The sending time is greater than the sending time at which the first master sends the first write address command to the first slave, and the arrival time of the second write address command reaching the second slave is less than the arrival time of the third write address command reaching the second slave, and The second master sends a fourth write address command to the first
  • FIG. 14 is a simplified deadlock matrix according to an embodiment of the present invention. Taking FIG. 14 as an example, the deadlock feature is:
  • FIG. 15 is a schematic diagram of the cyclic dependency relationship of the deadlock generated in FIG. 14 according to the embodiment. As shown in FIG. 15, W10 waits for W20, W20 waits for W23, W23 waits for W03, W03 waits for W01, W01 waits for W31, and W31 waits for W32. W32 waits for W12, W12 waits for W10, and the bus transmission is deadlocked.
  • the relationship between the Master and the Slave represented by any M*N-order deadlock matrix may satisfy the deadlock feature.
  • the manifestation of the deadlock feature varies with the order of the deadlock matrix and the Master and The specific relationship between Slave is different.
  • Step 404 If the relationship between the Master and the Slave satisfies the deadlock feature, the device that prevents the bus deadlock determines that the bus will generate a deadlock.
  • the method for preventing bus deadlock establishes a dynamic routing table for recording state information of a write address command issued by the master but not yet reaching the slave; generating a relationship matrix according to the relationship between the master and the slave; determining the relationship matrix Whether it is the simplest deadlock matrix; Array is not the simplest deadlock matrix, the relation matrix is converted into the simplest deadlock matrix; according to the dynamic routing table and the simplest deadlock matrix to determine whether the bus will generate a deadlock; if the bus will produce a deadlock, determine and block the deadlock Write address command; this can effectively identify the write address command that is at risk of potential deadlock, and thus specifically block the write address command that will cause the bus deadlock, thus achieving the purpose of preventing bus deadlock.
  • the problem of reducing the data throughput caused by adopting the unified anti-deadlock mechanism is avoided, and the data transmission efficiency of the bus is improved.
  • the dynamic routing table may further include information of the aggregation interface, where the aggregation interface is an interface where two or more transmission paths are aggregated.
  • the information of the convergence interface and the third timing convergence access information are added, wherein the information of the third timing convergence register slice is the information of the timing convergence register slice that the write address command reaches the convergence interface.
  • Table 2 The dynamic routing table established according to the system in which the Interconnect module is cascaded as shown in FIG. 12 is as shown in Table 2.
  • FIG. 16 is a schematic diagram of another Interconnect module cascaded according to the present invention.
  • AW11 arrives at the position in the figure; at this time, Master2 sends AW20 to Slave1 because of the transmission path.
  • the delay, AW20 will arrive at the shadow-filled Master interface in the picture before AW11, so the path between AW11 and the interface will be blocked, and the delay of AW11 reaching the destination Slave1 becomes uncontrollable.
  • the new write address command affects the relationship between the current write address commands: if the new write address command and the current write address command are aggregated on a certain aggregation interface, it is necessary to judge the new according to the dynamic routing table. Whether the write address command advances to the aggregation interface in advance (or at the same time) the current write address command, and if so, updates all previous write address commands of the aggregation interface on the transmission path to the delay in the transmission path to the original transmission. The sum of the delay in the path and the increment T, where the increment T is preset according to the actual situation; otherwise, the delay in the transmission path of the new write address command is set to ⁇ ; then it is judged whether the bus will die. lock.
  • the method for preventing bus deadlock may further comprise setting a time margin for preventing deadlock, thereby improving the robustness of the anti-deadlock mechanism for preventing the bus deadlock method.
  • it is determined whether the system bus will be deadlocked including: determining whether the system bus will deadlock according to the dynamic routing table, the time margin for preventing deadlock, and the relationship matrix.
  • the dynamic routing table dimension increases sharply, which directly leads to a geometric multiplication of the decision complexity of the simplest deadlock subarray.
  • the conditions for the master to send the write address command can be appropriately tightened.
  • the same master can only initiate write transmission to M slaves at the same time, thereby reducing the dimension of the dynamic routing table and making the computational complexity controllable.
  • the subsystem with high transmission efficiency is required to use the bus deadlock method provided by the present invention;
  • the NIS400 inherent SAS machine can be used.
  • the NIC400 can also be used to apply the outstanding transfer access mechanism between the AW channel and the W channel inherent in the master interface of a single matrix (up to only two AW handshakes are successful but the W channel does not fully transmit the successful transmission). Achieve the decomposition of the entire system to achieve the purpose of dimensionality reduction.
  • FIG. 17 is a flowchart of a method for preventing bus deadlock according to an embodiment of the present invention.
  • the method includes: firstly, a relationship between a Master and a Slave is represented as a relationship matrix, and then determining whether the relationship matrix includes the simplest dead.
  • the lock matrix if the relationship matrix does not contain the simplest deadlock matrix, release the write address command sent by the master to the slave, and if the relation matrix contains the simplest deadlock matrix, the relationship matrix is decomposed into one or more minimal deadlock matrices. Then, it is determined whether each of the simplest deadlock matrices satisfies the deadlock feature. If one or more of the simplest deadlock matrices satisfy the deadlock feature, the corresponding write address command that generates the deadlock is blocked.
  • the method for preventing bus deadlock in the embodiment provides a relationship between a Master and a Slave as a relationship matrix, and then determines whether the relationship matrix includes a minimal deadlock matrix, and then determines and blocks the deadlock according to the simplest deadlock matrix blocking.
  • Write address command can effectively identify the write address command that is at risk of potential deadlock, and thus specifically block the write address command that will cause the bus deadlock, thus achieving the purpose of preventing bus deadlock.
  • the problem of reducing the data throughput caused by the unified anti-deadlock mechanism is avoided, and the data transmission efficiency of the bus is improved.
  • FIG. 18 is still another schematic flowchart of a method for preventing bus deadlock according to an embodiment of the present invention. As shown in FIG. 18, the method includes:
  • Step 501 The device for preventing bus deadlock establishes a dynamic routing table.
  • the dynamic routing table is configured to record status information of a write address command sent by the master but not yet reach the slave.
  • Step 502 The device for preventing bus deadlock determines whether the relationship between the master and the slave exists in a pre-sentence situation according to the dynamic routing table; wherein, after the first transmission, the first master sends a first write address command to the first slave. The sending time is less than the second master sends the first slave The transmission time of the second write address command is sent, and the arrival time of the first write address command reaching the first slave is greater than the arrival time of the second write address command reaching the first slave.
  • Step 503 If the relationship between the master and the slave is pre-emptive to the situation, the device for preventing the bus deadlock generates the incremental relationship matrix according to the second write address command, the third write address command, and the fourth write address command;
  • the third write address command is an address command sent to the second slave and transmitting a time instant greater than a transmission time of the second write address command; and the fourth write address command is an address command having a transmission time greater than the third write address command.
  • the relationship between the master and the slave is in the first instance, the relationship between the master and the slave indicated by the second write address command, the third write address command, and the fourth write address command is determined;
  • the relationship between the Master and the Slave is that the Master sends a write address command to the Slave, and sets a first identifier in the corresponding position of the incremental relationship matrix; if the relationship between the Master and the Slave is that the Master does not send a write address command to the Slave, the increase is The corresponding position of the quantity relationship matrix sets the second identifier.
  • the transmission time of the write address command AW ij (indicating the AW command sent from Masteri to Slavej) precedes the transmission time of another write address command AW kj (indicating the command sent by Masterk to Slavej)
  • it will be sent to Slavej transmission time and the transmission time is later than the write address AW kj command ⁇ Tmj> Tkj AW mj (third write address commands), and sent to the Slave and transmits any time later than the time of the write address AW mj send command ⁇ Tmk >Tmj AW mk (fourth write address command)
  • the relationship between Master and Slave represented by AW kj (second write address command) is represented by the first identifier at the corresponding position of the incremental relationship matrix.
  • Step 504 The device for preventing bus deadlock determines whether the bus generates a deadlock according to the incremental relationship matrix.
  • the step 504 includes: determining whether each row and each column of the incremental relationship matrix respectively have at least two first identifiers; if each row and each column of the incremental relationship matrix respectively have at least two first identifiers, Determine if the bus will generate a deadlock.
  • Step 505 If the bus generates a deadlock, the device that prevents the bus deadlock determines and blocks the write address command that caused the deadlock.
  • the method for preventing bus deadlock establishes state information for recording a write address command sent by the master but has not yet reached the slave; and determining whether the relationship between the master and the slave exists after the first occurrence according to the dynamic routing table. If the relationship between the Master and the Slave exists first-hand, the incremental relationship matrix is generated according to the second write address command, the third write address command, and the fourth write address command; and then the bus is broken according to the incremental relationship matrix.
  • Whether a deadlock will occur determine and block the write address command that caused the deadlock; this can effectively identify the write address command that is at risk of potential deadlock in a simple way, thereby specifically preventing the bus from being caused
  • the write address command of the deadlock realizes the purpose of preventing the bus deadlock, and avoids the problem of reducing the address throughput caused by adopting the unified anti-deadlock mechanism, and improves the address transmission efficiency of the bus.
  • FIG. 19 is another flowchart of a method for preventing bus deadlock according to an embodiment of the present invention. As shown in FIG. 19, the method includes: first determining whether a relationship between a master and a slave exists after a pre-emptive situation, if not There is a write address command sent by the Master to the Slave. If it exists, an incremental relationship matrix is established, and then the bus is determined to be deadlocked according to the incremental relationship matrix. If it is determined that a deadlock occurs, the corresponding write address command is blocked.
  • FIG. 20 is a schematic diagram of an emergency mechanism for preventing bus deadlock according to an embodiment of the present invention.
  • the mechanism is configured to cope with an unreasonable parameter setting of an Interconnect module (eg, an Outstanding depth of an entry is greater than an Outstanding depth in a path), which may occur.
  • an unreasonable parameter setting of an Interconnect module eg, an Outstanding depth of an entry is greater than an Outstanding depth in a path
  • the mechanism includes: determining whether the self-blocking occurs by the bus.
  • FIG. 21 is a schematic structural diagram of another apparatus for preventing bus deadlock according to an embodiment of the present invention. As shown in FIG. 21, the apparatus 6 includes:
  • the pre-processing module 61 is configured to establish a dynamic routing table, where the dynamic routing table is used to record status information of a write address command sent by the master device but not yet reaching the slave device Slave;
  • the determining module 62 is configured to determine, according to the dynamic routing table, whether the bus generates a deadlock
  • the processing module 63 is configured to determine and block the write address command that caused the deadlock if the bus generates a deadlock.
  • the device for preventing bus deadlock establishes a dynamic routing table for recording status information of a write address command issued by the master but not yet reaching the slave; determining whether the bus will generate a deadlock according to the dynamic routing table; Generate a deadlock, determine and block the write address command that caused the deadlock; this can effectively identify the write address command that is at risk of potential deadlock, and thus specifically block the write address command that will cause the bus deadlock.
  • the purpose of preventing the bus deadlock is achieved, and the problem of reducing the address throughput caused by adopting the unified anti-deadlock mechanism is avoided, and the address transmission efficiency of the bus is improved.
  • FIG. 22 is a schematic structural diagram of another apparatus for preventing bus deadlock according to an embodiment of the present invention.
  • the determining module 62 includes:
  • the first processing unit 621 is configured to generate a relationship matrix according to the relationship between the master and the slave; wherein, if the master sends a write address command to the slave, the corresponding position of the relationship matrix is the first identifier, if the master does not send the write address command to the slave The corresponding position of the relationship matrix is the second identifier;
  • the first determining unit 622 is configured to determine whether the bus generates a deadlock according to the dynamic routing table and the relationship matrix.
  • the first determining unit 622 is configured to determine whether the relationship matrix is a deadlock matrix;
  • the deadlock matrix is a matrix in the relation matrix that can cause the bus to deadlock; if the relation matrix is a deadlock matrix, it is determined whether the deadlock matrix is the simplest deadlock matrix; wherein the simplest deadlock matrix is in the deadlock matrix
  • the bus that can make the bus deadlock and the simplest form; if the deadlock matrix is not the simplest deadlock matrix, convert the deadlock matrix into the simplest deadlock matrix; determine whether the bus is based on the dynamic routing table and the simplest deadlock matrix Will produce a deadlock.
  • the first determining unit 622 is further configured to determine whether each row and each column of the relationship matrix respectively have at least two first identifiers; if each row and each column of the relationship matrix respectively have at least two first identifiers, determining that the relationship matrix is Deadlock matrix; if there is no at least 2 first identifiers in a row or a column of the relationship matrix, it is determined that the relationship matrix is not a deadlock matrix.
  • the first determining unit 622 is further configured to: if the relationship matrix is a deadlock matrix, determine whether each row and each column of the deadlock matrix have two first identifiers; if each row and each column of the relationship matrix has two An identifier determines that the deadlock matrix is the simplest deadlock matrix; if there are more than two first identifiers in a row or a column of the relationship matrix, it is determined that the deadlock matrix is not the simplest deadlock matrix.
  • the first determining unit 622 is further configured to obtain, if the m ⁇ k order deadlock matrix is not the simplest deadlock matrix, according to the m ⁇ k order deadlock matrix.
  • the i ⁇ i order deadlock matrix is selected in the i ⁇ i order submatrix; whether the i ⁇ i order deadlock matrix is the simplest deadlock matrix; if the i ⁇ i order deadlock matrix is not the simplest deadlock matrix, The i ⁇ i order deadlock matrix is converted into the simplest deadlock matrix.
  • the first determining unit 622 is further configured to select the number of i rows and i columns in the m ⁇ k order deadlock matrix if the m ⁇ k order deadlock matrix is not the simplest deadlock matrix, from the selected i rows and i Select the number in the i row and the i column and generate the i ⁇ i order matrix from the number of columns; i ⁇ i order matrix, get i ⁇ i order matrix.
  • the first determining unit 622 is further configured to: if the i ⁇ i order deadlock matrix is not the simplest deadlock matrix, the first row or column in the i ⁇ i order deadlock matrix has more than two first identifiers.
  • the identifier is set to the second identifier, so that each row and each column of the i ⁇ i-order deadlock matrix has two first identifiers, The simplest deadlock matrix.
  • the status information of the write address command includes an interface name of the source interface, an interface name of the destination interface, information of the first timing convergence register slice, and information of the second timing convergence register slice, wherein the information of the first timing convergence register slice is The information of the timing convergence register slice that the address command is to pass from the source interface to the transmission path of the destination interface, and the information of the second timing convergence register slice is the information of the timing convergence register slice that the current address write address command has passed, and the source interface is The slave interface connected to the master that sends the write address command.
  • the destination interface is the master interface connected to the slave that receives the write address command.
  • FIG. 23 is a schematic structural diagram of another apparatus for preventing bus deadlock according to an embodiment of the present invention.
  • the processing module 63 includes:
  • the obtaining unit 631 is configured to obtain, according to the simplest deadlock matrix and the dynamic routing table, a sending moment that the master sends a write address command to the slave; and obtain a write address command sent by the master to obtain a path of the slave according to the simple deadlock matrix and the dynamic routing table. Delay
  • the second determining unit 632 is configured to determine, according to the sending time of the write address command and the delay in the path, whether the relationship between the master and the slave meets the deadlock feature; wherein the deadlock feature is sent by the first master to the first slave. a first write address command, followed by a second write address command to the second slave; the second master first sends a third write address command to the second slave, and then sends a fourth write address command to the first slave; and the second write address The command arrives at the second slave before the third write address command; the fourth write address command arrives at the first slave before the first write address command.
  • the second processing unit 633 is configured to determine that the bus will generate a deadlock if the relationship between the Master and the Slave satisfies the deadlock feature.
  • the obtaining unit 631 is configured to obtain information of the second timing convergence register slice of the write address command in the dynamic routing table according to the simplest deadlock matrix; acquire time information of the current time; and time information according to the current time and the second timing convergence register
  • the information of the slice calculates the transmission time at which the master sends a write address command to the slave. Get the first time in the dynamic routing table according to the simplest deadlock matrix
  • the sequence converges the information of the register slice; and calculates the delay in the transmission path of the write address command sent by the master to the slave according to the information of the first timing convergence register slice.
  • the second determining unit 632 is configured to determine whether the sending time of the first write address command sent by the first master to the first slave is smaller than the sending time of the second write address command sent by the first master to the second slave; Whether the sending time of the second slave address command is less than the sending time of the fourth write address command sent by the second master to the first slave; determining whether the arrival time of the second write address command reaching the second slave is less than the third write address When the command reaches the arrival time of the second slave, determining whether the arrival time of the fourth write address command reaching the first slave is less than the arrival time of the first write address command reaching the first slave;
  • the sending time of the first write address command sent by the first master to the second slave is greater than the sending time of the first write address command sent by the first master to the first slave, and the arrival time of the second write address command reaching the second slave is less than the The third write address command arrives at the arrival time of the second slave; and, the second master sends the fourth write address command to the first slave, the transmission time is greater than the second master sends the third write address command to the second slave, and the fourth The time at which the write address command arrives at the first slave is less than the time at which the first write address command arrives at the first slave; it is determined that the relationship between the master and the slave satisfies the deadlock feature.
  • the device for preventing bus deadlock establishes a dynamic routing table for recording state information of a write address command sent by the master but not yet reaching the slave; generating a relationship matrix according to the relationship between the master and the slave; determining the relationship matrix Whether it is the simplest deadlock matrix; if the relational matrix is not the simplest deadlock matrix, the relational matrix is converted into the simplest deadlock matrix; according to the dynamic routing table and the simplest deadlock matrix, it is judged whether the bus will generate a deadlock; Generate a deadlock, determine and block the write address command that caused the deadlock; this can effectively identify the write address command that is at risk of potential deadlock, and thus specifically block the write address command that will cause the bus deadlock.
  • the purpose of preventing the bus deadlock is achieved, and the problem of reducing the data throughput caused by the unified anti-deadlock mechanism is avoided, and the data transmission efficiency of the bus is improved.
  • FIG. 24 is a schematic structural diagram of another apparatus for preventing bus deadlock according to an embodiment of the present invention.
  • the determining module 62 includes:
  • the third determining unit 623 is configured to determine, according to the dynamic routing table, whether the relationship between the master and the slave exists after the first transmission; wherein, after the first transmission, the first master sends the first write address command to the first slave.
  • the sending time is less than the sending time at which the second master sends the second write address command to the first slave, and the arrival time of the first write address command reaching the first slave is greater than the arrival time of the second write address command reaching the first slave; Whether the incremental relationship matrix breaks the bus to generate a deadlock;
  • the third processing unit 624 is configured to generate an incremental relationship matrix according to the second write address command, the third write address command, and the fourth write address command, if the relationship between the master and the slave is pre-emptive to the situation;
  • the third write address command is an address command sent to the second slave and transmitting a time instant greater than the transmission time of the second write address command; and the fourth write address command is an address command having a transmission time greater than the third write address command.
  • the third processing unit 624 is configured to determine that the relationship between the master and the slave has a pre-send condition, and determine the master and slave respectively indicated by the second write address command, the third write address command, and the fourth write address command. If the relationship between the master and the slave is that the master sends a write address command to the slave, the first identifier is set at the corresponding position of the incremental relationship matrix; if the relationship between the master and the slave is that the master does not send the write to the slave The address command sets a second identifier at a corresponding position of the incremental relationship matrix. .
  • the third determining unit 623 is configured to determine whether each row and each column of the incremental relationship matrix respectively have at least two first identifiers; if each row and each column of the incremental relationship matrix respectively have at least two first identifiers Determine if the bus will generate a deadlock.
  • the device for preventing bus deadlock establishes state information for recording a write address command sent by the master but has not yet reached the slave; and determining whether the relationship between the master and the slave exists after the first occurrence according to the dynamic routing table. If the relationship between Master and Slave exists After the first transmission to the situation, the incremental relationship matrix is generated according to the second write address command, the third write address command, and the fourth write address command; and further, according to the incremental relationship matrix, whether the bus will generate a deadlock, determine and block A write address command that causes a deadlock; this can effectively identify a write address command that is at risk of a potential deadlock in a simple way, thereby specifically preventing a write address command that would cause a bus deadlock, thereby implementing
  • the purpose of preventing bus deadlock is to avoid the problem of data throughput reduction caused by adopting a unified anti-deadlock mechanism, and improve the data transmission efficiency of the bus.
  • the determining unit 632 and the second processing unit 633 may each be a central processing unit (CPU), a microprocessor (Micro Processor Unit (MPU), and a digital signal processor (Digital Signal Processor) located in the management device of the cache space. , DSP) or Field Programmable Gate Array (FPGA) implementation.
  • CPU central processing unit
  • MPU Micro Processor Unit
  • DSP Digital Signal Processor
  • FPGA Field Programmable Gate Array
  • FIG. 25 is a schematic structural diagram of another apparatus for preventing bus deadlock according to an embodiment of the present invention. As shown in FIG. 25, the apparatus 7 includes:
  • the Interconnect module 71 is configured to run a write address command sent by the Master to the Slave.
  • the monitoring module 72 is configured to monitor the operation of the Interconnect system module 71.
  • the determining module 73 is configured to determine whether a bus deadlock is generated in the Interconnect system according to the condition monitored by the monitoring module 72.
  • the blocking module 74 is configured to block a write address command that causes a bus deadlock.
  • the Interconnect module 71, the monitoring module 72, the judging module 73, and the blocking module 74 can be implemented by a CPU, an MPU, a DSP, an FPGA, or the like located in a management device of the cache space.
  • the method for reducing the delay is implemented in the form of a software function module
  • the law when sold or used as a stand-alone product, can also be stored on a computer readable storage medium.
  • the technical solution of the embodiments of the present invention may be embodied in the form of a software product in essence or in the form of a software product stored in a storage medium, including a plurality of instructions.
  • a computer device (which may be a personal computer, server, or network device, etc.) is caused to perform all or part of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read only memory (ROM), a magnetic disk, or an optical disk.
  • program codes such as a USB flash drive, a mobile hard disk, a read only memory (ROM), a magnetic disk, or an optical disk.
  • the embodiment of the present invention further provides a computer storage medium, where the computer storage medium stores a computer program for performing the above method for preventing bus deadlock in the embodiment of the present invention.
  • embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention can take the form of a hardware embodiment, a software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
  • These computer program instructions can also be stored in a bootable computer or other programmable data processing
  • the apparatus is readable in a computer readable memory in a particular manner such that instructions stored in the computer readable memory produce an article of manufacture comprising instruction means implemented in one or more flows and/or block diagrams of the flowchart The function specified in the box or in multiple boxes.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
  • the embodiment of the present invention establishes a dynamic routing table, wherein the dynamic routing table is used to record state information of a write address command sent by the master device but not reaching the slave device Slave; and determining whether the bus is dead according to the dynamic routing table. a lock; if the bus generates a deadlock, the write address command that caused the deadlock is determined and blocked. In this way, the write address command that causes the bus deadlock can be blocked in a targeted manner, thereby preventing the bus deadlock, and avoiding the problem of reducing the data throughput caused by the unified anti-deadlock mechanism, and improving the bus. Data transmission efficiency.

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)
  • Bus Control (AREA)
  • Multi Processors (AREA)

Abstract

Provided is a method for avoiding the deadlock of a bus, the method comprising: establishing a dynamic routing table (101); determining whether deadlock may occur with regard to a bus according to the dynamic routing table (102); and if deadlock may occur with regard to the bus, determining and blocking a write address command causing the deadlock (103). Also provided are a device for avoiding the deadlock of a bus, and storage medium.

Description

一种防止总线死锁的方法、装置及存储介质Method, device and storage medium for preventing bus deadlock

相关申请的交叉引用Cross-reference to related applications

本申请基于申请号为201611160596.7、申请日为2016年12月15日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。The present application is filed on the basis of the Chinese Patent Application Serial No. No. No. No. No. No. No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No

技术领域Technical field

本发明涉及高性能芯片设计领域,尤其涉及一种防止总线死锁的方法、装置及存储介质。The present invention relates to the field of high performance chip design, and in particular, to a method, device and storage medium for preventing bus deadlock.

背景技术Background technique

AXI(Advanced eXtensible Interface)总线协议是由ARM公司提出一种高性能高带宽的片上总线协议,在片上系统(system-on-chip,SOC)中被广泛采用。AXI总线采取读-写分离,地址/控制与数据分离的传输机制,通过定义读地址通道(AR),读数据通道(R),写地址通道(AW),写数据通道(W),写响应通道(B)五个独立的传输通道,很大程度上提高了传输效率。在基于AXI总线协议的SOC中,多主设备(Master)和多从设备(Slave)之间常通过总线互联Interconnect模块(也称为总线矩阵,即Bus Matrix)实现数据交换。SOC常常由多个Interconnect模块级联构成。Interconnect模块兼容AXI协议所支持的Outstanding传输访问和乱序(Out-of-Order,OoO)访问机制,这在一方面提升了传输吞吐率,但在另一方面,也增加了总线死锁的风险,尤其是在多级Interconnect模块级联的总线系统中。AXI (Advanced eXtensible Interface) bus protocol is a high performance and high bandwidth on-chip bus protocol proposed by ARM. It is widely used in system-on-chip (SOC). The AXI bus adopts a read-write separation, address/control and data separation transmission mechanism by defining a read address channel (AR), a read data channel (R), a write address channel (AW), a write data channel (W), and a write response. Channel (B) five independent transmission channels, greatly improving transmission efficiency. In the SOC based on the AXI bus protocol, data exchange between the multi-master device (Master) and the multi-slave device (Slave) is often performed through a bus interconnect Interconnect module (also known as a bus matrix). The SOC is often composed of multiple Interconnect modules cascaded. The Interconnect module is compatible with the Outstanding Transport Access and Out-of-Order (OoO) access mechanisms supported by the AXI protocol, which improves the transmission throughput on the one hand, but also increases the risk of bus deadlock on the other hand. Especially in the bus system cascaded by multi-level Interconnect modules.

在AXI传输中,Master用ID号来标记每一次传输,Interconnect模块通过 扩展每一个Master的ID号以区分不同的Master,对于同一个Master用同一个ID号发出不同的传输,不同的传输必须按照顺序进行,而Slave可以以OoO的方式返回不同ID号的传输。这种机制在多Master同时访问多Slave时可能形成握手信号之间的循环依赖(Cyclic Dependence),从而造成死锁,由于这类死锁是由于Slave在响应通道的乱序机制引起的,故将这类死锁称为“反向通道死锁”。在现有的Interconnect模块级联组成的系统中,反向通道死锁可以通过单Slave(Single Slave)或相同ID仅可用于单一Slave(Single Slave Per ID)的机制进行规避,其中,Single Slave Per ID机制在CN102103560A中有相应的描述。In AXI transmission, the Master marks each transmission with an ID number, and the Interconnect module passes The ID number of each Master is extended to distinguish different Masters. For the same Master, different transmissions are sent with the same ID number. Different transmissions must be performed in order, and the Slave can return the transmission of different ID numbers in OoO mode. This mechanism may form a Cyclic Dependence between handshake signals when multiple Masters access multiple Slaves at the same time, resulting in deadlocks. This type of deadlock is caused by Slave's out-of-order mechanism in response channels. This type of deadlock is called a "reverse channel deadlock." In the system composed of the existing Interconnect module cascade, the reverse channel deadlock can be circumvented by a single Slave (Single Slave) or the same ID can be used only for a single Slave (Single Slave Per ID) mechanism, wherein Single Slave Per The ID mechanism is described in CN102103560A.

同时,而在Interconnect模块级联组成的系统中,虽然AXI协议的outstanding传输访问机制允许Master无需等待上一笔写数据命令完成,就可以发出下一笔写数据命令;但实际中的绝大多数Slave并不支持写间插(write interleave)操作(事实上,AXI 4.0协议也取消了对write interleave的支持),即对于同一个slave,只有当一次传输的写数据接收完毕后,才被允许接收下一次传输的写数据。换句话说,尽管一个Master可以同时在AW通道发起多个地址/控制命令来协商对多个Slave的访问权,但在一个传输周期内,一个Slave只允许和唯一的,被赋予了访问权的Master在W通道进行数据交换。由于以上机制的作用,在多Master多Slave数据交换中,还存在着另一种死锁的风险,即“前向通道死锁”。At the same time, in the system composed of Interconnect module cascade, although the outstanding transmission access mechanism of AXI protocol allows the Master to issue the next write data command without waiting for the previous write data command to complete, the vast majority of the actual Slave does not support write interleave operations (in fact, the AXI 4.0 protocol also eliminates support for write interleave), that is, for the same slave, it is only allowed to receive when the write data of one transmission is received. Write data for the next transfer. In other words, although a Master can initiate multiple address/control commands on the AW channel to negotiate access to multiple slaves, a Slave is only allowed and unique, and is granted access during a transmission cycle. The Master exchanges data on the W channel. Due to the above mechanism, in the multi-master multi-Slave data exchange, there is another risk of deadlock, that is, "forward channel deadlock".

图1为现有技术一种典型的“前向通道死锁”示意图。在起始时刻T0,Master0向Slave1和Slave0依次并连续发出了AW01和AW00两笔写地址命令;同时,Master1向Slave0和Slave1依次并连续发出了AW10和AW11两笔写地址命令;由于Slave接口0和Master接口0之间的路径延迟小于SLAVE接口1和Master接口0之间的路径延迟,所以,AW00后发先至,先于AW10抵达Slave0,并获得对Master接口0的访问权,此时,Master接口0打开W通道,等待写数 据命令W00;同理,由于Slave接口1和Master接口1之间的路径延迟小于Slave接口0和Master接口1之间的路径延迟,AW11后发先至,先于AW01到达Slave1,并获得对Master接口1的访问权,此时Master接口1打开W通道,等待W11;因为在时间顺序上晚于W01,W00必须等待W01发送完毕才可以发往Master接口0;而此时,由于AW11占据了对Slave1的访问权,W01却只能等待W11发送完毕,才可以发往目的地Master接口1;同理,因为在时间顺序上晚于W10,W11必须等待W10发送完毕才可以发往目的地Master接口1;而此时由于AW00仍然占据对Slave0的访问权(W00一直处于等待状态),W10只能等待W00发送完毕才可以发往目的地Master接口0,于是,循环等待的局面形成。图2为图1产生死锁的循环依赖关系示意图,如图2所示,W00等待W01,W01等待W11,W11等待W10,W10等待W00,总线传输陷入死锁。FIG. 1 is a schematic diagram of a typical "forward channel deadlock" in the prior art. At the starting time T0, Master0 sequentially sends AW01 and AW00 two write address commands to Slave1 and Slave0 in sequence; at the same time, Master1 successively sends AW10 and AW11 two write address commands to Slave0 and Slave1 in sequence; since Slave interface 0 The path delay between the interface 0 and the master interface 0 is smaller than the path delay between the SLAVE interface 1 and the master interface 0. Therefore, the AW00 is sent first, and the AW10 arrives at the Slave0 and obtains access to the master interface 0. Master interface 0 turns on the W channel and waits for the number of writes. According to the command W00; similarly, since the path delay between the Slave interface 1 and the master interface 1 is smaller than the path delay between the Slave interface 0 and the master interface 1, the AW11 is sent first, before the AW01 arrives at the Slave1, and the master is obtained. Interface 1 access rights. At this time, Master interface 1 opens the W channel and waits for W11. Because it is later than W01 in time sequence, W00 must wait for W01 to send before it can send to Master interface 0. At this time, because AW11 occupies the right Slave1 access, W01 can only wait for W11 to be sent before it can be sent to the destination Master interface 1; similarly, because it is later than W10 in chronological order, W11 must wait for W10 to send before it can be sent to the destination Master interface. 1; At this time, since AW00 still occupies access to Slave0 (W00 is always in a waiting state), W10 can only wait for W00 to be sent before it can be sent to the destination Master interface 0, so the loop waiting situation is formed. 2 is a schematic diagram of the cyclic dependency of the deadlock generated in FIG. 1. As shown in FIG. 2, W00 waits for W01, W01 waits for W11, W11 waits for W10, W10 waits for W00, and the bus transmission is deadlocked.

为了防止AXI总线前向通道死锁,Interconnect模块采取了单一有效Slave(Single Active Slave,SAS)的机制。SAS机制规定interconnect模块的Slave接口只有当前一笔传输的写数据全部发送完毕之后,才能发起下一笔的写地址命令,从而避免了“当后一笔写传输的写地址命令抵达目的地后,前一笔的写数据仍然阻塞在Slave接口”这一形成前向死锁的必要条件。因此,在多级Switch结构的Interconnect模块以及多个Interconnect模块级联构成的系统中,常常采用单/每从设备ID(Single Provider ID,SPI)+SAS的机制,用来同时防止可能出现的前向与反向AXI总线死锁。In order to prevent the AXI bus forward channel deadlock, the Interconnect module adopts a single effective Slave (Slave Active Slave, SAS) mechanism. The SAS mechanism stipulates that the Slave interface of the interconnect module can only initiate the next write address command after all the write data of the current transmission has been sent, thereby avoiding the "when the write address command of the subsequent write transfer arrives at the destination, The previous write data still blocks the necessary conditions for the forward deadlock on the Slave interface. Therefore, in the system of the Interconnect module of the multi-level Switch structure and the cascading of multiple Interconnect modules, a single/single Provider ID (SPI)+SAS mechanism is often used to simultaneously prevent possible Deadlock to the reverse AXI bus.

SAS机制是以牺牲outstanding传输访问机制中AW通道的传输效率为代价的;对于某些Slave设备而言,更早的收到AW写地址命令(即使此时写数据并未抵达),可以将写响应操作的开销流程提前进行,比如双倍速率同步动态随机存储器(Double Data Rate,DDR)控制器,更早的收到AW写地址命令后可以提前进行行/列交错计算,从而减少写数据在W通道握手 的时间。从这个意义上来讲,SAS防死锁机制在一定程度上减少了总线传输的数据吞吐量并且降低了总线传输的数据效率。而对于常常需要将多个Interconnect模块进行级联来建构完整的总线互联的SOC,这无疑增加了各个主从设备路径延迟的差异性,也增加了前向总线死锁发生的概率。而增加这种前向总线死锁发生概率的路径延迟差异,往往并不体现在各Interconnect模块的内部通路上,而是体现在多个Interconnect模块的连接关系上;为了能够完全避免前向死锁,采取的办法常是在所有的Interconnect模块的Slave接口上添加SAS机制。而在实际的应用场景中,大量主从设备之间的数据交换是不存在死锁风险的,而分布式SAS节点的总线互联,由于无法识别出正在发生的访问是否具有潜在死锁风险,只是不加区分的对AW命令进行多次阻塞-放行-阻塞的操作,更加降低了总线的传输效率。The SAS mechanism is at the expense of the transmission efficiency of the AW channel in the outstanding transport access mechanism; for some slave devices, the AW write address command is received earlier (even if the write data does not arrive at this time), it can be written The overhead process of the response operation is advanced, such as a double rate synchronous dynamic random access memory (DDR) controller. The AW write address command can be used to perform row/column interleaving calculation in advance, thereby reducing write data. W channel handshake time. In this sense, the SAS anti-deadlock mechanism reduces the data throughput of the bus transmission to a certain extent and reduces the data efficiency of the bus transmission. For SOCs that often need to cascade multiple Interconnect modules to construct a complete bus interconnect, this undoubtedly increases the difference in path delay between each master and slave device, and increases the probability of forward bus deadlock. The difference in path delay for increasing the probability of such a forward bus deadlock is not reflected in the internal path of each Interconnect module, but in the connection relationship of multiple Interconnect modules; in order to completely avoid forward deadlock The approach taken is often to add a SAS mechanism to the Slave interface of all Interconnect modules. In the actual application scenario, there is no deadlock risk in the data exchange between a large number of master and slave devices, and the bus interconnection of distributed SAS nodes cannot identify whether the ongoing access has potential deadlock risk, but only Indiscriminate multiple blocking-release-blocking operations on the AW command further reduce the transmission efficiency of the bus.

因此,如何有效地识别出正在发生的具有潜在死锁风险的写命令,从而及时阻塞造成死锁的写命令是现如今亟待解决的技术问题。Therefore, how to effectively identify the write command that is at risk of potential deadlock, so as to block the write command causing the deadlock in time is a technical problem that needs to be solved nowadays.

发明内容Summary of the invention

有鉴于此,本发明实施例提供一种防止总线死锁的方法、装置及存储介质,以能够有效地识别出正在发生的具有潜在死锁风险的写命令,从而及时阻塞造成死锁的写命令。In view of this, embodiments of the present invention provide a method, apparatus, and storage medium for preventing bus deadlock, so as to be able to effectively identify a write command that is in danger of a potential deadlock, thereby blocking a write command that causes a deadlock in time. .

本发明实施例的技术方案是这样实现的:The technical solution of the embodiment of the present invention is implemented as follows:

本发明实施例提供一种防止总线死锁的方法,包括:Embodiments of the present invention provide a method for preventing a bus deadlock, including:

建立动态路由表,其中,所述动态路由表用来记录主设备Master发出的但未到达从设备Slave的写地址命令的状态信息;Establishing a dynamic routing table, where the dynamic routing table is used to record state information of a write address command sent by the master device but not reaching the slave device slave;

根据所述动态路由表判断总线是否会产生死锁;Determining whether the bus will generate a deadlock according to the dynamic routing table;

若所述总线会产生死锁,确定并阻塞造成死锁的所述写地址命令。If the bus generates a deadlock, the write address command that caused the deadlock is determined and blocked.

如上所述的方法,所述根据所述动态路由表判断总线是否会产生死锁包括: In the method as described above, the determining, according to the dynamic routing table, whether the bus generates a deadlock includes:

根据Master与Slave之间的关系生成关系矩阵;其中,若所述Master向所述Slave发送写地址命令,所述关系矩阵的对应位置为第一标识,若所述Master不向所述Slave发送所述写地址命令,所述关系矩阵的对应位置为第二标识;Generating a relationship matrix according to the relationship between the master and the slave; wherein, if the master sends a write address command to the slave, the corresponding position of the relationship matrix is a first identifier, if the master does not send the location to the slave Describe an address command, where a corresponding location of the relationship matrix is a second identifier;

根据所述动态路由表和所述关系矩阵判断总线是否会产生死锁。Determining whether the bus will generate a deadlock according to the dynamic routing table and the relationship matrix.

如上所述的方法,所述根据所述动态路由表和所述关系矩阵判断总线是否会产生死锁,包括:In the method as described above, the determining whether the bus generates a deadlock according to the dynamic routing table and the relationship matrix includes:

判断所述关系矩阵是否是死锁矩阵;其中,所述死锁矩阵为所述关系矩阵中能够使所述总线产生死锁的矩阵;Determining whether the relationship matrix is a deadlock matrix; wherein the deadlock matrix is a matrix in the relationship matrix that can cause the bus to generate a deadlock;

若所述关系矩阵是所述死锁矩阵,判断所述死锁矩阵是否是最简死锁矩阵;其中,所述最简死锁矩阵为所述死锁矩阵中能够使所述总线产生死锁,并且形式最简单的矩阵;If the relationship matrix is the deadlock matrix, determining whether the deadlock matrix is a simplest deadlock matrix; wherein the simplest deadlock matrix is that the deadlock matrix can cause the bus to generate a deadlock And the simplest form of matrix;

若所述死锁矩阵不是所述最简死锁矩阵,将所述死锁矩阵转换成所述最简死锁矩阵;If the deadlock matrix is not the simplest deadlock matrix, converting the deadlock matrix into the simplest deadlock matrix;

根据所述动态路由表和所述最简死锁矩阵判断所述总线是否会产生死锁。Determining whether the bus generates a deadlock according to the dynamic routing table and the simplest deadlock matrix.

如上所述的方法,所述判断所述关系矩阵是否是死锁矩阵,包括:The method as described above, the determining whether the relationship matrix is a deadlock matrix comprises:

判断所述关系矩阵的每一行和每一列是否分别存在至少2个所述第一标识;Determining whether there are at least two of the first identifiers in each row and each column of the relationship matrix;

若所述关系矩阵的每一行和每一列分别存在至少2个所述第一标识,确定所述关系矩阵是所述死锁矩阵;If there are at least two first identifiers in each row and each column of the relationship matrix, determining that the relationship matrix is the deadlock matrix;

若所述关系矩阵的一行或一列不存在至少2个所述第一标识,确定所述关系矩阵不是所述死锁矩阵。If at least two of the first identifiers do not exist in a row or a column of the relationship matrix, it is determined that the relationship matrix is not the deadlock matrix.

如上所述的方法,所述若所述关系矩阵是所述死锁矩阵,判断所述死锁矩阵是否是最简死锁矩阵,包括: In the method as described above, if the relationship matrix is the deadlock matrix, determining whether the deadlock matrix is the simplest deadlock matrix comprises:

若所述关系矩阵是所述死锁矩阵,判断所述死锁矩阵的每一行和每一列是否均存在2个所述第一标识;If the relationship matrix is the deadlock matrix, determine whether each of the row and each column of the deadlock matrix has two first identifiers;

若所述关系矩阵的每一行和每一列均存在2个所述第一标识,确定所述死锁矩阵是所述最简死锁矩阵;If there are two first identifiers in each row and each column of the relationship matrix, determining that the deadlock matrix is the simplest deadlock matrix;

若所述关系矩阵的一行或一列存在多于2个所述第一标识,确定所述死锁矩阵不是所述最简死锁矩阵。If there are more than two of the first identifiers in a row or a column of the relationship matrix, it is determined that the deadlock matrix is not the simplest deadlock matrix.

如上所述的方法,所述若所述死锁矩阵不是所述最简死锁矩阵,将所述死锁矩阵转换成所述最简死锁矩阵,包括:In the method as described above, if the deadlock matrix is not the simplest deadlock matrix, converting the deadlock matrix into the simplest deadlock matrix comprises:

若m×k阶死锁矩阵不是所述最简死锁矩阵,根据所述m×k阶死锁矩阵得到

Figure PCTCN2017085136-appb-000001
个i×i阶子矩阵;其中,m、k均为大于1的整数,l=min(m,k),i=2、3…l;If the m×k order deadlock matrix is not the simplest deadlock matrix, according to the m×k order deadlock matrix
Figure PCTCN2017085136-appb-000001
i×i order submatrix; wherein m and k are integers greater than 1, l=min(m,k), i=2, 3...l;

从所述

Figure PCTCN2017085136-appb-000002
个i×i阶子矩阵中筛选出i×i阶死锁矩阵;From the stated
Figure PCTCN2017085136-appb-000002
The i×i order deadlock matrix is selected in the i×i order submatrices;

判断所述i×i阶死锁矩阵是否是所述最简死锁矩阵;Determining whether the i×i order deadlock matrix is the simplest deadlock matrix;

若所述i×i阶死锁矩阵不是所述最简死锁矩阵,将所述i×i阶死锁矩阵转换成所述最简死锁矩阵。If the i×i order deadlock matrix is not the simplest deadlock matrix, the i×i order deadlock matrix is converted into the simplest deadlock matrix.

如上所述的方法,所述若m×k阶死锁矩阵不是所述最简死锁矩阵,根据所述m×k阶死锁矩阵得到

Figure PCTCN2017085136-appb-000003
个i×i阶子矩阵,包括:According to the method as described above, if the m×k order deadlock matrix is not the simplest deadlock matrix, according to the m×k order deadlock matrix
Figure PCTCN2017085136-appb-000003
i×i order sub-matrices, including:

若m×k阶死锁矩阵不是最简死锁矩阵,在所述m×k阶死锁矩阵中选择i行和i列的数,从所选择的i行和i列的数中选取同时包含在所述i行和i列中的数并生成所述i×i阶矩阵;If the m×k order deadlock matrix is not the simplest deadlock matrix, the number of i rows and i columns is selected in the m×k order deadlock matrix, and the selected i row and i column numbers are selected and included. Generating the numbers in the i rows and i columns and generating the i×i order matrix;

选取

Figure PCTCN2017085136-appb-000004
个所述i×i阶矩阵,得到所述
Figure PCTCN2017085136-appb-000005
个i×i阶矩阵。Select
Figure PCTCN2017085136-appb-000004
The i×i order matrix, resulting in the
Figure PCTCN2017085136-appb-000005
i × i order matrix.

如上所述的方法,所述若所述i×i阶死锁矩阵不是所述最简死锁矩阵,将所述i×i阶死锁矩阵转换成所述最简死锁矩阵,包括:In the method as described above, if the i×i order deadlock matrix is not the simplest deadlock matrix, converting the i×i order deadlock matrix into the simplest deadlock matrix comprises:

若所述i×i阶死锁矩阵不是所述最简死锁矩阵,将所述i×i阶死锁矩阵中存在多于2个所述第一标识的行或列中多余的所述第一标识置位成所述 第二标识,使所述i×i阶死锁矩阵的每一行和每一列均存在2个所述第一标识,得到所述最简死锁矩阵。If the i×i order deadlock matrix is not the simplest deadlock matrix, there are more than two of the first identified rows or columns in the i×i order deadlock matrix. An identifier is set to the stated The second identifier is such that each of the row and each column of the i×i-order deadlock matrix has two first identifiers, to obtain the simplest deadlock matrix.

如上所述的方法,所述写地址命令的状态信息包括源接口的接口名、目的接口的接口名、第一时序收敛寄存器片的信息和第二时序收敛寄存器片的信息,其中,所述第一时序收敛寄存器片的信息为所述写地址命令从所述源接口到达所述目的接口的传输路径中需经过的时序收敛寄存器片的信息,所述第二时序收敛寄存器片的信息为当前时刻所述写地址命令已经过的时序收敛寄存器片的信息,所述源接口是与发送所述写地址命令的所述Master连接的Slave接口,所述目的接口是与接收所述写地址命令的所述Slave相连接的Master接口。In the above method, the status information of the write address command includes an interface name of the source interface, an interface name of the destination interface, information of the first timing closure register slice, and information of the second timing closure register slice, wherein the The information of a timing closure register slice is information of a timing convergence register slice that the write address command needs to pass from the source interface to the transmission path of the destination interface, and the information of the second timing convergence register slice is the current time. The write address command has passed the information of the timing convergence register slice, the source interface is a slave interface connected to the master that sends the write address command, and the destination interface is the same as the command to receive the write address command. The Master interface connected to the Slave.

如上所述的方法,所述根据所述动态路由表和所述最简死锁矩阵判断所述总线是否会产生死锁,包括:In the method as described above, the determining whether the bus generates a deadlock according to the dynamic routing table and the simplest deadlock matrix comprises:

根据所述最简死锁矩阵和所述动态路由表获取所述Master向所述Slave发送所述写地址命令的发送时刻;Obtaining, according to the simplest deadlock matrix and the dynamic routing table, a sending moment that the master sends the write address command to the slave;

根据所述最简死锁矩阵和所述动态路由表获取所述Master发送的所述写地址命令到达所述Slave的路径中的延时;Acquiring, according to the simplest deadlock matrix and the dynamic routing table, a delay in a path that the write address command sent by the master reaches the slave;

根据所述写地址命令的发送时刻和所述路径中的延时判断所述Master与所述Slave之间的关系是否满足死锁特征;其中,所述死锁特征为第一Master先向第一Slave发送第一写地址命令,后向第二Slave发送第二写地址命令;第二Master先向所述第二Slave发送第三写地址命令,后向所述第一slave发送第四写地址命令;并且所述第二写地址命令先于所述第三写地址命令到达所述第二Slave;所述第四写地址命令先于所述第一写地址命令到达所述第一Slave。Determining, according to the sending moment of the write address command and the delay in the path, whether the relationship between the master and the slave meets a deadlock feature; wherein the deadlock feature is the first master first Slave sends a first write address command, and then sends a second write address command to the second slave; the second master first sends a third write address command to the second slave, and then sends a fourth write address command to the first slave. And the second write address command arrives at the second slave before the third write address command; the fourth write address command arrives at the first slave before the first write address command.

若所述Master与Slave之间的关系满足死锁特征,确定所述总线会产生死锁。 If the relationship between the Master and the Slave satisfies the deadlock feature, it is determined that the bus will generate a deadlock.

如上所述的方法,所述根据所述最简死锁矩阵和所述动态路由表获取所述Master向所述Slave发送写地址命令的发送时刻,包括:The method as described above, the obtaining, by the minimum deadlock matrix and the dynamic routing table, a sending moment that the master sends a write address command to the slave, includes:

根据所述最简死锁矩阵在所述动态路由表中获取所述写地址命令的第二时序收敛寄存器片的信息;Acquiring information of the second timing convergence register slice of the write address command in the dynamic routing table according to the simplest deadlock matrix;

获取当前时刻的时刻信息;Obtaining time information of the current moment;

根据所述当前时刻的时刻信息和所述第二时序收敛寄存器片的信息,计算所述Master向所述Slave发送写地址命令的发送时刻。And calculating, according to the time information of the current time and the information of the second timing convergence register slice, a transmission time at which the master sends a write address command to the slave.

如上所述的方法,所述根据所述最简死锁矩阵和所述动态路由表获取所述Master发送的所述写地址命令到达所述Slave的路径中的延时,包括:The method as described above, the obtaining the delay in the path of the write address command sent by the master to the slave according to the simplest deadlock matrix and the dynamic routing table, including:

根据所述最简死锁矩阵在所述动态路由表中获取第一时序收敛寄存器片的信息;Obtaining information of the first timing convergence register slice in the dynamic routing table according to the simplest deadlock matrix;

根据所述第一时序收敛寄存器片的信息计算所述Master发送的所述写地址命令到达所述Slave的传输路径中的延时。And calculating a delay in the transmission path of the write address command sent by the master to the slave according to the information of the first timing convergence register slice.

如上所述的方法,所述根据所述写地址命令的发送时刻和所述路径中的延时判断所述Master与所述Slave之间的关系是否满足死锁特征,包括:The method as described above, determining whether the relationship between the master and the slave meets a deadlock feature according to a sending moment of the write address command and a delay in the path, including:

判断所述第一Master向所述第一Slave发送所述第一写地址命令的发送时刻是否小于所述第一Master向所述第二Slave发送所述第二写地址命令的发送时刻;Determining whether the sending time of the first write address command sent by the first master to the first slave is less than the sending time of the first master sending the second write address command to the second slave;

判断所述第二Master向所述第二Slave发送所述第三写地址命令的发送时刻是否小于所述第二Master向所述第一Slave发送的所述第四写地址命令的发送时刻;Determining whether the sending time of the third master sending the third write address command to the second slave is smaller than the sending time of the fourth write address command sent by the second master to the first slave;

判断所述第二写地址命令到达所述第二Slave的到达时刻是否小于所述第三写地址命令到达所述第二Slave的到达时刻;Determining whether an arrival time of the second write address command to reach the second slave is less than an arrival time of the third write address command reaching the second slave;

判断所述第四写地址命令到达所述第一Slave的到达时刻是否小于所述第一写地址命令到达所述第一Slave的到达时刻; Determining whether an arrival time of the fourth write address command to reach the first slave is less than an arrival time of the first write address command to reach the first slave;

若所述第一Master向所述第二Slave发送所述第二写地址命令的发送时刻大于所述第一Master向所述第一Slave发送所述第一写地址命令的发送时刻,且所述第二写地址命令到达所述第二Slave的到达时刻小于所述第三写地址命令到达所述第二Slave的到达时刻;并且,所述第二Master向所述第一Slave发送所述第四写地址命令的发送时刻大于所述第二Master向所述第二Slave发送所述第三写地址命令的时刻,且所述第四写地址命令到达所述第一Slave的时刻小于所述第一写地址命令到达所述第一Slave的时刻;确定所述Master与Slave之间的关系满足死锁特征。And sending, by the first master, the sending time of the second write address command to the second slave is greater than the sending time of the first master sending the first write address command to the first slave, and The arrival time of the second write address command reaching the second slave is less than the arrival time of the third write address command reaching the second slave; and the second master sends the fourth to the first slave The sending time of the write address command is greater than the time when the second master sends the third write address command to the second slave, and the time when the fourth write address command reaches the first slave is less than the first The time at which the write address command arrives at the first slave; determining that the relationship between the master and the slave satisfies the deadlock feature.

如上所述的方法,所述方法根据所述动态路由表判断总线是否会产生死锁,包括:In the method as described above, the method determines whether the bus generates a deadlock according to the dynamic routing table, including:

根据所述动态路由表判断Master与Slave之间的关系是否存在先发后至情况;其中,所述先发后至情况为第一Master向第一Slave发送第一写地址命令的发送时刻小于第二Master向第一Slave发送第二写地址命令的发送时刻,并且所述第一写地址命令到达第一Slave的到达时刻大于所述第二写地址命令到达第一Slave的到达时刻的情况;Determining, according to the dynamic routing table, whether the relationship between the master and the slave exists in a pre-emptive manner; wherein, after the first sending, the sending time of the first master sending the first write address command to the first slave is smaller than the first The second master sends a sending moment of the second write address command to the first slave, and the arrival time of the first write address command reaching the first slave is greater than the arrival time of the second write address command reaching the first slave;

若所述Master与Slave之间的关系存在所述先发后至情况,根据所述第二写地址命令、第三写地址命令以及第四写地址命令生成增量型关系矩阵;其中,所述第三写地址命令为发送给第二Slave并且发送时刻大于所述第二写地址命令的发送时刻的写命令;所述第四写地址命令为发送时刻大于所述第三写地址命令的写命令;And if the relationship between the master and the slave exists in the pre-sending to the situation, generating an incremental relationship matrix according to the second write address command, the third write address command, and the fourth write address command; wherein The third write address command is a write command sent to the second slave and transmitting a time greater than a sending time of the second write address command; the fourth write address command is a write command having a sending time greater than the third write address command ;

根据所述增量型关系矩阵判断总线是否会产生死锁。Judging whether the bus will generate a deadlock according to the incremental relationship matrix.

如上所述的方法,所述若所述Master与Slave之间的关系存在所述先发后至情况,根据所述第二写地址命令、第三写地址命令以及第四写地址命令生成增量型关系矩阵,包括:In the method as described above, if the relationship between the master and the slave exists in the pre-starting situation, the increment is generated according to the second write address command, the third write address command, and the fourth write address command. Type relationship matrix, including:

若所述Master与Slave之间的关系存在所述先发后至情况,分别确定 所述第二写地址命令、所述第三写地址命令和所述第四写地址命令表示的Master与Slave之间的关系;If the relationship between the Master and the Slave exists after the first is sent to the situation, respectively a relationship between the master and the slave indicated by the second write address command, the third write address command, and the fourth write address command;

若所述Master与Slave之间的关系为所述Master向所述Slave发送写地址命令,在所述增量型关系矩阵的对应位置设置第一标识;If the relationship between the master and the slave is that the master sends a write address command to the slave, setting a first identifier at a corresponding position of the incremental relationship matrix;

若所述Master与Slave之间的关系为所述Master不向所述Slave发送写地址命令,在所述增量型关系矩阵的对应位置设置第二标识。If the relationship between the master and the slave is that the master does not send a write address command to the slave, a second identifier is set at a corresponding position of the incremental relationship matrix.

如上所述的方法,所述根据所述增量型关系矩阵判断总线是否会产生死锁,包括:In the method as described above, the determining whether the bus generates a deadlock according to the incremental relationship matrix includes:

判断所述增量型关系矩阵的每一行和每一列是否分别存在至少2个所述第一标识;Determining whether there are at least two of the first identifiers in each row and each column of the incremental relationship matrix;

若所述增量型关系矩阵的每一行和每一列分别存在至少2个所述第一标识,确定所述总线是否会产生死锁。If there are at least two of the first identifiers in each row and each column of the incremental relationship matrix, it is determined whether the bus will generate a deadlock.

本发明实施例还提供一种防止总线死锁的装置,包括:The embodiment of the invention further provides an apparatus for preventing bus deadlock, comprising:

预处理模块,配置为建立动态路由表,其中,所述动态路由表用来记录主设备Master发出的但尚未到达从设备Slave的写地址命令的状态信息;a pre-processing module configured to establish a dynamic routing table, where the dynamic routing table is used to record status information of a write address command sent by the master device but not yet reaching the slave device slave;

判断模块,配置为根据所述动态路由表判断总线是否会产生死锁;The determining module is configured to determine, according to the dynamic routing table, whether the bus generates a deadlock;

处理模块,配置为若所述总线会产生死锁,确定并阻塞造成死锁的所述写地址命令。The processing module is configured to determine and block the write address command causing the deadlock if the bus generates a deadlock.

如上所述的装置,所述判断模块包括:The device as described above, the determining module comprises:

第一处理单元,配置为根据Master与Slave之间的关系生成关系矩阵;其中,若所述Master向所述Slave发送写地址命令,所述关系矩阵的对应位置为第一标识,若所述Master不向所述Slave发送所述写地址命令,所述关系矩阵的对应位置为第二标识;a first processing unit, configured to generate a relationship matrix according to a relationship between the master and the slave; wherein, if the master sends a write address command to the slave, the corresponding position of the relationship matrix is a first identifier, if the master Not sending the write address command to the slave, where a corresponding location of the relationship matrix is a second identifier;

第一判断单元,配置为根据所述动态路由表和所述关系矩阵判断总线是否会产生死锁。 The first determining unit is configured to determine whether the bus generates a deadlock according to the dynamic routing table and the relationship matrix.

如上所述的装置,所述第一判断单元,配置为判断所述关系矩阵是否是死锁矩阵;其中,所述死锁矩阵为所述关系矩阵中能够使所述总线产生死锁的矩阵;In the device as described above, the first determining unit is configured to determine whether the relationship matrix is a deadlock matrix; wherein the deadlock matrix is a matrix in the relationship matrix that can cause the bus to generate a deadlock;

若所述关系矩阵是所述死锁矩阵,判断所述死锁矩阵是否是最简死锁矩阵;其中,所述最简死锁矩阵为所述死锁矩阵中能够使所述总线产生死锁,并且形式最简单的矩阵;If the relationship matrix is the deadlock matrix, determining whether the deadlock matrix is a simplest deadlock matrix; wherein the simplest deadlock matrix is that the deadlock matrix can cause the bus to generate a deadlock And the simplest form of matrix;

若所述死锁矩阵不是所述最简死锁矩阵,将所述死锁矩阵转换成所述最简死锁矩阵;If the deadlock matrix is not the simplest deadlock matrix, converting the deadlock matrix into the simplest deadlock matrix;

根据所述动态路由表和所述最简死锁矩阵判断所述总线是否会产生死锁。Determining whether the bus generates a deadlock according to the dynamic routing table and the simplest deadlock matrix.

如上所述的装置,所述写地址命令的状态信息包括源接口的接口名、目的接口的接口名、第一时序收敛寄存器片的信息和第二时序收敛寄存器片的信息,其中,所述第一时序收敛寄存器片的信息为所述写地址命令从所述源接口到达所述目的接口的传输路径中需经过的时序收敛寄存器片的信息,所述第二时序收敛寄存器片的信息为当前时刻所述写地址命令已经过的时序收敛寄存器片的信息,所述源接口是与发送所述写地址命令的所述Master连接的Slave接口,所述目的接口是与接收所述写地址命令的所述Slave相连接的Master接口。The device as described above, the status information of the write address command includes an interface name of the source interface, an interface name of the destination interface, information of the first timing closure register slice, and information of the second timing closure register slice, wherein the The information of a timing closure register slice is information of a timing convergence register slice that the write address command needs to pass from the source interface to the transmission path of the destination interface, and the information of the second timing convergence register slice is the current time. The write address command has passed the information of the timing convergence register slice, the source interface is a slave interface connected to the master that sends the write address command, and the destination interface is the same as the command to receive the write address command. The Master interface connected to the Slave.

如上所述的装置,所述处理模块包括:The device as described above, the processing module comprising:

获取单元,配置为根据所述最简死锁矩阵和所述动态路由表获取所述Master向所述Slave发送所述写地址命令的发送时刻;根据所述最简死锁矩阵和所述动态路由表获取所述Master发送的所述写地址命令到达所述Slave的路径中的延时;An obtaining unit, configured to acquire, according to the simplest deadlock matrix and the dynamic routing table, a sending moment that the master sends the write address command to the slave; according to the simplest deadlock matrix and the dynamic routing Obtaining, by the table, a delay in a path that the write address command sent by the master reaches the slave;

第二判断单元,配置为根据所述写地址命令的发送时刻和所述路径中的延时判断所述Master与所述Slave之间的关系是否满足死锁特征;其中, 所述死锁特征为第一Master先向第一Slave发送第一写地址命令,后向第二Slave发送第二写地址命令;第二Master先向所述第二Slave发送第三写地址命令,后向所述第一slave发送第四写地址命令;并且所述第二写地址命令先于所述第三写地址命令到达所述第二Slave;所述第四写地址命令先于所述第一写地址命令到达所述第一Slave;a second determining unit, configured to determine, according to the sending time of the write address command and the delay in the path, whether the relationship between the master and the slave meets a deadlock feature; The deadlock feature is that the first master first sends a first write address command to the first slave, and then sends a second write address command to the second slave; the second master first sends a third write address command to the second slave. Sending a fourth write address command to the first slave; and the second write address command reaches the second slave before the third write address command; the fourth write address command precedes the first a write address command arrives at the first slave;

第二处理单元,配置为若所述Master与Slave的之间关系满足死锁特征,确定所述总线会产生死锁。The second processing unit is configured to determine that the bus generates a deadlock if the relationship between the master and the slave satisfies a deadlock feature.

如上所述的装置,所述第二判断单元,配置为判断所述第一Master向所述第一Slave发送所述第一写地址命令的发送时刻是否小于所述第一Master向所述第二Slave发送所述第二写地址命令的发送时刻;In the device, the second determining unit is configured to determine whether the sending time of the first master sending the first write address command to the first slave is smaller than the first master to the second Slave sends a sending moment of the second write address command;

判断所述第二Master向所述第二Slave发送所述第三写地址命令的发送时刻是否小于所述第二Master向所述第一Slave发送的所述第四写地址命令的发送时刻;Determining whether the sending time of the third master sending the third write address command to the second slave is smaller than the sending time of the fourth write address command sent by the second master to the first slave;

判断所述第二写地址命令到达所述第二Slave的到达时刻是否小于所述第三写地址命令到达所述第二Slave的到达时刻;Determining whether an arrival time of the second write address command to reach the second slave is less than an arrival time of the third write address command reaching the second slave;

判断所述第四写地址命令到达所述第一Slave的到达时刻是否小于所述第一写地址命令到达所述第一Slave的到达时刻;Determining whether an arrival time of the fourth write address command to reach the first slave is less than an arrival time of the first write address command to reach the first slave;

若所述第一Master向所述第二Slave发送所述第二写地址命令的发送时刻大于所述第一Master向所述第一Slave发送所述第一写地址命令的发送时刻,且所述第二写地址命令到达所述第二Slave的到达时刻小于所述第三写地址命令到达所述第二Slave的到达时刻;并且,所述第二Master向所述第一Slave发送所述第四写地址命令的发送时刻大于所述第二Master向所述第二Slave发送所述第三写地址命令的时刻,且所述第四写地址命令到达所述第一Slave的时刻小于所述第一写地址命令到达所述第一Slave的时刻;确定所述Master与Slave之间的关系满足死锁特征。 And sending, by the first master, the sending time of the second write address command to the second slave is greater than the sending time of the first master sending the first write address command to the first slave, and The arrival time of the second write address command reaching the second slave is less than the arrival time of the third write address command reaching the second slave; and the second master sends the fourth to the first slave The sending time of the write address command is greater than the time when the second master sends the third write address command to the second slave, and the time when the fourth write address command reaches the first slave is less than the first The time at which the write address command arrives at the first slave; determining that the relationship between the master and the slave satisfies the deadlock feature.

如上所述的装置,所述判断模块包括:The device as described above, the determining module comprises:

第三判断单元,配置为根据所述动态路由表判断Master与Slave之间的关系是否存在先发后至情况;其中,所述先发后至情况为第一Master向第一Slave发送第一写地址命令的发送时刻小于第二Master向第一Slave发送第二写地址命令的发送时刻,并且所述第一写地址命令到达第一Slave的到达时刻大于所述第二写地址命令到达第一Slave的到达时刻的情况;根据增量型关系矩阵断总线是否会产生死锁;The third determining unit is configured to determine, according to the dynamic routing table, whether the relationship between the master and the slave is in a pre-emptive manner; wherein, after the first sending, the first master sends the first write to the first slave. The sending moment of the address command is smaller than the sending moment of the second master sending the second write address command to the first slave, and the arrival time of the first write address command reaching the first slave is greater than the second write address command reaching the first slave. The situation of the arrival time; whether the bus will be deadlocked according to the incremental relationship matrix;

第三处理单元,配置为若所述Master与Slave之间的关系存在所述先发后至情况,根据所述第二写地址命令、第三写地址命令以及第四写地址命令生成增量型关系矩阵;其中,所述第三写地址命令为发送给第二Slave并且发送时刻大于所述第二写地址命令的发送时刻的地址命令;所述第四写地址命令为发送时刻大于所述第三写地址命令的地址命令。a third processing unit, configured to generate an incremental type according to the second write address command, the third write address command, and the fourth write address command if the relationship between the master and the slave exists in the pre-start situation a relationship matrix; wherein the third write address command is an address command sent to the second slave and the transmission time is greater than a transmission time of the second write address command; and the fourth write address command is a transmission time greater than the first The address command of the three-write address command.

如上所述的装置,所述第三处理单元,配置为若所述Master与Slave之间的关系存在所述先发后至情况,分别确定所述第二写地址命令、所述第三写地址命令和所述第四写地址命令表示的Master与Slave之间的关系;In the device as described above, the third processing unit is configured to determine the second write address command and the third write address respectively if the relationship between the master and the slave exists in the pre-starting situation. The relationship between the command and the master and the slave indicated by the fourth write address command;

若所述Master与Slave之间的关系为所述Master向所述Slave发送写地址命令,在所述增量型关系矩阵的对应位置设置第一标识;If the relationship between the master and the slave is that the master sends a write address command to the slave, setting a first identifier at a corresponding position of the incremental relationship matrix;

若所述Master与Slave之间的关系为所述Master不向所述Slave发送写地址命令,在所述增量型关系矩阵的对应位置设置第二标识。If the relationship between the master and the slave is that the master does not send a write address command to the slave, a second identifier is set at a corresponding position of the incremental relationship matrix.

本发明实施例还提供一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行上述的防止总线死锁的方法。The embodiment of the invention further provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the foregoing method for preventing bus deadlock.

本发明实施例提供的防止总线死锁的方法、装置及存储介质,该方法包括建立用来记录Master发出的但尚未到达Slave的写地址命令的状态信息的动态路由表;根据动态路由表判断总线是否会产生死锁;若总线会产 生死锁,确定并阻塞造成死锁的写地址命令;这样能够有效地识别出正在发生的具有潜在死锁风险的写地址命令,进而有针对性地阻止会造成总线死锁的写地址命令,从而实现了防止总线死锁的目的,同时避免了采取统一防死锁机制的造成的数据吞吐量减少的问题,提高了总线的数据传输效率。A method, device, and storage medium for preventing bus deadlock provided by an embodiment of the present invention, the method comprising: establishing a dynamic routing table for recording state information of a write address command issued by a master but not yet reaching a slave; determining a bus according to the dynamic routing table Will there be a deadlock; if the bus will produce a deadlock, determining and blocking the write address command that caused the deadlock; this effectively identifies the write address command that is at risk of a potential deadlock, thereby specifically preventing write address commands that would cause a bus deadlock. The purpose of preventing bus deadlock is achieved, and the problem of data throughput reduction caused by adopting a unified anti-deadlock mechanism is avoided, and the data transmission efficiency of the bus is improved.

附图说明DRAWINGS

图1为现有技术一种典型的“前向通道死锁”示意图;1 is a schematic diagram of a typical "forward channel deadlock" in the prior art;

图2为图1产生死锁的循环依赖关系示意图;2 is a schematic diagram of the cyclic dependency of the deadlock generated in FIG. 1;

图3为本发明实施例提供的一种防止总线死锁的方法的流程示意图;FIG. 3 is a schematic flowchart diagram of a method for preventing bus deadlock according to an embodiment of the present invention;

图4为本发明实施例提供的另一防止总线死锁的方法的流程示意图;4 is a schematic flowchart diagram of another method for preventing bus deadlock according to an embodiment of the present invention;

图5为本发明实施例提供的又一种防止总线死锁的方法的流程示意图;FIG. 5 is a schematic flowchart diagram of still another method for preventing bus deadlock according to an embodiment of the present invention;

图6为本发明实施例提供的又一种防止总线死锁的方法的流程示意图;FIG. 6 is a schematic flowchart diagram of still another method for preventing bus deadlock according to an embodiment of the present invention;

图7为本发明实施例提供的3×4阶死锁矩阵示意图;FIG. 7 is a schematic diagram of a 3×4 order deadlock matrix according to an embodiment of the present invention;

图8为本发明实施例提供的由图7所生成的一个3×3阶矩阵示意图;FIG. 8 is a schematic diagram of a 3×3 matrix generated by FIG. 7 according to an embodiment of the present invention; FIG.

图9为本发明实施例提供的由图7所生成的另一个3×3阶矩阵示意图;FIG. 9 is a schematic diagram of another 3×3 order matrix generated by FIG. 7 according to an embodiment of the present invention; FIG.

图10为本发明实施例提供的由图7所生成的又一个3×3阶矩阵示意图;FIG. 10 is a schematic diagram of still another 3×3 order matrix generated by FIG. 7 according to an embodiment of the present invention; FIG.

图11为本发明实施例提供的由图7所生成的又一个3×3阶矩阵示意图;FIG. 11 is a schematic diagram of still another 3×3 order matrix generated by FIG. 7 according to an embodiment of the present invention; FIG.

图12为本发明提供的Interconnect模块级联的系统结构示意图;12 is a schematic structural diagram of a system in which an Interconnect module is cascaded according to the present invention;

图13为本发明实施例提供的又一种防止总线死锁的方法的流程示意图;FIG. 13 is a schematic flowchart of still another method for preventing bus deadlock according to an embodiment of the present invention;

图14为本发明实施例提供的一个最简死锁矩阵;FIG. 14 is a simplified deadlock matrix according to an embodiment of the present invention; FIG.

图15为本实施例提供的图14的产生死锁的循环依赖关系示意图;FIG. 15 is a schematic diagram of the cyclic dependency relationship of the deadlock generated by FIG. 14 according to the embodiment; FIG.

图16为本发明提供的另一个Interconnect模块级联的系统示意图;16 is a schematic diagram of another system of cascading Interconnect modules provided by the present invention;

图17为本发明实施例提供的防止总线死锁的方法的流程图;FIG. 17 is a flowchart of a method for preventing bus deadlock according to an embodiment of the present invention;

图18为本发明实施例提供的防止总线死锁的方法的又一流程示意图; FIG. 18 is still another schematic flowchart of a method for preventing bus deadlock according to an embodiment of the present invention;

图19为本发明实施例提供的防止总线死锁的方法的另一流程图;FIG. 19 is another flowchart of a method for preventing bus deadlock according to an embodiment of the present invention;

图20为本发明实施例提供的防止总线死锁的应急机制的示意图;20 is a schematic diagram of an emergency mechanism for preventing bus deadlock according to an embodiment of the present invention;

图21为本发明实施例提供的另一种防止总线死锁的装置的结构示意图;FIG. 21 is a schematic structural diagram of another apparatus for preventing bus deadlock according to an embodiment of the present invention;

图22为本发明实施例提供的另一种防止总线死锁的装置的结构示意图;FIG. 22 is a schematic structural diagram of another apparatus for preventing bus deadlock according to an embodiment of the present invention;

图23为本发明实施例提供的又一种防止总线死锁的装置的结构示意图;FIG. 23 is a schematic structural diagram of another apparatus for preventing bus deadlock according to an embodiment of the present invention;

图24为本发明实施例提供的又一种防止总线死锁的装置的结构示意图;FIG. 24 is a schematic structural diagram of another apparatus for preventing bus deadlock according to an embodiment of the present invention;

图25为本发明实施例提供的又一种防止总线死锁的装置的结构示意图。FIG. 25 is a schematic structural diagram of another apparatus for preventing bus deadlock according to an embodiment of the present invention.

具体实施方式detailed description

图3为本发明实施例提供的一种防止总线死锁的方法的流程示意图,如图3所示,本实施例提供的方法包括以下步骤:FIG. 3 is a schematic flowchart of a method for preventing a bus deadlock according to an embodiment of the present invention. As shown in FIG. 3, the method provided in this embodiment includes the following steps:

步骤101、建立动态路由表;其中,动态路由表用来记录Master发出的但尚未到达Slave的写地址命令的状态信息。Step 101: Establish a dynamic routing table, where the dynamic routing table is used to record status information of a write address command sent by the master but not yet reach the slave.

具体的,步骤101建立动态路由表可以由防止总线死锁的装置实现。需要说明的是,动态路由表是一个不断变化的路由表,它纪录的是Master发出的但尚未到达Slave的写地址命令的状态信息,如果在未来的某一时刻,Master发出写地址命令已经到达了相应的Slave,那么就将该写地址命令的状态信息从动态路由表中删除。Specifically, the step 101 of establishing a dynamic routing table may be implemented by a device that prevents bus deadlock. It should be noted that the dynamic routing table is an ever-changing routing table, which records the status information of the write address command sent by the master but has not yet reached the slave. If at some point in the future, the master sends a write address command has arrived. The corresponding Slave, then the status information of the write address command is deleted from the dynamic routing table.

步骤102、根据动态路由表判断总线是否会产生死锁。Step 102: Determine, according to the dynamic routing table, whether the bus will generate a deadlock.

具体的,步骤102根据动态路由表判断总线是否会产生死锁可以由防止总线死锁的装置实现。根据动态路由表判断总线是否会产生死锁是指从 动态路由表中获取Master发出的但尚未到达Slave的写地址命令的状态信息,根据获取的Master发出的但尚未到达Slave的写地址命令的状态信息判断总线是否会产生死锁。Specifically, step 102 determines whether the bus will generate a deadlock according to the dynamic routing table, and may be implemented by a device that prevents bus deadlock. According to the dynamic routing table, it is determined whether the bus will generate a deadlock. The dynamic routing table obtains the status information of the write address command sent by the master but has not yet reached the slave, and determines whether the bus will generate a deadlock according to the obtained status information of the write address command issued by the master but not yet reaching the slave.

步骤103、若总线会产生死锁,确定并阻塞造成死锁的写地址命令。Step 103: If the bus generates a deadlock, determine and block the write address command that caused the deadlock.

具体的,步骤103若总线会产生死锁,确定并阻塞造成死锁的写地址命令可以由防止总线死锁的装置实现。Specifically, if the bus generates a deadlock in step 103, determining and blocking the write address command causing the deadlock can be implemented by a device that prevents the bus from being deadlocked.

本实施例提供的防止总线死锁的方法,建立用来记录Master发出的但尚未到达Slave的写地址命令的状态信息的动态路由表;根据动态路由表判断总线是否会产生死锁;若总线会产生死锁,确定并阻塞造成死锁的写地址命令;这样能够有效地识别出正在发生的具有潜在死锁风险的写地址命令,进而有针对性地阻止会造成总线死锁的写地址命令,从而实现了防止总线死锁的目的,同时避免了采取统一防死锁机制的造成的地址吞吐量减少的问题,提高了总线的数据传输效率。The method for preventing bus deadlock provided in this embodiment establishes a dynamic routing table for recording status information of a write address command issued by the master but not yet reaching the slave; determining whether the bus will generate a deadlock according to the dynamic routing table; Generate a deadlock, determine and block the write address command that caused the deadlock; this can effectively identify the write address command that is at risk of potential deadlock, and thus specifically block the write address command that will cause the bus deadlock. Thereby, the purpose of preventing the bus deadlock is achieved, and the problem of reducing the address throughput caused by adopting the unified anti-deadlock mechanism is avoided, and the data transmission efficiency of the bus is improved.

图4为本发明实施例提供的另一防止总线死锁的方法的流程示意图,如图4所示,本实施例提供的方法包括以下步骤:FIG. 4 is a schematic flowchart of another method for preventing bus deadlock according to an embodiment of the present invention. As shown in FIG. 4, the method provided in this embodiment includes the following steps:

步骤201、防止总线死锁的装置建立动态路由表;其中,动态路由表用来记录Master发出的但尚未到达Slave的写地址命令的状态信息。Step 201: The device for preventing bus deadlock establishes a dynamic routing table. The dynamic routing table is used to record state information of a write address command sent by the master but not yet reach the slave.

步骤202、防止总线死锁的装置根据Master与Slave之间的关系生成关系矩阵;其中,若Master向Slave发送写地址命令,关系矩阵的对应位置为第一标识,若Master不向Slave发送写地址命令,关系矩阵的对应位置为第二标识。Step 202: The device for preventing bus deadlock generates a relationship matrix according to the relationship between the master and the slave; wherein, if the master sends a write address command to the slave, the corresponding position of the relationship matrix is the first identifier, if the master does not send the write address to the slave The corresponding position of the command and relationship matrix is the second identifier.

需要说明的是,关系矩阵是多个Master与多个Slave之间关系的矩阵,即表示所有Master的哪些Master向所有Slave中的哪些Slave发送写地址命令的矩阵,假如Master的数量为4,Slave的数量为5,4个Master分别表示为Master0、Master1、Master2和Master3,5个Slave分别表示为Slave0、 Slave1、Slave2、Slave3和Slave4,那么4个Master和5个Slave之间的关系可以以一个4×5的关系矩阵表示(Master和Slave4分别表示关系矩阵的行和列),如果Master1向Slave2发送写地址命令,那么在关系矩阵中第2行第3列的位置以第一标识进行表示。It should be noted that the relationship matrix is a matrix of relationships between multiple masters and multiple slaves, that is, which masters of all masters send a matrix of write address commands to all slaves in all slaves, if the number of masters is 4, Slave The number is 5, 4 Masters are represented as Master0, Master1, Master2 and Master3, respectively, and 5 Slaves are respectively represented as Slave0. Slave1, Slave2, Slave3, and Slave4, then the relationship between the four Masters and the five Slaves can be represented by a 4×5 relational matrix (Master and Slave4 represent the rows and columns of the relational matrix, respectively), if Master1 sends a write to Slave2. The address command, then the position of the second row and the third column in the relation matrix is represented by the first identifier.

还需要说明的是,在关系矩阵中,第一标识一般是以数“1”表示,第二表示一般是以数“0”表示。It should also be noted that in the relation matrix, the first identifier is generally represented by a number "1", and the second representation is generally represented by a number "0".

步骤203、防止总线死锁的装置根据动态路由表和关系矩阵判断总线是否会产生死锁。Step 203: The device for preventing bus deadlock determines whether the bus generates a deadlock according to the dynamic routing table and the relationship matrix.

需要说明的是,根据动态路由表和关系矩阵判断总线是否会产生死锁是指根据关系矩阵所表示的Master与Slave之间的关系从动态路由表中获取Master发出的但尚未到达Slave的写地址命令的状态信息,根据获取的Master发出的但尚未到达Slave的写地址命令的状态信息判断总线是否会产生死锁。It should be noted that determining whether the bus generates a deadlock according to the dynamic routing table and the relationship matrix means obtaining the write address of the master but not yet reaching the slave from the dynamic routing table according to the relationship between the master and the slave represented by the relationship matrix. The status information of the command determines whether the bus will generate a deadlock based on the obtained status information of the write address command issued by the master but not yet reaching the slave.

步骤204、若总线会产生死锁,防止总线死锁的装置确定并阻塞造成死锁的写地址命令。Step 204: If the bus generates a deadlock, the device that prevents the bus deadlock determines and blocks the write address command that caused the deadlock.

需要说明的是,本实施例中与其它实施例中相同步骤或概念的解释可以参照其它实施例中的描述,此处不再赘述。It should be noted that the explanation of the same steps or concepts in the other embodiments may refer to the descriptions in other embodiments, and details are not described herein again.

本实施例提供的防止总线死锁的方法,建立用来记录Master发出的但尚未到达Slave的写地址命令的状态信息的动态路由表;根据Master与Slave之间的关系生成关系矩阵;根据动态路由表和关系矩阵判断总线是否会产生死锁;若总线会产生死锁,确定并阻塞造成死锁的写地址命令;这样能够有效地识别出正在发生的具有潜在死锁风险的写地址命令,进而有针对性地阻止会造成总线死锁的写地址命令,从而实现了防止总线死锁的目的,同时避免了采取统一防死锁机制的造成的地址吞吐量减少的问题,提高了总线的地址传输效率。 The method for preventing bus deadlock provided in this embodiment establishes a dynamic routing table for recording state information of a write address command sent by the master but not yet reaching the slave; generating a relationship matrix according to the relationship between the master and the slave; The table and relationship matrix determine whether the bus will generate a deadlock; if the bus generates a deadlock, determine and block the write address command that caused the deadlock; this can effectively identify the write address command that is at risk of potential deadlock, and then Targeted blocking of the write address command that will cause the bus deadlock, thus achieving the purpose of preventing bus deadlock, while avoiding the problem of reducing the address throughput caused by the unified anti-deadlock mechanism, and improving the address transmission of the bus effectiveness.

图5为本发明实施例提供的又一种防止总线死锁的方法的流程示意图,如图5所示,本实施例提供的方法包括以下步骤:FIG. 5 is a schematic flowchart of a method for preventing a bus deadlock according to an embodiment of the present invention. As shown in FIG. 5, the method provided in this embodiment includes the following steps:

步骤301、防止总线死锁的装置建立动态路由表;其中,动态路由表用来记录Master发出的但尚未到达Slave的写地址命令的状态信息。Step 301: The device for preventing bus deadlock establishes a dynamic routing table. The dynamic routing table is configured to record state information of a write address command sent by the master but not yet reach the slave.

步骤302、防止总线死锁的装置根据Master与Slave之间的关系生成关系矩阵;其中,若Master向Slave发送写地址命令,关系矩阵的对应位置为第一标识,若Master不向Slave发送写地址命令,关系矩阵的对应位置为第二标识。Step 302: The device for preventing bus deadlock generates a relationship matrix according to the relationship between the master and the slave; wherein, if the master sends a write address command to the slave, the corresponding position of the relationship matrix is the first identifier, and if the master does not send the write address to the slave The corresponding position of the command and relationship matrix is the second identifier.

步骤303、防止总线死锁的装置判断关系矩阵是否是死锁矩阵;其中,死锁矩阵为关系矩阵中能够使总线产生死锁的矩阵。Step 303: The device for preventing bus deadlock determines whether the relationship matrix is a deadlock matrix; wherein the deadlock matrix is a matrix in the relationship matrix that can cause the bus to deadlock.

具体的,判断关系矩阵是否是死锁矩阵包括:判断关系矩阵的每一行和每一列是否分别存在至少2个第一标识;若关系矩阵的每一行和每一列分别存在至少2个第一标识,确定关系矩阵是死锁矩阵;若关系矩阵的一行或一列不存在至少2个第一标识,确定关系矩阵不是死锁矩阵。Specifically, determining whether the relationship matrix is a deadlock matrix includes: determining whether each row and each column of the relationship matrix respectively have at least two first identifiers; if each row and each column of the relationship matrix respectively have at least two first identifiers, The relationship matrix is determined to be a deadlock matrix; if there is no at least two first identifiers in a row or a column of the relationship matrix, it is determined that the relationship matrix is not a deadlock matrix.

需要说明的是,若第一标识以数“1”表示,第二标识以数“0”表示,判断关系矩阵是否是死锁矩阵包括:判断关系矩阵的每一行和每一列是否分别存在至少2个数“1”;若关系矩阵的每一行和每一列分别存在至少2个数“1”,确定关系矩阵是死锁矩阵;若关系矩阵的一行或一列不存在至少2个数“1”,确定关系矩阵不是死锁矩阵。若确定某一关系矩阵不是死锁矩阵,那么说明该关系矩阵反应的多Master和多Slave的关系不会造成总线死锁,相应的,不阻塞关系矩阵中Master向Slave发送的写地址命令。It should be noted that, if the first identifier is represented by a number “1” and the second identifier is represented by a number “0”, determining whether the relationship matrix is a deadlock matrix includes: determining whether each row and each column of the relationship matrix respectively exist at least 2 The number is "1"; if there are at least two numbers "1" in each row and each column of the relationship matrix, the relationship matrix is determined to be a deadlock matrix; if there is no at least two numbers "1" in one row or column of the relationship matrix, Make sure the relationship matrix is not a deadlock matrix. If it is determined that a relationship matrix is not a deadlock matrix, then the relationship between multiple masters and multiple slaves that the relationship matrix reacts does not cause a bus deadlock. Correspondingly, the write address command sent by the master to the slave in the relation matrix is not blocked.

步骤304、若关系矩阵是死锁矩阵,防止总线死锁的装置判断死锁矩阵是否是最简死锁矩阵;其中,最简死锁矩阵为死锁矩阵中能够使总线产生死锁,并且形式最简单的矩阵。Step 304: If the relationship matrix is a deadlock matrix, the device for preventing the bus deadlock determines whether the deadlock matrix is the simplest deadlock matrix; wherein the simple deadlock matrix is a deadlock matrix, the bus can be deadlocked, and the form The simplest matrix.

具体的,若关系矩阵是死锁矩阵,判断死锁矩阵是否是最简死锁矩阵 包括:若关系矩阵是死锁矩阵,判断死锁矩阵的每一行和每一列是否均存在2个第一标识;若关系矩阵的每一行和每一列均存在2个第一标识,确定死锁矩阵是最简死锁矩阵;若关系矩阵的一行或一列存在多于2个第一标识,确定死锁矩阵不是最简死锁矩阵。Specifically, if the relationship matrix is a deadlock matrix, it is determined whether the deadlock matrix is the simplest deadlock matrix. The method includes: if the relationship matrix is a deadlock matrix, determining whether each row and each column of the deadlock matrix have two first identifiers; if each row and each column of the relationship matrix has two first identifiers, determining a deadlock matrix It is the simplest deadlock matrix; if there are more than two first identifiers in a row or a column of the relation matrix, it is determined that the deadlock matrix is not the simplest deadlock matrix.

需要说明的是,若第一标识以数“1”表示,第二标识以数“0”表示,判断死锁矩阵是否是最简死锁矩阵包括:判断死锁矩阵的每一行和每一列是否均存在2个数“1”;若关系矩阵的每一行和每一列均存在2个数“1”,确定死锁矩阵是最简死锁矩阵;若关系矩阵的一行或一列存在多于2个数“1”,确定死锁矩阵不是最简死锁矩阵。It should be noted that, if the first identifier is represented by a number “1” and the second identifier is represented by a number “0”, determining whether the deadlock matrix is the simplest deadlock matrix includes: determining whether each row and each column of the deadlock matrix is There are 2 numbers "1"; if there are 2 numbers "1" in each row and column of the relationship matrix, it is determined that the deadlock matrix is the simplest deadlock matrix; if there are more than 2 rows or columns of the relationship matrix The number "1" determines that the deadlock matrix is not the simplest deadlock matrix.

步骤305、若死锁矩阵不是最简死锁矩阵,防止总线死锁的装置将死锁矩阵转换成最简死锁矩阵。Step 305: If the deadlock matrix is not the simplest deadlock matrix, the device for preventing bus deadlock converts the deadlock matrix into a simple deadlock matrix.

步骤306、根据动态路由表和最简死锁矩阵判断总线是否会产生死锁。Step 306: Determine whether the bus generates a deadlock according to the dynamic routing table and the simplest deadlock matrix.

步骤307、若总线会产生死锁,防止总线死锁的装置确定并阻塞造成死锁的写地址命令。Step 307: If the bus generates a deadlock, the device that prevents the bus deadlock determines and blocks the write address command that caused the deadlock.

需要说明的是,本实施例中与其它实施例中相同步骤或概念的解释可以参照其它实施例中的描述,此处不再赘述。It should be noted that the explanation of the same steps or concepts in the other embodiments may refer to the descriptions in other embodiments, and details are not described herein again.

本实施例提供的防止总线死锁的方法,建立用来记录Master发出的但尚未到达Slave的写地址命令的状态信息的动态路由表;根据Master与Slave之间的关系生成关系矩阵;判断关系矩阵是否是最简死锁矩阵;若关系矩阵不是最简死锁矩阵,将关系矩阵转换成最简死锁矩阵;根据动态路由表和最简死锁矩阵判断总线是否会产生死锁;若总线会产生死锁,确定并阻塞造成死锁的写地址命令;这样能够有效地识别出正在发生的具有潜在死锁风险的写地址命令,进而有针对性地阻止会造成总线死锁的写地址命令,从而实现了防止总线死锁的目的,同时避免了采取统一防死锁机制的造成的地址吞吐量减少的问题,提高了总线的数据传输效率。 The method for preventing bus deadlock provided in this embodiment establishes a dynamic routing table for recording state information of a write address command issued by the master but not yet reaching the slave; generating a relationship matrix according to the relationship between the master and the slave; determining the relationship matrix Whether it is the simplest deadlock matrix; if the relational matrix is not the simplest deadlock matrix, the relational matrix is converted into the simplest deadlock matrix; according to the dynamic routing table and the simplest deadlock matrix, it is judged whether the bus will generate a deadlock; Generate a deadlock, determine and block the write address command that caused the deadlock; this can effectively identify the write address command that is at risk of potential deadlock, and thus specifically block the write address command that will cause the bus deadlock. Thereby, the purpose of preventing the bus deadlock is achieved, and the problem of reducing the address throughput caused by adopting the unified anti-deadlock mechanism is avoided, and the data transmission efficiency of the bus is improved.

图6为本发明实施例提供的又一种防止总线死锁的方法的流程示意图,如图6所示,在上述图5对应的实施例的基础上,本实施例提供的方法中步骤305包括以下步骤:FIG. 6 is a schematic flowchart of still another method for preventing bus deadlock according to an embodiment of the present invention. As shown in FIG. 6, step 305 is included in the method provided in this embodiment. The following steps:

步骤305a、若m×k阶死锁矩阵不是最简死锁矩阵,防止总线死锁的装置根据m×k阶死锁矩阵得到

Figure PCTCN2017085136-appb-000006
个i×i阶子矩阵;其中,m、k均为大于1的整数,l=min(m,k),i=2、3…l。Step 305a, if the m×k order deadlock matrix is not the simplest deadlock matrix, the device for preventing bus deadlock is obtained according to the m×k order deadlock matrix.
Figure PCTCN2017085136-appb-000006
i×i order submatrices; wherein m and k are integers greater than 1, l=min(m,k), i=2, 3...l.

具体的,根据m×k阶死锁矩阵得到

Figure PCTCN2017085136-appb-000007
个i×i阶子矩阵包括:在m×k阶死锁矩阵中选择i行和i列的数,从所选择的i行和i列的数中选取同时包含在i行和i列中的数生成i×i阶矩阵;选取
Figure PCTCN2017085136-appb-000008
个i×i阶矩阵,得到
Figure PCTCN2017085136-appb-000009
个i×i阶矩阵。Specifically, according to the m×k order deadlock matrix
Figure PCTCN2017085136-appb-000007
The i×i order sub-matrices include: selecting the number of i rows and i columns in the m×k order deadlock matrix, and selecting from the selected i rows and i columns, and simultaneously included in the i rows and i columns. Number i×i order matrix; selection
Figure PCTCN2017085136-appb-000008
i×i order matrix, get
Figure PCTCN2017085136-appb-000009
i × i order matrix.

需要说明的是,图7为本发明实施例提供的3×4阶死锁矩阵示意图,假设第一标识以数“1”表示,第二标识以数“0”表示,当i=3时,如图7所示,在该3×4阶死锁矩阵中选择三行和四列中的三列的数,从选择的数中选取同时包含在所选择的三行和三列中的数,生成一个3×3阶矩阵,遍历选择死锁矩阵中的四列的数,一共生成四个3×3阶矩阵。具体的,图8为本发明实施例提供的由图7所生成的一个3×3阶矩阵示意图,图9为本发明实施例提供的由图7所生成的另一个3×3阶矩阵示意图,图10为本发明实施例提供的由图7所生成的又一个3×3阶矩阵示意图,图11为本发明实施例提供的由图7所生成的又一个3×3阶矩阵示意图。如图8所示,选择3×4阶死锁矩阵的三行和四列中的第一列、第二列、第三列的数,从选择的数中选取同时包含在三行和四列中的第一列、第二列、第三列的数中的数生成一个3×3阶矩阵;如图9所示,选择3×4阶死锁矩阵的三行和四列中的第一列、第三列、第四列的数,从选择的数中选取同时包含在三行和四列中的第一列、第三列、第四列的数中的数生成一个3×3阶矩阵;如图10所示,选择3×4阶死锁矩阵的三行和四列中的第一列、第二列、第四列的数,从选择的数 中选取同时包含在三行和四列中的第一列、第二列、第四列的数中的数生成一个3×3阶矩阵;如图11所示,选择3×4阶死锁矩阵的三行和四列中的第二列、第三列、第四列的数,从选择的数中选取同时包含在三行和四列中的第二列、第三列、第四列的数中的数生成一个3×3阶矩阵。It should be noted that FIG. 7 is a schematic diagram of a 3×4 order deadlock matrix according to an embodiment of the present invention. It is assumed that the first identifier is represented by a number “1”, and the second identifier is represented by a number “0”. When i=3, As shown in FIG. 7, the number of three columns in three rows and four columns is selected in the 3×4 order deadlock matrix, and the number included in the selected three rows and three columns is selected from the selected numbers. A 3×3 order matrix is generated, and the number of four columns in the deadlock matrix is traversed, and a total of four 3×3 order matrices are generated. Specifically, FIG. 8 is a schematic diagram of a 3×3 matrix generated by FIG. 7 according to an embodiment of the present invention, and FIG. 9 is a schematic diagram of another 3×3 matrix generated by FIG. 7 according to an embodiment of the present invention. FIG. 10 is a schematic diagram of still another 3×3 matrix generated by FIG. 7 according to an embodiment of the present invention. FIG. 11 is a schematic diagram of another 3×3 matrix generated by FIG. 7 according to an embodiment of the present invention. As shown in FIG. 8, the number of the first column, the second column, and the third column in the three rows and four columns of the 3×4 order deadlock matrix is selected, and the selected number is selected in three rows and four columns. The number in the first column, the second column, and the third column of the number generates a 3×3 order matrix; as shown in FIG. 9, the first of the three rows and four columns of the 3×4 order deadlock matrix is selected. The number of the column, the third column, and the fourth column is selected from the selected number and the number of the first column, the third column, and the fourth column included in the three rows and four columns simultaneously generates a 3×3 order a matrix; as shown in FIG. 10, the number of the first column, the second column, and the fourth column in the three rows and four columns of the 3×4 order deadlock matrix is selected, from the selected number Select a number in the first column, the second column, and the fourth column of the three rows and four columns to generate a 3×3 matrix; as shown in FIG. 11, select a 3×4 order deadlock matrix. The number of the second column, the third column, and the fourth column in the three rows and four columns, and the second column, the third column, and the fourth column of the three rows and four columns are selected from the selected number. The number in the number produces a 3 × 3 order matrix.

步骤305b、防止总线死锁的装置从

Figure PCTCN2017085136-appb-000010
个i×i阶子矩阵中筛选出i×i阶死锁矩阵。Step 305b, the device for preventing bus deadlock from
Figure PCTCN2017085136-appb-000010
The i×i order deadlock matrix is selected in the i×i order submatrices.

具体的,从

Figure PCTCN2017085136-appb-000011
个i×i阶子矩阵中筛选出i×i阶死锁矩阵是指从
Figure PCTCN2017085136-appb-000012
个i×i阶子矩阵中筛选满足每一行和每一列至少存在2个第一标识的i×i阶子矩阵作为i×i阶死锁矩阵。Specifically, from
Figure PCTCN2017085136-appb-000011
The i×i order deadlock matrix is selected from the i×i order submatrices.
Figure PCTCN2017085136-appb-000012
In the i×i order submatrix, an i×i order submatrix satisfying at least two first identifiers in each row and each column is selected as an i×i order deadlock matrix.

步骤305c、防止总线死锁的装置判断i×i阶死锁矩阵是否是最简死锁矩阵。Step 305c: The device for preventing bus deadlock determines whether the i×i-order deadlock matrix is the simplest deadlock matrix.

具体的,判断i×i阶死锁矩阵是否是最简死锁矩阵是看i×i阶死锁矩阵的每一行和每一列是否存在且只存在2个第一标识。Specifically, determining whether the i×i-order deadlock matrix is the simplest deadlock matrix is to see whether each row and each column of the i×i-order deadlock matrix exists and only two first identifiers exist.

步骤305d、若i×i阶死锁矩阵不是最简死锁矩阵,防止总线死锁的装置将i×i阶死锁矩阵转换成最简死锁矩阵。Step 305d: If the i×i order deadlock matrix is not the simplest deadlock matrix, the device for preventing bus deadlock converts the i×i order deadlock matrix into the simplest deadlock matrix.

具体的,若i×i阶死锁矩阵不是最简死锁矩阵,将i×i阶死锁矩阵中存在多于2个第一标识的行或列中多余的第一标识置位成第二标识,使i×i阶死锁矩阵的每一行和每一列只存在2个第一标识,得到最简死锁矩阵。Specifically, if the i×i-order deadlock matrix is not the simplest deadlock matrix, the redundant first identifier in the row or column in which the i×i-order deadlock matrix has more than two first identifiers is set to the second. The identifier is such that there are only two first identifiers for each row and each column of the i×i-order deadlock matrix, and the simplest deadlock matrix is obtained.

需要说明的是,若i×i阶死锁矩阵不是最简死锁矩阵(即第一标识的个数NE大于2i),在实际将i×i阶死锁矩阵转换成最简死锁矩阵的过程中,可以通过穷举法将某个第一标识置位成第二标识后的i×i阶死锁矩阵一一列出,对于一个i×i阶死锁矩阵,可以列出

Figure PCTCN2017085136-appb-000013
个标识置位后的i×i阶死锁矩阵,然后在这些
Figure PCTCN2017085136-appb-000014
个标识置位后的i×i阶死锁矩阵中筛选满足每一行和每一列存在且只存在2个第一标识的死锁矩阵,从而得到i×i阶最简死锁矩阵。It should be noted that if the i×i order deadlock matrix is not the simplest deadlock matrix (ie, the number NE of the first identifier is greater than 2i), the i×i order deadlock matrix is actually converted into the simplest deadlock matrix. In the process, the i×i-order deadlock matrix after a certain first identifier is set to the second identifier by the exhaustive method is listed one by one, and for an i×i-order deadlock matrix, it can be listed.
Figure PCTCN2017085136-appb-000013
Identifies the set i × i order deadlock matrix, then in these
Figure PCTCN2017085136-appb-000014
The deadlock matrix satisfying the existence of each row and each column and having only 2 first identifiers is selected in the i×i-order deadlock matrix after the flag is set, thereby obtaining an i×i-order simplest deadlock matrix.

还需要说明的是,本实施例中与其它实施例中相同步骤或概念的解释 可以参照其它实施例中的描述,此处不再赘述。It should also be noted that the same steps or concepts in the other embodiments are explained in this embodiment. Reference may be made to the description in other embodiments, and details are not described herein again.

本实施例提供的防止总线死锁的方法,当m×k阶死锁矩阵不是最简死锁矩阵时,对m×k阶死锁矩阵进行一步步处理,最终得到i×i阶最简死锁矩阵,进而根据动态路由表和最简死锁矩阵判断总线是否会产生死锁;若总线会产生死锁,确定并阻塞造成死锁的写地址命令;这样能够有效地识别出正在发生的具有潜在死锁风险的写地址命令,进而有针对性地阻止会造成总线死锁的写地址命令,从而实现了防止总线死锁的目的,同时避免了采取统一防死锁机制的造成的数据吞吐量减少的问题,提高了总线的数据传输效率。In the method for preventing bus deadlock provided by this embodiment, when the m×k order deadlock matrix is not the simplest deadlock matrix, the m×k order deadlock matrix is processed step by step, and finally the i×i order is the simplest dead. The lock matrix, according to the dynamic routing table and the simplest deadlock matrix to determine whether the bus will generate a deadlock; if the bus will generate a deadlock, determine and block the write address command causing the deadlock; this can effectively identify the occurrence of the The write address command of the potential deadlock risk, in turn, specifically blocks the write address command that will cause the bus deadlock, thereby achieving the purpose of preventing the bus deadlock, and avoiding the data throughput caused by the unified anti-deadlock mechanism. The problem of reduction increases the data transmission efficiency of the bus.

进一步的,写命令的状态信息包括源接口的接口名、目的接口的接口名、第一时序收敛寄存器片的信息和第二时序收敛寄存器片的信息,其中,第一时序收敛寄存器片的信息为写地址命令从源接口到达目的接口的传输路径中需经过的时序收敛寄存器片的信息,第二时序收敛寄存器片的信息为当前时刻写地址命令已经过的时序收敛寄存器片的信息,源接口是与发送写地址命令的Master连接的Slave接口,目的接口是与接收写地址命令的Slave相连接的Master接口。Further, the status information of the write command includes an interface name of the source interface, an interface name of the destination interface, information of the first timing convergence register slice, and information of the second timing convergence register slice, wherein the information of the first timing convergence register slice is The information of the timing convergence register slice that the address command is to pass from the source interface to the transmission path of the destination interface, and the information of the second timing convergence register slice is the information of the timing convergence register slice that the current address write address command has passed, and the source interface is The slave interface connected to the master that sends the write address command. The destination interface is the master interface connected to the slave that receives the write address command.

需要说明的是,在实际情况中,常常对Interconnect模块中的时序收敛的寄存器片和先入先出(First-In First-Out,FIFO)结构赋以唯一编号,以方便管理。第一时序收敛寄存器片的信息和第二时序收敛寄存器片的信息可以通过延时坐标进行表示。具体的,图12为本发明提供的Interconnect模块级联的系统结构示意图,如图12所示,该Interconnect模块级联的系统存在2个Interconnect模块(总线矩阵),分别为总线矩阵0和总线矩阵1,在总线矩阵0中由Slave接口00、Slave接口01、Master接口00和Master接口01组成一个Swich结构;在总线矩阵1中由Slave接口10、Slave接口11、Master接口10和Master接口11组成一个Swich结构。Master有3 个,分别是Master0、Master1和Master2,Slave也有3个,分别是Slave0、Slave1和Slave2;Master0通过总线矩阵0向Slave0发送写命令,并且通过总线矩阵0和总线矩阵1向Slave1发送写地址命令;Master1通过总线矩阵0向Slave0发送写命令,并且通过总线矩阵0和总线矩阵1向Slave1发送写命令;Master2通过总线矩阵1分别向Slave1和Slave2发送写命令。Slave接口00中存在一个时序收敛寄存器片(时序收敛寄存器片0),Master接口00中存在一个时序收敛寄存器片(时序收敛寄存器片1),Master接口01中存在一个时序收敛寄存器片(时序收敛寄存器片2);Slave接口10中存在一个时序收敛寄存器片(时序收敛寄存器片3),Master接口10中存在一个时序收敛寄存器片(时序收敛寄存器片4),Slave接口01到Master接口00的路径中存在一个时序收敛寄存器片(时序收敛寄存器片5),Master接口11中存在一个时序收敛寄存器片(时序收敛寄存器片6),Slave接口11中存在一个时序收敛寄存器片(时序收敛寄存器片7)。假设当前时刻Master0向Slave0发送的写地址命令到达Slave接口00,Master0向Slave1发送的写地址命令到达Master接口01,Master1向Slave0发送的写地址命令到达Master接口00,Master1向Slave1发送的写地址命令到达Master接口01,Master2向Slave1发送的写地址命令到达Slave接口11,Master2向Slave2发送的写地址命令到达Slave接口11。因此,根据图12所示的Interconnect模块级联的系统建立的动态路由表如表1所示,其中,延时坐标Regj(i)表示第一时序收敛寄存器片的信息和第二时序收敛寄存器片的信息,i表示该路径上收敛寄存器片的顺序号(从0开始计),j表示相应时序收敛寄存器片的标号。It should be noted that, in the actual situation, the timing slice of the Interconnect module and the First-In First-Out (FIFO) structure are often uniquely numbered for convenient management. The information of the first timing closure register slice and the information of the second timing closure register slice may be represented by delay coordinates. Specifically, FIG. 12 is a schematic structural diagram of an Interconnect module cascaded according to the present invention. As shown in FIG. 12, the Interconnect module cascaded system has two Interconnect modules (bus matrix), which are a bus matrix 0 and a bus matrix respectively. 1. In the bus matrix 0, a Swich structure is composed of Slave interface 00, Slave interface 01, Master interface 00 and Master interface 01; in the bus matrix 1, it is composed of Slave interface 10, Slave interface 11, Master interface 10 and Master interface 11. A Swich structure. Master has 3 Master0, Master1 and Master2, Slave also has three, Slave0, Slave1 and Slave2; Master0 sends a write command to Slave0 through bus matrix 0, and sends a write address command to Slave1 through bus matrix 0 and bus matrix 1; Master1 sends a write command to Slave0 through bus matrix 0, and sends a write command to Slave1 through bus matrix 0 and bus matrix 1; Master2 sends write commands to Slave1 and Slave2 through bus matrix 1, respectively. There is a timing convergence register slice (timing convergence register slice 0) in Slave interface 00, a timing convergence register slice (timing convergence register slice 1) exists in Master interface 00, and a timing closure register slice exists in Master interface 01 (timing convergence register) Slice 2); there is a timing closure register slice (timing convergence register slice 3) in the Slave interface 10, and a timing closure register slice (timing convergence register slice 4) exists in the master interface 10, and the slave interface 01 is in the path of the master interface 00. There is a timing closure register slice (timing convergence register slice 5), a timing closure register slice (timing convergence register slice 6) exists in the master interface 11, and a timing closure register slice (timing convergence register slice 7) exists in the slave interface 11. Assume that the write address command sent by Master0 to Slave0 arrives at Slave interface 00 at the current time. The write address command sent by Master0 to Slave1 reaches Master interface 01. The write address command sent by Master1 to Slave0 reaches Master interface 00, and the write address command sent by Master1 to Slave1. Upon reaching Master interface 01, the write address command sent by Master2 to Slave1 arrives at Slave interface 11, and the write address command sent by Master2 to Slave2 arrives at Slave interface 11. Therefore, the dynamic routing table established according to the system of the Interconnect module cascade shown in FIG. 12 is as shown in Table 1, wherein the delay coordinate Regj(i) represents the information of the first timing convergence register slice and the second timing convergence register slice. Information, i indicates the sequence number of the converged register slice on the path (starting from 0), and j indicates the label of the corresponding timing closure register slice.

表1Table 1

Figure PCTCN2017085136-appb-000015
Figure PCTCN2017085136-appb-000015

Figure PCTCN2017085136-appb-000016
Figure PCTCN2017085136-appb-000016

进一步,在上述实施例的基础上,图13为本发明实施例提供的又一种防止总线死锁的方法的流程示意图,如图13所示,根据动态路由表和最简死锁矩阵判断总线是否会产生死锁,包括:Further, based on the foregoing embodiment, FIG. 13 is a schematic flowchart diagram of another method for preventing bus deadlock according to an embodiment of the present invention. As shown in FIG. 13, the bus is determined according to a dynamic routing table and a simple deadlock matrix. Will there be a deadlock, including:

步骤401、防止总线死锁的装置根据最简死锁矩阵和动态路由表获取Master向Slave发送写地址命令的发送时刻。Step 401: The device for preventing bus deadlock acquires, according to the simple deadlock matrix and the dynamic routing table, a sending moment at which the master sends a write address command to the slave.

具体的,步骤401包括:根据最简死锁矩阵在动态路由表中获取写地址命令的第二时序收敛寄存器片的信息;获取当前时刻的时刻信息;根据当前时刻的时刻信息和第二时序收敛寄存器片的信息,计算Master向Slave发送写地址命令的发送时刻。Specifically, the step 401 includes: acquiring information of the second timing convergence register slice of the write address command in the dynamic routing table according to the simplest deadlock matrix; acquiring time information of the current time; and converge according to the current time information and the second timing The information of the register slice calculates the transmission time at which the Master sends a write address command to the slave.

需要说明的是,由于在一个Interconnect模块或由多个Interconnect模块级联的系统中,每个时序收敛寄存器片造成的时延是一定的,因此只需获取当前时刻的时刻信息,再获取当前时刻写地址命令已经过的时序收敛寄存器片的信息(即第二时序收敛寄存器片的信息),就可以反推出发送写地址命令的发送时刻。It should be noted that, in an Interconnect module or a system that is cascaded by multiple Interconnect modules, the delay caused by each timing convergence register slice is certain, so it is only necessary to obtain the current time information and then obtain the current time. By writing the information of the timing-converged register slice that the address command has passed (ie, the information of the second timing-converged register slice), the transmission timing of the write-write address command can be reversed.

步骤402、防止总线死锁的装置根据最简死锁矩阵和动态路由表获取Master发送的写地址命令到达Slave的路径中的延时。Step 402: The device for preventing bus deadlock acquires a delay in a path of the write address command sent by the master to the slave according to the simple deadlock matrix and the dynamic routing table.

具体的,步骤402包括:根据最简死锁矩阵在动态路由表中获取第一时序收敛寄存器片的信息;根据第一时序收敛寄存器片的信息计算Master 发送的写地址命令到达Slave的路径中的延时。Specifically, the step 402 includes: acquiring information of the first timing convergence register slice in the dynamic routing table according to the simplest deadlock matrix; and calculating the master according to the information of the first timing convergence register fragment. The delay in the path of the sent write address command to the slave.

需要说明的是,根据写地址命令的第一时序收敛寄存器片的信息可以获取写地址命令在传输路径中需经过的时序收敛寄存器片的信息,根据在传输路径中需经过的时序收敛寄存器片的信息就可以计算写地址命令在传输路径中的延时。It should be noted that, according to the information of the first timing convergence register slice of the write address command, the information of the timing convergence register slice that the write address command needs to pass in the transmission path can be obtained, and the register fragment is converge according to the timing that needs to pass in the transmission path. The information can be used to calculate the delay of the write address command in the transmission path.

步骤403、防止总线死锁的装置根据写地址命令的发送时刻和路径中的延时判断Master与Slave之间的关系是否满足死锁特征;其中,所述死锁特征为第一Master先向第一Slave发送第一写地址命令,后向第二Slave发送第二写地址命令;第二Master先向第二Slave发送第三写地址命令,后向第一slave发送第四写地址命令;并且第二写地址命令先于第三写地址命令到达第二Slave;第四写地址命令先于第一写地址命令到达第一Slave。Step 403: The device for preventing the bus deadlock determines whether the relationship between the master and the slave meets the deadlock feature according to the sending moment of the write address command and the delay in the path; wherein the deadlock feature is the first master first a slave sends a first write address command, and then sends a second write address command to the second slave; the second master first sends a third write address command to the second slave, and then sends a fourth write address command to the first slave; and The second write address command arrives at the second slave before the third write address command; the fourth write address command arrives at the first slave before the first write address command.

需要说明的是,写地址命令的到达时刻可以根据写地址命令的发送时刻加上写地址命令的传输路径中的延时计算得到。It should be noted that the arrival time of the write address command can be calculated according to the transmission time of the write address command plus the delay in the transmission path of the write address command.

具体的,步骤403包括:判断第一Master向第一Slave发送第一写地址命令的发送时刻是否小于第一Master向第二Slave发送第二写地址命令的发送时刻;判断第二Master向第二Slave发送第三写地址命令的发送时刻是否小于第二Master向第一Slave发送的第四写地址命令的发送时刻;判断第二写地址命令到达第二Slave的到达时刻是否小于第三写地址命令到达第二Slave的到达时刻,判断第四写地址命令到达第一Slave的到达时刻是否小于第一写地址命令到达第一Slave的到达时刻;若第一Master向第二Slave发送第二写地址命令的发送时刻大于第一Master向第一Slave发送第一写地址命令的发送时刻,且且第二写地址命令到达第二Slave的到达时刻小于第三写地址命令到达第二Slave的到达时刻,并且,第二Master向第一Slave发送第四写地址命令的发送时刻大于第二Master向第二Slave发送第三写地址命令的时刻,且第四写地址命令到达第一Slave的时刻小于 第一写地址命令到达第一Slave的时刻,确定Master与Slave之间的关系满足死锁特征。图14为本发明实施例提供的一个最简死锁矩阵,以图14为例,死锁特征为:Specifically, the step 403 includes: determining whether the sending time of the first master sending the first write address command to the first slave is smaller than the sending time of the first master sending the second write address command to the second slave; determining that the second master is the second Whether the sending time of the third write address command sent by the slave is smaller than the sending time of the fourth write address command sent by the second master to the first slave; determining whether the arrival time of the second write address command reaching the second slave is less than the third write address command When the arrival time of the second slave is reached, it is determined whether the arrival time of the fourth write address command to reach the first slave is less than the arrival time of the first write address command to reach the first slave; if the first master sends the second write address command to the second slave The sending time is greater than the sending time at which the first master sends the first write address command to the first slave, and the arrival time of the second write address command reaching the second slave is less than the arrival time of the third write address command reaching the second slave, and The second master sends a fourth write address command to the first slave, and the second master sends the third write address to the second slave. The time of the command, and the time at which the fourth write address command reaches the first slave is less than When the first write address command reaches the first slave, it is determined that the relationship between the Master and the Slave satisfies the deadlock feature. FIG. 14 is a simplified deadlock matrix according to an embodiment of the present invention. Taking FIG. 14 as an example, the deadlock feature is:

T03>T01 T 03 >T 01

T03+D03<T23+D23 T 03 +D 03 <T 23 +D 23

T10>T12 T 10 >T 12

T12+D12<T32+D32 T 12 +D 12 <T 32 +D 32

T20>T23 T 20 >T 23

T20+D20<T10+D10 T 20 + D 20 <T 10 + D 10

T31>T32 T 31 >T 32

T31+D31<T01+D01 T 31 +D 31 <T 01 +D 01

其中,Tij表示Masteri对Slavej发送写地址命令的发送时刻,Dij表示Masteri对Slavej发送的写地址命令在传输路径中的延时。图15为本实施例提供的图14的产生死锁的循环依赖关系示意图,如图15所示,W10等待W20,W20等待W23,W23等待W03,W03等待W01,W01等待W31,W31等待W32,W32等待W12,W12等待W10,总线传输陷入死锁。Where T ij represents the transmission timing of Masteri's write address command to Slavej, and D ij represents the delay of the write address command sent by Masteri to Slavej in the transmission path. FIG. 15 is a schematic diagram of the cyclic dependency relationship of the deadlock generated in FIG. 14 according to the embodiment. As shown in FIG. 15, W10 waits for W20, W20 waits for W23, W23 waits for W03, W03 waits for W01, W01 waits for W31, and W31 waits for W32. W32 waits for W12, W12 waits for W10, and the bus transmission is deadlocked.

还需要说明的是,任何一个M*N阶死锁矩阵所代表的Master与Slave之间的关系都可能满足死锁特征,死锁特征的表现形式随死锁矩阵的阶数的不同和Master与Slave之间的具体关系的不同而不同。It should also be noted that the relationship between the Master and the Slave represented by any M*N-order deadlock matrix may satisfy the deadlock feature. The manifestation of the deadlock feature varies with the order of the deadlock matrix and the Master and The specific relationship between Slave is different.

步骤404、若Master与Slave之间的关系满足死锁特征,防止总线死锁的装置确定总线会产生死锁。Step 404: If the relationship between the Master and the Slave satisfies the deadlock feature, the device that prevents the bus deadlock determines that the bus will generate a deadlock.

需要说明的是,本实施例中与其它实施例中相同步骤或概念的解释可以参照其它实施例中的描述,此处不再赘述。It should be noted that the explanation of the same steps or concepts in the other embodiments may refer to the descriptions in other embodiments, and details are not described herein again.

本实施例提供的防止总线死锁的方法,建立用来记录Master发出的但尚未到达Slave的写地址命令的状态信息的动态路由表;根据Master与Slave之间的关系生成关系矩阵;判断关系矩阵是否是最简死锁矩阵;若关系矩 阵不是最简死锁矩阵,将关系矩阵转换成最简死锁矩阵;根据动态路由表和最简死锁矩阵判断总线是否会产生死锁;若总线会产生死锁,确定并阻塞造成死锁的写地址命令;这样能够有效地识别出正在发生的具有潜在死锁风险的写地址命令,进而有针对性地阻止会造成总线死锁的写地址命令,从而实现了防止总线死锁的目的,同时避免了采取统一防死锁机制的造成的数据吞吐量减少的问题,提高了总线的数据传输效率。The method for preventing bus deadlock provided in this embodiment establishes a dynamic routing table for recording state information of a write address command issued by the master but not yet reaching the slave; generating a relationship matrix according to the relationship between the master and the slave; determining the relationship matrix Whether it is the simplest deadlock matrix; Array is not the simplest deadlock matrix, the relation matrix is converted into the simplest deadlock matrix; according to the dynamic routing table and the simplest deadlock matrix to determine whether the bus will generate a deadlock; if the bus will produce a deadlock, determine and block the deadlock Write address command; this can effectively identify the write address command that is at risk of potential deadlock, and thus specifically block the write address command that will cause the bus deadlock, thus achieving the purpose of preventing bus deadlock. At the same time, the problem of reducing the data throughput caused by adopting the unified anti-deadlock mechanism is avoided, and the data transmission efficiency of the bus is improved.

进一步,动态路由表还可以包括汇聚接口的信息,其中,汇聚接口为二条或两条以上的传输路径汇聚的接口。在上述表1的基础上,增加一项汇聚接口的信息和第三时序收敛存取信息,其中,第三时序收敛寄存器片的信息为写地址命令到达汇聚接口所经过的时序收敛寄存器片的信息,根据图12所示的Interconnect模块级联的系统建立的动态路由表如表2所示,Further, the dynamic routing table may further include information of the aggregation interface, where the aggregation interface is an interface where two or more transmission paths are aggregated. On the basis of the above Table 1, the information of the convergence interface and the third timing convergence access information are added, wherein the information of the third timing convergence register slice is the information of the timing convergence register slice that the write address command reaches the convergence interface. The dynamic routing table established according to the system in which the Interconnect module is cascaded as shown in FIG. 12 is as shown in Table 2.

表2Table 2

Figure PCTCN2017085136-appb-000017
Figure PCTCN2017085136-appb-000017

新来的写地址命令如果可能会对存在与动态路由表中在过去时刻的写 地址命令产生影响,使得原本可以通过第一时序收敛寄存器片的信息计算出的的传输路径的延时变得不可控。具体的,图16为本发明提供的另一个Interconnect模块级联的系统示意图,如图16所示,在当前时刻,AW11抵达图示中位置;此时,Master2向Slave1发出了AW20,因为传输路径的延时,AW20会先于AW11抵达图中阴影填充的Master接口,于是AW11和该接口之间的通路会被阻塞,AW11抵达目的地Slave1的延时变得不可控。所以,需要判断新的写地址命令是否会影响当前写地址命令之间的关系:如果新的写地址命令和当前写地址命令会在某一个汇聚接口上汇聚,则须根据动态路由表,判断新的写地址命令是否会提前于(或同时)当前写地址命令抵达汇聚接口,若是,则将该传输路径上的汇聚接口以前的所有写地址命令到在传输路径中的延时更新为原有传输路径中的延时与增量T的和,其中增量T根据实际情况预先设置的;否则,将新的写地址命令的传输路径中的延时置为∞;然后再判断总线是否会产生死锁。The new write address command if possible may exist in the past with the dynamic routing table The address command has an effect such that the delay of the transmission path that could have been calculated by the information of the first timing-converged register slice becomes uncontrollable. Specifically, FIG. 16 is a schematic diagram of another Interconnect module cascaded according to the present invention. As shown in FIG. 16, at the current moment, AW11 arrives at the position in the figure; at this time, Master2 sends AW20 to Slave1 because of the transmission path. The delay, AW20 will arrive at the shadow-filled Master interface in the picture before AW11, so the path between AW11 and the interface will be blocked, and the delay of AW11 reaching the destination Slave1 becomes uncontrollable. Therefore, it is necessary to determine whether the new write address command affects the relationship between the current write address commands: if the new write address command and the current write address command are aggregated on a certain aggregation interface, it is necessary to judge the new according to the dynamic routing table. Whether the write address command advances to the aggregation interface in advance (or at the same time) the current write address command, and if so, updates all previous write address commands of the aggregation interface on the transmission path to the delay in the transmission path to the original transmission. The sum of the delay in the path and the increment T, where the increment T is preset according to the actual situation; otherwise, the delay in the transmission path of the new write address command is set to ∞; then it is judged whether the bus will die. lock.

进一步,本发明提供的防止总线死锁的方法还可以包括设置防止死锁的时间裕量,从而提升防止总线死锁方法的防死锁机制的健壮性。相应的,根据路由表和关系矩阵判断系统总线是否会发生死锁,包括:根据动态路由表、防止死锁的时间裕量和关系矩阵判断系统总线是否会发生死锁。Further, the method for preventing bus deadlock provided by the present invention may further comprise setting a time margin for preventing deadlock, thereby improving the robustness of the anti-deadlock mechanism for preventing the bus deadlock method. Correspondingly, according to the routing table and the relationship matrix, it is determined whether the system bus will be deadlocked, including: determining whether the system bus will deadlock according to the dynamic routing table, the time margin for preventing deadlock, and the relationship matrix.

还需要说明的是,在多个复杂的Interconnect模块级联的系统中,动态路由表维度急剧升高,将直接导致最简死锁子阵的判定复杂度呈几何倍数增加。在这种情况下,可以适当收紧Master发送写地址命令的条件,比如,规定同一个Master只能够同时向M个Slave发起写传输,从而降低动态路由表的维度,使得运算复杂度处于可控范围内。同时,可以考虑将整个级联系统按照传输效率要求的高低程度进行分解降维处理,以减小计算复杂度:对于传输效率要求较高的子系统使用本发明提供的总线死锁的方法;而对于传输效率要求较为宽松的子系统则可以使用NIC400固有的SAS机 制;最后,还可以利用NIC400在单个矩阵的master接口固有的AW通道和W通道之间应用outstanding传输访问机制(至多只允许两笔AW握手成功但W通道未全部握手成功的传输通过),从而达到对整个系统进行分解以达到降维的目的。It should also be noted that in a system with multiple complex Interconnect modules cascaded, the dynamic routing table dimension increases sharply, which directly leads to a geometric multiplication of the decision complexity of the simplest deadlock subarray. In this case, the conditions for the master to send the write address command can be appropriately tightened. For example, the same master can only initiate write transmission to M slaves at the same time, thereby reducing the dimension of the dynamic routing table and making the computational complexity controllable. Within the scope. At the same time, it may be considered to decompose and reduce the entire cascading system according to the level of transmission efficiency requirements, so as to reduce the computational complexity: the subsystem with high transmission efficiency is required to use the bus deadlock method provided by the present invention; For subsystems with looser transmission efficiency requirements, the NIS400 inherent SAS machine can be used. Finally, the NIC400 can also be used to apply the outstanding transfer access mechanism between the AW channel and the W channel inherent in the master interface of a single matrix (up to only two AW handshakes are successful but the W channel does not fully transmit the successful transmission). Achieve the decomposition of the entire system to achieve the purpose of dimensionality reduction.

图17为本发明实施例提供的防止总线死锁的方法的流程图,如图17所示,该方法包括:首先将Master与Slave关系表示成关系矩阵,然后判断该关系矩阵是否包含最简死锁矩阵,如果该关系矩阵不包含最简死锁矩阵,放行Master向Slave发送的写地址命令,如果该关系矩阵包含最简死锁矩阵,将关系矩阵分解为一个或多个最简死锁矩阵,再判断每个最简死锁矩阵是否满足死锁特征,如果一个或多个最简死锁矩阵满足死锁特征,则阻塞相应的产生死锁的写地址命令。FIG. 17 is a flowchart of a method for preventing bus deadlock according to an embodiment of the present invention. As shown in FIG. 17, the method includes: firstly, a relationship between a Master and a Slave is represented as a relationship matrix, and then determining whether the relationship matrix includes the simplest dead. The lock matrix, if the relationship matrix does not contain the simplest deadlock matrix, release the write address command sent by the master to the slave, and if the relation matrix contains the simplest deadlock matrix, the relationship matrix is decomposed into one or more minimal deadlock matrices. Then, it is determined whether each of the simplest deadlock matrices satisfies the deadlock feature. If one or more of the simplest deadlock matrices satisfy the deadlock feature, the corresponding write address command that generates the deadlock is blocked.

本实施例提供的防止总线死锁的方法,将Master与Slave关系表示成关系矩阵,然后判断该关系矩阵是否包含最简死锁矩阵,进而根据最简死锁矩阵阻塞确定并阻塞造成死锁的写地址命令;这样能够有效地识别出正在发生的具有潜在死锁风险的写地址命令,进而有针对性地阻止会造成总线死锁的写地址命令,从而实现了防止总线死锁的目的,同时避免了采取统一防死锁机制的造成的数据吞吐量减少的问题,提高了总线的数据传输效率。The method for preventing bus deadlock in the embodiment provides a relationship between a Master and a Slave as a relationship matrix, and then determines whether the relationship matrix includes a minimal deadlock matrix, and then determines and blocks the deadlock according to the simplest deadlock matrix blocking. Write address command; this can effectively identify the write address command that is at risk of potential deadlock, and thus specifically block the write address command that will cause the bus deadlock, thus achieving the purpose of preventing bus deadlock. The problem of reducing the data throughput caused by the unified anti-deadlock mechanism is avoided, and the data transmission efficiency of the bus is improved.

图18为本发明实施例提供的防止总线死锁的方法的又一流程示意图,如图18所示,该方法包括:FIG. 18 is still another schematic flowchart of a method for preventing bus deadlock according to an embodiment of the present invention. As shown in FIG. 18, the method includes:

步骤501、防止总线死锁的装置建立动态路由表;其中,动态路由表用来记录Master发出的但尚未到达Slave的写地址命令的状态信息。Step 501: The device for preventing bus deadlock establishes a dynamic routing table. The dynamic routing table is configured to record status information of a write address command sent by the master but not yet reach the slave.

步骤502、防止总线死锁的装置根据动态路由表判断Master与Slave之间的关系是否存在先发后至情况;其中,先发后至情况为第一Master向第一Slave发送第一写地址命令的发送时刻小于第二Master向第一Slave发 送第二写地址命令的发送时刻,并且第一写地址命令到达第一Slave的到达时刻大于第二写地址命令到达第一Slave的到达时刻的情况。Step 502: The device for preventing bus deadlock determines whether the relationship between the master and the slave exists in a pre-sentence situation according to the dynamic routing table; wherein, after the first transmission, the first master sends a first write address command to the first slave. The sending time is less than the second master sends the first slave The transmission time of the second write address command is sent, and the arrival time of the first write address command reaching the first slave is greater than the arrival time of the second write address command reaching the first slave.

步骤503、若Master与Slave之间的关系存在先发后至情况,防止总线死锁的装置根据第二写地址命令、第三写地址命令以及第四写地址命令生成增量型关系矩阵;其中,第三写地址命令为发送给第二Slave并且发送时刻大于第二写地址命令的发送时刻的地址命令;第四写地址命令为发送时刻大于第三写地址命令的地址命令。Step 503: If the relationship between the master and the slave is pre-emptive to the situation, the device for preventing the bus deadlock generates the incremental relationship matrix according to the second write address command, the third write address command, and the fourth write address command; The third write address command is an address command sent to the second slave and transmitting a time instant greater than a transmission time of the second write address command; and the fourth write address command is an address command having a transmission time greater than the third write address command.

需要说明的是,若Master与Slave之间的关系存在先发后至情况,分别确定第二写地址命令、第三写地址命令和第四写地址命令表示的Master与Slave之间的关系;若Master与Slave之间的关系为Master向Slave发送写地址命令,在增量型关系矩阵的对应位置设置第一标识;若Master与Slave之间的关系为Master不向Slave发送写地址命令,在增量型关系矩阵的对应位置设置第二标识。It should be noted that, if the relationship between the master and the slave is in the first instance, the relationship between the master and the slave indicated by the second write address command, the third write address command, and the fourth write address command is determined; The relationship between the Master and the Slave is that the Master sends a write address command to the Slave, and sets a first identifier in the corresponding position of the incremental relationship matrix; if the relationship between the Master and the Slave is that the Master does not send a write address command to the Slave, the increase is The corresponding position of the quantity relationship matrix sets the second identifier.

具体的,若写地址命令AWij的发送时刻(表示从Masteri向Slavej发送的AW命令)先于另一个写地址命令AWkj的发送时刻(表示Masterk向Slavej发送的命令),那么,将发往Slavej并且发送时刻晚于AWkj的发送时刻的写地址命令∑Tmj>TkjAWmj(第三写地址命令),和发往任何Slave并且发送时刻晚于AWmj的送时刻的写地址命令∑Tmk>TmjAWmk(第四写地址命令),以及AWkj(第二写地址命令)所代表的Master与Slave之间的关系在增量型关系矩阵的对应位置以第一标识表示。Specifically, if the transmission time of the write address command AW ij (indicating the AW command sent from Masteri to Slavej) precedes the transmission time of another write address command AW kj (indicating the command sent by Masterk to Slavej), then it will be sent to Slavej transmission time and the transmission time is later than the write address AW kj command Σ Tmj> Tkj AW mj (third write address commands), and sent to the Slave and transmits any time later than the time of the write address AW mj send command Σ Tmk >Tmj AW mk (fourth write address command), and the relationship between Master and Slave represented by AW kj (second write address command) is represented by the first identifier at the corresponding position of the incremental relationship matrix.

步骤504、防止总线死锁的装置根据增量型关系矩阵判断总线是否会产生死锁。Step 504: The device for preventing bus deadlock determines whether the bus generates a deadlock according to the incremental relationship matrix.

具体的,步骤504包括:判断增量型关系矩阵的每一行和每一列是否分别存在至少2个第一标识;若增量型关系矩阵的每一行和每一列分别存在至少2个第一标识,确定总线是否会产生死锁。 Specifically, the step 504 includes: determining whether each row and each column of the incremental relationship matrix respectively have at least two first identifiers; if each row and each column of the incremental relationship matrix respectively have at least two first identifiers, Determine if the bus will generate a deadlock.

步骤505、若总线会产生死锁,防止总线死锁的装置确定并阻塞造成死锁的写地址命令。Step 505: If the bus generates a deadlock, the device that prevents the bus deadlock determines and blocks the write address command that caused the deadlock.

本实施例提供的防止总线死锁的方法,建立用来记录Master发出的但尚未到达Slave的写地址命令的状态信息;根据动态路由表判断Master与Slave之间的关系是否存在先发后至情况;若Master与Slave之间的关系存在先发后至情况,根据第二写地址命令、第三写地址命令以及第四写地址命令生成增量型关系矩阵;进而根据增量型关系矩阵断总线是否会产生死锁,确定并阻塞造成死锁的的写地址命令;这样能够以简单的方法有效地识别出正在发生的具有潜在死锁风险的写地址命令,进而有针对性地阻止会造成总线死锁的写地址命令,从而实现了防止总线死锁的目的,同时避免了采取统一防死锁机制的造成的地址吞吐量减少的问题,提高了总线的地址传输效率。The method for preventing bus deadlock provided in this embodiment establishes state information for recording a write address command sent by the master but has not yet reached the slave; and determining whether the relationship between the master and the slave exists after the first occurrence according to the dynamic routing table. If the relationship between the Master and the Slave exists first-hand, the incremental relationship matrix is generated according to the second write address command, the third write address command, and the fourth write address command; and then the bus is broken according to the incremental relationship matrix. Whether a deadlock will occur, determine and block the write address command that caused the deadlock; this can effectively identify the write address command that is at risk of potential deadlock in a simple way, thereby specifically preventing the bus from being caused The write address command of the deadlock realizes the purpose of preventing the bus deadlock, and avoids the problem of reducing the address throughput caused by adopting the unified anti-deadlock mechanism, and improves the address transmission efficiency of the bus.

图19为本发明实施例提供的防止总线死锁的方法的另一流程图,如图19所示,该方法包括:首先判断Master与Slave之间的关系是否存在先发后至情况,如果不存在放行Master向Slave发送的写地址命令,如果存在,建立增量型关系矩阵,然后根据增量型关系矩阵判断总线是否会发生死锁,如果确定会发生死锁,阻塞相应的写地址命令。FIG. 19 is another flowchart of a method for preventing bus deadlock according to an embodiment of the present invention. As shown in FIG. 19, the method includes: first determining whether a relationship between a master and a slave exists after a pre-emptive situation, if not There is a write address command sent by the Master to the Slave. If it exists, an incremental relationship matrix is established, and then the bus is determined to be deadlocked according to the incremental relationship matrix. If it is determined that a deadlock occurs, the corresponding write address command is blocked.

图20为本发明实施例提供的防止总线死锁的应急机制的示意图,该机制用于应对因Interconnect模块参数设置不合理(比如入口的Outstanding深度大于路径中的Outstanding深度),而导致的可能发生在AW命令传输过程中,无竞争访问而出现通路阻塞的状况(自阻塞)。一旦这种情况出现,则会破坏动态路由表中的时序关系和目的地队列表中的预估顺序,形成死锁可能。如图20所示,该机制包括:判断是否由总线是否发生自阻塞,若发生了自阻塞,判断动态路由表中是否存在和被造成自阻塞的写地址命令同Master但不同Slave,且进入Interconnect时间晚于该写地址命令的的其他写地址命 令,如果存在,则阻塞该写地址命令的Master后来发出的写地址命令,如果不存在,则阻塞其他发往该写地址命令的Slave写地址命令。FIG. 20 is a schematic diagram of an emergency mechanism for preventing bus deadlock according to an embodiment of the present invention. The mechanism is configured to cope with an unreasonable parameter setting of an Interconnect module (eg, an Outstanding depth of an entry is greater than an Outstanding depth in a path), which may occur. In the AW command transmission process, there is no competing access and the channel is blocked (self-blocking). Once this happens, it will destroy the timing relationship in the dynamic routing table and the estimated order in the destination queue list, forming a deadlock possibility. As shown in FIG. 20, the mechanism includes: determining whether the self-blocking occurs by the bus. If self-blocking occurs, determining whether the write address command in the dynamic routing table exists and is self-blocking is the same as the master but different from the slave, and enters the Interconnect. The time is later than the other write address of the write address command If so, the write address command issued by the Master that blocks the write address command is blocked, and if it does not exist, the other Slave write address command sent to the write address command is blocked.

图21为本发明实施例提供的另一种防止总线死锁的装置的结构示意图,如图21所示,该装置6包括:FIG. 21 is a schematic structural diagram of another apparatus for preventing bus deadlock according to an embodiment of the present invention. As shown in FIG. 21, the apparatus 6 includes:

预处理模块61,配置为建立动态路由表,其中,动态路由表用来记录主设备Master发出的但尚未到达从设备Slave的写地址命令的状态信息;The pre-processing module 61 is configured to establish a dynamic routing table, where the dynamic routing table is used to record status information of a write address command sent by the master device but not yet reaching the slave device Slave;

判断模块62,配置为根据动态路由表判断总线是否会产生死锁;The determining module 62 is configured to determine, according to the dynamic routing table, whether the bus generates a deadlock;

处理模块63,配置为若总线会产生死锁,确定并阻塞造成死锁的写地址命令。The processing module 63 is configured to determine and block the write address command that caused the deadlock if the bus generates a deadlock.

本实施例提供的防止总线死锁的装置,建立用来记录Master发出的但尚未到达Slave的写地址命令的状态信息的动态路由表;根据动态路由表判断总线是否会产生死锁;若总线会产生死锁,确定并阻塞造成死锁的写地址命令;这样能够有效地识别出正在发生的具有潜在死锁风险的写地址命令,进而有针对性地阻止会造成总线死锁的写地址命令,从而实现了防止总线死锁的目的,同时避免了采取统一防死锁机制的造成的地址吞吐量减少的问题,提高了总线的地址传输效率。The device for preventing bus deadlock provided in this embodiment establishes a dynamic routing table for recording status information of a write address command issued by the master but not yet reaching the slave; determining whether the bus will generate a deadlock according to the dynamic routing table; Generate a deadlock, determine and block the write address command that caused the deadlock; this can effectively identify the write address command that is at risk of potential deadlock, and thus specifically block the write address command that will cause the bus deadlock. Thereby, the purpose of preventing the bus deadlock is achieved, and the problem of reducing the address throughput caused by adopting the unified anti-deadlock mechanism is avoided, and the address transmission efficiency of the bus is improved.

图22为本发明实施例提供的另一种防止总线死锁的装置的结构示意图,如图22所示,判断模块62包括:FIG. 22 is a schematic structural diagram of another apparatus for preventing bus deadlock according to an embodiment of the present invention. As shown in FIG. 22, the determining module 62 includes:

第一处理单元621,配置为根据Master与Slave之间的关系生成关系矩阵;其中,若Master向Slave发送写地址命令,关系矩阵的对应位置为第一标识,若Master不向Slave发送写地址命令,关系矩阵的对应位置为第二标识;The first processing unit 621 is configured to generate a relationship matrix according to the relationship between the master and the slave; wherein, if the master sends a write address command to the slave, the corresponding position of the relationship matrix is the first identifier, if the master does not send the write address command to the slave The corresponding position of the relationship matrix is the second identifier;

第一判断单元622,配置为根据动态路由表和关系矩阵判断总线是否会产生死锁。The first determining unit 622 is configured to determine whether the bus generates a deadlock according to the dynamic routing table and the relationship matrix.

进一步,第一判断单元622,配置为判断关系矩阵是否是死锁矩阵;其 中,死锁矩阵为关系矩阵中能够使总线产生死锁的矩阵;若关系矩阵是死锁矩阵,判断死锁矩阵是否是最简死锁矩阵;其中,最简死锁矩阵为死锁矩阵中能够使总线产生死锁,并且形式最简单的矩阵;若死锁矩阵不是最简死锁矩阵,将死锁矩阵转换成最简死锁矩阵;根据动态路由表和最简死锁矩阵判断总线是否会产生死锁。Further, the first determining unit 622 is configured to determine whether the relationship matrix is a deadlock matrix; The deadlock matrix is a matrix in the relation matrix that can cause the bus to deadlock; if the relation matrix is a deadlock matrix, it is determined whether the deadlock matrix is the simplest deadlock matrix; wherein the simplest deadlock matrix is in the deadlock matrix The bus that can make the bus deadlock and the simplest form; if the deadlock matrix is not the simplest deadlock matrix, convert the deadlock matrix into the simplest deadlock matrix; determine whether the bus is based on the dynamic routing table and the simplest deadlock matrix Will produce a deadlock.

第一判断单元622,还配置为判断关系矩阵的每一行和每一列是否分别存在至少2个第一标识;若关系矩阵的每一行和每一列分别存在至少2个第一标识,确定关系矩阵是死锁矩阵;若关系矩阵的一行或一列不存在至少2个第一标识,确定关系矩阵不是死锁矩阵。The first determining unit 622 is further configured to determine whether each row and each column of the relationship matrix respectively have at least two first identifiers; if each row and each column of the relationship matrix respectively have at least two first identifiers, determining that the relationship matrix is Deadlock matrix; if there is no at least 2 first identifiers in a row or a column of the relationship matrix, it is determined that the relationship matrix is not a deadlock matrix.

第一判断单元622,还配置为若关系矩阵是死锁矩阵,判断死锁矩阵的每一行和每一列是否均存在2个第一标识;若关系矩阵的每一行和每一列均存在2个第一标识,确定死锁矩阵是最简死锁矩阵;若关系矩阵的一行或一列存在多于2个第一标识,确定死锁矩阵不是最简死锁矩阵。The first determining unit 622 is further configured to: if the relationship matrix is a deadlock matrix, determine whether each row and each column of the deadlock matrix have two first identifiers; if each row and each column of the relationship matrix has two An identifier determines that the deadlock matrix is the simplest deadlock matrix; if there are more than two first identifiers in a row or a column of the relationship matrix, it is determined that the deadlock matrix is not the simplest deadlock matrix.

第一判断单元622,还配置为若m×k阶死锁矩阵不是最简死锁矩阵,根据m×k阶死锁矩阵得到

Figure PCTCN2017085136-appb-000018
个i×i阶子矩阵;其中,m、k均为大于1的整数,l=min(m,k),i=2、3…l;从
Figure PCTCN2017085136-appb-000019
个i×i阶子矩阵中筛选出i×i阶死锁矩阵;判断i×i阶死锁矩阵是否是最简死锁矩阵;若i×i阶死锁矩阵不是最简死锁矩阵,将i×i阶死锁矩阵转换成最简死锁矩阵。The first determining unit 622 is further configured to obtain, if the m×k order deadlock matrix is not the simplest deadlock matrix, according to the m×k order deadlock matrix.
Figure PCTCN2017085136-appb-000018
i×i order submatrix; where m and k are integers greater than 1, l=min(m,k), i=2, 3...l;
Figure PCTCN2017085136-appb-000019
The i×i order deadlock matrix is selected in the i×i order submatrix; whether the i×i order deadlock matrix is the simplest deadlock matrix; if the i×i order deadlock matrix is not the simplest deadlock matrix, The i×i order deadlock matrix is converted into the simplest deadlock matrix.

第一判断单元622,还配置为若m×k阶死锁矩阵不是最简死锁矩阵,在m×k阶死锁矩阵中选择i行和i列的数,从所选择的i行和i列的数中选取同时包含在i行和i列中的数并生成i×i阶矩阵;选取

Figure PCTCN2017085136-appb-000020
个i×i阶矩阵,得到
Figure PCTCN2017085136-appb-000021
个i×i阶矩阵。The first determining unit 622 is further configured to select the number of i rows and i columns in the m×k order deadlock matrix if the m×k order deadlock matrix is not the simplest deadlock matrix, from the selected i rows and i Select the number in the i row and the i column and generate the i×i order matrix from the number of columns;
Figure PCTCN2017085136-appb-000020
i×i order matrix, get
Figure PCTCN2017085136-appb-000021
i × i order matrix.

第一判断单元622,还配置为若i×i阶死锁矩阵不是最简死锁矩阵,将i×i阶死锁矩阵中存在多于2个第一标识的行或列中多余的第一标识置位成第二标识,使i×i阶死锁矩阵的每一行和每一列均存在2个第一标识,得到 最简死锁矩阵。The first determining unit 622 is further configured to: if the i×i order deadlock matrix is not the simplest deadlock matrix, the first row or column in the i×i order deadlock matrix has more than two first identifiers. The identifier is set to the second identifier, so that each row and each column of the i×i-order deadlock matrix has two first identifiers, The simplest deadlock matrix.

进一步,写地址命令的状态信息包括源接口的接口名、目的接口的接口名、第一时序收敛寄存器片的信息和第二时序收敛寄存器片的信息,其中,第一时序收敛寄存器片的信息为写地址命令从源接口到达目的接口的传输路径中需经过的时序收敛寄存器片的信息,第二时序收敛寄存器片的信息为当前时刻写地址命令已经过的时序收敛寄存器片的信息,源接口是与发送写地址命令的Master连接的Slave接口,目的接口是与接收写地址命令的Slave相连接的Master接口。Further, the status information of the write address command includes an interface name of the source interface, an interface name of the destination interface, information of the first timing convergence register slice, and information of the second timing convergence register slice, wherein the information of the first timing convergence register slice is The information of the timing convergence register slice that the address command is to pass from the source interface to the transmission path of the destination interface, and the information of the second timing convergence register slice is the information of the timing convergence register slice that the current address write address command has passed, and the source interface is The slave interface connected to the master that sends the write address command. The destination interface is the master interface connected to the slave that receives the write address command.

图23为本发明实施例提供的又一种防止总线死锁的装置的结构示意图,如图23所示,处理模块63包括:FIG. 23 is a schematic structural diagram of another apparatus for preventing bus deadlock according to an embodiment of the present invention. As shown in FIG. 23, the processing module 63 includes:

获取单元631,配置为根据最简死锁矩阵和动态路由表获取Master向Slave发送写地址命令的发送时刻;根据最简死锁矩阵和动态路由表获取Master发送的写地址命令到达Slave的路径中的延时;The obtaining unit 631 is configured to obtain, according to the simplest deadlock matrix and the dynamic routing table, a sending moment that the master sends a write address command to the slave; and obtain a write address command sent by the master to obtain a path of the slave according to the simple deadlock matrix and the dynamic routing table. Delay

第二判断单元632,配置为根据写地址命令的发送时刻和路径中的延时判断Master与Slave之间的关系是否满足死锁特征;其中,死锁特征为第一Master先向第一Slave发送第一写地址命令,后向第二Slave发送第二写地址命令;第二Master先向第二Slave发送第三写地址命令,后向第一slave发送第四写地址命令;并且第二写地址命令先于第三写地址命令到达第二Slave;第四写地址命令先于第一写地址命令到达第一Slave。The second determining unit 632 is configured to determine, according to the sending time of the write address command and the delay in the path, whether the relationship between the master and the slave meets the deadlock feature; wherein the deadlock feature is sent by the first master to the first slave. a first write address command, followed by a second write address command to the second slave; the second master first sends a third write address command to the second slave, and then sends a fourth write address command to the first slave; and the second write address The command arrives at the second slave before the third write address command; the fourth write address command arrives at the first slave before the first write address command.

第二处理单元633,配置为若Master与Slave之间的关系满足死锁特征,确定总线会产生死锁。The second processing unit 633 is configured to determine that the bus will generate a deadlock if the relationship between the Master and the Slave satisfies the deadlock feature.

获取单元631,配置为根据最简死锁矩阵在动态路由表中获取写地址命令的第二时序收敛寄存器片的信息;获取当前时刻的时刻信息;根据当前时刻的时刻信息和第二时序收敛寄存器片的信息,计算Master向Slave发送写地址命令的发送时刻。根据最简死锁矩阵在动态路由表中获取第一时 序收敛寄存器片的信息;根据第一时序收敛寄存器片的信息计算Master发送的写地址命令到达Slave的传输路径中的延时。The obtaining unit 631 is configured to obtain information of the second timing convergence register slice of the write address command in the dynamic routing table according to the simplest deadlock matrix; acquire time information of the current time; and time information according to the current time and the second timing convergence register The information of the slice calculates the transmission time at which the master sends a write address command to the slave. Get the first time in the dynamic routing table according to the simplest deadlock matrix The sequence converges the information of the register slice; and calculates the delay in the transmission path of the write address command sent by the master to the slave according to the information of the first timing convergence register slice.

第二判断单元632,配置为判断第一Master向第一Slave发送第一写地址命令的发送时刻是否小于第一Master向第二Slave发送第二写地址命令的发送时刻;判断第二Master向第二Slave发送第三写地址命令的发送时刻是否小于第二Master向第一Slave发送的第四写地址命令的发送时刻;判断第二写地址命令到达第二Slave的到达时刻是否小于第三写地址命令到达第二Slave的到达时刻,判断第四写地址命令到达第一Slave的到达时刻是否小于第一写地址命令到达第一Slave的到达时刻;The second determining unit 632 is configured to determine whether the sending time of the first write address command sent by the first master to the first slave is smaller than the sending time of the second write address command sent by the first master to the second slave; Whether the sending time of the second slave address command is less than the sending time of the fourth write address command sent by the second master to the first slave; determining whether the arrival time of the second write address command reaching the second slave is less than the third write address When the command reaches the arrival time of the second slave, determining whether the arrival time of the fourth write address command reaching the first slave is less than the arrival time of the first write address command reaching the first slave;

若第一Master向第二Slave发送第二写地址命令的发送时刻大于第一Master向第一Slave发送第一写地址命令的发送时刻,且第二写地址命令到达第二Slave的到达时刻小于第三写地址命令到达第二Slave的到达时刻;并且,第二Master向第一Slave发送第四写地址命令的发送时刻大于第二Master向第二Slave发送第三写地址命令的时刻,且第四写地址命令到达第一Slave的时刻小于第一写地址命令到达第一Slave的时刻;确定Master与Slave之间的关系满足死锁特征。If the sending time of the first write address command sent by the first master to the second slave is greater than the sending time of the first write address command sent by the first master to the first slave, and the arrival time of the second write address command reaching the second slave is less than the The third write address command arrives at the arrival time of the second slave; and, the second master sends the fourth write address command to the first slave, the transmission time is greater than the second master sends the third write address command to the second slave, and the fourth The time at which the write address command arrives at the first slave is less than the time at which the first write address command arrives at the first slave; it is determined that the relationship between the master and the slave satisfies the deadlock feature.

本实施例提供的防止总线死锁的装置,建立用来记录Master发出的但尚未到达Slave的写地址命令的状态信息的动态路由表;根据Master与Slave之间的关系生成关系矩阵;判断关系矩阵是否是最简死锁矩阵;若关系矩阵不是最简死锁矩阵,将关系矩阵转换成最简死锁矩阵;根据动态路由表和最简死锁矩阵判断总线是否会产生死锁;若总线会产生死锁,确定并阻塞造成死锁的写地址命令;这样能够有效地识别出正在发生的具有潜在死锁风险的写地址命令,进而有针对性地阻止会造成总线死锁的写地址命令,从而实现了防止总线死锁的目的,同时避免了采取统一防死锁机制的造成的数据吞吐量减少的问题,提高了总线的数据传输效率。 The device for preventing bus deadlock provided in this embodiment establishes a dynamic routing table for recording state information of a write address command sent by the master but not yet reaching the slave; generating a relationship matrix according to the relationship between the master and the slave; determining the relationship matrix Whether it is the simplest deadlock matrix; if the relational matrix is not the simplest deadlock matrix, the relational matrix is converted into the simplest deadlock matrix; according to the dynamic routing table and the simplest deadlock matrix, it is judged whether the bus will generate a deadlock; Generate a deadlock, determine and block the write address command that caused the deadlock; this can effectively identify the write address command that is at risk of potential deadlock, and thus specifically block the write address command that will cause the bus deadlock. Thereby, the purpose of preventing the bus deadlock is achieved, and the problem of reducing the data throughput caused by the unified anti-deadlock mechanism is avoided, and the data transmission efficiency of the bus is improved.

图24为本发明实施例提供的又一种防止总线死锁的装置的结构示意图,如图24所示,判断模块62包括:FIG. 24 is a schematic structural diagram of another apparatus for preventing bus deadlock according to an embodiment of the present invention. As shown in FIG. 24, the determining module 62 includes:

第三判断单元623,配置为根据动态路由表判断Master与Slave之间的关系是否存在先发后至情况;其中,先发后至情况为第一Master向第一Slave发送第一写地址命令的发送时刻小于第二Master向第一Slave发送第二写地址命令的发送时刻,并且第一写地址命令到达第一Slave的到达时刻大于第二写地址命令到达第一Slave的到达时刻的情况;根据增量型关系矩阵断总线是否会产生死锁;The third determining unit 623 is configured to determine, according to the dynamic routing table, whether the relationship between the master and the slave exists after the first transmission; wherein, after the first transmission, the first master sends the first write address command to the first slave. The sending time is less than the sending time at which the second master sends the second write address command to the first slave, and the arrival time of the first write address command reaching the first slave is greater than the arrival time of the second write address command reaching the first slave; Whether the incremental relationship matrix breaks the bus to generate a deadlock;

第三处理单元624,配置为若Master与Slave之间的关系存在先发后至情况,根据第二写地址命令、第三写地址命令以及第四写地址命令生成增量型关系矩阵;其中,第三写地址命令为发送给第二Slave并且发送时刻大于第二写地址命令的发送时刻的地址命令;第四写地址命令为发送时刻大于第三写地址命令的地址命令。The third processing unit 624 is configured to generate an incremental relationship matrix according to the second write address command, the third write address command, and the fourth write address command, if the relationship between the master and the slave is pre-emptive to the situation; The third write address command is an address command sent to the second slave and transmitting a time instant greater than the transmission time of the second write address command; and the fourth write address command is an address command having a transmission time greater than the third write address command.

进一步,第三处理单元624,配置为若Master与Slave之间的关系存在先发后至情况,分别确定第二写地址命令、第三写地址命令和第四写地址命令表示的Master与Slave之间的关系;若Master与Slave之间的关系为Master向Slave发送写地址命令,在增量型关系矩阵的对应位置设置第一标识;若Master与Slave之间的关系为Master不向Slave发送写地址命令,在增量型关系矩阵的对应位置设置第二标识。。Further, the third processing unit 624 is configured to determine that the relationship between the master and the slave has a pre-send condition, and determine the master and slave respectively indicated by the second write address command, the third write address command, and the fourth write address command. If the relationship between the master and the slave is that the master sends a write address command to the slave, the first identifier is set at the corresponding position of the incremental relationship matrix; if the relationship between the master and the slave is that the master does not send the write to the slave The address command sets a second identifier at a corresponding position of the incremental relationship matrix. .

第三判断单元623,配置为判断增量型关系矩阵的每一行和每一列是否分别存在至少2个第一标识;若增量型关系矩阵的每一行和每一列分别存在至少2个第一标识,确定总线是否会产生死锁。The third determining unit 623 is configured to determine whether each row and each column of the incremental relationship matrix respectively have at least two first identifiers; if each row and each column of the incremental relationship matrix respectively have at least two first identifiers Determine if the bus will generate a deadlock.

本实施例提供的防止总线死锁的装置,建立用来记录Master发出的但尚未到达Slave的写地址命令的状态信息;根据动态路由表判断Master与Slave之间的关系是否存在先发后至情况;若Master与Slave之间的关系存 在先发后至情况,根据第二写地址命令、第三写地址命令以及第四写地址命令生成增量型关系矩阵;进而根据增量型关系矩阵断总线是否会产生死锁,确定并阻塞造成死锁的写地址命令;这样能够以简单的方法有效地识别出正在发生的具有潜在死锁风险的写地址命令,进而有针对性地阻止会造成总线死锁的写地址命令,从而实现了防止总线死锁的目的,同时避免了采取统一防死锁机制的造成的数据吞吐量减少的问题,提高了总线的数据传输效率。The device for preventing bus deadlock provided in this embodiment establishes state information for recording a write address command sent by the master but has not yet reached the slave; and determining whether the relationship between the master and the slave exists after the first occurrence according to the dynamic routing table. If the relationship between Master and Slave exists After the first transmission to the situation, the incremental relationship matrix is generated according to the second write address command, the third write address command, and the fourth write address command; and further, according to the incremental relationship matrix, whether the bus will generate a deadlock, determine and block A write address command that causes a deadlock; this can effectively identify a write address command that is at risk of a potential deadlock in a simple way, thereby specifically preventing a write address command that would cause a bus deadlock, thereby implementing The purpose of preventing bus deadlock is to avoid the problem of data throughput reduction caused by adopting a unified anti-deadlock mechanism, and improve the data transmission efficiency of the bus.

在实际应用中,所述预处理模块61、判断模块62、第一处理单元621、第一判断单元622、第三判断单元623、第三处理单元624、处理模块63、获取单元631、第二判断单元632、第二处理单元633,均可由位于缓存空间的管理装置中的中央处理器(Central Processing Unit,CPU)、微处理器(Micro Processor Unit,MPU)、数字信号处理器(Digital Signal Processor,DSP)或现场可编程门阵列(Field Programmable Gate Array,FPGA)等实现。In an actual application, the pre-processing module 61, the determining module 62, the first processing unit 621, the first determining unit 622, the third determining unit 623, the third processing unit 624, the processing module 63, the obtaining unit 631, and the second The determining unit 632 and the second processing unit 633 may each be a central processing unit (CPU), a microprocessor (Micro Processor Unit (MPU), and a digital signal processor (Digital Signal Processor) located in the management device of the cache space. , DSP) or Field Programmable Gate Array (FPGA) implementation.

图25为本发明实施例提供的又一种防止总线死锁的装置的结构示意图,如图25所示,该装置7包括:FIG. 25 is a schematic structural diagram of another apparatus for preventing bus deadlock according to an embodiment of the present invention. As shown in FIG. 25, the apparatus 7 includes:

Interconnect模块71,配置为运行Master向Slave发送的写地址命令。The Interconnect module 71 is configured to run a write address command sent by the Master to the Slave.

监测模块72,配置为监测Interconnect系统模块71的运行情况。The monitoring module 72 is configured to monitor the operation of the Interconnect system module 71.

判断模块73,配置为根据监测模块72所监测的情况判断Interconnect系统中是否发产生总线死锁。The determining module 73 is configured to determine whether a bus deadlock is generated in the Interconnect system according to the condition monitored by the monitoring module 72.

阻塞模块74,配置为阻塞引起总线死锁的写地址命令。The blocking module 74 is configured to block a write address command that causes a bus deadlock.

在实际应用中,Interconnect模块71、监测模块72、判断模块73、阻塞模块74,均可由位于缓存空间的管理装置中的CPU、MPU、DSP或FPGA等实现。In an actual application, the Interconnect module 71, the monitoring module 72, the judging module 73, and the blocking module 74 can be implemented by a CPU, an MPU, a DSP, an FPGA, or the like located in a management device of the cache space.

本发明实施例中,如果以软件功能模块的形式实现上述减少时延的方 法,并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明实施例的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机、服务器、或者网络设备等)执行本发明各个实施例所述方法的全部或部分。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read Only Memory,ROM)、磁碟或者光盘等各种可以存储程序代码的介质。这样,本发明实施例不限制于任何特定的硬件和软件结合。In the embodiment of the present invention, if the method for reducing the delay is implemented in the form of a software function module The law, when sold or used as a stand-alone product, can also be stored on a computer readable storage medium. Based on such understanding, the technical solution of the embodiments of the present invention may be embodied in the form of a software product in essence or in the form of a software product stored in a storage medium, including a plurality of instructions. A computer device (which may be a personal computer, server, or network device, etc.) is caused to perform all or part of the methods described in various embodiments of the present invention. The foregoing storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read only memory (ROM), a magnetic disk, or an optical disk. Thus, embodiments of the invention are not limited to any specific combination of hardware and software.

相应地,本发明实施例还提供一种计算机存储介质,该计算机存储介质中存储有计算机程序,该计算机程序用于执行本发明实施例的上述防止总线死锁的方法。Correspondingly, the embodiment of the present invention further provides a computer storage medium, where the computer storage medium stores a computer program for performing the above method for preventing bus deadlock in the embodiment of the present invention.

本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention can take the form of a hardware embodiment, a software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.

本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (system), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device. Means for implementing the functions specified in one or more of the flow or in a block or blocks of the flow chart.

这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理 设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions can also be stored in a bootable computer or other programmable data processing The apparatus is readable in a computer readable memory in a particular manner such that instructions stored in the computer readable memory produce an article of manufacture comprising instruction means implemented in one or more flows and/or block diagrams of the flowchart The function specified in the box or in multiple boxes.

这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device. The instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.

以上,仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。The above is only the preferred embodiment of the present invention and is not intended to limit the scope of the present invention.

工业实用性Industrial applicability

本发明实施例建立动态路由表,其中,所述动态路由表用来记录主设备Master发出的但未到达从设备Slave的写地址命令的状态信息;根据所述动态路由表判断总线是否会产生死锁;若所述总线会产生死锁,确定并阻塞造成死锁的所述写地址命令。如此,能够有针对性地阻止会造成总线死锁的写地址命令,实现了防止总线死锁的目的,同时避免了采取统一防死锁机制的造成的数据吞吐量减少的问题,提高了总线的数据传输效率。 The embodiment of the present invention establishes a dynamic routing table, wherein the dynamic routing table is used to record state information of a write address command sent by the master device but not reaching the slave device Slave; and determining whether the bus is dead according to the dynamic routing table. a lock; if the bus generates a deadlock, the write address command that caused the deadlock is determined and blocked. In this way, the write address command that causes the bus deadlock can be blocked in a targeted manner, thereby preventing the bus deadlock, and avoiding the problem of reducing the data throughput caused by the unified anti-deadlock mechanism, and improving the bus. Data transmission efficiency.

Claims (25)

一种防止总线死锁的方法,所述方法包括:A method of preventing bus deadlock, the method comprising: 建立动态路由表,其中,所述动态路由表用来记录主设备Master发出的但未到达从设备Slave的写地址命令的状态信息;Establishing a dynamic routing table, where the dynamic routing table is used to record state information of a write address command sent by the master device but not reaching the slave device slave; 根据所述动态路由表判断总线是否会产生死锁;Determining whether the bus will generate a deadlock according to the dynamic routing table; 若所述总线会产生死锁,确定并阻塞造成死锁的所述写地址命令。If the bus generates a deadlock, the write address command that caused the deadlock is determined and blocked. 根据权利要求1所述的方法,其中,所述根据所述动态路由表判断总线是否会产生死锁包括:The method of claim 1, wherein said determining, based on said dynamic routing table, whether a bus will generate a deadlock comprises: 根据Master与Slave之间的关系生成关系矩阵;其中,若所述Master向所述Slave发送写地址命令,所述关系矩阵的对应位置为第一标识,若所述Master不向所述Slave发送所述写地址命令,所述关系矩阵的对应位置为第二标识;Generating a relationship matrix according to the relationship between the master and the slave; wherein, if the master sends a write address command to the slave, the corresponding position of the relationship matrix is a first identifier, if the master does not send the location to the slave Describe an address command, where a corresponding location of the relationship matrix is a second identifier; 根据所述动态路由表和所述关系矩阵判断总线是否会产生死锁。Determining whether the bus will generate a deadlock according to the dynamic routing table and the relationship matrix. 根据权利要求2所述的方法,其中,所述根据所述动态路由表和所述关系矩阵判断总线是否会产生死锁,包括:The method of claim 2, wherein the determining whether the bus generates a deadlock according to the dynamic routing table and the relationship matrix comprises: 判断所述关系矩阵是否是死锁矩阵;其中,所述死锁矩阵为所述关系矩阵中能够使所述总线产生死锁的矩阵;Determining whether the relationship matrix is a deadlock matrix; wherein the deadlock matrix is a matrix in the relationship matrix that can cause the bus to generate a deadlock; 若所述关系矩阵是所述死锁矩阵,判断所述死锁矩阵是否是最简死锁矩阵;其中,所述最简死锁矩阵为所述死锁矩阵中能够使所述总线产生死锁,并且形式最简单的矩阵;If the relationship matrix is the deadlock matrix, determining whether the deadlock matrix is a simplest deadlock matrix; wherein the simplest deadlock matrix is that the deadlock matrix can cause the bus to generate a deadlock And the simplest form of matrix; 若所述死锁矩阵不是所述最简死锁矩阵,将所述死锁矩阵转换成所述最简死锁矩阵;If the deadlock matrix is not the simplest deadlock matrix, converting the deadlock matrix into the simplest deadlock matrix; 根据所述动态路由表和所述最简死锁矩阵判断所述总线是否会产生死锁。 Determining whether the bus generates a deadlock according to the dynamic routing table and the simplest deadlock matrix. 根据权利要求3所述的方法,其中,所述判断所述关系矩阵是否是死锁矩阵,包括:The method of claim 3, wherein the determining whether the relationship matrix is a deadlock matrix comprises: 判断所述关系矩阵的每一行和每一列是否分别存在至少2个所述第一标识;Determining whether there are at least two of the first identifiers in each row and each column of the relationship matrix; 若所述关系矩阵的每一行和每一列分别存在至少2个所述第一标识,确定所述关系矩阵是所述死锁矩阵;If there are at least two first identifiers in each row and each column of the relationship matrix, determining that the relationship matrix is the deadlock matrix; 若所述关系矩阵的一行或一列不存在至少2个所述第一标识,确定所述关系矩阵不是所述死锁矩阵。If at least two of the first identifiers do not exist in a row or a column of the relationship matrix, it is determined that the relationship matrix is not the deadlock matrix. 根据权利要求4所述的方法,其中,所述若所述关系矩阵是所述死锁矩阵,判断所述死锁矩阵是否是最简死锁矩阵,包括:The method according to claim 4, wherein if the relationship matrix is the deadlock matrix, determining whether the deadlock matrix is a minimalist deadlock matrix comprises: 若所述关系矩阵是所述死锁矩阵,判断所述死锁矩阵的每一行和每一列是否均存在2个所述第一标识;If the relationship matrix is the deadlock matrix, determine whether each of the row and each column of the deadlock matrix has two first identifiers; 若所述关系矩阵的每一行和每一列均存在2个所述第一标识,确定所述死锁矩阵是所述最简死锁矩阵;If there are two first identifiers in each row and each column of the relationship matrix, determining that the deadlock matrix is the simplest deadlock matrix; 若所述关系矩阵的一行或一列存在多于2个所述第一标识,确定所述死锁矩阵不是所述最简死锁矩阵。If there are more than two of the first identifiers in a row or a column of the relationship matrix, it is determined that the deadlock matrix is not the simplest deadlock matrix. 根据权利要求5所述的方法,其中,所述若所述死锁矩阵不是所述最简死锁矩阵,将所述死锁矩阵转换成所述最简死锁矩阵,包括:The method of claim 5, wherein if the deadlock matrix is not the simplest deadlock matrix, converting the deadlock matrix to the minimalistic deadlock matrix comprises: 若m×k阶死锁矩阵不是所述最简死锁矩阵,根据所述m×k阶死锁矩阵得到
Figure PCTCN2017085136-appb-100001
个i×i阶子矩阵;其中,m、k均为大于1的整数,l=min(m,k),i=2、3…l;
If the m×k order deadlock matrix is not the simplest deadlock matrix, according to the m×k order deadlock matrix
Figure PCTCN2017085136-appb-100001
i×i order submatrix; wherein m and k are integers greater than 1, l=min(m,k), i=2, 3...l;
从所述
Figure PCTCN2017085136-appb-100002
个i×i阶子矩阵中筛选出i×i阶死锁矩阵;
From the stated
Figure PCTCN2017085136-appb-100002
The i×i order deadlock matrix is selected in the i×i order submatrices;
判断所述i×i阶死锁矩阵是否是所述最简死锁矩阵;Determining whether the i×i order deadlock matrix is the simplest deadlock matrix; 若所述i×i阶死锁矩阵不是所述最简死锁矩阵,将所述i×i阶死锁矩阵转换成所述最简死锁矩阵。 If the i×i order deadlock matrix is not the simplest deadlock matrix, the i×i order deadlock matrix is converted into the simplest deadlock matrix.
根据权利要求6所述的方法,其中,所述若m×k阶死锁矩阵不是所述最简死锁矩阵,根据所述m×k阶死锁矩阵得到
Figure PCTCN2017085136-appb-100003
个i×i阶子矩阵,包括:
The method according to claim 6, wherein said m×k order deadlock matrix is not said simplest deadlock matrix, and is obtained according to said m×k order deadlock matrix
Figure PCTCN2017085136-appb-100003
i×i order sub-matrices, including:
若m×k阶死锁矩阵不是最简死锁矩阵,在所述m×k阶死锁矩阵中选择i行和i列的数,从所选择的i行和i列的数中选取同时包含在所述i行和i列中的数并生成所述i×i阶矩阵;If the m×k order deadlock matrix is not the simplest deadlock matrix, the number of i rows and i columns is selected in the m×k order deadlock matrix, and the selected i row and i column numbers are selected and included. Generating the numbers in the i rows and i columns and generating the i×i order matrix; 选取
Figure PCTCN2017085136-appb-100004
个所述i×i阶矩阵,得到所述
Figure PCTCN2017085136-appb-100005
个i×i阶矩阵。
Select
Figure PCTCN2017085136-appb-100004
The i×i order matrix, resulting in the
Figure PCTCN2017085136-appb-100005
i × i order matrix.
根据权利要求6所述的方法,其中,所述若所述i×i阶死锁矩阵不是所述最简死锁矩阵,将所述i×i阶死锁矩阵转换成所述最简死锁矩阵,包括:The method according to claim 6, wherein said if said i x i order deadlock matrix is not said simplest deadlock matrix, said i x i order deadlock matrix is converted to said minimalist deadlock Matrix, including: 若所述i×i阶死锁矩阵不是所述最简死锁矩阵,将所述i×i阶死锁矩阵中存在多于2个所述第一标识的行或列中多余的所述第一标识置位成所述第二标识,使所述i×i阶死锁矩阵的每一行和每一列均存在2个所述第一标识,得到所述最简死锁矩阵。If the i×i order deadlock matrix is not the simplest deadlock matrix, there are more than two of the first identified rows or columns in the i×i order deadlock matrix. An identifier is set to the second identifier, so that each of the row and each column of the i×i-order deadlock matrix has two first identifiers, to obtain the simplest deadlock matrix. 根据权利要求3所述的方法,其中,所述写地址命令的状态信息包括源接口的接口名、目的接口的接口名、第一时序收敛寄存器片的信息和第二时序收敛寄存器片的信息,其中,所述第一时序收敛寄存器片的信息为所述写地址命令从所述源接口到达所述目的接口的传输路径中需经过的时序收敛寄存器片的信息,所述第二时序收敛寄存器片的信息为当前时刻所述写地址命令已经过的时序收敛寄存器片的信息,所述源接口是与发送所述写地址命令的所述Master连接的Slave接口,所述目的接口是与接收所述写地址命令的所述Slave相连接的Master接口。The method of claim 3, wherein the state information of the write address command comprises an interface name of the source interface, an interface name of the destination interface, information of the first timing closure register slice, and information of the second timing closure register slice. The information of the first timing convergence register slice is information of a timing convergence register slice that the write address command needs to pass from the source interface to the transmission path of the destination interface, and the second timing convergence register fragment The information is the information of the timing convergence register slice that the address command has passed at the current time, the source interface is a slave interface connected to the master that sends the write address command, and the destination interface is Write the master interface of the Slave connected to the address command. 根据权利要求9所述的方法,其中,所述根据所述动态路由表和所述最简死锁矩阵判断所述总线是否会产生死锁,包括:The method of claim 9, wherein the determining whether the bus generates a deadlock according to the dynamic routing table and the minimalist deadlock matrix comprises: 根据所述最简死锁矩阵和所述动态路由表获取所述Master向所述Slave 发送所述写地址命令的发送时刻;Obtaining the master to the slave according to the simplest deadlock matrix and the dynamic routing table Sending a transmission time of the write address command; 根据所述最简死锁矩阵和所述动态路由表获取所述Master发送的所述写地址命令到达所述Slave的路径中的延时;Acquiring, according to the simplest deadlock matrix and the dynamic routing table, a delay in a path that the write address command sent by the master reaches the slave; 根据所述写地址命令的发送时刻和所述路径中的延时判断所述Master与所述Slave之间的关系是否满足死锁特征;其中,所述死锁特征为第一Master先向第一Slave发送第一写地址命令,后向第二Slave发送第二写地址命令;第二Master先向所述第二Slave发送第三写地址命令,后向所述第一slave发送第四写地址命令;并且所述第二写地址命令先于所述第三写地址命令到达所述第二Slave;所述第四写地址命令先于所述第一写地址命令到达所述第一Slave。Determining, according to the sending moment of the write address command and the delay in the path, whether the relationship between the master and the slave meets a deadlock feature; wherein the deadlock feature is the first master first Slave sends a first write address command, and then sends a second write address command to the second slave; the second master first sends a third write address command to the second slave, and then sends a fourth write address command to the first slave. And the second write address command arrives at the second slave before the third write address command; the fourth write address command arrives at the first slave before the first write address command. 若所述Master与Slave之间的关系满足死锁特征,确定所述总线会产生死锁。If the relationship between the Master and the Slave satisfies the deadlock feature, it is determined that the bus will generate a deadlock. 根据权利要求10所述的方法,其中,所述根据所述最简死锁矩阵和所述动态路由表获取所述Master向所述Slave发送写地址命令的发送时刻,包括:The method of claim 10, wherein the obtaining, by the simplest deadlock matrix and the dynamic routing table, a sending moment that the master sends a write address command to the slave comprises: 根据所述最简死锁矩阵在所述动态路由表中获取所述写地址命令的第二时序收敛寄存器片的信息;Acquiring information of the second timing convergence register slice of the write address command in the dynamic routing table according to the simplest deadlock matrix; 获取当前时刻的时刻信息;Obtaining time information of the current moment; 根据所述当前时刻的时刻信息和所述第二时序收敛寄存器片的信息,计算所述Master向所述Slave发送写地址命令的发送时刻。And calculating, according to the time information of the current time and the information of the second timing convergence register slice, a transmission time at which the master sends a write address command to the slave. 根据权利要求10所述的方法,其中,所述根据所述最简死锁矩阵和所述动态路由表获取所述Master发送的所述写地址命令到达所述Slave的路径中的延时,包括:The method according to claim 10, wherein the obtaining, in accordance with the simplest deadlock matrix and the dynamic routing table, a delay in a path of the write address command sent by the master to the slave, including : 根据所述最简死锁矩阵在所述动态路由表中获取第一时序收敛寄存器片的信息; Obtaining information of the first timing convergence register slice in the dynamic routing table according to the simplest deadlock matrix; 根据所述第一时序收敛寄存器片的信息计算所述Master发送的所述写地址命令到达所述Slave的传输路径中的延时。And calculating a delay in the transmission path of the write address command sent by the master to the slave according to the information of the first timing convergence register slice. 根据权利要求12所述的方法,其中,所述根据所述写地址命令的发送时刻和所述路径中的延时判断所述Master与所述Slave之间的关系是否满足死锁特征,包括:The method of claim 12, wherein the determining whether the relationship between the master and the slave meets a deadlock feature according to a sending moment of the write address command and a delay in the path comprises: 判断所述第一Master向所述第一Slave发送所述第一写地址命令的发送时刻是否小于所述第一Master向所述第二Slave发送所述第二写地址命令的发送时刻;Determining whether the sending time of the first write address command sent by the first master to the first slave is less than the sending time of the first master sending the second write address command to the second slave; 判断所述第二Master向所述第二Slave发送所述第三写地址命令的发送时刻是否小于所述第二Master向所述第一Slave发送的所述第四写地址命令的发送时刻;Determining whether the sending time of the third master sending the third write address command to the second slave is smaller than the sending time of the fourth write address command sent by the second master to the first slave; 判断所述第二写地址命令到达所述第二Slave的到达时刻是否小于所述第三写地址命令到达所述第二Slave的到达时刻;Determining whether an arrival time of the second write address command to reach the second slave is less than an arrival time of the third write address command reaching the second slave; 判断所述第四写地址命令到达所述第一Slave的到达时刻是否小于所述第一写地址命令到达所述第一Slave的到达时刻;Determining whether an arrival time of the fourth write address command to reach the first slave is less than an arrival time of the first write address command to reach the first slave; 若所述第一Master向所述第二Slave发送所述第二写地址命令的发送时刻大于所述第一Master向所述第一Slave发送所述第一写地址命令的发送时刻,且所述第二写地址命令到达所述第二Slave的到达时刻小于所述第三写地址命令到达所述第二Slave的到达时刻;并且,所述第二Master向所述第一Slave发送所述第四写地址命令的发送时刻大于所述第二Master向所述第二Slave发送所述第三写地址命令的时刻,且所述第四写地址命令到达所述第一Slave的时刻小于所述第一写地址命令到达所述第一Slave的时刻;确定所述Master与Slave之间的关系满足死锁特征。And sending, by the first master, the sending time of the second write address command to the second slave is greater than the sending time of the first master sending the first write address command to the first slave, and The arrival time of the second write address command reaching the second slave is less than the arrival time of the third write address command reaching the second slave; and the second master sends the fourth to the first slave The sending time of the write address command is greater than the time when the second master sends the third write address command to the second slave, and the time when the fourth write address command reaches the first slave is less than the first The time at which the write address command arrives at the first slave; determining that the relationship between the master and the slave satisfies the deadlock feature. 根据权利要求1所述的方法,其中,所述方法根据所述动态路由表判断总线是否会产生死锁,包括: The method of claim 1, wherein the method determines whether the bus generates a deadlock according to the dynamic routing table, including: 根据所述动态路由表判断Master与Slave之间的关系是否存在先发后至情况;其中,所述先发后至情况为第一Master向第一Slave发送第一写地址命令的发送时刻小于第二Master向第一Slave发送第二写地址命令的发送时刻,并且所述第一写地址命令到达第一Slave的到达时刻大于所述第二写地址命令到达第一Slave的到达时刻的情况;Determining, according to the dynamic routing table, whether the relationship between the master and the slave exists in a pre-emptive manner; wherein, after the first sending, the sending time of the first master sending the first write address command to the first slave is smaller than the first The second master sends a sending moment of the second write address command to the first slave, and the arrival time of the first write address command reaching the first slave is greater than the arrival time of the second write address command reaching the first slave; 若所述Master与Slave之间的关系存在所述先发后至情况,根据所述第二写地址命令、第三写地址命令以及第四写地址命令生成增量型关系矩阵;其中,所述第三写地址命令为发送给第二Slave并且发送时刻大于所述第二写地址命令的发送时刻的写命令;所述第四写地址命令为发送时刻大于所述第三写地址命令的写命令;And if the relationship between the master and the slave exists in the pre-sending to the situation, generating an incremental relationship matrix according to the second write address command, the third write address command, and the fourth write address command; wherein The third write address command is a write command sent to the second slave and transmitting a time greater than a sending time of the second write address command; the fourth write address command is a write command having a sending time greater than the third write address command ; 根据所述增量型关系矩阵判断总线是否会产生死锁。Judging whether the bus will generate a deadlock according to the incremental relationship matrix. 根据权利要求14所述的方法,其中,所述若所述Master与Slave之间的关系存在所述先发后至情况,根据所述第二写地址命令、第三写地址命令以及第四写地址命令生成增量型关系矩阵,包括:The method according to claim 14, wherein if the relationship between the Master and the Slave exists in the pre-sending to the case, according to the second write address command, the third write address command, and the fourth write The address command generates an incremental relationship matrix, including: 若所述Master与Slave之间的关系存在所述先发后至情况,分别确定所述第二写地址命令、所述第三写地址命令和所述第四写地址命令表示的Master与Slave之间的关系;If the relationship between the master and the slave exists in the pre-sending to the case, determine the master and the slave represented by the second write address command, the third write address command, and the fourth write address command, respectively. Relationship between 若所述Master与Slave之间的关系为所述Master向所述Slave发送写地址命令,在所述增量型关系矩阵的对应位置设置第一标识;If the relationship between the master and the slave is that the master sends a write address command to the slave, setting a first identifier at a corresponding position of the incremental relationship matrix; 若所述Master与Slave之间的关系为所述Master不向所述Slave发送写地址命令,在所述增量型关系矩阵的对应位置设置第二标识。If the relationship between the master and the slave is that the master does not send a write address command to the slave, a second identifier is set at a corresponding position of the incremental relationship matrix. 根据权利要求15所述的方法,其中,所述根据所述增量型关系矩阵判断总线是否会产生死锁,包括:The method according to claim 15, wherein said determining whether the bus generates a deadlock according to said incremental relationship matrix comprises: 判断所述增量型关系矩阵的每一行和每一列是否分别存在至少2个所述第一标识; Determining whether there are at least two of the first identifiers in each row and each column of the incremental relationship matrix; 若所述增量型关系矩阵的每一行和每一列分别存在至少2个所述第一标识,确定所述总线是否会产生死锁。If there are at least two of the first identifiers in each row and each column of the incremental relationship matrix, it is determined whether the bus will generate a deadlock. 一种防止总线死锁的装置,所述装置包括:A device for preventing bus deadlock, the device comprising: 预处理模块,配置为建立动态路由表,其中,所述动态路由表用来记录主设备Master发出的但尚未到达从设备Slave的写地址命令的状态信息;a pre-processing module configured to establish a dynamic routing table, where the dynamic routing table is used to record status information of a write address command sent by the master device but not yet reaching the slave device slave; 判断模块,配置为根据所述动态路由表判断总线是否会产生死锁;The determining module is configured to determine, according to the dynamic routing table, whether the bus generates a deadlock; 处理模块,配置为若所述总线会产生死锁,确定并阻塞造成死锁的所述写地址命令。The processing module is configured to determine and block the write address command causing the deadlock if the bus generates a deadlock. 根据权利要求17所述的装置,其中,所述判断模块包括:The apparatus of claim 17, wherein the determining module comprises: 第一处理单元,配置为根据Master与Slave之间的关系生成关系矩阵;其中,若所述Master向所述Slave发送写地址命令,所述关系矩阵的对应位置为第一标识,若所述Master不向所述Slave发送所述写地址命令,所述关系矩阵的对应位置为第二标识;a first processing unit, configured to generate a relationship matrix according to a relationship between the master and the slave; wherein, if the master sends a write address command to the slave, the corresponding position of the relationship matrix is a first identifier, if the master Not sending the write address command to the slave, where a corresponding location of the relationship matrix is a second identifier; 第一判断单元,配置为根据所述动态路由表和所述关系矩阵判断总线是否会产生死锁。The first determining unit is configured to determine whether the bus generates a deadlock according to the dynamic routing table and the relationship matrix. 根据要求18所述的装置,其中,The device of claim 18, wherein 所述第一判断单元,配置为判断所述关系矩阵是否是死锁矩阵;其中,所述死锁矩阵为所述关系矩阵中能够使所述总线产生死锁的矩阵;The first determining unit is configured to determine whether the relationship matrix is a deadlock matrix; wherein the deadlock matrix is a matrix in the relationship matrix that can cause the bus to generate a deadlock; 若所述关系矩阵是所述死锁矩阵,判断所述死锁矩阵是否是最简死锁矩阵;其中,所述最简死锁矩阵为所述死锁矩阵中能够使所述总线产生死锁,并且形式最简单的矩阵;If the relationship matrix is the deadlock matrix, determining whether the deadlock matrix is a simplest deadlock matrix; wherein the simplest deadlock matrix is that the deadlock matrix can cause the bus to generate a deadlock And the simplest form of matrix; 若所述死锁矩阵不是所述最简死锁矩阵,将所述死锁矩阵转换成所述最简死锁矩阵;If the deadlock matrix is not the simplest deadlock matrix, converting the deadlock matrix into the simplest deadlock matrix; 根据所述动态路由表和所述最简死锁矩阵判断所述总线是否会产生死锁。 Determining whether the bus generates a deadlock according to the dynamic routing table and the simplest deadlock matrix. 根据权利要求17所述的装置,其中,所述写地址命令的状态信息包括源接口的接口名、目的接口的接口名、第一时序收敛寄存器片的信息和第二时序收敛寄存器片的信息,其中,所述第一时序收敛寄存器片的信息为所述写地址命令从所述源接口到达所述目的接口的传输路径中需经过的时序收敛寄存器片的信息,所述第二时序收敛寄存器片的信息为当前时刻所述写地址命令已经过的时序收敛寄存器片的信息,所述源接口是与发送所述写地址命令的所述Master连接的Slave接口,所述目的接口是与接收所述写地址命令的所述Slave相连接的Master接口。The apparatus according to claim 17, wherein the status information of the write address command comprises an interface name of the source interface, an interface name of the destination interface, information of the first timing closure register slice, and information of the second timing closure register slice, The information of the first timing convergence register slice is information of a timing convergence register slice that the write address command needs to pass from the source interface to the transmission path of the destination interface, and the second timing convergence register fragment The information is the information of the timing convergence register slice that the address command has passed at the current time, the source interface is a slave interface connected to the master that sends the write address command, and the destination interface is Write the master interface of the Slave connected to the address command. 根据权利要求17所述的装置,其中,所述处理模块包括:The apparatus of claim 17 wherein said processing module comprises: 获取单元,配置为根据所述最简死锁矩阵和所述动态路由表获取所述Master向所述Slave发送所述写地址命令的发送时刻;根据所述最简死锁矩阵和所述动态路由表获取所述Master发送的所述写地址命令到达所述Slave的路径中的延时;An obtaining unit, configured to acquire, according to the simplest deadlock matrix and the dynamic routing table, a sending moment that the master sends the write address command to the slave; according to the simplest deadlock matrix and the dynamic routing Obtaining, by the table, a delay in a path that the write address command sent by the master reaches the slave; 第二判断单元,配置为根据所述写地址命令的发送时刻和所述路径中的延时判断所述Master与所述Slave之间的关系是否满足死锁特征;其中,所述死锁特征为第一Master先向第一Slave发送第一写地址命令,后向第二Slave发送第二写地址命令;第二Master先向所述第二Slave发送第三写地址命令,后向所述第一slave发送第四写地址命令;并且所述第二写地址命令先于所述第三写地址命令到达所述第二Slave;所述第四写地址命令先于所述第一写地址命令到达所述第一Slave;The second determining unit is configured to determine, according to the sending moment of the write address command and the delay in the path, whether the relationship between the master and the slave meets a deadlock feature; wherein the deadlock feature is The first master first sends a first write address command to the first slave, and then sends a second write address command to the second slave; the second master first sends a third write address command to the second slave, and then the first The slave sends a fourth write address command; and the second write address command arrives at the second slave before the third write address command; the fourth write address command arrives at the first write address command prior to First Slave; 第二处理单元,配置为若所述Master与Slave的之间关系满足死锁特征,确定所述总线会产生死锁。The second processing unit is configured to determine that the bus generates a deadlock if the relationship between the master and the slave satisfies a deadlock feature. 根据权利要求21所述的装置,其中,The device according to claim 21, wherein 所述第二判断单元,配置为判断所述第一Master向所述第一Slave发送所述第一写地址命令的发送时刻是否小于所述第一Master向所述第二 Slave发送所述第二写地址命令的发送时刻;The second determining unit is configured to determine whether a sending moment of the first master sending the first write address command to the first slave is smaller than the first master to the second Slave sends a sending moment of the second write address command; 判断所述第二Master向所述第二Slave发送所述第三写地址命令的发送时刻是否小于所述第二Master向所述第一Slave发送的所述第四写地址命令的发送时刻;Determining whether the sending time of the third master sending the third write address command to the second slave is smaller than the sending time of the fourth write address command sent by the second master to the first slave; 判断所述第二写地址命令到达所述第二Slave的到达时刻是否小于所述第三写地址命令到达所述第二Slave的到达时刻;Determining whether an arrival time of the second write address command to reach the second slave is less than an arrival time of the third write address command reaching the second slave; 判断所述第四写地址命令到达所述第一Slave的到达时刻是否小于所述第一写地址命令到达所述第一Slave的到达时刻;Determining whether an arrival time of the fourth write address command to reach the first slave is less than an arrival time of the first write address command to reach the first slave; 若所述第一Master向所述第二Slave发送所述第二写地址命令的发送时刻大于所述第一Master向所述第一Slave发送所述第一写地址命令的发送时刻,且所述第二写地址命令到达所述第二Slave的到达时刻小于所述第三写地址命令到达所述第二Slave的到达时刻;并且,所述第二Master向所述第一Slave发送所述第四写地址命令的发送时刻大于所述第二Master向所述第二Slave发送所述第三写地址命令的时刻,且所述第四写地址命令到达所述第一Slave的时刻小于所述第一写地址命令到达所述第一Slave的时刻;确定所述Master与Slave之间的关系满足死锁特征。And sending, by the first master, the sending time of the second write address command to the second slave is greater than the sending time of the first master sending the first write address command to the first slave, and The arrival time of the second write address command reaching the second slave is less than the arrival time of the third write address command reaching the second slave; and the second master sends the fourth to the first slave The sending time of the write address command is greater than the time when the second master sends the third write address command to the second slave, and the time when the fourth write address command reaches the first slave is less than the first The time at which the write address command arrives at the first slave; determining that the relationship between the master and the slave satisfies the deadlock feature. 根据权利要求17所述的装置,其中,所述判断模块包括:The apparatus of claim 17, wherein the determining module comprises: 第三判断单元,配置为根据所述动态路由表判断Master与Slave之间的关系是否存在先发后至情况;其中,所述先发后至情况为第一Master向第一Slave发送第一写地址命令的发送时刻小于第二Master向第一Slave发送第二写地址命令的发送时刻,并且所述第一写地址命令到达第一Slave的到达时刻大于所述第二写地址命令到达第一Slave的到达时刻的情况;根据增量型关系矩阵断总线是否会产生死锁;The third determining unit is configured to determine, according to the dynamic routing table, whether the relationship between the master and the slave is in a pre-emptive manner; wherein, after the first sending, the first master sends the first write to the first slave. The sending moment of the address command is smaller than the sending moment of the second master sending the second write address command to the first slave, and the arrival time of the first write address command reaching the first slave is greater than the second write address command reaching the first slave. The situation of the arrival time; whether the bus will be deadlocked according to the incremental relationship matrix; 第三处理单元,配置为若所述Master与Slave之间的关系存在所述先发后至情况,根据所述第二写地址命令、第三写地址命令以及第四写地址 命令生成增量型关系矩阵;其中,所述第三写地址命令为发送给第二Slave并且发送时刻大于所述第二写地址命令的发送时刻的地址命令;所述第四写地址命令为发送时刻大于所述第三写地址命令的地址命令。a third processing unit, configured to: if the relationship between the master and the slave exists after the first sending, according to the second write address command, the third write address command, and the fourth write address The command generates an incremental relationship matrix; wherein the third write address command is an address command sent to the second slave and the sending time is greater than the sending time of the second write address command; the fourth write address command is sent The time is greater than the address command of the third write address command. 根据权利要求23所述的装置,其中,The device according to claim 23, wherein 所述第三处理单元,配置为若所述Master与Slave之间的关系存在所述先发后至情况,分别确定所述第二写地址命令、所述第三写地址命令和所述第四写地址命令表示的Master与Slave之间的关系;The third processing unit is configured to determine, according to the relationship between the master and the slave, the second write address command, the third write address command, and the fourth The relationship between the Master and the Slave represented by the write address command; 若所述Master与Slave之间的关系为所述Master向所述Slave发送写地址命令,在所述增量型关系矩阵的对应位置设置第一标识;If the relationship between the master and the slave is that the master sends a write address command to the slave, setting a first identifier at a corresponding position of the incremental relationship matrix; 若所述Master与Slave之间的关系为所述Master不向所述Slave发送写地址命令,在所述增量型关系矩阵的对应位置设置第二标识。If the relationship between the master and the slave is that the master does not send a write address command to the slave, a second identifier is set at a corresponding position of the incremental relationship matrix. 一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行权利要求1至16任一项所述的防止总线死锁的方法。 A computer storage medium having stored therein computer executable instructions for performing the method of preventing bus deadlock according to any one of claims 1 to 16.
PCT/CN2017/085136 2016-12-15 2017-05-19 Method and device for avoiding deadlock of bus, and storage medium Ceased WO2018107658A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201611160596.7A CN108228503B (en) 2016-12-15 2016-12-15 Method and device for preventing deadlock of bus
CN201611160596.7 2016-12-15

Publications (1)

Publication Number Publication Date
WO2018107658A1 true WO2018107658A1 (en) 2018-06-21

Family

ID=62557938

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/085136 Ceased WO2018107658A1 (en) 2016-12-15 2017-05-19 Method and device for avoiding deadlock of bus, and storage medium

Country Status (2)

Country Link
CN (1) CN108228503B (en)
WO (1) WO2018107658A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023160192A1 (en) * 2022-02-24 2023-08-31 苏州浪潮智能科技有限公司 Interconnection apparatus for bus
CN117331872A (en) * 2023-11-30 2024-01-02 珠海市芯动力科技有限公司 Methods and related devices to prevent bus deadlock

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6480917B1 (en) * 1999-08-19 2002-11-12 International Business Machines Corporation Device arbitration including peer-to-peer access arbitration
CN101308477A (en) * 2008-06-13 2008-11-19 华为技术有限公司 System bus deadlock prevention method, device and system on chip
CN101667152A (en) * 2009-09-23 2010-03-10 华为技术有限公司 Computer system and method for monitoring bus of same
CN102103560A (en) * 2009-12-16 2011-06-22 中兴通讯股份有限公司 Anti-deadlock method and device for system buses

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7165131B2 (en) * 2004-04-27 2007-01-16 Intel Corporation Separating transactions into different virtual channels
CN101303682A (en) * 2008-06-25 2008-11-12 杭州华三通信技术有限公司 Apparatus for transmitting data through PCI bus, proxy access apparatus and method
JP6193910B2 (en) * 2015-04-03 2017-09-06 ファナック株式会社 Bus system with a bridge circuit that connects the interlock bus and split bus

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6480917B1 (en) * 1999-08-19 2002-11-12 International Business Machines Corporation Device arbitration including peer-to-peer access arbitration
CN101308477A (en) * 2008-06-13 2008-11-19 华为技术有限公司 System bus deadlock prevention method, device and system on chip
CN101667152A (en) * 2009-09-23 2010-03-10 华为技术有限公司 Computer system and method for monitoring bus of same
CN102103560A (en) * 2009-12-16 2011-06-22 中兴通讯股份有限公司 Anti-deadlock method and device for system buses

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023160192A1 (en) * 2022-02-24 2023-08-31 苏州浪潮智能科技有限公司 Interconnection apparatus for bus
CN117331872A (en) * 2023-11-30 2024-01-02 珠海市芯动力科技有限公司 Methods and related devices to prevent bus deadlock
CN117331872B (en) * 2023-11-30 2024-02-09 珠海市芯动力科技有限公司 Methods and related devices to prevent bus deadlock

Also Published As

Publication number Publication date
CN108228503A (en) 2018-06-29
CN108228503B (en) 2020-11-10

Similar Documents

Publication Publication Date Title
US11650895B2 (en) Distributed hardware tracing
US10506434B2 (en) System for accelerated network route update through exclusive access to routing tables
US9407573B2 (en) Bandwidth control in a controller area network (CAN)
EP3274853B1 (en) Direct memory access descriptor processing
EP3230860B1 (en) Technologies for efficient synchronization barriers with work stealing support
US20150063120A1 (en) Controller area network (can) worst-case message latency with priority inversion
CN104854845B (en) Method and apparatus using efficient atomic operations
CN110196826B (en) A deadlock judgment method and device
WO2018107658A1 (en) Method and device for avoiding deadlock of bus, and storage medium
US20110320855A1 (en) Error detection and recovery in a shared pipeline
CN109213828A (en) Block generation method, device, equipment and storage medium
US10216416B1 (en) Application performance in replication environments
CN101739341B (en) System having processor and i/o controller
JP2017091527A (en) Method and device for determining hot page in database
CN119537325A (en) Shared page reading and writing method, database system and computer equipment
US20150019776A1 (en) Selective change of pending transaction urgency
HK1259590B (en) Distributed hardware tracing
Purantra et al. A Novel Approach to Solve Deadlock Problem in On-Chip BUS Communication
FR2996935A1 (en) METHOD AND DEVICE FOR PROCESSING INTERRUPTIONS IN A MULTIPROCESSOR SYSTEM
TWM480716U (en) Data processing system and client device thereof

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17881173

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17881173

Country of ref document: EP

Kind code of ref document: A1