[go: up one dir, main page]

JP5845902B2 - Information processing apparatus and memory access management method - Google Patents

Information processing apparatus and memory access management method Download PDF

Info

Publication number
JP5845902B2
JP5845902B2 JP2012000087A JP2012000087A JP5845902B2 JP 5845902 B2 JP5845902 B2 JP 5845902B2 JP 2012000087 A JP2012000087 A JP 2012000087A JP 2012000087 A JP2012000087 A JP 2012000087A JP 5845902 B2 JP5845902 B2 JP 5845902B2
Authority
JP
Japan
Prior art keywords
task
authority
access
authority information
safety
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.)
Expired - Fee Related
Application number
JP2012000087A
Other languages
Japanese (ja)
Other versions
JP2013140477A (en
Inventor
平 哲也
哲也 平
浩司 尾藤
浩司 尾藤
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 JP2012000087A priority Critical patent/JP5845902B2/en
Publication of JP2013140477A publication Critical patent/JP2013140477A/en
Application granted granted Critical
Publication of JP5845902B2 publication Critical patent/JP5845902B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Storage Device Security (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Description

本発明は、情報処理装置及びメモリアクセス管理方法に関し、特に複数のタスクのいずれかによる、メモリに含まれる複数の領域のいずれかに対するアクセス権限を示す権限情報を、所定数だけ格納して、タスクからのメモリアクセスを管理する情報処理装置及びメモリアクセス管理方法に関する。   The present invention relates to an information processing device and a memory access management method, and in particular, stores a predetermined number of authority information indicating access authority to any of a plurality of areas included in a memory by any of a plurality of tasks, The present invention relates to an information processing apparatus and a memory access management method for managing memory access from a computer.

サービスロボットは、外界センサや自己診断装置によって安全状態を常時監視し、何らかの危険を検知した場合に適切な安全制御ロジックを実行することで、機能安全を確保する必要がある。   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.

タイム・パーティショニングを採用するオペレーティングシステムでは、図14に例示するように、タイムパーティションを切り替えることで、動作するアプリケーションも切り替えられる。図14では、「TP1」、「TP2」、「TP3」は、タイムパーティションを示し、「T1」、「T2」、「T3」のそれぞれは、TP1〜TP3のそれぞれに属するタスクを示している。なお、タスクは、非安全関連アプリケーション又は安全関連アプリケーションを実行することによって生成されているものとする。   In an operating system that employs time partitioning, as illustrated in FIG. 14, the operating application can be switched by switching the time partition. In FIG. 14, “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.

図14では、TP1に属するT1は、非安全関連アプリケーションによって生成されており、TP2に属するT2は、安全関連アプリケーションによって生成されているものとする。この場合、機能安全上、非安全関連系であるTP1に属するT1は、安全関連系であるTP2のリソースパーティションにアクセスすることを抑止する必要がある。   In FIG. 14, 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が有するメモリ保護機能を利用すれば、タイムパーティションのそれぞれに、そのタイムパーティションに対応するリソースパーティションに対するアクセス権限を付与することで、リソース・パーティショニングを行うことができる。具体的には、図15に示すように、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. 15, 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は、アクセス権限が定義されたテーブルを参照することによって、あるタスクがメモリ上のある領域にアクセスしたときに、そのタスクがその領域に対するアクセス権限を有しているか否かを判定して、メモリを保護している。このテーブルは、一般的には、複数のエントリを有しており、1つのエントリは、いずれか1つのタスクによる、メモリ内のいずれか1つのページ(領域)に対するアクセス権限を示す情報が含まれている。このテーブルは、MMUでは、TLB(Translation Look-aside Buffer)と呼ばれている。   Here, when the MMU and MPU access a certain area in the memory by referring to the table in which the access authority is defined, whether or not the task has the access authority to the area. To protect the memory. This table generally has a plurality of entries, and one entry includes information indicating access authority to any one page (area) in the memory by any one task. ing. This table is called TLB (Translation Look-aside Buffer) in the MMU.

以下、MMUの場合について説明する。MMUは、あるタスクからメモリ上のあるページに対するアクセスがあったとき、TLBを参照して、そのタスクがそのページに対してアクセス権限を有しているか否かを判定する。そして、MMUは、アクセス権限を有していないと判定した場合、そのアクセスをTLB保護違反(メモリ保護違反)として検出する。   Hereinafter, the case of MMU will be described. When a certain task accesses a certain page in the memory, the MMU refers to the TLB and determines whether or not the task has the access authority to the page. If the MMU determines that the user does not have access authority, the MMU detects the access as a TLB protection violation (memory protection violation).

しかしながら、MMUは、あるタスクからメモリ上のあるページに対するアクセスがあったときに、そのタスクによるそのページに対するアクセス権限を示すエントリがTLBに存在しない場合、それをTLBミスヒットとして検出する。TLBミスヒットを検出した場合には、そのアクセス権限を示す情報を作成して、TLBのいずれかのエントリに格納するという処理が発生してしまう。そして、再度、同一のメモリアクセスが発行され、新たに格納した情報に基づいてアクセス権限を判定する、ということが行われている。このように、TLBミスヒットが発生した場合には、メモリアクセスが、少なくとも、そのアクセス権限を示す情報を作成して、TLBに格納するまでは遅延することになる。また、この情報を作成するための処理時間は不確定である。そのため、直ぐに実行する必要がある処理が遅延してしまうという問題があった。例えば、安全関連アプリケーションのタスクは、機能安全の確保に関する処理を実行する関係上、その処理が遅延してしまうことは好ましくない。   However, when there is an access to a certain page in the memory from a certain task, the MMU detects this as a TLB miss if there is no entry in the TLB indicating the access authority for that page by that task. When a TLB miss is detected, information indicating the access authority is created and stored in any entry in the TLB. Then, the same memory access is issued again, and the access authority is determined based on the newly stored information. Thus, when a TLB miss occurs, the memory access is delayed until at least information indicating the access authority is created and stored in the TLB. Also, the processing time for creating this information is indeterminate. Therefore, there is a problem that processing that needs to be executed immediately is delayed. For example, it is not preferable for the safety-related application task to be delayed due to the execution of the process related to ensuring functional safety.

ここで、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 object thereof is to provide an information processing apparatus and a memory access management method that can reduce the probability that memory access by a specific task is delayed.

本発明の第1の態様にかかる情報処理装置は、複数の領域を含むメモリと、複数のタスクを実行するタスク実行部と、前記複数のタスクのいずれかによる前記複数の領域のいずれかに対するアクセス権限を示す権限情報を、所定数だけ格納可能な記憶部と、前記タスク実行部から前記タスクによる前記領域に対するアクセスがあったとき、当該タスクによる当該領域に対するアクセス権限を示す権限情報が前記記憶部に格納されているか否かを判定して、当該権限情報が格納されている場合は、当該権限情報に基づいて前記アクセス権限を判定し、当該権限情報が格納されていない場合は、前記アクセス権限の判定を可能とするために、当該タスクによる当該領域に対するアクセス権限を示す権限情報を前記記憶部に格納するアクセス管理部と、を備え、前記複数のタスクは、第1のタスクと、当該第1のタスクよりも実行の遅延が許容される第2のタスクとを含み、前記アクセス管理部は、前記第1のタスクに関する権限情報を前記記憶部に格納するときに、前記記憶部に格納された権限情報のいずれかを上書きする必要がある場合は、前記第1のタスクに関する権限情報と前記第2のタスクに関する権限情報のうち、前記第2のタスクに関する権限情報を優先的に上書きするものである。   An information processing apparatus according to a first aspect of the present invention includes a memory including a plurality of areas, a task execution unit that executes a plurality of tasks, and access to any of the plurality of areas by any of the plurality of tasks. A storage unit capable of storing a predetermined number of authority information indicating authority, and when the task execution unit accesses the area by the task, authority information indicating an access authority to the area by the task is stored in the storage unit. If the authority information is stored, the access authority is determined based on the authority information. If the authority information is not stored, the access authority is determined. An access management unit that stores authority information indicating access authority to the area by the task in the storage unit The plurality of tasks includes a first task and a second task that is allowed to be delayed in execution as compared to the first task, and the access management unit relates to the first task. When it is necessary to overwrite any of the authority information stored in the storage unit when the authority information is stored in the storage unit, the authority information related to the first task and the authority information related to the second task Among them, the authority information related to the second task is preferentially overwritten.

本発明の第2の態様にかかるメモリアクセス管理方法は、複数のタスクのうちのいずれかのタスクから、メモリに含まれる複数の領域のうちのいずれか領域に対するアクセスがあったとき、当該タスクによる当該領域に対するアクセス権限を示す権限情報が、前記複数のタスクのいずれかによる前記複数の領域のいずれかに対するアクセス権限を示す権限情報を所定数だけ格納可能な記憶部に格納されているか否かを判定する情報判定ステップと、前記権限情報が格納されている判定した場合は、当該権限情報に基づいて前記アクセス権限を判定する権限判定ステップと、前記権限情報が格納されていないと判定した場合は、前記アクセス権限の判定を可能とするために、前記アクセスをしたタスクによる前記アクセス先の領域に対するアクセス権限を示す権限情報を前記記憶部に格納する情報格納ステップと、を備え、前記複数のタスクは、第1のタスクと、当該第1のタスクよりも実行の遅延が許容される第2のタスクとを含み、前記情報格納ステップでは、前記第1のタスクに関する権限情報を前記記憶部に格納するときに、前記記憶部に格納された権限情報のいずれかを上書きする必要がある場合は、前記第1のタスクに関する権限情報と前記第2のタスクに関する権限情報のうち、前記第2のタスクに関する権限情報を優先的に上書きするものである。   The memory access management method according to the second aspect of the present invention is based on a task when any one of a plurality of tasks accesses any one of a plurality of regions included in the memory. Whether authority information indicating access authority for the area is stored in a storage unit capable of storing a predetermined number of authority information indicating access authority for any of the plurality of areas by any of the plurality of tasks. If it is determined that the authority information is stored and the authority information is stored, the authority determining step is to determine the access authority based on the authority information, and if it is determined that the authority information is not stored. In order to make it possible to determine the access authority, an access to the access destination area by the accessed task is performed. An information storage step of storing authority information indicating a task authority in the storage unit, wherein the plurality of tasks includes a first task and a second task that is allowed to be delayed in execution as compared to the first task. In the information storing step, when storing the authority information related to the first task in the storage unit, if any of the authority information stored in the storage unit needs to be overwritten, Of the authority information related to the first task and the authority information related to the second task, the authority information related to the second task is preferentially overwritten.

上述した本発明の各態様によれば、特定のタスクによるメモリアクセスが遅延する確率を低減することができる情報処理装置及びメモリアクセス管理方法を提供することができる。   According to each aspect of the present invention described above, it is possible to provide an information processing apparatus and a memory access management method capable of reducing the probability that memory access by a specific task is delayed.

発明の実施の形態にかかる安全制御装置の構成例を示すブロック図である。It is a block diagram which shows the structural example of the safety control apparatus concerning embodiment of invention. 発明の実施の形態におけるタイム・パーティショニングの概念を説明するための図である。It is a figure for demonstrating the concept of the time partitioning in embodiment of invention. 発明の実施の形態におけるリソース・パーティショニングの概念を説明するための概念図である。It is a conceptual diagram for demonstrating the concept of the resource partitioning in embodiment of invention. 発明の実施の形態にかかるMMUの構成例を示すブロック図である。It is a block diagram which shows the structural example of MMU concerning embodiment of invention. 発明の実施の形態にかかるTLBの一例を示す図である。It is a figure which shows an example of TLB concerning embodiment of invention. 発明の実施の形態にかかるASIDのWildへの変換例を示す図である。It is a figure which shows the example of conversion to the Wild of ASID concerning embodiment of invention. 発明の実施の形態におけるパーティションスケジューラとタスクとの関係を示す図である。It is a figure which shows the relationship between the partition scheduler and task in embodiment 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. 発明の実施の形態にかかるパーティションスケジューラの処理手順の具体例を示すフローチャートである。It is a flowchart which shows the specific example of the process sequence of the partition scheduler concerning embodiment of invention. 本発明の実施の形態にかかるエントリ情報登録処理の処理手順の具体例を示すフローチャートである。It is a flowchart which shows the specific example of the process sequence of the entry information registration process concerning embodiment of this invention. 本発明の実施の形態にかかるメモリアクセス処理の処理手順の具体例を示すフローチャートである。It is a flowchart which shows the specific example of the process sequence of the memory access process concerning embodiment of this 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の構成例を示すブロック図である。
<Embodiment 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のあるアドレスに対するアクセスがあったときに、そのアクセスがそのアドレスに対するアクセス権限を有しているか否かを判定する。そして、そのアクセスがそのアドレスに対するアクセス権限を有していない場合には、そのアクセスをTLB保護違反(メモリ保護違反)として検出するとともに、TLB保護違反をプロセッサ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. When the access does not have the access authority for the address, the access is detected as a TLB protection violation (memory protection violation), and the processor 10 is notified of the TLB 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は、そのアクセスをTLB保護違反として検出する。アクセス権限は、実行用メモリ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. Thereby, for example, when a task belonging to RP1 accesses the area of the execution memory 11 assigned to RP2, the MMU 14 detects the access as a TLB 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.

図4は、MMU14の構成例を示すブロック図である。MMU14は、制御部141及びTLB142を有する。ここで、アクセス権限及び仮想アドレスに対応する物理アドレスは、プロセッサ10によって、MMU14が有するTLB142に設定される。TLB142は、例えば、MMU14が有するレジスタ及びメモリ等の記憶装置である。TLB142は、複数のエントリを含んでいる。なお、図4では、TLB142のエントリ数が64の場合について例示しているが、TLB142のエントリ数は、これに限られない。1エントリには、1つのページについての内容が設定される。1エントリには、ASID(アドレス空間識別子:Address Space Identification)、仮想アドレス、その仮想アドレスに対応する物理アドレス、そのASIDのタスクによるその物理アドレスのページに対するアクセス権限等が設定される。   FIG. 4 is a block diagram illustrating a configuration example of the MMU 14. The MMU 14 includes a control unit 141 and a TLB 142. Here, the physical address corresponding to the access authority and the virtual address is set by the processor 10 in the TLB 142 included in the MMU 14. The TLB 142 is a storage device such as a register and a memory included in the MMU 14, for example. The TLB 142 includes a plurality of entries. 4 illustrates the case where the number of entries in the TLB 142 is 64, the number of entries in the TLB 142 is not limited to this. 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 of the physical address by a task of the ASID, and the like are set.

ASIDは、RPごとに一意に定められた値をとる。なお、本実施の形態では、1つのTPに1つのRPが対応することになるため、ASIDは、TPごとに一意に定められた値ともなる。TLB142における仮想アドレスとして、仮想アドレスのうち、ページを特定可能な一定の範囲を示す仮想ページ番号が設定されることが一般的である。物理アドレスについても同様である。この場合は、仮想アドレスのうち、仮想ページ番号に該当する範囲を物理ページ番号とされているアドレスに置き換え、その他のオフセットアドレスを示す範囲をそのまま用いることで、仮想アドレスを物理アドレスに変換することができる。アクセス権限としては、データの読み出し権限、データの書き込み権限、及び、データ(命令)の実行権限の有無を設定することができる。すなわち、アクセス権限は、アクセス種別(読み出し、書き込み、又は実行)ごとに、その有無を設定することが可能である。   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 142, 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の制御部141は、TLB142を参照して、指定されたASIDが設定されており、指定された仮想アドレスが設定されており(又は仮想ページ番号が一致する)、かつ、指定されたアクセス種別の権限が有りに設定されているエントリを検出できた場合、そのアクセスを許容する。この場合、制御部141は、検出したエントリに基づいて、アクセスにおいて指定された仮想アドレスを物理アドレスに変換して、変換後の物理アドレスとアクセス種別を指定したアクセスを実行用メモリ11に発行する。すなわち、物理アドレス及びアクセス種別のそれぞれを示す信号が実行用メモリ11に出力される。また、アクセス種別が書き込みである場合は、さらに実行用メモリ11に書き込むデータも指定される。   The control unit 141 of the MMU 14 refers to the TLB 142, the designated ASID is set, the designated virtual address is set (or 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 control unit 141 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に発行する。制御部141は、上述と同様に、アドレスの変換及びアクセス権限のチェックを行う。すなわち、ここでのチェックでは、データ(命令)の実行権限の有無が判定される。そして、制御部141は、そのアクセスを許容する場合、変換後の物理アドレスを指定したアクセスを実行用メモリ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 control unit 141 performs address conversion and access authority check in the same manner as described above. That is, in this check, it is determined whether or not there is an authority to execute data (command). When the access is permitted, the control unit 141 issues an access designating 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).

一方、制御部141は、TLB142を参照して、アクセスで指定された仮想アドレスが設定されており(又は仮想ページ番号が一致する)、かつ、指定されたASIDが設定されているエントリを検出したが、そのエントリにおいて、指定されたアクセス種別の権限が有りに設定されていない場合は、TLB保護違反を検出する。なお、アクセスで指定された仮想アドレス及び指定されたASIDが設定されているエントリを検出できなかった場合は、TLBミスヒットが検出されることになる。   On the other hand, the control unit 141 refers to the TLB 142 and detects an entry in which the virtual address designated by access is set (or the virtual page number matches) and the designated ASID is set. However, if the authority of the designated access type is not set to “Yes” in the entry, a TLB protection violation is detected. If an entry in which a virtual address designated by access and a designated ASID are set cannot be detected, a TLB miss is detected.

制御部141は、TLBミスヒットを検出した場合、TLBミスヒットをプロセッサ10に通知する。また、制御部141は、TLBのエントリの中から、更新対象となるエントリを選択する。プロセッサ10は、制御部141からのTLBミスヒットの通知に応じて、TLBミスヒットとなったアクセスで指定していたASID及び仮想アドレスに基づいて、TLB142のエントリの情報(以下、「エントリ情報」とも呼ぶ)を作成する。この情報は、TLBミスヒットとなったアクセスで指定していたASID及び仮想アドレス、その仮想アドレスに対応する物理アドレス、そのASIDによるその物理アドレスで示されるページに対するアクセス権限を示す情報となる。プロセッサ10は、作成した情報をMMU14に出力する。制御部141は、プロセッサ10から出力された情報で、更新対象として選択したエントリを更新する。そして、プロセッサ10は、TLBミスヒットとなったアクセスと同一のアクセスを、再度、MMU14に発行する。これによって、TLBミスヒットが発生することなく、アクセス権限の判定が行われるようになる。   When detecting the TLB miss, the control unit 141 notifies the processor 10 of the TLB miss. Also, the control unit 141 selects an entry to be updated from the TLB entries. In response to the notification of the TLB miss from the control unit 141, the processor 10 receives the TLB 142 entry information (hereinafter referred to as “entry information”) based on the ASID and virtual address specified in the access that caused the TLB miss. Also called). This information is information indicating the ASID and virtual address specified by the access that caused the TLB miss, the physical address corresponding to the virtual address, and the access authority to the page indicated by the physical address by the ASID. The processor 10 outputs the created information to the MMU 14. The control unit 141 updates the entry selected as the update target with the information output from the processor 10. Then, the processor 10 issues the same access to the MMU 14 again as the access that becomes the TLB miss hit. As a result, the access authority is determined without causing a TLB miss.

ここで、本実施の形態では、遅延無く実行することが好ましいタスクに関するエントリには、図5に示すように、ASIDとして、そのようなタスクであることを示す値を設定する。以下、この値を「Wild」と呼ぶ。なお、遅延無く実行することが好ましいタスクとして、安全関連アプリケーションを実行することによって生成されるタスクが該当する。すなわち、安全関連アプリケーションから生成された安全関連のタスクのASIDは、Wildに変換されてTLBのエントリに格納される。制御部141は、更新対象となるエントリを選択する場合、ASIDとしてWildが設定されていないエントリを優先的に選択する。これによれば、遅延無く実行することが好ましい安全関連のタスクに関するエントリがTLB142に存在する確率を高めることができる。すなわち、エントリの更新のために安全関連のタスクによるメモリアクセスが遅延する確率を低減することができる。また、安全関連のタスクによるメモリアクセスが待たされて、安全関連のタスクにおける処理が遅延する確率を低減することができる。   In this embodiment, as shown in FIG. 5, a value indicating such a task is set as an ASID in an entry relating to a task that is preferably executed without delay. Hereinafter, this value is referred to as “Wild”. Note that a task that is generated by executing a safety-related application corresponds to a task that is preferably executed without delay. That is, the ASID of the safety-related task generated from the safety-related application is converted to Wild and stored in the TLB entry. When selecting an entry to be updated, the control unit 141 preferentially selects an entry in which Wild is not set as the ASID. According to this, it is possible to increase the probability that an entry related to a safety-related task that is preferably executed without delay exists in the TLB 142. That is, it is possible to reduce the probability that the memory access by the safety-related task is delayed due to the entry update. In addition, it is possible to reduce the probability that processing in the safety-related task is delayed due to waiting for memory access by the safety-related task.

ここで、図5では、TLB142のエントリにおいて、仮想アドレスと物理アドレスに同一のアドレスが設定されている場合について例示しているが、異なるアドレスを設定するようにしてもよい。また、このように、仮想アドレスから物理アドレスへの変換が不要である場合は、MMU14の仮想記憶管理機能を無効にして、MMU14を利用するようにしてもよい。この場合、プロセッサ10は、物理アドレスを指定してメモリアクセスを発行することになる。また、この場合、制御部141は、プロセッサ10からのアクセスで指定された物理アドレスをそのまま指定したアクセスを実行用メモリ11に発行する。この場合は、TLB142には、例えば、図5に示すように、仮想アドレスに物理アドレスと同一のアドレスを設定しておけばよい。または、MMU14がTLB142の物理アドレスを参照して、上述したエントリの検出を行うようにしてもよい。   Here, FIG. 5 illustrates the case where the same address is set as the virtual address and the physical address in the entry of the TLB 142, but different addresses may be set. As described above, when the conversion from the virtual address to the physical address is unnecessary, the virtual memory management function of the MMU 14 may be disabled and the MMU 14 may be used. In this case, the processor 10 issues a memory access by designating a physical address. In this case, the control unit 141 issues an access in which the physical address designated by the access from the processor 10 is designated as it is to the execution memory 11. In this case, in the TLB 142, for example, as shown in FIG. 5, the same address as the physical address may be set as the virtual address. Alternatively, the MMU 14 may detect the entry described above with reference to the physical address of the TLB 142.

ここで、図6を参照して、ASIDからのWildの生成方法について説明する。Wildは、ASIDの値のうち、予め定められた位置のビット値をオン"1"に変化させた値として生成される。例えば、ASIDの下位から17ビット目を変化させる場合、図6に示すように、ASIDが"0x0001"である場合は、Wildとして"0x0101"が生成され、ASIDが"0x0002"である場合は、Wildとして"0x0102"が生成される。これは、例えば、下位から17ビット目の値を反転させることによって生成するようにしてもよく、下位から17ビット目がオンとなっている値"0x0100"との論理和として生成するようにしてもよい。プロセッサ10は、安全関連のタスクに関するエントリの情報を生成する場合には、このようにASIDをWildに変換してエントリの情報を生成する。   Here, with reference to FIG. 6, a method for generating a Wild from an ASID will be described. Wild is generated as a value obtained by changing the bit value of a predetermined position to ON “1” among the values of ASID. For example, when changing the 17th bit from the lower order of the ASID, as shown in FIG. 6, when the ASID is “0x0001”, “0x0101” is generated as the Wild, and when the ASID is “0x0002”, “0x0102” is generated as the Wild. This may be generated, for example, by inverting the value of the 17th bit from the lower order, or generated as a logical sum with the value “0x0100” in which the 17th bit from the lower order is on. Also good. When the processor 10 generates the entry information related to the safety-related task, the processor 10 converts the ASID into the wild as described above to generate the entry information.

制御部141は、プロセッサ10からのメモリアクセスで指定されたASIDを検出する場合には、Wildであることを示すビット"1"を"0"にマスクしてから、指定されたASIDと比較する。例えば、図6に示す例では、下位から17ビット目の値を反転させることによってマスクするようにしてもよく、下位から17ビット目がオンとなっている値"0x0100"との論理和としてマスクするようにしてもよい。   When detecting the ASID designated by the memory access from the processor 10, the control unit 141 masks the bit “1” indicating “Wild” to “0” and then compares it with the designated ASID. . For example, in the example shown in FIG. 6, masking may be performed by inverting the value of the lower 17th bit, and masking as a logical sum with the value “0x0100” in which the lower 17th bit is on. You may make it do.

なお、Wildの生成方法は、通常のASIDの値との違いを識別することができれば、上述した生成方法に限られない。例えば、図6の例では、1ビットのみの値を変化させた場合について例示したが、複数のビット値をオン"1"に変化させるようにしてもよい。また、ASIDの特定のビット位置のビット値を参照することで、Wildの値と、それ以外の値とを区別することができれば、これらにも限定されない。例えば、Wildである場合には、特定のビット値がオフ"0"となっており、Wildでない場合には、そのビット値がオン"1"となっているようにしてもよい。   Note that the Wild generation method is not limited to the above-described generation method as long as the difference from the normal ASID value can be identified. For example, in the example of FIG. 6, the case where the value of only one bit is changed is illustrated, but a plurality of bit values may be changed to ON “1”. Further, the present invention is not limited to these, as long as it is possible to distinguish the Wild value from other values by referring to the bit value at a specific bit position of the ASID. For example, when it is Wild, the specific bit value may be off “0”, and when it is not Wild, the bit value may be on “1”.

なお、図1では、MMU14を、プロセッサ10の外部に有する場合について例示したが、プロセッサ10がMMU14を有するようにしてもよい。すなわち、プロセッサ10が、制御部141及びTLB142を有するようにしてもよい。   Although FIG. 1 illustrates the case where the MMU 14 is provided outside the processor 10, the processor 10 may include the MMU 14. That is, the processor 10 may include the control unit 141 and the TLB 142.

リセット回路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の起動により生成されるタスクと、の関係について、図7を用いて説明する。図7は、OS100によって提供されるマルチプログラミング環境で起動される、パーティションスケジューラ21とタスク24、26、28との関係を示す図である。   Subsequently, the relationship between the partition scheduler 21 and the tasks generated by starting up the applications 101 to 103 will be described with reference to FIG. FIG. 7 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、MMU14等を含む。なお、図7では、マイクロコントローラ20の外部にリセット回路15を備える構成を例示しているが、マイクロコントローラ20の内部にリセット回路15を含む構成としてもよい。   The microcontroller 20 includes a processor 10, an execution memory 11, an I / O port 12, a nonvolatile memory 13, an MMU 14, and the like. 7 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の設定を定めたスケジューリングパターンに従って、パーティション・スケジューリングを行う。   Specifically, partition scheduling by the partition scheduler 21 is described. The partition scheduler 21 refers to the scheduling table 22 and performs partition scheduling in accordance with 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”.

図8Aは、通常制御スケジューリングパターンの具体例を示している。図8Aでは、通常制御タスク26が属するTP2が1サイクル時間の前半(T1)に割り当てられている。また、安全監視タスク24が属するTP1が1サイクル時間の後半(T2)に割り当てられている。図8Aのスケジューリングパターンによれば、通常制御タスク26と安全監視タスク24が繰り返しスケジューリングされる。   FIG. 8A shows a specific example of the normal control scheduling pattern. In FIG. 8A, 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. 8A, the normal control task 26 and the safety monitoring task 24 are repeatedly scheduled.

図8Bは、安全制御スケジューリングパターンの具体例を示している。図8Bでは、安全制御タスク28が属するTP3が1サイクル時間の前半(T3)に割り当てられている。また、安全監視タスク24が属するTP1が1サイクル時間の後半(T4)に割り当てられている。図8Bのスケジューリングパターンによれば、安全制御タスク28と安全監視タスク24が繰り返しスケジューリングされる。   FIG. 8B shows a specific example of the safety control scheduling pattern. In FIG. 8B, 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. 8B, the safety control task 28 and the safety monitoring task 24 are repeatedly scheduled.

図7に戻り説明を続ける。タスクスケジューラ23、25、27は、それぞれが属するTP内でのタスクのスケジューリングを行う。各TP内でのタスクのスケジューリングには、一般的な優先度ベースのスケジューリングを適用すればよい。なお、図7では、各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. 7, each TP is illustrated as including only one task, but may include one or more tasks. For example, the normal control task A and the normal control task B may be included in the normal control TP2.

安全監視タスク24は、安全監視アプリケーション101の起動によって生成されるタスクである。図7の例では、安全監視タスク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. 7, 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の起動によって生成されるタスクである。図7の例では、通常制御タスク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. 7, 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の起動によって生成されるタスクである。図7の例では、安全制御タスク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. 7, 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.

以上より、安全監視タスク24及び安全制御タスク28は、タスクの実行状況及び制御対象等の監視や、機能安全を確保するために定められた制御等のように、制御対象の機能安全の確保に関する処理を実行するタスクとなる。それに対して、通常制御タスク26は、その他の制御対象の制御に関する処理を実行するタスクとなる。そのため、安全監視タスク24及び安全制御タスク28は、遅延無く実行することが好ましい安全関連のタスクとなり、通常制御タスク26は、安全監視タスク24及び安全制御タスク28と比較して、実行の遅延が許容される非安全関連のタスクとなる。   From the above, the safety monitoring task 24 and the safety control task 28 are related to ensuring the functional safety of the controlled object, such as monitoring the execution status of the task and the controlled object, and the control defined for ensuring functional safety. It becomes a task to execute processing. On the other hand, the normal control task 26 is a task for executing processing related to control of other control targets. Therefore, the safety monitoring task 24 and the safety control task 28 are safety-related tasks that are preferably executed without delay, and the normal control task 26 has an execution delay compared to the safety monitoring task 24 and the safety control task 28. This is an acceptable non-safety related task.

OS100は、TLB管理ルーチン29を含んでいる。TLB管理ルーチン29は、OS100の起動時、又は、MMU14からのTLBミスヒットの通知時などに、TLB142のエントリ情報を作成するルーチンである。具体的には、TLB管理ルーチン29は、MMU14からTLBミスヒットが通知されたときに、上述したように、そのTLBミスヒットを引き起こしたアクセスにおいて指定していたASID及び仮想アドレスに基づいて、TLB142のエントリ情報を作成する。そして、TLB管理ルーチン29は、作成したエントリ情報をMMU14に出力する。その結果、上述したように、制御部141によって、TLB142のいずれかのエントリがTLB管理ルーチン29から出力されたエントリ情報によって更新される。   The OS 100 includes a TLB management routine 29. The TLB management routine 29 is a routine for creating entry information of the TLB 142 when the OS 100 is started or when a TLB miss hit is notified from the MMU 14. Specifically, when the TLB miss is notified from the MMU 14, the TLB management routine 29, as described above, based on the ASID and virtual address specified in the access that caused the TLB miss, the TLB 142 Create entry information for. Then, the TLB management routine 29 outputs the created entry information to the MMU 14. As a result, as described above, one of the entries in the TLB 142 is updated by the control unit 141 with the entry information output from the TLB management routine 29.

上述したように、パーティションスケジューラ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によるパーティション・スケジューリングについて、図9を用いて説明する。図9は、発明の実施の形態1にかかるパーティションスケジューラ21の処理手順の具体例を示すフローチャートである。   Subsequently, partition scheduling by the partition scheduler 21 will be described with reference to FIG. FIG. 9 is a flowchart showing a specific example of the processing procedure of the partition scheduler 21 according to the first embodiment of the invention.

なお、図9では、通常制御スケジューリングパターン(例えば図8A)または安全制御スケジューリングパターン(例えば図8B)に従って、スケジューリングを実行する場合を例に説明する。すなわち、TP2またはTP3に続く次のTPはTP1であり、かつ、TP2での異常がTP1で検知された場合に、TP1からの結果を受けて次に選択・決定されるTPはTP3である場合を例に説明する。   In FIG. 9, a case where scheduling is executed according to a normal control scheduling pattern (for example, FIG. 8A) or a safety control scheduling pattern (for example, FIG. 8B) will be described as an example. 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.

図9で示した処理に関して、パーティション・スケジューリングの具体例を説明する。まず、図8Aに例示した通常制御スケジューリングパターンに従って、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. 8A, a 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.)

