JP2014092860A - Task execution order diagnosis device - Google Patents

Task execution order diagnosis device Download PDF

Info

Publication number
JP2014092860A
JP2014092860A JP2012241851A JP2012241851A JP2014092860A JP 2014092860 A JP2014092860 A JP 2014092860A JP 2012241851 A JP2012241851 A JP 2012241851A JP 2012241851 A JP2012241851 A JP 2012241851A JP 2014092860 A JP2014092860 A JP 2014092860A
Authority
JP
Japan
Prior art keywords
task
task code
code
diagnosis
hierarchy
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2012241851A
Other languages
Japanese (ja)
Other versions
JP6081147B2 (en
Inventor
Makoto Toko
誠 登古
Hiroshi Nakatani
博司 中谷
Naoya Onishi
直哉 大西
Motohiko Okabe
基彦 岡部
Akira Nojima
章 野島
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Toshiba Corp
Toshiba Mitsubishi Electric Industrial Systems Corp
Original Assignee
Toshiba Corp
Toshiba Mitsubishi Electric Industrial Systems Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Toshiba Corp, Toshiba Mitsubishi Electric Industrial Systems Corp filed Critical Toshiba Corp
Priority to JP2012241851A priority Critical patent/JP6081147B2/en
Publication of JP2014092860A publication Critical patent/JP2014092860A/en
Application granted granted Critical
Publication of JP6081147B2 publication Critical patent/JP6081147B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a task execution order diagnosis device capable of diagnosing the execution order of a plurality of tasks including tasks in hierarchies for performing divided processing in the same processing level.SOLUTION: A task execution order diagnosis circuit 2 for diagnosing the execution order of a plurality of tasks T1 to T372 including tasks T21 to T372 in hierarchies H2 and H3 for performing divided processing includes: a current number register 24 for storing a current task code; a previous number register 25 for storing the previous task code; a number management table 26 for managing the final task code of each of hierarchies H1 to H3; a diagnosis circuit 27 for diagnosing whether or not the current task code is valid on the basis of the previous task code; and a comparator circuit 28 for comparing the current task code with the final task code of the number management table 26. The task code of the previous number register 25 is updated on the basis of the comparison result of the comparator circuit 28.

Description

本発明は、コンピュータにより実行されたタスクの順序を診断する装置に関する。   The present invention relates to an apparatus for diagnosing the order of tasks executed by a computer.

一般に、ファームウェアの正常動作を監視する方法として、タスク実行順診断が知られている。タスク実行順診断は、前回実行されるべきタスクと今回実行するタスクの妥当性を確認することで診断する。   In general, task execution order diagnosis is known as a method for monitoring normal operation of firmware. The task execution order diagnosis is performed by checking the validity of the task to be executed last time and the task to be executed this time.

例えば、自タスクの情報及び自タスクの前に実行されるタスクを特定する情報を含む識別情報を各タスクが起動時に監視部に設定することで実行順を診断することが開示されている(例えば、特許文献1参照)。   For example, it is disclosed that the execution order is diagnosed by setting identification information including information for identifying the task and information for identifying the task to be executed before the task itself in the monitoring unit at the time of activation (for example, , See Patent Document 1).

また、マイクロプロセッサによって実行されるプログラムを模擬する回路が予め実装された動作検査回路で、実行順を診断することが開示されている(例えば、特許文献2参照)。   Further, it is disclosed that the execution order is diagnosed by an operation inspection circuit in which a circuit for simulating a program executed by a microprocessor is mounted in advance (see, for example, Patent Document 2).

特開2010−9296号公報JP 2010-9296 A 特許第4359632号公報Japanese Patent No. 4359632

しかしながら、タスク内の処理を複数回に分割して実行する場合、分割されたタスクの属する階層の処理レベル毎に、タスクの実行順を診断することになり、全てのタスクを同一処理レベルで診断することについては知られていない。処理レベル毎にタスクの実行順を診断する場合、診断方法が複雑になり、診断時間が長くなる。また、ファームウェアの変更などでタスクの実行順が変わる場合、診断装置の変更が容易にできない可能性がある。   However, when the processing within a task is divided and executed multiple times, the task execution order is diagnosed for each processing level of the hierarchy to which the divided tasks belong, and all tasks are diagnosed at the same processing level. Not known about what to do. When diagnosing the task execution order for each processing level, the diagnosis method becomes complicated and the diagnosis time becomes longer. Also, if the task execution order changes due to firmware changes or the like, there is a possibility that the diagnostic device cannot be easily changed.

そこで、本発明の目的は、分割された処理をする階層のタスクを含む複数のタスクの実行順を同一処理レベルで診断することのできるタスク実行順診断装置を提供することにある。   Accordingly, an object of the present invention is to provide a task execution order diagnosis apparatus capable of diagnosing the execution order of a plurality of tasks including tasks in a hierarchy for performing divided processing at the same processing level.

本発明の観点に従ったタスク実行順診断装置は、分割された処理をする階層のタスクを含む複数のタスクの実行順を診断する診断装置であって、診断対象のタスクを示すタスクコードを記憶する第1のタスクコード記憶手段と、前記診断対象のタスクを診断するためのタスクコードを記憶する第2のタスクコード記憶手段と、前記階層毎に最後に実行されるタスクを示す最終タスクコードを記憶する最終タスクコード記憶手段と、前記第2のタスクコード記憶手段に記憶された前記タスクコードに基づいて、前記第1のタスクコード記憶手段に記憶された前記診断対象のタスクを示す前記タスクコードが妥当であるか否かを診断する診断手段と、前記診断対象のタスクを示す前記タスクコードが前記最終タスクコード記憶手段に記憶された前記最終タスクコードか否かを階層毎に判断する最終タスクコード判断手段と、前記最終タスクコード判断手段による判断結果に基づいて、前記第2のタスクコード記憶手段に記憶された前記タスクコードを更新する更新手段とを含む。   A task execution order diagnosis apparatus according to an aspect of the present invention is a diagnosis apparatus for diagnosing the execution order of a plurality of tasks including tasks in a hierarchy that performs divided processing, and stores a task code indicating a task to be diagnosed First task code storage means, second task code storage means for storing a task code for diagnosing the task to be diagnosed, and a final task code indicating a task to be executed last for each hierarchy The task code indicating the diagnosis target task stored in the first task code storage unit based on the task code stored in the second task code storage unit and the final task code storage unit to store A diagnostic means for diagnosing whether or not is appropriate, and before the task code indicating the task to be diagnosed is stored in the final task code storage means The task code stored in the second task code storage unit is updated based on a determination result by the final task code determination unit and a final task code determination unit that determines whether the task code is a final task code. Updating means.

本発明によれば、タスク内の処理を複数回に分割して実行するタスクを含む複数のタスクの実行順を同一処理レベルで診断することのできるタスク実行順診断装置を提供することができる。   ADVANTAGE OF THE INVENTION According to this invention, the task execution order diagnostic apparatus which can diagnose the execution order of several tasks containing the task which divides | segments the process in a task into multiple times and can be diagnosed at the same process level can be provided.

本発明の実施形態に係るタスク実行順診断回路が適用されたマイコンの構成を示す構成図。The block diagram which shows the structure of the microcomputer to which the task execution order diagnostic circuit which concerns on embodiment of this invention was applied. 本実施形態に係るファームウェアのタスクの構成を表す概念図。The conceptual diagram showing the structure of the task of the firmware which concerns on this embodiment. 本実施形態に係るファームウェアのタスクの実行順を示す図。The figure which shows the execution order of the task of the firmware which concerns on this embodiment. 本実施形態に係る現在番号レジスタの記憶領域の構造を示す構造図。FIG. 3 is a structural diagram showing a structure of a storage area of a current number register according to the present embodiment. 本実施形態に係る前回番号レジスタの記憶領域の構造を示す構造図。FIG. 3 is a structural diagram showing the structure of a storage area of a previous number register according to the present embodiment. 本実施形態に係る番号管理テーブルの記憶領域の構造を示す構造図。FIG. 3 is a structural diagram showing the structure of a storage area of a number management table according to the present embodiment. 本実施形態に係る前回番号レジスタのデータの更新状態を表すデータ変化図。The data change figure showing the update state of the data of the last number register which concerns on this embodiment. 本実施形態に係るタスクコードを表すデータの構造を示すデータ構造図。The data structure figure which shows the structure of the data showing the task code which concerns on this embodiment. 本実施形態に係るタスクコードを表す拡張されたデータの構造を示すデータ構造図。The data structure figure which shows the structure of the extended data showing the task code which concerns on this embodiment. 本実施形態に係る実行順診断回路の第1の動作を表すタイミングチャート。The timing chart showing the 1st operation of the execution order diagnostic circuit concerning this embodiment. 本実施形態に係る実行順診断回路の第2の動作を表すタイミングチャート。The timing chart showing the 2nd operation of the execution order diagnostic circuit concerning this embodiment. 本実施形態に係る実行順診断回路の第3の動作を表すタイミングチャート。The timing chart showing the 3rd operation of the execution order diagnostic circuit concerning this embodiment.

以下図面を参照して、本発明の実施形態を説明する。   Embodiments of the present invention will be described below with reference to the drawings.

(実施形態)
図1は、本発明の実施形態に係るタスク実行順診断回路2が適用されたマイクロコンピュータ(以下、「マイコン」という。)10の構成を示す構成図である。なお、図面における同一部分には同一符号を付してその詳しい説明を省略し、異なる部分について主に述べる。
(Embodiment)
FIG. 1 is a configuration diagram showing a configuration of a microcomputer (hereinafter referred to as “microcomputer”) 10 to which a task execution order diagnosis circuit 2 according to an embodiment of the present invention is applied. In addition, the same code | symbol is attached | subjected to the same part in drawing, the detailed description is abbreviate | omitted, and a different part is mainly described.

マイコン10は、マイクロプロセッサ1と、実行順診断回路2と、ファームウェア記憶部3と、ワークメモリ4と、メモリマップドI/O5とを備える。マイコン10を構成する各構成部分は、アドレスバスAB及びデータバスDBで接続されている。これにより、各構成部分間の通信を行う。   The microcomputer 10 includes a microprocessor 1, an execution order diagnosis circuit 2, a firmware storage unit 3, a work memory 4, and a memory mapped I / O 5. Each component constituting the microcomputer 10 is connected by an address bus AB and a data bus DB. Thereby, communication between each component part is performed.

マイクロプロセッサ1は、プログラムを実行する演算処理部である。マイクロプロセッサ1は、アドレスバスABによりメモリバスサイクルで対象デバイスのアドレスを出力する。これにより、マイクロプロセッサ1は、読み出し又は書き込みをする対象デバイスを指定する。マイクロプロセッサ1は、データバスDBによりメモリバスサイクルで、対象デバイスとデータの伝送をする。マイクロプロセッサ1は、メモリバスサイクルでコマンドを出力することにより、データの読み出し又は書き込み、及びそのタイミングを指示する。   The microprocessor 1 is an arithmetic processing unit that executes a program. The microprocessor 1 outputs the address of the target device in the memory bus cycle by the address bus AB. Thereby, the microprocessor 1 designates a target device to be read or written. The microprocessor 1 transmits data to and from the target device in a memory bus cycle using the data bus DB. The microprocessor 1 outputs a command in a memory bus cycle to instruct data reading or writing and its timing.

実行順診断回路2は、マイクロプロセッサ1で実行されたファームウェア(プログラム)のタスクの実行順を診断する回路である。実行順診断回路2は、コンピュータで構成されている。実行順診断回路2は、マイクロプロセッサ1が実行順診断回路2にタスクコードの書き込みをするサイクル内で、診断を完了する。タスクコードは、タスク毎に割り当てられたタスクを示す固有のコードである。   The execution order diagnosis circuit 2 is a circuit for diagnosing the execution order of firmware (program) tasks executed by the microprocessor 1. The execution order diagnosis circuit 2 is configured by a computer. The execution order diagnosis circuit 2 completes the diagnosis within a cycle in which the microprocessor 1 writes a task code to the execution order diagnosis circuit 2. The task code is a unique code indicating a task assigned to each task.

ファームウェア記憶部3は、ファームウェアが記憶されたメモリである。ファームウェア記憶部3は、例えば、FROM(flash read only memory)である。   The firmware storage unit 3 is a memory in which firmware is stored. The firmware storage unit 3 is, for example, a FROM (flash read only memory).

ワークメモリ4は、マイクロプロセッサ1が演算処理に用いるデータを一時的に記憶するためのメモリである。ワークメモリ4は、例えば、RAM(random access memory)である。   The work memory 4 is a memory for temporarily storing data used by the microprocessor 1 for arithmetic processing. The work memory 4 is, for example, a RAM (random access memory).

メモリマップドI/O5は、外部回路と伝送するためのインタフェース機能がある回路である。   The memory mapped I / O 5 is a circuit having an interface function for transmission with an external circuit.

次に、実行順診断回路2の構成について説明する。   Next, the configuration of the execution order diagnosis circuit 2 will be described.

実行順診断回路2は、アドレスデコード回路21と、R/W制御回路22と、タイミング回路23と、現在番号レジスタ24と、前回番号レジスタ25と、番号管理テーブル26と、診断回路27と、比較回路28とを備える。   The execution order diagnosis circuit 2 compares the address decode circuit 21, the R / W control circuit 22, the timing circuit 23, the current number register 24, the previous number register 25, the number management table 26, and the diagnosis circuit 27. Circuit 28.

アドレスデコード回路21は、アドレスバスABから受信したアドレスをデコードする。アドレスデコード回路21は、アドレスのデコード結果をR/W制御回路22に出力する。アドレスデコード回路21は、マイコン10のバスインターフェースとして機能する。   The address decoding circuit 21 decodes the address received from the address bus AB. The address decoding circuit 21 outputs the address decoding result to the R / W control circuit 22. The address decode circuit 21 functions as a bus interface for the microcomputer 10.

R/W制御回路22は、マイクロプロセッサ1から受信したコマンド及びアドレスデコード回路21から受信したアドレスのデコード結果に基づいて、実行順診断回路2内のレジスタ又はテーブルに対して、データの読み出し及び書き込みを制御する。   The R / W control circuit 22 reads and writes data to and from the register or table in the execution order diagnosis circuit 2 based on the command received from the microprocessor 1 and the decoding result of the address received from the address decoding circuit 21. To control.

タイミング回路23は、診断回路27及び比較回路28に処理を開始するタイミングを決定する。タイミング回路23は、決定したタイミングで診断回路27及び比較回路28を処理させるための信号を出力する。   The timing circuit 23 determines the timing at which the diagnosis circuit 27 and the comparison circuit 28 start processing. The timing circuit 23 outputs a signal for causing the diagnosis circuit 27 and the comparison circuit 28 to process at the determined timing.

現在番号レジスタ24には、マイクロプロセッサ1により実行される現在のタスクコードが書き込まれる。現在番号レジスタ24に書き込まれたタスクコードの示すタスクが実行順診断回路2による診断対象となる。   In the current number register 24, a current task code executed by the microprocessor 1 is written. The task indicated by the task code written in the current number register 24 becomes a diagnosis target by the execution order diagnosis circuit 2.

前回番号レジスタ25には、診断回路27による診断前の前回のタスクコードが書き込まれる。前回番号レジスタ25に書き込まれているタスクコードは、診断対象となるタスクを診断するためのタスクコードである。従って、前回番号レジスタ25には、必ずしも前回のタスクコードがそのまま保持されているとは限らず、診断に必要な修正が施されていてもよい。   In the previous number register 25, the previous task code before diagnosis by the diagnosis circuit 27 is written. The task code written in the previous number register 25 is a task code for diagnosing a task to be diagnosed. Therefore, the previous number register 25 does not necessarily hold the previous task code as it is, and may be corrected as necessary for diagnosis.

番号管理テーブル26には、初期化時に各階層の最終タスクコードが管理情報としてマイクロプロセッサ1により設定される。最終タスクコードは、各階層で最後に実行されるタスクを示すタスクコードである。   In the number management table 26, the final task code of each layer is set by the microprocessor 1 as management information at the time of initialization. The final task code is a task code indicating a task to be executed last in each layer.

診断回路27は、タイミング回路23から出力されたタイミングTAで、現在番号レジスタ24に保持されている現在のタスクコード及び前回番号レジスタ25に保持されている前回のタスクコードを参照して、ファームウェアのタスクの実行順の妥当性を診断する。診断回路27は、診断後、現在番号レジスタ24に保持されている現在のタスクコードを前回番号レジスタ25に書き込むための転送指令を出力する。これにより、前回番号レジスタ25には、現在のタスクコードが書き込まれる。   The diagnosis circuit 27 refers to the current task code held in the current number register 24 and the previous task code held in the previous number register 25 at the timing TA output from the timing circuit 23, and updates the firmware. Diagnose the validity of the task execution order. After diagnosis, the diagnostic circuit 27 outputs a transfer command for writing the current task code held in the current number register 24 to the previous number register 25. As a result, the current task code is written in the previous number register 25.

比較回路28は、タイミング回路23から出力されたタイミングTBで、番号管理テーブル26の管理情報を参照して、前回番号レジスタ25に保持されている診断の終了した現在のタスクコード(現在番号レジスタ24に保持されているタスクコードと同じ)が最終タスクか否かを判断する。比較回路28は、最終タスクと判断した場合、前回番号レジスタ25に保持されているタスクコードを次回の診断のために初期化する。   The comparison circuit 28 refers to the management information in the number management table 26 at the timing TB output from the timing circuit 23 and refers to the current task code (current number register 24) that has been stored in the previous number register 25 and has been diagnosed. Is the same as the task code held in (1). If the comparison circuit 28 determines that the task is the final task, it initializes the task code held in the previous number register 25 for the next diagnosis.

次に、実行順診断回路2の動作について説明する。図2は、本実施形態に係るファームウェアのタスクT1〜T728の構成を表す概念図である。ここでは、図2に示すタスクT1〜T728の構成を用いて主に説明するが、タスクの構成がどのような構成でも同様である。   Next, the operation of the execution order diagnostic circuit 2 will be described. FIG. 2 is a conceptual diagram showing a configuration of firmware tasks T1 to T728 according to the present embodiment. Here, the description will be given mainly using the configuration of tasks T1 to T728 shown in FIG. 2, but the configuration is the same for any configuration of tasks.

まず、タスクT1〜T728の構成について説明する。   First, the configuration of tasks T1 to T728 will be described.

マイクロプロセッサ1は、最上位階層の第1の階層H1のタスクT1からタスクT9までを順次に繰り返し実行する。   The microprocessor 1 repeatedly executes the tasks T1 to T9 in the first hierarchy H1 of the highest hierarchy in order.

タスクT2、タスクT4、タスクT6、及びタスクT7は、処理が複数回に分割されている。タスクT2は、第2の階層H2で、5つのタスクT21〜T25に分割されている。タスクT4は、第2の階層H2で、3つのタスクT41〜T43に分割されている。タスクT6は、第2の階層H2で、4つのタスクT61〜T64に分割されている。タスクT7は、第2の階層H2で、2つのタスクT71,T72に分割されている。   The tasks T2, T4, T6, and T7 are divided into a plurality of processes. The task T2 is divided into five tasks T21 to T25 in the second hierarchy H2. The task T4 is divided into three tasks T41 to T43 in the second hierarchy H2. The task T6 is divided into four tasks T61 to T64 in the second hierarchy H2. The task T7 is divided into two tasks T71 and T72 in the second hierarchy H2.

タスクT4の第2の階層H2の2つのタスクT41,T43及びタスクT7の第2の階層H2の2つのタスクT71,T72は、さらに処理が複数回に分割されている。第2の階層H2のタスクT41は、第3の階層H3で、3つのタスクT411〜T413に分割されている。第2の階層H2のタスクT43は、第3の階層H3で、6つのタスクT431〜T436に分割されている。第2の階層H2のタスクT71は、第3の階層H3で、3つのタスクT711〜T713に分割されている。第2の階層H2のタスクT72は、第3の階層H3で、8つのタスクT721〜T728に分割されている。   The two tasks T41 and T43 in the second hierarchy H2 of the task T4 and the two tasks T71 and T72 in the second hierarchy H2 of the task T7 are further divided into a plurality of times. The task T41 of the second hierarchy H2 is divided into three tasks T411 to T413 in the third hierarchy H3. The task T43 in the second hierarchy H2 is divided into six tasks T431 to T436 in the third hierarchy H3. The task T71 of the second hierarchy H2 is divided into three tasks T711 to T713 in the third hierarchy H3. The task T72 of the second hierarchy H2 is divided into eight tasks T721 to T728 in the third hierarchy H3.

図3は、マイクロプロセッサ1により実行されるタスクT1〜T728の実行順を表す図である。シーケンス順は、第1の階層H1の各タスクT1〜T9を実行する順番を示している。   FIG. 3 is a diagram showing the execution order of tasks T1 to T728 executed by the microprocessor 1. The sequence order indicates the order in which the tasks T1 to T9 of the first hierarchy H1 are executed.

マイクロプロセッサ1は、タスクT1からタスクT9を順次に実行する。   The microprocessor 1 executes task T1 to task T9 sequentially.

まず、1スキャン目(1巡目)について説明する。   First, the first scan (first round) will be described.

タスクT1は、分割されていないため、タスクT1の実行後、タスクT2が実行される。   Since the task T1 is not divided, the task T2 is executed after the task T1 is executed.

タスクT2は、1スキャン目では、第2の階層H2のタスクT21を実行する。タスクT21は分割されていないため、タスクT21の実行後、タスクT3が実行される。   The task T2 executes the task T21 of the second hierarchy H2 in the first scan. Since the task T21 is not divided, the task T3 is executed after the task T21 is executed.

タスクT3は、分割されていないため、タスクT3の実行後、タスクT4が実行される。   Since the task T3 is not divided, the task T4 is executed after the task T3 is executed.

タスクT4は、1スキャン目では、第2の階層H2のタスクT41を実行する。ここで、タスクT41は、さらに第3の階層H3で分割されている。従って、タスクT41は、第3の階層H3のタスクT411を実行する。タスクT411の実行後、タスクT5が実行される。   The task T4 executes the task T41 of the second hierarchy H2 in the first scan. Here, the task T41 is further divided in the third hierarchy H3. Accordingly, the task T41 executes the task T411 of the third hierarchy H3. After execution of task T411, task T5 is executed.

タスクT5は、分割されていないため、タスクT5の実行後、タスクT6が実行される。   Since the task T5 is not divided, the task T6 is executed after the task T5 is executed.

タスクT6は、1スキャン目では、第2の階層H2のタスクT61を実行する。タスクT61は分割されていないため、タスクT61の実行後、タスクT7が実行される。   The task T6 executes the task T61 of the second hierarchy H2 in the first scan. Since task T61 is not divided, task T7 is executed after execution of task T61.

タスクT7は、1スキャン目では、第2の階層H2のタスクT71を実行する。ここで、タスクT71は、さらに第3の階層H3で分割されている。従って、タスクT71は、第3の階層H3のタスクT711を実行する。タスクT711の実行後、タスクT8が実行される。   The task T7 executes the task T71 of the second hierarchy H2 in the first scan. Here, the task T71 is further divided in the third hierarchy H3. Therefore, the task T71 executes the task T711 of the third hierarchy H3. After execution of task T711, task T8 is executed.

タスクT8は、分割されていないため、タスクT8の実行後、タスクT9が実行される。   Since the task T8 is not divided, the task T9 is executed after the execution of the task T8.

タスクT9は、分割されていないため、タスクT9の実行後、2スキャン目として、タスクT1が実行される。   Since task T9 is not divided, task T1 is executed as the second scan after execution of task T9.

次に、2スキャン目について説明する。   Next, the second scan will be described.

タスクT1の実行後、タスクT2が実行される。タスクT2は、2スキャン目では、第2の階層H2のタスクT22を実行する。タスクT22の実行後、タスクT3が実行される。タスクT3の実行後、タスクT4が実行される。   After execution of task T1, task T2 is executed. The task T2 executes the task T22 of the second hierarchy H2 in the second scan. After execution of task T22, task T3 is executed. After execution of task T3, task T4 is executed.

タスクT4は、2スキャン目では、第2の階層H2の1スキャン目と同じタスクT41を実行する。これは、第2の階層H2の下位に位置する第3の階層H3で分割された全てのタスクT411〜T413の実行が終了していないためである。タスクT41は、2スキャン目では、タスクT412を実行する。タスクT412の実行後、タスクT5が実行される。タスクT5の実行後、タスクT6が実行される。   In the second scan, the task T4 executes the same task T41 as that in the first scan of the second hierarchy H2. This is because the execution of all the tasks T411 to T413 divided in the third hierarchy H3 located below the second hierarchy H2 is not completed. Task T41 executes task T412 in the second scan. After execution of task T412, task T5 is executed. After execution of task T5, task T6 is executed.

タスクT6は、2スキャン目では、第2の階層H2のタスクT62を実行する。タスクT62の実行後、タスクT7が実行される。   The task T6 executes the task T62 of the second hierarchy H2 in the second scan. After execution of task T62, task T7 is executed.

タスクT7は、2スキャン目では、第2の階層H2の1スキャン目と同じタスクT71を実行する。タスクT71は、2スキャン目では、タスクT712を実行する。タスクT712の実行後、タスクT8が実行される。タスクT8の実行後、タスクT9が実行される。タスクT9の実行後、3スキャン目として、タスクT1が実行される。   The task T7 executes the same task T71 as the first scan of the second hierarchy H2 in the second scan. Task T71 executes task T712 in the second scan. After execution of task T712, task T8 is executed. After execution of task T8, task T9 is executed. After the execution of task T9, task T1 is executed as the third scan.

3スキャン目以降も、1スキャン目及び2スキャン目と同様に、図3に示すように、タスクT1〜T728を実行する。   As in the first and second scans, tasks T1 to T728 are also executed after the third scan, as shown in FIG.

図4は、本実施形態に係る現在番号レジスタ24の記憶領域の構造を示す構造図である。   FIG. 4 is a structural diagram showing the structure of the storage area of the current number register 24 according to the present embodiment.

現在番号レジスタ24には、3つの階層H1〜H3にそれぞれ対応した3つの記憶領域RP1,RP2,RP3が割り当てられている。記憶領域RP1には、第1の階層H1のタスク番号が記憶される。記憶領域RP2には、第2の階層H2のタスク番号が記憶される。記憶領域RP3には、第3の階層H3のタスク番号が記憶される。   Three storage areas RP1, RP2, and RP3 corresponding to the three hierarchies H1 to H3 are allocated to the current number register 24, respectively. The storage area RP1 stores the task number of the first hierarchy H1. The storage area RP2 stores the task number of the second hierarchy H2. The storage area RP3 stores the task number of the third hierarchy H3.

ここで、タスク番号は、次のように決められているものとする。   Here, it is assumed that the task number is determined as follows.

第2の階層H2及び第3の階層H3があるタスクについては、各階層H1〜H3のタスク番号をそれぞれの階層において実行される順番の番号とする。また、存在しない階層H2,H3のタスク番号は、‘1’とする。例えば、タスクT431は、第1の階層H1のタスク番号が‘4’、第2の階層H2のタスク番号が‘3’、第3の階層H3のタスク番号が‘1’となる。また、タスク5の第2の階層H2及び第3の階層H3は、‘1’である。なお、タスク番号は、数値に限らず、ビット配列で表されていてもよいし、その他の方法で表されていてもよい。   For tasks with the second hierarchy H2 and the third hierarchy H3, the task numbers of the hierarchies H1 to H3 are the numbers in the order of execution in each hierarchy. Further, the task number of the non-existing layers H2 and H3 is “1”. For example, in the task T431, the task number of the first hierarchy H1 is “4”, the task number of the second hierarchy H2 is “3”, and the task number of the third hierarchy H3 is “1”. Further, the second hierarchy H2 and the third hierarchy H3 of the task 5 are “1”. The task number is not limited to a numerical value but may be represented by a bit arrangement or may be represented by other methods.

次に、現在番号レジスタ24に32ビットの記憶領域がある場合について説明する。   Next, a case where the current number register 24 has a 32-bit storage area will be described.

1ビット目から15ビット目は、記憶領域RP3に、16ビット目から23ビット目は、記憶領域RP2に、24ビット目から31ビット目は、記憶領域RP1に、それぞれ割り当てられている。現在のタスクコードが第3の階層H3のタスクT411である場合、記憶領域RP1に‘4’が書き込まれ、記憶領域RP2に‘1’が書き込まれ、記憶領域RP3に‘1’が書き込まれる。   The 1st to 15th bits are allocated to the storage area RP3, the 16th to 23rd bits are allocated to the storage area RP2, and the 24th to 31st bits are allocated to the storage area RP1, respectively. When the current task code is the task T411 of the third hierarchy H3, “4” is written in the storage area RP1, “1” is written in the storage area RP2, and “1” is written in the storage area RP3.

図5は、本実施形態に係る前回番号レジスタ25の記憶領域の構造を示す構造図である。   FIG. 5 is a structural diagram showing the structure of the storage area of the previous number register 25 according to this embodiment.

前回番号レジスタ25には、第1の階層H1のタスク番号を記憶する記憶領域RN1と、第1の階層H1のタスクT1〜T9の個数分の第2の階層H2及び第3の階層H3のそれぞれのタスク番号を記憶する記憶領域RN12〜RN93とが割り当てられている。   The previous number register 25 includes a storage area RN1 for storing the task number of the first hierarchy H1, and the second hierarchy H2 and the third hierarchy H3 corresponding to the number of tasks T1 to T9 in the first hierarchy H1. Are assigned storage areas RN12 to RN93.

前回番号レジスタ25は、現在番号レジスタ24からタスクコードが転送されてくると、このタスクコードの示すタスクT1〜T728のタスク番号を、対応する記憶領域RN12〜RN93に書き込む。例えば、タスクT724を示すタスクコードが転送されてきた場合、第1の階層H1の記憶領域RN1に‘7’が書き込まれ、タスクT7の第2の階層H2の記憶領域RN72に‘2’が書き込まれ、タスクT7の第3の階層H3の記憶領域RN73に‘4’が書き込まれる。   When the task code is transferred from the current number register 24, the previous number register 25 writes the task numbers of the tasks T1 to T728 indicated by the task code in the corresponding storage areas RN12 to RN93. For example, when the task code indicating the task T724 is transferred, “7” is written in the storage area RN1 of the first hierarchy H1, and “2” is written in the storage area RN72 of the second hierarchy H2 of the task T7. Accordingly, “4” is written in the storage area RN73 of the third hierarchy H3 of the task T7.

図6は、本実施形態に係る番号管理テーブル26の記憶領域の構造を示す構造図である。   FIG. 6 is a structural diagram showing the structure of the storage area of the number management table 26 according to the present embodiment.

番号管理テーブル26には、第1の階層H1の最終タスク番号を記憶する記憶領域RT1と、第2の階層H2の最終タスク番号を記憶する記憶領域RT12〜RT92と、第3の階層H3の最終タスク番号を記憶する記憶領域RT131〜RT931とが割り当てられている。例えば、記憶領域RT1には、第1の階層H1で最後に実行される9番目のタスクT9を示すタスク番号の‘9’が設定されている。記憶領域RT42には、第1の階層H1のタスクT4の第2の階層H2で最後に実行される3番目のタスクT43を示すタスク番号の‘3’が設定されている。また、実行されるタスクが無い階層では、‘1’が設定されている。例えば、第1の階層H1のタスクT5では、第2の階層H2で実行されるタスクは無いため、記憶領域RT52には、‘1’が設定されている。   The number management table 26 includes a storage area RT1 that stores the final task number of the first hierarchy H1, storage areas RT12 to RT92 that store the final task number of the second hierarchy H2, and a final area of the third hierarchy H3. Storage areas RT131 to RT931 for storing task numbers are allocated. For example, a task number “9” indicating the ninth task T9 executed last in the first hierarchy H1 is set in the storage area RT1. In the storage area RT42, a task number “3” indicating the third task T43 to be executed last in the second hierarchy H2 of the task T4 in the first hierarchy H1 is set. Also, “1” is set in the hierarchy where there is no task to be executed. For example, in the task T5 of the first hierarchy H1, there is no task to be executed in the second hierarchy H2, so “1” is set in the storage area RT52.

次に、前回番号レジスタ25のデータの更新について説明する。ここでは、タスクT1〜T728の実行順が全て正常(妥当)である場合について説明する。   Next, update of data in the previous number register 25 will be described. Here, a case where the execution order of tasks T1 to T728 is all normal (valid) will be described.

図7は、本実施形態に係る前回番号レジスタ25のデータの更新状態を表すデータ変化図である。   FIG. 7 is a data change diagram showing a data update state of the previous number register 25 according to the present embodiment.

前回番号レジスタ25は、初期状態では、全ての記憶領域RN1〜RN93に‘0’が書き込まれている。   In the previous number register 25, '0' is written in all the storage areas RN1 to RN93 in the initial state.

現在番号レジスタ24に書き込まれたタスクT1のタスクコードが正常であると判断されると、タスクT1のタスクコードが前回番号レジスタ25に書き込まれる。これにより、第1の階層H1の記憶領域RN1、タスクT1の第2の階層H2の記憶領域RN12及びタスクT1の第3の階層H3の記憶領域RN13に、‘1’が書き込まれる。番号管理テーブル26との比較により、タスクT1の第2の階層H2及び第3の階層H3が最終タスク番号であると判断されると、第2の階層H2の記憶領域RN12及び第3の階層H3の記憶領域RN13は、‘0’に初期化される。   When it is determined that the task code of the task T1 written in the current number register 24 is normal, the task code of the task T1 is written in the previous number register 25. As a result, '1' is written to the storage area RN1 of the first hierarchy H1, the storage area RN12 of the second hierarchy H2 of the task T1, and the storage area RN13 of the third hierarchy H3 of the task T1. If it is determined by comparison with the number management table 26 that the second hierarchy H2 and the third hierarchy H3 of the task T1 are the final task numbers, the storage area RN12 and the third hierarchy H3 of the second hierarchy H2 Storage area RN13 is initialized to '0'.

1スキャン目のタスクT1の実行後、タスクT21が実行されるため、現在番号レジスタ24に、タスクT21のタスクコードが書き込まれる。   Since the task T21 is executed after the execution of the task T1 of the first scan, the task code of the task T21 is written in the current number register 24.

現在番号レジスタ24に書き込まれたタスクT21のタスクコードが正常であると判断されると、タスクT21のタスクコードが前回番号レジスタ25に書き込まれる。これにより、第1の階層H1の記憶領域RN1に‘2’が書き込まれ、タスクT2の第2の階層H2の記憶領域RN22及びタスクT2の第3の階層H3の記憶領域RN23に、‘1’が書き込まれる。番号管理テーブル26との比較により、タスクT2の第3の階層H3が最終タスク番号であると判断されると、階層H3の記憶領域RN23は、‘0’に初期化される。   When it is determined that the task code of the task T21 written in the current number register 24 is normal, the task code of the task T21 is written in the previous number register 25. As a result, “2” is written to the storage area RN1 of the first hierarchy H1, and “1” is written to the storage area RN22 of the second hierarchy H2 of the task T2 and the storage area RN23 of the third hierarchy H3 of the task T2. Is written. If it is determined by comparison with the number management table 26 that the third hierarchy H3 of the task T2 is the final task number, the storage area RN23 of the hierarchy H3 is initialized to “0”.

1スキャン目のタスクT21の実行後、タスクT3が実行されるため、現在番号レジスタ24に、タスクT3のタスクコードが書き込まれる。   Since the task T3 is executed after the execution of the task T21 in the first scan, the task code of the task T3 is written in the current number register 24.

現在番号レジスタ24に書き込まれたタスクT3のタスクコードが正常であると判断されると、タスクT3のタスクコードが前回番号レジスタ25に書き込まれる。これにより、第1の階層H1の記憶領域RN1に‘3’が書き込まれ、タスクT3の第2の階層H2の記憶領域RN32及びタスクT3の第3の階層H3の記憶領域RN33に、‘1’が書き込まれる。番号管理テーブル26との比較により、タスクT3の第2の階層H2及び第3の階層H3が最終タスク番号であると判断されると、第2の階層H2の記憶領域RN22及び第3の階層H3の記憶領域RN23は、‘0’に初期化される。   When it is determined that the task code of the task T3 written in the current number register 24 is normal, the task code of the task T3 is written in the previous number register 25. As a result, “3” is written to the storage area RN1 of the first hierarchy H1, and “1” is written to the storage area RN32 of the second hierarchy H2 of the task T3 and the storage area RN33 of the third hierarchy H3 of the task T3. Is written. If it is determined by comparison with the number management table 26 that the second hierarchy H2 and the third hierarchy H3 of the task T3 are the final task numbers, the storage area RN22 and the third hierarchy H3 of the second hierarchy H2 Storage area RN23 is initialized to '0'.

このようにして、前回番号レジスタ25のデータが順次に更新される。   In this way, the data in the previous number register 25 is sequentially updated.

図8は、本実施形態に係るデータバスDBで伝送されるタスクコードを表すデータDTの構造を示すデータ構造図である。なお、ここでは、データDTの容量を32ビットで説明するが、データDTの容量はいくつでもよい。   FIG. 8 is a data structure diagram showing a structure of data DT representing a task code transmitted through the data bus DB according to the present embodiment. Here, the capacity of the data DT will be described with 32 bits, but the capacity of the data DT may be any number.

データDTは、各階層H1〜H3のタスク番号を表す領域D1〜D3と拡張フラグFLを含む。24ビットから31ビットまでの領域D1は、第1の階層H1のタスク番号を表している。16ビットから23ビットまでの領域D2は、第2の階層H2のタスク番号を表している。1ビットから15ビットまでの領域D3は、第3の階層H3のタスク番号を表している。   Data DT includes areas D1 to D3 representing task numbers of the respective hierarchies H1 to H3 and an extension flag FL. A region D1 from 24 bits to 31 bits represents the task number of the first hierarchy H1. A region D2 from 16 bits to 23 bits represents the task number of the second hierarchy H2. A region D3 from 1 bit to 15 bits represents the task number of the third hierarchy H3.

図8に示すように、シーケンス順に従って、データDTの各領域D1〜D3のタスク番号が変更される。   As shown in FIG. 8, the task numbers of the areas D1 to D3 of the data DT are changed according to the sequence order.

拡張フラグFLは、0ビットに位置する領域である。拡張フラグFLは、データDTを拡張するデータがある場合は‘1’、データDTを拡張するデータがない場合は‘0’である。拡張フラグFLは、第3の階層H3よりも下位の階層がある場合に‘1’になる。従って、図2に示すタスクT1〜T728の実行順の構成では、第3の階層H3よりも下位の階層はないため、拡張フラグFLは、常に‘0’である。   The extension flag FL is an area located at 0 bit. The extension flag FL is “1” when there is data that extends the data DT, and is “0” when there is no data that extends the data DT. The extension flag FL becomes “1” when there is a lower hierarchy than the third hierarchy H3. Therefore, in the configuration of the execution order of the tasks T1 to T728 shown in FIG. 2, since there is no hierarchy lower than the third hierarchy H3, the expansion flag FL is always “0”.

図9は、拡張されたデータDT1〜DT3の構造を示すデータ構造図である。図9を参照して、3つのデータDT1〜DT3に分けて、第1の階層H1から第8の階層H8まであるタスクコードを表す場合について説明する。なお、各階層H1〜H8のタスク番号を表す領域D1〜D8の容量は、3つのデータDT1〜DT3にどのように割り当ててもよい。   FIG. 9 is a data structure diagram showing the structure of the expanded data DT1 to DT3. With reference to FIG. 9, a case will be described in which task codes in the first hierarchy H1 to the eighth hierarchy H8 are divided into three data DT1 to DT3. Note that the capacities of the areas D1 to D8 representing the task numbers of the hierarchies H1 to H8 may be allocated to the three data DT1 to DT3 in any way.

第1のデータDT1は、拡張フラグFLが‘1’になっている点以外は、上述した図8に示すデータDTの構造と同じである。従って、第1のデータDT1には、第1の階層H1から第3の階層H3までのタスク番号を表す領域D1〜D3がある。拡張フラグFLが‘1’であるため、第1のデータDT1を受信した処理部は、第2のデータDT2の受信を待つ。   The first data DT1 is the same as the structure of the data DT shown in FIG. 8 except that the extension flag FL is “1”. Accordingly, the first data DT1 includes areas D1 to D3 representing task numbers from the first hierarchy H1 to the third hierarchy H3. Since the extension flag FL is “1”, the processing unit that has received the first data DT1 waits for the reception of the second data DT2.

第2のデータDT2は、第4の階層H4及び第5の階層H5のそれぞれのタスク番号を表す領域D4,D5と拡張フラグFLを含む。拡張フラグFLが‘1’であるため、第2のデータDT2を受信した処理部は、第3のデータDT3の受信を待つ。   The second data DT2 includes areas D4 and D5 representing the task numbers of the fourth hierarchy H4 and the fifth hierarchy H5, and an extension flag FL. Since the extension flag FL is “1”, the processing unit that has received the second data DT2 waits for reception of the third data DT3.

第3のデータDT3は、第6の階層H6及び第8の階層H8のそれぞれのタスク番号を表す領域D6〜D8と拡張フラグFLを含む。拡張フラグFLが‘0’であるため、第3のデータDT3を受信した処理部は、タスクコードを表すデータの受信処理を終了する。   The third data DT3 includes areas D6 to D8 representing task numbers of the sixth hierarchy H6 and the eighth hierarchy H8, and an extension flag FL. Since the extension flag FL is “0”, the processing unit that has received the third data DT3 ends the process of receiving data representing the task code.

図10は、本実施形態に係る実行順診断回路2の第1の動作を表すタイミングチャートである。第1の動作は、タスクの実行順が正常であり、かつ診断するタスクが最終タスクでない場合の動作である。なお、図中の網掛けの部分は、動作状態が不確定であることを示している。   FIG. 10 is a timing chart illustrating a first operation of the execution order diagnosis circuit 2 according to the present embodiment. The first operation is an operation when the task execution order is normal and the task to be diagnosed is not the final task. The shaded portion in the figure indicates that the operating state is indeterminate.

マイクロプロセッサ1は、実行順診断回路2による診断をする前に、実行順診断回路2を初期化する。具体的には、マイクロプロセッサ1は、番号管理テーブル26に管理情報を書き込み、前回番号レジスタ25に‘0’を書き込む。番号管理テーブル26の管理情報の初期化は、マイコン10の初期化時にファームウェアで設定できるようにしてもよい。   The microprocessor 1 initializes the execution order diagnosis circuit 2 before making a diagnosis by the execution order diagnosis circuit 2. Specifically, the microprocessor 1 writes management information in the number management table 26 and writes “0” in the previous number register 25. The management information in the number management table 26 may be initialized by firmware when the microcomputer 10 is initialized.

マイクロプロセッサ1は、タスクT1〜T728の実行時に、実行するタスクT1〜T728の固有のタスクコードを現在番号レジスタ24に書き込む。   When executing the tasks T1 to T728, the microprocessor 1 writes the unique task codes of the tasks T1 to T728 to be executed in the current number register 24.

具体的には、マイクロプロセッサ1は、タスクT1〜T728の実行時に、現在番号レジスタ24のアドレスをアドレスデコード回路21に出力し、実行順診断回路2にデータを書き込むためのコマンドをR/W制御回路22に出力し、実行するタスクT1〜T728の固有のタスクコードを現在番号レジスタ24に出力する。   Specifically, the microprocessor 1 outputs the address of the current number register 24 to the address decoding circuit 21 when executing the tasks T1 to T728, and performs a R / W control on a command for writing data to the execution order diagnosis circuit 2. It outputs to the circuit 22 and outputs the unique task code of the tasks T1 to T728 to be executed to the current number register 24.

アドレスデコード回路21は、受信したアドレスをデコードし、デコードしたアドレスをR/W制御回路22に出力する。R/W制御回路22は、受信したアドレス及びコマンドに基づいて、現在番号レジスタ24に書き込み指令を出力する。これにより、現在番号レジスタ24に、マイクロプロセッサ1から出力されたタスクコードが書き込まれる。   The address decoding circuit 21 decodes the received address and outputs the decoded address to the R / W control circuit 22. The R / W control circuit 22 outputs a write command to the current number register 24 based on the received address and command. As a result, the task code output from the microprocessor 1 is written in the current number register 24.

現在番号レジスタ24にタスクコードが書き込まれると、R/W制御回路22は、マイクロプロセッサ1にWAIT信号を出力する。これにより、マイクロプロセッサ1のバスサイクルが待機状態になる。また、R/W制御回路22は、実行順を診断させるための診断起動指令をタイミング回路23に出力する。   When the task code is written in the current number register 24, the R / W control circuit 22 outputs a WAIT signal to the microprocessor 1. As a result, the bus cycle of the microprocessor 1 enters a standby state. Further, the R / W control circuit 22 outputs a diagnosis start command for diagnosing the execution order to the timing circuit 23.

タイミング回路23は、診断起動指令を受信すると、実行順診断のシーケンスを制御する。   When the timing circuit 23 receives the diagnosis start command, the timing circuit 23 controls the sequence of the execution order diagnosis.

まず、タイミング回路23は、診断起動指令を受信すると、タイミングTAを診断回路27に出力する。診断回路27は、タイミングTAを受信すると、現在番号レジスタ24に保存されたタスクコードと前回番号レジスタ25に保存されている前回の実行順診断で保存したタスクコードを参照して、実行順が妥当(正常)か否かを診断する。   First, the timing circuit 23 outputs the timing TA to the diagnosis circuit 27 when receiving the diagnosis start command. When receiving the timing TA, the diagnostic circuit 27 refers to the task code stored in the current number register 24 and the task code stored in the previous execution order diagnosis stored in the previous number register 25, and the execution order is valid. Diagnose whether it is normal.

ここで、診断回路27による診断方法について説明する。   Here, a diagnosis method by the diagnosis circuit 27 will be described.

診断回路27は、上位の階層から下位の階層の順番に、現在番号レジスタ24と前回番号レジスタ25がそれぞれ示すタスク番号を比較して診断する。   The diagnosis circuit 27 performs diagnosis by comparing the task numbers indicated by the current number register 24 and the previous number register 25 in order from the upper layer to the lower layer.

まず、診断回路27は、第1の階層H1の診断を次のように行う。   First, the diagnostic circuit 27 performs the diagnosis of the first hierarchy H1 as follows.

診断回路27は、現在番号レジスタ24が示すタスクの第1の階層H1(最上位階層)のタスク番号と、前回番号レジスタ25が示すタスクの第1の階層H1のタスク番号に1を足した値(インクリメントした値)が同じであるか否かを判断する。同じでない場合、診断回路27は、実行順が異常と判断する。   The diagnosis circuit 27 adds 1 to the task number of the first hierarchy H1 (highest hierarchy) of the task indicated by the current number register 24 and the task number of the first hierarchy H1 of the task indicated by the previous number register 25. It is determined whether (incremented value) is the same. If they are not the same, the diagnostic circuit 27 determines that the execution order is abnormal.

診断回路27は、第1の階層H1が正常であると判断した場合、第2の階層H2の診断を次のように行う。   When the diagnosis circuit 27 determines that the first hierarchy H1 is normal, the diagnosis circuit 27 performs the diagnosis of the second hierarchy H2 as follows.

前回番号レジスタ25が示すタスクの第3の階層H3が‘0’である場合、診断回路27は、現在番号レジスタ24が示すタスクの第2の階層H2のタスク番号と、前回番号レジスタ25が示すタスクの第2の階層H2のタスク番号に1を足した値が同じであるか否かを判断する。同じでない場合、診断回路27は、実行順が異常と判断する。   When the third hierarchy H3 of the task indicated by the previous number register 25 is “0”, the diagnosis circuit 27 indicates the task number of the second hierarchy H2 of the task indicated by the current number register 24 and the previous number register 25. It is determined whether or not the value obtained by adding 1 to the task number of the second hierarchy H2 of the task is the same. If they are not the same, the diagnostic circuit 27 determines that the execution order is abnormal.

前回番号レジスタ25が示すタスクの第3の階層H3が‘0’でない場合、診断回路27は、現在番号レジスタ24が示すタスクの第2の階層H2のタスク番号と、前回番号レジスタ25が示すタスクの第2の階層H2のタスク番号が同じであるか否かを判断する。同じでない場合、診断回路27は、実行順が異常と判断する。   When the third hierarchy H3 of the task indicated by the previous number register 25 is not “0”, the diagnostic circuit 27 determines the task number of the second hierarchy H2 of the task indicated by the current number register 24 and the task indicated by the previous number register 25. It is determined whether the task numbers of the second hierarchy H2 are the same. If they are not the same, the diagnostic circuit 27 determines that the execution order is abnormal.

診断回路27は、第2の階層H2が正常であると判断した場合、次のように第3の階層H3の診断をする。   When the diagnosis circuit 27 determines that the second hierarchy H2 is normal, the diagnosis circuit 27 diagnoses the third hierarchy H3 as follows.

診断回路27は、現在番号レジスタ24が示すタスクの第3の階層H3のタスク番号と、前回番号レジスタ25が示すタスクの第3の階層H3のタスク番号に1を足した値が同じであるか否かを判断する。同じでない場合、診断回路27は、実行順が異常と判断する。   Whether the diagnosis circuit 27 has the same value as the task number of the third hierarchy H3 of the task indicated by the current number register 24 and the task number of the third hierarchy H3 of the task indicated by the previous number register 25 plus 1. Judge whether or not. If they are not the same, the diagnostic circuit 27 determines that the execution order is abnormal.

診断回路27は、いずれの階層H1〜H3も異常と判断しなかった場合、実行順が妥当(正常)と判断する。   The diagnosis circuit 27 determines that the execution order is appropriate (normal) when none of the hierarchies H1 to H3 is determined to be abnormal.

診断回路27は、実行順が妥当と診断すると、診断結果をタイミング回路23に出力し、現在番号レジスタ24に保存されているタスクコードを、前回番号レジスタ25に転送させるための転送指令を出力する。これにより、前回番号レジスタ25に保存されているタスクコードが現在番号レジスタ24に保存されているタスクコードに更新される。   When the diagnosis circuit 27 diagnoses that the execution order is valid, the diagnosis circuit 27 outputs a diagnosis result to the timing circuit 23 and outputs a transfer command for transferring the task code stored in the current number register 24 to the previous number register 25. . As a result, the task code stored in the previous number register 25 is updated to the task code stored in the current number register 24.

タイミング回路23は、実行順が妥当とする診断結果を受信すると、タイミングTBを比較回路28に出力する。   The timing circuit 23 outputs the timing TB to the comparison circuit 28 when receiving the diagnosis result that the execution order is valid.

比較回路28は、タイミングTBを受信すると、番号管理テーブル26の管理情報を参照して、前回番号レジスタ25に保存されている診断が終了したタスクコードが最終タスクか否かを判断する。比較回路28は、前回番号レジスタ25に保存されているタスクコードが最終タスクでない(管理情報と不一致)と判断すると、前回番号レジスタ25を初期化しない。比較回路28は、比較が完了すると、比較完了通知をタイミング回路23に出力する。   When the comparison circuit 28 receives the timing TB, the comparison circuit 28 refers to the management information in the number management table 26 to determine whether or not the task code for which the diagnosis stored in the previous number register 25 has been completed is the final task. If the comparison circuit 28 determines that the task code stored in the previous number register 25 is not the final task (mismatch with the management information), the comparison circuit 28 does not initialize the previous number register 25. When the comparison is completed, the comparison circuit 28 outputs a comparison completion notification to the timing circuit 23.

タイミング回路23は、比較完了通知を受信すると、診断完了通知をR/W制御回路22に出力する。R/W制御回路22は、診断完了通知を受信すると、マイクロプロセッサ1のバスサイクルの待機状態を解除する。   When receiving the comparison completion notification, the timing circuit 23 outputs a diagnosis completion notification to the R / W control circuit 22. When the R / W control circuit 22 receives the diagnosis completion notification, the R / W control circuit 22 cancels the standby state of the bus cycle of the microprocessor 1.

図11は、本実施形態に係る実行順診断回路2の第2の動作を表すタイミングチャートである。第2の動作は、タスクの実行順が正常であり、かつ診断するタスクが最終タスクである場合の動作である。なお、図中の網掛けの部分は、動作状態が不確定であることを示している。ここでは、図10に示す第1の動作と異なる部分について主に説明する。   FIG. 11 is a timing chart showing a second operation of the execution order diagnosis circuit 2 according to the present embodiment. The second operation is an operation when the task execution order is normal and the task to be diagnosed is the final task. The shaded portion in the figure indicates that the operating state is indeterminate. Here, the difference from the first operation shown in FIG. 10 will be mainly described.

比較回路28による処理が開始されるまでは、前述した第1の動作と同様である。   Until the processing by the comparison circuit 28 is started, it is the same as the first operation described above.

比較回路28は、前回番号レジスタ25に保存されているタスクコードが最終タスクである(管理情報と一致)と判断すると、前回番号レジスタ25を初期化する。比較回路28は、比較が完了すると、比較完了通知をタイミング回路23に出力する。   When the comparison circuit 28 determines that the task code stored in the previous number register 25 is the final task (matches the management information), the comparison circuit 28 initializes the previous number register 25. When the comparison is completed, the comparison circuit 28 outputs a comparison completion notification to the timing circuit 23.

その他の動作については、第2の動作は、図10に示す第1の動作と同じである。   Regarding other operations, the second operation is the same as the first operation shown in FIG.

図12は、本実施形態に係る実行順診断回路2の第3の動作を表すタイミングチャートである。第3の動作は、タスクの実行順が異常である場合の動作である。なお、図中の網掛けの部分は、動作状態が不確定であることを示している。ここでは、図10に示す第1の動作と異なる部分について主に説明する。   FIG. 12 is a timing chart showing a third operation of the execution order diagnostic circuit 2 according to the present embodiment. The third operation is an operation when the task execution order is abnormal. The shaded portion in the figure indicates that the operating state is indeterminate. Here, the difference from the first operation shown in FIG. 10 will be mainly described.

診断回路27による診断が開始されるまでは、前述した第1の動作と同様である。   Until the diagnosis by the diagnosis circuit 27 is started, the first operation is the same as that described above.

診断回路27は、実行順が異常と診断すると、異常を示す診断結果をタイミング回路23に出力し、前回番号レジスタ25を更新しない。   When the diagnosis circuit 27 diagnoses that the execution order is abnormal, the diagnosis circuit 27 outputs a diagnosis result indicating the abnormality to the timing circuit 23 and does not update the previous number register 25.

タイミング回路23は、異常を示す診断結果を受信すると、実行順異常通知をマイクロプロセッサ1に出力し、診断完了通知をR/W制御回路22に出力する。R/W制御回路22は、診断完了通知を受信すると、マイクロプロセッサ1のバスサイクルの待機状態を解除する。   When the timing circuit 23 receives the diagnosis result indicating the abnormality, the timing circuit 23 outputs an execution order abnormality notification to the microprocessor 1 and outputs a diagnosis completion notification to the R / W control circuit 22. When the R / W control circuit 22 receives the diagnosis completion notification, the R / W control circuit 22 releases the standby state of the microprocessor 1 in the bus cycle.

マイクロプロセッサ1は、実行順異常通知を受信することで、診断結果を得ることができる。実行順異常通知により、マイクロプロセッサ1の割り込み処理を起動することで、マイクロプロセッサ1は、実行順の異常を検出することができる。   The microprocessor 1 can obtain the diagnosis result by receiving the execution order abnormality notification. By starting the interrupt process of the microprocessor 1 by the execution order abnormality notification, the microprocessor 1 can detect an abnormality in the execution order.

本実施形態によれば、番号管理テーブル26により各階層H1〜H3の最終タスクコードを管理情報として一元的に管理することにより、分割された処理をする階層H2,H3のタスクT21〜T728を含む複数のタスクT1〜T728の実行順を各階層H1〜H3で隔てることなく同一処理レベルで診断することができる。   According to the present embodiment, the final task codes of the respective hierarchies H1 to H3 are centrally managed as management information by the number management table 26, thereby including the tasks T21 to T728 of the hierarchies H2 and H3 that perform divided processing. The execution order of the plurality of tasks T1 to T728 can be diagnosed at the same processing level without being separated by the hierarchies H1 to H3.

また、番号管理テーブル26をマイコン10の初期化時に、ファームウェアにより設定することで、タスク実行順を変更したファームウェアでも容易に対応した診断することができる。   Further, by setting the number management table 26 by firmware at the time of initialization of the microcomputer 10, it is possible to easily make a diagnosis corresponding to the firmware whose task execution order has been changed.

さらに、実行順診断回路2は、マイクロプロセッサ1が実行順診断回路2にタスクコードの書き込みをするサイクル内で診断を完了させることで、マイクロプロセッサ1が実行順診断回路2による診断のために待機状態となる時間を最小限に抑えることができる。   Further, the execution order diagnosis circuit 2 waits for the diagnosis by the execution order diagnosis circuit 2 by completing the diagnosis within the cycle in which the microprocessor 1 writes the task code to the execution order diagnosis circuit 2. Time to be in the state can be minimized.

なお、本発明のいくつかの実施形態を説明したが、これらの実施形態は、例として提示したものであり、発明の範囲を限定することは意図していない。これら新規な実施形態は、その他の様々な形態で実施されることが可能であり、発明の要旨を逸脱しない範囲で、種々の省略、置き換え、変更を行うことができる。これら実施形態やその変形は、発明の範囲や要旨に含まれるとともに、特許請求の範囲に記載された発明とその均等の範囲に含まれる。   In addition, although some embodiment of this invention was described, these embodiment is shown as an example and is not intending limiting the range of invention. These novel embodiments can be implemented in various other forms, and various omissions, replacements, and changes can be made without departing from the scope of the invention. These embodiments and modifications thereof are included in the scope and gist of the invention, and are included in the invention described in the claims and the equivalents thereof.

1…マイクロプロセッサ、2…実行順診断回路、3…ファームウェア記憶部、4…ワークメモリ、5…メモリマップドI/O、6…外部回路、10…マイコン、21…アドレスデコード回路、22…R/W制御回路、23…タイミング回路、24…現在番号レジスタ、25…前回番号レジスタ、26…番号管理テーブル、27…診断回路、28…比較回路。   DESCRIPTION OF SYMBOLS 1 ... Microprocessor, 2 ... Execution order diagnostic circuit, 3 ... Firmware memory | storage part, 4 ... Work memory, 5 ... Memory mapped I / O, 6 ... External circuit, 10 ... Microcomputer, 21 ... Address decoding circuit, 22 ... R / W control circuit, 23 ... timing circuit, 24 ... current number register, 25 ... previous number register, 26 ... number management table, 27 ... diagnostic circuit, 28 ... comparison circuit.

Claims (8)

分割された処理をする階層のタスクを含む複数のタスクの実行順を診断する診断装置であって、
診断対象のタスクを示すタスクコードを記憶する第1のタスクコード記憶手段と、
前記診断対象のタスクを診断するためのタスクコードを記憶する第2のタスクコード記憶手段と、
前記階層毎に最後に実行されるタスクを示す最終タスクコードを記憶する最終タスクコード記憶手段と、
前記第2のタスクコード記憶手段に記憶された前記タスクコードに基づいて、前記第1のタスクコード記憶手段に記憶された前記診断対象のタスクを示す前記タスクコードが妥当であるか否かを診断する診断手段と、
前記診断対象のタスクを示す前記タスクコードが前記最終タスクコード記憶手段に記憶された前記最終タスクコードか否かを階層毎に判断する最終タスクコード判断手段と、
前記最終タスクコード判断手段による判断結果に基づいて、前記第2のタスクコード記憶手段に記憶された前記タスクコードを更新する更新手段と
を備えることを特徴とするタスク実行順診断装置。
A diagnostic device for diagnosing the execution order of a plurality of tasks including tasks of a hierarchy that performs divided processing,
First task code storage means for storing a task code indicating a task to be diagnosed;
Second task code storage means for storing a task code for diagnosing the task to be diagnosed;
Final task code storage means for storing a final task code indicating a task to be executed last for each hierarchy;
Based on the task code stored in the second task code storage means, a diagnosis is made as to whether or not the task code indicating the diagnosis target task stored in the first task code storage means is valid. Diagnostic means to
Final task code determining means for determining, for each layer, whether or not the task code indicating the task to be diagnosed is the final task code stored in the final task code storage means;
A task execution order diagnosis apparatus comprising: an update unit that updates the task code stored in the second task code storage unit based on a determination result by the final task code determination unit.
前記最終タスクコード記憶手段は、前記タスクを実行させるファームウェアにより前記最終タスクコードが設定されること
を特徴とする請求項1に記載のタスク実行順診断装置。
2. The task execution order diagnosis apparatus according to claim 1, wherein the final task code storage unit is set with the final task code by firmware that executes the task.
前記第1のタスクコード記憶手段は、前記タスクを実行するプロセッサにより前記診断対象のタスクを示す前記タスクコードが書き込まれ、
前記診断手段は、前記プロセッサによる前記タスクコードの書き込みサイクル内で診断を完了すること
を特徴とする請求項1又は請求項2に記載のタスク実行順診断装置。
The first task code storage means is written with the task code indicating the task to be diagnosed by a processor that executes the task,
The task execution order diagnosis apparatus according to claim 1, wherein the diagnosis unit completes the diagnosis within a write cycle of the task code by the processor.
前記診断手段による診断結果が妥当である場合、前記第1のタスクコード記憶手段に記憶された前記タスクコードを前記第2のタスクコード記憶手段に転送するタスクコード転送手段を備え、
前記更新手段は、前記最終タスクコード判断手段により前記最終タスクコードと判断された場合、前記第2のタスクコード記憶手段に転送された前記タスクコードを初期化すること
を特徴とする請求項1から請求項3のいずれか1項に記載のタスク実行順診断装置。
A task code transfer means for transferring the task code stored in the first task code storage means to the second task code storage means when the diagnosis result by the diagnosis means is valid;
The update means initializes the task code transferred to the second task code storage means when the final task code is determined by the final task code determination means. The task execution order diagnosis apparatus according to claim 3.
分割された処理をする階層のタスクを含む複数のタスクの実行順を診断装置により診断する診断方法であって、
前記診断装置は、診断対象のタスクを示すタスクコードを記憶し、
前記診断装置は、前記診断対象のタスクを診断するためのタスクコードを記憶し、
前記診断装置は、前記階層毎に最後に実行されるタスクを示す最終タスクコードを記憶し、
前記診断装置は、記憶した前記診断対象のタスクを診断するための前記タスクコードに基づいて、記憶した前記診断対象のタスクを示す前記タスクコードが妥当であるか否かを診断し、
前記診断装置は、前記診断対象のタスクを示す前記タスクコードが前記最終タスクコードか否かを階層毎に判断し、
前記診断装置は、前記最終タスクコードか否かの判断結果に基づいて、前記診断対象のタスクを診断するためのタスクコードを更新すること
を含むことを特徴とするタスク実行順診断方法。
A diagnostic method for diagnosing the execution order of a plurality of tasks including a task of a hierarchy that performs divided processing by a diagnostic device,
The diagnostic device stores a task code indicating a task to be diagnosed,
The diagnostic device stores a task code for diagnosing the task to be diagnosed,
The diagnostic device stores a final task code indicating a task to be executed last for each hierarchy,
The diagnosis device diagnoses whether or not the task code indicating the stored task to be diagnosed is valid based on the stored task code for diagnosing the task to be diagnosed.
The diagnostic device determines, for each hierarchy, whether or not the task code indicating the task to be diagnosed is the final task code,
The diagnostic apparatus includes a task execution order diagnostic method, comprising: updating a task code for diagnosing the diagnosis target task based on a determination result of whether or not the final task code.
前記最終タスクコードは、前記タスクを実行させるファームウェアにより設定されること
を特徴とする請求項5に記載のタスク実行順診断方法。
6. The task execution order diagnosis method according to claim 5, wherein the final task code is set by firmware that executes the task.
前記診断対象のタスクを示す前記タスクコードは、前記タスクを実行するプロセッサにより書き込まれ、
前記タスクコードの診断は、前記プロセッサによる前記タスクコードの書き込みサイクル内で完了すること
を特徴とする請求項5に記載のタスク実行順診断方法。
The task code indicating the task to be diagnosed is written by a processor that executes the task,
6. The task execution order diagnosis method according to claim 5, wherein the task code diagnosis is completed within a write cycle of the task code by the processor.
前記診断装置は、前記タスクコードの診断結果が妥当である場合、診断した前記タスクコードを前記診断対象のタスクを診断するための前記タスクコードとして記憶し、
前記診断装置は、診断した前記タスクコードを前記最終タスクコードと判断した場合、記憶した前記診断対象のタスクを診断するための前記タスクコードを初期化すること
を特徴とする請求項5に記載のタスク実行順診断方法。
When the diagnosis result of the task code is valid, the diagnostic device stores the diagnosed task code as the task code for diagnosing the task to be diagnosed,
6. The diagnosis device according to claim 5, wherein when the diagnosed task code is determined as the final task code, the diagnostic device initializes the stored task code for diagnosing the task to be diagnosed. Task execution order diagnosis method.
JP2012241851A 2012-11-01 2012-11-01 Task execution order diagnosis apparatus and task execution order diagnosis method Active JP6081147B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012241851A JP6081147B2 (en) 2012-11-01 2012-11-01 Task execution order diagnosis apparatus and task execution order diagnosis method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012241851A JP6081147B2 (en) 2012-11-01 2012-11-01 Task execution order diagnosis apparatus and task execution order diagnosis method

Publications (2)

Publication Number Publication Date
JP2014092860A true JP2014092860A (en) 2014-05-19
JP6081147B2 JP6081147B2 (en) 2017-02-15

Family

ID=50936908

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012241851A Active JP6081147B2 (en) 2012-11-01 2012-11-01 Task execution order diagnosis apparatus and task execution order diagnosis method

Country Status (1)

Country Link
JP (1) JP6081147B2 (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0916527A (en) * 1995-06-30 1997-01-17 Nippon Telegr & Teleph Corp <Ntt> Method and system for large scale distributed information processing
JP2010009296A (en) * 2008-06-26 2010-01-14 Fujitsu Ltd Software operation monitoring device and method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0916527A (en) * 1995-06-30 1997-01-17 Nippon Telegr & Teleph Corp <Ntt> Method and system for large scale distributed information processing
JP2010009296A (en) * 2008-06-26 2010-01-14 Fujitsu Ltd Software operation monitoring device and method

Also Published As

Publication number Publication date
JP6081147B2 (en) 2017-02-15

Similar Documents

Publication Publication Date Title
US20140032860A1 (en) Semiconductor integrated circuit and method for operating same
US20130254592A1 (en) Semiconductor integrated circuit device and system using the same
CN112231136A (en) SoC chip, method for acquiring repair information, storage medium and electronic equipment
US9734023B2 (en) Semiconductor device with output data selection of lockstepped computing elements based on diagnostic information
JP2011048681A (en) Processor
EP2977907A1 (en) Data storage device, method for storing data, and onboard control device
JP6081147B2 (en) Task execution order diagnosis apparatus and task execution order diagnosis method
JP2015035121A (en) Semiconductor integrated circuit device
JP2013257640A (en) Configuration controller, configuration control method and configuration control program
JP7183884B2 (en) electronic controller
JP4621292B2 (en) Cache control device and cache control method
CN111596199B (en) Test chip, integrated circuit test method and system and detection equipment
US20070047346A1 (en) Semiconductor integrated circuit
CN114610557A (en) Method and device for testing equipment driving unit
JP5774941B2 (en) Configuration device and configuration method
JP2006285913A (en) Memory check device and image forming device
JP2020030507A (en) Multi-core control device
JP4721741B2 (en) Data processing module and message receiving method thereof
JP4286731B2 (en) Buffer device and buffer fault diagnosis method
JP5245617B2 (en) Register control circuit and register control method
JP4522846B2 (en) Data processing module and method for determining candidate message for sending
JP6358122B2 (en) Microcomputer
JPWO2009122700A1 (en) Test apparatus and test method
JP2006293641A (en) Register setting value monitoring module, system, and register setting value monitoring method
JP6631063B2 (en) Electronic equipment

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20150727

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20160531

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20160614

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20160810

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: 20161220

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20170118

R150 Certificate of patent or registration of utility model

Ref document number: 6081147

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313115

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350