JP2013140476A - Information processing device, access authority giving method, program generation device, and method therefor - Google Patents

Information processing device, access authority giving method, program generation device, and method therefor Download PDF

Info

Publication number
JP2013140476A
JP2013140476A JP2012000086A JP2012000086A JP2013140476A JP 2013140476 A JP2013140476 A JP 2013140476A JP 2012000086 A JP2012000086 A JP 2012000086A JP 2012000086 A JP2012000086 A JP 2012000086A JP 2013140476 A JP2013140476 A JP 2013140476A
Authority
JP
Japan
Prior art keywords
task
area
authority
memory
execution
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.)
Pending
Application number
JP2012000086A
Other languages
Japanese (ja)
Inventor
Tetsuya Taira
哲也 平
Koji Bito
浩司 尾藤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Toyota Motor Corp
Original Assignee
Toyota Motor Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Toyota Motor Corp filed Critical Toyota Motor Corp
Priority to JP2012000086A priority Critical patent/JP2013140476A/en
Publication of JP2013140476A publication Critical patent/JP2013140476A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Programmable Controllers (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide information by increasing openness to another task while maintaining independence between tasks.SOLUTION: An information processing device comprises: a memory that has a plurality of areas including a first area and a second area; and a task execution unit that in order to cause a first task to execute processing using the first area, executes the first task while giving desired authority to access the first area, and in order to cause a second task to execute processing using the second area, executes the second task while giving desired authority to access the second area. The task execution unit further gives the first task only reading authority as authority to access the second area.

Description

本発明は、メモリの領域に対する所望のアクセス権限を付与してタスクを実行する情報処理装置、アクセス権限付与方法、プログラム生成装置、及びプログラム生成方法に関する。   The present invention relates to an information processing apparatus, an access authority assignment method, a program generation apparatus, and a program generation method that execute a task by granting a desired access authority to a memory area.

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

ここで、特許文献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.

また、タイムパーティションのそれぞれに対応するように、リソースパーティションのそれぞれが割り当てられている。そのため、あるタイムパーティションに属するタスク(アプリケーション)がアクセスするメモリ上の領域には、それとは異なるタイムパーティションに属するタスクからはアクセスが禁止される。すなわち、あるタイムパーティションのタスクが使用するメモリ上の領域の情報を、他のタイムパーティションのタスクからは隠蔽・保護するようにしている。   Each resource partition is assigned so as to correspond to each time partition. Therefore, access to a memory area accessed by a task (application) belonging to a certain time partition is prohibited from a task belonging to a different time partition. That is, the information on the memory area used by the task of a certain time partition is concealed and protected from the tasks of other time partitions.

これは、特許文献1では、安全関連アプリケーションと非安全関連アプリケーションとの独立性を重視しており、安全関連のタイムパーティションにおける情報を、非安全関連のタイムパーティションに公開することを目的としていないからである。その逆も同様であり、非安全関連のタイムパーティションにおける情報を、安全関連のタイムパーティションに公開することも目的としていない。また、特許文献1では、あるタイムパーティションにおける情報を、他のタイムパーティションに公開することは、セキュリティ上、好ましくないとして考えられていた。そのため、あるタイムパーティションのタスクは、他のタイムパーティションのタスクの内部状態を確認することはできていなかった。   This is because Patent Document 1 emphasizes independence between safety-related applications and non-safety-related applications, and does not aim to disclose information on safety-related time partitions to non-safety-related time partitions. It is. The reverse is also true, and it is not intended to publish information in non-safety related time partitions to safety related time partitions. Moreover, in patent document 1, it was thought that it was unpreferable on security to disclose the information in a certain time partition to other time partitions. Therefore, a task in one time partition has not been able to confirm the internal state of the task in another time partition.

この考えは、マルチタスクOSについても同様である。マルチタスクOSでは、タスクにおける情報は、他のタスクからは隠蔽・保護されている。マルチタスクOSでは、複数のタスクのそれぞれの独立性を高めて動作させることを目的としているからである。また、マルチタスクOSにおいても、あるタスクにおける情報を、他のタスクに公開することは、セキュリティ上、好ましくないと考えられていた。   This idea is the same for the multitasking OS. In a multitasking OS, information in a task is hidden and protected from other tasks. This is because the multitask OS aims to increase the independence of each of the plurality of tasks. Further, even in a multitasking OS, it has been considered that it is not preferable in terms of security to disclose information on a certain task to other tasks.

また、一般的に、OSは、上述したようなタイムパーティション又はタスクにおける情報を格納する領域をメモリ上に可変に割り当てるようにしている。すなわち、OSが起動後に、タイムパーティション又はタスクに割り当てるメモリの領域は、必ずしも毎回同じアドレスの領域が割り当てられるわけではない。そのため、たとえ他のタイムパーティション又はタスクに情報を公開したとしても、他の(タイムパーティションに属する)タスクは目的とする情報のアドレスを把握することができないといった事情も存在する。   In general, the OS variably allocates an area for storing information in the time partition or task as described above on the memory. In other words, after the OS is started, the memory area allocated to the time partition or task is not necessarily allocated to the same address area every time. For this reason, even if information is disclosed to other time partitions or tasks, other tasks (belonging to time partitions) cannot grasp the address of the target information.

他方、組込OSでは、全ての情報が公開されている。これは、そもそも、組込OSには、タスクやパーティションといった区分が無いためである。すなわち、公開・隠蔽という概念すらない。   On the other hand, all information is disclosed in the embedded OS. This is because the built-in OS does not have divisions such as tasks and partitions. In other words, there is no concept of disclosure and concealment.

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

本願出願人は、上述したように、タイムパーティション間(又はアプリケーション間)の独立性を重視しすぎると、以下に説明する課題があることを見出した。以下、その課題について説明する。なお、以下に説明する内容は、本願出願人が新たに検討した内容であって、従来技術を説明したものではない。   As described above, the applicant of the present application has found that if too much importance is placed on independence between time partitions (or between applications), there is a problem described below. 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.

具体的には、上述した技術では、異なるタイムパーティションに属するタスク間では、他のタイムパーティションに属するタスクにおける情報を直接確認することができない。このような場合に、タスクの情報を受け渡す手段として、タスク間通信(メッセージキュー)を利用することが考えられる。しかしながら、タスク間通信では、情報を受け渡すためのメモリ領域が余分に必要となる、情報の受け渡しによるオーバーヘッドが発生してしまう、という問題があった。   Specifically, with the above-described technique, information on tasks belonging to other time partitions cannot be directly confirmed between tasks belonging to different time partitions. In such a case, it is conceivable to use inter-task communication (message queue) as means for transferring task information. However, there is a problem that inter-task communication requires an extra memory area for passing information and overhead due to information passing occurs.

また、例えば、緊急的にタイムパーティションを切り替えた場合には、切り替え前のタイムパーティションに属するタスクにおいて、タスク間通信によって情報を受け渡す処理を実行するタイミングを確保することができず、タスク間通信による情報の受け渡しが間に合わなくなってしまうという問題もあった。それに対して、そのような場合に情報の受け渡しを可能とする仕組み(専用ソフト等)を別途実装しようとすると、その仕組みを作成するために非常に手間がかかってしまうという問題があった。   Also, for example, when the time partition is urgently switched, it is not possible to secure the timing for executing the process of transferring information by inter-task communication in the task belonging to the time partition before switching, and the inter-task communication There was also a problem that the delivery of information by was not in time. On the other hand, if a mechanism (dedicated software or the like) that enables information exchange in such a case is separately installed, it takes a lot of time to create the mechanism.

その一方で、タイムパーティション間(タスク間)の独立性を全く無くしてしまうと、セキュリティ上、好ましくないという問題もある。例えば、タイムパーティション間において情報の隠蔽・保護を全く無くしてしまうと、あるタイムパーティションに属するタスクが意図せずに、他のタイムパーティションに属するタスクが利用する情報を書き換えようとしたときに、それを抑止することができなくなってしまう。その場合、そのようにして書き換えられた情報を利用してタスクが期待しない動作をしてしまう。また、例えば、あるタイムパーティションに属するタスクが意図せずに、他のタイムパーティションに属するタスクが実行する情報(命令)を実行しようとしたときに、それを抑止することができなくなってしまう。その場合、あるタスクで実行されるべき処理を、それとは異なるタスクが実行してしまう。   On the other hand, if the independence between time partitions (between tasks) is completely eliminated, there is a problem that it is not preferable in terms of security. For example, if there is no information concealment / protection between time partitions, when a task belonging to a certain time partition is not intended, information used by a task belonging to another time partition may be rewritten. Can no longer be suppressed. In that case, the task performs an unexpected operation using the information rewritten in this way. Further, for example, when a task belonging to a certain time partition is not intended and information (instruction) executed by a task belonging to another time partition is to be executed, it cannot be suppressed. In that case, a task that is to be executed by a certain task is executed by a different task.

本発明は、上述した知見に基づいてなされたものであって、タスク間の独立性を維持しつつ、他のタスクに対して公開性を高めて情報を提供することが可能となる情報処理装置、アクセス権限付与方法、プログラム生成装置、及びプログラム生成方法を提供することを目的とする。   The present invention has been made based on the above-described knowledge, and is an information processing apparatus capable of providing information with increased openness to other tasks while maintaining independence between tasks. It is an object to provide an access authority assigning method, a program generating device, and a program generating method.

本発明の第1の態様にかかる情報処理装置は、第1の領域と第2の領域とを含む複数の領域を有するメモリと、第1のタスクに前記第1の領域を利用して処理を実行させるために、前記第1の領域に対する所望のアクセス権限を付与して前記第1のタスクを実行するとともに、第2のタスクに前記第2の領域を利用して処理を実行させるために、前記第2の領域に対する所望のアクセス権限を付与して前記第2のタスクを実行するタスク実行部と、を備え、前記タスク実行部は、さらに、前記第1のタスクに前記第2の領域に対するアクセス権限として読み出し権限のみを付与するものである。   An information processing apparatus according to a first aspect of the present invention performs processing using a memory having a plurality of areas including a first area and a second area, and using the first area for a first task. In order to execute the first task by granting a desired access authority to the first area, and to cause the second task to execute processing using the second area, A task execution unit that executes the second task by granting a desired access authority to the second region, and the task execution unit further adds the first task to the second region. Only the read authority is given as the access authority.

本発明の第2の態様にかかるアクセス権限付与方法は、第1の領域と第2の領域とを含む複数の領域を有するメモリに対するアクセス権限を付与するアクセス権限付与方法であって、第1のタスクに前記第1の領域を利用して処理を実行させるために、前記第1のタスクに前記第1の領域に対する所望のアクセス権限を付与するとともに、第2のタスクに前記第2の領域を利用して処理を実行させるために、前記第2のタスクに前記第2の領域に対する所望のアクセス権限を付与する権限付与ステップと、前記第1のタスク及び前記第2のタスクの実行を開始するタスク実行ステップと、を備え、前記権限付与ステップでは、さらに、前記第1のタスクに前記第2の領域に対するアクセス権限として読み出し権限のみを付与するものである。   An access right granting method according to a second aspect of the present invention is an access right granting method for granting an access right to a memory having a plurality of areas including a first area and a second area. In order to cause a task to execute processing using the first area, the first task is given a desired access authority to the first area, and the second area is assigned to the second task. In order to execute processing by using the authority, an authority granting step for giving the second task a desired access authority to the second area, and execution of the first task and the second task are started. A task execution step, and in the authority granting step, only the read authority is granted to the first task as an access authority to the second area.

本発明の第3の態様にかかるプログラム生成装置は、第1のタスクにメモリに含まれる第1の領域を利用して処理を実行させるために、前記第1の領域に対する所望のアクセス権限を付与して前記第1のタスクを実行する処理と、第2のタスクに前記メモリに含まれる第2の領域を利用して処理を実行させるために、前記第2の領域に対する所望のアクセス権限を付与して前記第2のタスクを実行する処理と、をプロセッサに実行させるシステムプログラムを生成するプログラム生成装置であって、任意のタスクに前記メモリに含まれる任意の領域に対する任意のアクセス権限を設定する入力を受ける権限入力部と、前記権限入力部に対する入力によって設定された内容で、前記タスクに前記領域に対するアクセス権限を付与する処理を前記プロセッサに実行させるように前記システムプログラムを生成するプログラム生成部と、を備え、前記権限入力部は、さらに、前記第1のタスクに前記第2の領域に対するアクセス権限として読み出し権限のみを付与するように前記アクセス権限を設定する入力を受け付け可能であるものである。   The program generation device according to the third aspect of the present invention gives a desired access authority to the first area in order to cause the first task to execute processing using the first area included in the memory. And granting a desired access authority to the second area in order to cause the second task to execute the process using the second area included in the memory. A program generating apparatus that generates a system program that causes a processor to execute the process of executing the second task, and sets an arbitrary access right to an arbitrary area included in the memory for an arbitrary task An authority input unit that receives an input, and a process of granting an access authority to the area to the task with contents set by input to the authority input unit A program generation unit that generates the system program to be executed by a processor, and the authority input unit further grants only a read authority as an access authority to the second area to the first task. Can accept an input for setting the access authority.

本発明の第4の態様にかかるプログラム生成方法は、第1のタスクにメモリに含まれる第1の領域を利用して処理を実行させるために、前記第1の領域に対する所望のアクセス権限を付与して前記第1のタスクを実行する処理と、第2のタスクに前記メモリに含まれる第2の領域を利用して処理を実行させるために、前記第2の領域に対する所望のアクセス権限を付与して前記第2のタスクを実行する処理と、をプロセッサに実行させるシステムプログラムを生成するプログラム生成方法であって、任意のタスクに前記メモリに含まれる任意の領域に対する任意のアクセス権限を設定する入力を受ける権限入力ステップと、前記権限入力ステップにおける入力によって設定された内容で、前記タスクに前記領域に対するアクセス権限を付与する処理を前記プロセッサに実行させるように前記システムプログラムを生成するプログラム生成ステップと、を備え、前記権限入力ステップでは、さらに、前記第1のタスクに前記第2の領域に対するアクセス権限として読み出し権限のみを付与するように前記アクセス権限を設定する入力を受け付け可能であるものである。   The program generation method according to the fourth aspect of the present invention provides a desired access authority to the first area in order to cause the first task to execute processing using the first area included in the memory. And granting a desired access authority to the second area in order to cause the second task to execute the process using the second area included in the memory. A program generation method for generating a system program for causing a processor to execute a process for executing the second task, and setting an arbitrary access right to an arbitrary area included in the memory for an arbitrary task An authority input step for receiving input, and an access authority for the area is given to the task with the contents set by the input in the authority input step. A program generation step for generating the system program so as to cause the processor to execute processing. In the authority input step, the first task further has only a read authority as an access authority to the second area. An input for setting the access authority to be granted can be accepted.

上述した本発明の各態様によれば、タスク間の独立性を維持しつつ、他のタスクに対して公開性を高めて情報を提供することが可能となる情報処理装置、アクセス権限付与方法、プログラム生成装置、及びプログラム生成方法を提供することができる。   According to each aspect of the present invention described above, an information processing apparatus, an access right granting method, and an information processing apparatus capable of providing information with increased openness to other tasks while maintaining independence between tasks, A program generation device and a program generation method can be provided.

発明の実施の形態1にかかる安全制御装置の構成例を示すブロック図である。It is a block diagram which shows the structural example of the safety control apparatus concerning Embodiment 1 of invention. 発明の実施の形態1におけるタイム・パーティショニングの概念を説明するための図である。It is a figure for demonstrating the concept of the time partitioning in Embodiment 1 of invention. 発明の実施の形態1におけるリソース・パーティショニングの概念を説明するための概念図である。It is a conceptual diagram for demonstrating the concept of the resource partitioning in Embodiment 1 of invention. 発明の実施の形態1におけるリソース・パーティショニングの概念を説明するための概念図である。It is a conceptual diagram for demonstrating the concept of the resource partitioning in Embodiment 1 of invention. 発明の実施の形態1にかかるMMUの構成例を示すブロック図である。It is a block diagram which shows the structural example of MMU concerning Embodiment 1 of invention. 発明の実施の形態1におけるパーティションスケジューラとタスクとの関係を示す図である。It is a figure which shows the relationship between the partition scheduler and task in Embodiment 1 of invention. スケジューリングパターンの具体例を示す図である。It is a figure which shows the specific example of a scheduling pattern. スケジューリングパターンの具体例を示す図である。It is a figure which shows the specific example of a scheduling pattern. 発明の実施の形態1にかかる実行用メモリのページの割り当て例を示す図である。It is a figure which shows the example of allocation of the page of the memory for execution concerning Embodiment 1 of invention. 発明の実施の形態1にかかるTLBの設定例を示す図である。It is a figure which shows the example of a setting of TLB concerning Embodiment 1 of invention. 発明の実施の形態1にかかるパーティションスケジューラの処理手順の具体例を示すフローチャートである。It is a flowchart which shows the specific example of the process sequence of the partition scheduler concerning Embodiment 1 of invention. 発明の実施の形態1にかかる他のTPのメモリ領域に対する読み出し処理手順の具体例を示すフローチャートである。It is a flowchart which shows the specific example of the read-out process procedure with respect to the memory area of the other TP concerning Embodiment 1 of invention. 発明の実施の形態1にかかるソフトウェア生成装置2及びソフトウェア書込装置3のソフトウェア構成例を示すブロック図である。It is a block diagram which shows the software structural example of the software generator 2 and the software writer 3 concerning Embodiment 1 of invention. 発明の実施の形態にかかるソフトウェア生成及び書き込み処理を示すフローチャートである。It is a flowchart which shows the software production | generation and writing processing concerning embodiment of invention. 発明の実施の形態にかかるソフトウェア生成装置2及びソフトウェア書込装置3のハードウェア構成例を示すブロック図である。It is a block diagram which shows the hardware structural example of the software generator 2 and the software writer 3 concerning embodiment of invention. 発明の実施の形態2におけるパーティションスケジューラとタスクとの関係を示す図である。It is a figure which shows the relationship between the partition scheduler and task in Embodiment 2 of invention. 発明の実施の形態2にかかるパーティションスケジューラの処理手順の具体例を示すフローチャートである。It is a flowchart which shows the specific example of the process sequence of the partition scheduler concerning Embodiment 2 of invention. 発明の実施の形態2にかかるタスクの処理手順の具体例を示すフローチャートである。It is a flowchart which shows the specific example of the process sequence of the task concerning Embodiment 2 of invention. 発明の実施の形態2にかかるAPI関数wai_pswの処理手順の具体例を示すフローチャートである。It is a flowchart which shows the specific example of the process sequence of API function wai_psw concerning Embodiment 2 of invention. 発明の実施の形態2において、TPの時間内にタスクが実行終了した場合におけるタスクの実行状況の具体例を示す図である。In Embodiment 2 of invention, it is a figure which shows the specific example of the execution condition of a task in case the execution of a task is completed within the time of TP. 発明の実施の形態2において、TPの時間内にタスクが実行終了しなかった場合におけるタスクの実行状況の具体例を示す図である。In Embodiment 2 of invention, it is a figure which shows the specific example of the execution condition of a task when a task does not complete | finish within the time of TP. その他の実施の形態にかかるパーティションスケジューラとタスクとの関係を示す図である。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.

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

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

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

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

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

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

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

不揮発性メモリ13は、電力の供給を受けることなく、実行用メモリ11に比べて安定的に記憶内容を維持することが可能なメモリデバイスである。例えば、不揮発性メモリ13は、ROM(Read Only Memory)、フラッシュメモリ、ハードディスクドライブ若しくは光ディスクドライブ、又はこれらの組み合わせである。不揮発性メモリ13は、OS100、アプリケーション101〜103、シンボル情報210、及びTLB設定情報211を格納する。なお、不揮発性メモリ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 non-volatile memory 13 stores the OS 100, the applications 101 to 103, the symbol information 210, and the TLB setting information 211. 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).

