Instruction processing method, microprocessor and storage medium
By responding to instruction cancellation events in the microprocessor and maintaining the resource occupancy permission of the flow station, re-transmitting cancel instructions, solving the problem of inefficient instruction processing and improving processor performance.
Patent Information
- Application Number
- CN202410822071.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-25
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-06-25
AI Technical Summary
In the prior art, after the instruction is cancelled after the microprocessor's flow station is transmitted, it needs to be re-selected from the transmission queue and passed through each flow station again, resulting in low instruction processing efficiency and reduced processor operation performance.
By introducing instruction processing methods in the microprocessor, cancel the transmission event in response to the instruction, maintain the pending instructions' occupancy rights of the already passed flow station resources, and re-send the instructions when the target flow station allows it to prevent the instructions from passing through multiple flow stations again. stand.
It improves the instruction processing efficiency, improves the processor's operating performance, and reduces the number of flow stations required to pass during the instruction processing.
Smart Images

Figure CN118377538B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an instruction processing method, a microprocessor and a storage medium. Background Art
[0002] In the micro-architecture of the processor, any instruction needs to pass through several pipeline stations from the issuance queue to the execution unit, and the instruction may be cancelled at any pipeline station for various reasons, such as resource conflicts, cancellation of related instructions, etc. In the prior art, if an instruction is cancelled at any pipeline station, when the instruction needs to be issued again, it needs to be re-selected from the issuance queue and issued again, and enter the execution unit after passing through each pipeline station again. Obviously, this instruction processing method will lead to low instruction processing efficiency and reduce the operating performance of the processor. Summary of the invention
[0003] In view of this, the present application is committed to providing an instruction processing method, a microprocessor and a storage medium, which maintain the occupation rights of the relevant resources in the pipeline stations that have been passed by the canceled instruction, and re-transmit the canceled instruction when the pipeline station where the instruction is canceled allows the instruction to be transmitted, so as to avoid the instruction passing through each pipeline station again, thereby improving the instruction processing efficiency and improving the operating performance of the processor.
[0004] In a first aspect, the present application provides an instruction processing method, which is applied to a microprocessor, wherein the microprocessor includes a launch queue and at least one pipeline station, and the method includes the following steps executed by the launch queue: in response to an instruction cancel launch event, maintaining the occupancy authority of the pending instruction on the target resource in the previous pipeline station, and monitoring whether the target pipeline station allows the launch of the pending instruction; wherein the target pipeline station includes the pipeline station among the at least one pipeline station that cancels the launch of the pending instruction, and the previous pipeline station is the pipeline station through which the pending instruction has passed; if the target pipeline station allows the launch of the pending instruction, the pending instruction is re-launched from the target pipeline station.
[0005] In a possible implementation, the instruction processing method provided in the first aspect of the present application further includes: storing the instructions to be processed in a preset storage area; re-transmitting the instructions to be processed from the target pipeline station, including: obtaining the instructions to be processed stored in the preset storage area; and re-transmitting the instructions to be processed from the target pipeline station.
[0006] In a possible implementation, the preset storage area includes a pre-created memory, and the memory is arranged in a one-to-one correspondence with the water flow station.
[0007] In a possible implementation, the memory stores a plurality of pending instructions that meet the emission conditions; the obtaining of the pending instructions stored in the preset storage area includes: determining a target instruction among the plurality of pending instructions according to a first-in-first-out principle; obtaining the target instruction stored in the memory; and re-emitting the pending instructions from the target pipeline station includes: re-emitting the target instruction from the target pipeline station.
[0008] In a possible implementation, the instruction processing method provided in the first aspect of the present application further includes: determining the event probability of an instruction cancel emission event occurring in each of the pipeline stations; and configuring the capacity of the memory of the corresponding pipeline station based on the event probability of each of the pipeline stations.
[0009] In a possible implementation, after storing the pending instructions in a preset storage area, the method further includes: deleting the pending instructions stored in the storage space of the transmission queue.
[0010] In a possible implementation, the microprocessor further includes an execution unit, and the pipeline stations where instruction cancel emission events occur include multiple pipeline stations; re-emitting the pending instruction from the target pipeline station includes: among the multiple pipeline stations where instruction cancel emission events occur, determining the pipeline station with the least number of other pipeline stations that the instruction needs to pass through to enter the execution unit as the target pipeline station; and re-emitting the pending instruction from the target pipeline station.
[0011] In a possible implementation, after the to-be-processed instruction is retransmitted from the target pipeline station, the method further includes: broadcasting notification information, where the notification information is used to wake up other instructions associated with the to-be-processed instruction.
[0012] In a second aspect, the present application provides a microprocessor, comprising: an issue queue, at least one pipeline station and an execution unit, wherein the instructions in the issue queue pass through each of the pipeline stations in sequence and enter the execution unit; the execution unit is used to execute the instructions; the issue queue is used to execute the instruction processing method as described in any one of the first aspects of the present application.
[0013] In a third aspect, the present application provides a computer-readable storage medium storing a computer program, which, when executed, implements the instruction processing method as described in any one of the first aspects of the present application.
[0014] Based on the above content, the instruction processing method provided by the present application is applied to a microprocessor, which includes a transmission queue and at least one pipeline station. The transmission queue responds to the instruction cancellation transmission event of the target pipeline station, maintains the occupancy authority of the pending instruction on the target resource in the previous pipeline station that has passed, and monitors whether the target pipeline station allows the transmission of the pending instruction. If the transmission of the pending instruction is allowed, the transmission queue re-transmits the pending instruction from the target pipeline station. Through the instruction processing method provided by the present application, for the pending instruction that is canceled at the target pipeline station, the pending instruction is re-transmitted from the target pipeline station. Compared with the prior art, it can avoid the instruction from passing through the judgment of each pipeline station again, improve the instruction processing efficiency, and improve the operating performance of the processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0016] Figure 1 It is a structural block diagram of a microprocessor in the prior art.
[0017] Figure 2 It is a flow chart of an instruction processing method provided by an embodiment of the present invention.
[0018] Figure 3 It is a flowchart of another instruction processing method provided by an embodiment of the present invention.
[0019] Figure 4 It is a structural block diagram of a microprocessor provided by an embodiment of the present invention.
[0020] Figure 5 It is a structural block diagram of another microprocessor provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0021] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0022] See also Figure 1 , Figure 1 The structure block diagram of a microprocessor in the prior art is shown. Figure 1In the micro-architecture of the microprocessor shown, the microprocessor includes an issue queue 10, an execution unit 20, and at least one pipeline station ( Figure 1 Flow station 1, flow station 2 and flow station 3 are shown as examples).
[0023] Specifically, the instruction dispatch queue (IDQ) 10 is a key part inside the microprocessor, and at least one instruction that is decoded and waiting to be executed is stored in the transmission queue 10. In practical applications, the instructions stored in the transmission queue 10 can be instructions under an out-of-order processing mechanism or instructions under a sequential processing mechanism. When any instruction meets the transmission conditions, such as the operands required to execute the instruction are ready, the bus is idle, and the corresponding execution unit is idle, the transmission queue 10 transmits the instruction. It should be noted that other related implementations of the transmission queue 10 transmitting instructions can be implemented by referring to the relevant technical implementations, which will not be described in detail here.
[0024] A Reservation Station (RS) is a hardware mechanism that is mainly used to support out-of-order instruction execution, manage the operands and operators of instructions, and control the issuance of instructions when all required operands and other related resources for instructions are ready. Specifically, the Reservation Station tracks all operands required for instructions. If an operand is being generated by an instruction being executed, the execution result of the instruction will be sent directly to the pipeline station waiting for this operand. Only when all operands of the instruction in the pipeline station are ready will the instruction be sent to the next pipeline station until it finally reaches the execution unit for execution. The pipeline station can solve the data hazards and structural hazards under the out-of-order processing mechanism, which can effectively improve the instruction throughput and achieve higher performance.
[0025] Furthermore, in the micro-architecture of the microprocessor, the execution unit (EU) 20 is used to perform actual calculations and operations. In practical applications, the type and number of the execution unit 20 depend on the specific architecture of the microprocessor. Generally, the execution unit 20 may include a logic arithmetic unit, a floating point unit, a storage unit, a branch unit, and a vector unit, etc. Of course, it may also include other types of execution units, which are not listed here one by one.
[0026] Based on the above microprocessor structure, any instruction needs to pass through several pipeline stations from entering the emission queue 10 to finally entering the execution unit 20 for execution, and at each pipeline station it is determined whether the instruction is allowed to be emitted to the next node. Figure 1Taking the three pipeline stations shown as an example, an instruction can enter the execution unit 20 only if it has not been cancelled after passing through the three pipeline stations. In practical applications, the instruction may be cancelled at any pipeline station for various reasons, such as resource conflicts, cancellation of associated instructions, etc. In the prior art, if an instruction is cancelled at any pipeline station, when the instruction needs to be re-issued, it is necessary to re-select the instruction from the emission queue and re-issue it, and enter the execution unit after re-passing through each pipeline station. Obviously, this instruction processing method will lead to low instruction processing efficiency and reduce the operating performance of the processor.
[0027] To solve the above technical problems, the present application provides an instruction processing method, in which an emission queue responds to an instruction cancellation emission event of a target pipeline station, maintains the occupation authority of the pending instruction on the target resources in the previous pipeline station that has passed through, and when the target pipeline station allows the pending instruction to be emitted, the emission queue re-emits the pending instruction from the target pipeline station. Through the instruction processing method provided by the present application, for the pending instruction that has been canceled at the target pipeline station, the pending instruction is re-emittered from the target pipeline station. Compared with the prior art, it can avoid the instruction from passing through each pipeline station again, thereby improving the instruction processing efficiency and the operating performance of the processor.
[0028] The instruction processing method provided in the present application is applied to a microprocessor, and more specifically, to an issue queue in a microprocessor. Figure 2 , the instruction processing method provided in this application includes the following steps.
[0029] S100 , in response to an instruction issuance cancellation event, maintaining the occupation right of the pending instruction on the target resource in the previous pipeline stage.
[0030] In actual applications, when an instruction passes through any pipeline station, it is necessary to determine whether the target resources required by the instruction are idle. Only when the corresponding target resources are idle, that is, they can be occupied by the instruction, will the instruction be sent to the next pipeline station for further judgment. Moreover, under normal circumstances, the same instruction requires different resources when passing through different pipeline stations. Among them, the resources required for an instruction to occupy at any pipeline station will vary depending on the instruction. For example, the same instruction needs to occupy port A at pipeline station 1, but may need to occupy other resources at pipeline station 2. They will not be listed one by one here. The target resources required by different instructions at any pipeline station can be specifically realized by referring to the relevant technology, and this application does not make specific limitations on this.
[0031] Based on the above content, it can be known that when the target resource of an instruction in any pipeline station is occupied by other instructions, the execution of the instruction will be cancelled in the corresponding pipeline station, that is, an instruction cancellation emission event occurs. Based on this, this embodiment defines the pipeline station where the instruction cancellation emission event occurs in at least one pipeline station set inside the microprocessor as the target pipeline station. It can be understood that in actual applications, there may be multiple pipeline stations where the instruction cancellation emission event occurs at the same time, and the instruction processing method provided by the present application can be used to process the cancelled instructions for any pipeline station where the instruction cancellation emission event occurs. Accordingly, the instructions to be processed mentioned in the present application refer to the instructions whose emission is cancelled in the target pipeline station.
[0032] Furthermore, as mentioned above, the instruction needs to pass through each pipeline station in sequence before entering the execution unit. Based on this, the present application defines the pipeline station that the pending instruction has passed through before the target pipeline station as the previous pipeline station. It can be understood that whether the pending instruction corresponds to a previous pipeline station and the number of the previous pipeline stations depends on the position of the target pipeline station that cancels the issuance of the pending instruction. Therefore, if the target pipeline station is the first pipeline station entered after the issuance queue issues the instruction, the pending instruction has no corresponding previous pipeline station.
[0033] Based on the above content, after the instruction cancel emission event occurs in the target pipeline station, the emission queue responds to the instruction cancel emission event and maintains the pending instruction's right to occupy the target resource in the previous pipeline station, that is, prohibits other instructions from occupying the target resource. It can be understood that if the target pipeline station is the first pipeline station after the emission queue, that is, there is no previous pipeline station, the operation of the emission queue maintaining the pending instruction's right to occupy the target resource in the previous pipeline station can be regarded as a no-op, or it can also be understood that the pending instruction does not occupy any resources in the previous pipeline station.
[0034] Continue to use Figure 1 In the example shown, a certain instruction is cancelled from being issued in pipeline station 2 due to resource conflict. In this case, pipeline station 2 is the target pipeline station, the instruction cancelled from being issued in pipeline station 2 is the pending instruction, pipeline station 1 that the pending instruction passes through before the target pipeline station is the previous pipeline station, and the target resource occupied by the pending instruction when passing through pipeline station 1 is port A. Based on this, the issue queue responds to the instruction cancellation event of pipeline station 2, and maintains the pending instruction's right to occupy port A in pipeline station 1.
[0035] S110, monitoring whether the target pipeline station is allowed to transmit pending instructions, if so, executing S120.
[0036] The emission queue further monitors whether the target pipeline station allows the emission of pending instructions. If the emission of pending instructions is allowed, S120 is executed. On the contrary, if the emission of pending instructions is not allowed, the monitoring continues until the emission of pending instructions is allowed, and S120 is executed.
[0037] It is understandable that whether the issuance of pending instructions is allowed is directly related to the reason why the pending instructions are canceled. For example, if the issuance of a pending instruction is canceled due to failure to compete for bus resources, then the issuance of the pending instruction can be allowed at least when the bus resources are obtained. Of course, there are many conditions that affect the issuance of instructions. Even if the pending instruction obtains the aforementioned bus resources, it may not be issued due to other reasons. Moreover, the issuance conditions of different instructions are usually different. Therefore, in actual applications, it is necessary to combine the execution requirements of the pending instructions, the hardware resources inside the microprocessor, and the execution status of other instructions to comprehensively judge whether the issuance of the pending instructions is allowed. It will not be described in detail here. It can be implemented in combination with relevant technologies, and this application does not make specific limitations on this.
[0038] It should be noted that in actual applications, S100 and S110 can be executed synchronously, that is, while maintaining the occupation rights of the pending instruction to the target resource in the previous pipeline station, monitoring whether the target pipeline station is allowed to issue the pending instruction. For ease of description, this embodiment divides this process into two parts.
[0039] S120, re-send the pending instruction from the target pipeline station.
[0040] When the target pipeline station allows the issuance of pending instructions, since the issuance queue maintains the pending instructions' occupancy rights over the target resources in the previous pipeline station, all requirements for reissuing pending instructions from the target pipeline station are met, and the issuance queue reissuing pending instructions from the target pipeline station.
[0041] Following the previous example, the emission queue re-sends the pending instruction from pipeline station 2, directly enters pipeline station 3, and enters the execution unit and is finally executed if pipeline station 3 does not cancel the transmission of the pending instruction. It can be seen that, by adopting the instruction processing method provided by the present application, after the pending instruction is cancelled at the target pipeline station, the re-transmission process only needs to be judged by the target pipeline station itself and pipeline station 3, and does not need to be re-transmitted by the emission queue.
[0042] In the prior art, the instruction that is canceled in pipeline station 2 will wait in the emission queue to be awakened again. After being awakened again, the emission queue will re-issue the instruction and pass through the judgment of pipeline station 1, pipeline station 2 and pipeline station 3 in sequence, and finally enter the execution unit. Compared with the prior art, the instruction processing method provided by the present application can obviously reduce the number of pipeline stations that need to be passed during the instruction processing process.
[0043] To sum up, through the instruction processing method provided by the present application, for the pending instructions that are canceled at the target pipeline station, the pending instructions are re-issued from the target pipeline station. Compared with the prior art, this can avoid the instructions passing through each pipeline station again, thereby improving the instruction processing efficiency and improving the processor's operating performance.
[0044] Further, based on the above idea, the present application provides another instruction processing method, see Figure 3 As shown, the instruction processing method provided by this embodiment includes the following steps.
[0045] S200: In response to an instruction cancelling event, maintaining the occupation right of the pending instruction on the target resource in the previous pipeline stage.
[0046] In a possible implementation, this step can refer to Figure 2 The implementation of the relevant contents of S100 in the illustrated embodiment will not be repeated here.
[0047] S210: Store the pending instructions in a preset storage area.
[0048] In this embodiment, a preset storage area is set inside the microprocessor, and the preset storage area is used to store the to-be-processed instructions whose transmission is canceled at the target pipeline station.
[0049] In a possible implementation, the preset storage area includes a memory pre-created inside the microprocessor, and the memory is set in a one-to-one correspondence with the pipeline station, that is, the pipeline stations will not share the memory with each other, and each memory is only used to store the pending instructions of the pipeline station corresponding to itself. In practical applications, a corresponding memory can be set for each pipeline station to store the pending instructions of the corresponding pipeline station. Of course, a memory can also be set for some pipeline stations in the microprocessor. For example, based on actual operating data, the probability of instruction cancellation emission events occurring in each pipeline station can be calculated separately, and a memory can be set for each pipeline station in which the probability of instruction cancellation emission events occurring in each pipeline station is greater than a preset threshold. Of course, the pipeline station where the memory is set can also be selected based on other bases, which will not be described in detail here. Without exceeding the core idea of the present application, it also belongs to the scope of protection of the present application.
[0050] Furthermore, the capacity of the memory can also be configured according to the use requirements. In one possible implementation, the capacity of the memory of each pipeline station is the same. In another possible implementation, the event probability of the instruction cancellation emission event occurring at each pipeline station can be first determined. For example, the event probability can be calculated by the performance parameters during the actual operation of the program, and then the capacity of the memory of the corresponding pipeline station can be configured based on the event probability of each pipeline station. It can be understood that the higher the event probability, the more instructions are canceled at the pipeline station, and the larger the capacity of the memory should be. On the contrary, the lower the event probability, the fewer instructions are canceled at the pipeline station, and the smaller the capacity of the memory. Through the differentiated configuration of the memory capacity, the optimal utilization of the memory capacity can be achieved when the total memory capacity is constant, avoiding the waste of part of the memory capacity.
[0051] Based on this, after the instruction cancellation emission event occurs at the target pipeline station, the emission queue stores the pending instructions in a preset storage area. In practical applications, storing the pending instructions in a preset storage area mainly refers to storing the instruction information of the pending instructions, including but not limited to the target register address, execution cycle and timing count (recording the timing relationship between the producer) and other information of the pending instructions. Among them, the target register is used to store the operands related to the pending instructions. When the instruction is emitted, the target register address needs to be broadcast to notify other instructions that the operands of the pending instructions can be obtained; the execution cycle is used to determine the broadcast time; the timing count is related to the data path. The data obtained after the execution unit executes the instruction will not be written back to the register file immediately, but will be temporarily stored for a certain period of time. The corresponding data can be directly obtained within the period of time, and the timing count is used to determine the source of the data. Of course, the instruction information that needs to be stored will vary between different instructions, and will not be described in detail here. In practical applications, the instruction information of the pending instructions can be stored according to needs, and this application does not limit the specific content of the instruction information.
[0052] Continue to use Figure 1 In the example shown, instruction 1 and instruction 2 compete for the same port resources. According to the first-in-first-out principle, instruction 1, which enters the transmission queue first, should be emitted first. At this time, instruction 2 is canceled. Assuming that the port resource competition occurs in pipeline station 2, instruction 2 is stored in the memory corresponding to pipeline station 2.
[0053] In a preferred embodiment, after the pending instructions are stored in the corresponding memory of the target pipeline station, the pending instructions stored in the storage space of the transmission queue can be further deleted. In the subsequent execution process, the instruction information of the pending instructions is maintained in the memory. Based on this, the storage space originally occupied by the pending instructions in the transmission queue can be released, and the released storage space can be further used to receive new instructions, thereby increasing the storage capacity of the transmission queue in disguise, which helps to improve the overall performance of the microprocessor.
[0054] S220, monitor whether the target pipeline station is allowed to transmit pending instructions, if so, execute S230.
[0055] In a possible implementation, S210 may refer to Figure 2 The implementation of S110 related contents in the illustrated embodiment will not be repeated here.
[0056] S230: Obtain instructions to be processed stored in a preset storage area.
[0057] After determining that the target pipeline station allows the issuance of pending instructions, the issuance queue obtains the pending instructions stored in the preset storage area. When the preset storage area is the aforementioned memory, the pending instructions stored in the memory corresponding to the target pipeline station are obtained.
[0058] In a possible implementation, a plurality of pending instructions are stored in the memory corresponding to the target pipeline station, and a plurality of pending instructions satisfy the corresponding emission conditions. In this case, the pending instruction first stored in the memory can be determined as the target instruction among the plurality of pending instructions satisfying the emission conditions according to the first-in-first-out principle, and the target instruction is obtained. It can be understood that, as a preferred implementation, in order to ensure that each pending instruction can be processed in a timely manner, after the target instruction in the memory is obtained according to the first-in-first-out principle, the memory space occupied by the target instruction is released, thereby ensuring that the memory can store more pending instructions.
[0059] Of course, in practical applications, the target instruction can also be determined from multiple pending instructions that meet the launch conditions based on other principles, which will not be described in detail here. As long as it does not exceed the core idea of this application, it also falls within the scope of protection of this application.
[0060] S230, re-send the pending instruction from the target pipeline station.
[0061] After the pending instruction is obtained from the memory, the pending instruction can be re-issued from the target pipeline station. Accordingly, if a target instruction is determined from multiple pending instructions that meet the emission conditions after the aforementioned steps, the target instruction is re-issued from the target pipeline station when this step is executed. As for the specific implementation process of re-issuing the pending instruction, reference can be made to the relevant contents in the aforementioned embodiments, which will not be repeated here.
[0062] In an optional implementation, after retransmitting the pending instruction, notification information is further broadcasted, and other instructions associated with the transmitted pending instruction are awakened by the notification information. Compared with the prior art, the broadcast object of the notification information broadcast in this embodiment includes not only the transmission queue inside the microprocessor, but also the memories newly added in this application, so as to ensure that all other instructions related to the pending instruction can be notified. Furthermore, the resource occupancy of the pending instruction will be updated according to the execution cycle information, and the data bypass control information of the source operand related to the pending instruction will be updated according to the timing count information. Of course, other operations related to the pending instruction will be performed, which can be specifically implemented with reference to the relevant technology and will not be described in detail here.
[0063] In summary, the instruction processing method provided by this embodiment can not only avoid the instruction from passing through the judgment of each pipeline station again, improve the instruction processing efficiency, and improve the operating performance of the processor, but also increase the storage capacity of the transmission queue in disguised form, which helps to improve the instruction processing efficiency of the microprocessor.
[0064] It can be understood that the instruction processing method provided by the present application can be used for any pipeline station in the microprocessor. When an instruction is canceled at any pipeline station, it is re-issued according to the instruction processing method provided by the present application and enters the next pipeline station. If it is canceled again at the next pipeline station, the instruction can continue to be re-issued according to the instruction processing method provided by the present application until the instruction is sent to the execution unit for execution.
[0065] In one possible implementation, multiple pipeline stations in the microprocessor may simultaneously have instruction cancel emission events. In this case, the emission queue first determines, among the multiple pipeline stations where the instruction cancel emission events occur, the pipeline station with the least number of other pipeline stations that the instruction needs to pass through to enter the execution unit as the target pipeline station, that is, according to the order of the pipeline stations passed from the emission queue to the execution unit, the pipeline station closest to the execution unit and where the instruction cancel emission event occurs is used as the target pipeline station. Of course, the target pipeline station determined in this case can also be defined as a high-priority pipeline station, and then the pending instruction is re-issued from the target pipeline station.
[0066] Still Figure 1Taking the microprocessor shown as an example, assuming that pipeline stations 1, 2 and 3 all have instruction cancellation emission events, compared with the three pipeline stations, pipeline station 3 is the pipeline station with the least number of other pipeline stations (0) that the instruction needs to pass through to enter the execution unit. Therefore, pipeline station 3 is prioritized as the target pipeline station, and the pending instructions of pipeline station 3 are emitted from pipeline station 3. For another example, if both pipeline stations 1 and 2 have instruction cancellation events, the instruction canceled in pipeline station 1 needs to pass through pipeline station 2 and pipeline station 3 before entering the execution unit, while the instruction canceled in pipeline station 2 needs to pass through pipeline station 3 before entering the execution unit. Obviously, pipeline station 2 should be used as the target pipeline station. It can be understood that the more pipeline stations passed, the higher the probability of the instruction being cancelled. Correspondingly, the fewer pipeline stations passed, the lower the probability of being cancelled. Such a setting can ensure that instructions with a higher probability of entering the execution unit are processed first, which helps to further improve the instruction processing efficiency.
[0067] Furthermore, as mentioned above, the emission conditions of the pending instruction may involve multiple pipeline stations. Following the previous example, if instruction cancellation events occur in pipeline stations 1 and 2, pipeline station 2 should be used as the target pipeline station. Based on this, the pending instruction has the highest priority in the resource judgment of pipeline station 1. For example, the instruction whose emission is canceled in pipeline station 1 requires port A, and the emission of the pending instruction of the target pipeline station, i.e., pipeline station 2, also requires port A. In this case, the resources of port A are preferentially occupied by the pending instruction of the target pipeline station, and before the resources of the target pipeline station meet the emission requirements of the pending instruction, the pending instruction will continue to occupy port A of pipeline station 1 until the pending instruction is emitted from the target pipeline station. Therefore, the pending instruction whose emission is canceled in pipeline station 2 is emitted first, which can utilize the idle resources of each pipeline station earlier and create conditions for executing other subsequent instructions.
[0068] Furthermore, the present application also provides a microprocessor, see Figure 4 As shown, the microprocessor provided in this embodiment includes an issue queue 10, an execution unit 20, and at least one pipeline station ( Figure 4 3 water flow stations are shown in the figure), and a preset storage area 30.
[0069] Among them, the instructions in the emission queue 10 pass through each pipeline station in turn and enter the execution unit 20, the execution unit 20 is used to execute the corresponding instructions, the preset storage area 30 is used to store the pending instructions that are canceled at any pipeline station, and the emission queue 10 is used to execute the instruction processing method provided by any of the aforementioned embodiments.
[0070] Based on the above embodiments, the present application also provides another microprocessor, see Figure 5 As shown, the microprocessor provided in this embodiment includes an issue queue 10, an execution unit 20, and at least one pipeline station ( Figure 4 3 water flow stations are shown in the figure), and a preset storage area 30.
[0071] The instructions in the issue queue 10 pass through each pipeline station in sequence and enter the execution unit 20, which is used to execute the corresponding instructions. The preset storage area 30 includes at least one memory, each memory is set corresponding to a pipeline station, and the pipeline stations corresponding to each memory are different. Figure 5 In the embodiment shown, the preset storage area 30 includes a memory 1, a memory 2 and a memory 3, each of which corresponds to a flow station. For specific corresponding relationships, see Figure 5 Any memory is used to store the pending instructions that are cancelled in the corresponding pipeline station. The emission queue 10 is also used to execute the instruction processing method provided by any of the above embodiments.
[0072] It should be noted that in Figure 4 as well as Figure 5 In the illustrated embodiment, the process of storing instructions in the preset storage area is represented by a solid arrow, and the process of obtaining instructions from the preset storage area is represented by a dotted arrow. It can be seen from the diagram that the instructions to be processed are all re-transmitted from the target pipeline station backwards, and do not need to be re-transmitted from the transmission queue again, thereby avoiding traversing all pipeline stations again, effectively improving the instruction processing efficiency.
[0073] In some embodiments, this embodiment further provides a computer-readable storage medium, such as a floppy disk, an optical disk, a hard disk, a flash memory, a USB flash disk, an SD (Secure Digital Memory Card) card, an MMC (Multimedia Card) card, etc., in which one or more instructions for implementing the above steps are stored. When the one or more instructions are executed by one or more processors, the processors execute the instruction processing method described above. For the relevant specific implementation, please refer to the above description, which will not be repeated here.
[0074] In addition to the above-mentioned methods and devices, an embodiment of the present application may also be a computer program product, which includes computer program instructions. When the computer program instructions are executed by a processor, the processor executes the steps of the instruction processing method according to various embodiments of the present application described in the above content of this specification.
[0075] The computer program product may be written in any combination of one or more programming languages to write program codes for performing the operations of the embodiments of the present application, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0076] Those skilled in the art will appreciate that the contents disclosed in this disclosure may be subject to various modifications and improvements. For example, the various devices or components described above may be implemented by hardware, or by software, firmware, or a combination of some or all of the three.
[0077] In addition, although the present disclosure makes various references to certain units in the system according to embodiments of the present disclosure, any number of different units can be used and run on the client and / or server. The units are only illustrative, and different aspects of the system and method can use different units.
[0078] Flowcharts are used in this disclosure to illustrate the steps of the method according to the embodiments of the present disclosure. It should be understood that the preceding or following steps are not necessarily performed precisely in order. On the contrary, various steps may be processed in reverse order or simultaneously. At the same time, other operations may also be added to these processes.
[0079] Those skilled in the art will appreciate that all or part of the steps in the above method can be completed by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, such as a read-only memory, etc. Optionally, all or part of the steps in the above embodiment can also be implemented using one or more integrated circuits. Accordingly, each module / unit in the above embodiment can be implemented in the form of hardware or in the form of a software functional module. The present disclosure is not limited to any particular form of combination of hardware and software.
[0080] Unless otherwise defined, all terms used herein have the same meaning as commonly understood by those of ordinary skill in the art to which the present disclosure belongs. It should also be understood that terms such as those defined in common dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant technology, and should not be interpreted in an idealized or highly formal sense, unless explicitly defined as such herein.
[0081] The above is an explanation of the present disclosure and should not be considered as a limitation thereof. Although several exemplary embodiments of the present disclosure are described, it will be readily understood by those skilled in the art that many modifications may be made to the exemplary embodiments without departing from the novel teachings and advantages of the present disclosure. Therefore, all such modifications are intended to be included within the scope of the present disclosure as defined in the claims. It should be understood that the above is an explanation of the present disclosure and should not be considered to be limited to the specific embodiments disclosed, and modifications to the disclosed embodiments and other embodiments are intended to be included within the scope of the appended claims. The present disclosure is defined by the claims and their equivalents.
Claims
1. A command processing method, characterized in that: Applied to a microprocessor, the microprocessor includes an issue queue, an execution unit, and a plurality of pipeline stations, the method includes the following steps executed by the issue queue: In response to an instruction cancelling emission event, maintaining the occupation right of the pending instruction to the target resource in the previous pipeline station, and monitoring whether the target pipeline station is allowed to emit the pending instruction; The previous pipeline station is a pipeline station that the instruction to be processed has passed through, and the target resource includes the resource required to transmit the instruction to be processed; In the case where a command cancel emission event occurs in a pipeline station, the target pipeline station is the pipeline station where the command cancel emission event occurs; In the case where instruction cancel-issue events occur in multiple pipeline stations, the target pipeline station is a pipeline station with the least number of other pipeline stations that the instruction needs to pass through before entering the execution unit among the multiple pipeline stations where the instruction cancel-issue events occur; If the target pipeline station allows the pending instruction to be issued, the pending instruction is reissued from the target pipeline station.
2. The method according to claim 1, characterized in that Also includes: Storing the pending instructions in a preset storage area; Re-issuing the pending instruction from the target pipeline station, comprising: Acquire the pending instruction stored in the preset storage area; The pending instruction is re-issued from the target pipeline station.
3. The method according to claim 2, characterized in that The preset storage area includes a pre-created memory, and the memory is arranged in a one-to-one correspondence with the water flow station.
4. The method according to claim 3, characterized in that The memory stores a plurality of instructions to be processed that meet the transmission conditions; The obtaining the to-be-processed instruction stored in the preset storage area includes: According to the first-in-first-out principle, determining the target instruction from the plurality of pending instructions that meet the launch condition; Retrieve the target instruction stored in the memory; Re-issuing the pending instruction from the target pipeline station, including: The target instruction is re-issued from the target pipeline station.
5. The method according to claim 3, characterized in that: Also includes: Determine the event probability of the command cancellation transmission event occurring at each of the pipeline stations; The capacity of the memory of each pipeline station is configured based on the event probability of each pipeline station.
6. The method according to claim 2, characterized in that After storing the to-be-processed instructions in a preset storage area, the method further includes: The pending instructions stored in the storage space of the transmit queue are deleted.
7. The method according to any one of claims 1 to 6, characterized in that: After re-issuing the pending instruction from the target pipeline station, the method further includes: Broadcast notification information, where the notification information is used to wake up other instructions associated with the pending instruction.
8. A microprocessor, characterized in that: include: An issue queue, at least one pipeline station, and an execution unit, wherein: The instructions in the issue queue sequentially pass through each of the pipeline stations and enter the execution unit; The execution unit is used to execute the instruction; The issue queue is used to execute the instruction processing method according to any one of claims 1 to 7.
9. A computer-readable storage medium, characterized in that: A computer program is stored, and when the computer program is executed, the instruction processing method according to any one of claims 1 to 7 is implemented.
