Instruction processing method and device based on multi-core processor and storage medium

By detecting the instruction type in a multi-core processor and storing vector instructions into the shared vector processor cache, dynamically adjusting the number of processing units, the problem of wasted vector processor resources in the prior art is solved, and the utilization rate and calculation of the processor are improved efficiency.

CN118747084AInactive Publication Date: 2024-10-08SHENZHEN AOWEI LINGXIN TECH CO LTD

Patent Information

Application Number
CN202410665562.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-27
Publication Date
2024-10-08
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Each core in the existing processor is equipped with a vector processing unit, resulting in wasting resources when vector instructions are lacking, and the longer the vector register length, the more area is consumed, and a new technical solution is needed to improve computing efficiency.

Method used

The instruction processing method based on a multi-core processor is adopted to detect the type of instructions to be processed, and if it is a vector instruction, it is stored in the cache of the shared vector processor, and the number of processing units is dynamically adjusted to improve the utilization rate of the vector processor.

Benefits of technology

It effectively reduces the resource waste of vector processing units and improves the utilization rate of processors, especially when handling a large number of vector computing tasks, reducing the required processor area.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118747084A_ABST
    Figure CN118747084A_ABST
Patent Text Reader

Abstract

The invention relates to the field of chips, and discloses an instruction processing method and device based on a multi-core processor and a storage medium. The method comprises the steps that when a to-be-processed instruction is detected, decoding operation is executed on the to-be-processed instruction, and the instruction type of the to-be-processed instruction is obtained; if the instruction type is a vector instruction, storing the to-be-processed instruction into a cache of a preset shared vector processor; calling a shared vector processor to execute a decoding operation on the to-be-processed instruction to determine a micro-operation to be executed; reading to-be-processed data corresponding to the micro-operation; and performing vector calculation on the to-be-processed data according to the micro-operation so as to respond to the to-be-processed instruction. In the embodiment of the invention, the size of the shared vector processor can be accurately formulated according to actual requirements, so that the area required by the vector processing unit in the multi-core processor is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of chips, and in particular to an instruction processing method, device and storage medium based on a multi-core processor. Background Art

[0002] As computer applications continue to increase their data processing capabilities, the demand for high-performance computing and parallel computing is also increasing; in order to improve computing efficiency, vectorized computing will be introduced. Vectorized computing allows a single instruction to operate on multiple data elements at the same time, thereby completing more computing work in the same instruction cycle.

[0003] In general-purpose modern processors, due to the limitations of current instruction processing methods, each core usually has a vector processing unit (VPU). When there are no vector instructions in the processing scenario, the VPU will be idle, and the VPU resources in each core will be wasted. One VPU per core will increase the processor area. The longer the vector register length, the more area resources will be consumed. A new technical solution is needed to solve the above problems. Summary of the invention

[0004] The main purpose of the present invention is to solve the technical problem that the current instruction processing method requires a larger processor area.

[0005] A first aspect of the present invention provides an instruction processing method based on a multi-core processor, and the instruction processing method based on the multi-core processor comprises:

[0006] When a pending instruction is detected, a decoding operation is performed on the pending instruction to obtain an instruction type of the pending instruction;

[0007] If the instruction type is a vector instruction, storing the instruction to be processed into a cache of a preset shared vector processor;

[0008] Calling the shared vector processor to perform a decoding operation on the instruction to be processed to determine a micro-operation to be executed;

[0009] Reading the data to be processed corresponding to the micro-operation;

[0010] According to the micro-operation, vector calculation is performed on the data to be processed in response to the instruction to be processed.

[0011] Optionally, in a first implementation of the first aspect of the present invention, the step of performing vector calculation on the data to be processed according to the micro-operation to respond to the instruction to be processed includes:

[0012] According to the micro-operation, vector calculation is performed on the data to be processed to obtain a calculation result;

[0013] The calculation result is written back to a preset vector register in response to the instruction to be processed.

[0014] Optionally, in a second implementation manner of the first aspect of the present invention, the step of storing the to-be-processed instruction into a cache of a preset shared vector processor includes:

[0015] A register renaming operation is performed on the instruction to be processed, and the instruction to be processed is stored in a cache of a preset shared vector processor.

[0016] Optionally, in a third implementation manner of the first aspect of the present invention, when the instruction to be processed is detected, the step of performing a decoding operation on the instruction to be processed to obtain the instruction type of the instruction to be processed includes:

[0017] When a pending instruction is detected, parsing the operation code of the pending instruction;

[0018] Matching the operation code with a preset vector instruction set to obtain a matching set;

[0019] If the matching set is empty, it is determined that the instruction type of the instruction to be processed is a vector instruction; otherwise, it is determined that the instruction type of the instruction to be processed is a scalar instruction.

[0020] Optionally, in a fourth implementation manner of the first aspect of the present invention, after the step of determining that the instruction type of the instruction to be processed is a vector instruction if the matching set is empty, and otherwise determining that the instruction type of the instruction to be processed is the scalar instruction, the method further includes:

[0021] If the instruction type is a scalar instruction, the scalar processing unit is directly called to process the instruction to be processed.

[0022] Optionally, in a fifth implementation manner of the first aspect of the present invention, if the instruction type is a scalar instruction, the step of calling a scalar processing unit to process the instruction to be processed includes:

[0023] If the instruction type is a scalar instruction, sending the scalar instruction to an idle scalar pipeline;

[0024] An idle scalar processing unit is called to process the pending instruction.

[0025] Optionally, in a sixth implementation manner of the first aspect of the present invention, if the instruction type is a vector instruction, the step of storing the to-be-processed instruction into a cache of a preset shared vector processor includes:

[0026] Dynamically adjust the number of processing units of the shared vector processor according to the vector length information in the instruction to be processed;

[0027] The to-be-processed instructions are stored in a cache of the shared vector processor.

[0028] Optionally, in a seventh implementation manner of the first aspect of the present invention, the step of performing vector calculation on the data to be processed according to the micro-operation to respond to the instruction to be processed includes:

[0029] Selecting a vector computing unit in the shared vector processor according to a memory access mode of the data to be processed;

[0030] Vector calculations are performed on the data to be processed according to the micro-operations in response to the instructions to be processed.

[0031] A second aspect of the present invention provides an instruction processing device based on a multi-core processor, comprising: a memory and at least one processor, wherein instructions are stored in the memory, and the memory and the at least one processor are interconnected via lines; the at least one processor calls the instructions in the memory so that the instruction processing device based on the multi-core processor executes the above-mentioned instruction processing method based on the multi-core processor.

[0032] A third aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the above-mentioned instruction processing method based on a multi-core processor.

[0033] In an embodiment of the present invention, when an instruction to be processed is detected, a decoding operation is first performed to determine the instruction type. If the instruction type is a vector instruction, it is stored in the cache of the shared vector processor. If so, even if the current processor core does not have a vector computing task, the vector instruction can be cached in the shared vector processor to perform the vector computing task. This method improves the utilization of the vector processor, especially when there are a large number of vector computing tasks in the processing scenario. In a traditional processor, each core is equipped with a vector processing unit. However, in some cases, the vector processing unit of a particular core may be idle because there are not enough vector instructions to be processed. The introduction of a shared vector processor can reduce this waste of resources, because multiple cores can share the same vector processor, which improves the utilization of the vector processing unit. Therefore, the sample embodiment can accurately formulate the size of the shared vector processor according to actual needs to reduce the area required for the vector processing unit in a multi-core processor. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 A schematic diagram of an embodiment of an instruction processing method based on a multi-core processor in an embodiment of the present invention;

[0035] Figure 2 It is a schematic diagram of a specific embodiment of step 101 of the instruction processing method based on a multi-core processor in an embodiment of the present invention;

[0036] Figure 3 It is a schematic diagram of a specific embodiment of step 105 of the instruction processing method based on a multi-core processor in an embodiment of the present invention;

[0037] Figure 4 A schematic diagram of a multi-core processor pipeline structure of an instruction processing device based on a multi-core processor in an embodiment of the present invention;

[0038] Figure 5 The figure is a schematic diagram of an embodiment of an instruction processing device based on a multi-core processor in an embodiment of the present invention. DETAILED DESCRIPTION

[0039] The embodiments of the present invention provide an instruction processing method, device and storage medium based on a multi-core processor.

[0040] The embodiments disclosed in the present invention will be described in more detail below with reference to the accompanying drawings. Although certain embodiments disclosed in the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present invention. It should be understood that the drawings and embodiments disclosed in the present invention are only for exemplary purposes and are not intended to limit the scope of protection disclosed in the present invention.