図3Aは、リソース・パーティショニングに関する概念図である。図3Aの例では、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(Memory Management Unit)14のメモリ保護機能を利用して実現される。   FIG. 3A is a conceptual diagram related to resource partitioning. In the example of FIG. 3A, 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 a memory protection function of an MMU (Memory Management Unit) 14 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.

ここで、本実施の形態では、実行用メモリ11に対するアクセスに関しては、全てのアクセス種別(読み出し、書き込み、及び、実行)について、他のRPに対するアクセスを禁止するのではなく、読み出しによるアクセスのみは許容する。そのようにすることで、RP間の独立性を維持しつつ、他のRPに対して公開性を高めて実行用メモリ11の情報を提供することを可能としている。具体的に、図3Bに例を挙げて説明する。図3Bでは、2つのRP(RP1及びRP2)を示している。RP1には、実行用メモリ11の一部(A領域)が全てのアクセス種別におけるアクセスを許容するように割り当てられており、RP2には、実行用メモリ11の一部(B領域)が全てのアクセス種別におけるアクセスを許容するように割り当てられている。この場合、RP1には、B領域に対する読み出しによるアクセスのみが許容され、RP2には、A領域に対する読み出しによるアクセスのみが許容される。   Here, in the present embodiment, regarding access to the execution memory 11, access to other RPs is not prohibited for all access types (read, write, and execute), but only access by read is performed. Allow. By doing so, it is possible to provide the information of the execution memory 11 with improved openness to other RPs while maintaining independence between the RPs. Specifically, an example will be described with reference to FIG. 3B. In FIG. 3B, two RPs (RP1 and RP2) are shown. A part (A area) of the execution memory 11 is allocated to RP1 so as to allow access in all access types, and a part (B area) of the execution memory 11 is all assigned to RP2. The access type is assigned to allow access. In this case, only access by reading to the B area is permitted for the RP1, and only access by reading for the A area is permitted for the RP2.

図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.

シンボル情報210は、各アプリケーション101〜103における情報(変数)の変数名と、その情報が格納されている実行用メモリ11のアドレスとが対応付けられた情報である。シンボル情報210は、例えば、変数名とアドレスとを表形式で示す。各アプリケーション101〜103は、後述するように、シンボル情報210を参照することで、他のアプリケーションの情報(変数)であっても、そのアドレスを特定して変数の値を読み出すことを可能とする。以下、各アプリケーション(タスク)における情報を「データ」とも言う。   The symbol information 210 is information in which variable names of information (variables) in the applications 101 to 103 are associated with addresses of the execution memory 11 in which the information is stored. The symbol information 210 indicates, for example, variable names and addresses in a table format. As will be described later, each application 101 to 103 can read out the value of a variable by specifying its address even if it is information (variable) of another application by referring to the symbol information 210. . Hereinafter, information in each application (task) is also referred to as “data”.

TLB設定情報211は、MMU14のTLBへの設定内容を示す情報である。OS100は、TLB設定情報211に基づいて、TLBを設定する。なお、シンボル情報210及びTLB設定情報211がどのように生成されるのかについては、図11を参照して後述する。   The TLB setting information 211 is information indicating the setting contents of the MMU 14 in the TLB. The OS 100 sets the TLB based on the TLB setting information 211. Note that how the symbol information 210 and the TLB setting information 211 are generated will be described later with reference to FIG.

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

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

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

図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, in the entry, when the authority of the designated access type is not set to “Yes”, a TLB protection violation (memory 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.

なお、図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の起動により生成されるタスクと、の関係について、図5を用いて説明する。図5は、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. 5 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等を含む。なお、図5では、マイクロコントローラ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. 5 illustrates a configuration in which the reset circuit 15 is provided outside the microcontroller 20, but a configuration in which the reset circuit 15 is included in the microcontroller 20 may be employed.

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

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

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

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

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

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

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

安全監視タスク24は、安全監視アプリケーション101の起動によって生成されるタスクである。図5の例では、安全監視タスク24は、TP1及びRP1に割り当てられている。言い換えると、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. 5, the safety monitoring task 24 is assigned to TP1 and RP1. In other words, RP1 is assigned to TP1. 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の起動によって生成されるタスクである。図5の例では、通常制御タスク26は、TP2及びRP2に割り当てられている。言い換えると、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. 5, the normal control task 26 is assigned to TP2 and RP2. In other words, RP2 is assigned to TP2. 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の起動によって生成されるタスクである。図5の例では、安全制御タスク28は、TP3及びRP3に割り当てられている。言い換えると、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. 5, the safety control task 28 is assigned to TP3 and RP3. In other words, RP3 is assigned to TP3. 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.

上述したように、パーティションスケジューラ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.

ここで、図7を参照して、実行用メモリ11の割り当てについて説明する。図7は、実行用メモリ11のページの割り当て例を示す図である。OS100は、図7に示すように、各TP1〜TP3に対して、実行用メモリ11のページを割り当てる。なお、図7では、説明の簡略化のため、1つのTPに1つのページが割り当てられた場合について例示している。具体的には、TP1(RP1)にアドレス「0x0000C000」番地のページが割り当てられており、TP2(RP2)にアドレス「0x0000D000」番地のページが割り当てられており、TP3(RP3)にアドレス「0x0000E000」番地のページが割り当てられている。   Here, the allocation of the execution memory 11 will be described with reference to FIG. FIG. 7 is a diagram illustrating an example of page allocation in the execution memory 11. As shown in FIG. 7, the OS 100 allocates a page of the execution memory 11 to each of TP1 to TP3. FIG. 7 illustrates a case where one page is assigned to one TP for the sake of simplicity. Specifically, the page with address “0x0000C000” is assigned to TP1 (RP1), the page with address “0x0000D000” is assigned to TP2 (RP2), and the address “0x0000E000” is assigned to TP3 (RP3). An address page is assigned.

この場合、TP1に属する安全監視タスク24は、アドレス「0x0000C000」番地のページを利用してその処理を実行し、TP2に属する通常制御タスク26は、アドレス「0x0000D000」番地のページを利用してその処理を実行し、TP3に属する安全制御タスク28は、アドレス「0x0000E000」番地のページを利用してその処理を実行する。ここで、OS100は、その起動時には常にTLB設定情報211を参照して、各TP1〜TP3に対して実行用メモリ11の領域を割り当てる。そのため、OS100は、TLB設定情報211において予め定められているページ(アドレス)を固定的に各TP1〜TP3に割り当てることになる。   In this case, the safety monitoring task 24 belonging to TP1 executes the process using the page of address “0x0000C000”, and the normal control task 26 belonging to TP2 uses the page of address “0x0000D000” to execute the process. The process is executed, and the safety control task 28 belonging to TP3 executes the process using the page of the address “0x0000E000”. Here, the OS 100 always refers to the TLB setting information 211 at the time of startup, and allocates an area of the execution memory 11 to each of the TP1 to TP3. Therefore, the OS 100 fixedly assigns pages (addresses) determined in advance in the TLB setting information 211 to the TP1 to TP3.

続いて、図8を参照して、図7で示した場合におけるTLB142の設定例について説明する。図8は、図7で示した場合におけるTLB142の設定例を示す図である。図8では、ASID「0x01」は、TP1のASIDを示し、ASID「0x02」は、TP2のASIDを示し、ASID「0x03」は、TP3のASIDを示す。アクセス権限に、「R」が記載されている場合は、読み出し権限が「有り」であることを示し、「W」が記載されている場合は、書き込み権限が「有り」であることを示し、「E」が記載されている場合は、実行権限が「有り」であることを示す。逆に、それらが記載されていない場合は、それぞれ対応する権限が「無し」であることを示す。   Next, a setting example of the TLB 142 in the case illustrated in FIG. 7 will be described with reference to FIG. FIG. 8 is a diagram illustrating a setting example of the TLB 142 in the case illustrated in FIG. In FIG. 8, ASID “0x01” indicates the ASID of TP1, ASID “0x02” indicates the ASID of TP2, and ASID “0x03” indicates the ASID of TP3. When “R” is described in the access authority, it indicates that the read authority is “present”, and when “W” is described, the write authority is “present”. When “E” is described, the execution authority is “present”. Conversely, if they are not described, it indicates that the corresponding authority is “none”.

具体的には、図8に示すTLB142の1番上のエントリにおいて、TP1(RP1)に属する安全監視タスク24は、アドレス「0x0000C000」番地のページに対して、読み出し権限、書き込み権限、及び実行権限の全てのアクセス権限が付与されている。一方、2番目、3番目のエントリにおいて、TP1(RP1)に属する安全監視タスク24は、他のTP2、3(RP2、3)のそれぞれに割り当てられたアドレス「0x0000D000」番地のページ及びアドレス「0x0000E000」番地のページに対しては、読み出し権限のみが付与されている。このようにすることで、TP1に属する安全監視タスク24は、他のTP2、3に割り当てられたページであっても、読み出しのみであればアクセスすることを可能としている。TP2(RP2)に属する通常制御タスク26及びTP3(RP3)に属する安全制御タスク28についても同様であるため、説明を省略する。   Specifically, in the top entry of the TLB 142 shown in FIG. 8, the safety monitoring task 24 belonging to TP1 (RP1) has read authority, write authority, and execution authority for the page at the address “0x0000C000”. All access rights are granted. On the other hand, in the second and third entries, the safety monitoring task 24 belonging to TP1 (RP1), the address “0x0000D000” assigned to each of the other TP2, 3 (RP2, 3) and the address “0x0000E000” are assigned. Only the read authority is given to the page at the address. In this way, the safety monitoring task 24 belonging to TP1 can access the page assigned to the other TP2 and 3 as long as it is only read. Since the same applies to the normal control task 26 belonging to TP2 (RP2) and the safety control task 28 belonging to TP3 (RP3), the description thereof is omitted.

このTLB142のエントリへの情報の設定は、上述したようにOS100がその起動時に行う。具体的には、OS100は、TLB設定情報211に基づいて、各エントリの情報を作成して、MMU14に出力する。すなわち、ここでは、TLB設定情報211は、図8に示す各エントリの内容(TP、仮想アドレス、物理アドレス、及びアクセス権限)を示す情報であれば、どのような形式の情報であってもよい。MMU14の制御部141は、OS100から出力されたエントリの情報を、TLB142のエントリに格納する。   The information is set in the entry of the TLB 142 when the OS 100 starts up as described above. Specifically, the OS 100 creates information for each entry based on the TLB setting information 211 and outputs the information to the MMU 14. That is, here, the TLB setting information 211 may be information in any format as long as it is information indicating the contents (TP, virtual address, physical address, and access authority) of each entry shown in FIG. . The control unit 141 of the MMU 14 stores the entry information output from the OS 100 in the entry of the TLB 142.

ここで、図8では、TLB142のエントリにおいて、仮想アドレスと物理アドレスに同一のアドレスが設定されている場合について例示しているが、異なるアドレスを設定するようにしてもよい。また、このように、仮想アドレスと物理アドレスに同一のアドレスを設定しており、仮想アドレスから物理アドレスへの変換が不要である場合は、MMU14の仮想記憶管理機能を無効にして、MMU14を利用するようにしてもよい。この場合、プロセッサ10は、物理アドレスを指定してメモリアクセスを発行することになる。また、この場合、制御部141は、プロセッサ10からのアクセスで指定された物理アドレスをそのまま指定したアクセスを実行用メモリ11に発行する。この場合は、TLB142には、例えば、図8に示すように、仮想アドレスに物理アドレスと同一のアドレスを設定しておけばよい。または、MMU14がTLB142の物理アドレスを参照して、上述したエントリの検出を行うようにしてもよい。   Here, FIG. 8 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. In addition, when the same address is set as the virtual address and the physical address as described above and the conversion from the virtual address to the physical address is unnecessary, the virtual memory management function of the MMU 14 is disabled and the MMU 14 is used. You may make it do. 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. 8, 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.

なお、各TP1〜TP3に対して割り当てるページは、図8において示した例に限られない。例えば、図8の例とは異なるアドレスのページを、各TP1〜TP3に割り当てるようにしてもよい。また、1つのTPに対して複数のページを割り当てるようにしてもよいことは言うまでもない。   In addition, the page allocated with respect to each TP1-TP3 is not restricted to the example shown in FIG. For example, a page with an address different from the example of FIG. 8 may be assigned to each of TP1 to TP3. Needless to say, a plurality of pages may be assigned to one TP.

続いて以下では、パーティションスケジューラ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では、通常制御スケジューリングパターン(例えば図6A)または安全制御スケジューリングパターン(例えば図6B)に従って、スケジューリングを実行する場合を例に説明する。すなわち、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. 6A) or a safety control scheduling pattern (for example, FIG. 6B) 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で示した処理に関して、パーティション・スケジューリングの具体例を説明する。まず、図6Aに例示した通常制御スケジューリングパターンに従って、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. 6A, the case where scheduling is started from the active state of TP2 in S15 will be described. In this case, TPX = TP2 is started in S15, and TPX = TP2 remains even in subsequent S16 and S11 to S13. And as long as No continues in S13, the state of TPX = TP2 is maintained. If S13 is Yes and TP2 is changed to TP1 in S14, TP1 remains in S15 to S16 and S11 to S13. As long as No continues in S13, the state of TPX = TP1 is maintained. When it is determined in S16 that the execution status (data input / output, etc.) related to TP2 is normal when TP1 is active, TPX = TP2 in the next S14 (that is, start from TP2). Normal control scheduling pattern continues.) On the other hand, if it is determined in S16 that the execution status (data input / output, etc.) relating to TP2 is abnormal, TPX = TP3 (that is, a safety control scheduling pattern starting from TP3) in the next S14. Switch to.)

また、図6Bに例示した安全制御スケジューリングパターンに従って、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. 6B. In this case, TPX = TP3 is started in S15, and TPX = TP3 remains even in subsequent S16 and S11 to S13. And as long as No continues in S13, the state of TPX = TP3 is maintained. If the answer is Yes in S13 and the TP3 is changed to TP1 in S14, TP1 remains as it is in subsequent S15 to S16 and S11 to S13. As long as No continues in S13, the state of TPX = TP1 is maintained. When it is determined in S16 that the execution status (data input / output, etc.) relating to TP3 is normal when TP1 is active, TPX = TP2 is set in the next S14 (that is, starting from TP2). Switch to normal control scheduling pattern.) On the other hand, if it is determined in S16 that there is an abnormality in the execution status (data input / output, etc.) related to TP3, TPX = TP3 (that is, a safety control scheduling pattern starting from TP3) in the next S14. Will continue.)

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

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

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