また、図8Bに例示した安全制御スケジューリングパターンに従って、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. 8B. 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 a plurality of 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.

続いて、図10を参照して、本発明の実施の形態にかかるエントリ情報登録処理の処理手順について説明する。図10は、本発明の実施の形態にかかるエントリ情報登録処理の処理手順の具体例を示すフローチャートである。   Next, with reference to FIG. 10, a processing procedure of entry information registration processing according to the embodiment of the present invention will be described. FIG. 10 is a flowchart showing a specific example of the processing procedure of the entry information registration processing according to the embodiment of the present invention.

OS100は、その起動時に、TLB管理ルーチン29を実行することによって、TLB142のエントリ情報の作成及び登録のための処理を開始する(S21)。なお、以降の処理は、OS100の起動時以外にも、TLBミスヒットが発生した場合にも実行される。まず、OS100は、TLB142のエントリ情報を作成する(S22)。このとき、OS100は、安全関連のTP(TP1、TP3)に属するタスクに関するエントリ情報(以下、「安全関連のTPのエントリ情報」も呼ぶ)を作成する場合には、上述したように、ASIDをWildに変換したエントリ情報を作成する。OS100は、作成したエントリ情報をMMU14に出力する。   The OS 100 starts a process for creating and registering entry information of the TLB 142 by executing the TLB management routine 29 at the time of startup (S21). The subsequent processing is executed not only when the OS 100 is started but also when a TLB miss occurs. First, the OS 100 creates entry information of the TLB 142 (S22). At this time, when the OS 100 creates entry information related to a task belonging to the safety-related TP (TP1, TP3) (hereinafter also referred to as “safety-related TP entry information”), the ASID is set as described above. Create entry information converted to Wild. The OS 100 outputs the created entry information to the MMU 14.

