JP6995644B2 - Electronic control device - Google Patents

Electronic control device Download PDF

Info

Publication number
JP6995644B2
JP6995644B2 JP2018008895A JP2018008895A JP6995644B2 JP 6995644 B2 JP6995644 B2 JP 6995644B2 JP 2018008895 A JP2018008895 A JP 2018008895A JP 2018008895 A JP2018008895 A JP 2018008895A JP 6995644 B2 JP6995644 B2 JP 6995644B2
Authority
JP
Japan
Prior art keywords
usage
shared resource
request
register
authority
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2018008895A
Other languages
Japanese (ja)
Other versions
JP2019128711A (en
Inventor
賢伸 津野田
朋仁 蛯名
一 芹沢
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hitachi Astemo Ltd
Original Assignee
Hitachi Astemo Ltd
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 Hitachi Astemo Ltd filed Critical Hitachi Astemo Ltd
Priority to JP2018008895A priority Critical patent/JP6995644B2/en
Priority to PCT/JP2019/001385 priority patent/WO2019146509A1/en
Priority to DE112019000240.6T priority patent/DE112019000240T5/en
Publication of JP2019128711A publication Critical patent/JP2019128711A/en
Application granted granted Critical
Publication of JP6995644B2 publication Critical patent/JP6995644B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores

Description

本発明は、マルチコアマイコン(メニーコアマイコンとも言う)の共有リソースに対するアクセスを制御可能な電子制御装置に関する。 The present invention relates to an electronic control device capable of controlling access to a shared resource of a multi-core microcomputer (also referred to as a many-core microcomputer).

半導体プロセスの微細化とともに、組み込みマイコンの高集積化と高機能化が急速に進展している。組み込みマイコンの重要な応用先の1つとして、自動車分野における車載電子制御装置(Electronic Control Unit、ECU)が挙げられる。システムコスト削減に対する要求を背景に、複数台のECUにより実現されていた機能を1台のECUに集約可能とする技術が求められている。期待される技術としては、例えばマルチコアを活用した高性能な組み込みマイコンを搭載する統合ECUや、統合ECUに集約された各機能を実現するアプリケーションを適切に実行するためのアプリケーション実行基盤が挙げられる。 With the miniaturization of semiconductor processes, highly integrated and highly functional embedded microcomputers are rapidly advancing. One of the important applications of the embedded microcomputer is an in-vehicle electronic control unit (Electronic Control Unit, ECU) in the automobile field. Against the background of the demand for system cost reduction, there is a demand for a technology that enables functions realized by a plurality of ECUs to be integrated into one ECU. Expected technologies include, for example, an integrated ECU equipped with a high-performance embedded microcomputer utilizing multi-core, and an application execution platform for appropriately executing an application that realizes each function integrated in the integrated ECU.

最終製品の安全性に大きく関わる車載ECUは、その実装品質や安全性を担保する機能安全フレームワークとして、車載組み込みシステム向けの国際規格であるISO26262に依拠している。ISO26262は、車載組み込みシステムにおける高い安全性・信頼性と、ソフトウェア開発効率化の両立を目標に規格化され、自動車安全度水準(Automotive Safety Integrity Level、ASIL)と呼ばれる指標を導入し、ASIL導出のための3つのファクタ(暴露性・回避性・危害度)と、それらを用いたハザード分析・リスク評価手法を定めている。ASILとは、車載組み込みシステムで起こり得る障害(ハザード)を回避するために実現しなければならない安全性のレベルを、5段階で表現したものである。 The in-vehicle ECU, which is greatly related to the safety of the final product, relies on ISO26262, which is an international standard for in-vehicle embedded systems, as a functional safety framework that guarantees the mounting quality and safety. ISO 26262 is standardized with the goal of achieving both high safety and reliability in in-vehicle embedded systems and efficient software development, and introduces an index called the Automotive Safety Risk (ASIL), which is derived from ASIL. Three factors (exposure, avoidance, and degree of harm) for this purpose and hazard analysis and risk assessment methods using them are defined. ASIL expresses the level of safety that must be realized in order to avoid possible obstacles (hazard) in an in-vehicle embedded system in five stages.

ISO26262準拠に際し、特に重視されるのは、アプリケーション間での無干渉(Freedom From Interference、FFI)の保証である。FFIの考え方では、相互に異なるASILを付与された複数のアプリケーションが1つのECU上で混在して実行される場合に、より低いASILを持つアプリケーションで発生した誤動作が、より高いASILを持つアプリケーションに伝播することを防ぐことが求められる。ISO26262が規定する、アプリケーション間で発生し得る干渉としては、タイミングと実行(時間ドメイン)、メモリ、情報の交換の3タイプが存在する。 Of particular importance in ISO 26262 compliance is the assurance of Freedom From Interference (FFI) between applications. The idea of FFI is that when multiple applications with different ASILs are mixed and executed on one ECU, the malfunction that occurs in the application with the lower ASIL becomes the application with the higher ASIL. It is required to prevent it from propagating. There are three types of interference that can occur between applications defined by ISO 26262: timing and execution (time domain), memory, and information exchange.

時間ドメインにおける無干渉性とは、あるアプリケーションの実行中に発生した障害や、想定外の割り込み処理が、安全に関わる他のアプリケーションの実行を妨げないことである。そのための典型的な実現手段としては、実行基盤となるリアルタイムOSを構成する要素の一部として、時間管理用のハードウェア(ウォッチドッグタイマなど)とソフトウェアの組み合わせにより、アプリケーション実行の静的または動的スケジューリング機能と、実行時間の監視機能を持たせたものがある。車載ECU上で同時に動作する複数のアプリケーション(もしくはアプリケーションの構成要素であるタスク)の実行スケジュールを決定する際には、マイコン内蔵または外付けのメモリや周辺モジュールなどの共有リソースへのアクセスに関する、アプリケーション間の依存関係に矛盾が生じないことが求められる。 Non-interfering in the time domain means that failures that occur during the execution of one application or unexpected interrupt handling do not interfere with the execution of other safety-related applications. As a typical implementation means for that purpose, as a part of the elements that make up the real-time OS that is the execution platform, the application execution is static or dynamic by combining time management hardware (watchdog timer, etc.) and software. Some have a target scheduling function and an execution time monitoring function. When determining the execution schedule of multiple applications (or tasks that are components of the application) that run simultaneously on the in-vehicle ECU, applications related to access to shared resources such as internal or external memory and peripheral modules of the microcomputer. It is required that there is no contradiction in the dependencies between them.

同時に実行するアプリケーション、またはアプリケーションを実行する演算要素が比較的少数である場合には、リソース共有やアクセスの排他制御を実現する以下の技術が利用されている。
(1)リアルタイムOSのスケジューラが管理する時間(Tick)を単位として、アプリケーション間の依存関係を維持しつつ適切な順序で、各アプリケーションに対し、固定タイムスロットを割り当てる時間駆動スケジューリング。
(2)共有リソースごとに設定したロック変数に対する、マイコンのアーキテクチャがサポートする手段を利用したロック/アンロック操作によるアクセス排他制御。
When there are relatively few applications that are executed at the same time or arithmetic elements that execute the applications, the following technologies that realize resource sharing and exclusive control of access are used.
(1) Time-driven scheduling that allocates fixed time slots to each application in an appropriate order while maintaining the dependency between applications in units of time (Tick) managed by the real-time OS scheduler.
(2) Exclusive access control by lock / unlock operation using the means supported by the architecture of the microcomputer for the lock variable set for each shared resource.

澤田勉(2006)『わかりやすい組込みシステム構築技法-ソフトウェア編-』共立出版Tsutomu Sawada (2006) "Easy-to-understand embedded system construction technique-software edition-" Kyoritsu Shuppan

しかしながら、時間駆動スケジューリングでは、共有リソースを専有する時間がTick未満である、もしくはアプリケーション間で大きく異なる場合に、共有リソースの利用効率が低下する。加えて、特定のアプリケーションに対する共有リソースの使用権限割り当て間隔がアプリケーション数に比例して増大するため、処理のリアルタイム性が低下する。 However, in time-driven scheduling, the utilization efficiency of shared resources decreases when the time for occupying shared resources is less than Tick or when there is a large difference between applications. In addition, the interval for allocating usage rights for shared resources to a specific application increases in proportion to the number of applications, which reduces the real-time performance of processing.

アクセス排他制御では、スピンロック処理に起因する演算要素の利用効率低下や演算処理ボトルネックが発生し、FFIの実現に必要な優先度に基づく厳密なスケジュール管理も不可能である。 In the access exclusive control, the utilization efficiency of the arithmetic element is lowered due to the spinlock processing and the arithmetic processing bottleneck occurs, and strict schedule management based on the priority required for the realization of FFI is also impossible.

このため、上述したいずれの技術を適用した場合においても、統合ECUに搭載される車載マルチコアマイコンにソフトウェア実行基盤が集約され、さらにその上で動作する多数のアプリケーションがマイコン内外のリソースを共有する環境では、車載組み込みシステムに特有の要件であるハードリアルタイム性と、マイコン上で並列動作するアプリケーション(もしくは演算要素)数の増加トレンドに適応し続けることが可能なスケーラブルなリソース共有制御の実現とを両立させることが困難だった。 Therefore, regardless of which of the above technologies are applied, the software execution platform is integrated in the in-vehicle multi-core microcomputer mounted on the integrated ECU, and a large number of applications running on the software share resources inside and outside the microcomputer. In order to achieve both hard real-time performance, which is a requirement peculiar to in-vehicle embedded systems, and the realization of scalable resource sharing control that can continue to adapt to the increasing trend of the number of applications (or arithmetic elements) operating in parallel on a microcomputer. It was difficult to get it done.

本発明は、上記事情に鑑みなされたものであり、その目的は、マルチコアマイコンにおける処理のリアルタイム性を維持しつつ、共有リソースの利用効率を向上させることが可能な電子制御装置を提供することにある。 The present invention has been made in view of the above circumstances, and an object of the present invention is to provide an electronic control device capable of improving the utilization efficiency of shared resources while maintaining the real-time performance of processing in a multi-core microcomputer. be.

上記目的を達成するため、第1の観点に係る電子制御装置は、共有リソースの割り当てに関するポリシ情報を記憶し、前記ポリシ情報に基づいて前記共有リソースの割り当て処理を実行する第1演算装置とを備える。 In order to achieve the above object, the electronic control device according to the first aspect stores the policy information regarding the allocation of the shared resource, and the first arithmetic unit that executes the allocation process of the shared resource based on the policy information. Be prepared.

本発明によれば、マルチコアマイコンにおける処理のリアルタイム性を維持しつつ、共有リソースの利用効率を向上させることができる。 According to the present invention, it is possible to improve the utilization efficiency of shared resources while maintaining the real-time performance of processing in a multi-core microcomputer.

図1は、第1実施形態に係る電子制御装置に適用されるマイコンの構成例を示すブロック図である。FIG. 1 is a block diagram showing a configuration example of a microcomputer applied to the electronic control device according to the first embodiment. 図2は、図1の使用権限制御装置の構成例を示すブロック図である。FIG. 2 is a block diagram showing a configuration example of the usage authority control device of FIG. 図3は、図2の使用権限制御装置の変形例を示すブロック図である。FIG. 3 is a block diagram showing a modified example of the usage authority control device of FIG. 図4は、図1のマイコンの変形例を示す図である。FIG. 4 is a diagram showing a modification of the microcomputer of FIG. 1. 図5は、図1の制御テーブルの構成例を示す図である。FIG. 5 is a diagram showing a configuration example of the control table of FIG. 図6は、図1の使用要求レジスタの構成例を示す図である。FIG. 6 is a diagram showing a configuration example of the usage request register of FIG. 図7は、図4のPE間割り込み制御装置の構成例を示す図である。FIG. 7 is a diagram showing a configuration example of the inter-PE interrupt control device of FIG. 図8(a)および図8(b)は、図1のマイコンの制御周期と共有リソース使用要求タイムウィンドウとの関係を示すタイミングチャートである。8 (a) and 8 (b) are timing charts showing the relationship between the control cycle of the microcomputer of FIG. 1 and the shared resource usage request time window. 図9は、第1実施形態に係るマイコンの共有リソース使用権限付与の動作を示すフローチャートである。FIG. 9 is a flowchart showing the operation of granting the shared resource use authority of the microcomputer according to the first embodiment. 図10は、第1実施形態に係るマイコンの共有リソース使用権限付与の動作を示すフローチャートである。FIG. 10 is a flowchart showing the operation of granting the shared resource use authority of the microcomputer according to the first embodiment. 図11は、第1実施形態に係るマイコンの共有リソース使用権限付与の動作を示すフローチャートである。FIG. 11 is a flowchart showing the operation of granting the shared resource use authority of the microcomputer according to the first embodiment. 図12は、第2実施形態に係るマイコンの共有リソース使用権限付与の動作を示すフローチャートである。FIG. 12 is a flowchart showing the operation of granting the shared resource use authority of the microcomputer according to the second embodiment. 図13は、第2実施形態に係るマイコンの共有リソース使用権限付与の動作を示すフローチャートである。FIG. 13 is a flowchart showing the operation of granting the shared resource use authority of the microcomputer according to the second embodiment. 図14は、第2実施形態に係るマイコンの共有リソース使用権限付与の動作を示すフローチャートである。FIG. 14 is a flowchart showing the operation of granting the shared resource use authority of the microcomputer according to the second embodiment. 図15は、第3実施形態に係るマイコンの共有リソース使用権限付与の動作を示すフローチャートである。FIG. 15 is a flowchart showing the operation of granting the shared resource use authority of the microcomputer according to the third embodiment. 図16は、第3実施形態に係るマイコンの共有リソース使用権限付与の動作を示すフローチャートである。FIG. 16 is a flowchart showing the operation of granting the shared resource use authority of the microcomputer according to the third embodiment. 図17は、第3実施形態に係るマイコンの共有リソース使用権限付与の動作を示すフローチャートである。FIG. 17 is a flowchart showing the operation of granting the shared resource use authority of the microcomputer according to the third embodiment. 図18は、第3実施形態に係るマイコンの共有リソース使用権限付与の動作を示すフローチャートである。FIG. 18 is a flowchart showing the operation of granting the shared resource use authority of the microcomputer according to the third embodiment. 図19は、第4実施形態に係るマイコンの共有リソース使用権限付与の動作を示すフローチャートである。FIG. 19 is a flowchart showing the operation of granting the shared resource use authority of the microcomputer according to the fourth embodiment. 図20は、第4実施形態に係るマイコンの共有リソース使用権限付与の動作を示すフローチャートである。FIG. 20 is a flowchart showing the operation of granting the shared resource use authority of the microcomputer according to the fourth embodiment. 図21は、第4実施形態に係るマイコンの共有リソース使用権限付与の動作を示すフローチャートである。FIG. 21 is a flowchart showing the operation of granting the shared resource use authority of the microcomputer according to the fourth embodiment. 図22は、図1のマイコンにおける使用権限の付与順序決定処理を示すフローチャートである。FIG. 22 is a flowchart showing a process of determining the order of granting usage authority in the microcomputer of FIG. 図23は、図1のマイコンにおける使用権限の付与先決定処理を示すフローチャートである。FIG. 23 is a flowchart showing a process of determining the grantee of the usage authority in the microcomputer of FIG. 図24は、図1または図4のマイコンの図8(a)の動作時における消費電力の時間変化の一例を示す図である。FIG. 24 is a diagram showing an example of a time change in power consumption during the operation of the microcomputer of FIG. 1 or FIG. 4 (a). 図25は、図1または図4のマイコンの図8(b)の動作時における消費電力の時間変化の一例を示す図である。FIG. 25 is a diagram showing an example of time-dependent changes in power consumption during operation of the microcomputer of FIG. 1 or FIG. 4 (b). 図26は、本実施形態の比較例に係るマイコンの構成例を示すブロック図である。FIG. 26 is a block diagram showing a configuration example of a microcomputer according to a comparative example of the present embodiment. 図27は、図26のマイコンにおけるロック変数を利用したアクセス排他制御方法を示すタイミングチャートである。FIG. 27 is a timing chart showing an access exclusive control method using a lock variable in the microcomputer of FIG. 26. 図28は、図26のマイコンにおける消費電力の時間変化の一例を示す図である。FIG. 28 is a diagram showing an example of time change of power consumption in the microcomputer of FIG. 26.

実施形態について、図面を参照して説明する。なお、以下に説明する実施形態は特許請求の範囲に係る発明を限定するものではなく、また実施形態の中で説明されている諸要素及びその組み合わせの全てが発明の解決手段に必須であるとは限らない。 The embodiments will be described with reference to the drawings. It should be noted that the embodiments described below do not limit the invention according to the claims, and all of the elements and combinations thereof described in the embodiments are indispensable for the means for solving the invention. Is not always.

また、以下の説明において、「メモリ」はプログラムやデータを記憶する1つ以上の実体であり、各メモリはそれぞれ1以上の不揮発性メモリ、揮発性メモリ、ROM、RAM、First-In-First-Out(FIFO)型バッファメモリ、リング型バッファメモリ、インタリーブ型バッファメモリ、命令キャッシュ、データキャッシュまたはレジスタから構成することができる。メモリの一部または全部は、マイコン(マイクロコンピュータとも言う)と同一のシリコンチップ上に形成されていてもよいし、異なるシリコンチップ上に形成されていてもよい。メモリは、さらに、マイコンのメモリアドレス空間を経由してアクセス可能な不揮発性外部記憶デバイス(例えば、ハードディスクドライブまたはソリッドステートドライブ、メモリカードなどの記録媒体)を含んでいてもよい。 Further, in the following description, the "memory" is one or more entities for storing a program or data, and each memory is one or more non-volatile memory, volatile memory, ROM, RAM, First-In-First-. It can consist of an Out (FIFO) type buffer memory, a ring type buffer memory, an interleaved type buffer memory, an instruction cache, a data cache or a register. A part or all of the memory may be formed on the same silicon chip as the microcomputer (also referred to as a microcomputer), or may be formed on a different silicon chip. The memory may further include a non-volatile external storage device (eg, a hard disk drive or solid state drive, a recording medium such as a memory card) accessible via the memory address space of the microcomputer.

また、以下の説明において、マイコンは複数の演算要素(プロセッサエレメント、PE)を含むマルチコアマイコンである。PEを構成する1つ以上のCPUコアの実装は、それぞれ1つの命令実行ユニットを備える非スーパースカラ方式でもよいし、2以上の命令実行ユニットを備えるスーパースカラ方式でもよい。PEもしくはCPUコアの故障や誤動作を検出する目的で、1つのPEを構成する、物理的に複数のCPUコア上で同一プログラムを同時に実行する、ロックステップ構成を採用してもよい。マイコンは、CPUコアとは独立に、もしくはCPUコアからの指示に基づいて、メモリアクセスを実行するハードウェア回路(例えばDirect Memory Access Controller、DMAC)を含んでいてもよい。 Further, in the following description, the microcomputer is a multi-core microcomputer including a plurality of arithmetic elements (processor elements, PE). The implementation of one or more CPU cores constituting the PE may be a non-superscalar system including one instruction execution unit, or a superscalar system including two or more instruction execution units. For the purpose of detecting a failure or malfunction of a PE or a CPU core, a lock step configuration may be adopted in which one PE is configured and the same program is physically executed simultaneously on a plurality of CPU cores. The microcomputer may include a hardware circuit (for example, Direct Memory Access Controller, DMAC) that executes memory access independently of the CPU core or based on an instruction from the CPU core.

また、以下の説明において、「kkk部」の表現にて機能を説明することがあるが、機能は1以上のプログラムが命令実行ユニットで実行されることで実現されてもよいし、1以上のハードウェア回路(例えば、Field Programmable Gate Array(FPGA)やApplication Specific Integrated Circuit(ASIC))によって実現されてもよい。機能が命令実行ユニットによって実現される場合、定められた処理が適宜メモリおよび/または通信用外部インタフェースを用いながら行われるため、機能は命令実行ユニットの少なくとも一部とされてもよい。機能を主語として説明された処理は、命令実行ユニットまたはその命令実行ユニットを有するCPUコアが行う処理としてもよい。また、命令実行ユニットは、処理の一部または全部を行うハードウェア回路を含んでいてもよい。プログラムは、プログラムソースから、マイコンがアクセス可能な1つ以上のメモリにインストールされてもよい。プログラムソースは、例えば、不揮発性メモリ上の特定領域、またはマイコンが読み取り可能な記録媒体(例えば、メモリカード)にあってもよい。なお、各機能の説明は一例であり、複数の機能が1つの機能にまとめられたり、1つの機能が複数の機能に分割されたりしてもよい。 Further, in the following description, the function may be described by the expression of "kkk part", but the function may be realized by executing one or more programs in the instruction execution unit, or one or more. It may be realized by a hardware circuit (for example, Field Programmable Gate Array (FPGA) or Application Special Integrated Circuit (ASIC)). When the function is realized by the instruction execution unit, the function may be at least a part of the instruction execution unit because the defined processing is appropriately performed by using the memory and / or the external interface for communication. The process described with the function as the subject may be a process performed by an instruction execution unit or a CPU core having the instruction execution unit. Further, the instruction execution unit may include a hardware circuit that performs a part or all of the processing. The program may be installed from the program source in one or more memories accessible to the microcomputer. The program source may be, for example, a specific area on the non-volatile memory or a recording medium (for example, a memory card) readable by the microcomputer. The description of each function is an example, and a plurality of functions may be combined into one function, or one function may be divided into a plurality of functions.

また、以下の説明において、同種の要素を区別しないで説明する場合には、参照符号または参照符号における共通番号を使用し、同種の要素を区別して説明する場合は、その要素の参照符号を使用または参照符号に代えて、その要素に割り振られたIDを使用することがある。 Further, in the following description, when the same type of element is not distinguished, the reference code or the common number in the reference code is used, and when the same type of element is described separately, the reference code of the element is used. Alternatively, the ID assigned to the element may be used instead of the reference code.

図1は、第1実施形態に係る電子制御装置に適用されるマイコンの構成例を示すブロック図である。
図1において、マイコン1は、内蔵機能モジュールとして、複数のPE10、20-1、20-2、20-3、共有リソース30、使用要求レジスタ50および使用権限制御装置60を含む。PE10、20-1、20-2、20-3は、演算要素として用いることができる。PE10、20-1、20-2、20-3、共有リソース30、使用要求レジスタ50および使用権限制御装置60は、PE間接続バス40を介して相互接続される。PE10および使用権限制御装置60は、同一のシリコンチップ上に実装されていてもよいし、異なるシリコンチップ上に実装されていてもよい。使用権限制御装置60は、図3の使用権限制御装置60Aであってもよい。PE10は、共有リソース管理プログラムを実行するマスタPEとして動作する。PE20-1、20-2、20-3は、共有リソース管理プログラム以外のユーザプログラム(以下アプリケーションとも呼ぶ)を実行するサテライトPEとして動作する。なお、マスタPEでアプリケーションを動作させてもよい。PE10が共有リソース管理プログラムを実行することにより、PE20-1、20-2、20-3間での共有リソース30の割り当てに関するポリシ情報に基づいて、共有リソース30の割り当て処理を実現することができる。各PE20-1、20-2、20-3は、共有リソース30の使用を要求し、共有リソース30の使用の要求に応じて時分割的に割り当てられた共有リソース30の使用権限に基づいて、共有リソース30を排他的に使用することができる。
FIG. 1 is a block diagram showing a configuration example of a microcomputer applied to the electronic control device according to the first embodiment.
In FIG. 1, the microcomputer 1 includes a plurality of PE10, 20-1, 20-2, 20-3, a shared resource 30, a usage request register 50, and a usage authority control device 60 as built-in function modules. PE10, 20-1, 20-2, 20-3 can be used as arithmetic elements. The PE 10, 20-1, 20-2, 20-3, the shared resource 30, the usage request register 50, and the usage authority control device 60 are interconnected via the PE-to-PE connection bus 40. The PE 10 and the usage authority control device 60 may be mounted on the same silicon chip or may be mounted on different silicon chips. The usage authority control device 60 may be the usage authority control device 60A shown in FIG. PE10 operates as a master PE that executes a shared resource management program. PE20-1, 20-2, and 20-3 operate as satellite PEs that execute user programs (hereinafter also referred to as applications) other than the shared resource management program. The application may be operated by the master PE. By executing the shared resource management program by PE10, it is possible to realize the allocation process of the shared resource 30 based on the policy information regarding the allocation of the shared resource 30 among PE20-1, 20-2, and 20-3. .. Each PE20-1, 20-2, 20-3 requests the use of the shared resource 30, and is based on the usage authority of the shared resource 30 allocated in a time-division manner in response to the request for the use of the shared resource 30. The shared resource 30 can be used exclusively.

この時、PE20-1、20-2、20-3は、共有リソース30の使用要求を使用要求レジスタ50に格納する。PE10は、使用要求レジスタ50に保持された要求状態に基づいてPE20-1、20-2、20-3からの共有リソース30の使用要求を受け付ける。そして、PE10は、使用要求を受け付けたPE20-1、20-2、20-3間において、共有リソース30の割り当てに関するポリシ情報に基づいて共有リソース30の使用のスケジューリングを実行する。使用権限制御装置60は、共有リソース30の使用のスケジューリング結果に基づいて、共有リソース30の使用権限をPE20-1、20-2、20-3に付与する。PE20-1、20-2、20-3は、使用権限制御装置60から付与された使用権限に基づいて共有リソース30を排他的に使用する。 At this time, PE20-1, 20-2, and 20-3 store the usage request of the shared resource 30 in the usage request register 50. The PE 10 accepts a request for use of the shared resource 30 from PE 20-1, 20-2, 20-3 based on the request state held in the usage request register 50. Then, the PE 10 executes scheduling of the use of the shared resource 30 between PE 20-1, 20-2, and 20-3 that have received the usage request, based on the policy information regarding the allocation of the shared resource 30. The usage authority control device 60 grants the usage authority of the shared resource 30 to PE20-1, 20-2, and 20-3 based on the scheduling result of the use of the shared resource 30. PE20-1, 20-2, and 20-3 exclusively use the shared resource 30 based on the usage authority granted by the usage authority control device 60.

ここで、共有リソース30の割り当てに関するポリシ情報は、PE20-1、20-2、20-3ごとにソフトウェアまたはファームウェア上で個別に設定することができる。このため、PE20-1、20-2、20-3が受け持つ処理内容や処理が遅れた時の危害度などに応じて、PE20-1、20-2、20-3に対する共有リソース30の使用の優先度や使用時間を柔軟に設定することができ、共有リソース30を使用するPE20-1、20-2、20-3の個数が増大した場合においても、PE20-1、20-2、20-3の処理のリアルタイム性を維持することが可能となる。 Here, the policy information regarding the allocation of the shared resource 30 can be set individually on the software or firmware for each of PE20-1, 20-2, and 20-3. Therefore, the shared resource 30 is used for PE20-1, 20-2, 20-3 according to the processing content of PE20-1, 20-2, 20-3 and the degree of harm when the processing is delayed. The priority and usage time can be set flexibly, and even when the number of PE20-1, 20-2, 20-3 using the shared resource 30 increases, PE20-1, 20-2, 20- It becomes possible to maintain the real-time property of the processing of 3.

また、PE10が共有リソース30の使用のスケジューリングを実行し、使用権限制御装置60が共有リソース30の使用権限をPE20-1、20-2、20-3に付与することにより、PE20-1、20-2、20-3による共有リソース30の占有状態および解放状態をPE10、20-1、20-2、20-3が管理する必要がなくなり、PE10、20-1、20-2、20-3の負荷を低減することが可能となる。 Further, PE10 executes scheduling of use of the shared resource 30, and the use authority control device 60 grants the use authority of the shared resource 30 to PE20-1, 20-2, 20-3, whereby PE20-1, 20. It is no longer necessary for PE10, 20-1, 20-2, 20-3 to manage the occupied state and released state of the shared resource 30 by -2, 20-3, and PE10, 20-1, 20-2, 20-3. It is possible to reduce the load on the.

さらに、使用権限制御装置60が共有リソース30の使用権限を管理することにより、リアルタイムOSが管理する制御周期に同期してPE20-1、20-2、20-3間での共有リソース30の使用権限を切り替える必要がなくなり、PE20-1、20-2、20-3の共有リソース30の使用時間の粒度を細かくすることができる。このため、1制御周期内において、使用要求を出したPE20-1、20-2、20-3に対して少なくとも1回は共有リソース30の使用を可能としつつ、PE20-1、20-2、20-3の優先度に応じて共有リソース30の占有時間を異ならせることができ、マルチコアマイコンにおける処理のリアルタイム性を維持しつつ、共有リソース30の利用効率を向上させることが可能となる。 Further, the usage authority control device 60 manages the usage authority of the shared resource 30, so that the shared resource 30 is used between PE20-1, 20-2, and 20-3 in synchronization with the control cycle managed by the real-time OS. It is not necessary to switch the authority, and the particle size of the usage time of the shared resource 30 of PE20-1, 20-2, 20-3 can be made finer. Therefore, PE20-1, 20-2, while allowing the shared resource 30 to be used at least once for PE20-1, 20-2, 20-3 that have issued a usage request within one control cycle, The occupancy time of the shared resource 30 can be made different according to the priority of 20-3, and it is possible to improve the utilization efficiency of the shared resource 30 while maintaining the real-time performance of the processing in the multi-core microcomputer.

さらに、PE20-1、20-2、20-3は、共有リソース30の使用要求を使用要求レジスタ50に格納し、PE10は、使用要求レジスタ50に保持された要求状態に基づいてPE20-1、20-2、20-3からの共有リソース30の使用要求を受け付けることにより、PE20-1、20-2、20-3は、共有リソース30の使用権限が付与されるまで共有リソース30の使用要求を何度も出す必要がなくなるとともに、スピンロックに起因する演算効率の低下を抑制することができる。 Further, PE20-1, 20-2, and 20-3 store the usage request of the shared resource 30 in the usage request register 50, and PE10 stores the usage request of the shared resource 30 in the usage request register 50. By accepting the request for use of the shared resource 30 from 20-2, 20-3, PE20-1, 20-2, 20-3 request the use of the shared resource 30 until the right to use the shared resource 30 is granted. It is not necessary to issue the number of times, and it is possible to suppress the decrease in calculation efficiency due to the spinlock.

以下、図1のマイコン1の構成について具体的に説明する。
PE10は、所定の命令セットアーキテクチャに従って作成されたプログラムを実行する1つ以上のCPUコア100-0、PE10に関連する割り込み要求を制御する割り込みコントローラ110-0、CPUコア100-0で実行されるプログラムからのアクセス要求に応じて、PE10とPE間接続バス40との間のアクセスを制御するバスインタフェース120-0、プログラムおよび/またはプログラム実行に必要なデータを格納するキャッシュメモリおよび/またはRAMメモリからなるPE内部メモリ130-0、共有リソース30のアクセス制御に必要なポリシ情報を格納する制御テーブル140を含む。
Hereinafter, the configuration of the microcomputer 1 of FIG. 1 will be specifically described.
PE10 is executed by one or more CPU cores 100-0 that execute a program created according to a predetermined instruction set architecture, interrupt controllers 110-0 that control interrupt requests related to PE10, and CPU cores 100-0. A bus interface 120-0 that controls access between the PE 10 and the PE-to-PE connection bus 40 in response to an access request from the program, and a cache memory and / or RAM memory that stores the program and / or data necessary for program execution. It includes a PE internal memory 130-0 including a control table 140 for storing policy information necessary for access control of the shared resource 30.

割り込みコントローラ110-0は割り込みコントローラ接続インタフェース111-0により、バスインタフェース120-0はバスインタフェース接続インタフェース121-0により、PE内部メモリ130はPE内部メモリ-CPUコア間接続インタフェース132-0により、それぞれCPUコア100-0との間で相互接続される。さらに、PE内部メモリ130-0はPE内部メモリ-バスインタフェース間接続インタフェース131-0により、制御テーブル140は制御テーブル接続インタフェース141により、それぞれバスインタフェース120-0との間で相互接続される。割り込みコントローラ110-0には、PE10に対する割り込み要求を示す信号として、少なくとも使用権限制御装置60が出力する使用権限制御割り込み信号61が入力される。なお、制御テーブル140は、PE内部メモリ130-0とは独立したメモリ、PE内部メモリ130-0の一部、もしくはPE間接続バス40に接続されたPE10外部のメモリ(図示せず)のいずれかとして構成されてもよい。 The interrupt controller 110-0 uses the interrupt controller connection interface 111-0, the bus interface 120-0 uses the bus interface connection interface 121-0, and the PE internal memory 130 uses the PE internal memory-CPU core connection interface 132-0. It is interconnected with the CPU core 100-0. Further, the PE internal memory 130-0 is interconnected with the PE internal memory-bus interface connection interface 131-0, and the control table 140 is interconnected with the bus interface 120-0 by the control table connection interface 141. At least the usage authority control interrupt signal 61 output by the usage authority control device 60 is input to the interrupt controller 110-0 as a signal indicating an interrupt request to the PE 10. The control table 140 is either a memory independent of the PE internal memory 130-0, a part of the PE internal memory 130-0, or a memory outside the PE 10 (not shown) connected to the PE-to-PE connection bus 40. It may be configured as a table.

PE20-1は、PE10と共通の所定の命令セットアーキテクチャに従って作成されたプログラムを実行する1つ以上のCPUコア100-1、PE20-1に関連する割り込み要求を制御する割り込みコントローラ110-1、CPUコア100-1で実行されるプログラムからのアクセス要求に応じて、PE20-1とPE間接続バス40との間のアクセスを制御するバスインタフェース120-1、プログラム、および/またはプログラム実行に必要なデータを格納するキャッシュメモリおよび/またはRAMメモリからなるPE内部メモリ130-1を含む。割り込みコントローラ110-1は割り込みコントローラ接続インタフェース111-1により、バスインタフェース120-1はバスインタフェース接続インタフェース121-1により、PE内部メモリ130-1はPE内部メモリ-CPUコア間接続インタフェース132-1により、それぞれCPUコア100-1との間で相互接続される。さらに、PE内部メモリ130-1はPE内部メモリ-バスインタフェース間接続インタフェース131-1により、バスインタフェース120-1との間で相互接続される。割り込みコントローラ110-1には、PE20-1に対する割り込み要求を示す信号として、少なくとも使用権限制御装置60が出力する使用権限制御割り込み信号62-1が入力される。 The PE20-1 is one or more CPU cores 100-1 that execute a program created according to a predetermined instruction set architecture common to the PE10, an interrupt controller 110-1 that controls interrupt requests related to the PE20-1, and a CPU. Necessary for bus interface 120-1, program, and / or program execution that controls access between PE20-1 and PE-to-PE connection bus 40 in response to an access request from a program executed on core 100-1. A PE internal memory 130-1 including a cache memory for storing data and / or a RAM memory is included. The interrupt controller 110-1 uses the interrupt controller connection interface 111-1, the bus interface 120-1 uses the bus interface connection interface 121-1, and the PE internal memory 130-1 uses the PE internal memory-CPU core connection interface 132-1. , Each are interconnected with the CPU core 100-1. Further, the PE internal memory 130-1 is interconnected with the bus interface 120-1 by the PE internal memory-bus interface connection interface 131-1. At least the usage authority control interrupt signal 62-1 output by the usage authority control device 60 is input to the interrupt controller 110-1 as a signal indicating an interrupt request to PE20-1.

PE20-2、20-3もPE20-1同様に構成することができる。PE20-2、20-3の割り込みコントローラには、当該PE20-2、20-3に対する割り込み要求を示す信号として、少なくとも使用権限制御装置60が出力する使用権限制御割り込み信号62-2、62-3が入力される。使用権限制御割り込み信号62-1、62-2、62-3はPE20-1、20-2、20-3ごとに独立した信号である。 PE20-2 and 20-3 can be configured in the same manner as PE20-1. To the interrupt controller of PE20-2, 20-3, at least the usage authority control interrupt signal 62-2, 62-3 output by the usage authority control device 60 as a signal indicating an interrupt request for the PE20-2, 20-3. Is entered. The usage authority control interrupt signals 62-1, 62-2, and 62-3 are independent signals for each of PE20-1, 20-2, and 20-3.

共有リソース30は、複数のPE20-1、20-2、20-3で動作するアプリケーションが、共有リソース管理プログラムの制御に従って時分割の態様で共有する資源である。共有リソース30は、例えば、マイコン1の外部に接続されたハードウェアとの通信を制御する通信モジュールのような、1つ以上のマイコン内蔵周辺モジュールや、PE10、20-1、20-2、20-3内部もしくは外部に接続された1つ以上のメモリのうちの少なくとも一部領域であってよい。説明を簡単にするため、共有リソース30は1つのみ図示するが、2つ以上であっても構わない。 The shared resource 30 is a resource shared by a plurality of applications operating on PE20-1, 20-2, 20-3 in a time-division manner under the control of a shared resource management program. The shared resource 30 includes one or more microcomputer built-in peripheral modules such as a communication module that controls communication with hardware connected to the outside of the microcomputer 1, and PE10, 20-1, 20-2, 20. -3 It may be at least a part of one or more memories connected to the inside or the outside. For the sake of simplicity, only one shared resource 30 is shown, but two or more shared resources 30 may be used.

図2は、図1の使用権限制御装置の構成例を示すブロック図である。
図2において、使用権限制御装置60は、PE間接続バス40を経由した使用権限制御装置60内部の制御レジスタに対するアクセスを制御するバスインタフェース600、4つのハードウェアタイマチャネル610-1、610-2、610-3、610-4、各ハードウェアタイマチャネル610-1、610-2、610-3、610-4に対するトリガ制御信号612-1、612-2、612-3、612-4を生成するトリガ制御部620、各PE10、20-1、20-2、20-3への使用権限制御割り込み信号61、62-1、62-2、62-3を生成する割り込み要求制御部630を含む。トリガ制御部620は、トリガ制御信号612-1、612-2、612-3、612-4をハードウェアタイマチャネル610-1、610-2、610-3、610-4ごとに独立して出力する。ハードウェアタイマチャネル610-1、610-2、610-3、610-4の個数は、共有リソース30を使用するアプリケーションが動作するサテライトPE数以上である。各ハードウェアタイマチャネル610-1、610-2、610-3、610-4はハードウェアタイマチャネル接続インタフェース611により、トリガ制御部620はトリガ制御部接続インタフェース621により、割り込み要求制御部630は割り込み要求制御部接続インタフェース631により、それぞれバスインタフェース600との間で相互接続される。
FIG. 2 is a block diagram showing a configuration example of the usage authority control device of FIG.
In FIG. 2, the usage authority control device 60 is a bus interface 600 that controls access to a control register inside the usage authority control device 60 via the PE-to-PE connection bus 40, and four hardware timer channels 610-1 and 610-2. , 610-3, 610-4, generate trigger control signals 612-1, 612-2, 612-3, 612-4 for each hardware timer channel 610-1, 610-2, 610-3, 610-4. Includes a trigger control unit 620 to generate an interrupt request control unit 630 that generates use authority control interrupt signals 61, 62-1, 62-2, 62-3 to PE10, 20-1, 20-2, 20-3, respectively. .. The trigger control unit 620 outputs the trigger control signals 612-1, 612-2, 612-3, 612-4 independently for each hardware timer channel 610-1, 610-2, 610-3, 610-4. do. The number of hardware timer channels 610-1, 610-2, 610-3, 610-4 is equal to or greater than the number of satellite PEs in which the application using the shared resource 30 operates. Each hardware timer channel 610-1, 610-2, 610-3, 610-4 is interrupted by the hardware timer channel connection interface 611, the trigger control unit 620 is interrupted by the trigger control unit connection interface 621, and the interrupt request control unit 630 is interrupted. Each is interconnected with the bus interface 600 by the request control unit connection interface 631.

ハードウェアタイマチャネル610-1、610-2、610-3、610-4は、当該チャネルの動作状態を示すチャネル状態レジスタ615、現在のカウント値を保持する現カウント値レジスタ616、カウント開始時に現カウント値レジスタ616にロードする初期カウント値を保持する初期カウント値レジスタ617を、チャネルごとに独立に備える。各ハードウェアタイマチャネル610-1、610-2、610-3、610-4は、ハードウェアタイマチャネル接続インタフェース611からチャネル状態レジスタ615、現カウント値レジスタ616および初期カウント値レジスタ617へのアクセス要求に応答し、指定されたチャネル状態レジスタ615、現カウント値レジスタ616および初期カウント値レジスタ617への読み書きが実行されるよう構成する。各ハードウェアタイマチャネル610-1、610-2、610-3、610-4は、チャネル状態レジスタ615の内容により識別が可能な、少なくともカウント動作中およびカウント停止中の2つの状態を持ち、以下の機能を備える。 The hardware timer channels 610-1, 610-2, 610-3, and 610-4 have a channel status register 615 indicating the operating state of the channel, a current count value register 616 holding the current count value, and a current count value register 616 at the start of counting. An initial count value register 617 for holding an initial count value to be loaded into the count value register 616 is independently provided for each channel. Each hardware timer channel 610-1, 610-2, 610-3, 610-4 requests access from the hardware timer channel connection interface 611 to the channel status register 615, the current count value register 616, and the initial count value register 617. In response to, read / write to / from the specified channel status register 615, current count value register 616, and initial count value register 617 is executed. Each hardware timer channel 610-1, 610-2, 610-3, 610-4 has at least two states, which can be identified by the contents of the channel status register 615, that is, counting is in operation and counting is stopped. It has the function of.

(1)トリガ制御信号612-1、612-2、612-3、612-4が、自チャネルのカウント動作の開始を指示する場合には、初期カウント値レジスタ617の内容を現カウント値レジスタ616にロードし、チャネル状態レジスタ615の内容がカウント動作中を示す値となるよう更新する。この時、現カウント値レジスタ616の内容が、図示しない手段により事前に定義された下限値(例えばゼロ)より大きい場合に、所定の時間が経過するごとに現カウント値レジスタ616の内容をデクリメントする。 (1) When the trigger control signals 612-1, 612-2, 612-3, and 612-4 instruct the start of the counting operation of the own channel, the contents of the initial count value register 617 are changed to the current count value register 616. And update the contents of the channel status register 615 to a value indicating that the count is in progress. At this time, when the content of the current count value register 616 is larger than the lower limit value (for example, zero) defined in advance by a means (not shown), the content of the current count value register 616 is decremented every time a predetermined time elapses. ..

(2)トリガ制御信号612-1、612-2、612-3、612-4が、自チャネルのカウント動作の停止を指示する場合には、チャネル状態レジスタ615の内容がカウント停止中を示す値となるよう更新し、現カウント値レジスタ616の内容を保持する。 (2) When the trigger control signals 612-1, 612-2, 612-3, and 612-4 instruct the stop of the counting operation of the own channel, the content of the channel status register 615 indicates that the counting is stopped. Is updated to, and the contents of the current count value register 616 are retained.

(3)ハードウェアタイマチャネル610-1、610-2、610-3、610-4がカウント動作中、当該チャネルの現カウント値レジスタ616の内容が前記下限値以下であるか否かに応じてそれぞれ真/偽となる比較結果を、タイマ値比較結果信号613-1、613-2、613-3、613-4のうち自チャネルのタイマ値比較結果信号として出力する。 (3) While the hardware timer channels 610-1, 610-2, 610-3, and 610-4 are counting, the contents of the current count value register 616 of the channel are not equal to or less than the lower limit. The comparison results that are true / false respectively are output as the timer value comparison result signal of the own channel among the timer value comparison result signals 613-1, 613-2, 613-3, and 613-4.

なお、カウント停止中のハードウェアタイマチャネル610-1、610-2、610-3、610-4に対するカウント停止指示は無効な指示として無視する。また、カウント動作中のハードウェアタイマチャネル610-1、610-2、610-3、610-4に対するカウント開始指示は、カウント動作を継続する有効な指示と解釈する。ただし、カウント開始指示に応じ改めて初期カウント値レジスタ617の内容を現カウント値レジスタ616にコピーするか否かを、図示しない手段により選択可能としてよい。 Note that the count stop instruction for the hardware timer channels 610-1, 610-2, 610-3, and 610-4 during which the count is stopped is ignored as an invalid instruction. Further, the count start instruction for the hardware timer channels 610-1, 610-2, 610-3, and 610-4 during the count operation is interpreted as a valid instruction to continue the count operation. However, it may be possible to select whether or not to copy the contents of the initial count value register 617 to the current count value register 616 according to the count start instruction by means (not shown).

トリガ制御部620は、1つ以上のハードウェアタイマチャネル610-1、610-2、610-3、610-4に対し、同時にカウント開始を指示するビットマップ形式の開始トリガレジスタ625、同時にカウント停止を指示するビットマップ形式の停止トリガレジスタ626を備える。トリガ制御部620は、トリガ制御部接続インタフェース621から開始トリガレジスタ625および停止トリガレジスタ626へのアクセス要求に応答し、指定された開始トリガレジスタ625および停止トリガレジスタ626への書き込みが実行されるよう構成する。開始トリガレジスタ625への書き込み時、トリガ制御信号612-1、612-2、612-3、612-4のうち、カウント開始を指示するフィールド値(例えば、値1)を設定された1つ以上のハードウェアタイマチャネル610-1、610-2、610-3、610-4に対し、当該チャネルへのトリガ出力を行うトリガ制御信号612-1、612-2、612-3、612-4としてカウント開始を指示する所定の信号を同時に出力する。それ以外のフィールド値(例えば、値0)を設定されたハードウェアタイマチャネル610-1、610-2、610-3、610-4に対しては、当該チャネルへのトリガ制御信号612-1、612-2、612-3、612-4としてチャネル状態の維持を指示する所定の信号を同時に出力する。 The trigger control unit 620 simultaneously instructs one or more hardware timer channels 610-1, 610-2, 610-3, 610-4 to start counting in a bitmap format start trigger register 625, and stops counting at the same time. It is provided with a bitmap type stop trigger register 626 for instructing. The trigger control unit 620 responds to an access request to the start trigger register 625 and the stop trigger register 626 from the trigger control unit connection interface 621 so that writing to the specified start trigger register 625 and the stop trigger register 626 is executed. Configure. At the time of writing to the start trigger register 625, one or more of the trigger control signals 612-1, 612-2, 612-3, 612-4 in which the field value (for example, the value 1) indicating the start of counting is set. As the trigger control signals 612-1, 612-2, 612-3, 612-4 that output the trigger to the hardware timer channels 610-1, 610-2, 610-3, 610-4 of the above. A predetermined signal instructing the start of counting is output at the same time. For hardware timer channels 610-1, 610-2, 610-3, 610-4 for which other field values (for example, value 0) are set, the trigger control signal to the channel 612-1, As 612-2, 612-3, and 612-4, predetermined signals instructing the maintenance of the channel state are simultaneously output.

また、停止トリガレジスタ626への書き込み時、トリガ制御信号612-1、612-2、612-3、612-4のうち、カウント停止を指示するフィールド値(例えば、値1)を設定された1つ以上のハードウェアタイマチャネル610-1、610-2、610-3、610-4に対し、当該チャネルへのトリガ出力を行うトリガ制御信号612-1、612-2、612-3、612-4としてカウント停止を指示する所定の信号を同時に出力する。それ以外のフィールド値(例えば、値0)を設定されたハードウェアタイマチャネル610-1、610-2、610-3、610-4に対しては、当該チャネルへのトリガ制御信号612-1、612-2、612-3、612-4としてチャネル状態の維持を指示する所定の信号を同時に出力する。 Further, at the time of writing to the stop trigger register 626, among the trigger control signals 612-1, 612-2, 612-3, and 612-4, the field value (for example, value 1) instructing the count stop is set 1. Trigger control signals 612-1, 612-2, 612-3, 612-that output a trigger to one or more hardware timer channels 610-1, 610-2, 610-3, 610-4. As No. 4, a predetermined signal instructing the stop of counting is output at the same time. For hardware timer channels 610-1, 610-2, 610-3, 610-4 for which other field values (for example, value 0) are set, the trigger control signal to the channel 612-1, As 612-2, 612-3, and 612-4, predetermined signals instructing the maintenance of the channel state are simultaneously output.

割り込み要求制御部630は、ハードウェアタイマチャネル610-1、610-2、610-3、610-4と、割り込み先となるPE10、20-1、20-2、20-3(すなわち、各PE10、20-1、20-2、20-3に接続される使用権限制御割り込み信号61、62-1、62-2、62-3)との関連付けを定義するチャネルマッピングレジスタ637、割り込み要求の対象となるイベント(以下、割り込み要求対象イベントと言う)の発生状態を割り込み先となるPE10、20-1、20-2、20-3ごと、かつ要因ごとに保持する割り込み要因レジスタ635、割り込み要求対象イベントが発生した場合に割り込み要求を許可するかどうかを割り込み先となるPE10、20-1、20-2、20-3ごと、かつ要因ごとに設定する割り込みイネーブルレジスタ636を備える。割り込み要求制御部630は、割り込み要求制御部接続インタフェース631から割り込み要因レジスタ635、割り込みイネーブルレジスタ636およびチャネルマッピングレジスタ637へのアクセス要求に応答し、指定された割り込み要因レジスタ635、割り込みイネーブルレジスタ636およびチャネルマッピングレジスタ637への読み書きが実行されるよう構成する。 The interrupt request control unit 630 includes hardware timer channels 610-1, 610-2, 610-3, 610-4 and PE10, 20-1, 20-2, 20-3 (that is, each PE10) to be interrupted. , 20-1, 20-2, 20-3, channel mapping register 637, which defines the association with the usage authority control interrupt signal 61, 62-1, 62-2, 62-3), and the target of the interrupt request. Interrupt factor register 635, interrupt request target that holds the occurrence status of the event (hereinafter referred to as the interrupt request target event) for each of the interrupt destinations PE10, 20-1, 20-2, 20-3, and for each factor. It includes an interrupt enable register 636 that sets whether to allow an interrupt request when an event occurs for each of the interrupt destinations PE10, 20-1, 20-2, 20-3, and for each factor. The interrupt request control unit 630 responds to an access request from the interrupt request control unit connection interface 631 to the interrupt factor register 635, the interrupt enable register 636, and the channel mapping register 637, and the designated interrupt factor register 635, the interrupt enable register 636, and the interrupt enable register 636. It is configured to read and write to the channel mapping register 637.