続いて、図10を参照して、他のTPのメモリ領域に対する読み出し処理手順について説明する。図10は、他のTPのメモリ領域に対する読み出し処理手順の具体例を示すフローチャートである。以下、一例として、図6Aに例示した通常制御スケジューリングパターンに従って、動作した場合について説明する。   Next, with reference to FIG. 10, a read processing procedure for the memory area of another TP will be described. FIG. 10 is a flowchart showing a specific example of the read processing procedure for the memory area of another TP. Hereinafter, as an example, a case in which the operation is performed according to the normal control scheduling pattern illustrated in FIG. 6A will be described.

ここでは、まず、TP1がアクティブとなったものとする。その場合、TP1に属する安全監視タスク24が動作を開始する(S21)。安全監視タスク24は、RP1に割り当てられたページに格納されている変数Aの値を更新する(S22)。すわなち、書き込みによるアクセスが行われたことになる。例えば、I/Oポート12を介して取得したセンサ値等の書き込みが行われる。ここで、S21及びS22は、図9のS16に対応する。   Here, it is assumed that TP1 is activated first. In that case, the safety monitoring task 24 belonging to TP1 starts operation (S21). The safety monitoring task 24 updates the value of the variable A stored in the page assigned to RP1 (S22). In other words, access by writing has been performed. For example, a sensor value acquired via the I / O port 12 is written. Here, S21 and S22 correspond to S16 of FIG.

パーティションスケジューラ21は、TPの切り替えタイミングになったとき、TP1からTP2に切り替える(S23)。ここで、S23は、図9のS14に対応する。   The partition scheduler 21 switches from TP1 to TP2 when the TP switching timing comes (S23). Here, S23 corresponds to S14 of FIG.

TP2に属する通常制御タスク26が動作を開始する(S24)。通常制御タスク26は、変数Aの値を読み出す場合、シンボル情報210を参照して、変数Aの変数名から変数Aのアドレスを取得する(S25)。通常制御タスク26は、取得したアドレスにアクセスして、変数Aの値を読み出す(S26)。これによって、例えば、通常制御タスク26は、変数Aとして格納されたセンサ値を利用して、制御対象の制御計算を行うことができる。ここで、S24〜S26は、図9のS16に対応する。   The normal control task 26 belonging to TP2 starts operating (S24). When the value of the variable A is read, the normal control task 26 refers to the symbol information 210 and acquires the address of the variable A from the variable name of the variable A (S25). The normal control task 26 accesses the acquired address and reads the value of the variable A (S26). Thereby, for example, the normal control task 26 can perform control calculation of the control target using the sensor value stored as the variable A. Here, S24 to S26 correspond to S16 of FIG.

なお、上述した例では、直前のTPのデータを読み出す場合について例示したが、これに限られず、他のTPのデータであれば同様に読み出すことが可能である。例えば、TP1、TP3、TP2の順でTPが切り替わる場合には、TP2に属する通常制御タスク26が、TP1(RP1)に割り当てられたページのデータを読み出すことも可能である。また、TP間で受け渡すデータの種類も、例示したセンサ値に限られず、任意のデータを受け渡すことが可能である。   In the above-described example, the case of reading the data of the immediately preceding TP is illustrated, but the present invention is not limited to this, and other TP data can be read in the same manner. For example, when TP is switched in the order of TP1, TP3, and TP2, the normal control task 26 belonging to TP2 can read the data of the page assigned to TP1 (RP1). The type of data transferred between TPs is not limited to the exemplified sensor value, and arbitrary data can be transferred.

また、上述した例では、TPの切り替えタイミングで切り替えて、他のTPのデータを読み出す場合について例示したが、これに限られない。例えば、パーティションスケジューラ21は、自身が検出した異常の種類、又は、各タスクから通知された異常の種類によっては、非安全関連のTP2の時間が満了していない場合であっても、緊急的に安全関連のTP3に切り替えて、制御対象を緊急停止させることもできる。以上に説明した処理手順によれば、そのような場合であっても、TP3に属するタスクが、TP2に割り当てられた実行用メモリ11の領域に格納されたデータを参照することができる。つまり、TP3に属するタスクへ、TP2に属するタスクのデータの受け渡しが可能となる。これによれば、そのような場合に、データの受け渡しを可能とする仕組み(専用ソフト等)を別途実装する必要もない。そのため、実装のための手間を省くことができ、コストを低減することが可能となる。   Moreover, although the example mentioned above illustrated about the case where it switches at the switching timing of TP and reads the data of other TP, it is not restricted to this. For example, depending on the type of anomaly detected by the partition scheduler 21 or the type of anomaly notified from each task, even if the time of the non-safety related TP2 has not expired, It is also possible to switch to the safety-related TP3 and stop the control target in an emergency. According to the processing procedure described above, even in such a case, the task belonging to TP3 can refer to the data stored in the area of the execution memory 11 assigned to TP2. That is, the task data belonging to TP2 can be transferred to the task belonging to TP3. According to this, in such a case, it is not necessary to separately mount a mechanism (dedicated software or the like) that enables data transfer. Therefore, it is possible to save labor for mounting and to reduce costs.

以上に説明したように、本実施の形態1にかかる安全制御装置1では、TPに属するタスクに、実行用メモリ11の特定のページを利用して処理を実行させるために、そのページに対する全てのアクセス種別のアクセス権限を付与してそのタスクを実行する場合に、他のTPに属するタスクに、そのページに対するアクセス権限として読み出し権限のみを付与するようにしている。これによれば、TPに属するタスクが処理を実行するために利用するページのデータを、他のTPに属するタスクから読み出すことが可能となる。一方、書き込み権限及び実行権限は付与していないため、TPに属するタスクが参照するデータが、他のTPに属するタスクによって書き換えられてしまうことや、TPに属するタスクが実行するデータ(命令)が、他のTPに属するタスクによって実行されてしまうことはない。すなわち、TPに属するタスクの動作が、他のTPに属するタスクの挙動によって不正に変更されてしまうことや、TPに属するタスクの処理が、他のTPに属するタスクによって実行されてしまうこともない。したがって、本実施の形態によれば、TP間(タスク間)の独立性を維持しつつ、他のタスクに対して公開性を高めて情報(データ)を提供することが可能となる。   As described above, in the safety control device 1 according to the first embodiment, in order to cause a task belonging to the TP to execute processing using a specific page of the execution memory 11, all of the pages for the page are processed. When the access authority of the access type is given and the task is executed, only the read authority is given as the access authority for the page to the task belonging to another TP. According to this, it is possible to read out the data of the page used for the task belonging to the TP to execute the process from the task belonging to another TP. On the other hand, since write authority and execution authority are not granted, data referred to by a task belonging to TP is rewritten by a task belonging to another TP, or data (command) executed by a task belonging to TP It is never executed by tasks belonging to other TPs. That is, the operation of the task belonging to the TP is not changed illegally by the behavior of the task belonging to the other TP, and the processing of the task belonging to the TP is not executed by the task belonging to the other TP. . Therefore, according to the present embodiment, it is possible to provide information (data) with improved openness to other tasks while maintaining independence between TPs (between tasks).

また、これによれば、タスク間通信によってデータを受け渡す必要がないため、データを受け渡すための余分なメモリ領域も不要であり、データの受け渡しによるオーバーヘッドが発生することもない。そのため、必要なメモリ容量を低減しつつ、処理速度も向上することができる。   Also, according to this, since it is not necessary to exchange data by inter-task communication, an extra memory area for exchanging data is unnecessary, and overhead due to data exchange does not occur. Therefore, the processing speed can be improved while reducing the necessary memory capacity.

続いて、図11を参照して、本実施の形態にかかるソフトウェア生成装置2及びソフトウェア書込装置3のソフトウェア構成について説明する。図11は、本実施の形態にかかるソフトウェア生成装置2及びソフトウェア書込装置3のソフトウェア構成例を示すブロック図である。   Next, with reference to FIG. 11, software configurations of the software generation device 2 and the software writing device 3 according to the present embodiment will be described. FIG. 11 is a block diagram illustrating a software configuration example of the software generation device 2 and the software writing device 3 according to the present embodiment.

ソフトウェア生成装置2は、コンフィグレータ50、52、コンパイラ51、53、リンカ54、バイナリ変換ツール55を有する。ソフトウェア書込装置3は、ソフトウェア書き込みツール60を有する。   The software generation device 2 includes configurators 50 and 52, compilers 51 and 53, a linker 54, and a binary conversion tool 55. The software writing device 3 has a software writing tool 60.

ソフトウェア生成装置2は、安全制御装置1においてプロセッサ10によって実行される実行バイナリ206及びシンボル情報210を生成する装置である。実行バイナリ206には、OS100、安全監視アプリケーション101、通常制御アプリケーション102、及び安全制御アプリケーション103、TLB設定情報211が含まれる。ソフトウェア書込装置3は、ソフトウェア生成装置2が生成した実行バイナリ206及びシンボル情報210を安全制御装置1に書き込む装置である。   The software generation device 2 is a device that generates an execution binary 206 and symbol information 210 executed by the processor 10 in the safety control device 1. The execution binary 206 includes the OS 100, the safety monitoring application 101, the normal control application 102, the safety control application 103, and the TLB setting information 211. The software writing device 3 is a device that writes the execution binary 206 and the symbol information 210 generated by the software generation device 2 to the safety control device 1.

コンフィグレータ50は、ユーザーによって入力された非安全関連TPの設定情報に基づいて、その設定情報を示すソースコード301を生成する。この設定情報として、非安全関連のTP2についてのTLB142の設定内容が入力される。すなわち、非安全関連のTP2の設定情報として、TP2(RP2)に割り当てる実行用メモリ11のページのアドレス(仮想アドレス及び物理アドレス)、及び、TP2のタスクによるそのページに対するアクセス権限として読み出し権限、書き込み権限、及び実行権限の全てを「有り」とすることを示す情報と、他のTP1、3(RP1、3)に割り当てる実行用メモリ11のページのアドレス、及び、TP2のタスクによるそのページに対するアクセス権限として読み出し権限のみを「有り」とすることを示す情報とが含まれる。   The configurator 50 generates the source code 301 indicating the setting information based on the setting information of the non-safety related TP input by the user. As this setting information, the setting content of the TLB 142 for the non-safety related TP2 is input. That is, as the setting information of the non-safety related TP2, the address (virtual address and physical address) of the page of the execution memory 11 assigned to TP2 (RP2), and the read authority, the write authority as the access authority to the page by the TP2 task Information indicating that all of the authority and the execution authority are “present”, the address of the page of the execution memory 11 assigned to the other TP1, 3 (RP1, 3), and the access to the page by the task of TP2 The authority includes information indicating that only the read authority is “present”.

コンパイラ51は、ソースコード300、301をコンパイルして、非安全関連バイナリ201を生成する。すなわち、ソースコード300は、通常制御アプリケーション102のソースコードであり、非安全関連バイナリ201は、通常制御アプリケーション102及び非安全関連TP2の設定情報のオブジェクトコードである。コンパイラ51は、ソースコード300が機能安全対応OS100のAPIライブラリを使用している場合には、機能安全対応OS APIライブラリ200を参照して、ソースコード300をコンパイルする。   The compiler 51 compiles the source codes 300 and 301 to generate a non-safety related binary 201. That is, the source code 300 is a source code of the normal control application 102, and the non-safety related binary 201 is an object code of setting information of the normal control application 102 and the non-safety related TP2. When the source code 300 uses the API library of the functional safety compatible OS 100, the compiler 51 refers to the functional safety compatible OS API library 200 and compiles the source code 300.

コンフィグレータ52は、ユーザーによって入力された安全関連TPの設定情報に基づいて、その設定情報を示すソースコード302を生成する。この設定情報として、安全関連のTP1、TP3についてのTLB142の設定内容が入力される。すなわち、安全関連のTP1の設定情報として、TP1(RP1)に割り当てる実行用メモリ11のページのアドレス(仮想アドレス及び物理アドレス)、及び、TP1のタスクよるそのページに対するアクセス権限として読み出し権限、書き込み権限、及び実行権限の全てを「有り」とすることを示す情報と、他のTP2、3(RP2、3)に割り当てる実行用メモリ11のページのアドレス、及び、TP1のタスクによるそのページに対するアクセス権限として読み出し権限のみを「有り」とすることを示す情報とが含まれる。また、安全関連のTP3の設定情報として、TP3(RP3)に割り当てる実行用メモリ11のページのアドレス(仮想アドレス及び物理アドレス)、及び、TP3のタスクによるそのページに対するアクセス権限として読み出し権限、書き込み権限、及び実行権限の全てを「有り」とすることを示す情報と、他のTP1、2(RP1、2)に割り当てる実行用メモリ11のページのアドレス、及び、TP3のタスクによるそのページに対するアクセス権限として読み出し権限のみを「有り」とすることを示す情報とが含まれる。   The configurator 52 generates the source code 302 indicating the setting information based on the setting information of the safety related TP input by the user. As this setting information, the setting contents of the TLB 142 for safety-related TP1 and TP3 are input. That is, as the safety-related TP1 setting information, the page address (virtual address and physical address) of the execution memory 11 assigned to TP1 (RP1), and the read authority and write authority as the access authority to the page by the TP1 task , And information indicating that all execution authorities are “present”, the address of the page of the execution memory 11 assigned to the other TP2, 3 (RP2, 3), and the access authority to the page by the task of TP1 And information indicating that only the read authority is “present”. Further, as the safety-related TP3 setting information, the page address (virtual address and physical address) of the execution memory 11 assigned to TP3 (RP3), and the read authority and write authority as the access authority to the page by the TP3 task , And information indicating that all execution authorities are “present”, the address of the page of the execution memory 11 assigned to the other TP 1 and 2 (RP 1, 2), and the access authority to the page by the task of TP 3 And information indicating that only the read authority is “present”.

コンパイラ53は、ソースコード302をコンパイルして、安全関連設定バイナリ203を設定する。すなわち、安全関連設定バイナリ203は、安全関連TP1、TP3の設定情報のオブジェクトコードである。   The compiler 53 compiles the source code 302 and sets the safety related setting binary 203. That is, the safety related setting binary 203 is an object code of setting information of the safety related TP1 and TP3.

リンカ54は、非安全関連バイナリ201、安全関連バイナリ202、安全関連設定バイナリ203、及び、機能安全対応OSバイナリ204をリンクして、実行バイナリ205を生成する。ここで、安全関連バイナリ202は、安全関連TP1、TP3に属する安全監視アプリケーション101及び安全制御アプリケーション103のオブジェクトコードであり、機能安全対応OSバイナリ204は、OS100のオブジェクトコードである。   The linker 54 links the non-safety related binary 201, the safety related binary 202, the safety related setting binary 203, and the functional safety compatible OS binary 204 to generate an execution binary 205. Here, the safety related binary 202 is the object code of the safety monitoring application 101 and the safety control application 103 belonging to the safety related TP1 and TP3, and the functional safety compatible OS binary 204 is the object code of the OS100.

これによって、OS100、各アプリケーション101〜103、及び、TLB設定情報211のオブジェクトコードを含む実行バイナリ205が生成されることになる。すなわち、TLB設定情報211は、安全関連と非安全関連の全てのTP1〜TP3についての設定情報が含まれることになる。   As a result, the execution binary 205 including the object code of the OS 100, the applications 101 to 103, and the TLB setting information 211 is generated. That is, the TLB setting information 211 includes setting information for all safety-related and non-safety-related TP1 to TP3.

バイナリ変換ツール55は、実行バイナリ205をバイナリ変換して、実行バイナリ206を生成する。具体的には、実行バイナリ205の命令コードを、安全制御装置1のプロセッサ10で実行可能な形式の命令コードに変換する。また、このときに、バイナリ変換ツール55は、実行バイナリ205に含まれる変数の変数名(シンボル)と、その変数が格納される実行用メモリ11上のアドレスとが、全ての変数について対応付けられた表を示すシンボル情報210を生成する。   The binary conversion tool 55 performs binary conversion on the execution binary 205 to generate an execution binary 206. Specifically, the instruction code of the execution binary 205 is converted into an instruction code in a format that can be executed by the processor 10 of the safety control device 1. At this time, the binary conversion tool 55 associates the variable name (symbol) of the variable included in the execution binary 205 with the address on the execution memory 11 where the variable is stored for all the variables. Symbol information 210 indicating the table is generated.

ここで、実行バイナリ205には、各TP1〜TP3のTLB142の設定情報が含まれている。この設定情報によって、各TP1〜TP3のデータが配置される実行用メモリ11のページのアドレスを特定することが可能であるため、バイナリ変換ツール55は、そのアドレスを基準として、それぞれのページにおいて変数が配置される位置のアドレスを算出することが可能である。バイナリ変換ツール55は、そのようにして各変数のアドレスを算出して、シンボル情報210を生成する。   Here, the execution binary 205 includes setting information of the TLB 142 of each TP1 to TP3. Since the setting information can specify the address of the page of the execution memory 11 in which the data of each of TP1 to TP3 is arranged, the binary conversion tool 55 uses the variable as a reference in each page. Can be calculated. The binary conversion tool 55 thus calculates the address of each variable and generates symbol information 210.

ソフトウェア書き込みツール60は、ソフトウェア生成装置2によって生成された実行バイナリ206及びシンボル情報210を安全制御装置1の不揮発性メモリ13に書き込む。   The software writing tool 60 writes the execution binary 206 and the symbol information 210 generated by the software generation device 2 in the nonvolatile memory 13 of the safety control device 1.

続いて、図12を参照して、本実施の形態にかかるソフトウェア生成及び書き込み処理について説明する。図12は、本実施の形態にかかるソフトウェア生成及び書き込み処理を示すフローチャートである。   Next, software generation and writing processing according to the present embodiment will be described with reference to FIG. FIG. 12 is a flowchart showing software generation and writing processing according to the present embodiment.

非安全関連系のコンフィグレータ50は、ユーザーによって入力された非安全関連TP2の設定情報の内容が定義された記述を含むソースコード301を生成する(S31)。非安全関連系のコンパイラ51は、ソースコード300、301をコンパイルして非安全関連バイナリ201を生成する(S32)。   The non-safety related configurator 50 generates a source code 301 including a description in which the content of the setting information of the non-safety related TP2 input by the user is defined (S31). The non-safety related compiler 51 compiles the source codes 300 and 301 to generate the non-safety related binary 201 (S32).

一方、安全関連系のコンフィグレータ52は、ユーザーによって入力された安全関連TP1、TP3の設定情報の内容が定義された記述を含むソースコード302を生成する(S33)。安全関連系のコンパイラ53は、ソースコード302をコンパイルして安全関連設定バイナリ203を生成する(S34)。   On the other hand, the safety-related configurator 52 generates the source code 302 including the description in which the contents of the setting information of the safety-related TP1 and TP3 input by the user are defined (S33). The safety-related compiler 53 compiles the source code 302 to generate the safety-related setting binary 203 (S34).

リンカ54は、非安全関連バイナリ201、安全関連バイナリ202、安全関連設定バイナリ203、及び、機能安全対応OSバイナリ204をリンクして、実行バイナリ205を生成する(S35)。バイナリ変換ツール55は、実行バイナリ205をバイナリ変換して実行バイナリ206を生成するとともに、シンボル情報210を生成する(S36)。ソフトウェア書き込みツール60は、実行バイナリ206及びシンボル情報210を安全制御装置1に書き込む(S37)。   The linker 54 links the non-safety related binary 201, the safety related binary 202, the safety related setting binary 203, and the functional safety compatible OS binary 204 to generate the execution binary 205 (S35). The binary conversion tool 55 performs binary conversion on the execution binary 205 to generate an execution binary 206 and also generates symbol information 210 (S36). The software writing tool 60 writes the execution binary 206 and the symbol information 210 to the safety control device 1 (S37).

続いて、図13を参照して、本実施の形態にかかるソフトウェア生成装置2及びソフトウェア書込装置3のハードウェア構成例について説明する。図13は、本実施の形態にかかるソフトウェア生成装置2及びソフトウェア書込装置3のハードウェア構成例を示すブロック図である。なお、図13を参照して説明するハードウェア構成は、一例であって、上述したソフトウェア生成装置2及びソフトウェア書込装置3の動作を実行可能であれば、この構成に限定されるものではない。   Next, a hardware configuration example of the software generation device 2 and the software writing device 3 according to the present embodiment will be described with reference to FIG. FIG. 13 is a block diagram illustrating a hardware configuration example of the software generation device 2 and the software writing device 3 according to the present embodiment. Note that the hardware configuration described with reference to FIG. 13 is an example, and is not limited to this configuration as long as the operations of the software generation device 2 and the software writing device 3 described above can be performed. .

図13に示すハードウェア構成は、プロセッサ70、メモリ71、I/Oポート72、入力装置73、光ディスクドライブ74、及び、不揮発性メモリ75を有する。   The hardware configuration illustrated in FIG. 13 includes a processor 70, a memory 71, an I / O port 72, an input device 73, an optical disk drive 74, and a nonvolatile memory 75.

プロセッサ70は、プログラム(命令ストリーム)の取得、命令のデコード、命令のデコード結果に応じた演算処理を行う。なお、プロセッサ10と同様に、プロセッサ70は、マルチプロセッサ構成としてもよく、マルチコアプロセッサであってもよい。メモリ71は、プロセッサ70によるプログラム実行のために使用されるメモリである。具体的には、メモリ71は、SRAM、DRAM等のランダムアクセス可能な揮発性メモリとすればよい。メモリ71は、図1の実行用メモリ11と同様に、論理的な構成単位を示している。   The processor 70 performs operation processing according to acquisition of a program (instruction stream), instruction decoding, and instruction decoding result. As with the processor 10, the processor 70 may have a multiprocessor configuration or a multicore processor. The memory 71 is a memory used for program execution by the processor 70. Specifically, the memory 71 may be a random accessible volatile memory such as SRAM or DRAM. The memory 71 is a logical structural unit, similar to the execution memory 11 of FIG.

I/Oポート12は、外部デバイスとの間のデータ送受信に使用される。I/Oポート12は、シリアルポート又はUSB(Universal Serial Bus)ポート等である。入力装置73は、ユーザーからの入力を受け付ける。入力装置73は、例えば、マウス、キーボード、及びタッチパネル等である。   The I / O port 12 is used for data transmission / reception with an external device. The I / O port 12 is a serial port or a USB (Universal Serial Bus) port. The input device 73 receives input from the user. The input device 73 is, for example, a mouse, a keyboard, and a touch panel.

不揮発性メモリ75は、電力の供給を受けることなく、メモリ71に比べて安定的に記憶内容を維持することが可能なメモリデバイスである。例えば、不揮発性メモリ75は、ROM、フラッシュメモリ、ハードディスクドライブ若しくは光ディスクドライブ、又はこれらの組み合わせである。   The non-volatile memory 75 is a memory device capable of maintaining stored contents more stably than the memory 71 without receiving power supply. For example, the nonvolatile memory 75 is a ROM, a flash memory, a hard disk drive, an optical disk drive, or a combination thereof.

ソフトウェア生成装置2が、図13に示すようなハードウェア構成である場合、次に説明するように動作することで、上述したソフトウェア生成処理を実行する。不揮発性メモリ75は、コンフィグレータ50、52、コンパイラ51、53、リンカ54、及び、バイナリ変換ツール55が格納される。プロセッサ70は、それらのプログラム50〜55をメモリ71にロードして実行する。プロセッサ70は、コンフィグレータ50を実行することによって、ユーザーから入力装置73に対して入力された設定情報に基づいて、ソースコード301を生成して不揮発性メモリ75に格納する。   When the software generation device 2 has a hardware configuration as shown in FIG. 13, the above-described software generation processing is executed by operating as described below. The nonvolatile memory 75 stores configurators 50 and 52, compilers 51 and 53, a linker 54, and a binary conversion tool 55. The processor 70 loads these programs 50 to 55 into the memory 71 and executes them. The processor 70 executes the configurator 50 to generate the source code 301 based on the setting information input from the user to the input device 73 and store it in the nonvolatile memory 75.

また、不揮発性メモリ75は、機能安全対応OS APIライブラリ200及びソースコード300も格納される。プロセッサ70は、コンパイラ51を実行することによって、不揮発性メモリ75に格納されたソースコード300、301から、非安全関連バイナリ201を生成して不揮発性メモリ75に格納する。   The nonvolatile memory 75 also stores a functional safety-compatible OS API library 200 and source code 300. By executing the compiler 51, the processor 70 generates the non-safety related binary 201 from the source code 300 and 301 stored in the nonvolatile memory 75 and stores it in the nonvolatile memory 75.

また、プロセッサ70は、コンフィグレータ52を実行することによって、ユーザーから入力装置73に対して入力された設定情報に基づいて、ソースコード302を生成して不揮発性メモリ75に格納する。プロセッサ70は、コンパイラ53を実行することによって、不揮発性メモリ75に格納されたソースコード302から、安全関連設定バイナリ203を生成して不揮発性メモリ75に格納する。また、不揮発性メモリ75は、安全関連バイナリ202、及び機能安全対応OSバイナリ204も格納される。   Further, the processor 70 executes the configurator 52 to generate the source code 302 based on the setting information input from the user to the input device 73 and store it in the nonvolatile memory 75. The processor 70 executes the compiler 53 to generate the safety-related setting binary 203 from the source code 302 stored in the nonvolatile memory 75 and store it in the nonvolatile memory 75. The nonvolatile memory 75 also stores a safety related binary 202 and a functional safety compatible OS binary 204.

プロセッサ70は、リンカ54を実行することによって、不揮発性メモリ75に格納された非安全関連バイナリ201、安全関連バイナリ202、安全関連設定バイナリ203及び機能安全対応OSバイナリ204から、実行バイナリ205を生成して不揮発性メモリ75に格納する。プロセッサ70は、バイナリ変換ツール55を実行することによって、不揮発性メモリ75に格納された実行バイナリ205から、実行バイナリ206及びシンボル情報210を生成して不揮発性メモリ75に格納する。プロセッサ70は、光ディスクドライブ74を制御して、不揮発性メモリ75に格納された実行バイナリ206及びシンボル情報210を光ディスク80に記録する。   The processor 70 generates the execution binary 205 from the non-safety related binary 201, the safety related binary 202, the safety related setting binary 203 and the functional safety compatible OS binary 204 stored in the nonvolatile memory 75 by executing the linker 54. And stored in the nonvolatile memory 75. The processor 70 executes the binary conversion tool 55 to generate the execution binary 206 and the symbol information 210 from the execution binary 205 stored in the nonvolatile memory 75 and store the execution binary 206 and the symbol information 210 in the nonvolatile memory 75. The processor 70 controls the optical disk drive 74 to record the execution binary 206 and the symbol information 210 stored in the nonvolatile memory 75 on the optical disk 80.

ソフトウェア書込装置3が、図13に示すようなハードウェア構成である場合、次に説明するように動作することで、上述したソフトウェア書き込み処理を実行する。不揮発性メモリ75は、ソフトウェア書き込みツール60が格納される。プロセッサ70は、ソフトウェア書き込みツール60をメモリ71にロードして実行する。光ディスクドライブ74には、実行バイナリ206及びシンボル情報210が記録された光ディスク80が挿入される。プロセッサ70は、光ディスクドライブ74を制御して、光ディスク80に記録された実行バイナリ206及びシンボル情報210を読み出して、不揮発性メモリ75に格納する。プロセッサ70は、ソフトウェア書き込みツール60を実行することによって、不揮発性メモリ75に格納された実行バイナリ206及びシンボル情報210を安全制御装置1の不揮発性メモリ13に書き込む。例えば、シリアルポートを介して、シリアルインタフェースによって書き込みを行う。   When the software writing device 3 has a hardware configuration as shown in FIG. 13, the software writing process described above is executed by operating as described below. The nonvolatile memory 75 stores the software writing tool 60. The processor 70 loads the software writing tool 60 into the memory 71 and executes it. An optical disk 80 on which the execution binary 206 and symbol information 210 are recorded is inserted into the optical disk drive 74. The processor 70 controls the optical disc drive 74 to read out the execution binary 206 and the symbol information 210 recorded on the optical disc 80 and store them in the nonvolatile memory 75. The processor 70 writes the execution binary 206 and the symbol information 210 stored in the nonvolatile memory 75 into the nonvolatile memory 13 of the safety control device 1 by executing the software writing tool 60. For example, writing is performed by a serial interface via a serial port.

以上に説明したように、本実施の形態1にかかるソフトウェア生成装置2では、TPに属するタスクに、実行用メモリ11の特定のページを利用して処理を実行させるために、そのページに対する全てのアクセス種別のアクセス権限を付与してそのタスクを実行するOS100を生成する。さらに、このときに、他のTPに属するタスクに、そのページに対するアクセス権限として読み出し権限のみを付与するようにアクセス権限を設定することを可能としている。これによれば、TPに属するタスクが処理を実行するために利用するページのデータを、他のTPに属するタスクから読み出すことが可能となる。したがって、上述したように、TP間(タスク間)の独立性を維持しつつ、他のタスクに対して公開性を高めて情報(データ)を提供することが可能となる。   As described above, in the software generation device 2 according to the first exemplary embodiment, in order for the task belonging to the TP to execute processing using a specific page of the execution memory 11, all the processing for the page is performed. An OS 100 that executes the task with the access authority of the access type is generated. Furthermore, at this time, it is possible to set the access authority so that only the read authority is given to the task belonging to another TP as the access authority for the page. According to this, it is possible to read out the data of the page used for the task belonging to the TP to execute the process from the task belonging to another TP. Therefore, as described above, it is possible to provide information (data) with improved openness to other tasks while maintaining independence between TPs (between tasks).

ここで、上述した説明では、ソフトウェア生成装置2からソフトウェア書込装置3に光ディスク80を介して実行バイナリ206及びシンボル情報210を受け渡す場合について説明したが、これに限られない。例えば、光ディスクドライブ74に代えてフロッピー(登録商標)ディスクドライブを有するようにし、フロッピーディスクを介して実行バイナリ206及びシンボル情報210を受け渡すようにしてもよい。また、ソフトウェア生成装置2及びソフトウェア書込装置3のそれぞれに、有線LANポート、無線LANポート、又は赤外線ポート等の通信ポートを有するようにして、有線LAN通信、無線LAN通信、又は赤外線通信等の通信によって、実行バイナリ206及びシンボル情報210を受け渡すようにしてもよい。   Here, in the above description, the case where the execution binary 206 and the symbol information 210 are transferred from the software generation apparatus 2 to the software writing apparatus 3 via the optical disc 80 has been described, but the present invention is not limited thereto. For example, a floppy (registered trademark) disk drive may be provided instead of the optical disk drive 74, and the execution binary 206 and the symbol information 210 may be transferred via the floppy disk. In addition, each of the software generation device 2 and the software writing device 3 has a communication port such as a wired LAN port, a wireless LAN port, or an infrared port so that wired LAN communication, wireless LAN communication, infrared communication, etc. The execution binary 206 and the symbol information 210 may be transferred by communication.

また、上述した説明では、ソフトウェア生成装置2とソフトウェア書込装置3とが異なる装置で構成されている場合について説明したが、同一の装置で構成されていてもよい。また、コンフィグレータ50、52が、1つのコンフィグレータとして構成されていてもよく、コンパイラ51、53が、1つのコンパイラとして構成されていてもよい。   In the above description, the case where the software generation device 2 and the software writing device 3 are configured by different devices has been described. However, the software generation device 2 and the software writing device 3 may be configured by the same device. Further, the configurators 50 and 52 may be configured as one configurator, and the compilers 51 and 53 may be configured as one compiler.

また、上述したようにして生成されたシンボル情報210は、各TP1〜TP3に属するタスク24、26、28のように制御対象の制御に関する処理を実行するタスクが、他のTPのデータを参照するときのみの利用には制限されない。例えば、シンボル情報210を生成することによって、安全制御装置1の動作状況を調査するツール(調査アプリケーションプログラム)から利用することも可能となる。例えば、調査アプリケーションプログラムを実行したとき、TP4(RP4)に属する調査タスクとして動作する場合には、ユーザーは、TP4の設定情報として、TP4(RP4)に割り当てる実行用メモリ11のページのアドレス(仮想アドレス及び物理アドレス)、及び、TP4の調査タスクによるそのページに対するアクセス権限として読み出し権限、書き込み権限、及び実行権限の全てを「有り」とすることを示す情報と、他のTP1〜3(RP1〜3)に割り当てる実行用メモリ11のページのアドレス、及び、TP4の調査タスクによるそのページに対するアクセス権限として読み出し権限のみを「有り」とすることを示す情報とを入力する。   In addition, in the symbol information 210 generated as described above, a task that executes a process related to control of a control target like the tasks 24, 26, and 28 belonging to the TP1 to TP3 refers to data of another TP. It is not restricted to use only when. For example, by generating the symbol information 210, the symbol information 210 can be used from a tool (survey application program) that investigates the operation status of the safety control device 1. For example, when a survey application program is executed, if the user operates as a survey task belonging to TP4 (RP4), the user uses the address of the page of the execution memory 11 assigned to TP4 (RP4) as a setting information of TP4 (virtual Address and physical address), information indicating that all of the read authority, write authority, and execution authority are “present” as the access authority to the page by the investigation task of TP4, and other TP1 to 3 (RP1 to RP1) The address of the page of the execution memory 11 to be allocated to 3) and information indicating that only the read authority is “present” as the access authority for the page by the investigation task of TP4 are input.

これによれば、TP4の調査タスクには、他のTP1〜3(RP1〜3)に割り当てられた実行用メモリ11のページのデータ(変数)に対する読み出し権限が付与されることになる。したがって、調査用にTP1〜3のデータ(変数)を読み出してログする等して、TP1〜3のデータを調査することが可能となる。   According to this, the read task for the data (variable) of the page of the execution memory 11 assigned to the other TP1 to 3 (RP1 to 3) is given to the investigation task of TP4. Therefore, the data of TP1 to TP3 can be investigated by reading and logging data (variables) of TP1 to TP3 for investigation.

また、上述した説明では、設定情報として、TPに属するタスクによる他のTPに割り当てられたページに対する読み出し権限のみを「有り」とすることを示す情報を設定する場合について例示したが、この読み出し権限のみの設定を不要とするようにしてもよい。また、設定情報として、書き込み権限及び実行権限のみを設定させるようにしてもよい。そして、OS100で、各TP1〜TP3に対して、他のTPに割り当てられた実行用メモリ11のページに対するアクセス権限として、無条件に読み出し権限のみは付与するようにTLB142を設定するようにしてもよい。これによれば、ユーザーによるアクセス権限設定の負荷を低減することができる。   In the above description, the case where the information indicating that only the read authority for the page assigned to another TP by the task belonging to the TP is set to “present” is set as the setting information. It is also possible to eliminate the need for only setting. Further, only the write authority and the execution authority may be set as the setting information. Then, the OS 100 may set the TLB 142 so that only the read authority is unconditionally given to each of the TP1 to TP3 as the access authority to the page of the execution memory 11 assigned to the other TP. Good. According to this, it is possible to reduce the load of access authority setting by the user.

<発明の実施の形態2>
続いて、本発明の実施の形態2にかかる安全制御装置について説明する。本実施の形態2にかかる安全制御装置の構成は、OS100に代えてOS200を有すること以外は、図1を参照して説明した実施の形態1にかかる安全制御装置1の構成と同様であるため、その説明を省略する。
<Embodiment 2 of the Invention>
Then, the safety control apparatus concerning Embodiment 2 of this invention is demonstrated. The configuration of the safety control device according to the second embodiment is the same as the configuration of the safety control device 1 according to the first embodiment described with reference to FIG. 1 except that the OS 200 is provided instead of the OS 100. The description is omitted.

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

本実施の形態2にかかる安全制御装置は、実施の形態1にかかる安全制御装置1と比較して、OS100に代えてOS200を有する点、パーティションスケジューラ21に代えてパーティションスケジューラ31を有する点、タスク24、26、28に代えてタスク32、33、34を有する点が異なる。また、本実施の形態2では、実行用メモリ11にwai_pswフラグ29及び起床フラグ30が格納される。以下、実施の形態1と同様の内容については、適宜省略し、異なる点について説明する。   Compared with the safety control device 1 according to the first embodiment, the safety control device according to the second embodiment has an OS 200 instead of the OS 100, a partition scheduler 31 instead of the partition scheduler 21, and a task. The difference is that tasks 32, 33 and 34 are provided instead of 24, 26 and 28. In the second embodiment, the wai_psw flag 29 and the wake-up flag 30 are stored in the execution memory 11. Hereinafter, the contents similar to those of the first embodiment are omitted as appropriate, and different points will be described.

OS200は、各タスク32、33、34に対して、次回にタスクが属するタイムパーティションがアクティブとなるまで、そのタスクを実行終了してスリープさせるAPI(Application Program Interface)関数を提供する。したがって、一定周期でアクティブとなるTPに属するタスクに、このAPI関数を呼び出してスリープさせるようにすることで、そのタスクが一定周期で実行されるようにすることができる。以下、このAPI関数を「wai_psw」と記載する。   The OS 200 provides an API (Application Program Interface) function that causes each task 32, 33, 34 to sleep after being executed until the time partition to which the task belongs next becomes active. Therefore, a task belonging to a TP that becomes active at a constant cycle can be made to execute at a constant cycle by calling this API function to sleep. Hereinafter, this API function is referred to as “wai_psw”.

wai_pswフラグ29は、タスク32、33、34のそれぞれに対応するように、複数用意される。wai_pswフラグ29は、例えば、実行用メモリ11に格納される。wai_pswフラグ29は、「OK」又は「NG」のいずれかを示す値をとる変数である。wai_pswフラグ29がOKである場合、そのwai_pswフラグ29に対応するタスクが実行終了していることを意味する。一方、wai_pswフラグ29がNGである場合、そのwai_pswフラグ29に対応するタスクが実行終了していないことを意味する。   A plurality of wai_psw flags 29 are prepared so as to correspond to the tasks 32, 33 and 34, respectively. The wai_psw flag 29 is stored in the execution memory 11, for example. The wai_psw flag 29 is a variable that takes a value indicating either “OK” or “NG”. If the wai_psw flag 29 is OK, it means that the task corresponding to the wai_psw flag 29 has been executed. On the other hand, if the wai_psw flag 29 is NG, it means that the task corresponding to the wai_psw flag 29 has not finished executing.

wai_pswフラグ29は、初期値がOKを示す値になっている。パーティションスケジューラ31は、TPがアクティブになったときに、そのTPに属するタスクに対応するwai_pswフラグ29をNGに更新する。そして、各タスク32、33、34は、TP内で実行すべき処理を実行終了したとき、wai_pswを呼び出すことによって、スリープするとともにwai_pswフラグ29をOKに更新する。つまり、wai_pswには、呼び出し元のタスクに対応するwai_pswフラグ29をOKに更新する処理が含まれている。これらの処理によれば、次にTPがアクティブとなったときにwai_pswフラグ29がOKであれば、前回のTPの時間内にタスクが実行終了していたことが分かり、次にTPがアクティブとなったときにwai_pswフラグ29がNGであれば、前回のTPの時間内にタスクが実行終了していなかったことが分かる。   The initial value of the wai_psw flag 29 is a value indicating OK. When the TP becomes active, the partition scheduler 31 updates the wai_psw flag 29 corresponding to the task belonging to the TP to NG. When each task 32, 33, and 34 finishes executing the process to be executed in the TP, each task 32, sleeps and updates the wai_psw flag 29 to OK by calling wai_psw. That is, wai_psw includes processing for updating the wai_psw flag 29 corresponding to the caller task to OK. According to these processes, if the wai_psw flag 29 is OK when the TP becomes active next, it is understood that the task has been executed within the time of the previous TP, and then the TP becomes active. If the wai_psw flag 29 is NG at this time, it can be seen that the task has not been completed within the time of the previous TP.

ここで、wai_pswフラグ29は、例えば、OKを示す値を0とし、NGを示す値を1としてもよく、OKを示す値を1とし、NGを示す値を0としてもよい。また、wai_pswフラグ29は、OK又はNGを示す情報であれば、フラグのように2値化された情報に限られない。   Here, for example, the wai_psw flag 29 may have a value indicating OK as 0, a value indicating NG as 1, a value indicating OK as 1, and a value indicating NG as 0. The wai_psw flag 29 is not limited to binarized information as long as it is information indicating OK or NG.

起床フラグ30は、タスク32、33、34のそれぞれに対応するように、複数用意される。起床フラグ30は、例えば、実行用メモリ11に格納される。起床フラグ30は、「E_OK」又は「E_TMOUT」のいずれかを示す値をとる変数である。起床フラグ30がE_OKである場合、その起床フラグ30に対応するタスクが、そのタスクが属するTPの時間内に実行終了できていたことを意味する。起床フラグ30がE_TMOUTである場合、その起床フラグ30に対応するタスクが、そのタスクが属するTPの時間内に実行終了できていなかったことを意味する。   A plurality of wake-up flags 30 are prepared so as to correspond to the tasks 32, 33, and 34, respectively. The wakeup flag 30 is stored in the execution memory 11, for example. The wake-up flag 30 is a variable that takes a value indicating either “E_OK” or “E_TMOUT”. When the wakeup flag 30 is E_OK, it means that the task corresponding to the wakeup flag 30 has been completed within the time of the TP to which the task belongs. When the wakeup flag 30 is E_TMOUT, it means that the task corresponding to the wakeup flag 30 has not been completed within the time of the TP to which the task belongs.

起床フラグ30は、初期値がE_OKを示す値になっている。パーティションスケジューラ31は、TPがアクティブになったときに、そのTPに属するタスクに対応するwai_pswフラグ29がNGである場合、そのタスクに対応する起床フラグ30をE_TMOUTに更新する。これによって、起床フラグ30がE_TMOUTに更新されている場合、その起床フラグ30に対応するタスクがTPの時間内に実行終了できていなかったことが分かる。   The initial value of the wake-up flag 30 is a value indicating E_OK. If the wai_psw flag 29 corresponding to the task belonging to the TP is NG when the TP becomes active, the partition scheduler 31 updates the wake-up flag 30 corresponding to the task to E_TMOUT. As a result, when the wakeup flag 30 is updated to E_TMOUT, it can be seen that the task corresponding to the wakeup flag 30 has not been completed within the TP time.

また、wai_pswは、呼び出し元のタスクに対応する起床フラグ30がE_OKある場合、E_OKを示す値を戻り値として呼び出し元のタスクに返す。一方、wai_pswは、呼び出し元のタスクに対応する起床フラグ30がE_TMOUTである場合、E_TMOUTを示す値を戻り値として呼び出し元のタスクに返す。この戻り値は、wai_pswを呼び出してスリープしていたタスクが起床してwai_pswから復帰するときに、そのタスクに返される。これによって、呼び出し元のタスクは、wai_pswからの戻り値がE_OKである場合、TPの時間内に自身が実行終了できていたことを認識することができる。逆に、呼び出し元のタスクは、wai_pswからの戻り値がE_TMOUTである場合、TPの時間内に自身が実行終了できていなかったことを認識することができる。   Also, wai_psw returns a value indicating E_OK to the calling task as a return value when the wakeup flag 30 corresponding to the calling task is E_OK. On the other hand, when the wakeup flag 30 corresponding to the caller task is E_TMOUT, wai_psw returns a value indicating E_TMOUT to the caller task as a return value. This return value is returned to a task that has been sleeping by calling wai_psw and wakes up and returns from wai_psw. As a result, when the return value from wai_psw is E_OK, the calling task can recognize that it has finished executing within the time of TP. Conversely, when the return value from wai_psw is E_TMOUT, the caller task can recognize that it has not completed execution within the TP time.

そして、呼び出し元のタスクは、wai_pswからの戻り値に応じた処理を実行する。例えば、wai_pswからの戻り値がE_OKである場合、呼び出し元のタスクは、通常の処理を実行する。逆に、wai_pswからの戻り値がE_TMOUTである場合、呼び出し元のタスクは、異常処置を実行する。ここで、異常処置は、制御対象を安全な方向に動作させるための処置であればどのようなものであってもよい。例えば、図6Aに示す通常制御スケジューリングパターンに従って動作している場合、呼び出し元のタスクは、タスクの実行状況が異常である旨をパーティションスケジューラ31に通知する。そして、パーティションスケジューラ31は、その通知に応じて、スケジューリングパターンを、図6Bに示す安全制御スケジューリングパターンに切り替えるようにしてもよい。また、パーティションスケジューラ31は、その通知に応じて、次の動作タイミングで、TPを強制的にTP3に切り替えるようにしてもよい。そして、TP3へ切り替えた後は、例えば、安全制御タスク34によって制御対象を停止させる。また、パーティションスケジューラ21は、タスクの実行状況が異常である旨の通知を安全制御タスク34から通知された場合、パーティションスケジューラ31自身が、制御対象を停止させるように制御するようにしてもよい。   Then, the caller task executes processing according to the return value from wai_psw. For example, when the return value from wai_psw is E_OK, the calling task executes normal processing. On the other hand, when the return value from wai_psw is E_TMOUT, the calling task executes an abnormality treatment. Here, the abnormality treatment may be any treatment as long as it is a treatment for moving the controlled object in a safe direction. For example, when operating according to the normal control scheduling pattern shown in FIG. 6A, the calling task notifies the partition scheduler 31 that the task execution status is abnormal. Then, the partition scheduler 31 may switch the scheduling pattern to the safety control scheduling pattern shown in FIG. 6B according to the notification. Further, the partition scheduler 31 may forcibly switch TP to TP3 at the next operation timing according to the notification. And after switching to TP3, a control object is stopped by the safety control task 34, for example. Further, when the partition scheduler 21 is notified from the safety control task 34 that the task execution status is abnormal, the partition scheduler 31 itself may control to stop the control target.

ここで、起床フラグ30及び戻り値のそれぞれは、例えば、E_OKを示す値を0とし、E_TMOUTを示す値を1としてもよく、E_OKを示す値を1とし、E_TMOUTを示す値を0としてもよい。また、起床フラグ30及び戻り値のそれぞれは、E_OK又はE_TMOUTを示す情報であれば、フラグのように2値化された情報に限られない。さらに、起床フラグ30と戻り値とで、E_OKを示す値及びE_TMOUTを示す値のそれぞれが異なる値で定義されていてもよい。   Here, for each of the wake-up flag 30 and the return value, for example, the value indicating E_OK may be 0, the value indicating E_TMOUT may be 1, the value indicating E_OK may be 1, and the value indicating E_TMOUT may be 0. . Further, each of the wakeup flag 30 and the return value is not limited to the binarized information as long as it is information indicating E_OK or E_TMOUT. Further, the value indicating E_OK and the value indicating E_TMOUT may be defined as different values for the wakeup flag 30 and the return value.

以上に説明したようにパーティションスケジューラ31は、実施の形態1にかかるパーティションスケジューラ21と比較して、さらに、wai_pswフラグ29のチェック、wai_pswフラグ29及び起床フラグ30の更新を行う。   As described above, the partition scheduler 31 further checks the wai_psw flag 29 and updates the wai_psw flag 29 and the wake-up flag 30 as compared with the partition scheduler 21 according to the first embodiment.

安全監視タスク32、通常制御タスク33、及び安全制御タスク34のそれぞれは、実施の形態1にかかる安全監視タスク24、通常制御タスク26、及び安全制御タスク28のそれぞれと比較して、さらに、実行用メモリ11に対するアクセスを開始するときに実行用メモリ11に対するロックをかけ、アクセスが終了したときにロックを解除する。すなわち、本実施の形態2では、実行用メモリ11の排他制御を行う。例えば、安全監視タスク24が実行用メモリ11のロックをかけている場合、通常制御タスク26及び安全制御タスク28による実行用メモリ11に対するアクセスは一時的に制限されることになる。安全監視タスク32、通常制御タスク33、及び安全制御タスク34のそれぞれは、ロックを解除してから、その処理の実行を終了してスリープすることが期待値となる。   Each of the safety monitoring task 32, the normal control task 33, and the safety control task 34 is further executed in comparison with each of the safety monitoring task 24, the normal control task 26, and the safety control task 28 according to the first embodiment. The execution memory 11 is locked when the access to the memory 11 is started, and the lock is released when the access is completed. That is, in the second embodiment, exclusive control of the execution memory 11 is performed. For example, when the safety monitoring task 24 locks the execution memory 11, access to the execution memory 11 by the normal control task 26 and the safety control task 28 is temporarily restricted. Each of the safety monitoring task 32, the normal control task 33, and the safety control task 34 is expected to release the lock, end the execution of the processing, and sleep.

なお、ロックをかける単位は、実行用メモリ11全体であってもよく、実行用メモリ11の1ページ毎であってもよく、予め定めた数のページ単位であってもよく、ロックをかけるタスクが属するTPに対応するRP単位であってもよい。また、ロックをかける機構として、ミューテックス、セマフォ、又はスピンロック等の任意のロック機構を用いてよい。   The unit for locking may be the entire execution memory 11, may be for each page of the execution memory 11, or may be a predetermined number of pages, and the task for locking It may be an RP unit corresponding to the TP to which. Further, any locking mechanism such as a mutex, semaphore, or spin lock may be used as a mechanism for locking.

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

TP切り替えを実行したとき(S14)、パーティションスケジューラ31は、切り替え先のTPに属するタスクに対応するwai_pswフラグ29がOKか否かを判定する(S17)。   When TP switching is executed (S14), the partition scheduler 31 determines whether or not the wai_psw flag 29 corresponding to the task belonging to the switching destination TP is OK (S17).

切り替え先のTPに属するタスクに対応するwai_pswフラグ29がOKである場合(S17でYes)、切り替え先のTPが前回にアクティブだったときに、そのTPの時間内で、そのwai_pswフラグ29に対応するタスクが実行終了していたことを意味する。すなわち、この場合には、そのタスクが、実行用メモリ11のロックを解除してから、次のTPのタスクの実行が開始されたことが保障される。そのため、パーティションスケジューラ31は、そのタスクに対応する起床フラグ30をE_OKに更新する(S18)。そして、パーティションスケジューラ31は、S20に進む。   When the wai_psw flag 29 corresponding to the task belonging to the switching destination TP is OK (Yes in S17), when the switching destination TP was last active, the wai_psw flag 29 is supported within the time of the TP. This means that the task to be executed has ended. That is, in this case, it is ensured that the task has started execution of the next TP task after unlocking the execution memory 11. Therefore, the partition scheduler 31 updates the wakeup flag 30 corresponding to the task to E_OK (S18). Then, the partition scheduler 31 proceeds to S20.

一方、切り替え先のTPに属するタスクに対応するwai_pswフラグ29がOKでない場合(S17でNo)、切り替え先のTPが前回にアクティブだったときに、そのTPの時間内で、そのwai_pswフラグ29に対応するタスクが実行終了していなかったことを意味する。すなわち、この場合には、そのタスクが、実行用メモリ11のロックを解除する前に、次のTPのタスクの実行が開始された可能性がある。つまり、次のTPのタスクが実行用メモリ11にアクセスできず、所望の処理を実行することができなかったおそれがある。そのため、パーティションスケジューラ31は、そのタスクに対応する起床フラグ30をE_TMOUTに更新する(S19)。すなわち、切り替え先のTPに属するタスクに対応するwai_pswフラグ29がNGである場合に、S19を実行する。そして、パーティションスケジューラ21は、S20に進む。   On the other hand, if the wai_psw flag 29 corresponding to the task belonging to the switching destination TP is not OK (No in S17), when the switching destination TP was previously active, the wai_psw flag 29 is set within the time of the TP. This means that the corresponding task has not finished executing. That is, in this case, there is a possibility that the next TP task has been started before the task unlocks the execution memory 11. That is, there is a possibility that the next TP task cannot access the execution memory 11 and cannot execute a desired process. Therefore, the partition scheduler 31 updates the wakeup flag 30 corresponding to the task to E_TMOUT (S19). That is, when the wai_psw flag 29 corresponding to the task belonging to the switching destination TP is NG, S19 is executed. Then, the partition scheduler 21 proceeds to S20.

S20では、パーティションスケジューラ31は、切り替え先のTPに属するタスクに対応するwai_pswフラグ29をNGに更新する(S20)。これによれば、切り替え先のTPでタスクが実行終了するためにwai_pswを呼び出してwai_pswフラグ29をOKに更新しなかった場合に、wai_pswフラグ29がNGのままとなる。すなわち、切り替え先のTPの時間内にタスクが実行終了しなかったことを、次回にその切り替え先のTPがアクティブとなったときのwai_pswフラグ29の値によって判定すること(S17)が可能となる。そして、パーティションスケジューラ31は、S15に進む。なお、S17〜S20の処理は、TP内に複数のタスクが属している場合、その複数のタスクに対応するwai_pswフラグ29及び起床フラグ30のそれぞれに対して行われることになる。   In S20, the partition scheduler 31 updates the wai_psw flag 29 corresponding to the task belonging to the switching destination TP to NG (S20). According to this, when the wai_psw is called and the wai_psw flag 29 is not updated to OK because the task finishes executing at the switching destination TP, the wai_psw flag 29 remains NG. That is, it is possible to determine from the value of the wai_psw flag 29 when the switching destination TP becomes active next time that the task has not finished executing within the time of the switching destination TP (S17). . Then, the partition scheduler 31 proceeds to S15. Note that when a plurality of tasks belong to the TP, the processes of S17 to S20 are performed for each of the wai_psw flag 29 and the wake-up flag 30 corresponding to the plurality of tasks.

続いて、図16を参照して、本実施の形態2にかかるタスクの処理手順の具体例について説明する。図16は、本実施の形態2にかかるタスクの処理手順の具体例を示すフローチャートである。   Next, a specific example of a task processing procedure according to the second embodiment will be described with reference to FIG. FIG. 16 is a flowchart of a specific example of a task processing procedure according to the second embodiment.

S16において、TPXのタスクスケジューラは、スリープしていたTPX内のタスクを優先度に応じた順番で起床させる。起床したタスクは、wai_pswから復帰する(S41)。このとき、起床したタスクは、上述したようにwai_pswの戻り値に応じた処理を実行する。すなわち、タスクは、wai_pswからの戻り値がE_OKか否かを判定する(S42)。   In S16, the task scheduler of TPX wakes up the tasks in TPX that have been sleeping in the order corresponding to the priority. The waked up task returns from wai_psw (S41). At this time, the task that wakes up executes processing according to the return value of wai_psw as described above. That is, the task determines whether or not the return value from wai_psw is E_OK (S42).

wai_pswからの戻り値がE_OKである場合(S42でYes)、起床したタスクがTPの時間内に実行終了できていたことになるため、通常の処理を実行する。すなわち、タスクは、自身が属するTPに割り当てられた実行用メモリ11のページを利用してその処理を実行する。具体的には、例えば、次に説明する処理を実行する。まず、タスクは、実行用メモリ11のロックをかける(S43)。タスクは、実行用メモリ11にアクセスして、データの読み出し及び書き込み等を行う(S44)。実行用メモリ11に対するアクセスを終了したとき、タスクは、実行用メモリ11のロックを解除する(S45)。そして、タスクは、S46に進む。   If the return value from wai_psw is E_OK (Yes in S42), the wake-up task has been completed within the TP time, so normal processing is executed. That is, the task executes the process using the page of the execution memory 11 assigned to the TP to which the task belongs. Specifically, for example, the process described below is executed. First, the task locks the execution memory 11 (S43). The task accesses the execution memory 11 to read and write data (S44). When the access to the execution memory 11 is completed, the task unlocks the execution memory 11 (S45). Then, the task proceeds to S46.

一方、wai_pswからの戻り値がE_OKでない(E_TMOUTである)場合(S42でNo)、起床したタスクがTPの時間内に実行終了できていなかったことになるため、タスクの実行状況が異常である旨をパーティションスケジューラ31に通知する処理を実行する(S46)。そして、タスクは、S46に進む。   On the other hand, if the return value from wai_psw is not E_OK (E_TMOUT) (No in S42), the task that has woken up has not completed execution within the time of TP, so the task execution status is abnormal. Processing for notifying the partition scheduler 31 to that effect is executed (S46). Then, the task proceeds to S46.

これらのTP内で実行すべき処理が終了した場合、タスクは、wai_pswを呼び出して再びスリープする(S47)。なお、wai_pswにおけるフラグ制御処理の処理手順については、図17を参照して後述する。   When the processing to be executed in these TPs is completed, the task calls wai_psw and sleeps again (S47). Note that the processing procedure of the flag control processing in wai_psw will be described later with reference to FIG.

続いて以下では、タスクにおけるフラグ制御処理について、図17を用いて説明する。図17は、発明の実施の形態2にかかるAPI関数wai_pswの処理手順の具体例を示すフローチャートである。すなわち、S47において、wai_pswが呼び出された後の処理手順について説明する。   Subsequently, the flag control process in the task will be described with reference to FIG. FIG. 17 is a flowchart showing a specific example of the processing procedure of the API function wai_psw according to the second embodiment of the invention. That is, the processing procedure after wai_psw is called in S47 will be described.

タスクスケジューラによって実行されたタスクは、TP内で実行すべき処理を実行終了した後、次のTPまでスリープするときに、wai_pswを呼び出す(S51)。呼び出されたwai_pswは、呼び出し元のタスクに対応するwai_pswフラグ29をOKに更新する(S52)。そして、wai_pswは、呼び出し元のタスクに対応する起床フラグ30がE_TMOUTであるか否かを判定する(S53)。   The task executed by the task scheduler calls wai_psw when it sleeps to the next TP after completing the processing to be executed in the TP (S51). The called wai_psw updates the wai_psw flag 29 corresponding to the caller task to OK (S52). Then, wai_psw determines whether or not the wakeup flag 30 corresponding to the caller task is E_TMOUT (S53).

呼び出し元のタスクに対応する起床フラグ30がE_TMOUTでない場合(S53でNo)、wai_pswは、wai_pswの戻り値にE_OKを設定し(S54)、S56に進む。すなわち、呼び出し元のタスクに対応する起床フラグ30がE_OKである場合、S54が実行される。一方、起床フラグがE_TMOUTである場合、wai_pswは、wai_pswの戻り値にE_TMOUTを設定し(S55)、S56に進む。   If the wakeup flag 30 corresponding to the caller task is not E_TMOUT (No in S53), wai_psw sets E_OK as the return value of wai_psw (S54), and proceeds to S56. That is, when the wake-up flag 30 corresponding to the caller task is E_OK, S54 is executed. On the other hand, when the wake-up flag is E_TMOUT, wai_psw sets E_TMOUT as the return value of wai_psw (S55), and proceeds to S56.

wai_pswは、タスクスケジューラに、呼び出し元のタスクをスリープさせるスリープ処理を実行させる(S56)。すなわち、タスクスケジューラは、呼び出し元のタスクを実行終了して、スリープ状態に遷移させる。これによって、呼び出し元のタスクに対して割り当てたプロセッサ10の実行時間が解放される。なお、上述したように、wai_pswによってスリープしたタスクは、そのタスクが属するTPが次にアクティブとなるまでは、スリープ状態を継続する。そして、次にそのTPがアクティブになって、タスクスケジューラによってプロセッサ10の実行時間が割り当てられたときに、タスクは、スリープ時に設定された戻り値をwai_pswから受け取って、wai_pswから復帰する。つまり、タスクが起床して、タスクの実行が開始される。そして、タスクは、wai_pswからの戻り値がE_OKである場合、通常の処理を実行し、wai_pswからの戻り値がE_TMOUTである場合、異常処置を実行する。   The wai_psw causes the task scheduler to execute sleep processing that causes the calling task to sleep (S56). In other words, the task scheduler finishes executing the caller task, and transitions to the sleep state. As a result, the execution time of the processor 10 assigned to the caller task is released. Note that, as described above, a task that sleeps due to wai_psw continues to sleep until the TP to which the task belongs becomes active next. Then, when the TP becomes active next and the execution time of the processor 10 is allocated by the task scheduler, the task receives the return value set at the time of sleep from wai_psw and returns from wai_psw. That is, the task wakes up and the task execution is started. Then, when the return value from wai_psw is E_OK, the task executes normal processing, and when the return value from wai_psw is E_TMOUT, the task executes an abnormality treatment.

ここで、タスクが属するTPが次にアクティブとなるまで、そのタスクをスリープさせる方法は、例えば、次に説明する方法で実現するようにしてもよく、同様の方法であれば、この方法にも限定されない。具体的には、タスクのそれぞれに対応する起床抑止フラグを実行用メモリ11上に用意し、タスクがスリープしたときに、そのタスクに対応する起床抑止フラグを有効な値に更新する。例えば、wai_pswによって更新する。そして、起床抑止フラグが有効な値を示す場合は、同一TP内で、再度、その起床抑止フラグに対応するタスクの起床することを抑止するようにすればよい。なお、この場合、起床抑止フラグは、TPの時間が終了してから、そのTPが次にアクティブとなったときまでに、OS200又はパーティションスケジューラ31等によって、無効な値に更新するようにすればよい。   Here, the method of putting a task to sleep until the TP to which the task belongs becomes active next may be realized by, for example, the method described below. It is not limited. Specifically, a wakeup suppression flag corresponding to each task is prepared on the execution memory 11, and when the task sleeps, the wakeup suppression flag corresponding to the task is updated to a valid value. For example, it is updated by wai_psw. When the wakeup suppression flag indicates a valid value, it is only necessary to prevent the task corresponding to the wakeup suppression flag from waking up again in the same TP. In this case, if the wakeup suppression flag is updated to an invalid value by the OS 200 or the partition scheduler 31 or the like after the TP time expires and before the TP becomes active next time. Good.

続いて、図15〜17を参照して説明した処理によるタスクの実行状況監視の具体例について、図18及び図19を参照して説明する。図18は、TPの時間内にタスクが実行終了した場合におけるタスクの実行状況の具体例を示す図であり、図19は、TPの時間内にタスクが実行終了しなかった場合におけるタスクの実行状況の具体例を示す図である。なお、図18及び図19において、「Partition 1」及び「Partition 2」は、タイムパーティションを示し、「Task」は、Partition 1に属するタスクを示している。例えば、図6Aに示す通常制御スケジューリングパターンに従って動作している場合、「Partition 1」及び「Partition 2」は、TP1及びTP2に相当する。   Next, a specific example of task execution status monitoring by the processing described with reference to FIGS. 15 to 17 will be described with reference to FIGS. 18 and 19. FIG. 18 is a diagram showing a specific example of the task execution status when the task is completed within the time of TP, and FIG. 19 is the task execution when the task is not completed within the time of TP. It is a figure which shows the specific example of a condition. In FIG. 18 and FIG. 19, “Partition 1” and “Partition 2” indicate time partitions, and “Task” indicates a task belonging to Partition 1. For example, when operating according to the normal control scheduling pattern shown in FIG. 6A, “Partition 1” and “Partition 2” correspond to TP1 and TP2.

まず、図18を参照して、TPの時間内にタスクが実行終了した場合について説明する。ここで、wai_pswフラグ29はOKであり、起床フラグ30はE_OKであるものとする。図18は、1Tickが経過して起動されたパーティションスケジューラ21が、Partition 1をアクティブにしたとき(S11〜S14)から図示されている。   First, with reference to FIG. 18, a case where execution of a task is completed within the time of TP will be described. Here, it is assumed that the wai_psw flag 29 is OK and the wake-up flag 30 is E_OK. FIG. 18 is shown from the time when the partition scheduler 21 activated after 1 Tick has activated Partition 1 (S11 to S14).

この場合、Partition 1に属するタスクに対応するwai_pswフラグ29はOKとなっているため(S17でYes)、パーティションスケジューラ31は、Partition 1に属するタスクに対応する起床フラグ30をE_OKに更新する(S18)。また、パーティションスケジューラ21は、Partition 1に属するタスクに対応するwai_pswフラグ29をNGに更新する(S20)。Partition 1のタスクスケジューラは、動作を開始して(S15)、Partition 1内のタスクを実行する(S16、S41)。タスクは、通常の処理(S43〜S45)を実行終了したとき、wai_pswを呼び出す(S47、S51)。wai_pswは、呼び出し元のタスクに対応するwai_pswフラグをOKに更新する(S52)。また、上記S18で起床フラグ30はE_OKとなっているため(S53でNo)、wai_pswは、戻り値にE_OKを設定する(S54)。そして、wai_pswは、呼び出し元のタスクをスリープさせる(S56)。   In this case, since the wai_psw flag 29 corresponding to the task belonging to Partition 1 is OK (Yes in S17), the partition scheduler 31 updates the wake-up flag 30 corresponding to the task belonging to Partition 1 to E_OK (S18). ). Further, the partition scheduler 21 updates the wai_psw flag 29 corresponding to the task belonging to Partition 1 to NG (S20). The task scheduler of Partition 1 starts its operation (S15) and executes the tasks in Partition 1 (S16, S41). When the task finishes executing normal processing (S43 to S45), the task calls wai_psw (S47, S51). The wai_psw updates the wai_psw flag corresponding to the caller task to OK (S52). Since the wakeup flag 30 is E_OK in S18 (No in S53), wai_psw sets E_OK as the return value (S54). Then, wai_psw causes the calling task to sleep (S56).

パーティションスケジューラ31が、次にPartition 1をアクティブにしたとき(S11〜S14)、Partition 1に属するタスクに対応するwai_pswフラグ29はOKであるため(S17でYes)、パーティションスケジューラ31は、Partition 1に属するタスクに対応する起床フラグ30をE_OKに更新する(S18)。すなわち、起床フラグ30は、E_OKのままとなる。また、パーティションスケジューラ31は、Partition 1に属するタスクに対応するwai_pswフラグ29をNGに更新する(S20)。Partition 1のタスクスケジューラは、動作を開始して(S15)、Partition 1内のタスクを実行する(S16、S41)。このとき、タスクは、スリープ時に設定されたE_OKを戻り値としてwai_pswから受け取って、wai_pswから復帰する。タスクは、通常の処理(S43〜S45)を実行終了したとき、wai_pswを呼び出す(S47、S51)。wai_pswは、呼び出し元のタスクに対応するwai_pswフラグ29をOKに更新する(S52)。また、上記S18で起床フラグ30はE_OKとなっているため(S53でNo)、wai_pswは、戻り値にE_OKを設定する(S54)。そして、wai_pswは、呼び出し元のタスクをスリープさせる(S56)。   When the partition scheduler 31 next activates Partition 1 (S11 to S14), since the wai_psw flag 29 corresponding to the task belonging to Partition 1 is OK (Yes in S17), the partition scheduler 31 changes to Partition 1. The wakeup flag 30 corresponding to the task to which it belongs is updated to E_OK (S18). That is, the wake-up flag 30 remains E_OK. Further, the partition scheduler 31 updates the wai_psw flag 29 corresponding to the task belonging to Partition 1 to NG (S20). The task scheduler of Partition 1 starts its operation (S15) and executes the tasks in Partition 1 (S16, S41). At this time, the task receives E_OK set during sleep from wai_psw as a return value and returns from wai_psw. When the task finishes executing normal processing (S43 to S45), the task calls wai_psw (S47, S51). The wai_psw updates the wai_psw flag 29 corresponding to the caller task to OK (S52). Since the wakeup flag 30 is E_OK in S18 (No in S53), wai_psw sets E_OK as the return value (S54). Then, wai_psw causes the calling task to sleep (S56).

次に、Partition 1がアクティブとなったときも、wai_pswフラグ29にE_OKが設定されており、wai_pswの戻り値にE_OKが設定されているため、同様の処理が繰り返される。このように、タスクがPartition 1の時間内に実行終了できているときはwai_pswの戻り値がE_OKとなることに基づいて、タスクは、通常の処理を実行してもよいということを認識することが可能となる。   Next, when Partition 1 becomes active, E_OK is set in the wai_psw flag 29 and E_OK is set in the return value of wai_psw, so the same processing is repeated. In this way, when the task is finished executing within the time of Partition 1, it recognizes that the task may execute normal processing based on the return value of wai_psw being E_OK. Is possible.

次に、図19を参照して、TPの時間内にタスクが実行終了しなかった場合について説明する。ここで、wai_pswフラグ29はOKであり、起床フラグ30はE_OKであるものとする。図19は、1Tickが経過して起動されたパーティションスケジューラ31が、Partition 1をアクティブにしたとき(S11〜S14)から図示されている。   Next, with reference to FIG. 19, the case where the task has not finished executing within the time of TP will be described. Here, it is assumed that the wai_psw flag 29 is OK and the wake-up flag 30 is E_OK. FIG. 19 is illustrated from the time when the partition scheduler 31 activated after 1 tick has activated Partition 1 (S11 to S14).