MMU14の制御部141は、OS100によってプロセッサ10から出力されたエントリ情報が、安全関連のTPに関するエントリ情報であるか否かを判定する(S23)。安全関連のTPに関するエントリ情報であるか否かは、例えば、エントリ情報のASIDがWildか否かによって判定する。   The control unit 141 of the MMU 14 determines whether the entry information output from the processor 10 by the OS 100 is entry information related to the safety-related TP (S23). Whether the entry information is related to the safety-related TP is determined by, for example, whether the ASID of the entry information is Wild.

エントリ情報が安全関連のTPに関するエントリ情報でない場合(S23でNo)、制御部141は、TLB142のエントリに空きがあるか否かを判定する(S24)。TLB142のエントリに空きがある場合(S24でYes)、制御部141は、空いているエントリのいずれかに、プロセッサ10から出力されたエントリ情報を格納する(S25)。これによって、ASIDがWildでない通常(非安全関連)のTP(TP2)に属するタスクに関するエントリ情報(以下、「通常のTPに関するエントリ情報」と呼ぶ)がTLB142に登録される。TLB142のエントリに空きがない場合(S24でNo)、制御部141は、通常のTPに関するエントリ情報のいずれかを排除して、そのエントリにプロセッサ10から出力されたエントリ情報を格納する(S26)。すなわち、制御部141は、通常のTPに関するエントリ情報が格納されたエントリのいずれかを更新対象のエントリとして選択し、選択したエントリを、プロセッサ10から出力されたエントリ情報で上書きする。これによって、ASIDがWildでない通常のTPのエントリ情報がTLB142に登録される。   When the entry information is not entry information related to the safety-related TP (No in S23), the control unit 141 determines whether or not there is an empty entry in the TLB 142 (S24). When there is an empty entry in the TLB 142 (Yes in S24), the control unit 141 stores the entry information output from the processor 10 in any of the empty entries (S25). As a result, entry information relating to a task belonging to a normal (non-safety related) TP (TP2) whose ASID is not Wild (hereinafter referred to as “entry information related to a normal TP”) is registered in the TLB 142. When there is no empty entry in the TLB 142 (No in S24), the control unit 141 eliminates any entry information related to normal TP and stores the entry information output from the processor 10 in the entry (S26). . That is, the control unit 141 selects any entry in which entry information related to normal TP is stored as an update target entry, and overwrites the selected entry with the entry information output from the processor 10. As a result, normal TP entry information whose ASID is not Wild is registered in the TLB 142.

