An ultra-low power consumption optimization design method for industrial microcontrollers
By using gated clock technology and multi-power domain design in microcontrollers, the problem of high static power consumption of microprocessor systems under deep sub-micron processes is solved, ultra-low power consumption design is achieved, the design cycle is shortened and the cost is reduced. cost.
Patent Information
- Application Number
- CN202210839782.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-15
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2042-07-15
AI Technical Summary
The existing technology cannot effectively reduce the system static power consumption of microprocessors in deep sub-micron processes, resulting in excessive system power consumption, and the low-power design mode is relatively solid, and the design cycle is long and the cost is high.
Gating clock technology is used to control the input clock of each module of the microcontroller. By turning off the clock of the disable module, the UPF design module, power management module and low-power reset and clock system module are designed to realize multiple power supplies. Domain and gated power supply and gated clock technology optimize chip low-power design.
It significantly reduces the power consumption of the microcontroller, shortens the low-power design cycle, improves the flexibility and reliability of the design, reduces the development cost, and enhances the market competitiveness of the system.
Smart Images

Figure CN115114801B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of SoC low power consumption design, in particular to an ultra-low power consumption optimization design method for an industrial microcontroller. Background Art
[0002] As the core key basic components in the industrial base strengthening project, industrial SoC is related to major engineering tasks involving national economy and people's livelihood. The real realization of independent control of core technology is a technical problem that needs to be solved urgently. Among them, power consumption is an important characteristic of industrial SoC. With the continuous reduction of integrated circuit process size, the integration, functional complexity and clock frequency of microcontrollers have been greatly improved, and the power consumption problem has become increasingly prominent. The increase in power consumption will directly lead to the increase of chip temperature. Temperature is a key factor affecting chip performance. The increase in chip temperature will cause the electromigration of metal interconnects to become more obvious, and in severe cases, it will cause short circuits or open circuits inside the chip. As the chip temperature increases, the voltage of the power supply network will decrease, resulting in poor overall chip performance. The clock signal of the chip will also deviate and jitter as the chip temperature increases, which will then cause functional errors in the circuit. The increase in chip temperature will also lead to prominent thermal noise problems, the bit error rate will increase, and the system reliability will be greatly reduced. The chip heating problem caused by high power consumption requires the use of ceramic-based packaging process technology or other additional heat dissipation systems with good thermal conductivity but very expensive, which undoubtedly increases the production cost of the chip. In addition, the excessive power consumption of microcontrollers is incompatible with the sustainable development of low-carbon and environmental protection, and is not in line with the current and future green development concepts.
[0003] Under the combined influence of many factors such as today's advanced semiconductor process technology, high-reliability chip market demand, low-carbon and environmentally friendly green sustainable development concepts, and industry competition pressure, the low-power design of industrial SoCs has become particularly important. The unified power supply format is the current mainstream low-power design method. Based on this method, a reasonable and efficient low-power architecture solution is formulated for the microcontroller, and the system power management module is collaboratively designed. This can significantly reduce the power consumption of the microcontroller system and greatly enhance the product's market competitiveness.
[0004] The disadvantage of the prior art is that for microprocessors using deep submicron technology, low-power design cannot effectively reduce system static power consumption, resulting in excessive system power consumption. In addition, the low-power design model proposed by the prior art solution is relatively rigid, and the low-power design cycle is long and the cost is high. Summary of the invention
[0005] The purpose of the present invention is to provide an ultra-low power consumption optimization design method for an industrial microcontroller, so as to control the input clock of each module of the microcontroller by adopting the gated clock technology. When some modules are not enabled, the purpose of reducing power consumption is achieved by turning off the clock of the module.
[0006] To achieve the above-mentioned purpose, the present invention provides the following technical solutions: an ultra-low power optimization design method for an industrial microcontroller, the method comprising a UPF design module, a power management module (Power Management Unit, PMU), a low-power reset and clock system module. Among them, the UPF design module formulates the chip low-power design intention based on multiple power domains, gated power, and gated clock technologies, and plans the system power network. The power management module is used to implement power mode configuration and power-on or power-off process control of the shut-down module. The low-power reset and clock system module defines the system low-power clock architecture and reset logic.
[0007] Preferably, according to the low power consumption requirements of each switchable module of the system, the low power consumption architecture of each module is designed as follows:
[0008] For the power-off domains eepromPD, timerPD, pitPD, uart0PD, uart1PD, uart2PD, uart3PD, uart4PD, uart5PD, pwmPD, i2cPD, mscanPD, adcPD, and spiPD, the internal low-power architecture defined by UPF is the same, such as Figure 3 As shown, the circuit modules are divided into a shutoff power domain, in which a Header-type power switch capable of switching the VDD power supply network, a type of module input signal isolation unit, and a type of module output signal isolation unit are defined. The isolation unit is arranged in the parent domain, the normally open domain of ChipTopPD, and the power supply is VDD and VSS in ChipTopPD. The power supply of the module is VSS and VDD output by the power switch. The power switch control signal switch, the module input signal isolation unit enable signal isoen_i, and the module output signal isolation unit enable signal isoen_o all come from the PMU.
[0009] Figure 4 The low-power architecture diagram of the ECDSA module defined for UPF subdivides three power domains that can be turned off, namely ecdsaPD, SignPD, and VeriPD. EcdsaPD includes the entire ECDSA circuit system, SignPD includes the ECDSA signature function module, and VeriPD includes the ECDSA signature verification function module. Figure 3The low-power architecture shown is similar, and each power-off domain contains a Header-type power switch, a type of module input signal isolation unit, and a type of module output signal isolation unit. The power supply of SignPD and VeriPD comes from VSS and the VDD output by the power switch in ecdsaPD. The power supply of the modules contained in the power-off domain is the VDD output by the power switch in the domain. The isolation units ④ and ⑨ of ecdsaPD are arranged in ChipTopPD, and the isolation units ⑤ and ⑥ of SignPD and the isolation units ⑦ and ⑧ of VeriPD are arranged in ecdsaPD. The power supply of all isolation units comes from VDD and VSS in ChipTopPD. The retention cell of the retention register is defined in the AhbIf module of ECDSA. This unit is powered by two power supplies, namely the VDD from ChipTopPD and the VDD output by the power switch in ecdsaPD. The power switch control signal TopPwrSw and isolation unit enable signal TopIsoCtrlIn and TopIsoCtrlOut in ecdsaPD, the power switch control signal SPwrSw and isolation unit enable signal SIsoCtrlIn and SIsoCtrlOut in SignPD, and the power switch control signal VPwrSw and isolation unit enable signal VIsoCtrlIn and VIsoCtrlOut in VeriPD all come from the PMU module.
[0010] Figure 5 The low-power architecture diagram of the Cortex_M0 module defined by UPF is divided into three power domains, namely cortexm0PD, SysPD, and DbgPD. The cortexm0PD is the normally open power domain, which includes the entire Cortex_M0 circuit system. The SysPD is the shutoff power domain, which includes the Cortex_M0 system functional module. The DbgPD is the shutoff power domain, which includes the debug functional module. Figure 3The low-power architecture shown is similar. Each power-off domain contains a Header-type power switch, a type of module input signal isolation unit, and a type of module output signal isolation unit. The power supply of SysPD and DbgPD comes from VSS and VDD in ChipTopPD. The power supply of the modules contained in the power-off domain is the VDD output by the power switch in the domain. The isolation units ⑤ and ⑥ of SysPD and the isolation units ⑦ and ⑧ of VeriPD are arranged in cortexm0PD. The power supply of all isolation units comes from VDD and VSS in ChipTopPD. The retention register retention cell is defined in the SYS module of Cortex-M0, which is the same as the retention register defined in the AhbIF module of ECDSA. This unit is powered by two power supplies, namely VDD from ChipTopPD and VDD output by the power switch in SysPD. The power switch control signal SysPwrSw and the isolation unit enable signals SysIsoCtrlIn and SysIsoCtrlOut in SysPD, and the power switch control signal DbgPwrSw and the isolation unit enable signals DbgIsoCtrlIn and DbgIsoCtrlOut in DbgPD are all controlled by the PMU module.
[0011] Preferably, the PMU top-level module designed in this solution includes two parts: an APB interface module and a PMU module. The APB interface module is used for the microcontroller to realize functional control of the PMU by reading and writing registers, and the PMU-related data, control, and flag registers are defined internally. The data register includes a register for the number of clocks required for each control sequence (clock, reset, register retention, register recovery, isolation unit, power switch control) when the PMU controls the power-off module to power on or off. The control register includes the power-off enable and power-on enable control registers of each power-off module of the microcontroller. The flag register includes the power-off completion flag and the power-on completion flag register of each power-off module. The PMU module is used to cooperate with the designed system UPF module to realize hardware control of the power-on and power-off processes of the power-off modules. The specific control process includes:
[0012] S1: All modules of the microcontroller complete the initial power-on reset;
[0013] S2: Wait for software configuration to shut down the power domain and power-down and power-up enable registers;
[0014] S3: Software configuration can shut down the power domain, power down and power up enable registers;
[0015] S4: Determine whether the power-off enabling of the shut-down module is established. If established, proceed to S5 - power-off enabling of the shut-down module. If not established, proceed to S11 - power-on enabling of the shut-down module.
[0016] S5: The clock off delay counter off_clk_cnt starts counting, which can turn off the module input clock gating enable and turn off the clock. When off_clk_cnt is equal to the clock off delay configuration input value t_off_clk, the state jumps to S6;
[0017] S6: The isolation unit enable delay counter on_iso_cnt starts counting, which can shut down the module input and output signal isolation unit enable. The input signal is fixed to "0" and the output signal is fixed to the reset value to prevent the "X" state of the output signal from affecting the function of the next level circuit after power failure. When on_iso_cnt is equal to the isolation unit enable delay configuration input value t_on_iso, the state jumps to S7;
[0018] S7: The hold register save enable delay counter save_cnt starts counting, and the module hold register save signal enable can be turned off. The internal register data that defines the hold register function will be saved to the hold register (the hold register is powered on and the data does not disappear). When save_cnt is equal to the hold register save enable delay configuration input value t_save, the state jumps to S8;
[0019] S8: The reset enable delay counter on_rst_cnt starts counting, and the module reset signal enable can be turned off. When on_rst_cnt is equal to the reset enable delay configuration input value t_on_rst, the state jumps to S9;
[0020] S9: The power switch off delay counter off_pwr_cnt starts counting, and the module power switch signal can be turned off. The power supply of the module will be turned off, and its dynamic and static power consumption will be reduced to 0W, which greatly reduces the power consumption of the microcontroller. When off_pwr_cnt is equal to the power switch off delay configuration input value t_off_rst, the state jumps to S10;
[0021] S10: The power-off of the power domain that can be turned off is completed, the power-off completion flag signal of the corresponding power domain that can be turned off is pulled high, and the state jumps to S2;
[0022] S11: The power switch on delay counter on_pwr_cnt starts counting, the module power switch signal can be turned off, and the module resumes normal power supply. When on_pwr_cnt is equal to the power switch on delay configuration input value t_on_rst, the state jumps to S12;
[0023] S12: The reset disable delay counter off_rst_cnt starts counting, which can turn off the module reset signal prohibition, and the module terminates the reset. When off_rst_cnt is equal to the reset disable delay input value t_off_rst, the state jumps to S13;
[0024] S13: The holding register restore delay counter restore_cnt starts counting, and the module holding register restore signal can be turned off. The data stored in the holding register before the module is powered off will be restored to the corresponding register. When restore_cnt is equal to the holding register restore delay configuration input t_restore, the state jumps to S14;
[0025] S14: The isolation unit prohibition delay counter off_iso_cnt starts counting, which can shut down the module input and output signals. The isolation unit is prohibited, and the module input and output signals are no longer isolated, and normal input and output can be achieved. When off_iso_cnt is equal to the isolation unit prohibition delay configuration input t_off_iso, the state jumps to S15;
[0026] S15: The clock enable delay counter on_clk_cnt starts counting, which can shut down the module input clock gating prohibition. When on_clk_cnt is equal to the clock enable delay configuration input value t_on_clk, the state jumps to S16;
[0027] S16: The power-on of the shutoff power domain is completed, the power-on completion flag signal corresponding to the shutoff power domain is pulled high, and the state jumps to S2.
[0028] Preferably, the designed low-power microcontroller clock system includes two types of crystal oscillators, one off-chip and one on-chip. The system controller divides the off-chip crystal oscillator clock signal entering the PLL by configuring the PLL frequency division coefficient, and outputs high-frequency clocks of different frequencies. Then, the system controller selects the required clock as Core_clk from the on-chip crystal oscillator output clock and the PLL output multi-frequency clock by configuring the core clock Core_clk chip select register. The power management module input clock is Core_clk. For the module clock in the power domain that can be turned off, the power management module will perform clock gating enable or clock gating disable operation according to the designed hardware timing according to the power-on and power-off requirements controlled by the software, and then output it to the corresponding power domain module that can be turned off. The DMAC module is also designed with a low-power mode - clock shutdown and reset enable, so its clock and reset signals are also controlled by the power management module. The clock input of all modules except DMAC in the normally-on power domain of the microcontroller does not need to be controlled by the power management module, and is all Core_clk. FCLK is a clock that can run freely in the microcontroller. The system controller selects the external crystal oscillator output clock or the internal crystal oscillator output clock as FCLK. This clock is used to provide a delay count reference for each reset signal of the system.
[0029] The designed low-power microcontroller power-on reset includes the following processes:
[0030] S1: The chip is powered on and the external reset signal RESET is enabled;
[0031] S2: After a certain delay and signal synchronization deburring, the microcontroller power-on reset RST_POR is enabled. This reset signal is mainly used to reset PLL / MBIST and system controller;
[0032] S3: After a certain delay, the microcontroller system reset RST_SOC is enabled. This reset signal is used to reset the memory, peripherals, on-chip bus, and PMU in the normally-on power domain on the chip except DMAC. The reset of these modules is also controlled by the system controller, which can shut down all modules in the power domain and the reset signal of DMAC comes from the gating and synchronization output of RST_SOC by PMU.
[0033] S4: After a certain delay, the Cortex-M3 main processor powers on the reset M3_POR enabled. This reset signal is used to power on the Cortex-M3 core and the Cortex-M3 system reset synchronization module. These modules are also controlled by the system controller.
[0034] S5: After a certain delay, the Cortex-M0 coprocessor power-on reset M0_POR is enabled. M0_POR is used to power-on reset the Cortex-M0 core and the Cortex-M0 system reset synchronization module. The system controller also controls the reset of these modules. For the system reset signal M0_SYSRST of the Cortex-M0 coprocessor, it needs to be gated and synchronized by the PMU module to achieve the system's low-power design purpose for Cortex-M0.
[0035] Preferably, the designed power consumption management module includes:
[0036] When the system completes initialization and powers on, it enters normal mode, all modules are powered on and the input clock signals of each module jump normally. In this working mode, if all functional modules run at high speed, the power consumption of the microcontroller in this state is the highest.
[0037] If the microcontroller does not need the core to process tasks and only needs to enable peripherals, the system enters the sleep mode from the normal mode through the software control. The sleep mode defined in this solution is specifically: the clock of the Cortex-M3 main processor is turned off, the SysPD and DbgPD in the cortexm0PD power domain can shut down the power domain and power off, and the other modules on the chip work normally. For the system to enter the sleep mode from the normal mode, the specific idea in the software design is: first enable the peripheral interrupt, then the software configures the SysPD and DbgPD power-down enable registers in the PMU, and when the power-down end flags of these two power domains are pulled high, execute the WFI() instruction (this instruction is a general instruction for the Cortex-M3 core to enter the low-power mode, turn off the Cortex-M3 main processor clock, and put it into the low-power mode). If the RTC timed wake-up function is required, it is necessary to configure the RTC before executing the WFI() instruction, set the start time and end time, and enable the RTC. After this process, the system enters the sleep mode. When a peripheral generates a hardware interrupt, the WIC (Wake-up Interrupt Controller) will wake up the Cortex-M3 main processor, restore its clock signal to jump, and exit the low-power mode. Then the software configures the SysPD and DbgPD power-on enable registers in the PMU. When the power-on end flags of these two power domains are pulled high, the system completes the jump from sleep mode to normal mode.
[0038] If the microcontroller does not need the core to process transactions or enable peripherals, the system can enter deep sleep mode from normal mode through software control. The deep sleep mode defined in this solution is as follows: the clock of the Cortex-M3 main processor is turned off, the DMAC is reset and the clock is turned off, all power domains that can be turned off are powered off, and the remaining modules on the chip work normally. For the system to enter sleep mode from normal mode, the specific idea in the software design is: first enable peripheral interrupts, then configure the power-down enable register of all power domains that can be turned off and the DMAC function disable register of the PMU, when all power domains that can be turned off are powered off and the DMAC function disable (reset and clock off) flag is pulled high, execute the WFI() instruction. If the RTC timed wake-up function is required, it is necessary to configure the RTC before executing the WFI() instruction, set the start time and end time, and enable the RTC. After this process, the system enters deep sleep mode. When a peripheral generates a hardware interrupt, the WIC (Wake-up Interrupt Controller) will wake up the Cortex-M3 main processor, resume its clock signal transition, and exit the low-power mode. Then the software configures the PMU power-on enable registers and DMAC function enable registers for all power-off power domains that can be turned off. When the power-on completion flag bits and the DMAC function enable flag bits of all power-off power domains that can be turned off are pulled high, the system completes the jump from deep sleep mode to normal mode.
[0039] If the microcontroller needs to flexibly control the switch of the power domain that can be turned off, the software controls the system from normal mode to free configuration mode. The free configuration mode defined in this solution is specifically: the Cortex-M3 main processor maintains normal operation. If some modules or DMAC in the power domain that can be turned off do not need to be enabled during the operation of the chip, the software can freely control the disabled modules to power off or turn off the clock and reset at any time, instead of controlling the fixed modules to enter low power mode at the same time as entering sleep mode and deep sleep mode. For the system to enter free configuration mode from normal mode, the specific idea in the software design is: first print out the information of the modules that have been powered off or the clock is turned off, determine that the modules that need to be turned off next have not been turned off, and then configure the power-off enable register of the modules that need to be turned off in the PMU. When the power-off end flag of the module that is turned off is pulled high, it means that the module has been turned off. After this process, the system enters the free configuration mode. When the system has a module that is turned off again, the software will repeat the above steps to turn off the module that needs to be turned off. When the system needs to jump from free configuration mode to normal mode, software control is also required to power on or turn on the clock of all modules in low power state. First, print out the information of the modules that are currently powered off or whose clocks are turned off. Based on this, configure the power-on enable registers of the modules that need to be turned on in the PMU. When the power-on completion flags of all modules that need to be turned on are pulled high, it means that the system has exited to normal mode.
[0040] Preferably, the PMU design process completes the low-power control circuit design of the relevant modules based on the low-power design information such as the shut-down module, the shut-down module design requirements, and the voltage state table created during the UPF design process; the UPF design process completes the design of the UPF file and the feasibility verification of the power consumption mode according to the low-power control signal of the shut-down module, the RTL level of the low-power control signal of the shut-down module, and the low-power mode information of the design defined in the PMU design process. This method adopts the design concept of parallel development, can efficiently complete the low-power design of the SoC front end, and greatly reduce the time cost of low-power design.
[0041] The present invention provides an ultra-low power consumption optimization design method for an industrial microcontroller. It has the following beneficial effects:
[0042] (1) The ultra-low power optimization design method for an industrial microcontroller of the present invention is based on the UPF low-power design method. It utilizes multiple power domains, gated power supplies, and gated clock technologies to complete the design of chip power consumption intent at a higher chip design level, the architecture level, thereby significantly improving the optimization of chip power consumption. In addition, the UPF-based low-power design scheme proposed in the present invention is systematic, process-based, and portable, and can efficiently realize the low-power design of complex microcontrollers, thereby significantly shortening the low-power design cycle of complex chip systems.
[0043] (2) The present invention discloses an ultra-low power optimization design method for an industrial microcontroller. A flexible and reliable power management module is designed, and a low power state delay register is defined internally. The system can set a reasonable low power state delay according to the chip process to realize the state machine transition. A variety of power consumption modes are defined internally, which greatly improves the reusability and portability of the power management module. The designed PMU module innovatively proposes a free configuration mode. The user can turn off (or turn on) the power supply, clock and reset signal of one or more power domains that can be turned off in any order according to the enable requirements of each functional module of the system, which greatly improves the flexibility of the power management module. The internally designed register circuit memorizes the power-on and power-off information of each power domain that can be turned off. The system can obtain the power-on and power-off information of each power domain that can be turned off according to this register circuit, and then complete the power consumption control. This design method can significantly improve the reliability and timeliness of the system's low power control.
[0044] (3) The present invention proposes a method for co-designing UPF design and power management module based on the low-power design information such as the turnable module, the design requirements of the turnable module, and the voltage state table created in the UPF design process to complete the low-power control circuit design of the relevant modules; the UPF design process completes the design of the UPF file and the feasibility verification of the power mode according to the low-power control signal of the turnable module, the RTL level of the low-power control signal of the turnable module, and the low-power mode information of the design defined in the PMU design process. This method adopts the design concept of parallel development, can efficiently complete the low-power design of the SoC front end, and greatly reduce the time cost of low-power design.
[0045] (4) The low-power reset and clock system module designed by the ultra-low power optimization design method for an industrial microcontroller of the present invention has good versatility for the low-power design of industrial microcontrollers. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 is a multi-power domain planning diagram of a microcontroller in an embodiment of the present invention;
[0047] Figure 2 is a diagram of a UPF and PMU collaborative design method proposed in an embodiment of the present invention;
[0048] Figure 3 This is a diagram of a general low-power architecture scheme for a shut-down power domain designed in an embodiment of the present invention;
[0049] Figure 4 This is a diagram of the ecdsaPD low power architecture solution designed in an embodiment of the present invention;
[0050] Figure 5 This is a diagram of the cortexm0PD low-power architecture designed in an embodiment of the present invention;
[0051] Figure 6 It is an overall framework diagram of the power consumption management module in an embodiment of the present invention;
[0052] Figure 7 is a state transition diagram of a state machine of a power consumption management module in an embodiment of the present invention;
[0053] Figure 8 This is a diagram of the architecture of a microcontroller ultra-low power design clock system in an embodiment of the present invention;
[0054] Fig. 9 This is a microcontroller ultra-low power design reset system architecture diagram in an embodiment of the present invention;
[0055] Fig.10 It is a diagram of the software and hardware control relationship of the system working mode in an embodiment of the present invention. DETAILED DESCRIPTION
[0056] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0057] Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.
[0058] like Figure 1-10As shown, the present invention provides a technical solution: based on the functional enabling requirements of each module of the system, a normally open power domain and a shut-down power domain are created in the UPF design module. The normally open power domain is ChipTopPD, which includes Cortex-M3, JTAG, FLASH, EXRAM, SRAM, DMAC, SYSTEM Controller, ECT, WDT, RTC, SEMOPHORE, PLL, GPIO, on-chip bus, and Power Management Unit; the shut-down power domain is cortexm0PD, ecdsaPD, eepromPD, timerPD, pitPD, uart0PD, uart1PD, uart2PD, uart3PD, uart4PD, uart5PD, pwmPD, i2cPD, mscanPD, adcPD, and spiPD, and each shut-down power domain contains a module corresponding to the domain name. For the normally open power domain, the power supply remains powered in various power consumption modes. For the shut-down power domain, power is maintained in normal mode and sleep mode, and power is stopped in deep sleep mode. In free configuration mode, when the modules in a power domain do not need to be enabled, the software controls the power management module to shut down the power or clock of this power domain, so as to flexibly reduce the system power consumption.
[0059] Since the operating voltage of each module of the microcontroller is 1.35V, the UPF design module creates the following Figure 1 The microcontroller VDD and VSS power supply networks shown in the figure. For the power domains that can be turned off, eepromPD, timerPD, pitPD, uart0PD, uart1PD, uart2PD, uart3PD, uart4PD, uart5PD, pwmPD, i2cPD, mscanPD, adcPD, and spiPD, the internal low-power architecture defined by UPF is the same, such as Figure 3 As shown, the circuit modules are divided into a shutoff power domain, in which a Header-type power switch capable of switching the VDD power supply network, a type of module input signal isolation unit, and a type of module output signal isolation unit are defined. The isolation unit is arranged in the parent domain, the normally open domain of ChipTopPD, and the power supply is VDD and VSS in ChipTopPD. The power supply of the module is VSS and VDD output by the power switch. The power switch control signal switch, the module input signal isolation unit enable signal isoen_i, and the module output signal isolation unit enable signal isoen_o all come from the PMU.
[0060] For the ecdsaPD and cortexm0PD power domains, different low-power architectures are defined in the UPF design.
[0061] Figure 4 The low-power architecture diagram of the ECDSA module defined for UPF subdivides three power domains that can be turned off, namely ecdsaPD, SignPD, and VeriPD. EcdsaPD includes the entire ECDSA circuit system, SignPD includes the ECDSA signature function module, and VeriPD includes the ECDSA signature verification function module. Figure 3 The low-power architecture shown is similar, and each power-off domain contains a Header-type power switch, a type of module input signal isolation unit, and a type of module output signal isolation unit. The power supply of SignPD and VeriPD comes from VSS and the VDD output by the power switch in ecdsaPD. The power supply of the modules contained in the power-off domain is the VDD output by the power switch in the domain. The isolation units ④ and ⑨ of ecdsaPD are arranged in ChipTopPD, and the isolation units ⑤ and ⑥ of SignPD and the isolation units ⑦ and ⑧ of VeriPD are arranged in ecdsaPD. The power supply of all isolation units comes from VDD and VSS in ChipTopPD. The retention cell of the retention register is defined in the AhbIf module of ECDSA. This unit is powered by two power supplies, namely the VDD from ChipTopPD and the VDD output by the power switch in ecdsaPD. The power switch control signal TopPwrSw and isolation unit enable signal TopIsoCtrlIn and TopIsoCtrlOut in ecdsaPD, the power switch control signal SPwrSw and isolation unit enable signal SIsoCtrlIn and SIsoCtrlOut in SignPD, and the power switch control signal VPwrSw and isolation unit enable signal VIsoCtrlIn and VIsoCtrlOut in VeriPD all come from the PMU module.
[0062] Figure 5 The low-power architecture diagram of the Cortex_M0 module defined by UPF is divided into three power domains, namely cortexm0PD, SysPD, and DbgPD. The cortexm0PD is the normally open power domain, which includes the entire Cortex_M0 circuit system. The SysPD is the shutoff power domain, which includes the Cortex_M0 system functional module. The DbgPD is the shutoff power domain, which includes the debug functional module. Figure 3The low-power architecture shown is similar. Each power-off domain contains a Header-type power switch, a type of module input signal isolation unit, and a type of module output signal isolation unit. The power supply of SysPD and DbgPD comes from VSS and VDD in ChipTopPD. The power supply of the modules contained in the power-off domain is the VDD output by the power switch in the domain. The isolation units ⑤ and ⑥ of SysPD and the isolation units ⑦ and ⑧ of VeriPD are arranged in cortexm0PD. The power supply of all isolation units comes from VDD and VSS in ChipTopPD. The retention register retention cell is defined in the SYS module of Cortex-M0, which is the same as the retention register defined in the AhbIF module of ECDSA. This unit is powered by two power supplies, namely VDD from ChipTopPD and VDD output by the power switch in SysPD. The power switch control signal SysPwrSw and the isolation unit enable signals SysIsoCtrlIn and SysIsoCtrlOut in SysPD, and the power switch control signal DbgPwrSw and the isolation unit enable signals DbgIsoCtrlIn and DbgIsoCtrlOut in DbgPD are all controlled by the PMU module.
[0063] In this embodiment, the overall framework of the designed power consumption management module is shown in the figure below: Figure 6 As shown, the PMU top-level module includes two parts: the APB interface module and the PMU module. The APB interface module is used by the microcontroller to realize functional control of the PMU by reading and writing registers. The PMU-related data, control, and flag registers are defined internally. The data register includes the register for the number of clocks required for each control sequence (clock, reset, register retention, register recovery, isolation unit, power switch control) when the PMU controls the power-off module to power on or off. The control register includes the power-off enable and power-on enable control registers of each power-off module of the microcontroller. The flag register includes the power-off completion flag and power-on completion flag register of each power-off module. The PMU module is used to coordinate with the designed system UPF module to realize the hardware control of the power-on and power-off processes of the power-off modules. The state jump of the internally designed state machine is shown as follows. Figure 7 As shown, including:
[0064] S1: All modules of the microcontroller complete the initial power-on reset;
[0065] S2: Wait for software configuration to shut down the power domain and power-down and power-up enable registers;
[0066] S3: Software configuration can shut down the power domain, power down and power up enable registers;
[0067] S4: Determine whether the module can be powered off and enabled. If yes, proceed to step 5 - power off the module can be powered off. If not, proceed to S11 - power on the module can be powered off;
[0068] S5: The clock off delay counter off_clk_cnt starts counting, which can turn off the module input clock gating enable and turn off the clock. When off_clk_cnt is equal to the clock off delay configuration input value t_off_clk, the state jumps to S6;
[0069] S6: The isolation unit enable delay counter on_iso_cnt starts counting, which can shut down the module input and output signal isolation unit enable. The input signal is fixed to "0" and the output signal is fixed to the reset value to prevent the "X" state of the output signal from affecting the function of the next level circuit after power failure. When on_iso_cnt is equal to the isolation unit enable delay configuration input value t_on_iso, the state jumps to S7;
[0070] S7: The hold register save enable delay counter save_cnt starts counting, and the module hold register save signal enable can be turned off. The internal register data that defines the hold register function will be saved to the hold register (the hold register is powered on and the data does not disappear). When save_cnt is equal to the hold register save enable delay configuration input value t_save, the state jumps to S8;
[0071] S8: The reset enable delay counter on_rst_cnt starts counting, and the module reset signal enable can be turned off. When on_rst_cnt is equal to the reset enable delay configuration input value t_on_rst, the state jumps to S9;
[0072] S9: The power switch off delay counter off_pwr_cnt starts counting, and the module power switch signal can be turned off. The power supply of the module will be turned off, and its dynamic and static power consumption will be reduced to 0W, which greatly reduces the power consumption of the microcontroller. When off_pwr_cnt is equal to the power switch off delay configuration input value t_off_rst, the state jumps to S10;
[0073] S10: The power-off of the power domain that can be turned off is completed, the power-off completion flag signal of the corresponding power domain that can be turned off is pulled high, and the state jumps to S2;
[0074] S11: The power switch on delay counter on_pwr_cnt starts counting, the module power switch signal can be turned off, and the module resumes normal power supply. When on_pwr_cnt is equal to the power switch on delay configuration input value t_on_rst, the state jumps to S12;
[0075] S12: The reset disable delay counter off_rst_cnt starts counting, which can turn off the module reset signal prohibition, and the module terminates the reset. When off_rst_cnt is equal to the reset disable delay input value t_off_rst, the state jumps to S13;
[0076] S13: The holding register restore delay counter restore_cnt starts counting, and the module holding register restore signal can be turned off. The data stored in the holding register before the module is powered off will be restored to the corresponding register. When restore_cnt is equal to the holding register restore delay configuration input t_restore, the state jumps to S14;
[0077] S14: The isolation unit prohibition delay counter off_iso_cnt starts counting, which can shut down the module input and output signals. The isolation unit is prohibited, and the module input and output signals are no longer isolated, and normal input and output can be achieved. When off_iso_cnt is equal to the isolation unit prohibition delay configuration input t_off_iso, the state jumps to S15;
[0078] S15: The clock enable delay counter on_clk_cnt starts counting, which can shut down the module input clock gating prohibition. When on_clk_cnt is equal to the clock enable delay configuration input value t_on_clk, the state jumps to S16;
[0079] S16: The power-on of the shut-off power domain is completed, the power-on completion flag signal of the corresponding shut-off power domain is pulled high, and the state jumps to S2;
[0080] In this embodiment, the microcontroller low power design clock system architecture diagram is as follows: Figure 8 As shown in the figure, the microcontroller includes two crystal oscillators, one on-chip and one off-chip. The system controller divides the off-chip crystal oscillator clock signal entering the PLL by configuring the PLL division coefficient, and outputs high-frequency clocks of different frequencies. Then the system controller selects the required clock as Core_clk from the on-chip crystal oscillator output clock and the PLL output multi-frequency clock by configuring the core clock Core_clk chip select register. The power management module input clock is Core_clk. For the module clock in the power domain that can be turned off, the power management module will power on and off according to the power-on and power-off requirements controlled by the software. Figure 7The specified hardware timing performs clock gating enable or clock gating disable operations, and then outputs to the corresponding power domain module that can be turned off. The DMAC module is also designed with a low-power mode - clock shutdown and reset enable, so its clock and reset signals are also controlled by the power management module. The clock inputs of all modules except DMAC in the normally-on power domain of the microcontroller do not need to be controlled by the power management module, and are all Core_clk. FCLK is the clock that the microcontroller can run freely. The system controller selects the external crystal oscillator output clock or the internal crystal oscillator output clock as FCLK. This clock is used to provide a delay count reference for each reset signal of the system.
[0081] In this embodiment, the microcontroller low power design reset system architecture diagram is as follows: Fig. 9 As shown in the figure, the microcontroller power-on reset includes the following processes:
[0082] S1: The chip is powered on and the external reset signal RESET is enabled;
[0083] S2: After a certain delay and signal synchronization deburring, the microcontroller power-on reset RST_POR is enabled. This reset signal is mainly used to reset PLL / MBIST and system controller;
[0084] S3: After a certain delay, the microcontroller system reset RST_SOC is enabled. This reset signal is used to reset the memory, peripherals, on-chip bus, and PMU in the normally-on power domain on the chip except DMAC. The reset of these modules is also controlled by the system controller, which can shut down all modules in the power domain and the reset signal of DMAC comes from the gating and synchronization output of RST_SOC by PMU.
[0085] S4: After a certain delay, the Cortex-M3 main processor powers on the reset M3_POR enabled. This reset signal is used to power on the Cortex-M3 core and the Cortex-M3 system reset synchronization module. These modules are also controlled by the system controller.
[0086] S5: After a certain delay, the Cortex-M0 coprocessor power-on reset M0_POR is enabled. M0_POR is used to power-on reset the Cortex-M0 core and the Cortex-M0 system reset synchronization module. The system controller also controls the reset of these modules. For the system reset signal M0_SYSRST of the Cortex-M0 coprocessor, it needs to be gated and synchronized by the PMU module to achieve the system's low-power design purpose for Cortex-M0.
[0087] In this embodiment, the designed system working mode software and hardware control relationship diagram is as follows: Fig.10As shown, when the system completes initialization and power-on, it enters normal mode, all modules are powered on and the input clock signals of each module jump normally. In this working mode, if each functional module runs at high speed, the power consumption of the microcontroller in this state is the highest.
[0088] If the microcontroller does not need the core to process tasks and only needs to enable peripherals, the system enters the sleep mode from the normal mode through the software control. The sleep mode defined in this solution is specifically: the clock of the Cortex-M3 main processor is turned off, the SysPD and DbgPD in the cortexm0PD power domain can shut down the power domain and power off, and the other modules on the chip work normally. For the system to enter the sleep mode from the normal mode, the specific idea in the software design is: first enable the peripheral interrupt, then the software configures the SysPD and DbgPD power-down enable registers in the PMU, and when the power-down end flags of these two power domains are pulled high, execute the WFI() instruction (this instruction is a general instruction for the Cortex-M3 core to enter the low-power mode, turn off the Cortex-M3 main processor clock, and put it into the low-power mode). If the RTC timed wake-up function is required, it is necessary to configure the RTC before executing the WFI() instruction, set the start time and end time, and enable the RTC. After this process, the system enters the sleep mode. When a peripheral generates a hardware interrupt, the WIC (Wake-up Interrupt Controller) will wake up the Cortex-M3 main processor, restore its clock signal to jump, and exit the low-power mode. Then the software configures the SysPD and DbgPD power-on enable registers in the PMU. When the power-on end flags of these two power domains are pulled high, the system completes the jump from sleep mode to normal mode.
[0089] If the microcontroller does not need the core to process transactions or enable peripherals, the system can enter deep sleep mode from normal mode through software control. The deep sleep mode defined in this solution is as follows: the clock of the Cortex-M3 main processor is turned off, the DMAC is reset and the clock is turned off, all power domains that can be turned off are powered off, and the remaining modules on the chip work normally. For the system to enter sleep mode from normal mode, the specific idea in the software design is: first enable peripheral interrupts, then configure the power-down enable register of all power domains that can be turned off and the DMAC function disable register of the PMU, when all power domains that can be turned off are powered off and the DMAC function disable (reset and clock off) flag is pulled high, execute the WFI() instruction. If the RTC timed wake-up function is required, it is necessary to configure the RTC before executing the WFI() instruction, set the start time and end time, and enable the RTC. After this process, the system enters deep sleep mode. When a peripheral generates a hardware interrupt, the WIC (Wake-up Interrupt Controller) will wake up the Cortex-M3 main processor, resume its clock signal transition, and exit the low-power mode. Then the software configures the PMU power-on enable registers and DMAC function enable registers for all power-off power domains that can be turned off. When the power-on completion flag bits and the DMAC function enable flag bits of all power-off power domains that can be turned off are pulled high, the system completes the jump from deep sleep mode to normal mode.
[0090] If the microcontroller needs to flexibly control the switch of the power domain that can be turned off, the software controls the system from normal mode to free configuration mode. The free configuration mode defined in this solution is specifically: the Cortex-M3 main processor maintains normal operation. If some modules or DMAC in the power domain that can be turned off do not need to be enabled during the operation of the chip, the software can freely control the disabled modules to power off or turn off the clock and reset at any time, instead of controlling the fixed modules to enter low power mode at the same time as entering sleep mode and deep sleep mode. For the system to enter free configuration mode from normal mode, the specific idea in the software design is: first print out the information of the modules that have been powered off or the clock is turned off, determine that the modules that need to be turned off next have not been turned off, and then configure the power-off enable register of the modules that need to be turned off in the PMU. When the power-off end flag of the module that is turned off is pulled high, it means that the module has been turned off. After this process, the system enters the free configuration mode. When the system has a module that is turned off again, the software will repeat the above steps to turn off the module that needs to be turned off. When the system needs to jump from free configuration mode to normal mode, software control is also required to power on or turn on the clock of all modules in low power state. First, print out the information of the modules that are currently powered off or whose clocks are turned off. Based on this, configure the power-on enable registers of the modules that need to be turned on in the PMU. When the power-on completion flags of all modules that need to be turned on are pulled high, it means that the system has exited to normal mode.
[0091] In summary, the ultra-low power optimization design method of an industrial microcontroller of the present invention utilizes multiple power domains, gated power supplies, and gated clock technologies to complete the design of chip power consumption intentions at the chip architecture level, greatly improving the optimization of chip power consumption. At the same time, this solution has the characteristics of systematization, process-based, and portable, which can greatly shorten the low-power design cycle and has extremely high practical value. In addition, this solution adopts the design idea of collaborative design and collaborative simulation of UPF and power management module, discovers problems in low-power design in the early stage of design, improves the reliability of system low-power design, and effectively reduces the cost of low-power development. The present invention designs a variety of power consumption modes, including normal mode, sleep mode, deep sleep mode, and free configuration mode, and adopts a combination of software and hardware control to achieve efficient switching between power consumption modes. In deep sleep mode, the system power consumption is reduced by 80% compared to when the chip is not designed for low power consumption, and the designed power management module supports free configuration mode. The user can turn off or turn on the power supply of one or more power domains that can be turned off at any time through software control according to the enabling requirements of each functional module of the system, thereby improving the flexibility of low-power control of the system. This ultra-low power design greatly reduces the power consumption of the chip system and can significantly improve the market competitiveness of microcontroller products.
[0092] In the several embodiments provided by the present invention, it should be understood that the apparatus and method disclosed by the present invention can be implemented in other ways. For example, the apparatus embodiments described above are only illustrative, for example, the division of the modules is only a logical function division, and there are other division methods in actual implementation, such as combining or integrating multiple modules or components into another system, or ignoring or not executing some features.
[0093] In addition, each functional module in each embodiment of the present invention is integrated into a processing module, each module exists physically separately, or two or more modules are integrated into one module. The above integrated modules are implemented in the form of hardware or hardware plus software functional modules.
[0094] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants 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.
[0095] Finally, it should be noted that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for a person skilled in the art to modify the technical solutions described in the aforementioned embodiments or to replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. An ultra-low power consumption optimization design method for an industrial microcontroller, characterized in that: The method includes a UPF design module, a power management module, a low power reset and clock system module; The low-power architecture of each module is designed as follows: For the power-off domains eepromPD, timerPD, pitPD, uart0PD, uart1PD, uart2PD, uart3PD, uart4PD, uart5PD, pwmPD, i2cPD, mscanPD, adcPD, and spiPD, the internal low-power architecture defined by UPF is the same, and the circuit modules are divided into the power-off domain. A Header-type power switch capable of switching the VDD power supply network, a type of module input signal isolation unit, and a type of module output signal isolation unit are defined in the power-off domain; the isolation unit is arranged in the parent domain - the normally open domain of ChipTopPD, and the power supply is VDD and VSS in ChipTopPD; the power supply of the module is VSS and VDD output by the power switch, and the power switch control signal switch, the module input signal isolation unit enable signal isoen_i, and the module output signal isolation unit enable signal isoen_o are all from PMU; There are three power-off domains, namely ecdsaPD, SignPD, and VeriPD. ecdsaPD includes the entire ECDSA circuit system, SignPD includes the ECDSA signature function module, and VeriPD includes the ECDSA signature verification function module. Each power-off domain includes a Header-type power switch, a type of module input signal isolation unit, and a type of module output signal isolation unit. The power supply of SignPD and VeriPD comes from VSS and VDD output by the power switch in ecdsaPD, and the power supply of the modules included in the power-off domain is VDD output by the power switch in the domain. The isolation units ④ and ⑨ of ecdsaPD are arranged in ChipTopPD, and the isolation units ⑤ and ⑥ of SignPD and the isolation units ⑦ and ⑧ of VeriPD are all arranged in ecdsaPD. The power supply of all isolation units comes from VDD and VSS in ChipTopPD. The retention register is defined in the AhbIf module of ECDSA. cell, this unit is powered by two power supplies, namely VDD from ChipTopPD and VDD output by the power switch in ecdsaPD; the power switch control signal TopPwrSw, isolation unit enable signals TopIsoCtrlIn and TopIsoCtrlOut in ecdsaPD, the power switch control signal SPwrSw, isolation unit enable signals SIsoCtrlIn and SIsoCtrlOut in SignPD, the power switch control signal VPwrSw, isolation unit enable signals VIsoCtrlIn and VIsoCtrlOut in VeriPD, all come from the PMU module; The Cortex_M0 module is divided into three power domains for low power consumption, namely cortexm0PD, SysPD, and DbgPD. The cortexm0PD is a normally open power domain, which includes the entire Cortex_M0 circuit system. The SysPD is a shutoff power domain, which includes the Cortex_M0 system functional module. The DbgPD is a shutoff power domain, which includes the debug functional module. Each shutoff power domain contains a Header type power switch, a type of module input signal isolation unit, and a type of module output signal isolation unit. The power supply of SysPD and DbgPD comes from VSS and VDD in ChipTopPD, and the power supply of the modules included in the shutoff power domain is the VDD output by the power switch in the domain. The isolation units ⑤ and ⑥ of SysPD and the isolation units ⑦ and ⑧ of VeriPD are all arranged in cortexm0PD, and the power supply of all isolation units comes from VDD and VSS in ChipTopPD. The retention register is defined in the SYS module of Cortex-M0. cell, which is the same as the holding register defined in the AhbIF module of ECDSA. This unit is powered by two power supplies, namely VDD from ChipTopPD and VDD output by the power switch in SysPD. The power switch control signal SysPwrSw in SysPD, the isolation unit enable signal SysIsoCtrlIn and SysIsoCtrlOut, the power switch control signal DbgPwrSw in DbgPD, the isolation unit enable signal DbgIsoCtrlIn and DbgIsoCtrlOut are all controlled by the PMU module. The top-level module of PMU includes two parts: APB interface module and PMU module. The APB interface module is used by the microcontroller to realize the functional control of PMU by reading and writing registers. The APB interface module defines PMU-related data, control and flag registers. The data register includes the register of the number of clocks consumed by each control sequence when the PMU controls the power-on or power-off of the shutdown module. The control register includes the power-off enable and power-on enable control registers of each shutdown module of the microcontroller. The flag register includes the power-off completion flag and power-on completion flag register of each shutdown module. The PMU module is used to coordinate with the designed system UPF module to realize the hardware control of the power-on and power-off process of the shut-down module. The specific control process includes: S1: All modules of the microcontroller complete the initial power-on reset; S2: Wait for software to configure the power domain that can be shut down and the power-down and power-up enable registers; S3: Software configuration can shut down the power domain, power down and power up enable registers; S4: Determine whether the power-off enabling of the shut-down module is established. If established, proceed to S5 - power-off enabling of the shut-down module. If not established, proceed to S11 - power-on enabling of the shut-down module. S5: The clock off delay counter off_clk_cnt starts counting, which can turn off the module input clock gating enable and turn off the clock. When off_clk_cnt is equal to the clock off delay configuration input value t_off_clk, the state jumps to S6; S6: The isolation unit enable delay counter on_iso_cnt starts counting, which can shut down the module input and output signal isolation unit enable. The input signal is fixed to "0" and the output signal is fixed to the reset value to prevent the "X" state of the output signal from affecting the next level circuit function after power failure. When on_iso_cnt is equal to the isolation unit enable delay configuration input value t_on_iso, the state jumps to S7; S7: The hold register save enable delay counter save_cnt starts counting, and the module hold register save signal enable can be turned off. The internal register data that defines the hold register function will be saved to the hold register. When save_cnt is equal to the hold register save enable delay configuration input value t_save, the state jumps to S8; S8: The reset enable delay counter on_rst_cnt starts counting, and the module reset signal enable can be turned off. When on_rst_cnt is equal to the reset enable delay configuration input value t_on_rst, the state jumps to S9; S9: The power switch off delay counter off_pwr_cnt starts counting, and the module power switch signal can be turned off. The power supply of the module will be turned off, and its dynamic and static power consumption will be reduced to 0W, which greatly reduces the power consumption of the microcontroller. When off_pwr_cnt is equal to the power switch off delay configuration input value t_off_rst, the state jumps to S10; S10: The power-off of the power domain that can be turned off is completed, the power-off completion flag signal of the corresponding power domain that can be turned off is pulled high, and the state jumps to S2; S11: The power switch on delay counter on_pwr_cnt starts counting, the module power switch signal can be turned off, and the module resumes normal power supply. When on_pwr_cnt is equal to the power switch on delay configuration input value t_on_rst, the state jumps to S12; S12: The reset disable delay counter off_rst_cnt starts counting, which can turn off the module reset signal prohibition, and the module terminates the reset. When off_rst_cnt is equal to the reset disable delay input value t_off_rst, the state jumps to S13; S13: The holding register restore delay counter restore_cnt starts counting, and the module holding register restore signal can be turned off. The data stored in the holding register before the module is powered off will be restored to the corresponding register. When restore_cnt is equal to the holding register restore delay configuration input t_restore, the state jumps to S14; S14: The isolation unit prohibition delay counter off_iso_cnt starts counting, which can shut down the module input and output signals. The isolation unit is prohibited, and the module input and output signals are no longer isolated, and normal input and output can be achieved. When off_iso_cnt is equal to the isolation unit prohibition delay configuration input t_off_iso, the state jumps to S15; S15: The clock enable delay counter on_clk_cnt starts counting, which can shut down the module input clock gating prohibition. When on_clk_cnt is equal to the clock enable delay configuration input value t_on_clk, the state jumps to S16; S16: The power-on of the shutoff power domain is completed, the power-on completion flag signal corresponding to the shutoff power domain is pulled high, and the state jumps to S2.
2. The method for optimizing the design of an ultra-low power consumption industrial microcontroller according to claim 1, characterized in that: The designed low-power microcontroller clock system includes two types of crystal oscillators, one is off-chip and the other is on-chip. The system controller divides the off-chip crystal oscillator clock signal entering the PLL by configuring the PLL division coefficient, and outputs high-frequency clocks of different frequencies. Then, the system controller selects the required clock as Core_clk from the on-chip crystal oscillator output clock and the PLL output multi-frequency clock by configuring the core clock Core_clk chip select register. The input clock of the power management module is Core_clk. For the module clock in the power-off domain, the power management module will output it to the corresponding power-off domain module according to the power-on and power-off requirements controlled by the software. The DMAC module is also designed with a low-power mode - clock shutdown and reset enable, so its clock and reset signals are also controlled by the power management module. The clock inputs of all modules except DMAC in the normally-on power domain of the microcontroller do not need to be controlled by the power management module, and are all Core_clk. FCLK is the clock that the microcontroller can run freely. The system controller selects the off-chip crystal oscillator output clock or the on-chip crystal oscillator output clock as FCLK. This clock is used to provide a delay counting reference for each reset signal of the system.
3. The method for optimizing the design of an ultra-low power consumption industrial microcontroller according to claim 1, characterized in that: The designed low-power microcontroller power-on reset includes the following processes: S1: The chip is powered on and the external reset signal RESET is enabled; S2: After a certain delay and signal synchronization deburring, the microcontroller power-on reset RST_POR is enabled. This reset signal is mainly used to reset PLL / MBIST and system controller; S3: After a certain delay, the microcontroller system reset RST_SOC is enabled. This reset signal is used to reset the memory, peripherals, on-chip bus, and PMU in the normally open power domain on the chip except DMAC. The reset of these modules is also controlled by the system controller, which can shut down all modules in the power domain and the reset signal of DMAC comes from the gate control and synchronization output of RST_SOC by PMU; S4: After a certain delay, the Cortex-M3 main processor powers on the reset M3_POR enabled. This reset signal is used to power on the reset of the Cortex-M3 core and the Cortex-M3 system reset synchronization module. These modules are also controlled by the system controller. S5: After a certain delay, the Cortex-M0 coprocessor power-on reset M0_POR is enabled. M0_POR is used to power-on reset the Cortex-M0 core and the Cortex-M0 system reset synchronization module. The system controller also controls the reset of these modules. For the system reset signal M0_SYSRST of the Cortex-M0 coprocessor, it needs to be gated and synchronized by the PMU module to achieve the system's low-power design purpose for Cortex-M0.
4. The method for optimizing the design of an ultra-low power consumption industrial microcontroller according to claim 1, characterized in that: The designed power management module includes the following software and hardware control methods for the operation status of each module of the microcontroller and the switching of the operation mode: When the system completes initialization and is powered on, it enters normal mode, all modules are powered on and the input clock signals of each module jump normally. In this working mode, if all functional modules run at high speed, the power consumption of the microcontroller in this state is the highest; If the microcontroller does not need the core to process tasks and only needs to enable peripherals, the system enters the sleep mode from the normal mode through the software control; the sleep mode is specifically: the clock of the Cortex-M3 main processor is turned off, the SysPD and DbgPD in the cortexm0PD power domain can shut down the power domain, and the other modules on the chip work normally; for the system to enter the sleep mode from the normal mode, the specific idea in the software design is: first enable the peripheral interrupt, then the software configures the SysPD and DbgPD power-down enable registers in the PMU, and when the power-down end flag bits of these two power domains are pulled high, execute the WFI() instruction, which is the Cortex-M3 core to enter The general instruction to enter low power mode turns off the Cortex-M3 main processor clock to put it into low power mode. If the RTC timed wake-up function is required, it is necessary to configure the RTC before executing the WFI() instruction, set the start time and end time and enable the RTC. After this process, the system enters the sleep mode; when the peripheral generates a hardware interrupt, the WIC will wake up the Cortex-M3 main processor, restore its clock signal to jump, exit the low power mode, and then configure the SysPD and DbgPD power-on enable registers in the PMU by software. When the power-on end flag bits of these two power domains are pulled high, the system completes the jump from sleep mode to normal mode; If the microcontroller does not need the core to process transactions or enable peripherals, the software control system enters deep sleep mode from normal mode; deep sleep mode is specifically: the clock of the Cortex-M3 main processor is turned off, the DMAC is reset and the clock is turned off, all power domains that can be turned off are powered off, and the remaining modules on the chip work normally; for the system to enter sleep mode from normal mode, first enable peripheral interrupts, then configure the power-down enable register of all power domains that can be turned off and the DMAC function disable register of the PMU by software, and when the power-down end flag bit of all power domains that can be turned off and the DMAC function disable flag bit are pulled high, execute WFI() Instruction. If the RTC timed wake-up function is required, it is necessary to configure the RTC before executing the WFI() instruction, set the start time and end time and enable the RTC. After this process, the system enters the deep sleep mode; when the peripheral generates a hardware interrupt, the WIC will wake up the Cortex-M3 main processor, restore its clock signal to jump, exit the low power mode, and then the software configures the PMU all power domain power-on enable registers and DMAC function enable registers that can be turned off. When all power domain power-on end flags and DMAC function enable flags that can be turned off are pulled high, the system completes the jump from deep sleep mode to normal mode; If the microcontroller needs to flexibly control the switch of the power domain that can be turned off, the software control system enters the free configuration mode from the normal mode; the free configuration mode is specifically: the Cortex-M3 main processor maintains normal operation. If some modules or DMAC in the power domain that can be turned off do not need to be enabled during the operation of the chip, the software can freely control the disabled modules to power off or turn off the clock and reset at any time, instead of controlling fixed modules to enter low power mode at the same time as entering sleep mode and deep sleep mode; for the system to enter the free configuration mode from the normal mode, first print out the information of the modules that have been powered off or the clock turned off, and make sure that the modules that need to be turned off next have not been turned off. Then configure the power-off enable register of the module that needs to be turned off in the PMU. When the power-off end flag of the turned-off module is pulled high, it means that the module has been turned off. After this process, the system enters the free configuration mode. When the system has a turned-off module again, the software will repeat the above steps to turn off the module that needs to be turned off. When the system needs to jump from the free configuration mode to the normal mode, the software control is also required to power on all modules in the low-power state or turn on the clock. First, print out the information of the module that has been powered off or the clock is turned off, configure the power-on enable register of the module that needs to be turned on in the PMU. When the power-on end flag of all modules that need to be turned on is pulled high, it means that the system has exited to the normal mode.
5. The method for optimizing the design of an ultra-low power consumption industrial microcontroller according to claim 1, characterized in that: The PMU design process is based on the low-power design information such as the shut-down modules defined in the UPF design process, the shut-down module design requirements, and the voltage state table created to complete the low-power control circuit design of the relevant modules; The UPF design process completes the design of the UPF file and verifies the feasibility of the power consumption mode according to the low-power control signal of the shut-down module defined in the PMU design process, the RTL level of the low-power control signal of the shut-down module, and the designed low-power consumption mode information.
