WO2022227693A1 - Command distribution apparatus and method, chip, computer device, and medium - Google Patents
Command distribution apparatus and method, chip, computer device, and medium Download PDFInfo
- Publication number
- WO2022227693A1 WO2022227693A1 PCT/CN2022/070709 CN2022070709W WO2022227693A1 WO 2022227693 A1 WO2022227693 A1 WO 2022227693A1 CN 2022070709 W CN2022070709 W CN 2022070709W WO 2022227693 A1 WO2022227693 A1 WO 2022227693A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- command
- circuit
- operation unit
- line
- commands
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 73
- 239000000872 buffer Substances 0.000 claims abstract description 246
- 230000004044 response Effects 0.000 claims abstract description 11
- 238000013500 data storage Methods 0.000 claims description 20
- 238000012544 monitoring process Methods 0.000 claims description 19
- 238000012790 confirmation Methods 0.000 claims description 15
- 230000004913 activation Effects 0.000 claims description 7
- 230000005540 biological transmission Effects 0.000 claims description 6
- 238000004590 computer program Methods 0.000 claims description 6
- 230000003247 decreasing effect Effects 0.000 claims description 3
- 238000012545 processing Methods 0.000 description 18
- 230000008569 process Effects 0.000 description 16
- 238000010586 diagram Methods 0.000 description 7
- 230000006870 function Effects 0.000 description 6
- 238000004891 communication Methods 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000009825 accumulation Methods 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 238000013135 deep learning Methods 0.000 description 2
- 238000011160 research Methods 0.000 description 2
- 238000013473 artificial intelligence Methods 0.000 description 1
- 238000013475 authorization Methods 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000008054 signal transmission Effects 0.000 description 1
- 238000004148 unit process Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/30003—Arrangements for executing specific machine instructions
- G06F9/30007—Arrangements for executing specific machine instructions to perform operations on data operands
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/14—Handling requests for interconnection or transfer
- G06F13/16—Handling requests for interconnection or transfer for access to memory bus
- G06F13/1605—Handling requests for interconnection or transfer for access to memory bus based on arbitration
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/30003—Arrangements for executing specific machine instructions
- G06F9/3004—Arrangements for executing specific machine instructions to perform operations on memory
- G06F9/30047—Prefetch instructions; cache control instructions
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N20/00—Machine learning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2213/00—Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F2213/36—Arbitration
Definitions
- the present disclosure relates to the field of computer technology, and in particular, to an apparatus, method, chip, computer device, and storage medium for command distribution.
- Embodiments of the present disclosure provide at least a command distribution apparatus, method, chip, computer device, and storage medium.
- an embodiment of the present disclosure provides a command distribution apparatus, including at least one distribution circuit and at least one information buffer; wherein each of the distribution circuits is connected to the at least one information buffer.
- Each of the information buffers in the at least one information buffer is used to store the number of currently unprocessed commands in the corresponding operation unit as the number of commands and the command number threshold of the corresponding operation unit.
- Each distribution circuit in the at least one distribution circuit is used to read the first command currently to be sent from the command queue corresponding to the distribution circuit, based on the arithmetic unit identifier carried in the first command, from the The number of commands and the threshold of the number of commands are read from the first information buffer corresponding to the identification of the arithmetic unit; in response to the number of commands meeting a preset condition, an arbitration request signal is sent to the arbitration circuit.
- each distribution circuit in the command distribution device will send an arbitration request signal to the arbitration circuit only when the number of commands satisfies the preset condition. Therefore, it is possible to avoid command accumulation in some operation units and no executable in other operation units. In the case of a command, the execution efficiency of the command is improved, and the computing resource utilization of the computing unit is increased.
- each distribution circuit when the number of commands does not meet the preset conditions, each distribution circuit will not participate in the authority arbitration process, and will not occupy the bus; and the distribution circuit that has obtained the distribution authority will also not occupy the bus for a long time, which improves command distribution. s efficiency.
- the command distribution is realized through hardware, which can effectively reduce the computing resource overhead.
- the preset condition includes: the number of commands is less than the threshold of the number of commands.
- each distribution circuit in the at least one distribution circuit is further configured to monitor in real time the number of commands in the first information buffer when the number of commands is equal to the threshold of the number of commands Whether the number of commands has changed to be less than the threshold of the number of commands; after monitoring that the number of commands has changed to be less than the threshold of the number of commands, the arbitration request signal is sent to the arbitration circuit.
- the command number threshold of the corresponding operation unit is based on the size of the data storage space occupied by the currently unprocessed commands in the corresponding operation unit and the total data storage volume of the corresponding operation unit The size of the space is determined.
- the operation unit can be dynamically configured according to the size of the data storage space occupied by the unprocessed commands received by each operation unit and the size of the total data storage space of the operation unit
- the threshold of the number of commands can reduce the probability of command congestion in a certain computing unit, and at the same time, improve the processing efficiency of the computing unit.
- each distribution circuit in the at least one distribution circuit is further configured to, after receiving the permission permission signal returned by the arbitration circuit based on the arbitration request signal, send a message to the arithmetic unit with the The first operation unit corresponding to the identifier sends the first command.
- each distribution circuit in the at least one distribution circuit when reading the first command to be sent currently from the command queue corresponding to the distribution circuit, is used to:
- the corresponding command queue reads the current command line of the first command.
- the distribution circuit when reading the number of commands and the threshold of the number of commands from the first information buffer corresponding to the identifier of the operation unit based on the identifier of the operation unit carried in the first command, is used to:
- the current command line is the first command line of the first command, based on the operation unit identifier carried in the first command
- the first information buffer corresponding to the operation unit identifier is read from the first information buffer.
- the number of commands and the command number threshold when reading the first command to be sent currently from the command queue corresponding to the distribution circuit, is used to:
- the distribution circuit when reading the number of commands and the threshold of the number of commands from the first information buffer corresponding to the identifier of the operation unit based on the identifier of the operation unit carried in the first command, is used to:
- each distribution circuit can determine whether the number of commands that have been received by the arithmetic unit corresponding to the new command and have not been processed yet reaches the command number threshold.
- each distribution circuit in the at least one distribution circuit is further configured to: in the case that the current command line is a non-first line command line of the first command, to the arbitration A circuit sends the arbitration request signal.
- an arbitration request signal can be directly sent to the arbitration circuit to participate in the arbitration of the arbitration circuit, thereby improving the distribution efficiency.
- each distribution circuit in the at least one distribution circuit is further configured to: determine whether the current command line is the first line of the command line.
- the distribution circuit when sending an arbitration request signal to the arbitration circuit in response to the number of commands satisfying a preset condition, is configured to: determine the first command line in the first command Whether it is in a ready state; if so, send the arbitration request signal to the arbitration circuit.
- the first line of the first command being in a ready state includes: a first operation unit corresponding to the first command, a first operation unit corresponding to the second command recently sent by the command queue
- the second operation unit is the same; or, the first operation unit is different from the second operation unit, but the second command has been processed by the second operation unit.
- each command can be processed sequentially according to the order in which the multiple commands are stored in the command queue, ensuring that the same command queue is stored in the same command queue.
- the multiple commands are processed sequentially.
- the distribution circuit includes a parsing circuit and a command line buffer; the parsing circuit is respectively connected to the command line buffer and the information buffer.
- the parsing circuit is used to read the current command line of the first command from the command queue, and determine whether the current command line is the first command line; in the case that the current command line is the first command line Next, based on the operation unit identifier carried in the first line of the command line, read the number of commands and the threshold of the number of commands from the first information buffer corresponding to the identifier of the operation unit; In the case of the above-mentioned threshold of the number of commands, the first line of the command line is sent to the command line buffer.
- the command line buffer is configured to send the arbitration request signal to the arbitration circuit after receiving the first line of the command line sent by the parsing circuit.
- the parsing circuit is further configured to send the first command line and the first command line to the command line buffer when the number of commands is equal to the command number threshold A pause instruction; the command line buffer is further configured to pause sending the arbitration request signal to the arbitration circuit after receiving the first line of the command line and the first pause instruction sent by the parsing circuit.
- the parsing circuit is further configured to monitor in real time whether the number of commands in the first information buffer changes to be less than the threshold of the number of commands; after monitoring the change in the number of commands After the number of commands is less than the threshold of the number of commands, a first start command is sent to the command line buffer.
- the command line buffer is further configured to send the arbitration request signal to the arbitration circuit after receiving the first start instruction.
- the distribution circuit further includes a command line counter; the command line counter is connected to the parsing circuit.
- the parsing circuit when determining whether the current command line is the first command line, is configured to read the first count value from the command line counter after reading the current command line from the command queue; When the first count value is equal to the first preset value or equal to the original value, it is determined that the current command line is the first command line in the first command.
- the first preset value is determined based on the number of command line lines of the first command.
- the parsing circuit can determine whether the read current command line is the first command line of the first command by reading the first count value of the command line counter and comparing the first count value with the current count threshold, so as to use A low-cost way to realize the identification of different commands in the same queue.
- the parsing circuit is further configured to update the first preset value based on the number of command lines of the first command when it is determined that the current command line is the first command line, and Send a reset instruction to the command line counter;
- the command line counter is further configured to reset the first count value to the original value after receiving the reset instruction sent by the parsing circuit, and increase the first count value numerical value.
- the command line counter restarts to count the number of lines of the command line of the new command to be sent read by the parsing circuit.
- the distribution circuit further includes a judgment circuit; the judgment circuit is respectively connected with the parsing circuit and the command line buffer.
- the parsing circuit is further configured to parse the first command line from the first command line when it is determined that the current command line is the first line command line and the number of commands is less than the command number threshold.
- An operation unit identifier corresponding to a command is sent to the judgment circuit, and the current command line and the operation unit identifier are sent to the command line buffer.
- the judging circuit is configured to receive the operation unit identifier sent by the parsing circuit, and based on the operation unit identifier, determine the first operation unit corresponding to the first command and the most recently sent data of the command queue.
- a second pause instruction is sent to the command line buffer.
- the command line buffer is further configured to suspend sending the arbitration request signal to the arbitration circuit in the case of receiving the second suspend instruction sent by the judgment circuit.
- the processing order of the two adjacent commands will not be affected due to the processing efficiency of the operation units.
- the command line buffer does not participate in the arbitration of the arbitration circuit to ensure that the current command is not issued, thereby ensuring the processing order of multiple commands in the same command queue.
- the distribution circuit further includes a command counter; the command counter is connected to the judgment circuit.
- the judging circuit is further configured to read a second count value from the command counter after receiving the operation unit identifier sent by the parsing circuit, and when the second count value is greater than a second preset In the case of a numerical value, it is determined that the second command has not been processed by the second operation unit.
- the command counter is used to count the commands corresponding to the command queue that are currently sent but not yet processed.
- the judgment circuit compares the second count value read from the command counter with the second preset value, so as to know whether the recently sent second command in the command queue corresponding to the judgment circuit has been processed.
- the judging circuit is further configured to monitor whether the second count value in the command counter is in the case of determining that the second command has not been processed by the second arithmetic unit. change to the second preset value; and send a second start instruction to the command line buffer when monitoring that the second count value of the command counter changes to the second preset value.
- the command line buffer is further configured to send the arbitration request signal to the arbitration circuit after receiving the second start instruction.
- the information buffer can send the third counting instruction to the command counter corresponding to the command queue after the corresponding operation unit has processed the command that has been sent in a certain command queue, and after the command counter receives the third counting instruction, it will The second count value is decreased by a second value to indicate that a command sent by the command queue has been processed.
- the command counter is connected to the parsing circuit.
- the parsing circuit is further configured to send the current command line to the first operation unit after monitoring that the command line buffer sends the current command line to the first operation unit when the current command line is the first command line.
- the command counter sends a second counting instruction; the command counter is used to increase the second counting value by a second value after receiving the second counting instruction.
- the command counter can record the number of commands that have been sent by the corresponding command queue.
- the information buffer is connected to command counters corresponding to the plurality of command queues respectively.
- the first information buffer is further configured to, after receiving the confirmation information fed back after the first operation unit has processed the first command, based on the command line queue identifier and the confirmation information, send The command counter corresponding to the command queue identifier sends a third counting instruction.
- the command counter is used to decrease the second count value by a second value after receiving the third count instruction sent by the first information buffer.
- the judgment circuit can notify the command line buffer to participate in the arbitration of the arbitration circuit in real time after the recently sent command in the corresponding command queue is processed, and send the first command line of the current command to be sent.
- the first information buffer is further configured to update the number of commands after receiving confirmation information fed back after the first operation unit has processed the first command.
- the distribution circuit can re-participate in the arbitration of the arbitration circuit under the condition that the first operation unit corresponding to the first command to be sent can receive the first command, and obtain the opportunity to send the first command to the first operation unit, Improve the efficiency of command distribution.
- an embodiment of the present disclosure further provides a command distribution method, which is applied to a command distribution apparatus, where the command distribution apparatus includes at least one distribution circuit and at least one information buffer. Wherein, each of the distribution circuits is connected to the at least one information buffer.
- the command distribution method includes: each information buffer in the at least one information buffer stores the number of currently unprocessed commands in the corresponding operation unit as the number of commands and the command number threshold of the corresponding operation unit; the at least After each distribution circuit in a distribution circuit reads the first command currently to be sent from the command queue corresponding to the distribution circuit, based on the operation unit identifier carried in the first command, the first command corresponding to the operation unit identifier is retrieved from the first command.
- the number of commands and the threshold of the number of commands are read from an information buffer, and an arbitration request signal is sent to the arbitration circuit in response to the number of commands meeting a preset condition.
- the preset condition includes: the number of commands is less than the threshold of the number of commands.
- the command distribution method further includes: when each distribution circuit in the at least one distribution circuit is equal to the command number threshold, monitoring the first command in real time Whether the number of commands in the information buffer has changed to be less than the threshold of the number of commands; after monitoring that the number of commands has changed to be less than the threshold of the number of commands, the arbitration request signal is sent to the arbitration circuit.
- the command distribution method further includes: each information buffer in the at least one information buffer acquires a dynamically configured command number threshold of the corresponding operation unit.
- the command number threshold of the corresponding operation unit is determined based on the size of the data storage space occupied by the currently unprocessed commands in the corresponding operation unit and the size of the total data storage space of the corresponding operation unit.
- the command distribution method further includes: after each distribution circuit in the at least one distribution circuit receives a permission permission signal returned by the arbitration circuit based on the arbitration request signal, send the The first operation unit corresponding to the operation unit identifier sends the first command.
- each distribution circuit in the at least one distribution circuit reads the first command currently to be sent from a command queue corresponding to the distribution circuit, including: each of the at least one distribution circuit The distribution circuit reads the current command line of the first command from the command queue corresponding to the distribution circuit. The distribution circuit reads the command number and the command number threshold from the first information buffer corresponding to the operation unit identifier based on the operation unit identifier carried in the first command, including: in the current When the command line is the first line of the command line of the first command, based on the operation unit identifier carried in the first command, read the number of commands and the number of commands from the first information buffer corresponding to the operation unit identifier. The command number threshold.
- the command distribution method further includes: in each distribution circuit in the at least one distribution circuit, when the current command line is a non-first line command line of the first command , sending the arbitration request signal to the arbitration circuit.
- the command distribution method further includes: each distribution circuit in the at least one distribution circuit determines whether the current command line is the first line of the command line.
- the distribution circuit in response to the number of commands meeting a preset condition, sends an arbitration request signal to the arbitration circuit, including: determining whether the first command line in the first command is in a ready state ; if yes, send the arbitration request signal to the arbitration circuit.
- the first line of the first command being in a ready state includes: a first operation unit corresponding to the first command, a second command corresponding to the most recently sent second command in the command queue
- the second operation unit is the same; or, the first operation unit is different from the second operation unit, but the second command has been processed by the second operation unit.
- the distribution circuit includes a parsing circuit and a command line buffer; the parsing circuit is respectively connected to the command line buffer and the information buffer.
- each distribution circuit in the at least one distribution circuit reads the first command line of the first command from the command queue corresponding to the distribution circuit, based on the operation unit identifier carried in the first line command line, from the operation
- the number of commands and the threshold of the number of commands are read from the first information buffer corresponding to the unit identifier; when the number of commands is less than the threshold of the number of commands, an arbitration request signal is sent to the arbitration circuit, including: the The parsing circuit reads the current command line of the first command from the command queue, and determines whether the current command line is the first command line; in the case that the current command line is the first command line, based on the The arithmetic unit identifier carried in the first line of the command line, reads the number of commands and the threshold of the number of commands from the first information buffer corresponding to the identifier of the arith
- the command distribution method further includes: when the number of commands is equal to the threshold of the number of commands, the parsing circuit sends the first line of the command line to the command line buffer , and a first pause command; after receiving the first command line and the first pause command sent by the parsing circuit, the command line buffer pauses sending the arbitration request signal to the arbitration circuit.
- the command distribution method further includes: the parsing circuit monitors in real time whether the number of commands in the first information buffer changes to be less than the command number threshold; After the number of commands is changed to be less than the threshold of the number of commands, a first activation instruction is sent to the command line buffer; after receiving the first activation instruction, the command line buffer sends the first activation instruction to the arbitration circuit. the arbitration request signal.
- the distribution circuit further includes a command line counter; the command line counter is connected to the parsing circuit.
- the parsing circuit determining whether the current command line is the first command line includes: after the parsing circuit reads the current command line from the command queue, reading a first count value from the command line counter; In the case that the first count value is equal to the first preset value or equal to the original value, it is determined that the current command line is the first command line in the first command.
- the first preset value is determined based on the number of command line lines of the first command.
- the command distribution method further includes: when the parsing circuit determines that the current command line is the first command line, updating the first command line based on the number of command lines of the first command Presetting a value and sending a reset instruction to the command line counter; after receiving the reset instruction sent by the parsing circuit, the command line counter resets the first count value to the original value, and increases the first count value numerical value.
- the command distribution method further includes: after the parsing circuit determines that the current command line is a non-first line command line of the first command, sending a first command line to the command line counter A counting instruction; after the command line counter receives the first counting instruction sent by the parsing circuit, the first counting value is increased by a first value.
- the distribution circuit further includes a judgment circuit; the judgment circuit is respectively connected with the parsing circuit and the command line buffer.
- the command distribution method further includes: when the parsing circuit determines that the current command line is the first line of the command line, and when the number of commands is less than the command number threshold, extracting the command from the first line of the command line.
- a second pause instruction is sent to the command line buffer; the command line buffer receives the judgment In the case of the second pause command sent by the circuit, transmission of the arbitration request signal to the arbitration circuit is paused.
- the distribution circuit further includes a command counter; the command counter is connected to the judgment circuit.
- the command distribution method further includes: after the judging circuit receives the operation unit identifier sent by the parsing circuit, reading a second count value from the command counter, and when the second count value is greater than In the case of the second preset value, it is determined that the second command has not been processed by the second operation unit.
- the command counter is used to count the commands corresponding to the command queue that are currently sent but not yet processed.
- the command distribution method further includes: when the judgment circuit determines that the second command has not been processed by the second arithmetic unit, monitoring the first command in the command counter. Whether the second count value has changed to the second preset value; and in the case of monitoring that the second count value of the command counter has changed to the second preset value, send a second start command to the command line buffer; After receiving the second start command, the command line buffer sends the arbitration request signal to the arbitration circuit.
- the command counter is connected to the parsing circuit.
- the command distribution method further includes: when the current command line is the first command line, the parsing circuit detects that the command line buffer sends the current command line to the first computing unit after monitoring that the current command line is sent to the first computing unit. , sending a second counting instruction to the command counter; after receiving the second counting instruction, the command counter increases the second counting value by a second value.
- the information buffer is connected to command counters corresponding to a plurality of command queues respectively; the command distribution method further includes: the first information buffer receives the first operation unit After the confirmation information fed back after the first command is processed, based on the command line queue identifier and the confirmation information, a third counting instruction is sent to the command counter corresponding to the command queue identifier; the command counter is in After receiving the third count instruction sent by the first information buffer, the second count value is decreased by a second value.
- the command distribution method further includes: after the first information buffer receives the confirmation information fed back after the first operation unit has processed the first command, updating all the number of commands.
- an optional implementation manner of the present disclosure further provides a chip, including the command distribution apparatus according to the first aspect or any one of the first aspect.
- an optional implementation manner of the present disclosure further provides a computer device, including an instruction memory and the chip described in the third aspect above.
- an optional implementation manner of the present disclosure further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and the computer program is executed by a processor when the second aspect or the second aspect is executed.
- FIG. 1 shows a schematic diagram of a command distribution apparatus provided by an embodiment of the present disclosure
- FIG. 2 shows a schematic diagram of another command distribution apparatus provided by an embodiment of the present disclosure
- FIG. 3 shows a schematic structural diagram of a distribution circuit provided by an embodiment of the present disclosure
- FIG. 4 shows a schematic diagram of a command distribution method provided by an embodiment of the present disclosure.
- the micro-control unit When the micro-control unit distributes the command, it sends the command to the command distribution unit. After the command distribution unit receives the command, it can use the software program deployed in the command distribution unit to distribute the command to each computing unit. When the command distribution unit sends commands to the operation unit, it will occupy the bus. If too many commands are distributed to an operation unit, the bus resources will always be occupied by the operation unit. In this way, commands may be piled up in the operation unit, but no commands can be executed by other operation units, resulting in lower execution efficiency of the commands, and the computing resources of the operation units cannot be fully utilized.
- the present disclosure provides a command distribution device composed of hardware, which distributes commands through a hardware circuit, and each distribution circuit in the command distribution device determines the first operation unit corresponding to the first command to be sent currently.
- a command distribution device composed of hardware, which distributes commands through a hardware circuit, and each distribution circuit in the command distribution device determines the first operation unit corresponding to the first command to be sent currently.
- an arbitration request signal is sent to the arbitration circuit, so it can be avoided that the command accumulates in some operation units, and When other computing units have no executable commands, the execution efficiency of the commands is improved, and the computing resource utilization of the computing units is increased.
- each distribution circuit in the command distribution device will send an arbitration request to the arbitration circuit when it is determined that the number of currently unprocessed commands in the first operation unit corresponding to the first command is less than the command number threshold of the first operation unit Signal, that is, when the number of currently unprocessed commands in the first operation unit corresponding to the command to be sent is equal to the command number threshold of the first operation unit, it will not participate in the authority arbitration process, so it will not Occupies the bus; and the distribution circuit that obtains the distribution authority also does not occupy the bus for a long time, which improves the efficiency of command distribution.
- command distribution apparatus provided by the embodiments of the present disclosure is implemented by hardware, which can effectively reduce computing resource overhead and improve the efficiency of command distribution.
- connection described in the embodiments of the present disclosure refers to the connection between hardware circuits.
- different circuit modules eg, a distribution circuit, an arbitration circuit
- level signals eg, a high level, a low level
- the combination of different level signals can represent different meanings according to the convention.
- the number 1 represents a high level
- the number 0 represents a low level.
- Multiple electrical signal transmission lines can be set between the two circuit modules, when different signals are transmitted, different lines are controlled to transmit different level signals, and the combination of different level signals forms different binary numbers.
- the level signals sent in a certain processing cycle are high level, low level, and high level, respectively, and the binary number formed is 101. Different binary numbers represent different meanings by definition.
- the command queue, command line buffer, and information buffer described in the embodiments of the present disclosure are electronic components with a storage function.
- the operation unit described in the embodiments of the present disclosure is a hardware circuit that can implement different operations, for example, includes a convolution operation unit that performs multiplication and addition operations, an encoding/decoding operation unit that performs video encoding and decoding, and the like.
- Each operation unit is connected with the bus; and each operation unit corresponds to an information buffer, each operation unit is connected with the corresponding information buffer, and each information buffer stores the number of commands that the corresponding operation unit has not processed as The number of commands, and the command number threshold.
- Each computing unit has a limited ability to receive commands, and the command number threshold is the maximum number of received but unprocessed commands that the computing unit can store;
- the command number threshold of an operation unit may be different. Specifically, the command number threshold of each operation unit may be set according to the processing capability of each operation unit, which is not limited here.
- the commands described in the embodiments of the present disclosure are, for example, a command package, and each command includes multiple command lines.
- the first line of the command line is also called the header line, and the header line carries the identifier of the operation unit to which the command is to be sent.
- the command distribution device distributes the command to the corresponding computing unit based on the identifier.
- the first line of the command line also includes the number of lines of the command line included in the command.
- the first three bits of the first line of the command line represent the identifier of the operation unit to which the command is to be sent
- the fourth and fifth bits represent the number of lines of the command line included in the command.
- the specific information of the command is carried, such as the operation to be performed by the command, the address of the operand, and the command status.
- the specific information of the command may vary according to different commands, which is not limited in this embodiment of the present disclosure.
- Command line counter and command counter are electronic components with counting function.
- the parsing circuit and the arbitration circuit are hardware circuits that implement corresponding functions through the connection of electronic components and the transmission of level signals (eg, high level, low level).
- the command distribution apparatus includes at least one distribution circuit 10-0 to 10-n (hereinafter collectively referred to as distribution circuit 10) and at least one information cache 20-0 to 20-n (hereinafter collectively referred to as information buffers 20).
- Each information buffer 20 in the at least one information buffer is used to store the number of current unprocessed commands in the corresponding arithmetic unit as the number of commands and the command number threshold of the corresponding arithmetic unit;
- Each distribution circuit 10 in at least one distribution circuit is used to read the first command currently to be sent from the command queue corresponding to the distribution circuit 10, based on the operation unit identifier carried in the first command, from the operation unit identifier corresponding to The number of commands and the threshold of the number of commands are read from the first information buffer 20 of the first information buffer; in response to the number of commands meeting the preset condition, an arbitration request signal is sent to the arbitration circuit.
- each distribution circuit 10 is connected with the at least one information buffer 20 .
- the command distribution apparatus further includes an arbitration circuit 30 , and the arbitration circuit 30 is connected to at least one distribution circuit 10 respectively.
- the arbitration circuit 30 is configured to perform authority arbitration on each distribution circuit 10 after receiving an arbitration request signal sent by each distribution circuit 10 in at least one distribution circuit, and return to the distribution circuit 10 that has obtained the transmission authority based on the result of the authority arbitration Permission permission signal.
- the command distribution apparatus in the embodiment of the present disclosure is implemented by hardware, which can effectively reduce computing resource overhead.
- each distribution circuit of the command distribution device After reading the first command to be sent, each distribution circuit of the command distribution device reads the number of commands and the number of commands from the first information buffer corresponding to the identifier of the operation unit based on the identifier of the operation unit carried in the first command. Threshold; when the number of commands is less than the threshold of the number of commands, an arbitration request signal is sent to the arbitration circuit. Therefore, it is possible to avoid a situation in which command accumulation occurs in some computing units, while other computing units have no executable commands, thereby improving the execution efficiency of commands and increasing the computing resource utilization rate of the computing units.
- the distribution circuit will not participate in the authority arbitration process and will not occupy the bus when the number of currently unprocessed commands in the first operation unit corresponding to the first command is equal to the command number threshold of the first operation unit; and The distribution circuit that obtains the distribution authority also does not occupy the bus for a long time, thereby improving the efficiency of command distribution.
- the distribution circuit 10 when the first command to be sent currently is read from the command queue corresponding to the distribution circuit, for example, the current command line of the first command is read from the command queue corresponding to the distribution circuit.
- each information buffer 20 in the at least one information buffer it is also used to obtain a dynamically configured command number threshold of the corresponding operation unit.
- the command number threshold corresponding to the operation unit is determined based on, for example, the size of the data storage space occupied by the currently unprocessed commands in the corresponding operation unit and the total data storage space size of the corresponding operation unit.
- the dynamic configuration is, for example, configuration by any one of the host, the distribution circuit 10 , and the configuration unit connected to each information buffer 20 .
- the host or the configuration unit connected to each information buffer 20 determines the corresponding operation unit based on the size of the data storage space occupied by the currently unprocessed command in the corresponding operation unit and the size of the total data storage space of the corresponding operation unit. command count threshold.
- the total data storage space of the operation unit can store 50 lines of command lines, the number of unprocessed commands received by the operation unit is 3, and the data storage space occupied by the three commands is 30 lines , the operation unit still has 20 lines of storage space.
- the host or the configuration unit connected to each information buffer 20 determines that the operation unit has a command number threshold of 4.
- the distribution circuit 10 reads the first command line of the first command from the command queue corresponding to the distribution circuit 10, parses the first command line to obtain the number of command lines of the first command, and sends the first information to the first information
- the buffer sends the number of command lines; after receiving the number of command lines sent by the distribution circuit 10, the first information buffer is based on the number of command lines, the size of the data storage space occupied by the currently unprocessed commands in the first arithmetic unit, And the size of the total data storage space of the first operation unit determines the command number threshold of the first operation unit.
- the total data storage space of the first operation unit can store 40 lines of command lines, the number of unprocessed commands received by the first operation unit is 3, and the data storage space occupied by the three commands
- the size is 30 lines, and the first operation unit has 10 lines of storage space left. If the number of command lines of the first command is greater than 10 lines, the threshold of the number of commands of the first operation unit is 3; if the command line of the first command If the number of lines is less than or equal to 10 lines, the command number threshold of the first operation unit is 4.
- each distribution circuit 10 in at least one distribution circuit For each distribution circuit 10 in at least one distribution circuit, read the current command line of the first command from the command queue corresponding to the distribution circuit 10, and determine whether the current command line is the first command line of the first command.
- Case A1 In the case where it is determined that the current command line is the first command line of the first command, the distribution circuit 10, based on the operation unit identifier carried in the first line of the command line, selects from the first information buffer corresponding to the operation unit identifier.
- the number of currently unprocessed commands in the first operation unit corresponding to the first command is read as the number of commands and the command number threshold of the first operation unit, and an arbitration request signal is sent to the arbitration circuit in response to the number of commands meeting a preset condition.
- the preset condition includes, for example, that the number of commands is less than a threshold of the number of commands. Therefore, when the number of commands is smaller than the command number threshold, the distribution circuit 10 sends an arbitration request signal to the arbitration circuit 30 .
- the first operation unit is the operation unit corresponding to the first command to be sent currently
- the first information buffer is the information buffer corresponding to the first operation unit
- the operation unit identifier includes, for example, the identifier of the corresponding operation unit (for example, At least one of the contents of the address of the corresponding operation unit), the identifier of the corresponding information buffer (for example, the address of the corresponding information buffer) and the like.
- the distribution circuit 10 may also record the operation unit identifier; when the current command line is a non-first line command line, use the recorded operation unit identifier to send the current command line to the first operation unit corresponding to the operation unit identifier.
- the current command line read by the distribution circuit 10 is the first command line, which means that the distribution circuit wants to start sending a new first command, and needs to determine the received, but not yet stored, first operation unit corresponding to the new first command. Whether the number of processed commands (hereinafter referred to as the number of commands) has reached the maximum value; if the number of commands is less than the threshold of the number of commands, it means that the number of received but unprocessed commands stored by the first operation unit has not reached the maximum value. , the first arithmetic unit can also normally receive the command sent by the distribution circuit. At this time, the distribution circuit can send an arbitration request signal to the arbitration circuit 30 to participate in the arbitration of the arbitration circuit 30 to obtain the opportunity to send the command to the first arithmetic unit.
- the distribution circuit 10 monitors in real time whether the number of commands in the first information buffer changes to be less than the threshold of the number of commands; after monitoring that the number of commands changes to be less than the threshold of the number of commands, An arbitration request signal is sent to the arbitration circuit 30 .
- the command sent by the distribution circuit 10 cannot be received until at least one of the stored commands is processed.
- the command sent by the distribution circuit 10 is received.
- the first arithmetic unit After the first arithmetic unit processes a command, it will give feedback information to the first information buffer, and the first information buffer will update the number of commands after receiving the feedback information, for example, reduce the number of commands by 1, and the distribution circuit 10 After monitoring that the number of commands stored in the first information buffer changes to be less than the command number threshold, an arbitration request signal is sent to the arbitration circuit 30 to participate in the arbitration of the arbitration circuit 30 to obtain an opportunity to send commands to the first arithmetic unit.
- Case A2 When it is determined that the current command line is a non-first line command line of the first command, the distribution circuit 10 directly sends an arbitration request signal to the arbitration circuit 30 .
- the distribution circuit 10 In the case where the current command line is not the first command line of the first command, it means that the distribution circuit 10 has determined that the first operation unit corresponding to the first command has received the received command line when sending the first command line of the first command. However, the number of unprocessed commands has not reached the maximum value. Therefore, when the current command line read is not the first command line of the first command, the distribution circuit 10 can directly send an arbitration request signal to the arbitration circuit 30. , without the need to determine whether the current number of unprocessed commands in the first operation unit is less than the command number threshold.
- the corresponding operation unit will process the processing task corresponding to the command based on the command. Therefore, if the current command line is a non-first-line command line, you can continue to send the non-first-line command line to the corresponding operation unit. Therefore, the distribution circuit 10 directly sends an arbitration request signal to the arbitration circuit 30 when the current command line is a non-first-line command line.
- any one of the following modes B1 or B2 may be adopted:
- Mode B1 When the number of commands is less than the command number threshold, the distribution circuit 10 sends an arbitration request signal to the arbitration circuit 30 .
- Mode B2 when the number of commands is less than the threshold of the number of commands, the distribution circuit 10 determines whether the first line of the command line is in a ready state; if so, it sends an arbitration request signal to the arbitration circuit 30; if it is not in a ready state, it does not send the arbitration circuit 30. The arbitration request signal is sent until it changes to the ready state.
- the current command line is in the ready state, which means that when the number of commands is less than the command number threshold, the current command line can be sent to the corresponding first operation unit.
- the ready state includes, for example, any one of the following states (1) to (2):
- the first operation unit corresponding to the first command where the first line of the command line is located is the same as the second operation unit corresponding to the second command recently sent by the command queue.
- each command in the latter command can be processed.
- the rows are sent to the same operation unit, so that the processing order between different commands in the same command queue can also be guaranteed.
- the current command line is determined as the ready state; in the above (2), in the first operation unit and the second operation unit When the units are different, and the second command is processed by the second operation unit, the current command line is determined to be in a ready state.
- each distribution circuit 10 in the at least one distribution circuit sends a first command to the first operation unit corresponding to the operation unit identifier after receiving the authorization permission signal returned by the arbitration circuit 30 based on the arbitration request signal.
- the command distribution device may further include a command distribution interface 40; the distribution circuit 10 may be connected to the command distribution interface 40, and when sending the current command line to the first operation unit, the current command line and the operation unit identifier may be sent together To the command distribution interface 40 .
- the command distribution interface 40 is connected to the bus, and based on the identification of the operation unit, sends the current command line to the first operation unit connected to the bus through the bus.
- the command distribution interface 40 can also be connected to the arbitration circuit 30; the distribution circuit 10 sends the current command line and the operation unit identifier to the arbitration circuit 30 after receiving the permission permission signal; the arbitration circuit 30 sends the current command line and the operation unit identifier to the arbitration circuit 30; The identifier is sent to the command distribution interface 40 together, and then the command distribution interface 40 sends the current command line to the first operation unit connected to the bus through the bus based on the operation unit identifier.
- the command distribution interface 40 may be connected, for example, to a bus interface of a bus.
- the command distribution interface 40 sends the current command line and the operation unit identifier to the bus interface, and the bus interface sends the current command line to the first operation unit through the bus and the operation unit identifier.
- the distribution circuit 10 includes a parsing circuit 101 and a command line buffer 102; the parsing circuit 101 and the command line buffer 102 and the at least one information buffer 20 is connected;
- the parsing circuit 101 is used to read the current command line of the first command from the command queue, and determine whether the current command line is the first command line; in the case that the current command line is the first command line, based on the first command line carried
- the arithmetic unit identifier reads the command quantity and the command number threshold from the first information buffer corresponding to the arithmetic unit identifier; In the case that the command quantity is less than the command number threshold, send the first line command line to the command line buffer 102;
- the command line buffer 102 is configured to send an arbitration request signal to the arbitration circuit after receiving the first line of the command line sent by the parsing circuit 101 .
- each parsing circuit 101 is connected to the corresponding command queue, the parsing circuit 0 in FIG. 3 is connected to the command queue 0, the parsing circuit 1 is connected to the command queue 1; the parsing circuit 101 is connected to Corresponding command line buffers 102 are connected.
- parsing circuit 0 is connected to command line buffer 0
- parsing circuit 1 is connected to command line buffer 1 .
- the process of reading the command queue by the parsing circuit 101 includes, for example: the parsing circuit 101 monitors the level state between it and the command queue, and monitors the level state between it and the command line buffer 102;
- the level state of the command line indicates that there is a command to be sent in the command queue, and the level state between the command line buffer 102 and the command line buffer 102 indicates that the command line buffer 102 is empty, then the current command line is read from the command queue.
- the process of reading the command queue by the parsing circuit 101 may further include: when the command queue stores the command to be sent, sending a first level signal to the parsing circuit 101, where the first level signal represents that the command to be sent is stored in the command queue ; After receiving the first level signal, the parsing circuit 101 sends a second level signal to the command line buffer 102. After the command line buffer 102 receives the second level signal, there is no signal in the command line buffer 102. In the case of storing any command line, a third level signal is sent to the parsing circuit 101. After receiving the third level signal, the parsing circuit 101 feeds back the fourth level signal to the command queue, and the command queue receives the fourth level signal. After the signal is sent, the parsing circuit 101 sends the current command line among the plurality of command lines to be sent.
- the command line buffer 102 When the command line buffer 102 stores a command line, it feeds back a fifth level signal to the parsing circuit 101. After receiving the fifth level signal, the parsing circuit 101 feeds back a sixth level signal to the command queue, and the command queue After receiving the sixth level signal, continue to send the first level signal to the analysis circuit 101 until the fourth level signal fed back by the analysis circuit 101 is received.
- the above-mentioned sending of the first level signal, the second level signal, the third level signal, the fourth level signal, the fifth level signal, and the sixth level signal may be a transmission state, or may It is the corresponding circuit module that maintains the state corresponding to the level signal. For example, if the first level signal sent by the command queue to the parsing circuit 101 is a high level, then the command queue may send a high level to the parsing circuit 101 once every clock cycle, or the command queue may keep a high level all the time. state.
- the parsing circuit 101 is further configured to send the first line of the command line and the first pause instruction to the command line buffer when the number of commands is equal to the threshold of the number of commands; the command line buffer 102, after receiving the After the first line of the command line and the first pause instruction, the arbitration request signal is sent to the arbitration circuit by pause.
- the parsing circuit 101 monitors in real time whether the number of commands in the first information buffer has changed to be less than the threshold of the number of commands; after monitoring that the number of commands has changed to be less than the threshold of the number of commands, the parsing circuit 101 sends the first start to the command line buffer 102 command; after receiving the first start command, the command line buffer 102 sends an arbitration request signal to the arbitration circuit 30 .
- the distribution circuit 10 After the distribution circuit 10 reads the current command line, it determines whether the current command line is the first command line of the first command.
- the arithmetic unit identifier reads the number of commands and the threshold of the number of commands from the first information buffer corresponding to the identifier of the arithmetic unit; in the case that the number of commands is less than the threshold of the number of commands, determine whether the first line of the command line is in a ready state;
- the arbitration circuit 30 transmits an arbitration request signal.
- the distribution circuit 10 further includes a command line counter 103 ; the command line counter 103 is connected to the parsing circuit 101 .
- the parsing circuit 101 is configured to read the first count value from the command line counter 103 after reading the current command line from the command queue; when the first count value is less than the first preset value and greater than the original value, determine The current command line is the non-first command line in the first command.
- the first preset value is determined based on the number of command line lines of the first command.
- the first preset value is related to the original value of the command line buffer 102 .
- the first preset value can be m+n; the original value can be set according to the actual situation, such as the original value It can be set to 0, or 1, etc., and can be set according to actual needs.
- the parsing circuit 101 reads the current command line from the command queue, and when it is determined that the current command line is a non-first line command line in the first command, sends the current command line to the command line buffer 102, as shown in 4 in Figure 3
- the command line buffer 102 after receiving the current command line sent by the parsing circuit 101, sends an arbitration request signal to the arbitration circuit 30, as shown in 5 in FIG. 3 .
- the parsing circuit 101 reads the current command line from the command queue, it reads the first count value from the command line counter 103, as shown in 1 and 3 in FIG. 3; after the parsing circuit 101 reads the first count value, After it is determined that the current command line is a non-first line command line in the first command, the command line counter 103 sends a first count instruction, as shown in 2 in FIG. 3 ; The first count value is incremented by the first value after the count instruction.
- the first value is set according to the specific application situation, for example, for the number of lines of the command line read by the recording parsing circuit 101 , the first value is, for example, 1.
- the parsing circuit 101 determines that the current command line is the first command line in the first command, Update the first preset value based on the number of command line lines of the first command and send a reset instruction to the command line counter 103, as shown in 6 in FIG. 3 ; after the command line counter 103 receives the reset instruction sent by the parsing circuit 101 , reset the first count value to the original value and then increase the first value.
- the parsing circuit 101 determines that the current command line is the first line command of the first command, based on the operation unit identifier carried in the first line command line, the number of commands and the number of commands are read from the first information buffer corresponding to the operation unit identifier. Threshold; if the number of commands is less than the threshold of the number of commands, determine whether the first line of the command line is in a ready state; if so, send an arbitration request signal to the arbitration circuit 30 .
- the distribution circuit 10 further includes a judgment circuit 104 .
- the analysis circuit 101 is connected to the judgment circuit 104 .
- the parsing circuit 101 is also used to determine that the current command line is the first command line in the first command, and in the case that the number of commands is less than the command number threshold, from the first command line to parse the operation unit identifier corresponding to the first command, and send the operation unit identifier to the judgment circuit 104, and send the current command line to the command line buffer 102;
- the judgment circuit 104 is used to receive the arithmetic unit identifier sent by the parsing circuit 101, and based on the arithmetic unit identifier, it is judged that the first arithmetic unit corresponding to the first command and the second arithmetic unit corresponding to the second command that the command queue has recently sent are different, And when the second command is not processed by the second arithmetic unit, send a second pause command to the command line buffer 102;
- the command line buffer 102 is further configured to suspend sending an arbitration request signal to the arbitration circuit 30 when the second suspend instruction sent by the judgment circuit 104 is received.
- the command counter 105 is further included in the distribution circuit 10 .
- the command counter 105 is connected to the judgment circuit 104 .
- the judgment circuit 104 is further configured to read the second count value from the command counter 105 after receiving the operation unit identifier sent by the analysis circuit 101, and determine the first count value when the second count value is greater than the second preset value.
- the second command has not been processed by the second operation unit;
- the command counter 105 is used to count the commands corresponding to the command queue that are currently sent but not yet processed.
- the parsing circuit 101 is connected to the judgment circuit 104 and the command counter 105, and the command counter 105 is connected to the judgment circuit 104; when the current command line is the first command line in the first command, The parsing circuit 101 parses the arithmetic unit identification corresponding to the first command from the first line command line, and sends the arithmetic unit identification to the judgment circuit 104, as shown in 7 in Figure 3, and sends the current command line,
- the operation unit identifier is shown as 8 in FIG. 3 ; wherein, the operation unit identifier may be, for example, a binary array, used to represent the address of the first operation unit corresponding to the first command.
- the judgment circuit 104 After the judgment circuit 104 receives the operation unit identifier sent by the parsing circuit 101, it is determined that the received operation unit identifier is consistent with the second identifier of the second operation unit corresponding to the second command that the command queue has recently sent. That is, the ready state described in the above state (1), the judgment circuit 104 maintains a fixed level signal such as a high level. When the judgment circuit 104 is maintained at a high level, the command line buffer 102 receives the parsing circuit 101. After sending the current command line and the operation unit identifier, the arbitration request signal is sent to the arbitration circuit 30 as shown in 9 in FIG. 3 .
- the second identifier may be, for example, a binary array, which is used to represent the address of the second operation unit.
- the judgment circuit 104 reads the second count value from the command counter 105 after receiving the operation unit identifier sent by the parsing circuit 101 , and in the case that the second count value is equal to the second preset value , it is determined that the second command has been processed by the second operation unit, and when the operation unit identifier is inconsistent with the second identifier of the second operation unit corresponding to the second command, it is the ready state described in the above state (2).
- the judging circuit 104 is kept at a fixed level signal, such as a high level.
- the command line buffer 102 After receiving the current command line and the arithmetic unit identifier sent by the parsing circuit 101, sends the The arbitration circuit 30 sends the arbitration request signal as shown in 9 in FIG. 3 .
- the judgment circuit 104 reads the second count value from the command counter 105 after receiving the operation unit identifier sent by the parsing circuit 101 , and when the second count value is greater than the second preset value In this case, it is determined that the second command that has been sent recently has not been processed by the second operation unit, and when the identifier of the operation unit is inconsistent with the second identifier of the second operation unit, the judgment circuit 104 sends the command to the command line buffer 102.
- the second pause command is shown in Figure 3 As shown, the command line buffer 102 suspends sending the arbitration request signal to the arbitration circuit 30 when receiving the second suspend instruction sent by the judgment circuit 104 .
- the judgment circuit 104 monitors whether the second count value in the command counter 105 changes to the second preset value when it is determined that the second command has not been processed by the second arithmetic unit; and monitors the second count of the command counter 105 When the value changes to the second preset value, a second start command is sent to the command line buffer 102 as shown in FIG. 3 As shown; the command line buffer 102 sends an arbitration request signal to the arbitration circuit 30 after receiving the second start command.
- the arbitration circuit 30 After receiving the arbitration request signal sent by each command line buffer 102, the arbitration circuit 30 performs authority arbitration on each command line buffer 102, and based on the result of the authority arbitration, returns the authority permission to the command line buffer 102 that has obtained the sending authority
- the signal is shown in Figure 3 shown.
- the command line buffer 102 After receiving the permission permission signal returned by the arbitration circuit 30 based on the arbitration request signal, the command line buffer 102 sends the current command line to the first operation unit corresponding to the first command.
- the command line buffer 102 sends the current command line and the arithmetic unit identifier of the first arithmetic unit to the arbitration circuit 30 after receiving the permission permission signal returned by the arbitration circuit 30 based on the arbitration request signal.
- the arbitration circuit 30 sends the current command line and the arithmetic unit identification to the command distribution interface 40 as shown in Figure 3 shown;
- the command distribution interface 40 sends the current command line and the operation unit identification to the bus interface after receiving the current command line and the arithmetic unit identification as shown in Figure 3
- the bus interface sends the current command line to the first operation unit based on the operation unit identifier.
- the bus is connected to each operation unit, and the bus selects the operation unit to be communicated through the identification of each operation unit.
- the command line buffer 102 is connected to the command distribution interface 40; after receiving the permission permission signal returned by the arbitration circuit 30 based on the arbitration request signal, the command line buffer 102 sends the command distribution interface 40 The current command line and the operation unit identifier; the command distribution interface 40 sends the current command line and the operation unit identifier to the bus interface after receiving the current command line and the operation unit identifier; the bus interface receives the current command line and the operation unit identifier. After the unit identification, the current command line is sent to the first operation unit based on the operation unit identification.
- the command line buffer 102 is connected to the information buffer 20; the parsing circuit 101 sends the command queue identifier of the command queue to the command line buffer 102 when it is determined that the current command line is the first command line in the first command; the command When the line buffer 102 sends the current command line to the first operation unit corresponding to the first command, it sends the command queue identifier to the first information buffer; wherein, the first information buffer is the information buffer corresponding to the first operation unit device 20.
- the arbitration circuit 30 is connected to the information buffer 20 ; the information buffer 20 is connected to command counters corresponding to a plurality of command queues respectively; the command line buffer 102 sends the current command line, the operation unit to the arbitration circuit 30 Identification and command queue identification; when the arbitration circuit 30 sends the current command line and the arithmetic unit identification to the command distribution interface 40, it sends the command queue identification to the first information buffer as shown in Figure 3 shown.
- the first information buffer receives the command queue identifier; and the confirmation information fed back after receiving the first operation unit to process the first command is as shown in Figure 3
- a third counting instruction is sent to the command counter 105 as shown in FIG. 3
- the first information buffer updates the number of commands, for example, decrements the number of commands by 1, after receiving the confirmation information fed back after the first operation unit has processed the first command.
- the command counter 105 After receiving the third counting instruction sent by the first information buffer, the command counter 105 reduces the second counting value by the second value.
- the acknowledgement information fed back to the information buffer 20 may be, for example, an acknowledgement character (Acknowledge character, ACK).
- the command counter 105 can count the commands corresponding to the command queue that are currently sent but not yet processed.
- Figure 3 It does not represent a specific processing sequence, but only to illustrate the processing logic in two cases where the current command line acquired by the distribution circuit 10 is the first command line or the non-first command line of the first command to be sent currently.
- the arbitration circuit 30 only returns a permission permission signal to one command line register 102 , that is, the right to use the bus can only be given to one command line register 102 at the same time.
- the arbitration logic of the arbitration circuit 30 may be defined based on the registers connected to the arbitration circuit 30, for example, arbitration is performed by dividing the command queues into levels, or arbitration is based on a polling manner, which is not limited here.
- the writing order of each step does not mean a strict execution order but constitutes any limitation on the implementation process, and the specific execution order of each step should be based on its functions and possible Internal logic is determined.
- the embodiment of the present disclosure also provides a command distribution method corresponding to the command distribution device. Reference may be made to the implementation of the method, and repeated descriptions will not be repeated.
- the execution subject of the command distribution method provided by the embodiment of the present disclosure is generally a computer device with a certain computing capability.
- Equipment, UE mobile devices, user terminals, terminals, cellular phones, cordless phones, personal digital assistants (Personal Digital Assistant, PDA), handheld devices, computing devices, in-vehicle devices, wearable devices, etc.
- PDA Personal Digital Assistant
- the command distribution method may be implemented by the processor invoking computer-readable instructions stored in the memory.
- the command distribution method provided by the embodiment of the present disclosure will be described below by taking the execution subject as the command distribution apparatus as an example.
- a schematic diagram of a command distribution method provided by an embodiment of the present disclosure includes:
- each information buffer in at least one information buffer stores the number of currently unprocessed commands in the corresponding operation unit as the number of commands and the command number threshold of the corresponding operation unit;
- each distribution circuit in the at least one distribution circuit reads the first command line of the first command to be sent from the command queue corresponding to the distribution circuit, and based on the operation unit identifier carried in the first command line The number of read commands and the threshold of the number of commands in the first information buffer corresponding to the unit identifier; when the number of commands is less than the threshold of the number of commands, send an arbitration request signal to the arbitration circuit; after receiving the authority returned by the arbitration circuit based on the arbitration request signal After the permission signal is received, the first command line is sent to the first operation unit corresponding to the operation unit identifier.
- the preset condition includes: the number of commands is less than the threshold of the number of commands.
- the command distribution method further includes: when each distribution circuit in the at least one distribution circuit is equal to the command number threshold, monitoring the first command in real time Whether the number of commands in the information buffer has changed to be less than the threshold of the number of commands; after monitoring that the number of commands has changed to be less than the threshold of the number of commands, the arbitration request signal is sent to the arbitration circuit.
- the command distribution method further includes: each information buffer in the at least one information buffer acquires a dynamically configured command number threshold of the corresponding operation unit.
- the command number threshold of the corresponding operation unit is determined based on the size of the data storage space occupied by the currently unprocessed commands in the corresponding operation unit and the size of the total data storage space of the corresponding operation unit.
- the command distribution method further includes: after each distribution circuit in the at least one distribution circuit receives a permission permission signal returned by the arbitration circuit based on the arbitration request signal, send the The first operation unit corresponding to the operation unit identifier sends the first command.
- each distribution circuit in the at least one distribution circuit reads the first command currently to be sent from a command queue corresponding to the distribution circuit, including: each of the at least one distribution circuit The distribution circuit reads the current command line of the first command from the command queue corresponding to the distribution circuit. The distribution circuit reads the command number and the command number threshold from the first information buffer corresponding to the operation unit identifier based on the operation unit identifier carried in the first command, including: in the current When the command line is the first line of the command line of the first command, based on the operation unit identifier carried in the first command, read the number of commands and the number of commands from the first information buffer corresponding to the operation unit identifier. The command number threshold.
- the command distribution method further includes: in each distribution circuit in the at least one distribution circuit, when the current command line is a non-first line command line of the first command , sending the arbitration request signal to the arbitration circuit.
- the command distribution method further includes: each distribution circuit in the at least one distribution circuit determines whether the current command line is the first line of the command line.
- the distribution circuit in response to the number of commands meeting a preset condition, sends an arbitration request signal to the arbitration circuit, including: determining whether the first line of command lines is in a ready state; if so, sending an arbitration request signal to the arbitration circuit.
- the arbitration circuit sends the arbitration request signal.
- the first-line command line being in a ready state includes: a first operation unit corresponding to the first command where the first-line command line is located, and a second command corresponding to the second command that has been recently sent by the command queue
- the second operation unit is the same; or, the first operation unit is different from the second operation unit, but the second command has been processed by the second operation unit.
- the distribution circuit includes a parsing circuit and a command line buffer; the parsing circuit is respectively connected to the command line buffer and the information buffer.
- each distribution circuit in the at least one distribution circuit reads the first command line of the first command from the command queue corresponding to the distribution circuit, based on the operation unit identifier carried in the first line command line, from the operation
- the number of commands and the threshold of the number of commands are read from the first information buffer corresponding to the unit identifier; when the number of commands is less than the threshold of the number of commands, an arbitration request signal is sent to the arbitration circuit, including: the The parsing circuit reads the current command line of the first command from the command queue, and determines whether the current command line is the first command line; in the case that the current command line is the first command line, based on the The arithmetic unit identifier carried in the first line of the command line, reads the number of commands and the threshold of the number of commands from the first information buffer corresponding to the identifier of the arith
- the command distribution method further includes: when the number of commands is equal to the threshold of the number of commands, the parsing circuit sends the first line of the command line to the command line buffer , and a first pause command; after receiving the first command line and the first pause command sent by the parsing circuit, the command line buffer pauses sending the arbitration request signal to the arbitration circuit.
- the command distribution method further includes: the parsing circuit monitors in real time whether the number of commands in the first information buffer changes to be less than the threshold of the number of commands, After the number of commands is changed to be less than the threshold of the number of commands, a first activation instruction is sent to the command line buffer; after receiving the first activation instruction, the command line buffer sends the first activation instruction to the arbitration circuit. the arbitration request signal.
- the distribution circuit further includes a command line counter; the command line counter is connected to the parsing circuit.
- the parsing circuit determining whether the current command line is the first command line includes: after the parsing circuit reads the current command line from the command queue, reading a first count value from the command line counter; In the case that the first count value is equal to the first preset value or equal to the original value, it is determined that the current command line is the first command line in the first command; wherein, the first preset value, is determined based on the number of command line lines of the first command.
- the command distribution method further includes: when the parsing circuit determines that the current command line is the first command line, updating the first command line based on the number of command lines of the first command Presetting a value and sending a reset instruction to the command line counter; after receiving the reset instruction sent by the parsing circuit, the command line counter resets the first count value to the original value, and increases the first count value numerical value.
- the command distribution method further includes: after the parsing circuit determines that the current command line is a non-first line command line of the first command, sending a first command line to the command line counter A counting instruction; after the command line counter receives the first counting instruction sent by the parsing circuit, the first counting value is increased by a first value.
- the distribution circuit further includes a judgment circuit; the judgment circuit is respectively connected with the parsing circuit and the command line buffer.
- the command distribution method further includes: when the parsing circuit determines that the current command line is the first line of the command line, and when the number of commands is less than the command number threshold, extracting the command from the first line of the command line.
- Parse the operation unit identifier corresponding to the first command send the operation unit identifier to the judgment circuit, and send the current command line and the operation unit identifier to the command line buffer; the judgment The circuit receives the operation unit identifier sent by the parsing circuit, and determines the second operation unit corresponding to the first operation unit corresponding to the first command and the second command recently sent by the command queue based on the operation unit identifier.
- send a second pause instruction to the command line buffer; the command line buffer receives the judgment circuit When the second pause command is sent, transmission of the arbitration request signal to the arbitration circuit is paused.
- the distribution circuit further includes a command counter; the command counter is connected to the judgment circuit.
- the command distribution method further includes: after the judging circuit receives the operation unit identifier sent by the parsing circuit, reading a second count value from the command counter, and when the second count value is greater than In the case of a preset value, it is determined that the second command has not been processed by the second operation unit.
- the command counter is used to count the commands corresponding to the command queue that are currently sent but not yet processed.
- the command distribution method further includes: when the judgment circuit determines that the second command has not been processed by the second arithmetic unit, monitoring the first command in the command counter. Whether the second count value has changed to the second preset value; and in the case of monitoring that the second count value of the command counter has changed to the second preset value, send a second start command to the command line buffer; After receiving the second start command, the command line buffer sends the arbitration request signal to the arbitration circuit.
- the command counter is connected to the parsing circuit.
- the command distribution method further includes: when the current command line is the first command line, the parsing circuit detects that the command line buffer sends the current command line to the first computing unit after monitoring that the current command line is sent to the first computing unit. , sending a second counting instruction to the command counter; after receiving the second counting instruction, the command counter increases the second counting value by a second value.
- the information buffer is connected to command counters corresponding to the plurality of command queues respectively.
- the command distribution method further includes: after the first information buffer receives the confirmation information fed back after the first operation unit has processed the first command, based on the command line queue identifier and the Confirm the information, and send a third count instruction to the command counter corresponding to the command queue identifier; after the command counter receives the third count instruction sent by the first information buffer, the second count value is reduced by the third count. binary value.
- the command distribution method further includes: after the first information buffer receives the confirmation information fed back after the first operation unit has processed the first command, updating all the number of commands.
- Embodiments of the present disclosure provide a specific example of a command distribution process, including:
- Step 1 The parsing circuit 101 reads the current command line in the first command to be sent from the command queue, and reads the first count value from the command line counter 103 after reading the current command line.
- Step 2 The parsing circuit 101 compares the first count value with the first preset value. If the first count value is less than the first preset value and greater than the original value, go to step 3; if the first count value is equal to the first preset value or equal to the original value, go to step 11.
- Step 3 The parsing circuit 101 sends the current command line and the operation unit identifier corresponding to the first command to the command line buffer 102 . And send the first counting instruction to the command line counter 103 .
- Step 4 The command line counter 103 increases the first count value by the first value according to the first count instruction.
- Step 5 After receiving the current command line sent by the parsing circuit and the operation unit identifier corresponding to the first command, the command line buffer 102 sends an arbitration request signal to the arbitration circuit.
- step 4 and step 5 have no order of execution.
- Step 6 Following the above step 5, after receiving the arbitration request signal sent by each command line buffer 104, the arbitration circuit 30 performs authority arbitration on each command line buffer 102, and based on the result of the authority arbitration, sends the command to obtain the sending authority.
- the line buffer 102 returns the permission permission signal, and jumps to step 7 or jumps to step 8 .
- Step 7 After receiving the permission permission signal sent by the arbitration circuit 30, the command line buffer 102 sends the current command line and the operation unit identifier corresponding to the first command to the command distribution interface 40, and jumps to step 9.
- the command line buffer 102 is connected to the command distribution interface 40 through an arbitration circuit.
- Step 8 After receiving the permission permission signal sent by the arbitration circuit 30, the command line buffer 102 sends the current command line and the operation unit identifier corresponding to the first command to the arbitration circuit 30, and the arbitration circuit receives the current command line and the first command. After the operation unit identifier corresponding to a command is sent, the current command line and the operation unit identifier corresponding to the first command are sent to the command distribution interface 40 . In this case, the command line buffer 102 is directly connected to the command distribution interface 40 .
- step 7 and step 8 are two mutually exclusive possible implementations.
- Step 9 Following the above-mentioned step 7 or step 8 or step 23, the command distribution interface 40 sends the current command line and the operation corresponding to the first command to the bus interface after receiving the current command line and the operation unit identifier corresponding to the first command. Unit ID.
- Step 10 After receiving the current command line sent by the command distribution interface 40 and the operation unit identifier corresponding to the first command, the bus interface sends the current command line to the first operation unit corresponding to the first command based on the operation unit identifier, and jumps. Go to step 27.
- Step 11 Following the above step 2, the parsing circuit 101 sends a reset instruction to the command line counter 103, and updates the first preset value based on the number of lines of the command line of the first command; based on the arithmetic unit identifier carried in the current command line, The number of commands and the threshold of the number of commands are read from the first information buffer corresponding to the identifier of the operation unit, and the identifier of the operation unit is sent to the judgment circuit 104 .
- Step 12 After receiving the reset instruction sent by the parsing circuit 101, the command line counter 103 resets the first count value to the original value and then increases the first value.
- Step 13 the parsing circuit 101 determines whether the number of commands is less than the threshold of the number of commands; if so, go to step 15 ; if not, go to step 14 .
- step 12 and step 13 have no order of execution.
- Step 14 The parsing circuit 101 sends the current command line, the operation unit identifier and the first pause instruction to the command line buffer 102; the command line buffer 102 receives the current command line, the operation unit identifier and the first pause sent by the parsing circuit 101 After the instruction, suspend sending an arbitration request signal to the arbitration circuit; and the parsing circuit 101 monitors in real time whether the number of commands in the first information buffer changes to be less than the threshold of the number of commands; Then, send the first startup instruction to the command line buffer 102 ; after the command line buffer 102 receives the first startup instruction, it jumps to step 16 .
- Step 15 Following Step 13, the parsing circuit 101 sends the current command line and the arithmetic unit identifier to the command line buffer 102; the command line buffer 102 sends the current command line and arithmetic unit identifier sent by the parsing circuit 101 to the arbitration circuit Send an arbitration request signal.
- Step 16 After the judgment circuit 104 receives the operation unit identifier sent by the analysis circuit 101, it reads the second count value of the command counter 105, and compares the second count value with the second preset value. In the case of two preset values, go to step 17, and in the case that the second count value is not equal to the second preset value, go to step 24.
- Step 17 After receiving the current command line sent by the parsing circuit 101 and the operation unit identifier corresponding to the first command, the command line buffer 102 sends an arbitration request signal to the arbitration circuit.
- Step 18 After receiving the arbitration request signal sent by each command line buffer 104, the arbitration circuit 30 performs authority arbitration on each command line buffer 102, and returns to the command line buffer 102 that has obtained the sending authority based on the result of the authority arbitration Permission permission signal, go to step 19 or go to step 20.
- Step 19 After receiving the permission permission signal sent by the arbitration circuit 30, the command line buffer 102 sends the current command line and the operation unit identifier corresponding to the first command to the command distribution interface 40, and sends the current command to the first information buffer.
- Step 20 Following Step 18, after receiving the permission permission signal sent by the arbitration circuit 30, the command line buffer 102 sends the current command line, the operation unit identifier corresponding to the first command, and the command queue where the current command line is located to the arbitration circuit 30. After receiving the current command line, the arithmetic unit identification corresponding to the first command, and the command queue identification of the command queue where the current command line is located, the arbitration circuit 30 sends the current command line and the first command corresponding to the command distribution interface 40. and send the command queue identifier of the command queue where the current command line is located to the first information buffer corresponding to the operation unit identifier.
- step 19 and step 20 are two mutually exclusive possible implementations.
- Step 21 Following Step 19 or Step 20, after sending the current command line, the command line buffer 102 feeds back to the parsing circuit 101 feedback information that the current command line has been sent.
- Step 22 After receiving the feedback information that the current command line has been sent from the command line buffer 102, the parsing circuit 101 sends a second counting instruction to the command counter 105.
- Step 23 after the command counter 105 receives the second count instruction sent by the parsing circuit 101 , it increases the second count value by a second value, and jumps to step 9 .
- Step 24 Following step 16, the judgment circuit 104 judges, based on the operation unit identifier, whether the first operation unit corresponding to the first command and the second operation unit corresponding to the second command recently sent by the command queue are consistent, yes, jump to step 24 17, no, go to step 25.
- Step 25 The judgment circuit 104 sends the second pause command to the command line register 102, and monitors the second count value of the command counter 105 in real time. Start command.
- Step 26 After receiving the second pause command sent by the judgment circuit 104, the command line buffer 102 stops sending the arbitration request signal to the arbitration circuit 30, and sends the arbitration request signal to the arbitration circuit after receiving the second start command sent by the judgment circuit 104. request signal, go to step 18.
- Step 27 Following step 10, the first operation unit feeds back the processed confirmation information to the first information buffer after receiving and processing the first command currently to be sent.
- Step 28 After receiving the confirmation information fed back by the first arithmetic unit, the first information buffer sends a third counting instruction to the corresponding command counter 105 based on the command queue identifier where the processed command is located, and decrements the number of commands by 1 .
- Step 29 After receiving the third counting instruction, the command counter 105 reduces the second counting value by the second value.
- An embodiment of the present disclosure further provides a chip, including the command distribution apparatus according to any embodiment of the present disclosure.
- An embodiment of the present disclosure further provides a computer device, including the chip provided by any embodiment of the present disclosure.
- Embodiments of the present disclosure further provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is run by a processor, the steps of the command distribution method described in the foregoing method embodiments are executed.
- the storage medium may be a volatile or non-volatile computer-readable storage medium.
- the units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
- each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
- the functions, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a processor-executable non-volatile computer-readable storage medium.
- the computer software products are stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present disclosure.
- the aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes .
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Artificial Intelligence (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Data Mining & Analysis (AREA)
- Evolutionary Computation (AREA)
- Medical Informatics (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Computer And Data Communications (AREA)
- Remote Monitoring And Control Of Power-Distribution Networks (AREA)
Abstract
Description
Claims (20)
- 一种命令分发装置,其特征在于,包括至少一个分发电路、以及至少一个信息缓存器;其中,每一所述分发电路与所述至少一个信息缓存器连接;A command distribution device, comprising at least one distribution circuit and at least one information buffer; wherein each of the distribution circuits is connected to the at least one information buffer;所述至少一个信息缓存器中的各信息缓存器,用于Each information buffer in the at least one information buffer is used for存储对应运算单元中当前未处理完命令的数量作为命令数量、以及所述对应运算单元的命令数阈值;Store the number of current unprocessed commands in the corresponding operation unit as the number of commands and the command number threshold of the corresponding operation unit;所述至少一个分发电路中的各分发电路,用于each distribution circuit in the at least one distribution circuit for从与该分发电路对应的命令队列读取当前待发送的第一命令;Read the first command currently to be sent from the command queue corresponding to the distribution circuit;基于所述第一命令中携带的运算单元标识,从所述运算单元标识对应的第一信息缓存器中读取所述命令数量以及所述命令数阈值;Based on the operation unit identifier carried in the first command, read the command number and the command number threshold from the first information buffer corresponding to the operation unit identifier;响应于所述命令数量满足预设条件,向仲裁电路发送仲裁请求信号。In response to the number of commands meeting a preset condition, an arbitration request signal is sent to the arbitration circuit.
- 根据权利要求1所述的命令分发装置,其特征在于,所述预设条件包括:The command distribution apparatus according to claim 1, wherein the preset conditions include:所述命令数量小于所述命令数阈值。The number of commands is less than the number of commands threshold.
- 根据权利要求2所述的命令分发装置,其特征在于,所述至少一个分发电路中的各分发电路,还用于在所述命令数量等于所述命令数阈值的情况下,The command distribution apparatus according to claim 2, wherein each distribution circuit in the at least one distribution circuit is further configured to:实时监测所述第一信息缓存器中的所述命令数量是否变化为小于所述命令数阈值;Monitor in real time whether the number of commands in the first information buffer changes to be less than the threshold of the number of commands;在监测到所述命令数量变化为小于所述命令数阈值后,向所述仲裁电路发送所述仲裁请求信号。The arbitration request signal is sent to the arbitration circuit after monitoring that the number of commands is changed to be less than the threshold of the number of commands.
- 根据权利要求1至3任一项所述的命令分发装置,其特征在于,所述对应运算单元的命令数阈值,是基于所述对应运算单元中当前未处理完命令所占据的数据存储空间大小、以及所述对应运算单元的数据存储总空间大小确定的。The command distribution device according to any one of claims 1 to 3, wherein the command number threshold of the corresponding operation unit is based on the size of the data storage space occupied by the currently unprocessed commands in the corresponding operation unit , and the size of the total data storage space of the corresponding operation unit.
- 根据权利要求1至4任一项所述的命令分发装置,其特征在于,所述至少一个分发电路中的各分发电路,还用于:The command distribution device according to any one of claims 1 to 4, wherein each distribution circuit in the at least one distribution circuit is further configured to:在接收到所述仲裁电路基于所述仲裁请求信号返回的权限许可信号后,向与所述运算单元标识对应的第一运算单元发送所述第一命令。After receiving the permission permission signal returned by the arbitration circuit based on the arbitration request signal, the first command is sent to the first operation unit corresponding to the operation unit identifier.
- 根据权利要求1至5任一项所述的命令分发装置,其特征在于,The command distribution device according to any one of claims 1 to 5, characterized in that:所述至少一个分发电路中的各分发电路,在从与该分发电路对应的命令队列读取当前待发送的第一命令时,用于:Each distribution circuit in the at least one distribution circuit, when reading the first command currently to be sent from the command queue corresponding to the distribution circuit, is used for:从与该分发电路对应的命令队列读取所述第一命令的当前命令行;Read the current command line of the first command from the command queue corresponding to the distribution circuit;该分发电路,在基于所述第一命令中携带的运算单元标识,从所述运算单元标识对应的第一信息缓存器中读取所述命令数量以及所述命令数阈值时,用于:The distribution circuit, when reading the number of commands and the threshold of the number of commands from the first information buffer corresponding to the identifier of the arithmetic unit based on the identifier of the arithmetic unit carried in the first command, is used to:在所述当前命令行为所述第一命令的首行命令行的情况下,基于所述第一命令中携带的运算单元标识,从所述运算单元标识对应的第一信息缓存器中读取所述命令数量以及所述命令数阈值。In the case where the current command line is the first command line of the first command, based on the operation unit identifier carried in the first command, read the information from the first information buffer corresponding to the operation unit identifier the command number and the command number threshold.
- 根据权利要求6所述命令分发装置,其特征在于,所述至少一个分发电路中的各分发电路,还用于:The command distribution device according to claim 6, wherein each distribution circuit in the at least one distribution circuit is further configured to:在所述当前命令行为所述第一命令的非首行命令行的情况下,向所述仲裁电路发送所述仲裁请求信号。When the current command line is a non-first line command line of the first command, the arbitration request signal is sent to the arbitration circuit.
- 根据权利要求6或7所述的命令分发装置,其特征在于,所述至少一个分发电路中的各分发电路,在响应于所述命令数量满足预设条件,向仲裁电路发送仲裁请求信号时,用于:The command distribution device according to claim 6 or 7, wherein each distribution circuit in the at least one distribution circuit, in response to the number of commands meeting a preset condition, sends an arbitration request signal to the arbitration circuit, Used for:确定所述第一命令中的首行命令行是否为就绪状态;Determine whether the first line of the command line in the first command is in a ready state;若是,则向所述仲裁电路发送所述仲裁请求信号。If so, send the arbitration request signal to the arbitration circuit.
- 根据权利要求8所述的命令分发装置,其特征在于,所述第一命令中的首行命令行为就绪状态包括:The command distribution device according to claim 8, wherein the first command line in the first command is in a ready state comprising:所述第一命令对应的第一运算单元、与所述命令队列的最近已发送的第二命令对应 的第二运算单元相同;或者,The first operation unit corresponding to the first command is the same as the second operation unit corresponding to the recently sent second command of the command queue; or,所述第一运算单元、与所述第二运算单元不相同,但所述第二命令被所述第二运算单元处理完毕。The first operation unit is different from the second operation unit, but the second command has been processed by the second operation unit.
- 根据权利要求6至9任一项所述的命令分发装置,其特征在于,所述分发电路包括解析电路、以及命令行缓存器;所述解析电路分别和所述命令行缓存器、以及所述信息缓存器连接;The command distribution device according to any one of claims 6 to 9, wherein the distribution circuit comprises a parsing circuit and a command line buffer; the parsing circuit is respectively associated with the command line buffer and the command line buffer. information buffer connection;所述解析电路,用于The parsing circuit for从所述命令队列中读取所述第一命令的当前命令行;Read the current command line of the first command from the command queue;在所述当前命令行为首行命令行的情况下,基于所述首行命令行中携带的运算单元标识,从所述运算单元标识对应的第一信息缓存器中读取所述命令数量以及所述命令数阈值;In the case where the current command line is the first command line, based on the operation unit identifier carried in the first line of the command line, read the number of commands and the total number of commands from the first information buffer corresponding to the operation unit identifier. the number of commands described above;在所述命令数量小于所述命令数阈值的情况下,向所述命令行缓存器发送所述首行命令行;In the case that the number of commands is less than the threshold of the number of commands, sending the first command line to the command line buffer;所述命令行缓存器,用于the command line buffer for在接收所述解析电路发送的所述首行命令行后,向所述仲裁电路发送所述仲裁请求信号。After receiving the first command line sent by the parsing circuit, the arbitration request signal is sent to the arbitration circuit.
- 根据权利要求10所述的命令分发装置,其特征在于,The command distribution device according to claim 10, wherein:所述解析电路,还用于:The parsing circuit is also used for:在所述命令数量等于所述命令数阈值的情况下,向所述命令行缓存器发送所述首行命令行、以及第一暂停指令;In the case that the number of commands is equal to the threshold of the number of commands, sending the first line of the command line and the first pause instruction to the command line buffer;所述命令行缓存器,还用于:The command line cache is also used to:在接收所述解析电路发送的所述首行命令行以及所述第一暂停指令后,暂停向所述仲裁电路发送所述仲裁请求信号。After receiving the first line of the command line and the first pause instruction sent by the parsing circuit, the arbitration request signal is paused to be sent to the arbitration circuit.
- 根据权利要求11所述的命令分发装置,其特征在于,The command distribution apparatus according to claim 11, wherein:所述解析电路,还用于:The parsing circuit is also used for:实时监测所述第一信息缓存器中的所述命令数量是否变化为小于所述命令数阈值;Monitor in real time whether the number of commands in the first information buffer changes to be less than the threshold of the number of commands;在监测到所述命令数量变化为小于所述命令数阈值后,向所述命令行缓存器发送第一启动指令;After monitoring that the number of commands is changed to be less than the threshold of the number of commands, sending a first activation instruction to the command line buffer;所述命令行缓存器,还用于:The command line cache is also used to:在接收到所述第一启动指令后,向所述仲裁电路发送所述仲裁请求信号。After receiving the first start instruction, the arbitration request signal is sent to the arbitration circuit.
- 根据权利要求10至12任一项所述的命令分发装置,其特征在于,所述分发电路还包括命令行计数器;所述命令行计数器与所述解析电路连接;The command distribution device according to any one of claims 10 to 12, wherein the distribution circuit further comprises a command line counter; the command line counter is connected to the parsing circuit;所述解析电路,还用于:The parsing circuit is also used for:从所述命令队列中读取所述当前命令行后,从所述命令行计数器读取第一计数数值;After reading the current command line from the command queue, read the first count value from the command line counter;在所述第一计数数值等于基于所述第一命令的命令行行数确定的第一预设数值、或等于原始数值的情况下,确定所述当前命令行为所述第一命令中的首行命令行。In the case that the first count value is equal to the first preset value determined based on the number of command line lines of the first command, or is equal to the original value, determining that the current command line is the first line in the first command Command Line.
- 根据权利要求13所述的命令分发装置,其特征在于,The command distribution apparatus according to claim 13, wherein:所述解析电路,还用于在确定所述当前命令行为首行命令行的情况下,The parsing circuit is further configured to, in the case of determining that the current command line is the first command line,基于所述第一命令的命令行行数更新第一预设数值,并update the first preset value based on the number of command line lines of the first command, and向所述命令行计数器发送重置指令;sending a reset instruction to the command line counter;所述命令行计数器,还用于:The command line counters are also used to:接收到所述解析电路发送的重置指令后,将所述第一计数数值重置为原始数值后,增加第一数值。After receiving the reset instruction sent by the parsing circuit, after resetting the first count value to the original value, the first value is increased.
- 根据权利要求10至14任一项所述的命令分发装置,其特征在于,所述分发电 路还包括判断电路;所述判断电路分别与所述解析电路、所述命令行缓存器连接;The command distribution device according to any one of claims 10 to 14, wherein the distribution circuit further comprises a judgment circuit; the judgment circuit is respectively connected with the parsing circuit and the command line buffer;所述解析电路,还用于在所述当前命令行为所述首行命令行、且所述命令数量小于所述命令数阈值的情况下,The parsing circuit is further configured to, when the current command line is the first line command line and the number of commands is less than the threshold of the number of commands,从所述首行命令行中解析所述第一命令对应的运算单元标识;Parse the operation unit identifier corresponding to the first command from the first command line;向所述判断电路发送所述运算单元标识,以及sending the arithmetic unit identifier to the judgment circuit, and向所述命令行缓存器发送所述当前命令行、以及所述运算单元标识;sending the current command line and the operation unit identifier to the command line buffer;所述判断电路,用于:The judgment circuit is used for:接收所述解析电路发送的所述运算单元标识,并receiving the operation unit identifier sent by the parsing circuit, and在基于所述运算单元标识判断所述第一命令对应的第一运算单元和所述命令队列最近已发送的第二命令对应的第二运算单元不同、且所述第二命令未被所述第二运算单元处理完毕的情况下,向所述命令行缓存器发送第二暂停指令;When it is determined based on the operation unit identifier that the first operation unit corresponding to the first command and the second operation unit corresponding to the second command recently sent by the command queue are different, and the second command is not In the case that the two arithmetic units are processed, send a second pause instruction to the command line buffer;所述命令行缓存器,还用于:The command line cache is also used to:在接收到所述判断电路发送的所述第二暂停指令的情况下,暂停向所述仲裁电路发送所述仲裁请求信号。In the case of receiving the second pause command sent by the judgment circuit, the transmission of the arbitration request signal to the arbitration circuit is paused.
- 根据权利要求15所述的命令分发装置,其特征在于,所述信息缓存器与多个命令队列分别对应的命令计数器连接;The command distribution device according to claim 15, wherein the information buffer is connected to command counters corresponding to a plurality of command queues respectively;所述第一信息缓存器,还用于:The first information buffer is also used for:在接收到所述第一运算单元将所述第一命令处理完毕后反馈的确认信息后,基于所述命令行队列标识、以及所述确认信息,向所述命令队列标识对应的命令计数器发送第三计数指令;After receiving the confirmation information fed back after the first operation unit has processed the first command, based on the command line queue identifier and the confirmation information, send the first command counter to the command queue identifier corresponding to the command queue identifier. Three counting instructions;所述命令计数器,用于:The command counter for:在接收到所述第一信息缓存器发送的第三计数指令后,将所述命令计数器的当前第二计数数值减少第二数值。After receiving the third count instruction sent by the first information buffer, the current second count value of the command counter is decreased by a second value.
- 一种命令分发方法,其特征在于,应用于命令分发装置,所述命令分发装置包括至少一个分发电路、以及至少一个信息缓存器;其中,每一所述分发电路与所述至少一个信息缓存器连接;所述命令分发方法包括:A command distribution method, characterized by being applied to a command distribution device, the command distribution device comprising at least one distribution circuit and at least one information buffer; wherein, each of the distribution circuits and the at least one information buffer connection; the command distribution method includes:所述至少一个信息缓存器中的各信息缓存器存储对应运算单元中当前未处理完命令的数量作为命令数量、以及所述对应运算单元的命令数阈值;Each information buffer in the at least one information buffer stores the number of currently unprocessed commands in the corresponding operation unit as the number of commands and the command number threshold of the corresponding operation unit;所述至少一个分发电路中的各分发电路each distribution circuit in the at least one distribution circuit从与该分发电路对应的命令队列读取当前待发送的第一命令,Read the first command currently to be sent from the command queue corresponding to the distribution circuit,基于所述第一命令中携带的运算单元标识,从所述运算单元标识对应的第一信息缓存器中读取所述命令数量以及所述命令数阈值;Based on the operation unit identifier carried in the first command, read the command number and the command number threshold from the first information buffer corresponding to the operation unit identifier;响应于所述命令数量满足预设条件,向仲裁电路发送仲裁请求信号。In response to the number of commands meeting a preset condition, an arbitration request signal is sent to the arbitration circuit.
- 一种芯片,其特征在于,包括如权利要求1至16任一项所述的命令分发装置。A chip, characterized by comprising the command distribution device according to any one of claims 1 to 16.
- 一种计算机设备,其特征在于,包括指令存储器和如权利要求18所述的芯片。A computer device, characterized in that it includes an instruction memory and a chip as claimed in claim 18 .
- 一种计算机可读存储介质,其特征在于,该计算机可读存储介质上存储有计算机程序,该计算机程序被处理器运行时执行如权利要求17所述的命令分发方法的步骤。A computer-readable storage medium, characterized in that, a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the command distribution method according to claim 17 are executed.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110476337.X | 2021-04-29 | ||
CN202110476337.XA CN113138802B (en) | 2021-04-29 | 2021-04-29 | Command distribution device, method, chip, computer device and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2022227693A1 true WO2022227693A1 (en) | 2022-11-03 |
Family
ID=76816584
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2022/070709 WO2022227693A1 (en) | 2021-04-29 | 2022-01-07 | Command distribution apparatus and method, chip, computer device, and medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN113138802B (en) |
WO (1) | WO2022227693A1 (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113138802B (en) * | 2021-04-29 | 2024-03-05 | 上海阵量智能科技有限公司 | Command distribution device, method, chip, computer device and storage medium |
CN113138801B (en) * | 2021-04-29 | 2023-08-04 | 上海阵量智能科技有限公司 | Command distribution device, method, chip, computer device and storage medium |
CN114265717A (en) * | 2021-12-30 | 2022-04-01 | 上海阵量智能科技有限公司 | Instruction synchronization device, chip, computer equipment and data processing method |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104298628A (en) * | 2014-09-30 | 2015-01-21 | 中国电子科技集团公司第三十八研究所 | Data storage device arbitration circuit and method for concurrent access |
CN105243033A (en) * | 2015-09-28 | 2016-01-13 | 联想(北京)有限公司 | Data processing method and electronic device |
US20170185542A1 (en) * | 2015-12-24 | 2017-06-29 | Arm Limited | Arbitration of requests requiring a variable number of resources |
CN112597080A (en) * | 2020-12-29 | 2021-04-02 | 联芸科技(杭州)有限公司 | Read request control device and method and memory controller |
CN113138802A (en) * | 2021-04-29 | 2021-07-20 | 上海阵量智能科技有限公司 | Command distribution device, method, chip, computer equipment and storage medium |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2007265303A (en) * | 2006-03-29 | 2007-10-11 | Brother Ind Ltd | Computer program |
JP5722264B2 (en) * | 2012-03-23 | 2015-05-20 | 株式会社日立ハイテクノロジーズ | Data processing apparatus and data capacity increase suppressing method |
US20170109203A1 (en) * | 2015-10-15 | 2017-04-20 | International Business Machines Corporation | Task scheduling |
CN110825312B (en) * | 2018-08-10 | 2023-06-23 | 昆仑芯(北京)科技有限公司 | Data processing device, artificial intelligent chip and electronic equipment |
-
2021
- 2021-04-29 CN CN202110476337.XA patent/CN113138802B/en active Active
-
2022
- 2022-01-07 WO PCT/CN2022/070709 patent/WO2022227693A1/en active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104298628A (en) * | 2014-09-30 | 2015-01-21 | 中国电子科技集团公司第三十八研究所 | Data storage device arbitration circuit and method for concurrent access |
CN105243033A (en) * | 2015-09-28 | 2016-01-13 | 联想(北京)有限公司 | Data processing method and electronic device |
US20170185542A1 (en) * | 2015-12-24 | 2017-06-29 | Arm Limited | Arbitration of requests requiring a variable number of resources |
CN112597080A (en) * | 2020-12-29 | 2021-04-02 | 联芸科技(杭州)有限公司 | Read request control device and method and memory controller |
CN113138802A (en) * | 2021-04-29 | 2021-07-20 | 上海阵量智能科技有限公司 | Command distribution device, method, chip, computer equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN113138802B (en) | 2024-03-05 |
CN113138802A (en) | 2021-07-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2022227693A1 (en) | Command distribution apparatus and method, chip, computer device, and medium | |
WO2022227614A1 (en) | Command distribution apparatus and method, chip, computer device, and storage medium | |
US7953915B2 (en) | Interrupt dispatching method in multi-core environment and multi-core processor | |
WO2018076793A1 (en) | Nvme device, and methods for reading and writing nvme data | |
US8893146B2 (en) | Method and system of an I/O stack for controlling flows of workload specific I/O requests | |
US20200218662A1 (en) | Data caching device and control method therefor, data processing chip, and data processing system | |
CN104572974B (en) | service request processing method and device | |
CN108023829B (en) | Message processing method and device, storage medium and electronic equipment | |
US20230421512A1 (en) | Packet processing with reduced latency | |
US8447897B2 (en) | Bandwidth control for a direct memory access unit within a data processing system | |
CN107743137B (en) | File uploading method and device | |
US9798591B2 (en) | Method, apparatus, and chip for implementing mutually-exclusive operation of multiple threads | |
CN114567607B (en) | Multi-port arbitration method, device, equipment and computer readable storage medium | |
CN115934625B (en) | Doorbell knocking method, equipment and medium for remote direct memory access | |
CN116627869B (en) | Data transmission method and device applied to electronic equipment | |
CN115964319A (en) | Data processing method for remote direct memory access and related product | |
CN117389766A (en) | Message sending method and device, storage medium and electronic device | |
CN115469804B (en) | NVMe multi-queue arbitration method and device | |
WO2023093805A1 (en) | Storage control method, storage controller, storage chip, network card, and readable medium | |
CN115981893A (en) | Message queue task processing method and device, server and storage medium | |
WO2022227561A1 (en) | Apparatus and method for data reading, chip, computer device, and storage medium | |
CN112732176B (en) | SSD (solid State disk) access method and device based on FPGA (field programmable Gate array), storage system and storage medium | |
CN116136790A (en) | Task processing method and device | |
CN113076138B (en) | NVMe command processing method, device and medium | |
US9934184B1 (en) | Distributed ordering system |
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: 22794176 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: 22794176 Country of ref document: EP Kind code of ref document: A1 |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 22794176 Country of ref document: EP Kind code of ref document: A1 |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 160424) |