エントリ情報が安全関連のTPに関するエントリ情報である場合(S23でYes)、制御部141は、TLB142に、安全関連のTPのエントリ情報が登録されていないエントリが2つ以上あるか否かを判定する(S27)。すなわち、通常のTPが格納されているエントリ及び空いているエントリが合計で2つ以上あるか否かを判定する。   When the entry information is entry information related to the safety-related TP (Yes in S23), the control unit 141 determines whether there are two or more entries in the TLB 142 in which the entry information of the safety-related TP is not registered. (S27). That is, it is determined whether there are a total of two or more entries storing normal TPs and vacant entries.

安全関連のTPのエントリ情報が登録されていないエントリが2つ以上ない場合(S27でNo)、制御部141は、安全関連のTPに関するエントリ情報のうち、実行回数が少ないアクセスに関するエントリ情報を排除して、そのエントリにプロセッサ10から出力されたエントリ情報を格納する(S28)。すなわち、制御部141は、安全関連のTPに関するエントリ情報のうち、実行回数が少ないアクセスに関するエントリ情報が格納されたエントリを更新対象のエントリとして選択し、選択したエントリを、プロセッサ10から出力されたエントリ情報で上書きする。これによって、ASIDがWildである安全関連のTPのエントリ情報がTLB142に登録される。   If there are no two or more entries in which the safety-related TP entry information is not registered (No in S27), the control unit 141 excludes the entry information related to access with a small number of executions from the entry information related to the safety-related TP. Then, the entry information output from the processor 10 is stored in the entry (S28). That is, the control unit 141 selects, as entry to be updated, an entry in which entry information related to access with a small number of executions is stored among entry information related to safety-related TPs, and the selected entry is output from the processor 10 Overwrite with entry information. As a result, the entry information of the safety-related TP whose ASID is Wild is registered in the TLB 142.

ここで、アクセスの実行回数は、実測値を用いてもよく、推定値を用いてもよい。例えば、実測値を用いる場合は、プロセッサ10から実行用メモリ11に対するアクセスがあったときに、そのアクセスで指定されたASID及び仮想アドレスから検出したエントリのエントリ情報に関するアクセスの実行回数をカウントアップすることで計測する。計測した実行回数は、エントリ情報と関連付けて、MMU14が有する記憶装置に格納しておき、S28での判定時に制御部141が参照可能としておけばよい。MMU14が有する記憶装置としては、レジスタ又はメモリ等の任意の記憶装置を用いてよい。   Here, the actual number of times of access execution may be used, or an estimated value may be used. For example, in the case of using an actual measurement value, when the processor 10 accesses the execution memory 11, the access execution count related to the entry information of the entry detected from the ASID and virtual address designated by the access is counted up. To measure. The measured number of executions may be stored in a storage device included in the MMU 14 in association with the entry information so that the control unit 141 can be referred to at the time of determination in S28. As a storage device included in the MMU 14, any storage device such as a register or a memory may be used.