割り込み要求対象イベントとして、各ハードウェアタイマチャネル610-1、610-2、610-3、610-4が出力するタイマ値比較結果信号613-1、613-2、613-3、613-4が偽から真に遷移、すなわちカウント動作中の当該ハードウェアタイマチャネル610-1、610-2、610-3、610-4において現カウント値が所定の下限値以下となったことを検出したものとする。この時、割り込み要求制御部630は、チャネルマッピングレジスタ637に設定された関連付け先となるPE10、20-1、20-2、20-3を特定し、当該PE10、20-1、20-2、20-3への割り込み要求対象イベントの発生状態を保持する割り込み要因レジスタ635において、使用権限付与期間終了イベントを示すフィールドに所定の値(例えば、値1)を設定する。 Timer value comparison result signals 613-1, 613-2, 613-3, 613-4 output by each hardware timer channel 610-1, 610-2, 610-3, 610-4 are interrupt request target events. A true transition from false, that is, a detection that the current count value is equal to or less than a predetermined lower limit value in the hardware timer channels 610-1, 610-2, 610-3, 610-4 during the counting operation. do. At this time, the interrupt request control unit 630 identifies the PE10, 20-1, 20-2, 20-3 to be associated with the channel mapping register 637, and the PE10, 20-1, 20-2, In the interrupt factor register 635 that holds the occurrence state of the interrupt request target event to 20-3, a predetermined value (for example, value 1) is set in the field indicating the end event of the usage authority grant period.

当該PE10、20-1、20-2、20-3にて使用権限付与期間終了イベント発生時に割り込み要求を許可するよう、割り込みイネーブルレジスタ636に設定されている場合には、さらに使用権限制御割り込み信号61、62-1、62-2、62-3を経由し、当該PE10、20-1、20-2、20-3に対する割り込みを要求する。使用権限制御装置60からの割り込み要求を検出したPE10、20-1、20-2、20-3では、自PE内のいずれかのCPUコアで動作する割り込みハンドラの処理の一部として、処理本体の実行後には、割り込み要因レジスタ635への書き込みにより、使用権限付与期間終了イベント発生を示すフィールド値を無効な値(例えば、値0)に更新し、当該イベントによる割り込み要求を無効化する。 If the interrupt enable register 636 is set to enable the interrupt request when the usage authority grant period end event occurs in the PE10, 20-1, 20-2, 20-3, the usage authority control interrupt signal is further set. An interrupt to the PE10, 20-1, 20-2, 20-3 is requested via 61, 62-1, 62-2, 62-3. In PE10, 20-1, 20-2, and 20-3 that have detected an interrupt request from the usage authority control device 60, the processing main body is used as a part of the processing of the interrupt handler operating in any CPU core in the own PE. After the execution of, the field value indicating the occurrence of the usage authority grant period end event is updated to an invalid value (for example, the value 0) by writing to the interrupt cause register 635, and the interrupt request by the event is invalidated.

ここで、PE20-1、20-2、20-3は使用権限制御装置60からの割り込みに基づいて共有リソース30を解放することができる。このため、共有リソース30の使用時間がPE20-1、20-2、20-3ごとに個別に設定されている場合においても、PE20-1、20-2、20-3が共有リソース30の使用時間を監視することなく、共有リソース30を解放することができ、PE20-1、20-2、20-3の負荷を低減することができる。 Here, PE20-1, 20-2, and 20-3 can release the shared resource 30 based on the interrupt from the usage authority control device 60. Therefore, even when the usage time of the shared resource 30 is set individually for each of PE20-1, 20-2, and 20-3, PE20-1, 20-2, and 20-3 use the shared resource 30. The shared resource 30 can be released without monitoring the time, and the load on PE20-1, 20-2, and 20-3 can be reduced.

図3は、図2の使用権限制御装置の変形例を示すブロック図である。使用権限制御装置60Aのうち、図2の使用権限制御装置60と同じ符号を持つ要素は共通であるため、説明の一部を省略する。
図3において、使用権限制御装置60Aは、PE間接続バス40を経由した使用権限制御装置60A内部の制御レジスタに対するアクセスを制御するバスインタフェース600、4つのハードウェアタイマチャネル610-1、610-2、610-3、610-4、ハードウェアタイマチャネル610-1、610-2、610-3、610-4に対するトリガ制御信号612-1、612-2、612-3、612-4を生成するトリガ制御部620、各PE10、20-1、20-2、20-3への使用権限制御割り込み信号61、62-1、62-2、62-3を生成する割り込み要求制御部630Aを含む。各ハードウェアタイマチャネル610-1、610-2、610-3、610-4はハードウェアタイマチャネル接続インタフェース611により、トリガ制御部620はトリガ制御部接続インタフェース621により、割り込み要求制御部630Aは割り込み要求制御部接続インタフェース631により、それぞれバスインタフェース600との間で相互接続される。
FIG. 3 is a block diagram showing a modified example of the usage authority control device of FIG. Of the usage authority control device 60A, the elements having the same reference numerals as the usage authority control device 60 of FIG. 2 are common, so a part of the description will be omitted.
In FIG. 3, the usage authority control device 60A is a bus interface 600 that controls access to a control register inside the usage authority control device 60A via the PE-to-PE connection bus 40, and four hardware timer channels 610-1 and 610-2. , 610-3, 610-4, hardware timer channels 610-1, 610-2, 610-3, 610-4 to generate trigger control signals 612-1, 612-2, 612-3, 612-4. It includes a trigger control unit 620 and an interrupt request control unit 630A that generates use authority control interrupt signals 61, 62-1, 62-2, 62-3 to PE10, 20-1, 20-2, 20-3, respectively. Each hardware timer channel 610-1, 610-2, 610-3, 610-4 is interrupted by the hardware timer channel connection interface 611, the trigger control unit 620 is interrupted by the trigger control unit connection interface 621, and the interrupt request control unit 630A is interrupted. Each is interconnected with the bus interface 600 by the request control unit connection interface 631.

使用権限制御装置60Aのハードウェアタイマチャネル610-1、610-2、610-3、610-4およびトリガ制御部620の構成と機能は、使用権限制御装置60と共通である。 The configurations and functions of the hardware timer channels 610-1, 610-2, 610-3, 610-4 and the trigger control unit 620 of the usage authority control device 60A are the same as those of the usage authority control device 60.

割り込み要求制御部630Aは、ハードウェアタイマチャネル610-1、610-2、610-3、610-4と割り込み先となるPE10、20-1、20-2、20-3(すなわち、各PE10、20-1、20-2、20-3に接続される使用権限制御割り込み信号61、62-1、62-2、62-3)との関連付けを定義するチャネルマッピングレジスタ637、割り込み要求対象イベントの発生状態を割り込み先となるPE10、20-1、20-2、20-3ごと、かつ要因ごとに保持する割り込み要因レジスタ635A、割り込み要求対象イベントが発生した場合に割り込み要求を許可するかどうかを割り込み先となるPE10、20-1、20-2、20-3ごと、かつ要因ごとに設定する割り込みイネーブルレジスタ636Aを備える。割り込み要求制御部630Aは、割り込み要求制御部接続インタフェース631から割り込み要因レジスタ635A、割り込みイネーブルレジスタ636Aおよびチャネルマッピングレジスタ637へのアクセス要求に応答し、指定された割り込み要因レジスタ635A、割り込みイネーブルレジスタ636Aおよびチャネルマッピングレジスタ637への読み書きが実行されるよう構成する。 The interrupt request control unit 630A includes hardware timer channels 610-1, 610-2, 610-3, 610-4 and PE10, 20-1, 20-2, 20-3 (that is, each PE10, which is an interrupt destination). Channel mapping register 637, which defines the association with the usage authority control interrupt signal 61, 62-1, 62-2, 62-3) connected to 20-1, 20-2, 20-3, interrupt request target event. Interrupt factor register 635A that holds the occurrence status for each of PE10, 20-1, 20-2, 20-3, which is the interrupt destination, and for each factor, whether to allow interrupt request when an interrupt request target event occurs. It includes an interrupt enable register 636A that is set for each of PE10, 20-1, 20-2, 20-3, which is an interrupt destination, and for each factor. The interrupt request control unit 630A responds to an access request from the interrupt request control unit connection interface 631 to the interrupt factor register 635A, the interrupt enable register 636A, and the channel mapping register 637, and the designated interrupt factor register 635A, the interrupt enable register 636A, and the interrupt enable register 636A. It is configured to read and write to the channel mapping register 637.

本変形例では、各ハードウェアタイマチャネル610-1、610-2、610-3、610-4が出力するタイマ値比較結果信号613-1、613-2、613-3、613-4に加え、トリガ制御部620が出力するトリガ制御信号612-1、612-2、612-3、612-4のうち、少なくともカウント開始指示を識別できるトリガ制御信号についても割り込み要求対象イベントとする。割り込み要求対象イベントとして、タイマ値比較結果信号613-1、613-2、613-3、613-4が偽から真に遷移、すなわちカウント動作中の当該ハードウェアタイマチャネル610-1、610-2、610-3、610-4において現カウント値が所定の下限値以下となったことを検出したものとする。この時、割り込み要求制御部630Aは、チャネルマッピングレジスタ637に設定された関連付け先となるPE10、20-1、20-2、20-3を特定し、当該PE10、20-1、20-2、20-3への割り込み要求対象イベントの発生状態を保持する割り込み要因レジスタ635Aにおいて、使用権限付与期間終了イベントを示すフィールド値に所定の値(例えば、値1)を設定する。当該PE10、20-1、20-2、20-3にて使用権限付与期間終了イベント発生時に割り込み要求を許可するよう、割り込みイネーブルレジスタ636Aに設定されている場合には、さらに使用権限制御割り込み信号61、62-1、62-2、62-3を経由し、当該PE10、20-1、20-2、20-3に対する割り込みを要求する。 In this modification, in addition to the timer value comparison result signals 613-1, 613-2, 613-3, 613-4 output by each hardware timer channel 610-1, 610-2, 610-3, 610-4. Of the trigger control signals 621-1, 612-2, 612-3, and 612-4 output by the trigger control unit 620, at least the trigger control signal capable of identifying the count start instruction is also an interrupt request target event. As an interrupt request target event, the timer value comparison result signals 613-1, 613-2, 613-3, 613-4 truly transition from false to true, that is, the hardware timer channels 610-1, 610-2 during the counting operation. , 610-3, 610-4, it is assumed that it is detected that the current count value is equal to or less than a predetermined lower limit value. At this time, the interrupt request control unit 630A identifies the PE10, 20-1, 20-2, 20-3 to be associated with the channel mapping register 637, and the PE10, 20-1, 20-2, In the interrupt factor register 635A that holds the occurrence state of the interrupt request target event to 20-3, a predetermined value (for example, value 1) is set in the field value indicating the event for which the usage authority grant period ends. If the interrupt enable register 636A is set to enable the interrupt request when the usage authority grant period end event occurs in the PE10, 20-1, 20-2, 20-3, the usage authority control interrupt signal is further set. An interrupt to the PE10, 20-1, 20-2, 20-3 is requested via 61, 62-1, 62-2, 62-3.

加えて、割り込み要求対象イベントとして、トリガ制御信号612-1、612-2、612-3、612-4がカウント開始を指示する場合、割り込み要求制御部630Aは、チャネルマッピングレジスタ637に設定された関連付け先となるPE10、20-1、20-2、20-3を特定し、当該PE10、20-1、20-2、20-3への割り込み要求対象イベントの発生状態を保持する割り込み要因レジスタ635Aにおいて、使用権限付与期間開始イベントを示すフィールド値に所定の値(例えば、値1)を設定する。当該PE10、20-1、20-2、20-3にて使用権限付与期間開始イベント発生時に割り込み要求を許可するよう、割り込みイネーブルレジスタ636Aに設定されている場合には、さらに使用権限制御割り込み信号61、62-1、62-2、62-3を経由し、当該PE10、20-1、20-2、20-3に対する割り込みを要求する。 In addition, when the trigger control signals 612-1, 612-2, 612-3, and 612-4 instruct the start of counting as the interrupt request target event, the interrupt request control unit 630A is set in the channel mapping register 637. An interrupt factor register that identifies the PE10, 20-1, 20-2, 20-3 to be associated, and holds the occurrence state of the event for which an interrupt request is made to the PE10, 20-1, 20-2, 20-3. In 635A, a predetermined value (for example, value 1) is set in the field value indicating the usage authority grant period start event. If the interrupt enable register 636A is set to enable the interrupt request when the usage authority grant period start event occurs in the PE10, 20-1, 20-2, 20-3, the usage authority control interrupt signal is further set. An interrupt to the PE10, 20-1, 20-2, 20-3 is requested via 61, 62-1, 62-2, 62-3.

使用権限制御装置60Aからの割り込み要求を検出したPE10、20-1、20-2、20-3では、自PE内のいずれかのCPUコアで動作する割り込みハンドラの処理の一部として、処理本体の実行に先立ち、割り込み要因レジスタ635Aの内容を読み出し、割り込み要因(使用権限付与期間開始または終了イベント)を特定する。処理本体の実行後には、割り込み要因レジスタ635Aへの書き込みにより、上記で特定したイベントの発生を示すフィールド値を無効な値(例えば、値0)に更新し、当該イベントによる割り込み要求を無効化する。 In PE10, 20-1, 20-2, and 20-3 that have detected an interrupt request from the usage authority control device 60A, the processing main body is used as a part of the processing of the interrupt handler operating in any CPU core in the own PE. The contents of the interrupt factor register 635A are read out prior to the execution of, and the interrupt factor (use permission grant period start or end event) is specified. After the processing body is executed, the field value indicating the occurrence of the event specified above is updated to an invalid value (for example, value 0) by writing to the interrupt factor register 635A, and the interrupt request due to the event is invalidated. ..

ここで、PE20-1、20-2、20-3は使用権限制御装置60Aからの割り込みに基づいて、共有リソース30の使用を開始したり、共有リソース30を解放したりすることができる。このため、共有リソース30の使用開始タイミングや使用時間がPE20-1、20-2、20-3ごとに個別に設定されている場合においても、PE20-1、20-2、20-3が共有リソース30の使用状態を監視することなく、共有リソース30を排他的に使用することができる。このため、各PE20-1、20-2、20-3は、共有リソース30の使用の必要がある時に、共有リソース30の使用権限が得られるまで共有リソース30の使用要求を出し続ける必要がなくなり、PE20-1、20-2、20-3の負荷を低減することが可能となる。 Here, PE20-1, 20-2, and 20-3 can start using the shared resource 30 or release the shared resource 30 based on an interrupt from the usage authority control device 60A. Therefore, even when the usage start timing and usage time of the shared resource 30 are individually set for each of PE20-1, 20-2, and 20-3, PE20-1, 20-2, and 20-3 are shared. The shared resource 30 can be used exclusively without monitoring the usage status of the resource 30. Therefore, when it is necessary to use the shared resource 30, each PE 20-1, 20-2, 20-3 does not have to keep issuing a request to use the shared resource 30 until the authority to use the shared resource 30 is obtained. , PE20-1, 20-2, 20-3 can be reduced.

なお、通常は2つの割り込み要因、すなわち使用権限付与期間の開始および終了イベントが同時に検出されることはなく、また割り込み要因レジスタ635Aの内容を参照することで割り込み要因を特定可能なため、PE10、20-1、20-2、20-3へ出力する使用権限制御割り込み信号61、62-1、62-2、62-3は複数のイベント間で共有してよい。また、カウント動作中のハードウェアタイマチャネル610-1、610-2、610-3、610-4に対するカウント開始要求については、図示しない手段によりマスクできるよう使用権限制御装置60Aを構成してもよい。 Normally, two interrupt factors, that is, the start and end events of the usage authority grant period are not detected at the same time, and the interrupt factor can be identified by referring to the contents of the interrupt factor register 635A. The usage authority control interrupt signals 61, 62-1, 62-2, 62-3 to be output to 20-1, 20-2, 20-3 may be shared among a plurality of events. Further, the usage authority control device 60A may be configured so that the count start request for the hardware timer channels 610-1, 610-2, 610-3, and 610-4 during the counting operation can be masked by means (not shown). ..

図4は、図1のマイコンの変形例を示す図である。マイコン1Bのうち、図1に示すマイコン1と同じ符号をもつ要素は共通であるため、説明の一部を省略する。
図4において、マイコン1Bは、内蔵機能モジュールとして、さらにPE間割り込み制御装置70を含む。PE間割り込み制御装置70は、PE間接続バス40を介してPE10、20-1、20-2、20-3との間で相互接続される。PE間割り込み制御装置70は、各PE10、20-1、20-2、20-3からアクセス可能な制御レジスタを含む。割り込み要求元PEにおいては、自PEもしくは他PEに対する割り込みを要求し、割り込み要求先PEにおいては、割り込み要求元PEを特定する手段をそれぞれ備える。また、PE間割り込み制御装置70は、割り込み先PEごとに当該PEに対するPE間割り込み要求状態を示す、PE間割り込み信号71-0、71-1、71-2、71-3を独立した信号として出力し、それぞれPE10、20-1、20-2、20-3内の割り込みコントローラに入力される。
FIG. 4 is a diagram showing a modification of the microcomputer of FIG. 1. Since the elements of the microcomputer 1B having the same reference numerals as those of the microcomputer 1 shown in FIG. 1 are common, a part of the description thereof will be omitted.
In FIG. 4, the microcomputer 1B further includes an inter-PE interrupt control device 70 as a built-in function module. The inter-PE interrupt control device 70 is interconnected with PE 10, 20-1, 20-2, and 20-3 via the inter-PE connection bus 40. The inter-PE interrupt control device 70 includes a control register accessible from each PE 10, 20-1, 20-2, 20-3. The interrupt requesting source PE requests an interrupt to its own PE or another PE, and the interrupt requesting destination PE is provided with means for specifying the interrupt requesting source PE. Further, the inter-PE interrupt control device 70 uses the inter-PE interrupt signals 71-0, 71-1, 71-2, and 71-3 as independent signals, which indicate the inter-PE interrupt request status for the PE for each interrupt destination PE. It is output and input to the interrupt controller in PE10, 20-1, 20-2, 20-3, respectively.

ここで、PE間割り込み制御装置70は、PE20-1、20-2、20-3から共有リソース30の解放通知を受けると、リソース解放イベントの発生をPE10に通知することができる。PE10は、リソース解放イベントの発生通知を受け取ると、共有リソース30の使用要求を出しているPE20-1、20-2、20-3間で共有リソース30の使用の再スケジューリングを実行することができる。このため、共有リソース30の使用権限が付与されたPE20-1、20-2、20-3において、そのPE20-1、20-2、20-3に与えられた使用時間を使い切る前に共有リソース30が解放された場合においても、そのPE20-1、20-2、20-3に与えられた使用時間の経過を待つことなく、共有リソース30の使用要求を出しているPE20-1、20-2、20-3が共有リソース30を使用することが可能となり、共有リソース30の利用効率を向上させることが可能となる。 Here, when the inter-PE interrupt control device 70 receives the release notification of the shared resource 30 from PE20-1, 20-2, 20-3, the PE 10 can be notified of the occurrence of the resource release event. Upon receiving the notification of the occurrence of the resource release event, the PE 10 can rescheduling the use of the shared resource 30 among the PE 20-1, 20-2, and 20-3 that are requesting the use of the shared resource 30. .. Therefore, in PE20-1, 20-2, 20-3 to which the usage authority of the shared resource 30 is granted, the shared resource is used before the usage time given to PE20-1, 20-2, 20-3 is used up. Even when 30 is released, PE20-1, 20- requesting the use of the shared resource 30 without waiting for the elapse of the usage time given to PE20-1, 20-2, 20-3. It becomes possible for 2, 20-3 to use the shared resource 30, and it becomes possible to improve the utilization efficiency of the shared resource 30.

図5は、図1の制御テーブルの構成例を示す図である。
図5において、制御テーブル140は、PE10、20-1、20-2、20-3間での共有リソース30に関する制御ポリシを格納することができる。PE10は、共有リソース管理プログラムの実行時に制御テーブル140を参照することで、使用要求を受け付けたPE20-1、20-2、20-3間での共有リソース30の使用のスケジューリングを実行することができる。
FIG. 5 is a diagram showing a configuration example of the control table of FIG.
In FIG. 5, the control table 140 can store the control policy regarding the shared resource 30 among PE10, 20-1, 20-2, 20-3. The PE 10 can schedule the use of the shared resource 30 among the PE 20-1, 20-2, and 20-3 that have received the usage request by referring to the control table 140 when the shared resource management program is executed. can.

制御テーブル140は、共有リソース管理プログラムの実行により各PE10、20-1、20-2、20-3に対する共有リソース30の使用権限付与順序制御する際に、参照および更新する制御ポリシを格納する記憶領域である。制御テーブル140は、共有制御の対象PE10、20-1、20-2、20-3ごとに以下のフィールドを備える。
以下の説明を簡単にするため、特記なき場合は、マイコン1、1Bの備える複数のPE10、20-1、20-2、20-3のうち、最小のPE識別子をもつPE、すなわちPE0をPE10とし、PE識別子の昇順にPE1、PE2、PE3をそれぞれPE20-1、20-2、20-3とする。
The control table 140 stores a control policy to be referenced and updated when the order of granting the usage authority of the shared resource 30 to each PE10, 20-1, 20-2, and 20-3 is controlled by executing the shared resource management program. It is an area. The control table 140 includes the following fields for each of the PE10, 20-1, 20-2, and 20-3 to be shared control.
For the sake of simplicity of the following description, unless otherwise specified, PE10 having the smallest PE identifier among the plurality of PE10s, 20-1, 20-2, and 20-3 provided in the microcomputers 1 and 1B, that is, PE0 is used as PE10. In the ascending order of the PE identifier, PE1, PE2, and PE3 are designated as PE20-1, 20-2, and 20-3, respectively.

(1)イネーブル(Enable、EN)フィールド:当該PE10、20-1、20-2、20-3に関する以下のフィールドの設定が有効かどうかを示すフィールドである。当該PE10、20-1、20-2、20-3上で動作するアプリケーションが共有リソース30の使用を要求し得る場合には有効に設定されなければならない。 (1) Enable (EN) field: A field indicating whether or not the settings of the following fields related to the PE10, 20-1, 20-2, and 20-3 are valid. If an application running on the PE10, 20-1, 20-2, 20-3 can request the use of the shared resource 30, it must be enabled.

(2)基本優先度(Priority、PR)フィールド:当該PE10、20-1、20-2、20-3に対し、共有リソース30の使用権限を付与する際の優先度を示すゼロまたは正の整数である。値が小さいほど優先度が高く、共有リソース30の使用権限の付与順序が早くなる。 (2) Priority, PR field: Zero or a positive integer indicating the priority when granting the right to use the shared resource 30 to the PE10, 20-1, 20-2, 20-3. Is. The smaller the value, the higher the priority, and the earlier the order of granting the usage authority of the shared resource 30.

(3)制御周期内上限時間(Permitted Time、PT)フィールド:制御周期ごとに当該PE10、20-1、20-2、20-3へ付与可能な共有リソース使用時間の上限値である。絶対値または制御周期時間に対する割合のいずれかの指標に基づく値を設定する。いかなる時点においても、ENフィールドが有効な全PE10、20-1、20-2、20-3について本フィールドの設定値を加算した結果は、制御周期時間(絶対値を指標とする場合)または100%(割合を指標とする場合)を超えてはならない。本制約は、マイコン1、1Bの正常動作に必要な制約としてユーザに課してもよいし、共有リソース管理プログラムの備える機能の一部として動作時に制約違反の有無を検出させ、制約違反が検出された場合にはログ取得など所定のエラー処理を実行させてもよい。また、共有リソース管理に係る処理時間のばらつきによる制御エラーを補償するため、上記制約違反のチェックの際、制御周期時間(絶対値を指標とする場合)または100%(割合を指標とする場合)から所定の猶予時間または猶予率を減じた値と比較してもよい。 (3) Upper limit time within the control cycle (Permitted Time, PT) field: An upper limit of the shared resource usage time that can be assigned to the PE10, 20-1, 20-2, 20-3 for each control cycle. Set a value based on either an absolute value or a percentage of the control cycle time. At any time, the result of adding the set values of this field for all PE10, 20-1, 20-2, 20-3 for which the EN field is valid is the control cycle time (when the absolute value is used as an index) or 100. Do not exceed% (when the percentage is used as an index). This constraint may be imposed on the user as a constraint necessary for the normal operation of the microcomputers 1 and 1B, or as a part of the function provided by the shared resource management program, the presence or absence of a constraint violation is detected during operation, and the constraint violation is detected. If this is the case, a predetermined error process such as log acquisition may be executed. In addition, in order to compensate for control errors due to variations in processing time related to shared resource management, control cycle time (when using an absolute value as an index) or 100% (when using a ratio as an index) when checking for violations of the above constraints. It may be compared with the value obtained by subtracting the predetermined grace time or the grace rate from.

(4)制御周期内権限再付与(Re-Grant、RG)フィールド:1つの制御周期において、当該PE10、20-1、20-2、20-3がPTフィールドの設定値を上限として、共有リソース30を複数回に分割して使用することを許可するかどうかを指定する。本フィールドはオプションとしてよく、その場合は分割使用の禁止が指定されたものと解釈する。 (4) Re-grant of authority within control cycle (Re-Grant, RG) field: In one control cycle, PE10, 20-1, 20-2, 20-3 are shared resources up to the set value of the PT field. Specifies whether to allow 30 to be divided into a plurality of times and used. This field may be an option, in which case it is interpreted that the prohibition of split use is specified.

