JP2013161362A - Information processing device and program execution method - Google Patents

Information processing device and program execution method Download PDF

Info

Publication number
JP2013161362A
JP2013161362A JP2012024347A JP2012024347A JP2013161362A JP 2013161362 A JP2013161362 A JP 2013161362A JP 2012024347 A JP2012024347 A JP 2012024347A JP 2012024347 A JP2012024347 A JP 2012024347A JP 2013161362 A JP2013161362 A JP 2013161362A
Authority
JP
Japan
Prior art keywords
input value
value
program
function
sub
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.)
Pending
Application number
JP2012024347A
Other languages
Japanese (ja)
Inventor
Masafumi Okubo
雅史 大久保
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 JP2012024347A priority Critical patent/JP2013161362A/en
Publication of JP2013161362A publication Critical patent/JP2013161362A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide an information processing device which can reduce a processing load of a CPU compared to the case of obtaining a processing result by execution of an instruction, in the situation in which the same processing result is obtained.SOLUTION: An information processing device 100 comprises: program storage means 24 which stores a program 14; input value acquisition means 12 and 25 which acquire an input value of the program; arithmetic means 23 which generates an output value from the input value by executing the program; value storage means 16 which stores a past input value and the output value in association with each other; comparison means 13 which compares the input value acquired by the input value acquisition means with the input value stored in the value storage means; and execution control means 11 which adopts the output value in the value storage means as the output value of the program without causing the arithmetic means to execute the program when the input value acquired by the input value acquisition means matches the input value stored in the value storage means.

Description

本発明は、プログラムを実行する情報処理装置に関し、特に入力値を使用して出力値を生成する情報処理装置に関する。   The present invention relates to an information processing apparatus that executes a program, and more particularly to an information processing apparatus that generates an output value using an input value.

エンジンやモータなどの車載装置の電子制御化が進んでいるが、一台の車両に搭載される電子制御装置(ECU:Electronic Control Unit)の数が増大する傾向が生じている。このため、一つの電子制御装置に、複数の機能を搭載するいわゆる機能統合が進められている。しかしながら、複数の機能を一台の電子制御装置で提供しようとすると、処理能力が不足する場合がある。   In-vehicle devices such as engines and motors are being electronically controlled, but there is a tendency that the number of electronic control units (ECUs) mounted on one vehicle increases. For this reason, so-called function integration in which a plurality of functions are mounted on one electronic control device is being promoted. However, if a plurality of functions are to be provided by a single electronic control device, the processing capability may be insufficient.

処理能力の不足に対応するための方策の一つとして電子制御装置の処理能力を補強することが考えられる。例えば、電子制御装置に搭載されるCPUの動作クロックを大きくすることで処理能力を補強することができる。しかしながら、CPUの消費電力は動作クロックに比例して大きくなるため、消費電力の増大とそれに伴う発熱量の増大という不都合をもたらす。また、例えば、マルチコアのCPUを電子制御装置に搭載することで処理能力を補強することができる。しかし、マルチコアのCPUは単価が高いため電子制御装置のコスト増をもたらすという不都合がある。   As one of the measures for dealing with the shortage of processing capacity, it is conceivable to reinforce the processing capacity of the electronic control unit. For example, the processing capability can be reinforced by increasing the operation clock of the CPU mounted on the electronic control unit. However, since the power consumption of the CPU increases in proportion to the operation clock, there is an inconvenience of an increase in power consumption and an accompanying increase in heat generation. Further, for example, the processing capability can be reinforced by mounting a multi-core CPU in the electronic control unit. However, since the multi-core CPU is expensive, there is an inconvenience that the cost of the electronic control device is increased.

そこで、CPUの処理負荷を低減することが考えられる(例えば、特許文献1参照。)。特許文献1には、繰り返しレジスタに設定された回数、同じ命令を繰り返し実行するプログラム制御装置が開示されている。このプログラム制御装置によれば、一度、命令が読み出されれば、同じ命令を実行している間は命令を読み出したり、繰り返し回数を設定したりするオーバーヘッドを低減することができる。   Therefore, it is conceivable to reduce the processing load on the CPU (for example, see Patent Document 1). Patent Document 1 discloses a program control device that repeatedly executes the same instruction for the number of times set in a repeat register. According to this program control device, once an instruction is read, it is possible to reduce the overhead of reading the instruction and setting the number of repetitions while executing the same instruction.

特開平08−286912号公報JP 08-286912 A

しかしながら、特許文献1に開示されたプログラム制御装置は、同じ命令を繰り返し実行しているためCPUの処理負荷を大きく低減することができないという問題がある。すなわち、同じ命令が同じ入力データを用いて実行される場合、処理結果が同じなるが、特許文献1では入力データの同一性を考慮せずに命令を実行するため、処理負荷を低減できる状況でも処理負荷を低減できていない。   However, the program control device disclosed in Patent Document 1 has a problem that the processing load on the CPU cannot be greatly reduced because the same instruction is repeatedly executed. That is, when the same instruction is executed using the same input data, the processing result is the same. However, in Patent Document 1, since the instruction is executed without considering the identity of the input data, the processing load can be reduced. The processing load cannot be reduced.

本発明は、上記課題に鑑み、同じ処理結果が得られる状況では命令の実行により処理結果を得る場合よりもCPUの処理負荷を低減できる情報処理装置を提供することを目的とする。   In view of the above problems, an object of the present invention is to provide an information processing apparatus that can reduce the processing load of a CPU in a situation where the same processing result is obtained, compared to a case where a processing result is obtained by executing an instruction.

本発明は、プログラムを記憶するプログラム記憶手段と、前記プログラムの入力値を取得する入力値取得手段と、前記入力値を用いた処理を行う前記プログラムを実行して出力値を生成する演算手段と、過去の前記入力値と前記出力値を対応づけて記憶する値記憶手段と、前記入力値取得手段が取得した前記入力値と、前記値記憶手段が記憶する前記入力値を比較する比較手段と、前記入力値取得手段が取得した前記入力値と、前記値記憶手段が記憶する前記入力値が一致する場合、前記プログラムを前記演算手段に実行させずに前記値記憶手段の前記出力値を前記プログラムの前記出力値として採用する実行制御手段と、を有する情報処理装置を提供する。   The present invention includes a program storage unit that stores a program, an input value acquisition unit that acquires an input value of the program, and an arithmetic unit that generates an output value by executing the program that performs processing using the input value. A value storage means for storing the past input value and the output value in association with each other; a comparison means for comparing the input value acquired by the input value acquisition means with the input value stored by the value storage means; When the input value acquired by the input value acquisition means matches the input value stored by the value storage means, the output value of the value storage means is not executed by the calculation means. An information processing apparatus having execution control means employed as the output value of the program is provided.

同じ処理結果が得られる状況では命令の実行により処理結果を得る場合よりもCPUの処理負荷を低減できる情報処理装置を提供することができる。   In a situation where the same processing result is obtained, it is possible to provide an information processing apparatus that can reduce the processing load of the CPU as compared with the case where the processing result is obtained by executing an instruction.

本実施形態のマイコンの概略的な特徴を説明する図の一例である。It is an example of the figure explaining the schematic characteristic of the microcomputer of this embodiment. ECUのハードウェア構成図の一例である。It is an example of the hardware block diagram of ECU. マイコンの機能ブロック図の一例である。It is an example of the functional block diagram of a microcomputer. 機能Iの実行手順、機能IIの実行手順を示す図の一例である。It is an example of the figure which shows the execution procedure of the function I, and the execution procedure of the function II. 前回値テーブルの一例を模式的に説明する図の一例である。It is an example of the figure which illustrates an example of a last time value table typically. 依存関係データを模式的に説明する図の一例である。It is an example of the figure which illustrates dependency relationship data typically. マイコンが機能Iを実行する動作手順を示すフローチャート図の一例である。It is an example of the flowchart figure which shows the operation | movement procedure in which a microcomputer performs the function I. マイコンの機能ブロック図の一例である。It is an example of the functional block diagram of a microcomputer. 定常状態判定結果テーブルの一例である。It is an example of a steady state determination result table. 定常状態判定部の処理を説明するフローチャート図の一例である。It is an example of the flowchart figure explaining the process of a steady state determination part.

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

図1は、本実施形態のマイコン100の概略的な特徴を説明する図の一例である。マイコン100には機能統合により複数の機能I、機能IIが搭載されている。機能I、機能IIは入力値に処理を施して出力値を出力する機能ブロックである。機能ブロックとしては、プログラム、プログラム内の関数、タスク又はスレッドなどが挙げられる。   FIG. 1 is an example of a diagram illustrating schematic features of the microcomputer 100 of the present embodiment. The microcomputer 100 is equipped with a plurality of functions I and II by function integration. Function I and function II are functional blocks that process input values and output output values. Examples of the function block include a program, a function in the program, a task, or a thread.

本実施形態のマイコン100は機能I,機能IIそれぞれの前回入力値と前回出力値を記憶しておく。そして、今回入力値が与えられ機能Iが実行される場合、マイコン100は今回入力値と前回入力値を比較し、一致した場合は機能Iを実行することなく記憶している前回出力値を出力する。   The microcomputer 100 of this embodiment stores the previous input value and the previous output value of each of the functions I and II. When the current input value is given and the function I is executed, the microcomputer 100 compares the current input value with the previous input value, and when they match, outputs the stored previous output value without executing the function I. To do.

例えば、機能Iの入力値が入力値aの場合、マイコンは今回入力値aと前回入力値aを比較して、一致した場合は記憶している前回出力値zを機能Iの出力値に採用する。今回入力値と前回入力値が一致した場合、マイコン100は対応する機能I又は機能IIを実行する必要がないのでCPUの処理負荷を低減できる。   For example, if the input value of function I is the input value a, the microcomputer compares the current input value a with the previous input value a. If they match, the microcomputer uses the stored previous output value z as the output value of function I. To do. If the input value this time matches the previous input value, the microcomputer 100 does not need to execute the corresponding function I or function II, so the processing load on the CPU can be reduced.

ところで、機能I、機能IIのそれぞれからみて車両が安定した状態になると、機能I、IIの入力値が一定になる傾向がある。車両が安定した状態としては、例えば、車両が停車した状態、車両が一定車速で直線を走行する状態、一定の加速度で加速する状態等が想定されるが、どのような状態が安定した状態かは機能毎に異なる。   By the way, when the vehicle is in a stable state as seen from each of the functions I and II, the input values of the functions I and II tend to be constant. As the state where the vehicle is stable, for example, a state where the vehicle stops, a state where the vehicle travels on a straight line at a constant vehicle speed, a state where the vehicle accelerates at a constant acceleration, etc. are assumed. Is different for each function.

本実施形態では機能I、機能IIのそれぞれからみて車両が安定した状態を「定常状態」と称す。したがって、定常状態は前回入力値と今回入力値が一致する状態と定義することができる。なお、定常状態でない状態を高負荷状態と称す。   In the present embodiment, a state in which the vehicle is stable as viewed from each of the functions I and II is referred to as a “steady state”. Therefore, the steady state can be defined as a state in which the previous input value and the current input value match. A state that is not in a steady state is referred to as a high load state.

ここで、機能I、機能IIは、機能統合により一つのマイコン100に搭載されているので機能の独立性が高い。このため、機能Iが定常状態でも機能IIが定常状態になるとは限らず、マイコン100としては定常状態の機能と、高負荷状態の機能が混在した状態になることが期待できる。   Here, since the function I and the function II are mounted on one microcomputer 100 by function integration, the functions are highly independent. For this reason, even if the function I is in the steady state, the function II is not necessarily in the steady state, and the microcomputer 100 can be expected to be in a state where the functions in the steady state and the functions in the high load state are mixed.

本実施形態のマイコン100は定常状態の処理負荷を低減できるので、独立した機能が混在した状況ではマイコン100のピーク時の処理負荷を抑制することが可能になる。したがって、マイコン100のスペックダウン、省電力化、及び、発熱の抑制が可能となる。   Since the microcomputer 100 of this embodiment can reduce the processing load in the steady state, the processing load at the peak of the microcomputer 100 can be suppressed in a situation where independent functions are mixed. Therefore, the specification of the microcomputer 100 can be reduced, power can be saved, and heat generation can be suppressed.

なお、本実施形態では機能統合により統合された複数の機能I、機能IIをマイコン100が有することを前提に説明するが、機能統合の有無に関係なく入力値を使用する機能が1つさえあれば、各マイコンに適用可能である。ただし、本実施例の処理負荷の低減方法は、複数の機能が独立に定常状態となることが期待できる機能統合されたマイコン100に対しより好適に適用できる。   In this embodiment, the description will be made on the assumption that the microcomputer 100 has a plurality of functions I and II integrated by function integration. However, there is even one function that uses an input value regardless of the presence or absence of function integration. For example, it can be applied to each microcomputer. However, the processing load reduction method of the present embodiment can be more suitably applied to the function-integrated microcomputer 100 in which a plurality of functions can be expected to be in a steady state independently.

〔構成例〕
図2は、ECU200のハードウェア構成図の一例を示す。ECU200は、入力I/F11、電源回路14、マイコン100、及び、出力I/F13を有する。この他、CANコントローラのような他の電子制御装置と通信するための通信装置等を有しているが、図示を省略した。
[Configuration example]
FIG. 2 shows an example of a hardware configuration diagram of the ECU 200. The ECU 200 includes an input I / F 11, a power supply circuit 14, a microcomputer 100, and an output I / F 13. In addition, although it has a communication device for communicating with other electronic control devices such as a CAN controller, the illustration is omitted.

車載されるECU200には種々のものがある。例えば、HV−ECU(Electronic Control Unit)、エンジンECU、ブレーキECU、ボディECU、パワステECU、ナビゲーションECU(AV・情報処理ECU)、ゲートウェイECU等が知られている。本実施例のECUは、機能統合によりこれら複数の機能を有する場合がある。また、どのような機能を搭載するかに関わらず、処理負荷を低減することが可能である。   There are various types of ECU 200 mounted on the vehicle. For example, HV-ECU (Electronic Control Unit), engine ECU, brake ECU, body ECU, power steering ECU, navigation ECU (AV / information processing ECU), gateway ECU, and the like are known. The ECU of this embodiment may have these multiple functions by function integration. Moreover, it is possible to reduce the processing load regardless of what functions are installed.

電源回路14はIG−SW15のON/OFFを検出する。IG−SW15のONを検出した場合、電源回路14はバッテリ16から供給される電力を必要に応じて降圧して、入力I/F11、マイコン100及び出力I/F13に供給する。また、IG−SW15のOFFを検出した場合、電源回路14は各回路への電力の供給を停止するが、例えば、RAM25にだけ電力を供給してパラメータを保持するとしてもよい。このようなIG−OFF時の省電力制御により、ECU200は、IG−ON時に演算した(学習した)パラメータを、次回のIG−ON後に使用でき、操作性などを向上させることができる。   The power supply circuit 14 detects ON / OFF of the IG-SW 15. When the ON state of the IG-SW 15 is detected, the power supply circuit 14 steps down the power supplied from the battery 16 as necessary and supplies it to the input I / F 11, the microcomputer 100, and the output I / F 13. In addition, when the IG-SW 15 is detected to be OFF, the power supply circuit 14 stops supplying power to each circuit. For example, the power may be supplied only to the RAM 25 to hold the parameters. By such power saving control at the time of IG-OFF, the ECU 200 can use the parameter calculated (learned) at the time of IG-ON after the next IG-ON, thereby improving the operability and the like.

入力I/F11には、各種のセンサが接続されている。入力I/F11はマルチプレクサとして機能し、各センサの検出信号を時分割又は優先度に基づき読み出し、センサの識別情報と共にマイコン100のA/D21又はI/O22に送信する。また、入力I/F11は、CPU23からの指示によりセンサから検出信号を取得する場合と、指示がなくてもセンサから検出信号を取得する場合がある。   Various sensors are connected to the input I / F 11. The input I / F 11 functions as a multiplexer, reads the detection signal of each sensor based on time division or priority, and transmits it to the A / D 21 or I / O 22 of the microcomputer 100 together with the sensor identification information. Further, the input I / F 11 may acquire a detection signal from the sensor in response to an instruction from the CPU 23, or may acquire a detection signal from the sensor even if there is no instruction.