また、例えば、推定値を用いる場合は、スケジューリングテーブル22に基づいて、スケジューリングパターンの1サイクルのうちで、TPがアクティブになる回数が多いTPに属するタスクは、アクセスの実行回数が多いと推定する。この場合、OS100が、さらに推定した実行回数も、その実行回数に対応するタスクのASIDを含むエントリ情報に設定するようにして、制御部141がそれを参照して判定するようにすればよい。なお、これらの実測値及び推定値は、一例であり、その他の方法で計測した実測値又は推定した推定値を利用するようにしてもよい。   Further, for example, when using an estimated value, it is estimated that a task belonging to a TP having a large number of times that the TP becomes active in one cycle of the scheduling pattern is based on the scheduling table 22 and has a large number of accesses. . In this case, the execution count further estimated by the OS 100 may be set in the entry information including the ASID of the task corresponding to the execution count, and the control unit 141 may determine it with reference to the entry information. Note that these actually measured values and estimated values are examples, and actual measured values or estimated estimated values measured by other methods may be used.

安全関連のTPのエントリ情報が登録されていないエントリが2つ以上ある場合(S27でYes)、制御部141は、TLB142のエントリに空きがあるか否かを判定する(S29)。TLB142のエントリに空きがある場合(S29でYes)、制御部141は、空いているエントリのいずれかに、プロセッサ10から出力されたエントリ情報を格納する(S30)。これによって、ASIDがWildである安全関連のTPのエントリ情報がTLB142に登録される。TLB142のエントリに空きがない場合(S29でNo)、制御部141は、通常のTPに関するエントリ情報のいずれかを排除して、そのエントリにプロセッサ10から出力されたエントリ情報を格納する(S31)。すなわち、制御部141は、通常のTPに関するエントリ情報が格納されたエントリのいずれかを更新対象のエントリとして選択し、選択したエントリを、プロセッサ10から出力されたエントリ情報で上書きする。これによって、ASIDがWildである安全関連のTPのエントリ情報がTLB142に登録される。   If there are two or more entries in which the safety-related TP entry information is not registered (Yes in S27), the control unit 141 determines whether or not there is an empty entry in the TLB 142 (S29). When there is an empty entry in the TLB 142 (Yes in S29), the control unit 141 stores the entry information output from the processor 10 in any of the empty entries (S30). As a result, the entry information of the safety-related TP whose ASID is Wild is registered in the TLB 142. When there is no empty entry in the TLB 142 (No in S29), the control unit 141 eliminates any entry information related to the normal TP and stores the entry information output from the processor 10 in the entry (S31). . That is, the control unit 141 selects any entry in which entry information related to normal TP is stored as an update target entry, and overwrites the selected entry with the entry information output from the processor 10. As a result, the entry information of the safety-related TP whose ASID is Wild is registered in the TLB 142.

一方、OS100は、全てのエントリ情報の登録(作成)が終わったか否かを判定する(S32)。全てのエントリの登録が終わっていない場合(S32でNo)、OS100は、次に登録するエントリ情報を作成する(S22)。以降、上述と同様の処理が繰り返される。全てのエントリの登録が終わった場合(S32でYes)、OS100は、TLB142のエントリ情報の作成を終了する(S33)。ここで、TLBミスヒットに応じて、以上に説明した処理が実行された場合は、1つのエントリ情報を登録したら、処理を終了することになる(S32でYes、S33)。   On the other hand, the OS 100 determines whether or not all entry information has been registered (created) (S32). If all the entries have not been registered (No in S32), the OS 100 creates entry information to be registered next (S22). Thereafter, the same processing as described above is repeated. When all the entries have been registered (Yes in S32), the OS 100 ends the creation of the entry information of the TLB 142 (S33). Here, when the processing described above is executed in response to a TLB miss, the processing ends when one entry information is registered (Yes in S32, S33).

以上に説明した処理手順によれば、S31のように、通常のTPに関するエントリ情報を優先的に排除して、安全関連のTPに関するエントリ情報を優先的に登録するようにしている。これによれば、遅延無く実行することが好ましい安全関連のタスクに関するエントリがTLB142に存在する確率を高めることができる。すなわち、エントリの更新のために安全関連のタスクによるメモリアクセスが遅延する確率を低減することができる。また、安全関連のタスクによるメモリアクセスが待たされて、安全関連のタスクにおける処理が遅延する確率を低減することができる。   According to the processing procedure described above, entry information related to a normal TP is preferentially excluded and entry information related to a safety-related TP is preferentially registered as in S31. According to this, it is possible to increase the probability that an entry related to a safety-related task that is preferably executed without delay exists in the TLB 142. That is, it is possible to reduce the probability that the memory access by the safety-related task is delayed due to the entry update. In addition, it is possible to reduce the probability that processing in the safety-related task is delayed due to waiting for memory access by the safety-related task.

ここで、上述した処理手順では、S27において、安全関連のTPに関するエントリ情報が登録されていないエントリが2つ以上ある場合に、それらのエントリのいずれかに安全関連のTPに関するエントリ情報を登録し、そうでない場合には、安全関連のTPに関するエントリ情報が登録されているエントリのいずれかにエントリ情報を登録するようにしている。これによって、全てのエントリに対して安全関連のTPに関するエントリ情報が優先的に登録され、通常のTPに関するエントリ情報が登録されなくならないようにしている。   Here, in the processing procedure described above, when there are two or more entries in which entry information related to safety-related TPs is not registered in S27, entry information related to safety-related TPs is registered in one of those entries. Otherwise, the entry information is registered in one of the entries in which entry information related to safety-related TPs is registered. As a result, entry information related to safety-related TPs is preferentially registered for all entries, and entry information related to normal TPs is not registered.

例えば、図4に例示するようにTLB142のエントリ数が64である場合、63個のエントリまでは、通常のTPに関するエントリ情報を優先的に排除して安全関連のTPに関するエントリ情報を登録するが、安全関連のTPに関するエントリ情報が登録されていないエントリが残り1個となった場合には、そのエントリは通常のTPに関するエントリ情報を登録するために残されることになる。すなわち、この例では、安全関連のTPに関するエントリ情報を登録することができるエントリの上限数が63となる。   For example, as illustrated in FIG. 4, when the number of entries in the TLB 142 is 64, entry information related to safety-related TPs is registered by preferentially excluding entry information related to normal TPs up to 63 entries. When there is one remaining entry in which no entry information related to safety-related TPs is registered, the entry is left for registering entry information related to normal TPs. That is, in this example, the upper limit number of entries in which entry information related to safety-related TPs can be registered is 63.

ここで、S27で判定するエントリ数は、2つ以上か否かには限られない。例えば、上述した例では、安全関連のTPに関するエントリ情報が上限数まで格納された場合、通常のTPに関するエントリ情報は、1つだけしかTLB142に格納されないことになる。例えば、このようにすると、通常のTPに関するエントリ情報の更新が頻発してしまい、悪影響がでてしまうような場合は、安全関連のTPに関するエントリ情報の上限数を下げるようにしてもよい。例えば、S27で判定するエントリ数を、4つ以上か否かとしてもよい。すなわち、安全関連のTPに関するエントリ情報の上限数として、任意の数を予め定めることができる。   Here, the number of entries determined in S27 is not limited to two or more. For example, in the above-described example, when up to the upper limit number of entry information related to safety-related TPs, only one entry information related to normal TPs is stored in the TLB 142. For example, in this case, when the entry information related to the normal TP is frequently updated and adversely affected, the upper limit number of entry information related to the safety-related TP may be lowered. For example, the number of entries determined in S27 may be four or more. That is, an arbitrary number can be predetermined as the upper limit number of entry information related to safety-related TPs.

また、以上に説明したようにして、安全関連のTPに関するエントリ情報の上限数を超える登録を抑止するようにしているが、その方法は、上述した方法には限られない。例えば、安全関連のTPに関するエントリ情報の登録が上限数に達するまでは、通常のTPに関するエントリ情報を優先的に排除して安全関連のTPに関するエントリ情報を登録するようにし、安全関連のTPに関するエントリ情報の登録が上限数に達しているときには、単純に、更新対象のエントリをランダムに選択する、実行回数が少ないエントリを選択する、又は、FIFO(First In First Out)で選択する等して更新対象のエントリを選択するようにしてもよい。   In addition, as described above, registration exceeding the upper limit number of entry information related to safety-related TPs is suppressed, but the method is not limited to the method described above. For example, until the registration of entry information related to safety-related TPs reaches the upper limit, entry information related to safety-related TPs is preferentially excluded and entry information related to safety-related TPs is registered. When the registration of entry information has reached the upper limit, simply select an entry to be updated at random, select an entry with a small number of executions, or select by FIFO (First In First Out), etc. The entry to be updated may be selected.

続いて、図11を参照して、本発明の実施の形態にかかるメモリアクセス処理の処理手順について説明する。図11は、本発明の実施の形態にかかるメモリアクセス処理の処理手順の具体例を示すフローチャートである。   Next, with reference to FIG. 11, a processing procedure of the memory access processing according to the embodiment of the present invention will be described. FIG. 11 is a flowchart showing a specific example of the processing procedure of the memory access processing according to the embodiment of the present invention.

アクティブになっているTPにおいて実行されているタスクが実行用メモリ11のあるページに対してアクセスする場合、OS100は、そのTPに対応するASID、そのページのアドレスを指定したアクセスをMMU14に発行する。MMU14の制御部141は、OS100によってプロセッサ10から発行されたアクセスにおいて指定されているASID及びアドレスと、同一のASID及びアドレスを示すエントリ情報が格納されているエントリを検索する(S41)。   When a task being executed in the active TP accesses a page in the execution memory 11, the OS 100 issues an access specifying the ASID corresponding to the TP and the address of the page to the MMU 14. . The control unit 141 of the MMU 14 searches for an entry in which entry information indicating the same ASID and address as the ASID and address specified in the access issued from the processor 10 by the OS 100 is stored (S41).