[0041] In the description of the embodiments disclosed in the present invention, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc. may refer to different or the same objects. Other explicit and implicit definitions may also be included below.

[0042] For ease of understanding, the specific process of the embodiment of the present invention is described below. Figure 1 , an embodiment of the instruction processing method based on a multi-core processor in an embodiment of the present invention includes:

[0043] 101. When a pending instruction is detected, a decoding operation is performed on the pending instruction to obtain an instruction type of the pending instruction;

[0044] Specifically, the instruction processing device based on the multi-core processor performs a decoding operation on the instruction to be processed to determine its instruction type. Among them, each field of the instruction is parsed to determine the type and operation of the instruction. According to the result of the decoding operation, the instruction is classified into different types, such as scalar instruction and vector instruction.

[0045] The identified instruction type is returned so that the instruction processing device based on the multi-core processor can subsequently perform corresponding operations according to the instruction type.

[0046] Specifically, refer to Figure 2 , Figure 2 FIG. 1 is a schematic diagram of a specific embodiment of step 101 of the instruction processing method based on a multi-core processor in an embodiment of the present invention. Step 101 also includes the following specific implementation methods:

[0047] 1011. When a pending instruction is detected, an operation code of the pending instruction is parsed;

[0048] Specifically, when the instruction to be processed is detected, it is read from the instruction memory and sent to the instruction decoding unit. The instruction decoding unit extracts the operation code field from the instruction to be processed.

[0049] 1012. Match the operation code with a preset vector instruction set to obtain a matching set;

[0050] 1013. If the matching set is empty, determine that the instruction type of the instruction to be processed is a vector instruction; otherwise, determine that the instruction type of the instruction to be processed is a scalar instruction.

[0051] Optionally, if the instruction type is a scalar instruction, the scalar processing unit is directly called to process the instruction to be processed. Scalar instructions usually involve operations on a single data element, and directly calling the scalar processing unit can specifically process these operations without mixing them with vector operations. This step can improve the efficiency of the processor and speed up the execution speed of the entire program.

[0052] Among them, scalar instructions are instructions executed on a single data element. In contrast, vector instructions are used to process multiple data elements at the same time, usually in the form of a group (vector). Scalar instructions are usually used to process a single data element or perform a single operation, and are suitable for scenarios that cannot or are not convenient to process in vector form. In contrast, vector instructions can process multiple data elements at the same time, providing higher parallelism and efficiency when processing large-scale data.

[0053] Optionally, if the instruction type is a scalar instruction, the scalar instruction is sent to an idle scalar pipeline; and an idle scalar processing unit is called to process the instruction to be processed. By sending the scalar instruction to an idle scalar pipeline, multiple instructions can be executed in parallel at different pipeline stages, thereby improving overall performance.

[0054] Specifically, the opcode is matched with known opcodes according to the instruction set architecture of the processor. Usually, each opcode corresponds to an operation performed by the processor, such as arithmetic operation, logical operation, data movement, etc. The opcode is identified and parsed, and the instruction processing device based on the multi-core processor performs the corresponding operation according to the opcode. If an invalid opcode or an unrecognizable instruction is found during the instruction decoding process, the exception handling mechanism is triggered. The processor usually executes the exception handling process according to the instruction set architecture specification, such as throwing an exception, interrupting execution, etc. After parsing the opcode, the instruction processing device based on the multi-core processor will continue to execute the subsequent steps of the instruction.

[0055] In steps 1011-1013, by parsing the opcode and matching it with the preset vector instruction set, the instruction processing device based on the multi-core processor can quickly and accurately determine the type of instruction to be processed. Classifying instructions into vector instructions and scalar instructions helps to optimize the allocation of processor resources. For example, vector instructions can be assigned to vector processor units, while scalar instructions can be assigned to scalar processor units to maximize the parallel capability of the processor.

[0056] 102. If the instruction type is a vector instruction, store the instruction to be processed into a cache of a preset shared vector processor;

[0057] Specifically, for vector instructions, a cache location is selected based on certain features of the instruction (such as opcode, address, etc.). After selecting the cache location, check the status of the selected location to ensure that it is available. If the location is already occupied, execute a replacement strategy (such as LRU, FIFO, etc.) to select a replaceable entry. Write the opcode, operand, and related information of the vector instruction to the selected cache location. Mark the selected location as occupied, and update other status information related to cache management.

