Template-based method for improving efficiency of CPU (Central Processing Unit) configuration accelerator

By configuring multiple mode registers and module configuration technology in the SoC system, the problem of excessive CPU configuration accelerator instruction cycle and too long configuration time is solved, and the accelerator is quickly initialized and working mode switching is realized, which improves the working efficiency of the CPU.

CN119621354AInactive Publication Date: 2025-03-14ZHONGYIN MICROELECTRONICS NANJING CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510162452.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-14
Publication Date
2025-03-14
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the current SoC system, the CPU configuration accelerator has too many instruction cycles, resulting in too long configuration time and reducing the CPU's working efficiency.

Method used

By configuring multiple mode registers in the accelerator, different configuration operations are generated according to the CPU's working mode, and parallel or serial configuration is carried out through module configuration technology, reducing the configuration workload of the CPU.

Benefits of technology

It realizes the accelerator to quickly enter the working state, reduces the initialization time, and supports the rapid switching of different working modes of the accelerator, improving the working efficiency of the CPU.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119621354A_ABST
    Figure CN119621354A_ABST
Patent Text Reader

Abstract

The invention aims to provide a method for improving the efficiency of a CPU (Central Processing Unit) configuration accelerator based on a template. The method comprises the following steps: acquiring a working mode of CPU configuration; configuring a module of the accelerator according to the working mode configured by the CPU; and checking whether the module of the accelerator is configured. Through a module configuration technology, the configuration workload of a CPU (Central Processing Unit) can be reduced, the software participation degree can be reduced, logic is generated in the accelerator to quickly configure an internal register, so that the accelerator quickly enters a working state, the initialization time is shortened in an initialization stage, and quick switching of different working modes of the accelerator can be realized in a normal working stage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method for improving the efficiency of a CPU configuration accelerator based on a template. Background Art

[0002] At present, SoC has become the most feature-rich hardware, integrating various functional modules such as CPU, GPU, RAM, ADC, DAC, Modem, high-speed DSP, etc. Some SoCs also integrate power management modules and control modules of various external devices. At the same time, it is also necessary to consider the distribution and utilization of various buses. ‌‌CPU is the core component of the computer, responsible for interpreting and executing instructions, performing calculations and logical operations, and is the calculation core and control core of the computer. ‌‌CPU, or Central Processing Unit, is the core component of the computer, responsible for interpreting and executing computer instructions and processing data in the software. It is the calculation core and control core of the computer. All operations in the computer are read by the CPU, translated and encoded, and executed. The design of the CPU enables the computer to perform various complex tasks, from simple calculations to advanced graphics processing and multitasking. The main function of the CPU is to perform calculations and logical operations. It controls the execution order of the program by executing instructions, generates operation signals to control hardware operations, performs time control on various operations, and performs arithmetic and logical operations on data.

[0003] The accelerator is an important tool for realizing CPU function offloading and improving the working efficiency of the SOC system. The accelerator is divided into several large modules, each of which contains a configuration space. The configuration space offset addresses of different modules are different, and the common configuration of the entire accelerator is placed in the COMMON configuration space; therefore, the configuration sent by the CPU is configured in different modules and COMMON configuration space respectively after passing through the decoding module. In order to make the accelerator work in a certain working mode, the CPU needs to configure a large number of registers of the accelerator.

[0004] The current SOC architecture includes the CPU and various accelerators. The accelerator accelerates the work by offloading the CPU's tasks, and the CPU exchanges data with each accelerator through the RING bus. In order for each accelerator to work properly, the CPU needs to configure the accelerator initialization during initialization. During normal operation, the CPU needs to configure a large number of registers according to the different working modes of the accelerator. Since the CPU configuration requires software participation, the configuration time of the accelerator will take up a large number of CPU working cycles, reducing the CPU work efficiency. Summary of the invention

[0005] The purpose of the present invention is to provide a template-based method for improving the efficiency of CPU configuration accelerator. The method can reduce the configuration workload of the CPU and reduce the software involvement through module configuration technology. The accelerator generates logic inside to quickly configure internal registers, so that the accelerator can quickly enter the working state, the initialization time can be reduced in the initialization stage, and the accelerator can achieve fast switching of different working modes in the normal working stage.