マイコン100は、バスを介してCPU23と接続されたA/D21、I/O22、フラッシュROM24、RAM25、I/O26及びWDT27を有する。I/O22は、入力I/F11から入力された検出信号を検出信号の種別と共に、割込みなどの仕組みを利用してCPU23に通知する。また、A/D21はアナログの検出信号をデジタルの検出信号に変換する回路であり、変換後の検出信号を検出信号の種別と共に、割込みなどの仕組みを利用してCPU23に通知する。   The microcomputer 100 includes an A / D 21, an I / O 22, a flash ROM 24, a RAM 25, an I / O 26, and a WDT 27 that are connected to the CPU 23 via a bus. The I / O 22 notifies the CPU 23 of the detection signal input from the input I / F 11 together with the type of the detection signal using a mechanism such as an interrupt. The A / D 21 is a circuit that converts an analog detection signal into a digital detection signal, and notifies the CPU 23 of the converted detection signal together with the type of the detection signal using a mechanism such as an interrupt.

WDT27は、動作クロックをコントロールレジスタなどに設定されている分周比で分周して、時間の経過をカウントアップする回路である。そして、計測した時間が予め定められたリセット時間に達すると(オーバーフローすると)、マイコン100をリセットするなどのフェールセーフ処理を行う。CPU23は、WDT27がオーバーフローする前に定期的に計測されている時間をクリアする。したがって、WDT27がマイコン100をリセットしない間は、CPU23が各機能を想定される時間内に実行していることが推定できる。なお、WDT27は、マイコン内でなくマイコン外の電子制御装置上に配置されていてもよい。   The WDT 27 is a circuit that counts up the passage of time by dividing the operation clock by a division ratio set in a control register or the like. When the measured time reaches a predetermined reset time (overflow), fail-safe processing such as resetting the microcomputer 100 is performed. The CPU 23 clears the time that is regularly measured before the WDT 27 overflows. Therefore, while the WDT 27 does not reset the microcomputer 100, it can be estimated that the CPU 23 is executing each function within the expected time. Note that the WDT 27 may be arranged not on the microcomputer but on an electronic control device outside the microcomputer.

CPU23は、フラッシュROM24に記憶されているプログラムを実行して、検出信号の読み取り、演算、マップ引き、RAM25への書き込み又はI/O26への出力を行う。このプログラムに複数の機能I,機能IIが含まれる。これらの具体的な処理内容はECU200の種類や、機能によって異なる。   The CPU 23 executes a program stored in the flash ROM 24 to read a detection signal, calculate, map, write to the RAM 25, or output to the I / O 26. This program includes a plurality of functions I and II. These specific processing contents vary depending on the type and function of the ECU 200.

後段のI/O26は、CPU23からの指示により、制御対象の識別情報やチップ選択線のアサートと共に演算結果を出力I/F13に出力する。出力I/F13は、各種のアクチュエータと接続されている。出力I/F13は、例えばD/A変換した電圧値等をアクチュエータに出力することでアクチュエータを制御する。また、出力I/F13は例えば、スイッチ素子であり、ソレノイドに通電しリレーなどの開閉を制御する。また、出力I/F13は例えばドライバ回路であり、直流電圧を交流電圧に変換してモータの回転数を制御する。   The subsequent I / O 26 outputs the calculation result to the output I / F 13 together with the identification information of the control target and the assertion of the chip selection line in response to an instruction from the CPU 23. The output I / F 13 is connected to various actuators. The output I / F 13 controls the actuator by outputting, for example, a D / A converted voltage value to the actuator. The output I / F 13 is, for example, a switch element, and energizes the solenoid to control opening and closing of the relay. The output I / F 13 is, for example, a driver circuit, which converts a DC voltage into an AC voltage and controls the rotation speed of the motor.

図3は、マイコン100の機能ブロック図の一例を示す。マイコン100は機能Iと機能IIを有している。機能Iと機能IIはそれぞれ別々のECUに搭載されていた機能である。マイコン100のCPU23は機能Iと機能IIを独立に実行する。   FIG. 3 shows an example of a functional block diagram of the microcomputer 100. The microcomputer 100 has a function I and a function II. Function I and function II are functions mounted in separate ECUs. The CPU 23 of the microcomputer 100 executes the function I and the function II independently.

図4(a)は機能Iの実行手順を、図4(b)は機能IIの実行手順をそれぞれ示す。CPU23がシングルコアの場合、マイコン100はCPU23を含むリソースを時分割して機能I、機能IIをそれぞれ実行する。例えば、CPU23がアドレス順にプログラムを読み出すことで機能Iと機能IIの実行を機械的に繰り返してもよいし、機能I、機能IIが実行終了時にタイマを設定し、タイマ割込みにより実行開始されてもよい。また、OS(Operating System)の例えばスケジューラが、機能Iと機能IIをCPU23などのリソースに割り当てることで、繰り返し実行してもよい。この場合、機能Iと機能IIの全体を実行させるのでなく、所定のスライスタイム毎にコンテキストを切り替えて実行してもよい。   4A shows the execution procedure of function I, and FIG. 4B shows the execution procedure of function II. When the CPU 23 is a single core, the microcomputer 100 executes the functions I and II by time-sharing resources including the CPU 23. For example, the CPU 23 may mechanically repeat the execution of the function I and the function II by reading the program in the order of addresses, or the function I and the function II may set a timer at the end of the execution and start execution by a timer interrupt. Good. Further, for example, a scheduler of an OS (Operating System) may be repeatedly executed by assigning the functions I and II to resources such as the CPU 23. In this case, instead of executing the entire functions I and II, the contexts may be switched at predetermined slice times.

図3に戻り、機能Iは全体制御部11、ラッチ処理部12、定常状態判定部13、及び、サブ機能14(以下、区別する場合、サブ機能A〜Fという)を有する。機能IIも全体制御部11、ラッチ処理部12、定常状態判定部13、及び、サブ機能G、Hを有するが、本実施形態の特徴部における機能I,機能IIの内容は同等なので機能IIの説明は省略する。なお、3つ以上の機能が統合されていてもよい。   Returning to FIG. 3, the function I includes an overall control unit 11, a latch processing unit 12, a steady state determination unit 13, and a sub-function 14 (hereinafter referred to as sub-functions A to F when distinguished). The function II also has an overall control unit 11, a latch processing unit 12, a steady state determination unit 13, and sub-functions G and H. However, since the contents of the function I and the function II in the characteristic part of this embodiment are the same, the function II Description is omitted. Three or more functions may be integrated.

〔入力値 出力値〕
全体制御部11は、例えばMain関数であり、各機能ブロックが記述された順番又はタイミングやフラグなどの条件の判定結果にしたがい各機能ブロックを実行する。
[Input value Output value]
The overall control unit 11 is, for example, a Main function, and executes each functional block according to the order in which each functional block is described or the determination result of conditions such as timing and flag.

機能ブロックのうち、サブ機能A〜Fが機能統合前から機能Iに含まれている機能である。サブ機能A〜Fは例えば1つ以上の関数又はサブルーチンである。関数の場合、呼び出し元から引数が与えられると関数に特有の処理を行い、戻り値を呼び出し元に返す。呼び出し元は例えば全体制御部11又は別の関数である。サブルーチンも同様であるが、戻り値がない場合がある。関数又はサブルーチンが直接、アクチュエータ等を制御する場合もあるが、この場合も制御結果は呼び出し元に返される。したがって、サブ機能A〜Fにおいて、入力値は例えば引数、出力値は例えば戻り値又は関数やサブルーチンの演算結果である。   Among the functional blocks, the sub-functions A to F are functions included in the function I before function integration. The sub functions A to F are, for example, one or more functions or subroutines. In the case of a function, when an argument is given from the caller, processing specific to the function is performed and a return value is returned to the caller. The caller is, for example, the overall control unit 11 or another function. The subroutine is similar, but there may be no return value. In some cases, the function or subroutine directly controls the actuator or the like. In this case, the control result is returned to the caller. Therefore, in the subfunctions A to F, the input value is, for example, an argument, and the output value is, for example, a return value or a calculation result of a function or subroutine.

