JP2013109559A - Information processor and data return method - Google Patents

Information processor and data return method Download PDF

Info

Publication number
JP2013109559A
JP2013109559A JP2011253703A JP2011253703A JP2013109559A JP 2013109559 A JP2013109559 A JP 2013109559A JP 2011253703 A JP2011253703 A JP 2011253703A JP 2011253703 A JP2011253703 A JP 2011253703A JP 2013109559 A JP2013109559 A JP 2013109559A
Authority
JP
Japan
Prior art keywords
data
operation mode
clock
storage means
processing apparatus
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2011253703A
Other languages
Japanese (ja)
Other versions
JP5660010B2 (en
Inventor
Masahide Sakano
将秀 坂野
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Toyota Motor Corp
Original Assignee
Toyota Motor Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Toyota Motor Corp filed Critical Toyota Motor Corp
Priority to JP2011253703A priority Critical patent/JP5660010B2/en
Publication of JP2013109559A publication Critical patent/JP2013109559A/en
Application granted granted Critical
Publication of JP5660010B2 publication Critical patent/JP5660010B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

PROBLEM TO BE SOLVED: To provide an information processor capable of reducing consumption power at sleep time by suppressing an impact of a manufacturing process.SOLUTION: An information processor 100 includes saved data storage means for holding data during a second operation mode that is generated by working storage means during a first operation mode for executing a program, and the information processor includes: clock generation means 19 and 20 for generating an operation clock of the second operation mode and a greater operation clock of the first operation mode than the operation clock of the second operation mode; first data return means 41 for, at the time of return from the second mode, returning information processor status data showing a status of the information processor from the saved data storage means to the working storage means before an increase to the operation clock of the first operation mode by the clock generation mode; and second data return means 46 for returning the data generated during the first operation mode from the saved data storage means to the working storage means after the increase to the operation clock of the first operation mode by the clock generation means.

Description

本発明は、プログラムを実行する実行モードと実行モードよりも消費電力を低減する省電力モードを有する情報処理装置に関する。   The present invention relates to an information processing apparatus having an execution mode for executing a program and a power saving mode for reducing power consumption compared to the execution mode.

多くのマイコンは、一定条件下で一部の回路の動作を停止したり動作クロックを低減するスリープモードを備える。スリープモードでは、ウェイクアップ処理などに必要な回路を残して他の回路への動作クロックや電源供給が遮断されることで、消費電力が低減される。   Many microcomputers have a sleep mode in which the operation of some circuits is stopped under a certain condition and the operation clock is reduced. In the sleep mode, power consumption is reduced by cutting off operation clocks and power supply to other circuits while leaving a circuit necessary for wake-up processing or the like.

しかしながら、半導体の製造プロセスの微細化が進むと、電源供給されていない回路に電流が流れるリーク電流が消費電力の低減を阻害するようになってきた。   However, as the semiconductor manufacturing process becomes finer, a leakage current that flows through a circuit that is not supplied with power has hindered reduction in power consumption.

図1は、マイコンのリーク電流を説明する図の一例である。スリープモードに入る前の通常動作モードでは、レジスタ、CPU、RAM、CANコントローラ、A/Dコンバータ、及び、タイマに動作クロックと電源が供給される(斜線の回路)。マイコンがスリープモードに入ると、レジスタ、CPU、及び、RAMを残して他の回路への動作クロックと電源の供給が停止される。この場合、レジスタ、CPU、及び、RAMの間でのみ電流が流れるはずだが、製造プロセスによっては動作が停止している回路に電流が漏れ出す場合がある。   FIG. 1 is an example of a diagram for explaining leakage current of a microcomputer. In the normal operation mode before entering the sleep mode, an operation clock and power are supplied to the register, CPU, RAM, CAN controller, A / D converter, and timer (shaded circuit). When the microcomputer enters the sleep mode, supply of the operation clock and power to other circuits is stopped, leaving the register, CPU, and RAM. In this case, a current should flow only between the register, the CPU, and the RAM, but the current may leak to a circuit whose operation is stopped depending on the manufacturing process.

このような電流のリークは、レジスタやRAMがCPU以外の回路と接続されており、マイコン内の他の回路同士を接続する電線がレジスタやRAMと密接しているため、レジスタやRAMへ電源が供給されるとその電流が電線に漏れるために生じると考えられる。   Such a current leak occurs because the register and RAM are connected to a circuit other than the CPU, and the wires connecting the other circuits in the microcomputer are in close contact with the register and RAM. When supplied, the current is considered to be leaked to the electric wire.

そこで、スリープ時のリーク電流を低減する技術が考えられている(例えば、特許文献1参照。)。特許文献1には、第1,第2ブロックを異なる製造プロセスにより製造し、スリープ時、第2ブロックは、第2ブロックよりもリーク電流量を低減可能な製造プロセスで作成された第1ブロックに保持が必要なデータを転送するマイコンが開示されている。第1ブロックはリーク電流が発生しにくいので、スリープ時のリーク電流を低減できる。   Therefore, a technique for reducing the leakage current during sleep has been considered (see, for example, Patent Document 1). In Patent Document 1, the first and second blocks are manufactured by different manufacturing processes, and at the time of sleep, the second block is a first block created by a manufacturing process capable of reducing the amount of leakage current compared to the second block. A microcomputer for transferring data that needs to be retained is disclosed. Since the first block hardly generates a leak current, the leak current during sleep can be reduced.

特開2007−226632号公報JP 2007-226632 A

しかしながら、特許文献1に開示されているように、マイコンの回路を異なる製造プロセスで製造することは、1つのマイコンが異なる製造プロセスで製造されることを意味する。このため、製造プロセスの微細化によるコスト低減効果を小さくしてしまうという問題がある。   However, as disclosed in Patent Document 1, manufacturing a microcomputer circuit by a different manufacturing process means that one microcomputer is manufactured by a different manufacturing process. For this reason, there exists a problem of reducing the cost reduction effect by refinement | miniaturization of a manufacturing process.

本発明は、上記課題に鑑み、製造プロセスの影響を抑制してスリープ時の消費電力を低減できる情報処理装置を提供することを目的とする。   In view of the above problems, an object of the present invention is to provide an information processing apparatus capable of reducing power consumption during sleep by suppressing the influence of a manufacturing process.

本発明は、第1の動作モード中に作業用記憶手段に作成されたデータを、第2の動作モード中に保持する退避データ記憶手段を有する情報処理装置であって、第2の動作モードの動作クロックと、第2の動作モードの動作クロックよりも大きい第1の動作モードの動作クロックとを生成するクロック生成手段と、第2の動作モードから復帰する際、前記クロック生成手段が第1の動作モードの動作クロックに上昇させる前に、当該情報処理装置の状態を示す情報処理装置ステータスデータを前記退避データ記憶手段から前記作業用記憶手段に復帰させる第1のデータ復帰手段と、前記クロック生成手段が第1の動作モードの動作クロックに上昇させた後、第1の動作モード中に作成されたデータを前記退避データ記憶手段から前記作業用記憶手段に復帰させる第2のデータ復帰手段と、を有することを特徴とする。   The present invention is an information processing apparatus having save data storage means for holding data created in the work storage means during the first operation mode during the second operation mode, A clock generating means for generating an operating clock and an operating clock for the first operating mode that is larger than the operating clock for the second operating mode; and when returning from the second operating mode, the clock generating means A first data return means for returning information processing apparatus status data indicating the state of the information processing apparatus from the saved data storage means to the working storage means before raising the operation clock to the operation mode; After the means is raised to the operation clock of the first operation mode, the data created during the first operation mode is stored from the saved data storage means to the working memory. And having a second data restoring means for restoring the stage, the.

製造プロセスの影響を抑制してスリープ時の消費電力を低減できる情報処理装置を提供することができる。   It is possible to provide an information processing apparatus that can reduce the power consumption during sleep by suppressing the influence of the manufacturing process.

マイコンのリーク電流を説明する図の一例である。It is an example of the figure explaining the leakage current of a microcomputer. マイコンの特徴部を概略的に説明する図の一例である。It is an example of the figure which illustrates the characteristic part of a microcomputer roughly. バックアップRAMの電源供給状態を示す図の一例である。It is an example of the figure which shows the power supply state of backup RAM. マイコンの機能ブロック図の一例である。It is an example of the functional block diagram of a microcomputer. マイコンの動作モードの遷移を説明するフローチャート図の一例である。It is an example of the flowchart figure explaining the transition of the operation mode of a microcomputer. ウェイクアップ手順を模式的に説明する図の一例である。It is an example of the figure which illustrates a wake-up procedure typically. ウェイクアップ手順を説明するフローチャート図の一例である。It is an example of the flowchart figure explaining a wake-up procedure. 「ウェイクアップ判断」「データ復帰処理A」の実行手順を説明するフローチャート図の一例である。FIG. 10 is an example of a flowchart for explaining an execution procedure of “wakeup determination” and “data restoration processing A”. 「ウェイクアップ判断」「データ復帰処理B」の実行手順を説明するフローチャート図の一例である。FIG. 10 is an example of a flowchart for explaining an execution procedure of “wakeup determination” and “data recovery process B”.

以下、本発明を実施するための形態について図面を参照しながら実施例を挙げて説明する。   DESCRIPTION OF EMBODIMENTS Hereinafter, embodiments for carrying out the present invention will be described with reference to the drawings.

図2は、本実施例のマイコンの特徴部を概略的に説明する図の一例である。図はスリープ状態のマイコン100を示し、斜線部のブロック(図ではCPU)に電源とクロックが供給されている。   FIG. 2 is an example of a diagram schematically illustrating a characteristic part of the microcomputer according to the present embodiment. The figure shows the microcomputer 100 in the sleep state, and power and a clock are supplied to the shaded block (CPU in the figure).

本実施例のマイコン100は新たにスリープ中にレジスタ11やRAM13のデータを保持しておくバックアップRAM17を有している。バックアップRAM17は、CPU12とのみ接続されている。換言すると、CPU12と1対1で接続されており、CPU12のみがバックアップRAM17にアクセスすることができる。   The microcomputer 100 of this embodiment newly has a backup RAM 17 that holds the data in the register 11 and the RAM 13 during sleep. The backup RAM 17 is connected only to the CPU 12. In other words, the CPU 12 is connected on a one-to-one basis, and only the CPU 12 can access the backup RAM 17.

スリープ前にレジスタ11とRAM13のデータはバックアップRAM17に退避されているので、スリープ中、電源と動作クロックをレジスタ11、RAM13、及び、バックアップRAM17(バックアップRAMが不揮発メモリの場合)へ供給する必要はない。このため、従来と比べてスリープ中の消費電力を大きく低減できる。   Since the data in the register 11 and the RAM 13 is saved in the backup RAM 17 before the sleep, it is necessary to supply the power source and the operation clock to the register 11, the RAM 13 and the backup RAM 17 (when the backup RAM is a non-volatile memory) during the sleep. Absent. For this reason, the power consumption during sleep can be greatly reduced as compared with the prior art.

また、バックアップRAM17は他の回路と同様の製造プロセス(例えば、90nm以下)で作成されている。マイコン100の全体を同じ製造プロセスで製造できるのでコストを低減しやすい。また、バックアップRAM17はCPU以外の回路と接続されていないので、製造プロセスが微細でもスリープ中のリーク電流を大きく低減できる。すなわち、バックアップRAM17が揮発性メモリの場合、スリープ中、CPU12とバックアップRAM17に電源とクロックが供給される。しかし、バックアップRAM17はCPU12としか接続されていないので、バックアップRAM17から他の回路に電流がリークすることがほとんど生じない。したがって、バックアップRAM17が揮発性メモリでもスリープ中の消費電力を低減できる。   Further, the backup RAM 17 is created by the same manufacturing process (for example, 90 nm or less) as other circuits. Since the entire microcomputer 100 can be manufactured by the same manufacturing process, the cost can be easily reduced. Further, since the backup RAM 17 is not connected to a circuit other than the CPU, the leakage current during sleep can be greatly reduced even if the manufacturing process is fine. That is, when the backup RAM 17 is a volatile memory, power and a clock are supplied to the CPU 12 and the backup RAM 17 during sleep. However, since the backup RAM 17 is connected only to the CPU 12, current hardly leaks from the backup RAM 17 to other circuits. Therefore, even when the backup RAM 17 is a volatile memory, power consumption during sleep can be reduced.

〔構成例〕
図2のマイコン100について説明する。マイコン100は、レジスタ11、CPU12、RAM13、CANコントローラ14、A/Dコンバータ15、タイマ16、及び、バックアップRAM17を有する。また、スリープモードと関係する発振器18、メインクロック発生回路19、PLL回路20、及び、電源回路21を図示した。この他、プログラムを記憶したROM、キャッシュメモリ、DMAC、割り込みコントローラ、IP(マイコンによって異なるが、例えばDSP、画像処理回路)等は省略した。
[Configuration example]
The microcomputer 100 in FIG. 2 will be described. The microcomputer 100 includes a register 11, a CPU 12, a RAM 13, a CAN controller 14, an A / D converter 15, a timer 16, and a backup RAM 17. Further, the oscillator 18, the main clock generation circuit 19, the PLL circuit 20, and the power supply circuit 21 related to the sleep mode are illustrated. In addition, ROM, cache memory, DMAC, interrupt controller, IP (which differs depending on the microcomputer, for example, DSP, image processing circuit), etc. are omitted.

CPU12は、レジスタ11、RAM13、CANコントローラ14、A/Dコンバータ15、及び、タイマ16とメインバスや周辺バスを介して接続されている。また、レジスタ11とRAM13も、CANコントローラ14、A/Dコンバータ15、及び、タイマ16からアクセスされるため、これらの回路と接続されている。これに対し、バックアップRAM17はCPU12とのみ接続されている。   The CPU 12 is connected to the register 11, the RAM 13, the CAN controller 14, the A / D converter 15, and the timer 16 via a main bus and a peripheral bus. The register 11 and the RAM 13 are also connected to these circuits because they are accessed from the CAN controller 14, the A / D converter 15, and the timer 16. On the other hand, the backup RAM 17 is connected only to the CPU 12.

なお、CPU12は不図示のROMに記憶されたプログラムを実行して、目的とする演算結果が得られるように他の回路を制御する。レジスタ11には、CPU12が演算に使用する値が格納された汎用レジスタ、次に実行する命令のアドレスを記憶するプログラムカウンタ、マイコン100の状態を示すマイコンステータスレジスタ、割り込み制御レジスタ、その他、各種のレジスタが含まれる。RAM13は、プログラムの実行途中のデータやルックアップ用データ等が記憶される作業メモリである。マイコン100によってはプログラムをRAM13にコピーしてから実行される場合がある。CANコントローラ14は、CANバスを介して接続された他のマイコン(例えば、ECU:Electronic Control Unit)と通信するための通信装置である。CANコントローラ14はCPU12からの指示によりCANフレームを生成しCANバス上に送信する。また、CANバス上を流れるCANフレームを監視しCAN IDに応じて受信すると共にCPU12に通知する。A/Dコンバータ15は、センサ等が検出したアナログ値をデジタルデータに変換してRAM13に記憶させCPU12に通知する。タイマ16は、CPU12が設定した時間の経過をCPU12に通知する。タイマ16には例えばWDTがある。なお、これらの周辺回路はCPU12との通信にレジスタ11やRAM13を使用するようになっている。   The CPU 12 executes a program stored in a ROM (not shown) and controls other circuits so that a target calculation result can be obtained. The register 11 includes a general-purpose register in which values used by the CPU 12 are stored, a program counter that stores the address of an instruction to be executed next, a microcomputer status register that indicates the state of the microcomputer 100, an interrupt control register, and various other types. Contains registers. The RAM 13 is a working memory that stores data during execution of the program, data for lookup, and the like. Some microcomputers 100 may be executed after copying the program to the RAM 13. The CAN controller 14 is a communication device for communicating with another microcomputer (for example, ECU: Electronic Control Unit) connected via the CAN bus. The CAN controller 14 generates a CAN frame in response to an instruction from the CPU 12 and transmits it on the CAN bus. Also, the CAN frame flowing on the CAN bus is monitored, received according to the CAN ID, and notified to the CPU 12. The A / D converter 15 converts an analog value detected by a sensor or the like into digital data, stores it in the RAM 13 and notifies the CPU 12 of it. The timer 16 notifies the CPU 12 of the elapse of the time set by the CPU 12. The timer 16 includes, for example, WDT. These peripheral circuits use the register 11 and the RAM 13 for communication with the CPU 12.

バックアップRAM17は不揮発メモリとして説明するが、揮発性メモリでもよい。不揮発メモリであれば、例えば、フラッシュメモリ、磁気抵抗RAM(MRAM)、強誘電体メモリ(FeRAM)、PCM(相変化メモリ)、ReRAM(抵抗変化型メモリ)などを記憶素子に採用できる。揮発性メモリであれば、SRAM、SDRAM、DRAMなどを記憶素子に採用できる。バックアップRAM17はCPU12と対であるが、複数のコアを備えたマルチコアプロセッサの場合、マルチコアプロセッサに1つのバックアップRAM17を配置してもよいし、コア毎に1つのバックアップRAM17を配置してもよい。コア毎にバックアップRAM17を設ければ、コア単位のスリープが可能になり、マルチコアプロセッサに1つのバックアップRAM17を設ければコスト低減が容易になる。   The backup RAM 17 is described as a nonvolatile memory, but may be a volatile memory. If it is a non-volatile memory, for example, a flash memory, a magnetoresistive RAM (MRAM), a ferroelectric memory (FeRAM), a PCM (phase change memory), a ReRAM (resistance change type memory), etc. can be adopted as the storage element. If it is a volatile memory, SRAM, SDRAM, DRAM, etc. can be adopted as a storage element. Although the backup RAM 17 is paired with the CPU 12, in the case of a multi-core processor having a plurality of cores, one backup RAM 17 may be arranged in the multi-core processor, or one backup RAM 17 may be arranged for each core. If a backup RAM 17 is provided for each core, sleep can be performed in units of cores, and if one backup RAM 17 is provided in a multi-core processor, cost reduction is facilitated.

本実施例のマイコン100は、主に車両のECUに搭載されることを想定している。車載されるECUには、その主要な機能により、エンジンECU、ブレーキECU、ボディECU、ナビゲーションECU(AV・情報処理ECU)、ゲートウェイECU等がある。本実施例のマイコン100はECUの機能の違いに影響されず搭載されることが可能である。   It is assumed that the microcomputer 100 of this embodiment is mainly mounted on the ECU of the vehicle. In-vehicle ECUs include an engine ECU, a brake ECU, a body ECU, a navigation ECU (AV / information processing ECU), a gateway ECU, and the like depending on the main functions. The microcomputer 100 of the present embodiment can be mounted without being affected by the difference in ECU functions.

マイコン100の消費電力は、およそ動作クロックに比例しかつ電圧の二乗に比例すると言われている。したがって、スリープ時には動作クロックと電圧を低減することが有効であるが、いずれか一方のみを低減してもよい。   The power consumption of the microcomputer 100 is said to be approximately proportional to the operation clock and proportional to the square of the voltage. Therefore, it is effective to reduce the operation clock and voltage during sleep, but only one of them may be reduced.

動作クロックは、発振器18、メインクロック発生回路19及びPLL回路20により生成される。発振器18は例えば基準クロックを生成する水晶振動子であり、メインクロック発生回路19は基準クロックを指示された周波数に低倍する回路、PLL回路20は指示された分周比によりメインクロックをPLLクロックまで増大させる回路である。CPU12は、起動時及びウェイクアップ時に所定のレジスタ11に周波数の指示値を設定することで、メインクロックとPLLクロックを制御する。なお、メインクロックとPLLクロックが固定のマイコン100もあり、この場合、CPU12が周波数を制御しなくてもよい。   The operation clock is generated by the oscillator 18, the main clock generation circuit 19, and the PLL circuit 20. The oscillator 18 is, for example, a crystal oscillator that generates a reference clock, the main clock generation circuit 19 is a circuit that lowers the reference clock to a specified frequency, and the PLL circuit 20 is a PLL clock that generates a main clock with a specified division ratio. It is a circuit to increase to. The CPU 12 controls the main clock and the PLL clock by setting a frequency instruction value in a predetermined register 11 at the time of start-up and wake-up. There is also a microcomputer 100 in which the main clock and the PLL clock are fixed. In this case, the CPU 12 may not control the frequency.

電源回路21は、バッテリ電圧を降圧して、いくつかの回路グループ毎に数種類の電源電圧を生成しCPU等の回路に供給する。電源回路21は、少なくともグループ毎に電源をON/OFFすることができる。   The power supply circuit 21 steps down the battery voltage, generates several types of power supply voltages for several circuit groups, and supplies them to a circuit such as a CPU. The power supply circuit 21 can turn on / off the power at least for each group.

CPU12は、スリープモードに移行する場合、スリープモード用の動作クロックの指示値をメインクロック発生回路19とPLL回路20に設定すると共に、電源回路21にCPU以外の電源をOFFにするよう要求する。こうすることで、スリープモード時、クロック周波数は通常動作モード(スリープモード以外の動作モードを通常動作モードという)よりも低減され、電源が供給される回路もCPU12のみに制限できる。スリープモード時の動作クロックは基準クロック程度とする。なお、メインクロックやPLLクロックの指示値を変えることで、スリープモード及び通常動作モードの動作クロックを可変にすることができる。   When shifting to the sleep mode, the CPU 12 sets the instruction value of the operation clock for the sleep mode in the main clock generation circuit 19 and the PLL circuit 20 and requests the power supply circuit 21 to turn off the power supply other than the CPU. In this way, in the sleep mode, the clock frequency is reduced compared to the normal operation mode (an operation mode other than the sleep mode is referred to as a normal operation mode), and the circuit to which power is supplied can be limited to the CPU 12 alone. The operation clock in the sleep mode is about the reference clock. Note that the operation clocks in the sleep mode and the normal operation mode can be made variable by changing the indicated values of the main clock and the PLL clock.

図3(a)は、バックアップRAM17が不揮発メモリの場合の電源供給状態の一例を示す。斜線部が、電源が供給されている回路を示す。左側は通常動作モードの電源供給状態を示すが、図3(a)では全ての回路に電源が供給されている。また、右側はスリープモードの電源供給状態を示すが、CPU12を除き電源が供給されてない。このように、CPU以外の回路の電源をOFFにすることでスリープ中の消費電力を低減できる。   FIG. 3A shows an example of a power supply state when the backup RAM 17 is a nonvolatile memory. A hatched portion indicates a circuit to which power is supplied. The left side shows the power supply state in the normal operation mode. In FIG. 3A, power is supplied to all circuits. The right side shows the power supply state in the sleep mode, but no power is supplied except for the CPU 12. In this way, power consumption during sleep can be reduced by turning off the power supply of circuits other than the CPU.

図3(b)は、バックアップRAM17が揮発性メモリの場合の電源供給状態を示す。同様に左側は通常動作モードの電源供給状態を示す。また、右側はスリープモードの電源供給状態を示すが、CPU12とバックアップRAM17に電源が供給されている。バックアップRAM17に電源が供給されても、レジスタ11とRAM13に電源が供給されるようは消費電力を低減できる。仮に消費電力の低減効果が小さくても、CPU12とのみ接続されたバックアップRAM17はスリープ中のリーク電流が小さいので、従来よりもスリープ中の消費電力を低減できる。   FIG. 3B shows a power supply state when the backup RAM 17 is a volatile memory. Similarly, the left side shows the power supply state in the normal operation mode. The right side shows the power supply state in the sleep mode, and power is supplied to the CPU 12 and the backup RAM 17. Even if power is supplied to the backup RAM 17, power consumption can be reduced so that power is supplied to the register 11 and the RAM 13. Even if the effect of reducing the power consumption is small, the backup RAM 17 connected only to the CPU 12 has a small leakage current during the sleep, so that the power consumption during the sleep can be reduced as compared with the conventional case.

〔スリープモードへの移行〕
図4は、マイコン100の機能ブロック図の一例を示す。マイコン100はECUに必要な制御や処理のために固有の処理を行うタスクA31(以下、単にタスクAという)、タスクB32(以下、単にタスクBという)、マイコン100の状態を判定する状態判定部33、電源回路21を制御する電源回路制御部34、スリープ処理を行うスリープモード実行部35、及び、ウェイクアップ処理を行うウェイクアップ実行部41を有している。各機能ブロックは、CPU12がハードウェアと協働しながらプログラムを実行することで実現される。
[Transition to sleep mode]
FIG. 4 shows an example of a functional block diagram of the microcomputer 100. The microcomputer 100 performs a task A31 (hereinafter simply referred to as “task A”), a task B32 (hereinafter simply referred to as “task B”), and a state determination unit that determines the state of the microcomputer 100. 33, a power supply circuit control unit 34 that controls the power supply circuit 21, a sleep mode execution unit 35 that performs sleep processing, and a wakeup execution unit 41 that performs wakeup processing. Each functional block is realized by the CPU 12 executing a program in cooperation with hardware.

OSや基本ソフトなどのタスク管理機能はタスクの優先順位にしたがって、CPU12に割り当てるタスクを切り替える。タスク管理機能は、例えば、1つのタスクが終わる毎又は定期的にタスクのスケジューリングを行い、例えば、タスクA,タスクB及び状態判定部33がそれぞれ所定の頻度で実行されるようにタスクを実行する。   A task management function such as an OS or basic software switches tasks assigned to the CPU 12 in accordance with the priority order of tasks. The task management function, for example, performs task scheduling every time one task is completed or periodically, and executes tasks such that, for example, task A, task B, and state determination unit 33 are executed at a predetermined frequency. .

状態判定部33は、タスクA、タスクBの実行状態を確認しスリープモードに移行するか否かを判定する。例えば、タスクA、タスクBが最後に実行された時間を記録しておき、所定時間が経過したことによりスリープモードに移行すると判定してもよいし、タスクA及びタスクBがそれぞれ生成したスリープモード移行要求の有無を判定してもよい。また、さらに他のマイコン100からスリープへの移行許可を取得したか否かを判定してもよい。   The state determination unit 33 confirms the execution states of the tasks A and B and determines whether or not to shift to the sleep mode. For example, the time when task A and task B were last executed may be recorded, and it may be determined that the mode is shifted to the sleep mode when a predetermined time has elapsed, or the sleep mode generated by task A and task B, respectively. The presence or absence of a migration request may be determined. Further, it may be determined whether or not permission for transition to sleep has been obtained from another microcomputer 100.

状態判定部33がスリープモードに移行すると判定すると、スリープモード実行部35がスリープモードへの移行処理を行う。スリープモード実行部35は、データ退避部36、及び、動作クロック設定部37を有する。データ退避部36は、レジスタ11とRAM13のデータをバックアップRAM17に退避する。また、退避が終了すると、スリープモード実行部35は、動作クロック設定部37にスリープモード用の動作クロックを設定させ、また、電源回路制御部34に電源制御を要求する。これにより、マイコン100はスリープモードに移行する。   When the state determination unit 33 determines to shift to the sleep mode, the sleep mode execution unit 35 performs a shift process to the sleep mode. The sleep mode execution unit 35 includes a data saving unit 36 and an operation clock setting unit 37. The data saving unit 36 saves the data in the register 11 and the RAM 13 to the backup RAM 17. When the saving is completed, the sleep mode execution unit 35 causes the operation clock setting unit 37 to set the operation clock for the sleep mode, and requests the power supply circuit control unit 34 to perform power control. Thereby, the microcomputer 100 shifts to the sleep mode.

ウェイクアップ実行部41は、マイコン100をウェイクアップさせるイベントが生じると実行が開始される。このようなイベントには様々なものがありまたマイコン100によって異なるが、例えば、所定の部品のスイッチオン、CAN通信の開始、一定時間の経過、等が挙げられる。また、ウェイクアップ実行部41はマイコン100が、IG−ON(ハイブリッド車や電気自動車ではメインシステムのスイッチがONとなることをいう)等によりリセットされた場合も実行が開始される。   The wake-up execution unit 41 starts execution when an event that causes the microcomputer 100 to wake up occurs. There are various types of such events and differ depending on the microcomputer 100. Examples of such events include switch-on of predetermined parts, start of CAN communication, elapse of a predetermined time, and the like. The wake-up execution unit 41 is also started when the microcomputer 100 is reset by IG-ON (which means that the main system switch is turned on in a hybrid vehicle or an electric vehicle).

イベントの発生は、スリープモード中の例えばタスク管理機能が定期的に特定のレジスタ11を参照することで検出する。イベントの発生を検出したタスク管理機能はウェイクアップ実行部41をCPU12に割り当てる。マイコンがリセットされた場合、マイコン100はスリープモードからの復帰でなく通常起動するので、リセット割込みによりCPU12は所定のアドレスの命令を実行することでウェイクアップ実行部41の実行を開始する。   The occurrence of an event is detected by, for example, the task management function in the sleep mode periodically referring to a specific register 11. The task management function that detects the occurrence of the event assigns the wake-up execution unit 41 to the CPU 12. When the microcomputer is reset, the microcomputer 100 starts normally instead of returning from the sleep mode. Therefore, the CPU 12 starts executing the wakeup execution unit 41 by executing a command at a predetermined address by a reset interrupt.

ウェイクアップ実行部41は、第1データ復帰部41、ウェイクアップ要因判定部43、ウェイクアップブートフック部44、及び、第2データ復帰部46を有する。第1データ復帰部41は後述するデータ復帰処理Aを行い、第2データ復帰部46は後述するデータ復帰処理Bを行う。ウェイクアップ要因判定部43は、ウェイクアップの要因がスリープモードから復帰したためのウェイクアップか、そうでないかを判定する。この判定を行うのは、本実施例のマイコン100はスリープモードからの復帰が、リセットからの復帰として扱われるため、ソフト的にスリープモードからの復帰か、リセットによる起動かを区別する必要があるためである。スリープモードからの復帰か、リセットからの起動かによって初期処理が変わってくる。例えば、スリープモードからの復帰でない場合、バックアップRAM17からのデータ復帰も不要になる。   The wakeup execution unit 41 includes a first data return unit 41, a wakeup factor determination unit 43, a wakeup boot hook unit 44, and a second data return unit 46. The first data restoration unit 41 performs a data restoration process A described later, and the second data restoration unit 46 performs a data restoration process B described later. The wake-up factor determination unit 43 determines whether the wake-up factor is a wake-up caused by returning from the sleep mode or not. This determination is made because the microcomputer 100 according to the present embodiment treats the return from the sleep mode as the return from the reset, so it is necessary to distinguish whether the return from the sleep mode or the activation by the reset is software. Because. The initial process changes depending on whether the device returns from the sleep mode or starts up from reset. For example, when it is not the return from the sleep mode, the data return from the backup RAM 17 is not necessary.

ウェイクアップブートフック部44は、ウェイクアップ時のフック処理(プログラムの特定の箇所で呼び出される処理)を行う。本実施例では代表的な処理として動作クロック設定部45が動作クロックを上昇させるものとする。   The wake-up boot hook unit 44 performs hook processing at the time of wake-up (processing called at a specific part of the program). In the present embodiment, it is assumed that the operation clock setting unit 45 increases the operation clock as a representative process.

図5は、マイコン100の動作モードの遷移を説明するフローチャート図の一例である。図5の手順はマイコン100が起動するとスタートする。   FIG. 5 is an example of a flowchart for explaining the transition of the operation mode of the microcomputer 100. The procedure of FIG. 5 starts when the microcomputer 100 is activated.

起動後、まず、ウェイクアップ実行部41がウェイクアップブート処理を行う(S10)。ウェイクアップブート処理については実施例2にて説明する。ウェイクアップブート処理には、リセットからの起動処理とスリープモードからの復帰処理が含まれている。   After startup, first, the wakeup execution unit 41 performs a wakeup boot process (S10). The wake-up boot process will be described in the second embodiment. The wake-up boot process includes a startup process from reset and a return process from sleep mode.

ウェイクアップ実行部41は、ウェイクアップブート処理を完了するとプログラムを実行する(S20)。このプログラムは、例えばmain関数の開始を意味し(C言語の場合)、以降、main関数が繰り返し実行される。上記のタスクA、B、状態判定部33はmain関数から実行される関数やルーチンなどである。   When the wakeup execution unit 41 completes the wakeup boot process, it executes the program (S20). This program means, for example, the start of the main function (in the case of C language), and thereafter the main function is repeatedly executed. The tasks A and B and the state determination unit 33 are functions and routines executed from the main function.

状態判定部33は、例えば定期的にスリープ条件が成立したか否かを判定する(S30)。スリープ条件が成立しない場合(S30のNo)、CPU12は継続的にプログラムを実行する。   The state determination unit 33 determines, for example, whether or not the sleep condition is periodically satisfied (S30). When the sleep condition is not satisfied (No in S30), the CPU 12 continuously executes the program.

スリープ条件が成立した場合(S30のYes)、スリープモード実行部35はスリープモードへの移行処理を行う(S40)。まず、スリープモード実行部35はマイコンステータスレジスタにスリープモードへ移行したことを記録する。具体的には、マイコンステータスレジスタのスリープ検出リセットフラグを”1”に設定する。したがって、ウェイクアップ時にはCPU12がバックアップRAM17からマイコンステータスレジスタを読み出すことで、スリープモードからの復帰か、リセットからの起動かを判定できる。なお、フラグの“1”“0”がフラグのON/OFFのどちらを示すかは設計事項である。   When the sleep condition is satisfied (Yes in S30), the sleep mode execution unit 35 performs a transition process to the sleep mode (S40). First, the sleep mode execution unit 35 records the transition to the sleep mode in the microcomputer status register. Specifically, the sleep detection reset flag of the microcomputer status register is set to “1”. Therefore, at the time of wakeup, the CPU 12 can read out the microcomputer status register from the backup RAM 17 to determine whether to return from the sleep mode or to start from reset. Note that whether the flag “1” or “0” indicates ON / OFF of the flag is a design matter.

また、マイコンステータスレジスタには、この他、リセット原因を示すフラグが含まれている。リセット原因には、IG−ON、異常の発生やWDTによる外部リセット、バッテリ低電圧、内部低電圧などがある。   In addition, the microcomputer status register includes a flag indicating the cause of reset. Causes of reset include IG-ON, occurrence of abnormality or external reset by WDT, battery low voltage, internal low voltage, and the like.

データ退避部36は、RAM13のデータを予め決まったセクション毎にバックアップRAM17に退避する。セクションとは、RAM13やバックアップRAM17の領域(アドレス範囲)やブロックであり、重複しないセクション名を指定することで、バックアップRAM17とRAM13の領域を指定できる。また、データ退避部36は、レジスタ名を指定して全てのレジスタ11のデータをバックアップRAM17に退避する。バックアップRAM17のどのセクションに、RAM13及びレジスタ11のデータが記憶されているかは、第1データ復帰部41と第2データ復帰部46にとって明らかになっている。退避されるレジスタ11の1つにはマイコンステータスレジスタも含まれる。   The data saving unit 36 saves the data in the RAM 13 to the backup RAM 17 for each predetermined section. A section is an area (address range) or block of the RAM 13 or the backup RAM 17, and the areas of the backup RAM 17 and the RAM 13 can be specified by specifying a section name that does not overlap. Further, the data saving unit 36 saves the data of all the registers 11 to the backup RAM 17 by specifying the register name. It is clear to the first data restoration unit 41 and the second data restoration unit 46 in which section of the backup RAM 17 the data of the RAM 13 and the register 11 are stored. One of the saved registers 11 includes a microcomputer status register.

なお、RAM13については全領域のデータをバックアップRAM17に退避しなくてもよい。復帰後にプログラムが必要とするデータは、タスクA、Bなどのプログラムが作成したデータや制御を最適化するためのパラメータなどである。このような演算により得られたデータのみを退避することで、退避時間も復帰時間も短縮できる。この場合、データ退避部36は予め指定されたセクション名や変数名のみをRAM13から退避するなどして、退避するデータを選択する。   Note that the RAM 13 does not have to save the data in the entire area to the backup RAM 17. Data required by the program after the return is data created by a program such as tasks A and B, parameters for optimizing control, and the like. By saving only the data obtained by such calculation, the saving time and the recovery time can be shortened. In this case, the data saving unit 36 selects data to be saved by saving only the section name and variable name designated in advance from the RAM 13.

データの退避後、動作クロック設定部37は動作クロックを低減し、電源回路制御部34がCPU12以外の回路への電源をOFFにする。これにより、マイコン100はスリープモードに移行する。   After saving the data, the operation clock setting unit 37 reduces the operation clock, and the power supply circuit control unit 34 turns off the power supply to circuits other than the CPU 12. Thereby, the microcomputer 100 shifts to the sleep mode.

スリープモードに移行すると、CPU12はウェイクアップのイベントが検出されるまで待機する(S50)。そして、ウェイクアップのイベントが検出されると(S50のYes)、ステップS10のウェイクアップブート処理が実行される。   After shifting to the sleep mode, the CPU 12 waits until a wake-up event is detected (S50). When a wake-up event is detected (Yes in S50), the wake-up boot process in step S10 is executed.

以上説明したように、本実施例のマイコン100は、CPU12とのみ接続されたバックアップRAM17にデータを退避するので、レジスタ11とRAM13の電源をOFFにでき、また、リーク電流を低減できるのでスリープモード中の消費電力を低減できる。   As described above, the microcomputer 100 of this embodiment saves data in the backup RAM 17 connected only to the CPU 12, so that the power of the register 11 and the RAM 13 can be turned off, and the leakage current can be reduced, so that the sleep mode can be reduced. Power consumption can be reduced.

実施例1では、バックアップRAM17をマイコン100に設けた。しかし、このようなマイコン100では、ウェイクアップ時にバックアップRAM17からレジスタ11やRAM13へのデータの復帰処理が必要になるため、ウェイクアップを開始してからタスクA,Bなどの実行が開始されるまでの時間が長くなるおそれがある。そこで、本実施例では、バックアップRAM17を備えたマイコン100のウェイクアップ時間を短縮するウェイクアップ方法について説明する。   In the first embodiment, the backup RAM 17 is provided in the microcomputer 100. However, in such a microcomputer 100, data restoration processing from the backup RAM 17 to the register 11 or the RAM 13 is necessary at the time of wakeup, so that the execution of tasks A, B, etc. is started after the wakeup is started. There is a possibility that the time of the process becomes longer. In this embodiment, a wakeup method for shortening the wakeup time of the microcomputer 100 provided with the backup RAM 17 will be described.

図6は、本実施例のウェイクアップ手順を模式的に説明する図の一例である。図6では時間の経過順に、マイコン起動、レジスタ初期化、「データ復帰処理A(ウェイクアップ判断)」、ウェイクアップブートフック、メインクロック発振設定、メインクロック発振安定待ち、PLLクロック発振設定、PLLクロック発振安定待ち、「データ復帰処理B」となっている。このうち、「データ復帰処理A(ウェイクアップ判断)」と「データ復帰処理B」がバックアップRAM17を搭載したことによる処理である。   FIG. 6 is an example of a diagram for schematically explaining the wake-up procedure of the present embodiment. In FIG. 6, in order of time, microcomputer activation, register initialization, “data recovery process A (wakeup determination)”, wakeup boothook, main clock oscillation setting, main clock oscillation stabilization wait, PLL clock oscillation setting, PLL clock Waiting for oscillation stabilization, “Data recovery process B”. Among these, “data restoration processing A (wakeup determination)” and “data restoration processing B” are processing due to the installation of the backup RAM 17.

図示するように、ウェイクアップ時は動作クロックの発振や安定に時間がかかる。マイコン100によって大きく異なるが、図では、CRクロック発振期間(500〜750kHz程度)、メインクロック発振期間(1M〜4MHz程度)、PLLクロック発振期間(8M〜128MHz)のように徐々に動作クロックが上昇する。なお、3段階に動作クロックが上昇するとは限らず、上昇時の動作クロックのステップ数はマイコン100に依存する。また、CRクロックはスリープモード中の動作クロックである。   As shown in the figure, it takes time to oscillate and stabilize the operation clock during wakeup. Although it varies greatly depending on the microcomputer 100, in the figure, the operation clock gradually increases such as a CR clock oscillation period (about 500 to 750 kHz), a main clock oscillation period (about 1 M to 4 MHz), and a PLL clock oscillation period (8 M to 128 MHz). To do. Note that the operation clock does not necessarily increase in three stages, and the number of steps of the operation clock at the time of the increase depends on the microcomputer 100. The CR clock is an operation clock during the sleep mode.

したがって、動作クロックの低いうちに処理を開始すれば、バックアップRAM17を搭載したことによる復帰時間の増大を、動作クロックの発振・安定時間である程度吸収することができる。「データ復帰処理A(ウェイクアップ判断)」及び「データ復帰処理B」をどのタイミングで実行するかは適宜設計できる。本実施例では、動作クロックが最も低いスリープ中のCRクロックのまま「データ復帰処理A(ウェイクアップ判断)」を行い、最も高いPLLクロックに安定したら「データ復帰処理B」を実行するものとする。「データ復帰処理A」では必要最小限のデータのみを復帰させ、大部分のデータを「データ復帰処理B」で復帰させるのでウェイクアップ時間の遅延を最小限にすることができる。   Therefore, if the processing is started while the operation clock is low, the increase in the recovery time due to the mounting of the backup RAM 17 can be absorbed to some extent by the oscillation / stable time of the operation clock. The timing at which “data restoration processing A (wakeup determination)” and “data restoration processing B” are executed can be appropriately designed. In this embodiment, “data recovery processing A (wakeup determination)” is performed with the CR clock during sleep having the lowest operation clock, and “data recovery processing B” is executed when the clock clock is stabilized to the highest PLL clock. . In the “data restoration process A”, only the minimum necessary data is restored, and most data is restored in the “data restoration process B”, so that the delay of the wakeup time can be minimized.

なお、動作クロックがCRクロックのまま「データ復帰処理B」を開始してもよい。また、メインクロックに安定した段階で「データ復帰処理A」を開始し、PLLクロックに安定したら「データ復帰処理B」を開始してもよいし、メインクロックに安定した段階で「データ復帰処理A」「データ復帰処理B」を開始してもよい。   Note that the “data recovery process B” may be started while the operation clock is the CR clock. Further, “data recovery processing A” may be started when the main clock is stabilized, and “data recovery processing B” may be started when the main clock is stabilized. “Data restoration processing B” may be started.

・データ復帰処理A
必須処理:マイコンステータスレジスタをバックアップRAM17から読み出す
マイコンステータスレジスタのスリープ検出リセットフラグによりスリープモードからの復帰か否かを判定するためである。また、データ復旧処理Aにはこのスリープモードからの復帰か否かのウェイクアップ判断が含まれる。
オプション処理1:メインクロック発振設定、PLLクロック発振設定に必要なデータ(動作クロックの指示値)をバックアップRAM17から読み出す
この処理がオプションなのは、マイコン100によってはメインクロック発振設定、PLLクロックの設定値が固定であるため、バックアップRAM17から読み出す必要がないためである。
オプション処理2:その他、早期に必要なデータをバックアップRAM17から読み出す
早期に必要なデータはマイコン100やマイコン100が実行するプログラムによって異なるので、開発者が第一データ復帰部41に予め設定している。
・ Data restoration processing A
Essential processing: This is because the microcomputer status register is read from the backup RAM 17 to determine whether or not to return from the sleep mode based on the sleep detection reset flag of the microcomputer status register. Further, the data recovery process A includes a wake-up determination as to whether or not to return from the sleep mode.
Option processing 1: Main clock oscillation setting and data required for PLL clock oscillation setting (operation clock indication value) are read from the backup RAM 17 as an option. Depending on the microcomputer 100, the main clock oscillation setting and the PLL clock setting value are optional. This is because there is no need to read from the backup RAM 17 because it is fixed.
Option processing 2: Read out necessary data from the backup RAM 17 at an early stage Since the data necessary at an early stage varies depending on the microcomputer 100 and the program executed by the microcomputer 100, the developer sets the first data return unit 41 in advance. .

・データ復帰処理B
必須処理:スリープ前にバックアップRAM17に保持されたRAM13・レジスタ11のデータをRAM13、レジスタ11に書き込む
なお、マイコン100によっては、RAM13やレジスタ11に復帰が必要なデータ(上記の演算により得られたデータなど)を書き込まない仕様のものも存在する。そのようなマイコン100にとっては、データ復帰処理Bの必須処理が不要になる。データ復帰処理Bが不要な場合、プログラムのリンク時にデータ復帰処理Bを行う第2のデータ復帰部をリンクしなければよい。
・ Data restoration processing B
Mandatory processing: The data of the RAM 13 and the register 11 held in the backup RAM 17 before the sleep is written to the RAM 13 and the register 11. Some specifications do not write data. For such a microcomputer 100, the essential process of the data restoration process B is not required. If the data restoration process B is unnecessary, the second data restoration unit that performs the data restoration process B at the time of linking the program may not be linked.

〔動作手順〕
図7〜9は、ウェイクアップ手順を説明するフローチャート図の一例である。図7の手順は、マイコン100をウェイクアップさせるイベントが検出されるか、又は、マイコン100のリセット(起動)によりスタートする。図7の処理は図5のステップS10の処理に相当する。
[Operation procedure]
7 to 9 are examples of flowcharts for explaining the wake-up procedure. The procedure of FIG. 7 starts when an event that wakes up the microcomputer 100 is detected or when the microcomputer 100 is reset (activated). The process of FIG. 7 corresponds to the process of step S10 of FIG.

なお、ウェイクアップにより電源回路制御部34が、電源回路21から全ての回路に電源を供給している。動作クロックは、スリープモードからの復帰であればCRクロックに安定しており、リセットからの起動であればCRクロックが安定してからウェイクアップ処理が実行される。   Note that the power supply circuit control unit 34 supplies power to all the circuits from the power supply circuit 21 by wakeup. The operation clock is stable to the CR clock when returning from the sleep mode, and the wake-up process is executed after the CR clock is stabilized when starting from reset.

まず、ウェイクアップ実行部41は、プロセッサを割込み禁止に設定する(S101)。割込み禁止にすることで、ウェイクアップ中に割込みが入り別の処理が実行されることを防止できる。なお、割込み禁止に設定するには割込み禁止レジスタに所定値を設定する。   First, the wakeup execution unit 41 sets the processor to disable interrupts (S101). By disabling interrupts, it is possible to prevent an interrupt from entering and another process from being executed during wakeup. In order to set the interrupt prohibition, a predetermined value is set in the interrupt prohibition register.

次に、ウェイクアップ実行部41はウェイクアップ時の専用レジスタを初期化する(S102)。専用レジスタは、ポインタやアドレスのインデックスを格納するレジスタである。   Next, the wakeup execution unit 41 initializes a dedicated register for wakeup (S102). The dedicated register is a register for storing an index of a pointer or an address.

そして、動作クロックを上昇させる前に、「データ復帰処理A&ウェイクアップ判断」が実行される(S200)。この処理については図8にて説明する。   Then, before the operation clock is raised, “data recovery process A & wakeup determination” is executed (S200). This process will be described with reference to FIG.

次に、ウェイクアップブートフック部44はウェイクアップ時のフック処理を行う(S103)。上記のように、このフック処理では、動作クロックの上昇処理が行われる。   Next, the wakeup boot hook unit 44 performs hook processing at the time of wakeup (S103). As described above, in this hook process, the operation clock is increased.

まず、動作クロック設定部45は、データ復帰処理Aで取得したメインクロックの指示値をメインクロック発生回路19に設定する(S104)。これにより動作クロックはメインクロックまで上昇する。   First, the operation clock setting unit 45 sets the instruction value of the main clock acquired in the data restoration process A in the main clock generation circuit 19 (S104). As a result, the operation clock rises to the main clock.

動作クロック設定部45は、動作クロックがメインクロックで安定するまで、予め定められた時間、待機する(S105)。   The operation clock setting unit 45 waits for a predetermined time until the operation clock is stabilized by the main clock (S105).

次に、動作クロック設定部45は、データ復帰処理Aで取得したPLLクロックの指示値をPLL回路20に設定する(S106)。これにより動作クロックはPLLクロックまで上昇する。   Next, the operation clock setting unit 45 sets the instruction value of the PLL clock acquired in the data restoration process A in the PLL circuit 20 (S106). As a result, the operation clock rises to the PLL clock.

動作クロック設定部45は、動作クロックがPLLクロックで安定するまで、予め定められた時間、待機する(S107)。   The operation clock setting unit 45 waits for a predetermined time until the operation clock is stabilized by the PLL clock (S107).

次に、第2データ復帰部46は、データ復帰処理BのためにRAM13などを初期化する。まず、第2データ復帰部46はRAM13におけるスタック領域を初期化する(S108)。RAM13の全部でなく必ず使用する領域のみを初期化することで復帰処理の時間を短縮できる。   Next, the second data restoration unit 46 initializes the RAM 13 and the like for the data restoration process B. First, the second data return unit 46 initializes the stack area in the RAM 13 (S108). By initializing only the area to be used instead of the entire RAM 13, the time for the restoration process can be shortened.

次に、第2データ復帰部46は汎用レジスタを初期化する(S109)。   Next, the second data return unit 46 initializes the general-purpose register (S109).

そして、第2データ復帰部46は「データ復帰処理B」を実行する(S300)。この処理については図9にて説明する。   Then, the second data restoration unit 46 executes “data restoration process B” (S300). This process will be described with reference to FIG.

データ復帰処理Bが完了すると、CPU12はメインスクA、Bなどのプログラムを実行する(S110)。すなわち、図5のステップS20に処理が以降する。   When the data restoration process B is completed, the CPU 12 executes programs such as the mainsks A and B (S110). In other words, the process proceeds to step S20 in FIG.

図8は、「データ復帰処理A&ウェイクアップ判断」の実行手順を説明するフローチャート図の一例である。   FIG. 8 is an example of a flowchart for explaining an execution procedure of “data restoration process A & wakeup determination”.

第1データ復帰部41は、CPU12からマイコンステータスレジスタのデータを読み出す(S201)。この処理は上記のデータ復帰処理Aの必須処理に相当する。以降、ウェイクアップ要因判定部43がウェイクアップ要因を判定する。   The first data return unit 41 reads data in the microcomputer status register from the CPU 12 (S201). This process corresponds to the essential process of the data restoration process A described above. Thereafter, the wakeup factor determination unit 43 determines the wakeup factor.

ウェイクアップ要因判定部43は、マイコンステータスレジスタのデータと所定のMASK値を論理演算してパワーオン検出リセットフラグを取り出す。そして、ウェイクアップ要因判定部43はパワーオン検出リセットフラグがONか否かを判定する(S202)。   The wake-up factor determination unit 43 performs a logical operation on the data in the microcomputer status register and a predetermined MASK value to extract a power-on detection reset flag. Then, the wakeup factor determination unit 43 determines whether or not the power-on detection reset flag is ON (S202).

パワーオン検出リセットフラグがONであることはウェイクアップ処理がスリープモードからの復帰でなくIG−ONによるリセットを要因とすることになる。よって、パワーオン検出リセットフラグがONの場合(S202のYes)、処理はステップS210に進む。   If the power-on detection reset flag is ON, the wake-up process is caused not by the return from the sleep mode but by a reset by IG-ON. Therefore, when the power-on detection reset flag is ON (Yes in S202), the process proceeds to step S210.

パワーオン検出リセットフラグがONでない場合(S202のNo)、ウェイクアップ要因判定部43は、外部リセット検出フラグがONか否かを判定する(S203)。すなわち、マイコンステータスレジスタのデータと所定のMASK値を論理演算して外部リセット検出フラグを取り出す。   When the power-on detection reset flag is not ON (No in S202), the wakeup factor determination unit 43 determines whether or not the external reset detection flag is ON (S203). That is, the external reset detection flag is extracted by performing a logical operation on the data in the microcomputer status register and a predetermined MASK value.

外部リセット検出トフラグがONであることはウェイクアップ処理がスリープモードからの復帰でなく外部からのリセットを要因とすることになる。よって、外部リセット検出フラグがONの場合(S203のYes)、処理はステップS210に進む。   If the external reset detection flag is ON, the wake-up process is caused not by the return from the sleep mode but by an external reset. Accordingly, when the external reset detection flag is ON (Yes in S203), the process proceeds to step S210.

外部リセット検出フラグがONでない場合(S203のNo)、ウェイクアップ要因判定部43は、外部低電圧リセット検出フラグがONか否かを判定する(S204)。すなわち、マイコンステータスレジスタのデータと所定のMASK値を論理演算して外部低電圧リセット検出フラグを取り出す。   When the external reset detection flag is not ON (No in S203), the wakeup factor determination unit 43 determines whether the external low voltage reset detection flag is ON (S204). That is, the external low voltage reset detection flag is extracted by performing a logical operation on the data in the microcomputer status register and a predetermined MASK value.

外部低電圧リセット検出トフラグがONであることはウェイクアップ処理がスリープモードからの復帰でなくバッテリ電圧が閾値以下であることをリセット要因とすることになる。よって、外部低電圧リセット検出フラグがONの場合(S204のYes)、処理はステップS210に進む。   When the external low voltage reset detection flag is ON, the reset factor is that the wake-up process is not the return from the sleep mode but the battery voltage is equal to or lower than the threshold value. Therefore, when the external low voltage reset detection flag is ON (Yes in S204), the process proceeds to step S210.

外部低電圧リセット検出リセットフラグがONでない場合(S204のNo)、ウェイクアップ要因判定部43は、内部低電圧リセット検出フラグがONか否かを判定する(S205)。すなわち、マイコンステータスレジスタのデータと所定のMASK値を論理演算して内部低電圧リセット検出フラグを取り出す。   When the external low voltage reset detection reset flag is not ON (No in S204), the wakeup factor determination unit 43 determines whether or not the internal low voltage reset detection flag is ON (S205). That is, the internal low voltage reset detection flag is extracted by performing a logical operation on the data in the microcomputer status register and a predetermined MASK value.

内部低電圧リセット検出トフラグがONであることはウェイクアップ処理がスリープモードからの復帰でなく電源回路21の電圧が閾値以下であることをリセット要因とすることになる。よって、内部低電圧リセット検出フラグがONの場合(S205のYes)、処理はステップS210に進む。   When the internal low voltage reset detection flag is ON, the reset factor is that the wake-up process is not the return from the sleep mode but the voltage of the power supply circuit 21 is equal to or lower than the threshold value. Therefore, when the internal low voltage reset detection flag is ON (Yes in S205), the process proceeds to step S210.

内部低電圧リセット検出リセットフラグがONでない場合(S205のNo)、ウェイクアップ要因判定部43は、スリープからの復帰か否かを同様に判定する(S206)。すなわち、マイコンステータスレジスタのデータと所定のMASK値を論理演算してスリープ検出フラグを取り出す。   When the internal low voltage reset detection reset flag is not ON (No in S205), the wakeup factor determination unit 43 similarly determines whether or not to return from sleep (S206). That is, the sleep detection flag is extracted by performing a logical operation on the data in the microcomputer status register and a predetermined MASK value.

スリープ検出フラグがONでない場合には(S206のNo)、同様に、処理はステップS210に進む。   If the sleep detection flag is not ON (No in S206), the process similarly proceeds to step S210.

スリープ検出フラグがONの場合(S206のYes)、ウェイクアップ要因はスリープモードからの復帰と判定される。よって、第1データ復帰部41は、データ復帰処理Aのオプション処理を実行する。本実施例のマイコン100のオプション処理は、動作クロックの設定に必要なメインクロックとPLLクロックの指示値をバックアップRAM17から読み出すことである。   When the sleep detection flag is ON (Yes in S206), it is determined that the wake-up factor is the return from the sleep mode. Therefore, the first data restoration unit 41 executes the option process of the data restoration process A. The optional processing of the microcomputer 100 according to the present embodiment is to read the main clock and PLL clock instruction values necessary for setting the operation clock from the backup RAM 17.

第1データ復帰部41は、バックアップRAM17からメインクロックやPLLクロックの指示値を読み出す(S207)。この後、処理は図7のS103に戻る。   The first data return unit 41 reads the instruction value of the main clock or PLL clock from the backup RAM 17 (S207). Thereafter, the process returns to S103 of FIG.

処理がステップS210に遷移した場合、データ復帰を行わず、リセットからの起動処理が行われる。リセットからの起動処理後は、タスクA、Bなどのプログラムが実行される。   When the process transitions to step S210, the data recovery is not performed and the activation process from reset is performed. After the activation process from reset, programs such as tasks A and B are executed.

図9は、「データ復帰処理B」の実行手順(S300)を説明するフローチャート図の一例である。図7にてステップS300を含めステップS103〜S110が実行されるのは、ステップS200でスリープモードからの復帰と判定された場合である。このため、第2データ復帰部46は、バックアップRAM17からRAM13とレジスタ11のデータを復帰すればよい。   FIG. 9 is an example of a flowchart for explaining the execution procedure (S300) of “data restoration processing B”. Steps S103 to S110 including step S300 in FIG. 7 are executed when it is determined in step S200 to return from the sleep mode. Therefore, the second data restoration unit 46 may restore the data in the RAM 13 and the register 11 from the backup RAM 17.

第2データ復帰部46はバックアップRAM17から読み出したデータをRAM13とレジスタ11にそれぞれ書き込む(S301)。この処理がデータ復帰処理Bの必須処理に相当する。   The second data restoration unit 46 writes the data read from the backup RAM 17 to the RAM 13 and the register 11 respectively (S301). This process corresponds to the essential process of the data restoration process B.

また、第2データ復帰部46はその他、必要なデータがあれば復帰したり、周辺回路にデータを設定したりする(S302)。この後、処理は図7のS110に戻る。   In addition, the second data restoration unit 46 restores any necessary data or sets data in the peripheral circuit (S302). Thereafter, the process returns to S110 of FIG.

以上説明したように本実施例のマイコンは、動作クロックの遅い間は最小限のデータを復帰させ、動作クロックが速くなってから大部分のデータを復帰させる。このため、スリープ中のデータを保持するバックアップRAM17を備えたマイコン100のウェイクアップ時間を短縮できる。   As described above, the microcomputer of this embodiment restores a minimum amount of data while the operation clock is slow, and restores most of the data after the operation clock becomes fast. For this reason, the wake-up time of the microcomputer 100 including the backup RAM 17 that holds the data during sleep can be shortened.

11 レジスタ
12 CPU
13 RAM
17 バックアップRAM
18 発振器
35 スリープモード実行部
41 ウェイクアップ実行部
100 マイコン
11 Register 12 CPU
13 RAM
17 Backup RAM
18 Oscillator 35 Sleep mode execution unit 41 Wake-up execution unit 100 Microcomputer

Claims (8)

第1の動作モード中に作業用記憶手段に作成されたデータを、第2の動作モード中に保持する退避データ記憶手段を有する情報処理装置であって、
第2の動作モードの動作クロックと、第2の動作モードの動作クロックよりも大きい第1の動作モードの動作クロックとを生成するクロック生成手段と、
第2の動作モードから復帰する際、前記クロック生成手段が第1の動作モードの動作クロックに上昇させる前に、当該情報処理装置の状態を示す情報処理装置ステータスデータを前記退避データ記憶手段から前記作業用記憶手段に復帰させる第1のデータ復帰手段と、
前記クロック生成手段が第1の動作モードの動作クロックに上昇させた後、第1の動作モード中に作成されたデータを前記退避データ記憶手段から前記作業用記憶手段に復帰させる第2のデータ復帰手段と、
を有する情報処理装置。
An information processing apparatus having saved data storage means for holding data created in the work storage means during the first operation mode during the second operation mode,
Clock generating means for generating an operation clock for the second operation mode and an operation clock for the first operation mode that is larger than the operation clock for the second operation mode;
When returning from the second operation mode, before the clock generation means raises the operation clock to the first operation mode, the information processing apparatus status data indicating the state of the information processing apparatus is read from the saved data storage means. First data return means for returning to the working storage means;
After the clock generation means raises the operation clock to the first operation mode, the second data restoration for restoring the data created during the first operation mode from the saved data storage means to the working storage means Means,
An information processing apparatus.
前記第1のデータ復帰手段は、前記クロック生成手段が第1の動作モードの動作クロックに上昇させる前に、予め定められた早期復帰データを前記退避データ記憶手段から前記作業用記憶手段に復帰させる、
ことを特徴とする請求項1記載の情報処理装置。
The first data restoration means restores predetermined early restoration data from the saved data storage means to the work storage means before the clock generation means raises the operation clock to the first operation mode. ,
The information processing apparatus according to claim 1.
前記情報処理装置ステータスフラグは、当該情報処理装置の状態が第2の動作モードからの復帰であるかリセットからの起動であるかの情報を有する、
ことを特徴とする請求項1又は2記載の情報処理装置。
The information processing apparatus status flag has information indicating whether the state of the information processing apparatus is a return from the second operation mode or a start from reset,
The information processing apparatus according to claim 1 or 2.
前記早期復帰データは、第1の動作モードの動作クロックを指示するデータである、ことを特徴とする請求項2記載の情報処理装置。   The information processing apparatus according to claim 2, wherein the early return data is data indicating an operation clock of the first operation mode. 前記情報処理装置ステータスフラグに、当該情報処理装置の状態が第2の動作モードからの復帰であるという情報が含まれている場合にのみ、
前記第1のデータ復帰手段は情報処理装置ステータスデータを前記退避データ記憶手段から前記作業用記憶手段に復帰させ、前記第2のデータ復帰手段は第1の動作モード中に作成されたデータを前記退避データ記憶手段から前記作業用記憶手段に復帰させる、
ことを特徴とする請求項3記載の情報処理装置。
Only when the information processing apparatus status flag includes information that the state of the information processing apparatus is a return from the second operation mode,
The first data return means returns information processing apparatus status data from the saved data storage means to the work storage means, and the second data return means transfers the data created during the first operation mode to the work data storage means. Returning from the saved data storage means to the working storage means;
The information processing apparatus according to claim 3.
前記退避データ記憶手段は、当該情報処理装置が有するプロセッサとのみ接続されている、ことを特徴とする請求項1〜5いずれか1項記載の情報処理装置。   6. The information processing apparatus according to claim 1, wherein the save data storage unit is connected only to a processor included in the information processing apparatus. 前記退避データ記憶手段が不揮発メモリの場合、第2の動作モードにおいて前記退避データ記憶手段への電源が遮断される、ことを特徴とする請求項6記載の情報処理装置。   7. The information processing apparatus according to claim 6, wherein when the saved data storage means is a non-volatile memory, the power to the saved data storage means is shut off in the second operation mode. プログラムを実行する第1の動作モード中に作業用記憶手段に作成されたデータを、第2の動作モード中に保持する退避データ記憶手段を有する情報処理装置のデータ復帰方法であって、
クロック生成手段が第2の動作モードの動作クロックを生成するステップと、
前記クロック生成手段が第1の動作モードの動作クロックに上昇させる前に、第1のデータ復帰手段が、当該情報処理装置の状態を示す情報処理装置ステータスデータを前記退避データ記憶手段から前記作業用記憶手段に復帰させるステップと、
クロック生成手段が、第2の動作モードより大きい第1の動作モードの動作クロックを生成するステップと、
前記クロック生成手段が第1の動作モードの動作クロックに上昇させた後、第2のデータ復帰手段が、第1の動作モード中に作成されたデータを前記退避データ記憶手段から前記作業用記憶手段に復帰させるステップと、
を有するデータ復帰方法。
A data restoration method for an information processing apparatus having saved data storage means for holding data created in a working storage means during a first operation mode for executing a program during a second operation mode,
A step of generating a clock for the second operation mode by the clock generation means;
Before the clock generation means raises the operation clock to the first operation mode, the first data restoration means sends the information processing apparatus status data indicating the state of the information processing apparatus from the saved data storage means to the work data. Returning to the storage means;
The clock generation means generating an operation clock of the first operation mode that is larger than the second operation mode;
After the clock generation unit raises the operation clock to the first operation mode, the second data restoration unit transfers the data created during the first operation mode from the saved data storage unit to the work storage unit. Step to return to
A data recovery method.
JP2011253703A 2011-11-21 2011-11-21 Information processing apparatus and data restoration method Active JP5660010B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011253703A JP5660010B2 (en) 2011-11-21 2011-11-21 Information processing apparatus and data restoration method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011253703A JP5660010B2 (en) 2011-11-21 2011-11-21 Information processing apparatus and data restoration method

Publications (2)

Publication Number Publication Date
JP2013109559A true JP2013109559A (en) 2013-06-06
JP5660010B2 JP5660010B2 (en) 2015-01-28

Family

ID=48706249

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011253703A Active JP5660010B2 (en) 2011-11-21 2011-11-21 Information processing apparatus and data restoration method

Country Status (1)

Country Link
JP (1) JP5660010B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015170006A (en) * 2014-03-05 2015-09-28 株式会社デンソー Control device and initialization program
JP7444661B2 (en) 2019-03-29 2024-03-06 ラピスセミコンダクタ株式会社 Wake-up circuit and reception system

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0589041A (en) * 1991-09-30 1993-04-09 Casio Comput Co Ltd Data processor
JPH06230845A (en) * 1993-02-08 1994-08-19 Fujitsu Ltd Resuming system
JPH07134628A (en) * 1993-11-10 1995-05-23 Hitachi Ltd Power saving control method and information processor
JP2006095741A (en) * 2004-09-28 2006-04-13 Fuji Xerox Co Ltd Information processing equipment
JP2008005336A (en) * 2006-06-23 2008-01-10 Kyocera Corp Receiver, reception processing method, and base band processor
JP2008234046A (en) * 2007-03-16 2008-10-02 Fujitsu Ltd Oscillation circuit and semiconductor device
JP2009277252A (en) * 2003-05-07 2009-11-26 Mosaid Technologies Corp Management of power on integrated circuit using power island

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0589041A (en) * 1991-09-30 1993-04-09 Casio Comput Co Ltd Data processor
JPH06230845A (en) * 1993-02-08 1994-08-19 Fujitsu Ltd Resuming system
JPH07134628A (en) * 1993-11-10 1995-05-23 Hitachi Ltd Power saving control method and information processor
JP2009277252A (en) * 2003-05-07 2009-11-26 Mosaid Technologies Corp Management of power on integrated circuit using power island
JP2006095741A (en) * 2004-09-28 2006-04-13 Fuji Xerox Co Ltd Information processing equipment
JP2008005336A (en) * 2006-06-23 2008-01-10 Kyocera Corp Receiver, reception processing method, and base band processor
JP2008234046A (en) * 2007-03-16 2008-10-02 Fujitsu Ltd Oscillation circuit and semiconductor device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015170006A (en) * 2014-03-05 2015-09-28 株式会社デンソー Control device and initialization program
JP7444661B2 (en) 2019-03-29 2024-03-06 ラピスセミコンダクタ株式会社 Wake-up circuit and reception system

Also Published As

Publication number Publication date
JP5660010B2 (en) 2015-01-28

Similar Documents

Publication Publication Date Title
US8046615B2 (en) Microcomputer system with reduced power consumption
JP5776124B2 (en) A strategy for starting clocks in power management.
JP4535170B2 (en) Microcomputer system
JP2011164780A (en) Control method of disk array apparatus and disk array apparatus
KR20090026895A (en) Apparatus and method for reducing power consumption in system on chip
JP2013084089A (en) Vehicular device
US20120117364A1 (en) Method and System for Operating a Handheld Calculator
CN102200779A (en) Vehicle-mounted electronic system and energy consumption control method thereof
JP5915733B2 (en) Information processing apparatus, information processing method, and program
CN110096125B (en) Computer-implemented method for saving memory data and computer system
US20040250147A1 (en) Uninterrupted system operation
JP5660010B2 (en) Information processing apparatus and data restoration method
JP2011221708A (en) Information processing devise and control method for information processing devise
JP3960800B2 (en) Method of operating a processor-based system for a vehicle
JP6150669B2 (en) Information processing apparatus, image forming apparatus, and control method thereof
JP5598945B2 (en) Information processing system and control method thereof
JP2010097427A (en) Processing apparatus, processing method and computer program
JP2008059007A (en) Semiconductor storage device
CN113791738A (en) Normalized low-power-consumption processing method and device based on solid state disk and computer equipment
JP3699947B2 (en) Microcontroller
CN110121688B (en) Method for judging loader and electronic system
JP2005078197A (en) Power-saving controller
CN112579005B (en) Method, device, computer equipment and storage medium for reducing average power consumption of SSD
JP2015170006A (en) Control device and initialization program
JP4647276B2 (en) Semiconductor circuit device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20140117

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20140917

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140924

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20141020

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20141104

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20141117

R151 Written notification of patent or utility model registration

Ref document number: 5660010

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151