[0006] A method for improving CPU configuration accelerator efficiency based on a template, comprising: Get the working mode of CPU configuration; Configure a module of the accelerator according to the working mode configured by the CPU; Verify that the accelerator module is configured.

[0007] Preferably, before obtaining the working mode of the CPU configuration, the method further includes: configuring multiple mode registers in the accelerator; A mode register includes an operating mode of the CPU.

[0008] Preferably, the working mode of obtaining the CPU configuration includes: Determine whether the CPU is configured to work in real mode, protected mode, or long mode.

[0009] Preferably, the module for configuring the accelerator according to the working mode configured by the CPU includes: Generate configuration operations for each module of the configuration accelerator through the Template_Gen module; Different modules are configured in parallel, and identical modules are configured in series.

[0010] Preferably, the step of checking whether the configuration of the modules of the accelerator is complete includes: The accelerator returns a configuration completion signal after the Template_Gen module configuration is completed; The CPU obtains the configuration completion signal through polling or interruption.

[0011] Preferably, the configuration operation of generating each module of the configuration accelerator through the Template_Gen module includes: Select a configuration template based on the working mode of the CPU configuration; Set the template parameters according to the type of accelerator module.

[0012] Preferably, the CPU obtaining the configuration completion signal by polling or interruption includes: In the polling mode, the CPU continuously checks whether the accelerator has completed configuration; In the interrupt mode, the CPU obtains an interrupt signal from the accelerator and checks whether the accelerator has completed configuration.

[0013] A system for improving CPU configuration accelerator efficiency based on a template, comprising: A data acquisition module is used to obtain the working mode of the CPU configuration; A data processing module, used to configure an accelerator module according to the working mode configured by the CPU; The verification module is used to verify whether the accelerator module configuration is complete.

[0014] An electronic device comprises: a chip, a processor and a memory, wherein the memory is used to store computer program code, the computer program code comprises computer instructions, and when the chip executes the computer instructions, the electronic device executes a template-based method for improving the efficiency of a CPU configuration accelerator.

[0015] A computer-readable storage medium stores a computer program, wherein the computer program includes program instructions. When the program instructions are executed by a processor of an electronic device, the processor executes a template-based method for improving the efficiency of a CPU configuration accelerator.

[0016] The beneficial effects of the present invention are: 1. The present invention adds a number of configuration mode registers, which can generate different configuration operations according to different working modes of the CPU, thereby solving the problem of too many CPU configuration accelerator instruction cycles and too long configuration time; 2. The present invention generates different configuration operations for each module of the accelerator, and different modules can be configured in parallel, while the same modules can be configured in series, so that the accelerator can enter the working state faster, the initialization time can be reduced, and the fast switching of different working modes of the accelerator can be realized during the normal working stage. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0018] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0019] Figure 1 A flow chart of a method for improving CPU configuration accelerator efficiency based on templates of the present invention; Figure 2A schematic diagram of a register configuration structure generated based on a template of the present invention; Figure 3 A schematic diagram of the structure of a system for improving the efficiency of CPU configuration accelerator based on templates of the present invention; Figure 4 The figure is a schematic diagram of the hardware structure of an electronic device of the present invention. DETAILED DESCRIPTION

[0020] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0021] It should be noted that all directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of the present invention are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.

[0022] In addition, the descriptions of "first", "second", etc. in the present invention are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.

[0023] The accelerator is an important tool for realizing CPU function offloading and improving the working efficiency of the SOC system. The accelerator is divided into several large modules, each of which contains a configuration space. The configuration space offset addresses of different modules are different, and the common configuration of the entire accelerator is placed in the COMMON configuration space; therefore, the configuration sent by the CPU is configured in different modules and COMMON configuration space respectively after passing through the decoding module. In order to make the accelerator work in a certain working mode, the CPU needs to configure a large number of registers of the accelerator.

