JP6642358B2 - Microcomputer and electronic control unit - Google Patents
Microcomputer and electronic control unit Download PDFInfo
- Publication number
- JP6642358B2 JP6642358B2 JP2016184263A JP2016184263A JP6642358B2 JP 6642358 B2 JP6642358 B2 JP 6642358B2 JP 2016184263 A JP2016184263 A JP 2016184263A JP 2016184263 A JP2016184263 A JP 2016184263A JP 6642358 B2 JP6642358 B2 JP 6642358B2
- Authority
- JP
- Japan
- Prior art keywords
- interrupt
- factor
- counter
- value
- monitoring unit
- 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
- 238000012544 monitoring process Methods 0.000 claims description 114
- 238000000034 method Methods 0.000 claims description 59
- 238000012545 processing Methods 0.000 claims description 59
- 238000012850 discrimination method Methods 0.000 claims 1
- 230000005856 abnormality Effects 0.000 description 4
- 230000010365 information processing Effects 0.000 description 4
- 238000011161 development Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4812—Task transfer initiation or dispatching by interrupt, e.g. masked
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4812—Task transfer initiation or dispatching by interrupt, e.g. masked
- G06F9/4825—Interrupt from clock, e.g. time of day
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/48—Indexing scheme relating to G06F9/48
- G06F2209/484—Precedence
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/54—Indexing scheme relating to G06F9/54
- G06F2209/543—Local
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Microcomputers (AREA)
- Debugging And Monitoring (AREA)
Description
本発明はマイクロコンピュータ及び電子制御装置に関する。 The present invention relates to a microcomputer and an electronic control device.
従来より、所定のプログラムにしたがって割込み処理を実行する処理部を備えたマイクロコンピュータが供されている。例えば特許文献1には、外部からの割込み要因を監視する割込み要因監視部を有する構成が開示されている。この構成では、割込み要因監視部は、割込み要因毎に個別に設定されている監視間隔で割込みの発生を監視し、割込み発生からの経過時間と割込みの発生回数とを記憶する。割込み要因監視部は、経過時間が予め設定されている所定時間を超え、発生回数が予め設定されている所定回数を超えると、異常の発生を判別する。 2. Description of the Related Art Conventionally, a microcomputer provided with a processing unit that executes an interrupt process according to a predetermined program has been provided. For example, Patent Document 1 discloses a configuration having an interrupt factor monitoring unit that monitors an external interrupt factor. In this configuration, the interrupt factor monitoring unit monitors the occurrence of an interrupt at a monitoring interval set individually for each interrupt factor, and stores the elapsed time since the interrupt occurred and the number of times the interrupt occurred. When the elapsed time exceeds a predetermined time set in advance and the number of occurrences exceeds a predetermined number of times, the interrupt factor monitoring unit determines occurrence of an abnormality.
特許文献1に記載されている構成では、異常の発生を割込み要因監視部で判別することはできる。しかしながら、異常が発生していない正常時において、割込み要因毎の割込み発生からの経過時間を処理部で扱うことができず、その経過時間を用いた高度な割込み処理を実行することができない。例えば割込みAが連続して発生しているにも関わらず、割込みAよりも優先度が高い割込みBが発生している期間では、割込みAの割込み処理を実行することができない。その一方で、割込みAの割込み処理を実行しない状況が継続すると、異常が発生する。又、割込み要因毎の割込み発生からの経過時間を処理部で扱えるようにし、経過時間が最も長い割込み要因を処理部が判別するように構成すると、処理部の処理負荷の増大を招く。 With the configuration described in Patent Literature 1, the occurrence of an abnormality can be determined by the interrupt factor monitoring unit. However, in a normal state where no abnormality has occurred, the processing unit cannot handle the elapsed time from the occurrence of the interrupt for each interrupt factor, and cannot execute advanced interrupt processing using the elapsed time. For example, the interrupt process of the interrupt A cannot be executed during the period in which the interrupt B having a higher priority than the interrupt A occurs while the interrupt A occurs continuously. On the other hand, if the situation where the interrupt process of the interrupt A is not executed continues, an abnormality occurs. Further, if the processing unit can handle the elapsed time from the occurrence of the interrupt for each interrupt factor and the processing unit determines the interrupt factor having the longest elapsed time, the processing load on the processing unit increases.
本発明は、上記した事情に鑑みてなされたものであり、その目的は、処理部の処理負荷が増大することなく、割込み発生からの経過時間を用いた高度な割込み処理を実行することができるマイクロコンピュータ及び電子制御装置を提供することにある。 The present invention has been made in view of the above circumstances, and an object of the present invention is to execute an advanced interrupt process using an elapsed time from the occurrence of an interrupt without increasing the processing load of a processing unit. A microcomputer and an electronic control device are provided.
請求項1に記載した発明によれば、所定のプログラムにしたがって割込み処理を実行する処理部(5)を備えたマイクロコンピュータ(2)において、前記処理部とは別に設けられ、外部からの複数の割込み要因を監視する割込み要因監視部(7)を備える。割込み要因監視部は、割込み要因毎の割込み発生からの経過時間を計測するタイマカウンタ(8)と、前記割込み要因毎の割込みの発生回数を計測する回数カウンタ(9)と、複数の割込み要因の中で前記タイマカウンタの値が最大の割込み要因の要因番号、又は前記回数カウンタの値が最大の割込み要因の要因番号を記憶する最大待ち要因記憶部(11)と、を有し、前記最大待ち要因記憶部に記憶されている割込み要因の要因番号が前記回数カウンタにより更新されない場合に前記タイマカウンタの値を用いて複数の割込み要因のうち割込み発生からの経過時間が最も長い割込み要因を判別する第1の判別方法と、前記最大待ち要因記憶部に記憶されている割込み要因の要因番号が前記回数カウンタにより更新される場合に前記タイマカウンタの値と前記回数カウンタの値とを用いて複数の割込み要因のうち割込み発生からの経過時間が最も長い割込み要因を判別する第2の判別方法とのうち何れかを選択する。割込み発生からの経過時間が最も長い割込み要因を、処理部とは別の割込み要因監視部が判別することで、処理部の処理負荷が増大することなく、割込み発生からの経過時間を用いた高度な割込み処理を実行することができる。
According to the first aspect of the present invention, in the microcomputer (2) including the processing unit (5) for executing an interrupt process according to a predetermined program, the microcomputer (2) is provided separately from the processing unit and includes a plurality of external devices. An interrupt factor monitoring unit (7) for monitoring an interrupt factor is provided. The interrupt factor monitoring unit includes a timer counter (8) for measuring an elapsed time from the occurrence of an interrupt for each interrupt factor, a count counter (9) for measuring the number of times an interrupt has occurred for each interrupt factor, and a plurality of interrupt factors. A maximum wait factor storage unit (11) for storing a factor number of an interrupt factor having a maximum value of the timer counter or a factor number of an interrupt factor having a maximum value of the number counter. When the factor number of the interrupt factor stored in the factor storage unit is not updated by the number counter, the interrupt factor using the value of the timer counter is used to determine the interrupt factor having the longest elapsed time from the occurrence of the interrupt. A first determination method, and determining that the timer counter is used when the factor number of the interrupt factor stored in the maximum wait factor storage unit is updated by the number counter. Selecting one of the second determination method of the elapsed time from the interrupt generation of the plurality of interrupt source to determine the longest interrupt factor by using the values of said counter in printer. The interrupt factor monitoring unit separate from the processing unit determines the interrupt factor that has the longest elapsed time since the occurrence of the interrupt. It is possible to execute various interrupt processes.
以下、本発明の一実施形態について図面を参照して説明する。電子制御装置1は、例えば車両用のエンジンの始動を制御する装置であり、電子制御装置1の動作を制御するマイクロコンピュータ(以下、マイコンと称する)2を有する。マイコン2は、割込み制御装置3と、情報処理装置4とを有する。割込み制御装置3は、外部から割込み要因1〜n(nは自然数)のn個の割込み要因を入力可能であり、何れかの割込み要因を入力すると、割込み要求を情報処理装置4に出力すると共に、その入力した割込み要因を特定可能な要因番号を情報処理装置4に出力する。
Hereinafter, an embodiment of the present invention will be described with reference to the drawings. The electronic control unit 1 is a device that controls, for example, the start of a vehicle engine, and includes a microcomputer (hereinafter, referred to as a microcomputer) 2 that controls the operation of the electronic control unit 1. The microcomputer 2 has an
情報処理装置4は、処理部5と、タイマ6と、割込み要因監視部7とを有する。処理部5は所定のプログラムにしたがって割込み処理を実行する。タイマ6は、予め任意に設定されている間隔でタイミング通知を割込み要因監視部7に出力する。割込み要因監視部7は、割込み制御装置3から入力する割込み要求及び要因番号と、タイマ6から入力するタイミング通知とを用い、割込み要因の状態を監視する。
The information processing device 4 includes a processing unit 5, a timer 6, and an interrupt factor monitoring unit 7. The processing unit 5 executes an interrupt process according to a predetermined program. The timer 6 outputs a timing notification to the interrupt factor monitoring unit 7 at an interval set in advance. The interrupt factor monitoring unit 7 monitors the status of the interrupt factor using the interrupt request and the factor number input from the
割込み要因監視部7は、割込み制御装置3から割込み要求を入力すると、割込みの発生を判定し、割込みの発生を示す割込み通知を処理部5に出力する。処理部5は、割込み要因監視部7から割込み通知を入力すると共に、各種要求を割込み要因監視部7に出力し、割込み処理を実行する。割込み要因監視部7は、処理部5から各種要求を入力すると、その入力した各種要求に対する各種応答を処理部5に出力する。
When receiving an interrupt request from the
処理部5は、割込み要因監視部7に出力する各種要求として、割込み要因クリア要求、タイマカウンタ値取得要求、回数カウンタ値取得要求、要因FIFO(First In First Out)取得要求、最大待ち要因取得要求を出力する。処理部5は、割込み要因クリア要求を割込み要因監視部7に出力することで、割込み要因監視部7で監視されている割込み要因をクリアする。 The processing unit 5 includes, as various requests output to the interrupt factor monitoring unit 7, an interrupt factor clear request, a timer counter value acquisition request, a number counter value acquisition request, a factor FIFO (First In First Out) acquisition request, and a maximum wait factor acquisition request. Is output. The processing unit 5 outputs the interrupt factor clear request to the interrupt factor monitoring unit 7, thereby clearing the interrupt factor monitored by the interrupt factor monitoring unit 7.
処理部5は、タイマカウンタ値取得要求を割込み要因監視部7に出力することで、後述するタイマカウンタ8の値を含むタイマカウンタ値取得応答を割込み要因監視部7から入力し、タイマカウンタ8の値を割込み要因監視部7から取得する。処理部5は、回数カウンタ値取得要求を割込み要因監視部7に出力することで、後述する回数カウンタ9の値を含む回数カウンタ値取得応答を割込み要因監視部7から入力し、回数カウンタ9の値を割込み要因監視部7から取得する。
The processing unit 5 outputs the timer counter value acquisition request including the value of the
処理部5は、要因FIFO取得要求を割込み要因監視部7に出力することで、後述する要因FIFO10の記憶内容を含む要因FIFO取得応答を割込み要因監視部7から入力し、要因FIFO10の記憶内容を割込み要因監視部7から取得する。処理部5は、最大待ち要因取得要求を割込み要因監視部7に出力することで、後述する最大待ち要因レジスタ11の記憶内容を含む最大待ち要因取得応答を割込み要因監視部7から入力し、最大待ち要因レジスタ11の記憶内容を割込み要因監視部7から取得する。
The processing unit 5 outputs the factor FIFO acquisition request to the interrupt factor monitoring unit 7 by inputting a factor FIFO acquisition response including the storage content of the
割込み要因監視部7は、割込み要因毎のタイマカウンタ8と回数カウンタ9とを有すると共に、要因FIFO10(要因記憶部に相当する)と最大待ち要因レジスタ11(最大待ち要因記憶部に相当する)とを有する。タイマカウンタ8は、何れかの割込み要因が発生している期間において、タイマ6からタイミング通知を入力する毎に対応する値をインクリメントし、その割込み発生からの経過時間を計測する。回数カウンタ9は、割込み制御装置3から割込み要求を入力すると、その割込み要求に対応して割込み制御装置3から入力した要因番号に対応する値をインクリメントし、その割込みの発生回数を計測する。タイマカウンタ8及び回数カウンタ9は、それぞれ処理部5から割込み要因クリア要求を入力すると、割込み要因に対応する値を「0」にクリアする。
The interrupt factor monitoring unit 7 has a
要因FIFO10は、割込み制御装置3から要因番号を入力すると、その入力した要因番号を先入れ先出し順に記憶する。要因FIFO10は、記憶可能な要因番号の個数である上限数をm(mは自然数)とし、1〜m番目のm個の記憶領域を有している。要因FIFO10は、割込み制御装置3から要因番号を入力すると、記憶している要因番号の個数がp(pは自然数、p<m)であり、上限数に達していなければ、1〜p番目の記憶領域に記憶している要因番号をそれぞれ2〜(p+1)番目の記憶領域に移動する。そして、要因FIFO10は、割込み制御装置3から入力した要因番号、即ち最新の要因番号を1番目の記憶領域に記憶する。一方、要因FIFO10は、記憶している要因番号の個数がmであり、上限数に達していれば、m番目の記憶領域に記憶している要因番号を削除する。そして、要因FIFO10は、1〜(m−1)番目の記憶領域に記憶している要因番号をそれぞれ2〜m番目の記憶領域に移動し、割込み制御装置3から入力した要因番号、即ち最新の要因番号を1番目の記憶領域に記憶する。尚、要因FIFO10は、上限数を任意に変更可能である。
When a factor number is input from the
最大待ち要因レジスタ11は、n個の割込み要因の中でタイマカウンタ8の値が最大の割込み要因の要因番号、又は回数カウンタ9の値が最大の割込み要因の要因番号を記憶するレジスタである。即ち、最大待ち要因レジスタ11は、n個の割込み要因の中でタイマカウンタ8の値が最大の割込み要因の要因番号を記憶することで、割込み要因が発生しているにも関わらず、その割込み要因に対応する割込み処理が実行されるまでの経過時間、即ち割込み発生からの経過時間が最も長い割込み要因を記憶する。又、最大待ち要因レジスタ11は、n個の割込み要因の中で回数カウンタ9の値が最大の割込み要因の要因番号を記憶することで、割込み要因が発生しているにも関わらず、その対応する割込み処理が実行されるまでの発生回数、即ち割込みの発生回数が最も多い割込み要因を記憶する。
The maximum
この場合、割込み要因監視部7は、タイマカウンタ8を用いた方式及び回数カウンタ9を用いた方式のうち何れかで最大待ち要因レジスタ11の記憶内容を更新する必要があり、何れの方式で更新するかを選択可能である。割込み要因監視部7が最大待ち要因レジスタ11の記憶内容を更新するタイミングとして以下の2つのタイミングがある。
In this case, the interrupt cause monitoring unit 7 needs to update the storage content of the maximum
1つ目は、割込み要因監視部7が割込み制御装置3から割込み要求を入力したタイミングである。割込み要因監視部7は、割込み制御装置3から割込み要求を入力すると、その割込み要求に対応して割込み制御装置3から入力した要因番号に対応する回数カウンタ9の値をインリメントする。そのため、回数カウンタ9の値が最大となる割込み要因が変化する可能性がある。回数カウンタ9の値が最大となる割込み要因が変化すると、それまで最大待ち要因レジスタ11が記憶している割込み要因の要因番号と、回数カウンタ9の値が最大となった割込み要因の要因番号とが合致しなくなる。よって、この場合は最大待ち要因レジスタ11の記憶内容を更新する必要がある。
The first is a timing at which the interrupt factor monitoring unit 7 inputs an interrupt request from the interrupt
2つ目は、割込み要因監視部7が処理部5から割込み要因クリア要求を入力したタイミングである。割込み要因監視部7は、処理部5から割込み要因クリア要求を入力すると、割込み要因に対応するタイマカウンタ8の値及び回数カウンタ9の値の両方を「0」にクリアする。そのため、それまで最大待ち要因レジスタ11が記憶している割込み要因の要因番号と、割込み要因クリア要求によりタイマカウンタ8の値及び回数カウンタ9の値の両方が「0」にクリアされた割込み要因の要因番号とが合致していると、それまで最大待ち要因レジスタ11が記憶している割込み要因の要因番号と、タイマカウンタ8の値又は回数カウンタ9の値が最大となった割込み要因の要因番号とが合致しなくなる。よって、この場合も最大待ち要因レジスタ11の記憶内容を更新する必要がある。
The second is a timing at which the interrupt factor monitoring unit 7 inputs an interrupt factor clear request from the processing unit 5. Upon receiving the interrupt factor clear request from the processing unit 5, the interrupt factor monitoring unit 7 clears both the value of the
尚、割込み要因監視部7は、タイマ6からタイミング通知を入力すると、発生している割込み要因に対応する全てのタイマカウンタ8の値を一斉にインクリメントする。そのため、タイマカウンタ8の値が最大の割込み要因が変化することはなく、それまで最大待ち要因レジスタ11が記憶している割込み要因の要因番号と、タイマカウンタ8の値が最大の割込み要因の要因番号とが合致したままである。よって、この場合は最大待ち要因レジスタ11の記憶内容を更新する必要はない。
When a timing notification is input from the timer 6, the interrupt factor monitoring unit 7 simultaneously increments the values of all the timer counters 8 corresponding to the interrupt factor that has occurred. Therefore, the interrupt factor with the maximum value of the
次に、上記した構成の作用について図2から図7を参照して説明する。割込み要因監視部7は、割込み制御装置3から割込み要求を入力すると、割込み要因の監視処理を実行し、タイマ6からタイミング通知を入力すると、タイマカウンタ8の更新処理を実行する。以下、割込み要因の監視処理及びタイマカウンタ8の更新処理について順次説明する。尚、割込み要因監視部7が割込み制御装置3から割込み要求を入力するタイミングとタイマ6からタイミング通知を入力するタイミングとの間には依存関係が存在しないので、割込み要因監視部7は、割込み要因の監視処理及びタイマカウンタ8の更新処理を独立して実行する。
Next, the operation of the above configuration will be described with reference to FIGS. The interrupt factor monitoring unit 7 executes an interrupt factor monitoring process when an interrupt request is input from the interrupt
(1)割込み要因の監視処理
割込み要因監視部7は、割込み要因の監視処理を開始すると、割込み通知を処理部5に出力する(S1)。このとき、処理部5は、割込み要因監視部7から割込み通知を入力することで、割込み処理を開始する。
(1) Interrupt Factor Monitoring Process When the interrupt factor monitoring unit 7 starts the interrupt factor monitoring process, it outputs an interrupt notification to the processing unit 5 (S1). At this time, the processing unit 5 starts interrupt processing by inputting an interrupt notification from the interrupt factor monitoring unit 7.
割込み要因監視部7は、割込み通知を処理部5に出力すると、要因FIFO10の更新処理に移行する(S2)。割込み要因監視部7は、要因FIFO10の更新処理を開始すると、割込み制御装置3から入力した要因番号を取得し(S11)、記憶している要因番号の個数が上限数に達しているか否かを判定する(S12)。ここで、割込み要因監視部7は、上限数をmとすると、記憶している要因番号の個数がp(p<m)であれば、記憶している要因番号の個数が上限数に達していないと判定する(S12:NO)。割込み要因監視部7は、1〜p番目の記憶領域に記憶している要因番号をそれぞれ2〜(p+1)番目の記憶領域に移動し(S13)、その取得した要因番号を1番目の記憶領域に記憶し(S14)、要因FIFO10の更新処理を終了し、割込み要因の監視処理に戻る。
Upon outputting the interrupt notification to the processing unit 5, the interrupt factor monitoring unit 7 shifts to updating the factor FIFO 10 (S2). When starting the updating process of the
一方、割込み要因監視部7は、記憶している要因番号の個数がmであれば、記憶している要因番号の個数が上限数に達していると判定する(S12:YES)。割込み要因監視部7は、m番目の記憶領域に記憶している要因番号を削除し(S15)、1〜(m−1)番目の記憶領域に記憶している要因番号をそれぞれ2〜m番目の記憶領域に移動し(S16)、その取得した要因番号を1番目の記憶領域に記憶し(S17)、要因FIFO10の更新処理を終了し、割込み要因の監視処理に戻る。割込み要因監視部7は、このようにして要因番号を先入れ先出し順に記憶することで、過去に発生した割込み要因を、その発生順序を維持したまま記憶可能となる。
On the other hand, if the number of stored factor numbers is m, the interrupt factor monitoring unit 7 determines that the stored number of factor numbers has reached the upper limit (S12: YES). The interrupt factor monitoring unit 7 deletes the factor numbers stored in the m-th storage area (S15), and replaces the factor numbers stored in the first to (m-1) -th storage areas with the second to m-th, respectively. (S16), the acquired factor number is stored in the first storage area (S17), the updating process of the
割込み要因監視部7は、割込み要因の監視処理に戻ると、回数カウンタ9の更新処理に移行する(S3)。割込み要因監視部7は、回数カウンタ9の更新処理を開始すると、割込み制御装置3から入力して取得した要因番号を取得し(S21)、その取得した要因番号に対応する回数カウンタ9の値をインクリメントし(S22)、回数カウンタの更新処理を終了し、割込み要因の監視処理に戻る。割込み要因監視部7は、このように発生した割込み要因に対応する回数カウンタ9の値をインクリメントすることで、割込み要因毎に割込みの発生回数を記憶可能となる。尚、以上は、割込み要因監視部7は、要因FIFO10の更新処理を終了した後に回数カウンタの更新処理を実行する場合を説明したが、要因FIFO10の更新処理と回数カウンタ9の更新処理との間には依存関係が存在しないので、要因FIFO10の更新処理と回数カウンタ9の更新処理とを同時に(即ち並列に)実行しても良い。
When returning to the interrupt factor monitoring process, the interrupt factor monitoring unit 7 proceeds to an update process of the number counter 9 (S3). When the interrupt factor monitoring unit 7 starts the updating process of the
割込み要因監視部7は、割込み要因の監視処理に戻ると、割込み要求入力時の最大待ち要因レジスタ11の更新処理に移行する。割込み要因監視部7は、割込み要求入力時の最大待ち要因レジスタ11の更新処理を開始すると、最大待ち要因レジスタ11に記憶されている割込み要因の要因番号が回数カウンタ9で更新されるか否かを判定する(S31)。割込み要因監視部7は、最大待ち要因レジスタ11に記憶されている割込み要因の要因番号が回数カウンタ9により更新されないと判定すると(S31:NO)、最大待ち要因レジスタ11の記憶内容の更新が不要となるので、割込み要求入力時の最大待ち要因レジスタ11の更新処理を終了し、割込み要因の監視処理に戻る。
When the interrupt factor monitoring unit 7 returns to the interrupt factor monitoring process, the process shifts to updating the maximum wait factor register 11 when an interrupt request is input. When the interrupt factor monitoring unit 7 starts updating the maximum wait factor register 11 when an interrupt request is input, the interrupt factor monitor unit 7 determines whether or not the factor number of the interrupt factor stored in the maximum wait factor register 11 is updated by the
一方、割込み要因監視部7は、最大待ち要因レジスタ11に記憶されている割込み要因の要因番号が回数カウンタ9により更新されると判定すると(S31:YES)、割込み制御装置3から入力して取得した要因番号と、最大待ち要因レジスタ11に記憶されている割込み要因の要因番号とが異なるか否かを判定する(S32)。割込み要因監視部7は、両者が同じであると判定すると(S32:NO)、回数カウンタ9の値を更新したとしても値が最大となる割込み要因が変化せず、最大待ち要因レジスタ11の記憶内容の更新が不要となるので、割込み要求入力時の最大待ち要因レジスタ11の更新処理を終了し、割込み要因の監視処理に戻る。
On the other hand, if the interrupt factor monitoring unit 7 determines that the factor number of the interrupt factor stored in the maximum wait factor register 11 is updated by the number counter 9 (S31: YES), the interrupt factor monitoring unit 7 inputs and obtains the interrupt number from the interrupt
一方、割込み要因監視部7は、両者が異なると判定すると(S32:YES)、回数カウンタ9の値を更新することで、値が最大となる割込み要因が変化する可能性があるので、割込み制御装置3から入力して取得した要因番号に対応する回数カウンタ9の値と最大待ち要因レジスタ11に記憶されている割込み要因の要因番号に対応する回数カウンタ9の値との大小を比較する(S33)。割込み要因監視部7は、割込み制御装置3から入力して取得した要因番号に対応する回数カウンタ9の値が、最大待ち要因レジスタ11に記憶されている割込み要因の要因番号に対応する回数カウンタ9の値よりも大きくないと判定すると(S33:NO)、最大待ち要因レジスタ11の記憶内容の更新が不要となるので、割込み要求入力時の最大待ち要因レジスタ11の更新処理を終了し、割込み要因の監視処理に戻る。
On the other hand, when determining that the two are different (S32: YES), the interrupt factor monitoring unit 7 updates the value of the
一方、割込み要因監視部7は、割込み制御装置3から入力して取得した要因番号に対応する回数カウンタ9の値が、最大待ち要因レジスタ11に記憶されている割込み要因の要因番号に対応する回数カウンタ9の値よりも大きいと判定すると(S33:YES)、割込み制御装置3から入力して取得した要因番号を最大待ち要因レジスタ11に記憶し(S34)、割込み要求入力時の最大待ち要因レジスタ11の更新処理を終了し、割込み要因の監視処理に戻る。
On the other hand, the interrupt factor monitoring unit 7 determines that the value of the
割込み要因監視部7は、割込み要因の監視処理に戻ると、処理部5からの割込み要因クリア要求の入力を待機する(S5)。これ以降、処理部5は、割込み処理を完了すると、割込み要因クリア処理を実行し、割込み要因クリア要求を割込み要因監視部7に出力する。割込み要因監視部7は、処理部5から割込み要因クリア要求を入力したと判定すると(S5:YES)、割込み要因クリア時の最大待ち要因レジスタ11の更新処理に移行する(S6)。 When returning to the interrupt factor monitoring process, the interrupt factor monitoring unit 7 waits for an interrupt factor clear request from the processing unit 5 (S5). Thereafter, when the interrupt processing is completed, the processing unit 5 executes the interrupt factor clearing process and outputs an interrupt factor clear request to the interrupt factor monitoring unit 7. When determining that an interrupt factor clear request has been input from the processing unit 5 (S5: YES), the interrupt factor monitoring unit 7 shifts to updating the maximum wait factor register 11 when the interrupt factor is cleared (S6).
割込み要因監視部7は、割込み要因クリア時の最大待ち要因レジスタ11の更新処理を開始すると、処理部5から入力した割込み要因クリア要求により指定されているクリア対象の要因番号と最大待ち要因レジスタ11に記憶されている割込み要因の要因番号とが異なるか否かを判定する(S41)。割込み要因監視部7は、両者が異なると判定すると(S41:YES)、最大待ち要因レジスタ11に記憶されている割込み要因の要因番号が変化せず、最大待ち要因レジスタ11の記憶内容の更新が不要となるので、割込み要因クリア時の最大待ち要因レジスタ11の更新処理を終了し、割込み要因の監視処理に戻る。 When the interrupt factor monitoring unit 7 starts updating the maximum wait factor register 11 at the time of clearing the interrupt factor, the interrupt factor monitoring unit 7 and the factor number of the clear target designated by the interrupt factor clear request input from the processing unit 5 and the maximum wait factor register 11 It is determined whether or not the cause number of the interrupt cause stored in (1) is different (S41). If the interrupt factor monitoring unit 7 determines that the two are different (S41: YES), the factor number of the interrupt factor stored in the maximum wait factor register 11 does not change, and the contents stored in the maximum wait factor register 11 are updated. Since it becomes unnecessary, the update process of the maximum wait cause register 11 at the time of clearing the interrupt factor is ended, and the process returns to the interrupt factor monitoring process.
一方、割込み要因監視部7は、両者が同じであると判定すると(S41:NO)、最大待ち要因レジスタ11に記憶されている割込み要因の要因番号が回数カウンタ9により更新されるか否かを判定する(S42)。割込み要因監視部7は、最大待ち要因レジスタ11に記憶されている割込み要因の要因番号が回数カウンタ9により更新されないと判定すると(S42:NO)、タイマカウンタ8の値が最大の割込み要因が最大待ち要因レジスタ11に記憶される必要があるので、全ての割込み要因の中からタイマカウンタ8の値が最大の割込み要因を探索する(S43)。そして、割込み要因監視部7は、その探索した割込み要因の要因番号を最大待ち要因レジスタ11に記憶し(S44)、割込み要因クリア時の最大待ち要因レジスタ11の更新処理を終了し、割込み要因の監視処理に戻る。
On the other hand, when the interrupt factor monitoring unit 7 determines that the two are the same (S41: NO), the interrupt factor monitoring unit 7 determines whether the factor number of the interrupt factor stored in the maximum wait factor register 11 is updated by the
一方、割込み要因監視部7は、最大待ち要因レジスタ11に記憶されている割込み要因の要因番号が回数カウンタ9により更新されると判定すると(S42:YES)、全ての割込み要因の中から回数カウンタ9の値が最大の割込み要因を探索する(S45)。割込み要因監視部7は、探索した割込み要因が複数であるか否かを判定し(S46)、その探索した割込み要因が複数でない(即ち1つである)と判定すると(S46:NO)、その探索した割込み要因の要因番号を最大待ち要因レジスタ11に記憶し(S44)、割込み要因クリア時の最大待ち要因レジスタ11の更新処理を終了し、割込み要因の監視処理に戻る。 On the other hand, if the interrupt factor monitoring unit 7 determines that the factor number of the interrupt factor stored in the maximum wait factor register 11 is updated by the count counter 9 (S42: YES), the count counter of all interrupt factors is counted. The interrupt factor having the maximum value of 9 is searched for (S45). The interrupt factor monitoring unit 7 determines whether or not the searched interrupt factor is plural (S46), and when it is determined that the searched interrupt factor is not plural (that is, one) (S46: NO), The factor number of the found interrupt factor is stored in the maximum wait factor register 11 (S44), the process of updating the maximum wait factor register 11 when the interrupt factor is cleared ends, and the process returns to the interrupt factor monitoring process.
一方、割込み要因監視部7は、その探索した割込み要因が複数であると判定すると(S46:YES)、その複数の割込み要因の中からタイマカウンタ8の値が最大の割込み要因を探索する(S47)。そして、割込み要因監視部7は、その探索した割込み要因の要因番号を最大待ち要因レジスタ11に記憶し(S44)、割込み要因クリア時の最大待ち要因レジスタ11の更新処理を終了し、割込み要因の監視処理に戻る。
On the other hand, if the interrupt factor monitoring unit 7 determines that the searched interrupt factors are plural (S46: YES), the interrupt factor monitoring unit 7 searches for the interrupt factor with the maximum value of the
(2)タイマカウンタ8の更新処理
割込み要因監視部7は、タイマカウンタ8の更新処理を開始すると、回数カウンタ9の値が「0」でない割込み要因が存在するか否かを判定する(S51)。割込み要因監視部7は、回数カウンタ9の値が「0」でない割込み要因が存在していないと判定すると(S51:NO)、割込み要因が発生していないと判定し、タイマカウンタ8の値をインクリメントせず、タイマカウンタ8の更新処理を終了する。一方、割込み要因監視部7は、回数カウンタ9の値が「0」でない割込み要因が存在していると判定すると(S51:YES)、割込み要因が発生していると判定し、その割込み要因に対応するタイマカウンタ8の値をインクリメントし(S52)、タイマカウンタ8の更新処理を終了する。
(2) Update process of
このようにして割込み要因監視部7が割込み要因の監視処理及びタイマカウンタ8の更新処理を実行することで、割込み発生からの経過時間が最も長い割込み要因を判別する処理を処理部5が実行しなくとも、その経過時間が最も長い割込み要因を割込み要因監視部7で判別可能となる。加えて、割込みの発生回数が最も多い割込み要因を処理部5が実行しなくとも、その発生回数が最も多い割込み要因を発生順序にしたがって割込み要因監視部7で判別可能となる。これにより、処理部5は、経過時間が最も長い割込み要因や発生回数が最も多い割込み要因を割込み要因監視部7から取得することで、その取得した経過時間や発生回数に応じて割込み処理の実行順序を変更する等の高度な割込み処理を実行可能となる。尚、タイマカウンタ8の値を用いて割込み発生からの経過時間が最も長い割込み要因を判別する判別方法と、タイマカウンタ8の値と回数カウンタ9の値とを用いて割込み発生からの経過時間が最も長い割込み要因を判別する判別方法とのうち何れかを選択可能としても良い。
As described above, the interrupt factor monitoring unit 7 executes the monitoring process of the interrupt factor and the updating process of the
以上に説明したように本実施形態によれば、次に示す効果を得ることができる。
マイコン2において、最大待ち要因レジスタ11に記憶されている記憶内容により、複数の割込み要因のうち割込み発生からの経過時間が最も長い割込み要因を割込み要因監視部7が判別するようにした。経過時間が最も長い割込み要因を判別する処理を処理部5が実行しなくとも、経過時間が最も長い割込み要因を割込み要因監視部7が判別することで、処理部5の処理負荷が増大することなく、割込み発生からの経過時間を用いた高度な割込み処理を実行することができる。又、複数の割込み要因を監視することで、複数の割込み要因に対応することができ、電子制御装置1を含めたシステムの柔軟な開発を実現することができる。
According to the present embodiment as described above, the following effects can be obtained.
In the microcomputer 2, the interrupt factor monitoring unit 7 determines the interrupt factor having the longest elapsed time from the occurrence of the interrupt among the plurality of interrupt factors, based on the contents stored in the maximum
又、マイコン2において、要因FIFO10に記憶されている記憶内容により、複数の割込み要因のうち割込みの発生回数が最も多い割込み要因を割込み要因監視部7が判別するようにした。発生回数が最も多い割込み要因を判別する処理を処理部5が実行しなくとも、発生回数が最も多い割込み要要因を割込み要因監視部7が判別することで、処理部5の処理負荷が増大することなく、割込み発生からの経過時間に加えて割込みの発生回数を用いた高度な割込み処理を実行することができる。又、過去に発生した割込み要因の発生順序を維持したまま記憶することで、デバッグを容易に行うことができる。
Further, in the microcomputer 2, the interrupt factor monitoring unit 7 determines the interrupt factor with the largest number of interrupt occurrences among a plurality of interrupt factors, based on the stored contents stored in the
又、マイコン2において、タイマカウンタ8の値を用いて割込み発生からの経過時間が最も長い割込み要因を判別する判別方法と、タイマカウンタ8の値と回数カウンタ9の値とを用いて割込み発生からの経過時間が最も長い割込み要因を判別する判別方法とのうち何れかを選択するようにした。何れかの判別方法を、電子制御装置1を含めたシステムに応じて選択することで、システムの柔軟な開発を実現することができる。
The microcomputer 2 uses the value of the
又、マイコン2において、タイマ6からタイミング通知を入力することで、タイマカウンタの値を更新するようにした。タイマカウンタの値を定期的に更新し、割込み発生からの経過時間を適切に計測することができる。 Further, the microcomputer 2 updates the value of the timer counter by inputting a timing notification from the timer 6. It is possible to periodically update the value of the timer counter and appropriately measure the elapsed time from the occurrence of the interrupt.
又、マイコン2において、タイマカウンタ8の値、回数カウンタ9の値、要因FIFO10の記憶内容、最大待ち要因記憶部11の記憶内容を処理部5が割込み要因監視部7から取得するようにした。タイマカウンタ8の値、回数カウンタ9の値、要因FIFO10の記憶内容、最大待ち要因記憶部11の記憶内容を処理部5が任意のタイミングで取得することができる。
Further, in the microcomputer 2, the processing unit 5 acquires the value of the
又、マイコン2において、処理部5が割込み要因クリアを割込み要因監視部7に出力すると、タイマカウンタ8の値、回数カウンタ9の値、要因FIFO10の記憶内容、最大待ち要因記憶部11の記憶内容をクリアするようにした。タイマカウンタ8の値、回数カウンタ9の値、要因FIFO10の記憶内容、最大待ち要因記憶部11の記憶内容を処理部5が任意のタイミングでクリアすることができる。
Also, in the microcomputer 2, when the processing unit 5 outputs the interrupt factor clear to the interrupt factor monitoring unit 7, the value of the
本発明は、上記した実施形態で例示したものに限定されることなく、その範囲を逸脱しない範囲で任意に変形又は拡張することができる。
電子制御装置1は、車両用のエンジンの始動を制御する装置に限らず、どのような電子制御装置に適用しても良い。
The present invention can be arbitrarily modified or expanded without departing from the scope thereof, without being limited to those exemplified in the above embodiments.
The electronic control device 1 is not limited to a device that controls the start of a vehicle engine, and may be applied to any electronic control device.
本開示は、実施例に準拠して記述されたが、当該実施例や構造に限定されるものではないと理解される。本開示は、様々な変形例や均等範囲内の変形をも包含する。加えて、様々な組み合わせや形態、更には、それらに一要素のみ、それ以上、或いはそれ以下を含む他の組み合わせや形態をも、本開示の範疇や思想範囲に入るものである。 Although the present disclosure has been described with reference to the embodiments, it is understood that the present disclosure is not limited to the embodiments and the structures. The present disclosure also encompasses various modifications and variations within an equivalent range. In addition, various combinations and forms, and other combinations and forms including one element, more elements, or less elements are also included in the scope and spirit of the present disclosure.
図面中、1は電子制御装置、2はマイコン、5は処理部、7は割込み要因監視部、8はタイマカウンタ、9は回数カウンタ、10は要因FIFO(要因記憶部)、11は最大待ち要因レジスタ(最大待ち要因記憶部)である。 In the drawings, 1 is an electronic control unit, 2 is a microcomputer, 5 is a processing unit, 7 is an interrupt factor monitoring unit, 8 is a timer counter, 9 is a counter, 10 is a FIFO (factor storage), and 11 is a maximum wait factor. This is a register (maximum wait factor storage unit).
Claims (5)
前記処理部とは別に設けられ、外部からの複数の割込み要因を監視する割込み要因監視部(7)を備え、
前記割込み要因監視部は、割込み要因毎の割込み発生からの経過時間を計測するタイマカウンタ(8)と、前記割込み要因毎の割込みの発生回数を計測する回数カウンタ(9)と、複数の割込み要因の中で前記タイマカウンタの値が最大の割込み要因の要因番号、又は前記回数カウンタの値が最大の割込み要因の要因番号を記憶する最大待ち要因記憶部(11)と、を有し、前記最大待ち要因記憶部に記憶されている割込み要因の要因番号が前記回数カウンタにより更新されない場合に前記タイマカウンタの値を用いて複数の割込み要因のうち割込み発生からの経過時間が最も長い割込み要因を判別する第1の判別方法と、前記最大待ち要因記憶部に記憶されている割込み要因の要因番号が前記回数カウンタにより更新される場合に前記タイマカウンタの値と前記回数カウンタの値とを用いて複数の割込み要因のうち割込み発生からの経過時間が最も長い割込み要因を判別する第2の判別方法とのうち何れかを選択するマイクロコンピュータ。 In a microcomputer (2) including a processing unit (5) for executing an interrupt process according to a predetermined program,
An interrupt factor monitoring unit (7) provided separately from the processing unit and monitoring a plurality of external interrupt factors;
The interrupt factor monitoring unit includes a timer counter (8) for measuring an elapsed time from occurrence of an interrupt for each interrupt factor, a count counter (9) for measuring the number of times an interrupt has occurred for each interrupt factor, and a plurality of interrupt factors. And a maximum wait factor storage unit (11) for storing the factor number of the interrupt factor with the largest value of the timer counter or the factor number of the interrupt factor with the largest value of the number counter. If the factor number of the interrupt factor stored in the wait factor storage unit is not updated by the number counter, the value of the timer counter is used to determine the interrupt factor having the longest elapsed time from the occurrence of the interrupt among the plurality of interrupt factors. A first discrimination method for determining whether or not the cause number of the interrupt cause stored in the maximum wait cause storage unit is updated by the number counter. Counter value and the counter value and a microcomputer for selecting one of the second determination method of the elapsed time from the interrupt generation of the plurality of interrupt source to determine the longest interrupt factor with.
前記タイマカウンタは、タイマ(6)からタイミング通知を入力することで、その値を更新するマイクロコンピュータ。 The microcomputer according to claim 1,
The microcomputer updates the value of the timer counter by inputting a timing notification from a timer (6) .
前記割込み要因監視部は、現在から遡って過去所定回数分の割込み要因を記憶する要因記憶部(10)を有するマイクロコンピュータ。 The microcomputer according to claim 1 or 2,
The microcomputer includes a factor storage unit (10) for storing a predetermined number of past interrupt factors retroactively from the present .
前記要因記憶部は、前記過去所定回数分の割込み要因を先入れ先出し順にしたがって記憶するマイクロコンピュータ。 The microcomputer according to claim 3 ,
The microcomputer stores the cause of interruption for the predetermined number of times in the past in a first-in first-out order .
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2016184263A JP6642358B2 (en) | 2016-09-21 | 2016-09-21 | Microcomputer and electronic control unit |
DE102017215944.8A DE102017215944A1 (en) | 2016-09-21 | 2017-09-11 | Microcomputer and electronic control unit |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2016184263A JP6642358B2 (en) | 2016-09-21 | 2016-09-21 | Microcomputer and electronic control unit |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2018049446A JP2018049446A (en) | 2018-03-29 |
JP6642358B2 true JP6642358B2 (en) | 2020-02-05 |
Family
ID=61302607
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2016184263A Active JP6642358B2 (en) | 2016-09-21 | 2016-09-21 | Microcomputer and electronic control unit |
Country Status (2)
Country | Link |
---|---|
JP (1) | JP6642358B2 (en) |
DE (1) | DE102017215944A1 (en) |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2010271993A (en) | 2009-05-22 | 2010-12-02 | Renesas Electronics Corp | Interrupt processing apparatus and method |
-
2016
- 2016-09-21 JP JP2016184263A patent/JP6642358B2/en active Active
-
2017
- 2017-09-11 DE DE102017215944.8A patent/DE102017215944A1/en active Pending
Also Published As
Publication number | Publication date |
---|---|
DE102017215944A1 (en) | 2018-03-22 |
JP2018049446A (en) | 2018-03-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111008072A (en) | Task scheduling method and device, storage medium and electronic equipment | |
CA2965283A1 (en) | Systems and methods of subject state change notification | |
EP2996039B1 (en) | Adaptive scheduling jobs of a virus detection batch according to cpu performance | |
JP6642358B2 (en) | Microcomputer and electronic control unit | |
JP5864032B1 (en) | Programmable logic controller | |
US10156992B2 (en) | Method for data reduction of items of sensor data information | |
TWI833975B (en) | Status management system and status management method | |
JP6338923B2 (en) | Programmable controller and control program | |
CN107615205B (en) | Clock diagnosis device and clock diagnosis method | |
JP2015156104A (en) | Self-controlling system, self-controlling device, self-controlling method, and program | |
JP2009026035A (en) | Interrupt processing synchronizing device, interrupt processing synchronizing method, and program | |
JP6580287B2 (en) | Display, display method and display system | |
US8527743B2 (en) | Simultaneous checking of plural exit conditions loaded in table subsequent to execution of wait instruction for jitter free exit | |
JP6648663B2 (en) | Arithmetic unit, electronic control unit, and arithmetic method | |
CN110764609B (en) | Method and device for data synchronization and computing equipment | |
JP2002006944A (en) | Indicator with control function | |
JP4516898B2 (en) | Task controller | |
KR101989337B1 (en) | Method and Apparatus for Displaying Real Time Wake Information in Radar System | |
JP4006648B2 (en) | Input module | |
EP3048481A1 (en) | Electronic device, method for controlling electronic device, and storage medium | |
JP6162491B2 (en) | Processing device, processing method, and program | |
JP6201921B2 (en) | Microcomputer | |
JP6613873B2 (en) | Data processing apparatus and program | |
JP2016177564A (en) | Debug control circuit and debug control method | |
JP2010009434A (en) | Load distribution method in collection of monitor and control information |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20181102 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20190723 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20190820 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20191001 |
|
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: 20191203 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20191216 |
|
R151 | Written notification of patent or utility model registration |
Ref document number: 6642358 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 |