この場合、Partition 1に属するタスクに対応するwai_pswフラグ29はOKであるため(S17でYes)、パーティションスケジューラ31は、Partition 1に属するタスクに対応する起床フラグ30をE_OKに更新する(S18)。また、パーティションスケジューラ31は、Partition 1に属するタスクに対応するwai_pswフラグ29をNGに更新する(S20)。Partition 1のタスクスケジューラは、動作を開始して(S15)、Partition 1内のタスクを実行する(S16、S41)。   In this case, since the wai_psw flag 29 corresponding to the task belonging to Partition 1 is OK (Yes in S17), the partition scheduler 31 updates the wake-up flag 30 corresponding to the task belonging to Partition 1 to E_OK (S18). Further, the partition scheduler 31 updates the wai_psw flag 29 corresponding to the task belonging to Partition 1 to NG (S20). The task scheduler of Partition 1 starts its operation (S15) and executes the tasks in Partition 1 (S16, S41).

図19では、このときに、Partition 1の時間内にタスクが実行終了しなかった場合について図示している。この場合、Partition 1の時間が満了したときにタスクスケジューラによってタスクの実行が中断され、パーティションスケジューラ31によってTPがPartition 2に切り替えられる(S11〜S14)。この場合は、タスクによってwai_pswが呼び出されていないため、wai_pswフラグ29はNGのままとなる。   FIG. 19 shows a case where the task has not finished executing within the time of Partition 1 at this time. In this case, when the time of Partition 1 expires, task execution is interrupted by the task scheduler, and TP is switched to Partition 2 by the partition scheduler 31 (S11 to S14). In this case, since wai_psw has not been called by the task, the wai_psw flag 29 remains NG.

パーティションスケジューラ31が、次にPartition 1をアクティブにしたとき(S11〜S14)、Partition 1に属するタスクに対応するwai_pswフラグ29はNGであるため(S17でNo)、パーティションスケジューラ31は、Partition 1に属するタスクに対応する起床フラグ30をE_TMOUTに更新する(S19)。また、パーティションスケジューラ31は、Partition 1に属するタスクに対応するwai_pswフラグ29をNGに更新する(S20)。Partition 1のタスクスケジューラは、動作を開始して(S15)、Partition 1内のタスクを実行する(S16、S41)。このとき、タスクは、中断されたところから実行が再開される。タスクは、通常の処理(S43〜S45)を実行終了したとき、wai_pswを呼び出す(S47、S51)。wai_pswは、呼び出し元のタスクに対応するwai_pswフラグ29をOKに更新する(S52)。また、上記S19で起床フラグ30はE_TMOUTとなっているため(S53でYes)、wai_pswは、戻り値にE_TMOUTを設定する(S55)。そして、wai_pswは、呼び出し元のタスクをスリープさせる(S56)。   When the partition scheduler 31 next activates Partition 1 (S11 to S14), since the wai_psw flag 29 corresponding to the task belonging to Partition 1 is NG (No in S17), the partition scheduler 31 changes to Partition 1. The wakeup flag 30 corresponding to the task to which it belongs is updated to E_TMOUT (S19). Further, the partition scheduler 31 updates the wai_psw flag 29 corresponding to the task belonging to Partition 1 to NG (S20). The task scheduler of Partition 1 starts its operation (S15) and executes the tasks in Partition 1 (S16, S41). At this time, the task is resumed from where it was interrupted. When the task finishes executing normal processing (S43 to S45), the task calls wai_psw (S47, S51). The wai_psw updates the wai_psw flag 29 corresponding to the caller task to OK (S52). Since the wake-up flag 30 is E_TMOUT in S19 (Yes in S53), wai_psw sets E_TMOUT as a return value (S55). Then, wai_psw causes the calling task to sleep (S56).

パーティションスケジューラ31が、次にPartition 1をアクティブにしたとき(S11〜S14)、上記と同様にS17でYesの場合の処理が実行された後、Partition 1のタスクスケジューラは、動作を開始して(S15)、Partition 1内のタスクを実行する(S16、S41)。このとき、タスクは、スリープ時に設定されたE_TMOUTを戻り値としてwai_pswから受け取って、wai_pswから復帰する。このように、wai_pswの戻り値がE_TMOUTであることに基づいて、タスクは、自身がPartition 1の時間内に実行終了できていなかったため(S42でNo)、異常処置(S46)を実行する必要があるということを認識することが可能となる。   When the partition scheduler 31 next activates Partition 1 (S11 to S14), after the processing in the case of Yes in S17 is executed as described above, the task scheduler of Partition 1 starts its operation ( S15), the task in Partition 1 is executed (S16, S41). At this time, the task receives E_TMOUT set during sleep from wai_psw as a return value, and returns from wai_psw. Thus, based on the return value of wai_psw being E_TMOUT, the task itself has not been completed within the time of Partition 1 (No in S42), and therefore it is necessary to perform an abnormality treatment (S46). It becomes possible to recognize that there is.

以上に説明したように、本実施の形態2では、TPの切り替え時に切り替え先のTPに属するタスクに対応するwai_pswフラグ29をNGに更新するとともに、そのタスクの実行終了時にwai_pswフラグ29をOKに更新するようにしている。そして、TPの切り替え時に切り替え先のTPに属するタスクに対応するwai_pswフラグ29をNGに更新する前に、wai_pswフラグ29がNGとなっていることを検出するようにしている。   As described above, in the second embodiment, the wai_psw flag 29 corresponding to the task belonging to the switching destination TP is updated to NG when the TP is switched, and the wai_psw flag 29 is set to OK when the execution of the task is completed. I try to update it. Then, before the wai_psw flag 29 corresponding to the task belonging to the switching destination TP is updated to NG when the TP is switched, it is detected that the wai_psw flag 29 is NG.

これによれば、TPの時間内にタスクが実行終了しなかったことを、wai_pswフラグ29がNGであることによって検出することができる。すなわち、TPの時間内にタスクを実行終了することができているか否かを監視することが可能となる。これによれば、タスクが実行用メモリ11をロックしたままとなり、その後に切り替わったTPに属するタスクが実行用メモリ11にアクセスできずに、正常に処理を実行することができなかった可能性があることを検出することが可能である。つまり、そのような状態のまま動作を継続することを防止することができ、より安定した制御対象の制御を行うことが可能となる。また、それを所定のタイミングで情報(wai_pswフラグ29)を更新するのみという簡易な処理での監視が可能となる。   According to this, it can be detected that the task has not finished executing within the time of TP by the wai_psw flag 29 being NG. That is, it is possible to monitor whether or not the task can be completed within the time of TP. According to this, there is a possibility that the task remains locked to the execution memory 11 and the task belonging to the TP that has been switched thereafter cannot access the execution memory 11 and cannot execute processing normally. It can be detected. That is, it is possible to prevent the operation from being continued in such a state, and it is possible to perform more stable control of the control target. In addition, it is possible to monitor it with a simple process of only updating the information (wai_psw flag 29) at a predetermined timing.

特に、本実施の形態では、他のTPに属するタスクにも、読み出し権限のみであればアクセス権限を付与するようにしている。したがって、そのようなタスクが、他のTPに割り当てられた実行用メモリ11のページにアクセスできず、正常にその処理を実行することができなかった可能性があることを好適に検出することができる。   In particular, in this embodiment, an access authority is given to tasks belonging to other TPs as long as only the read authority is present. Therefore, it is possible to suitably detect that such a task may not be able to access the page of the execution memory 11 assigned to another TP and cannot normally execute the process. it can.

ここで、一定周期でタスクの実行が終了しているか否かを監視する方法として、個々のタスクにおいて一定周期で実行が終了しているか否かを監視する仕組みを作り込む方法も考えることもできる。しかしながら、そのようにした場合、タスクを生成するアプリケーションプログラムのそれぞれに対して独立して監視する仕組みを実装した場合には、アプリケーションプログラムが複雑になってしまうという問題があった。   Here, as a method for monitoring whether or not the execution of a task is completed at a constant cycle, a method for monitoring whether or not the execution of each task is completed at a predetermined cycle can be considered. . However, in such a case, there is a problem that the application program becomes complicated when a mechanism for independently monitoring each application program that generates a task is implemented.

それに対して、さらに、本実施の形態2では、タスクがその処理を実行終了してスリープするときに呼び出すAPI関数において、wai_pswフラグ29をOKに更新するようにしている。また、TPをスケジューリングするパーティションスケジューラ31において、TPの切り替え時にwai_pswフラグ29をNGに更新するとともに、TPの切り替え時にwai_pswフラグ29を更新する前にwai_pswフラグ29がNGとなっているかを検出するようにしている。   On the other hand, in the second embodiment, the wai_psw flag 29 is updated to OK in the API function that is called when the task finishes executing the process and sleeps. In addition, the partition scheduler 31 that schedules TP updates the wai_psw flag 29 to NG at the time of TP switching, and detects whether the wai_psw flag 29 is NG before updating the wai_psw flag 29 at the time of TP switching. I have to.

これによれば、タイム・パーティショニングを採用したマルチタスクシステムにおける既存の処理タイミングを利用して、監視する仕組みを実装することができる。すなわち、より簡易に、TPの時間内にタスクを実行終了することができているか否かを監視することが可能となる。   According to this, it is possible to implement a monitoring mechanism using the existing processing timing in the multitask system adopting time partitioning. That is, it becomes possible to monitor whether or not the task can be completed within the time of TP.

本実施の形態2では、TPの切り替え時に、切り替え先のTPに属するタスクに対応するwai_pswフラグ29をNGに更新するとともに、切り替え先のTPに属するタスクに対応するwai_pswフラグ29をNGに更新する(S20)前に、wai_pswフラグ29がNGとなっていることを検出して(S17でNo)、起床フラグ30をE_TMOUTに更新する(S19)ようにしているが、これに限られない。例えば、TPの切り替え時に、切り替え前のTPに属するタスクに対応するwai_pswフラグ29をNGに更新するとともに、その切り替え前のTPに属するタスクに対応するwai_pswフラグ29をNGに更新する前に、wai_pswフラグ29がNGとなっていることを検出して、起床フラグ30をE_TMOUTに更新するようにしてもよい。   In the second embodiment, when the TP is switched, the wai_psw flag 29 corresponding to the task belonging to the switching destination TP is updated to NG, and the wai_psw flag 29 corresponding to the task belonging to the switching destination TP is updated to NG. (S20) Before, it is detected that the wai_psw flag 29 is NG (No in S17) and the wake-up flag 30 is updated to E_TMOUT (S19), but this is not restrictive. For example, at the time of TP switching, the wai_psw flag 29 corresponding to the task belonging to the TP before switching is updated to NG, and the wai_psw flag 29 corresponding to the task belonging to the TP before switching is updated to NG. The wakeup flag 30 may be updated to E_TMOUT by detecting that the flag 29 is NG.

本実施の形態2では、パーティションスケジューラが、wai_pswフラグ29がNGとなっていることを検出したときに(S17でNo)、起床フラグ30の更新のみを行うようにしているが(S19)、これに限られない。例えば、パーティションスケジューラが、wai_pswフラグ29がNGとなっていることを検出したときに、異常処置に対応する処理を即時実施するようにしてもよい。しかしながら、本実施の形態のように、起床フラグ30によってタスクにおいて異常を認識して、タスクからパーティションスケジューラに異常を通知する構成とすることで、その他の異常等をタスクからパーティションスケジューラに通知をする仕組みに統合することができ、より少ない変更量でより簡易に実装することが可能となる。   In the second embodiment, when the partition scheduler detects that the wai_psw flag 29 is NG (No in S17), it only updates the wakeup flag 30 (S19). Not limited to. For example, when the partition scheduler detects that the wai_psw flag 29 is NG, the process corresponding to the abnormality treatment may be performed immediately. However, as in this embodiment, the task is configured to recognize an abnormality in the task by the wake-up flag 30 and notify the partition scheduler of the abnormality, so that the task notifies the partition scheduler of other abnormalities. It can be integrated into the mechanism and can be implemented more easily with a smaller amount of change.

本実施の形態2では、wai_pswは、起床フラグ30がE_TMOUTの場合に、戻り値にE_TMOUTを設定してタスクをスリープさせるようにしているが、これに限られない。例えば、起床フラグ30がE_TMOUTの場合に、タスクをスリープさせずに、E_TMOUTを戻り値として即時復帰するようにしてもよい。このようにすることで、タスクによる異常処置の応答性を高めることができる。しかしながら、本実施の形態2のように、正常系と異常系とで処理を統一することによって、より少ない変更量でより簡易に実装することが可能となる。   In the second embodiment, wai_psw sets the return value to E_TMOUT and causes the task to sleep when the wakeup flag 30 is E_TMOUT, but is not limited thereto. For example, when the wake-up flag 30 is E_TMOUT, the task may be immediately returned using E_TMOUT as a return value without sleeping the task. By doing in this way, the responsiveness of the abnormal treatment by a task can be improved. However, as in the second embodiment, by unifying the processing between the normal system and the abnormal system, it is possible to more easily implement with a smaller change amount.

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

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

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

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

図20の例では、監視制御タスク35及び安全制御タスク37は、制御対象の監視や、機能安全を確保するために定められた制御計算等のように、制御対象の機能安全の確保に関する処理を実行するタスクとなる。それに対して、通常制御タスク36は、その他の制御対象の制御に関する処理を実行するタスクとなる。そのため、監視制御タスク35及び安全制御タスク37は、安全関連のタスクとなり、通常制御タスク36は、非安全関連のタスクとなる。   In the example of FIG. 20, the monitoring control task 35 and the safety control task 37 perform processing related to ensuring the functional safety of the controlled object, such as monitoring of the controlled object and control calculation defined for ensuring functional safety. A task to be executed. On the other hand, the normal control task 36 is a task that executes processing related to control of other control targets. Therefore, the supervisory control task 35 and the safety control task 37 are safety-related tasks, and the normal control task 36 is a non-safety-related task.

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

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

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

図21の例では、監視タスク38、HMIタスク40及び制御タスク39によって、制御対象の監視、それに応じた制御計算、制御計算結果に基づいた制御対象の制御を行うことで、状況によっては制御対象の機能安全の確保に関する処理を実行する。そのため、監視タスク38、HMIタスク40及び制御タスク39は、安全関連のタスクとなる。この場合には、TP1〜TP3以外のTP(図示せず)に属する、その他の制御対象の制御に関する処理を実行するタスクが、非安全関連のタスクとなる。   In the example of FIG. 21, the monitoring task 38, the HMI task 40, and the control task 39 monitor the control object, perform control calculation according to the control object, and control the control object based on the control calculation result. Execute processing related to ensuring functional safety. Therefore, the monitoring task 38, the HMI task 40, and the control task 39 are safety-related tasks. 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 a non-safety related task.

ここで、図21において説明した構成によれば、搭乗者の操作に応じて制御対象が制御されるというHMIを実現することができる。例えば、搭乗者が重心を前後に移動させることで制御対象が前後後退を行い、搭乗者が重心を左右に移動させることで制御対象が左右旋回を行うといった制御が可能となる。これについては、実施の形態1〜2及び図20によって説明した例についても同様のことが言える。具体的には、安全監視タスク24、32又は監視制御タスク35が取得したセンサ値に応じて、通常制御タスク26、33及び安全制御タスク28、34、もしくは、通常制御タスク36及び安全制御タスク37が同様の制御をすることで、HMIを実現することが可能である。また、本実施の形態2によれば、より安定した制御対象の制御を行うことが可能となる。そのため、以上に説明したように、人が搭乗することができる走行装置を制御対象として適用することで、より安全性を向上した制御対象の制御を行うことが可能となる。   Here, according to the configuration described with reference to FIG. 21, 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 applies to the examples described with reference to Embodiments 1 and 2 and FIG. Specifically, the normal control tasks 26 and 33 and the safety control tasks 28 and 34, or the normal control task 36 and the safety control task 37, depending on the sensor values acquired by the safety monitoring tasks 24 and 32 or the monitoring control task 35. However, HMI can be realized by performing similar control. Further, according to the second embodiment, it is possible to perform more stable control of the control target. Therefore, as described above, it is possible to perform control of a controlled object with improved safety by applying a traveling device on which a person can board as a controlled object.

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

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

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

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

本実施の形態では、TP(RP)ごとに異なるアクセス権限を付与する場合について例示した。すなわち、本実施の形態では、同一のTPに属するタスクに対して同一のアクセス権限を付与する場合について例示したが、これに限られない。例えば、タスクごとに異なるアクセス権限を付与するようにしてもよい。この場合は、タスクごとにASIDが一意に定義されることになる。   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.

本実施の形態では、他のTP(RP)のタスクによる読み出しのみのアクセスを可能とするメモリとして、揮発性メモリである実行用メモリ11を対象とした場合について例示したが、これに限られない。例えば、対象とするメモリは、不揮発性メモリ13であってもよい。また、対象とするメモリは、揮発性メモリ及び不揮発性メモリの組み合わせであってもよい。   In the present embodiment, the case where the execution memory 11 that is a volatile memory is targeted as the memory that can be accessed only by reading by another TP (RP) task is illustrated, but the present invention is not limited thereto. . For example, the target memory may be the nonvolatile memory 13. The target memory may be a combination of a volatile memory and a nonvolatile memory.

本実施の形態では、MMUによってメモリ保護機能を実装する場合について例示したが、これに限られない。例えば、MPU(Memory Protection Unit)によってメモリ保護機能を実装するようにしてもよい。MPUによって実装する場合、仮想記憶管理機能を有していないため、MPUが有するTLBに相当するテーブルのエントリには、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 (Memory Protection Unit). When implemented by MPU, since it does not have a virtual memory management function, the entry of the table corresponding to the TLB that MPU has is set with ASID, address, access authority to the page at that address by the task of that ASID, etc. Will be.