[0024] The current SOC architecture includes the CPU and various accelerators. The accelerator accelerates the work by offloading the CPU's tasks, and the CPU exchanges data with each accelerator through the RING bus. In order for each accelerator to work properly, the CPU needs to configure the accelerator initialization during initialization. During normal operation, the CPU needs to configure a large number of registers according to the different working modes of the accelerator. Since the CPU configuration requires software participation, the configuration time of the accelerator will take up a large number of CPU working cycles, reducing the CPU work efficiency.

[0025] The present invention adds several configuration mode registers, which can generate different configuration operations according to different working modes of the CPU, thereby solving the problem of too many CPU configuration accelerator instruction cycles and too long configuration time; the present invention generates different configuration operations for each module of the accelerator, and different modules can be configured in parallel, while the same modules can be configured in series, so that the accelerator can enter the working state faster, reduce the initialization time, and realize fast switching of different working modes of the accelerator during the normal working stage.

[0026] Example 1 A template-based method to improve the efficiency of CPU configuration accelerator, refer to Figure 1 ,include: S100, obtaining the working mode of the CPU configuration; To obtain the working mode of the CPU configuration, you can use the following commands and tools: Use the lscpu command: Display information about the CPU architecture, number of cores, number of threads, CPU frequency, etc. By executing the lscpu command, you can learn about the specific configuration of the CPU in the system, such as CPU model, manufacturer, etc. View the :ml-search[ / proc / cpuinfo] file: You can view information including processor model, cache size, supported instruction set, etc. By viewing the / proc / cpuinfo file, you can get more information about the CPU, so as to have a more comprehensive understanding of the working status of the CPU. Use the :ml-search[mpstat] command: This command can view the working status and load of each CPU core, and display information such as the utilization rate, idle rate, system and user-mode CPU usage of each core. By executing the mpstat command, you can understand the operating status of each CPU core and the overall load of the system. Through them, you can better understand the operation of the system, adjust and optimize the system configuration in time, and improve system performance and stability.

[0027] S200, configuring the accelerator module according to the working mode configured by the CPU; The accelerator modules in the SOC system include GPU, DSP, ISP, multimedia processor, communication baseband processing, positioning module, connection module, security processing module, etc. The accelerator modules in the SOC system are designed to meet specific application requirements: GPU: Mainly used for graphics processing scenarios such as 3D games, providing powerful graphics rendering and computing capabilities. DSP: Mainly used for sensor algorithm processing, such as fast Fourier transform (FFT) and inverse FFT (IFFT) calculations in applications such as radar systems. ISP: Used for image signal processing to improve image quality and processing speed. Multimedia processor: Processes multimedia data such as audio and video to provide high-quality multimedia experience. Communication baseband processing: Supports communication technologies such as 4G LTE to achieve high-speed data transmission and communication. Positioning module: Positioning technologies such as GPS / Beidou are used to determine the geographic location of the device. Connection module: Including wireless connection technologies such as WiFi and Bluetooth to achieve fast connection between devices. Security processing module: Provides system security, including encryption, identity authentication and other functions. These accelerator modules work together to enable the SOC system to adapt to different application scenarios and provide high-efficiency, low-power, secure and scalable solutions.

[0028] S300, checking whether the accelerator module is configured.

[0029] Whether the accelerator module is configured properly can be determined by checking the following steps or conditions: Check the Docker configuration file: For the Docker accelerator, you can check whether the registry-mirrors field in the Docker configuration file (such as / etc / docker / daemon.json) is correctly configured with the accelerator address. If the configuration file contains the accelerator URL and the URL is correct, then the accelerator is considered to be correctly configured. Check the log: Check the Docker log or system log to see if there is any error information about the accelerator configuration. If there is no error information, then the configuration may be successful.

[0030] Through the above steps, it can be comprehensively judged whether the accelerator modules have been correctly configured.

[0031] Preferably, before S100, obtaining the working mode configured by the CPU, the method further includes: configuring multiple mode registers in the accelerator; A mode register is a special register used to record the working status or configuration information of a CPU or a specific hardware module. It usually has a specific purpose, such as recording the current processing mode, interrupt processing status, task status, etc. The value of the mode register can be configured by software or hardware to change its state, thereby affecting the behavior of the CPU or related hardware. For example, in computer architecture, a mode register may be used to define the operating mode of the CPU, such as user mode, system mode, etc., or to configure specific hardware modules to adapt to different working scenarios or requirements. By reading and writing the mode register, the system can dynamically change the state or behavior of the hardware to achieve more flexible and efficient data processing and task execution.

