JP2013109393A - Information processing device and operation check method for memory protection device - Google Patents

Information processing device and operation check method for memory protection device Download PDF

Info

Publication number
JP2013109393A
JP2013109393A JP2011251606A JP2011251606A JP2013109393A JP 2013109393 A JP2013109393 A JP 2013109393A JP 2011251606 A JP2011251606 A JP 2011251606A JP 2011251606 A JP2011251606 A JP 2011251606A JP 2013109393 A JP2013109393 A JP 2013109393A
Authority
JP
Japan
Prior art keywords
task
memory
access
mmu
control
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
JP2011251606A
Other languages
Japanese (ja)
Other versions
JP5664530B2 (en
Inventor
Tetsuya Taira
哲也 平
Koji Bito
浩司 尾藤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Toyota Motor Corp
Original Assignee
Toyota Motor Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Toyota Motor Corp filed Critical Toyota Motor Corp
Priority to JP2011251606A priority Critical patent/JP5664530B2/en
Publication of JP2013109393A publication Critical patent/JP2013109393A/en
Application granted granted Critical
Publication of JP5664530B2 publication Critical patent/JP5664530B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

PROBLEM TO BE SOLVED: To enable a check as to whether a memory protection device for detecting memory access having no access authority operates normally.SOLUTION: An information processing device includes: a memory; a system program for executing plural tasks each of which accesses the memory; a processor for executing the system program; and a memory protection device that, when a task accesses, from the processor using its authority, an area of the memory of which access authority is not provided to the task, detects the access as memory protection violation. The processor uses the authority of the task to intentionally access the area of the memory of which access authority is not provided to the task, by executing the system program, and determines whether the memory protection device has detected memory protection violation through the access.

Description

本発明は、アクセス権限の無いメモリアクセスを検出するメモリ保護装置を利用した情報処理装置およびメモリ管理装置の動作確認方法に関する。   The present invention relates to an information processing apparatus using a memory protection device that detects memory access without access authority and a method for confirming the operation of a memory management apparatus.

サービスロボットは、外界センサや自己診断装置によって安全状態を常時監視し、何らかの危険を検知した場合に適切な安全制御ロジックを実行することで、機能安全を確保する必要がある。   Service robots must ensure functional safety by constantly monitoring the safety state with external sensors and self-diagnosis devices and executing appropriate safety control logic when any danger is detected.

上述したサービスロボットのほか、運輸機器等の電気的な原理で動作するシステムを対象とした機能安全に関する国際標準としてIEC 61508が制定されている。IEC 61508では、機能安全の確保のために設けられるシステムのことを安全関連系と呼んでいる。IEC 61508は、マイクロプロセッサ及びPLC(Programmable Logic Controller)等のハードウェアとコンピュータプログラム(ソフトウェア)によって安全関連系を構築するための様々な技法を定めている。IEC 61508で定められている技法を用いることで、コンピュータシステムを用いて安全関連系を構築することが可能となる。   In addition to the service robots described above, IEC 61508 has been established as an international standard for functional safety for systems that operate on electrical principles such as transportation equipment. In IEC 61508, a system provided for ensuring functional safety is called a safety-related system. IEC 61508 defines various techniques for constructing a safety-related system using hardware such as a microprocessor and a PLC (Programmable Logic Controller) and a computer program (software). By using the technique defined in IEC 61508, it is possible to construct a safety-related system using a computer system.

一方で、近年、マイクロプロセッサ等のプログラマブル電子機器の処理能力が向上している。このため、マルチタスクOS(Operating System)を利用し、1つのコンピュータシステム上で様々なアプリケーションプログラムを並列実行することで、サービスロボット及び自動車等の機器に搭載されている複数用途のコンピュータシステムを統合することができる。   On the other hand, in recent years, the processing capability of programmable electronic devices such as microprocessors has improved. For this reason, a multi-task OS (Operating System) is used, and various application programs are executed in parallel on one computer system, thereby integrating multiple-use computer systems installed in service robots and automobiles. can do.

例えば特許文献1に、機能安全の確保に関するアプリケーションプログラム(以下、安全関連アプリケーションと呼ぶ)を、その他のアプリケーションプログラム(以下、非安全関連アプリケーションと呼ぶ)と共に1つのコンピュータシステム上で動作させる技術が開示されている。   For example, Patent Literature 1 discloses a technique for causing an application program (hereinafter referred to as a safety-related application) related to ensuring functional safety to operate on one computer system together with other application programs (hereinafter referred to as a non-safety-related application). Has been.

IEC 61508で定められている技法を、安全関連アプリケーションおよび非安全関連アプリケーションを含むソフトウェア全体に適用すると、非安全関連アプリケーションにまで適用する必要性が生じる。このため、ソフトウェア開発コストが増大するという問題がある。   When the technique defined in IEC 61508 is applied to the entire software including safety-related applications and non-safety-related applications, it is necessary to apply even to non-safety-related applications. For this reason, there is a problem that the software development cost increases.

そこで、特許文献1に開示される技術では、システムプログラムのタイム・パーティションニングによって、安全関連アプリケーション(安全監視プログラム及び安全制御プログラム)を非安全関連アプリケーション(通常制御プログラム)から独立させている。このため、通常制御プログラムを安全関連系から除外することができ、コンピュータシステムを用いて構成される安全関連系の低コスト化に寄与することができる。   Therefore, in the technique disclosed in Patent Document 1, safety-related applications (safety monitoring program and safety control program) are made independent from non-safety-related applications (normal control program) by time partitioning of the system program. For this reason, the normal control program can be excluded from the safety-related system, which can contribute to the cost reduction of the safety-related system configured using the computer system.

特開2010−271759号公報JP 2010-271759 A

ここで、特許文献1に開示の技術では、リソース・パーティショニングという技術を採用している。この技術では、実行用メモリ等の固定的な資源をリソースパーティションと言われるパーティションにパーティショニングしている。そして、アプリケーションは、予め割り当てられたリソースパーティションを超えて他のリソースにアクセスすることが禁止される。   Here, the technique disclosed in Patent Document 1 employs a technique called resource partitioning. In this technique, fixed resources such as execution memory are partitioned into partitions called resource partitions. The application is prohibited from accessing other resources beyond the pre-assigned resource partition.

本願出願人は、上述したリソース・パーティショニングを、MMU(Memory Management Unit)又はMPU(Memory Protection Unit)を利用して実現することを検討するにあたり、以下に説明する課題を見出した。以下、その課題について説明する。なお、以下に説明する内容は、本願出願人が新たに検討した内容であって、従来技術を説明したものではない。   The applicant of the present application has found the problems described below when examining the above-described resource partitioning using an MMU (Memory Management Unit) or an MPU (Memory Protection Unit). The problem will be described below. In addition, the content demonstrated below is the content which the present applicant newly examined, and is not what demonstrated the prior art.

タイム・パーティショニングを採用するオペレーティングシステムでは、図17に例示するように、タイムパーティションを切り替えることで、動作するアプリケーションも切り替えられる。図17では、「TP1」、「TP2」、「TP3」は、タイムパーティションを示し、「T1」、「T2」、「T3」のそれぞれは、TP1〜TP3のそれぞれに属するタスクを示している。なお、タスクは、非安全関連アプリケーション又は安全関連アプリケーションを実行することによって生成されているものとする。   In an operating system that employs time partitioning, as illustrated in FIG. 17, the operating application can be switched by switching the time partition. In FIG. 17, “TP1”, “TP2”, and “TP3” indicate time partitions, and “T1”, “T2”, and “T3” indicate tasks belonging to TP1 to TP3, respectively. It is assumed that the task is generated by executing a non-safety related application or a safety related application.

このような場合、アプリケーションの切り替えの組み合わせとして、以下の4パターンが考えられる。
1)非安全関連アプリケーションから安全関連アプリケーション
2)安全関連アプリケーションから安全関連アプリケーション
3)安全関連アプリケーションから非安全関連アプリケーション
4)非安全関連アプリケーションから非安全関連アプリケーション
In such a case, the following four patterns can be considered as combinations of application switching.
1) Non-safety related applications to safety related applications 2) Safety related applications to safety related applications 3) Safety related applications to non-safety related applications 4) Non-safety related applications to non-safety related applications

図17では、TP1に属するT1は、非安全関連アプリケーションによって生成されており、TP2に属するT2は、安全関連アプリケーションによって生成されているものとする。この場合、機能安全上、非安全関連系であるTP1に属するT1は、安全関連系であるTP2のリソースパーティションにアクセスすることを抑止する必要がある。   In FIG. 17, it is assumed that T1 belonging to TP1 is generated by a non-safety related application, and T2 belonging to TP2 is generated by a safety related application. In this case, for functional safety, T1 belonging to TP1, which is a non-safety related system, needs to prevent access to the resource partition of TP2, which is a safety related system.

これに対して、MMU又はMPUが有するメモリ保護機能を利用すれば、タイムパーティションのそれぞれに、そのタイムパーティションに対応するリソースパーティションに対するアクセス権限を付与することで、リソース・パーティショニングを行うことができる。具体的には、図18に示すように、TP1に属するT1には、TP1のリソースパーティションに割り当てられたメモリの領域のみにアクセス可能なアクセス権限を付与し、TP2に属するT2には、TP2のリソースパーティションに割り当てられたメモリの領域のみにアクセス可能なアクセス権限を付与する。このようにすることで、例えば、T1が、T2のリソースパーティションに割り当てられたメモリの領域に対してアクセスした場合に、MMU又はMPUによって、そのアクセスをメモリ保護違反として検出することが可能となる。これによって、あるタイムパーティションに属するタスクが、他のタイムパーティションに割り当てられたリソースパーティションにアクセスすることを抑止することが可能となる。   On the other hand, if the memory protection function of the MMU or MPU is used, resource partitioning can be performed by granting access authority to the resource partition corresponding to the time partition to each time partition. . Specifically, as shown in FIG. 18, T1 belonging to TP1 is given access authority to access only the memory area allocated to the resource partition of TP1, and T2 belonging to TP2 is assigned to TP2 Grant access authority to access only the memory area allocated to the resource partition. In this way, for example, when T1 accesses an area of memory allocated to the resource partition of T2, the access can be detected as a memory protection violation by the MMU or MPU. . This makes it possible to prevent a task belonging to a certain time partition from accessing a resource partition assigned to another time partition.

しかしながら、MMU又はMPUが故障している場合、メモリを適切に保護することができなくなってしまう可能性があるという問題がある。例えば、故障によってメモリ保護機能が適切に動作しなくなってしまった場合には、本来ならアクセス権限が付与されていなかったタスクに対してアクセス権限が付与されてしまい、メモリ保護違反とするべきアクセスを、メモリ保護違反として検出できなくなってしまう可能性があるという問題がある。すなわち、T1が誤って、本来ならT1にアクセス権限が付与されていないメモリの領域にアクセスした場合であっても、メモリ保護違反が検出されず、アクセスが許容されてしまう可能性がある。   However, there is a problem that if the MMU or MPU is out of order, the memory cannot be properly protected. For example, if the memory protection function does not work properly due to a failure, access authority is granted to tasks that were not originally granted access authority, and access that should be considered a memory protection violation There is a problem that it may become impossible to detect as a memory protection violation. That is, even when T1 is erroneously accessed and an area of the memory to which T1 is not originally granted access authority is accessed, there is a possibility that a memory protection violation is not detected and access is permitted.

したがって、システムの信頼性をより向上するためには、このようなMMU又はMPUの異常を検出して、MMU又はMPUが異常な状態のままシステムが動作を継続してしまうことを防止する必要がある。そのためには、MMU又はMPUが正常に動作していることを確認するための仕組みが必要である。しかしながら、MMU又はMPUが正常に動作していることを確認するための技術は見当たらない。   Therefore, in order to further improve the reliability of the system, it is necessary to detect such an abnormality of the MMU or MPU and prevent the system from continuing operation while the MMU or MPU is in an abnormal state. is there. For this purpose, a mechanism for confirming that the MMU or MPU is operating normally is necessary. However, there is no technique for confirming that the MMU or MPU is operating normally.

ここで、MMUとMPUは、アクセス権限の無いメモリアクセスを検出するメモリ保護機能を有する点で共通する。それに対して、一般的に、MMUとMPUは、仮想アドレスを物理アドレスに変換する仮想記憶管理機能を、MMUとMPUのうち、MMUのみが有するという点で異なる。   Here, the MMU and the MPU are common in that they have a memory protection function for detecting a memory access without access authority. On the other hand, generally, the MMU and the MPU are different in that only the MMU of the MMU and the MPU has a virtual storage management function for converting a virtual address into a physical address.

本発明は、上述した知見に基づいてなされたものであって、アクセス権限の無いメモリアクセスを検出するメモリ保護装置が正常に動作しているか否かを確認することが可能となる情報処理装置及びメモリ保護装置の動作確認方法を提供することを目的とする。   The present invention has been made based on the above-described knowledge, and an information processing apparatus capable of confirming whether or not a memory protection device that detects memory access without access authority is operating normally, and An object of the present invention is to provide a method for checking the operation of a memory protection device.

本発明の第1の態様にかかる情報処理装置は、メモリと、それぞれが前記メモリにアクセスする複数のタスクを実行するシステムプログラムと、前記システムプログラムを実行するプロセッサと、前記タスクの権限による前記プロセッサからの前記メモリに対するアクセスが、当該タスクに対してアクセス権限が付与されていない領域に対するアクセスである場合、当該アクセスをメモリ保護違反として検出するメモリ保護装置と、を備え、前記プロセッサは、前記システムプログラムを実行することによって、前記タスクの権限で当該タスクに対してアクセス権限が付与されていない前記メモリの領域に意図的にアクセスし、当該アクセスによって前記メモリ保護装置が前記メモリ保護違反を検出したか否かを判定するものである。   An information processing apparatus according to a first aspect of the present invention includes a memory, a system program that executes a plurality of tasks each accessing the memory, a processor that executes the system program, and the processor that is authorized by the task A memory protection device that detects the access as a memory protection violation when the access to the memory from the access is an access to an area for which the access authority is not granted to the task, and the processor includes the system By executing a program, the memory area where the access authority is not granted to the task is intentionally accessed by the task authority, and the memory protection device detects the memory protection violation by the access. Whether or not.

本発明の第2の態様にかかるメモリ保護装置の動作確認方法は、それぞれがメモリにアクセスする複数のタスクを実行するシステムプログラムを実行するプロセッサからの前記タスクの権限による前記メモリに対するアクセスが、当該タスクに対してアクセス権限が付与されていない領域に対するアクセスである場合、当該アクセスをメモリ保護違反として検出するメモリ保護装置の動作確認方法であって、前記プロセッサが、前記タスクの権限で当該タスクに対してアクセス権限が付与されていない前記メモリの領域に意図的にアクセスするステップと、前記プロセッサが、当該アクセスによって前記メモリ保護装置が前記メモリ保護違反を検出したか否かを判定するステップと、を備えたものである。   The operation check method of the memory protection device according to the second aspect of the present invention is such that access to the memory by the authority of the task from a processor executing a system program that executes a plurality of tasks each accessing the memory is A method for confirming the operation of a memory protection device that detects an access as a memory protection violation when the access is not made to an area to which a task has no access authority. Deliberately accessing an area of the memory to which no access right is granted, and determining whether or not the memory protection device has detected the memory protection violation by the access by the processor; It is equipped with.

上述した本発明の各態様によれば、アクセス権限の無いメモリアクセスを検出するメモリ保護装置が正常に動作しているか否かを確認することが可能となる情報処理装置及びメモリ管理装置の動作確認方法を提供することができる。   According to each aspect of the present invention described above, the operation check of the information processing apparatus and the memory management apparatus that can confirm whether or not the memory protection device that detects a memory access without access authority is operating normally. A method can be provided.

発明の実施の形態1にかかる安全制御装置の構成例を示すブロック図である。It is a block diagram which shows the structural example of the safety control apparatus concerning Embodiment 1 of invention. 発明の実施の形態1におけるタイム・パーティショニングの概念を説明するための図である。It is a figure for demonstrating the concept of the time partitioning in Embodiment 1 of invention. 発明の実施の形態1におけるリソース・パーティショニングの概念を説明するための概念図である。It is a conceptual diagram for demonstrating the concept of the resource partitioning in Embodiment 1 of invention. 発明の実施の形態1におけるパーティションスケジューラとタスクとの関係を示す図である。It is a figure which shows the relationship between the partition scheduler and task in Embodiment 1 of invention. スケジューリングパターンの具体例を示す図である。It is a figure which shows the specific example of a scheduling pattern. スケジューリングパターンの具体例を示す図である。It is a figure which shows the specific example of a scheduling pattern. 発明の実施の形態1にかかるパーティションスケジューラの処理手順の具体例を示すフローチャートである。It is a flowchart which shows the specific example of the process sequence of the partition scheduler concerning Embodiment 1 of invention. 発明の実施の形態1にかかるMMU確認ルーチンの処理手順の具体例を示すフローチャートである。It is a flowchart which shows the specific example of the process sequence of the MMU confirmation routine concerning Embodiment 1 of invention. MMU確認ルーチンの実行タイミングの一例を示す図である。It is a figure which shows an example of the execution timing of a MMU confirmation routine. 発明の実施の形態2におけるパーティションスケジューラとタスクとの関係を示す図である。It is a figure which shows the relationship between the partition scheduler and task in Embodiment 2 of invention. 発明の実施の形態2にかかるパーティションスケジューラの処理手順の具体例を示すフローチャートである。It is a flowchart which shows the specific example of the process sequence of the partition scheduler concerning Embodiment 2 of invention. 発明の実施の形態3にかかる安全制御装置の構成例を示すブロック図である。It is a block diagram which shows the structural example of the safety control apparatus concerning Embodiment 3 of invention. 発明の実施の形態3におけるパーティションスケジューラとタスクとの関係を示す図である。It is a figure which shows the relationship between the partition scheduler and task in Embodiment 3 of invention. スケジューリングパターンの具体例を示す図である。It is a figure which shows the specific example of a scheduling pattern. スケジューリングパターンの具体例を示す図である。It is a figure which shows the specific example of a scheduling pattern. 発明の実施の形態4におけるパーティションスケジューラとタスクとの関係を示す図である。It is a figure which shows the relationship between the partition scheduler and task in Embodiment 4 of invention. その他の実施の形態にかかるパーティションスケジューラとタスクとの関係を示す図である。It is a figure which shows the relationship between the partition scheduler concerning other embodiment, and a task. その他の実施の形態にかかるパーティションスケジューラとタスクとの関係を示す図である。It is a figure which shows the relationship between the partition scheduler concerning other embodiment, and a task. 課題を説明するための図である。It is a figure for demonstrating a subject. 課題を説明するための図である。It is a figure for demonstrating a subject.

以下では、本発明を適用した具体的な実施の形態について、図面を参照しながら詳細に説明する。各図面において、同一要素には同一の符号が付されており、説明の明確化のため、必要に応じて重複説明は省略される。   Hereinafter, specific embodiments to which the present invention is applied will be described in detail with reference to the drawings. In the drawings, the same elements are denoted by the same reference numerals, and redundant description is omitted as necessary for the sake of clarity.

<発明の実施の形態1>
本実施の形態にかかる安全制御装置1は、サービスロボットや運輸機器等に搭載されて機能安全確保のための安全制御を実行する。安全制御装置1は、安全関連アプリケーションと非安全関連アプリケーションを同一のコンピュータシステムで実行するよう構成される。図1は、本実施の形態にかかる安全制御装置1の構成例を示すブロック図である。
<Embodiment 1 of the Invention>
The safety control device 1 according to the present embodiment is mounted on a service robot, a transportation device, or the like, and executes safety control for ensuring functional safety. The safety control device 1 is configured to execute a safety-related application and a non-safety-related application on the same computer system. FIG. 1 is a block diagram illustrating a configuration example of the safety control device 1 according to the present embodiment.

プロセッサ10は、プログラム(命令ストリーム)の取得、命令のデコード、命令のデコード結果に応じた演算処理を行う。なお、図1では、1つのプロセッサ10のみを示しているが、安全制御装置1は、複数のプロセッサ10を有するマルチプロセッサ構成であってもよい。また、プロセッサ10は、マルチコアプロセッサでもよい。プロセッサ10は、システムプログラムとしてのオペレーティングシステム(OS)100を実行することによりマルチプログラミング環境を提供する。マルチプログラミング環境とは、複数のプログラムを定期的に切り替えて実行したり、あるイベントの発生に応じて実行するプログラムを切り替えたりすることによって、複数のプログラムがあたかも並列実行されているような環境を意味する。   The processor 10 performs calculation processing according to acquisition of a program (instruction stream), instruction decoding, and instruction decoding result. Although only one processor 10 is shown in FIG. 1, the safety control device 1 may have a multiprocessor configuration having a plurality of processors 10. The processor 10 may be a multi-core processor. The processor 10 provides a multiprogramming environment by executing an operating system (OS) 100 as a system program. A multi-programming environment is an environment in which multiple programs are executed in parallel by periodically switching and executing multiple programs, or by switching the programs to be executed in response to the occurrence of a certain event. means.

マルチプログラミングは、マルチプロセス、マルチスレッド、マルチタスク等と呼ばれる場合もある。プロセス、スレッド及びタスクは、マルチプログラミング環境で並列実行されるプログラム単位を意味する。本実施の形態のプロセッサ10が具備するマルチプログラミング環境は、マルチプロセス環境でもよいし、マルチスレッド環境でもよい。   Multiprogramming is sometimes called multiprocess, multithread, multitask, and the like. A process, a thread, and a task mean a program unit that is executed in parallel in a multiprogramming environment. The multi-programming environment included in the processor 10 of the present embodiment may be a multi-process environment or a multi-thread environment.

実行用メモリ11は、プロセッサ10によるプログラム実行のために使用されるメモリである。実行用メモリ11には、不揮発性メモリ13からロードされたプログラム(OS100及びアプリケーション101〜103等)、プロセッサ10の入出力データ等が記憶される。なお、プロセッサ10は、プログラムを不揮発性メモリ13から実行用メモリ11にロードすることなく、これらのプログラムを不揮発性メモリ13から直接実行してもよい。   The execution memory 11 is a memory used for program execution by the processor 10. The execution memory 11 stores programs (such as the OS 100 and applications 101 to 103) loaded from the nonvolatile memory 13, input / output data of the processor 10, and the like. The processor 10 may directly execute these programs from the nonvolatile memory 13 without loading the programs from the nonvolatile memory 13 to the execution memory 11.

具体的には、実行用メモリ11は、SRAM(Static Random Access Memory)、DRAM(Dynamic Random Access Memory)等のランダムアクセス可能な揮発性メモリとすればよい。図1の実行用メモリ11は、論理的な構成単位を示している。すなわち、実行用メモリ11は、例えば、複数のSRAMデバイスの組み合わせ、複数のDRAMデバイスの組み合わせ、又はSRAMデバイスとDRAMデバイスの組み合わせでもよい。   Specifically, the execution memory 11 may be a random accessible volatile memory such as SRAM (Static Random Access Memory) or DRAM (Dynamic Random Access Memory). The execution memory 11 in FIG. 1 represents a logical unit. That is, the execution memory 11 may be, for example, a combination of a plurality of SRAM devices, a combination of a plurality of DRAM devices, or a combination of an SRAM device and a DRAM device.

I/Oポート12は、外部デバイスとの間のデータ送受信に使用される。例えば、安全制御装置1がサービスロボットに搭載される場合であれば、外部デバイスは、各種センサ及びサービスロボットを動作させるアクチュエータ等である。この場合、各種センサは、例えば、サービスロボット周囲の障害物を計測可能な視覚センサ、サービスロボットの姿勢を検知するための姿勢センサ、及びサービスロボットのアクチュエータの状態を検知するための回転センタ等のサービスロボットの内外の状態を検出するセンサを含む。   The I / O port 12 is used for data transmission / reception with an external device. For example, when the safety control device 1 is mounted on a service robot, the external device is various sensors and actuators that operate the service robot. In this case, the various sensors include, for example, a visual sensor capable of measuring obstacles around the service robot, a posture sensor for detecting the posture of the service robot, and a rotation center for detecting the state of the actuator of the service robot. It includes a sensor that detects the internal and external status of the service robot.

不揮発性メモリ13は、電力の供給を受けることなく、実行用メモリ11に比べて安定的に記憶内容を維持することが可能なメモリデバイスである。例えば、不揮発性メモリ13は、ROM(Read Only Memory)、フラッシュメモリ、ハードディスクドライブ若しくは光ディスクドライブ、又はこれらの組み合わせである。不揮発性メモリ13は、OS100及びアプリケーション101〜103を格納する。なお、不揮発性メモリ13の少なくとも一部は安全制御装置1から取り外し可能に構成されてもよい。例えば、アプリケーション101〜103が格納されたメモリを取り外し可能としてもよい。また、不揮発性メモリ13の少なくとも一部は、安全制御装置1の外部に配置されてもよい。   The non-volatile memory 13 is a memory device capable of maintaining stored contents more stably than the execution memory 11 without receiving power supply. For example, the nonvolatile memory 13 is a ROM (Read Only Memory), a flash memory, a hard disk drive or an optical disk drive, or a combination thereof. The nonvolatile memory 13 stores the OS 100 and the applications 101 to 103. Note that at least a part of the nonvolatile memory 13 may be configured to be removable from the safety control device 1. For example, the memory storing the applications 101 to 103 may be removable. Further, at least a part of the nonvolatile memory 13 may be disposed outside the safety control device 1.

OS100は、プロセッサ10によって実行されることにより、プロセッサ10及び実行用メモリ11及び不揮発性メモリ13等のハードウェア資源を利用して、タスクスケジューリングを含むタスク管理、割り込み管理、時間管理、資源管理、タスク間同期およびタスク間通信機構の提供等を行う。   The OS 100 is executed by the processor 10 to use task resources including task scheduling, interrupt management, time management, resource management using hardware resources such as the processor 10, the execution memory 11, and the nonvolatile memory 13. Provides inter-task synchronization and inter-task communication mechanism.

さらに、機能安全の確保に関連する安全監視アプリケーション101及び安全制御アプリケーション103の通常制御アプリケーション102からの独立性を高めるため、OS100は、ハードウェア資源を、時間的および空間的に保護する機能を有する。ここで、ハードウェア資源とは、プロセッサ10、実行用メモリ11、I/Oポート12を含む。   Further, in order to increase the independence of the safety monitoring application 101 and the safety control application 103 related to ensuring functional safety from the normal control application 102, the OS 100 has a function of protecting hardware resources temporally and spatially. . Here, the hardware resources include the processor 10, the execution memory 11, and the I / O port 12.

このうち、時間的な保護は、プロセッサ10の実行時間という時間的な資源をパーティショニングすることにより行う。具体的に述べると、時間的な保護は、プロセッサ10の実行時間をパーティショニングし、各パーティション(タイムパーティションと呼ぶ)にタスク(プロセス又はスレッド)を割り当てることにより行う。OS100のスケジューリング機能(パーティションスケジューラ21)は、各タイムパーティション(以下、TPと略称する場合がある。)に割り当てられたタスクに対して、プロセッサ10の実行時間を含む資源の利用を保証する。   Of these, temporal protection is performed by partitioning a temporal resource called the execution time of the processor 10. Specifically, temporal protection is performed by partitioning the execution time of the processor 10 and assigning a task (process or thread) to each partition (referred to as a time partition). The scheduling function (partition scheduler 21) of the OS 100 guarantees the use of resources including the execution time of the processor 10 for tasks assigned to each time partition (hereinafter sometimes referred to as TP).

図2は、タイム・パーティショニングに関する概念図である。図2の例では、予め定められた1サイクル時間を3つのTP1、TP2及びTP3に分割する例を示している。例えば、1サイクル時間を100Tickとした場合、このうち前半の20TickがTP1、中間の30TickがTP2、後半の50TickがTP3と規定される。   FIG. 2 is a conceptual diagram related to time partitioning. In the example of FIG. 2, an example in which a predetermined cycle time is divided into three TP1, TP2, and TP3 is shown. For example, when one cycle time is 100 Tick, the first 20 Tick is defined as TP1, the middle 30 Tick is defined as TP2, and the second 50 Tick is defined as TP3.

また、図2の例では、第1アプリケーション(APL1)〜第4アプリケーション(APL4)が、TP1〜TP3のいずれかに割り当てられている。OS100のスケジューリング機能(パーティションスケジューラ21)は、時間の経過に応じて、TP1〜TP3のいずれをアクティブにするかを選択・決定する。そして、アクティブなTPに割り当てられているアプリケーションが、プロセッサ10で実行される。   In the example of FIG. 2, the first application (APL1) to the fourth application (APL4) are assigned to any one of TP1 to TP3. The scheduling function (partition scheduler 21) of the OS 100 selects / determines which of TP1 to TP3 is activated as time elapses. Then, the application assigned to the active TP is executed by the processor 10.

一方、空間的な保護は、実行用メモリ11及びI/Oポート12を含む固定的な資源をパーティショニングし、各パーティション(リソースパーティションと呼ぶ)にタスクを割り当てることにより行う。OS100のスケジューリング機能(パーティションスケジューラ21)は、予め割り当てられたリソースパーティション(以下、RPと略称する場合がある。)を超えてタスクが他のリソースにアクセスすることを禁止する。   On the other hand, spatial protection is performed by partitioning fixed resources including the execution memory 11 and the I / O port 12 and assigning tasks to each partition (referred to as a resource partition). The scheduling function (partition scheduler 21) of the OS 100 prohibits a task from accessing other resources beyond a pre-assigned resource partition (hereinafter sometimes referred to as RP).

図3は、リソース・パーティショニングに関する概念図である。図3の例では、2つのRP(RP1及びRP2)を示している。RP1には、実行用メモリ11及び不揮発性メモリ13の一部(A領域)と、I/Oポート12の一部(ポートA)が割り当てられている。また、RP2には、実行用メモリ11及び不揮発性メモリ13の他の一部(B領域)と、I/Oポート12の他の一部(ポートB)が割り当てられている。RP1からはRP2に割り当てられたリソースへのアクセスが禁止され、RP2からはRP1に割り当てられたリソースへのアクセスが禁止される。実行用メモリ11におけるリソース・パーティショニングは、後述するMMUのメモリ保護機能を利用して実現される。   FIG. 3 is a conceptual diagram related to resource partitioning. In the example of FIG. 3, two RPs (RP1 and RP2) are shown. A part of the execution memory 11 and the nonvolatile memory 13 (A area) and a part of the I / O port 12 (port A) are allocated to RP1. Further, another part (B area) of the execution memory 11 and the nonvolatile memory 13 and another part (port B) of the I / O port 12 are allocated to RP2. Access from RP1 to the resource assigned to RP2 is prohibited, and access from RP2 to the resource assigned to RP1 is prohibited. Resource partitioning in the execution memory 11 is realized by using the memory protection function of the MMU described later.

なお、全てのリソースがいずれかのRPに排他的に割り当てられる必要はない。つまり、複数のRPによって共有されるリソースがあってもよい。例えば、サービスロボットの安全制御を行う場合、アクチュエータには、通常制御アプリケーション102及び安全制御アプリケーション103の双方からアクセスできる必要がある。よって、通常制御アプリケーション102が属するRPと安全制御アプリケーション103が属するRPによって、アクチュエータを制御するためのI/Oポートを共有するとよい。   Note that not all resources need to be exclusively assigned to any RP. That is, there may be a resource shared by a plurality of RPs. For example, when performing safety control of a service robot, the actuator needs to be accessible from both the normal control application 102 and the safety control application 103. Therefore, the I / O port for controlling the actuator may be shared by the RP to which the normal control application 102 belongs and the RP to which the safety control application 103 belongs.

図1に戻り説明を続ける。アプリケーション101〜103は、OS100及びプロセッサ10によって提供されるマルチプログラミング環境で実行される。このうち、安全監視アプリケーション101は、通常制御アプリケーション102の実行状況の監視と、安全制御アプリケーション103の実行状況の監視と、I/Oポート12への入出力データの監視と、をプロセッサ10に実行させるための命令コードを含む。さらに、安全監視アプリケーション101は、パーティションスケジューラ21への結果通知をプロセッサ10に実行させるための命令コードを含む。つまり、安全監視アプリケーション101は、安全関連アプリケーションである。   Returning to FIG. The applications 101 to 103 are executed in a multiprogramming environment provided by the OS 100 and the processor 10. Among these, the safety monitoring application 101 executes the processor 10 to monitor the execution status of the normal control application 102, monitor the execution status of the safety control application 103, and monitor input / output data to the I / O port 12. Instruction code to make it Further, the safety monitoring application 101 includes an instruction code for causing the processor 10 to execute a result notification to the partition scheduler 21. That is, the safety monitoring application 101 is a safety related application.

また、通常制御アプリケーション102は、サービスロボット等の制御対象に通常の機能・動作を行わせるための制御手順をプロセッサ10に実行させるための命令コードを含む。さらに、通常制御アプリケーション102は、パーティションスケジューラ21への結果通知をプロセッサ10に実行させるための命令コードを含む。つまり、通常制御アプリケーション102は、非安全関連アプリケーションである。   Further, the normal control application 102 includes an instruction code for causing the processor 10 to execute a control procedure for causing a control target such as a service robot to perform a normal function / operation. Further, the normal control application 102 includes an instruction code for causing the processor 10 to execute a result notification to the partition scheduler 21. That is, the normal control application 102 is a non-safety related application.

また、安全制御アプリケーション103は、何らかの異常が検出された場合に対応して、機能安全を確保するために定められた制御手順をプロセッサ10に実行させるための命令コードを含む。さらに、安全制御アプリケーション103は、パーティションスケジューラ21への結果通知をプロセッサ10に実行させるための命令コードを含む。つまり、安全制御アプリケーション103は、安全関連アプリケーションである。   Further, the safety control application 103 includes an instruction code for causing the processor 10 to execute a control procedure determined to ensure functional safety in response to a case where some abnormality is detected. Further, the safety control application 103 includes an instruction code for causing the processor 10 to execute a result notification to the partition scheduler 21. That is, the safety control application 103 is a safety-related application.

MMU14は、メモリ保護機能及び仮想記憶管理機能を有する。メモリ保護機能は、プロセッサ10から実行用メモリ11に対するアクセスを監視して、メモリ保護違反となるアクセスを検出する機能である。プロセッサ10から実行用メモリ11のあるアドレスに対するアクセスがあったときに、そのアクセスがそのアドレスに対するアクセス権限を有しているか否かを判定する。そして、そのアクセスがそのアドレスに対するアクセス権限を有していない場合には、そのアクセスをメモリ保護違反として検出するとともに、メモリ保護違反をプロセッサ10に通知する。また、この場合、MMU14は、実行用メモリ11に対するアクセスを抑止するようにしてもよい。   The MMU 14 has a memory protection function and a virtual memory management function. The memory protection function is a function that monitors accesses from the processor 10 to the execution memory 11 and detects an access that causes a memory protection violation. When an access is made to an address in the execution memory 11 from the processor 10, it is determined whether or not the access has an access right to the address. If the access does not have access authority for the address, the access is detected as a memory protection violation and the processor 10 is notified of the memory protection violation. In this case, the MMU 14 may inhibit access to the execution memory 11.

MMU14は、このメモリ保護機能によって、実行用メモリ11におけるリソース・パーティショニングを実現する。具体的には、図3に例示する場合には、RP1に属するタスクには、RP1に割り当てられた実行用メモリ11の領域のみにアクセス可能なアクセス権限が付与され、RP2に属するタスクには、RP2に割り当てられた実行用メモリ11の領域のみにアクセス可能なアクセス権限が付与される。これによって、例えば、RP1に属するタスクが、RP2に割り当てられた実行用メモリ11の領域に対してアクセスした場合に、MMU14は、そのアクセスをメモリ保護違反として検出する。アクセス権限は、実行用メモリ11のページ単位に付与される。また、1ページのサイズとして、予め任意のサイズを定めることができる。   The MMU 14 realizes resource partitioning in the execution memory 11 by this memory protection function. Specifically, in the case illustrated in FIG. 3, the task belonging to RP1 is given an access authority to access only the area of the execution memory 11 assigned to RP1, and the task belonging to RP2 is assigned to Access authority is granted to access only the area of the execution memory 11 assigned to RP2. Thus, for example, when a task belonging to RP1 accesses an area of the execution memory 11 assigned to RP2, the MMU 14 detects the access as a memory protection violation. The access authority is given to each page of the execution memory 11. Further, an arbitrary size can be determined in advance as the size of one page.

仮想記憶管理機能は、プロセッサ10が実行用メモリ11にアクセスするときに指定された仮想アドレスを、その仮想アドレスに対応する物理アドレスに変換する機能である。すなわち、MMU14は、仮想記憶管理機能によって、プロセッサ10からの仮想アドレスを指定した実行用メモリ11へのアクセスを、その仮想アドレスが示す実行用メモリ11上のアドレスと同一のアドレスを示す物理アドレスを指定した実行用メモリ11へのアクセスに変換して、実行用メモリ11に発行する。   The virtual memory management function is a function for converting a virtual address designated when the processor 10 accesses the execution memory 11 into a physical address corresponding to the virtual address. That is, the MMU 14 accesses the execution memory 11 designated by the virtual address from the processor 10 by the virtual memory management function, and gives a physical address indicating the same address as the address on the execution memory 11 indicated by the virtual address. The access is converted to access to the designated execution memory 11 and issued to the execution memory 11.

ここで、アクセス権限及び仮想アドレスに対応する物理アドレスは、プロセッサ10によって、MMU14が有するTLB(Translation Look-aside Buffer)(図示せず)に設定される。TLBは、例えば、MMU14が有するレジスタ及びメモリ等の記憶装置(図示せず)に格納される。TLBは、複数のエントリを含んでいる。1エントリには、1つのページについての内容が設定される。1エントリには、ASID(アドレス空間識別子:Address Space Identification)、仮想アドレス、その仮想アドレスに対応する物理アドレス、ページに対するアクセス権限等が設定される。   Here, the physical address corresponding to the access authority and the virtual address is set by the processor 10 in a TLB (Translation Look-aside Buffer) (not shown) of the MMU 14. The TLB is stored in a storage device (not shown) such as a register and a memory included in the MMU 14, for example. The TLB includes a plurality of entries. The contents for one page are set in one entry. In one entry, an ASID (Address Space Identification), a virtual address, a physical address corresponding to the virtual address, an access authority to a page, and the like are set.

ASIDは、RPごとに一意に定められた値をとる。なお、本実施の形態では、1つのTPに1つのRPが対応することになるため、ASIDは、TPごとに一意に定められた値ともなる。TLBにおける仮想アドレスとして、仮想アドレスのうち、ページを特定可能な一定の範囲を示す仮想ページ番号が設定されることが一般的である。物理アドレスについても同様である。この場合は、仮想アドレスのうち、仮想ページ番号に該当する範囲を物理ページ番号とされているアドレスに置き換え、その他のオフセットアドレスを示す範囲をそのまま用いることで、仮想アドレスを物理アドレスに変換することができる。アクセス権限としては、データの読み出し権限、データの書き込み権限、及び、データ(命令)の実行権限の有無を設定することができる。すなわち、アクセス権限は、アクセス種別(読み出し、書き込み、又は実行)ごとに、その有無を設定することが可能である。   The ASID takes a value uniquely determined for each RP. In the present embodiment, since one RP corresponds to one TP, the ASID is also a value uniquely determined for each TP. As a virtual address in the TLB, a virtual page number indicating a certain range in which a page can be specified is generally set in the virtual address. The same applies to the physical address. In this case, the virtual address is converted into a physical address by replacing the range corresponding to the virtual page number with the physical page number and using the other offset address range as it is. Can do. As the access authority, data read authority, data write authority, and data (command) execution authority can be set. That is, the access authority can be set for each access type (read, write, or execution).

例えば、実行用メモリ11上のあるページについて、あるTPに属するタスクからのデータの読み出し及び書き込みを許容する場合、エントリには、そのTPに対応するASID、そのページの仮想アドレス、そのページの物理アドレス、及び、読み出し権限及び書き込み権限を有りとしたアクセス権限等が設定される。   For example, when reading and writing of data from a task belonging to a certain TP is permitted for a certain page on the execution memory 11, the entry includes an ASID corresponding to the TP, a virtual address of the page, and a physical of the page. Address, access authority with read authority and write authority, etc. are set.

プロセッサ10は、実行用メモリ11上のあるページ内のあるアドレスに対して、データの読み出し又は書き込みによるアクセスを行う場合、ASID、仮想アドレス、及びアクセス種別(読み出し又は書き込み)を指定したアクセスをMMU14に発行する。すなわち、ASID、仮想アドレス、及びアクセス種別のそれぞれを示す信号がMMU14に出力される。ASIDには、そのアクセスの発行元となったタスクに応じた値が指定される。すなわち、指定されたASIDを参照することで、どのTPに属するタスクの権限でのアクセスかを特定することができる。なお、本実施の形態では、同一のTPに属するタスクからアクセスには同一のASIDが指定されることになる。また、アクセス種別が書き込みである場合は、さらに実行用メモリ11に書き込むデータも指定される。   When the processor 10 accesses a certain address in a page on the execution memory 11 by reading or writing data, the processor 10 performs access specifying the ASID, virtual address, and access type (reading or writing). To issue. That is, a signal indicating each of the ASID, virtual address, and access type is output to the MMU 14. A value corresponding to the task that issued the access is specified for the ASID. That is, by referring to the designated ASID, it is possible to specify which TP belongs to the task with the authority of the task. In the present embodiment, the same ASID is designated for access from tasks belonging to the same TP. If the access type is write, data to be written to the execution memory 11 is also specified.

MMU14は、TLBを参照して、指定されたASIDが設定されており、指定された仮想アドレスに対応する仮想アドレスが設定されており(仮想ページ番号が一致する)、かつ、指定されたアクセス種別の権限が有りに設定されているエントリを検出できた場合、そのアクセスを許容する。この場合、MMU14は、検出したエントリに基づいて、アクセスにおいて指定された仮想アドレスを物理アドレスに変換して、変換後の物理アドレスとアクセス種別を指定したアクセスを実行用メモリ11に発行する。すなわち、物理アドレス及びアクセス種別のそれぞれを示す信号が実行用メモリ11に出力される。また、アクセス種別が書き込みである場合は、さらに実行用メモリ11に書き込むデータも指定される。   The MMU 14 refers to the TLB, the designated ASID is set, the virtual address corresponding to the designated virtual address is set (the virtual page number matches), and the designated access type If an entry that is set to have the right is detected, access is permitted. In this case, the MMU 14 converts the virtual address specified in the access into a physical address based on the detected entry, and issues an access specifying the converted physical address and the access type to the execution memory 11. That is, signals indicating the physical address and the access type are output to the execution memory 11. If the access type is write, data to be written to the execution memory 11 is also specified.

また、プロセッサ10は、実行用メモリ11上のあるページ内のあるアドレスに対して、データ(命令)の実行によるアクセスを行う場合、ASID及び仮想アドレスを指定したアクセスをMMU14に発行する。MMU14は、上述と同様に、アドレスの変換及びアクセス権限のチェックを行う。そして、MMU14は、そのアクセスを許容する場合、変換後の物理アドレスを指定したアクセスを実行用メモリ11に発行する。   Further, the processor 10 issues an access specifying an ASID and a virtual address to the MMU 14 when accessing a certain address in a certain page on the execution memory 11 by executing data (instruction). The MMU 14 performs address conversion and access authority check in the same manner as described above. When the access is permitted, the MMU 14 issues an access specifying the converted physical address to the execution memory 11.

実行用メモリ11は、MMU14からのアクセスに応じて、そのアクセスに応じたデータの処理を行う。具体的には、実行用メモリ11は、読み出し又は書き込みによるアクセスであり、かつ、アクセス種別が読み出しである場合は、指定された物理アドレスのデータをプロセッサ10に出力する。実行用メモリ11は、読み出し又は書き込みによるアクセスであり、かつ、アクセス種別が書き込みである場合は、指定された物理アドレスに、指定されたデータを書き込む。実行用メモリ11は、データ(命令)の実行によるアクセスである場合、指定された物理アドレスのデータをプロセッサ10に出力する。   In response to an access from the MMU 14, the execution memory 11 processes data according to the access. Specifically, the execution memory 11 outputs data of a specified physical address to the processor 10 when the access is performed by reading or writing and the access type is reading. The execution memory 11 writes the specified data to the specified physical address when the access is performed by reading or writing and the access type is writing. The execution memory 11 outputs the data of the designated physical address to the processor 10 when the access is performed by executing the data (instruction).

一方、MMU14は、TLBを参照して、アクセスで指定された仮想アドレスに対応する仮想アドレスが設定されている(仮想ページ番号が一致する)が、指定されたASID及び指定されたアクセス種別の権限が設定されていない場合は、メモリ保護違反を検出する。なお、アクセスで指定された仮想アドレスに対応する仮想アドレスが設定されていない場合は、ページフォルトが検出されることになる。   On the other hand, the MMU 14 refers to the TLB, and a virtual address corresponding to the virtual address specified by access is set (virtual page number matches), but the authority of the specified ASID and the specified access type If is not set, a memory protection violation is detected. Note that when a virtual address corresponding to the virtual address designated by the access is not set, a page fault is detected.

また、MMU14は、その有効/無効をプロセッサ10からの指示で切り替えることが可能である。すなわち、プロセッサ10がMMU14を有効にする旨の指示をMMU14に出力したとき、MMU14はその指示に応じて、上述したメモリ管理機能及び仮想記憶管理機能を有効にする。これによって、上述したメモリ保護違反の検出及びアドレスの変換が行われるようになる。一方、プロセッサ10がMMU14を無効にする旨の指示をMMU14に出力したとき、MMU14はその指示に応じて、上述したメモリ管理機能及び仮想管理機能を無効にする。これによって、上述したメモリ保護違反の検出及びアドレスの変換が行われないようになる。プロセッサ10は、MMU14を無効にしている場合、直接、物理アドレスを指定したアクセスを発行することで、実行用メモリ11に対してアクセスすることが可能である。この場合、MMU14は、アクセスで指定された物理アドレスをそのまま指定したアクセスを実行用メモリ11に発行する。   Further, the MMU 14 can switch the validity / invalidity according to an instruction from the processor 10. That is, when the processor 10 outputs an instruction to enable the MMU 14 to the MMU 14, the MMU 14 enables the memory management function and the virtual storage management function described above according to the instruction. As a result, the above-described memory protection violation and address conversion are performed. On the other hand, when the processor 10 outputs an instruction to invalidate the MMU 14 to the MMU 14, the MMU 14 invalidates the memory management function and the virtual management function described above according to the instruction. As a result, the above-described memory protection violation detection and address conversion are not performed. When the MMU 14 is invalidated, the processor 10 can access the execution memory 11 by issuing an access designating a physical address directly. In this case, the MMU 14 issues an access designating the physical address designated by the access as it is to the execution memory 11.

なお、図1では、MMU14を、プロセッサ10の外部に有する場合について例示したが、プロセッサ10がMMU14を有するようにしてもよい。   Although FIG. 1 illustrates the case where the MMU 14 is provided outside the processor 10, the processor 10 may include the MMU 14.

リセット回路15は、OS100からの信号に基づき、マイクロコントローラ20のリセットを行う。パーティションスケジューラ21からリセット回路15に定期的に送信信号を送信するようにし、リセット回路15は、パーティションスケジューラ21からの送信信号が途絶えた場合に、マイクロコントローラ20をリセットする。例えば、パーティションスケジューラ21は、後述するように、1Tickごとに動作するタイミングで送信信号を送信する。また、OS100で異常を検知した場合、又は、アプリケーション101〜103のいずれかから異常を示す結果通知を受けた場合に、パーティションスケジューラ21がリセット回路15にリセット信号を送信するようにして、それに応じて、リセット回路15がマイクロコントローラ20をリセットするようにしてもよい。このようにすることで、マイクロコントローラ20に不具合が発生した場合に、マイクロコントローラ20をリセットして復旧することができる。   The reset circuit 15 resets the microcontroller 20 based on a signal from the OS 100. A transmission signal is periodically transmitted from the partition scheduler 21 to the reset circuit 15, and the reset circuit 15 resets the microcontroller 20 when the transmission signal from the partition scheduler 21 is interrupted. For example, as will be described later, the partition scheduler 21 transmits a transmission signal at a timing that operates every 1 tick. Further, when an abnormality is detected by the OS 100 or when a result notification indicating an abnormality is received from any of the applications 101 to 103, the partition scheduler 21 transmits a reset signal to the reset circuit 15 and responds accordingly. Thus, the reset circuit 15 may reset the microcontroller 20. By doing in this way, when a malfunction occurs in the microcontroller 20, the microcontroller 20 can be reset and recovered.

続いて以下では、パーティションスケジューラ21と、アプリケーション101〜103の起動により生成されるタスクと、の関係について、図4を用いて説明する。図4は、OS100によって提供されるマルチプログラミング環境で起動される、パーティションスケジューラ21とタスク24、26、28との関係を示す図である。   Subsequently, the relationship between the partition scheduler 21 and the tasks generated by the activation of the applications 101 to 103 will be described with reference to FIG. FIG. 4 is a diagram showing the relationship between the partition scheduler 21 and the tasks 24, 26, and 28 that are activated in the multiprogramming environment provided by the OS 100.

マイクロコントローラ20は、プロセッサ10、実行用メモリ11、I/Oポート12、不揮発性メモリ13等を含む。なお、図4では、マイクロコントローラ20の外部にリセット回路15を備える構成を例示しているが、マイクロコントローラ20の内部にリセット回路15を含む構成としてもよい。   The microcontroller 20 includes a processor 10, an execution memory 11, an I / O port 12, a nonvolatile memory 13, and the like. 4 illustrates a configuration in which the reset circuit 15 is provided outside the microcontroller 20, but a configuration in which the reset circuit 15 is included in the microcontroller 20 may be employed.

