JP6558317B2 - Electronic equipment - Google Patents
Electronic equipment Download PDFInfo
- Publication number
- JP6558317B2 JP6558317B2 JP2016137794A JP2016137794A JP6558317B2 JP 6558317 B2 JP6558317 B2 JP 6558317B2 JP 2016137794 A JP2016137794 A JP 2016137794A JP 2016137794 A JP2016137794 A JP 2016137794A JP 6558317 B2 JP6558317 B2 JP 6558317B2
- Authority
- JP
- Japan
- Prior art keywords
- variable
- core
- calculation
- unit
- occurred
- 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.)
- Active
Links
Images
Landscapes
- Combined Controls Of Internal Combustion Engines (AREA)
- Retry When Errors Occur (AREA)
- Multi Processors (AREA)
- Microcomputers (AREA)
Description
本発明は、演算を実行する電子装置に関する。 The present invention relates to an electronic device that performs an operation.
従来、演算を実行する電子装置の一例として、特許文献1に開示された車載制御装置がある。この車載制御装置は、非数が発生した変数を初期化するとともに、同変数を参照して算出される変数など、非数が発生した変数によって影響を受ける変数を一括して初期化する。 Conventionally, there is an in-vehicle control device disclosed in Patent Document 1 as an example of an electronic device that executes a calculation. This in-vehicle control device initializes a variable in which a non-number has occurred, and initializes variables affected by the variable in which a non-number has occurred, such as a variable calculated by referring to the variable.
ところで、電子装置には、演算を並行実行する複数の処理部を備えたものがある。このような電子装置では、演算結果が非数になるなど演算にエラーが発生した変数と、この変数の影響を受ける変数とが、異なる処理部に配置されていることもある。また、処理部は、複数の処理部における他の処理部で変数が演算されると、その変数の値を保持し、その後、保持しておいた値を用いて他の変数の演算を行う。 Incidentally, some electronic devices include a plurality of processing units that execute operations in parallel. In such an electronic apparatus, a variable in which an operation error has occurred, for example, the operation result becomes non-numeric, and a variable affected by this variable may be arranged in different processing units. In addition, when a variable is calculated in another processing unit of the plurality of processing units, the processing unit holds the value of the variable, and then performs calculation of another variable using the stored value.
よって、処理部は、他の処理部での演算にエラーが発生した場合、エラーが発生前の変数値を保持することがある。このため、処理部は、エラーが発生した演算で得られた変数が他の処理部によって初期化され、且つ、この変数の影響を受ける変数を初期化したとしても、保持しておいたエラーが発生前の演算で得られた変数値を用いて他の変数の演算を行なってしまう。従って、電子装置は、エラーが発生前の演算で得られた変数値を用いて演算された変数が初期化されないという問題がある。 Therefore, when an error occurs in a calculation in another processing unit, the processing unit may hold a variable value before the error occurs. For this reason, even if the variable obtained by the operation in which the error has occurred is initialized by another processing unit, and the variable affected by this variable is initialized, the stored error is The calculation of other variables is performed using the variable value obtained by the calculation before the occurrence. Therefore, the electronic device has a problem that the variable calculated using the variable value obtained by the calculation before the error is not initialized.
本開示は、上記問題点に鑑みなされたものであり、変数の演算を並行実行する複数の処理部が、エラーが発生した演算で得られた変数に加えて、この変数を用いて演算された変数を初期化することができる電子装置を提供することを目的とする。 The present disclosure has been made in view of the above-described problem, and a plurality of processing units that execute variable operations in parallel are calculated using this variable in addition to the variable obtained by the operation in which the error occurred. An object is to provide an electronic device capable of initializing variables.
上記目的を達成するために本開示は、
複数の処理部を備えた電子装置であって、
各処理部は、
変数を演算する演算部(S10、S22)と、
自処理部における演算部での演算にエラーが発生したか否かを判定する判定部(S11、S23)と、
判定部にてエラーが発生したと判定された場合、エラーが発生したと判定された演算で得られた自処理部の変数を初期化する第1初期化部(S14、S26)と、を備え、
他処理部における演算部の演算で得られた変数値を保持しつつ、他処理部の演算した変数に関連する変数を、保持した変数値を用いて演算部が演算するものであり、
さらに、
演算部の演算が複数の処理部間で並行実行され、判定部にてエラーが発生したと判定された場合、エラーが発生したことを複数の処理部間で共有するために、エラーが発生したことを記憶するエラー記憶部(S13、S25)と、
エラー記憶部を確認することで、他処理部の演算部での演算にエラーが発生しているか否かを監視する監視部(S15、S27)と、
監視部での監視でエラーが発生していた場合、該エラーが発生している演算で得られた変数に関連する自処理部の変数を初期化する第2初期化部(S16、S28)と、備えていることを特徴とする。
In order to achieve the above object, the present disclosure
An electronic device including a plurality of processing units,
Each processing unit
A calculation unit (S10, S22) for calculating a variable;
A determination unit (S11, S23) for determining whether or not an error has occurred in the calculation in the calculation unit in the processing unit;
A first initialization unit (S14, S26) that initializes a variable of the processing unit obtained by an operation in which it is determined that an error has occurred when the determination unit determines that an error has occurred; ,
While holding the variable value obtained by the calculation of the calculation unit in the other processing unit, the calculation unit calculates the variable related to the variable calculated by the other processing unit using the held variable value,
further,
When the calculation of the calculation unit is executed in parallel between multiple processing units and the determination unit determines that an error has occurred, an error has occurred in order to share that the error has occurred among the multiple processing units An error storage unit (S13, S25) for storing
A monitoring unit (S15, S27) for monitoring whether or not an error has occurred in the calculation in the calculation unit of the other processing unit by checking the error storage unit;
A second initialization unit (S16, S28) that initializes a variable of the self-processing unit related to a variable obtained by an operation in which the error has occurred when an error has occurred in monitoring by the monitoring unit; It is characterized by having.
このように、本開示は、自処理部における演算部での演算にエラーが発生したか否かを判定し、エラーが発生したと判定した場合、エラーが発生したと判定された演算で得られた自処理部の変数を初期化する。また、本開示は、エラーが発生したと判定された場合、エラーが発生したことを複数の処理部間で共有するために、エラーが発生したことを記憶部に記憶し、この記憶部を確認して、他処理部の演算部での演算にエラーが発生しているか否かを監視する。 As described above, the present disclosure is obtained by the operation in which it is determined that an error has occurred when it is determined whether or not an error has occurred in the operation in the operation unit in the processing unit. Initialize the variables of the self-processing section. In addition, when it is determined that an error has occurred, the present disclosure stores the fact that an error has occurred in a storage unit in order to share the occurrence of the error among a plurality of processing units, and confirms this storage unit. Then, it is monitored whether or not an error has occurred in the calculation in the calculation unit of the other processing unit.
このため、本開示の各処理部は、自処理部における演算部での演算で用いる変数が、エラーが発生している演算で得られた変数であるか否かを把握することができる。そして、本開示は、監視部で監視してエラーが発生していた場合、エラーが発生している演算で得られた変数に関連する自処理部の変数を初期化する。よって、本開示は、変数の演算を実行する複数の処理部が、エラーが発生した演算で得られた変数に加えて、この変数を用いて演算された変数を初期化することができる。 For this reason, each processing unit of the present disclosure can grasp whether or not the variable used in the calculation in the calculation unit in the self-processing unit is a variable obtained by the calculation in which an error has occurred. And this indication initializes the variable of the self-processing part relevant to the variable obtained by the calculation in which the error has generate | occur | produced, when the monitoring part monitors and the error has generate | occur | produced. Therefore, according to the present disclosure, a plurality of processing units that execute a variable calculation can initialize a variable calculated using this variable in addition to the variable obtained by the calculation in which the error has occurred.
なお、特許請求の範囲、及びこの項に記載した括弧内の符号は、一つの態様として後述する実施形態に記載の具体的手段との対応関係を示すものであって、発明の技術的範囲を限定するものではない。 It should be noted that the reference numerals in parentheses described in the claims and in this section indicate the correspondence with the specific means described in the embodiments described later as one aspect, and the technical scope of the invention It is not limited.
以下において、図面を参照しながら、発明を実施するための形態を説明する。図1に示すように、ECU200は、マイクロコンピュータ100が設けられている。なお、ECU200は、マイコン100の他にも、各種電子素子が設けられていてもよい。
Hereinafter, embodiments for carrying out the invention will be described with reference to the drawings. As shown in FIG. 1, the ECU 200 is provided with a
マイクロコンピュータ100は、電子装置に相当する。以下においては、マイクロコンピュータ100をマイコン100と略称で記載する。マイコン100は、第1コア10、第1コア用RAM12、第2コア20、第2コア用RAM22、共有RAM30などを備えて構成されている。このように、マイコン100は、所謂デュアルコアマイコンである。しかしながら、本発明は、三つ以上のコアを含むマルチコアマイコンでも採用できる。
The
第1コア10と第2コア20のそれぞれは、処理部に相当する。各コア10,20は、予め定められた演算順序に従って予め定められたプログラムを実行する。また、各コア10,20は、浮動小数点演算を実行可能に構成されている。なお、コアは、演算プロセッサやCPUコアと言い換えることもできる。各コア10,20の処理動作に関しては、後程詳しく説明する。
Each of the
第1コア10は、第1コアフラグが記憶された記憶領域である第1フラグ領域11を含んでいる。第1コアフラグは、第1コア10によって値が設定されるフラグである。また、第1コアフラグは、第1コア10による演算にエラーが発生したか否か、すなわち第1コア10の演算状態を示すフラグである。よって、第1コアフラグは、第1コア10による演算にエラーが発生したか否かによって値が書き換えられる。この第1コアフラグは、第1コア10のみが値を設定できる。このため、第2コア20は、第1コアフラグの値を設定できない。
The
なお、第1コア10は、自コア10の演算でエラーが発生したと判定した場合、第1コアフラグをオンし、エラーが発生したと判定していない場合、第1コアフラグをオフすると言える。また、第1コア10は、第1コアフラグをオンすることでエラー状態を書き込み、第1コアフラグをオフすることで非エラー状態を書き込むと言える、
一方、第2コア20は、第2コアフラグが記憶された記憶領域である第2フラグ領域21を含んでいる。第2コアフラグは、第2コア20によって値が設定されるフラグである。また、第2コアフラグは、第2コア20による演算にエラーが発生したか否か、すなわち第2コア20の演算状態を示すフラグである。よって、第2コアフラグは、第2コア20による演算にエラーが発生したか否かによって値が書き換えられる。この第2コアフラグは、第2コア20のみが値を設定できる。このため、第1コア10は、第2コアフラグの値を設定できない。
It can be said that the
On the other hand, the
なお、第2コア20は、自コア20の演算でエラーが発生したと判定した場合、第2コアフラグをオンし、エラーが発生したと判定していない場合、第2コアフラグをオフすると言える。また、第2コア20は、第2コアフラグをオンすることでエラー状態を書き込み、第2コアフラグをオフすることで非エラー状態を書き込むと言える。
It can be said that the
このように、各コア10,20は、自コアの演算にエラーが発生したことを記憶可能に構成されている。なお、各コアフラグの設定に関しては、後程、各コア10,20の処理動作とともに説明する。
As described above, each of the
第1コア用RAM12(以下、第1RAM12)は、第1コア10専用の記憶装置である。第1RAM12には、第1コア10のみが用いる変数などが記憶されている。一方、第2コア用RAM22(以下、第2RAM22)は、第2コア20専用の記憶装置である。
The first core RAM 12 (hereinafter referred to as the first RAM 12) is a storage device dedicated to the
また、第2RAM22は、記憶領域として変数領域22aを含んでおり、第2コア20のみが用いる変数などが記憶されている。例えば、変数領域22aには、第2コア20のみが用いる変数dが記憶されている。変数dは、第2コア20によって演算されて、値が書き換えられる。変数領域22aは、変数記憶部に相当する。
The
共有RAM30は、第1コア10と第2コア20に共通に設けられた記憶装置である。共有RAM30は、記憶領域として、第1共有領域31、第2共有領域32、第3共有領域33を含んでいる。また、第1共有領域31には、第1コア10によって値が設定される第1フラグが記憶されている。第2共有領域32には、第2コア20によって値が設定される第2フラグが記憶されている。よって、第1コア10は、第2フラグの値を参照することはできる。同様に、第2コア20は、第1フラグの値を参照することはできる。
The shared
なお、第1フラグは、第1コアフラグと同様に、第1コア10による演算にエラーが発生したか否かを示すフラグである。よって、第1フラグの値は、第1コアフラグと同じ第1コア10の演算状態を示している。このため、第2コア20は、第1フラグの値を参照することで、第1コア10の演算状態を認識できる。
The first flag is a flag indicating whether or not an error has occurred in the calculation performed by the
一方、第2フラグは、第2コアフラグと同様に、第2コア20による演算にエラーが発生したか否かを示すフラグである。よって、第2フラグの値は、第2コアフラグと同じ第2コア20の演算状態を示している。このため、第1コア10は、第2フラグの値を参照することで、第2コア20の演算状態を認識できる。
On the other hand, the second flag is a flag indicating whether or not an error has occurred in the calculation by the
なお、第1コア10は、自コア10の演算でエラーが発生したと判定した場合、第1フラグをオンし、エラーが発生したと判定していない場合、第1フラグをオフすると言える。同様に、第2コア20は、自コア20の演算でエラーが発生したと判定した場合、第2フラグをオンし、エラーが発生したと判定していない場合、第2フラグをオフすると言える。
It can be said that the
また、第3共有領域33には、第1コア10と第2コア20の両方が用いる変数が記憶されている。例えば、第3共有領域33には、第1コア10と第2コア20が用いる変数cが記憶されている。変数cは、第1コア10によって演算されて、値が書き換えられる。
The third shared
ところで、各コア10,20が実行する浮動小数点演算は、浮動小数点型データを用いた演算である。演算結果の浮動小数点型データは、第1RAM12や、第2RAM22や、共有RAM30に記憶される。この演算結果の浮動小数点型データは、変数に相当する。よって、上記変数cと変数dは、浮動小数点型データである。
By the way, the floating point calculation executed by each of the
変数cは、第1コア10が浮動小数点演算を行うことで得られる。つまり、第1コア10は、第3共有領域33に記憶された変数cを演算するとともに、演算で得られた値に変数cを更新する。よって、第1コア10は、第3共有領域33の変数cを演算結果の値で書き換えると言える。
The variable c is obtained when the
一方、変数dは、第2コア20が浮動小数点演算を行うことで得られる。つまり、第2コア20は、変数領域22aに記憶された変数dを演算するとともに、演算で得られた値に変数dを更新する。よって、第2コア20は、変数領域22aの変数dを演算結果の値で書き換えると言える。さらに、第2コア20は、変数cの値を保持しつつ、保持した値を用いて変数dを演算する。このため、変数cは、他処理部における演算部の演算で得られた変数に相当する。変数dは、保持した変数に関連する変数に相当する。また、変数cと変数dは、関連する変数と言える。
On the other hand, the variable d is obtained when the
このように、変数cは、第1コア10と第2コア20の両方で用いられるため、共有RAM30の第3共有領域33に記憶されている。一方、変数dは、第1コア10で用いられず、共有RAM30に記憶されている必要がないため、第2RAM22に記憶されている。
Thus, the variable c is stored in the third shared
各コア10,20は、例えば、IEEE754規格に従ったデータ形式で、浮動小数点型データを表す。IEEE754規格に従う単精度の浮動小数点型データは、1ビットの符号部、8ビットの指数部、23ビットの仮数部で構成される。
Each of the
この規格の浮動小数点データでは、例えば、数値として表現できない演算結果を非数として表現できるようになっている。0で除する演算や、∞(無限大)を用いた演算等の演算結果が、数値として表現できない演算結果の一例として挙げられる。 In the floating point data of this standard, for example, an operation result that cannot be expressed as a numerical value can be expressed as a non-number. An operation result such as an operation that divides by 0 or an operation that uses ∞ (infinity) is an example of an operation result that cannot be expressed as a numerical value.
例えばこの規格では、指数部の8ビットが全て1で、すなわち指数部が10進表記の255で、仮数部が0以外の場合、この浮動小数点型データを非数と表す。また、この規格では、指数部の8ビットが全て1で仮数部が0の場合、この浮動小数点型データを無限大と表す。なお、0で除する演算や、無限大を用いた演算のような、数値として表現できない演算結果となる演算は、無効な演算と言える。 For example, in this standard, when all the 8 bits of the exponent part are 1, that is, when the exponent part is 255 in decimal notation and the mantissa part is other than 0, this floating point type data is represented as a non-number. Also, in this standard, when all 8 bits of the exponent part are 1 and the mantissa part is 0, this floating point type data is represented as infinity. Note that an operation that results in an operation that cannot be expressed as a numerical value, such as an operation that divides by 0 or an operation that uses infinity, is an invalid operation.
また、各コア10,20で演算したデータが非数か無限大の場合に、各コア10,20での演算にエラーが発生したと言うことができる。さらに、各コア10,20での演算が無効な演算であった場合に、各コア10,20での演算にエラーが発生したと言うことができる。
Further, when the data calculated by the
なお、以下においては、演算にエラーが発生した一例として、各コア10,20で演算した浮動小数点型データが非数であった場合を採用する。よって、第1コアフラグ及び第1フラグは、第1コア10の演算で得られた変数が非数であるか否かを示しているものとする。一方、第2コアフラグ及び第2フラグは、第2コア20の演算で得られた変数が非数であるか否かを示しているものとする。
In the following, a case where the floating point type data calculated by each of the
ここで、図2、図3、図4を用いて、第1コア10と第2コア20の処理動作に関して説明する。第1コア10と第2コア20とは、図2に示すように演算を並行実行する。本実施形態では、一例として、第1コア10で非数が発生し、第2コア20で非数が発生しない場合を採用する。
Here, processing operations of the
まず、図3を用いて第1コア10の処理動作に関して説明する。第1コア10は、所定の実行タイミングで図3のフローチャートをスタートする。
First, the processing operation of the
ステップS10では、変数cを演算する(演算部)。第1コア10は、処理を開始すると、変数cを演算する。
In step S10, the variable c is calculated (calculation unit). When the
ステップS11では、非数が発生したか否かを判定する(判定部)。第1コア10は、ステップS10での演算で非数が発生したか否かを判定する。言い換えると、第1コア10は、自コア10における演算にエラーが発生したか否かを判定する。第1コア10は、例えばc=9/0の場合、非数が発生する。
In step S11, it is determined whether or not a non-number has occurred (determination unit). The
第1コア10は、ステップS11で非数が発生したと判定した場合、ステップS12へ進む。ステップS12では、第2コア20に非数状態を通知する。第1コア10は、ステップS11で非数が発生したと判定した場合、第2コア20に対して、自コア10で非数が発生したことを通知する。なお、本発明は、ステップS12を省略しても目的を達成できる。
If the
ステップS13では、第1フラグをオンする(エラー記憶部)。第1コア10は、ステップS11で非数が発生したと判定した場合、第1共有領域31の第1フラグをオンする。言い換えると、第1コア10は、非数状態を第1共有領域31に書き込む。
In step S13, the first flag is turned on (error storage unit). The
このように、第1コア10は、第2コア20と演算を並行実行しており、非数が発生したと判定した場合、非数が発生したことを第2コア20との間で共有するために、非数が発生したことを共有RAM30に記憶すると言える。また、第1コア10は、第1共有領域31の第1フラグをオンすることで、演算を並行実行している第2コア20との間で、自コア10で非数が発生したことを共有すると言える。なお、第1コア10は、ステップS11で非数が発生したと判定した場合、第1コアフラグをオンするとともに、第1共有領域31の第1フラグをオンする。
As described above, the
ステップS14では、変数cを初期化する(第1初期化部)。第1コア10は、非数が発生した変数cを初期化する。つまり、第1コア10は、非数が発生したと判定した場合、非数が発生したと判定された演算で得られた自コア10の変数cを初期化する。
In step S14, the variable c is initialized (first initialization unit). The
第1コア10は、ステップS11で非数が発生したと判定していない場合、ステップS15へ進む。ステップS15では、第2フラグがオンであるか否かを判定する(監視部)。第1コア10は、第2共有領域32を確認することで、すなわち、第2フラグを確認することで、他処理部である第2コア20での演算で非数が発生しているか否かを監視する。
If the
第1コア10は、第2フラグがオンであると判定した場合、ステップS16へ進み、第2フラグがオンであると判定しなかった場合、ステップS17へ進む。なお、後程説明するが、第2コア20は、第1コア10と同様に、自コア20での演算で非数が発生した場合、第2フラグをオンする。
If the
ステップS16では、変数cを初期化する(第2初期化部)。第1コア10は、ステップS15で第2フラグがオンであり、第2コア20での演算で非数が発生していたと判定した場合、非数が発生している変数dに関連する変数cを初期化する。第1コア10は、例えばc=0とする。第1コア10は、例えばプログラムの内容などによって、変数cが変数dに関連するか否かを確認できる。なお、第1コア10は、変数cが変数dに関連しないと判定した場合、ステップS16を行う必要がない。
In step S16, the variable c is initialized (second initialization unit). If the
ステップS17では、変数cに演算結果を書き込む。第1コア10は、ステップS10での演算結果を第3共有領域33に書き込む。
In step S17, the calculation result is written in the variable c. The
次に、図4を用いて第2コア20の処理動作に関して説明する。第2コア20は、所定の実行タイミングで図4のフローチャートをスタートする。
Next, the processing operation of the
ステップS20では、変数cをラッチする。第2コア20は、第3共有領域33に記憶されている変数cを読み込んで、第2RAM22に記憶(保持)しておく。
In step S20, the variable c is latched. The
ステップS21では、通知により変数dを初期化する。第2コア20は、第1コア10から非数状態の通知がなされた場合、変数dを初期化する。第2コア20は、例えばd=0とする。当然ながら、第2コア20は、第1コア10から非数状態の通知がなかった場合、変数dの初期化を行わない。
In step S21, the variable d is initialized by notification. When the
ステップS22では、変数dを演算する(演算部)。第2コア20は、ステップS20でラッチした変数cを用いて変数dを演算する。このように、第2コア20は、第1コア10における演算で得られた変数cを保持しつつ、保持した変数cに関連する変数dを、保持した変数cを用いて演算する。
In step S22, the variable d is calculated (calculation unit). The
ステップS23では、非数が発生したか否かを判定する(判定部)。第2コア20は、自コア20における演算にエラーが発生したか否かを判定する。第2コア20は、ステップS23で非数が発生したと判定した場合、ステップS24へ進む。
In step S23, it is determined whether or not a non-number has occurred (determination unit). The
ステップS24では、第1コア10に非数情報を通知する。なお、第2コア20は、ステップS24を省略しても目的を達成できる。
In step S24, the
ステップS25では、第2フラグをオンする(エラー記憶部)。第2コア20は、ステップS23で非数が発生したと判定した場合、第2共有領域32の第2フラグをオンする。言い換えると、第2コア20は、非数状態を第2共有領域32に書き込む。
In step S25, the second flag is turned on (error storage unit). The
このように、第2コア20は、第1コア10と演算を並行実行しており、非数が発生したと判定した場合、非数が発生したことを第1コア10との間で共有するために、非数が発生したことを共有RAM30に記憶すると言える。また、第2コア20は、第2共有領域32の第2フラグをオンすることで、演算を並行実行している第1コア10との間で、自コア20で非数が発生したことを共有すると言える。なお、第2コア20は、ステップS23で非数が発生したと判定した場合、第2コアフラグをオンするとともに、第2共有領域32の第2フラグをオンする。
As described above, the
ステップS26では、変数dを初期化する(第1初期化部)。第2コア20は、非数が発生した変数dを初期化する。つまり、第2コア20は、非数が発生したと判定した場合、非数が発生したと判定された演算で得られた自コア20の変数dを初期化する。
In step S26, the variable d is initialized (first initialization unit). The
第2コア20は、ステップS23で非数が発生したと判定していない場合、ステップS27へ進む。ステップS27では、第1フラグがオンであるか否かを判定する(監視部)。第2コア20は、第1共有領域31を確認することで、すなわち、第1フラグを確認することで、他処理部である第1コア10での演算で非数が発生しているか否かを監視する。第2コア20は、第1フラグがオンであると判定した場合、ステップS28へ進み、第1フラグがオンであると判定しなかった場合、ステップS29へ進む。
If the
ステップS28では、変数dを初期化する(第2初期化部)。第2コア20は、ステップS27で第1フラグがオンであり、第1コア10での演算で非数が発生していたと判定した場合、非数が発生している変数cに関連する変数dを初期化する。つまり、第2コア20は、他コア10が演算した変数cに非数が発生していた場合、自コア20が変数cを用いて演算する変数dを初期化する。第2コア20は、例えばd=0とする。第2コア20は、例えばプログラムの内容などによって、変数dが変数cに関連するか否かを確認できる。
In step S28, the variable d is initialized (second initialization unit). If the
なお、第2コア20は、変数dとは異なる変数に関しても、変数cを用いて演算を行うものであってもよい。この第2コア20が変数cを用いて演算を行う変数は、第2RAM22や共有RAM30に記憶されている。この場合、ステップS28では、第2コア20は、変数dだけでなく、変数cを用いて演算を行う全ての変数を初期化してもよい。
Note that the
また、第2コア20は、ステップS22で変数dを演算した場合、ステップS27よりも先に、変数領域22aの変数dを演算によって得られた値に更新してもよい。しかしながら、本実施形態では、ステップS27で第1フラグがオンであると判定した場合、変数領域22aの変数dを演算によって得られた値に更新する前に、変数領域22aの変数dを初期化する。これによって、マイコン100は、変数領域22aの変数dが二度更新されることを抑制できる。また、マイコン100は、変数領域22aの変数dが、非数が発生した変数cを用いて演算された値に更新されることを抑制できる。
In addition, when the variable d is calculated in step S22, the
なお、各コア10,20で演算された変数c,dは、各種制御に用いられるものであってもよい。この場合、マイコン100は、変数領域22aの変数dが、非数が発生した変数cを用いて演算された値に更新されることを抑制できるため、変数dを用いる制御の信頼性を向上できる。
The variables c and d calculated by the
ステップS29では、変数dに演算結果を書き込む。第2コア20は、ステップS22での演算結果を変数領域22aに書き込む。
In step S29, the calculation result is written in the variable d. The
次に、図2のシーケンス図を用いて、第1コア10と第2コア20の処理動作を説明する。タイミングt1では、第1コア10と第2コア20とが処理を開始する。よって、第1コアは、ステップS10の処理を実行し、第2コア20がステップS20を実行する。
Next, processing operations of the
タイミングt2では、第1コア10がステップS11、S12を実行し、第2コア20が非数状態の通知を受けてステップS21を実行する。タイミングt3では、第1コア10がステップS13を実行し、第2コア20がステップS22を実行する。このとき、第2コア20は、ステップS20でラッチした変数cを用いて、変数dを演算することになる。
At timing t2, the
タイミングt4では、第1コア10がステップS14を実行し、第2コア20がステップS23を実行する。タイミングt5では、第2コア20がステップS27を実行する。そして、タイミングt6では、ステップS28を実行する。なお、タイミングt6では、第1コア10はアイドル状態となる。
At timing t4, the
このように、マイコン100は、第1コア10における演算に非数が発生したか否かを判定し、非数が発生したと判定した場合、非数が発生したと判定された演算で得られた自コア10の変数cを初期化する。同様に、マイコン100は、第2コア20における演算に非数が発生したか否かを判定し、非数が発生したと判定した場合、非数が発生したと判定された演算で得られた自コア20の変数dを初期化する。
As described above, the
また、マイコン100は、非数が発生したと判定された場合、非数が発生したことを第1コア10と第2コア20との間で共有するために、非数が発生したことを共有RAM30に記憶する。そして、マイコン100は、各コア10,20が共有RAM30を確認して、他コアでの演算に非数が発生しているか否かを監視する。
In addition, when it is determined that the non-number has occurred, the
このため、各コア10,20は、自コアにおける演算で用いる変数が、非数が発生している演算で得られた変数であるか否かを把握することができる。そして、マイコン100は、上記のように監視して非数が発生していた場合、非数が発生している演算で得られた変数cに関連する自コア20の変数dを初期化する。よって、マイコン100は、変数の演算を実行する複数のコア10,20が、非数が発生した演算で得られた変数cに加えて、この変数cを用いて演算された変数dを初期化することができる。つまり、マイコン100は、他コアの非数発生に応じて、関連する自コアの変数を一括初期化できるとも言える。
For this reason, each core 10 and 20 can grasp | ascertain whether the variable used by the calculation in a self-core is the variable obtained by the calculation in which the non-number generate | occur | produced. Then, the
また、各コア10,20で演算された変数c,dは、各種制御に用いられるものであってもよい。上記のように、マイコン100は、非数が発生した変数cを初期化できるだけでなく、他コア20が変数cを用いて演算した変数dを初期化できる。このため、マイコン100は、非数が発生した変数cを用いて演算された変数dが初期化されないまま用いられるよりも、変数dを用いる制御の信頼性を向上できる。
The variables c and d calculated by the
なお、本実施形態では、処理部としてのコア10,20を備えたデュアルコアマイコンに適用した例を採用した。しかしながら、本発明はこれに限定されない。本発明は、処理部としてのマイコンを複数備えた電子装置であっても適用できる。
In this embodiment, an example applied to a dual core microcomputer provided with
また、第2RAM22には、変数dの他にも、変数cを用いて演算されない複数の変数を記憶している。第2コア20は、ステップS28で変数dを初期化する際に、変数dだけではなく、変数cを用いて演算されない他の変数も含めて全ての変数を初期化してもよい。つまり、第2コア20は、ステップS28で第2RAM22に記憶されている全ての変数を初期化してもよい。この場合、第2コア20は、変数cを用いて演算する変数dを第2RAM22から選択する必要がない。よって、マイコン100は、変数cを用いて演算する変数を第2RAM22から選択するよりも容易に変数dを初期化することができる。
In addition to the variable d, the
以上、本発明の好ましい実施形態について説明した。しかしながら、本発明は、上記実施形態に何ら制限されることはなく、本発明の趣旨を逸脱しない範囲において、種々の変形が可能である。 The preferred embodiments of the present invention have been described above. However, the present invention is not limited to the above embodiment, and various modifications can be made without departing from the spirit of the present invention.
10…第1コア、11…第1フラグ領域、12…第1コア用RAM、20…第2コア、21…第2フラグ領域、22…第2コア用RAM、22a…変数領域、30…共有RAM、
31…第1共有領域、32…第2共有領域、33…第3共有領域、100…マイコン、200…ECU
DESCRIPTION OF
31 ... 1st shared area, 32 ... 2nd shared area, 33 ... 3rd shared area, 100 ... Microcomputer, 200 ... ECU
Claims (4)
各処理部は、
変数を演算する演算部(S10、S22)と、
自処理部における前記演算部での演算にエラーが発生したか否かを判定する判定部(S11、S23)と、
前記判定部にてエラーが発生したと判定された場合、エラーが発生したと判定された演算で得られた前記自処理部の変数を初期化する第1初期化部(S14、S26)と、を備え、
他処理部における前記演算部の演算で得られた変数値を保持しつつ、他処理部の演算した変数に関連する変数を、保持した変数値を用いて前記演算部が演算するものであり、
さらに、
前記演算部の演算が複数の前記処理部間で並行実行され、前記判定部にてエラーが発生したと判定された場合、エラーが発生したことを複数の前記処理部間で共有するために、エラーが発生したことを記憶するエラー記憶部(S13、S25)と、
前記エラー記憶部を確認することで、他処理部の前記演算部での演算にエラーが発生しているか否かを監視する監視部(S15、S27)と、
前記監視部での監視でエラーが発生していた場合、該エラーが発生している演算で得られた変数に関連する前記自処理部の変数を初期化する第2初期化部(S16、S28)と、備えている電子装置。 An electronic device including a plurality of processing units,
Each processing unit
A calculation unit (S10, S22) for calculating a variable;
A determination unit (S11, S23) for determining whether or not an error has occurred in the calculation in the calculation unit in the processing unit;
A first initialization unit (S14, S26) that initializes a variable of the processing unit obtained by an operation in which it is determined that an error has occurred when the determination unit determines that an error has occurred; With
While holding the variable value obtained by the calculation of the calculation unit in the other processing unit, the calculation unit calculates the variable related to the variable calculated by the other processing unit using the held variable value,
further,
In order to execute the calculation of the calculation unit in parallel between the plurality of processing units, and when the determination unit determines that an error has occurred, in order to share that the error has occurred among the plurality of processing units, An error storage unit (S13, S25) for storing that an error has occurred;
A monitoring unit (S15, S27) for monitoring whether or not an error has occurred in the calculation in the calculation unit of another processing unit by checking the error storage unit;
If an error has occurred during monitoring by the monitoring unit, a second initialization unit (S16, S28) that initializes a variable of the self-processing unit related to a variable obtained by a calculation in which the error has occurred. ) And the electronic device provided.
前記演算部は、前記変数記憶部に記憶された変数を演算するとともに、演算で得られた値に変数を更新し、
前記監視部は、前記自処理部における前記演算部の演算によって得られた値に変数を更新する前に前記エラー記憶部を確認し、
前記第2初期化部は、前記監視部での監視でエラーが発生していた場合、前記自処理部における前記演算部の演算によって得られた値に変数を更新する前に、前記変数記憶部に記憶された、前記自処理部の変数を初期化する請求項1又は2に記載の電子装置。 A variable storage unit in which variable values are stored;
The calculation unit calculates a variable stored in the variable storage unit, updates the variable to a value obtained by the calculation,
The monitoring unit checks the error storage unit before updating the variable to the value obtained by the calculation of the calculation unit in the self-processing unit,
When an error has occurred during monitoring by the monitoring unit, the second initialization unit may update the variable storage unit before updating the variable to a value obtained by the calculation of the calculation unit in the processing unit. The electronic device according to claim 1, wherein the variable of the self-processing unit stored in is initialized.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2016137794A JP6558317B2 (en) | 2016-07-12 | 2016-07-12 | Electronic equipment |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2016137794A JP6558317B2 (en) | 2016-07-12 | 2016-07-12 | Electronic equipment |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2018010425A JP2018010425A (en) | 2018-01-18 |
| JP6558317B2 true JP6558317B2 (en) | 2019-08-14 |
Family
ID=60995507
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2016137794A Active JP6558317B2 (en) | 2016-07-12 | 2016-07-12 | Electronic equipment |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP6558317B2 (en) |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP4158566B2 (en) * | 2003-03-18 | 2008-10-01 | 株式会社デンソー | Electronic control device having floating point arithmetic function |
| JP4356650B2 (en) * | 2005-05-16 | 2009-11-04 | 株式会社デンソー | Data communication method and data communication system |
| JP4920015B2 (en) * | 2008-09-03 | 2012-04-18 | 日立オートモティブシステムズ株式会社 | Control software for distributed control and electronic control device |
| JP5379712B2 (en) * | 2010-02-08 | 2013-12-25 | 日立オートモティブシステムズ株式会社 | In-vehicle control device |
-
2016
- 2016-07-12 JP JP2016137794A patent/JP6558317B2/en active Active
Also Published As
| Publication number | Publication date |
|---|---|
| JP2018010425A (en) | 2018-01-18 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP6744913B2 (en) | Rounding of floating point numbers | |
| JP5776688B2 (en) | Information processing apparatus and task switching method | |
| US5684728A (en) | Data processing system having a saturation arithmetic operation function | |
| US8484520B2 (en) | Processor capable of determining ECC errors | |
| JP7541526B2 (en) | Handling overflow or underflow of anchor data values | |
| CN108701031B (en) | Register Access Control | |
| JP6558317B2 (en) | Electronic equipment | |
| JP2011008702A (en) | Fault processor | |
| CN113342671B (en) | Method, device, electronic device and medium for verifying computing module | |
| CN118069224B (en) | Address generation method, device, computer equipment and storage medium | |
| JP6332091B2 (en) | Electronic control unit | |
| CN112433914B (en) | Method and system for obtaining parallel computing task progress | |
| US20100077383A1 (en) | Simulation method and storage medium for storing program | |
| JP5732139B2 (en) | Conditional selection of data elements | |
| JP6519530B2 (en) | Verification apparatus, verification program, and verification method | |
| JP2010160622A (en) | Simulator | |
| CN120994254B (en) | Branch prediction result determination method and electronic equipment | |
| CN116802635A (en) | Electronic device BIOS update | |
| US10817288B2 (en) | Combined instruction for addition and checking of terminals | |
| US9747074B2 (en) | Division circuit and microprocessor | |
| JP2008530679A (en) | Electronic parallel processing circuit | |
| JP4893340B2 (en) | Calculation apparatus and calculation program | |
| JP6127883B2 (en) | Semiconductor device and semiconductor device operation control method | |
| JP2015121953A (en) | Microcomputer and electronic control device | |
| JPH0233173B2 (en) |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20181001 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20190529 |
|
| TRDD | Decision of grant or rejection written | ||
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20190618 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20190701 |
|
| R151 | Written notification of patent or utility model registration |
Ref document number: 6558317 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |