JP2013161362A - Information processing device and program execution method - Google Patents
Information processing device and program execution method Download PDFInfo
- 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
Links
Images
Landscapes
- Debugging And Monitoring (AREA)
Abstract
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.
しかしながら、特許文献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.
以下、本発明を実施するための形態について図面を参照しながら実施例を挙げて説明する。 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
本実施形態のマイコン100は機能I,機能IIそれぞれの前回入力値と前回出力値を記憶しておく。そして、今回入力値が与えられ機能Iが実行される場合、マイコン100は今回入力値と前回入力値を比較し、一致した場合は機能Iを実行することなく記憶している前回出力値を出力する。
The
例えば、機能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
ところで、機能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
本実施形態のマイコン100は定常状態の処理負荷を低減できるので、独立した機能が混在した状況ではマイコン100のピーク時の処理負荷を抑制することが可能になる。したがって、マイコン100のスペックダウン、省電力化、及び、発熱の抑制が可能となる。
Since the
なお、本実施形態では機能統合により統合された複数の機能I、機能IIをマイコン100が有することを前提に説明するが、機能統合の有無に関係なく入力値を使用する機能が1つさえあれば、各マイコンに適用可能である。ただし、本実施例の処理負荷の低減方法は、複数の機能が独立に定常状態となることが期待できる機能統合されたマイコン100に対しより好適に適用できる。
In this embodiment, the description will be made on the assumption that the
〔構成例〕
図2は、ECU200のハードウェア構成図の一例を示す。ECU200は、入力I/F11、電源回路14、マイコン100、及び、出力I/F13を有する。この他、CANコントローラのような他の電子制御装置と通信するための通信装置等を有しているが、図示を省略した。
[Configuration example]
FIG. 2 shows an example of a hardware configuration diagram of the
車載される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
入力I/F11には、各種のセンサが接続されている。入力I/F11はマルチプレクサとして機能し、各センサの検出信号を時分割又は優先度に基づき読み出し、センサの識別情報と共にマイコン100のA/D21又はI/O22に送信する。また、入力I/F11は、CPU23からの指示によりセンサから検出信号を取得する場合と、指示がなくてもセンサから検出信号を取得する場合がある。
Various sensors are connected to the input I /
マイコン100は、バスを介してCPU23と接続されたA/D21、I/O22、フラッシュROM24、RAM25、I/O26及びWDT27を有する。I/O22は、入力I/F11から入力された検出信号を検出信号の種別と共に、割込みなどの仕組みを利用してCPU23に通知する。また、A/D21はアナログの検出信号をデジタルの検出信号に変換する回路であり、変換後の検出信号を検出信号の種別と共に、割込みなどの仕組みを利用してCPU23に通知する。
The
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
CPU23は、フラッシュROM24に記憶されているプログラムを実行して、検出信号の読み取り、演算、マップ引き、RAM25への書き込み又はI/O26への出力を行う。このプログラムに複数の機能I,機能IIが含まれる。これらの具体的な処理内容はECU200の種類や、機能によって異なる。
The
後段のI/O26は、CPU23からの指示により、制御対象の識別情報やチップ選択線のアサートと共に演算結果を出力I/F13に出力する。出力I/F13は、各種のアクチュエータと接続されている。出力I/F13は、例えばD/A変換した電圧値等をアクチュエータに出力することでアクチュエータを制御する。また、出力I/F13は例えば、スイッチ素子であり、ソレノイドに通電しリレーなどの開閉を制御する。また、出力I/F13は例えばドライバ回路であり、直流電圧を交流電圧に変換してモータの回転数を制御する。
The subsequent I /
図3は、マイコン100の機能ブロック図の一例を示す。マイコン100は機能Iと機能IIを有している。機能Iと機能IIはそれぞれ別々のECUに搭載されていた機能である。マイコン100のCPU23は機能Iと機能IIを独立に実行する。
FIG. 3 shows an example of a functional block diagram of the
図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
図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
〔入力値 出力値〕
全体制御部11は、例えばMain関数であり、各機能ブロックが記述された順番又はタイミングやフラグなどの条件の判定結果にしたがい各機能ブロックを実行する。
[Input value Output value]
The
機能ブロックのうち、サブ機能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
入力値には、静的変数、レジスタ値、又は、関数そのものなどがあるが、何が入力値となるかはサブ機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
サブ機能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
定常状態判定部13は、前回値テーブル16に登録されている前回入力値と今回入力値を比較することで、機能Iが定常状態か否かを判定する。定常状態か否かの判定の際、定常状態判定部13は依存関係データ15を参照し、依存関係のあるサブ機能グループ毎に定常状態か否かを判定する。
The steady
図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
入力値は有効桁の全てで一致する必要はない。開発者等が、例えば、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
図6は、依存関係データ15を模式的に説明する図の一例である。図6では各サブ機能がツリー状に接続されている。依存関係データ15には、サブ機能間の依存関係が登録されている。依存関係には、処理の順番に制約がある処理依存や、他のサブ機能のデータを必要とするデータ依存がある。依存関係は固定なので、開発者等が予め依存関係を抽出し依存関係データ15に登録しておくことができる。図6によれば、サブ機能Cはサブ機能Bと依存関係にあり、サブ機能Bはサブ機能Aと依存関係にあり、サブ機能Dはサブ機能Aと依存関係にある。
FIG. 6 is an example of a diagram for schematically explaining the
このような依存関係がある場合、仮にサブ機能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
なお、図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
なお、定常状態判定部13は、前回入力値との比較に使用した今回入力値を、新たな前回入力値として前回値テーブル16に登録する。これにより、前回値テーブル16の前回入力値は最新の入力値に更新される。
The steady
定常状態判定部13は、サブ機能グループ毎(又はサブ機能毎でもよい)に定常状態か否かの判定結果を全体制御部11に通知する。全体制御部11はサブ機能A〜Fのうち、定常状態のサブ機能は実行しない。これにより、マイコン100のCPU23の処理負荷を低減できる。
The steady
そして、全体制御部11は、定常状態と判定されたサブ機能の前回出力値を前回値テーブル16から読み出す。また、全体制御部11は、定常状態と判定されなかったサブ機能に今回入力値を渡すと共に実行し、各サブ機能の今回出力値を各サブ機能から取得する。そして、前回値テーブル16の前回出力値をサブ機能が出力した今回出力値にて更新する。こうすることで、前回値テーブル16の前回出力値も、最新の出力値を維持することができる。
Then, the
〔動作手順〕
図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
全体制御部11は今回入力値を引数に定常状態判定部13を呼び出す。これにより、定常状態判定部13は依存関係データ15を参照して、サブ機能グループ単位で定常状態か否かを判定する(S20)。ここでは、例えば、サブ機能E,Fのサブ機能グループが定常状態であり、サブ機能A〜Dのサブ機能グループは定常状態でなかったとする。
The
そして、全体制御部11は、定常状態でないと判定されたサブ機能グループのサブ機能A〜Dを順次、実行する。すなわち、サブ機能Aの今回入力値を引数にサブ機能Aを呼び出し、サブ機能Aを実行する(S30)。サブ機能Aは今回出力値を全体制御部11に返す。
Then, the
次に、サブ機能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
次に、サブ機能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
次に、サブ機能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
そして、全体制御部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
以上説明したように、本実施例のマイコン100は、定常状態の機能を実行するCPU23の処理負荷を低減できるのでマイコン100やCPU23の仕様のダウンを可能にできる。また、CPU23の消費電力も低下するので、燃費向上・発熱抑制が図られ、ECU200の放熱性能の仕様をダウンすることが可能になる。
As described above, the
実施例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
図8は、本実施例のマイコン100の機能ブロック図の一例を示す。図8において図3と同一部には同一の符号を付しその説明は省略する。本実施例の機能Iは、新たに定常状態判定結果テーブル17を有している。定常状態判定結果テーブル17は、過去に定常状態であると判定された回数が登録されたテーブルである。
FIG. 8 shows an example of a functional block diagram of the
図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
(Iii) Only when the processing load of the
定常判定回数は、定常状態であると判定された回数であり、非定常判定回数は、定常状態でないと判定された回数である。したがって、判定機会=定常判定回数+非定常判定回数という関係がある。なお、定常状態か否かはサブ機能グループ毎に判定されるので、同じサブ機能グループのサブ機能は定常判定回数が同じになる。 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
また、定常状態判定部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
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
例えば、省略実施確率が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
なお、上記(iii)に記載したように、定常状態判定省略フラグが“1”となった後も、定常状態判定部13はマイコン100の処理負荷が低い時に、定常状態か否かを判定することで、定常判定回数及び非定常判定回数を更新する。これにより、定常判定回数が大きくなったサブ機能の定常状態判定省略フラグは“0”となり、定常判定の対象とすることができる。
As described in (iii) above, even after the steady state determination omission flag becomes “1”, the steady
図10は、本実施例の定常状態判定部13の処理を説明するフローチャート図の一例である。全体的な動作手順は図7と同様であり、図10は図7のステップS20の処理手順を示す。図10の処理は、全体制御部11が今回入力値を引数に定常状態判定部13を呼び出すことでスタートする。
FIG. 10 is an example of a flowchart for explaining the process of the steady
まず、定常状態判定部13は判定機会が十分に大きいか否かを判定する(S201)。判定機会が十分に大きい場合(S201のYes)、処理はステップS206に進む。
判定機会が十分に大きくない場合(S201のNo)、定常状態判定部13はマイコンの処理負荷が低いか否かを判定する(S202)。マイコンの処理負荷が低くない場合(S202のNo)、定常状態か否かを判定すると処理負荷がさらに高くなってしまうので、定常状態判定部13は全てのサブ機能が定常状態でないと判定する(S203)。判定結果を全体制御部11に返す。この場合、全体制御部11は全てのサブ機能を実行する。
First, the steady
When the determination opportunity is not sufficiently large (No in S201), the steady
マイコンの処理負荷が低い場合(S202のYes)、定常状態判定部13は各サブ機能が定常状態か否かを判定する(S204)。これにより判定機会を増大させることができる。
When the processing load of the microcomputer is low (Yes in S202), the steady
定常状態判定部13は定常状態判定結果テーブル17を更新して、全体制御部に判定結果を返す(S205)。この場合、全体制御部11は定常状態でないと判定されたサブ機能のみを実行する。
The steady
判定機会が十分に大きい場合(S201のYes)、定常状態判定部13は定常状態判定省略フラグを読み出す(S206)。
When the determination opportunity is sufficiently large (Yes in S201), the steady
そして、サブ機能グループに定常状態判定省略フラグが“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-
サブ機能グループに定常状態判定省略フラグが“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-
次に、定常状態判定部13は、マイコン100の処理負荷が閾値より低いか否かを判定する(S210)。
Next, the steady
そして、マイコン100の処理負荷が低い場合にのみ(S210のYes)、定常状態判定部13は、定常状態か否か判定しなかったサブ機能について定常状態か否かを判定する(S211)。こうすることで、マイコン100の処理負荷を増大させることなく、サブ機能の判定機会を増やすことができる。
Then, only when the processing load of the
マイコン100の処理負荷が低くない場合(S210のNo)、定常状態判定部13は定常状態判定結果テーブルを更新する(S212)。すなわち、定常状態判定結果テーブル17の判定機会、定常判定回数及び非定常判定回数を更新し、省略実施確率を算出して閾値と比較することで定常状態判定省略フラグを更新する。こうすることで、次回、定常状態判定部13が呼び出された場合、最新の定常状態判定省略フラグに基づき定常判定を行うか否かを判定できる。
When the processing load of the
以上説明したように、本実施例のマイコン100は、実施例1と同様の効果に加え、定常状態の機能を実行するCPUの処理負荷を低減できる。また、定常状態になりにくい機能については定常状態化否かの判定を省略するので、さらに処理負荷を低減できる。
As described above, the
11 全体制御部
12 ラッチ処理部
13 定常状態判定部
14 サブ機能
15 依存関係データ
16 前回値テーブル
100 マイコン
200 ECU
DESCRIPTION OF
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:
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)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2015075964A (en) * | 2013-10-09 | 2015-04-20 | 富士通株式会社 | Log output condition setting program, device, and method |
-
2012
- 2012-02-07 JP JP2012024347A patent/JP2013161362A/en active Pending
Cited By (1)
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 |