マイクロコントローラ20には、外部のクロック源からのクロック信号が供給され、プロセッサ10等は、このクロック信号に基づく所定のタイマー周期で動作する。本実施の形態では、所定のタイマー周期を、1Tickであるとして説明する。このため、プロセッサ10によりOS100が実行されることで、パーティションスケジューラ21が1Tickごとに動作すると共に、各TPにおいて、タスクスケジューラ23、25、27およびタスク(安全監視タスク24、通常制御タスク26、安全制御タスク28)が1Tickごとに動作する。   The microcontroller 20 is supplied with a clock signal from an external clock source, and the processor 10 and the like operate at a predetermined timer cycle based on this clock signal. In the present embodiment, the predetermined timer cycle is described as 1 Tick. For this reason, when the processor 10 executes the OS 100, the partition scheduler 21 operates every 1 Tick, and at each TP, the task schedulers 23, 25, 27 and tasks (safety monitoring task 24, normal control task 26, safety The control task 28) operates every 1 Tick.

パーティションスケジューラ21は、1Tickごとに動作し、TPの切り替え(パーティション・スケジューリング)を行う。パーティションスケジューラ21は、次の1Tickの間にTP1〜TP3のいずれをアクティブにするかを選択・決定する。さらに、パーティションスケジューラ21は、選択したTPに関するタスクスケジューラの動作を開始させる。   The partition scheduler 21 operates every 1 tick and performs TP switching (partition scheduling). The partition scheduler 21 selects and determines which of TP1 to TP3 is activated during the next 1 Tick. Furthermore, the partition scheduler 21 starts the operation of the task scheduler related to the selected TP.

パーティションスケジューラ21によるパーティション・スケジューリングについて具体的に述べると、パーティションスケジューラ21は、スケジューリングテーブル22を参照し、TPの設定を定めたスケジューリングパターンに従って、パーティション・スケジューリングを行う。   More specifically, partition scheduling by the partition scheduler 21 refers to the scheduling table 22 and performs partition scheduling according to a scheduling pattern that defines TP settings.

スケジューリングテーブル22は、TPの切り替え順序およびタイミングを規定したスケジューリングパターンを保持している。スケジューリングテーブル22は、例えば、実行用メモリ11に予め格納されている。なお、スケジューリングテーブル22は、少なくとも2つの異なるスケジューリングパターンを保持している。1つは、安全監視タスク24による異常検知が行われていない場合(つまり通常時)に適用されるスケジューリングパターンである。もう1つは、安全監視タスク24によって異常が検知された場合に適用されるスケジューリングパターンである。以下では、通常時に適用されるスケジューリングパターンを"通常制御スケジューリングパターン"と呼ぶ。また、異常検知時に適用されるスケジューリングパターンを"安全制御スケジューリングパターン"と呼ぶ。   The scheduling table 22 holds a scheduling pattern that defines the TP switching order and timing. For example, the scheduling table 22 is stored in advance in the execution memory 11. The scheduling table 22 holds at least two different scheduling patterns. One is a scheduling pattern that is applied when abnormality detection by the safety monitoring task 24 is not performed (that is, during normal time). The other is a scheduling pattern applied when an abnormality is detected by the safety monitoring task 24. Hereinafter, the scheduling pattern applied in the normal time is referred to as “normal control scheduling pattern”. A scheduling pattern applied at the time of detecting an abnormality is called a “safe control scheduling pattern”.

図5Aは、通常制御スケジューリングパターンの具体例を示している。図5Aでは、通常制御タスク26が属するTP2が1サイクル時間の前半(T1)に割り当てられている。また、安全監視タスク24が属するTP1が1サイクル時間の後半(T2)に割り当てられている。図5Aのスケジューリングパターンによれば、通常制御タスク26と安全監視タスク24が繰り返しスケジューリングされる。   FIG. 5A shows a specific example of the normal control scheduling pattern. In FIG. 5A, TP2 to which the normal control task 26 belongs is assigned to the first half (T1) of one cycle time. In addition, TP1 to which the safety monitoring task 24 belongs is assigned to the second half (T2) of one cycle time. According to the scheduling pattern of FIG. 5A, the normal control task 26 and the safety monitoring task 24 are repeatedly scheduled.

図5Bは、安全制御スケジューリングパターンの具体例を示している。図5Bでは、安全制御タスク28が属するTP3が1サイクル時間の前半(T3)に割り当てられている。また、安全監視タスク24が属するTP1が1サイクル時間の後半(T4)に割り当てられている。図5Bのスケジューリングパターンによれば、安全制御タスク28と安全監視タスク24が繰り返しスケジューリングされる。   FIG. 5B shows a specific example of the safety control scheduling pattern. In FIG. 5B, TP3 to which the safety control task 28 belongs is assigned to the first half (T3) of one cycle time. In addition, TP1 to which the safety monitoring task 24 belongs is assigned to the second half (T4) of one cycle time. According to the scheduling pattern of FIG. 5B, the safety control task 28 and the safety monitoring task 24 are repeatedly scheduled.

図4に戻り説明を続ける。タスクスケジューラ23、25、27は、それぞれが属するTP内でのタスクのスケジューリングを行う。各TP内でのタスクのスケジューリングには、一般的な優先度ベースのスケジューリングを適用すればよい。なお、図4では、各TPはそれぞれ1つのタスクのみを含むものとして図示しているが、1以上のタスクが含まれるようにしてもよい。例えば、通常制御用のTP2内には、通常制御タスクA及び通常制御タスクBの2つのタスクが含まれていてもよい。   Returning to FIG. The task schedulers 23, 25, and 27 perform task scheduling in the TP to which each belongs. For scheduling tasks in each TP, general priority-based scheduling may be applied. In FIG. 4, each TP is illustrated as including only one task, but one or more tasks may be included. For example, the normal control task A and the normal control task B may be included in the normal control TP2.

安全監視タスク24は、安全監視アプリケーション101の起動によって生成されるタスクである。図4の例では、安全監視タスク24は、TP1及びRP1に割り当てられている。安全監視タスク24は、非安全関連アプリケーションである通常制御タスク26の実行状況の監視と、安全関連アプリケーションである安全制御タスク28の実行状況の監視と、I/Oポート12の入出力データを監視する。安全監視タスク24は、自身が属するRP1に割り当てられた実行用メモリ11のリソースを使用しながら、自身の処理を実行するために必要な演算等を行う。さらに、安全監視タスク24は、タスクの実行状況を、パーティションスケジューラ21へ通知する。   The safety monitoring task 24 is a task generated when the safety monitoring application 101 is activated. In the example of FIG. 4, the safety monitoring task 24 is assigned to TP1 and RP1. The safety monitoring task 24 monitors the execution status of the normal control task 26 that is a non-safety related application, monitors the execution status of the safety control task 28 that is a safety related application, and monitors input / output data of the I / O port 12. To do. The safety monitoring task 24 performs calculations necessary for executing its own processing while using the resources of the execution memory 11 assigned to the RP1 to which the safety monitoring task 24 belongs. Furthermore, the safety monitoring task 24 notifies the partition scheduler 21 of the task execution status.

通常制御タスク26は、通常制御アプリケーション102の起動によって生成されるタスクである。図4の例では、通常制御タスク26は、TP2及びRP2に割り当てられている。通常制御タスク26は、サービスロボット等の制御対象に通常の機能・動作を行わせるための制御を行う。通常制御タスク26は、自身が属するRP2に割り当てられた実行用メモリ11のリソースを使用しながら、自身の処理を実行するために必要な演算等を行う。さらに、通常制御タスク26は、タスクの実行状況を、パーティションスケジューラ21へ通知する。   The normal control task 26 is a task generated when the normal control application 102 is activated. In the example of FIG. 4, the normal control task 26 is assigned to TP2 and RP2. The normal control task 26 performs control for causing a control target such as a service robot to perform a normal function / operation. The normal control task 26 performs calculations necessary for executing its own processing while using the resources of the execution memory 11 assigned to the RP 2 to which the normal control task 26 belongs. Further, the normal control task 26 notifies the partition scheduler 21 of the task execution status.

安全制御タスク28は、安全制御アプリケーション103の起動によって生成されるタスクである。図4の例では、安全制御タスク28は、TP3及びRP3に割り当てられている。安全制御タスク28は、何らかの異常が検出された場合に対応して、機能安全を確保するために定められた制御を行う。安全制御タスク28は、自身が属するRP3に割り当てられた実行用メモリ11のリソースを使用しながら、自身の処理を実行するために必要な演算等を行う。さらに、安全制御タスク28は、タスクの実行状況を、パーティションスケジューラ21へ通知する。   The safety control task 28 is a task generated when the safety control application 103 is activated. In the example of FIG. 4, the safety control task 28 is assigned to TP3 and RP3. The safety control task 28 performs control determined to ensure functional safety in response to any abnormality being detected. The safety control task 28 performs calculations necessary for executing its own processing while using the resources of the execution memory 11 assigned to the RP 3 to which the safety control task 28 belongs. Further, the safety control task 28 notifies the partition scheduler 21 of the task execution status.

なお、各タスクからパーティションスケジューラ21へと結果を通知する具体的な構成としては、様々な手法を採用することができる。例えば、タスクがOS100のシステムコール(サービスコール)を呼び出し、OS100を介して、パーティションスケジューラ21に結果を通知することができる。具体的には、例えば、タスク間通信を行うシステムコールを呼び出す。また、例えば、タスクの実行状況に関するフラグを実行用メモリ11に格納するものとして、タスクがその実行状況に応じてフラグの値を設定し、パーティションスケジューラ21がフラグの設定値に応じてタスクの実行状況を判断することもできる。   Various methods can be adopted as a specific configuration for notifying the result from each task to the partition scheduler 21. For example, a task can call a system call (service call) of the OS 100 and notify the partition scheduler 21 of the result via the OS 100. Specifically, for example, a system call for performing communication between tasks is called. Also, for example, assuming that a flag related to the task execution status is stored in the execution memory 11, the task sets a flag value according to the execution status, and the partition scheduler 21 executes the task according to the flag set value. The situation can also be judged.

OS100は、MMU確認ルーチン29を含んでいる。MMU確認ルーチン29は、MMU14が正常に動作できているか否かを確認するルーチンである。具体的には、MMU確認ルーチン29は、メモリの領域に対して、そのメモリの領域に対してアクセス権限が付与されていないタスクの権限で意図的にアクセスを行う。そして、そのアクセスによってMMU14がメモリ保護違反を検出したか否かによって、MMU14が正常に動作しているか否かを判定する。すなわち、このようなアクセスによって、MMU14がメモリ保護違反を検出した場合には、正常にメモリ保護機能が動作していることになり、MMU14が正常に動作していることが確認される。なお、このときのアクセスは、検査対象のページに対して、検査対象とするタスクによる書き込み権限及び読み出し権限を無しに設定して行うことになる。   The OS 100 includes an MMU confirmation routine 29. The MMU confirmation routine 29 is a routine for confirming whether or not the MMU 14 is operating normally. Specifically, the MMU confirmation routine 29 intentionally accesses a memory area with the authority of a task to which no access authority is granted. Whether or not the MMU 14 is operating normally is determined based on whether or not the MMU 14 has detected a memory protection violation by the access. That is, when the MMU 14 detects a memory protection violation by such an access, the memory protection function is operating normally, and it is confirmed that the MMU 14 is operating normally. Note that the access at this time is performed without setting the write authority and the read authority by the task to be inspected with respect to the inspection target page.

上述したように、パーティションスケジューラ21が1Tickごとに動作し、TP1〜TP3のいずれをアクティブにするかを選択・決定する。さらに、パーティションスケジューラ21が、選択したTPに関するタスクスケジューラの動作を開始させる。そして、タスクスケジューラ23、25、27が動作を開始することでタスクのスケジューリングが行われ、プロセッサ10が、タスクスケジューラ23、25、27によりスケジューリングされた順序に従って、TP内でのタスクを実行していく。これによって、アクティブなTPに割り当てられているアプリケーションが、プロセッサ10で実行される。   As described above, the partition scheduler 21 operates every 1 Tick, and selects and determines which of TP1 to TP3 is activated. Further, the partition scheduler 21 starts the operation of the task scheduler related to the selected TP. Then, task scheduling is performed by the task schedulers 23, 25, and 27 starting operations, and the processor 10 executes the tasks in the TP according to the order scheduled by the task schedulers 23, 25, and 27. Go. As a result, the application assigned to the active TP is executed by the processor 10.

続いて以下では、パーティションスケジューラ21によるパーティション・スケジューリングについて、図6を用いて説明する。図6は、発明の実施の形態1にかかるパーティションスケジューラ21の処理手順の具体例を示すフローチャートである。   Next, partition scheduling by the partition scheduler 21 will be described below with reference to FIG. FIG. 6 is a flowchart showing a specific example of the processing procedure of the partition scheduler 21 according to the first embodiment of the invention.

なお、図6では、通常制御スケジューリングパターン(例えば図5A)または安全制御スケジューリングパターン(例えば図5B)に従って、スケジューリングを実行する場合を例に説明する。すなわち、TP2またはTP3に続く次のTPはTP1であり、かつ、TP2での異常がTP1で検知された場合に、TP1からの結果を受けて次に選択・決定されるTPはTP3である場合を例に説明する。   Note that FIG. 6 illustrates an example in which scheduling is performed according to a normal control scheduling pattern (for example, FIG. 5A) or a safety control scheduling pattern (for example, FIG. 5B). That is, when the next TP following TP2 or TP3 is TP1, and when an abnormality in TP2 is detected in TP1, the next TP selected and determined based on the result from TP1 is TP3 Will be described as an example.

OS100は、1Tick経過するごとに(S11)、パーティションスケジューラ21を起動する(S12)。パーティションスケジューラ21は、スケジューリングパターンを参照して、TPの切り替えタイミングか否かを判定する(S13)。   The OS 100 starts the partition scheduler 21 every time one tick elapses (S11) (S12). The partition scheduler 21 refers to the scheduling pattern and determines whether or not it is TP switching timing (S13).

TPの切り替えタイミングでないと判定した場合(S13でNo)、パーティションスケジューラ21は、同一のTPXについての動作を継続させる。このため、TPの切り替えタイミングとなるまでの間、S11〜S13、S15、S16の処理が繰り返される。ここで、変数XはTPの番号を示し、Xは1〜3のうちのいずれかの値となる。すなわち、通常制御スケジューリングパターンに従ってパーティション・スケジューリングを実施している場合は、安全制御用のTP3を除いた、TP2及びTP1のいずれかを動作させる。   If it is determined that it is not the TP switching timing (No in S13), the partition scheduler 21 continues the operation for the same TPX. For this reason, the processes of S11 to S13, S15, and S16 are repeated until the TP switching timing is reached. Here, the variable X indicates the number of TP, and X is any one of 1 to 3. That is, when partition scheduling is performed according to the normal control scheduling pattern, either TP2 or TP1 except for TP3 for safety control is operated.

一方、TPの切り替えタイミングであると判定した場合(S13でYes)、パーティションスケジューラ21は、TPの切り替えを実行する(S14)。このように、パーティションスケジューラ21は、次にアクティブにするTPを変更する(S13でYes)場合には、さらに、切り替え前のTPに属するタスクからの通知結果に応じて、切り替え前のTPが正常であったか否かを判断する。判断の結果、切り替え前のTPが異常であった場合、パーティションスケジューラ21は、次の1Tickの間にアクティブにするTPXを、安全制御スケジューリングパターンに従って、TP1及びTP3のいずれかから選択・決定する。判断の結果、正常であった場合、パーティションスケジューラ21は、次の1Tickの間にアクティブにするTPXを、通常制御スケジューリングパターンに従って、TP1及びTP2のいずれかを選択・決定する。   On the other hand, when it is determined that it is TP switching timing (Yes in S13), the partition scheduler 21 executes TP switching (S14). As described above, when the partition scheduler 21 changes the TP to be activated next (Yes in S13), the partition TP before switching is normal according to the notification result from the task belonging to the TP before switching. It is determined whether or not. If the TP before switching is abnormal as a result of the determination, the partition scheduler 21 selects and determines the TPX to be activated during the next 1 Tick from either TP1 or TP3 according to the safety control scheduling pattern. As a result of the determination, if it is normal, the partition scheduler 21 selects and determines one of TP1 and TP2 in accordance with the normal control scheduling pattern for TPX to be activated during the next 1 Tick.