入力値には、静的変数、レジスタ値、又は、関数そのものなどがあるが、何が入力値となるかはサブ機A〜F能毎に予め決まっている。また、出力値には、変数、レジスタ値、真偽変数などがあり、何が出力値となるかはサブ機能A〜F毎に予め決まっている。サブ機能A〜Fは、入力値に基づきマップを参照して入力値に対応する出力値を読み出す処理、入力値に四則演算やシフト演算を行い出力値を生成する処理、入力値と閾値を比較して判定結果を出力値とする処理などを行う。   The input value includes a static variable, a register value, or a function itself, but what is the input value is determined in advance for each of the sub machines A to F. The output value includes a variable, a register value, a true / false variable, and the output value is predetermined for each of the sub functions A to F. Sub-functions A to F read the output value corresponding to the input value by referring to the map based on the input value, perform the four arithmetic operations and shift operation on the input value to generate the output value, and compare the input value and the threshold value Then, a process of using the determination result as an output value is performed.

〔依存関係 定常状態の判定〕
全体制御部11は、まずラッチ処理部12を呼び出して、サブ機能A〜Fの入力値をラッチさせる。ラッチされた入力値が今回入力値である。ラッチとは、収集や取得という意味である。ラッチ処理部12には、予めサブ機能A〜Fの入力値を全てがリストアップされている。ラッチ処理部12は、サブ機能A〜Fの入力値をRAMから読み出したり、レジスタから読み出したりしてラッチする。これらは、不図示のセンサが検出したデータ、CAN通信により受信したデータ、又は、DCM(Data Communication Module)などが携帯電話網で受信したデータ等である。
[Dependency determination of steady state]
The overall control unit 11 first calls the latch processing unit 12 to latch the input values of the sub functions A to F. The latched input value is the current input value. Latch means collection or acquisition. In the latch processing unit 12, all input values of the sub functions A to F are listed in advance. The latch processing unit 12 reads and latches the input values of the sub functions A to F from the RAM or from the register. These are data detected by a sensor (not shown), data received by CAN communication, data received by a DCM (Data Communication Module), etc. via a mobile phone network.

サブ機能A〜Fが例えば別のサブ機能の処理結果(出力値)を入力値とする場合があるが、その場合は、サブ機能A〜Fが処理したタイミングで入力値を取得する。本実施形態では説明を簡単にするため、サブ機能A〜Fが例えば別のサブ機能の処理結果を入力値とすることはないものとする。   For example, the subfunctions A to F may use the processing result (output value) of another subfunction as an input value. In this case, the input value is acquired at the timing when the subfunctions A to F have processed. In the present embodiment, to simplify the description, it is assumed that the sub functions A to F do not use the processing result of another sub function as an input value, for example.

ラッチ処理部12は、リストアップされた全ての今回入力値をラッチすると全体制御部11に返す。全体制御部11は定常状態判定部13を呼び出すと共に、全ての今回入力値を定常状態判定部13に引数として渡す。   The latch processing unit 12 latches all the current input values listed up and returns them to the overall control unit 11. The overall control unit 11 calls the steady state determination unit 13 and passes all current input values to the steady state determination unit 13 as arguments.

定常状態判定部13は、前回値テーブル16に登録されている前回入力値と今回入力値を比較することで、機能Iが定常状態か否かを判定する。定常状態か否かの判定の際、定常状態判定部13は依存関係データ15を参照し、依存関係のあるサブ機能グループ毎に定常状態か否かを判定する。   The steady state determination unit 13 determines whether or not the function I is in a steady state by comparing the previous input value registered in the previous value table 16 with the current input value. When determining whether or not it is in a steady state, the steady state determination unit 13 refers to the dependency relationship data 15 to determine whether or not each sub function group having a dependency relationship is in a steady state.

図5は前回値テーブル16の一例を模式的に説明する図の一例である。前回値テーブル16には、サブ機能毎に前回入力値と前回出力値が記録されている。定常状態判定部13は、サブ機能毎に、今回入力値と前回入力値が一致するか否かを判定する。例えば、サブ機能Aの入力値はa1,a2の2つなので、定常状態判定部13は今回入力値a1,a2と前回入力値a1,a2の両方が一致すると、入力値が一致すると判定する。   FIG. 5 is an example of a diagram for schematically explaining an example of the previous value table 16. In the previous value table 16, the previous input value and the previous output value are recorded for each sub-function. The steady state determination unit 13 determines whether or not the current input value matches the previous input value for each sub-function. For example, since the input values of the sub-function A are two values a1 and a2, the steady state determination unit 13 determines that the input values match if both the current input values a1 and a2 match the previous input values a1 and a2.

入力値は有効桁の全てで一致する必要はない。開発者等が、例えば、3桁の入力値のうち最小桁の値が出力値に大きな影響を与えないことが分かっている場合は入力値の上位2桁のみを比較すればよい。また、小数点以下の桁が出力値に大きな影響を与えないことが分かっている場合、整数桁のみを比較すればよい。このように、一致するか否かの判定基準を緩和することで、定常状態と判定されやすくなりマイコン100の処理負荷を低減しやすくなる。   Input values do not have to match in all significant digits. For example, if the developer knows that the value of the smallest digit among the input values of three digits does not greatly affect the output value, only the upper two digits of the input value need be compared. If it is known that digits after the decimal point do not significantly affect the output value, only integer digits need to be compared. In this way, by relaxing the criteria for determining whether or not they match, it is easier to determine the steady state and the processing load on the microcomputer 100 can be reduced.

図6は、依存関係データ15を模式的に説明する図の一例である。図6では各サブ機能がツリー状に接続されている。依存関係データ15には、サブ機能間の依存関係が登録されている。依存関係には、処理の順番に制約がある処理依存や、他のサブ機能のデータを必要とするデータ依存がある。依存関係は固定なので、開発者等が予め依存関係を抽出し依存関係データ15に登録しておくことができる。図6によれば、サブ機能Cはサブ機能Bと依存関係にあり、サブ機能Bはサブ機能Aと依存関係にあり、サブ機能Dはサブ機能Aと依存関係にある。   FIG. 6 is an example of a diagram for schematically explaining the dependency relationship data 15. In FIG. 6, each sub-function is connected in a tree shape. In the dependency relationship data 15, the dependency relationship between the sub-functions is registered. Dependencies include processing dependencies with restrictions on processing order and data dependencies that require data of other subfunctions. Since the dependency relationship is fixed, a developer or the like can extract the dependency relationship in advance and register it in the dependency relationship data 15. According to FIG. 6, sub function C is dependent on sub function B, sub function B is dependent on sub function A, and sub function D is dependent on sub function A.

このような依存関係がある場合、仮にサブ機能Cの前回入力値と今回入力値が一致しても、サブ機能A又はサブ機能Bの前回入力値と今回入力値が一致していない場合、サブ機能Cの処理結果に影響が生じるおそれがある。また、仮にサブ機能Aの前回入力値と今回入力値が一致しても、サブ機能B又はサブ機能Cの前回入力値と今回入力値が一致していない場合、サブ機能Aへの戻り値に影響が生じるおそれがある。そこで、本実施形態では、依存関係のある全てのサブ機能の前回入力値と今回入力値が一致した場合に、サブ機能グループが定常状態であると判定する。すなわち、サブ機能グループ毎に定常状態か否かを判定する。   If there is such a dependency, even if the previous input value of the subfunction C and the current input value match, the previous input value of the subfunction A or the subfunction B does not match the current input value. The processing result of function C may be affected. If the previous input value of the subfunction A and the current input value match, but the previous input value of the subfunction B or C does not match the current input value, the return value to the subfunction A is set. Impact may occur. Therefore, in this embodiment, when the previous input value and the current input value of all subfunctions having a dependency relationship match, it is determined that the subfunction group is in a steady state. That is, it is determined whether or not each sub-function group is in a steady state.

