Electronic device with power saving mechanism and instruction access method thereof

By dividing the cyclic instructions into two parts that can be stored and cannot be stored in the buffer circuit, the power consumption problem during the access of cyclic instructions in the prior art is solved, and efficient command acquisition and execution during the cyclic process is achieved, achieving power saving effect .

CN119065715APending Publication Date: 2024-12-03REALTEK SEMICON CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310650833.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-02
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

When existing electronic devices process instruction access to memory, it is difficult to effectively save power, especially when there are too many cyclic instructions, which leads to the buffer control circuit that needs to frequently obtain instructions from the instruction source, increasing power consumption.

Method used

The cyclic instructions are divided into the first part that meets the storage amount of the instruction buffer circuit and the second part that exceeds the storage amount. Only the first part is stored in the instruction buffer circuit. During the cycle, the buffer control circuit obtains the first part of the instructions from the instruction buffer circuit. , and obtain the second part of the instructions from the instruction source to reduce unnecessary storage and repeated acquisition.

Benefits of technology

Through this method, power consumption is reduced, instruction access efficiency is improved, and the buffer control circuit frequently obtains instructions from the instruction source when the storage amount is insufficient, achieving the purpose of power saving.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119065715A_ABST
    Figure CN119065715A_ABST
Patent Text Reader

Abstract

The invention discloses an instruction access method with a power saving mechanism. The method comprises the following steps: controlling a cache control circuit to acquire a plurality of instructions from an instruction source for execution; the judgment instruction comprises a plurality of loop instructions corresponding to a loop process, and each loop instruction comprises a first part conforming to the storage capacity of the instruction buffer circuit and a second part exceeding the storage capacity; controlling the cache control circuit to store a first part of the loop instruction to the instruction buffer circuit, and not to store a second part of the loop instruction to the instruction buffer circuit; and in each loop process, controlling the cache control circuit to acquire the first part of the loop instruction from the instruction buffer circuit for execution and acquire the second part of the loop instruction from the instruction source for execution.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to instruction access technology, and more particularly to an electronic device with a power saving mechanism and an instruction access method thereof. Background Art

[0002] Electronic devices use processing circuits to access and calculate instructions and data from connected memories to achieve the desired processing results. In recent years, the demand for power saving in various electronic devices has increased. When processing circuits access instructions from memories, they often need more efficient access methods to achieve the purpose of power saving. Summary of the invention

[0003] In view of the problems in the prior art, an object of the present invention is to provide an electronic device with a power saving mechanism and an instruction access method thereof to improve the prior art.

[0004] The present invention includes an instruction access method with a power saving mechanism, comprising: controlling a cache control circuit to obtain multiple instructions from an instruction source for execution; determining that the instruction includes multiple loop instructions corresponding to a loop process, wherein the loop instruction includes a first part that meets the storage capacity of the instruction buffer circuit and a second part that exceeds the storage capacity; controlling the cache control circuit to store the first part of the loop instruction to the instruction buffer circuit and not to store the second part of the loop instruction to the instruction buffer circuit; and in each loop process, controlling the cache control circuit to obtain the first part of the loop instruction from the instruction buffer circuit for execution, and to obtain the second part of the loop instruction from the instruction source for execution.

[0005] The present invention also includes an electronic device with a power saving mechanism, including: a cache control circuit, an instruction buffer circuit and a processing circuit. The processing circuit is configured to: control the cache control circuit to obtain multiple instructions from an instruction source for execution; determine whether the instruction includes multiple loop instructions corresponding to a loop process, wherein the loop instruction includes a first part that meets the storage capacity of the instruction buffer circuit and a second part that exceeds the storage capacity; control the cache control circuit to store the first part of the loop instruction to the instruction buffer circuit, and not to store the second part of the loop instruction to the instruction buffer circuit; and in each loop process, control the cache control circuit to obtain the first part of the loop instruction from the instruction buffer circuit for execution, and obtain the second part of the loop instruction from the instruction source for execution.

[0006] The features, implementation and effects of this solution are described in detail below with reference to the accompanying drawings as a preferred embodiment. BRIEF DESCRIPTION OF THE DRAWINGS

[0007] Figure 1 A block diagram showing an electronic device with a power saving mechanism according to an embodiment of the present invention;

[0008] Figure 2 A schematic diagram showing instructions fetched by a cache control circuit according to an embodiment of the present invention; and