パーティションスケジューラ21は、現在アクティブになっているTPXのタスクスケジューラを動作させる(S15)。S15で動作を開始したTPXのタスクスケジューラは、TPX内のタスクを優先度に応じて実行する(S16)。   The partition scheduler 21 operates the task scheduler of the currently active TPX (S15). The task scheduler of TPX that started the operation in S15 executes the task in TPX according to the priority (S16).

そして、1Tickが経過すると(S11)、パーティションスケジューラ21が、再びTPのスケジューリングを開始する(S12)。すなわち、パーティションスケジューラ21は、スケジューリングパターンに従って、次の1Tickの間にいずれのTPをアクティブにするかを選択・決定する。   When 1 Tick elapses (S11), the partition scheduler 21 starts TP scheduling again (S12). That is, the partition scheduler 21 selects and determines which TP is to be activated during the next 1 Tick according to the scheduling pattern.

図6で示した処理に関して、パーティション・スケジューリングの具体例を説明する。まず、図5Aに例示した通常制御スケジューリングパターンに従って、S15においてTP2がアクティブの状態からスケジューリングを開始した場合を説明する。この場合、S15ではTPX=TP2として開始し、続くS16、S11〜S13にかけてもTPX=TP2のままである。そして、S13でNoが続く限り、TPX=TP2の状態が維持される。S13でYesとなり、S14でTP2からTP1へと変更された場合、続くS15〜S16、S11〜S13にかけてTP1のままである。そして、S13でNoが続く限り、TPX=TP1の状態が維持される。TP1がアクティブのときに、S16で、TP2に関する実行状況(データ入出力等)が正常であると判定されていた場合には、次のS14では、TPX=TP2となる(つまり、TP2から開始する通常制御スケジューリングパターンが継続される。)。一方で、S16で、TP2に関する実行状況(データ入出力等)が異常であると判定されていた場合には、次のS14で、TPX=TP3となる(つまり、TP3から開始する安全制御スケジューリングパターンに切り替わる。)。   A specific example of partition scheduling will be described with respect to the processing shown in FIG. First, according to the normal control scheduling pattern illustrated in FIG. 5A, the case where scheduling is started from the active state of TP2 in S15 will be described. In this case, TPX = TP2 is started in S15, and TPX = TP2 remains even in subsequent S16 and S11 to S13. And as long as No continues in S13, the state of TPX = TP2 is maintained. If S13 is Yes and TP2 is changed to TP1 in S14, TP1 remains in S15 to S16 and S11 to S13. As long as No continues in S13, the state of TPX = TP1 is maintained. When it is determined in S16 that the execution status (data input / output, etc.) related to TP2 is normal when TP1 is active, TPX = TP2 in the next S14 (that is, start from TP2). Normal control scheduling pattern continues.) On the other hand, if it is determined in S16 that the execution status (data input / output, etc.) relating to TP2 is abnormal, TPX = TP3 (that is, a safety control scheduling pattern starting from TP3) in the next S14. Switch to.)

また、図5Bに例示した安全制御スケジューリングパターンに従って、S15においてTP3がアクティブの状態からスケジューリングを開始した場合を説明する。この場合、S15ではTPX=TP3として開始し、続くS16、S11〜S13にかけてもTPX=TP3のままである。そして、S13でNoが続く限り、TPX=TP3の状態が維持される。S13でYesとなり、S14でTP3からTP1へと変更された場合、続くS15〜S16、S11〜S13にかけてTP1のままである。そして、S13でNoが続く限り、TPX=TP1の状態が維持される。TP1がアクティブのときに、S16で、TP3に関する実行状況(データ入出力等)が正常であると判定されていた場合には、次のS14では、TPX=TP2とする(つまり、TP2から開始する通常制御スケジューリングパターンに切り替わる。)。一方で、S16で、TP3に関する実行状況(データ入出力等)に異常があると判定されていた場合には、次のS14で、TPX=TP3となる(つまり、TP3から開始する安全制御スケジューリングパターンが継続される。)。   Further, a case will be described in which scheduling is started from the active state of TP3 in S15 according to the safety control scheduling pattern illustrated in FIG. 5B. In this case, TPX = TP3 is started in S15, and TPX = TP3 remains even in subsequent S16 and S11 to S13. And as long as No continues in S13, the state of TPX = TP3 is maintained. If the answer is Yes in S13 and the TP3 is changed to TP1 in S14, TP1 remains as it is in subsequent S15 to S16 and S11 to S13. As long as No continues in S13, the state of TPX = TP1 is maintained. When it is determined in S16 that the execution status (data input / output, etc.) relating to TP3 is normal when TP1 is active, TPX = TP2 is set in the next S14 (that is, starting from TP2). Switch to normal control scheduling pattern.) On the other hand, if it is determined in S16 that there is an abnormality in the execution status (data input / output, etc.) related to TP3, TPX = TP3 (that is, a safety control scheduling pattern starting from TP3) in the next S14. Will continue.)

なお、上述の例では、スケジューリングパターンとして、3つのTP(安全監視用のTP1、通常制御用のTP2、安全制御用のTP3)のみを組み合わせた場合を例に説明したが、TP2のような通常制御用パーティションや、TP3のような安全制御用パーティションについては、それぞれ複数個存在するものとしてもよい。例えば、2つの通常制御用のTP2及びTP4と、安全監視用のTP1と、2つの安全制御用のTP3及びTP5と、が存在し、これら5つのTP(TP1〜TP5)を組み合わせてスケジューリングパターンを構成してもよい。この場合、S14では、パーティションスケジューラ21が、TPXに関する実行状況(データ入出力等)の異常状態の種類を判定し、その異常種類に応じて、安全制御用のTP3またはTP5のいずれかを選択すればよい。また、S14では、通常制御用のTP2またはTP4のいずれかを選択すればよい。   In the above-described example, a case where only three TPs (safety monitoring TP1, normal control TP2 and safety control TP3) are combined as a scheduling pattern has been described as an example. There may be a plurality of control partitions and safety control partitions such as TP3. For example, there are two TP2 and TP4 for normal control, TP1 for safety monitoring, and two TP3 and TP5 for safety control, and these five TPs (TP1 to TP5) are combined to form a scheduling pattern. It may be configured. In this case, in S14, the partition scheduler 21 determines the type of the abnormal state of the execution status (data input / output, etc.) related to TPX, and selects either TP3 or TP5 for safety control according to the abnormal type. That's fine. In S14, either TP2 or TP4 for normal control may be selected.

上述したように、本実施の形態では、OS100は、安全監視用のTP1からの通知、または、各TPからの通知に応じて、次にアクティブとするパーティションを選択・決定するパーティションスケジューラ21を備えている。パーティションスケジューラ21は、各TPにおいて実行されるタスクとは独立して、所定のタイマー周期で動作する。   As described above, in this embodiment, the OS 100 includes the partition scheduler 21 that selects and determines the partition to be activated next in response to a notification from the TP1 for safety monitoring or a notification from each TP. ing. The partition scheduler 21 operates at a predetermined timer period independently of the tasks executed in each TP.

独立に動作するパーティションスケジューラ21が、全てのTPから結果通知を受ける構成とすることで、パーティションスケジューラ21は、全てのTPに関する状況を一元的に把握することができる。このため、例えば、安全監視用のTP1からの結果通知に応じて、パーティションスケジューラ21が次のパーティションを決定・選択しようとする場合には、パーティションスケジューラ21は、各TPの状況を考慮した上で、正常状態にあるTPのみから次のパーティションを決定・選択することもできる。これによれば、より正確なパーティション・スケジューリングを実現することができるという効果を奏する。   With the configuration in which the partition scheduler 21 that operates independently receives the result notification from all TPs, the partition scheduler 21 can centrally grasp the situation regarding all TPs. Therefore, for example, when the partition scheduler 21 decides and selects the next partition in response to the result notification from the safety monitoring TP1, the partition scheduler 21 considers the situation of each TP. The next partition can be determined and selected only from the TP in the normal state. According to this, there is an effect that more accurate partition scheduling can be realized.

続いて、MMU確認ルーチン29によるMMU確認処理について、図7を用いて説明する。図7は、発明の実施の形態1にかかるMMU確認ルーチン29の処理手順の具体例を示すフローチャートである。OS100がMMU確認ルーチン29を実行することによって、以下に説明する処理手順が実行されることになる。なお、厳密には、以下に説明する処理は、OS100を実行するプロセッサ10によって実行されることになる。   Next, the MMU confirmation process by the MMU confirmation routine 29 will be described with reference to FIG. FIG. 7 is a flowchart showing a specific example of the processing procedure of the MMU confirmation routine 29 according to the first embodiment of the invention. When the OS 100 executes the MMU confirmation routine 29, the processing procedure described below is executed. Strictly speaking, the processing described below is executed by the processor 10 that executes the OS 100.

OS100は、検査対象とするTBLのエントリに格納されたデータのバックアップをとる(S21)。ここで、バックアップしたデータは、実行用メモリ11に格納するようにしてもよく、不揮発性メモリ13に格納するようにしてもよい。   The OS 100 backs up data stored in the TBL entry to be inspected (S21). Here, the backed up data may be stored in the execution memory 11 or may be stored in the nonvolatile memory 13.

OS100は、検査対象のエントリに、検査対象のページに関する内容を設定する。具体的には、検査対象のエントリに、検査対象のタスクのASID、検査対象のページの仮想アドレス、検査対象のページの物理アドレス、並びに、読み出し権限、書き込み権限、及び実行権限を無しとしたアクセス権限等を設定する(S22)。なお、設定するアクセス権限は、ここで例示したパターンに限られない。すなわち、検査対象とするアクセス種別のみを権限無しに設定すればよい。例えば、読み出し権限について、正常にアクセス保護違反が検出されるか否かを検査する場合は、少なくとも読み出し権限のみを無しに設定すればよい。   The OS 100 sets contents regarding the inspection target page in the inspection target entry. Specifically, access to the entry to be inspected without the ASID of the task to be inspected, the virtual address of the page to be inspected, the physical address of the page to be inspected, and the read, write, and execution rights Authority and the like are set (S22). The access authority to be set is not limited to the pattern exemplified here. That is, only the access type to be inspected may be set without authority. For example, in the case of checking whether or not an access protection violation is normally detected for the read authority, at least the read authority may be set to none.

OS100は、検査対象のページの境界にアクセス(読み出し、書き込み又は実行)する(S23)。具体的には、OS100は、先頭と末尾のそれぞれにアクセスする。ここで、ページの先頭と末尾には、例えば4ワード等の予め任意に定めた固定長の範囲でアクセスするものとする。   The OS 100 accesses (reads, writes, or executes) the boundary of the inspection target page (S23). Specifically, the OS 100 accesses each of the beginning and the end. Here, it is assumed that the beginning and the end of the page are accessed within a predetermined fixed length range such as 4 words.

OS100は、S11において、バックアップしたデータを、検査対象のエントリに復元する(S24)。そして、OS100は、S13におけるアクセスで、メモリ保護違反が検出されたか否かを判定する(S25)。すなわち、OS100は、MMU14からメモリ保護違反が通知されたか否かを判定する。   The OS 100 restores the data backed up in S11 to the entry to be inspected (S24). Then, the OS 100 determines whether or not a memory protection violation has been detected in the access in S13 (S25). That is, the OS 100 determines whether or not a memory protection violation is notified from the MMU 14.

OS100は、メモリ保護違反が検出された場合(S25でYes)、MMU14が正常に動作していると判定する(S26)。この場合、OS100は、通常の処理(パーティションスケジューラ21、タスクスケジューラ23、25、27、タスク24、26、28の実行等)の実行を継続する(S27)。一方、OS100は、メモリ保護違反が検出されなかった場合(S25でNo)、MMU14が正常に動作していないと判定する(S28)。この場合、OS100は、緊急停止ルーチンを実行する。   When a memory protection violation is detected (Yes in S25), the OS 100 determines that the MMU 14 is operating normally (S26). In this case, the OS 100 continues execution of normal processing (partition scheduler 21, task scheduler 23, 25, 27, execution of tasks 24, 26, 28, etc.) (S27). On the other hand, when no memory protection violation is detected (No in S25), the OS 100 determines that the MMU 14 is not operating normally (S28). In this case, the OS 100 executes an emergency stop routine.

ここで、緊急停止ルーチンは、制御対象の安全を確保するために、制御対象を緊急停止させる処理となる。例えば、図5Aに示す通常制御スケジューリングパターンに従って動作している場合、スケジューリングパターンを、図5Bに示す安全制御スケジューリングパターンに切り替えるようにしてもよい。また、パーティションスケジューラ21の次の動作タイミングで、TPを強制的にTP3に切り替えるようにしてもよい。そして、TP3へ切り替えた後は、例えば、安全制御タスク28によって制御対象を停止させる。また、OS100は、直接、制御対象を停止させるように制御するようにしてもよい。   Here, the emergency stop routine is a process for stopping the control target in an emergency in order to ensure the safety of the control target. For example, when operating according to the normal control scheduling pattern shown in FIG. 5A, the scheduling pattern may be switched to the safety control scheduling pattern shown in FIG. 5B. Further, TP may be forcibly switched to TP3 at the next operation timing of partition scheduler 21. Then, after switching to TP3, for example, the control target is stopped by the safety control task 28. Further, the OS 100 may be controlled to directly stop the control target.

以上に説明したMMU確認ルーチン29の処理は、OS100に制御が移ったときにおける任意のタイミングで実行するようにしてよい。例えば、図8に示すように、TPにおいてそのTPに属する全てのタスクの実行が終了してOS100に制御が移ったときに、残りのTPの時間の間、処理を実行するようにしてもよい。このようにすることで、TPにおいて余った時間を有効利用することができる。   The processing of the MMU confirmation routine 29 described above may be executed at an arbitrary timing when control is transferred to the OS 100. For example, as shown in FIG. 8, when execution of all tasks belonging to the TP is completed and control is transferred to the OS 100, processing may be executed for the remaining TP time. . By doing in this way, the surplus time in TP can be used effectively.

なお、MMU確認ルーチン29で検査対象とするページ、タスク、及びエントリの組み合わせは、任意の組み合わせを、任意の順序で組み合わせていくようにしてよい。例えば、検査対象とするページは、実行用メモリ11の全てのページを先頭からの順番に、検査対象とするタスクは、全てのタスク24、26、28を対象として予め定めた順番に、検査対象とするエントリは、TLBの全てのエントリを先頭から順番に組み合わせて検査していくことで、全ての組み合わせに対するMMU14の動作確認を行うようにしてもよい。また、図8に示すように、TP2の余った時間でMMU14の動作確認を行う場合は、次にアクティブとなるTP1に属するタスクを検査対象としてMMU14の動作確認を行うようにしてもよい。   Note that any combination of pages, tasks, and entries to be inspected in the MMU confirmation routine 29 may be combined in any order. For example, the pages to be inspected are all pages in the execution memory 11 in the order from the top, and the tasks to be inspected are inspected in the predetermined order for all the tasks 24, 26, and 28. The entries may be checked by combining all the entries in the TLB in order from the top to check the operation of the MMU 14 for all the combinations. Further, as shown in FIG. 8, when the operation of the MMU 14 is checked in the remaining time of the TP2, the operation of the MMU 14 may be checked with a task belonging to the next active TP1 as an inspection target.

以上に説明したMMU確認ルーチン29の処理手順では、ページの先頭と末尾に対して、アクセスするようにしているが、これに限られない。例えば、先頭と末尾のいずれか一方に対して、アクセスをするようにしてもよい。また、ページ全体に対して、アクセスをするようにしてもよい。また、ページの先頭と末尾以外の任意の位置に対して、アクセスをするようにしてもよい。しかしながら、好ましくは、上述したように、ページの先頭と末尾を対象とすることで、境界値分析を行うこととなるため、MMU14の異常を検出する精度が向上することが期待される。   In the processing procedure of the MMU confirmation routine 29 described above, the top and the bottom of the page are accessed, but the present invention is not limited to this. For example, you may make it access either one of the head and the tail. Moreover, you may make it access the whole page. Further, an arbitrary position other than the top and the end of the page may be accessed. However, preferably, as described above, the boundary value analysis is performed by targeting the head and tail of the page, so that it is expected that the accuracy of detecting an abnormality in the MMU 14 is improved.

以上に説明したように、本実施の形態1では、検査対象とするタスクの権限で、そのタスクに対してアクセス権限が付与されていない実行用メモリ11の領域に意図的にアクセスするようにしている。そして、そのアクセスによってMMU14がメモリ保護違反を検出したか否かを判定する。これによれば、メモリ保護違反が検出された場合に、MMU14によるメモリ保護が正常に行われていることを確認することができる。つまり、MMU14が正常に動作していることを確認することができる。   As described above, in the first embodiment, the area of the execution memory 11 to which the access authority is not given to the task is intentionally accessed with the authority of the task to be inspected. Yes. Then, it is determined whether or not the MMU 14 has detected a memory protection violation by the access. According to this, when a memory protection violation is detected, it can be confirmed that the memory protection by the MMU 14 is normally performed. That is, it can be confirmed that the MMU 14 is operating normally.