[0032] A mode register includes an operating mode of the CPU.

[0033] The mode register is used to store the address of the instruction currently being executed, as well as to control the execution order of the program and implement program jumps and branches. The mode register, also known as the program counter (PC), is a special register whose core function is to store the address of the next instruction to be executed. By changing the value of the program counter, the execution order of the program can be controlled, and the program jumps and branches can be implemented, thereby ensuring that the computer program can be executed according to the expected logical flow. This mechanism plays a vital role in the computer system and plays a key role in the operation and performance of the computer. In addition, the mode register is also involved in the execution process of instructions, ensuring that the computer can accurately jump to the correct location to continue to execute subsequent instructions, thereby ensuring the correctness and efficiency of the program.

[0034] Configuring mode registers in an accelerator typically involves the following steps: Initialize the DMA transfer control block (TCB) chain in the processor memory. This step is to prepare for data transfer and ensure that the accelerator can correctly access and process the data. Configure FIRA / IIRA control registers. These registers are used to set the specific operating mode and parameters of the accelerator, such as operating mode, interrupt enable / disable, start / suspend / abort of data transfer, etc. Select the operating mode. According to the needs of the accelerator, select the appropriate operating mode, such as register to memory mode, memory to memory mode, etc., which determine how data is transferred between the accelerator and the memory. Enable / disable DMA2D interrupts. As needed, the accelerator can be configured to generate interrupts under specific conditions so that the processor can respond to these interrupts and perform subsequent operations. Start / suspend / abort ongoing data transfer. By configuring the corresponding registers, the start, pause or termination of data transfer can be controlled to meet the requirements of real-time or resource management. In the embodiment of the present invention, corresponding adjustments and optimizations can also be made according to the specific hardware platform and software framework.

[0035] Preferably, S100, obtaining the working mode of the CPU configuration includes: Determine whether the CPU is configured to work in real mode, protected mode, or long mode.

[0036] ‌Real mode‌, also known as real address mode, is a basic working mode of the CPU. In this mode, the CPU does not distinguish the actions of the instructions when executing instructions, and directly executes the real functions of the instructions. At the same time, the address sent to the memory is real, and there is no restriction on any address. The registers in real mode are all 16 bits, such as AX, BX, CX, DX, DI, SI, BP and other general registers, which are used to store data, addresses, and participate in operations; IP is the program pointer register, which always points to the address of the next instruction; SP is the stack pointer register, which always points to the top of the current stack; CS, DS, ES, SS are segment registers, which store the base address of the memory segment; FLAGS is the CPU flag register, which stores the status bits generated by the CPU executing the operation instructions. In real mode, data and instructions are stored in memory, and both obtaining instructions and loading data into registers require access to memory. Protected mode‌, compared with real mode, protected mode adds control and protection mechanisms for memory access. The number of register bits in protected mode is expanded from 16 bits in real mode to 32 bits, which solves the problem of memory addressing space. Each instruction has a different privilege level. Dangerous instructions require higher privileges to execute, protecting the system from the perspective of instruction execution. The introduction of the segmentation model and segment descriptors increases the CPU's control over memory address access permissions, protecting the system from a data perspective.

[0037] Long mode‌ is another working mode of the CPU, the specific details may vary depending on the CPU architecture. Long mode generally provides higher security and performance, and may include more registers and a more complex instruction set to support more advanced applications and operating systems.