1 安全制御装置
2 ソフトウェア生成装置
3 ソフトウェア書込装置
10、70 プロセッサ
11 実行用メモリ
12、72 I/Oポート
13、75 不揮発性メモリ
14 MMU
15 リセット回路
20 マイクロコントローラ
21 パーティションスケジューラ
22 スケジューリングテーブル
23、25、27 タスクスケジューラ
24、32 安全監視タスク
26、33、36 通常制御タスク
28、34、37 安全制御タスク
35 監視制御タスク
38 監視タスク
39 制御タスク
40 HMIタスク
50、52 コンフィグレータ
51、53 コンパイラ
54 リンカ
55 バイナリ変換ツール
60 ソフトウェア書き込みツール
71 メモリ
73 入力装置
74 光ディスクドライブ
80 光ディスク
100 オペレーティングシステム
101 安全監視アプリケーション
102 通常制御アプリケーション
103 安全制御アプリケーション
141 制御部
142 TLB
200 機能安全対応OS APIライブラリ
201 非安全関連バイナリ
202 安全関連バイナリ
203 安全関連設定バイナリ
204 機能安全対応OSバイナリ
205、206 実行バイナリ
210 シンボル情報
211 TLB設定情報
300、301、302 ソースコード
DESCRIPTION OF SYMBOLS 1 Safety control apparatus 2 Software generation apparatus 3 Software writing apparatus 10, 70 Processor 11 Execution memory 12, 72 I / O port 13, 75 Non-volatile memory 14 MMU
15 reset circuit 20 microcontroller 21 partition scheduler 22 scheduling table 23, 25, 27 task scheduler 24, 32 safety monitoring task 26, 33, 36 normal control task 28, 34, 37 safety control task 35 monitoring control task 38 monitoring task 39 control Task 40 HMI task 50, 52 Configurator 51, 53 Compiler 54 Linker 55 Binary conversion tool 60 Software writing tool 71 Memory 73 Input device 74 Optical disk drive 80 Optical disk 100 Operating system 101 Safety monitoring application 102 Normal control application 103 Safety control application 141 Control unit 142 TLB
200 Functional safety compatible OS API library 201 Non-safety related binary 202 Safety related binary 203 Safety related setting binary 204 Functional safety compatible OS binary 205, 206 Execution binary 210 Symbol information 211 TLB setting information 300, 301, 302 Source code

Claims (10)

第1の領域と第2の領域とを含む複数の領域を有するメモリと、
第1のタスクに前記第1の領域を利用して処理を実行させるために、前記第1の領域に対する所望のアクセス権限を付与して前記第1のタスクを実行するとともに、第2のタスクに前記第2の領域を利用して処理を実行させるために、前記第2の領域に対する所望のアクセス権限を付与して前記第2のタスクを実行するタスク実行部と、を備え、
前記タスク実行部は、さらに、前記第1のタスクに前記第2の領域に対するアクセス権限として読み出し権限のみを付与する、
情報処理装置。
A memory having a plurality of regions including a first region and a second region;
In order to cause the first task to execute processing using the first area, the first task is executed by giving a desired access authority to the first area, and the second task A task execution unit that grants a desired access authority to the second area and executes the second task in order to execute processing using the second area;
The task execution unit further grants only read authority as access authority to the second area to the first task,
Information processing device.
前記タスク実行部は、前記第1の領域及び前記第2の領域として、それぞれ、予め定められた領域を固定的に割り当てる、
請求項1に記載の情報処理装置。
The task execution unit assigns a predetermined area as the first area and the second area, respectively.
The information processing apparatus according to claim 1.
前記情報処理装置は、さらに、前記第2の領域に格納されるデータのアドレスを示すアドレス情報が格納されたアドレス情報記憶部を有し、
前記第1のタスクは、前記第2の領域に格納されたデータを読み出すとき、前記アドレス情報記憶部に格納されたアドレス情報に基づいて、当該データのアドレスを特定する、
請求項2に記載の情報処理装置。
The information processing apparatus further includes an address information storage unit in which address information indicating an address of data stored in the second area is stored,
When the first task reads data stored in the second area, the first task specifies an address of the data based on address information stored in the address information storage unit.
The information processing apparatus according to claim 2.
前記タスク実行部は、前記第1のタスクが実行される第1のタイムパーティションと前記第2のタスクが実行される第2のタイムパーティションとを含む複数のタイムパーティションのスケジューリング内容を示すスケジューリング情報に従って、前記第1のタスク及び前記第2のタスクをスケジューリングして実行し、
前記タスク実行部は、前記第1のタイムパーティションにおいて実行される全てのタスクに対して、前記第1の領域に対する前記所望のアクセス権限を付与することで、前記第1のタスクに前記第1の領域に対する所望のアクセス権限を付与するとともに、前記第2のタイムパーティションにおいて実行される全てのタスクに対して、前記第2の領域に対する前記所望のアクセス権限を付与することで、前記第2のタスクに前記第1の領域に対する所望のアクセス権限を付与し、
前記タスク実行部は、さらに、前記第1のタイムパーティションにおいて実行される全てのタスクに対して、前記第2の領域に対するアクセス権限として読み出し権限のみを付与することで、前記第1のタスクに前記第2の領域に対する読み出し権限のみを付与する、
請求項1乃至3のいずれか1項に記載の情報処理装置。
The task execution unit is configured according to scheduling information indicating scheduling contents of a plurality of time partitions including a first time partition in which the first task is executed and a second time partition in which the second task is executed. Scheduling and executing the first task and the second task;
The task execution unit gives the first access to the first task by giving the desired access authority to the first area for all tasks executed in the first time partition. Granting the desired access authority to the area and granting the desired access authority to the second area for all tasks executed in the second time partition, the second task Granting the desired access authority to the first area,
The task execution unit further grants only the read authority as the access authority to the second area to all the tasks executed in the first time partition, so that the first task Grant only read authority to the second area,
The information processing apparatus according to any one of claims 1 to 3.
前記第1のタスク及び前記第2のタスクのそれぞれは、前記メモリをロックしてから前記第2の領域にアクセスして、当該アクセスの終了後に前記メモリをアンロックしてからその実行を終了し、
前記情報処理装置は、さらに、前記第2のタスクの実行終了又は実行未終了を示す終了情報が格納される終了情報記憶部を備え、
前記第2のタスクは、その実行をしたときに、前記終了情報を実行終了に更新し、
前記タスク実行部は、前記第2のタイムパーティションに関する前記タイムパーティションの切り替え時に前記終了情報を実行未終了に更新し、
前記タスク実行部は、前記第2のタイムパーティションに関する前記タイムパーティションの切り替え時に前記終了情報を実行未終了に更新する前に前記終了情報が実行未終了を示している場合を検出する、
請求項4に記載の情報処理装置。
Each of the first task and the second task accesses the second area after locking the memory, unlocks the memory after the access ends, and then finishes its execution. ,
The information processing apparatus further includes an end information storage unit that stores end information indicating execution end or non-execution end of the second task,
When the second task executes the second task, it updates the end information to end of execution,
The task execution unit updates the end information to non-executed when switching the time partition related to the second time partition,
The task execution unit detects a case where the end information indicates execution not completed before updating the end information to execution not completed when switching the time partition related to the second time partition.
The information processing apparatus according to claim 4.
前記情報処理装置は、制御対象を制御する制御装置であって、
前記第1のタスク及び前記第2のタスクのそれぞれは、前記制御対象の制御に関する処理を実行するタスクである、
請求項1乃至5のいずれか1項に記載の情報処理装置。
The information processing apparatus is a control apparatus that controls a control target,
Each of the first task and the second task is a task that executes processing related to control of the control target.
The information processing apparatus according to any one of claims 1 to 5.
前記第1のタスクは、前記制御対象の機能安全の確保に関する処理を実行するタスクであり、
前記第2のタスクは、その他の前記制御対象の制御に関する処理を実行するタスクである、
請求項6に記載の情報処理装置。
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 6.
第1の領域と第2の領域とを含む複数の領域を有するメモリに対するアクセス権限を付与するアクセス権限付与方法であって、
第1のタスクに前記第1の領域を利用して処理を実行させるために、前記第1のタスクに前記第1の領域に対する所望のアクセス権限を付与するとともに、第2のタスクに前記第2の領域を利用して処理を実行させるために、前記第2のタスクに前記第2の領域に対する所望のアクセス権限を付与する権限付与ステップと、
前記第1のタスク及び前記第2のタスクの実行を開始するタスク実行ステップと、を備え、
前記権限付与ステップでは、さらに、前記第1のタスクに前記第2の領域に対するアクセス権限として読み出し権限のみを付与する、
アクセス権限付与方法。
An access authority granting method for granting access authority to a memory having a plurality of areas including a first area and a second area,
In order to cause the first task to execute processing using the first area, the first task is given a desired access authority to the first area, and the second task is assigned the second area. An authority granting step of granting a desired access authority to the second area to the second task in order to execute processing using the area of
A task execution step of starting execution of the first task and the second task,
In the authority granting step, only the read authority is granted to the first task as an access authority to the second area.
How to grant access rights.
第1のタスクにメモリに含まれる第1の領域を利用して処理を実行させるために、前記第1の領域に対する所望のアクセス権限を付与して前記第1のタスクを実行する処理と、第2のタスクに前記メモリに含まれる第2の領域を利用して処理を実行させるために、前記第2の領域に対する所望のアクセス権限を付与して前記第2のタスクを実行する処理と、をプロセッサに実行させるシステムプログラムを生成するプログラム生成装置であって、
任意のタスクに前記メモリに含まれる任意の領域に対する任意のアクセス権限を設定する入力を受ける権限入力部と、
前記権限入力部に対する入力によって設定された内容で、前記タスクに前記領域に対するアクセス権限を付与する処理を前記プロセッサに実行させるように前記システムプログラムを生成するプログラム生成部と、を備え、
前記権限入力部は、さらに、前記第1のタスクに前記第2の領域に対するアクセス権限として読み出し権限のみを付与するように前記アクセス権限を設定する入力を受け付け可能である、
プログラム生成装置。
A process for executing the first task by granting a desired access authority to the first area in order to cause the first task to execute the process using the first area included in the memory; A process of executing the second task by giving a desired access authority to the second area in order to cause the second task to execute the process using the second area included in the memory. A program generation device for generating a system program to be executed by a processor,
An authority input unit that receives an input for setting an arbitrary access authority to an arbitrary area included in the memory for an arbitrary task;
A program generation unit that generates the system program so as to cause the processor to execute a process of granting an access authority to the area to the task, with contents set by input to the authority input unit;
The authority input unit can further accept an input for setting the access authority so as to give only a read authority as an access authority to the second area to the first task.
Program generator.
第1のタスクにメモリに含まれる第1の領域を利用して処理を実行させるために、前記第1の領域に対する所望のアクセス権限を付与して前記第1のタスクを実行する処理と、第2のタスクに前記メモリに含まれる第2の領域を利用して処理を実行させるために、前記第2の領域に対する所望のアクセス権限を付与して前記第2のタスクを実行する処理と、をプロセッサに実行させるシステムプログラムを生成するプログラム生成方法であって、
任意のタスクに前記メモリに含まれる任意の領域に対する任意のアクセス権限を設定する入力を受ける権限入力ステップと、
前記権限入力ステップにおける入力によって設定された内容で、前記タスクに前記領域に対するアクセス権限を付与する処理を前記プロセッサに実行させるように前記システムプログラムを生成するプログラム生成ステップと、を備え、
前記権限入力ステップでは、さらに、前記第1のタスクに前記第2の領域に対するアクセス権限として読み出し権限のみを付与するように前記アクセス権限を設定する入力を受け付け可能である、
プログラム生成方法。
A process for executing the first task by granting a desired access authority to the first area in order to cause the first task to execute the process using the first area included in the memory; A process of executing the second task by giving a desired access authority to the second area in order to cause the second task to execute the process using the second area included in the memory. A program generation method for generating a system program to be executed by a processor,
An authority input step for receiving an input for setting an arbitrary access authority for an arbitrary area included in the memory for an arbitrary task;
A program generation step of generating the system program so as to cause the processor to execute a process of granting the task access authority to the area with the contents set by the input in the authority input step;
In the authority input step, it is further possible to accept an input for setting the access authority so that only the read authority is given to the first task as an access authority to the second area.
Program generation method.
JP2012000086A 2012-01-04 2012-01-04 Information processing device, access authority giving method, program generation device, and method therefor Pending JP2013140476A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012000086A JP2013140476A (en) 2012-01-04 2012-01-04 Information processing device, access authority giving method, program generation device, and method therefor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012000086A JP2013140476A (en) 2012-01-04 2012-01-04 Information processing device, access authority giving method, program generation device, and method therefor

Publications (1)

Publication Number Publication Date
JP2013140476A true JP2013140476A (en) 2013-07-18

Family

ID=49037858

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012000086A Pending JP2013140476A (en) 2012-01-04 2012-01-04 Information processing device, access authority giving method, program generation device, and method therefor

Country Status (1)

Country Link
JP (1) JP2013140476A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180032050A1 (en) * 2016-07-27 2018-02-01 Fanuc Corporation Programmable controller
CN111694602A (en) * 2020-06-12 2020-09-22 北京经纬恒润科技有限公司 Cross-partition data processing method and device
WO2021192098A1 (en) * 2020-03-25 2021-09-30 三菱電機株式会社 Information processing device, information processing method, and information processing program
CN115328053A (en) * 2022-08-23 2022-11-11 中国核动力研究设计院 Authority implementation method based on nuclear power plant security level DCS system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004259298A (en) * 2004-04-21 2004-09-16 Toshiba Corp Virtual storage management method
JP2007310834A (en) * 2006-05-22 2007-11-29 Hitachi Ltd Data protection method, information processor and operating system
JP2010271759A (en) * 2009-05-19 2010-12-02 Toyota Motor Corp Safety control device and safety control method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004259298A (en) * 2004-04-21 2004-09-16 Toshiba Corp Virtual storage management method
JP2007310834A (en) * 2006-05-22 2007-11-29 Hitachi Ltd Data protection method, information processor and operating system
JP2010271759A (en) * 2009-05-19 2010-12-02 Toyota Motor Corp Safety control device and safety control method

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180032050A1 (en) * 2016-07-27 2018-02-01 Fanuc Corporation Programmable controller
JP2018018248A (en) * 2016-07-27 2018-02-01 ファナック株式会社 Programmable controller
CN107664978A (en) * 2016-07-27 2018-02-06 发那科株式会社 Programmable controller
CN107664978B (en) * 2016-07-27 2019-06-07 发那科株式会社 Programmable controller
US10488841B2 (en) 2016-07-27 2019-11-26 Fanuc Corporation Programmable controller
WO2021192098A1 (en) * 2020-03-25 2021-09-30 三菱電機株式会社 Information processing device, information processing method, and information processing program
JPWO2021192098A1 (en) * 2020-03-25 2021-09-30
JP7062142B2 (en) 2020-03-25 2022-05-02 三菱電機株式会社 Information processing equipment, information processing methods and information processing programs
CN111694602A (en) * 2020-06-12 2020-09-22 北京经纬恒润科技有限公司 Cross-partition data processing method and device
CN115328053A (en) * 2022-08-23 2022-11-11 中国核动力研究设计院 Authority implementation method based on nuclear power plant security level DCS system
CN115328053B (en) * 2022-08-23 2024-05-28 中国核动力研究设计院 Permission realization method based on security level DCS system of nuclear power plant

Similar Documents

Publication Publication Date Title
JP5446447B2 (en) SAFETY CONTROL DEVICE AND SAFETY CONTROL METHOD
JP5136695B2 (en) SAFETY CONTROL DEVICE AND SAFETY CONTROL METHOD
JP5136693B2 (en) SAFETY CONTROL DEVICE AND SAFETY CONTROL METHOD
US8756606B2 (en) Safety controller and safety control method in which time partitions are scheduled according to a scheduling pattern
JP5321686B2 (en) SAFETY CONTROL DEVICE AND SAFETY CONTROL METHOD
JP2013140476A (en) Information processing device, access authority giving method, program generation device, and method therefor
JP5621857B2 (en) SAFETY CONTROL DEVICE AND SAFETY CONTROL METHOD
JP5664530B2 (en) Operation check method of control device and memory protection device
JP5834935B2 (en) SAFETY CONTROL DEVICE AND SAFETY CONTROL METHOD
JP5845902B2 (en) Information processing apparatus and memory access management method
JP5633501B2 (en) Control apparatus and control method
JP5906584B2 (en) Control apparatus and control method
JP5811865B2 (en) Control device and program execution method
JP2014211689A (en) Safety control device and safety control method
JP5849731B2 (en) Information processing apparatus and data storage method
JP6004057B2 (en) Information processing apparatus and DMA controller operation check method
JP5803689B2 (en) Information processing apparatus and DMA controller operation check method
JP5712907B2 (en) Operation check method of control device, information processing device and memory management device
JP5853716B2 (en) Information processing apparatus and task control method
JP5699910B2 (en) Control apparatus and control method
JP2001154872A (en) Device and method for supporting software development and recording medium having the same program recorded thereon

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

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20150602

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20150729

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20151117

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20160308