(5)制御周期内権限付与順序(Order、OR)フィールド:共有リソース管理プログラムが所定の順序決定アルゴリズムに基づき、制御周期ごとに更新するフィールドである。その設定値は、現制御周期における共有リソース使用権限付与の順序を示すゼロまたは正の整数であり、本フィールドに設定された値がゼロから昇順となるよう、各PE10、20-1、20-2、20-3に対し時分割で使用権を付与する。利用する順序決定アルゴリズムによっては本フィールドをオプションとしてよく、例えば、使用権限付与先PEを切り替える時点で1つ以上の共有リソース30の使用要求があった場合に、最も高い優先度を設定されたPEに対し動的に権限を付与し、共有リソース30の使用要求がなかった場合には、要求が発生するまで所定の周期で共有リソース30の使用要求をポーリングすればよい。 (5) Order for granting authority within the control cycle (Order, OR) field: This field is updated every control cycle by the shared resource management program based on a predetermined order determination algorithm. The set value is a zero or a positive integer indicating the order of granting the authority to use the shared resource in the current control cycle, and each PE10, 20-1, 20- so that the value set in this field is in ascending order from zero. The right to use is granted to 2, 20-3 in a timely manner. Depending on the order determination algorithm to be used, this field may be an option. For example, when there is a request to use one or more shared resources 30 at the time of switching the use permission destination PE, the PE with the highest priority is set. If there is no request to use the shared resource 30, the permission may be dynamically granted to the user, and the request to use the shared resource 30 may be polled at a predetermined cycle until the request is generated.

(6)制御周期内残り時間(Remaining Time、RT)フィールド:現制御周期において、当該PE10、20-1、20-2、20-3へ付与可能な共有リソース30の使用時間の残り時間を保持するフィールドである。時間の絶対値をハードウェアタイマチャネル610-1、610-2、610-3、610-4のデクリメント動作周期で除した値、すなわちハードウェアタイマチャネル610-1、610-2、610-3、610-4の初期カウント値レジスタ617または現カウント値レジスタ616に対し直接書き込み可能、または値の大小を直接比較可能な値に換算した正の整数値とすることができる。本フィールド値は、制御周期ごとにPTフィールドの値を上記の手順に従い換算した値でリセットし、あるPE10、20-1、20-2、20-3に対する共有リソース30の使用権限の付与期間が終了、もしくはPE10、20-1、20-2、20-3から共有リソース30の使用終了が通知されるごとに、当該PE10、20-1、20-2、20-3に関する本フィールド値を更新するよう制御される。新たに本フィールドに設定される更新値は、ゼロ、または現在の設定値から実際の共有リソース30の使用時間分を減じた残り時間に相当するカウント値であってよい。 (6) Remaining time in control cycle (Remaining Time, RT) field: Holds the remaining time of the usage time of the shared resource 30 that can be assigned to the PE10, 20-1, 20-2, 20-3 in the current control cycle. It is a field to do. The absolute value of time divided by the decrement operation cycle of the hardware timer channels 610-1, 610-2, 610-3, 610-4, that is, the hardware timer channels 610-1, 610-2, 610-3, It can be written directly to the initial count value register 617 or the current count value register 616 of 610-4, or can be a positive integer value obtained by converting the magnitude of the value into a value that can be directly compared. This field value is reset by the value obtained by converting the value of the PT field according to the above procedure for each control cycle, and the period for granting the right to use the shared resource 30 to a certain PE10, 20-1, 20-2, 20-3 is set. This field value for PE10, 20-1, 20-2, 20-3 is updated every time the end or the end of use of the shared resource 30 is notified from PE10, 20-1, 20-2, 20-3. Is controlled to do. The update value newly set in this field may be zero, or a count value corresponding to the remaining time obtained by subtracting the actual usage time of the shared resource 30 from the current setting value.

(7)使用権限付与中フラグ(In-Use、IU)フィールド:当該PE10、20-1、20-2、20-3に対して共有リソース30の使用権限を付与中であるかどうかを示すフラグである。共有リソース管理プログラムが同時に使用権限を付与するPE数はたかだか1であり、PE数分の本フィールドのうち0または1つのフィールドのみ真となる。 (7) Flag for granting usage authority (In-Use, IU) field: Flag indicating whether the usage authority for the shared resource 30 is being granted to the PE10, 20-1, 20-2, 20-3. Is. The number of PEs to which the shared resource management program grants the usage authority at the same time is at most 1, and only 0 or 1 of the fields corresponding to the number of PEs is true.

図6は、図1の使用要求レジスタの構成例を示す図である。なお、図6では、使用要求レジスタ50の内部構成、共有リソース30の使用要求の有無を要求元PEごとに保持するフラグ、およびフラグのセット/クリア手段に関するレジスタ間マッピングを示した。
図6において、使用要求レジスタ50は、PE間接続バス40を経由して各PE10、20-1、20-2、20-3からアクセス可能とされ、マイコン1、1Bの持つアドレス空間上の一部領域に配置することができる。使用要求レジスタ50は、相互にアドレスの異なる2つの使用要求レジスタバンク、すなわち使用要求レジスタバンク50-0(Bank-0)および使用要求レジスタバンク50-1(Bank-1)から構成される。
FIG. 6 is a diagram showing a configuration example of the usage request register of FIG. Note that FIG. 6 shows the internal configuration of the usage request register 50, the flag that holds the presence / absence of the usage request of the shared resource 30 for each request source PE, and the register-to-register mapping related to the flag setting / clearing means.
In FIG. 6, the use request register 50 is accessible from PE10, 20-1, 20-2, and 20-3 via the PE-to-PE connection bus 40, and is one of the address spaces of the microcomputers 1 and 1B. It can be placed in a local area. The usage request register 50 is composed of two usage request register banks having different addresses, that is, a usage request register bank 50-0 (Bank-0) and a usage request register bank 50-1 (Bank-1).

各使用要求レジスタバンク50-0、50-1の機能は、構成要素となる制御レジスタに割り当てられたアドレスの差異を除き、バンク間で共通である。2つの使用要求レジスタバンク50-0、50-1のうち、例えば、一方のバンクは現制御周期における共有リソース30の使用権限の付与制御のため、PE10上で動作する共通リソース管理プログラムが参照するバンク(以下、表バンク)、他方はPE20-1、20-2、20-3上で動作するアプリケーションからの、次制御周期における共有リソース30の使用権限の割り当て要求を蓄積するバンク(以下、裏バンク)として割り当て、制御周期ごとに表裏バンクを切り替えて使用してもよい。アプリケーションがアクセス先とする裏バンクのアドレス生成手続きを簡略化する目的で、表裏バンクの割り当て状態を識別するフラグを格納するレジスタ(図示せず)と、当該フラグの状態により表裏バンクのアドレス領域を入れ替えるアドレス変換部(図示せず)を使用要求レジスタ50内にさらに設けることで、バンクの割り当て状態によらず表裏バンクのアドレスを固定する機能を備えていてもよい。使用要求レジスタ50の一部または全部は専用に設計されたハードウェアモジュールとして実装してもよいし、少なくとも一部をマイコン1、1Bの内部もしくは外部に接続されたメモリに割り当ててもよい。また、実装上の制約により、使用要求レジスタ50を使用要求レジスタバンク50-0のみの1バンク構成としてもよい。1バンク、または2バンク構成時の各使用要求レジスタバンク50-0、50-1の使用方法については、共有リソース30の使用権限付与の詳細な制御フローとともに後述する。 The functions of the usage request register banks 50-0 and 50-1 are common among the banks except for the difference in the address assigned to the control register which is a component. Of the two usage request register banks 50-0 and 50-1, for example, one of the banks is referred to by the common resource management program operating on the PE 10 for controlling the granting of the usage authority of the shared resource 30 in the current control cycle. A bank (hereinafter referred to as a front bank), and the other is a bank (hereinafter referred to as a back bank) that accumulates requests for allocation of usage authority of the shared resource 30 in the next control cycle from an application running on PE20-1, 20-2, 20-3. It may be assigned as a bank), and the front and back banks may be switched and used for each control cycle. For the purpose of simplifying the address generation procedure of the back bank to be accessed by the application, a register (not shown) that stores a flag that identifies the allocation state of the front and back banks and the address area of the front and back banks are determined by the state of the flag. By further providing a replacement address translation unit (not shown) in the usage request register 50, it may be provided with a function of fixing the addresses of the front and back banks regardless of the bank allocation status. A part or all of the usage request register 50 may be implemented as a specially designed hardware module, or at least a part may be allocated to the memory connected to the inside or the outside of the microcomputers 1 and 1B. Further, due to implementation restrictions, the usage request register 50 may be configured as one bank having only the usage request register banks 50-0. The method of using the usage request register banks 50-0 and 50-1 in the configuration of one bank or two banks will be described later together with the detailed control flow of granting the usage authority of the shared resource 30.

使用要求レジスタバンク50-0、50-1は、共有リソース30の使用要求の有無を要求元PEごとに関するビットマップ形式で保持する使用要求フラグレジスタと、使用要求フラグレジスタに格納される使用要求フラグをPE10、20-1、20-2、20-3ごとに個別に、もしくは複数PE分を一括してセット/クリアする手段として、以下の制御レジスタを備える。 The usage request register banks 50-0 and 50-1 have a usage request flag register that holds the presence / absence of a usage request of the shared resource 30 in a bitmap format for each request source PE, and a usage request flag stored in the usage request flag register. Is provided individually for each PE10, 20-1, 20-2, 20-3, or as a means for collectively setting / clearing a plurality of PEs, the following control registers are provided.

(1)共有リソース使用要求セットレジスタ520-0、520-1、520-2、520-3:それぞれPE10、20-1、20-2、20-3が共有リソース30の使用要求フラグをセットする際のインタフェースとなる32ビット幅のレジスタである。要求元PEごとに独立したレジスタSET_REQ_REG0(PE10からの要求用)、SET_REQ_REG1(PE20-1からの要求用)、SET_REQ_REG2(PE20-2からの要求用)、SET_REQ_REG3(PE20-3からの要求用)から構成される。各PE10、20-1、20-2、20-3上で動作し、共有リソース30の使用権限付与を要求するアプリケーションは、制御周期のうち所定のタイムウィンドウ内に、自PE用の共有リソース使用要求セットレジスタ520-0、520-1、520-2、520-3内のフラグセット要求フィールドSR0、SR1、SR2、SR3に値1を書き込む。各フラグセット要求フィールドSR0、SR1、SR2、SR3は、共有リソース使用要求フラグレジスタ510内にある、要求元PEごとに独立したフラグフィールドRQ0、RQ1、RQ2、RQ3にそれぞれマッピングされており、セット要求SRn(n=0、1、2、3)への値1の書き込みに応じてフラグRQn(n=0、1、2、3)が値1にセットされる。なお、本レジスタの読み出し時は常にゼロ値が読み出されるものとする。 (1) Shared resource usage request set register 520-0, 520-1, 520-2, 520-3: PE10, 20-1, 20-2, 20-3 set the usage request flag of the shared resource 30, respectively. It is a 32-bit wide register that serves as an interface. From the registers SET_REF_REG0 (for requests from PE10), SET_RQ_REG1 (for requests from PE20-1), SET_RQ_REG2 (for requests from PE20-2), and SET_RQ_REG3 (for requests from PE20-3) that are independent for each requesting PE. It is composed. An application that operates on each PE10, 20-1, 20-2, 20-3 and requests the permission to use the shared resource 30 uses the shared resource for its own PE within a predetermined time window in the control cycle. The value 1 is written to the flag set request fields SR0, SR1, SR2, SR3 in the request set register 520-0, 520-1, 520-2, 520-3. Each flag set request field SR0, SR1, SR2, SR3 is mapped to the flag fields RQ0, RQ1, RQ2, RQ3 independent for each request source PE in the shared resource use request flag register 510, and the set request is made. The flag RQn (n = 0, 1, 2, 3) is set to the value 1 in response to the writing of the value 1 to SRn (n = 0, 1, 2, 3). It is assumed that the zero value is always read when reading this register.

(2)共有リソース使用要求フラグレジスタ510:それぞれPE10、20-1、20-2、20-3による共有リソース30の使用要求の有無をビットマップ形式で保持するフラグフィールドRQ0、RQ1、RQ2、RQ3を1つのレジスタに集約した、32ビット幅の読み出し専用レジスタFLG_REQ_REGである。PE10上で動作する共有リソース管理プログラムが読み出す。 (2) Shared resource use request flag register 510: Flag fields RQ0, RQ1, RQ2, RQ3 that hold in bitmap format whether or not there is a request to use the shared resource 30 by PE10, 20-1, 20-2, 20-3, respectively. Is a 32-bit wide read-only register FLG_REF_REG that aggregates the above into one register. Read by the shared resource management program running on PE10.

(3)共有リソース使用要求クリアレジスタ530:それぞれPE10、20-1、20-2、20-3が共有リソース30の使用要求フラグをクリアする際のインタフェースとなる32ビット幅のレジスタCLR_REQ_REGである。PE10上で動作する共有リソース管理プログラムが書き込む。クリア対象とする共有リソース使用要求フラグレジスタ510のフラグフィールドRQ0、RQ1、RQ2、RQ3ごとに独立してマッピングされたクリア要求フィールドCR0、CR1、CR2、CR3が1つのレジスタに集約されており、クリア要求フィールドCRn(n=0、1、2、3)への値1の書き込みに応じてフラグフィールドRQn(n=0、1、2、3)が値0にクリアされる。なお、読み出し時は常にゼロ値が読み出される。 (3) Shared resource usage request clear register 530: A 32-bit wide register CLR_RQ_REG in which PE10, 20-1, 20-2, and 20-3 serve as an interface for clearing the usage request flag of the shared resource 30, respectively. The shared resource management program running on PE10 writes. The flag fields CR0, CR1, CR2, and CR3 independently mapped for each of the flag fields RQ0, RQ1, RQ2, and RQ3 of the shared resource usage request flag register 510 to be cleared are aggregated in one register and cleared. The flag field RQn (n = 0, 1, 2, 3) is cleared to the value 0 in response to the writing of the value 1 to the request field CRn (n = 0, 1, 2, 3). At the time of reading, a zero value is always read.

図7は、図4のPE間割り込み制御装置の構成例を示す図である。なお、図7では、PE間割り込み制御装置70の内部構成、PE間割り込み要求の有無を要求元/要求先PEの組み合わせごとに保持するフラグ、およびフラグのセット/クリア手段に関するレジスタ間マッピングを示した。
図7において、PE間割り込み制御装置70は、PE間接続バス40を経由して各PE10、20-1、20-2、20-3からアクセス可能とされ、マイコン1Bの持つアドレス空間上の一部領域に配置された複数の制御レジスタを含む。制御レジスタの一部または全部は専用に設計されたハードウェアモジュールとして実装してもよいし、少なくとも一部をマイコン1Bの内部もしくは外部に接続されたメモリに割り当ててもよい。PE間割り込み制御装置70は、PE間割り込みの有無を対象となる要求先PEごとに独立したレジスタに集約し、かつ要求元PEに関するビットマップ形式で保持する手段として、特定の要求元PEからの割り込み要求について要求先PEごとに個別に、もしくは複数の要求先PE分を一括してセットする手段として、また特定の要求先PEを対象とするPE間割り込み要求フラグについて要求元PEごとに個別に、もしくは複数の要求元PE分を一括してクリアする手段として、以下の制御レジスタを備える。
FIG. 7 is a diagram showing a configuration example of the inter-PE interrupt control device of FIG. Note that FIG. 7 shows the internal configuration of the PE-to-PE interrupt control device 70, the flag that holds the presence / absence of the PE-to-PE interrupt request for each combination of the request source / request destination PE, and the register-to-register mapping related to the flag setting / clearing means. rice field.
In FIG. 7, the inter-PE interrupt control device 70 is accessible from each of PEs 10, 20-1, 20-2, and 20-3 via the inter-PE connection bus 40, and is one on the address space of the microcomputer 1B. Includes multiple control registers located in the area. Part or all of the control registers may be implemented as a dedicatedly designed hardware module, or at least a part may be allocated to the memory connected to the inside or the outside of the microcomputer 1B. The inter-PE interrupt control device 70 collects the presence or absence of an inter-PE interrupt in an independent register for each request destination PE, and holds the presence or absence of the inter-PE interrupt in a bitmap format regarding the request source PE from a specific request source PE. For interrupt requests, individually for each request destination PE, or as a means to collectively set multiple request destination PEs, and for the inter-PE interrupt request flag targeting a specific request destination PE, individually for each request source PE. Or, as a means for clearing a plurality of request source PEs at once, the following control registers are provided.

(1)PE間割り込み要求セットレジスタ720-n(n=0、1、2、3):それぞれPE10、20-1、20-2、20-3を要求元PEとするPE間割り込み要求フラグをセットする際のインタフェースとなる32ビット幅のレジスタである。要求元PEごとに独立したレジスタSET_IPIR_REG0(PE10からの要求用)、SET_IPIR_REG1(PE20-1からの要求用)、SET_IPIR_REG2(PE20-2からの要求用)、SET_IPIR_REG3(PE20-3からの要求用)から構成される。各PE10、20-1、20-2、20-3上で動作し、自PEもしくは他PEに対し所定の形式に基づくメッセージ送信を要求するアプリケーションは、自PE(PEn)用のPE間割り込み要求セットレジスタ720-n(n=0、1、2、3)内のフラグセット要求フィールドSRn0、SRn1、SRn2、SRn3のうち、自PEからの割り込み要求先となるPEに対応する1つ以上のフィールドに値1を書き込む。 (1) PE-to-PE interrupt request set register 720-n (n = 0, 1, 2, 3): Set the PE-to-PE interrupt request flag with PE10, 20-1, 20-2, 20-3 as the request source PE, respectively. It is a 32-bit wide register that serves as an interface when setting. From the registers SET_IPIR_REG0 (for requests from PE10), SET_IPIR_REG1 (for requests from PE20-1), SET_IPIR_REG2 (for requests from PE20-2), and SET_IPIR_REG3 (for requests from PE20-3) that are independent for each requesting PE. It is composed. An application that operates on each PE10, 20-1, 20-2, 20-3 and requests the transmission of a message based on a predetermined format from the own PE or another PE is an interrupt request between PEs for the own PE (Pen). Of the flag set request fields SRn0, SRn1, SRn2, SRn3 in the set register 720-n (n = 0, 1, 2, 3), one or more fields corresponding to the PE that is the interrupt request destination from the own PE. Write the value 1 to.

PE間割り込み要求セットレジスタSET_IPIR_REGn(n=0、1、2、3)のフラグセット要求フィールドSRnm(m=0、1、2、3)は、割り込み要求先PEごとに集約されたPE間割り込み要求フラグレジスタFLG_IPIR_REGm(m=0、1、2、3)のフィールドRQnm(n=0、1、2、3)にマッピングされており、フラグセット要求フィールドSRnmへの値1の書き込みに応じてフィールドRQnmが値1にセットされる。なお、本レジスタの読み出し時は常にゼロ値が読み出されるものとする。 The flag set request field SRnm (m = 0, 1, 2, 3) of the inter-PE interrupt request set register SET_IPIR_REGn (n = 0, 1, 2, 3) is an inter-PE interrupt request aggregated for each interrupt request destination PE. It is mapped to the field RQnm (n = 0, 1, 2, 3) of the flag register FLG_IPIR_REGm (m = 0, 1, 2, 3), and the field RQnm corresponds to the writing of the value 1 to the flag set request field SRnm. Is set to the value 1. It is assumed that the zero value is always read when reading this register.

(2)PE間割り込み要求フラグレジスタ710-m(m=0、1、2、3):それぞれPE10、20-1、20-2、20-3を要求先PEとするPE間割り込み要求フラグについて、要求元PEを識別可能なビットマップ形式で取得可能なインタフェースとなる32ビット幅の読み出し専用レジスタである。要求先ごとに独立したレジスタFLG_IPIR_REG0(マスタPE10への要求用)、FLG_IPIR_REG1(PE20-1への要求用)、FLG_IPIR_REG2(PE20-2への要求用)、FLG_IPIR_REG3(PE20-3への要求用)から構成される。通常、PE間割り込みを要求された側のアプリケーションが、自PE(PEm)を要求先とするPE間割り込みの要求元を特定する目的で、PE間割り込み要求フラグレジスタ710-m(m=0、1、2、3)からの読み出しを行う。また、PE間割り込み信号71-m(m=0、1、2、3)は、フィールドRQ0m、RQ1m、RQ2m、RQ3mの論理和として定義することができる。 (2) Inter-PE interrupt request flag register 710-m (m = 0, 1, 2, 3): About the inter-PE interrupt request flag whose request destination PEs are PE10, 20-1, 20-2, and 20-3, respectively. , A 32-bit wide read-only register that provides an interface that can acquire the requesting PE in an identifiable bitmap format. From the registers FLG_IPIR_REG0 (for request to master PE10), FLG_IPIR_REG1 (for request to PE20-1), FLG_IPIR_REG2 (for request to PE20-2), FLG_IPIR_REG3 (for request to PE20-3) independent for each request destination. It is composed. Normally, the application on the side where the inter-PE interrupt is requested identifies the request source of the inter-PE interrupt with its own PE (PEm) as the request destination, and the inter-PE interrupt request flag register 710-m (m = 0, Read from 1, 2, 3). Further, the interrupt signal 71-m (m = 0, 1, 2, 3) between PEs can be defined as the logical sum of the fields RQ0m, RQ1m, RQ2m, and RQ3m.

(3)PE間割り込み要求クリアレジスタ730-m(m=0、1、2、3):それぞれPE10、20-1、20-2、20-3を要求先PEとするPE間割り込み要求フラグをクリアする際のインタフェースとなる32ビット幅のレジスタである。要求先PEごとに独立したレジスタCLR_IPIR_REG0(PE10への要求用)、CLR_IPIR_REG1(PE20-1への要求用)、CLR_IPIR_REG2(PE20-2への要求用)、CLR_IPIR_REG3(PE20-3への要求用)から構成される。通常、PE間割り込みを要求された側のアプリケーションが、自PE(PEm)を要求先とするPE間割り込みのうち、処理を完了した1つ以上のPE(PEn)からの割り込み要求をクリアする目的で、PE間割り込み要求クリアレジスタ730-m(m=0、1、2、3)への書き込みを行う。PE間割り込み要求クリアレジスタCLR_IPIR_REGm(m=0、1、2、3)のフィールドCRnm(n=0、1、2、3)は、PE間割り込み要求フラグレジスタFLG_IPIR_REGm(m=0、1、2、3)のフィールドRQnm(n=0、1、2、3)にマッピングされており、フィールドCRnmへの値1の書き込みに応じてフィールドRQnmが値0にクリアされる。なお、本レジスタの読み出し時は常にゼロ値が読み出されるものとする。 (3) PE-to-PE interrupt request clear register 730-m (m = 0, 1, 2, 3): Set the PE-to-PE interrupt request flag with PE10, 20-1, 20-2, 20-3 as the request destination PE, respectively. It is a 32-bit wide register that serves as an interface for clearing. From the independent registers CLR_IPIR_REG0 (for request to PE10), CLR_IPIR_REG1 (for request to PE20-1), CLR_IPIR_REG2 (for request to PE20-2), and CLR_IPIR_REG3 (for request to PE20-3) that are independent for each request destination PE. It is composed. Normally, the purpose of the application on the side where the PE-to-PE interrupt is requested clears the interrupt request from one or more PEs (PEn) that have completed processing among the PE-to-PE interrupts whose request destination is its own PE (PEm). Then, write to the PE-to-PE interrupt request clear register 730-m (m = 0, 1, 2, 3). The field CRnm (n = 0, 1, 2, 3) of the inter-PE interrupt request clear register CLR_IPIR_REGm (m = 0, 1, 2, 3) is the inter-PE interrupt request flag register FLG_IPIR_REGm (m = 0, 1, 2, 3). It is mapped to the field RQnm (n = 0, 1, 2, 3) of 3), and the field RQnm is cleared to the value 0 according to the writing of the value 1 to the field CRnm. It is assumed that the zero value is always read when reading this register.

以下、制御ポリシに基づき共有リソース使用権限の付与制御を実現するにあたり、制御の時間単位となる制御周期と、共有リソース30の使用要求を受け付けるタイムウィンドウとの関係に着目した2つの主要な制御モデルを説明する。 Below, two main control models focusing on the relationship between the control cycle, which is the time unit of control, and the time window that accepts the usage request of the shared resource 30, in order to realize the control of granting the authority to use the shared resource based on the control policy. To explain.

図8(a)および図8(b)は、図1のマイコンの制御周期と共有リソース使用要求タイムウィンドウとの関係を示すタイミングチャートである。
図8(a)および図8(b)において、制御周期(Control Period)とはマイコン1、1B上で動作するアプリケーション、もしくはアプリケーションの実行環境を提供するリアルタイムOSが時間管理の基準とするシステムクロック(Tick)に基づき生成される固定の時間周期である。アプリケーションまたは/およびリアルタイムOSの動作は、原則として制御周期を単位として制御される。制御周期よりも時間粒度の小さいリソース共有制御を実現するため、共有リソース30の使用権限付与に係る制御状態や制御パラメータの少なくとも一部は制御周期ごとに再設定(初期化)されること、共有リソース30の使用権限の付与期間は単一の制御周期内で完結し、複数の制御周期に跨る権限付与は行わないこと、特定の制御周期における共有リソース30の使用権限付与を要求した1つ以上のPE10、20-1、20-2、20-3それぞれに対し、当該制御周期内に少なくとも1回の使用権限付与がなされるよう共有制御を行うこと、を制約として課してもよい。なお、以下の説明では、PE10上で実行されるアプリケーションが共有リソース30の使用を要求することはない前提としているが、制御ポリシに基づく使用権限付与制御の一般性が失われることはない。
8 (a) and 8 (b) are timing charts showing the relationship between the control cycle of the microcomputer of FIG. 1 and the shared resource usage request time window.
In FIGS. 8 (a) and 8 (b), the control cycle (Control Period) is an application running on the microcomputers 1 and 1B, or a system clock used as a reference for time management by a real-time OS that provides an execution environment of the application. It is a fixed time cycle generated based on (Tick). In principle, the operation of the application or / and the real-time OS is controlled in units of control cycles. In order to realize resource sharing control with a smaller time particle size than the control cycle, at least a part of the control state and control parameters related to the granting of usage authority of the shared resource 30 must be reset (initialized) for each control cycle, and shared. The grant period of the usage authority of the resource 30 is completed within a single control cycle, the permission is not granted across multiple control cycles, and one or more requests for granting the usage permission of the shared resource 30 in a specific control cycle. As a constraint, PE10, 20-1, 20-2, and 20-3 of PE10, 20-1, 20-2, and 20-3 may be subject to shared control so that the usage authority is granted at least once within the control cycle. In the following description, it is assumed that the application executed on the PE 10 does not request the use of the shared resource 30, but the generality of the usage authority grant control based on the control policy is not lost.

図8(a)は、使用要求レジスタ50が使用要求レジスタバンク50-0のみの1バンク構成をとる場合の制御モデルである。本制御モデルでは、PE20-1、20-2、20-3からの共有リソース30の使用権限割り当て要求の蓄積と、共有リソース管理プログラムからの要求状態の参照との間で、1つの使用要求レジスタバンク50-0を時分割で共有する。そのため、各制御周期の先頭から指定された期間のみ、当該制御周期内の共有リソース使用要求Rを受け付けるための使用要求受け付けウィンドウ期間Wを設定する。使用権限の割り当てを必要とするPE20-1、20-2、20-3は、使用要求受け付けウィンドウ期間W内に使用要求レジスタバンク50-0の共有リソース使用要求セットレジスタ520-1、520-2、520-3を介して、共有リソース使用要求フラグレジスタ510の要求フラグをセットする。使用要求受け付けウィンドウ期間W内に1つ以上の使用権限割り当て要求があった場合、PE10で動作する共有リソース管理プログラムは、制御テーブル140に規定される制御ポリシに基づき、現制御周期における使用権限の付与順序の決定Aを行う。 FIG. 8A is a control model in which the usage request register 50 has a one-bank configuration of only the usage request register banks 50-0. In this control model, one usage request register is used between the accumulation of usage authority allocation requests for the shared resource 30 from PE20-1, 20-2, and 20-3 and the reference of the request status from the shared resource management program. Share banks 50-0 in a time division manner. Therefore, the usage request acceptance window period W for accepting the shared resource usage request R in the control cycle is set only for the period specified from the beginning of each control cycle. PE20-1, 20-2, and 20-3, which require the assignment of usage authority, are the shared resource usage request set registers 520-1 and 520-2 of the usage request register bank 50-0 within the usage request acceptance window period W. The request flag of the shared resource usage request flag register 510 is set via 520-3. When one or more usage authority allocation requests are made within the usage request acceptance window period W, the shared resource management program operating on PE10 is based on the control policy specified in the control table 140, and the usage authority in the current control cycle is used. The granting order is determined A.

続いて、決定した付与順序に従って、次に使用権限を付与するPE20-1、20-2、20-3を特定し、権限付与時間の管理に必要となる使用権限制御装置60、60A内のハードウェアタイマチャネル610-2、610-3、610-4の設定および起動Sを行う。権限付与対象となったPE20-1、20-2、20-3は、自PEに関連付けられたハードウェアタイマチャネル610-2、610-3、610-4の動作状態のポーリング、もしくは自PEに出力された使用権限制御割り込み信号62-1、62-2、62-3を経由した権限付与開始割り込みの検出により、自PEに共有リソース30の使用権限が付与されたことを認識し、共有リソース30を利用するアプリケーションの実行Uを行う。共有リソース管理プログラムの制御により、使用権限が付与されたPE20-1、20-2、20-3は自PEへの権限付与終了割り込みを検出するまでの期間、共有リソース30を占有することができる。 Subsequently, according to the determined granting order, PE20-1, 20-2, 20-3 to be granted the usage authority next are specified, and the hardware in the usage authority control device 60, 60A required for managing the authorization grant time is specified. Set and start S of the wear timer channels 610-2, 610-3, 610-4. PE20-1, 20-2, 20-3 to which the authority is granted can be used for polling the operating status of the hardware timer channels 610-2, 610-3, 610-4 associated with the own PE, or for the own PE. By detecting the permission grant start interrupt via the output usage authority control interrupt signals 62-1, 62-2, 62-3, it is recognized that the usage authority of the shared resource 30 has been granted to the own PE, and the shared resource is used. Execution U of the application using 30 is performed. Under the control of the shared resource management program, PE20-1, 20-2, and 20-3 to which the usage authority is granted can occupy the shared resource 30 until the interrupt for the end of authorization to the own PE is detected. ..

例えば、制御周期(n-1)では、使用要求受け付けウィンドウ期間W内に2つのPE20-1、20-3から共有リソース使用要求Rがあったものとすると、制御周期(n-1)内にPE20-1、20-3に共有リソース30の使用権限が時分割的に割り当てられる。そして、PE20-1、20-3は、制御周期(n-1)内に共有リソース30を排他的に使用することでアプリケーションの実行Uを行う。また、制御周期(n)では、使用要求受け付けウィンドウ期間W内に3つのPE20-1、20-2、20-3から共有リソース使用要求Rがあったものとすると、制御周期(n)内にPE20-1、20-2、20-3に共有リソース30の使用権限が時分割的に割り当てられる。そして、PE20-1、20-2、20-3は、制御周期(n)内に共有リソース30を排他的に使用することでアプリケーションの実行Uを行う。 For example, in the control cycle (n-1), assuming that there is a shared resource usage request R from two PE20-1 and 20-3 within the usage request acceptance window period W, it is assumed that the shared resource usage request R is within the control cycle (n-1). The right to use the shared resource 30 is assigned to PE20-1 and 20-3 in a time-division manner. Then, PE20-1 and 20-3 execute the application by exclusively using the shared resource 30 within the control cycle (n-1). Further, in the control cycle (n), assuming that there are shared resource usage requests R from the three PE20-1, 20-2, and 20-3 within the usage request acceptance window period W, it is assumed that the shared resource usage request R is within the control cycle (n). The right to use the shared resource 30 is assigned to PE20-1, 20-2, and 20-3 in a time-division manner. Then, PE20-1, 20-2, and 20-3 execute the application by exclusively using the shared resource 30 within the control cycle (n).

これにより、各制御周期(n-1)、(n)よりも時間粒度の小さいリソース共有制御が実現可能となるとともに、制御周期(n-1)、(n)ごとにリソース共有制御の時間粒度を変化させることが可能となる。このため、例えば、制御周期(n-1)内に共有リソース使用要求Rを出したPE20-1、20-3において、その制御周期(n-1)内にPE20-1に共有リソース30の使用権限が割り当てられた場合においても、PE20-3は、その制御周期(n-1)内に共有リソース30の使用権限を取得することができ、制御周期(n-1)より後の制御周期(n)、(n+1)までアプリケーションの実行Uを待機する必要がなくなることから、PE20-3の演算効率を向上させることが可能となる。なお、より詳細な制御フローについては、別図とともに改めて説明する。 As a result, resource sharing control with a smaller time particle size than each control cycle (n-1) and (n) can be realized, and the time particle size of the resource sharing control for each control cycle (n-1) and (n). Can be changed. Therefore, for example, in PE20-1 and 20-3 that issued the shared resource use request R in the control cycle (n-1), the shared resource 30 is used in PE20-1 within the control cycle (n-1). Even when the authority is assigned, the PE20-3 can acquire the authority to use the shared resource 30 within the control cycle (n-1), and the control cycle (n-1) after the control cycle (n-1). Since it is not necessary to wait for the execution U of the application until n) and (n + 1), it is possible to improve the calculation efficiency of PE20-3. A more detailed control flow will be described again with a separate figure.

図8(b)は、使用要求レジスタ50が使用要求レジスタバンク50-0、50-1の2バンク構成をとる場合の制御モデルである。本制御モデルでは、PE20-1、20-2、20-3からの共有リソース30の使用権限割り当て要求蓄積と、共有リソース管理プログラムからの要求状態の参照にそれぞれ異なる使用要求レジスタバンク50-0、50-1を割り当て可能であり、図8(a)で説明した使用要求レジスタバンク50-0の時分割共有は不要となる。そのため、特定の制御周期(Control Period(n))について、その全体を次制御周期(Control Period(n+1))内の共有リソース使用要求Rを受け付けるための使用要求受け付けウィンドウ期間W(n+1)として設定することができる。使用権限の割り当てを必要とするPE20-1、20-2、20-3は、使用要求受け付けウィンドウ期間W(n+1)間内に使用要求レジスタバンク50-0、50-1のうち裏バンク側の共有リソース使用要求セットレジスタ520-1、520-2、520-3を介して、共有リソース使用要求フラグレジスタ510の要求フラグをセットする。各制御周期の先頭で使用要求レジスタ50-0、50-1の表/裏バンクを切り替えた結果として、表バンク側に1つ以上の使用権限割り当て要求があった場合、PE10で動作する共有リソース管理プログラムは、制御テーブル140に規定される制御ポリシに基づき、制御周期(n+1)における使用権限の付与順序の決定Aを行う。 FIG. 8B is a control model in which the usage request register 50 has a two-bank configuration of usage request register banks 50-0 and 50-1. In this control model, the usage request register banks 50-0, which are different for accumulating usage authority allocation requests for shared resources 30 from PE20-1, 20-2, and 20-3, and for referencing the request status from the shared resource management program, respectively. 50-1 can be assigned, and the time division sharing of the usage request register bank 50-0 described with reference to FIG. 8A becomes unnecessary. Therefore, for a specific control cycle (Control Period (n)), the whole is set as a usage request acceptance window period W (n + 1) for accepting the shared resource usage request R in the next control cycle (Control Period (n + 1)). can do. PE20-1, 20-2, and 20-3, which require the assignment of usage authority, are on the back bank side of the usage request register banks 50-0, 50-1 within the usage request acceptance window period W (n + 1). The request flag of the shared resource usage request flag register 510 is set via the shared resource usage request set register 520-1, 520-2, 520-3. A shared resource that operates on PE10 when there is one or more usage permission allocation requests on the front bank side as a result of switching the front / back banks of the usage request registers 50-0 and 50-1 at the beginning of each control cycle. The management program determines the order of granting the usage authority in the control cycle (n + 1) based on the control policy specified in the control table 140.

続いて、決定した付与順序に従って、次に使用権限を付与するPE20-1、20-2、20-3を特定し、権限付与時間の管理に必要となる使用権限制御装置60、60A内のハードウェアタイマチャネル610-2、610-3、610-4の設定および起動Sを行う。権限付与対象となったPE20-1、20-2、20-3は、自PEに関連付けられたハードウェタイマチャネル610-2、610-3、610-4の動作状態のポーリング、もしくは自PEに接続された使用権限制御割り込み信号62-1、62-2、62-3を経由した権限付与開始割り込みの検出により、自PEに共有リソース30の使用権限が付与されたことを認識し、共有リソース30を利用するアプリケーションの実行Uを行う。共有リソース管理プログラムの制御により、使用権限が付与されたPE20-1、20-2、20-3は自PEへの権限付与終了割り込みを検出するまでの期間、共有リソース30を独占することができる。 Subsequently, according to the determined granting order, PE20-1, 20-2, 20-3 to be granted the usage authority next are specified, and the hardware in the usage authority control device 60, 60A required for managing the authorization grant time is specified. Set and start S of the wear timer channels 610-2, 610-3, 610-4. PE20-1, 20-2, 20-3 to which the authority is granted are polled of the operating status of the hard-wet timer channels 610-2, 610-3, 610-4 associated with the own PE, or connected to the own PE. By detecting the permission grant start interrupt via the usage authority control interrupt signals 62-1, 62-2, 62-3, it is recognized that the usage authority of the shared resource 30 has been granted to the own PE, and the shared resource 30 is recognized. Execute the application that uses. Under the control of the shared resource management program, PE20-1, 20-2, and 20-3 to which the usage authority is granted can monopolize the shared resource 30 until the interrupt for the end of authorization to the own PE is detected. ..