[0038] Preferably, reference Figure 3 , S200, the module for configuring the accelerator according to the working mode configured by the CPU includes: S210, generating configuration operations of each module of the configuration accelerator through the Template_Gen module; The Template_Gen module is a text generation framework based on deep learning. It uses neural templates to understand and generate natural language text, aiming to improve the efficiency and quality of natural language processing tasks. In addition, the Template_Gen module is also described as a flexible code generator that can adapt to the needs of different frameworks and can generate code templates that adapt to different frameworks through simple configuration. The design of this module takes into account multiple aspects such as database configuration, JAVA entity field type matching, and custom field configuration, so that it can generate corresponding code or text content according to user needs. The application of the Template_Gen module is not limited to text generation. It can also be used to solve the coupling problem of display and data, and generate documents in a specific format, such as HTML content, through the template engine. The use of the template engine can simplify the process of dynamically generating the final type fragment, so that the interface and data are separated in Web development, and the business code and logic code are separated, thereby improving development efficiency and promoting code reuse. The Template_Gen module provides developers with an efficient and convenient way to handle various text and code generation tasks through its flexible configuration and powerful functions.

[0039] S220, different modules are configured in parallel, and the same modules are configured in series.

[0040] ‌Parallel configuration‌ refers to a configuration in which multiple processors or computers in a computer system perform multiple tasks simultaneously to improve computing efficiency and performance. This configuration can significantly increase the execution speed of tasks and reduce the overall processing time. ‌Parallel configuration can be divided into several types, each suitable for different application scenarios. Symmetric multiprocessing (SMP): In this configuration, multiple processors share memory and other hardware resources to complete computing tasks together. This configuration is suitable for tasks that require a large amount of computing resources, such as scientific computing and big data processing. Massively parallel processing (MPP): In this configuration, multiple computers are connected together through a network, and each computer has its own processor and memory. This configuration is suitable for distributed computing tasks, such as large-scale data analysis. Distributed parallelism: In this configuration, multiple computers are connected together through a network to complete a computing task together. This configuration is suitable for tasks that require high-performance computing, such as machine learning and deep learning.

[0041] Serial configuration is a method of data transmission in which data is transmitted bit by bit, rather than multiple bits at the same time. This method is often used in scenarios that require a simple interface and a lower data transfer rate. Serial configuration involves the use of serial ports. In order to implement serial configuration, some hardware and software support is required. First, you need a serial port, which is the basis for external devices to communicate with the computer. Secondly, you need a serial communication software to transfer data between the computer and the external device. Finally, you need a serial port configuration software, which is a software used to configure the serial port communication settings. The hardware and software of serial configuration work together to ensure the correct transmission and configuration of data.

[0042] Preferably, S300, checking whether the configuration of the accelerator module is complete includes: S310, the accelerator returns a configuration completion signal after the Template_Gen module configuration is completed; S320, the CPU obtains a configuration completion signal through polling or interruption.

[0043] ‌The configuration completion signal returned by the accelerator after the configuration is completed is the click of the Save button or the confirmation prompt. ‌When configuring the accelerator, the user needs to fill in the server address, port, password and other detailed information, and after filling in, complete the configuration process by clicking the Save button or confirming the operation. This step marks the completion of the configuration, and the accelerator will be ready, waiting for the user's activation to start providing acceleration services. In addition, some accelerator software will also display a corresponding prompt message after the configuration is completed, informing the user that the configuration has been successfully completed and is ready to use‌.

[0044] Preferably, S310, generating the configuration operation of each module of the configuration accelerator through the Template_Gen module includes: S311, selecting a configuration template according to the working mode configured by the CPU; A configuration template is a standardized document used to describe and define the configuration parameters of a system, software, or device. It can help administrators quickly set up and deploy systems to ensure consistency and accuracy. Configuration templates can be applied to multiple fields, including but not limited to network settings, security management, system configuration, service configuration, etc. By using predefined configuration templates, administrators can batch import configurations to multiple hardware devices, thereby simplifying and facilitating device configuration. In addition, configuration templates can also be used to improve code writing efficiency and speed up the development process by providing real-time code templates and file templates. In the Windows environment, user configuration templates are a component of group policies that are used to configure specific settings for user accounts, including desktop settings, security settings, etc., to help administrators uniformly manage computers and network resources for all users and ensure that users have the same computer experience. In network management, configuration templates can be used to define network parameters such as WiFi settings, smart QoS, network detection, and cloud backup, as well as security parameters such as ACL rules and firewalls. In software development, configuration templates can help developers quickly generate code and improve programming efficiency. In system management, configuration templates can be used to define system-level parameters such as time zone settings and language settings. In addition, configuration templates can also be used to define service configurations, such as Web server and database server settings, as well as other settings such as log settings and backup strategies. Configuration templates greatly simplify the configuration process of systems, software, or devices by providing predefined configuration parameters and options, improving work efficiency and consistency. Whether it is a network administrator, software developer, or system administrator, they can optimize their workflow by using configuration templates.

