A fast environment switching method to improve chip design module performance
By providing multiple sets of configuration and status registers in the chip design and using the microcontroller for environment switching, the problem of performance loss caused by reading and writing registers one by one is solved, and efficient task switching and performance improvement are achieved.
Patent Information
- Application Number
- CN202110788502.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-13
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2041-07-13
AI Technical Summary
In chip design, especially in the design of high-performance IP cores such as video codecs, the traditional method of reading and writing registers one by one leads to a performance loss of up to 10% when switching environments. Due to the increase in the number of configuration and status registers, the efficiency of fast task switching is low. .
By providing at least two sets of configuration and status registers in the chip design, and using the microcontroller to write the register values in the memory, triggering environment switching, avoiding reading and writing registers one by one, and achieving continuous execution.
It effectively reduces performance loss and improves task switching efficiency, especially in frequent environment switching scenarios, such as video codecs, achieving nearly 100% performance utilization.
Smart Images

Figure CN113626078B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of rapid task switching, and in particular to a rapid environment switching method for improving the performance of a chip design module. Background Art
[0002] In existing chip designs, especially in high-performance IP cores such as video codec designs, in order to maximize the reusability of the design and support for legacy technical standards and formats, IP cores support many modes. As the number of modes supported by IP designs increases, the number of configuration and status registers of the IP core also increases significantly. At the same time, due to the advancement of semiconductor technology, the performance of the IP core itself has also been improved, and more task data can be processed per unit time. The time-sharing multiplexing of data streams of different tasks in the same IP core has brought great performance improvement and flexibility to system design, but it also brings more configuration and status register read and write cycles. In existing video codec applications, since each frame of image encoding and decoding requires environment switching, the traditional on-chip central processing unit (CPU) method of reading and writing registers one by one will result in up to 10% performance loss. Summary of the invention
[0003] The embodiment of the present invention provides a fast environment switching method for improving the performance of a chip design module, so as to solve the technical problem of performance loss caused by reading and writing registers one by one during the existing fast task switching process.
[0004] The present disclosure provides a method for fast environment switching to improve the performance of a chip design module, including:
[0005] Write the target register values into the memory in sequence;
[0006] Provide at least two sets of configuration and status registers;
[0007] After writing the target register value into the memory, triggering writing the register value of the memory into the first group of configuration and status registers;
[0008] After completing the writing of the set of configuration and status registers, switching the execution environment of the IP core to the set of configuration and status registers; and
[0009] Before the next context switch, the second set of configuration and status registers are written based on the register values of the next set of memories.
[0010] In some embodiments, the method further includes: performing a cyclic context switching between the at least two groups of configuration and status registers by switching a switch.
[0011] In some embodiments, the switching switch is triggered by an execution task completion event of the IP core.
[0012] In some embodiments, parameters of at least two sets of configuration and status registers are identical.
[0013] The present disclosure also provides a task fast switching device, including:
[0014] At least two sets of configuration and status registers;
[0015] A processor configured to sequentially write target register values into a memory;
[0016] A microcontroller configured to trigger writing of register values of the memory into a first set of configuration and status registers after writing the target register values into the memory;
[0017] A switch configured to switch the execution environment of the IP core to the set of configuration and status registers after completing writing of the set of configuration and status registers; and
[0018] The microcontroller is further configured to write a second set of configuration and status registers based on register values of the next set of memories before the next context switch.
[0019] In some embodiments, the switch is further configured to perform cyclic context switching between the at least two groups of configuration and status registers.
[0020] In some embodiments, the switching switch is triggered by an execution task completion event of the IP core.
[0021] In some embodiments, parameters of at least two sets of configuration and status registers are identical.
[0022] The embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the aforementioned task fast switching method are implemented.
[0023] The embodiment of the present invention uses at least two groups of configuration and status registers, so that the writing of configuration and status registers can be completed before the next environment switch, thereby eliminating the need to read and write registers one by one, achieving continuous execution of tasks, and reducing performance loss.
[0024] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0026] Figure 1 The present invention provides a technical comparison between the disclosed method and the existing solutions.
[0027] Figure 2 The basic flow chart of the disclosed method.
[0028] Figure 3 It is a basic framework structure diagram of the device disclosed in the present invention. DETAILED DESCRIPTION
[0029] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0030] like Figure 1 As shown, in the traditional IP core environment switching, the on-chip central processing unit will calculate the required configuration and status register values according to the next task that the IP core needs to complete, and wait for the completion of the current task. After the current task is completed, the central processing unit will write the values into the registers of the IP core one by one, and start the IP core to execute the task again. When the processor reads and writes the IP core registers, the IP core itself is in an idle state. If the number of IP core registers is large, the idle period will be very long, thereby affecting the performance during the environment switching process. The disclosed embodiment proposes a fast environment switching method to improve the performance of a chip design module, such as Figure 2As shown, the target register value can be written into the memory in sequence in step S201. That is, in this example, the target register value can be written into the memory by the processor, and the subsequent memory can be written directly after the current memory is written. In order to solve the low efficiency of the central processing unit reading and writing one by one in the traditional method, a microcontroller can be integrated inside the IP core in this example, so that the central processing unit can write the register value into a chip memory (such as static random access memory) or an off-chip memory (such as dynamic random access memory) of a continuous address. The IP core in this example can be an intellectual property module, and the IP core can be a chip design circuit module for realizing a specified function, which can be developed by the inventor or obtained from a third party. In this example, at least two groups of configuration and status registers are provided in step S202, that is, at least two groups of configuration and status registers are set for the IP core in this example. Then in step S203, after the target register value is written into a group of memory, the register value of the memory is triggered to be written into the first group of configuration and status registers. In this example, the register value of the memory can be controlled to be written into the first group of configuration and status registers by triggering the microcontroller. After completing the writing of the group of configuration and status registers in step S204, the execution environment of the IP core is switched to the group of configuration and status registers. Thus, the IP core can execute tasks according to the data in the current first group of configuration and status registers. And before the next environment switch in step S205, the second group of configuration and status registers are written based on the register values in the next group of memories. In this example, the change and storage of configuration and status registers can be called the environment switch of the IP core. During the process of the IP core executing the task, the second group of configuration and status registers is in an idle state and will not be executed by the IP core. Therefore, at this time, the microcontroller can also be used to control the writing of the stored values of the next group of memories into the second group of configuration and status registers. Thus, when the IP core executes the next task, Figure 1 As shown, the IP core execution environment can be switched to the second set of configuration and status registers, thereby effectively avoiding the read delay of the on-chip or off-chip memory and the delay of the IP core internal microcontroller configuration, which will still cause performance loss during the environment switching process.
[0031] In some embodiments, the parameters of at least two groups of configuration and status registers are the same, that is, at least two groups of configuration and status registers with completely identical parameters can be configured.
[0032] In some embodiments, it also includes: performing cyclic environment switching between the at least two groups of configuration and status registers by switching switches. Exemplarily, the switching between at least two groups of configuration and status registers can be performed by switching switches. For example, it can be switched from the first group of configuration and status registers to the second group of configuration and status registers, ..., the Nth group of configuration and status registers, and then switched to the first group of configuration and status registers. Of course, this is just a switching implementation method. In the specific implementation process, the IP core can be switched to the corresponding configuration and status registers by the switching switch to perform the task. As an exemplary case, for example, in the case of including two groups of configuration and status registers, the "ping-pong" operation can be achieved by switching switches, thereby effectively reducing the circuit cost. The method of the present invention is particularly suitable for scenes such as video encoding and decoding that require frequent environment switching. The method of the present invention can realize fast environment switching of video codecs. Since the register value required for the next task has been written in the next configuration and status register before each switch, seamless connection can be achieved after switching, thereby greatly reducing performance loss and greatly improving the performance of encoding and decoding.
[0033] In some embodiments, the switch is triggered by an event that the IP core completes the task execution. That is, when the IP core completes the task execution of the current configuration and status registers, the switch is triggered to select the second set of configuration and status registers. As an exemplary switch control, the two-choice selector can complete the switch in one clock cycle, so the performance loss required for the environment switch can be almost ignored, achieving nearly 100% performance utilization.
[0034] The disclosed embodiment uses at least two groups of configuration and status registers, so that the configuration and status registers can be written before the next environment switch, eliminating the need to read and write registers one by one, perfectly achieving continuous execution of tasks and reducing performance loss.
[0035] The disclosed embodiment also provides a task fast switching device, such as Figure 3 As shown, it includes: at least two groups of configuration and status registers; a processor configured to write target register values into a memory in sequence; a microcontroller configured to trigger writing the register values of the group of memories into the first group of configuration and status registers after writing the target register values into a memory; a switch configured to switch the execution environment of the IP core to the group of configuration and status registers after completing the writing of the group of configuration and status registers; and the microcontroller is further configured to write the second group of configuration and status registers based on the register values of the next group of memories before the next environment switch. Figure 3As shown, the on-chip memory may include several memories, which are connected to the processor through an interface, and the processor may sequentially write the target register value into a memory. A microcontroller is connected to the on-chip memory, which is configured to trigger the register value of the memory to be written into a group of configuration and status registers after the target register value is written into the memory. In some embodiments, the switching switch is also configured to perform cyclic environment switching between the at least two groups of configuration and status registers. For example, for a situation including two groups of configuration and status registers, the switching switch can realize switching back and forth between the two groups of configuration and status registers by controlling a two-choice selector. As an exemplary switching switch control, the two-choice selector can complete the switching in one clock cycle, so the performance loss required for environment switching can be almost ignored, so that the IP core can achieve close to 100% performance utilization.
[0036] In some embodiments, the parameters of at least two groups of configuration and status registers are the same. In some embodiments, the switch is triggered by an execution task completion event of the IP core.
[0037] The embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the aforementioned task fast switching method are implemented.
[0038] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0039] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0040] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), including a number of instructions for a terminal (which can be a mobile phone, computer, server or network equipment, etc.) to execute the methods described in each embodiment of the present invention.
[0041] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.
Claims
1. A fast environment switching method for improving the performance of a chip design module, characterized in that: include: Write the target register values into the memory in sequence; Provide at least two sets of configuration and status registers; After writing the target register value into the memory, triggering writing the register value of the memory into the first group of configuration and status registers; After completing the writing of the group of configuration and status registers, switch the execution environment of the IP core to the group of configuration and status registers; as well as Before the next context switch, write the second group of configuration and status registers based on the register values of the next group of memories; Cyclic context switching is performed between the at least two sets of configuration and status registers by switching switches.
2. The fast environment switching method according to claim 1, characterized in that: The switching switch is triggered by an execution task completion event of the IP core.
3. The fast environment switching method according to claim 1, characterized in that: At least two sets of configuration and status registers have the same parameters.
4. A task fast switching device, characterized in that: include: At least two sets of configuration and status registers; A processor configured to sequentially write target register values into a memory; A microcontroller configured to trigger writing of register values of the memory into a first set of configuration and status registers after writing the target register values into the memory; A switch configured to switch the execution environment of the IP core to the set of configuration and status registers after completing writing of the set of configuration and status registers; as well as The microcontroller is further configured to write a second set of configuration and status registers based on register values of the next set of memories before the next context switch; The switch is further configured to perform cyclic context switching between the at least two groups of configuration and status registers.
5. The task fast switching device according to claim 4, characterized in that: The switching switch is triggered by an execution task completion event of the IP core.
6. The task fast switching device according to claim 4, characterized in that: At least two sets of configuration and status registers have the same parameters.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the task fast switching method according to any one of claims 1 to 3 are implemented.