図6の例では、1つのサブ機能グループはサブ機能A〜D、もう1つのサブ機能グループはサブ機能E,Fである。依存関係が全くないサブ機能は1つだけで1つのサブ機能グループである。したがって、定常状態判定部13は、サブ機能A〜Dの前回入力値と今回入力値が全て一致するか否かを判定し、サブ機能E,Fの前回入力値と今回入力値が全て一致するか否かを判定する。   In the example of FIG. 6, one sub-function group is sub-functions A to D, and the other sub-function group is sub-functions E and F. There is only one sub-function with no dependency relationship, which is one sub-function group. Therefore, the steady state determination unit 13 determines whether or not the previous input values of the sub-functions A to D and the current input value all match, and the previous input values of the sub-functions E and F and the current input value all match. It is determined whether or not.

なお、図6のような機能ツリーが抽出された場合でも、例えば、上位のサブ機能Aがサブ機能B〜Dの処理結果に影響を受けないことが確定していることがある。このような知見は開発者にとっては既知である。したがって、開発者等が、機能ツリーのうち一部の上位のサブ機能を特定しておくことで、定常状態判定部13は、下位のサブ機能と切り離して前回入力値と今回入力値が一致するか否か(定常状態か否か)を判定することができる。この場合、一部の上位のサブ機能がサブ機能グループとなる。   Even when the function tree as shown in FIG. 6 is extracted, for example, it may be determined that the upper subfunction A is not affected by the processing results of the subfunctions B to D. Such knowledge is known to developers. Therefore, when a developer or the like identifies some upper subfunctions in the function tree, the steady state determination unit 13 separates from the lower subfunctions so that the previous input value matches the current input value. It can be determined whether or not (steady state). In this case, some upper sub-functions become sub-function groups.

なお、定常状態判定部13は、前回入力値との比較に使用した今回入力値を、新たな前回入力値として前回値テーブル16に登録する。これにより、前回値テーブル16の前回入力値は最新の入力値に更新される。   The steady state determination unit 13 registers the current input value used for comparison with the previous input value in the previous value table 16 as a new previous input value. As a result, the previous input value in the previous value table 16 is updated to the latest input value.

定常状態判定部13は、サブ機能グループ毎(又はサブ機能毎でもよい)に定常状態か否かの判定結果を全体制御部11に通知する。全体制御部11はサブ機能A〜Fのうち、定常状態のサブ機能は実行しない。これにより、マイコン100のCPU23の処理負荷を低減できる。   The steady state determination unit 13 notifies the overall control unit 11 of the determination result as to whether or not the steady state exists for each sub-function group (or for each sub-function). The overall control unit 11 does not execute a steady state sub-function among the sub-functions A to F. Thereby, the processing load of CPU23 of the microcomputer 100 can be reduced.

そして、全体制御部11は、定常状態と判定されたサブ機能の前回出力値を前回値テーブル16から読み出す。また、全体制御部11は、定常状態と判定されなかったサブ機能に今回入力値を渡すと共に実行し、各サブ機能の今回出力値を各サブ機能から取得する。そして、前回値テーブル16の前回出力値をサブ機能が出力した今回出力値にて更新する。こうすることで、前回値テーブル16の前回出力値も、最新の出力値を維持することができる。   Then, the overall control unit 11 reads the previous output value of the sub function determined to be in the steady state from the previous value table 16. In addition, the overall control unit 11 passes and executes the current input value to the sub-function that has not been determined to be in the steady state, and acquires the current output value of each sub-function from each sub-function. Then, the previous output value in the previous value table 16 is updated with the current output value output by the sub-function. By doing so, the latest output value of the previous value table 16 can also be maintained as the latest output value.

〔動作手順〕
図7は、マイコン100が機能Iを実行する動作手順を示すフローチャート図の一例である。図7の手順は例えば定期的に繰り返し実行される。機能Iではまず全体制御部11が実行される。全体制御部11はラッチ処理部12を呼び出す。これによりラッチ処理部12は機能Iに必要な全ての入力値をラッチする(S10)。ラッチ処理部12はラッチした全ての今回入力値を全体制御部11に返す。
[Operation procedure]
FIG. 7 is an example of a flowchart illustrating an operation procedure in which the microcomputer 100 executes the function I. The procedure of FIG. 7 is repeatedly executed, for example, periodically. In the function I, the overall control unit 11 is first executed. The overall control unit 11 calls the latch processing unit 12. Accordingly, the latch processing unit 12 latches all input values necessary for the function I (S10). The latch processing unit 12 returns all latched current input values to the overall control unit 11.

全体制御部11は今回入力値を引数に定常状態判定部13を呼び出す。これにより、定常状態判定部13は依存関係データ15を参照して、サブ機能グループ単位で定常状態か否かを判定する(S20)。ここでは、例えば、サブ機能E,Fのサブ機能グループが定常状態であり、サブ機能A〜Dのサブ機能グループは定常状態でなかったとする。   The overall control unit 11 calls the steady state determination unit 13 using the current input value as an argument. Thus, the steady state determination unit 13 refers to the dependency relationship data 15 and determines whether or not the steady state is in units of sub-function groups (S20). Here, for example, it is assumed that the sub function groups of the sub functions E and F are in the steady state, and the sub function groups of the sub functions A to D are not in the steady state.

そして、全体制御部11は、定常状態でないと判定されたサブ機能グループのサブ機能A〜Dを順次、実行する。すなわち、サブ機能Aの今回入力値を引数にサブ機能Aを呼び出し、サブ機能Aを実行する(S30)。サブ機能Aは今回出力値を全体制御部11に返す。   Then, the overall control unit 11 sequentially executes the sub functions A to D of the sub function group determined not to be in the steady state. That is, the sub-function A is called with the current input value of the sub-function A as an argument, and the sub-function A is executed (S30). The sub function A returns the current output value to the overall control unit 11.

次に、サブ機能Bの今回入力値を引数にサブ機能Bを呼び出し、サブ機能Bを実行する(S40)。サブ機能Bは今回出力値を全体制御部11に返す。   Next, the sub function B is called with the current input value of the sub function B as an argument, and the sub function B is executed (S40). The subfunction B returns the current output value to the overall control unit 11.

次に、サブ機能Cの今回入力値を引数にサブ機能Cを呼び出し、サブ機能Cを実行する(S50)。サブ機能Cは今回出力値を全体制御部11に返す。   Next, the sub function C is called with the current input value of the sub function C as an argument, and the sub function C is executed (S50). The sub function C returns the current output value to the overall control unit 11.

次に、サブ機能Dの今回入力値を引数にサブ機能Dを呼び出し、サブ機能Dを実行する(S60)。サブ機能Dは今回出力値を全体制御部11に返す。   Next, the sub function D is called by using the current input value of the sub function D as an argument, and the sub function D is executed (S60). The sub function D returns the current output value to the overall control unit 11.

そして、全体制御部11は、本来はサブ機能E,Fを実行するタイミングでも、サブ機能E,Fの実行を省略する(S70,S80)。全体制御部11は定常状態判定部13の判定結果に基づき、前回値テーブル16からサブ機能E,Fの前回出力値を読み出し、サブ機能E,Fの出力値として採用する。具体的には、サブ機能E,Fの出力値で制御するアクチュエータ等があれば制御し、サブ機能E,Fが出力値で直接、アクチュエータ等を制御するのであれば、サブ機能E,Fに出力値を渡す(この場合もサブ機能E,Fが演算を実行することはない)。また、別のサブ機能にサブ機能E,Fの前回出力値を渡してもよい。これにより、マイコン100のCPU23の負荷を低減できる。   Then, the overall control unit 11 omits the execution of the sub functions E and F even at the timing when the sub functions E and F are originally executed (S70, S80). The overall control unit 11 reads out the previous output values of the sub functions E and F from the previous value table 16 based on the determination result of the steady state determination unit 13 and adopts them as the output values of the sub functions E and F. Specifically, if there is an actuator or the like controlled by the output values of the sub-functions E and F, control is performed. If the sub-functions E and F directly control the actuator or the like by the output values, the sub-functions E and F are controlled. The output value is passed (in this case, the sub-functions E and F do not execute the operation). Further, the previous output values of the sub-functions E and F may be passed to another sub-function. Thereby, the load on the CPU 23 of the microcomputer 100 can be reduced.