[0045] S312, setting parameters of the template according to the type of the accelerator module.

[0046] Configuration template parameters mainly refer to the parameters defined in the configuration file, which are used to control or configure the behavior of a system or application. Configuration template parameters can have different meanings and uses in different contexts. For example, in the configuration of MySQL, configuration template parameters may include specifying the configuration files that the server should use, which contain parameters for optimizing server performance, memory usage, security settings, etc. In the configuration of Nginx, configuration template parameters may include defining the user and user group that Nginx runs, specifying the number of Nginx processes, setting the maximum number of descriptors, etc. These parameters are used to optimize the performance and reliability of Nginx. The setting of configuration template parameters is usually based on a deep understanding of the system or application requirements, as well as considerations of performance, security, availability, etc. By adjusting these parameters, fine-grained control of the system or application can be achieved to meet specific operating environments and business needs.

[0047] Preferably, S320, the CPU obtaining the configuration completion signal by polling or interruption includes: In the polling mode, the CPU continuously checks whether the accelerator has completed configuration; In the interrupt mode, the CPU obtains an interrupt signal from the accelerator and checks whether the accelerator has completed configuration.

[0048] The CPU obtains the configuration completion signal through polling or interruption to ensure that the external device or resource is ready for data exchange or execution of corresponding operations. In the polling mode, the CPU will continuously check whether the external device or resource has completed the configuration. The disadvantage of this method is that it is inefficient because the CPU needs to check continuously, even though the device may not have completed the configuration most of the time. In this mode, the CPU utilization rate is not high, and there is a situation of idling waiting. The interruption mode is when the external device or resource completes the configuration, it sends an interrupt signal to the CPU. After receiving the interrupt signal, the CPU will suspend the current work and process the interrupt request, that is, check whether the configuration is completed. In this way, the CPU can be awakened to handle the interrupt when needed, thereby improving the efficiency and response speed of the system. The interruption mode is considered to be a more efficient interaction mode because it allows the CPU to continue to perform other tasks while waiting for external events to complete. Polling and interruption are two basic ways for the CPU to interact with external devices or resources. Although the polling mode is simple, it is less efficient; although the interruption mode is more complicated, it can significantly improve the response speed and efficiency of the system, especially when processing external events.

[0049] Example 2 A template-based system for improving CPU configuration accelerator efficiency, reference Figure 2 ,include: A data acquisition module is used to obtain the working mode of the CPU configuration; A data processing module, used to configure the accelerator module according to the working mode configured by the CPU; The verification module is used to verify whether the accelerator module configuration is complete.

[0050] Example 3 An electronic device includes: a chip, a processor and a memory, the memory is used to store computer program code, the computer program code includes computer instructions, and when the chip executes the computer instructions, the electronic device executes a template-based method for improving the efficiency of a CPU configuration accelerator.

[0051] refer to Figure 4, the electronic device 2 includes a processor 21, a memory 22, an input device 23, and an output device 24. The processor 21, the memory 22, the input device 23, and the output device 24 are coupled via a connector, and the connector includes various interfaces, transmission lines, or buses, etc., which are not limited in the embodiments of the present invention. It should be understood that in various embodiments of the present invention, coupling refers to mutual connection in a specific manner, including direct connection or indirect connection through other devices, for example, through various interfaces, transmission lines, buses, etc.

[0052] The processor 21 may be one or more graphics processing units (GPUs). When the processor 21 is a GPU, the GPU may be a single-core GPU or a multi-core GPU. Optionally, the processor 21 may be a processor group consisting of multiple GPUs, and the multiple processors are coupled to each other via one or more buses. Optionally, the processor may also be other types of processors, etc., which are not limited in the embodiments of the present invention.