[0009] Figure 3 A flow chart of an instruction access method with a power saving mechanism according to an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0010] Figure 1 The purpose of the present invention is to provide an electronic device with a power saving mechanism and an instruction access method thereof, by dividing a loop instruction into a first part that meets the storage capacity of an instruction buffer circuit and a second part that exceeds the storage capacity of the instruction buffer circuit, so that only the first part is stored in the instruction buffer circuit, so that during the loop process, the first part of the loop instruction is obtained from the instruction buffer circuit for execution, and the second part of the loop instruction is obtained from the instruction source for execution, thereby achieving the purpose of power saving.

[0011] Please refer to Figure 1 . Figure 1 A block diagram of an electronic device 100 with a power saving mechanism according to an embodiment of the present invention is shown. The electronic device 100 comprises a cache control circuit 110 , an instruction buffer circuit 120 and a processing circuit 130 .

[0012] In one embodiment, the processing circuit 130 is a core of a central processing unit and is electrically coupled to the cache control circuit 110 to control the cache control circuit 110 to obtain instructions CM from an instruction source for execution. The instruction source may be, for example but not limited to, a system bus 140, a cache circuit 150, a memory circuit 160 or a combination thereof that the electronic device 100 also includes.

[0013] The processing circuit 130 determines that the instruction CM includes a plurality of loop instructions corresponding to a loop process, wherein the loop instruction includes a first portion that matches the storage capacity of the instruction buffer circuit 120 and a second portion that exceeds the storage capacity.

[0014] Please also refer to Figure 2 . Figure 2 A schematic diagram showing instructions CM fetched by the cache control circuit 110 according to an embodiment of the present invention.

[0015] In one embodiment, the instructions CM obtained by the cache control circuit 110 include individual instructions labeled IN(1)-IN(n+2) respectively, so as to be executed sequentially by the processing circuit 130. Here, n is a positive integer.

[0016] The processing circuit 130 determines that the currently executed instruction in the instruction CM includes a branch request corresponding to a previous instruction, and further determines that the instructions from the previous instruction to the current instruction are loop instructions CL.

[0017] For example, when the processing circuit 130 executes instruction IN(n) and determines that instruction IN(n) includes a branch request corresponding to instruction IN(3), it further determines that the instructions from instruction IN(3) to instruction IN(n) are loop instructions CL. These loop instructions CL correspond to a loop process, which is repeatedly executed multiple times by the processing circuit 130. More specifically, the processing circuit 130 executes multiple loop processes and sequentially executes instructions IN(3) to instruction IN(n) in each loop process.

[0018] In one embodiment, the instruction buffer circuit 120 is a register including a plurality of D-type flip-flops and is configured to temporarily store at least part of the loop instructions CL. Since the storage capacity of the instruction buffer circuit 120 is limited, when the number of loop instructions CL is greater than the storage capacity of the instruction buffer circuit 120, all loop instructions CL cannot be stored.

[0019] Therefore, the processing circuit 130 calculates the branch jump distance from the previous instruction to the current instruction, wherein the branch jump distance is equal to the number of the loop instructions CL. In the above example, the processing circuit 130 calculates the branch jump distance from instruction IN(3) to instruction IN(n) as n-3+1=n-2.

[0020] Furthermore, the processing circuit 130 controls the cache control circuit 110 to determine the first part P1 and the second part P2 of the loop instruction CL according to the branch jump distance and the storage capacity of the instruction buffer circuit 120. The first part P1 is the part of the loop instruction CL that matches the storage capacity of the instruction buffer circuit 120, and the second part P2 is the part of the loop instruction CL that exceeds the storage capacity of the instruction buffer circuit 120.

[0021] by Figure 2 For example, when the storage capacity of the instruction buffer circuit 120 can only store m loop instructions, instructions IN(3) to IN(m+2) will correspond to the first part P1 of the loop instruction CL, and instructions IN(m+3) to IN(n) will correspond to the second part P2 of the loop instruction CL, where m is a positive integer less than n.

[0022] The processing circuit 130 controls the cache control circuit 110 to store the first part P1 of the loop instruction CL into the instruction buffer circuit 120 , and does not store the second part P2 of the loop instruction CL into the instruction buffer circuit 120 .

[0023] Furthermore, during each loop process, the processing circuit 130 controls the cache control circuit 110 to obtain the first part P1 of the loop instruction CL from the instruction buffer circuit 120 for execution, and to obtain the second part P2 of the loop instruction CL from the instruction source for execution.