<発明の実施の形態2>
続いて、本発明の実施の形態2にかかる安全制御装置について説明する。本実施の形態2にかかる安全制御装置の構成は、図1を参照して説明した実施の形態1にかかる安全制御装置の構成と同様であるため、その説明を省略する。以下では、パーティションスケジューラ30と、アプリケーション101〜103の起動により生成されるタスクと、の関係について、図9を用いて説明する。図9は、本実施の形態2にかかるパーティションスケジューラ30とタスク24、26、28との関係を示す図である。以下、実施の形態1と同様の内容については、適宜、その説明を省略する。
<Embodiment 2 of the Invention>
Then, the safety control apparatus concerning Embodiment 2 of this invention is demonstrated. Since the configuration of the safety control device according to the second embodiment is the same as the configuration of the safety control device according to the first embodiment described with reference to FIG. 1, the description thereof is omitted. Below, the relationship between the partition scheduler 30 and the tasks generated by the activation of the applications 101 to 103 will be described with reference to FIG. FIG. 9 is a diagram showing the relationship between the partition scheduler 30 and the tasks 24, 26, and 28 according to the second embodiment. Hereinafter, the description of the same contents as those in Embodiment 1 will be omitted as appropriate.

図9に示すように、本実施の形態2は、実施の形態1と比較して、パーティションスケジューラ21に代えてパーティションスケジューラ30を有し、MMU確認ルーチン29がパーティションスケジューラ30に含まれる点が異なる。すなわち、本実施の形態2にかかるパーティションスケジューラ30は、実施の形態1にかかるパーティションスケジューラ21と比較して、MMU確認ルーチン29を実行する点が異なる。   As shown in FIG. 9, the second embodiment is different from the first embodiment in that a partition scheduler 30 is provided instead of the partition scheduler 21 and an MMU confirmation routine 29 is included in the partition scheduler 30. . That is, the partition scheduler 30 according to the second embodiment is different from the partition scheduler 21 according to the first embodiment in that an MMU confirmation routine 29 is executed.

続いて、パーティションスケジューラ30によるパーティション・スケジューリングについて、図10を用いて説明する。図10は、発明の実施の形態2にかかるパーティションスケジューラ30の処理手順の具体例を示すフローチャートである。なお、図6を参照して説明した、実施の形態1にかかる処理手順と同様の処理手順については、同一の符号を付し、説明を省略する。本実施の形態2にかかる処理手順では、実施の形態1にかかる処理手順と比較して、S13でYesとなったときにS17を実行して、その次にS14を実行する点が異なる。   Next, partition scheduling by the partition scheduler 30 will be described with reference to FIG. FIG. 10 is a flowchart showing a specific example of the processing procedure of the partition scheduler 30 according to the second embodiment of the invention. In addition, about the process procedure similar to the process procedure concerning Embodiment 1 demonstrated with reference to FIG. 6, the same code | symbol is attached | subjected and description is abbreviate | omitted. The processing procedure according to the second embodiment is different from the processing procedure according to the first embodiment in that S17 is executed when Yes in S13, and then S14 is executed.

TPの切り替えタイミングであると判定した場合(S13でYes)、パーティションスケジューラ30は、切り替え先のTPで利用するページに関して、MMU確認ルーチン29を実行する(S17)。そして、パーティションスケジューラ30は、MMU確認ルーチン29を実行した後に、TPの切り替えを実行する(S14)。   When it is determined that it is the TP switching timing (Yes in S13), the partition scheduler 30 executes the MMU confirmation routine 29 for the page used in the switching destination TP (S17). Then, the partition scheduler 30 executes TP switching after executing the MMU confirmation routine 29 (S14).

MMU確認ルーチン29における処理手順については、OS100のパーティションスケジューラ30が実行すること以外は、実施の形態1において図7を参照して説明した処理と同様となるため、その説明を省略する。ここで、本実施の形態2では、上述したように切り替え先のTPで利用するページに関して、MMU確認ルーチン29を実行する。すなわち、パーティションスケジューラ30は、切り替え先のTPで利用するページに対するアクセスの影響を受ける可能性の高い、切り替え先のTPで利用するページに隣接するページについて検査を行う。その理由は、タスクが誤動作をしてメモリ保護違反となるアクセスをするケースで可能性が高いものとして、タスクが誤って隣接するページにまではみ出してアクセスしてしまうことが考えられるからである。よって、パーティションスケジューラ30は、切り替え先のTPに属するタスクの権限(ASID)で、切り替え先のTPに属するタスクで利用するページに隣接し、かつ、切り替え先のTPに属するタスクに対してアクセス権限が付与されていないページについてMMU確認ルーチン29を実行する。   The processing procedure in the MMU confirmation routine 29 is the same as the processing described with reference to FIG. 7 in the first embodiment except that it is executed by the partition scheduler 30 of the OS 100, and thus the description thereof is omitted. Here, in the second embodiment, as described above, the MMU confirmation routine 29 is executed for the page used in the switching destination TP. That is, the partition scheduler 30 inspects a page adjacent to a page used in the switching destination TP that is highly likely to be affected by an access to the page used in the switching destination TP. The reason is that the task is likely to access the adjacent page by mistake, assuming that there is a high possibility in the case where the task malfunctions and accesses the memory protection violation. Therefore, the partition scheduler 30 has the authority (ASID) of the task belonging to the switching destination TP, the access authority for the task belonging to the page used by the task belonging to the switching destination TP and belonging to the switching destination TP. The MMU confirmation routine 29 is executed for the pages to which no is assigned.

具体的には、パーティションスケジューラ30は、MMU14のTLBを参照して、切り替え先のTPに対応するASIDが設定されているエントリを検索する。そして、この検索によって検出したエントリにおいて設定されているページが切り替え先のTPで利用するページとなる。さらに、パーティションスケジューラ30は、検出したエントリにおいて設定されている仮想アドレス又は物理アドレスに基づいて、検出したエントリのページに隣接するページについて設定されており、かつASIDが切り替え先のTPに対応するASIDでないエントリを検索する。そして、パーティションスケジューラ30は、この検索によって検出したエントリにおいて設定されているページを検査対象のページとして認識する。よって、検査対象のページは、TLBのエントリの設定を変更しなくても、切り替え先のTPに属するタスクの権限(ASID)でのアクセス権限は有していない。そのため、パーティションスケジューラ30は、S21でのエントリのバックアップ、S22でのエントリの設定、及びS24でのエントリの復元は実行せずに、MMU確認ルーチン29を実施するようにしてもよい。なお、上述した理由から、ステップS23では、検査対象のページの先頭と末尾のうち、切り替え先のTPに属するタスクで利用するページに隣接する側のみにアクセスするようにしてもよい。   Specifically, the partition scheduler 30 refers to the TLB of the MMU 14 and searches for an entry in which an ASID corresponding to the switching destination TP is set. The page set in the entry detected by this search becomes the page used in the switching destination TP. Furthermore, the partition scheduler 30 is set for a page adjacent to the page of the detected entry based on the virtual address or physical address set in the detected entry, and the ASID corresponding to the switching destination TP. Find entries that are not. Then, the partition scheduler 30 recognizes the page set in the entry detected by this search as the page to be inspected. Therefore, the page to be inspected does not have the access authority with the authority (ASID) of the task belonging to the switching destination TP even if the setting of the TLB entry is not changed. Therefore, the partition scheduler 30 may execute the MMU confirmation routine 29 without executing the entry backup at S21, the entry setting at S22, and the entry restoration at S24. For the reasons described above, in step S23, only the side adjacent to the page used in the task belonging to the switching destination TP may be accessed from the beginning and end of the page to be inspected.

以上に説明したように、本実施の形態2では、TPを切り替えるときに、切り替え先のTPで実行されるタスクがアクセスする実行用メモリ11のページに関して、MMU14の動作確認を行うようにしている。これによれば、直近で使用される実行用メモリ11のページに関してMMU14の動作が正常に行われていることを確認することができる。そのため、MMU14の異常をより早く検出することが可能となり、より信頼性を向上することが可能となる。   As described above, in the second embodiment, when the TP is switched, the operation of the MMU 14 is checked with respect to the page of the execution memory 11 accessed by the task executed by the switching destination TP. . According to this, it can be confirmed that the operation of the MMU 14 is normally performed with respect to the page of the execution memory 11 used most recently. For this reason, it is possible to detect the abnormality of the MMU 14 earlier, and it is possible to further improve the reliability.

<発明の実施の形態3>
続いて、本発明の実施の形態3にかかる安全制御装置2について説明する。図11は、本実施の形態3にかかる安全制御装置2の構成例を示すブロック図である。以下、実施の形態1と同様の内容については、適宜、その説明を省略する。
<Third Embodiment of the Invention>
Next, the safety control device 2 according to the third embodiment of the present invention will be described. FIG. 11 is a block diagram illustrating a configuration example of the safety control device 2 according to the third embodiment. Hereinafter, the description of the same contents as those in Embodiment 1 will be omitted as appropriate.

本実施の形態3にかかる安全制御装置2は、図1を参照して説明した実施の形態1にかかる安全制御装置1と比較して、OS100に代えてOS200を有し、さらにMMU確認アプリケーション104を有する点が異なる。   The safety control device 2 according to the third embodiment has an OS 200 instead of the OS 100 as compared with the safety control device 1 according to the first embodiment described with reference to FIG. Is different.

MMU確認アプリケーション104は、MMU確認ルーチン29を実行することによって、MMU14が正常に動作しているか否かを確認する処理をプロセッサ10に実行させるための命令コードを含む。MMU確認アプリケーション104は、パーティションスケジューラ21への結果通知をプロセッサ10に実行させるための命令コードを含む。MMU確認アプリケーション104は、安全関連アプリケーションである。なお、OS100とOS200との違いについては、後述する。   The MMU confirmation application 104 includes an instruction code for causing the processor 10 to execute processing for confirming whether or not the MMU 14 is operating normally by executing the MMU confirmation routine 29. The MMU confirmation application 104 includes an instruction code for causing the processor 10 to execute a result notification to the partition scheduler 21. The MMU confirmation application 104 is a safety related application. The difference between the OS 100 and the OS 200 will be described later.

続いて、パーティションスケジューラ21と、アプリケーション101〜104の起動により生成されるタスクと、の関係について、図12を用いて説明する。図12は、本実施の形態3にかかるパーティションスケジューラ21とタスク24、26、28、32との関係を示す図である。   Next, the relationship between the partition scheduler 21 and tasks generated by starting up the applications 101 to 104 will be described with reference to FIG. FIG. 12 is a diagram illustrating a relationship between the partition scheduler 21 and the tasks 24, 26, 28, and 32 according to the third embodiment.

図12に示すように、本実施の形態3は、実施の形態1と比較して、OS100に代えてOS200を有し、スケジューリングテーブル22に代えてスケジューリングテーブル33を有し、さらにタスクスケジューラ31とMMU確認タスク32とを有する点が異なる。また、本実施の形態3は、実施の形態1と比較して、さらにTP4及びRP4が定義されている。TP4及びRP4には、タスクスケジューラ31とMMU確認タスク32とが属する。   As shown in FIG. 12, the third embodiment has an OS 200 instead of the OS 100, a scheduling table 33 instead of the scheduling table 22, and a task scheduler 31 as compared with the first embodiment. The difference is that it has an MMU confirmation task 32. Further, in the third embodiment, TP4 and RP4 are further defined as compared with the first embodiment. A task scheduler 31 and an MMU confirmation task 32 belong to TP4 and RP4.

本実施の形態3にかかるOS200は、実施の形態1にかかるOS100と比較して、MMU確認ルーチン29を有しない点が異なる。すなわち、OS200によって、直接、MMU14の動作確認は行わない。後述するように、本実施の形態3では、OS200上で動作するMMU確認タスク32がMMU確認ルーチン29を実行する。   The OS 200 according to the third embodiment is different from the OS 100 according to the first embodiment in that it does not have the MMU confirmation routine 29. That is, the operation check of the MMU 14 is not performed directly by the OS 200. As will be described later, in the third embodiment, the MMU confirmation task 32 operating on the OS 200 executes the MMU confirmation routine 29.

タスクスケジューラ31は、タスクスケジューラ23、25、27と同様に、自身が属するTP4内のタスクのスケジューリングを行う。なお、図12では、TP4は1つのタスクのみを含むものとして図示しているが、1以上のタスクが含まれるようにしてもよい。   Similar to the task schedulers 23, 25, and 27, the task scheduler 31 performs scheduling of tasks in the TP4 to which the task scheduler 31 belongs. In FIG. 12, TP4 is illustrated as including only one task, but one or more tasks may be included.

MMU確認タスク32は、MMU確認アプリケーション104の起動によって生成されるタスクである。図12の例では、MMU確認タスク32は、TP4及びRP4に割り当てられている。MMU確認タスク32は、MMU確認ルーチン29を実行することによって、MMU14が正常に動作しているか否かを確認する。   The MMU confirmation task 32 is a task generated when the MMU confirmation application 104 is activated. In the example of FIG. 12, the MMU confirmation task 32 is assigned to TP4 and RP4. The MMU confirmation task 32 confirms whether or not the MMU 14 is operating normally by executing the MMU confirmation routine 29.

スケジューリングテーブル33は、図13A及び図13Bに示すスケジューリングパターンを保持している。図13Aは、通常制御スケジューリングパターンの具体例を示している。図13Aでは、1サイクル時間において、通常制御タスク26が属するTP2の期間(T1)、安全監視タスク24が属するTP1の期間(T2)、及びMMU確認タスク32が属するTP4の期間(T5)が割り当てられている。図13Bは、安全制御スケジューリングパターンの具体例を示している。図13Bでは、1サイクル時間において、安全監視タスク24が属するTP1の期間(T1)、安全監視タスク24が属するTP1の期間(T2)、及びMMU確認タスク32が属するTP4の期間(T6)が割り当てられている。   The scheduling table 33 holds the scheduling pattern shown in FIGS. 13A and 13B. FIG. 13A shows a specific example of the normal control scheduling pattern. In FIG. 13A, the period (T1) of TP2 to which the normal control task 26 belongs, the period (T2) of TP1 to which the safety monitoring task 24 belongs, and the period (T5) of TP4 to which the MMU confirmation task 32 belongs are assigned in one cycle time. It has been. FIG. 13B shows a specific example of the safety control scheduling pattern. In FIG. 13B, in one cycle time, the period (T1) of TP1 to which the safety monitoring task 24 belongs, the period (T2) of TP1 to which the safety monitoring task 24 belongs, and the period (T6) of TP4 to which the MMU confirmation task 32 belongs are assigned. It has been.

MMU確認ルーチン29における処理手順については、MMU確認タスク32が実行すること以外は、実施の形態1において図7を参照して説明した処理と同様となるため、その説明を省略する。ここで、MMU確認タスク32は、TP4のタスクの権限でRP4に割り当てられたリソースしかアクセスすることができない。また、通常、OS200は、OS200上で動作するタスクからは、MMU14内のTLBのエントリにアクセスすることができないようにしている。そこで、本実施の形態3にかかるOS200は、MMU確認タスク32に対して、エントリのデータのバックアップ、復元及び検索のためのアクセスを可能とするAPI関数、及び、検査対象となるタスクの権限(ASID)で検査対象となるページに対するアクセスの発行を可能とするAPI関数等を提供する。そして、MMU確認タスク32は、それぞれのAPI関数を使用して、MMU確認ルーチン29を実行する。   Since the processing procedure in the MMU confirmation routine 29 is the same as the processing described with reference to FIG. 7 in the first embodiment except that the MMU confirmation task 32 executes, the description thereof is omitted. Here, the MMU confirmation task 32 can access only resources allocated to the RP 4 with the authority of the task of the TP 4. In general, the OS 200 prevents a task operating on the OS 200 from accessing a TLB entry in the MMU 14. Therefore, the OS 200 according to the third embodiment has an API function that enables access to the MMU confirmation task 32 for backup, restoration, and search of entry data, and the authority of the task to be inspected ( An API function or the like that enables issuance of access to a page to be inspected by ASID). Then, the MMU confirmation task 32 executes the MMU confirmation routine 29 using each API function.

また、MMU確認タスク32は、MMU14の異常を検出した場合(S25でNo、S28)には、緊急停止ルーチンとして、パーティションスケジューラ21に異常を通知する。そして、パーティションスケジューラ21は、その通知に応じて、スケジューリングパターンを、安全制御スケジューリングパターンに切り替えて、制御対象を緊急停止させる。   Further, when the MMU confirmation task 32 detects an abnormality of the MMU 14 (No in S25, S28), it notifies the partition scheduler 21 of the abnormality as an emergency stop routine. And according to the notification, the partition scheduler 21 switches the scheduling pattern to the safety control scheduling pattern and urgently stops the control target.

