Threshold voltage adjusting circuit and method and frequency adjusting circuit and method
By designing a circuit for automatically calibrating the threshold voltage, the problem of improper clock frequency adjustment caused by inaccurate threshold voltage settings in the prior art is solved, real-time response to power supply voltage changes and adaptive adjustment of clock frequency are achieved, and the performance and stability of the system are improved.
Patent Information
- Application Number
- CN202510152018.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-11
- Publication Date
- 2025-06-13
AI Technical Summary
In the prior art, the clock frequency adjustment is improperly adjusted due to inaccurate threshold voltage settings, which cannot effectively suppress the negative impact of voltage drop, affecting system performance and stability.
A threshold voltage adjustment circuit is designed, and the voltage comparison module, voltage control module and voltage adjustment module are connected to each other, and the difference between the power supply voltage and the threshold voltage is monitored in real time, and the threshold voltage is automatically calibrated so that it changes in the same direction as the power supply voltage, and the clock frequency is adjusted according to the voltage sag detection signal through the frequency adjustment module.
Adaptive adjustment of threshold voltage is realized, the voltage sag phenomenon is accurately identified, and the clock frequency is adjusted accordingly, effectively suppressing the negative impact of voltage drop, and improving system performance and stability.
Smart Images

Figure CN120143918A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of circuit design, and particularly to a threshold voltage adjustment circuit and method, and a frequency adjustment circuit and method. Background Art
[0002] In high-performance CPU / GPU (Central Processing Unit / Graphics Processing Unit) chips, voltage droop is a problem that cannot be ignored. When the chip is in different load states, instantaneous current changes and parasitic inductance on the package will cause the voltage to drop (V = Ldi / dt). This voltage droop phenomenon will reduce the timing and voltage design margins, and thus have a negative impact on the performance and power consumption of the system. Especially in high-load situations, voltage droop may lead to failure of timing convergence, thereby affecting the stability and reliability of the entire system.
[0003] Currently, the main countermeasure for the voltage droop problem is to reduce the system clock frequency to mitigate the negative impact of voltage droop when it is detected that the power supply voltage drops to a preset threshold voltage. However, in the implementation of this existing solution, since the power supply voltage and clock frequency of the CPU / GPU vary greatly with the load, the threshold voltage of the voltage droop needs to be manually switched each time, which will bring the following problems: First, it is not only time-consuming and laborious, but also prone to inaccurate threshold voltage setting due to human operation errors, which may lead to incorrect judgment of the voltage droop phenomenon, resulting in improper adjustment of the clock frequency; for example, if the threshold voltage is set too high, the clock frequency may not be reduced in time when the voltage droop actually occurs; on the contrary, if the threshold voltage is set too low, it may lead to frequent triggering of frequency reduction, affecting the system performance and limiting the processing ability of the processor under high load; Second, when the load or power supply voltage changes rapidly, it may not be possible to quickly adjust the clock frequency to adapt to the new working conditions, thus unable to effectively suppress the negative impact brought by the voltage droop; this lag response may lead to a decline in system performance, an increase in power consumption, and even may cause problems such as system instability or timing convergence failure. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a threshold voltage adjustment circuit and method, and a frequency adjustment circuit and method to solve the problem of improper clock frequency adjustment caused by inaccurate threshold voltage setting in the prior art.
[0005] In a first aspect, an embodiment of the present invention provides a threshold voltage adjustment circuit, including a voltage comparison module, a voltage control module, and a voltage adjustment module connected in sequence; wherein: The voltage comparison module is configured to compare the current power supply voltage with the current threshold voltage plus a set offset; The voltage control module is configured to generate a voltage control signal according to the comparison result of the voltage comparison module; The voltage adjustment module is configured to adjust the threshold voltage under the control of the voltage control signal so that it changes in the same direction as the current power supply voltage.
[0006] Further, the voltage adjustment module is further configured to: input the adjusted threshold voltage to the voltage comparison module to form a loop; The loop stops the adjustment until the adjusted threshold voltage plus the set offset is equal to the current power supply voltage.
[0007] Further, the voltage comparison module includes: A comparator configured to compare whether the current power supply voltage is higher than the current threshold voltage plus the set offset and output a comparison result signal to the voltage control module.
[0008] Further, the voltage control module includes a conversion unit and an accumulation unit connected in sequence, wherein: The conversion unit is configured to convert the comparison result of the voltage comparison module into a corresponding positive increment, negative increment, or zero increment and output it to the accumulation unit; The accumulation unit is configured to accumulate the output result of the conversion unit this time with the previous accumulation result of the accumulation unit and output it to the voltage adjustment module.
[0009] Further, the conversion unit includes a comparison result converter, a first accumulator, and a first threshold detector connected in sequence, wherein: The comparison result converter is configured to preliminarily convert the comparison result of the voltage comparison module into a corresponding positive increment or negative increment and output it to the first accumulator; The first accumulator is configured to accumulate the output result of the comparison result converter this time with the previous accumulation result of the first accumulator and output it to the first threshold detector; The first threshold detector is configured to compare the accumulation result of the first accumulator with preset positive and negative thresholds; if it is higher than the preset positive threshold, the comparison result of the voltage comparison module is finally converted into the positive increment; if it is lower than the preset negative threshold, the comparison result of the voltage comparison module is finally converted into the negative increment; otherwise, the comparison result of the voltage comparison module is finally converted into a zero increment.
[0010] Further, the accumulation unit includes a second accumulator and a second threshold detector connected in sequence, where: The second accumulator is configured to accumulate the output result of the conversion unit this time with the accumulation result of the second accumulator in the previous time and output it to the second threshold detector; The second threshold detector is configured to output a corresponding overflow value when the output of the second accumulator exceeds the preset positive and negative overflow value ranges; otherwise, output the accumulation result of the second accumulator.
[0011] Further, the accumulation unit further includes: A binary converter, connected to the second threshold detector, for converting the output of the second threshold detector into binary.
[0012] Further, the voltage adjustment module includes a multi-stage voltage source and a multiplexer connected in sequence, where: The multi-stage voltage source is configured to provide multi-stage voltages; The multiplexer is configured to select a corresponding stage of voltage from the multi-stage voltages as the threshold voltage for output under the control of the voltage control signal.
[0013] In a second aspect, an embodiment of the present invention provides a frequency adjustment circuit, including a threshold voltage adjustment circuit, a voltage sag detection module, and a frequency adjustment module as described in the first aspect connected in sequence, where: The voltage sag detection module is configured to compare the current power supply voltage with the threshold voltage output by the threshold voltage adjustment circuit, and output a clock frequency control signal to the frequency adjustment module after determining that a voltage sag has occurred based on the comparison result; The frequency adjustment module is configured to adjust the clock frequency under the control of the frequency control signal to change in the same direction as the current power supply voltage.
[0014] Further, the frequency adjustment module includes a clock source control unit and a frequency locked loop including a clock source and a frequency divider, where: The clock source control unit is configured to control the clock source to adjust the output clock frequency under the control of the frequency control signal to change in the same direction as the current power supply voltage; The frequency divider is used to adjust the division ratio under the control of the frequency control signal, and divide the clock frequency output by the clock source according to the division ratio.
[0015] In a third aspect, an embodiment of the present invention provides a threshold voltage adjustment method, including: Comparing the current power supply voltage with the current threshold voltage plus a set offset; Generating a voltage control signal according to the comparison result; Under the control of the voltage control signal, adjusting the threshold voltage so that it changes in the same direction as the current power supply voltage.
[0016] Further, the method further includes: using the adjusted threshold voltage as the current threshold voltage again, and continuing to execute the step of comparing the current power supply voltage and the threshold voltage; Stopping the adjustment of the threshold voltage until the adjusted threshold voltage plus the set offset is equal to the current power supply voltage.
[0017] Further, comparing the current power supply voltage and the threshold voltage includes: Comparing whether the current power supply voltage is higher than the current threshold voltage plus the set offset, and outputting a comparison result signal.
[0018] Further, generating a voltage control signal according to the comparison result includes: Converting the comparison result into a corresponding positive increment, negative increment or zero increment; Adding the positive increment, negative increment or zero increment obtained by this conversion to the previous second accumulation result to obtain a new second accumulation result, so as to generate a voltage control signal.
[0019] Further, converting the comparison result into a corresponding positive increment, negative increment or zero increment includes: Preliminarily converting the comparison result into a corresponding positive increment or negative increment; Adding the converted positive increment or negative increment to the previous first accumulation result to obtain a new first accumulation result; Comparing the new first accumulation result with a preset positive and negative threshold; if it is higher than the preset positive threshold, finally converting the comparison result into the positive increment; if it is lower than the preset negative threshold, finally converting the comparison result into the negative increment; otherwise, finally converting the comparison result into zero increment.
[0020] Further, adding the positive increment, negative increment or zero increment obtained by this conversion to the previous second accumulation result to obtain a voltage control signal includes: Accumulate the positive increment, negative increment, or zero increment obtained from this conversion with the previous second accumulation result to obtain a new second accumulation result; When the new second accumulation result exceeds the preset positive and negative overflow value range, obtain a voltage control signal based on the corresponding overflow value; otherwise, obtain a voltage control signal based on the new second accumulation result.
[0021] Further, obtaining a voltage control signal based on the corresponding overflow value or the new second accumulation result includes: After converting the corresponding overflow value or the new second accumulation result into binary, obtain a voltage control signal.
[0022] Further, under the control of the voltage control signal, adjusting the threshold voltage includes: Under the control of the voltage control signal, select a corresponding voltage level from the provided multi-level voltages as the threshold voltage.
[0023] In a fourth aspect, an embodiment of the present invention further provides a frequency adjustment method, including: Compare the current power supply voltage and the threshold voltage, and generate a clock frequency control signal after determining that voltage droop has occurred based on the comparison result; Under the control of the frequency control signal, adjust the clock frequency so that it changes in the same direction as the current power supply voltage; Wherein, the threshold voltage is obtained according to the threshold voltage adjustment method described in any one of claims 11-18 above.
[0024] Further, under the control of the frequency control signal, adjusting the clock frequency so that it changes in the same direction as the current power supply voltage includes: Under the control of the frequency control signal: adjust the clock frequency output by the clock source in the frequency locked loop so that it changes in the same direction as the current power supply voltage; adjust the division ratio of the frequency divider in the frequency locked loop so that the frequency divider divides the clock frequency output by the clock source according to the division ratio.
[0025] The technical solution proposed by the embodiment of the present invention can automatically calibrate the threshold voltage by monitoring the difference between the power supply voltage and the threshold voltage in real time, so that it always follows the change of the power supply voltage while maintaining a fixed offset, thereby avoiding the problem of deviation in the setting of the threshold voltage. At the same time, with the accurately set threshold voltage, this solution can accurately identify the voltage droop phenomenon. When it is identified that voltage droop has occurred, the clock frequency can be adjusted accordingly to adapt to the change of the power supply voltage. Description of the Drawings
[0026] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can be obtained based on these drawings.
[0027] Figure 1 FIG. 4 is a schematic structural diagram of a threshold voltage adjustment circuit provided in Embodiment 1 of the present invention; Figure 2 FIG. 5 is a schematic structural diagram of a comparator provided in Embodiment 1 of the present invention; Figure 3 FIG. 6 is a schematic structural diagram of a voltage control module provided in Embodiment 1 of the present invention; Figure 4 FIG. 7 is a schematic structural diagram of a voltage adjustment module provided in Embodiment 1 of the present invention; Figure 5 FIG. 8 is a schematic structural diagram of a specific example of a threshold voltage adjustment circuit provided in Embodiment 1 of the present invention; Figure 6 FIG. 9 is a schematic structural diagram of a frequency adjustment circuit provided in Embodiment 2 of the present invention; Figure 7 FIG. 10 is a schematic diagram of the relationship between the clock frequency and the current power supply voltage provided in Embodiment 2 of the present invention; Figure 8 FIG. 11 is a schematic structural diagram of a frequency adjustment module provided in Embodiment 2 of the present invention; Figure 9 FIG. 12 is a schematic flowchart of a threshold voltage adjustment method provided in Embodiment 3 of the present invention; Figure 10 FIG. 13 is a schematic flowchart of a frequency adjustment method provided in Embodiment 4 of the present invention. Specific Embodiments
[0028] The following will describe the embodiments of the present invention in detail with reference to the accompanying drawings.
[0029] It should be clear that the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.
[0030] Next, the technical solutions of the present invention will be introduced in detail through each embodiment.
[0031] Embodiment 1 This embodiment provides a threshold voltage adjustment circuit, which is applicable to the voltage droop processing scenario in CPU / GPU chips. Refer toFigure 1 , the circuit includes a voltage comparison module 101, a voltage control module 102, and a voltage adjustment module 103 connected in sequence. Among them: The voltage comparison module 101 is used to compare the current power supply voltage with the current threshold voltage plus a set offset; The voltage control module 102 is used to generate a voltage control signal according to the comparison result of the voltage comparison module 101; The voltage adjustment module 103 is used to adjust the threshold voltage under the control of the voltage control signal so that it changes in the same direction as the current power supply voltage.
[0032] As a preferred embodiment, the voltage adjustment module 103 is further used to: input the adjusted threshold voltage into the voltage comparison module 101 to form a loop. The loop stops adjusting until the adjusted threshold voltage plus the set offset is equal to the current power supply voltage. In this preferred method, the condition for the loop to stop adjusting is that the threshold voltage is close to the power supply voltage and maintains a certain offset from the power supply voltage to prevent over-adjustment or unstable states. Moreover, the adjustment of the threshold voltage in this way can be gradual and progressive, thereby effectively smoothing noise and short-term interference, preventing overshoot and undershoot of the threshold voltage, and reducing misjudgment of the voltage droop phenomenon.
[0033] The following elaborates in detail each component module of the threshold voltage adjustment circuit in this embodiment.
[0034] 1. Voltage comparison module 101 The comparison objects of the voltage comparison module 101 are, one is the current power supply voltage, and the other is the sum of the current threshold voltage and the set offset. The output represents the comparison result of the two comparison objects, such as the relative magnitude relationship (higher than, equal to, or lower than), or the difference. Among them, the current power supply voltage is the working voltage of the system where it is located, specifically, it can be the current working voltage of the CPU / GPU chip.
[0035] Preferably, this module includes a comparator for comparing whether the current power supply voltage is higher than the current threshold voltage plus the set offset and outputting a comparison result signal to the voltage control module 102. For example, if the current power supply voltage is higher than the current threshold voltage plus the set offset, the comparison result is 1 and a high-level signal is output; otherwise, the comparison result is 0 and a low-level signal is output.
[0036] See Figure 2 , in the specific structure of the comparator, the input terminal INP inputs the current power supply voltage V INP , the input terminal INN inputs the current threshold voltage V INN , V INP >V INN+offset, Comp_out outputs a high-level signal; V INP <=V INN +offset, Comp_out outputs a low-level signal. Specifically, the input pair transistors in the comparator pre-amplify the input signal, other field-effect transistors provide bias current for the input pair transistors, and two resistors implement the source degeneration function to enhance the linearity of the comparator. Offset is specifically the programmable offset that can be set programmably.
[0037] 2. Voltage control module 102 The voltage control module 102 generates a corresponding voltage control signal according to the comparison result of the voltage comparison module 101, which is used to further control the adjustment of the threshold voltage so that the threshold voltage can change in the same direction as the current power supply voltage.
[0038] Specifically in implementation, when the comparison result indicates that the current power supply voltage is higher than the current threshold voltage plus the set offset, the voltage control module 102 generates a positive increment to increase the current threshold voltage; when the comparison result indicates that the current power supply voltage is lower than the current threshold voltage plus the set offset, the voltage control module 102 generates a negative increment to decrease the current threshold voltage. When the comparison result indicates that the current power supply voltage is equal to the current threshold voltage plus the set offset, the voltage control module 102 generates a zero increment and the current threshold voltage remains unchanged.
[0039] Among them, the positive increment is a positive value, which is used to increase the current threshold voltage so that the new threshold voltage is close to the current higher power supply voltage. If this positive increment is directly used to control the threshold voltage, then the value of the positive increment is less than or equal to: V DD_SE -(V REF +offset), and it can be specifically set by those skilled in the art according to experience. In this embodiment: V DD_SE is the current power supply voltage; V REF is the current threshold voltage; offset is the set offset and is greater than 0. Similarly, the negative increment is a negative value, which is used to decrease the current threshold voltage so that the new threshold voltage is close to the current lower power supply voltage. If this negative increment is directly used to control the threshold voltage, then the value of the negative increment is greater than or equal to V DD_SE -(V REF +offset), and it can be specifically set by those skilled in the art according to experience. Typically, the absolute values of the positive increment and the negative increment are equal.
[0040] As a preferred implementation manner, see Figure 3 , the specific structure of the voltage control module 102 includes a conversion unit 1021 and an accumulation unit 1022 connected in sequence. Among them: A conversion unit 1021, configured to convert the comparison result of the voltage comparison module 101 into a corresponding positive increment, negative increment or zero increment, and then output the result to an accumulation unit 1022; The accumulation unit 1022 is configured to accumulate the output result of the conversion unit 1021 this time and the previous accumulation result of the accumulation unit 1022, and then output the result to a voltage adjustment module 103.
[0041] In this preferred mode, the accumulation result of the accumulation unit 1022 represents a voltage control signal, which is used as the input of the voltage adjustment module 103 to guide the voltage adjustment module 103 to adjust the threshold voltage. The positive increment, negative increment and zero increment are used as intermediate variables. By changing the accumulation result of the accumulation unit 1022, the adjustment of the threshold voltage is indirectly controlled. Based on the previous accumulation result, when the accumulation unit 1022 adds a positive increment, it will become larger, controlling the increase of the threshold voltage; based on the previous accumulation result, when the accumulation unit 1022 adds a negative increment, it will become smaller, controlling the decrease of the threshold voltage; based on the previous accumulation result, when the accumulation unit 1022 adds a zero increment, it remains unchanged, and the threshold voltage remains unchanged. When the threshold voltage adjustment circuit is the above loop, through this preferred mode, the voltage control module 102 can adjust the threshold voltage in a smooth and continuous manner, avoiding the sudden change and instability that may be caused by direct adjustment.
[0042] More preferably, the specific structure of the conversion unit 1021 includes a comparison result converter 10211, a first accumulator 10212 and a first threshold detector 10213 connected in sequence, as Figure 3 shown, where: The comparison result converter 10211 is configured to convert the comparison result of the voltage comparison module 101 into a corresponding positive increment or negative increment, and then output the result to the first accumulator 10212; The first accumulator 10212 is configured to accumulate the output result of the comparison result converter 10211 this time and the previous accumulation result of the first accumulator 10212, and then output the result to the first threshold detector 10213; The first threshold detector 10213 is configured to compare the accumulation result of the first accumulator 10212 with a preset positive and negative threshold; if it is higher than the preset positive threshold, the comparison result of the voltage comparison module 101 is finally converted into the positive increment; if it is lower than the preset negative threshold, the comparison result of the voltage comparison module 101 is finally converted into the negative increment; otherwise, the comparison result of the voltage comparison module 101 is finally converted into a zero increment.
[0043] Among them, the first accumulator 10212 is used to smooth or accumulate the incremental signal output by the comparison result converter 10211. Through accumulation, the change trend of the voltage can be more accurately identified, the misjudgment caused by instantaneous noise or interference can be reduced, and it is ensured that the subsequent output incremental signal is accurate and reliable. Exemplarily, the first accumulator 10212 can be implemented by an existing integration circuit, including an adder and a delay unit connected in sequence. Among them, the two inputs of the adder are respectively: the output result of the comparison result converter 10211, and the output of the delay unit. The output of the adder is connected to the delay unit Z -1 , the output of the delay unit Z -1 or the output of the adder is connected to the first threshold detector 10213. The accumulated result of the first accumulator 10212 can be the binary representation of any decimal number (such as 1, 5, 10, 25, 35, -25, -30...). If the comparison result of the voltage comparison module 101 is always 1 within a period of time, the accumulated result will reach a relatively large value. If the comparison result of the voltage comparison module 101 is always 0 within a period of time, the accumulated result will reach a relatively large negative value.
[0044] Exemplarily, the accumulation unit 1022 includes a second accumulator 10221 and a second threshold detector 10222 connected in sequence, as Figure 3 shown, where: The second accumulator 10221 is used to accumulate the output result of the conversion unit 1021 this time with the previous accumulated result of the second accumulator 10221 and then output it to the second threshold detector 10222; The second threshold detector 10222 is used to output the corresponding overflow value when the output of the second accumulator 10221 exceeds the preset positive and negative overflow value range; otherwise, output the accumulated result of the second accumulator 10221.
[0045] Specifically, the second threshold detector 10222 compares the accumulated result of the second accumulator 10221 with the preset positive and negative overflow values; if the accumulated result of the second accumulator 10221 is higher than the positive overflow value, output the positive overflow value. If the accumulated result of the second accumulator 10221 is lower than the negative overflow value, output the negative overflow value. Otherwise, use the input value as the output value.
[0046] Optionally, the voltage control signal of the threshold voltage is a binary signal. Correspondingly, the accumulation unit 1022 further includes: a binary converter 10223, as Figure 3 shown, connected to the second threshold detector 10222, and is used to convert the output of the second threshold detector 10222 into binary.
[0047] 3. Voltage adjustment module 103 The specific structure of the voltage adjustment module 103 may include a multi - level voltage source and a multiplexer connected in sequence, where: The multi - level voltage source is used to provide multi - level voltages; The multiplexer is used to select a corresponding level of voltage from the multi - level voltages as the threshold voltage for output under the control of the voltage control signal.
[0048] As Figure 4 shown, the voltage adjustment module 103 includes a resistor voltage divider 1031 and a multiplexer 1032. Among them, the resistor voltage divider 1031 is an exemplified multi - level voltage source, which divides the power supply voltage by using multiple resistors to obtain multi - level voltages. Here, the power supply voltage is different from the current power supply voltage compared in the voltage comparison module 101. The former is a stable voltage independently set for voltage division, and the latter is the working voltage of the dynamically changing CPU / GPU chip. The data input of the multiplexer 1032 is the multi - level voltages of the resistor voltage divider 1031, one data input is one - level voltage, and the selection input is the voltage control signal output by the voltage control module 102.
[0049] It should be noted that the number of bits of the binary sequence output by the second threshold detector 10222 should be the same as the number of bits of the selection input of the multiplexer 1032, and the absolute value of the positive and negative overflow values can be the maximum decimal number corresponding to the binary sequence of the number of bits of the selection input of the multiplexer 1032.
[0050] The following gives a specific example of the threshold voltage adjustment circuit. Refer to Figure 5 , this circuit includes: 1. A comparator 501 (corresponding to the voltage comparison module), with two voltages input at the input end: one is the current threshold voltage VREF, and the other is the current dynamically changing first power supply voltage VDD_SE. The output end outputs the comparison result of VDD_SE and (VREF + offset): 1 or 0; 2. A digital loop filter 502 (corresponding to the voltage control module), including: A comparison result converter 5021, which is used to preliminarily convert the voltage comparison result of the comparator 501 into 1 (corresponding to the comparison result 1) or - 1 (corresponding to the comparison result 0); A first accumulator 5022, which is used to accumulate and output the output result of the comparison result converter 5021 this time and the previous accumulation result of the first accumulator 5022 to the first threshold detector 5023; The first threshold detector 5023 is configured to compare the accumulated result of the first accumulator 5022 with a preset positive and negative threshold; if it is higher than the preset positive threshold, the voltage comparison result of the comparator 501 is finally converted into a positive increment 1; if it is lower than the preset negative threshold, the voltage comparison result of the comparator 501 is finally converted into a negative increment -1; otherwise, the voltage comparison result of the comparator 501 is finally converted into a zero increment; The second accumulator 5024 is configured to accumulate the output result of the first threshold detector 5023 this time with the accumulated result of the second accumulator 5024 in the previous time and then output it to the second threshold detector 5025; The second threshold detector 5025 is configured to output a corresponding overflow value when the output of the second accumulator 5024 exceeds the preset positive and negative overflow value range; otherwise, output the accumulated result of the second accumulator 5024; The binary converter 5026 converts the decimal output result of the second threshold detector 5025 into binary; 3. The voltage adjustment module 503 includes: The resistor divider 5031 is configured to divide the power supply voltage by using multiple resistors to obtain multi-gear voltages; The multiplexer 5032 is configured to select a corresponding target gear voltage from the multi-gear voltages of the resistor divider 5031 with data input as the threshold voltage for output under the selection input of the output result of the binary converter 5026 in the digital loop filter 502, and this output is connected to the threshold voltage input of the comparator 501, thereby forming a loop.
[0051] In this example, the threshold voltage adjustment circuit implements a dynamic feedback mechanism. If the current power supply voltage is higher than the threshold voltage, the circuit will gradually increase the threshold voltage until it approaches the power supply voltage and meets the offset condition; on the contrary, if the current power supply voltage is lower than the threshold voltage, the circuit will gradually decrease the threshold voltage, also until it approaches the power supply voltage and meets the offset condition. Through this process, the threshold voltage adjustment circuit continuously adjusts the threshold voltage to reach a balanced state, so that a relatively stable relationship is maintained between the threshold voltage and the power supply voltage. And, the change of the threshold voltage in this example is carried out slowly. Due to the effect of the digital loop filter, the error of the difference between the power supply voltage and the existing threshold voltage is slowly averaged, and the accumulated result of the second accumulator changes slowly, so that the existing threshold voltage catches up with the change of the power supply voltage. This threshold adjustment loop enables the threshold voltage to adaptively track the power supply voltage without manual adjustment with relatively small hardware resources.
[0052] Embodiment 2 Based on the above Embodiment 1, this embodiment provides a frequency adjustment circuit. Refer toFigure 6 The circuit includes a threshold voltage adjustment circuit 601, a voltage droop detection module 602, and a frequency adjustment module 603 connected in sequence. Among them, the threshold voltage adjustment circuit 601 can be the threshold voltage adjustment circuit provided in any embodiment of the present invention (including the above-mentioned Embodiment 1).
[0053] In this embodiment, the voltage droop detection module 602 is configured to compare the current power supply voltage with the threshold voltage output by the threshold voltage adjustment circuit 601, and after determining that a voltage droop has occurred based on the comparison result, output a clock frequency control signal to the frequency adjustment module 603. Typically, the voltage droop detection module 602 is implemented by an analog-to-digital converter, and the clock frequency control signal is a digital signal representing the difference between the current power supply voltage and the threshold voltage. In this embodiment, the clock frequency changes in the same direction as the current power supply voltage, and the relationship between the two is as Figure 7 shown, which is the prior art. Thus, after detecting that the current power supply voltage is lower than the threshold voltage and a voltage droop problem occurs, the negative impact of the voltage droop is reduced by reducing the clock frequency.
[0054] The frequency adjustment module 603 is configured to adjust the clock frequency under the control of the frequency control signal so that it changes in the same direction as the current power supply voltage. Among them, the clock frequency is the operating frequency of the system where it is located, and specifically can be the current operating frequency of the CPU / GPU chip.
[0055] As an implementable manner, the frequency adjustment module 603 includes a clock source and a clock source control unit. The clock source control unit controls the clock source to adjust the output clock frequency under the control of the frequency control signal. Preferably, as Figure 8 shown, the frequency adjustment module 603 includes: a clock source control unit 6030, an FLL (Frequency Locked Loop) including a clock source 6031 and a frequency divider 6032, where: The clock source control unit 6030 is configured to control the clock source 6031 to adjust the output clock frequency under the control of the frequency control signal so that it changes in the same direction as the current power supply voltage; The frequency divider 6032 is configured to adjust the division ratio under the control of the frequency control signal and divide the clock frequency output by the clock source 6031 according to the division ratio.
[0056] Exemplarily, the clock source is an oscillator. The clock source control unit 6030 can be a current sink module, which is respectively connected to the voltage droop detection module 602 and the clock source, and is configured to: under the control of the frequency control signal, divert a part of the input current of the clock source, for example, divert it to the ground, so as to reduce the clock frequency output by the clock source and make it change in the same direction as the current power supply voltage.
[0057] Meanwhile, the clock frequency control signal output by the voltage sag detection module 602 is also used to control the frequency divider 6032, reducing the division ratio of the frequency divider 6032, so that the FLL still maintains frequency locking, but locks to a lower clock frequency. The FLL maintains frequency locking throughout the process and satisfies the following frequency formula:
[0058] Wherein, is the reference frequency, is the output clock frequency, is the division ratio of the clock source 6031, N is the integer component, and.F is the fractional component.
[0059] The FLL is elaborated in detail below. The FLL is a circuit structure used to synchronize the frequency of the clock signal output by the clock source with the reference frequency of the input clock signal. Refer to Figure 8 , the FLL consists of four parts: Frequency discriminator 6033: compares the reference frequency and the feedback frequency output by the frequency divider 6032 to generate an error signal; Filtering unit 6034: filters the error signal to remove high-frequency noise and generates a control signal; Clock source 6031: adjusts the output clock frequency according to the control signal of the filtering unit 6034, so that after being divided by the frequency divider 6032, it is synchronized with the reference frequency; Frequency divider 6032: is a loop frequency divider that divides the clock frequency output by the clock source to match the reference frequency.
[0060] Among them, the filtering unit 6034 includes a digital filter 60341, an analog-to-digital converter 60342, and a voltage regulator 60343. The digital filter 60341 filters the error signal to remove high-frequency noise and generates an analog control signal. The analog-to-digital converter 60342 converts the analog control signal into a digital control signal and outputs it to the clock source 6031. The voltage regulator is used to provide a stable voltage for the analog-to-digital converter 60342. The clock source control unit 6030 shunts the current input to the clock source 6031 by the analog-to-digital converter 60342 to the ground under the control of the frequency control signal, thereby reducing the clock frequency output by the clock source 6031.
[0061] In summary, the embodiment of the present invention proposes a hardware - implementable adaptive threshold voltage adjustment scheme. This scheme automatically calibrates the threshold voltage by real - time monitoring the voltage difference between the power supply voltage and the threshold voltage, enabling it to closely follow the power supply voltage and maintain a certain offset level. In the case of large fluctuations in the power supply voltage, this scheme can ensure that the threshold voltage tracks the change of the power supply voltage in real - time, accurately identify the voltage droop phenomenon, and thus achieve the adaptive frequency - reduction function.
[0062] Embodiment III This embodiment provides a threshold voltage adjustment method. Refer to Figure 9 , this method includes the following steps 901 - 903.
[0063] Step 901: Compare the current power supply voltage with the current threshold voltage plus a set offset. Step 902: Generate a voltage control signal according to the comparison result. Step 903: Under the control of the voltage control signal, adjust the threshold voltage so that it changes in the same direction as the current power supply voltage.
[0064] As a preferred implementation, the threshold voltage adjustment method in this embodiment further includes: using the adjusted threshold voltage as the current threshold voltage again, and continuing to execute the step of comparing the current power supply voltage and the threshold voltage; Stop adjusting the threshold voltage until the adjusted threshold voltage plus the set offset is equal to the current power supply voltage.
[0065] Exemplarily, in step 901, comparing the current power supply voltage and the threshold voltage includes: Comparing whether the current power supply voltage is higher than the current threshold voltage plus the set offset, and outputting a comparison result signal.
[0066] In step 902, generating a voltage control signal according to the comparison result includes: Sub - step 9021: Convert the comparison result into a corresponding positive increment, negative increment or zero increment; Sub - step 9022: Accumulate the positive increment, negative increment or zero increment obtained from this conversion with the previous second accumulated result to obtain a new second accumulated result, so as to generate a voltage control signal.
[0067] Among them, in sub - step 9021, converting the comparison result into a corresponding positive increment, negative increment or zero increment may include: Preliminarily convert the comparison result into a corresponding positive increment or negative increment; Accumulate the obtained positive increment or negative increment with the previous first accumulated result to obtain a new first accumulated result; Compare the new first accumulation result with a preset positive and negative threshold; if it is higher than the preset positive threshold, finally convert the comparison result into the positive increment; if it is lower than the preset negative threshold, finally convert the comparison result into the negative increment; otherwise, finally convert the comparison result into a zero increment.
[0068] In sub-step 9022, accumulate the positive increment, negative increment or zero increment obtained from this conversion with the previous second accumulation result to obtain a new second accumulation result, so as to generate a voltage control signal, including: Accumulate the positive increment, negative increment or zero increment obtained from this conversion with the previous second accumulation result to obtain a new second accumulation result; When the new second accumulation result exceeds the preset positive and negative overflow value range, obtain the voltage control signal based on the corresponding overflow value; otherwise, obtain the voltage control signal based on the new second accumulation result.
[0069] Exemplarily, obtaining the voltage control signal based on the corresponding overflow value or the new second accumulation result may include: After converting the corresponding overflow value or the new second accumulation result into binary, obtain the voltage control signal.
[0070] In step 903, under the control of the voltage control signal, adjust the threshold voltage, which may include: Under the control of the voltage control signal, select a corresponding voltage from the provided multi-gear voltages as the threshold voltage.
[0071] The threshold voltage adjustment method in this embodiment is basically the same as the threshold voltage adjustment circuit described in any of the foregoing embodiments in terms of the implementation principle and the corresponding technical effects, and will not be elaborated here.
[0072] Embodiment 4 This embodiment provides a frequency adjustment method. Refer to Figure 10 , this method includes the following steps 1001-1002.
[0073] Step 1001, compare the current power supply voltage and the threshold voltage, and generate a clock frequency control signal after determining that voltage sag has occurred based on the comparison result.
[0074] Wherein, the threshold voltage is obtained according to the threshold voltage adjustment method described in the embodiments of the present invention.
[0075] Step 1002, under the control of the frequency control signal, adjust the clock frequency so that it changes in the same direction as the current power supply voltage.
[0076] Exemplarily, in step 1002, under the control of the frequency control signal, adjusting the clock frequency to change in the same direction as the current power supply voltage includes: Under the control of the frequency control signal: adjusting the clock frequency output by the clock source in the frequency locked loop to change in the same direction as the current power supply voltage; adjusting the division ratio of the frequency divider in the frequency locked loop so that the frequency divider divides the clock frequency output by the clock source according to the division ratio.
[0077] The frequency adjustment method in this embodiment and the frequency adjustment circuit described in any of the foregoing embodiments have basically the same implementation principle and corresponding technical effects, and will not be elaborated herein.
[0078] It should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including an..." does not exclude the existence of additional identical elements in the process, method, article or device including the element.
[0079] In the embodiments of the present invention, the term "and / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after.
[0080] Each embodiment in this specification is described in a related manner. The same or similar parts among the embodiments can be referred to each other, and the differences between each embodiment and other embodiments are emphasized.
[0081] In particular, for the device embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiments.
[0082] For the convenience of description, the above device is described by dividing it into various units / modules according to functions. Of course, when implementing the present invention, the functions of each unit / module can be implemented in one or more software and / or hardware.
[0083] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above methods. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM), etc.
[0084] As mentioned above, the above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by those skilled in the art within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.
Claims
1. A threshold voltage adjustment circuit, characterized in that: It includes a voltage comparison module, a voltage control module and a voltage adjustment module connected in sequence; wherein: The voltage comparison module is used to compare the current power supply voltage with the current threshold voltage plus a set offset; The voltage control module is used to generate a voltage control signal according to the comparison result of the voltage comparison module; The voltage adjustment module is used to adjust the threshold voltage under the control of the voltage control signal so that the threshold voltage changes in the same direction as the current power supply voltage.
2. The circuit according to claim 1, characterized in that The voltage adjustment module is further used to: input the adjusted threshold voltage to the voltage comparison module to form a loop; The loop stops the adjustment until the adjusted threshold voltage plus the set offset equals the current power supply voltage.
3. The circuit according to claim 2, characterized in that The voltage comparison module comprises: The comparator is used to compare whether the current power supply voltage is higher than the current threshold voltage plus the set offset, and output a comparison result signal to the voltage control module.
4. The circuit according to claim 1, characterized in that The voltage control module comprises a conversion unit and an accumulation unit connected in sequence, wherein: The conversion unit is used to convert the comparison result of the voltage comparison module into a corresponding positive increment, a negative increment or a zero increment and then output it to the accumulating unit; The accumulation unit is used to accumulate the current output result of the conversion unit and the previous accumulation result of the accumulation unit and output the accumulated result to the voltage adjustment module.
5. The circuit according to claim 4, characterized in that The conversion unit comprises a comparison result converter, a first accumulator and a first threshold detector connected in sequence, wherein: The comparison result converter is used to convert the comparison result of the voltage comparison module into a corresponding positive increment or a negative increment and then output it to the first accumulator; The first accumulator is used to accumulate the output result of the comparison result converter this time and the previous accumulation result of the first accumulator and output the accumulated result to the first threshold detector; The first threshold detector is used to compare the accumulated result of the first accumulator with the preset positive and negative thresholds; if it is higher than the preset positive threshold, the comparison result of the voltage comparison module is finally converted into the positive increment; if it is lower than the preset negative threshold, the comparison result of the voltage comparison module is finally converted into the negative increment; otherwise, the comparison result of the voltage comparison module is finally converted into a zero increment.
6. The circuit according to claim 4, characterized in that The accumulating unit comprises a second accumulator and a second threshold detector connected in sequence, wherein: The second accumulator is used to accumulate the output result of the conversion unit this time and the previous accumulation result of the second accumulator and output the accumulated result to the second threshold detector; The second threshold detector is used to output a corresponding overflow value when the output of the second accumulator exceeds a preset positive or negative overflow value range; otherwise, output the accumulation result of the second accumulator.
7. The circuit according to claim 6, characterized in that The accumulating unit further includes: The binary converter is connected to the second threshold detector and is used for converting the output of the second threshold detector into binary.
8. The circuit according to claim 1, characterized in that The voltage adjustment module includes a multi-level voltage source and a multiplexer connected in sequence, wherein: The multi-level voltage source is used to provide multi-level voltages; The multiplexer is used to select a corresponding voltage from the multiple voltage levels as a threshold voltage for output under the control of the voltage control signal.
9. A frequency adjustment circuit, characterized in that: The method comprises a threshold voltage adjustment circuit, a voltage sag detection module and a frequency adjustment module as described in any one of claims 1 to 8 connected in sequence, wherein: The voltage droop detection module is used to compare the current power supply voltage with the threshold voltage output by the threshold voltage adjustment circuit, and output a clock frequency control signal to the frequency adjustment module after determining that a voltage droop occurs based on the comparison result; The frequency adjustment module is used to adjust the clock frequency under the control of the frequency control signal so that the clock frequency changes in the same direction as the current power supply voltage.
10. The circuit according to claim 9, characterized in that The frequency adjustment module includes a clock source control unit and a frequency locked loop including a clock source and a frequency divider, wherein: The clock source control unit is used to control the clock source to adjust the output clock frequency under the control of the frequency control signal so that it changes in the same direction as the current power supply voltage; The frequency divider is used to adjust the frequency division ratio under the control of the frequency control signal, and divide the clock frequency output by the clock source according to the frequency division ratio.
11. A threshold voltage adjustment method, characterized in that: include: Compare the current supply voltage with the current threshold voltage plus a set offset; generating a voltage control signal according to the comparison result; Under the control of the voltage control signal, the threshold voltage is adjusted so as to change in the same direction as the current power supply voltage.
12. The method according to claim 11, characterized in that The method further includes: using the adjusted threshold voltage as the current threshold voltage again, and continuing to perform the step of comparing the current power supply voltage and the threshold voltage; The adjustment of the threshold voltage is stopped until the adjusted threshold voltage plus the set offset equals the current power supply voltage.
13. The method according to claim 12, characterized in that Compare the current supply voltage to the threshold voltage, including: Compare whether the current power supply voltage is higher than the current threshold voltage plus the set offset, and output a comparison result signal.
14. The method according to claim 11, characterized in that According to the comparison result, a voltage control signal is generated, including: Convert the comparison result into a corresponding positive increment, negative increment or zero increment; The positive increment, negative increment or zero increment obtained by this conversion is accumulated with the second accumulation result of the previous time to obtain a new second accumulation result to generate a voltage control signal.
15. The method according to claim 14, characterized in that Convert the comparison result to the corresponding positive increment, negative increment, or zero increment, including: Preliminarily converting the comparison result into a corresponding positive increment or negative increment; Accumulate the converted positive increment or negative increment with the previous first accumulation result to obtain a new first accumulation result; The new first accumulated result is compared with the preset positive and negative thresholds; if it is higher than the preset positive threshold, the comparison result is finally converted into the positive increment; if it is lower than the preset negative threshold, the comparison result is finally converted into the negative increment; otherwise, the comparison result is finally converted into a zero increment.
16. The method according to claim 14, characterized in that Accumulating the positive increment, negative increment or zero increment obtained by the current conversion with the second accumulation result of the previous time to obtain a new second accumulation result to generate a voltage control signal, including: Accumulate the positive increment, negative increment or zero increment obtained by this conversion with the second accumulation result of the previous time to obtain a new second accumulation result; When the new second accumulation result exceeds a preset positive or negative overflow value range, a voltage control signal is obtained based on the corresponding overflow value; otherwise, a voltage control signal is obtained based on the new second accumulation result.
17. The method according to claim 16, characterized in that Based on the corresponding overflow value or the new second accumulation result, a voltage control signal is obtained, including: After converting the corresponding overflow value or the new second accumulation result into binary, a voltage control signal is obtained.
18. The method according to claim 11, characterized in that Under the control of the voltage control signal, adjusting the threshold voltage includes: Under the control of the voltage control signal, a corresponding voltage level is selected from the provided multiple voltage levels as the threshold voltage.
19. A frequency adjustment method, characterized in that: include: comparing a current power supply voltage with a threshold voltage, and generating a clock frequency control signal after determining that a voltage sag occurs based on the comparison result; Under the control of the frequency control signal, the clock frequency is adjusted so that it changes in the same direction as the current power supply voltage; Wherein, the threshold voltage is obtained according to the threshold voltage adjustment method described in any one of claims 11-18 above.
20. The method according to claim 19, characterized in that Under the control of the frequency control signal, the clock frequency is adjusted so that it changes in the same direction as the current power supply voltage, including: Under the control of the frequency control signal: adjust the clock frequency output by the clock source in the frequency locked loop so that it changes in the same direction as the current power supply voltage; adjust the frequency division ratio of the frequency divider in the frequency locked loop so that the frequency divider divides the clock frequency output by the clock source according to the frequency division ratio.