本制御モデルでは、制御周期を単位とするソフトウェアパイプラインの態様でアプリケーションを実行できるため、図8(a)の制御モデルと比較し、既存アプリケーションを本制御モデルに適合させるために必要な移植作業を削減することができる。なお、より詳細な制御フローについては、別図とともに改めて説明する。 In this control model, the application can be executed in the form of a software pipeline whose unit is the control cycle. Therefore, the porting work required to adapt the existing application to the control model in comparison with the control model of FIG. 8 (a). Can be reduced. A more detailed control flow will be described again with a separate figure.

以下、制御ポリシに基づく共有リソース使用権限の付与制御に関し、4つの典型的な制御フローについて詳細に説明する。 Hereinafter, four typical control flows will be described in detail regarding the control of granting the authority to use shared resources based on the control policy.

<第1の共有リソース使用権限付与制御フロー>
図9~図11は、第1実施形態に係るマイコンの共有リソース使用権限付与の動作を示すフローチャートである。
<First shared resource usage permission grant control flow>
9 to 11 are flowcharts showing the operation of granting the authority to use the shared resource of the microcomputer according to the first embodiment.

第1の共有リソース使用権限付与制御フローでは、以下の場合について例示する。
(1)使用要求レジスタ50は1バンク(使用要求レジスタバンク50-0のみ)構成とし、使用要求レジスタバンクS30とする。
In the first shared resource use authority grant control flow, the following cases are illustrated.
(1) The usage request register 50 has a configuration of one bank (only the usage request register bank 50-0), and is the usage request register bank S30.

(2)使用権限制御装置は60または60Aのいずれかの構成とし、全PEについて使用権限付与期間終了イベント発生時の割り込み要求を許可に設定する。 (2) The usage authority control device is configured to be either 60 or 60A, and the interrupt request when the usage authority grant period end event occurs is set to permission for all PEs.

(3)制御テーブル140の設定に関し、マスタPE(PE0)の基本優先度(PR)フィールドをゼロ(優先度最高)、制御周期内上限時間(PT)フィールドを使用要求受け付けウィンドウ期間に換算可能な値に設定し、さらに、マスタPE(PE0)および全サテライトPE(PE1、PE2、PE3)について制御周期内権限再付与(RG)フィールドを無効に、それぞれ設定する。 (3) Regarding the setting of the control table 140, the basic priority (PR) field of the master PE (PE0) can be converted to zero (highest priority), and the upper limit time (PT) field within the control cycle can be converted into the usage request acceptance window period. Set to a value, and disable the intra-control cycle reauthorization (RG) field for each of the master PE (PE0) and all satellite PEs (PE1, PE2, PE3).

(4)各制御周期の先頭から所定の時間のみ、使用要求受け付けウィンドウ期間Wとして設定し、当該制御周期内に共有リソース30の使用権限付与を必要とするサテライトPEからの共有リソース使用要求を受け付ける。 (4) Only a predetermined time from the beginning of each control cycle is set as the usage request acceptance window period W, and the shared resource usage request from the satellite PE that needs to grant the usage authority of the shared resource 30 is accepted within the control cycle. ..

(5)使用権限の付与開始タイミングの通知は、各サテライトPE上で動作するアプリケーションから、使用権限制御装置60、60Aの備える、自PEに関連付けられたハードウェアタイマチャネルの動作状態をポーリングすることで実現する。 (5) Notification of the start timing of granting usage authority is to poll the operating status of the hardware timer channel associated with the own PE of the usage authority control devices 60 and 60A from the application running on each satellite PE. Realize with.

(6)使用権限の付与終了タイミングの通知は、各サテライトPE上で動作するアプリケーションに対し、使用権限制御装置60、60Aから使用権限付与期間終了イベント発生に伴う割り込みを要求することで実現する。 (6) The notification of the end timing of granting the usage authority is realized by requesting the application running on each satellite PE from the usage authority control devices 60 and 60A to interrupt with the occurrence of the usage authority grant period end event.

第1サテライトPEであるPEnには、使用権限制御装置60、60Aの備えるハードウェアタイマチャネルS41が関連付けられ、少なくともPEnおよびPEn上で動作するアプリケーションS40への共有リソース使用権限付与の終了タイミングを制御する。マスタPE(PE0)についても同様に、ハードウェアタイマチャネルS41とは独立したハードウェアタイマチャネルS11が関連付けられ、PE0上で動作する共有リソース管理プログラムS10による共有制御処理の一部として、使用要求受け付けウィンドウ期間Wを計測する目的で、さらに望ましくは、使用権限を保持するサテライトPEに関連付けられたハードウェアタイマチャネルの状態および動作を複製(レプリケーション)したレプリカとして、利用する。 The hardware timer channel S41 provided in the usage authority control devices 60 and 60A is associated with the PEN which is the first satellite PE, and controls the end timing of granting the shared resource usage authority to at least the PEN and the application S40 running on the Pen. do. Similarly, for the master PE (PE0), a hardware timer channel S11 independent of the hardware timer channel S41 is associated with the master PE (PE0), and a usage request is accepted as a part of the shared control process by the shared resource management program S10 operating on the PE0. For the purpose of measuring the window period W, more preferably, it is used as a replica of the state and operation of the hardware timer channel associated with the satellite PE holding the usage authority.

PEn上で動作するアプリケーションS40は、1バンク構成の使用要求レジスタバンクS30内の要求フラグをセットする。共有リソース管理プログラムS10は、使用要求レジスタバンクS30に蓄積された共有リソース使用要求、および制御テーブルS20に設定された制御情報をそれぞれ参照/更新しながら、使用権限付与順序の決定と使用権限制御装置60、60Aの制御を行う。共有制御の開始に先立ち、制御テーブルS20は適切に設定されているものとする。 The application S40 running on the Pen sets the request flag in the use request register bank S30 of the one-bank configuration. The shared resource management program S10 determines the order of granting usage authority and controls the usage authority while referring / updating the shared resource usage request stored in the usage request register bank S30 and the control information set in the control table S20, respectively. 60, 60A is controlled. It is assumed that the control table S20 is appropriately set prior to the start of the shared control.

図9において、共有リソース管理プログラムS10が、図示しないハードウェアもしくはソフトウェア手段を用いて制御周期の開始タイミングを検出すると、以下の初期化処理S1001を順次実行する。 In FIG. 9, when the shared resource management program S10 detects the start timing of the control cycle by using hardware or software means (not shown), the following initialization process S1001 is sequentially executed.

(1)使用権限制御装置60、60Aが備える停止トリガレジスタ626への書き込みにより、全ハードウェアタイマチャネルS11、S41の同時停止を要求(T1001、T1002)する。停止要求を受けたPE0およびPEn用のハードウェアタイマチャネルS11、S41は、それぞれ停止状態(S1101、S4101)となる。 (1) Simultaneous stop of all hardware timer channels S11 and S41 is requested (T1001 and T1002) by writing to the stop trigger register 626 provided in the usage authority control devices 60 and 60A. The hardware timer channels S11 and S41 for PE0 and PEn that have received the stop request are in the stopped state (S1101, S4101), respectively.

(2)使用要求レジスタバンクS30が備える共有リソース使用要求クリアレジスタ530への書き込みにより全PEの使用要求フラグをクリアし、さらに共有リソース使用要求セットレジスタ520-0への書き込みによりPE0の使用要求フラグをセットすることで、PE0の使用要求フラグのみ有効な状態(S3001)となるよう、共有リソース使用要求フラグレジスタ510の内容を更新(T1003)する。 (2) The usage request flag of all PEs is cleared by writing to the shared resource usage request clear register 530 provided in the usage request register bank S30, and the usage request flag of PE0 is cleared by writing to the shared resource usage request set register 520-0. By setting, the contents of the shared resource usage request flag register 510 are updated (T1003) so that only the usage request flag of PE0 is in a valid state (S3001).

(3)制御テーブルS20の全PEについて、使用権限付与中フラグ(IU)フィールド値をクリア(偽に設定)(T1004)し、制御周期内残り時間(RT)フィールド値は、制御周期内上限時間(PT)フィールド値からハードウェアタイマチャネルS11、S41内のカウントレジスタに設定可能な値に変換した値(以下、換算値と呼ぶ)に更新(T1005)することで、制御周期開始時点での制御テーブルS20の初期状態(S2001)とする。 (3) For all PEs in the control table S20, the usage authority granting flag (IU) field value is cleared (set to false) (T1004), and the remaining time in the control cycle (RT) field value is the upper limit time in the control cycle. (PT) Control at the start of the control cycle by updating (T1005) to a value converted from the field value to a value that can be set in the count register in the hardware timer channels S11 and S41 (hereinafter referred to as a converted value). The initial state (S2001) of the table S20 is used.

(4)各PEに関連付けられたハードウェアタイマチャネルS11、S41の初期カウント値レジスタ617に対し、制御テーブルS20の制御周期内残り時間(RT)フィールド値をそれぞれ設定(T1006、T1007)する。本時点では、PE0用ハードウェアタイマチャネルS11には、使用要求受け付けウィンドウ期間Wに相当する値が設定される。 (4) The remaining time (RT) field value in the control cycle of the control table S20 is set (T1006, T1007) for the initial count value register 617 of the hardware timer channels S11 and S41 associated with each PE, respectively. At this point in time, a value corresponding to the usage request acceptance window period W is set in the hardware timer channel S11 for PE0.

(5)制御周期の先頭において、PE0に対する共有リソース使用権限付与の態様で使用要求受け付けウィンドウ期間Wを実現する目的で、PE0用ハードウェアタイマチャネルS11を動作させるため、PE0の使用権限付与中フラグ(IU)フィールド値をセット(真に設定)(T1008)し、制御テーブルS20の状態を、PE0が使用権限を保持している状態S2002に更新する。本処理は、PE0の基本優先度設定が最高であることと組み合わせることで、PE0とそれ以外のPEnに対する共有リソース使用権限付与に係る処理を共通化し、使用要求受け付けウィンドウ期間W以前にPE0以外のPEnに対して使用権限が付与されるのを抑止するために有効なオプション処理である。 (5) At the beginning of the control cycle, in order to operate the hardware timer channel S11 for PE0 for the purpose of realizing the usage request acceptance window period W in the mode of granting the permission to use the shared resource to PE0, the flag for granting the permission to use PE0. (IU) The field value is set (true set) (T1008), and the state of the control table S20 is updated to the state S2002 in which PE0 holds the usage authority. By combining this process with the highest basic priority setting of PE0, the process related to granting the authority to use shared resources to PE0 and other PENs is standardized, and other than PE0 before the usage request acceptance window period W. This is an effective optional process for suppressing the granting of usage authority to PEn.

(6)使用権限制御装置60、60Aが備える開始トリガレジスタ625への書き込みにより、PE0用ハードウェアタイマチャネルS11の起動を要求(T1009)する。起動要求を受けたハードウェアタイマチャネルS11は動作状態S1102へと遷移し、現カウント値レジスタ616にコピーされた初期カウント値レジスタ617の値を初期値として、所定の条件に基づくデクリメント動作を開始する。 (6) The activation of the hardware timer channel S11 for PE0 is requested (T1009) by writing to the start trigger register 625 included in the usage authority control devices 60 and 60A. The hardware timer channel S11 that has received the start request transitions to the operation state S1102, and starts the decrement operation based on a predetermined condition with the value of the initial count value register 617 copied to the current count value register 616 as the initial value. ..

共有リソース管理プログラムS10と同様の手段により制御周期の開始タイミングを検出した、PEn上で動作するアプリケーションS40は、制御周期内に実行すべき処理に関する初期化等、所定の前処理を実行(S4001)する。実行すべき処理が共有リソース使用権限の付与を必要とする場合には、前処理の少なくとも一部として、使用要求受け付けウィンドウ期間W内、すなわちPE0用ハードウェアタイマチャネルS11のカウント動作中に、使用要求レジスタバンクS30内にあるPEn用共有リソース使用要求セットレジスタへの書き込みにより、PEnの使用要求フラグをセット(T4001)する。 The application S40 running on PEn, which has detected the start timing of the control cycle by the same means as the shared resource management program S10, executes predetermined preprocessing such as initialization of the processing to be executed within the control cycle (S4001). do. When the process to be executed requires the granting of the shared resource use authority, it is used within the usage request acceptance window period W, that is, during the counting operation of the hardware timer channel S11 for PE0, as at least a part of the preprocessing. The PEn usage request flag is set (T4001) by writing to the PEN shared resource usage request set register in the request register bank S30.

また、図示しないが、同じ使用要求受け付けウィンドウ期間W内に、PEnとは異なるサテライトPE(PEmとする)上で動作するアプリケーションも、同様の手順により、PEmの使用要求フラグをセットするものとする。この結果、使用要求受け付けウィンドウ期間W終了の時点で、使用要求レジスタバンクS30には、PE0、PEnおよびPEmの使用要求フラグがセットされた状態S3002となる。 Further, although not shown, an application running on a satellite PE (referred to as PEm) different from Pen within the same usage request acceptance window period W shall also set the usage request flag of PEm by the same procedure. .. As a result, at the end of the usage request acceptance window period W, the usage request register bank S30 is in a state S3002 in which the usage request flags of PE0, Pen, and Pem are set.

前処理を完了したPEn上のアプリケーションS40は、PEnへの共有リソース使用権限の付与待ち処理S4002の少なくとも一部として、図9および図10に示すように、PEn用ハードウェアタイマチャネルS41のチャネル状態レジスタ615を所定の周期でポーリング(T4002、T4003、T4004)する。PEnへ使用権限が付与済みである、すなわち共有リソース管理プログラムS10の指示によりハードウェアタイマチャネルS41が起動し、チャネル状態レジスタ615がカウント動作中であることを示す値となるまで、アプリケーションS40はポーリング動作を反復する。 As shown in FIGS. 9 and 10, the application S40 on the PEN that has completed the preprocessing is a channel state of the hardware timer channel S41 for the Pen as at least a part of the process S4002 waiting for the permission to use the shared resource to be granted to the Pen. The register 615 is polled (T4002, T4003, T4004) at a predetermined cycle. The application S40 polls until the PEn has been granted usage authority, that is, the hardware timer channel S41 is started by the instruction of the shared resource management program S10, and the channel status register 615 reaches a value indicating that the counting operation is in progress. Repeat the operation.

一方、カウント動作状態にあるPE0用ハードウェアタイマチャネルS11は、使用要求受け付けウィンドウ期間W、所定の時間経過ごとに現カウント値レジスタ616の内容をデクリメントする。現カウント値レジスタ616の内容が、事前に定義された下限値以下となったことを検出すると、使用権限制御装置60、60Aは、割り込み要求制御部630、630Aが備える割り込み要因レジスタ635、635Aにおいて、ハードウェアタイマチャネルS11からPE0に対する使用権限付与期間終了イベントの発生状態を保持するフィールド値を真にセットする。本制御フローでは、当該イベントを要因とする割り込みを許可に設定しているため、使用権限制御割り込み信号61により当該イベントを要因とする割り込みをPE0に要求(T1101)する。 On the other hand, the hardware timer channel S11 for PE0 in the counting operation state decrements the contents of the current count value register 616 every time the usage request acceptance window period W and a predetermined time elapse. When it is detected that the content of the current count value register 616 is equal to or less than the predetermined lower limit value, the usage authority control devices 60 and 60A are in the interrupt factor registers 635 and 635A provided in the interrupt request control units 630 and 630A. , The field value that holds the occurrence state of the usage authority grant period end event for PE0 from the hardware timer channel S11 is truly set. In this control flow, since the interrupt caused by the event is set to allow, the use authority control interrupt signal 61 requests the PE0 for the interrupt caused by the event (T1101).

PE0用ハードウェアタイマチャネルS11による、使用権限付与期間終了イベントを要因とする割り込み要求を検出した共有リソース管理プログラムS10は、使用要求受け付けウィンドウ期間Wの終了に係る一連の処理S1002を順次実行する。 The shared resource management program S10 that has detected an interrupt request caused by the usage authority grant period end event by the hardware timer channel S11 for PE0 sequentially executes a series of processes S1002 related to the end of the usage request acceptance window period W.

(1)使用権限制御装置60、60Aの割り込み要求制御部630、630Aが備える割り込み要因レジスタ635、635Aにおいて、PE0用ハードウェアタイマチャネルS11からPE0に対する使用権限付与期間終了イベントの発生状態を保持するフィールド値を偽にクリアし、さらに望ましくは、チャネルS11がカウント動作状態を継続している場合には、停止トリガレジスタ626への書き込みにより、ハードウェアタイマチャネルS11の停止を要求する(T1010)。この結果、ハードウェアタイマチャネルS11はカウント停止状態S1103へ遷移する。 (1) In the interrupt factor registers 635 and 635A provided in the interrupt request control units 630 and 630A of the usage authority control devices 60 and 60A, the generation state of the usage authority grant period end event for PE0 is held from the hardware timer channel S11 for PE0. The field value is falsely cleared, and more preferably, when the channel S11 continues the counting operation state, the hardware timer channel S11 is requested to be stopped by writing to the stop trigger register 626 (T1010). As a result, the hardware timer channel S11 transitions to the count stop state S1103.

(2)PE0に対する共有リソース使用権限付与の態様で実装した、使用要求受け付けウィンドウ期間W終了に伴い、PE0の使用権限付与中フラグ(IU)フィールド値をクリア(偽に設定)(T1011)し、制御テーブルS20の状態を、どのPE0、PEn、PEmも使用権限を保持していない状態S2003に更新する。なお、処理T1011は処理T1008と対になるものであり、処理T1008を省略した場合は、処理T1011も同様に省略してよい。 (2) With the end of the usage request acceptance window period W implemented in the mode of granting the shared resource usage authority to PE0, the PE0 usage authority granting flag (IU) field value is cleared (set to false) (T1011). The state of the control table S20 is updated to the state S2003 in which none of PE0, Pen, and Pem holds the usage authority. The process T1011 is paired with the process T1008, and when the process T1008 is omitted, the process T1011 may be omitted as well.

(3)続いて、PE0の制御周期内権限再付与(RG)フィールドの設定に応じ、PE0の制御周期内残り時間(RT)フィールド値を更新する。本制御フローでは、RGフィールドを無効(再付与禁止)に設定しており、その場合には、誤って再度PE0に対する使用権限付与が行われないよう、RTフィールド値を残り時間ゼロに相当する換算値に更新(T1012)する。 (3) Subsequently, the remaining time (RT) field value in the control cycle of PE0 is updated according to the setting of the authority reassignment (RG) field in the control cycle of PE0. In this control flow, the RG field is set to invalid (reassignment prohibited), and in that case, the RT field value is converted to zero remaining time so that the usage authority is not granted to PE0 again by mistake. Update to the value (T1012).

(4)PE0の制御周期内残り時間がゼロとなった場合、使用要求レジスタバンクS30が備える共有リソース使用要求クリアレジスタ530への書き込みにより、PE0の使用要求フラグをクリア(T1013)する。この結果、使用要求レジスタバンクS30は、PEnおよびPEmの使用要求フラグがセットされた状態S3003となる。 (4) When the remaining time in the control cycle of PE0 becomes zero, the usage request flag of PE0 is cleared (T1013) by writing to the shared resource usage request clear register 530 provided in the usage request register bank S30. As a result, the usage request register bank S30 is in the state S3003 in which the usage request flags of Pen and Pem are set.

共有リソース管理プログラムS10は、続いて、図10に示すように、使用要求レジスタバンクS30の備える共有リソース使用要求フラグレジスタ510を読み出し(T1014)、使用要求受け付けウィンドウ期間Wに蓄積された共有リソース使用要求の有無をチェック(S1003)する。1以上の使用要求があった場合には、図22に示すフローに基づき、共有リソース使用権限の付与順序を一括して決定(S1004)し、制御テーブルS20のうち、少なくとも共有リソース30の使用を要求した全PEについて、決定した付与順序を特定する値を制御周期内権限付与順序(OR)フィールドに設定する(T1015)。さらに望ましくは、共有リソース30の使用要求なし、制御テーブルS20内の制御ポリシ設定が無効などの所定の理由により、現制御周期における共有リソース使用権限付与の対象外となったPEについては、付与対象外であることを示す特定の値を、当該PEのORフィールドに設定してよい。 Subsequently, as shown in FIG. 10, the shared resource management program S10 reads out the shared resource usage request flag register 510 included in the usage request register bank S30 (T1014), and uses the shared resources accumulated in the usage request acceptance window period W. Check for the presence or absence of a request (S1003). When there is one or more usage requests, the order of granting the shared resource usage authority is collectively determined (S1004) based on the flow shown in FIG. 22, and at least the shared resource 30 of the control table S20 is used. For all the requested PEs, a value specifying the determined grant order is set in the authority grant order (OR) field within the control cycle (T1015). More preferably, PEs that are not subject to the grant of the shared resource use authority in the current control cycle due to a predetermined reason such as no request to use the shared resource 30 or invalidation of the control policy setting in the control table S20 are subject to grant. A specific value indicating that it is outside may be set in the OR field of the PE.

以降、共有リソース管理プログラムS10は、処理S1004で決定した共有リソース使用権限の付与順序に従って、付与対象となるサテライトPEに対し共有リソース30の使用権限を付与する。具体的な手順は以下のとおりである。 After that, the shared resource management program S10 grants the usage authority of the shared resource 30 to the satellite PE to be granted according to the order of granting the shared resource usage authority determined in the process S1004. The specific procedure is as follows.

(1)制御テーブルS20の制御周期内権限付与順序(OR)フィールドを参照し、次(または最初)に使用権限を付与すべきサテライトPEを特定(S1005)する。特定したPE(PEnとする)の使用権限付与中フラグ(IU)フィールド値をセット(真に設定)(T1016)し、制御テーブルS20の状態を、PEnが使用権限を保持している状態S2004に更新する。 (1) With reference to the authority granting order (OR) field within the control cycle of the control table S20, the satellite PE to which the usage authority should be granted next (or first) is specified (S1005). The flag (IU) field value for granting the usage authority of the specified PE (referred to as PEn) is set (true set) (T1016), and the state of the control table S20 is changed to the state S2004 in which the PEN holds the usage authority. Update.

(2)PE0用ハードウェアタイマチャネルS11を、次の使用権限付与先であるPEn用ハードウェアタイマチャネルS41のレプリカとして動作させるため、制御テーブルS20の設定のうち、PEnの制御周期内残り時間(RT)フィールド値を、ハードウェアタイマチャネルS11の初期カウント値レジスタ617に設定(T1017)する。 (2) In order to operate the hardware timer channel S11 for PE0 as a replica of the hardware timer channel S41 for Pen to which the next usage authority is granted, the remaining time in the control cycle of PEn in the setting of the control table S20 (2) The RT) field value is set in the initial count value register 617 of the hardware timer channel S11 (T1017).

(3)使用権限制御装置60、60Aが備える開始トリガレジスタ625への書き込みにより、PE0およびPEn用ハードウェアタイマチャネルS11、S41の同時起動を要求(T1018、T1019)する。起動要求を受けたハードウェアタイマチャネルS11、S41はそれぞれ動作状態(S1104、S4102)に遷移し、いずれも当該ハードウェアタイマチャネルS11、S41の現カウント値レジスタ616にコピーされた初期カウント値レジスタ617の値を初期値として、所定の条件に基づくデクリメント動作を開始する。ここで、ハードウェアタイマチャネルS41がカウント動作状態であることと、共有リソース使用権限をPEnに対し付与中であることは等価であり、2つのハードウェアタイマチャネルS11、S41は同期してデクリメント動作を行う。 (3) Simultaneous activation of PE0 and PEn hardware timer channels S11 and S41 is requested (T1018, T1019) by writing to the start trigger register 625 included in the usage authority control devices 60 and 60A. The hardware timer channels S11 and S41 that received the start request transition to the operating states (S1104 and S4102), respectively, and both of them are the initial count value registers 617 copied to the current count value registers 616 of the hardware timer channels S11 and S41. The decrement operation based on a predetermined condition is started with the value of. Here, it is equivalent that the hardware timer channel S41 is in the counting operation state and the shared resource use authority is being granted to the PEN, and the two hardware timer channels S11 and S41 are synchronously decrementing. I do.

PEnへの共有リソース使用権限の付与待ち処理S4002の少なくとも一部として、PEn用ハードウェアタイマチャネルS41のチャネル状態レジスタ615を所定の周期でポーリング(T4004)していたアプリケーションS40は、ハードウェアタイマチャネルS41のカウント動作状態、すなわちPEnへの使用権限が付与済みであることを示す状態を検出すると、共有リソース30の使用を伴う処理S4003を実行する。アプリケーションS40は、ハードウェアタイマチャネルS41がカウント動作状態の期間、共有リソース30を占有して使用可能である一方、使用権限の付与終了タイミングを通知する権限付与期間終了イベントを要因とする割り込み要求が発生するまでには、処理S4003を終了しなければならないものとする。 The application S40, which polls (T4004) the channel status register 615 of the hardware timer channel S41 for Pen at a predetermined cycle as at least a part of the process S4002 waiting for the permission to use the shared resource to be granted to the Pen, is the hardware timer channel. When the count operation state of S41, that is, the state indicating that the usage authority to PEn has been granted is detected, the process S4003 accompanied by the use of the shared resource 30 is executed. In the application S40, while the hardware timer channel S41 can be used by occupying the shared resource 30 during the counting operation state, an interrupt request caused by an authorization period end event for notifying the use authority grant end timing is received. It is assumed that the process S4003 must be completed by the time it occurs.

PE0およびPEn用ハードウェアタイマチャネルS11、S41が同時起動要求(T1018、T1019)によりカウント動作状態に遷移した後、各ハードウェアタイマチャネルS11、S41の初期カウント値レジスタ617に設定された時間、すなわち制御テーブルS20内のPEnに割り当て可能な制御周期内残り時間(RT)フィールドに指定された時間が経過すると、使用権限制御装置60、60Aの割り込み要求制御部630、630Aが備える割り込み要因レジスタ635、635Aにおいて、ハードウェアタイマチャネルS11からPE0に対する使用権限付与期間終了イベント、およびハードウェアタイマチャネルS41からPEnに対する使用権限付与期間終了イベントの発生状態を保持するフィールド値がそれぞれ真にセットされる。本制御フローでは、当該イベントを要因とする割り込みを許可に設定しているため、ハードウェアチャネルS11、S41は、当該イベントを要因とし使用権限付与期間の終了を通知する割り込みを、使用権限割り込み信号を経由し、それぞれPE0(T1102)、PEn(T4101)に対し同時に要求する。 After the hardware timer channels S11 and S41 for PE0 and PEn transition to the count operation state by the simultaneous start request (T1018, T1019), the time set in the initial count value register 617 of each hardware timer channel S11, S41, that is, When the time specified in the remaining time (RT) field in the control cycle that can be assigned to PEn in the control table S20 elapses, the interrupt factor registers 635 provided by the interrupt request control units 630 and 630A of the usage authority control devices 60 and 60A, In 635A, the field values that hold the occurrence state of the usage authority granting period end event for PE0 from the hardware timer channel S11 and the usage authority granting period end event for PEN from the hardware timer channel S41 are truly set. In this control flow, since the interrupt caused by the event is set to allow, the hardware channels S11 and S41 send an interrupt notifying the end of the usage authority granting period due to the event as a usage authority interrupt signal. At the same time, PE0 (T1102) and Pen (T4101) are requested at the same time.

PEn用ハードウェアタイマチャネルS41による、使用権限付与期間終了イベントを要因とする割り込み要求を検出したアプリケーションS40は、図11に示すように、使用権限付与期間終了に係る処理S4004を実行する。 As shown in FIG. 11, the application S40 that has detected the interrupt request caused by the usage authority grant period end event by the hardware timer channel S41 for Pen executes the process S4004 related to the end of the usage permission grant period.

(1)使用権限制御装置60、60Aの割り込み要求制御部630、630Aが備える割り込み要因レジスタ635、635Aにおいて、PEn用ハードウェアタイマチャネルS41からPEnに対する使用権限付与期間終了イベントの発生状態を保持するフィールド値を偽にクリアし、さらに望ましくは、チャネルS41がカウント動作状態を継続している場合には、停止トリガレジスタ626への書き込みにより、ハードウェアタイマチャネルS41の停止を要求する(T4005)。この結果、ハードウェアタイマチャネルS41はカウント停止状態S4103へ遷移する。 (1) In the interrupt factor registers 635 and 635A provided in the interrupt request control units 630 and 630A of the usage authority control devices 60 and 60A, the generation state of the usage authority grant period end event for the PEN from the hardware timer channel S41 for Pen is held. The field value is falsely cleared, and more preferably, when the channel S41 continues the counting operation state, the hardware timer channel S41 is requested to be stopped by writing to the stop trigger register 626 (T4005). As a result, the hardware timer channel S41 transitions to the count stop state S4103.

(2)必要に応じて、アプリケーションS40は、割り込みからの回復処理、共有リソース使用権限が不要かつ当該制御周期内に実行すべき処理など、所定の後処理S4005を実行する。 (2) If necessary, the application S40 executes predetermined post-processing S4005, such as recovery processing from interrupts, processing that does not require shared resource use authority and should be executed within the control cycle.

PE0用ハードウェアタイマチャネルS11による、使用権限付与期間終了イベントを要因とする割り込み要求を検出した共有リソース管理プログラムS10は、使用権限付与期間終了に係る処理S1006として、以下の処理を順次実行する。 The shared resource management program S10 that has detected an interrupt request caused by the usage authority grant period end event by the hardware timer channel S11 for PE0 sequentially executes the following processes as the process S1006 related to the end of the usage permission grant period.

(1)使用権限制御装置60、60Aの割り込み要求制御部630、630Aが備える割り込み要因レジスタ635、635Aにおいて、PE0用ハードウェアタイマチャネルS11からPE0に対する使用権限付与期間終了イベントの発生状態を保持するフィールド値を偽にクリアし、さらに望ましくは、ハードウェアタイマチャネルS11がカウント動作状態を継続している場合には、停止トリガレジスタ626への書き込みにより、ハードウェアタイマチャネルS11の停止を要求する(T1020)。この結果、ハードウェアタイマチャネルS11はカウント停止状態S1105へ遷移する。 (1) In the interrupt factor registers 635 and 635A provided in the interrupt request control units 630 and 630A of the usage authority control devices 60 and 60A, the generation state of the usage authority grant period end event for PE0 is held from the hardware timer channel S11 for PE0. If the field value is falsely cleared, and more preferably, the hardware timer channel S11 continues to be in the counting operation state, the hardware timer channel S11 is requested to be stopped by writing to the stop trigger register 626. T1020). As a result, the hardware timer channel S11 transitions to the count stop state S1105.

(2)安全対応のオプション処理として、割り込み要因レジスタ635、635AにおいてPEnを対象とする全イベントの発生状態を保持するフィールド値を偽にクリアするとともに、停止トリガレジスタ626への書き込みにより、PEn用ハードウェアタイマチャネルS41の停止を要求する(T1021)。 (2) As an optional process for safety, the field value that holds the occurrence status of all events targeting PEn is falsely cleared in the interrupt factor registers 635 and 635A, and the field value is written to the stop trigger register 626 for PEn. Request the stop of the hardware timer channel S41 (T1021).

(3)制御テーブルS20に関しては、PEnの使用権限付与中フラグ(IU)フィールド値をクリア(偽に設定)(T1022)し、どのPE0、PEn、PEmも使用権限を保持していない状態S2005に更新する。 (3) Regarding the control table S20, the flag (IU) field value for which the usage authority of Pen is granted is cleared (set to false) (T1022), and none of PE0, Pen, and Pem holds the usage authority in S2005. Update.

(4)続いて、PEnの制御周期内権限再付与(RG)フィールドの設定に応じ、PEnの制御周期内残り時間(RT)フィールド値を更新する。本制御フローでは、RGフィールドを無効(再付与禁止)に設定しており、その場合には、誤って再度PEnに対する使用権限付与が行われないよう、RTフィールド値を残り時間ゼロに相当する換算値に更新(T1023)する。 (4) Subsequently, the remaining time (RT) field value in the control cycle of the PEN is updated according to the setting of the authority reassignment (RG) field in the control cycle of the PEN. In this control flow, the RG field is set to invalid (reassignment prohibited), and in that case, the RT field value is converted to zero remaining time so that the usage authority is not granted to PEn again by mistake. Update to the value (T1023).

(5)PEnの制御周期内残り時間がゼロとなった場合、使用要求レジスタバンクS30が備える共有リソース使用要求クリアレジスタ530への書き込みにより、PEnの使用要求フラグをクリア(T1024)する。この結果、使用要求レジスタバンクS30は、PEmの使用要求フラグがセットされた状態S3004となる。 (5) When the remaining time in the control cycle of PEn becomes zero, the usage request flag of Pen is cleared (T1024) by writing to the shared resource usage request clear register 530 provided in the usage request register bank S30. As a result, the usage request register bank S30 is in the state S3004 in which the usage request flag of PEm is set.

共有リソース管理プログラムS10は、続いて、PEnの次に使用権限の付与先となるPEの特定と、特定したPEに対する共有リソース30の権限付与に係る一連の処理S1007を実行する。具体的な手順は以下のとおりである。 The shared resource management program S10 subsequently executes a series of processes S1007 relating to the identification of the PE to which the usage authority is granted next to the PEn and the authorization of the shared resource 30 to the identified PE. The specific procedure is as follows.

(1)制御テーブルS20の制御周期内権限付与順序(OR)フィールドを参照し、次に使用権限を付与すべきサテライトPEを特定する。特定したPE(PEmとする)の使用権限付与中フラグ(IU)フィールド値をセット(真に設定)(T1025)し、制御テーブルS20の状態を、PEmが使用権限を保持している状態S2006に更新する。 (1) With reference to the authority granting order (OR) field within the control cycle of the control table S20, the satellite PE to which the usage authority should be granted is specified next. Set (true set) (T1025) the flag (IU) field value for granting the usage authority of the specified PE (referred to as PEm), and change the state of the control table S20 to the state S2006 in which the PEm holds the usage authority. Update.

(2)PE0用ハードウェアタイマチャネルS11を、次の使用権限付与先であるPEm用ハードウェアタイマチャネル(図示せず)のレプリカとして動作させるため、制御テーブルS20の設定のうち、PEmの制御周期内残り時間(RT)フィールド値を、ハードウェアタイマチャネルS11の初期カウント値レジスタ617に設定(T1026)する。 (2) In order to operate the hardware timer channel S11 for PE0 as a replica of the hardware timer channel S11 for PEm (not shown) to which the next usage authority is granted, the control cycle of PEm among the settings of the control table S20 The remaining time (RT) field value is set in the initial count value register 617 of the hardware timer channel S11 (T1026).

(3)使用権限制御装置60、60Aが備える開始トリガレジスタ625への書き込みにより、PE0用ハードウェアタイマチャネルS11とPEm用ハードウェアタイマチャネル(図示せず)の同時起動を要求(T1027、T1028)する。起動要求を受けたハードウェアタイマチャネルS11は動作状態(S1106)に遷移し、当該ハードウェアタイマチャネルS11の現カウント値レジスタ616にコピーされた初期カウント値レジスタ617の値を初期値として、所定の条件に基づくデクリメント動作を開始する。図示しないPEm用ハードウェアタイマチャネルも、同様の手順によりデクリメント動作を開始し、共有リソース使用権限をPEmに対し付与中であることを示すカウント動作状態となる。 (3) By writing to the start trigger register 625 provided in the usage authority control devices 60 and 60A, simultaneous activation of the hardware timer channel S11 for PE0 and the hardware timer channel for PEm (not shown) is requested (T1027, T1028). do. The hardware timer channel S11 that has received the start request transitions to the operating state (S1106), and a predetermined value is set as the initial value of the initial count value register 617 copied to the current count value register 616 of the hardware timer channel S11. Start the condition-based decrement operation. The hardware timer channel for PEm (not shown) also starts the decrement operation by the same procedure, and becomes a count operation state indicating that the shared resource use authority is being granted to the PEm.

本制御フローによれば、マイコン1、1Bの搭載する限られた機能を活用し、上記の使用権限付与処理を順次実行することにより、使用要求受け付けウィンドウ期間W内に使用権限の割り当てを要求した全PEについて、厳密な優先度設定に基づき、かつハードウェアタイマチャネルS11、S41の許す限り細粒度の時間単位で、制御周期ごとに少なくとも1回は使用権限を付与するリソース共有制御を実現できる。 According to this control flow, the allocation of usage authority is requested within the usage request acceptance window period W by sequentially executing the above-mentioned usage authority granting process by utilizing the limited functions installed in the microcomputers 1 and 1B. For all PEs, it is possible to realize resource sharing control that grants usage authority at least once in each control cycle based on strict priority setting and in the finest particle time unit allowed by the hardware timer channels S11 and S41.

<第2の共有リソース使用権限付与制御フロー>
図12~図14は、第2実施形態に係るマイコンの共有リソース使用権限付与の動作を示すフローチャートである。
第2の共有リソース使用権限付与制御フローでは、第1の共有リソース使用権限付与制御フローの例示に対し(2)および(5)の条件が異なる。
<Second shared resource usage permission grant control flow>
12 to 14 are flowcharts showing the operation of granting the authority to use the shared resource of the microcomputer according to the second embodiment.
In the second shared resource use authority grant control flow, the conditions (2) and (5) are different from the example of the first shared resource use authority grant control flow.