以上説明したように、本実施例のマイコン100は、定常状態の機能を実行するCPU23の処理負荷を低減できるのでマイコン100やCPU23の仕様のダウンを可能にできる。また、CPU23の消費電力も低下するので、燃費向上・発熱抑制が図られ、ECU200の放熱性能の仕様をダウンすることが可能になる。   As described above, the microcomputer 100 according to the present embodiment can reduce the processing load on the CPU 23 that executes the steady-state function, so that the specifications of the microcomputer 100 and the CPU 23 can be reduced. In addition, since the power consumption of the CPU 23 is also reduced, fuel efficiency is improved and heat generation is suppressed, and the heat dissipation performance specifications of the ECU 200 can be reduced.

実施例1では、定常状態のサブ機能を実行しないことで処理負荷を低減したが、定常状態か否かを判定する処理が必要になった。このため、定常状態でないと判定されたサブ機能については、定常状態か否かの判定処理の分だけ従来よりも処理量が多くなってしまっている。そこで、本実施例では、サブ機能の定常状態頻度を学習し、定常状態になりにくいサブ機能は定常状態か否かを判定対象から除外するマイコン100について説明する。   In the first embodiment, the processing load is reduced by not executing the sub-function in the steady state, but a process for determining whether or not the steady state is present is necessary. For this reason, the processing amount of the sub-function determined not to be in the steady state is larger than that in the conventional case by the amount of determination processing for determining whether or not it is in the steady state. Therefore, in the present embodiment, a description will be given of the microcomputer 100 that learns the steady-state frequency of the sub-function and excludes from the determination target whether the sub-function that is less likely to be in the steady-state is a steady-state.

図8は、本実施例のマイコン100の機能ブロック図の一例を示す。図8において図3と同一部には同一の符号を付しその説明は省略する。本実施例の機能Iは、新たに定常状態判定結果テーブル17を有している。定常状態判定結果テーブル17は、過去に定常状態であると判定された回数が登録されたテーブルである。   FIG. 8 shows an example of a functional block diagram of the microcomputer 100 of the present embodiment. 8, the same parts as those in FIG. 3 are denoted by the same reference numerals, and the description thereof is omitted. The function I of the present embodiment has a new steady state determination result table 17. The steady state determination result table 17 is a table in which the number of times determined to be a steady state in the past is registered.

図9(a)は定常状態判定結果テーブル17の一例を示す。定常状態判定結果テーブル17にはサブ機能毎に判定機会、定常判定回数、及び、非定常判定回数が登録されている。判定機会は、サブ機能A〜Fが定常状態か否かが判定された機会の回数である。図では判定機会は等しく100回となっている。   FIG. 9A shows an example of the steady state determination result table 17. In the steady state determination result table 17, a determination opportunity, a steady determination count, and a non-steady determination count are registered for each sub-function. The determination opportunity is the number of opportunities for determining whether or not the sub-functions A to F are in a steady state. In the figure, the judgment opportunities are equally 100 times.

実施例1では図7のフローチャート図に示したように、機能Iが実行されるとサブ機能A〜Fが全て実行されるので、サブ機能A〜Fは全て定常状態か否かが判定されていた。本実施例では、以下の場合に定常状態か否かを判定する。
(i)判定機会が十分に大きな数になるまでは、マイコン100の処理負荷が所定以下の場合に限り、サブ機能グループが定常状態か否かを判定する
(ii)判定機会が十分に大きな数になった後、省略実施確率が閾値以上のサブ機能グループのみ定常状態か否かを判定する。省略実施確率が閾値未満のサブ機能グループは定常状態か否かの判定対象から除外する。
(iii)判定機会が十分に大きな数になった後、マイコン100の処理負荷が所定以下の場合に限り、省略実施確率が閾値未満のサブ機能グループが定常状態か否かを判定する
なお、マイコン100の処理負荷は、例えばCPU負荷率としマイコン100のOS等から提供される。CPU負荷率は例えば、単位時間からアイドルタスクの実行時間を減じた値を単位時間で除することで求められる。
In the first embodiment, as shown in the flowchart of FIG. 7, when the function I is executed, all the sub functions A to F are executed. Therefore, it is determined whether or not all the sub functions A to F are in a steady state. It was. In the present embodiment, it is determined whether or not a steady state is reached in the following cases.
(I) Until a sufficiently large number of determination opportunities, it is determined whether or not the sub-function group is in a steady state only when the processing load of the microcomputer 100 is equal to or less than a predetermined value. (Ii) A sufficiently large number of determination opportunities After that, it is determined whether only the sub-function group whose omission execution probability is equal to or higher than the threshold is in a steady state. A sub-function group whose omission execution probability is less than the threshold is excluded from the determination target whether or not it is in a steady state.
(Iii) Only when the processing load of the microcomputer 100 is equal to or less than a predetermined value after the determination opportunity becomes a sufficiently large number, it is determined whether or not the sub-function group whose omission execution probability is less than the threshold is in a steady state. The processing load of 100 is provided from the OS of the microcomputer 100, for example, as a CPU load factor. The CPU load factor is obtained, for example, by dividing the value obtained by subtracting the idle task execution time from the unit time by the unit time.

定常判定回数は、定常状態であると判定された回数であり、非定常判定回数は、定常状態でないと判定された回数である。したがって、判定機会=定常判定回数+非定常判定回数という関係がある。なお、定常状態か否かはサブ機能グループ毎に判定されるので、同じサブ機能グループのサブ機能は定常判定回数が同じになる。   The number of times of steady determination is the number of times determined to be in a steady state, and the number of times of unsteady determination is the number of times determined to be not in a steady state. Therefore, there is a relationship of determination opportunity = number of steady determinations + unsteady determinations. In addition, since it is determined for each sub function group whether or not it is in a steady state, the number of times of steady determination is the same for the sub functions in the same sub function group.

定常状態判定部13は、定常状態か否かを判定する毎に判定機会を1つ増やし、定常状態であると判定すれば定常判定回数を1つ増やし、定常状態でないと判定すれば非定常判定回数を1つ増やす。   Each time the steady state determination unit 13 determines whether or not it is in the steady state, the determination opportunity is increased by one. If it is determined that the state is in the steady state, the steady determination number is increased by one. Increase the number by one.

また、定常状態判定部13は、判定機会が十分に大きな数になると、マイコン100の処理負荷が大きくない時に、省略実施確率を算出する。
省略実施確率=100×定常判定回数/判定機会
図の例ではサブ機能A〜Dの省略実施確率は70%であり、サブ機能E,Fの省略実施確率は30%である。そして、定常状態判定部13は、省略実施確率を閾値と比較して、比較結果に応じた定常状態判定省略フラグを保持しておく。図9(b)は定常状態判定省略フラグを示す図の一例である。定常状態判定省略フラグ“1”は定常状態の判定を省略することを、定常状態判定省略フラグ“0”は定常状態の判定を行うことを示す。
In addition, when the number of determination opportunities becomes sufficiently large, the steady state determination unit 13 calculates an omitted execution probability when the processing load on the microcomputer 100 is not large.
Omission execution probability = 100 × number of regular determinations / determination opportunity In the example in the figure, the omission execution probability of the sub functions A to D is 70%, and the omission execution probability of the sub functions E and F is 30%. Then, the steady state determination unit 13 compares the omission execution probability with a threshold and holds a steady state determination omission flag corresponding to the comparison result. FIG. 9B is an example of a diagram showing a steady state determination omission flag. The steady state determination omission flag “1” indicates that the determination of the steady state is omitted, and the steady state determination omission flag “0” indicates that the determination of the steady state is performed.

例えば、省略実施確率が50%未満のサブ機能は、2回に1回は実行されることになるので、定常状態か否かの判定が処理負荷を増大させるおそれがある。開発者等は、定常判定がどのくらいの負荷となるかということと、実行省略時の負荷低減とを考量し、閾値を決定する。   For example, a sub-function with an omission execution probability of less than 50% is executed once every two times, and therefore determination of whether or not it is in a steady state may increase the processing load. Developers, etc., determine the threshold value by taking into account how much load the steady state determination will be and reducing the load when execution is omitted.

定常状態判定部13は、省略実施確率が閾値未満の場合、そのサブ機能の定常状態判定省略フラグを“1”にして保持しておく。そして、定常状態判定省略フラグが“1”のサブ機能については、定常状態の判定を省略する。この結果、全体制御部11は、定常状態判定省略フラグが“1”のサブ機能は必ず実行する。   When the omission execution probability is less than the threshold value, the steady state determination unit 13 sets the steady state determination omission flag of the sub-function to “1” and holds it. For the sub-functions whose steady state determination omission flag is “1”, the determination of the steady state is omitted. As a result, the overall control unit 11 always executes the sub function whose steady state determination omission flag is “1”.