該当するエントリを検出できた場合(S42でNo)、制御部141は、検出したエントリの情報によって、発行されたアクセスのアクセス権限をチェックする(S43)。発行されたアクセスがアクセス権限を有していると判定した場合(S45でNo)、制御部141は、メモリアクセスを実行する(S46)。すなわち、制御部141は、指定されたアドレスを仮想アドレスから物理アドレスに変換してから、実行用メモリ11に対するアクセスを発行する。   When the corresponding entry is detected (No in S42), the control unit 141 checks the access authority of the issued access based on the detected entry information (S43). When it is determined that the issued access has access authority (No in S45), the control unit 141 executes memory access (S46). That is, the control unit 141 converts the designated address from a virtual address to a physical address, and then issues an access to the execution memory 11.

発行されたアクセスがアクセス権限を有していないと判定した場合(S45でYes)、制御部141は、TLB保護違反例外の通知をプロセッサ11に出力する(S47)。OS100は、MMU14からのTLB保護違反例外の通知に応じて、異常処置を行う。異常処置としては、任意の処理を実装するようにしてもよい。例えば、パーティションスケジューラ21が、スケジューリングパターンを安全制御スケジューリングパターンに切り替えて、安全制御タスク28によって制御対象を緊急停止させるように制御するようにしてもよい。   If it is determined that the issued access does not have access authority (Yes in S45), the control unit 141 outputs a notification of a TLB protection violation exception to the processor 11 (S47). The OS 100 performs an abnormality treatment in response to the notification of the TLB protection violation exception from the MMU 14. Arbitrary processing may be implemented as the abnormality treatment. For example, the partition scheduler 21 may switch the scheduling pattern to the safety control scheduling pattern and perform control so that the control target is urgently stopped by the safety control task 28.

一方、該当するエントリを検出できなかった場合(S42でYes)、制御部141は、TLBミスヒット例外の通知をプロセッサ11に出力する(S44)。OS100は、MMU14からのTLBミスヒットの通知に応じて、TLB管理ルーチン29を実行する。これによって、以下に説明する処理を実行する。   On the other hand, if the corresponding entry cannot be detected (Yes in S42), the control unit 141 outputs a TLB miss hit exception notification to the processor 11 (S44). The OS 100 executes the TLB management routine 29 in response to the notification of the TLB miss from the MMU 14. Thereby, the process described below is executed.

OS100は、TLBミスヒット例外が発生したアクセスのアクセス権限をチェックする(S48)。ここで、一般的に、TLB142のエントリ情報を作成するのはOS100であるため、OS100は、各タスクのASID、各タスクがアクセスするページ(仮想アドレス及び物理アドレス)、及び各タスクの各ページに対するアクセス権限の情報を有している、又は、参照可能である。そのため、その情報に基づいて、アクセス権限を判定すればよい。   The OS 100 checks the access authority of the access in which the TLB miss hit exception has occurred (S48). Here, generally, since the OS 100 creates entry information of the TLB 142, the OS 100 determines the ASID of each task, the page (virtual address and physical address) accessed by each task, and each page of each task. Has access authority information or can refer to it. Therefore, the access authority may be determined based on the information.

アクセス権限を有していないと判定した場合(S49でYes)、OS100は、TLB保護違反例外ハンドラへジャンプする(S51)。例えば、TLB保護違反例外ハンドラとして、上述したように異常処置を行う。   If it is determined that the user does not have access authority (Yes in S49), the OS 100 jumps to the TLB protection violation exception handler (S51). For example, as a TLB protection violation exception handler, an abnormality treatment is performed as described above.

アクセス権限を有していると判定した場合(S49でNo)、OS100は、TLBミスヒット例外を発生させたアクセスにおいて指定していたASID及びアドレスと、そのASIDによるそのアドレスに対するアクセス権限とを示すエントリ情報を作成する(S50)。OS100は、作成したエントリ情報をMMU14に出力する(S51)。これによって、MMU14の制御部141は、TLB142からエントリ情報の格納先のエントリを選択して、選択したエントリのエントリ情報を、OS100によってプロセッサ10から出力されたエントリ情報に差し替える。すなわち、エントリ情報を上書きする。このときに、図10を参照して説明したエントリ情報登録処理が実行されることになる。   If it is determined that the user has access authority (No in S49), the OS 100 indicates the ASID and address specified in the access that caused the TLB miss-hit exception, and the access authority for the address by the ASID. Entry information is created (S50). The OS 100 outputs the created entry information to the MMU 14 (S51). As a result, the control unit 141 of the MMU 14 selects the entry information storage destination entry from the TLB 142, and replaces the entry information of the selected entry with the entry information output from the processor 10 by the OS 100. That is, the entry information is overwritten. At this time, the entry information registration process described with reference to FIG. 10 is executed.

なお、MMU14は、更新対象のエントリをプロセッサ10からのエントリ情報の出力に応じて選択するようにしてもよく、TLBミスヒットを検出したときに、前もって選択しておくようにしてもよい。   Note that the MMU 14 may select an entry to be updated in accordance with the output of entry information from the processor 10, or may select in advance when a TLB miss is detected.

プロセッサ10は、TLBミスヒット例外を起こした命令(アドレス)に帰還する(S52)。すなわち、プロセッサ10は、TLBミスヒット例外を起こしたメモリアクセスを、再度、MMU14に発行する。これによって、TLBミスヒットが発生することなく(S42でNo)、アクセス権限の判定(S45)が行われるようになる。   The processor 10 returns to the instruction (address) that caused the TLB miss hit exception (S52). That is, the processor 10 issues the memory access that caused the TLB miss hit exception to the MMU 14 again. As a result, the determination of access authority (S45) is performed without causing a TLB miss (No in S42).

<発明の他の実施の形態>
本実施の形態では、TPのそれぞれに属するタスクが、それぞれ安全監視タスク24、通常制御タスク26、及び安全制御タスク28である場合について例示したが、タスクの種類は、これに限られない。安全監視タスク24、通常制御タスク26及び安全制御タスク28に限られず、その他の制御対象の制御に関する任意の処理を実行するタスクを有するようにしてもよい。
<Other embodiments of the invention>
In the present embodiment, the case where the tasks belonging to each of the TPs are the safety monitoring task 24, the normal control task 26, and the safety control task 28, respectively, is illustrated, but the types of tasks are not limited thereto. 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 an arbitrary process related to the control of another control target.

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

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

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

図12の例では、監視制御タスク30及び安全制御タスク32は、制御対象の監視や、機能安全を確保するために定められた制御計算等のように、制御対象の機能安全の確保に関する処理を実行するタスクとなる。それに対して、通常制御タスク31は、その他の制御対象の制御に関する処理を実行するタスクとなる。そのため、監視制御タスク30及び安全制御タスク32は、遅延無く実行することが好ましい安全関連のタスクとなり、通常制御タスク31は、監視制御タスク30及び安全制御タスク32と比較して、実行の遅延が許容される非安全関連のタスクとなる。すなわち、図12に示す場合は、図10に示すエントリ情報登録処理において、監視制御タスク30及び安全制御タスク32は、安全関連のTPに属するタスクとして処理され、通常制御タスク31は、通常(非安全関連)のTPに属するタスクとして処理される。   In the example of FIG. 12, the monitoring control task 30 and the safety control task 32 perform processing related to ensuring the functional safety of the controlled object, such as monitoring of the controlled object and control calculation determined to ensure functional safety. A task to be executed. On the other hand, the normal control task 31 is a task that executes processing related to control of other control targets. Therefore, the monitoring control task 30 and the safety control task 32 are safety-related tasks that are preferably executed without delay, and the normal control task 31 has an execution delay compared to the monitoring control task 30 and the safety control task 32. This is an acceptable non-safety related task. That is, in the case shown in FIG. 12, in the entry information registration process shown in FIG. 10, the monitoring control task 30 and the safety control task 32 are processed as tasks belonging to the safety-related TP, and the normal control task 31 is normal (non- It is processed as a task belonging to the TP of safety-related).

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

監視タスク33は、制御対象のセンサから、センサ値を取得する。このセンサには、上述したように制御対象の姿勢を検知するための姿勢センサを含む。ここで説明する例では、制御対象として、人が搭乗することができる走行装置に適用した場合について説明する。この場合、監視タスク33は、搭乗者による重心移動を姿勢センサにより検知することができる。監視タスク33は、取得したセンサ値をHMI(Human Machine Interface)タスク35に出力する。   The monitoring task 33 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 33 can detect the movement of the center of gravity by the passenger using the posture sensor. The monitoring task 33 outputs the acquired sensor value to an HMI (Human Machine Interface) task 35.

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

図13の例では、監視タスク33、HMIタスク35及び制御タスク34によって、制御対象の監視、それに応じた制御計算、制御計算結果に基づいた制御対象の制御を行うことで、状況によっては制御対象の機能安全の確保に関する処理を実行する。そのため、監視タスク33、HMIタスク35及び制御タスク34は、遅延無く実行することが好ましい安全関連のタスクとなる。この場合には、TP1〜TP3以外のTP(図示せず)に属する、その他の制御対象の制御に関する処理を実行するタスクが、監視タスク33、HMIタスク35及び制御タスク34と比較して、実行の遅延が許容される非安全関連のタスクとなる。すなわち、図13に示す場合は、図10に示すエントリ情報登録処理において、監視タスク33、HMIタスク35及び制御タスク34は、安全関連のTPに属するタスクとして処理される。   In the example of FIG. 13, the monitoring task 33, the HMI task 35, and the control task 34 monitor the control target, perform control calculation according to the control target, and control the control target based on the control calculation result. Execute processing related to ensuring functional safety. Therefore, the monitoring task 33, the HMI task 35, and the control task 34 are safety-related tasks that are preferably executed without delay. In this case, a task that executes processing related to control of another control target belonging to a TP (not shown) other than TP1 to TP3 is executed in comparison with the monitoring task 33, the HMI task 35, and the control task 34. This is a non-safety-related task in which delay is allowed. That is, in the case shown in FIG. 13, in the entry information registration process shown in FIG. 10, the monitoring task 33, the HMI task 35, and the control task 34 are processed as tasks belonging to the safety-related TP.