[0024] More specifically, when the processing circuit 130 executes the instructions IN(3) to IN(n), only the first pass controls the cache control circuit 110 to directly obtain the instructions IN(3) to IN(n) from the instruction source (i.e., the system bus 140, the cache circuit 150, the memory circuit 160, or a combination thereof) for execution. In each subsequent loop of repeated execution, the processing circuit 130 controls the cache control circuit 110 to obtain the instructions IN(3) to IN(m+2) (corresponding to the first part P1 of the loop instruction CL) from the instruction buffer circuit 120 for execution, without obtaining the instructions from the original instruction sources of these instructions. In addition, the processing circuit 130 controls the cache control circuit 110 to obtain the instructions IN(m+3) to IN(n) from the instruction source (corresponding to the second part P2 of the loop instruction CL) for execution.

[0025] It should be noted that when the number of loop instructions CL is less than the storage capacity of the instruction buffer circuit 120, the instruction buffer circuit 120 will be sufficient to store all loop instructions CL. Therefore, the loop instruction CL will only include the first part P1, and the second part P2 will not exist. In this case, the processing circuit 130 can store all loop instructions CL in the instruction buffer circuit 120, and control the cache control circuit 110 to obtain the loop instruction CL from the instruction buffer circuit 120 for execution in each loop process.

[0026] The original purpose of setting up the instruction buffer circuit is to provide temporary storage for loop instructions so that the processing circuit can quickly access them when executing the loop process without having to access them from the original instruction source, thereby achieving the purpose of power saving. However, in some technologies, the processing circuit controls the cache control circuit to directly write all loop instructions into the instruction buffer circuit. When the storage capacity of the instruction buffer circuit is insufficient to temporarily store all loop instructions, the cache control circuit will continuously write loop instructions that exceed the storage capacity and overwrite the loop instructions already stored in the instruction buffer circuit. When the loop process is executed again, the cache control circuit will not be able to find the correct loop instruction in the instruction buffer circuit, and must access it from the original instruction source of the loop instruction. This method will not achieve the purpose of power saving.

[0027] Therefore, the electronic device with a power saving mechanism of the present invention can divide the loop instruction into a first part that meets the storage capacity of the instruction buffer circuit and a second part that exceeds the storage capacity of the instruction buffer circuit, so as to store only the first part in the instruction buffer circuit, obtain the first part of the loop instruction from the instruction buffer circuit for execution during the loop process, and obtain the second part of the loop instruction from the instruction source for execution, thereby achieving the purpose of power saving.

[0028] Please refer to Figure 3 . Figure 3 A flowchart of an instruction access method 300 with a power saving mechanism according to an embodiment of the present invention is shown.

[0029] In addition to the aforementioned apparatus, the present invention further discloses an instruction access method 300 with a power saving mechanism, which is applied to, for example, but not limited to Figure 1 The instruction access method 300 may be implemented in the electronic device 100, and may be implemented, for example but not limited to, by executing a stored application program by the processing circuit 130 of the electronic device 100. Figure 3 As shown, the following steps are included.

[0030] In step S310 , the processing circuit 130 controls the cache control circuit 110 to obtain a plurality of instructions CM from an instruction source for execution.

[0031] In step S320 , the processing circuit 130 determines whether the instruction CM includes a plurality of loop instructions corresponding to a loop process, wherein the loop instruction includes a first portion that matches the storage capacity of the instruction buffer circuit 120 and a second portion that exceeds the storage capacity.

[0032] In step S330 , the processing circuit 130 controls the cache control circuit 110 to store the first part P1 of the loop instruction CL into the instruction buffer circuit 120 , and does not store the second part P2 of the loop instruction CL into the instruction buffer circuit 120 .

[0033] In step S340 , the processing circuit 130 controls the cache control circuit 110 to obtain the first part P1 of the loop instruction CL from the instruction buffer circuit 120 for execution, and to obtain the second part P2 of the loop instruction CL from the instruction source for execution during each loop process.

[0034] It should be noted that the above embodiments are only examples. In other embodiments, those skilled in the art may make modifications without departing from the spirit of the present invention.