(2)使用権限制御装置は60Aの構成とし、全PEについて使用権限付与期間終了イベント発生時の割り込み要求を許可に設定し、PE0を除く全PEについて使用権限付与期間開始イベント発生時の割り込み要求を許可に設定する。 (2) The usage authority control device is configured to be 60A, the interrupt request when the usage authority grant period end event occurs is set to allow for all PEs, and the interrupt request when the usage authority grant period start event occurs for all PEs except PE0. Is set to allow.

(5)使用権限の付与開始タイミングの通知は、各サテライトPE上で動作するアプリケーションに対し、使用権限制御装置60Aから使用権限付与期間開始イベント発生に伴う割り込みを要求することで実現する。 (5) Notification of the start timing of granting usage authority is realized by requesting an interrupt accompanying the occurrence of the usage permission grant period start event from the usage authority control device 60A to the application running on each satellite PE.

第1サテライトPEであるPEnには、使用権限制御装置60Aの備えるハードウェアタイマチャネルS41が関連付けられ、PEnおよびPEn上で動作するアプリケーションS40への共有リソース使用権限付与の開始/終了タイミングを制御する。マスタPE(PE0)についても同様に、ハードウェアタイマチャネルS41とは独立したハードウェアタイマチャネルS11が関連付けられ、PE0上で動作する共有リソース管理プログラムS10による共有制御処理の一部として、使用要求受け付けウィンドウ期間Wを計測する目的で、さらに望ましくは、使用権限を保持するサテライトPEに関連付けられたハードウェアタイマチャネルS41の状態および動作を複製(レプリケーション)したレプリカとして、利用する。PEn上で動作するアプリケーションS40は、1バンク構成の使用要求レジスタバンクS30内の要求フラグをセットし、共有リソース管理プログラムS10は、使用要求レジスタバンクS30に蓄積された共有リソース使用要求、および制御テーブルS20に設定された制御情報をそれぞれ参照/更新しながら、使用権限付与順序の決定と使用権限制御装置60Aの制御を行う。共有制御の開始に先立ち、制御テーブルS20は適切に設定されているものとする。 A hardware timer channel S41 included in the usage authority control device 60A is associated with the PEn which is the first satellite PE, and controls the start / end timing of granting the shared resource usage authority to the application S40 running on the Pen and the Pen. .. Similarly, for the master PE (PE0), a hardware timer channel S11 independent of the hardware timer channel S41 is associated with the master PE (PE0), and a usage request is accepted as a part of the shared control process by the shared resource management program S10 operating on the PE0. For the purpose of measuring the window period W, more preferably, it is used as a replica of the state and operation of the hardware timer channel S41 associated with the satellite PE holding the usage authority. The application S40 running on the Pen sets the request flag in the usage request register bank S30 of the one-bank configuration, and the shared resource management program S10 sets the shared resource usage request stored in the usage request register bank S30 and the control table. While referring / updating the control information set in S20, the order of granting usage authority is determined and the usage authority control device 60A is controlled. It is assumed that the control table S20 is appropriately set prior to the start of the shared control.

図12において、共有リソース管理プログラムS10が、図示しないハードウェアもしくはソフトウェア手段を用いて制御周期の開始タイミングを検出すると、以下の初期化処理S1001を順次実行する。 In FIG. 12, when the shared resource management program S10 detects the start timing of the control cycle by using hardware or software means (not shown), the following initialization process S1001 is sequentially executed.

(1)使用権限制御装置60Aが備える停止トリガレジスタ626への書き込みにより、全ハードウェアタイマチャネルS11、S41の同時停止を要求(T1001、T1002)する。停止要求を受けたPE0およびPEn用ハードウェアタイマチャネルS11、S41は、それぞれ停止状態(S1101、S4101)となる。 (1) Simultaneous stop of all hardware timer channels S11 and S41 is requested (T1001 and T1002) by writing to the stop trigger register 626 included in the usage authority control device 60A. The PE0 and the hardware timer channels S11 and S41 for PEn that have received the stop request are in the stopped state (S1101, S4101), respectively.

(2)使用要求レジスタバンクS30が備える共有リソース使用要求クリアレジスタ530への書き込みにより全PEの使用要求フラグをクリアし、さらに共有リソース使用要求セットレジスタ520-0への書き込みによりPE0の使用要求フラグをセットすることで、PE0の使用要求フラグのみ有効な状態(S3001)となるよう、共有リソース使用要求フラグレジスタ510の内容を更新(T1003)する。 (2) The usage request flag of all PEs is cleared by writing to the shared resource usage request clear register 530 provided in the usage request register bank S30, and the usage request flag of PE0 is cleared by writing to the shared resource usage request set register 520-0. By setting, the contents of the shared resource usage request flag register 510 are updated (T1003) so that only the usage request flag of PE0 is in a valid state (S3001).

(3)制御テーブルS20の全PEについて、使用権限付与中フラグ(IU)フィールド値をクリア(偽に設定)(T1004)し、制御周期内残り時間(RT)フィールド値は、制御周期内上限時間(PT)フィールド値からハードウェアタイマチャネルS11、S41内のカウントレジスタに設定可能な値に変換した値(以下換算値と呼ぶ)に更新(T1005)することで、制御周期開始時点での制御テーブルS20の初期状態(S2001)とする。 (3) For all PEs in the control table S20, the usage authority granting flag (IU) field value is cleared (set to false) (T1004), and the remaining time in the control cycle (RT) field value is the upper limit time in the control cycle. (PT) The control table at the start of the control cycle by updating (T1005) to the value converted from the field value to the value that can be set in the count register in the hardware timer channels S11 and S41 (hereinafter referred to as the converted value). The initial state of S20 (S2001) is used.

(4)各PEに関連付けられたハードウェアタイマチャネルS11、S41の初期カウント値レジスタ617に対し、制御テーブルS20の制御周期内残り時間(RT)フィールド値をそれぞれ設定(T1006、T1007)する。本時点では、PE0用ハードウェアタイマチャネルS11には、使用要求受け付けウィンドウ期間Wに相当する値が設定されている。 (4) The remaining time (RT) field value in the control cycle of the control table S20 is set (T1006, T1007) for the initial count value register 617 of the hardware timer channels S11 and S41 associated with each PE, respectively. At this point in time, a value corresponding to the usage request acceptance window period W is set in the hardware timer channel S11 for PE0.

(5)制御周期の先頭において、PE0に対する共有リソース使用権限付与の態様で使用要求受け付けウィンドウ期間Wを実現する目的で、PE0用ハードウェアタイマチャネルS11を動作させるため、PE0の使用権限付与中フラグ(IU)フィールド値をセット(真に設定)(T1008)し、制御テーブルS20の状態を、PE0が使用権限を保持している状態S2002に更新する。本処理は、PE0の基本優先度設定が最高であることと組み合わせることで、PE0とそれ以外のPEnに対する共有リソース使用権限付与に係る処理を共通化し、使用要求受け付けウィンドウ期間W以前にPE0以外のPEnに対して使用権限が付与されるのを抑止するために有効なオプション処理である。 (5) At the beginning of the control cycle, in order to operate the hardware timer channel S11 for PE0 for the purpose of realizing the usage request acceptance window period W in the mode of granting the permission to use the shared resource to PE0, the flag for granting the permission to use PE0. (IU) The field value is set (true set) (T1008), and the state of the control table S20 is updated to the state S2002 in which PE0 holds the usage authority. By combining this process with the highest basic priority setting of PE0, the process related to granting the authority to use shared resources to PE0 and other PENs is standardized, and other than PE0 before the usage request acceptance window period W. This is an effective optional process for suppressing the granting of usage authority to PEn.

(6)使用権限制御装置60Aが備える開始トリガレジスタ625への書き込みにより、PE0用ハードウェアタイマチャネルS11の起動を要求(T1009)する。起動要求を受けたハードウェアタイマチャネルS11は動作状態S1102へと遷移し、現カウント値レジスタ616にコピーされた初期カウント値レジスタ617の値を初期値として、所定の条件に基づくデクリメント動作を開始する。 (6) The activation of the hardware timer channel S11 for PE0 is requested (T1009) by writing to the start trigger register 625 included in the usage authority control device 60A. The hardware timer channel S11 that has received the start request transitions to the operation state S1102, and starts the decrement operation based on a predetermined condition with the value of the initial count value register 617 copied to the current count value register 616 as the initial value. ..

共有リソース管理プログラムS10と同様の手段により制御周期の開始タイミングを検出した、PEn上で動作するアプリケーションS40は、制御周期内に実行すべき処理に関する初期化等、所定の前処理を実行(S4001)する。実行すべき処理が共有リソース使用権限の付与を必要とする場合には、前処理の少なくとも一部として、使用要求受け付けウィンドウ期間W内、すなわちPE0用ハードウェアタイマチャネルS11のカウント動作中に、使用要求レジスタバンクS30内にあるPEn用共有リソース使用要求セットレジスタへの書き込みにより、PEnの使用要求フラグをセット(T4001)する。 The application S40 running on PEn, which has detected the start timing of the control cycle by the same means as the shared resource management program S10, executes predetermined preprocessing such as initialization of the processing to be executed within the control cycle (S4001). do. When the process to be executed requires the granting of the shared resource use authority, it is used within the usage request acceptance window period W, that is, during the counting operation of the hardware timer channel S11 for PE0, as at least a part of the preprocessing. The PEN usage request flag is set (T4001) by writing to the PEN shared resource usage request set register in the request register bank S30.

また、図示しないが、同じ使用要求受け付けウィンドウ期間W内に、PEnとは異なるサテライトPE(PEmとする)上で動作するアプリケーションも、同様の手順により、PEmの使用要求フラグをセットする。この結果、使用要求受け付けウィンドウ期間W終了の時点で、使用要求レジスタバンクS30には、PE0、PEnおよびPEmの使用要求フラグがセットされた状態S3002となる。 Further, although not shown, an application operating on a satellite PE (referred to as PEm) different from Pen within the same usage request acceptance window period W also sets the usage request flag of PEm by the same procedure. As a result, at the end of the usage request acceptance window period W, the usage request register bank S30 is in a state S3002 in which the usage request flags of PE0, Pen, and Pem are set.

第1の共有リソース使用権限付与制御フローとは異なり、前処理を完了したPEn上のアプリケーションS40は、PEnへの共有リソース使用権限の付与待ち処理の少なくとも一部として、PEn用ハードウェアタイマチャネルS41のチャネル状態レジスタ615をポーリングする必要はない。共有リソース管理プログラムS10によるハードウェアタイマチャネルS41の起動要求に応じて、使用権限制御装置60Aから使用権限付与期間開始イベントを要因とする割り込みが要求されるのを待てばよく、当該割り込み要求までの期間を別のタスク処理の実行に当ててもよい。 Unlike the first shared resource use permission grant control flow, the application S40 on the PEN that has completed the preprocessing is a hardware timer channel S41 for Pen as at least a part of the process of waiting for the grant of the shared resource use right to the Pen. There is no need to poll the channel status register 615 of. In response to the start request of the hardware timer channel S41 by the shared resource management program S10, it is sufficient to wait for an interrupt caused by the usage authority grant period start event from the usage authority control device 60A, until the interrupt request is made. The period may be devoted to the execution of another task process.

一方、カウント動作状態にあるPE0用ハードウェアタイマチャネルS11は、使用要求受け付けウィンドウ期間W、所定の時間経過ごとに現カウント値レジスタ616の内容をデクリメントする。現カウント値レジスタ616の内容が、事前に定義された下限値以下となったことを検出すると、使用権限制御装置60Aは、割り込み要求制御部630Aが備える割り込み要因レジスタ635Aにおいて、ハードウェアタイマチャネルS11からPE0に対する使用権限付与期間終了イベントの発生状態を保持するフィールド値を真にセットする。本制御フローでは、当該イベントを要因とする割り込みを許可に設定しているため、使用権限制御割り込み信号61により当該イベントを要因とする割り込みをPE0に要求(T1101)する。 On the other hand, the hardware timer channel S11 for PE0 in the counting operation state decrements the contents of the current count value register 616 every time the usage request acceptance window period W and a predetermined time elapse. When it is detected that the content of the current count value register 616 is equal to or less than the predetermined lower limit value, the usage authority control device 60A sets the hardware timer channel S11 in the interrupt factor register 635A included in the interrupt request control unit 630A. True sets the field value that holds the occurrence state of the usage authority grant period end event for PE0. In this control flow, since the interrupt caused by the event is set to allow, the use authority control interrupt signal 61 requests the PE0 for the interrupt caused by the event (T1101).

PE0用ハードウェアタイマチャネルS11による、使用権限付与期間終了イベントを要因とする割り込み要求T1001を検出した共有リソース管理プログラムS10は、使用要求受け付けウィンドウ期間Wの終了に係る一連の処理S1002を順次実行する。 The shared resource management program S10 that has detected the interrupt request T1001 caused by the usage permission grant period end event by the hardware timer channel S11 for PE0 sequentially executes a series of processes S1002 related to the end of the usage request acceptance window period W. ..

(1)使用権限制御装置60Aの割り込み要求制御部630Aが備える割り込み要因レジスタ635Aにおいて、PE0用ハードウェアタイマチャネルS11からPE0に対する使用権限付与期間終了イベントの発生状態を保持するフィールド値を偽にクリアし、さらに望ましくは、ハードウェアタイマチャネルS11がカウント動作状態を継続している場合には、停止トリガレジスタ626への書き込みにより、ハードウェアタイマチャネルS11の停止を要求する(T1010)。この結果、ハードウェアタイマチャネルS11はカウント停止状態S1103へ遷移する。 (1) In the interrupt factor register 635A provided in the interrupt request control unit 630A of the usage authority control device 60A, the field value for holding the occurrence state of the usage authority grant period end event for PE0 from the hardware timer channel S11 for PE0 is falsely cleared. Further, more preferably, when the hardware timer channel S11 continues the counting operation state, the hardware timer channel S11 is requested to be stopped by writing to the stop trigger register 626 (T1010). As a result, the hardware timer channel S11 transitions to the count stop state S1103.

(2)PE0に対する共有リソース使用権限付与の態様で実装した、使用要求受け付けウィンドウ期間W終了に伴い、PE0の使用権限付与中フラグ(IU)フィールド値をクリア(偽に設定)(T1011)し、制御テーブルS20の状態を、どのPE0、PEn、PEmも使用権限を保持していない状態S2003に更新する。なお、処理T1011は処理T1008と対になるものであり、処理T1008を省略した場合は、処理T1011も同様に省略してよい。 (2) With the end of the usage request acceptance window period W implemented in the mode of granting the shared resource usage authority to PE0, the PE0 usage authority granting flag (IU) field value is cleared (set to false) (T1011). The state of the control table S20 is updated to the state S2003 in which none of PE0, Pen, and Pem holds the usage authority. The process T1011 is paired with the process T1008, and when the process T1008 is omitted, the process T1011 may be omitted as well.

(3)続いて、PE0の制御周期内権限再付与(RG)フィールドの設定に応じ、PE0の制御周期内残り時間(RT)フィールド値を更新する。本制御フローでは、RGフィールドを無効(再付与禁止)に設定しており、その場合には、誤って再度PE0に対する使用権限付与が行われないよう、RTフィールド値を残り時間ゼロに相当する換算値に更新(T1012)する。 (3) Subsequently, the remaining time (RT) field value in the control cycle of PE0 is updated according to the setting of the authority reassignment (RG) field in the control cycle of PE0. In this control flow, the RG field is set to invalid (reassignment prohibited), and in that case, the RT field value is converted to zero remaining time so that the usage authority is not granted to PE0 again by mistake. Update to the value (T1012).

(4)PE0の制御周期内残り時間がゼロとなった場合、使用要求レジスタバンクS30が備える共有リソース使用要求クリアレジスタ530への書き込みにより、PE0の使用要求フラグをクリア(T1013)する。この結果、使用要求レジスタバンクS30は、PEnおよびPEmの使用要求フラグがセットされた状態S3003となる。 (4) When the remaining time in the control cycle of PE0 becomes zero, the usage request flag of PE0 is cleared (T1013) by writing to the shared resource usage request clear register 530 provided in the usage request register bank S30. As a result, the usage request register bank S30 is in the state S3003 in which the usage request flags of Pen and Pem are set.

共有リソース管理プログラムS10は、続いて、図13に示すように、使用要求レジスタバンクS30の備える共有リソース使用要求フラグレジスタ510を読み出し(T1014)、使用要求受け付けウィンドウ期間Wに蓄積された共有リソース使用要求の有無をチェック(S1003)する。1以上の使用要求があった場合には、図22に示すフローに基づき、共有リソース使用権限の付与順序を一括して決定(S1004)し、制御テーブルS20のうち、少なくとも共有リソース30の使用を要求した全PEについて、決定した付与順序を特定する値を制御周期内権限付与順序(OR)フィールドに設定する(T1015)。さらに望ましくは、共有リソース30の使用要求なし、制御テーブルS20内の制御ポリシ設定が無効などの所定の理由により、現制御周期における共有リソース使用権限付与の対象外となったPEについては、付与対象外であることを示す所定の値を、当該PEのORフィールドに設定してよい。 Subsequently, as shown in FIG. 13, the shared resource management program S10 reads out the shared resource usage request flag register 510 included in the usage request register bank S30 (T1014), and uses the shared resources accumulated in the usage request acceptance window period W. Check for the presence or absence of a request (S1003). When there is one or more usage requests, the order of granting the shared resource usage authority is collectively determined (S1004) based on the flow shown in FIG. 22, and at least the shared resource 30 of the control table S20 is used. For all the requested PEs, a value specifying the determined grant order is set in the authority grant order (OR) field within the control cycle (T1015). More preferably, PEs that are not subject to the grant of the shared resource use authority in the current control cycle due to a predetermined reason such as no request to use the shared resource 30 or invalidation of the control policy setting in the control table S20 are subject to grant. A predetermined value indicating that it is outside may be set in the OR field of the PE.

以降、共有リソース管理プログラムS10は、処理S1004で決定した共有リソース使用権限の付与順序にしたがい、付与対象とするサテライトPEに対し共有リソース30の使用権限を付与する。具体的な手順は以下のとおりである。 After that, the shared resource management program S10 grants the usage authority of the shared resource 30 to the satellite PE to be granted according to the order of granting the shared resource usage authority determined in the process S1004. The specific procedure is as follows.

(1)制御テーブルS20の制御周期内権限付与順序(OR)フィールドを参照し、次(または最初)に使用権限を付与すべきサテライトPEを特定(S1005)する。特定したPE(PEnとする)の使用権限付与中フラグ(IU)フィールド値をセット(真に設定)(T1016)し、制御テーブルS20の状態を、PEnが使用権限を保持している状態S2004に更新する。 (1) With reference to the authority granting order (OR) field within the control cycle of the control table S20, the satellite PE to which the usage authority should be granted next (or first) is specified (S1005). The flag (IU) field value for granting the usage authority of the specified PE (referred to as PEn) is set (true set) (T1016), and the state of the control table S20 is changed to the state S2004 in which the PEN holds the usage authority. Update.

(2)PE0用ハードウェアタイマチャネルS11を、次の使用権限付与先であるPEn用ハードウェアタイマチャネルS41のレプリカとして動作させるため、制御テーブルS20の設定のうち、PEnの制御周期内残り時間(RT)フィールド値を、チャネルS11の初期カウント値レジスタ617に設定(T1017)する。 (2) In order to operate the hardware timer channel S11 for PE0 as a replica of the hardware timer channel S41 for Pen to which the next usage authority is granted, the remaining time in the control cycle of PEn in the setting of the control table S20 (2) The RT) field value is set in the initial count value register 617 of the channel S11 (T1017).

(3)使用権限制御装置60Aが備える開始トリガレジスタ625への書き込みにより、PE0およびPEn用ハードウェアタイマチャネルS11、S41の同時起動を要求(T1018、T1019)する。起動要求を受けたハードウェアタイマチャネルS11、S41はそれぞれ動作状態(S1104、S4102)に遷移し、いずれも当該ハードウェアタイマチャネルS11、S41の現カウント値レジスタ616にコピーされた初期カウント値レジスタ617の値を初期値として、所定の条件に基づくデクリメント動作を開始する。ここで、ハードウェアタイマチャネルS41がカウント動作状態であることと、共有リソース使用権限をPEnに対し付与中であることは等価であり、2つのハードウェアタイマチャネルS11、S41は同期してデクリメント動作を行う。 (3) By writing to the start trigger register 625 included in the usage authority control device 60A, simultaneous activation of PE0 and PEn hardware timer channels S11 and S41 is requested (T1018, T1019). The hardware timer channels S11 and S41 that received the start request transition to the operating states (S1104 and S4102), respectively, and both of them are the initial count value registers 617 copied to the current count value registers 616 of the hardware timer channels S11 and S41. The decrement operation based on a predetermined condition is started with the value of. Here, it is equivalent that the hardware timer channel S41 is in the counting operation state and the shared resource use authority is being granted to the PEN, and the two hardware timer channels S11 and S41 are synchronously decrementing. I do.

共有リソース管理プログラムS10から、PEn用ハードウェアタイマチャネルS41に対する起動要求T1018を受けると、使用権限制御装置60Aの割り込み要求制御部630Aが備える割り込み要因レジスタ635Aにおいて、ハードウェアタイマチャネルS11からPE0に対する使用権限付与期間開始イベント、およびハードウェアタイマチャネルS41からPEnに対する使用権限付与期間開始イベントの発生状態を保持するフィールド値がそれぞれ真にセットされる。本制御フローでは後者のイベントを要因とする割り込みのみ許可に設定しているため、ハードウェアタイマチャネルS41は、当該イベントを要因として使用権限付与期間の開始を通知する割り込みを、使用権限割り込み信号を経由し、PEnに対し要求(T4121)する。 When the start request T1018 for the hardware timer channel S41 for Pen is received from the shared resource management program S10, the hardware timer channel S11 is used for PE0 in the interrupt factor register 635A provided in the interrupt request control unit 630A of the usage authority control device 60A. The field values that hold the occurrence status of the authorization period start event and the usage authorization period start event for PEn from the hardware timer channel S41 are set to true. In this control flow, only the interrupt caused by the latter event is set to be permitted, so that the hardware timer channel S41 sends an interrupt notifying the start of the usage authority granting period due to the event, and a usage authority interrupt signal. Request (T4121) to PEn via.

PEn用ハードウェアタイマチャネルS41による、使用権限付与期間開始イベントを要因とする割り込み要求T4121を検出したアプリケーションS40は、使用権限付与期間開始に係る処理S4021を実行する。すなわち、使用権限制御装置60Aの割り込み要求制御部630Aが備える割り込み要因レジスタ635Aにおいて、PEn用ハードウェアタイマチャネルS41からPEnに対する使用権限付与期間開始イベントの発生状態を保持するフィールド値を偽にクリア(T4021)し、続いて、共有リソース30の使用を伴う処理S4003を実行する。第1の制御フローと同様、アプリケーションS40は、ハードウェアタイマチャネルS41がカウント動作状態の期間、共有リソース30を占有して使用可能である一方、使用権限の付与終了タイミングを通知する権限付与期間終了イベント発生を要因とする割り込み要求が発生するまでには、処理S4003を終了しなければならないものとする。 The application S40 that has detected the interrupt request T4121 caused by the usage permission grant period start event by the hardware timer channel S41 for Pen executes the process S4021 related to the start of the usage permission grant period. That is, in the interrupt factor register 635A provided in the interrupt request control unit 630A of the usage authority control device 60A, the field value for holding the occurrence state of the usage authority grant period start event for the PEN from the hardware timer channel S41 for Pen is falsely cleared ( T4021), and subsequently, the process S4003 accompanied by the use of the shared resource 30 is executed. Similar to the first control flow, the application S40 can be used by occupying the shared resource 30 during the period in which the hardware timer channel S41 is in the counting operation state, while the permission granting period for notifying the timing of the granting end of the usage permission ends. It is assumed that the process S4003 must be terminated before the interrupt request caused by the occurrence of the event is generated.

PE0およびPEn用ハードウェアタイマチャネルS11、S41が同時起動要求(T1018、T1019)によりカウント動作状態に遷移した後、各ハードウェアタイマチャネルS11、S41の初期カウント値レジスタ617に設定された時間、すなわち制御テーブルS20内のPEnに割り当て可能な制御周期内残り時間(RT)フィールドに指定された時間が経過すると、使用権限制御装置60Aの割り込み要求制御部630Aが備える割り込み要因レジスタ635Aにおいて、ハードウェアタイマチャネルS11からPE0に対する使用権限付与期間終了イベント、およびハードウェアタイマチャネルS41からPEnに対する使用権限付与期間終了イベントの発生状態を保持するフィールド値がそれぞれ真にセットされる。本制御フローでは、当該イベントを要因とする割り込みを許可に設定しているため、図14に示すように、ハードウェアタイマチャネルS11、S41は、当該イベントを要因とし使用権限付与期間の終了を通知する割り込みを、使用権限割り込み信号を経由し、それぞれPE0(T1102)、PEn(T4101)に対し同時に要求する。 After the hardware timer channels S11 and S41 for PE0 and PEn transition to the count operation state by the simultaneous start request (T1018, T1019), the time set in the initial count value register 617 of each hardware timer channel S11, S41, that is, When the time specified in the remaining time (RT) field in the control cycle that can be assigned to PEn in the control table S20 elapses, the hardware timer is set in the interrupt factor register 635A provided in the interrupt request control unit 630A of the usage authority control device 60A. The field values that hold the occurrence status of the usage authority granting period end event from the channel S11 to PE0 and the usage authority granting period end event from the hardware timer channel S41 to PEn are set to true. In this control flow, since the interrupt caused by the event is set to allow, the hardware timer channels S11 and S41 notify the end of the usage authority granting period due to the event as shown in FIG. The interrupt to be executed is simultaneously requested to PE0 (T1102) and PEn (T4101), respectively, via the usage authority interrupt signal.

PEn用ハードウェアタイマチャネルS41による、使用権限付与期間終了イベントを要因とする割り込み要求を検出したアプリケーションS40は、使用権限付与期間終了に係る処理S4004を実行する。 The application S40 that has detected an interrupt request caused by the usage authority grant period end event by the hardware timer channel S41 for Pen executes the process S4004 related to the end of the usage permission grant period.

(1)使用権限制御装置60Aの割り込み要求制御部630Aが備える割り込み要因レジスタ635Aにおいて、PEnを対象とする全イベントの発生を保持するフィールド値を偽にクリアし、さらに望ましくは、ハードウェアタイマチャネルS41がカウント動作状態を継続している場合には、停止トリガレジスタ626への書き込みにより、ハードウェアタイマチャネルS41の停止を要求する(T4005)。この結果、ハードウェアタイマチャネルS41はカウント停止状態S4103へ遷移する。 (1) In the interrupt factor register 635A provided in the interrupt request control unit 630A of the usage authority control device 60A, the field value for holding the occurrence of all events targeting PEn is falsely cleared, and more preferably, the hardware timer channel. When S41 continues the counting operation state, the hardware timer channel S41 is requested to be stopped by writing to the stop trigger register 626 (T4005). As a result, the hardware timer channel S41 transitions to the count stop state S4103.

(2)必要に応じて、アプリケーションS40は割り込みからの回復処理、共有リソース使用権限が不要かつ当該制御周期内に実行すべき処理など、所定の後処理S4005を実行する。 (2) If necessary, the application S40 executes predetermined post-processing S4005, such as recovery processing from an interrupt, processing that does not require shared resource use authority and should be executed within the control cycle.

PE0用ハードウェアタイマチャネルS11による、使用権限付与期間終了イベントを要因とする割り込み要求を検出した共有リソース管理プログラムS10は、使用権限付与期間終了に係る処理S1006として、以下の処理を順次実行する。 The shared resource management program S10 that has detected an interrupt request caused by the usage authority grant period end event by the hardware timer channel S11 for PE0 sequentially executes the following processes as the process S1006 related to the end of the usage permission grant period.

(1)使用権限制御装置60Aの割り込み要求制御部630Aが備える割り込み要因レジスタ635Aにおいて、PE0を対象とする全イベントの発生状態を保持するフィールド値を偽にクリアし、さらに望ましくは、ハードウェアタイマチャネルS11がカウント動作状態を継続している場合には、停止トリガレジスタ626への書き込みにより、ハードウェアタイマチャネルS11の停止を要求する(T1020)。この結果、ハードウェアタイマチャネルS11はカウント停止状態S1105へ遷移する。 (1) In the interrupt factor register 635A provided in the interrupt request control unit 630A of the usage authority control device 60A, the field value holding the occurrence state of all events targeting PE0 is falsely cleared, and more preferably, the hardware timer. When the channel S11 continues the counting operation state, the hardware timer channel S11 is requested to be stopped by writing to the stop trigger register 626 (T1020). As a result, the hardware timer channel S11 transitions to the count stop state S1105.

(2)安全対応のオプション処理として、割り込み要因レジスタ635AにおいてPEnを対象とする全イベントの発生状態を保持するフィールド値を偽にクリアするとともに、停止トリガレジスタ626への書き込みにより、PEn用ハードウェアタイマチャネルS41の停止を要求する(T1021)。 (2) As an optional process for safety, the field value that holds the occurrence status of all events targeting PEn in the interrupt factor register 635A is falsely cleared, and the hardware for Pen is written by writing to the stop trigger register 626. Request the stop of the timer channel S41 (T1021).

(3)制御テーブルS20に関しては、PEnの使用権限付与中フラグ(IU)フィールド値をクリア(偽に設定)(T1022)し、どのPE0、PEn、PEmも使用権限を保持していない状態S2005に更新する。 (3) Regarding the control table S20, the flag (IU) field value for which the usage authority of Pen is granted is cleared (set to false) (T1022), and none of PE0, Pen, and Pem holds the usage authority in S2005. Update.

(4)続いて、PEnの制御周期内権限再付与(RG)フィールドの設定に応じ、PEnの制御周期内残り時間(RT)フィールド値を更新する。本制御フローでは、RGフィールドを無効(再付与禁止)に設定しており、その場合には、誤って再度PEnに対する使用権限付与が行われないよう、RTフィールド値を残り時間ゼロに相当する換算値に更新(T1023)する。 (4) Subsequently, the remaining time (RT) field value in the control cycle of the PEN is updated according to the setting of the authority reassignment (RG) field in the control cycle of the PEN. In this control flow, the RG field is set to invalid (reassignment prohibited), and in that case, the RT field value is converted to zero remaining time so that the usage authority is not granted to PEn again by mistake. Update to the value (T1023).

(5)PEnの制御周期内残り時間がゼロとなった場合、使用要求レジスタバンクS30が備える共有リソース使用要求クリアレジスタ530への書き込みにより、PEnの使用要求フラグをクリア(T1024)する。この結果、使用要求レジスタバンクS30は、PEmの使用要求フラグがセットされた状態S3004となる。 (5) When the remaining time in the control cycle of PEn becomes zero, the usage request flag of Pen is cleared (T1024) by writing to the shared resource usage request clear register 530 provided in the usage request register bank S30. As a result, the usage request register bank S30 is in the state S3004 in which the usage request flag of PEm is set.

共有リソース管理プログラムS10は、続いて、PEnの次に使用権限の付与先となるPEの特定と、特定したPEに対する共有リソース30の権限付与に係る一連の処理S1007を実行する。具体的な手順は以下のとおりである。 The shared resource management program S10 subsequently executes a series of processes S1007 relating to the identification of the PE to which the usage authority is granted next to the PEn and the authorization of the shared resource 30 to the identified PE. The specific procedure is as follows.

(1)制御テーブルS20の制御周期内権限付与順序(OR)フィールドを参照し、次に使用権限を付与すべきサテライトPEを特定する。特定したPE(PEmとする)の使用権限付与中フラグ(IU)フィールド値をセット(真に設定)(T1025)し、制御テーブルS20の状態を、PEmが使用権限を保持している状態S2006に更新する。 (1) With reference to the authority granting order (OR) field within the control cycle of the control table S20, the satellite PE to which the usage authority should be granted is specified next. Set (true set) (T1025) the flag (IU) field value for granting the usage authority of the specified PE (referred to as PEm), and change the state of the control table S20 to the state S2006 in which the PEm holds the usage authority. Update.

(2)PE0用ハードウェアタイマチャネルS11を、次の使用権限付与先であるPEm用ハードウェアタイマチャネル(図示せず)のレプリカとして動作させるため、制御テーブルS20の設定のうち、PEmの制御周期内残り時間(RT)フィールド値を、チャネルS11の初期カウント値レジスタ617に設定(T1026)する。 (2) In order to operate the hardware timer channel S11 for PE0 as a replica of the hardware timer channel (not shown) for PEm to which the next usage authority is granted, the control cycle of PEm among the settings of the control table S20 The remaining time (RT) field value is set in the initial count value register 617 of the channel S11 (T1026).

(3)使用権限制御装置60Aが備える開始トリガレジスタ625への書き込みにより、PE0用ハードウェアタイマチャネルS11とPEm用ハードウェアタイマチャネル(図示せず)の同時起動を要求(T1027、T1028)する。起動要求を受けたハードウェアタイマチャネルS11は動作状態(S1106)に遷移し、当該ハードウェアタイマチャネルS11の現カウント値レジスタ616にコピーされた初期カウント値レジスタ617の値を初期値として、所定の条件に基づくデクリメント動作を開始する。図示しないPEm用ハードウェアタイマチャネルも、同様の手順によりデクリメント動作を開始し、共有リソース使用権限をPEmに対し付与中であることを示すカウント動作状態となる。 (3) By writing to the start trigger register 625 included in the usage authority control device 60A, simultaneous activation of the hardware timer channel S11 for PE0 and the hardware timer channel for PEm (not shown) is requested (T1027, T1028). The hardware timer channel S11 that has received the start request transitions to the operating state (S1106), and a predetermined value is set as the initial value of the initial count value register 617 copied to the current count value register 616 of the hardware timer channel S11. Start the condition-based decrement operation. The hardware timer channel for PEm (not shown) also starts the decrement operation by the same procedure, and becomes a count operation state indicating that the shared resource use authority is being granted to the PEm.

第1の制御フローと比較し、本制御フローによれば、サテライトPEに対する共有リソース使用権限付与状態を取得するためのポーリング処理が不要となり、特に複数タスクの同時実行をサポートするサテライトPEにおける、CPUコア等の計算リソースの利用効率を向上させることができる。 Compared with the first control flow, according to this control flow, the polling process for acquiring the shared resource use authority grant status to the satellite PE becomes unnecessary, and the CPU in the satellite PE that supports the simultaneous execution of a plurality of tasks in particular. It is possible to improve the utilization efficiency of computational resources such as cores.

<第3の共有リソース使用権限付与制御フロー>
図15~図18は、第3実施形態に係るマイコンの共有リソース使用権限付与の動作を示すフローチャートである。
第3の共有リソース使用権限付与制御フローでは、第2の共有リソース使用権限付与制御フローの例示に対し、さらに(3)および(6)の条件が異なる。
<Third shared resource usage permission grant control flow>
15 to 18 are flowcharts showing the operation of granting the authority to use the shared resource of the microcomputer according to the third embodiment.
In the third shared resource use authority grant control flow, the conditions (3) and (6) are further different from the example of the second shared resource use authority grant control flow.

(3)制御テーブル140の設定に関し、マスタPE(PE0)の基本優先度(PR)フィールドをゼロ(優先度最高)、制御周期内上限時間(PT)フィールドを使用要求受け付けウィンドウ期間Wに換算可能な値に設定し、さらに、少なくとも1つのサテライトPE(PEnとする)の制御周期内権限再付与(RG)フィールドを有効に、PEnを除くサテライトPEとマスタPE(PE0)についてはRGフィールドを無効に、それぞれ設定する。 (3) Regarding the setting of the control table 140, the basic priority (PR) field of the master PE (PE0) can be converted to zero (highest priority), and the upper limit time (PT) field within the control cycle can be converted to the usage request acceptance window period W. In addition, enable the reauthorization (RG) field within the control cycle of at least one satellite PE (referred to as PEN), and disable the RG field for satellite PE and master PE (PE0) excluding PEN. To each.

(6)使用権限の付与終了タイミングを通知する、使用権限制御装置60Aから使用権限付与期間終了イベント発生に伴う割り込み要求の検出に代えて、アプリケーションS40が共有リソース30の使用を伴う処理を完了した時点で、アプリケーションS40から共有リソース管理プログラムS10に対し、PE間割り込み制御装置70を介したPE間割り込み要求により使用権限の返却を主体的に通知する。 (6) Instead of detecting the interrupt request due to the occurrence of the usage authority grant period end event from the usage authority control device 60A that notifies the usage authority grant end timing, the application S40 has completed the process involving the use of the shared resource 30. At this point, the application S40 proactively notifies the shared resource management program S10 of the return of the usage authority by the PE-to-PE interrupt request via the PE-to-PE interrupt control device 70.