ここで、図13において説明した構成によれば、搭乗者の操作に応じて制御対象が制御されるというHMIを実現することができる。例えば、搭乗者が重心を前後に移動させることで制御対象が前後後退を行い、搭乗者が重心を左右に移動させることで制御対象が左右旋回を行うといった制御が可能となる。これについては、実施の形態及び図12によって説明した例についても同様のことが言える。具体的には、安全監視タスク24又は監視制御タスク34が取得したセンサ値に応じて、通常制御タスク26及び安全制御タスク28、もしくは、通常制御タスク31及び安全制御タスク32が同様の制御をすることで、HMIを実現することが可能である。また、本実施の形態によれば、安全関連のタスクの実行遅延確率を低減して、より信頼性を向上した制御対象の制御を行うことが可能となる。そのため、以上に説明したように、人が搭乗することができる走行装置を制御対象として適用することで、より安全性を向上した制御対象の制御を行うことが可能となる。   Here, according to the configuration described with reference to FIG. 13, 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 example described with reference to the embodiment and FIG. Specifically, the normal control task 26 and the safety control task 28, or the normal control task 31 and the safety control task 32 perform the same control according to the sensor value acquired by the safety monitoring task 24 or the monitoring control task 34. Thus, HMI can be realized. Further, according to the present embodiment, it is possible to reduce the execution delay probability of the safety-related task and 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.

なお、本発明は上記実施の形態に限られたものではなく、趣旨を逸脱しない範囲で適宜変更することが可能である。   Note that the present invention is not limited to the above-described embodiment, and can be changed as appropriate without departing from the spirit of the present invention.

本実施の形態では、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が一意に定義されることになる。   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.

本実施の形態では、タイム・パーティショニングを採用したマルチタスク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によってメモリ保護機能を実装する場合について例示したが、これに限られない。例えば、MPUによってメモリ保護機能を実装するようにしてもよい。MPUによって実装する場合、仮想記憶管理機能を有していないため、MPUが有するテーブルのエントリには、ASID、アドレス、そのASIDのタスクによるそのアドレスのページに対するアクセス権限等が設定されることになる。   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. When implemented by the MPU, since it does not have a virtual memory management function, the ASID, the address, the access authority for the page of the address by the task of the ASID, etc. are set in the entry of the MPU. .

本実施の形態では、安全関連のタスクのASIDを、Wildに変換するようにしているが、Wildへの変換を行わないようにしてもよい。この場合、MMU14が安全関連のタスクのASIDを認識しておくようにすることで、優先的に排除してもよいエントリ情報を判定することを可能とする。例えば、MMU14が、安全関連のタスクのASIDの一覧を記憶する記憶装置を有するようにし、それらのASIDと照合することで安全関連のタスクのASIDが設定されたエントリを判定するようにすればよい。なお、この場合、安全関連のタスクのASIDの一覧は、MMU14が、OS100から取得して記憶装置に格納するようにすればよい。また、MMU14が、安全関連以外のタスクのASIDの一覧を記憶する記憶装置を有するようにし、それらのASIDと照合することで安全関連のASIDが設定されたエントリを判定するようにしてもよい。ただし、好ましくは、本実施の形態のように、安全関連のタスクのASIDを、予め定められた位置のビット値を変化させた値とすることで、そのビット値のみを確認するだけで、優先的に排除してもよいエントリ情報が判定可能となる。これによれば、安全関連のタスクに関するエントリ情報を判定する処理を簡易にすることができる。   In the present embodiment, the ASID of the safety-related task is converted to Wild, but the conversion to Wild may not be performed. In this case, by making the MMU 14 recognize the ASID of the safety-related task, it is possible to determine entry information that may be preferentially excluded. For example, the MMU 14 may have a storage device that stores a list of ASIDs of safety-related tasks, and an entry in which the ASIDs of safety-related tasks are set may be determined by checking those ASIDs. . In this case, the list of ASIDs of safety-related tasks may be acquired by the MMU 14 from the OS 100 and stored in the storage device. Further, the MMU 14 may include a storage device that stores a list of ASIDs of tasks other than safety-related tasks, and an entry in which a safety-related ASID is set may be determined by collating with those ASIDs. However, preferably, as in the present embodiment, the ASID of the safety-related task is set to a value obtained by changing the bit value at a predetermined position, so that only the bit value is confirmed and priority is given. The entry information that can be excluded automatically can be determined. According to this, it is possible to simplify the process of determining entry information related to a safety-related task.

本実施の形態では、MMU14が更新対象のエントリを選択するようにしているが、これに限られない。例えば、OS100(TLB管理ルーチン29)で、更新対象のエントリを選択して、選択したエントリにエントリ情報を格納するようにMMU14に指示するようにしてもよい。   In this embodiment, the MMU 14 selects an entry to be updated, but the present invention is not limited to this. For example, the OS 100 (TLB management routine 29) may select the update target entry and instruct the MMU 14 to store the entry information in the selected entry.

本実施の形態では、制御対象の機能安全の確保に関する処理を実行する安全関連のタスクと、その他の制御対象の制御に関する処理を実行する非安全関連のタスクとで、TLB142にエントリ情報を優先的に残すタスクとそうでないタスクとを区分するようにしているが、この区分はこれに限られない。これ以外でも、遅延無く実行することが好ましいタスクと、そのタスクよりも実行の遅延が許容されるタスクとが存在するシステムであれば、同様にして適用することができる。   In this embodiment, entry information is given priority to the TLB 142 in a safety-related task that executes a process related to ensuring functional safety of a control target and a non-safety-related task that executes a process related to control of another control target. However, this task is not limited to this. Other than this, if the system includes a task that is preferably executed without delay and a task in which execution delay is allowed more than that task, the system can be similarly applied.

1 安全制御装置
10 プロセッサ
11 実行用メモリ
12 I/Oポート
13 不揮発性メモリ
14 MMU
15 リセット回路
20 マイクロコントローラ
21 パーティションスケジューラ
22 スケジューリングテーブル
23、25、27 タスクスケジューラ
24 安全監視タスク
26、31 通常制御タスク
28、32 安全制御タスク
29 TLB管理ルーチン
30 監視制御タスク
33 監視タスク
34 制御タスク
35 HMIタスク
100 オペレーティングシステム
101 安全監視アプリケーション
102 通常制御アプリケーション
103 安全制御アプリケーション
141 制御部
142 TLB
DESCRIPTION OF SYMBOLS 1 Safety control apparatus 10 Processor 11 Execution memory 12 I / O port 13 Non-volatile memory 14 MMU
15 reset circuit 20 microcontroller 21 partition scheduler 22 scheduling tables 23, 25, 27 task scheduler 24 safety monitoring tasks 26, 31 normal control tasks 28, 32 safety control tasks 29 TLB management routine 30 monitoring control task 33 monitoring task 34 control task 35 HMI task 100 Operating system 101 Safety monitoring application 102 Normal control application 103 Safety control application 141 Control unit 142 TLB

Claims (10)