[0053] The memory 22 can be used to store computer program instructions and various computer program codes including program codes for executing the scheme of the present invention. Optionally, the memory includes but is not limited to random access memory (RAM), read-only memory (ROM), erasable programmable read only memory (EPROM), or portable read only memory (CD-ROM), which is used for related instructions and data.

[0054] The input device 23 is used to input data and / or signals, and the output device 24 is used to output data and / or signals. The output device 24 and the input device 23 may be independent devices or an integrated device.

[0055] Example 4 A computer-readable storage medium stores a computer program, wherein the computer program includes program instructions. When the program instructions are executed by a processor of an electronic device, the processor executes a template-based method for improving the efficiency of a CPU configuration accelerator.

[0056] The present invention adds several configuration mode registers, which can generate different configuration operations according to different working modes of the CPU, thereby solving the problem of too many CPU configuration accelerator instruction cycles and too long configuration time; the present invention generates different configuration operations for each module of the accelerator, and different modules can be configured in parallel, while the same modules can be configured in series, so that the accelerator can enter the working state faster, the initialization time can be reduced, and the fast switching of different working modes of the accelerator can be realized in the normal working stage.

[0057] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A method for improving the efficiency of CPU configuration accelerator based on template, characterized in that: include: Get the working mode of CPU configuration; Configure a module of the accelerator according to the working mode configured by the CPU; Verify that the accelerator module is configured.

2. The method for improving CPU configuration accelerator efficiency based on template according to claim 1, characterized in that: Before obtaining the working mode of the CPU configuration, the method further includes: configuring multiple mode registers in the accelerator; A mode register includes an operating mode of the CPU.

3. The method for improving CPU configuration accelerator efficiency based on template according to claim 1, characterized in that: The working mode of obtaining CPU configuration includes: Determine whether the CPU is configured to work in real mode, protected mode, or long mode.

4. The method for improving CPU configuration accelerator efficiency based on template according to claim 1, characterized in that: The module for configuring the accelerator according to the working mode configured by the CPU includes: Generate configuration operations for each module of the configuration accelerator through the Template_Gen module; Different modules are configured in parallel, and identical modules are configured in series.

5. The method for improving CPU configuration accelerator efficiency based on template according to claim 1, characterized in that: The step of checking whether the module of the accelerator is configured completely comprises: The accelerator returns a configuration completion signal after the Template_Gen module configuration is completed; The CPU obtains the configuration completion signal through polling or interruption.

6. The method for improving CPU configuration accelerator efficiency based on template according to claim 4, characterized in that: The configuration operation of generating each module of the configuration accelerator through the Template_Gen module includes: Select a configuration template based on the working mode of the CPU configuration; Set the template parameters according to the type of accelerator module.

7. The method for improving CPU configuration accelerator efficiency based on template according to claim 5, characterized in that: The CPU obtains the configuration completion signal by polling or interruption, including: In the polling mode, the CPU continuously checks whether the accelerator has completed configuration; In the interrupt mode, the CPU obtains an interrupt signal from the accelerator and checks whether the accelerator has completed configuration.

8. A system for improving CPU configuration accelerator efficiency based on templates, characterized in that: include: A data acquisition module is used to obtain the working mode of the CPU configuration; A data processing module, used to configure an accelerator module according to the working mode configured by the CPU; The verification module is used to verify whether the accelerator module configuration is complete.

9. An electronic device, characterized in that: include: A chip, a processor and a memory, wherein the memory is used to store computer program code, the computer program code includes computer instructions, and when the chip executes the computer instructions, the electronic device executes a template-based method for improving the efficiency of a CPU configuration accelerator as described in any one of claims 1 to 6.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which includes program instructions. When the program instructions are executed by a processor of an electronic device, the processor executes a template-based method for improving the efficiency of a CPU configuration accelerator as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Programmable hardware accelerator controller

    CN118278486A

  • Interface signal control method and system based on register

    CN118504477A

  • Scheduling and flow control method based on FEC coding direction

    CN118869153A

  • System-on-chip SoC reset management module automatic generation method

    CN119024942A

  • Automatically configured deep neural network accelerator system and implementation method thereof

    CN119416842A