第1サテライトPEであるPEnには、使用権限制御装置60Aの備えるハードウェアタイマチャネルS41が関連付けられ、PEnおよびPEn上で動作するアプリケーションS40への共有リソース使用権限付与の開始/終了タイミングを制御する。マスタPE(PE0)についても同様に、ハードウェアタイマチャネルS41とは独立したハードウェアタイマチャネルS11が関連付けられ、PE0上で動作する共有リソース管理プログラムS10による共有制御処理の一部として、使用要求受け付けウィンドウ期間Wを計測する目的で、さらに望ましくは、使用権限を保持するサテライトPEに関連付けられたハードウェアタイマチャネルS41の状態および動作を複製(レプリケーション)したレプリカとして、利用する。PEn上で動作するアプリケーションS40は、1バンク構成の使用要求レジスタバンクS30内の要求フラグをセットし、共有リソース管理プログラムS10は、使用要求レジスタバンクS30に蓄積された共有リソース使用要求、および制御テーブルS20に設定された制御情報をそれぞれ参照/更新しながら、使用権限付与順序の決定と使用権限制御装置60Aの制御を行う。本制御フローでは、さらに、少なくともアプリケーションS40から共有リソース管理プログラムS10に対し、主体的な共有リソース使用権限の返却を通知する手段として、PE間割り込み制御装置70を介したPE間割り込み要求を利用する。共有制御の開始に先立ち、制御テーブルS20は適切に設定されているものとする。 A hardware timer channel S41 included in the usage authority control device 60A is associated with the PEn which is the first satellite PE, and controls the start / end timing of granting the shared resource usage authority to the application S40 running on the Pen and the Pen. .. Similarly, for the master PE (PE0), a hardware timer channel S11 independent of the hardware timer channel S41 is associated with the master PE (PE0), and a usage request is accepted as a part of the shared control process by the shared resource management program S10 operating on the PE0. For the purpose of measuring the window period W, more preferably, it is used as a replica of the state and operation of the hardware timer channel S41 associated with the satellite PE holding the usage authority. The application S40 running on the Pen sets the request flag in the usage request register bank S30 of the one-bank configuration, and the shared resource management program S10 sets the shared resource usage request stored in the usage request register bank S30 and the control table. While referring / updating the control information set in S20, the order of granting usage authority is determined and the usage authority control device 60A is controlled. In this control flow, at least the PE-to-PE interrupt request via the PE-to-PE interrupt control device 70 is used as a means for notifying the shared resource management program S10 of the return of the independent shared resource use authority from the application S40. .. It is assumed that the control table S20 is appropriately set prior to the start of the shared control.

図15において、共有リソース管理プログラムS10が、図示しないハードウェアもしくはソフトウェア手段を用いて制御周期の開始タイミングを検出すると、以下の初期化処理S1001を順次実行する。 In FIG. 15, when the shared resource management program S10 detects the start timing of the control cycle by using hardware or software means (not shown), the following initialization process S1001 is sequentially executed.

(1)使用権限制御装置60Aが備える停止トリガレジスタ626への書き込みにより、全ハードウェアタイマチャネルS11、S41の同時停止を要求(T1001、T1002)する。停止要求を受けたPE0およびPEn用ハードウェアタイマチャネルS11、S41は、それぞれ停止状態(S1101、S4101)となる。 (1) Simultaneous stop of all hardware timer channels S11 and S41 is requested (T1001 and T1002) by writing to the stop trigger register 626 included in the usage authority control device 60A. The PE0 and the hardware timer channels S11 and S41 for PEn that have received the stop request are in the stopped state (S1101, S4101), respectively.

(2)使用要求レジスタバンクS30が備える共有リソース使用要求クリアレジスタ530への書き込みにより全PEの使用要求フラグをクリアし、さらに共有リソース使用要求セットレジスタ520-0への書き込みによりPE0の使用要求フラグをセットすることで、PE0の使用要求フラグのみ有効な状態(S3001)となるよう、共有リソース使用要求フラグレジスタ510の内容を更新(T1003)する。 (2) The usage request flag of all PEs is cleared by writing to the shared resource usage request clear register 530 provided in the usage request register bank S30, and the usage request flag of PE0 is cleared by writing to the shared resource usage request set register 520-0. By setting, the contents of the shared resource usage request flag register 510 are updated (T1003) so that only the usage request flag of PE0 is in a valid state (S3001).

(3)制御テーブルS20の全PEについて、使用権限付与中フラグ(IU)フィールド値をクリア(偽に設定)(T1004)し、制御周期内残り時間(RT)フィールド値は、制御周期内上限時間(PT)フィールド値からハードウェアタイマチャネルS11、S41内のカウントレジスタに設定可能な値に変換した値(以下換算値と呼ぶ)に更新(T1005)することで、制御周期開始時点での制御テーブルS20の初期状態(S2001)とする。 (3) For all PEs in the control table S20, the usage authority granting flag (IU) field value is cleared (set to false) (T1004), and the remaining time in the control cycle (RT) field value is the upper limit time in the control cycle. (PT) The control table at the start of the control cycle by updating (T1005) to the value converted from the field value to the value that can be set in the count register in the hardware timer channels S11 and S41 (hereinafter referred to as the converted value). The initial state of S20 (S2001) is used.

(4)各PEに関連付けられたハードウェアタイマチャネルS11、S41の初期カウント値レジスタ617に対し、制御テーブルS20の制御周期内残り時間(RT)フィールド値をそれぞれ設定(T1006、T1007)する。本時点では、PE0用ハードウェアタイマチャネルS11には、使用要求受け付けウィンドウ期間Wに相当する値が設定されている。 (4) The remaining time (RT) field value in the control cycle of the control table S20 is set (T1006, T1007) for the initial count value register 617 of the hardware timer channels S11 and S41 associated with each PE, respectively. At this point in time, a value corresponding to the usage request acceptance window period W is set in the hardware timer channel S11 for PE0.

(5)制御周期の先頭において、PE0に対する共有リソース使用権限付与の態様で使用要求受け付けウィンドウ期間Wを実現する目的で、PE0用ハードウェアタイマチャネルS11を動作させるため、PE0の使用権限付与中フラグ(IU)フィールド値をセット(真に設定)(T1008)し、制御テーブルS20の状態を、PE0が使用権限を保持している状態S2002に更新する。本処理は、PE0の基本優先度設定が最高であることと組み合わせることで、PE0とそれ以外のPEnに対する共有リソース使用権限付与に係る処理を共通化し、使用要求受け付けウィンドウ期間W以前にPE0以外のPEnに対して使用権限が付与されるのを抑止するために有効なオプション処理である。 (5) At the beginning of the control cycle, in order to operate the hardware timer channel S11 for PE0 for the purpose of realizing the usage request acceptance window period W in the mode of granting the permission to use the shared resource to PE0, the flag for granting the permission to use PE0. (IU) The field value is set (true set) (T1008), and the state of the control table S20 is updated to the state S2002 in which PE0 holds the usage authority. By combining this process with the highest basic priority setting of PE0, the process related to granting the authority to use shared resources to PE0 and other PENs is standardized, and other than PE0 before the usage request acceptance window period W. This is an effective optional process for suppressing the granting of usage authority to PEn.

(6)使用権限制御装置60Aが備える開始トリガレジスタ625への書き込みにより、PE0用ハードウェアタイマチャネルS11の起動を要求(T1009)する。起動要求を受けたハードウェアタイマチャネルS11は動作状態S1102へと遷移し、現カウント値レジスタ616にコピーされた初期カウント値レジスタ617の値を初期値として、所定の条件に基づくデクリメント動作を開始する。 (6) The activation of the hardware timer channel S11 for PE0 is requested (T1009) by writing to the start trigger register 625 included in the usage authority control device 60A. The hardware timer channel S11 that has received the start request transitions to the operation state S1102, and starts the decrement operation based on a predetermined condition with the value of the initial count value register 617 copied to the current count value register 616 as the initial value. ..

共有リソース管理プログラムS10と同様の手段により制御周期の開始タイミングを検出した、PEn上で動作するアプリケーションS40は、制御周期内に実行すべき処理に関する初期化等、所定の前処理を実行(S4001)する。実行すべき処理が共有リソース使用権限の付与を必要とする場合には、前処理の少なくとも一部として、使用要求受け付けウィンドウ期間W内、すなわちPE0用ハードウェアタイマチャネルS11のカウント動作中に、使用要求レジスタバンクS30内にあるPEn用共有リソース使用要求セットレジスタへの書き込みにより、PEnの使用要求フラグをセット(T4001)する。 The application S40 running on PEn, which has detected the start timing of the control cycle by the same means as the shared resource management program S10, executes predetermined preprocessing such as initialization of the processing to be executed within the control cycle (S4001). do. When the process to be executed requires the granting of the shared resource use authority, it is used within the usage request acceptance window period W, that is, during the counting operation of the hardware timer channel S11 for PE0, as at least a part of the preprocessing. The PEN usage request flag is set (T4001) by writing to the PEN shared resource usage request set register in the request register bank S30.

また、図示しないが、同じ使用要求受け付けウィンドウ期間W内に、PEnとは異なるサテライトPE(PEmとする)上で動作するアプリケーションも、同様の手順により、PEmの使用要求フラグをセットするものとする。この結果、使用要求受け付けウィンドウ期間W終了の時点で、使用要求レジスタバンクS30には、PE0、PEnおよびPEmの使用要求フラグがセットされた状態S3002となる。 Further, although not shown, an application running on a satellite PE (referred to as PEm) different from Pen within the same usage request acceptance window period W shall also set the usage request flag of PEm by the same procedure. .. As a result, at the end of the usage request acceptance window period W, the usage request register bank S30 is in a state S3002 in which the usage request flags of PE0, Pen, and Pem are set.

第2の共有リソース使用権限付与制御フローと同様、前処理を完了したPEn上のアプリケーションS40は、PEnへの共有リソース使用権限の付与待ち処理の少なくとも一部として、PEn用ハードウェアタイマチャネルS41のチャネル状態レジスタ615をポーリングする必要はない。共有リソース管理プログラムS10によるハードウェアタイマチャネルS41の起動要求に応じて、使用権限制御装置60Aから使用権限付与期間開始イベントを要因とする割り込みが要求されるのを待てばよく、当該割り込み要求までの期間を別のタスク処理の実行に当ててもよい。 Similar to the second shared resource use permission grant control flow, the application S40 on the PEN that has completed the preprocessing is the hardware timer channel S41 for Pen as at least a part of the process of waiting for the grant of the shared resource use permission to the Pen. There is no need to poll the channel state register 615. In response to the start request of the hardware timer channel S41 by the shared resource management program S10, it is sufficient to wait for an interrupt caused by the usage authority grant period start event from the usage authority control device 60A, until the interrupt request is made. The period may be devoted to the execution of another task process.

一方、カウント動作状態にあるPE0用ハードウェアタイマチャネルS11は、使用要求受け付けウィンドウ期間W、所定の時間経過ごとに現カウント値レジスタ616の内容をデクリメントする。現カウント値レジスタ616の内容が、事前に定義された下限値以下となったことを検出すると、使用権限制御装置60Aは、割り込み要求制御部630Aが備える割り込み要因レジスタ635Aにおいて、ハードウェアタイマチャネルS11からPE0に対する使用権限付与期間終了イベントの発生状態を保持するフィールド値を真にセットする。本制御フローでは、当該イベントを要因とする割り込みを許可に設定しているため、使用権限制御割り込み信号61により当該イベントを要因とする割り込みをPE0に要求(T1101)する。 On the other hand, the hardware timer channel S11 for PE0 in the counting operation state decrements the contents of the current count value register 616 every time the usage request acceptance window period W and a predetermined time elapse. When it is detected that the content of the current count value register 616 is equal to or less than the predetermined lower limit value, the usage authority control device 60A sets the hardware timer channel S11 in the interrupt factor register 635A included in the interrupt request control unit 630A. True sets the field value that holds the occurrence state of the usage authority grant period end event for PE0. In this control flow, since the interrupt caused by the event is set to allow, the use authority control interrupt signal 61 requests the PE0 for the interrupt caused by the event (T1101).

PE0用ハードウェアタイマチャネルS11による、使用権限付与期間終了イベントを要因とする割り込み要求T1101を検出した共有リソース管理プログラムS10は、使用要求受け付けウィンドウ期間の終了に係る一連の処理S1002を順次実行する。 The shared resource management program S10 that has detected the interrupt request T1101 caused by the usage permission grant period end event by the hardware timer channel S11 for PE0 sequentially executes a series of processes S1002 related to the end of the usage request acceptance window period.

(1)使用権限制御装置60Aの割り込み要求制御部630Aが備える割り込み要因レジスタ635Aにおいて、PE0用ハードウェアタイマチャネルS11からPE0に対する使用権限付与期間終了イベントの発生状態を保持するフィールド値を偽にクリアし、さらに望ましくは、ハードウェアタイマチャネルS11がカウント動作状態を継続している場合には、停止トリガレジスタ626への書き込みにより、ハードウェアタイマチャネルS11の停止を要求する(T1010)。この結果、ハードウェアタイマチャネルS11はカウント停止状態S1103へ遷移する。 (1) In the interrupt factor register 635A provided in the interrupt request control unit 630A of the usage authority control device 60A, the field value for holding the occurrence state of the usage authority grant period end event for PE0 from the hardware timer channel S11 for PE0 is falsely cleared. Further, more preferably, when the hardware timer channel S11 continues the counting operation state, the hardware timer channel S11 is requested to be stopped by writing to the stop trigger register 626 (T1010). As a result, the hardware timer channel S11 transitions to the count stop state S1103.

(2)PE0に対する共有リソース使用権限付与の態様で実装した、使用要求受け付けウィンドウ期間W終了に伴い、PE0の使用権限付与中フラグ(IU)フィールド値をクリア(偽に設定)(T1011)し、制御テーブルS20の状態を、どのPE0、PEn、PEmも使用権限を保持していない状態S2003に更新する。なお、処理T1011は処理T1008と対になるものであり、処理T1008を省略した場合は、処理T1011も同様に省略してよい。 (2) With the end of the usage request acceptance window period W implemented in the mode of granting the shared resource usage authority to PE0, the PE0 usage authority granting flag (IU) field value is cleared (set to false) (T1011). The state of the control table S20 is updated to the state S2003 in which none of PE0, Pen, and Pem holds the usage authority. The process T1011 is paired with the process T1008, and when the process T1008 is omitted, the process T1011 may be omitted as well.

(3)続いて、PE0の制御周期内権限再付与(RG)フィールドの設定に応じ、PE0の制御周期内残り時間(RT)フィールド値を更新する。本制御フローでは、RGフィールドを無効(再付与禁止)に設定しており、その場合には、誤って再度PE0に対する使用権限付与が行われないよう、RTフィールド値を残り時間ゼロに相当する換算値に更新(T1012)する。 (3) Subsequently, the remaining time (RT) field value in the control cycle of PE0 is updated according to the setting of the authority reassignment (RG) field in the control cycle of PE0. In this control flow, the RG field is set to invalid (reassignment prohibited), and in that case, the RT field value is converted to zero remaining time so that the usage authority is not granted to PE0 again by mistake. Update to the value (T1012).

(4)PE0の制御周期内残り時間がゼロとなった場合、使用要求レジスタバンクS30が備える共有リソース使用要求クリアレジスタ530への書き込みにより、PE0の使用要求フラグをクリア(T1013)する。この結果、使用要求レジスタバンクS30は、PEnおよびPEmの使用要求フラグがセットされた状態S3003となる。 (4) When the remaining time in the control cycle of PE0 becomes zero, the usage request flag of PE0 is cleared (T1013) by writing to the shared resource usage request clear register 530 provided in the usage request register bank S30. As a result, the usage request register bank S30 is in the state S3003 in which the usage request flags of Pen and Pem are set.

共有リソース管理プログラムS10は、続いて、図16に示すように、使用要求レジスタバンクS30の備える共有リソース使用要求フラグレジスタ510を読み出し(T1014)、使用要求受け付けウィンドウ期間Wに蓄積された共有リソース使用要求の有無をチェック(S1003)する。1以上の使用要求があった場合には、図23に示すフローに基づき、本処理実行時点で最も優先度の高い1つのPEを、最初の共有リソース使用権限付与先として動的に決定(S1041)する。本制御フローにおける共有制御ポリシでは、制御テーブルS20内の制御周期内権限付与順序(OR)フィールドを参照しないため、ORフィールドの設定値は任意としてよい。 Subsequently, as shown in FIG. 16, the shared resource management program S10 reads out the shared resource usage request flag register 510 included in the usage request register bank S30 (T1014), and uses the shared resources accumulated in the usage request acceptance window period W. Check for the presence or absence of a request (S1003). When there is one or more usage requests, one PE with the highest priority at the time of execution of this process is dynamically determined as the first shared resource usage authority grant destination based on the flow shown in FIG. 23 (S1041). )do. In the shared control policy in this control flow, since the authority granting order (OR) field within the control cycle in the control table S20 is not referred to, the set value of the OR field may be arbitrary.

以降、共有リソース管理プログラムS10は、処理S1041で動的に決定した共有リソース使用権限の付与対象とするサテライトPEに対し、共有リソース30の使用権限を付与する処理S1042を実行する。具体的な手順は以下のとおりである。 After that, the shared resource management program S10 executes the process S1042 for granting the use authority of the shared resource 30 to the satellite PE to which the shared resource use authority is dynamically determined in the process S1041. The specific procedure is as follows.

(1)使用権限を付与すべきPE(PEnとする)の使用権限付与中フラグ(IU)フィールド値をセット(真に設定)(T1041)し、制御テーブルS20の状態を、PEnが使用権限を保持している状態S2004に更新する。 (1) Set (true set) (T1041) the flag (IU) field value for granting the usage authority of the PE (referred to as PEN) to which the usage authority should be granted, and PEn assigns the usage authority to the status of the control table S20. Update to the held state S2004.

(2)PE0用ハードウェアタイマチャネルS11を、最初の使用権限付与先であるPEn用ハードウェアタイマチャネルS41のレプリカとして動作させるため、制御テーブルS20の設定のうち、PEnの制御周期内残り時間(RT)フィールド値を、チャネルS11の初期カウント値レジスタ617に設定(T1017)する。 (2) In order to operate the hardware timer channel S11 for PE0 as a replica of the hardware timer channel S41 for Pen which is the first permission to use, among the settings of the control table S20, the remaining time in the control cycle of PEn (2) The RT) field value is set in the initial count value register 617 of the channel S11 (T1017).

(3)使用権限制御装置60Aが備える開始トリガレジスタ625への書き込みにより、PE0およびPEn用ハードウェアタイマチャネルS11、S41の同時起動を要求(T1018、T1019)する。起動要求を受けたハードウェアタイマチャネルS11、S41はそれぞれ動作状態(S1104、S4102)に遷移し、いずれも当該ハードウェアタイマチャネルS11、S41の現カウント値レジスタ616にコピーされた初期カウント値レジスタ617の値を初期値として、所定の条件に基づくデクリメント動作を開始する。ここで、ハードウェアタイマチャネルS41がカウント動作状態であることと、共有リソース使用権限をPEnに対し付与中であることは等価であり、2つのハードウェアタイマチャネルS11、S41は同期してデクリメント動作を行う。 (3) By writing to the start trigger register 625 included in the usage authority control device 60A, simultaneous activation of PE0 and PEn hardware timer channels S11 and S41 is requested (T1018, T1019). The hardware timer channels S11 and S41 that received the start request transition to the operating states (S1104 and S4102), respectively, and both of them are the initial count value registers 617 copied to the current count value registers 616 of the hardware timer channels S11 and S41. The decrement operation based on a predetermined condition is started with the value of. Here, it is equivalent that the hardware timer channel S41 is in the counting operation state and the shared resource use authority is being granted to the PEN, and the two hardware timer channels S11 and S41 are synchronously decrementing. I do.

共有リソース管理プログラムS10から、PEn用ハードウェアタイマチャネルS41に対する起動要求T1018を受けると、使用権限制御装置60Aの割り込み要求制御部630Aが備える割り込み要因レジスタ635Aにおいて、ハードウェアタイマチャネルS11からPE0に対する使用権限付与期間開始イベント、およびハードウェアタイマチャネルS41からPEnに対する使用権限付与期間開始イベントの発生状態を保持するフィールド値がそれぞれ真にセットされる。本制御フローでは後者のイベントを要因とする割り込みのみ許可に設定しているため、ハードウェアタイマチャネルS41は、当該イベントを要因として使用権限付与期間の開始を通知する割り込みを、使用権限割り込み信号を経由し、PEnに対し要求(T4121)する。 When the start request T1018 for the hardware timer channel S41 for Pen is received from the shared resource management program S10, the hardware timer channel S11 is used for PE0 in the interrupt factor register 635A provided in the interrupt request control unit 630A of the usage authority control device 60A. The field values that hold the occurrence status of the authorization period start event and the usage authorization period start event for PEn from the hardware timer channel S41 are set to true. In this control flow, only the interrupt caused by the latter event is set to be permitted, so that the hardware timer channel S41 sends an interrupt notifying the start of the usage authority granting period due to the event, and a usage authority interrupt signal. Request (T4121) to PEn via.

PEn用ハードウェアタイマチャネルS41による、使用権限付与期間開始イベントを要因とする割り込み要求T4121を検出したアプリケーションS40は、使用権限付与期間開始に係る処理S4021を実行する。すなわち、使用権限制御装置60Aの割り込み要求制御部630Aが備える割り込み要因レジスタ635Aにおいて、PEn用ハードウェアタイマチャネルS41からPEnに対する使用権限付与期間開始イベントの発生状態を保持するフィールド値を偽にクリア(T4021)し、続いて、共有リソース30の使用を伴う処理S4003を実行する。第2の制御フローと同様、アプリケーションS40は、ハードウェアタイマチャネルS41がカウント動作状態の期間、共有リソース30を占有して使用可能である一方、使用権限の付与終了タイミングを通知する権限付与期間終了イベント発生を要因とする割り込み要求が発生するまでには、処理S4003を終了しなければならないものとする。 The application S40 that has detected the interrupt request T4121 caused by the usage permission grant period start event by the hardware timer channel S41 for Pen executes the process S4021 related to the start of the usage permission grant period. That is, in the interrupt factor register 635A provided in the interrupt request control unit 630A of the usage authority control device 60A, the field value for holding the occurrence state of the usage authority grant period start event for the PEN from the hardware timer channel S41 for Pen is falsely cleared ( T4021), and subsequently, the process S4003 accompanied by the use of the shared resource 30 is executed. Similar to the second control flow, the application S40 can be used by occupying the shared resource 30 during the period in which the hardware timer channel S41 is in the counting operation state, while the permission granting period for notifying the timing of the granting end of the usage permission ends. It is assumed that the process S4003 must be terminated before the interrupt request caused by the occurrence of the event is generated.

第2の制御フローでは、アプリケーションS40において、共有リソース30を使用する処理S4003が完了したか否かに関わらず、使用権限付与期間終了イベントおよび当該イベント要因とする割り込み要求を検出するまで、共有リソース30の使用権限をPEnが保持し続ける。それに対し、本制御フローでは、共有リソース30の使用権限が不要となった時点で、使用権限付与期間終了イベントを要因とする割り込み要求を待たずに、図17に示すように、以下の使用権限返却処理S4041を主体的に実行する。 In the second control flow, regardless of whether or not the process S4003 using the shared resource 30 is completed in the application S40, the shared resource is used until the usage authority grant period end event and the interrupt request that is the cause of the event are detected. PEn continues to retain the usage authority of 30. On the other hand, in this control flow, when the usage authority of the shared resource 30 is no longer required, the following usage authority is as shown in FIG. 17 without waiting for the interrupt request caused by the usage authority grant period end event. The return process S4041 is independently executed.

(1)動作中のPEn用ハードウェアタイマチャネルS41を安全に停止させるため、使用権限制御装置60Aの割り込み要求制御部630Aが備える割り込みイネーブルレジスタ636Aへの書き込みにより、PEnを対象とする全イベントを要因とする割り込み要求を一時的に禁止する(T4041)。 (1) In order to safely stop the operating hardware timer channel S41 for PEn, all events targeting PEn are sent by writing to the interrupt enable register 636A provided in the interrupt request control unit 630A of the usage authority control device 60A. Temporarily disable the interrupt request as a factor (T4041).

(2)割り込み要因レジスタ635Aにおいて、PEnを対象とする全イベントの発生状態を保持するフィールド値を偽にクリアするとともに、停止トリガレジスタ626への書き込みにより、PEn用ハードウェアタイマチャネルS41の停止を要求する(T4042)。この結果、ハードウェアタイマチャネルS41はカウント停止状態S4103へ遷移する。 (2) In the interrupt factor register 635A, the field value holding the occurrence state of all events targeting PEn is falsely cleared, and the hardware timer channel S41 for Pen is stopped by writing to the stop trigger register 626. Request (T4042). As a result, the hardware timer channel S41 transitions to the count stop state S4103.

(3)PE間割り込み制御装置70の備える、PEnを要求元PEとするPE間割り込み要求セットレジスタ720-nへの書き込みにより、PE0を要求先PEとするPE間割り込み要求フラグをセットし、PEnからPE0へのPE間割り込みを要求(T4043)する。なお、PE間割り込みに関し、使用権限の返却による共有リソース30の解放とは異なるメッセージを伝達する必要がある場合には、PE間割り込み信号に付随して割り込み要因を通知する手段(図示せず)を別途設けてもよい。 (3) The PE-interruption request flag with PE0 as the request destination PE is set by writing to the PE-interruption request set register 720-n having the PEn as the request source PE provided in the PE-interruption control device 70, and the PEN is set. Requests an interrupt between PEs from PE0 (T4043). When it is necessary to transmit a message different from the release of the shared resource 30 by returning the usage authority regarding the interrupt between PEs, a means for notifying the interrupt factor accompanying the interrupt signal between PEs (not shown). May be provided separately.

(4)割り込みイネーブルレジスタ636Aへの書き込みにより、処理T4041で一時的に禁止していた割り込み要求を再度許可する(T4044)。 (4) By writing to the interrupt enable register 636A, the interrupt request temporarily disabled by the process T4041 is re-allowed (T4044).

(5)必要に応じて、アプリケーションS40は共有リソース使用権限が不要かつ当該制御周期内に実行すべき処理など、所定の後処理S4005を実行する。 (5) If necessary, the application S40 executes predetermined post-processing S4005, such as processing that does not require the shared resource use authority and should be executed within the control cycle.

PE間割り込み信号を経由した、PEnからPE0へのPE間割り込み要求T4043を検出した共有リソース管理プログラムS10は、使用権限返却に係る処理S1043として、以下の処理を順次実行する。 The shared resource management program S10 that has detected the PE-to-PE interrupt request T4043 from PEn to PE0 via the PE-to-PE interrupt signal sequentially executes the following processes as the process S1043 related to the return of usage authority.

(1)動作中のPE0用ハードウェアタイマチャネルS11を安全に停止させるため、使用権限制御装置60Aの割り込み要求制御部630Aが備える割り込みイネーブルレジスタ636Aへの書き込みにより、PE0を対象とする全イベントを要因とする割り込み要求を一時的に禁止する(T1042)。 (1) In order to safely stop the operating hardware timer channel S11 for PE0, all events targeting PE0 are sent by writing to the interrupt enable register 636A provided in the interrupt request control unit 630A of the usage authority control device 60A. Temporarily disable the interrupt request as a factor (T1042).

(2)割り込み要因レジスタ635Aにおいて、PE0を対象とする全イベントの発生状態を保持するフィールド値を偽にクリアするとともに、停止トリガレジスタ626への書き込みにより、PEn用ハードウェアタイマチャネルS11の停止を要求する(T1043)。この結果、ハードウェアタイマチャネルS41はカウント停止状態S1105へ遷移する。 (2) In the interrupt factor register 635A, the field value holding the occurrence state of all events targeting PE0 is falsely cleared, and the hardware timer channel S11 for PEn is stopped by writing to the stop trigger register 626. Request (T1043). As a result, the hardware timer channel S41 transitions to the count stop state S1105.

(3)安全対応のオプション処理として、割り込み要因レジスタ635Aにおいて、PEnを対象とする全イベントの発生状態を保持するフィールド値を偽にクリアするとともに、停止トリガレジスタ626への書き込みにより、PEn用ハードウェアタイマチャネルS41の停止を要求する(T1021)。 (3) As an optional process for safety, in the interrupt factor register 635A, the field value that holds the occurrence state of all events targeting PEn is falsely cleared, and the hardware for Pen is written by writing to the stop trigger register 626. Request the stop of the wear timer channel S41 (T1021).

(4)割り込みイネーブルレジスタ636Aへの書き込みにより、処理T1042で一時的に禁止していた割り込み要求を再度許可する(T1044)。 (4) By writing to the interrupt enable register 636A, the interrupt request temporarily disabled by the process T1042 is re-allowed (T1044).

(5)制御テーブルS20に関しては、PEnの使用権限付与中フラグ(IU)フィールド値をクリア(偽に設定)(T1022)し、どのPE0、PEn、PEmも使用権限を保持していない状態S2005に更新する。 (5) Regarding the control table S20, the flag (IU) field value for which the usage authority of Pen is granted is cleared (set to false) (T1022), and none of PE0, Pen, and Pem holds the usage authority in S2005. Update.

(6)続いて、PEnの制御周期内権限再付与(RG)フィールドの設定に応じ、PEnの制御周期内残り時間(RT)フィールド値を更新する。本制御フローでは、RGフィールドを有効(再付与許可)に設定しており、その場合には、PEn用ハードウェアタイマチャネルS41の現カウント値レジスタ616、または/および、PE0用ハードウェアタイマチャネルS11の現カウント値レジスタ616の内容をそれぞれ読み出し(T1045、T1046)、PEnが実際に共有リソース30を占有した時間を差し引いた、PEnに割り当て可能な制御周期内残り時間の換算値を算出する。算出方法としては、処理T1045で取得した換算値、処理T1045および処理T1046で取得した2つの換算値の平均、または2つの換算値のうちより小さい値のいずれかの値とすればよい。 (6) Subsequently, the remaining time (RT) field value in the control cycle of the PEN is updated according to the setting of the authority reassignment (RG) field in the control cycle of the PEN. In this control flow, the RG field is set to valid (re-grant permission), and in that case, the current count value register 616 of the hardware timer channel S41 for Pen and / and the hardware timer channel S11 for PE0 are set. The contents of the current count value register 616 of the above are read out (T1045, T1046), respectively, and the converted value of the remaining time in the control cycle that can be assigned to the PEN is calculated by subtracting the time when the Pen actually occupies the shared resource 30. As the calculation method, the conversion value acquired by the processing T1045, the average of the two conversion values acquired by the processing T1045 and the processing T1046, or the smaller value among the two conversion values may be used.

(7)制御テーブルS20のPEnについて、RTフィールドの値を(6)で算出した換算値に更新する(T1047)。 (7) For PEn in the control table S20, the value of the RT field is updated to the converted value calculated in (6) (T1047).

(8)PEnに対する共有リソース使用権限再付与に備え、PEn用ハードウェアタイマチャネルS41の初期カウント値レジスタ617についても同様に、(7)で算出した換算値に更新する(T1048)。 (8) Similarly, the initial count value register 617 of the hardware timer channel S41 for Pen is updated to the converted value calculated in (7) in preparation for reassigning the authority to use the shared resource to PEN (T1048).

(9)(6)で算出したPEnの制御周期内残り時間がゼロとなった場合、現制御周期内のPEnに対する権限再付与はRGフィールドの設定によらず禁止となり、使用要求レジスタバンクS30が備える共有リソース使用要求クリアレジスタ530への書き込みにより、PEnの使用要求フラグをクリア(T1049)する。この結果、使用要求レジスタバンクS30は、PEnおよびPEmの使用要求フラグがセットされた状態、もしくはPEmの使用要求のみがセットされた状態のいずれかの状態S3041となる。なお、本制御フローでは、PEnおよびPEmの使用要求フラグがセットされた状態として以降の説明を続ける。 (9) When the remaining time in the control cycle of the PEN calculated in (6) becomes zero, reassignment of authority to the Pen in the current control cycle is prohibited regardless of the setting of the RG field, and the use request register bank S30 is set. By writing to the shared resource usage request clear register 530 provided, the usage request flag of PEn is cleared (T1049). As a result, the usage request register bank S30 is in a state S3041 in which the usage request flags of Pen and Pem are set or only the usage request of Pem is set. In this control flow, the following description will be continued assuming that the usage request flags of PEn and Pem are set.

共有リソース管理プログラムS10は、続いて、図18に示すように、PEnの次に使用権限の付与先となるPEの特定と、特定したPEに対する共有リソース30の権限付与に係る一連の処理を実行する。具体的には、改めて、使用要求レジスタバンクS30の備える共有リソース使用要求フラグレジスタ510を読み出し(T1050)、制御周期内残り時間として正の値をもつPEによる使用権限再付与を含む、共有リソース使用要求の有無をチェック(S1044)する。1以上の使用要求があった場合には、図23に示すフローに基づき、本処理実行時点で最も優先度の高い1つのPEを、次の共有リソース使用権限付与先として動的に決定(S1045)する。 Then, as shown in FIG. 18, the shared resource management program S10 executes a series of processes related to the identification of the PE to which the usage authority is granted next to the PE and the authorization of the shared resource 30 to the identified PE. do. Specifically, the shared resource usage including the re-granting of the usage authority by the PE having a positive value as the remaining time in the control cycle by reading the shared resource usage request flag register 510 provided in the usage request register bank S30 (T1050) again. Check for the presence or absence of a request (S1044). When there is one or more usage requests, one PE with the highest priority at the time of execution of this process is dynamically determined as the next shared resource usage authority grant destination based on the flow shown in FIG. 23 (S1045). )do.

以降、共有リソース管理プログラムS10は、処理S1045で動的に決定した共有リソース使用権限の付与対象とするサテライトPEに対し、共有リソース30の使用権限を付与する処理S1046を実行する。具体的な手順は以下のとおりである。 After that, the shared resource management program S10 executes the process S1046 for granting the use authority of the shared resource 30 to the satellite PE to which the shared resource use authority is dynamically determined in the process S1045. The specific procedure is as follows.

(1)次に使用権限を付与するPE(PEn、同じPEに対し2回連続で使用権限が付与されるケースを想定する)の使用権限付与中フラグ(IU)フィールド値をセット(真に設定)(T1051)し、制御テーブルS20の状態を、PEnが再度使用権限を保持している状態S2006に更新する。 (1) Set (true set) the usage authority granting flag (IU) field value of the PE (PEn, assuming the case where the usage authority is granted twice in a row to the same PE) to which the usage authority is granted next. ) (T1051), and the state of the control table S20 is updated to the state S2006 in which PEn holds the usage authority again.

(2)PE0用ハードウェアタイマチャネルS11を、次の使用権限付与先であるPEn用ハードウェアタイマチャネルS41のレプリカとして動作させるため、制御テーブルS20の設定のうち、PEnの制御周期内残り時間(RT)フィールド値を、ハードウェアタイマチャネルS11の初期カウント値レジスタ617に設定(T1017)する。ここで設定される値は、1回目の使用権限付与時にPEnが実際に共有リソース30を占有した時間に相当する値を差し引いた値である。 (2) In order to operate the hardware timer channel S11 for PE0 as a replica of the hardware timer channel S41 for Pen to which the next usage authority is granted, the remaining time in the control cycle of PEn in the setting of the control table S20 (2) The RT) field value is set in the initial count value register 617 of the hardware timer channel S11 (T1017). The value set here is a value obtained by subtracting the value corresponding to the time when Pen actually occupies the shared resource 30 at the time of the first grant of the usage authority.

(3)使用権限制御装置60Aが備える開始トリガレジスタ625への書き込みにより、PE0およびPEn用ハードウェアタイマチャネルS11、S41の同時起動を要求(T1018、T1019)する。PEnに対する1回目の権限付与の場合と同様、起動要求を受けたハードウェアタイマチャネルS11、S41はそれぞれ動作状態(S1106、S4141)に遷移し、いずれも当該ハードウェアタイマチャネルS11、S41の現カウント値レジスタ616にコピーされた初期カウント値レジスタ617の値を初期値として、所定の条件に基づくデクリメント動作を開始する。 (3) By writing to the start trigger register 625 included in the usage authority control device 60A, simultaneous activation of PE0 and PEn hardware timer channels S11 and S41 is requested (T1018, T1019). As in the case of the first grant of authority to PEn, the hardware timer channels S11 and S41 that received the start request transition to the operating states (S1106, S4141), respectively, and both of them are the current counts of the hardware timer channels S11 and S41. The decrement operation based on a predetermined condition is started with the value of the initial count value register 617 copied to the value register 616 as the initial value.

第2の制御フローと比較し、本制御フローによれば、サテライトPEが実際に共有リソース30を使用した時間が制御テーブルS20内の制御周期内上限時間の設定より短い場合に、例えば、非定常な割り込み処理による共有リソース使用要求に対して余剰時間を割り当てることにより、共有リソース30が未使用となる無駄時間を削減し、共有リソース30の利用効率を向上させることができる。 Compared with the second control flow, according to this control flow, when the time when the satellite PE actually uses the shared resource 30 is shorter than the setting of the upper limit time in the control cycle in the control table S20, for example, it is unsteady. By allocating the surplus time to the shared resource usage request due to the interrupt processing, it is possible to reduce the wasted time when the shared resource 30 is unused and improve the utilization efficiency of the shared resource 30.

<第4の共有リソース使用権限付与制御フロー>
図19~図21は、第4実施形態に係るマイコンの共有リソース使用権限付与の動作を示すフローチャートである。
第4の共有リソース使用権限付与制御フローでは、第2の共有リソース使用権限付与制御フローの例示に対し、さらに(1)、(3)および(4)の条件が異なる。
<Fourth shared resource usage permission grant control flow>
19 to 21 are flowcharts showing the operation of granting the authority to use the shared resource of the microcomputer according to the fourth embodiment.
In the fourth shared resource use authority grant control flow, the conditions (1), (3), and (4) are further different from the example of the second shared resource use authority grant control flow.

(1)使用要求レジスタ50は2バンク(使用要求レジスタバンク50-0、50-1)構成とし、使用要求レジスタバンクS31、S32(Bank-0、Bank-1)とする。 (1) The usage request register 50 has a configuration of two banks (use request register banks 50-0, 50-1), and the usage request register banks S31 and S32 (Bank-0, Bank-1).

(3)制御テーブル140の設定に関し、マスタPE(PE0)のイネーブル(EN)フィールドを無効に設定し、さらに、全サテライトPEについて制御周期内権限再付与(RG)フィールドを無効に、それぞれ設定する。 (3) Regarding the setting of the control table 140, the enable (EN) field of the master PE (PE0) is set to invalid, and the privilege reassignment (RG) field within the control cycle is disabled for all satellite PEs. ..