[0058] Optionally, a register renaming operation is performed on the pending instruction, and the pending instruction is stored in a preset cache of a shared vector processor. The register renaming operation can reduce data conflicts caused by multiple instructions reading and writing the same register. By storing the instructions in the cache, the execution order of the instructions can be managed more effectively to avoid data dependencies and race conditions.

[0059] Specifically, step 102 also includes the following specific implementation methods:

[0060] 1021. Dynamically adjust the number of processing units of the shared vector processor according to the vector length information in the instruction to be processed;

[0061] Specifically, the instruction to be processed is parsed to obtain the vector length information contained therein, such as a field or metadata in the instruction, which is used to indicate the vector length of the data to be processed.

[0062] 1022. Store the to-be-processed instruction into a cache of the shared vector processor.

[0063] Specifically, the number of required processing units is determined based on the vector length information obtained through the analysis. A longer vector length requires more processing units to process data in parallel, while a shorter vector length requires fewer processing units. Based on the determined number of processing units, the number of vector processing units in the shared vector processor is dynamically adjusted. For example, redundant vector processing units are disabled.

[0064] In steps 1021-1022, disabling the vector processing unit can reduce the power consumption of the processor. The vector processing unit is usually one of the parts of the processor that consumes more power, especially when performing a large number of vector calculations. By disabling unnecessary units, the power consumption of the entire processor can be reduced.

[0065] 103. Calling the shared vector processor to perform a decoding operation on the instruction to be processed to determine a micro-operation to be executed;

[0066] Specifically, based on the instruction information obtained by decoding, the shared vector processor determines the micro-operation to be executed. After determining the micro-operation to be executed, the shared vector processor will call the corresponding execution unit to execute the micro-operation. The execution unit is a vector processing unit. After calling the execution unit, the shared vector processor starts to execute the determined micro-operation. During the execution of the micro-operation, if an exception occurs, such as data overflow, illegal operation, etc., the shared vector processor needs to adopt an appropriate exception handling mechanism to handle the exception and ensure the correct operation of the system. After completing the execution of the micro-operation of the current instruction, the shared vector processor checks whether there is a next instruction to be processed.

[0067] 104. Read the to-be-processed data corresponding to the micro-operation;

[0068] Specifically, according to the type and operation code of the current micro-operation, determine which data the micro-operation needs to read. Determine the location of the data to be processed, such as a register file, cache, memory or other storage device. According to the address, offset and other information contained in the micro-operation, determine the location of the data to be processed in the memory. According to the determined data location, send a read request to the storage subsystem. The read request includes information such as address, data size, and read mode.

[0069] Wait for the storage subsystem to respond to the read request and transfer the corresponding data back to the shared vector processor.

[0070] 105. Perform vector calculation on the data to be processed according to the micro-operation to respond to the instruction to be processed.

[0071] Specifically, the shared vector processor starts receiving the transmitted data, for example, reading the data from the memory into a cache or a register file.

[0072] Store the received data to the appropriate location of the shared vector processor for use by subsequent micro-operations, such as writing the data to a register file, cache, or temporary storage area.

[0073] After storing the data, the shared vector processor may perform a data integrity check to ensure that the received data is consistent with the expected data. After completing the data read operation.

[0074] Specifically, refer to Figure 3 , Figure 3 FIG. 1 is a schematic diagram of a specific embodiment of step 105 of the instruction processing method based on a multi-core processor in an embodiment of the present invention. Step 105 also includes the following specific implementation methods:

[0075] 1051. Perform vector calculation on the data to be processed according to the micro-operation to obtain a calculation result;

[0076] 1052. Write the calculation result back to a preset vector register in response to the instruction to be processed.

[0077] In steps 1051-1052, vector calculations can process multiple data elements at the same time, thus significantly improving the performance of the processor. By writing the calculation results directly back to the vector registers, the overhead of data movement and storage access can be reduced, thereby improving the overall performance. Writing the calculation results directly back to the vector registers can reduce the data transmission delay within the processor, thereby reducing the overall instruction execution delay.

[0078] Specifically, step 105 also includes the following specific implementation methods:

[0079] 1053. Select a vector computing unit in the shared vector processor according to a memory access mode of the data to be processed;

