Processor, instruction processing method, and electronic device including processor
By designing dynamically coupled accelerator modules and arbitrators in the processor, the problem of sharing the accelerator engine between cores in multi-core CPUs is solved, and the utilization rate and processor performance of the accelerator engine are improved.
Patent Information
- Application Number
- CN202411261193.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-09
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2044-09-09
AI Technical Summary
Existing CPU accelerators have low utilization and high load offload overhead. Especially in multi-core CPU environments, it is difficult to share accelerator engines with the same or different functions between cores, resulting in accelerator engines being not very useful in most cases.
A processor is designed, including multiple processor cores and accelerator modules. Each processor core can dynamically couple and share the accelerator modules, and allocate the accelerator engine through an arbitrator to improve the utilization of the accelerator engine.
By dynamically allocating and binding the accelerator engine, the utilization rate of accelerator engine in different application scenarios is improved, development and deployment costs are reduced, and overall processor performance is improved.
Smart Images

Figure CN119045896A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to integrated circuits, and more particularly, to a processor, an instruction processing method, and an electronic device including the processor. Background Art
[0002] The accelerator unit (or "accelerator" for short) of a central processing unit (CPU) generally refers to a technology that can improve the computing power of a CPU in a specific application field, for example, a technology that improves the processing speed and efficiency of a CPU in a specific application field. Accelerator units integrated into the CPU are generally divided into two types: CPU core internal accelerators and CPU core external accelerators, depending on their connection relationship with the CPU core.
[0003] However, CPU accelerators may suffer from low accelerator unit utilization or high load offloading overhead. Summary of the invention
[0004] According to at least one embodiment of the present disclosure, a processor is provided, comprising: a plurality of processor cores, wherein each of the plurality of processor cores is configured to execute a first category of instructions; an accelerator module, wherein the accelerator module comprises at least one accelerator engine, configured to execute a second category of instructions different from the first category of instructions; wherein the accelerator module is coupled to the plurality of processor cores and shared by the plurality of processor cores, and the plurality of processor cores respectively dispatch object instructions belonging to the second category of instructions in the instruction stream processed by themselves to the accelerator module for execution and receive execution result messages of the object instructions from the accelerator module.
[0005] For example, in the processor according to an embodiment of the present disclosure, the accelerator module is dynamically coupled to the multiple processor cores, and receives the same or different object instructions belonging to the second category of instructions from the multiple processor cores.
[0006] For example, in a processor according to an embodiment of the present disclosure, each of the multiple processor cores is further configured to: identify whether the current instruction in the instruction stream is the first category instruction or the second category instruction, dispatch the current instruction to its own pipeline in response to the current instruction being the first category instruction, and dispatch the current instruction to the accelerator module as the object instruction in response to the current instruction being the second category instruction.
[0007] For example, according to an embodiment of the present disclosure, each of the multiple processor cores is further configured to: cause the object instruction to enter a dispatch queue to wait for dispatch, allocate an entry in a reorder buffer (ROB) for the object instruction, and in response to the object instruction becoming the oldest instruction in the ROB, dispatch the object instruction to the accelerator module.
[0008] For example, in a processor according to an embodiment of the present disclosure, each of the multiple processor cores is further configured to: allow the object instruction to enter a dispatch queue to wait for dispatch, wait for a reorder buffer (ROB) to be drained, and in response to the ROB being drained, dispatch the instruction to the accelerator module.
[0009] For example, in a processor according to an embodiment of the present disclosure, wherein: the accelerator module is also configured to return the processing result of the object instruction to the corresponding processor core, and the execution result message of the object instruction includes the execution result of the object instruction; or the accelerator module is also configured to store the processing result of the object instruction in a memory coupled to the multiple processor cores, and the execution result message of the object instruction includes the storage address of the execution result of the object instruction in the memory.
[0010] For example, a processor according to an embodiment of the present disclosure, wherein each of the multiple processor cores includes: an instruction fetch module configured to fetch instructions; a decoding module configured to decode the fetched instructions into one or more micro-operations MOPs; and a dispatch module configured to dispatch the one or more MOPs to the processor core pipeline or the accelerator module.
[0011] For example, according to a processor of an embodiment of the present disclosure, the one or more MOPs include: a read and fill MOP for reading instruction parameters and filling operands, and a load unloading MOP for sending workloads to an accelerator engine that executes the one or more MOPs.
[0012] For example, in a processor according to an embodiment of the present disclosure, in response to the accelerator engine and the corresponding processor core being in a synchronous operation mode, the accelerator module is configured to return the execution status to the corresponding processor core in response to the completion of execution of the object instruction in the accelerator module.
[0013] For example, in the processor according to an embodiment of the present disclosure, the one or more MOPs further include: a read response MOP, configured to enable the at least one accelerator engine to return an execution status to a corresponding processor core.
[0014] For example, in a processor according to an embodiment of the present disclosure, the accelerator module further includes: an arbitrator coupled between the multiple processor cores and at least one accelerator engine, and configured to arbitrate the object instructions received from the multiple processor cores to allocate them to a target accelerator engine among the at least one accelerator engine.
[0015] For example, according to the processor of an embodiment of the present disclosure, the accelerator module further includes: a memory interface coupled to the at least one accelerator engine and including a translation lookaside buffer (TLB), wherein the at least one accelerator engine shares the TLB.
[0016] For example, in a processor according to an embodiment of the present disclosure, the TLB includes one or more TLB entries, each of the one or more TLB entries includes a processor core ID, and the processor core identity (ID) identifies which processor core among the multiple processor cores the current TLB entry belongs to.
[0017] For example, in the processor according to an embodiment of the present disclosure, each of the one or more TLB entries further includes: a process ID for identifying a process to which the current TLB entry belongs.
[0018] For example, in a processor according to an embodiment of the present disclosure, each of the multiple processor cores is further configured to send a TLB entry operation instruction to the accelerator module, and when the TLB entry operation instruction is executed, the accelerator module performs one or more of the following operations: invalidate all TLB entries, invalidate TLB entries with a specific process ID, invalidate TLB entries with a specific process ID and a specific virtual page number (VPN), invalidate TLB entries with a specific processor core ID, invalidate TLB entries with a specific processor core ID and a specific process ID, and invalidate TLB entries with a specific processor core ID, a specific process ID, and a specific VPN.
[0019] For example, in a processor according to an embodiment of the present disclosure, the accelerator module further includes a data cache, and each of the multiple processor cores is further configured to send a cache operation instruction to the accelerator module, wherein the cache operation instruction, when executed, causes the accelerator module to perform one or more of the following operations: invalidate all cache lines in the data cache; invalidate one or more cache lines in the data cache; refresh all cache lines in the data cache; and refresh one or more cache lines in the data cache.
[0020] For example, in the processor according to an embodiment of the present disclosure, the at least one accelerator engine includes a control register configured to store the TLB entry operation instruction and the cache operation instruction.
[0021] For example, according to a processor of an embodiment of the present disclosure, the accelerator module also includes a page table walker (PTW) independent of the multiple processor cores, wherein the accelerator module is further configured to: in response to a miss of the at least one accelerator engine for the TLB, use the independent PTW to complete the page table access.
[0022] For example, in a processor according to an embodiment of the present disclosure, the accelerator module further includes a PTW router connected to at least a portion of the multiple processor cores, the object instruction further includes a processor core ID, and the accelerator module is further configured to: in response to a miss of the TLB by the at least one accelerator engine, use the PTW router to access the PTW in the corresponding processor core based on the processor core ID to complete the page table access.
[0023] For example, in a processor according to an embodiment of the present disclosure, each of the at least one accelerator engine includes: an acquisition front-end module, configured to decode the object instruction received from the arbitrator; one or more back-end execution modules, configured to execute the object instruction decoded by the acquisition front-end module; a memory interface arbitrator module, arbitrating memory access requests of the one or more back-end execution modules; and a completion unit module, configured to submit the processing results of the object instruction.
[0024] For example, in a processor according to an embodiment of the present disclosure, the acquisition front-end module includes a load offload buffer, and the load offload buffer is configured to store object instruction parameters and operands.
[0025] According to at least one embodiment of the present disclosure, an electronic device is provided, including the above-mentioned processor.
[0026] According to at least one embodiment of the present disclosure, an instruction processing method is provided, comprising: receiving an instruction stream to be executed through multiple processor cores, wherein the instruction stream includes a first category of instructions and a second category of instructions different from the first category of instructions; the multiple processor cores respectively process the first category of instructions in the corresponding instruction stream; the multiple processor cores respectively dispatch object instructions belonging to the second category of instructions in the instruction stream processed by themselves to an accelerator module for execution, and receive execution result messages of the object instructions from the accelerator module, wherein the accelerator module includes at least one accelerator engine, configured to execute the second category of instructions, and the accelerator module is coupled to the multiple processor cores and shared by the multiple processor cores. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The above and other aspects, features and advantages of certain embodiments of the present disclosure will become more apparent from the following description in conjunction with the accompanying drawings, in which:
[0028] Figure 1A is a schematic diagram of a processor according to at least one embodiment of the present disclosure; Figure 1B is a schematic diagram of an example of a processor core according to at least one embodiment of the present disclosure.
[0029] Figure 2 is a schematic diagram of a processor according to at least one embodiment of the present disclosure.
[0030] Figure 3 is a schematic diagram of data interaction between a processor core and an accelerator module according to at least one embodiment of the present disclosure.
[0031] Figure 4 is a schematic diagram of a MOP according to at least one embodiment of the present disclosure.
[0032] Figure 5 It is a schematic diagram of a method for an accelerator engine to access a TLB and a PTW router according to at least one embodiment of the present disclosure.
[0033] Figure 6 is a schematic diagram of the operation of a processor core on a TLB and an optional data cache in an accelerator module according to at least one embodiment of the present disclosure.
[0034] Figure 7 is a schematic structural diagram of an accelerator module according to at least one embodiment of the present disclosure.
[0035] Figure 8 The invention relates to an instruction processing method according to at least one embodiment of the present disclosure.
[0036] Fig. 9 An electronic device including a processor according to at least one embodiment of the present disclosure. DETAILED DESCRIPTION
[0037] Before proceeding to the following detailed description, it may be advantageous to set forth the definitions of certain words and phrases used throughout this disclosure. The terms "include" and "comprises" and their derivatives mean including but not limited to. The term "or" is inclusive, meaning and / or. The phrase "associated with..." and its derivatives mean including, included within, interconnected, contained, contained within, connected or connected with, coupled or coupled with, communicated with, coordinated, interwoven, parallel, close, bound or bound with, having, having attributes, having a relationship or having a relationship with, etc. The term "controller" refers to any device, system, or part thereof that controls at least one operation. Such a controller may be implemented with hardware, or a combination of hardware and software and / or firmware. The functions associated with any particular controller may be centralized or distributed, whether local or remote. The phrase "at least one", when used with a list of items, means that different combinations of one or more of the listed items may be used, and only one item in the list may be required. For example, “at least one of A, B, and C” includes any one of the following combinations: A, B, C, A and B, A and C, B and C, A, B, and C.
[0038] Definitions for other specific words and phrases are provided throughout this disclosure. Those of ordinary skill in the art should understand that in many, if not most instances, such definitions apply to prior and future uses of such defined words and phrases.
[0039] The various embodiments of the principles of the present disclosure described below in conjunction with the accompanying drawings are only for illustration, and should not be interpreted as limiting the scope of the present disclosure in any way. It will be appreciated by those skilled in the art that the principles of the present disclosure can be implemented in any appropriately arranged system or device. In some cases, the actions described in the specification can be performed in different orders, and the desired results can still be achieved. In addition, the process depicted in the accompanying drawings does not necessarily require the specific order shown or the sequential order to achieve the desired results. In a specific embodiment, multitasking and parallel processing may be advantageous.
[0040] The accelerator unit integrated in the CPU is generally divided into two types: CPU core internal accelerator and CPU core external accelerator according to the connection relationship with the CPU core. The design feature of the CPU core internal accelerator is that the CPU core internal accelerator uses the same instruction set architecture (ISA) as the CPU, and decides whether to dispatch to the accelerator for execution or use the ordinary CPU arithmetic and logic unit (ALU) for execution based on the instruction encoding inside the CPU. The design feature of the CPU core external accelerator is that the CPU core external accelerator is outside the CPU core and is connected to the CPU core through an IO bus (for example, Peripheral Component Interconnect Express (PCIE)), and the CPU operates the accelerator to perform operations by reading and writing the IO address of the accelerator.
[0041] Due to the close integration with the CPU pipeline, the accelerator inside the CPU core is generally a one-to-one relationship with the CPU core (that is, one CPU core is matched with one accelerator). For multi-core CPU chips, if there are multiple different types of accelerators, then each CPU core is generally required to have multiple types of accelerators integrated with the same combination. However, in reality, most CPU workloads may not require all CPU cores to run the same accelerated computing task, which results in low utilization efficiency of a large number of accelerators. In addition, if each core of a multi-core CPU is integrated with multiple types of accelerators in different combinations according to usage needs (for example, the type of CPU workload), it may cause multi-core heterogeneity problems, bring challenges to software development / deployment and migration, and increase development / deployment and migration costs.
[0042] For accelerators outside the CPU core, although such accelerators based on the IO bus connection method can realize function sharing through the driver method, the IO bus connection method may have the problem of large load unloading overhead. In particular, in some applications with relatively small workload granularity, the efficiency of the CPU core external accelerator may be significantly reduced.
[0043] Modern multi-core CPUs, based on implementation and performance considerations, generally package several (e.g., 4 to 8) CPU cores together with their accompanying Level 1 data cache (L1D$), Level 2 cache (L2$), Level 3 cache (L3$), etc. into a module called a core cluster. Several CPU cores in a core cluster can generally share L2$ or L3$. By connecting several identical core clusters together using internal interconnects, they can together form an overall multi-core CPU system.
[0044] The present disclosure provides a processor, comprising: a plurality of processor cores and an accelerator module, wherein each of the plurality of processor cores is configured to execute a first category of instructions; the accelerator module comprises at least one accelerator engine, configured to execute a second category of instructions different from the first category of instructions; the accelerator module is coupled to the plurality of processor cores and shared by the plurality of processor cores, and the plurality of processor cores respectively dispatch object instructions belonging to the second category of instructions in the instruction stream processed by themselves to the accelerator module for execution and receive execution result messages of the object instructions from the accelerator module.
[0045] The processor according to the present disclosure can solve or alleviate the problem that it is difficult to share accelerator engines with the same or different functions between cores in a core cluster. For example, in many application scenarios, the accelerators (for example, the type and number of accelerator engines) used by the CPU loads of different types of CPU cores are different. However, due to the static binding method between the CPU core and the accelerator, the same type of accelerator engine must be integrated in each CPU core, which causes the problem that the accelerator engine is not used frequently in most cases.
[0046] According to the processor disclosed in the present invention, several cores in a core cluster can share accelerator engines with the same or different functions. The type and number of accelerator engines can be configured specifically according to the different application fields that the entire CPU is facing, and there is no direct binding relationship between the number of CPU cores in the core cluster. In this way, accelerator engines can be dynamically allocated and bound to CPU cores, thereby improving the utilization of accelerator engines in different application scenarios.
[0047] Figure 1A is a schematic diagram of a processor according to at least one embodiment of the present disclosure; Figure 1B is a schematic diagram of an example of a processor core according to at least one embodiment of the present disclosure.
[0048] like Figure 1AAs shown, the processor 100 may include a plurality of processor cores 111 , 112 , . . . , 11 n and an accelerator module 120 .
[0049] The multiple processor cores 111-11n may be components for executing instructions in the processor 100. Each of the multiple processor cores 111-11n may independently execute program code and process different tasks or threads at the same time. The multiple processor cores 111-11n may improve the parallel processing capability of the processor, so that the computer may execute multiple tasks or more complex calculations more quickly. Each of the multiple processor cores 111-11n may execute a first class of instructions, for example, instructions executed by the pipeline of the processor core itself, including but not limited to arithmetic logic instructions (for example, addition, subtraction, multiplication, division, and, or, non, XOR, etc.), data transfer instructions (for example, load, store, input, output, etc.), control flow instructions (for example, unconditional jump, subroutine call and return, etc.), string processing instructions (for example, comparison, movement, string search, etc.), floating point operation instructions (for example, arithmetic operations for floating point numbers, such as addition, subtraction, multiplication, division, square root, etc.), privileged instructions (for example, tasks at the operating system level, such as interrupt control, virtual memory management, etc.), and the like. A plurality of processor cores 111 - 11 n may form a core cluster 110 .
[0050] Figure 1B FIG. 1 shows a pipeline of an exemplary processor core, where the dashed line with an arrow in the figure represents the redirected instruction flow. Figure 1BAs shown, the processor core (e.g., CPU core) of a single-core processor or a multi-core processor improves instruction level parallelism through pipeline technology. The processor core includes multiple pipeline stages. For example, after the pipeline feeds program counters from various sources and selects the next program counter (PC) through a multiplexer (Mux), the instruction corresponding to the program counter must go through branch prediction, instruction fetch, instruction decoding, instruction dispatch and rename, instruction execution, and instruction termination (Retire / Complete). Waiting queues are set between each pipeline stage as needed, and these queues are usually first-in-first-out (FIFO) queues. For example, after the branch prediction unit, a branch prediction (BP) FIFO queue is set to store branch prediction results; after the instruction fetch unit, an instruction cache (IC) FIFO is set to cache the fetched instructions; after the instruction decoding unit, a decoding (DE) FIFO is set to cache the decoded instructions; after the instruction distribution and renaming unit, a termination (RT) FIFO is set to cache the instructions waiting for confirmation after execution. At the same time, the pipeline of the processor core also includes an instruction queue to cache instructions waiting for the instruction execution unit to execute after the instruction distribution and renaming. In order to support high operating frequencies, each pipeline stage may contain multiple pipeline stages (clock cycles). Although each pipeline stage performs limited operations, each clock can be minimized in this way, and the performance of the CPU core can be improved by increasing the operating frequency of the CPU. Each pipeline stage can also further improve the performance of the processor core by accommodating more instructions (i.e. superscalar technology).
[0051] The processor core translates each architecture instruction into one or more micro-ops (mop) within the micro-architecture. Each micro-op performs only limited operations, which ensures that each pipeline stage is short to increase the operating frequency of the processor core. For example, a memory read instruction (load) can be translated into an address generation micro-instruction and a memory read micro-instruction. The second micro-instruction depends on the result of the first micro-instruction, so the second micro-instruction will only start to execute after the first micro-instruction is executed. Micro-instructions contain multiple micro-architecture-related fields, which are used to pass relevant information between pipeline stages.
[0052] Speculative execution is another technique to improve processor performance. This technique executes the instructions following an instruction before it has finished executing. The branch prediction unit (branch predictor) at the front end of the processor core predicts the jump direction of the branch instruction, pre-fetches and executes the instructions in that direction; another speculative execution technique is to execute a memory read instruction before the addresses of all the previous memory write instructions are obtained. Speculative execution further improves the parallelism between instructions, thereby greatly improving the performance of the processor core. When a speculative execution error occurs, such as a branch prediction error is found, or a write instruction before the memory read instruction rewrites the same address, all instructions in the pipeline following the erroneous instruction need to be refreshed (or "flushed" or "cleared"), and then the program jumps to the error point and re-executes to ensure the correctness of the program execution. To support speculative execution, the processor core microarchitecture also needs to support the architectural register recovery mechanism to ensure that the architectural registers always have the correct value during speculative execution.
[0053] Operating systems usually need to support multiple processes running simultaneously while using the CPU. To simplify multi-process management and enhance security, applications use a complete virtual address. For example, a 32-bit addressing application has a maximum of 2 32 =4GB of virtual address space is available. When the program is running, these virtual addresses are mapped to multiple memory pages, each with its own physical storage address. When the application program accesses instructions and data, it must first translate the virtual addresses of the instructions and data into physical addresses, and detect whether the application's access to the page is legal, and then go to the memory or cache to obtain the corresponding data and pass it to the CPU core. The conversion process from virtual address to physical address is called address translation. The mapping from virtual address to physical address is stored in a table in memory, and accessing these tables in memory also requires hundreds of clocks. In order to reduce these memory accesses, the CPU core uses multiple levels of cache to save the most recently used mappings. These specific caches are called translation lookaside buffers or page table buffers (Table Lookaside Buffer, TLB). When the query TLB is missing or misses, the CPU core needs to use the Page Table Walker (PTW) to browse the page table page to find the required page table entry (PTE) for address translation.
[0054] The pipeline of the processor core of the embodiment of the present disclosure is not limited to Figure 1AIn the examples shown, some components can be omitted or other components can be added as needed. The embodiments of the present disclosure do not limit the architecture of the processor core (such as x86, ARM, MIPS, RISC-V, etc.) and the instruction set executed.
[0055] The accelerator module 120 can be coupled to a plurality of processor cores 111-11n and can be shared by the plurality of processor cores 111-11n. The accelerator module 120 can improve the performance or energy efficiency of the processor cores 111-11n when performing a specific computing task or in a specific scenario, thereby improving the performance of the overall processor 100. For example, in some scenarios, not all processes running on the processor cores on the core cluster need to access the accelerator engine. In other words, among the processes running on the processor cores on the core cluster, only the processes on the individual processor cores may need to access the accelerator engine. In this case, if each processor core is statically bound to an accelerator hardware module, it may cause waste.
[0056] The accelerator module 120 may include at least one accelerator engine 121. Figure 1A Only one accelerator engine 121 is shown, but the example embodiment may include more accelerator engines. At least one accelerator engine 121 may include multiple accelerator engines of the same or different types. The accelerator engine may include, but is not limited to, an application specific integrated circuit (ASIC), a graphics processing unit (GPU), a tensor processing unit (TPU), a neural network processing unit (NPU), a field programmable gate array (FPGA), a digital signal processor (DSP), etc. At least one accelerator engine 121 may be configured to execute a second type of instruction that is different from the first type of instruction. The second type of instruction is an instruction that can be executed by the accelerator module, for example, encryption and decryption, hash calculation, compression and decompression, etc., but the present disclosure is not limited thereto.
[0057] The multiple processor cores 111-11n may respectively dispatch the object instructions 131 belonging to the second category of instructions in the instruction stream processed by the processor cores 111-11n to the accelerator module 120 for execution. For example, the multiple processor cores 111-11n may respectively dispatch the object instructions 131 belonging to the second category of instructions to at least one accelerator engine 121 in the accelerator 120 for execution. The multiple processor cores 111-11n may receive execution result messages of the object instructions from the accelerator module 120. For example, the multiple processor cores 111-11n may receive execution result messages of the object instructions from at least one accelerator engine 121 in the accelerator module 120.
[0058] Multiple processor cores 111-11n may share at least one accelerator engine 121 with the same or different functions. The type and number of accelerator engines 121 may be configured specifically according to different application fields of the CPU, and have no direct binding relationship with the number of processor cores 111-11n.
[0059] In one embodiment, during the operation of the CPU, the accelerator module 120 can be dynamically coupled to the multiple processor cores 111-11n, and receive the same or different object instructions belonging to the second category of instructions from one or more of the processor cores 111-11n, for example, the same or different object instructions can be received from the multiple processor cores in the same operation cycle (clock cycle) or different operation cycles. For example, at least one accelerator engine 121 in the accelerator module 120 can be dynamically coupled to the multiple processor cores 111-11n.
[0060] For example, in response to the load of the processor 100 being a first type of load, the at least one accelerator engine 121 may receive the object instruction from one of the multiple processor cores 111-11n (e.g., processor core 111) and send an execution result message of the object instruction to the processor core. In response to the load of the processor 100 changing from the first type of load to the second type of load, the at least one accelerator engine 121 may change to receive the object instruction from another processor core (e.g., one of the processor cores 112-11n) among the multiple processor cores 111-11n and send an execution result message of the object instruction to the other processor core.
[0061] In this way, the accelerator engine 121 can be dynamically allocated and bound to the multiple processor cores 111 - 11 n , thereby improving the utilization of the accelerator engine in different application scenarios.
[0062] Figure 2 is a schematic diagram of a processor according to at least one embodiment of the present disclosure.
[0063] like Figure 2 As shown, the processor 2000 may include a plurality of processor cores 2010 , 2020 , . . . , 20n0 and an accelerator module 2300 and a third-level cache L3$ 2200 shared by the processor cores 2010 , 2020 , . . . , 20n0 .
[0064] Multiple processor cores 2010, 2020, ..., 20n0 may form a core cluster. Each core cluster may have 4-8 processor cores, that is, the number of multiple processor cores 2010, 2020, ..., 20n0 may be 4-8, but the embodiments of the present disclosure are not limited thereto, and each core cluster may include more or fewer processor cores.
[0065] although Figure 2 , n processor cores 2010, 2020, ..., 20n0 (n is a natural number greater than 1) are shown, but this is only an example, and the connection topology of the processor cores and accelerator modules in the core cluster can be more flexible. For example, every two processor cores can share one accelerator module. For another example, more or fewer processor cores can share one or more accelerator modules, etc.
[0066] although Figure 2 The structures of the multiple processor cores 2010, 2020, ..., 20n0 are shown to be the same, but those skilled in the art may understand that one or more of the multiple processor cores 2010, 2020, ..., 20n0 may have different structures.
[0067] Each processor core can identify whether the current instruction in the corresponding instruction stream processed by itself is a first-class instruction or a second-class instruction. For example, each processor core can identify whether the current instruction to be processed is a processor core instruction or an accelerator instruction. In response to identifying that the current instruction is a processor core instruction, each processor core can dispatch the current instruction to its own pipeline. In response to identifying that the current instruction is an accelerator instruction, each processor core can dispatch the current instruction to the accelerator module 2300 as an object instruction.
[0068] Multiple processor cores 2010, 2020, ..., 20n0 may include instruction fetch modules 2011, 2021, ..., 20n1, respectively. Each of the instruction fetch modules 2011, 2021, ..., 20n1 may be configured to fetch instructions. For example, each instruction fetch module may find the location of the instruction to be executed by the processor 2000 in the memory through the address bus, and fetch the instruction from the memory. Each instruction fetch module may transmit the fetched instruction to the corresponding decoding module.
[0069] Multiple processor cores 2010, 2020, ..., 20n0 may include decoding modules 2012, 2022, ..., 20n2, respectively. Each of the decoding modules 2012, 2022, ..., 20n2 may be configured to decode the fetched instruction into one or more MOPs. For example, each decoding module may decode the instruction from the corresponding instruction fetch module, and identify the type of instruction and the operands required by the instruction.
[0070] The plurality of processor cores 2010, 2020, ..., 20n0 may include dispatch modules 2013, 2023, ..., 20n3, respectively. Each of the dispatch modules 2013, 2023, ..., 20n3 may be configured to dispatch one or more MOPs to the processor core pipeline or accelerator module. For details of the one or more MOPs, refer to the following description of the MOPs. Figure 4 Description.
[0071] Each dispatch module may dispatch one or more MOPs to the accelerator module 2300 according to whether one or more MOPs from the corresponding decoding module are MOPs for the accelerator module.
[0072] In one embodiment, each processor core may be configured to allow the object instruction to be dispatched to the accelerator module 2300 to enter the dispatch queue (not shown in the figure) of the dispatch module to wait for dispatch. Each processor core may allocate an entry in the reorder buffer ROB for the object instruction. In response to the object instruction becoming the oldest instruction in the ROB, each processor core may dispatch the object instruction to the accelerator module 2300. The object instruction becoming the oldest instruction in the ROB means that the instructions before the object instruction have been executed and submitted, so the object instruction will not cause an execution error due to instruction dependency or data dependency.
[0073] Alternatively or additionally, in another embodiment, each processor core may be configured to cause the object instruction to enter a dispatch queue to wait for dispatch. Each processor core may wait for the reorder buffer ROB to be drained. In response to the ROB being drained, each processor core may dispatch instructions to the accelerator module 2300. The reorder buffer ROB being drained also means that the instructions before the object instruction have been executed and submitted, so that the object instruction will not cause an execution error due to instruction dependency or data dependency.
[0074] Each dispatch module may dispatch one or more MOPs to a corresponding transmit module according to whether the one or more MOPs from a corresponding decode module are MOPs for a pipeline of a processor core.
[0075] The plurality of processor cores 2010, 2020, ..., 20n0 may include transmission modules 2014, 2024 ( Figure 2 Each of the transmitting modules 2014, 2024, ..., 20n4 can take instructions from the dispatch queue of the processor core pipeline and distribute them to subsequent modules for execution. For example, each transmitting module can take instructions from the corresponding dispatch module from the dispatch queue of the processor core pipeline and distribute them to the corresponding LSU module and ALU module.
[0076] The plurality of processor cores 2010, 2020, ..., 20n0 may include a load and store unit (LSU) module 2015, 2025 ( Figure 2 ), ..., 20n5. Each of the LSU modules 2015, 2025, ..., 20n5 can receive and execute instructions on loading and storing. Instructions on loading and storing allow the processor 2000 to access data stored in the memory. When performing load and store operations, each LSU module can generate a virtual address. The virtual address can be converted into a physical address through an address conversion process (for example, through a corresponding TLB or PTW), so as to read or write data from the physical memory. Each LSU module can load data from the memory into the register of the processor 2000, or store data in the register of the processor 2000 back to the memory. Each LSU module can send its execution result to the corresponding completion module.
[0077] The plurality of processor cores 2010, 2020, ..., 20n0 may each include an independent level 1 data cache (eg, L1D$ 2018, L1D$ 2028 ( Figure 2 ), ..., L1D$ 20n8), and level 2 cache (e.g., L2$ 2029, L2$ 2029 ( Figure 2 ), ..., L2$ 20n9). Multiple processor cores 2010, 2020, ..., 20n0 may share a level 3 cache (L3$) 2200 via a memory coherent bus 2100. Each level 1 data cache may include a translation lookaside buffer TLB (e.g., TLB 20181, TLB 20281, ..., TLB 20n81) and a page table walker PTW (e.g., PTW 20182, PTW 20282, ..., PTW 20n82).
[0078] Each TLB can be used to store a copy of the page table entries that are most likely to be accessed by the corresponding processor core. These page table entries include mapping information from virtual addresses to physical addresses. When the corresponding processor core needs to access a virtual address, the processor core can first check whether the mapping information for the address already exists in the TLB. If it does (i.e., a hit), the processor core can directly use the physical address in the TLB to access the memory, thereby avoiding direct access to the page table in the memory, reducing the number of memory accesses, and increasing the speed of address conversion.
[0079] When the mapping information of a virtual address does not exist in the TLB (i.e., TLB miss), the processor core can access the page table in the memory through the corresponding PTW to obtain the physical address corresponding to the virtual address. The PTW can find the matching virtual address by traversing the page table and return the found physical address to the corresponding processor core. The PTW can also find the corresponding item from the page table and fill it back to the TLB.
[0080] The plurality of processor cores 2010, 2020, ..., 20n0 may include arithmetic and logic unit (ALU) modules 2016, 2026 ( Figure 2 Each of the LSU modules 2016, 2026, ..., 20n6 can perform basic arithmetic and logical operations, etc. according to the instructions received from the corresponding transmission module. Each ALU module can send its execution result to the corresponding completion module.
[0081] The plurality of processor cores 2010, 2020, ..., 20n0 may include completion modules 2017, 2027 ( Figure 2 Each of the completion modules 2017, 2027, ..., 20n7 may mark the corresponding instruction in the reorder buffer ROB as completed. Each completion module may also write the execution result of the corresponding instruction into the ROB for submission.
[0082] The processor 2000 may include an accelerator module 2300. Multiple processor cores 2010, 2020, ..., 20n0 may share an instruction set architecture (ISA) front end with the accelerator module 2300, for example, including instruction fetching, decoding, and dispatching. The accelerator module 2300 may include an arbitrator 2310. The arbitrator 2310 may be coupled between the multiple processor cores and the accelerator engine. Since the accelerator module 2300 is shared by multiple processor cores, the arbitrator 2310 of the accelerator module 2300 may arbitrate the object instructions received from the multiple processor cores to allocate them to the target accelerator engine in the accelerator engine, thereby improving the allocation and utilization efficiency of computing resources in the accelerator module. After the object instruction is allocated to the target accelerator engine by the arbitrator 2310, it can be executed in the target accelerator engine. If an object instruction arbitration is unsuccessful, the corresponding processor core may wait until the object instruction can be allocated to a suitable accelerator engine by the arbitrator 2310.
[0083] The accelerator module 2300 may include a plurality of accelerator engines 2321, 2322, ..., 232m, where m is a natural number greater than 0. The number and type of accelerator engines included in the accelerator module 2300 may be flexibly configured according to the use requirements of the processor. For a description of the accelerator engine, please refer to Figure 1A The description is not repeated here.
[0084] The accelerator module 2300 may include a memory interface 2350 independent of the plurality of processor cores to access the memory. The accelerator module 2300 may complete the address conversion from the virtual address to the physical address independently of the plurality of processor cores. The memory interface 2350 may be coupled to the accelerator engines 2321, 2322, ..., 232m and include a TLB 2351. The TLB 2351 may be shared by the accelerator engines 2321, 2322, ..., 232m.
[0085] When the corresponding accelerator engine needs to access a certain virtual address, the accelerator engine can first check whether the mapping information of the address already exists in the TLB. If it exists (i.e., a hit), the accelerator engine can directly use the physical address in the TLB to access the memory. For specific details about the page table entries in TLB2351, please refer to the following about Figure 5 Description.
[0086] The accelerator module 2300 may include a PTW router 2340. When a TLB miss occurs, the PTW in the processor core to which the accelerator engine is bound may be used to complete the page table access. In this case, an independent PTW may not be configured in the accelerator module 2300. For example, the corresponding accelerator engine may access the page table in the memory through the PTW router 2340 to obtain the physical address corresponding to the virtual address. When the processor core dispatches an instruction to the accelerator module, the process ID of the current process and the processor core ID of the current processor core in the core cluster may be carried in the dispatched instruction. The corresponding accelerator engine may use the PTW router 2340 when a TLB miss occurs and search for the PTW in the corresponding processor core according to the processor core ID, thereby obtaining the required page table entry.
[0087] The memory interface 2350 may include an optional PTW 2352. The accelerator module 2300 may use the PTW 2352 to independently complete the access to the page table without accessing the PTW in the processor core. For example, when the accelerator module 2300 includes an independent PTW 2352, when a TLB miss occurs, the accelerator engine may access the page table in the memory through the PTW 2352 to obtain the physical address corresponding to the virtual address. By independently configuring the PTW 2352 for the accelerator module 2300, the connection required for the PTW router 2340 to access the processor core may be omitted. Therefore, the size of the processor 2000 may be reduced.
[0088] In at least one embodiment, the accelerator module 2300 may include an optional data cache 2360. For example, when the accelerator module 2300 needs to improve memory access performance, the optional data cache 2360 may be configured. When an independent data cache 2360 is not required, the accelerator module 2300 may directly interface to the third-level cache L3$ shared by multiple cores in the core cluster through the memory interface 2350.
[0089] The accelerator module 2300 may include a completion module 2330. The completion module 2330 may mark the corresponding instruction in the reorder buffer ROB as completed. The completion module 2330 may also send the execution result of the corresponding instruction to the corresponding completion module in the completion modules 2017, 2027, ..., 20n7. The details of the data interaction between the accelerator module 2300 and the processor core may refer to the following description. Figure 3 .
[0090] Figure 3 is a schematic diagram of data interaction between a processor core and an accelerator module according to at least one embodiment of the present disclosure.
[0091] Figure 4 is a schematic diagram of a MOP according to at least one embodiment of the present disclosure.
[0092] like Figure 3 As shown, the processor core 3100 can exchange data with the accelerator module 3200. The accelerator module 3200 may include an arbitrator 3210 and accelerator engines 3221, 3222, ..., 322m. For a detailed description of the processor core, accelerator module, arbitrator, and accelerator engine, please refer to Figure 1A and Figure 2 The description in will not be repeated here.
[0093] The processor core 3100 may send handshake and status signals to the accelerator module 3200, and may receive handshake and status signals from the accelerator module 3200. The handshake and status signals may include valid, ready, busy, etc. The handshake and status signals may coordinate and synchronize the operations between the processor core 3100 and the accelerator module 3200 to ensure the correctness and security of data transmission and improve the reliability and correctness of data transmission.
[0094] The processor core 3100 may send a load unloading instruction to the accelerator module 3200. The load unloading instruction may include an instruction code and operands required for the instruction execution. The processor core 3100 may receive a load unloading response from the accelerator module 3200. The load unloading response may include an instruction execution state and an optional instruction execution result. For example, the accelerator module 3200 may return the processing result of the object instruction to the corresponding processor core, and the execution result message of the object instruction may include the execution result of the object instruction. For another example, the accelerator module 3200 may also store the processing result of the object instruction in a memory coupled to a plurality of processor cores, and the execution result message of the object instruction may include the storage address of the execution result of the object instruction in the memory. The instruction execution state may indicate whether the object instruction is executed successfully or whether there is an exception that needs to be processed.
[0095] From the perspective of ISA, all instructions sent by the processor core 3100 to the accelerator module 3200 can be split into one or more MOPs at the decoding stage. Figure 4 Describes one or more MOPs.
[0096] Figure 4 The object instruction in requires four instruction parameters, for example, param1, param2, param3, param4. The processor core may use four general purpose registers (GRP) including registers R1, R2, R3, and R4 to cache the four instruction parameters param1-param4 respectively. The instructions "mov R1, param1", "mov R2, param2", "mov R3, param3", and "mov R4, param4" may be the first class of instructions dispatched to the processor core pipeline, so that the processor core caches the four instruction parameters param1-param4 to the four general purpose registers R1-R4.
[0097] The object instruction "acc_offload R1" dispatched to the accelerator module can be used to call the acceleration function of the accelerator module. The object instruction "acc_offload R1" can be divided into four MOPs including MOP1, MOP2, MOP3 and optional MOP4. MOP1 and MOP2 can be read and fill MOPs. The read and fill MOP can be used to read object instruction parameters and fill operands. For example, the read and fill MOP can move 4 instruction parameters in the GPR to the load unloading buffer of the accelerator module. MOP3 can be a load unloading MOP. The load unloading MOP can send a workload to the accelerator engine that executes one or more MOPs to start the accelerator engine. Optional MOP4 can be a read response MOP. The read response MOP enables the corresponding accelerator engine to return the instruction execution status to the processor core. After the instruction execution is completed, the result obtained by the accelerator can be written to the general register R1 for subsequent use, but the present disclosure is not limited to this, and the result can also be written to other general registers.
[0098] return Figure 3 In one embodiment, when the processor core 3100 and the corresponding accelerator engine in the accelerator module 3200 are in a synchronous operation mode, the processor core 3100 may not send a read response MOP to the accelerator module 3200. The accelerator engine may return an execution status to the corresponding processor core 3100 in response to the completion of execution of the target instruction in the accelerator module.
[0099] In another embodiment, when the processor core 3100 and the corresponding accelerator engine in the accelerator module 3200 are in an asynchronous operation mode, the processor core 3100 may send a read response MOP to the accelerator module 3200. The read response MOP may synchronize the processor core 3100 with the corresponding accelerator engine and process the abnormal state returned by the corresponding accelerator engine. For example, if an exception occurs when the object instruction is executed in the accelerator module 3200, the accelerator module 3200 may save the abnormal state internally. When the read response MOP is executed, the abnormal state may be reported to the processor core 3100. In response to receiving the abnormal state sent by the accelerator module 3200, the processor core 3100 may jump into the exception handling program. After the exception handling is completed, the entire accelerator instruction (including all split MOPs) may be re-executed. When the read response MOP is re-executed, the instruction execution result may be correctly executed and submitted.
[0100] Figure 5 It is a schematic diagram of a method for an accelerator engine to access a TLB and a PTW router according to at least one embodiment of the present disclosure.
[0101] In order to improve the utilization efficiency of the TLB in the accelerator module, the entire accelerator module adopts a centralized TLB 520. That is, all TLB entries in TLB 520 can be dynamically shared and allocated among multiple accelerator engines 511-51m. Each TLB entry may include
[0102] Each TLB entry in TLB 520 may include a processor core ID, a process ID, and a virtual page number VPN. The processor core ID may identify the processor core to which the current TLB entry belongs among multiple processor cores. The process ID may identify the process to which the current TLB entry belongs. In one embodiment, the process ID may be an address space identifier ASID in the TLB entry for identifying which virtual address space the TLB entry belongs to. VPN may refer to a virtual address page table index number in the TLB entry of the processor.
[0103] When the processor core dispatches instructions to the accelerator engines 511-51m in the accelerator module, the dispatched instructions may carry the process ID of the current process and the processor core ID of the current processor core in the core cluster. When the corresponding accelerator engine needs to access a certain virtual address, the accelerator engine may first check whether the TLB entry in the TLB 520 already has mapping information for the address based on the process ID and the processor core ID. If it exists (i.e., a hit), the accelerator engine may directly use the physical address in the TLB 520 to access the memory.
[0104] When a TLB miss occurs, the corresponding accelerator engine can use the PTW router 530 and search for the PTW in the corresponding processor core (eg, the PTW of the processor core 541 - the processor core 54 n ) according to the processor core ID, thereby obtaining the required page table entry.
[0105] There is no fixed correspondence between the accelerator engines 511-51m in the accelerator module and the processor cores 541-processor cores 54n in the core cluster. The accelerator module may include m accelerator engines 511-51m. Since these accelerator engines are independent of each other and have concurrent memory access requirements, the TLB 520 also needs to provide m read and write ports accordingly. Since each of the m accelerator engines 511-51m may receive an object instruction sent from each of the n processor cores 541-processor cores 54n, when a TLB miss occurs, a PTW router 530 is needed to find the PTW connection path of the corresponding processor core.
[0106] Figure 66 is a schematic diagram of the operation of the processor core on the TLB and optional data cache in the accelerator module according to at least one embodiment of the present disclosure. For details about the processor cores 611-61n, at least one accelerator engine 620, the memory interface 630, the TLB 631, the PTW 632, the optional data cache 640 and the L3$, please refer to Figure 2 The detailed description in will not be repeated here.
[0107] In the case where the accelerator module and the processor core are in a synchronous execution relationship, the control of the TLB 631 and the optional data cache 640 in the accelerator module needs to be synchronized with the corresponding processor core. The TLB 631 and the optional data cache 640 in the accelerator module need to be managed and controlled by the corresponding processor core.
[0108] Each of the plurality of processor cores 611-61n may send a TLB entry operation instruction to the accelerator module. When the TLB entry operation instruction is executed, the accelerator module may perform one or more of the following operations: invalidate all TLB entries, invalidate TLB entries with a specific process ID, invalidate TLB entries with a specific process ID and a specific VPN, invalidate TLB entries with a specific processor core ID, invalidate TLB entries with a specific processor core ID and a specific process ID, and invalidate TLB entries with a specific processor core ID, a specific process ID, and a specific VPN.
[0109] In the case where the accelerator module includes an optional data cache 640, each of the plurality of processor cores 611-61n may also send a cache operation instruction to the accelerator module. The cache operation instruction, when executed, may cause the accelerator module to perform one or more of the following operations: invalidate all cache lines in the data cache; invalidate one or more cache lines in the data cache; flush all cache lines in the data cache; and flush one or more cache lines in the data cache.
[0110] Figure 7 is a schematic structural diagram of an accelerator module according to at least one embodiment of the present disclosure. Figure 7 The accelerator module 7000 in Figure 2 The same components will not be described again.
[0111] Figure 7The accelerator module 7000 may also include accelerator engines 7200 and 7300, but the present disclosure is not limited thereto, and the accelerator module 7000 may include more accelerator engines. The structure of the accelerator engine may be similar. For example, the accelerator engine 7200 may include a control register 7210, an acquisition front end 7220, back end execution modules 7230 and 7240, a completion module 7250, and a memory interface arbitrator 7260.
[0112] The control register 7210 can store reference Figure 6 For example, the memory core can configure the behavior of the accelerator engines 7200, 7300, etc. by reading and writing the control register 7210. These parameters are configured using reference Figure 4 The MOP1 and MOP2 split by the "acc_offload R1" instruction are sent to the accelerator engine.
[0113] The acquisition front-end module 7220 can decode the object instruction received from the arbitrator 7100 and dispatch it to one or more back-end execution modules for execution. In the accelerator engine, since multiple back-end execution modules may have concurrent memory access requirements, the accelerator module 7000 includes a memory interface arbitrator 7260 to arbitrate the memory access requests of multiple back-end execution modules. Figure 3 As shown in the figure, the object instruction can have variable-length instruction parameters, and the object instruction can be split into multiple MOPs by the decoding module of the processor core. This design enables an object instruction to have the ability to describe multiple parallel operations. For example, an object instruction can describe two parallel matrix multiplication and accumulation operations, and these two matrix multiplication and accumulation operations are split into two MOPs in the decoding stage to achieve parallel execution.
[0114] The acquisition front-end module 7220 may include a load offload buffer 7221. The load offload buffer 7221 may store object instruction parameters and operands.
[0115] One or more back-end execution modules 7230, 7240 may execute the object instructions decoded by the fetch front-end module 7220. Figure 7 , two backend execution modules 7230 and 7240 are shown, but the accelerator engine 7200 may include more backend execution modules. The backend execution module 7230 may include a control unit 7231 , a loading unit 7232 , an execution unit 7233 , a storage unit 7234 , and an on-chip buffer (ScratchPad) 7235 .
[0116] The control unit 7231 may execute control flows of instructions and data. The load unit 7232 may read data from a memory or other storage device and prepare the data for use by other functional units (e.g., the execution unit 7233). The execution unit 7233 may perform various arithmetic and logical operations. The storage unit 7234 may write data processed by the execution unit 7233 back to the memory or other storage device. The on-chip buffer 7235 may be a cache area located on the processor for storing temporary data.
[0117] Figure 8 The method for processing instructions according to at least one embodiment of the present disclosure includes steps S802, S804, and S806.
[0118] In step S802, an instruction stream to be executed may be received by a plurality of processor cores, wherein the instruction stream includes a first category of instructions and a second category of instructions different from the first category of instructions.
[0119] In step S804, the first type of instructions in the corresponding instruction stream may be processed by multiple processor cores respectively.
[0120] In step S806, multiple processor cores can respectively dispatch object instructions belonging to the second category of instructions in the instruction stream processed by themselves to the accelerator module for execution, and receive execution result messages of the object instructions from the accelerator module, wherein the accelerator module includes at least one accelerator engine configured to execute the second category of instructions, and the accelerator module is coupled to the multiple processor cores and shared by the multiple processor cores.
[0121] The instruction processing method according to at least one embodiment of the present disclosure may further include dynamically coupling the accelerator module to multiple processor cores, and receiving the same or different object instructions belonging to the second category of instructions from the multiple processor cores.
[0122] The instruction processing method according to at least one embodiment of the present disclosure may further include identifying, by each of the plurality of processor cores, whether the current instruction in the instruction stream is a first-category instruction or a second-category instruction. In response to the current instruction being a first-category instruction, dispatching the current instruction to the pipeline of the processor core itself. In response to the current instruction being a second-category instruction, dispatching the current instruction to the accelerator module through the processor core as an object instruction.
[0123] The instruction processing method according to at least one embodiment of the present disclosure may further include, through each of the plurality of processor cores, causing the object instruction to enter a dispatch queue to wait for dispatch, allocating an entry in the ROB for the object instruction, and in response to the object instruction becoming the oldest instruction in the ROB, dispatching the object instruction to the accelerator module through the processor core.
[0124] The instruction processing method according to at least one embodiment of the present disclosure may further include, through each of the plurality of processor cores, allowing the target instruction to enter a dispatch queue to wait for dispatch, waiting for ROB to be drained, and dispatching the instruction to the accelerator module through the processor core in response to ROB being drained.
[0125] The instruction processing method according to at least one embodiment of the present disclosure may further include returning the processing result of the object instruction to the corresponding processor core through the accelerator module, and the execution result message of the object instruction includes the execution result of the object instruction. Alternatively or additionally, the processing result of the object instruction may be stored in a memory coupled to the plurality of processor cores through the accelerator module, and the execution result message of the object instruction includes the storage address of the execution result of the object instruction in the memory.
[0126] According to at least one embodiment of the present disclosure, the instruction processing method may also include acquiring instructions through an instruction fetch module of each processor core in a plurality of processor cores; decoding the acquired instructions into one or more micro-operations MOPs through a decoding module of the processor core; and dispatching one or more MOPs to a processor core pipeline or an accelerator module through a dispatch module of the processor core.
[0127] According to at least one embodiment of the present disclosure, the instruction processing method may further include reading instruction parameters and filling operands through an accelerator module and using a read and fill MOP in one or more MOPs, and sending a workload to an accelerator engine that executes one or more MOPs through an accelerator module and using a load unloading MOP in one or more MOPs.
[0128] According to at least one embodiment of the present disclosure, the instruction processing method may further include, in response to the accelerator engine and the corresponding processor core being in a synchronous operation mode, in response to the completion of execution of the object instruction in the accelerator module, returning the execution status to the corresponding processor core through the accelerator module.
[0129] The instruction processing method according to at least one embodiment of the present disclosure may further include, through the accelerator module, using a read response MOP in one or more MOPs to enable at least one accelerator engine to return an execution status to a corresponding processor core.
[0130] According to at least one embodiment of the present disclosure, the instruction processing method may further include arbitrating object instructions received from multiple processor cores and allocating them to a target accelerator engine in at least one accelerator engine through an arbitrator coupled between multiple processor cores and at least one accelerator engine of the accelerator module.
[0131] The instruction processing method according to at least one embodiment of the present disclosure may further include enabling at least one accelerator engine to share a TLB included in a memory interface of the accelerator module.
[0132] The instruction processing method according to at least one embodiment of the present disclosure may also include sending a TLB entry operation instruction to an accelerator module through each of a plurality of processor cores, so that the accelerator module executes the TLB entry operation instruction to perform one or more of the following operations: invalidate all TLB entries, invalidate TLB entries with a specific process ID, invalidate TLB entries with a specific process ID and a specific virtual page number (VPN), invalidate TLB entries with a specific processor core ID, invalidate TLB entries with a specific processor core ID and a specific process ID, and invalidate TLB entries with a specific processor core ID, a specific process ID, and a specific VPN.
[0133] The instruction processing method according to at least one embodiment of the present disclosure may also include sending a cache operation instruction to an accelerator module through each of a plurality of processor cores, and executing the cache operation instruction through the accelerator module to perform one or more of the following operations: invalidating all cache lines in the data cache; invalidating one or more cache lines in the data cache; refreshing all cache lines in the data cache; and refreshing one or more cache lines in the data cache.
[0134] The instruction processing method according to at least one embodiment of the present disclosure may further include storing the TLB entry operation instruction and the cache operation instruction through a control register of at least one accelerator engine.
[0135] The instruction processing method according to at least one embodiment of the present disclosure may further include completing, by the accelerator module, a page table access using an independent PTW included in the accelerator module in response to a miss of the at least one accelerator engine with respect to the TLB.
[0136] According to at least one embodiment of the present disclosure, the instruction processing method may further include, in response to a TLB miss occurring in at least one accelerator engine, accessing the PTW in the corresponding processor core based on the processor core ID included in the object instruction through the accelerator module using a PTW router included in the accelerator module to complete the page table access.
[0137] According to at least one embodiment of the present disclosure, the instruction processing method may further include decoding an object instruction received from an arbitrator through an acquisition front-end module included in each of at least one accelerator engines; executing the object instruction decoded by the acquisition front-end module through one or more back-end execution modules included in the accelerator engine; arbitrating memory access requests of one or more back-end execution modules through a memory interface arbitrator module included in the accelerator engine; and submitting the processing results of the object instruction through a completion unit module included in the accelerator engine.
[0138] The instruction processing method according to at least one embodiment of the present disclosure may further include storing object instruction parameters and operands by acquiring a load offloading buffer included in the front-end module.
[0139] Fig. 9 An electronic device including a processor according to at least one embodiment of the present disclosure.
[0140] like Fig. 9 As shown, the electronic device 900 includes a processor 910 and a memory 920. The memory 920 includes one or more computer program modules 921. The one or more computer program modules 921 are stored in the memory 920 and can be configured to be read and executed by the processor 910.
[0141] The memory 920 and the processor 910 may be interconnected via a bus system and / or other forms of connection mechanisms (not shown). For example, the bus may be a peripheral component interconnect standard (PCI) bus or an extended industrial standard architecture (EISA) bus, etc. The communication bus may be divided into an address bus, a data bus, a control bus, etc.
[0142] The processor 910 may include the Figure 1A-Figure 7 Exemplarily, the electronic device may include a central processing unit (CPU), a digital signal processor (DSP), a graphics processing unit (GPU), or other forms of processing units with data processing capabilities and / or program execution capabilities, such as a field programmable gate array (FPGA), etc. The processor 910 may be a general-purpose processor or a dedicated processor, and may control other components in the electronic device 900 to perform desired functions.
[0143] Exemplarily, the memory 920 may include any combination of one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache, etc. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, erasable programmable read-only memory (EPROM), portable compact disk read-only memory (CD-ROM), USB memory, flash memory, etc. One or more computer program modules 921 may be stored on the computer-readable storage medium, and the processor 910 may run one or more computer program modules 921 to implement various functions of the electronic device 900. Various applications and various data, as well as various data used and / or generated by the application, etc. may also be stored in the computer-readable storage medium.
[0144] For example, the electronic device 900 may also include input devices such as cameras, touch screens, touch pads, keyboards, mice, webcams, microphones, accelerometers, gyroscopes, etc.; output devices such as liquid crystal displays, speakers, vibrators, etc.; storage devices such as magnetic tapes, hard disks (HDD or SDD), etc.; and communication devices such as network interface cards such as LAN cards, modems, etc. The communication device may allow the electronic device 900 to communicate with other devices wirelessly or wired to exchange data, and perform communication processing via a network such as the Internet. The drive is connected to the I / O interface as needed. Removable storage media, such as magnetic disks, optical disks, magneto-optical disks, semiconductor memories, etc., are installed on the drive as needed so that the computer program read therefrom is installed into the storage device as needed.
[0145] For example, the electronic device 900 may further include a peripheral interface (not shown in the figure), etc. The peripheral interface may be various types of interfaces, such as a USB interface, a lightning interface, etc. The communication device may communicate with a network and other devices through wireless communication, such as the Internet, an intranet and / or a wireless network such as a cellular phone network, a wireless local area network (LAN), and / or a metropolitan area network (MAN). Wireless communication may use any of a variety of communication standards, protocols, and technologies, including, but not limited to, Global System for Mobile Communications (GSM), Enhanced Data GSM Environment (EDGE), Wideband Code Division Multiple Access (W-CDMA), Code Division Multiple Access (CDMA), Time Division Multiple Access (TDMA), Bluetooth, Wi-Fi (e.g., based on IEEE 802.11a, IEEE 802.11b, IEEE 802.11g, and / or IEEE 802.11n standards), Voice over Internet Protocol (VoIP), Wi-MAX, protocols for email, instant messaging, and / or Short Message Service (SMS), or any other suitable communication protocol.
[0146] The electronic device 900 may be, for example, a system on a chip (SOC) or a device including the SOC, for example, a mobile phone, a tablet computer, a laptop computer, an e-book, a game console, a television, a digital photo frame, a navigator, a home appliance, a communication base station, an industrial controller, a server, or any other device, or a combination of any data processing device and hardware, which is not limited by the embodiments of the present disclosure. The specific functions and technical effects of the electronic device 900 may refer to the above description of the processor and its additional aspects according to at least one embodiment of the present disclosure, which will not be repeated here.
[0147] The processor according to the present disclosure may not implement the accelerator module for a specific accelerator function. The accelerator module is characterized by having independent memory access capabilities, and can automatically load data, process data, and write back data. Workloads that meet these characteristics can accelerate the computing load of the processor core by implementing a corresponding accelerator engine. The processor according to the present disclosure can improve the configuration flexibility of the accelerator engine within the processor core cluster and between processor cores, while improving the use efficiency of the processor accelerator engine.
[0148] The text and drawings in this disclosure are provided as examples only to help understand the present disclosure. They should not be interpreted as limiting the scope of the present disclosure in any way. Although certain embodiments and examples have been provided, based on the contents disclosed herein, it is clear to those skilled in the art that the embodiments and examples shown may be changed without departing from the scope of the present disclosure.
[0149] Although the present disclosure has been described with exemplary embodiments, various changes and modifications may be suggested to one skilled in the art. The present disclosure is intended to encompass such changes and modifications as fall within the scope of the appended claims.
[0150] Any description in this disclosure should not be construed as implying that any particular element, step, or function is an essential element that must be included in the claims scope. The scope of the patented subject matter is limited solely by the claims.
Claims
1. A processor, comprising: a plurality of processor cores, wherein each of the plurality of processor cores is configured to execute a first class of instructions; an accelerator module, wherein the accelerator module comprises at least one accelerator engine configured to execute a second type of instructions different from the first type of instructions; The accelerator module is coupled to and shared by the multiple processor cores, and the multiple processor cores respectively dispatch object instructions belonging to the second category of instructions in the instruction stream processed by themselves to the accelerator module for execution and receive execution result messages of the object instructions from the accelerator module.
2. The processor of claim 1, wherein: The accelerator module is dynamically coupled to the plurality of processor cores and receives the same or different object instructions belonging to the second category of instructions from the plurality of processor cores.
3. The processor according to claim 1, wherein: Each of the plurality of processor cores is further configured to: identifying whether a current instruction in the instruction stream is an instruction of the first category or an instruction of the second category, In response to the current instruction being the first type of instruction, dispatching the current instruction to its own pipeline, and In response to the current instruction being the second-category instruction, dispatching the current instruction to the accelerator module as the target instruction.
4. The processor according to claim 1, wherein: Each of the plurality of processor cores is further configured to: The object instruction is put into a dispatch queue to wait for dispatch, allocating an entry in a reorder buffer for the target instruction, and In response to the target instruction becoming the oldest instruction in the reorder buffer, dispatching the target instruction to the accelerator module.
5. The processor according to claim 1, wherein: Each of the plurality of processor cores is further configured to: The object instruction is put into a dispatch queue to wait for dispatch, Waiting for the reorder buffer to drain, and In response to the reorder buffer being drained, the target instruction is dispatched to the accelerator module.
6. The processor of claim 1, wherein: The accelerator module is further configured to return a processing result of the object instruction to the corresponding processor core, and the execution result message of the object instruction includes the execution result of the object instruction; or The accelerator module is further configured to store the processing result of the object instruction in a memory coupled to the multiple processor cores, and the execution result message of the object instruction includes a storage address of the execution result of the object instruction in the memory.
7. The processor according to claim 1, wherein: Each processor core of the plurality of processor cores comprises: an instruction fetch module, configured to fetch instructions; a decode module configured to decode the fetched instruction into one or more micro-operations; and The dispatch module is configured to dispatch the one or more micro-operations to the processor core pipeline or the accelerator module.
8. The processor according to claim 7, wherein: The one or more micro-operations include: Read and fill micro-operations, which are used to read instruction parameters and fill operands, A load offloading micro-operation is used to send a workload to an accelerator engine that executes the one or more micro-operations.
9. The processor of claim 1, wherein: In response to the accelerator engine and the corresponding processor core being in a synchronous operation mode, the accelerator module is configured to return an execution status to the corresponding processor core in response to completion of execution of the target instruction in the accelerator module.
10. The processor of claim 8, wherein: The one or more micro-operations also include: The read response micro-operation is used to cause the at least one accelerator engine to return an execution status to a corresponding processor core.
11. The processor of claim 1, wherein: The accelerator module also includes: An arbitrator is coupled between the plurality of processor cores and at least one accelerator engine and is configured to arbitrate the object instructions received from the plurality of processor cores to allocate to a target accelerator engine among the at least one accelerator engine.
12. The processor of claim 1, wherein: The accelerator module also includes: a memory interface coupled to the at least one accelerator engine and comprising a translation lookaside buffer, Wherein, the at least one accelerator engine shares the translation lookaside buffer.
13. The processor of claim 12, wherein: The translation lookaside buffer comprises one or more translation lookaside buffer entries, Each of the one or more translation lookaside buffer entries includes a processor core identity, and the processor core identity is used to identify a processor core to which the current translation lookaside buffer entry belongs among the plurality of processor cores.
14. The processor of claim 13, wherein: Each of the one or more translation lookaside buffer entries further comprises: Process ID, used to identify the process to which the current translation lookaside buffer entry belongs.
15. The processor of claim 14, wherein: Each of the plurality of processor cores is further configured to send a translation lookaside buffer entry operation instruction to the accelerator module, the translation lookaside buffer entry operation instruction, when executed, causing the accelerator module to perform one or more of the following operations: Invalidate all translation lookaside buffer entries; Invalidate the translation lookaside buffer entry with a specific process ID; Invalidate the translation lookaside buffer entry with a specific process ID and a specific virtual page number; Invalidate the translation lookaside buffer entry with a specific processor core identity; invalidating a translation lookaside buffer entry having a specific processor core identity and a specific process identity; and Invalidate a translation lookaside buffer entry having a specific processor core identity, a specific process identity, and a specific virtual page number.
16. The processor of claim 15, wherein: The accelerator module also includes a data cache, and Each of the plurality of processor cores is further configured to send a cache operation instruction to the accelerator module, and when the cache operation instruction is executed, the accelerator module performs one or more of the following operations: invalidating all cache lines in the data cache; invalidating one or more cache lines in the data cache; Refreshing all cache lines in the data cache; and One or more cache lines in the data cache are refreshed.
17. The processor of claim 16, wherein: The at least one accelerator engine comprises a control register, The control register is configured to store the translation lookaside buffer entry operation instruction and the cache operation instruction.
18. The processor of claim 1, wherein: The accelerator module also includes a page table walker independent of the plurality of processor cores. The accelerator module is further configured to: in response to a miss of the at least one accelerator engine with respect to the translation lookaside buffer, use the independent page table walker to complete a page table access.
19. The processor of claim 1, wherein: The accelerator module further includes a page table walker router connected to at least a portion of the plurality of processor cores, the object instruction further includes a processor core identity, The accelerator module is further configured to: in response to a miss of the at least one accelerator engine for the translation lookaside buffer, use the page table walker router to access the page table walker in the corresponding processor core based on the processor core identity to complete the page table access.
20. The processor of claim 11, wherein: Each of the at least one accelerator engine comprises: acquiring a front-end module configured to decode the object instruction received from the arbitrator; One or more backend execution modules, configured to execute the object instructions decoded by the acquisition front-end module; A memory interface arbitrator module, arbitrating memory access requests of the one or more backend execution modules; The completion unit module is configured to submit the processing result of the object instruction.
21. The processor of claim 20, wherein: The acquisition front-end module includes a load offload buffer configured to store object instruction parameters and operands.
22. An electronic device comprising a processor according to any one of claims 1-21.
23. A method for processing an instruction, comprising: Receiving, through a plurality of processor cores, an instruction stream to be executed, wherein the instruction stream includes a first category of instructions and a second category of instructions different from the first category of instructions; The plurality of processor cores respectively process the first type of instructions in the corresponding instruction streams; and The multiple processor cores respectively dispatch object instructions belonging to the second category of instructions in the instruction stream processed by themselves to the accelerator module for execution, and receive execution result messages of the object instructions from the accelerator module, The accelerator module includes at least one accelerator engine configured to execute the second type of instructions, and the accelerator module is coupled to the multiple processor cores and shared by the multiple processor cores.
Citation Information
Patent Citations
Extensible 2.5-dimensional multi-core processor architecture
CN104008084A
Off-chip accelerator applicable to fusion memory of 2.5D (2.5 dimensional) multi-core system
CN104035896A
Apparatus and method for accelerating operations in processor which uses shared virtual memory
CN104204990A
Processor and method for making processor operate
CN105975405A
Multi-core neural network processor chip of RISC-V architecture
CN114239806A
Cited By
Processor, instruction processing method, and electronic device comprising processor
WO2026051272A1