(4)図8(b)を用いて概念的に示したように、各制御周期の全体について、次制御周期における共有リソース使用要求を受け付ける使用要求受け付けウィンドウ期間として設定する。 (4) As conceptually shown with reference to FIG. 8B, the entire control cycle is set as the usage request acceptance window period for accepting the shared resource usage request in the next control cycle.

第1のサテライトPEであるPEnには、使用権限制御装置60Aの備えるハードウェアタイマチャネルS41が関連付けられ、PEnおよびPEn上で動作するアプリケーションS40への共有リソース使用権限付与の開始/終了タイミングを制御する。マスタPE(PE0)についても同様に、ハードウェアタイマチャネルS41とは独立したハードウェアタイマチャネルS11が関連付けられ、望ましくは、PE0上で動作する共有リソース管理プログラムS10による共有制御処理の一部として、使用権限を保持するサテライトPEに関連付けられたハードウェアタイマチャネルS41の状態および動作を複製(レプリケーション)したレプリカとして利用する。 A hardware timer channel S41 included in the usage authority control device 60A is associated with PEN, which is the first satellite PE, and controls the start / end timing of granting the shared resource usage authority to the application S40 running on Pen and Pen. do. Similarly, for the master PE (PE0), the hardware timer channel S11 independent of the hardware timer channel S41 is associated with the master PE (PE0), and preferably, as a part of the shared control process by the shared resource management program S10 operating on the PE0. The state and operation of the hardware timer channel S41 associated with the satellite PE holding the usage authority are used as a replicated replica.

PEn上で動作するアプリケーションS40は、2バンク構成の使用要求レジスタバンクS31、S32内のうち裏バンク側の使用要求レジスタバンク内の要求フラグをセットし、共有リソース管理プログラムS10は、表バンク側の使用要求レジスタバンクに蓄積された共有リソース使用要求、および制御テーブルS20に設定された制御情報をそれぞれ参照/更新し、さらに制御周期ごとにバンクの表裏を切り替えながら、使用権限付与順序の決定と使用権限制御装置60Aの制御を行う。共有制御の開始に先立ち、制御テーブルS20は適切に設定されているものとする。また、制御開始時点では、2つの使用要求レジスタバンクS31、S32のうち、使用要求レジスタバンクS32が表バンク(カレントバンクとも呼ぶ)、使用要求レジスタバンクS31が裏バンクであるとする。 The application S40 running on Pen sets the request flag in the usage request register bank on the back bank side of the usage request register banks S31 and S32 having a two-bank configuration, and the shared resource management program S10 is on the front bank side. Refer to / update the shared resource usage request stored in the usage request register bank and the control information set in the control table S20, and determine and use the usage authority granting order while switching the front and back of the bank for each control cycle. It controls the authority control device 60A. It is assumed that the control table S20 is appropriately set prior to the start of the shared control. Further, at the time of starting control, of the two usage request register banks S31 and S32, the usage request register bank S32 is the front bank (also referred to as the current bank), and the usage request register bank S31 is the back bank.

図19において、共有リソース管理プログラムS10が、図示しないハードウェアもしくはソフトウェア手段を用いて制御周期の開始タイミングを検出すると、以下の初期化処理S1061を順次実行する。 In FIG. 19, when the shared resource management program S10 detects the start timing of the control cycle by using hardware or software means (not shown), the following initialization process S1061 is sequentially executed.

(1)使用権限制御装置60Aが備える停止トリガレジスタ626への書き込みにより、全ハードウェアタイマチャネルS11、S41の同時停止を要求(T1001、T1002)する。停止要求を受けたPE0およびPEn用ハードウェアタイマチャネルS11、S41は、それぞれ停止状態(S1101、S4101)となる。 (1) Simultaneous stop of all hardware timer channels S11 and S41 is requested (T1001 and T1002) by writing to the stop trigger register 626 included in the usage authority control device 60A. The PE0 and the hardware timer channels S11 and S41 for Pen that have received the stop request are in the stopped state (S1101, S4101), respectively.

(2)この時点で表バンクに相当する、使用要求レジスタバンクS32が備える共有リソース使用要求クリアレジスタ530への書き込みにより全PEの使用要求フラグをクリアすることで、全PEの使用要求フラグが無効な状態(S3261)となるよう、共有リソース使用要求フラグレジスタ510の内容を更新(T1061)する。 (2) At this point, the usage request flag of all PEs is invalidated by clearing the usage request flag of all PEs by writing to the shared resource usage request clear register 530 provided in the usage request register bank S32, which corresponds to the table bank. The contents of the shared resource use request flag register 510 are updated (T1061) so that the state (S3261) is reached.

(3)所定の手順により使用要求レジスタバンクS31、S32の表裏バンクを切り替え(T1062)、使用要求レジスタバンクS31を表バンクとする(S3161)。 (3) The front and back banks of the usage request register banks S31 and S32 are switched (T1062) according to a predetermined procedure, and the usage request register bank S31 is used as the front bank (S3161).

(4)制御テーブルS20の全PEについて、使用権限付与中フラグ(IU)フィールド値をクリア(偽に設定)(T1004)し、制御周期内残り時間(RT)フィールド値は、制御周期内上限時間(PT)フィールド値からハードウェアタイマチャネルS11、S41内のカウントレジスタに設定可能な値に変換した値(以下換算値と呼ぶ)に更新(T1005)することで、制御周期開始時点での制御テーブルS20の初期状態(S2001)とする。 (4) For all PEs in the control table S20, the usage authority granting flag (IU) field value is cleared (set to false) (T1004), and the remaining time in the control cycle (RT) field value is the upper limit time in the control cycle. (PT) The control table at the start of the control cycle by updating (T1005) to the value converted from the field value to the value that can be set in the count register in the hardware timer channels S11 and S41 (hereinafter referred to as the converted value). The initial state of S20 (S2001) is used.

(5)各サテライトPEに関連付けられたハードウェアタイマチャネルの初期カウント値レジスタ617に対し、制御テーブルS20の制御周期内残り時間(RT)フィールド値をそれぞれ設定(T1006)する。本制御フローでは、PE0用ハードウェアタイマチャネルS11を用いて使用要求受け付けウィンドウ期間を計測する必要はないため、この時点ではハードウェアタイマチャネルS11の設定や起動は行わなくてよい。 (5) The remaining time (RT) field value in the control cycle of the control table S20 is set (T1006) for the initial count value register 617 of the hardware timer channel associated with each satellite PE. In this control flow, it is not necessary to measure the usage request acceptance window period using the hardware timer channel S11 for PE0. Therefore, it is not necessary to set or start the hardware timer channel S11 at this point.

共有リソース管理プログラムS10と同様の手段により制御周期の開始タイミングを検出した、PEn上で動作するアプリケーションS40は、現在の、または/および、次の制御周期に実行すべき処理に関する初期化等、所定の前処理を実行(S4061)する。次制御周期に実行すべき処理が共有リソース使用権限の付与を必要とする場合には、前処理の少なくとも一部として、裏バンク側である使用要求レジスタバンクS32内にあるPEn用共有リソース使用要求セットレジスタへの書き込みにより、PEnの使用要求フラグをセット(T4061)する。 The application S40 running on PEn, which has detected the start timing of the control cycle by the same means as the shared resource management program S10, determines the initialization of the processing to be executed in the current and / or next control cycle. (S4061) is executed. When the process to be executed in the next control cycle requires the granting of the shared resource use authority, as at least a part of the pre-process, the PEN shared resource use request in the use request register bank S32 on the back bank side. By writing to the set register, the PEn usage request flag is set (T4061).

また、図示しないが、PEnとは異なるサテライトPE(PEmとする)上で動作するアプリケーションも、同様の手順により、使用要求レジスタバンクS32内にあるPEmの使用要求フラグをセットする。この結果、現制御周期終了の時点で、使用要求レジスタバンクS32にはPEnおよびPEmの使用要求フラグがセットされた状態S3262となる。 Further, although not shown, an application operating on a satellite PE (referred to as PEm) different from Pen also sets the usage request flag of PEm in the usage request register bank S32 by the same procedure. As a result, at the end of the current control cycle, the usage request register bank S32 is in a state S3622 in which the usage request flags of PEn and Pem are set.

第2の共有リソース使用権限付与制御フローと同様、前処理を完了したPEn上のアプリケーションS40は、共有リソース管理プログラムS10によるハードウェアタイマチャネルS41の起動要求に応じて、使用権限制御装置60Aから使用権限付与期間開始イベントを要因とする割り込みが要求されるのを待つ。当該割り込み要求までの期間を別のタスク処理の実行に当ててもよい。なお、アプリケーションS40には、使用権限付与期間開始イベントを要因とする割り込みと、制御周期との対応関係を保持する内部リソースとして、前制御周期に共有リソース30の使用権限付与を要求したか否かを示すフラグを設けてもよい。 Similar to the second shared resource usage authority grant control flow, the application S40 on the PEN that has completed the preprocessing is used from the usage authority control device 60A in response to the start request of the hardware timer channel S41 by the shared resource management program S10. Wait for an interrupt due to the authorization period start event to be requested. The period until the interrupt request may be devoted to the execution of another task process. Whether or not the application S40 is requested to grant the usage authority of the shared resource 30 in the previous control cycle as an internal resource that maintains the correspondence between the interrupt caused by the usage permission grant period start event and the control cycle. A flag indicating the above may be provided.

制御テーブルS20の初期設定に続き、共有リソース管理プログラムS10は、表バンク側である使用要求レジスタバンクS31の備える共有リソース使用要求フラグレジスタ510を読み出し(T1063)、前制御周期に蓄積された共有リソース使用要求の有無をチェック(S1062)する。説明を簡単にするため、この時点では、どのサテライトPEn、PEmからも使用要求がなかったものとし、現制御周期における使用権限付与に係る処理を終了する。 Following the initial setting of the control table S20, the shared resource management program S10 reads out the shared resource usage request flag register 510 included in the usage request register bank S31 on the table bank side (T1063), and the shared resource accumulated in the previous control cycle. Check for the presence or absence of a usage request (S1062). For the sake of simplicity, it is assumed that there is no usage request from any satellite Pen or Pem at this point, and the process related to the granting of usage authority in the current control cycle is terminated.

共有リソース管理プログラムS10が、再度制御周期の開始タイミングを検出すると、改めて以下の初期化処理S1061Aを順次実行する。 When the shared resource management program S10 detects the start timing of the control cycle again, the following initialization process S1061A is sequentially executed again.

(1)使用権限制御装置60Aが備える停止トリガレジスタ626への書き込みにより、全ハードウェアタイマチャネルS11、S41の同時停止を要求(T1001A、T1002A)する。停止要求を受けたPE0およびPEn用ハードウェアタイマチャネルS11、S41は、それぞれ停止状態(S1101A、S4101A)へ遷移、もしくは停止状態を維持する。 (1) Simultaneous stop of all hardware timer channels S11 and S41 is requested (T1001A, T1002A) by writing to the stop trigger register 626 included in the usage authority control device 60A. The hardware timer channels S11 and S41 for PE0 and PEn that have received the stop request transition to the stopped state (S1101A, S4101A), respectively, or maintain the stopped state.

(2)この時点で表バンクに相当する、使用要求レジスタバンクS31が備える共有リソース使用要求クリアレジスタ530への書き込みにより全PEの使用要求フラグをクリアすることで、全PEの使用要求フラグが無効な状態(S3162)となるよう、共有リソース使用要求フラグレジスタ510の内容を更新(T1064)する。 (2) At this point, the usage request flag of all PEs is invalidated by clearing the usage request flag of all PEs by writing to the shared resource usage request clear register 530 provided in the usage request register bank S31 corresponding to the table bank. The contents of the shared resource use request flag register 510 are updated (T1064) so that the state (S3162) is reached.

(3)所定の手順により使用要求レジスタバンクS31、S32の表裏バンクを切り替え(T1065)、使用要求レジスタバンクS32を表バンクとする(S3263)。 (3) The front and back banks of the usage request register banks S31 and S32 are switched (T1065) according to a predetermined procedure, and the usage request register bank S32 is used as the front bank (S3263).

(4)制御テーブルS20の全PEについて、使用権限付与中フラグ(IU)フィールド値をクリア(偽に設定)(T1004A)し、制御周期内残り時間(RT)フィールド値は、制御周期内上限時間(PT)フィールド値からハードウェアタイマチャネルS11、S41内のカウントレジスタに設定可能な値に変換した値(以下換算値と呼ぶ)に更新(T1005A)することで、制御周期開始時点での制御テーブルS20の初期状態(S2001A)とする。 (4) For all PEs in the control table S20, the usage authority granting flag (IU) field value is cleared (set to false) (T1004A), and the remaining time in the control cycle (RT) field value is the upper limit time in the control cycle. (PT) The control table at the start of the control cycle by updating (T1005A) to the value converted from the field value to the value that can be set in the count register in the hardware timer channels S11 and S41 (hereinafter referred to as the converted value). The initial state of S20 (S2001A) is used.

(5)各サテライトPEに関連付けられたハードウェアタイマチャネルの初期カウント値レジスタ617に対し、制御テーブルS20の制御周期内残り時間(RT)フィールド値をそれぞれ設定(T1006A)する。前制御周期の場合と同様、この時点では、PE0用ハードウェアタイマチャネルS11の設定や起動は行わなくてよい。 (5) The remaining time (RT) field value in the control cycle of the control table S20 is set (T1006A) for the initial count value register 617 of the hardware timer channel associated with each satellite PE. As in the case of the pre-control cycle, it is not necessary to set or start the hardware timer channel S11 for PE0 at this point.

共有リソース管理プログラムS10は、続いて、図20に示すように、表バンク側である使用要求レジスタバンクS32の備える共有リソース使用要求フラグレジスタ510を読み出し(T1066)、前制御周期に蓄積された共有リソース使用要求の有無をチェック(S1062A)する。1以上の使用要求があった場合には、図22に示すフローに基づき、共有リソース使用権限の付与順序を一括して決定(S1004A)し、制御テーブルS20のうち、少なくとも共有リソース30の使用を要求した全PEについて、決定した付与順序を特定する値を制御周期内権限付与順序(OR)フィールドに設定する(T1015A)。さらに望ましくは、共有リソース30の使用要求なし、制御テーブルS20内の制御ポリシ設定が無効などの所定の理由により、現制御周期における共有リソース使用権限付与の対象外となったPEについては、付与対象外であることを示す所定の値を、当該PEのORフィールドに設定してよい。 Subsequently, as shown in FIG. 20, the shared resource management program S10 reads out the shared resource usage request flag register 510 included in the usage request register bank S32 on the table bank side (T1066), and shares the shares accumulated in the pre-control cycle. Check whether there is a resource usage request (S1062A). When there is one or more usage requests, the order of granting the shared resource usage authority is collectively determined (S1004A) based on the flow shown in FIG. 22, and at least the shared resource 30 of the control table S20 is used. For all the requested PEs, a value specifying the determined granting order is set in the authority granting order (OR) field within the control cycle (T1015A). More preferably, PEs that are not subject to the grant of the shared resource use authority in the current control cycle due to a predetermined reason such as no request to use the shared resource 30 or invalidation of the control policy setting in the control table S20 are subject to grant. A predetermined value indicating that it is outside may be set in the OR field of the PE.

以降、共有リソース管理プログラムS10は、処理S1004Aで決定した共有リソース使用権限の付与順序に従って、付与対象とするサテライトPEに対し共有リソース30の使用権限を付与する。具体的な手順は以下の通りである。 After that, the shared resource management program S10 grants the usage authority of the shared resource 30 to the satellite PE to be granted according to the order of granting the shared resource usage authority determined in the process S1004A. The specific procedure is as follows.

(1)制御テーブルS20の制御周期内権限付与順序(OR)フィールドを参照し、次(または最初)に使用権限を付与すべきサテライトPEを特定(S1005A)する。特定したPE(PEnとする)の使用権限付与中フラグ(IU)フィールド値をセット(真に設定)(T1016A)し、制御テーブルS20の状態を、PEnが使用権限を保持している状態S2004Aに更新する。 (1) With reference to the authority granting order (OR) field within the control cycle of the control table S20, the satellite PE to which the usage authority should be granted next (or first) is specified (S1005A). Set (true set) (T1016A) the flag (IU) field value for granting the usage authority of the specified PE (referred to as PEn), and change the state of the control table S20 to the state S2004A in which the PEN holds the usage authority. Update.

(2)PE0用ハードウェアタイマチャネルS11を、次の使用権限付与先であるPEn用ハードウェアタイマチャネルS41のレプリカとして動作させるため、制御テーブルS20の設定のうち、PEnの制御周期内残り時間(RT)フィールド値を、チャネルS11の初期カウント値レジスタに設定(T1017A)する。 (2) In order to operate the hardware timer channel S11 for PE0 as a replica of the hardware timer channel S41 for Pen to which the next usage authority is granted, the remaining time in the control cycle of PEn in the setting of the control table S20 (2) The RT) field value is set in the initial count value register of channel S11 (T1017A).

(3)使用権限制御装置60Aが備える開始トリガレジスタ625への書き込みにより、PE0およびPEn用ハードウェアタイマチャネルS11、S41の同時起動を要求(T1018A、T1019A)する。起動要求を受けたハードウェアタイマチャネルS11、S41はそれぞれ動作状態(S1104A、S4102A)に遷移し、いずれも当該ハードウェアタイマチャネルS11、S41の現カウント値レジスタ616にコピーされた初期カウント値レジスタ617の値を初期値として、所定の条件に基づくデクリメント動作を開始する。ここで、ハードウェアタイマチャネルS41がカウント動作状態であることと、共有リソース使用権限をPEnに対し付与中であることは等価であり、2つのハードウェアタイマチャネルS11、S41は同期してデクリメント動作を行う。 (3) Simultaneous activation of PE0 and PEn hardware timer channels S11 and S41 is requested (T1018A, T1019A) by writing to the start trigger register 625 included in the usage authority control device 60A. The hardware timer channels S11 and S41 that received the start request transition to the operating states (S1104A, S4102A), respectively, and both of them are the initial count value registers 617 copied to the current count value registers 616 of the hardware timer channels S11 and S41. The decrement operation based on a predetermined condition is started with the value of. Here, it is equivalent that the hardware timer channel S41 is in the counting operation state and the shared resource use authority is being granted to the PEN, and the two hardware timer channels S11 and S41 are synchronously decrementing. I do.

共有リソース管理プログラムS10から、PEn用ハードウェアタイマチャネルS41に対する起動要求T1018Aを受けると、使用権限制御装置60Aの割り込み要求制御部630Aが備える割り込み要因レジスタ635Aにおいて、ハードウェアタイマチャネルS11からPEnに対する使用権限付与期間開始イベント、およびハードウェアタイマチャネルS41からPEnに対する使用権限付与期間開始イベントの発生状態を保持するフィールド値がそれぞれ真にセットされる。本制御フローでは、後者のイベントを要因とする割り込みのみ許可に設定しているため、ハードウェアタイマチャネルS41は、当該イベントを要因として使用権限付与期間の開始を通知する割り込みを、使用権限割り込み信号を経由しPEnに要求(T4121A)する。 When the start request T1018A for the hardware timer channel S41 for Pen is received from the shared resource management program S10, the use for the PEN from the hardware timer channel S11 in the interrupt factor register 635A provided in the interrupt request control unit 630A of the usage authority control device 60A. The field values that hold the occurrence status of the authorization period start event and the usage authorization period start event for PEn from the hardware timer channel S41 are set to true. In this control flow, only the interrupt caused by the latter event is set to be permitted, so that the hardware timer channel S41 sends an interrupt notifying the start of the usage authority granting period due to the event as a usage authority interrupt signal. Request (T4121A) to PEn via.

PEn用ハードウェアタイマチャネルS41による、使用権限付与期間開始イベントを要因とする割り込み要求T4121Aを検出したアプリケーションS40は、使用権限付与期間開始に係る処理S4021Aを実行する。すなわち、使用権限制御装置60Aの割り込み要求制御部630Aが備える割り込み要因レジスタ635Aにおいて、PEn用ハードウェアタイマチャネルS41からPEnに対する使用権限付与期間開始イベントの発生状態を保持するフィールド値を偽にクリア(T1021A)し、続いて、共有リソース30の使用を伴う処理S4003Aを実行する。第2および第2の制御フローと同様、アプリケーションS40は、ハードウェアタイマチャネルS41がカウント動作状態の期間共有リソース30を占有して使用可能である一方、使用権限の付与終了タイミングを通知する権限付与期間終了イベント発生を要因とする割り込み要求が発生するまでには、処理S4003Aを終了しなければならないものとする。 The application S40 that has detected the interrupt request T4121A caused by the usage authorization period start event by the hardware timer channel S41 for Pen executes the process S4021A related to the start of the usage authorization period. That is, in the interrupt factor register 635A provided in the interrupt request control unit 630A of the usage authority control device 60A, the field value for holding the occurrence state of the usage authority grant period start event for the PEN from the hardware timer channel S41 for Pen is falsely cleared ( T1021A), and subsequently, the process S4003A accompanied by the use of the shared resource 30 is executed. Similar to the second and second control flows, in the application S40, while the hardware timer channel S41 can occupy and use the shared resource 30 during the counting operation state, the application S40 grants the permission to notify the end timing of granting the usage permission. It is assumed that the process S4003A must be terminated before the interrupt request caused by the occurrence of the period end event is generated.

PE0およびPEn用ハードウェアタイマチャネルS11、S41が同時起動要求(T1018A、T1019A)によりカウント動作状態に遷移した後、各ハードウェアタイマチャネルS11、S41の初期カウント値レジスタ617に設定された時間、すなわち制御テーブルS20内のPEnに割り当て可能な制御周期内残り時間(RT)フィールドに指定された時間が経過すると、使用権限制御装置60Aの割り込み要求制御部630Aが備える割り込み要因レジスタ635Aにおいて、ハードウェアタイマチャネルS11からPE0に対する使用権限付与期間終了イベント、およびハードウェアタイマチャネルS41からPEnに対する使用権限付与期間終了イベントの発生状態を保持するフィールド値がそれぞれ真にセットされる。本制御フローでは、当該イベントを要因とする割り込みを許可に設定しているため、ハードウェアタイマチャネルS11、S41は、図21に示すように、当該イベントを要因とする使用権限付与期間の終了を通知する割り込みを、使用権限割り込み信号を経由し、それぞれPE0(T1102A)、PEn(T4101A)に同時に要求する。 After the hardware timer channels S11 and S41 for PE0 and PEn transition to the counting operation state by the simultaneous start request (T1018A, T1019A), the time set in the initial count value register 617 of each hardware timer channel S11, S41, that is, When the time specified in the remaining time (RT) field in the control cycle that can be assigned to PEn in the control table S20 elapses, the hardware timer is set in the interrupt factor register 635A provided in the interrupt request control unit 630A of the usage authority control device 60A. The field values that hold the occurrence status of the usage authority granting period end event from the channel S11 to PE0 and the usage authority granting period end event from the hardware timer channel S41 to PEn are set to true. In this control flow, since the interrupt caused by the event is set to allow, the hardware timer channels S11 and S41 terminate the usage authority granting period caused by the event, as shown in FIG. 21. The interrupt to be notified is simultaneously requested to PE0 (T1102A) and PEn (T4101A), respectively, via the usage authority interrupt signal.

PEn用ハードウェアタイマチャネルS41による、使用権限付与期間終了イベントを要因とする割り込み要求を検出したアプリケーションS40は、使用権限付与期間終了に係る処理S4004Aを実行する。 The application S40 that has detected an interrupt request caused by the usage authority granting period end event by the hardware timer channel S41 for Pen executes the process S4004A related to the end of the usage permission granting period.

(1)使用権限制御装置60Aの割り込み要求制御部630Aが備える割り込み要因レジスタ635Aにおいて、PEnを対象とする全イベントの発生を保持するフィールド値を偽にクリアし、さらに望ましくは、ハードウェアタイマチャネルS41がカウント動作状態を継続している場合には、停止トリガレジスタ626への書き込みにより、ハードウェアタイマチャネルS41の停止を要求する(T4005A)。この結果、ハードウェアタイマチャネルS41はカウント停止状態S4103Aに遷移する。 (1) In the interrupt factor register 635A provided in the interrupt request control unit 630A of the usage authority control device 60A, the field value for holding the occurrence of all events targeting PEn is falsely cleared, and more preferably, the hardware timer channel. When S41 continues the counting operation state, the hardware timer channel S41 is requested to be stopped by writing to the stop trigger register 626 (T4005A). As a result, the hardware timer channel S41 transitions to the count stop state S4103A.

(2)必要に応じて、アプリケーションS40は割り込みからの回復処理、共有リソース使用権限が不要かつ当該制御周期内に実行すべき処理など、所定の後処理S4005Aを実行する。 (2) If necessary, the application S40 executes predetermined post-processing S4005A, such as recovery processing from an interrupt, processing that does not require shared resource use authority and should be executed within the control cycle.

PE0用ハードウェアタイマチャネルS11による、使用権限付与期間終了イベントを要因とする割り込み要求を検出した共有リソース管理プログラムS10は、使用権限付与期間終了に係る処理S1063Aとして、以下の処理を順次実行する。 The shared resource management program S10 that has detected an interrupt request caused by the usage authority grant period end event by the hardware timer channel S11 for PE0 sequentially executes the following processes as the process S1063A related to the end of the usage permission grant period.

(1)使用権限制御装置60Aの割り込み要求制御部630Aが備える割り込み要因レジスタ635Aにおいて、PE0を対象とする全イベントの発生状態を保持するフィールド値を偽にクリアし、さらに望ましくは、ハードウェアタイマチャネルS11がカウント動作状態を継続している場合には、停止トリガレジスタ626への書き込みにより、ハードウェアタイマチャネルS11の停止を要求する(T1020A)。この結果、ハードウェアタイマチャネルS11はカウント停止状態S1105Aへ遷移する。 (1) In the interrupt factor register 635A provided in the interrupt request control unit 630A of the usage authority control device 60A, the field value holding the occurrence state of all events targeting PE0 is falsely cleared, and more preferably, the hardware timer. When the channel S11 continues the counting operation state, the hardware timer channel S11 is requested to be stopped by writing to the stop trigger register 626 (T1020A). As a result, the hardware timer channel S11 transitions to the count stop state S1105A.

(2)安全対応のオプション処理として、割り込み要因レジスタ635Aにおいて、PEnを対象とする全イベントの発生状態を保持するフィールド値を偽にクリアするとともに、停止トリガレジスタ626への書き込みにより、PEn用ハードウェアタイマチャネルS41の停止を要求する(T1021A)。 (2) As an optional process for safety, in the interrupt factor register 635A, the field value that holds the occurrence state of all events targeting PEn is falsely cleared, and the hardware for Pen is written by writing to the stop trigger register 626. Request the stop of the wear timer channel S41 (T1021A).

(3)制御テーブルS20に関しては、PEnの使用権限付与中フラグ(IU)フィールド値をクリア(偽に設定)(T1022A)し、どのPE0、PEn、PEmも使用権限を保持していない状態S2005Aに更新する。 (3) Regarding the control table S20, the flag (IU) field value for which the usage authority of Pen is granted is cleared (set to false) (T1022A), and no PE0, Pen, or Pem holds the usage authority in S2005A. Update.

(4)続いて、PEnの制御周期内権限再付与(RG)フィールドの設定に応じ、PEnの制御周期内残り時間(RT)フィールド値を更新する。本制御フローでは、RGフィールドを無効(再付与禁止)に設定しており、その場合には、誤って再度PEnに対する使用権限付与が行われないよう、RTフィールド値を残り時間ゼロに相当する換算値に更新(T1023A)する。 (4) Subsequently, the remaining time (RT) field value in the control cycle of the PEN is updated according to the setting of the authority reassignment (RG) field in the control cycle of the PEN. In this control flow, the RG field is set to invalid (reassignment prohibited), and in that case, the RT field value is converted to zero remaining time so that the usage authority is not granted to PEn again by mistake. Update to the value (T1023A).

(5)PEnの制御周期内残り時間がゼロとなった場合、表バンク側である使用要求レジスタバンクS32が備える共有リソース使用要求クリアレジスタ530への書き込みにより、PEnの使用要求フラグをクリア(T1067)する。この結果、使用要求レジスタバンクS32は、PEmの使用要求フラグがセットされた状態S3264となる。 (5) When the remaining time in the control cycle of PEn becomes zero, the usage request flag of PEn is cleared by writing to the shared resource usage request clear register 530 provided in the usage request register bank S32 on the table bank side (T1067). )do. As a result, the usage request register bank S32 is in the state S3264 in which the usage request flag of PEm is set.

共有リソース管理プログラムS10は、続いて、PEnの次に使用権限の付与先となるPEの特定と、特定したPEに対する共有リソース30の権限付与に係る一連の処理S1007Aを実行する。具体的な手順は以下のとおりである。 The shared resource management program S10 subsequently executes a series of processes S1007A relating to the identification of the PE to which the usage authority is granted next to the PEn and the authorization of the shared resource 30 to the identified PE. The specific procedure is as follows.

(1)制御テーブルS20の制御周期内権限付与順序(OR)フィールドを参照し、次に使用権限を付与すべきサテライトPEを特定する。特定したPE(PEmとする)の使用権限付与中フラグ(IU)フィールド値をセット(真に設定)(T1025A)し、制御テーブルS20の状態を、PEmが使用権限を保持している状態S2006Aに更新する。 (1) With reference to the authority granting order (OR) field within the control cycle of the control table S20, the satellite PE to which the usage authority should be granted is specified next. Set (true set) (T1025A) the flag (IU) field value for granting the usage authority of the specified PE (referred to as PEm), and change the state of the control table S20 to the state S2006A in which the PEm holds the usage authority. Update.

(2)PE0用ハードウェアタイマチャネルS11を、次の使用権限付与先であるPEm用ハードウェアタイマチャネル(図示せず)のレプリカとして動作させるため、制御テーブルS20の設定のうち、PEmの制御周期内残り時間(RT)フィールド値を、ハードウェアタイマチャネルS11の初期カウント値レジスタ617に設定(T1026A)する。 (2) In order to operate the hardware timer channel S11 for PE0 as a replica of the hardware timer channel S11 for PEm (not shown) to which the next usage authority is granted, the control cycle of PEm among the settings of the control table S20 The remaining time (RT) field value is set in the initial count value register 617 of the hardware timer channel S11 (T1026A).

(3)使用権限制御装置60Aが備える開始トリガレジスタ625への書き込みにより、PE0用ハードウェアタイマチャネルS11とPEm用ハードウェアタイマチャネル(図示せず)の同時起動を要求(T1027A、T1028A)する。起動要求を受けたハードウェアタイマチャネルS11は動作状態(S1106A)に遷移し、当該ハードウェアタイマチャネルS11の現カウント値レジスタ616にコピーされた初期カウント値レジスタ67の値を初期値として、所定の条件に基づくデクリメント動作を開始する。図示しないPEm用ハードウェアタイマチャネルも、同様の手順によりデクリメント動作を開始し、共有リソース使用権限をPEmに対し付与中であることを示すカウント動作状態となる。 (3) By writing to the start trigger register 625 included in the usage authority control device 60A, simultaneous activation of the hardware timer channel S11 for PE0 and the hardware timer channel for PEm (not shown) is requested (T1027A, T1028A). The hardware timer channel S11 that has received the start request transitions to the operating state (S1106A), and a predetermined value is set as the initial value of the initial count value register 67 copied to the current count value register 616 of the hardware timer channel S11. Start the condition-based decrement operation. The hardware timer channel for PEm (not shown) also starts the decrement operation by the same procedure, and becomes a count operation state indicating that the shared resource use authority is being granted to the PEm.

第1の制御フローと比較し、本制御フローによれば、制御周期の一部を使用要求受け付けウィンドウ期間として設定する必要がなくなり、使用要求受け付けウィンドウ期間に相当する時間を、各サテライトPEにおける各種処理や共有リソース30の使用に割り当てることができ、CPUコア等の計算リソースおよび共有リソース30の利用効率をさらに向上させることができる。加えて、サテライトPEからの共有リソース使用要求タイミングに関する時間制約が大幅に緩和される他、制御周期を単位とするソフトウェアパイプライン処理の実装との親和性が高く、アプリケーションの移植を容易化することができる。 Compared with the first control flow, according to this control flow, it is not necessary to set a part of the control cycle as the usage request acceptance window period, and the time corresponding to the usage request acceptance window period can be set in various satellite PEs. It can be allocated to processing and use of the shared resource 30, and the utilization efficiency of the computational resource such as the CPU core and the shared resource 30 can be further improved. In addition, the time constraint regarding the timing of the shared resource usage request from the satellite PE is greatly relaxed, and it has a high affinity with the implementation of software pipeline processing in units of control cycles, facilitating application porting. Can be done.

図22は、図1のマイコンにおける使用権限の付与順序決定処理を示すフローチャートである。図22では、これまで例示した4つの典型的な共有リソース使用権限付与制御フローのうち、本処理開始時点で共有リソース使用要求フラグレジスタ510に蓄積された1以上の共有リソース使用要求に関し、すべての使用要求を対象に現制御周期内の使用権限付与順序を一括して決定する、処理S1004およびS1004Aの詳細フローを示す。 FIG. 22 is a flowchart showing a process of determining the order of granting usage authority in the microcomputer of FIG. In FIG. 22, among the four typical shared resource usage authority grant control flows exemplified so far, all of the one or more shared resource usage requests accumulated in the shared resource usage request flag register 510 at the start of this process. The detailed flow of the process S1004 and S1004A which collectively determines the order of granting the use authority in the current control cycle for the use request is shown.

ここで、マイコン1、1Bが備える複数のPE10、20-1、20-2、20-3には、それぞれ固有の値をもつPE識別子(ゼロまたは正の整数値、ただしゼロはPE0を示す)が割り当てられている。制御テーブル140内の基本優先度(PR)フィールドに設定可能な値はゼロ(優先度最高、ただしPE0にのみ設定可能とする)または所定の最大値(優先度最低)以下の正の整数値のいずれかである。同じ優先度を持つPE間ではPE識別子の値が小さいものほど高優先度として扱う。また、制御周期内権限付与順序(OR)フィールドに設定する、共有リソース使用権限の付与順序を示す値は、当該制御周期内の付与対象のPEについてはゼロまたはPE数未満の正の整数値のいずれか、付与対象外のPEについては負の整数値(例えば、-1)であり、値ゼロが設定されたPEから昇順に権限付与を行うものとする。 Here, each of the plurality of PE10, 20-1, 20-2, and 20-3 included in the microcomputers 1 and 1B has a PE identifier having a unique value (zero or positive integer value, where zero indicates PE0). Is assigned. The value that can be set in the basic priority (PR) field in the control table 140 is zero (highest priority, but can be set only for PE0) or a positive integer value less than or equal to the predetermined maximum value (lowest priority). Either. Among PEs with the same priority, the smaller the value of the PE identifier, the higher the priority. In addition, the value indicating the order of granting the authority to use the shared resource set in the authority grant order (OR) field within the control cycle is zero or a positive integer value less than the number of PEs for the PE to be granted within the control cycle. Any PE that is not subject to grant has a negative integer value (for example, -1), and the authority is granted in ascending order from the PE for which the value zero is set.

図22において、内部パラメータである順序カウンタNおよび優先度カウンタPをそれぞれゼロに初期化(S901)する。続いて、本処理開始前に読み出した共有リソース使用要求フラグレジスタ510の内容から、共有リソース30の使用要求の有無をチェック(S902)し、使用要求が1つもない場合(S902:No)には、使用権限付与の対象外となった全PEについてORフィールド値を-1に設定(S910)し、本処理を終了する。 In FIG. 22, the order counter N and the priority counter P, which are internal parameters, are initialized to zero (S901), respectively. Subsequently, the presence / absence of a usage request for the shared resource 30 is checked (S902) from the contents of the shared resource usage request flag register 510 read before the start of this process, and if there is no usage request (S902: No). , The OR field value is set to -1 (S910) for all PEs that are not subject to the grant of usage authority, and this process is terminated.

1以上のPEから使用要求があった場合(S902:Yes)は、制御テーブル140内をPEごとにスキャンする内部パラメータとして、PEカウンタCをゼロに初期化(S903)する。続いて、PE識別子がPEカウンタCの値と一致するPEについて、使用権限付与の対象となり得るかの判定処理として、当該PEのイネーブル(EN)フィールド値が真(有効)、かつ基本優先度(PR)フィールド値が優先度カウンタPの値に一致し、かつ制御周期内残り時間(RT)フィールド値がゼロではない換算値であるかを制御テーブルで確認し、加えて当該PEからの使用要求があるかどうかをチェック(S904)する。付与対象PEであると判定された場合(S904:Yes)には、当該PEのORフィールドに順序カウンタNの値を設定した後、順序カウンタNをインクリメント(S905)する。付与対象PEではないと判定された場合(S904:No)には処理S905をスキップする。 When there is a usage request from one or more PEs (S902: Yes), the PE counter C is initialized to zero (S903) as an internal parameter for scanning the control table 140 for each PE. Subsequently, as a process of determining whether or not the PE whose PE identifier matches the value of the PE counter C can be the target of granting the usage authority, the enable (EN) field value of the PE is true (valid) and the basic priority (basic priority). PR) Check in the control table whether the field value matches the value of the priority counter P and the remaining time (RT) field value in the control cycle is a non-zero conversion value, and in addition, the usage request from the PE. Check if there is (S904). When it is determined that the PE is a grant target PE (S904: Yes), the value of the order counter N is set in the OR field of the PE, and then the order counter N is incremented (S905). If it is determined that the PE is not the grant target PE (S904: No), the process S905 is skipped.

続いて、PEカウンタCをインクリメント(S906)し、PEカウンタCの値が最大値、すなわち((マイコン1、1Bの備えるPE数)-1)以上であるかどうかをチェック(S907)する。処理S907の結果が不成立の場合(S907:No)には処理S904に戻る。 Subsequently, the PE counter C is incremented (S906), and it is checked (S907) whether or not the value of the PE counter C is the maximum value, that is, ((the number of PEs included in the microcomputers 1 and 1B) -1) or more. If the result of the process S907 is unsuccessful (S907: No), the process returns to the process S904.