以上に説明した本実施の形態3のように、MMU14の動作確認を行うための専用のTPを定義して、そのTPに属するタスクによって、MMU14の動作確認を行うようにすることもできる。   As in the third embodiment described above, a dedicated TP for confirming the operation of the MMU 14 can be defined and the operation of the MMU 14 can be confirmed by a task belonging to the TP.

<発明の実施の形態4>
続いて、本発明の実施の形態4にかかる安全制御装置について説明する。本実施の形態4にかかる安全制御装置の構成は、図1を参照して説明した実施の形態1にかかる安全制御装置の構成と同様であるため、その説明を省略する。以下では、パーティションスケジューラ21と、アプリケーション101〜103の起動により生成されるタスクと、の関係について、図14を用いて説明する。図14は、本実施の形態4にかかるパーティションスケジューラ21とタスク34〜36との関係を示す図である。以下、実施の形態1と同様の内容については、適宜、その説明を省略する。
<Embodiment 4 of the Invention>
Then, the safety control apparatus concerning Embodiment 4 of this invention is demonstrated. Since the configuration of the safety control device according to the fourth embodiment is the same as the configuration of the safety control device according to the first embodiment described with reference to FIG. 1, the description thereof is omitted. Below, the relationship between the partition scheduler 21 and the task generated by the activation of the applications 101 to 103 will be described with reference to FIG. FIG. 14 is a diagram illustrating a relationship between the partition scheduler 21 and the tasks 34 to 36 according to the fourth embodiment. Hereinafter, the description of the same contents as those in Embodiment 1 will be omitted as appropriate.

図14に示すように、本実施の形態4は、実施の形態1と比較して、OS100に代えてOS200を有し、安全監視タスク24、通常制御タスク26、及び安全制御タスク28に代えて安全監視タスク34、通常制御タスク35、及び安全制御タスク36を有する点が異なる。安全監視タスク34、通常制御タスク35、及び安全制御タスク36のそれぞれは、安全監視タスク24、通常制御タスク26、及び安全制御タスク28のそれぞれと比較して、MMU確認ルーチン29を有する点が異なる。   As shown in FIG. 14, the fourth embodiment has an OS 200 instead of the OS 100 as compared with the first embodiment, and replaces the safety monitoring task 24, the normal control task 26, and the safety control task 28 with each other. The difference is that a safety monitoring task 34, a normal control task 35, and a safety control task 36 are provided. Each of the safety monitoring task 34, the normal control task 35, and the safety control task 36 is different from the safety monitoring task 24, the normal control task 26, and the safety control task 28 in that it has an MMU confirmation routine 29. .

本実施の形態4にかかるOS200は、実施の形態1にかかるOS100と比較して、実施の形態3にかかるOS200と同様にMMU確認ルーチン29を有しない。すなわち、OS200において、直接、MMU14の動作確認は行わない。   The OS 200 according to the fourth embodiment does not have the MMU confirmation routine 29 as compared with the OS 100 according to the third embodiment, as compared with the OS 100 according to the first embodiment. That is, the OS 200 does not directly check the operation of the MMU 14.

本実施の形態4にかかる安全監視タスク34は、実施の形態1にかかる安全監視タスク24と比較して、さらに、MMU確認ルーチン29を実行することによって、MMU14が正常に動作しているか否かを確認する点が異なる。本実施の形態4にかかる通常制御タスク35は、実施の形態1にかかる通常制御タスク26と比較して、さらに、MMU確認ルーチン29を実行することによって、MMU14が正常に動作しているか否かを確認する点が異なる。本実施の形態4にかかる安全制御タスク36は、実施の形態1にかかる安全制御タスク28と比較して、さらに、MMU確認ルーチン29を実行することによって、MMU14が正常に動作しているか否かを確認する点が異なる。   Compared with the safety monitoring task 24 according to the first embodiment, the safety monitoring task 34 according to the fourth embodiment further executes an MMU confirmation routine 29 to determine whether the MMU 14 is operating normally. The point to check is different. Compared with the normal control task 26 according to the first embodiment, the normal control task 35 according to the fourth embodiment further executes an MMU confirmation routine 29 to determine whether the MMU 14 is operating normally. The point to check is different. Compared with the safety control task 28 according to the first embodiment, the safety control task 36 according to the fourth embodiment further executes an MMU confirmation routine 29 to determine whether the MMU 14 is operating normally. The point to check is different.

MMU確認ルーチン29における処理手順については、安全監視タスク34、通常制御タスク35、及び安全制御タスク36のそれぞれが実行すること以外は、実施の形態1において図7を参照して説明した処理と同様となるため、その説明を省略する。ここで、安全監視タスク34、通常制御タスク35、及び安全制御タスク36のそれぞれは、それぞれが属するTPで利用するページに関して、MMU確認ルーチン29を実行する。すなわち、それぞれのタスク34〜36は、それぞれが属するTPで利用するページに隣接するページについて検査を行う。それぞれのタスク34〜36の権限(ASID)で、それぞれが利用するページについてMMU確認ルーチン29を実行することになる。よって、それぞれのタスク34〜36は、それぞれのタスク34〜36の権限(ASID)で、それぞれのタスク34〜36が利用するページに隣接し、かつ、それぞれのタスク34〜36に対してアクセス権限が付与されていないページについてMMU確認ルーチン29を実行する。ここで、それぞれのタスク34〜36が検査対象のページを特定する方法については、実施の形態2において説明した方法と同様であるため、説明を省略する。また、実施の形態2と同様の理由で、ステップS23では、検査対象のページの先頭と末尾のうち、それぞれのタスク34〜36が属するTPで利用するページに隣接する側のみにアクセスするようにしてもよい。   The processing procedure in the MMU confirmation routine 29 is the same as the processing described with reference to FIG. 7 in the first embodiment except that each of the safety monitoring task 34, the normal control task 35, and the safety control task 36 is executed. Therefore, the description thereof is omitted. Here, each of the safety monitoring task 34, the normal control task 35, and the safety control task 36 executes the MMU confirmation routine 29 for the page used by the TP to which each belongs. That is, each of the tasks 34 to 36 inspects a page adjacent to a page used by the TP to which each task belongs. With the authority (ASID) of each task 34 to 36, the MMU confirmation routine 29 is executed for the page used by each. Therefore, each task 34 to 36 is the authority (ASID) of each task 34 to 36, is adjacent to the page used by each task 34 to 36, and has access authority to each task 34 to 36. The MMU confirmation routine 29 is executed for the pages to which no is assigned. Here, the method for specifying the pages to be inspected by the tasks 34 to 36 is the same as the method described in the second embodiment, and thus the description thereof is omitted. Further, for the same reason as in the second embodiment, in step S23, only the side adjacent to the page used in the TP to which each task 34 to 36 belongs is accessed from the head and the tail of the page to be inspected. May be.

また、検査対象のページは、TLBのエントリの設定を変更しなくても、それぞれのタスク34〜36の権限(ASID)でのアクセス権限は有していない。そのため、それぞれのタスク34〜36は、S21でのエントリのバックアップ、S22でのエントリの設定、及びS24でのエントリの復元は実行せずに、MMU確認ルーチン29を実施するようにしてもよい。   The page to be inspected does not have the access authority with the authority (ASID) of each task 34 to 36 even if the setting of the TLB entry is not changed. Therefore, each of the tasks 34 to 36 may execute the MMU confirmation routine 29 without executing the entry backup in S21, the entry setting in S22, and the entry restoration in S24.

ここで、通常、OS200は、OS200上で動作するタスクからは、MMU14のエントリにアクセスすることができないようにしている。そこで、本実施の形態4にかかるOS200は、実施の形態3にかかるOS200と同様に、各タスク34〜36に対して、エントリのデータのバックアップ、復元及び検索のためのアクセスを可能とするAPI関数を提供する。そして、各タスク34〜36は、それぞれのAPI関数を使用して、MMU確認ルーチン29を実行する。   Here, normally, the OS 200 is prevented from accessing the entry of the MMU 14 from a task operating on the OS 200. Therefore, as with the OS 200 according to the third embodiment, the OS 200 according to the fourth embodiment has an API that enables access for backup, restoration, and search of entry data to the tasks 34 to 36. Provide a function. Then, each of the tasks 34 to 36 executes the MMU confirmation routine 29 using the respective API function.

また、各タスク34〜36は、MMU14の異常を検出した場合(S25でNo、S28)には、緊急停止ルーチンとして、パーティションスケジューラ21に異常を通知する。そして、パーティションスケジューラ21は、その通知に応じて、スケジューリングパターンを、安全制御スケジューリングパターンに切り替えて、制御対象を緊急停止させる。   Further, when each of the tasks 34 to 36 detects an abnormality of the MMU 14 (No in S25, S28), it notifies the partition scheduler 21 of the abnormality as an emergency stop routine. And according to the notification, the partition scheduler 21 switches the scheduling pattern to the safety control scheduling pattern and urgently stops the control target.

以上に説明したように、本実施の形態4では、TP1〜3のそれぞれにおいて、それぞれのTPに属するタスクによって、それぞれのTPに対応するRPに割り当てられた実行用メモリ11のページについてMMU14の動作確認を行うようにすることもできる。   As described above, in the fourth embodiment, the operation of the MMU 14 for each page of the execution memory 11 assigned to the RP corresponding to each TP by the tasks belonging to each TP in each of TP1 to TP3. You can also check.

発明の他の実施の形態.
本実施の形態では、TPのそれぞれに属するタスクが、それぞれ安全監視タスク24、34、通常制御タスク26、35及び安全制御タスク28、36である場合について例示したが、タスクの種類は、これに限られない。安全監視タスク24、通常制御タスク26及び安全制御タスク28に限られず、その他の任意の制御対象の制御に関する処理を実行するタスクを有するようにしてもよい。
Another embodiment of the invention.
In the present embodiment, the case where the tasks belonging to each of the TPs are the safety monitoring tasks 24 and 34, the normal control tasks 26 and 35, and the safety control tasks 28 and 36, respectively, is exemplified. Not limited. The present invention is not limited to the safety monitoring task 24, the normal control task 26, and the safety control task 28, and may have a task for executing processing related to control of any other control target.

例えば、図22に示すようなタスク37〜39を有するようにしてもよい。なお、この場合、安全制御装置は、アプリケーション101〜103に代えて、タスク37〜39に対応するアプリケーションを有する必要があるが、その点は自明であるため図示及び説明を省略する。   For example, you may make it have the tasks 37-39 as shown in FIG. In this case, the safety control device needs to have applications corresponding to the tasks 37 to 39 instead of the applications 101 to 103. However, since this point is obvious, illustration and description are omitted.

監視制御タスク37は、制御対象を制御する。具体的には、監視制御タスク37は、通常制御タスク38及び安全制御タスク39からの指令値に基づいて、制御対象のアクチュエータを制御する。通常制御タスク38は、制御対象に通常の機能・動作を行わせるための制御計算を行う。具体的には、通常制御タスク38は、通常制御におけるアクチュエータの制御計算をして、アクチュエータの指令値を算出する。通常制御タスク38は、算出した指令値を監視制御タスク37に出力する。安全制御タスク39は、機能安全を確保するために定められた制御計算を行う。具体的には、安全制御タスク39は、安全制御におけるアクチュエータの制御計算をして、アクチュエータの指令値を算出する。安全制御タスク39は、算出した指令値を監視制御タスク37に出力する。監視制御タスク37は、通常制御タスク38又は安全制御タスク39から出力された指令値に基づいてアクチュエータを制御する。   The supervisory control task 37 controls the control target. Specifically, the supervisory control task 37 controls the actuator to be controlled based on command values from the normal control task 38 and the safety control task 39. The normal control task 38 performs control calculation for causing the control target to perform a normal function / operation. Specifically, the normal control task 38 calculates the actuator command value by performing control calculation of the actuator in normal control. The normal control task 38 outputs the calculated command value to the monitoring control task 37. The safety control task 39 performs a control calculation determined to ensure functional safety. Specifically, the safety control task 39 calculates the actuator command value by performing a control calculation of the actuator in the safety control. The safety control task 39 outputs the calculated command value to the monitoring control task 37. The supervisory control task 37 controls the actuator based on the command value output from the normal control task 38 or the safety control task 39.

さらに、監視制御タスク37は、制御対象のセンサから、センサ値を取得する。監視制御タスク37は、取得したセンサ値を通常制御タスク38及び安全制御タスク39に出力する。通常制御タスク38及び安全制御タスク39のそれぞれは、監視制御タスク37から出力されたセンサ値に基づいて、アクチュエータの制御計算を行うようにしてもよい。   Furthermore, the monitoring control task 37 acquires a sensor value from the sensor to be controlled. The monitoring control task 37 outputs the acquired sensor value to the normal control task 38 and the safety control task 39. Each of the normal control task 38 and the safety control task 39 may perform actuator control calculation based on the sensor value output from the monitoring control task 37.

また、その他に、例えば、図23に示すようなタスク40〜42を有するようにしてもよい。なお、この場合、安全制御装置は、アプリケーション101〜103に代えて、タスク40〜42に対応するアプリケーションを有する必要があるが、その点は自明であるため図示及び説明を省略する。   In addition, for example, tasks 40 to 42 as shown in FIG. 23 may be included. In this case, the safety control device needs to have an application corresponding to the tasks 40 to 42 instead of the applications 101 to 103. However, since this point is obvious, illustration and description are omitted.

監視タスク40は、制御対象のセンサから、センサ値を取得する。このセンサには、上述したように制御対象の姿勢を検知するための姿勢センサを含む。ここで説明する例では、制御対象として、人が搭乗することができる走行装置に適用した場合について説明する。この場合、監視タスク40は、搭乗者による重心移動を姿勢センサにより検知することができる。監視タスク40は、取得したセンサ値をHMI(Human Machine Interface)タスク39に出力する。   The monitoring task 40 acquires a sensor value from the sensor to be controlled. This sensor includes a posture sensor for detecting the posture of the control target as described above. The example demonstrated here demonstrates the case where it applies to the traveling apparatus which a person can board as a control object. In this case, the monitoring task 40 can detect the movement of the center of gravity by the passenger using the posture sensor. The monitoring task 40 outputs the acquired sensor value to an HMI (Human Machine Interface) task 39.

HMIタスク42は、監視タスク40から出力されたセンサ値に基づいて、制御対象のアクチュエータの制御計算をして、アクチュエータの指令値を算出する。HMIタスク42は、算出した指令値を制御タスク41に出力する。制御タスク41は、HMIタスク42から出力された指令値に基づいて、アクチュエータを制御する。   Based on the sensor value output from the monitoring task 40, the HMI task 42 performs control calculation of the actuator to be controlled, and calculates a command value for the actuator. The HMI task 42 outputs the calculated command value to the control task 41. The control task 41 controls the actuator based on the command value output from the HMI task 42.

これによれば、搭乗者の操作に応じて制御対象が制御されるというHMIを実現することができる。例えば、搭乗者が重心を前後に移動させることで制御対象が前後後退を行い、搭乗者が重心を左右に移動させることで制御対象が左右旋回を行うといった制御が可能となる。これについては、実施の形態1〜4及び図22によって説明した例についても同様のことが言える。具体的には、安全監視タスク24、34又は監視制御タスク37が取得したセンサ値に応じて、通常制御タスク26、35及び安全制御タスク28、36、もしくは、通常制御タスク38及び安全制御タスク39が同様の制御をすることで、HMIを実現することが可能である。また、本実施の形態によれば、より信頼性を向上した制御対象の制御を行うことが可能となる。そのため、以上に説明したように、人が搭乗することができる走行装置を制御対象として適用することで、より安全性を向上した制御対象の制御を行うことが可能となる。   According to this, it is possible to realize an HMI in which a control target is controlled in accordance with a passenger's operation. For example, it is possible to perform control such that the control object moves back and forth when the passenger moves the center of gravity back and forth, and the control object turns left and right when the passenger moves the center of gravity left and right. The same can be said for the examples described with reference to Embodiments 1 to 4 and FIG. Specifically, the normal control tasks 26 and 35 and the safety control tasks 28 and 36, or the normal control task 38 and the safety control task 39, depending on the sensor values acquired by the safety monitoring tasks 24 and 34 or the monitoring control task 37. However, HMI can be realized by performing similar control. Moreover, according to this Embodiment, it becomes possible to perform control of the controlled object with improved reliability. Therefore, as described above, it is possible to perform control of a controlled object with improved safety by applying a traveling device on which a person can board as a controlled object.