[0080] 1054. Perform vector calculation on the data to be processed according to the micro-operation to respond to the instruction to be processed.

[0081] In steps 1053-1054, it is determined which vector computing units are selected to perform vector computing based on the memory access pattern of the data. If the data exhibits a continuous access pattern, more vector computing units are enabled to speed up data processing. On the contrary, if the data access is random, fewer vector computing units are selected to more efficiently utilize resources.

[0082] In a specific embodiment, in an instruction processing device based on a multi-core processor, a pipeline structure is adopted in the multi-core processor (CPU), and specific reference is made to Figure 4 After the instruction is fetched by the front end, if the instruction decoded in the decoding stage is a vector instruction, the instruction is sent to the shared vector for processing; if it is a scalar instruction, it is processed in the scalar pipeline of each core.

[0083] Vpu is equipped with an independent vcsr for each core. Each vcsr in Vpu is a backup of each core. Vpu contains Thread_id, Core_id information. Vpu can be adaptively expanded according to the number of threads and cores.

[0084] Each core uses a fifo to cache the vector instructions sent in the decoding stage. According to the decode width, it takes n instructions from the fifos of multiple cores in turn and sends them to the next level fifo in each cycle. At the same time, it balances the number of instructions in the previous level fifo to ensure that the fifo is not full and causes pipeline congestion. The Vpu takes n instructions from the last level fifo in turn according to the decode width for decoding.

[0085] Send the decoded mop to the rename module corresponding to core_id to rename the register.

[0086] The instructions from rename are dispatched to the issue module, which sends the instructions to the execution unit.

[0087] At the same time, rob is created for the renamed instruction to maintain the instruction status information. At the same time, vector instructions need to create rob in each core and scalar instructions in the order of instructions. When the instruction corresponding to core_id in vpu is submitted, the submission information is passed to the rob in the corresponding core.

[0088] After Rename, enter the issue stage and select the oldest ready instruction to send to the execution unit for execution. Use the same register file and execution unit.

[0089] In an embodiment of the present invention, when an instruction to be processed is detected, a decoding operation is first performed to determine the instruction type. If the instruction type is a vector instruction, it is stored in the cache of the shared vector processor. If so, even if the current processor core does not have a vector computing task, the vector instruction can be cached in the shared processor so that other cores can use these instructions to perform vector computing tasks. This method improves the utilization of the processor, especially when there are a large number of vector computing tasks in the processing scenario. In a traditional processor, each core is equipped with a vector processing unit. However, in some cases, the vector processing unit of a particular core may be idle because there are not enough vector instructions to be processed. The introduction of a shared vector processor can reduce this waste of resources, because multiple cores can share the same vector processor, which improves the utilization of the vector processing unit. Therefore, the sample embodiment can accurately formulate the size of the shared vector processor according to actual needs to reduce the area required for the vector processing unit in a multi-core processor.

[0090] Figure 5 1 is a schematic diagram of the structure of an instruction processing device based on a multi-core processor provided by an embodiment of the present invention. The instruction processing device 500 based on a multi-core processor may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 510 (for example, one or more processors) and a memory 520, and one or more storage media 530 (for example, one or more mass storage devices) storing application programs 533 or data 532. Among them, the memory 520 and the storage medium 530 can be short-term storage or permanent storage. The program stored in the storage medium 530 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the instruction processing device 500 based on the multi-core processor. Furthermore, the processor 510 may be configured to communicate with the storage medium 530 to execute a series of instruction operations in the storage medium 530 on the instruction processing device 500 based on the multi-core processor.

[0091] The multi-core processor-based instruction processing device 500 may also include one or more power supplies 540, one or more wired or wireless network interfaces 550, one or more input and output interfaces 560, and / or one or more operating systems 531, such as Windows Serve, Mac OS X, Unix, Linux, Free BSD, etc. Those skilled in the art will appreciate that Figure 5 The illustrated structure of the instruction processing device based on a multi-core processor does not constitute a limitation on the instruction processing device based on a multi-core processor, and may include more or less components than shown in the figure, or combine certain components, or arrange components differently.

[0092] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions are executed on a computer, the computer executes the steps of the instruction processing method based on a multi-core processor.

[0093] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0094] In addition, although each operation is described in a specific order, this should be understood as requiring such operation to be performed in the specific order shown or in a sequential order, or requiring that all illustrated operations should be performed to obtain desired results. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single implementation in combination. On the contrary, the various features described in the context of a single implementation can also be implemented in multiple implementations individually or in any suitable sub-combination mode.

[0095] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

Claims

1. An instruction processing method based on a multi-core processor, characterized in that: The instruction processing method based on a multi-core processor includes: When a pending instruction is detected, a decoding operation is performed on the pending instruction to obtain an instruction type of the pending instruction; If the instruction type is a vector instruction, storing the instruction to be processed into a cache of a preset shared vector processor; Calling the shared vector processor to perform a decoding operation on the instruction to be processed to determine a micro-operation to be executed; Reading the data to be processed corresponding to the micro-operation; According to the micro-operation, vector calculation is performed on the data to be processed in response to the instruction to be processed.

2. The instruction processing method based on a multi-core processor according to claim 1, characterized in that: The step of performing vector calculation on the data to be processed according to the micro-operation to respond to the instruction to be processed includes: According to the micro-operation, vector calculation is performed on the data to be processed to obtain a calculation result; The calculation result is written back to a preset vector register in response to the instruction to be processed.

3. The instruction processing method based on a multi-core processor according to claim 1, characterized in that: The step of storing the to-be-processed instruction into a cache of a preset shared vector processor comprises: A register renaming operation is performed on the instruction to be processed, and the instruction to be processed is stored in a cache of a preset shared vector processor.

4. The instruction processing method based on a multi-core processor according to claim 1, characterized in that: When the instruction to be processed is detected, the step of performing a decoding operation on the instruction to be processed to obtain the instruction type of the instruction to be processed includes: When a pending instruction is detected, parsing the operation code of the pending instruction; Matching the operation code with a preset vector instruction set to obtain a matching set; If the matching set is empty, it is determined that the instruction type of the instruction to be processed is a vector instruction; otherwise, it is determined that the instruction type of the instruction to be processed is a scalar instruction.

5. The instruction processing method based on a multi-core processor according to claim 4, characterized in that: After the step of determining that the instruction type of the instruction to be processed is a vector instruction if the matching set is empty, and otherwise determining that the instruction type of the instruction to be processed is a scalar instruction, the method further comprises: If the instruction type is a scalar instruction, the scalar processing unit is directly called to process the instruction to be processed.

6. The instruction processing method based on a multi-core processor according to claim 4, characterized in that: If the instruction type is a scalar instruction, the step of calling a scalar processing unit to process the instruction to be processed includes: If the instruction type is a scalar instruction, sending the scalar instruction to an idle scalar pipeline; An idle scalar processing unit is called to process the pending instruction.

7. The instruction processing method based on a multi-core processor according to claim 1, characterized in that: If the instruction type is a vector instruction, the step of storing the to-be-processed instruction into a cache of a preset shared vector processor comprises: Dynamically adjust the number of processing units of the shared vector processor according to the vector length information in the instruction to be processed; The to-be-processed instructions are stored in a cache of the shared vector processor.

8. The instruction processing method based on a multi-core processor according to claim 1, characterized in that: The step of performing vector calculation on the data to be processed according to the micro-operation to respond to the instruction to be processed includes: Selecting a vector computing unit in the shared vector processor according to a memory access mode of the data to be processed; Vector calculations are performed on the data to be processed according to the micro-operations in response to the instructions to be processed.

9. An instruction processing device based on a multi-core processor, characterized in that: The multi-core processor-based instruction processing device comprises: a memory and at least one processor, the memory stores instructions, and the memory and the at least one processor are interconnected via a line; The at least one processor calls the instruction in the memory so that the instruction processing device based on the multi-core processor executes the instruction processing method based on the multi-core processor as described in any one of claims 1-8.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the instruction processing method based on a multi-core processor as described in any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Vector processor and vector data access and interaction method thereof

    CN103699360A

  • Processor having multiple cores, shared core extension logic, and shared core extension utilization instructions

    CN109375949A

  • Vector data processing method and device for multi-core processor

    CN115993949A

  • RISC-V Vector Processor And Method For RISC-V Vector Processor

    CN118034784A

  • Processing method and device based on vector calculation

    WO2023122899A1

Cited By

  • Configuration method and device for instruction set arithmetic unit in multi-core processor

    CN120256136A