処理S907の結果が成立の場合(S907:Yes)、次に低い優先度を持つPEに関して同様の処理、すなわち制御テーブル140内のPE単位での設定スキャンと使用権限の付与対象PEへの付与順序設定を実行するため、優先度カウンタPをインクリメント(S908)し、優先度カウンタPの値が所定の最大値以上であるかどうかをチェック(S909)する。処理S909の結果が不成立の場合(S909:No)には処理S903に戻り、成立の場合(S909:Yes)には、使用権限付与の対象外となった全PEについてORフィールド値を-1に設定(S910)し、本処理を終了する。 When the result of the process S907 is established (S907: Yes), the same process is performed for the PE having the next lowest priority, that is, the setting scan for each PE in the control table 140 and the order of granting the usage authority to the PE to be granted. In order to execute the setting, the priority counter P is incremented (S908), and it is checked whether the value of the priority counter P is equal to or greater than a predetermined maximum value (S909). If the result of process S909 is unsuccessful (S909: No), the process returns to process S903, and if it is established (S909: Yes), the OR field value is set to -1 for all PEs that are not subject to use permission. Set (S910) and end this process.

図23は、図1のマイコンにおける使用権限の付与先決定処理を示すフローチャートである。図23では、これまで例示した4つの典型的な共有リソース使用権限付与制御フローのうち、本処理開始時点で共有リソース使用要求フラグレジスタ510に蓄積された1以上の共有リソース使用要求に関し、最も優先度の高い1つのPEを次の使用権限付与先として決定する処理S1041およびS1045の詳細フローを示す。 FIG. 23 is a flowchart showing a process of determining the grantee of the usage authority in the microcomputer of FIG. In FIG. 23, among the four typical shared resource usage authority grant control flows exemplified so far, the highest priority is given to one or more shared resource usage requests stored in the shared resource usage request flag register 510 at the start of this process. The detailed flow of the process S1041 and S1045 which determines one PE with a high degree as the next use authority grant destination is shown.

ここで、マイコン1、1Bが備える複数のPE10、20-1、20-2、20-3にはそれぞれ固有の値をもつPE識別子(ゼロまたは正の整数値、ただしゼロはPE0を示す)が割り当てられている。制御テーブル140内の基本優先度(PR)フィールドに設定可能な値はゼロ(優先度最高、ただしPE0にのみ設定可能とする)または所定の最大値(優先度最低)以下の正の整数値のいずれかである。同じ優先度を持つPE間ではPE識別子の値が小さいものほど高優先度として扱う。図22の処理とは異なり、制御周期内権限付与順序(OR)フィールドの更新は行わない。 Here, each of the plurality of PE10, 20-1, 20-2, and 20-3 included in the microcomputers 1 and 1B has a PE identifier (zero or a positive integer value, where zero indicates PE0) having a unique value. Assigned. The value that can be set in the basic priority (PR) field in the control table 140 is zero (highest priority, but can be set only for PE0) or a positive integer value less than or equal to the predetermined maximum value (lowest priority). Either. Among PEs with the same priority, the smaller the value of the PE identifier, the higher the priority. Unlike the process of FIG. 22, the authority granting order (OR) field within the control cycle is not updated.

図23において、内部パラメータである優先度カウンタPをゼロに初期化(S921)する。続いて、本処理開始前の読み出した共有リソース使用要求フラグレジスタ510の内容から、使用要求の有無をチェック(S922)し、使用要求が1つもない場合(S922:No)には、次の権限付与先PEがない場合の所定の処理S930を実行した後、本処理を終了する。 In FIG. 23, the priority counter P, which is an internal parameter, is initialized to zero (S921). Subsequently, the presence / absence of a usage request is checked (S922) from the contents of the shared resource usage request flag register 510 read before the start of this processing, and if there is no usage request (S922: No), the following authority is given. After executing the predetermined process S930 when there is no grant destination PE, this process ends.

1以上のPEから使用要求があった場合(S922:Yes)は、制御テーブル140内をPEごとにスキャンする内部パラメータとして、PEカウンタCをゼロに初期化(S923)する。続いて、PE識別子がPEカウンタCの値と一致するPEについて、使用権限付与の対象となりうるかの判定処理として、当該PEのイネーブル(EN)フィールド値が真(有効)、かつ基本優先度(PR)フィールド値が優先度カウンタPの値に一致し、かつ制御周期内残り時間(RT)フィールド値がゼロではない換算値であるかを制御テーブル140で確認し、加えて当該PEからの使用要求があるかどうかをチェック(S924)する。付与対象PEであると判定された場合(S924:Yes)には、当該PEを次の付与先に決定(S925)し、本処理を終了する。 When there is a usage request from one or more PEs (S922: Yes), the PE counter C is initialized to zero (S923) as an internal parameter for scanning the control table 140 for each PE. Subsequently, as a process of determining whether or not the PE whose PE identifier matches the value of the PE counter C can be the target of granting usage authority, the enable (EN) field value of the PE is true (valid) and the basic priority (PR). ) Check with the control table 140 whether the field value matches the value of the priority counter P and the remaining time in the control cycle (RT) field value is a non-zero conversion value, and in addition, the usage request from the PE. Check if there is (S924). When it is determined that the PE is to be granted (S924: Yes), the PE is determined as the next grant destination (S925), and this process is terminated.

処理S924の結果が不成立の場合(S924:No)、PEカウンタCをインクリメント(S926)し、PEカウンタCの値が最大値、すなわち((マイコン1、1Bの備えるPE数)-1)以上であるかどうかをチェック(S927)する。処理S927の結果が不成立の場合(S927:No)には処理S924に戻る。 When the result of the process S924 is unsuccessful (S924: No), the PE counter C is incremented (S926), and the value of the PE counter C is the maximum value, that is, ((the number of PEs of the microcomputers 1 and 1B) -1) or more. Check if there is (S927). If the result of the process S927 is unsuccessful (S927: No), the process returns to the process S924.

処理S927の結果が成立の場合(S927:Yes)、次に低い優先度を持つPEに関して同様の処理、すなわち制御テーブル140内のPE単位での設定スキャンを実行するため、優先度カウンタPをインクリメント(S928)し、優先度カウンタPの値が所定の最大値以上であるかどうかをチェック(S929)する。処理S929の結果が不成立の場合(S929:No)には処理S923に戻り、成立の場合(S929:Yes)には、次の権限付与先PEがない場合の所定の処理S930を実行した後、本処理を終了する。 When the result of the process S927 is satisfied (S927: Yes), the priority counter P is incremented in order to execute the same process for the PE having the next lowest priority, that is, the setting scan for each PE in the control table 140. (S928), and it is checked whether or not the value of the priority counter P is equal to or greater than a predetermined maximum value (S929). If the result of the process S929 is unsuccessful (S929: No), the process returns to the process S923, and if the result is established (S929: Yes), after executing the predetermined process S930 when there is no next authorization destination PE, This process ends.

以上説明したように、上述した実施形態によれば、スピンロック処理を用いたアクセス排他制御に比べ、演算要素および共有リソースの利用効率の向上を図ることが可能となるとともに、ユーザが規定する制御ポリシに基づく厳密なスケジューリング制御およびハードリアルタイム性が要求される応用に好適な時間粒度の小さいリソース共有制御を実現することができる。加えて、演算に関与しない処理を削減することでリソース共有制御に係る消費電力を低減することができる。 As described above, according to the above-described embodiment, it is possible to improve the utilization efficiency of arithmetic elements and shared resources as compared with the access exclusive control using the spinlock process, and the control specified by the user. It is possible to realize resource sharing control with a small time particle size suitable for applications that require strict scheduling control based on policies and hard real-time performance. In addition, it is possible to reduce the power consumption related to the resource sharing control by reducing the processing that is not involved in the calculation.

図24は、図1または図4のマイコンの図8(a)の動作時における消費電力の時間変化の一例を示す図である。
図24において、マイコン1、1Bでは全体の消費電力が平均化されているだけでなく、共有制御に要する消費電力そのものも、ほぼ共有リソース管理プログラムが動作する1つのPE分で上限が決まるため、消費電力の低減に寄与している。
FIG. 24 is a diagram showing an example of a time change in power consumption during the operation of the microcomputer of FIG. 1 or FIG. 4 (a).
In FIG. 24, not only the overall power consumption of the microcomputers 1 and 1B is averaged, but also the upper limit of the power consumption itself required for the shared control is almost determined by one PE in which the shared resource management program operates. It contributes to the reduction of power consumption.

図25は、図1または図4のマイコンの図8(b)の動作時における消費電力の時間変化の一例を示す図である。
図25において、図8(a)の方法では、共有リソース使用要求R、使用権限の付与順序の決定A、ハードウェアタイマチャネルの設定および起動S、アプリケーションの実行Uが時系列的に実行される。これに対して、図8(a)の方法では、共有リソース使用要求Rは、使用権限の付与順序の決定A、ハードウェアタイマチャネルの設定および起動S、またはアプリケーションの実行Uと並列に実行される。
このため、図8(b)の方法では、共有リソース使用要求Rがあると、その処理に必要な消費電力が図8(a)の方法の消費電力に上乗せされる。
FIG. 25 is a diagram showing an example of time-dependent changes in power consumption during operation of the microcomputer of FIG. 1 or FIG. 4 (b).
In FIG. 25, in the method of FIG. 8A, the shared resource usage request R, the determination A of the granting order of the usage authority, the setting and starting S of the hardware timer channel, and the execution U of the application are executed in chronological order. .. On the other hand, in the method of FIG. 8A, the shared resource usage request R is executed in parallel with the determination A of the granting order of the usage authority, the setting and starting S of the hardware timer channel, or the execution U of the application. To.
Therefore, in the method of FIG. 8B, when there is a shared resource usage request R, the power consumption required for the processing is added to the power consumption of the method of FIG. 8A.

図26は、本実施形態の比較例に係るマイコンの構成例を示すブロック図である。
図26において、マイコン1001は、内蔵機能モジュールとして、複数のPE1010-0、1010-1、1010-2、1010-3、共有リソース1030、共有リソース1030のロック状態を保持するロック変数レジスタ1080を含む。PE1010-0、1010-1、1010-2、1010-3は、演算要素として用いることができる。PE1010-0、1010-1、1010-2、1010-3、共有リソース1030およびロック変数レジスタ1080はPE間接続バス1040を介して相互接続される。
FIG. 26 is a block diagram showing a configuration example of a microcomputer according to a comparative example of the present embodiment.
In FIG. 26, the microcomputer 1001 includes, as a built-in function module, a lock variable register 1080 that holds a lock state of a plurality of PE1010-0, 1010-1, 1010-2, 1010-3, a shared resource 1030, and a shared resource 1030. .. PE1010-0, 1010-1, 1010-2, 1010-3 can be used as an arithmetic element. PE1010-0, 1010-1, 1010-2, 1010-3, shared resource 1030 and lock variable register 1080 are interconnected via the PE-to-PE connection bus 1040.

各PE1010-0、1010-1、1010-2、1010-3は、所定の命令セットアーキテクチャに従って作成されたプログラムを実行する1つ以上のCPUコア1100、CPUコア1100で実行されるプログラムからのアクセス要求に応じて、当該PEとPE間接続バス1040との間のアクセスを制御するバスインタフェース1120、プログラム、および/またはプログラム実行に必要なデータを格納するキャッシュメモリおよび/またはRAMメモリからなるPE内部メモリ1130を含む。バスインタフェース1120はバスインタフェース接続インタフェース1121により、PE内部メモリ1130はPE内部メモリ-CPUコア間接続インタフェース1132により、それぞれCPUコア1100との間で相互接続される。さらに、PE内部メモリ1130はPE内部メモリ-バスインタフェース間接続インタフェース1131により、バスインタフェース1120との間で相互接続される。 Each PE 1010-0, 1010-1, 1010-2, 1010-3 is accessed by one or more CPU cores 1100, a program executed by the CPU core 1100, which executes a program created according to a predetermined instruction set architecture. Inside the PE, which consists of a bus interface 1120 that controls access between the PE and the connection bus 1040 between PEs, a program, and / or a cache memory and / or a RAM memory that stores data necessary for program execution, upon request. Includes memory 1130. The bus interface 1120 is interconnected with the CPU core 1100 by the bus interface connection interface 1121 and the PE internal memory 1130 is interconnected with the CPU core 1100 by the PE internal memory-CPU core connection interface 1132. Further, the PE internal memory 1130 is interconnected with the bus interface 1120 by the PE internal memory-bus interface connection interface 1131.

共有リソース1030は、複数のPE1010-0、1010-1、1010-2、1010-3で動作するアプリケーションが時分割の態様で共有する資源である。共有リソース1030は、例えば、マイコン1001の外部に接続されたハードウェアとの通信を制御する通信モジュールのような、1つ以上のマイコン内蔵周辺モジュールや、PE内部もしくは外部に接続された1つ以上のメモリのうちの少なくとも一部領域であってよい。説明を簡単にするため、共有リソース1030は1つのみ図示するが、2つ以上であっても構わない。 The shared resource 1030 is a resource shared by applications operating on a plurality of PEs 1010-0, 1010-1, 1010-2, and 1010-3 in a time-division manner. The shared resource 1030 may be one or more peripheral modules with built-in microcomputers such as a communication module that controls communication with hardware connected to the outside of the microcomputer 1001, or one or more connected to the inside or outside of the PE. It may be at least a part of the memory of. For the sake of simplicity, only one shared resource 1030 is shown, but there may be two or more.

ロック変数レジスタ1080は、PE間接続バス1040を経由して各PE1010-0、1010-1、1010-2、1010-3からアクセス可能とされ、マイコン1001のもつアドレス空間上の一部領域に配置される。ロック変数レジスタ1080は共有リソース1030ごとに設けられ、当該共有リソース1030が使用中(ロック状態)であるか否かを示すフラグを保持する。 The lock variable register 1080 is accessible from each PE 1010-0, 1010-1, 1010-2, 1010-3 via the PE-to-PE connection bus 1040, and is arranged in a part of the address space of the microcomputer 1001. Will be done. The lock variable register 1080 is provided for each shared resource 1030, and holds a flag indicating whether or not the shared resource 1030 is in use (locked state).

図27は、図26のマイコンにおけるロック変数を利用したアクセス排他制御方法を示すタイミングチャートである。
図27において、ロック変数レジスタ1080に保持されるロック変数は、非ロック状態(OFF)またはロック状態(ON)のいずれかの状態をも持つ。各PE1010-0、1010-1、1010-2、1010-3で動作するアプリケーションが共有リソース1030を使用する場合、アプリケーションは実際の使用に先立ちロック変数の状態をチェックし、非ロック状態であれば、ロック変数をロック状態に設定(P)することでロックを取得する。ロックを取得したPEは、共有リソース1030を使用する処理を実行(U)する。処理が終了すると、ロックを取得したPEは、ロック変数を非ロック状態に設定(V)することで、共有リソース1030を解放する。
FIG. 27 is a timing chart showing an access exclusive control method using a lock variable in the microcomputer of FIG. 26.
In FIG. 27, the lock variable held in the lock variable register 1080 has either an unlocked state (OFF) or a locked state (ON). If the application running on each PE 1010-0, 1010-1, 1010-2, 1010-3 uses the shared resource 1030, the application checks the state of the lock variable prior to actual use, and if it is in the unlocked state. , The lock is acquired by setting the lock variable to the locked state (P). The PE that has acquired the lock executes (U) a process that uses the shared resource 1030. When the processing is completed, the PE that has acquired the lock releases the shared resource 1030 by setting the lock variable to the unlocked state (V).

ここで、複数のPE1010-0、1010-1、1010-2、1010-3が同時に共有リソース1030の使用を要求した場合、ロック取得に失敗したPEは、ロック変数が非ロック状態になるまでロック変数をチェックし続けるスピンロック(SL)処理を実行する。そして、ロック取得に失敗したPEは、ロック変数が非ロック状態になった時にロックを取得することにより、共有リソース1030に対する排他アクセスを実現できる。 Here, when a plurality of PEs 1010-0, 1010-1, 1010-2, and 1010-3 simultaneously request the use of the shared resource 1030, the PEs that fail to acquire the lock are locked until the lock variable is in the unlocked state. Perform a spinlock (SL) process that keeps checking variables. Then, the PE that fails to acquire the lock can realize exclusive access to the shared resource 1030 by acquiring the lock when the lock variable is in the unlocked state.

図28は、図26のマイコンにおける消費電力の時間変化の一例を示す図である。
図28において、図24および図25の消費電力と同一条件で比較するため、各PE1010-1、1010-2、1010-3では、共有リソース使用権限の付与が必要な1つのタスクのみ実行する場合を想定している。比較例では、特に複数のPE1010-1、1010-2、1010-3が、スピンロックしながら使用権限の付与を長時間待ち続けている期間の消費電力が大きく、マイコン1001全体のピークおよび平均消費電力を押し上げている。
FIG. 28 is a diagram showing an example of time change of power consumption in the microcomputer of FIG. 26.
In FIG. 28, in order to compare with the power consumption of FIGS. 24 and 25 under the same conditions, in each PE1010-1, 1010-2, 1010-3, when only one task for which the shared resource use authority needs to be granted is executed. Is assumed. In the comparative example, in particular, a plurality of PE1010-1, 1010-2, and 1010-3 have large power consumption during a long period of waiting for the granting of usage authority while spinlocking, and the peak and average consumption of the entire microcomputer 1001. It is pushing up the power.

スピンロック(SL)処理による消費電力は、同時に共有リソース1030の使用を要求するPEの個数に比例して増大する。このため、マイコン1001に搭載されるPEの個数の増大に伴ってマイコン1001全体のピークの消費電力が増大する。 The power consumption of the spinlock (SL) process increases in proportion to the number of PEs that require the use of the shared resource 1030 at the same time. Therefore, as the number of PEs mounted on the microcomputer 1001 increases, the peak power consumption of the entire microcomputer 1001 increases.

これに対して、図1および図4のマイコン1、1Bでは、スピンロック(SL)処理を実行することなく、共有リソース1030に対する排他アクセスを実現することができ、その分に対応した消費電力を削減することができる。このため、マイコン1、1Bに搭載されるPEの個数が増大した場合においても、マイコン1、1B全体のピークの消費電力の増大を防止することができる。 On the other hand, in the microcomputers 1 and 1B of FIGS. 1 and 4, exclusive access to the shared resource 1030 can be realized without executing the spinlock (SL) process, and the power consumption corresponding to that amount can be realized. Can be reduced. Therefore, even when the number of PEs mounted on the microcomputers 1 and 1B increases, it is possible to prevent an increase in the peak power consumption of the entire microcomputers 1 and 1B.

1、1B:マイコン、10、20-1、20-2、20-3:演算要素(プロセッサエレメント、PE)、30:共有リソース、40:PE間接続バス、50:使用要求レジスタ、50-0、50-1:使用要求レジスタバンク、60、60A:使用権限制御装置、61、62-1、62-2、62-3:使用権限制御割り込み信号、70:PE間割り込み制御装置、71-0、71-1、71-2、71-3:PE間割り込み信号、100:CPUコア、110:割り込みコントローラ、111:割り込みコントローラ接続インタフェース、120:バスインタフェース、121:バスインタフェース接続インタフェース、130:PE内部メモリ、131:PE内部メモリ-バスインタフェース間接続インタフェース、132:PE内部メモリ-CPUコア間接続インタフェース、140:制御テーブル、141:制御テーブル接続インタフェース、510:共有リソース使用要求フラグレジスタ、520-0、520-1、520-2、520-3:共有リソース使用要求セットレジスタ、530:共有リソース使用要求クリアレジスタ、600:バスインタフェース、610-1、610-2、610-3、610-4:ハードウェアタイマチャネル、611:ハードウェアタイマチャネル接続インタフェース、612-1、612-2、612-3、612-4:トリガ制御信号、613-1、613-2、613-3、613-4:タイマ値比較結果信号、615:チャネル状態レジスタ、616:現カウント値レジスタ、617:初期カウント値レジスタ、620:トリガ制御部、621:トリガ制御部接続インタフェース、625:開始トリガレジスタ、626:停止トリガレジスタ、630、630A:割り込み要求制御部、631:割り込み要求制御部接続インタフェース、635、635A:割り込み要因レジスタ、636、636A:割り込みイネーブルレジスタ、637:チャネルマッピングレジスタ、710-m、:PE間割り込み要求フラグレジスタ、720-n、:PE間割り込み要求セットレジスタ、730-m、:PE間割り込み要求クリアレジスタ

1, 1B: Microcomputer, 10, 20-1, 20-2, 20-3: Arithmetic element (processor element, PE), 30: Shared resource, 40: PE connection bus, 50: Usage request register, 50-0 , 50-1: Usage request register bank, 60, 60A: Usage authority control device, 61, 62-1, 62-2, 62-3: Usage authority control interrupt signal, 70: PE-to-PE interrupt control device, 71-0 , 71-1, 71-2, 71-3: Interrupt signal between PEs, 100: CPU core, 110: interrupt controller, 111: interrupt controller connection interface, 120: bus interface, 121: bus interface connection interface, 130: PE Internal memory, 131: PE internal memory-bus interface connection interface, 132: PE internal memory-CPU core connection interface, 140: control table, 141: control table connection interface, 510: shared resource usage request flag register, 520- 0,520-1,520-2,520-3: Shared resource usage request set register, 530: Shared resource usage request clear register, 600: Bus interface, 610-1, 610-2, 610-3, 610-4 : Hardware timer channel, 611: Hardware timer channel connection interface, 612-1, 612-2, 612-3, 612-4: Trigger control signal, 613-1, 613-2, 613-3, 613-4 : Timer value comparison result signal, 615: Channel status register, 616: Current count value register, 617: Initial count value register, 620: Trigger control unit, 621: Trigger control unit connection interface, 625: Start trigger register, 626: Stop Trigger register, 630, 630A: Interrupt request control unit, 631: Interrupt request control unit connection interface, 635, 635A: Interrupt factor register, 636, 636A: Interrupt enable register, 637: Channel mapping register, 710-m ,: Between PE Interrupt request flag register, 720-n :: PE-to-PE interrupt request set register, 730-m ,: PE-to-PE interrupt request clear register

Claims (10)

共有リソースの割り当てに関するポリシ情報を記憶し、前記ポリシ情報に基づいて前記共有リソースの割り当て処理を実行する第1演算装置と、
前記ポリシ情報に基づいて設定された前記共有リソースの使用権限の有無および使用許可量のうちいずれか少なくとも一方を保持する使用権限管理装置と、
前記使用権限管理装置の動作状態に基づいて前記共有リソースを排他的に使用する複数の第2演算装置と、
前記複数の第2演算装置による前記共有リソースの使用要求の有無を保持する記憶装置と、を備え、
前記第1演算装置は、
前記記憶装置に保持された要求状態および前記ポリシ情報に基づいて、前記複数の第2演算装置に前記共有リソースの使用権限を割り当て、
前記記憶装置に保持された要求状態および前記ポリシ情報に基づいて、前記複数の第2演算装置から選択した1つの第2演算装置の共有リソース使用権限が有効となるよう前記使用権限管理装置の動作状態を更新し、
前記使用許可量と所定値との比較結果に基づいて、前記選択した1つの第2演算装置の共有リソース使用権限が無効となるよう前記使用権限管理装置の動作状態を更新し、
所定の制御周期を時間単位として動作し、
前記制御周期内の所定期間に前記使用許可量を再設定し、
前記複数の第2演算装置から前記記憶装置へ通知された前記共有リソースの使用要求のうち、前記制御周期内の所定期間になされた使用要求のみ有効とするよう制御する、電子制御装置。
A first arithmetic unit that stores policy information regarding the allocation of shared resources and executes the allocation process of the shared resources based on the policy information .
A usage authority management device that holds at least one of the presence / absence of usage authority and the usage permission amount of the shared resource set based on the policy information.
A plurality of second arithmetic units that exclusively use the shared resource based on the operating state of the usage authority management device, and
A storage device for holding a request for use of the shared resource by the plurality of second arithmetic units is provided.
The first arithmetic unit is
Based on the request state held in the storage device and the policy information, the plurality of second arithmetic units are assigned the right to use the shared resource.
The operation of the usage authority management device so that the shared resource usage authority of one second arithmetic unit selected from the plurality of second arithmetic units becomes valid based on the request state held in the storage device and the policy information. Update the status,
Based on the comparison result between the usage permission amount and the predetermined value, the operating state of the usage permission management device is updated so that the shared resource usage permission of the selected second arithmetic unit becomes invalid.
Operates with a predetermined control cycle as a unit of time,
The license amount is reset during a predetermined period within the control cycle, and the license amount is reset.
An electronic control device that controls so that only the usage requests made within a predetermined period within the control cycle are valid among the usage requests of the shared resource notified from the plurality of second arithmetic units to the storage device.
前記使用権限管理装置と前記第1演算装置は、同一または異なるシリコンチップ上に実装されている請求項に記載の電子制御装置。 The electronic control device according to claim 1 , wherein the usage authority management device and the first arithmetic unit are mounted on the same or different silicon chips. 前記使用権限管理装置は、1つ以上のカウンタを備え、
所定の時間経過、または前記共有リソースへのアクセスに応じて前記カウンタのカウント値を更新する請求項に記載の電子制御装置。
The usage authority management device includes one or more counters.
The electronic control device according to claim 1 , wherein the count value of the counter is updated according to the lapse of a predetermined time or access to the shared resource.
前記使用権限管理装置は、前記カウンタのカウント動作開始を示す動作開始割り込みを前記第2演算装置に要求することにより、前記共有リソースの使用権限が前記第2演算装置に付与された状態であることを通知する請求項に記載の電子制御装置。 The usage authority management device is in a state in which the usage authority of the shared resource is granted to the second arithmetic unit by requesting the second arithmetic unit for an operation start interrupt indicating the start of counting operation of the counter. The electronic control device according to claim 3 , which notifies that. 前記使用権限管理装置は、前記カウンタのカウント値が所定値以下、もしくは未満であることを示すアンダフロー割り込みを前記第2演算装置に要求することにより、前記共有リソースの使用権限が前記第2演算装置に付与された状態ではなくなったことを通知する請求項に記載の電子制御装置。 The usage authority management device requests the second arithmetic unit for an underflow interrupt indicating that the count value of the counter is equal to or less than a predetermined value, so that the usage authority of the shared resource is the second arithmetic unit. The electronic control device according to claim 3 , which notifies that the state is no longer given to the device. 前記使用権限管理装置は、前記カウンタのカウント値が所定値以下、もしくは未満であることを示すアンダフロー割り込みを前記第2演算装置および前記第1演算装置に要求することにより、前記第1演算装置の所定の処理を起動する請求項に記載の電子制御装置。 The usage authority management device requests the second arithmetic unit and the first arithmetic unit for an underflow interrupt indicating that the count value of the counter is equal to or less than a predetermined value, thereby causing the first arithmetic unit. The electronic control device according to claim 3 , which activates the predetermined processing of the above. 前記共有リソースを使用する複数の第2演算装置と、
前記第2演算装置からの使用要求を記憶する記憶装置と、
前記共有リソースの使用のスケジューリング結果に基づいて、前記共有リソースの使用権限を前記第2演算装置に付与する使用権限制御装置とをさらに備え、
前記第1演算装置は、
前記第2演算装置からの使用要求を受け付け、
前記使用要求を受け付けた前記第2演算装置間において、前記ポリシ情報に基づいて前記共有リソースの使用のスケジューリングを実行し、
前記第2演算装置は、前記使用権限制御装置から付与された使用権限に基づいて前記共有リソースを排他的に使用する請求項1に記載の電子制御装置。
A plurality of second arithmetic units that use the shared resource, and
A storage device that stores the usage request from the second arithmetic unit, and
Further, a usage authority control device for granting the usage authority of the shared resource to the second arithmetic unit based on the scheduling result of the use of the shared resource is provided.
The first arithmetic unit is
Accepting the usage request from the second arithmetic unit,
Scheduling the use of the shared resource is executed based on the policy information between the second arithmetic units that have received the usage request.
The electronic control device according to claim 1, wherein the second arithmetic unit exclusively uses the shared resource based on the usage authority granted by the usage authority control unit.
前記使用要求受け付けと、前記共有リソースの使用のスケジューリングと、前記共有リソースの使用権限の付与が制御周期内に繰り返して実行されるか、あるいは、
前記共有リソースの使用のスケジューリングと、前記共有リソースの使用権限の付与が制御周期内に繰り返して実行され、前記使用要求受け付けが、前記共有リソースの使用のスケジューリングが実行される制御周期の前の制御周期内に実行される請求項に記載の電子制御装置。
Accepting the usage request, scheduling the use of the shared resource, and granting the permission to use the shared resource are repeatedly executed within the control cycle, or
The scheduling of the use of the shared resource and the granting of the permission to use the shared resource are repeatedly executed within the control cycle, and the acceptance of the usage request is before the control cycle in which the scheduling of the use of the shared resource is executed. The electronic control device according to claim 7 , which is executed within the control cycle.
前記使用権限制御装置は、前記第2演算装置のそれぞれと1対1に対応付けられたカウンタを備え、
前記第2演算装置は、自身に対応付けられたカウンタの動作に基づいて前記共有リソースを排他的に使用する請求項に記載の電子制御装置。
The usage authority control device includes a counter associated with each of the second arithmetic units on a one-to-one basis.
The electronic control unit according to claim 7 , wherein the second arithmetic unit exclusively uses the shared resource based on the operation of a counter associated with the second arithmetic unit.
共有リソースを使用する複数の演算装置と使用権限管理装置と記憶装置とを備え、
前記複数の演算装置は、
前記共有リソースの使用を要求し、
前記共有リソースの使用の要求に応じて前記複数の演算装置のそれぞれに時分割的に割り当てられた前記共有リソースの使用権限に基づいて、前記共有リソースを排他的に使用し、
前記複数の演算装置は、前記共有リソースの割り当てに関するポリシ情報を記憶し、前記ポリシ情報に基づいて前記共有リソースの割り当て処理を実行する第1演算装置を含み、
記使用権限管理装置は、前記ポリシ情報に基づいて設定された前記共有リソースの使用権限の有無および使用許可量のうちいずれか少なくとも一方を保持し、
前記複数の演算装置は、前記使用権限管理装置の動作状態に基づいて前記共有リソースを排他的に使用する複数の第2演算装置を含み、
前記記憶装置は、前記複数の第2演算装置による前記共有リソースの使用要求の有無を保持し、
前記第1演算装置は、
前記記憶装置に保持された要求状態および前記ポリシ情報に基づいて、前記複数の第2演算装置に前記共有リソースの使用権限を割り当て、
前記記憶装置に保持された要求状態および前記ポリシ情報に基づいて、前記複数の第2演算装置から選択した1つの第2演算装置の共有リソース使用権限が有効となるよう前記使用権限管理装置の動作状態を更新し、
前記使用許可量と所定値との比較結果に基づいて、前記選択した1つの第2演算装置の共有リソース使用権限が無効となるよう前記使用権限管理装置の動作状態を更新し、
所定の制御周期を時間単位として動作し、
前記制御周期内の所定期間に前記使用許可量を再設定し、
前記複数の第2演算装置から前記記憶装置へ通知された前記共有リソースの使用要求のうち、前記制御周期内の所定期間になされた使用要求のみ有効とするよう制御する、電子制御装置。
It is equipped with multiple arithmetic units that use shared resources, usage authority management units, and storage devices .
The plurality of arithmetic units are
Request the use of the shared resource
The shared resource is exclusively used based on the usage authority of the shared resource allocated to each of the plurality of arithmetic units in a time-division manner in response to the request for the use of the shared resource .
The plurality of arithmetic units include a first arithmetic unit that stores policy information regarding the allocation of the shared resource and executes the allocation process of the shared resource based on the policy information.
The usage authority management device holds at least one of the presence / absence of the usage authority and the usage permission amount of the shared resource set based on the policy information.
The plurality of arithmetic units include a plurality of second arithmetic units that exclusively use the shared resource based on the operating state of the usage authority management unit.
The storage device holds the presence / absence of a request for use of the shared resource by the plurality of second arithmetic units.
The first arithmetic unit is
Based on the request state held in the storage device and the policy information, the plurality of second arithmetic units are assigned the right to use the shared resource.
The operation of the usage authority management device so that the shared resource usage authority of one second arithmetic unit selected from the plurality of second arithmetic units becomes valid based on the request state held in the storage device and the policy information. Update the status,
Based on the comparison result between the usage permission amount and the predetermined value, the operating state of the usage permission management device is updated so that the shared resource usage permission of the selected second arithmetic unit becomes invalid.
Operates with a predetermined control cycle as a unit of time,
The license amount is reset during a predetermined period within the control cycle, and the license amount is reset.
An electronic control device that controls so that only the usage requests made within a predetermined period within the control cycle are valid among the usage requests of the shared resource notified from the plurality of second arithmetic units to the storage device.
JP2018008895A 2018-01-23 2018-01-23 Electronic control device Active JP6995644B2 (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP2018008895A JP6995644B2 (en) 2018-01-23 2018-01-23 Electronic control device
PCT/JP2019/001385 WO2019146509A1 (en) 2018-01-23 2019-01-18 Electronic control device
DE112019000240.6T DE112019000240T5 (en) 2018-01-23 2019-01-18 Electric control device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2018008895A JP6995644B2 (en) 2018-01-23 2018-01-23 Electronic control device

Publications (2)

Publication Number Publication Date
JP2019128711A JP2019128711A (en) 2019-08-01
JP6995644B2 true JP6995644B2 (en) 2022-01-14

Family

ID=67394969

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018008895A Active JP6995644B2 (en) 2018-01-23 2018-01-23 Electronic control device

Country Status (3)

Country Link
JP (1) JP6995644B2 (en)
DE (1) DE112019000240T5 (en)
WO (1) WO2019146509A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7448585B2 (en) 2022-05-31 2024-03-12 トヨタ自動車株式会社 Information processing device, information processing method, and information processing program

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011107939A (en) 2009-11-17 2011-06-02 Toyota Motor Corp Redundant system information processor
WO2011114496A1 (en) 2010-03-18 2011-09-22 富士通株式会社 Multi-core processor system, arbitration circuit control method, and arbitration circuit control program
JP2012150583A (en) 2011-01-18 2012-08-09 Toyota Motor Corp Multiprocessor system
JP2017228192A (en) 2016-06-24 2017-12-28 日立オートモティブシステムズ株式会社 Vehicle controller
JP2018005851A (en) 2016-07-08 2018-01-11 株式会社デンソー Electronic equipment

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07281942A (en) * 1994-04-14 1995-10-27 Asahi Kasei Micro Syst Kk Arbitration method for shared resources
JPH08287016A (en) * 1995-04-14 1996-11-01 Mitsubishi Electric Corp Cooperation work support system
US5894562A (en) * 1996-10-28 1999-04-13 Motorola, Inc. Method and apparatus for controlling bus arbitration in a data processing system
KR101696804B1 (en) * 2010-10-05 2017-01-16 삼성전자주식회사 Control apparatus and method for the resource utilization policy over the virtual environment
US10025711B2 (en) * 2012-01-16 2018-07-17 Qualcomm Incorporated Hybrid write-through/write-back cache policy managers, and related systems and methods

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011107939A (en) 2009-11-17 2011-06-02 Toyota Motor Corp Redundant system information processor
WO2011114496A1 (en) 2010-03-18 2011-09-22 富士通株式会社 Multi-core processor system, arbitration circuit control method, and arbitration circuit control program
JP2012150583A (en) 2011-01-18 2012-08-09 Toyota Motor Corp Multiprocessor system
JP2017228192A (en) 2016-06-24 2017-12-28 日立オートモティブシステムズ株式会社 Vehicle controller
JP2018005851A (en) 2016-07-08 2018-01-11 株式会社デンソー Electronic equipment

Also Published As

Publication number Publication date
JP2019128711A (en) 2019-08-01
DE112019000240T5 (en) 2020-09-17
WO2019146509A1 (en) 2019-08-01

Similar Documents

Publication Publication Date Title
US11842217B1 (en) Isolating tenants executing in multi-tenant software containers
US8966464B1 (en) Isolating tenants executing in multi-tenant software containers
US9471353B1 (en) Isolating tenants executing in multi-tenant software containers
EP0464715B1 (en) Interlock queueing
US8984245B2 (en) Memory protection unit and method for controlling an access to memory device
US9754122B1 (en) Isolating tenants executing in multi-tenant software containers
KR20170012093A (en) Fabricating method of semiconductor device
US9536075B2 (en) Dynamic resource sharing
US20150052529A1 (en) Efficient task scheduling using a locking mechanism
US20110161644A1 (en) Information processor
JP2013161299A (en) Information processing apparatus and interface access method
JP2010250470A (en) Computer system
JP2003050789A (en) Circuit, processor and multi processor system
JP6995644B2 (en) Electronic control device
JP5920595B2 (en) Electronic device, operating system, and access management method
US10967813B2 (en) Vehicle control device
KR101535792B1 (en) Apparatus for configuring operating system and method thereof
JP4789269B2 (en) Vector processing apparatus and vector processing method
JPWO2011158441A1 (en) Data processing apparatus and method, and processor unit thereof
CN106250328B (en) Memory protection unit, memory management unit and microcontroller
US20180136977A1 (en) Multi-queue device assignment for application groups
JP2007109053A (en) Bus access controller
JP2012113632A (en) Information processor and method of managing exclusive access right of information processor
WO2007049543A1 (en) Calculating apparatus
JP2013041361A (en) Resource arbitration system and resource arbitration method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20200902

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20211019

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20211119

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20211207

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20211215

R150 Certificate of patent or registration of utility model

Ref document number: 6995644

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150