[0035] In summary, the electronic device with a power saving mechanism and the instruction access method thereof in the present invention divide the loop instruction into a first part that meets the storage capacity of the instruction buffer circuit and a second part that exceeds the storage capacity of the instruction buffer circuit, so as to store only the first part in the instruction buffer circuit, so as to obtain the first part of the loop instruction from the instruction buffer circuit for execution during the loop process, and obtain the second part of the loop instruction from the instruction source for execution, thereby achieving the purpose of power saving.

[0036] Although the embodiments of the present application are described above, these embodiments are not intended to limit the present application. Those skilled in the art may make changes to the technical features of the present application based on the explicit or implicit contents of the present application. All these changes may fall within the scope of patent protection sought by the present application. In other words, the scope of patent protection of the present application shall be subject to the scope of the patent application defined in this specification.

[0037] Description of Reference Numerals

[0038] 100: Electronic devices

[0039] 110: Cache control circuit

[0040] 120: instruction buffer circuit

[0041] 130: Processing circuit

[0042] 140: System bus

[0043] 150: Cache circuit

[0044] 160: memory circuit

[0045] 300: Instruction access method

[0046] S310~S340: Steps

[0047] CL: loop instruction

[0048] CM: Command

[0049] IN(1)~IN(n+2): instruction

[0050] P1: Part 1

[0051] P2: Part 2

Claims

1. An instruction access method with a power saving mechanism, comprising: Controlling the cache control circuit to obtain a plurality of instructions from an instruction source for execution; Determining that the plurality of instructions include a plurality of loop instructions corresponding to a loop process, wherein the plurality of loop instructions include a first portion that matches a storage capacity of an instruction buffer circuit and a second portion that exceeds the storage capacity; Controlling the cache control circuit to store a first portion of the plurality of loop instructions in the instruction buffer circuit, and not to store a second portion of the plurality of loop instructions in the instruction buffer circuit; as well as In each loop process, the cache control circuit is controlled to obtain a first part of the plurality of loop instructions from the instruction buffer circuit for execution, and to obtain a second part of the plurality of loop instructions from the instruction source for execution.

2. The instruction access method according to claim 1, wherein the instruction source is a system bus, a cache circuit, a memory circuit or a combination thereof.

3. The instruction access method according to claim 1, wherein the instruction buffer circuit is a register including a plurality of D-type flip-flops.

4. The instruction access method according to claim 1, further comprising: It is determined that a current instruction executed among the plurality of instructions includes a branch request corresponding to a previous instruction, and it is further determined that a plurality of instructions from the previous instruction to the current instruction are the plurality of loop instructions.

5. The instruction access method according to claim 4, further comprising: Calculating a branch jump distance from the previous instruction to the current instruction; and The cache control circuit is controlled to determine the first part and the second part of the plurality of loop instructions according to the branch jump distance and the storage capacity of the instruction buffer circuit.

6. An electronic device with a power saving mechanism, comprising: Cache control circuit; instruction buffer circuit; and A processing circuit configured to: Controlling the cache control circuit to obtain a plurality of instructions from an instruction source for execution; determining that the plurality of instructions include a plurality of loop instructions corresponding to a loop process, wherein the plurality of loop instructions include a first portion that matches a storage capacity of the instruction buffer circuit and a second portion that exceeds the storage capacity; Controlling the cache control circuit to store a first portion of the plurality of loop instructions in the instruction buffer circuit, and not to store a second portion of the plurality of loop instructions in the instruction buffer circuit; as well as In each loop process, the cache control circuit is controlled to obtain a first part of the plurality of loop instructions from the instruction buffer circuit for execution, and to obtain a second part of the plurality of loop instructions from the instruction source for execution. 7 . The electronic device as claimed in claim 6 , wherein the instruction source is a system bus, a cache circuit, a memory circuit or a combination thereof included in the electronic device. 8 . The electronic device as claimed in claim 6 , wherein the instruction buffer circuit is a register including a plurality of D-type flip-flops.

9. The electronic device as claimed in claim 6, wherein the processing circuit is further configured to: It is determined that a current instruction executed among the plurality of instructions includes a branch request corresponding to a previous instruction, and it is further determined that a plurality of instructions from the previous instruction to the current instruction are the plurality of loop instructions.

10. The electronic device as claimed in claim 9, wherein the processing circuit is further configured to: Calculating a branch jump distance from the previous instruction to the current instruction; and The cache control circuit is controlled to determine the first part and the second part of the plurality of loop instructions according to the branch jump distance and the storage capacity of the instruction buffer circuit.