なお、上記(iii)に記載したように、定常状態判定省略フラグが“1”となった後も、定常状態判定部13はマイコン100の処理負荷が低い時に、定常状態か否かを判定することで、定常判定回数及び非定常判定回数を更新する。これにより、定常判定回数が大きくなったサブ機能の定常状態判定省略フラグは“0”となり、定常判定の対象とすることができる。   As described in (iii) above, even after the steady state determination omission flag becomes “1”, the steady state determination unit 13 determines whether the microcomputer 100 is in a steady state when the processing load on the microcomputer 100 is low. Thus, the steady determination times and the unsteady determination times are updated. As a result, the steady state determination omission flag of the sub-function for which the number of steady determinations has increased is set to “0”, and can be the target of steady determination.

図10は、本実施例の定常状態判定部13の処理を説明するフローチャート図の一例である。全体的な動作手順は図7と同様であり、図10は図7のステップS20の処理手順を示す。図10の処理は、全体制御部11が今回入力値を引数に定常状態判定部13を呼び出すことでスタートする。   FIG. 10 is an example of a flowchart for explaining the process of the steady state determination unit 13 of the present embodiment. The overall operation procedure is the same as in FIG. 7, and FIG. 10 shows the processing procedure of step S20 in FIG. The process of FIG. 10 starts when the overall control unit 11 calls the steady state determination unit 13 with the current input value as an argument.

まず、定常状態判定部13は判定機会が十分に大きいか否かを判定する(S201)。判定機会が十分に大きい場合(S201のYes)、処理はステップS206に進む。
判定機会が十分に大きくない場合(S201のNo)、定常状態判定部13はマイコンの処理負荷が低いか否かを判定する(S202)。マイコンの処理負荷が低くない場合(S202のNo)、定常状態か否かを判定すると処理負荷がさらに高くなってしまうので、定常状態判定部13は全てのサブ機能が定常状態でないと判定する(S203)。判定結果を全体制御部11に返す。この場合、全体制御部11は全てのサブ機能を実行する。
First, the steady state determination unit 13 determines whether the determination opportunity is sufficiently large (S201). If the determination opportunity is sufficiently large (Yes in S201), the process proceeds to step S206.
When the determination opportunity is not sufficiently large (No in S201), the steady state determination unit 13 determines whether the processing load on the microcomputer is low (S202). If the processing load of the microcomputer is not low (No in S202), the processing load will be further increased if it is determined whether or not it is in the steady state, so the steady state determination unit 13 determines that all the sub-functions are not in the steady state ( S203). The determination result is returned to the overall control unit 11. In this case, the overall control unit 11 executes all the sub functions.

マイコンの処理負荷が低い場合(S202のYes)、定常状態判定部13は各サブ機能が定常状態か否かを判定する(S204)。これにより判定機会を増大させることができる。   When the processing load of the microcomputer is low (Yes in S202), the steady state determination unit 13 determines whether each sub-function is in a steady state (S204). Thereby, the determination opportunity can be increased.

定常状態判定部13は定常状態判定結果テーブル17を更新して、全体制御部に判定結果を返す(S205)。この場合、全体制御部11は定常状態でないと判定されたサブ機能のみを実行する。   The steady state determination unit 13 updates the steady state determination result table 17 and returns the determination result to the overall control unit (S205). In this case, the overall control unit 11 executes only the sub-function that is determined not to be in the steady state.

判定機会が十分に大きい場合(S201のYes)、定常状態判定部13は定常状態判定省略フラグを読み出す(S206)。   When the determination opportunity is sufficiently large (Yes in S201), the steady state determination unit 13 reads the steady state determination omission flag (S206).

そして、サブ機能グループに定常状態判定省略フラグが“1”のサブ機能があるか否かを判定する(S207)。サブ機能グループ毎に判定するのは、定常状態か否かはサブ機能グループ単位で判定されるためである。つまり、1つのサブ機能について定常状態か否かを判定しない場合、そのサブ機能グループが定常状態と判定されることがないためである。なお、同じサブ機能グループのサブ機能の定常状態判定省略フラグは同じ状態になると考えられる。   Then, it is determined whether or not the sub-function group has a sub-function whose steady state determination omission flag is “1” (S207). The reason for determining for each sub-function group is that it is determined for each sub-function group whether or not it is in a steady state. That is, if it is not determined whether or not one subfunction is in a steady state, the subfunction group is not determined to be in a steady state. Note that it is considered that the steady state determination omission flags of the sub functions of the same sub function group are in the same state.

サブ機能グループに定常状態判定省略フラグが“1”のサブ機能がある場合(S207のYes)、定常状態判定部13は、定常状態判定省略フラグが“1”のサブ機能を含むサブ機能グループについて定常状態か否か判定しない(S208)。これにより、例えばサブ機能E,Fの定常判定を省略できる。また、全体制御部11はサブ機能E,Fを必ず実行する。   When the sub-function group has a sub-function whose steady state determination omission flag is “1” (Yes in S207), the steady-state determination unit 13 includes a sub function group including a sub-function whose steady state determination omission flag is “1”. It is not determined whether or not it is in a steady state (S208). Thereby, for example, the stationary determination of the sub-functions E and F can be omitted. Further, the overall control unit 11 always executes the sub functions E and F.

サブ機能グループに定常状態判定省略フラグが“1”のサブ機能がない場合(S207のNo)、定常状態判定部13は、サブ機能グループの各サブ機能について定常状態か否か判定する(S209)。これにより、全体制御部11は定常状態か否かの判定結果に基づきサブ機能の実行を省略できる。ステップS208の前にマイコンの処理負荷が低いか否かを判定し、処理負荷が低い場合にのみ定常状態か否かを判定してもよい。   If the sub-function group does not have a sub-function whose steady state determination omission flag is “1” (No in S207), the steady-state determining unit 13 determines whether each sub-function of the sub-function group is in a steady state (S209). . Thereby, the overall control unit 11 can omit the execution of the sub-function based on the determination result of whether or not the steady state. Before step S208, it may be determined whether or not the processing load of the microcomputer is low, and it may be determined whether or not it is in a steady state only when the processing load is low.

次に、定常状態判定部13は、マイコン100の処理負荷が閾値より低いか否かを判定する(S210)。   Next, the steady state determination unit 13 determines whether or not the processing load of the microcomputer 100 is lower than a threshold value (S210).

そして、マイコン100の処理負荷が低い場合にのみ(S210のYes)、定常状態判定部13は、定常状態か否か判定しなかったサブ機能について定常状態か否かを判定する(S211)。こうすることで、マイコン100の処理負荷を増大させることなく、サブ機能の判定機会を増やすことができる。   Then, only when the processing load of the microcomputer 100 is low (Yes in S210), the steady state determination unit 13 determines whether or not the sub-function that has not been determined whether or not the steady state is in the steady state (S211). By doing so, the sub function determination opportunities can be increased without increasing the processing load of the microcomputer 100.

マイコン100の処理負荷が低くない場合(S210のNo)、定常状態判定部13は定常状態判定結果テーブルを更新する(S212)。すなわち、定常状態判定結果テーブル17の判定機会、定常判定回数及び非定常判定回数を更新し、省略実施確率を算出して閾値と比較することで定常状態判定省略フラグを更新する。こうすることで、次回、定常状態判定部13が呼び出された場合、最新の定常状態判定省略フラグに基づき定常判定を行うか否かを判定できる。   When the processing load of the microcomputer 100 is not low (No in S210), the steady state determination unit 13 updates the steady state determination result table (S212). That is, the determination opportunity, steady determination count, and non-steady determination count in the steady state determination result table 17 are updated, the omitted execution probability is calculated, and the steady state determination skip flag is updated by comparing with the threshold. In this way, when the steady state determination unit 13 is called next time, it can be determined whether or not to perform the steady determination based on the latest steady state determination omission flag.