複数の領域を含むメモリと、
複数のタスクを実行するタスク実行部と、
前記複数のタスクのいずれかによる前記複数の領域のいずれかに対するアクセス権限を示す権限情報を、所定数だけ格納可能な記憶部と、
前記タスク実行部から前記タスクによる前記領域に対するアクセスがあったとき、当該タスクによる当該領域に対するアクセス権限を示す権限情報が前記記憶部に格納されているか否かを判定して、当該権限情報が格納されている場合は、当該権限情報に基づいて前記アクセス権限を判定し、当該権限情報が格納されていない場合は、前記アクセス権限の判定を可能とするために、当該タスクによる当該領域に対するアクセス権限を示す権限情報を前記記憶部に格納するアクセス管理部と、を備え、
前記複数のタスクは、第1のタスクと、当該第1のタスクよりも実行の遅延が許容される第2のタスクとを含み、
前記アクセス管理部は、前記第1のタスクに関する権限情報を前記記憶部に格納するときに、前記記憶部に格納された権限情報のいずれかを上書きする必要がある場合は、前記第1のタスクに関する権限情報と前記第2のタスクに関する権限情報のうち、前記第2のタスクに関する権限情報を優先的に上書きする、
情報処理装置。
Memory containing multiple areas;
A task execution unit for executing a plurality of tasks;
A storage unit capable of storing a predetermined number of authority information indicating access authority to any of the plurality of areas by any of the plurality of tasks;
When the task execution unit accesses the area by the task, it is determined whether authority information indicating access authority to the area by the task is stored in the storage unit, and the authority information is stored. If the access authority is determined, the access authority is determined based on the authority information. If the authority information is not stored, the access authority to the area by the task is determined in order to determine the access authority. An access management unit for storing authority information indicating the storage in the storage unit,
The plurality of tasks include a first task and a second task that is allowed to be delayed in execution as compared to the first task,
When the access management unit needs to overwrite any of the authority information stored in the storage unit when storing the authority information related to the first task in the storage unit, the first task Preferentially overwriting authority information relating to the second task among authority information relating to the second task and authority information relating to the second task,
Information processing device.
前記アクセス管理部は、前記第2のタスクに関する権限情報を前記記憶部に格納するときに、前記記憶部に格納された権限情報のいずれかを上書きする必要がある場合は、前記第1のタスクに関する権限情報と前記第2のタスクに関する権限情報のうち、前記第2のタスクに関する権限情報を優先的に上書きする、
請求項1に記載の情報処理装置。
When the access management unit needs to overwrite any of the authority information stored in the storage unit when storing the authority information regarding the second task in the storage unit, the first task Preferentially overwriting authority information relating to the second task among authority information relating to the second task and authority information relating to the second task,
The information processing apparatus according to claim 1.
前記アクセス管理部は、前記第1のタスクに関する権限情報を前記記憶部に格納するときに、すでに所定の上限数、前記第1のタスクに関する権限情報が前記記憶部に格納されている場合は、前記第1のタスクに関する権限情報の上書きを許容する、
請求項1又は2に記載の情報処理装置。
When the access management unit stores the authority information related to the first task in the storage unit, the predetermined upper limit number, if the authority information related to the first task is already stored in the storage unit, Allowing overwriting of authority information relating to the first task;
The information processing apparatus according to claim 1 or 2.
前記アクセス管理部は、すでに所定の上限数、前記第1のタスクに関する権限情報が前記記憶部に格納されている場合は、前記記憶部に格納された前記第1のタスクに関する権限情報のうち、より少ない回数のアクセスに関する権限情報を、より優先的に上書きする、
請求項3に記載の情報処理装置。
When the access management unit has already stored a predetermined upper limit number and authority information related to the first task in the storage unit, among the authority information related to the first task stored in the storage unit, Overwrites the authority information related to fewer accesses more preferentially,
The information processing apparatus according to claim 3.
前記権限情報は、前記タスクを識別する識別値と、当該タスクによる前記領域に対するアクセス権限とを示す情報であり、
前記第1のタスクに関する権限情報と前記第2のタスクに関する権限情報とでは、前記識別値の所定のビット位置のビット値が異なる値となっており、
前記アクセス管理部は、前記所定のビット位置のビット値に基づいて、前記権限情報が前記第1のタスクに関する権限情報か否かを判定する、
請求項1乃至4のいずれか1項に記載の情報処理装置。
The authority information is information indicating an identification value for identifying the task and an access authority for the area by the task,
In the authority information related to the first task and the authority information related to the second task, the bit values at predetermined bit positions of the identification value are different values,
The access management unit determines whether the authority information is authority information related to the first task based on a bit value of the predetermined bit position;
The information processing apparatus according to any one of claims 1 to 4.
前記複数のタスクのそれぞれは、複数のタイムパーティションのいずれかにおいて実行され、
前記タスク実行部は、前記複数のタイムパーティションのスケジューリング内容を示すスケジューリング情報に従って、前記複数のタスクをスケジューリングして実行する、
請求項1乃至5のいずれか1項に記載の情報処理装置。
Each of the plurality of tasks is executed in any of a plurality of time partitions,
The task execution unit schedules and executes the plurality of tasks according to scheduling information indicating scheduling contents of the plurality of time partitions.
The information processing apparatus according to any one of claims 1 to 5.
前記情報処理装置は、制御対象を制御する制御装置であって、
前記複数のタスクのそれぞれは、前記制御対象の制御に関する処理を実行するタスクである、
請求項1乃至6のいずれか1項に記載の情報処理装置。
The information processing apparatus is a control apparatus that controls a control target,
Each of the plurality of tasks is a task that executes processing related to control of the control target.
The information processing apparatus according to claim 1.
前記第1のタスクは、前記制御対象の機能安全の確保に関する処理を実行するタスクであり、
前記第2のタスクは、その他の前記制御対象の制御に関する処理を実行するタスクである、
請求項7に記載の情報処理装置。
The first task is a task for executing processing related to ensuring functional safety of the control target;
The second task is a task for executing processing related to control of the other control target.
The information processing apparatus according to claim 7.
前記タスク実行部は、前記プロセッサであり、
前記アクセス管理部は、MMU(Memory Management Unit)又はMPU(Memory Protection Unit)である、
請求項1乃至8のいずれか1項に記載の情報処理装置。
The task execution unit is the processor;
The access management unit is an MMU (Memory Management Unit) or MPU (Memory Protection Unit).
The information processing apparatus according to any one of claims 1 to 8.
複数のタスクのうちのいずれかのタスクから、メモリに含まれる複数の領域のうちのいずれか領域に対するアクセスがあったとき、当該タスクによる当該領域に対するアクセス権限を示す権限情報が、前記複数のタスクのいずれかによる前記複数の領域のいずれかに対するアクセス権限を示す権限情報を所定数だけ格納可能な記憶部に格納されているか否かを判定する情報判定ステップと、
前記権限情報が格納されている判定した場合は、当該権限情報に基づいて前記アクセス権限を判定する権限判定ステップと、
前記権限情報が格納されていないと判定した場合は、前記アクセス権限の判定を可能とするために、前記アクセスをしたタスクによる前記アクセス先の領域に対するアクセス権限を示す権限情報を前記記憶部に格納する情報格納ステップと、を備え、
前記複数のタスクは、第1のタスクと、当該第1のタスクよりも実行の遅延が許容される第2のタスクとを含み、
前記情報格納ステップでは、前記第1のタスクに関する権限情報を前記記憶部に格納するときに、前記記憶部に格納された権限情報のいずれかを上書きする必要がある場合は、前記第1のタスクに関する権限情報と前記第2のタスクに関する権限情報のうち、前記第2のタスクに関する権限情報を優先的に上書きする、
メモリアクセス管理方法。
When any one of the plurality of tasks accesses any one of the plurality of areas included in the memory, the authority information indicating the access authority to the area by the task is the plurality of tasks. An information determination step for determining whether authority information indicating access authority to any of the plurality of areas is stored in a storage unit capable of storing a predetermined number of
If it is determined that the authority information is stored, an authority determining step for determining the access authority based on the authority information;
If it is determined that the authority information is not stored, authority information indicating access authority to the access destination area by the accessed task is stored in the storage unit so that the access authority can be determined. And an information storage step for
The plurality of tasks include a first task and a second task that is allowed to be delayed in execution as compared to the first task,
In the information storing step, when the authority information related to the first task is stored in the storage unit, if any of the authority information stored in the storage unit needs to be overwritten, the first task Preferentially overwriting authority information relating to the second task among authority information relating to the second task and authority information relating to the second task,
Memory access management method.
JP2012000087A 2012-01-04 2012-01-04 Information processing apparatus and memory access management method Expired - Fee Related JP5845902B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012000087A JP5845902B2 (en) 2012-01-04 2012-01-04 Information processing apparatus and memory access management method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012000087A JP5845902B2 (en) 2012-01-04 2012-01-04 Information processing apparatus and memory access management method

Publications (2)

Publication Number Publication Date
JP2013140477A JP2013140477A (en) 2013-07-18
JP5845902B2 true JP5845902B2 (en) 2016-01-20

Family

ID=49037859

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012000087A Expired - Fee Related JP5845902B2 (en) 2012-01-04 2012-01-04 Information processing apparatus and memory access management method

Country Status (1)

Country Link
JP (1) JP5845902B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6323235B2 (en) * 2014-07-29 2018-05-16 株式会社デンソー Electronic control unit
JP6504984B2 (en) * 2015-09-28 2019-04-24 ルネサスエレクトロニクス株式会社 Data processor
JP6838223B2 (en) * 2016-11-02 2021-03-03 日立Astemo株式会社 Vehicle control device

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2029628A1 (en) * 1989-11-13 1991-05-14 Anantakotirajv Vagesna Translation look aside buffer with parallel exception checking and update bypass
JP3454854B2 (en) * 1992-01-16 2003-10-06 株式会社東芝 Memory management device and method
JPH0784885A (en) * 1993-09-09 1995-03-31 Hitachi Ltd Cache memory controller
DE813709T1 (en) * 1995-03-03 1998-10-22 Hal Computer Systems Inc MICRO-TLB WITH PARALLEL ACCESS TO SPEED UP ADDRESS TRANSLATION
JP4603753B2 (en) * 2000-02-01 2010-12-22 シラス ロジック、インコーポレイテッド Method and circuit for securing cached information
US6766419B1 (en) * 2000-03-31 2004-07-20 Intel Corporation Optimization of cache evictions through software hints
US6643759B2 (en) * 2001-03-30 2003-11-04 Mips Technologies, Inc. Mechanism to extend computer memory protection schemes
JP2003228518A (en) * 2002-02-06 2003-08-15 Ip Flex Kk Control method for cache system
JP2006338426A (en) * 2005-06-03 2006-12-14 Hitachi Ltd Computer system
JP2008234188A (en) * 2007-03-19 2008-10-02 Toyota Motor Corp Information processing device
EP2225645B1 (en) * 2007-12-17 2011-07-27 Continental Teves AG & Co. oHG Memory mapping system, request controller, multi-processing arrangement, central interrupt request controller, apparatus, method for controlling memory access and computer program product
US20100217937A1 (en) * 2009-02-20 2010-08-26 Arm Limited Data processing apparatus and method

Also Published As

Publication number Publication date
JP2013140477A (en) 2013-07-18

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
EP2672344B1 (en) Safety control device and safety control method
EP2677377B1 (en) Safety control device and safety control method
US8457766B2 (en) Safety controller and safety control method
JP5664530B2 (en) Operation check method of control device and memory protection device
JP5845902B2 (en) Information processing apparatus and memory access management method
JP5621857B2 (en) SAFETY CONTROL DEVICE AND SAFETY CONTROL METHOD
JP5834935B2 (en) SAFETY CONTROL DEVICE AND SAFETY CONTROL METHOD
JP2013140476A (en) Information processing device, access authority giving method, program generation device, and method therefor
JP5633501B2 (en) Control apparatus and control method
JP5712907B2 (en) Operation check method of control device, information processing device and memory management device
JP5906584B2 (en) Control apparatus and control method
JP2014211689A (en) Safety control device and safety control method
JP6004057B2 (en) Information processing apparatus and DMA controller operation check method
JP5803689B2 (en) Information processing apparatus and DMA controller operation check method
JP5849731B2 (en) Information processing apparatus and data storage method
JP5853716B2 (en) Information processing apparatus and task control method
JP5811865B2 (en) Control device and program execution 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
JP2024085627A (en) Computer system, abnormality handling method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20140821

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20150414

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20150428

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20151109

R151 Written notification of patent or utility model registration

Ref document number: 5845902

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

LAPS Cancellation because of no payment of annual fees