なお、走行装置として、例えば、立ち乗り方の同軸二輪車とすることもできる。その場合は、アクチュエータを制御することで、車輪が回転動作をすることになる。また、安全制御装置自体も制御対象に搭載される構成としてもよい。   In addition, as a traveling apparatus, it can also be set as the coaxial two-wheeled vehicle of standing up riding. In this case, the wheel rotates by controlling the actuator. Further, the safety control device itself may be mounted on the control target.

さらに、本発明は上述した実施の形態のみに限定されるものではなく、既に述べた本発明の要旨を逸脱しない範囲において種々の変更が可能であることは勿論である。   Furthermore, the present invention is not limited to the above-described embodiments, and various modifications can be made without departing from the gist of the present invention described above.

本実施の形態では、OSが、TP1〜TP3を有する場合について例示したが、TPの種類及び数は、これに限られない。スケジューリングパターンについても、本実施の形態に例示したものに限られない。   In the present embodiment, the case where the OS has TP1 to TP3 is illustrated, but the type and number of TPs are not limited to this. The scheduling pattern is not limited to that exemplified in the present embodiment.

本実施の形態では、タスクの数が3つである場合について例示したが、タスクの数は、これに限られない。例えば、本実施の形態では、TPがTP1〜TP3の3つである場合について例示したが、TPの数を3つ以外の数とし、それぞれのTPが1つ以上の任意の数のタスクを有するようにしてもよい。   In the present embodiment, the case where the number of tasks is three is exemplified, but the number of tasks is not limited to this. For example, in the present embodiment, the case where there are three TPs TP1 to TP3 is illustrated, but the number of TPs is set to a number other than three, and each TP has one or more arbitrary numbers of tasks. You may do it.

本実施の形態では、TP(RP)ごとに異なるアクセス権限を付与する場合について例示した。すなわち、本実施の形態では、同一のTPに属するタスクに対して同一のアクセス権限を付与する場合について例示したが、これに限られない。例えば、タスクごとに異なるアクセス権限を付与するようにしてもよい。この場合は、タスクごとにASIDが一意に定義されることになる。また、この場合は、実施の形態2おいて、切り替え先のTPに属するタスクのそれぞれで利用するページに関して、MMU確認ルーチン29を実行するようにすればよい。   In the present embodiment, the case where different access authorities are assigned for each TP (RP) has been illustrated. That is, in the present embodiment, the case where the same access authority is given to tasks belonging to the same TP is exemplified, but the present invention is not limited to this. For example, a different access authority may be given for each task. In this case, the ASID is uniquely defined for each task. In this case, in the second embodiment, the MMU confirmation routine 29 may be executed for the pages used in each of the tasks belonging to the switching destination TP.

本実施の形態では、タイム・パーティショニングを採用したマルチタスクOSについて例示したが、これに限られない。タイム・パーティショニングを採用していないマルチタスクOSに適用することもできる。この場合は、タスクごとにASIDが一意に定義されることになる。   In the present embodiment, the multitask OS adopting time partitioning is exemplified, but the present invention is not limited to this. The present invention can also be applied to a multitasking OS that does not employ time partitioning. In this case, the ASID is uniquely defined for each task.

本実施の形態では、MMU14の管理対象をRAMである実行用メモリ11とした場合について例示したが、これに限られない。例えば、MMUが管理対象とする記憶装置は、ROMであってもよい。また、MMUが管理対象とする記憶装置は、RAM及びROMの組み合わせであってもよい。   In the present embodiment, the case where the management target of the MMU 14 is the execution memory 11 that is a RAM is illustrated, but the present invention is not limited to this. For example, the storage device managed by the MMU may be a ROM. Further, the storage device to be managed by the MMU may be a combination of RAM and ROM.

また、MMU確認ルーチンを実施前に、プロセッサ10に対するMMUに関連しない割り込みを抑止して、MMU確認ルーチンの実施後に、割り込み抑止を解除するようにしてもよい。このようにすることで、TLBのエントリに検査時のデータが格納されたまま、他の処理が行われることを防止することができる。   Further, interrupts that are not related to the MMU for the processor 10 may be suppressed before the MMU confirmation routine is executed, and the interrupt suppression may be released after the MMU confirmation routine is executed. In this way, it is possible to prevent other processing from being performed while the data at the time of inspection is stored in the TLB entry.

本実施の形態では、MMUによってメモリ保護機能を実装する場合について例示したが、これに限られない。例えば、MPUによってメモリ保護機能を実装するようにしてもよい。   In this embodiment, the case where the memory protection function is implemented by the MMU is illustrated, but the present invention is not limited to this. For example, a memory protection function may be implemented by an MPU.

1、2 安全制御装置
10 プロセッサ
11 実行用メモリ
12 I/Oポート
13 不揮発性メモリ
14 MMU
15 リセット回路
20 マイクロコントローラ
21、30 パーティションスケジューラ
22、33 スケジューリングテーブル
23、25、27、31 タスクスケジューラ
24、34 安全監視タスク
26、35、38 通常制御タスク
28、36、39 安全制御タスク
29 MMU確認ルーチン
32 MMU確認タスク
37 監視制御タスク
40 監視タスク
41 制御タスク
42 HMIタスク
100、200 オペレーティングシステム
101 安全監視アプリケーション
102 通常制御アプリケーション
103 安全制御アプリケーション
104 MMU確認アプリケーション
1, 2 Safety control device 10 Processor 11 Execution memory 12 I / O port 13 Non-volatile memory 14 MMU
15 Reset circuit 20 Microcontroller 21, 30 Partition scheduler 22, 33 Scheduling table 23, 25, 27, 31 Task scheduler 24, 34 Safety monitoring task 26, 35, 38 Normal control task 28, 36, 39 Safety control task 29 MMU confirmation Routine 32 MMU confirmation task 37 Monitoring control task 40 Monitoring task 41 Control task 42 HMI task 100, 200 Operating system 101 Safety monitoring application 102 Normal control application 103 Safety control application 104 MMU confirmation application

Claims (7)

メモリと、
それぞれが前記メモリにアクセスする複数のタスクを実行するシステムプログラムと、
前記システムプログラムを実行するプロセッサと、
前記タスクの権限による前記プロセッサからの前記メモリに対するアクセスが、当該タスクに対してアクセス権限が付与されていない領域に対するアクセスである場合、当該アクセスをメモリ保護違反として検出するメモリ保護装置と、を備え、
前記プロセッサは、前記システムプログラムを実行することによって、
前記タスクの権限で当該タスクに対してアクセス権限が付与されていない前記メモリの領域に意図的にアクセスし、
当該アクセスによって前記メモリ保護装置が前記メモリ保護違反を検出したか否かを判定する、
情報処理装置。
Memory,
A system program for executing a plurality of tasks each accessing the memory;
A processor for executing the system program;
A memory protection device that detects the access as a memory protection violation when an access to the memory from the processor by the task authority is an access to an area to which the access authority is not granted to the task; ,
The processor executes the system program,
With intentional access to the area of the memory that is not granted access authority to the task with the authority of the task,
Determining whether the memory protection device has detected the memory protection violation by the access;
Information processing device.
前記情報処理装置は、制御対象を制御する制御装置であって、
前記複数のタスクは、前記制御対象を制御するとともに、それに伴って前記メモリに対してアクセスする制御関連タスクを含む、
請求項1に記載の情報処理装置。
The information processing apparatus is a control apparatus that controls a control target,
The plurality of tasks include a control-related task that controls the control target and accesses the memory accordingly.
The information processing apparatus according to claim 1.
前記システムプログラムは、前記制御関連タスクが実行される制御関連タイムパーティションを含む複数のタイムパーティションのスケジューリング内容を示すスケジューリング情報に従って、前記制御関連タスクをスケジューリングして実行し、
前記システムプログラムは、前記タイムパーティションを前記制御関連タイムパーティションに切り替えるとき、当該制御関連タイムパーティションで実行される制御関連タスクにアクセス権限が付与されている領域に隣接する、当該制御関連タスクにアクセス権限が付与されていない領域について、前記判定を前記プロセッサに実行させる、
請求項2に記載の情報処理装置。
The system program schedules and executes the control related task according to scheduling information indicating scheduling contents of a plurality of time partitions including a control related time partition in which the control related task is executed,
When the system program switches the time partition to the control-related time partition, the system program has an access right to the control-related task adjacent to an area where the access right is granted to the control-related task executed in the control-related time partition. For the region to which is not assigned, the processor performs the determination.
The information processing apparatus according to claim 2.
前記プロセッサは、前記意図的なアクセスによって前記メモリ保護装置が前記メモリ保護違反を検出しなかった場合に、前記メモリ保護装置が異常であると判定して当該異常に応じた処理を実行する、
請求項1乃至3のいずれか1項に記載の情報処理装置。
When the memory protection device does not detect the memory protection violation due to the intentional access, the processor determines that the memory protection device is abnormal and executes processing according to the abnormality.
The information processing apparatus according to any one of claims 1 to 3.
前記プロセッサは、前記メモリの領域の先頭及び末尾のうち、少なくともいずれか1つの所定サイズのデータに対してアクセスする、
請求項1乃至4のいずれか1項に記載の情報処理装置。
The processor accesses data of a predetermined size at least one of the beginning and end of the memory area;
The information processing apparatus according to any one of claims 1 to 4.
前記メモリ保護装置は、MMU(Memory Management Unit)又はMPU(Memory Protection Unit)である、
請求項1乃至5のいずれか1項に記載の情報処理装置。
The memory protection device is an MMU (Memory Management Unit) or MPU (Memory Protection Unit).
The information processing apparatus according to any one of claims 1 to 5.
それぞれがメモリにアクセスする複数のタスクを実行するシステムプログラムを実行するプロセッサからの前記タスクの権限による前記メモリに対するアクセスが、当該タスクに対してアクセス権限が付与されていない領域に対するアクセスである場合、当該アクセスをメモリ保護違反として検出するメモリ保護装置の動作確認方法であって、
前記プロセッサが、前記タスクの権限で当該タスクに対してアクセス権限が付与されていない前記メモリの領域に意図的にアクセスするステップと、
前記プロセッサが、当該アクセスによって前記メモリ保護装置が前記メモリ保護違反を検出したか否かを判定するステップと、
を備えたメモリ保護装置の動作確認方法。
When the access to the memory by the authority of the task from a processor that executes a system program that executes a plurality of tasks each accessing a memory is an access to an area to which the access authority is not granted to the task, An operation check method of a memory protection device for detecting the access as a memory protection violation,
The processor intentionally accessing an area of the memory that is not authorized to access the task with the authority of the task;
The processor determines whether the memory protection device has detected the memory protection violation by the access; and
A method for confirming the operation of a memory protection device comprising:
JP2011251606A 2011-11-17 2011-11-17 Operation check method of control device and memory protection device Expired - Fee Related JP5664530B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011251606A JP5664530B2 (en) 2011-11-17 2011-11-17 Operation check method of control device and memory protection device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011251606A JP5664530B2 (en) 2011-11-17 2011-11-17 Operation check method of control device and memory protection device

Publications (2)

Publication Number Publication Date
JP2013109393A true JP2013109393A (en) 2013-06-06
JP5664530B2 JP5664530B2 (en) 2015-02-04

Family

ID=48706115

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011251606A Expired - Fee Related JP5664530B2 (en) 2011-11-17 2011-11-17 Operation check method of control device and memory protection device

Country Status (1)

Country Link
JP (1) JP5664530B2 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017204286A (en) * 2017-06-28 2017-11-16 日立オートモティブシステムズ株式会社 Vehicle control device
JP2018528527A (en) * 2015-08-07 2018-09-27 クアルコム,インコーポレイテッド Hardware-enforced content protection for graphics processing units
US10102391B2 (en) 2015-08-07 2018-10-16 Qualcomm Incorporated Hardware enforced content protection for graphics processing units
US10528467B2 (en) 2016-07-13 2020-01-07 Denso Ten Limited Information processing device and information processing method

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01162300A (en) * 1987-12-18 1989-06-26 Nec Corp Rom checking circuit testing system
JPH04322343A (en) * 1991-04-23 1992-11-12 Mitsubishi Electric Corp Trace system for memory access
JP2000126425A (en) * 1998-10-26 2000-05-09 Sophia Co Ltd Device and method of calculation for game
JP2002049531A (en) * 2000-08-03 2002-02-15 Hitachi Ltd Memory area border detecting method and computer system
JP2004185536A (en) * 2002-12-06 2004-07-02 Oki Electric Ind Co Ltd Microcomputer, and its testing method
JP2007066246A (en) * 2005-09-02 2007-03-15 Hitachi Ltd Self-diagnostic system and method of controller
WO2008120537A1 (en) * 2007-03-19 2008-10-09 Toyota Jidosha Kabushiki Kaisha Information processing device
JP2010271759A (en) * 2009-05-19 2010-12-02 Toyota Motor Corp Safety control device and safety control method
JP2011227700A (en) * 2010-04-20 2011-11-10 Mitsubishi Electric Corp Peripheral device failure simulation system, peripheral device failure simulation method and peripheral device failure simulation program

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01162300A (en) * 1987-12-18 1989-06-26 Nec Corp Rom checking circuit testing system
JPH04322343A (en) * 1991-04-23 1992-11-12 Mitsubishi Electric Corp Trace system for memory access
JP2000126425A (en) * 1998-10-26 2000-05-09 Sophia Co Ltd Device and method of calculation for game
JP2002049531A (en) * 2000-08-03 2002-02-15 Hitachi Ltd Memory area border detecting method and computer system
JP2004185536A (en) * 2002-12-06 2004-07-02 Oki Electric Ind Co Ltd Microcomputer, and its testing method
JP2007066246A (en) * 2005-09-02 2007-03-15 Hitachi Ltd Self-diagnostic system and method of controller
WO2008120537A1 (en) * 2007-03-19 2008-10-09 Toyota Jidosha Kabushiki Kaisha Information processing device
JP2010271759A (en) * 2009-05-19 2010-12-02 Toyota Motor Corp Safety control device and safety control method
JP2011227700A (en) * 2010-04-20 2011-11-10 Mitsubishi Electric Corp Peripheral device failure simulation system, peripheral device failure simulation method and peripheral device failure simulation program

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018528527A (en) * 2015-08-07 2018-09-27 クアルコム,インコーポレイテッド Hardware-enforced content protection for graphics processing units
US10102391B2 (en) 2015-08-07 2018-10-16 Qualcomm Incorporated Hardware enforced content protection for graphics processing units
US10528467B2 (en) 2016-07-13 2020-01-07 Denso Ten Limited Information processing device and information processing method
JP2017204286A (en) * 2017-06-28 2017-11-16 日立オートモティブシステムズ株式会社 Vehicle control device

Also Published As

Publication number Publication date
JP5664530B2 (en) 2015-02-04

Similar Documents

Publication Publication Date Title
JP5446447B2 (en) SAFETY CONTROL DEVICE AND SAFETY CONTROL METHOD
US8706265B2 (en) Safety controller and safety control method
US8880201B2 (en) Safety controller and safety control method
US8756606B2 (en) Safety controller and safety control method in which time partitions are scheduled according to a scheduling pattern
US20120198464A1 (en) Safety controller and safety control method
JP5240402B2 (en) SAFETY CONTROL DEVICE AND SAFETY CONTROL METHOD
JP5664530B2 (en) Operation check method of control device and memory protection device
JP5621857B2 (en) SAFETY CONTROL DEVICE AND SAFETY CONTROL METHOD
JP5834935B2 (en) SAFETY CONTROL DEVICE AND SAFETY CONTROL METHOD
JP5845902B2 (en) Information processing apparatus and memory access management method
JP5712907B2 (en) Operation check method of control device, information processing device and memory management device
JP5906584B2 (en) Control apparatus and control method
JP6004057B2 (en) Information processing apparatus and DMA controller operation check method
JP5633501B2 (en) Control apparatus and control method
JP2013140476A (en) Information processing device, access authority giving method, program generation device, and method therefor
JP2014211689A (en) Safety control device and safety control method
JP5803689B2 (en) Information processing apparatus and DMA controller operation check method
JP5811865B2 (en) Control device and program execution method
JP5853716B2 (en) Information processing apparatus and task control method
JP5699910B2 (en) Control apparatus and control method
JP4340669B2 (en) INPUT / OUTPUT CONTROL DEVICE, INPUT / OUTPUT CONTROL METHOD, PROCESS CONTROL DEVICE, AND PROCESS CONTROL METHOD
JP5849731B2 (en) Information processing apparatus and data storage method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20140117

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20140731

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140819

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20141009

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20141124

R151 Written notification of patent or utility model registration

Ref document number: 5664530

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

LAPS Cancellation because of no payment of annual fees