以上説明したように、本実施例のマイコン100は、実施例1と同様の効果に加え、定常状態の機能を実行するCPUの処理負荷を低減できる。また、定常状態になりにくい機能については定常状態化否かの判定を省略するので、さらに処理負荷を低減できる。   As described above, the microcomputer 100 according to the present embodiment can reduce the processing load of the CPU that executes the steady-state function in addition to the same effects as the first embodiment. In addition, since it is not necessary to determine whether or not a function is in a steady state, the processing load can be further reduced.

11 全体制御部
12 ラッチ処理部
13 定常状態判定部
14 サブ機能
15 依存関係データ
16 前回値テーブル
100 マイコン
200 ECU
DESCRIPTION OF SYMBOLS 11 Overall control part 12 Latch process part 13 Steady-state determination part 14 Subfunction 15 Dependency relationship data 16 Previous value table 100 Microcomputer 200 ECU

Claims (5)

プログラムを記憶するプログラム記憶手段と、
前記プログラムの入力値を取得する入力値取得手段と、
前記入力値を用いた処理を行う前記プログラムを実行して出力値を生成する演算手段と、
過去の前記入力値と前記出力値を対応づけて記憶する値記憶手段と、
前記入力値取得手段が取得した前記入力値と、前記値記憶手段が記憶する前記入力値を比較する比較手段と、
前記入力値取得手段が取得した前記入力値と、前記値記憶手段が記憶する前記入力値が一致する場合、前記プログラムを前記演算手段に実行させずに前記値記憶手段の前記出力値を前記プログラムの前記出力値として採用する実行制御手段と、
を有する情報処理装置。
Program storage means for storing a program;
Input value acquisition means for acquiring an input value of the program;
An arithmetic means for generating an output value by executing the program for performing processing using the input value;
Value storage means for storing the past input value and the output value in association with each other;
Comparison means for comparing the input value acquired by the input value acquisition means with the input value stored by the value storage means;
When the input value acquired by the input value acquisition unit and the input value stored by the value storage unit match, the program stores the output value of the value storage unit without causing the calculation unit to execute the program. Execution control means employed as the output value of
An information processing apparatus.
前記プログラムを前記演算手段に実行させなかった頻度が登録された実行省略頻度テーブルを有し、
前記比較手段は、前記実行省略頻度テーブルに登録された前記頻度が閾値未満の場合、前記入力値取得手段が取得した前記入力値と、前記値記憶手段が記憶する前記入力値を比較する処理を省略する、
ことを特徴とする請求項1記載の情報処理装置。
An execution omission frequency table in which the frequency at which the program is not executed by the computing unit is registered;
When the frequency registered in the execution omission frequency table is less than a threshold value, the comparison unit compares the input value acquired by the input value acquisition unit with the input value stored in the value storage unit. Omitted,
The information processing apparatus according to claim 1.
前記プログラム記憶手段に記憶された複数の前記プログラム間における処理依存関係又はデータ依存関係が登録された依存関係テーブルを有し、
前記比較手段は、前記依存関係テーブルに依存関係があると登録された全ての前記プログラム毎に、前記入力値取得手段が取得した前記入力値と、前記値記憶手段が記憶する前記入力値を比較し、
前記依存関係テーブルに依存関係があると登録された全ての前記プログラムについて前記入力値取得手段が取得した前記入力値と、前記値記憶手段が記憶する前記入力値が一致する場合、
前記実行制御手段は、前記プログラムを前記演算手段に実行させずに前記値記憶手段の前記出力値を前記プログラムの前記出力値として採用する、
ことを特徴とする請求項1又は2記載の情報処理装置。
A dependency table in which processing dependency relationships or data dependency relationships among the plurality of programs stored in the program storage unit are registered;
The comparison unit compares the input value acquired by the input value acquisition unit with the input value stored by the value storage unit for every program registered as having a dependency in the dependency relationship table. And
When the input value acquired by the input value acquisition unit for all the programs registered as having a dependency relationship in the dependency table matches the input value stored in the value storage unit,
The execution control means adopts the output value of the value storage means as the output value of the program without causing the calculation means to execute the program.
The information processing apparatus according to claim 1 or 2.
前記プログラムが関数型言語で記述された関数である場合、
前記入力値は関数の引数であり、前記出力値は関数の戻り値である、ことを特徴とする請求項1〜3いずれか1項記載の情報処理装置。
When the program is a function written in a functional language,
The information processing apparatus according to claim 1, wherein the input value is a function argument, and the output value is a return value of the function.
プログラムを記憶するプログラム記憶手段と、
前記プログラムの入力値を取得する入力値取得手段と、
前記プログラムを実行して前記入力値から出力値を生成する演算手段と、を有する情報処理装置のプログラム実行方法であって、
比較手段が、前記入力値取得手段が取得した前記入力値と、過去の前記入力値と前記出力値を対応づけて記憶する値記憶手段に記憶された前記入力値を比較するステップと、
前記入力値取得手段が取得した前記入力値と、前記値記憶手段が記憶する前記入力値が一致する場合、実行制御手段が、前記プログラムを前記演算手段に実行させずに前記値記憶手段の前記出力値を前記プログラムの前記出力値として採用するステップと、
を有するプログラム実行方法。
Program storage means for storing a program;
Input value acquisition means for acquiring an input value of the program;
A program execution method for an information processing apparatus, comprising: an arithmetic unit that executes the program and generates an output value from the input value,
A comparison means comparing the input value acquired by the input value acquisition means with the input value stored in the value storage means for storing the input value in the past and the output value in association with each other;
When the input value acquired by the input value acquisition means matches the input value stored by the value storage means, the execution control means does not cause the calculation means to execute the program, and the calculation means does not execute the program. Adopting an output value as the output value of the program;
A program execution method comprising:
JP2012024347A 2012-02-07 2012-02-07 Information processing device and program execution method Pending JP2013161362A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012024347A JP2013161362A (en) 2012-02-07 2012-02-07 Information processing device and program execution method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012024347A JP2013161362A (en) 2012-02-07 2012-02-07 Information processing device and program execution method

Publications (1)

Publication Number Publication Date
JP2013161362A true JP2013161362A (en) 2013-08-19

Family

ID=49173536

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012024347A Pending JP2013161362A (en) 2012-02-07 2012-02-07 Information processing device and program execution method

Country Status (1)

Country Link
JP (1) JP2013161362A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015075964A (en) * 2013-10-09 2015-04-20 富士通株式会社 Log output condition setting program, device, and method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015075964A (en) * 2013-10-09 2015-04-20 富士通株式会社 Log output condition setting program, device, and method

Similar Documents

Publication Publication Date Title
Tang et al. A hardware scheduler based on task queues for FPGA-based embedded real-time systems
US20120101791A1 (en) Controlling simulation systems
JP2014191655A (en) Multiprocessor, electronic control device, and program
US10571993B2 (en) Micro controller unit
JP2010160715A (en) Electronic control unit for vehicle
JP5533789B2 (en) In-vehicle electronic control unit
JP5532144B2 (en) Processor, electronic control device, creation program
JP2013161362A (en) Information processing device and program execution method
JP4209377B2 (en) Semiconductor device
JP2011002993A (en) Watchdog timer monitoring device, and watchdog timer monitoring method
CN105556402A (en) Method for manipulating a control program of a control device
US20150363241A1 (en) Method and apparatus to migrate stacks for thread execution
JP2010140239A (en) Apparatus and method for shortening interrupt latency
JP2013534670A (en) Memory access optimization method when resuming application execution in a microprocessor having a plurality of logical cores, and a computer program for executing the method
USH2202H1 (en) Method and apparatus to dynamically hook runtime processes without interrupting the flow of execution
JP2013061783A (en) Multi-core processor
US9396044B2 (en) Memory efficient thread-level speculation
EP2551776A1 (en) Multi-core processor system, control program, and control method
US9342312B2 (en) Processor with inter-execution unit instruction issue
JP6447442B2 (en) Electronic control unit
JP2016084050A (en) On-vehicle control apparatus
CN110673937A (en) Single chip microcomputer and synchronous and asynchronous control method thereof
WO2010109609A1 (en) Processing device and vehicle engine control device
JP4530074B2 (en) Semiconductor device
Zhang et al. Branch prediction migration for multi-core architectures