JP2014153860A - Multi-thread processor - Google Patents

Multi-thread processor Download PDF

Info

Publication number
JP2014153860A
JP2014153860A JP2013022209A JP2013022209A JP2014153860A JP 2014153860 A JP2014153860 A JP 2014153860A JP 2013022209 A JP2013022209 A JP 2013022209A JP 2013022209 A JP2013022209 A JP 2013022209A JP 2014153860 A JP2014153860 A JP 2014153860A
Authority
JP
Japan
Prior art keywords
thread
authority
schedule
execution
cycle number
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2013022209A
Other languages
Japanese (ja)
Inventor
Hirotaka Motai
寛隆 茂田井
Yasuhiro Tawara
康宏 田原
Koji Adachi
浩次 安達
Hitoshi Suzuki
均 鈴木
Rika Jokura
梨香 城倉
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.)
Renesas Electronics Corp
Original Assignee
Renesas Electronics Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Renesas Electronics Corp filed Critical Renesas Electronics Corp
Priority to JP2013022209A priority Critical patent/JP2014153860A/en
Publication of JP2014153860A publication Critical patent/JP2014153860A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Storage Device Security (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a multi-thread processor capable of preventing the program execution speed from decreasing when a thread operates with an authority other than a user authority.SOLUTION: In a multi-thread processor, each thread operates with a user authority or an authority other than the user authority, for each cycle. A thread scheduler 160 switches between threads for execution, for each cycle. A schedule adjustment unit 192 sets a thread that is to be executed in a second period other than a first period in which a thread to be executed by an operating system or hypervisor is set. The schedule adjustment unit 192 performs adjustment so that a thread which operated with the authority other than the user authority is to be supplementally executed in the second period.

Description

本発明は、マルチスレッドプロセッサに関し、特に各スレッドがサイクルごとにユーザ権限またはユーザ権限以外の権限で動作するマルチスレッドプロセッサに関する。   The present invention relates to a multi-thread processor, and more particularly to a multi-thread processor in which each thread operates with user authority or authority other than user authority every cycle.

制御システムのような高い信頼性・リアルタイム性が求められるコンピュータシステムでは、要求される機能ごとに機器が用意され、これら複数の機器が連携動作することにより1つのシステムを構成している。近年では、複数の機能を1つのプロセッサにて統合実行する技術が知られている。   In a computer system such as a control system that requires high reliability and real-time performance, a device is prepared for each required function, and a plurality of these devices operate together to constitute one system. In recent years, a technique is known in which a plurality of functions are integrated and executed by a single processor.

たとえば、特許文献1(特開2011−128767号公報)のマルチスレッド処理装置は、複数のスレッドに対して、スレッドの作動割合である帯域を設定する帯域設定手段と、各スレッドの処理負荷を監視し、各スレッドの処理負荷が平準化するような帯域変更を帯域設定手段に指示する帯域制御手段とを備える。   For example, a multi-thread processing device disclosed in Patent Document 1 (Japanese Patent Laid-Open No. 2011-128767) monitors a processing load of each thread and a bandwidth setting unit that sets a bandwidth that is an operation ratio of the thread for a plurality of threads And a bandwidth control means for instructing the bandwidth setting means to change the bandwidth so that the processing load of each thread is leveled.

特許文献2(特開2010−286898号公報)のマルチスレッド実行装置は、プログラム毎に、命令の目標実行速度情報を記憶するとともに、命令の実行完了速度を監視する。フィードバック制御手段が、実行完了速度が目標実行速度情報に略一致するように、命令発行手段に命令を発行させる。   The multi-thread execution device of Patent Document 2 (Japanese Patent Laid-Open No. 2010-286898) stores target instruction execution speed information for each program and monitors the instruction execution completion speed. The feedback control means causes the instruction issuing means to issue an instruction so that the execution completion speed substantially matches the target execution speed information.

特開2011−128767号公報JP 2011-128767 A 特開2010−286898号公報JP 2010-286898 A

マルチスレッド環境で動作する各プログラムは、対応のスレッドに割り当てられる。各スレッドには、対応のプログラムの優先度などを考慮して、実行サイクルが割り当てられる。   Each program operating in a multi-thread environment is assigned to a corresponding thread. Each thread is assigned an execution cycle in consideration of the priority of the corresponding program.

しかしながら、スレッドにて動作するプログラムからスーパーバイザやハイパーバイザを呼び出すことによって、スーパーバイザやハイパーバイザがスレッドに割当てられた実行サイクルを消費する。その結果、ユーザ権限以外のスーパーバイザ権限やハイパーバイザ権限で動作したサイクル数だけプログラムが動作するサイクル数が減らされる。そのため、プログラムの実行速度が低下するという問題がある。   However, by calling a supervisor or hypervisor from a program operating in a thread, the supervisor or hypervisor consumes an execution cycle assigned to the thread. As a result, the number of cycles in which the program operates is reduced by the number of cycles operated with supervisor authority or hypervisor authority other than user authority. Therefore, there is a problem that the execution speed of the program decreases.

それゆえに、本発明の目的は、ユーザ権限以外の権限でスレッドが動作した場合において、プログラムの実行速度が低下することを防止することができるマルチスレッドプロセッサを提供することである。   Therefore, an object of the present invention is to provide a multi-thread processor that can prevent a decrease in the execution speed of a program when a thread operates with an authority other than a user authority.

上記課題を解決するために、本発明のマルチスレッドプロセッサは、各スレッドがサイクルごとにユーザ権限またはユーザ権限以外の権限で動作するマルチスレッドプロセッサであって、サイクル単位で実行するスレッドを切り換えるスケジューラと、オペレーティングシステムまたはハイパーバイザによって実行するスレッドが設定される第1期間以外の第2期間に実行するスレッドを設定するスケジュール調整部とを備える。スケジュール調整部は、ユーザ権限以外の権限で動作したスレッドが、第2期間において、補充的に実行されるように調整する。   In order to solve the above problems, a multi-thread processor of the present invention is a multi-thread processor in which each thread operates with user authority or authority other than user authority every cycle, and a scheduler that switches threads to be executed in units of cycles. A schedule adjusting unit that sets a thread to be executed in a second period other than the first period in which a thread to be executed by the operating system or the hypervisor is set. The schedule adjustment unit adjusts the thread that has been operated with an authority other than the user authority to be supplementarily executed in the second period.

本発明のマルチスレッドプロセッサによれば、ユーザ権限以外の権限でスレッドが動作した場合において、プログラムの実行速度が低下することを防止することができる。   According to the multi-thread processor of the present invention, it is possible to prevent the execution speed of a program from being lowered when a thread operates with an authority other than the user authority.

第1の実施形態のマルチスレッドプロセッサの概略構成の一例である。It is an example of schematic structure of the multithread processor of 1st Embodiment. スケジュールテーブルの例を表わす図である。It is a figure showing the example of a schedule table. 実行サイクル数テーブルの例を表わす図である。It is a figure showing the example of an execution cycle number table. 実行サイクル数加算部の各サイクルでの動作手順を示すフローチャートである。It is a flowchart which shows the operation | movement procedure in each cycle of an execution cycle number addition part. 第1の実施形態のスケジュール調整部のスケジュール更新周期ごとの動作手順を示すフローチャートである。It is a flowchart which shows the operation | movement procedure for every schedule update period of the schedule adjustment part of 1st Embodiment. 第1の実施形態におけるスケジュール調整の第1の例を説明するための図である。It is a figure for demonstrating the 1st example of the schedule adjustment in 1st Embodiment. 第1の実施形態におけるスケジュール調整の第2の例を説明するための図である。It is a figure for demonstrating the 2nd example of the schedule adjustment in 1st Embodiment. 第2の実施形態のマルチスレッドプロセッサの概略構成の一例である。It is an example of schematic structure of the multithread processor of 2nd Embodiment. 調整管理テーブルの例を表わす図である。It is a figure showing the example of an adjustment management table. 第2の実施形態のスケジュール調整部のスケジュール更新周期ごとの動作手順を示すフローチャートである。It is a flowchart which shows the operation | movement procedure for every schedule update period of the schedule adjustment part of 2nd Embodiment. 第2の実施形態のスケジュール調整部のスケジュール更新周期ごとの動作手順を示すフローチャートである。It is a flowchart which shows the operation | movement procedure for every schedule update period of the schedule adjustment part of 2nd Embodiment. 第2の実施形態のスケジュール調整部のスケジュール更新周期ごとの動作手順を示すフローチャートである。It is a flowchart which shows the operation | movement procedure for every schedule update period of the schedule adjustment part of 2nd Embodiment. 第2の実施形態におけるスケジュール調整の例を説明するための図である。It is a figure for demonstrating the example of the schedule adjustment in 2nd Embodiment. (a)および(b)は、スケジュールテーブルの別の例を表わす図である。(A) And (b) is a figure showing another example of a schedule table.

以下、本発明の実施の形態について、図面を用いて説明する。
[第1の実施形態]
図1は、第1の実施形態のマルチスレッドプロセッサの概略構成の一例である。
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
[First Embodiment]
FIG. 1 is an example of a schematic configuration of the multithread processor according to the first embodiment.

図1に示すように、このマルチスレッドプロセッサは、命令バス100と、主記憶部101と、第0命令バッファ110と、第1命令バッファ111と、命令フェッチ部145と、セレクタ120と、デコーダ130と、実行部140と、スレッドスケジューラ160と、スケジュールレジスタ180と、スケジュール調整部192と、実行サイクル数加算部190と、実行サイクル数テーブル記憶部191と、データバス170と、主記憶部102と、第0レジスタセット150と、第1レジスタセット151と、セレクタ121と、セレクタ122とを備える。   As shown in FIG. 1, the multi-thread processor includes an instruction bus 100, a main storage unit 101, a zeroth instruction buffer 110, a first instruction buffer 111, an instruction fetch unit 145, a selector 120, and a decoder 130. An execution unit 140, a thread scheduler 160, a schedule register 180, a schedule adjustment unit 192, an execution cycle number addition unit 190, an execution cycle number table storage unit 191, a data bus 170, and a main storage unit 102. , 0th register set 150, first register set 151, selector 121, and selector 122.

本実施の形態のマルチスレッドプロセッサは、スレッド0およびスレッド1からなるマルチスレッドの実行環境を有する。このマルチスレッドプロセッサは、各スレッドがサイクルごとにユーザ権限またはユーザ権限以外の権限で動作する。   The multi-thread processor according to the present embodiment has a multi-thread execution environment including thread 0 and thread 1. In this multi-thread processor, each thread operates with a user authority or an authority other than the user authority every cycle.

マルチスレッド実行環境では、複数のスレッドが、ハードウエアの一部を共有して処理を行なうものである。ここで、スレッドとは、ハードウエアを部分的に共有して処理を行なう仮想的な処理主体をいう。本実施の形態では、第0命令バッファ110および第0レジスタセット150は、スレッド0で用いられ、第1命令バッファ111および第1レジスタセット151は、スレッド1で用いられる。プロセッサにおけるその他の構成要素はスレッド0およびスレッド1の間で共用される。   In a multi-thread execution environment, a plurality of threads share a part of hardware for processing. Here, a thread refers to a virtual processing entity that performs processing while partially sharing hardware. In the present embodiment, the 0th instruction buffer 110 and the 0th register set 150 are used in the thread 0, and the first instruction buffer 111 and the first register set 151 are used in the thread 1. Other components in the processor are shared between thread 0 and thread 1.

プロセッサが基本的な動作を行なう最小単位である1サイクル毎に、スレッド0またはスレッド1が実行スレッドとして順に選択される。以下、実行スレッドとは、処理を実行中のスレッドをいうものとする。実行スレッドの切り替えは、スレッドスケジューラ160によって制御される。   For each cycle, which is the minimum unit in which the processor performs basic operations, thread 0 or thread 1 is sequentially selected as an execution thread. Hereinafter, the execution thread refers to a thread that is executing a process. Switching of execution threads is controlled by the thread scheduler 160.

命令バス100は、接続された回路間で命令データが伝送されるバスである。データバス170は、接続された回路間でデータが伝送されるバスである。   The instruction bus 100 is a bus through which instruction data is transmitted between connected circuits. The data bus 170 is a bus through which data is transmitted between connected circuits.

主記憶部101は、命令バス100と接続されている。主記憶部101は、プログラムA、プログラムB、プログラムAで利用されるOS_A、プログラムBで利用されるOS_B、およびOS_AとOS_B間の保護や調停を行なうソフトウエアであるハイパーバイザを保持している。主記憶部101は、例えば、FD(Floppy Disk)、HDD(Hard Disk Drive)、ROM(Read Only Memory)、RAM(Random Access Memory)、CD(Compact Disk)、DVD(Digital Versatile Disk)などである。   The main storage unit 101 is connected to the instruction bus 100. The main storage unit 101 holds a program A, a program B, an OS_A used by the program A, an OS_B used by the program B, and a hypervisor that is software for protecting and arbitrating between the OS_A and the OS_B. . The main storage unit 101 is, for example, an FD (Floppy Disk), an HDD (Hard Disk Drive), a ROM (Read Only Memory), a RAM (Random Access Memory), a CD (Compact Disk), a DVD (Digital Versatile Disk), or the like. .

スレッド0は、ユーザプログラムA、OS_A、またはハイパーバイザを実行する。
スレッド1は、ユーザプログラムB、OS_B、またはハイバーバイザを実行する。
The thread 0 executes the user program A, OS_A, or hypervisor.
The thread 1 executes a user program B, OS_B, or a hypervisor.

スレッド0がユーザプログラムAを実行するときには、実行部140によって、第0レジスタセット150にスレッド0の権限情報として「ユーザ権限」が設定され、スレッド0が「ユーザ権限」で動作する。スレッド0がOS_Aの機能(サービス)を実行するときには、実行部140によって、第0レジスタセット150にスレッド0の権限情報として「スーパーバイザ権限」が設定され、スレッド0が「スーパーバイザ権限」で動作する。スレッド0がハイパーバイザを実行するときには、実行部140によって、第0レジスタセット150にスレッド0の権限情報として「ハイパーバイザ権限」が設定され、スレッド0が「ハイパーバイザ権限」で動作する。   When the thread 0 executes the user program A, the execution unit 140 sets “user authority” as the authority information of the thread 0 in the 0th register set 150, and the thread 0 operates with “user authority”. When the thread 0 executes the function (service) of OS_A, the execution unit 140 sets “supervisor authority” as the authority information of the thread 0 in the 0th register set 150, and the thread 0 operates with “supervisor authority”. When the thread 0 executes the hypervisor, the execution unit 140 sets “hypervisor authority” as authority information of the thread 0 in the 0th register set 150, and the thread 0 operates with “hypervisor authority”.

また、同様に、スレッド1がユーザプログラムBを実行するときには、実行部140によって、第1レジスタセット151にスレッド1の権限情報として「ユーザ権限」が設定され、スレッド1が「ユーザ権限」で動作する。スレッド1がOS_Bの機能(サービス)を実行するときには、実行部140によって、第1レジスタセット151にスレッド1の権限情報として「スーパーバイザ権限」が設定され、スレッド1が「スーパーバイザ権限」で動作する。スレッド1がハイパーバイザを実行するときには、実行部140によって、第1レジスタセット151にスレッド1の権限情報として「ハイパーバイザ権限」が設定され、スレッド1が「ハイパーバイザ権限」で動作する。   Similarly, when the thread 1 executes the user program B, the execution unit 140 sets “user authority” as the authority information of the thread 1 in the first register set 151, and the thread 1 operates with “user authority”. To do. When the thread 1 executes the function (service) of OS_B, the execution unit 140 sets “supervisor authority” as the authority information of the thread 1 in the first register set 151, and the thread 1 operates with “supervisor authority”. When the thread 1 executes the hypervisor, the execution unit 140 sets “hypervisor authority” as the authority information of the thread 1 in the first register set 151, and the thread 1 operates with “hypervisor authority”.

主記憶部102は、データバス170と接続されている。主記憶部102は、プログラムAおよびプログラムBが利用するデータを保持している。主記憶部102は、例えば、FD、HDD、RAMなどである。なお、主記憶部101と主記憶部102は同一の主記憶部であってもよい。また、プログラムA用およびプログラムB用にそれぞれ個別に主記憶部101、主記憶部102があってもよい。   The main storage unit 102 is connected to the data bus 170. The main storage unit 102 holds data used by the programs A and B. The main storage unit 102 is, for example, an FD, HDD, RAM, or the like. The main storage unit 101 and the main storage unit 102 may be the same main storage unit. Further, there may be a main storage unit 101 and a main storage unit 102 for program A and program B, respectively.

第0命令バッファ110および第1命令バッファ111は、それぞれ命令バス100と接続されている。命令バス100は、主記憶部101と接続されている。   The 0th instruction buffer 110 and the first instruction buffer 111 are each connected to the instruction bus 100. The instruction bus 100 is connected to the main storage unit 101.

命令フェッチ部145は、第0命令バッファ110用のプログラムカウンタと、第1命令バッファ111用のプログラムカウンタを有する。実行部140は、第0命令バッファ110のプログラムカウンタのアドレスを命令バス100に出力して、主記憶部101から第0命令バッファ110にプログラムAの命令を1つずつ読み出す。命令フェッチ部145は、第1命令バッファ111のプログラムカウンタのアドレスを命令バス100に出力して、主記憶部101から第1命令バッファ111にプログラムBの命令を1つずつ読み出す。   The instruction fetch unit 145 has a program counter for the 0th instruction buffer 110 and a program counter for the first instruction buffer 111. The execution unit 140 outputs the address of the program counter of the 0th instruction buffer 110 to the instruction bus 100 and reads the instructions of the program A from the main storage unit 101 to the 0th instruction buffer 110 one by one. The instruction fetch unit 145 outputs the address of the program counter of the first instruction buffer 111 to the instruction bus 100 and reads the instructions of the program B from the main storage unit 101 to the first instruction buffer 111 one by one.

第0命令バッファ110および第1命令バッファ111は、セレクタ120に接続されている。セレクタ120は、第0命令バッファ110および第1命令バッファ111のうち、1つの命令バッファを選択して、選択した命令バッファをデコーダ130に接続する。セレクタ120が選択する命令バッファは、スレッドスケジューラ160によって制御される。   The 0th instruction buffer 110 and the first instruction buffer 111 are connected to the selector 120. The selector 120 selects one instruction buffer out of the 0th instruction buffer 110 and the first instruction buffer 111 and connects the selected instruction buffer to the decoder 130. The instruction buffer selected by the selector 120 is controlled by the thread scheduler 160.

デコーダ130は、セレクタ120から出力される第0命令バッファ110または第1命令バッファ111の命令を解読し、解読結果を実行部140に送出する。   The decoder 130 decodes the instruction in the 0th instruction buffer 110 or the first instruction buffer 111 output from the selector 120 and sends the decoding result to the execution unit 140.

第0レジスタセット150は、複数の汎用レジスタ、システムレジスタ(権限情報を含む)などを含む。第1レジスタセット151は、複数の汎用レジスタ、システムレジスタ(権限情報を含む)などを含む。   The zeroth register set 150 includes a plurality of general-purpose registers, system registers (including authority information), and the like. The first register set 151 includes a plurality of general-purpose registers, system registers (including authority information), and the like.

セレクタ121は、第0レジスタセット150または第1レジスタセット151を選択し、選択したレジスタセットのデータを実行部140へ送る。セレクタ122は、第0レジスタセット150または第1レジスタセット151を選択し、実行部140による実行結果を表わすデータを選択したレジスタセットへ送る。   The selector 121 selects the 0th register set 150 or the first register set 151 and sends the data of the selected register set to the execution unit 140. The selector 122 selects the 0th register set 150 or the first register set 151 and sends data representing the execution result by the execution unit 140 to the selected register set.

実行部140は、デコーダ130から送られる解読された命令を実行する。実行部140は、演算の種類に応じて第0レジスタセット150または第1レジスタセット151に記憶されたデータに対して演算を行う。演算の内容は、加算、乗算、除算、ロード、ストア、または分岐などであり、実行部140は、それぞれの演算に応じた回路を含む。ロード(もしくはストア)の場合、実行部140からデータバス170にアドレスを出力して主記憶部102からデータを読込む(もしくは書込む)。読み込んだデータは第0レジスタセット150または第1レジスタセット151に格納する。実行部140が使用するレジスタセットは、セレクタ121と122によって選択される。セレクタ121、122はスレッドスケジューラ160によって制御される。   The execution unit 140 executes the decoded instruction sent from the decoder 130. The execution unit 140 performs an operation on the data stored in the 0th register set 150 or the first register set 151 according to the type of operation. The contents of the operation are addition, multiplication, division, load, store, branch, or the like, and the execution unit 140 includes a circuit corresponding to each operation. In the case of load (or store), an address is output from the execution unit 140 to the data bus 170 and data is read (or written) from the main storage unit 102. The read data is stored in the 0th register set 150 or the first register set 151. The register set used by the execution unit 140 is selected by the selectors 121 and 122. The selectors 121 and 122 are controlled by the thread scheduler 160.

スケジュールレジスタ180は、図2に示すようなスケジュールテーブル200を記憶する。スケジュールテーブル200の各エントリには、番号が付されているとともに、実行するスレッド番号が設定される。スケジュールテーブル200は、15個のエントリを有し、15個のサイクルについて、実行するスレッドを定める。   The schedule register 180 stores a schedule table 200 as shown in FIG. Each entry in the schedule table 200 is assigned a number and a thread number to be executed. The schedule table 200 has 15 entries, and defines threads to be executed for 15 cycles.

スケジュールテーブル200は、第0〜第9のエントリを含むコアスケジュールテーブル201と、第10〜第14のエントリを含む補填用スケジュールテーブル202とを含む。   The schedule table 200 includes a core schedule table 201 including the 0th to 9th entries and a compensation schedule table 202 including the 10th to 14th entries.

コアスケジュールテーブル201は、コア期間に実行されるスレッドを定める。コアスケジュールテーブル201は、スケジュール調整部192以外のOSまたはハイバーバイザによって設定される。たとえば、実行部140が、スレッド0およびスレッド1の実行順序および実行比率を定めるハイバーバイザを実行したときに、第14エントリのスレッドを実行後に、コアスケジュールテーブル201の各エントリのスレッド番号が設定される。   The core schedule table 201 defines threads to be executed during the core period. The core schedule table 201 is set by an OS or a hypervisor other than the schedule adjustment unit 192. For example, when the execution unit 140 executes a hypervisor that determines the execution order and execution ratio of the thread 0 and the thread 1, the thread number of each entry in the core schedule table 201 is set after executing the 14th entry thread. .

補填用スケジュールテーブル202は、補填用期間に実行されるスレッドを定める。補填用スケジュールテーブル202は、スケジュール調整部192によってスケジュール更新周期ごとに設定される。本実施の形態では、スケジュール更新周期は、15サイクルである。   The compensation schedule table 202 defines threads to be executed during the compensation period. The compensation schedule table 202 is set by the schedule adjustment unit 192 for each schedule update period. In the present embodiment, the schedule update period is 15 cycles.

スレッドスケジューラ160は、1サイクルごとにスケジュールテーブル200の1つのエントリを読み出す。スレッドスケジューラ160は、番号0のエントリから順にエントリを読み出し、最後のエントリを読み出したら、再度番号0のエントリから順に読み出す(循環すると記す)。   The thread scheduler 160 reads one entry of the schedule table 200 every cycle. The thread scheduler 160 reads the entries in order from the entry with the number 0, and when reading the last entry, reads the entries in the order from the entry with the number 0 again (denoted as circulating).

スレッドスケジューラ160は、スケジュールレジスタ180に設定された順番で各スレッドを1サイクル毎に切り替えて実行する。これにより、物理的に1つのプロセッサであるが、仮想的な複数のプロセッサを有するように振舞う。ここでの「サイクル」とは、1命令毎であってもよいし、まとまった命令ごとであっても良いし、一定時間であっても良い。   The thread scheduler 160 switches and executes each thread for each cycle in the order set in the schedule register 180. Thereby, although it is physically one processor, it behaves like having a plurality of virtual processors. The “cycle” here may be one instruction, one group of instructions, or a fixed time.

スレッドスケジューラ160は、読みだしたエントリに設定されたスレッド番号が「0」の場合には、セレクタ120に第0命令バッファ110からの命令の出力を選択させ、セレクタ121に第0レジスタセット150からのデータの読出しを選択させ、セレクタ122に第0レジスタセット150へのデータの書込みを選択させる。   When the thread number set in the read entry is “0”, the thread scheduler 160 causes the selector 120 to select the instruction output from the zeroth instruction buffer 110 and causes the selector 121 to select from the zeroth register set 150. Data reading is selected, and the selector 122 is selected to write data to the zeroth register set 150.

スレッドスケジューラ160は、読みだしたエントリに設定されたスレッド番号が「1」の場合には、セレクタ120に第1命令バッファ111からの命令の出力を選択させ、セレクタ121に第1レジスタセット151からのデータの読出しを選択させ、セレクタ122に第1レジスタセット151へのデータの書込みを選択させる。   When the thread number set in the read entry is “1”, the thread scheduler 160 causes the selector 120 to select the output of the instruction from the first instruction buffer 111 and causes the selector 121 to select from the first register set 151. Data reading is selected, and the selector 122 is selected to write data to the first register set 151.

スレッドスケジューラ160は、読みだしたエントリに存在しないスレッド番号が設定されている場合、セレクタ120に第0命令バッファ110および第1命令バッファ111からのいずれの命令も選択させず、実行部140に、何も命令を実行させない(NOP(no operation)命令を実行する)。   If a thread number that does not exist in the read entry is set, the thread scheduler 160 does not cause the selector 120 to select any instruction from the 0th instruction buffer 110 and the first instruction buffer 111, No instruction is executed (NOP (no operation) instruction is executed).

実行サイクル数テーブル記憶部191は、図3に示すような実行サイクル数テーブル300を有する。実行サイクル数テーブル300の列301は、本実施の形態のスレッドの権限を示す。本実施の形態のスレッド0およびスレッド1は、「ハイパーバイザ権限」、「スーパーバイザ権限」、または「ユーザ権限」を有する。図3に示すように、実行サイクル数テーブル300の列302は、スレッド0用の実行サイクル数を格納する列である。実行サイクル数テーブル300の列303は、スレッド1用の実行サイクル数を格納する列である。実行サイクル数テーブル300の行311は、スレッド0、スレッド1のユーザ権限の実行サイクル数を格納する行である。 実行サイクル数テーブル300の行312は、スレッド0、スレッド1のスーパーバイザ権限の実行サイクル数を格納する行である。実行サイクル数テーブル300の行313は、スレッド0、スレッド1のハイパーバイザ権限の実行サイクル数を格納する行である。   The execution cycle number table storage unit 191 has an execution cycle number table 300 as shown in FIG. A column 301 of the execution cycle number table 300 indicates the authority of the thread according to the present embodiment. The thread 0 and the thread 1 of the present embodiment have “hypervisor authority”, “supervisor authority”, or “user authority”. As illustrated in FIG. 3, the column 302 of the execution cycle number table 300 is a column that stores the number of execution cycles for the thread 0. The column 303 of the execution cycle number table 300 is a column that stores the number of execution cycles for the thread 1. A row 311 of the execution cycle number table 300 is a row for storing the number of execution cycles of the user authority of the thread 0 and the thread 1. The row 312 of the execution cycle number table 300 is a row for storing the number of execution cycles of the supervisor authority of the thread 0 and the thread 1. The row 313 of the execution cycle number table 300 is a row for storing the number of execution cycles of the hypervisor authority of the thread 0 and thread 1.

実行サイクル数加算部190は、スレッドスケジューラ160と連携して、それぞれのスレッドにて実行されたハイパーバイザの実行サイクル数を実行サイクル数テーブル記憶部191に記録する。   The execution cycle number adding unit 190 cooperates with the thread scheduler 160 to record the number of execution cycles of the hypervisor executed in each thread in the execution cycle number table storage unit 191.

(実行サイクル数加算部190の動作)
図4は、実行サイクル数加算部190の各サイクルでの動作手順を示すフローチャートである。初期状態では、実行サイクル数テーブル記憶部191に記憶される実行サイクル数はすべて「0」である。
(Operation of the execution cycle number adding unit 190)
FIG. 4 is a flowchart showing an operation procedure in each cycle of the execution cycle number adding unit 190. In the initial state, the number of execution cycles stored in the execution cycle number table storage unit 191 is all “0”.

実行サイクル数加算部190は、スレッドスケジューラ160から実行しているスレッド番号を取得する(ステップS100)。   The execution cycle number adding unit 190 acquires the thread number being executed from the thread scheduler 160 (step S100).

次に、実行サイクル数加算部190は、実行しているスレッドがスレッド0の場合には(ステップS101でYES)、第0レジスタセット150からスレッド0の権限情報を取得する(ステップS102)。   Next, when the executing thread is the thread 0 (YES in step S101), the execution cycle number adding unit 190 acquires the authority information of the thread 0 from the 0th register set 150 (step S102).

次に、実行サイクル数加算部190は、実行サイクル数テーブル記憶部191に記憶された実行サイクル数テーブル300におけるスレッド0の取得した権限の実行サイクル数に「1」を加算する。実行サイクル数加算部190は、たとえば、取得した権限がハイパーバイザ権限であった場合、実行サイクル数テーブル300の列302の行313に記録された実行サイクル数に「1」を加算する(ステップS103)。   Next, the execution cycle number adding unit 190 adds “1” to the execution cycle number of the authority acquired by the thread 0 in the execution cycle number table 300 stored in the execution cycle number table storage unit 191. For example, when the acquired authority is a hypervisor authority, the execution cycle number adding unit 190 adds “1” to the execution cycle number recorded in the row 313 of the column 302 of the execution cycle number table 300 (step S103). ).

次に、実行サイクル数加算部190は、実行しているスレッドがスレッド0でない場合には(ステップS101でNO)、第1レジスタセット151からスレッド1の権限情報を取得する(ステップS104)。   Next, when the executing thread is not thread 0 (NO in step S101), the execution cycle number adding unit 190 acquires the authority information of the thread 1 from the first register set 151 (step S104).

次に、実行サイクル数加算部190は、実行サイクル数テーブル記憶部191に記憶された実行サイクル数テーブル300におけるスレッド1の取得した権限の実行サイクル数に「1」を加算する。実行サイクル数加算部190は、たとえば、取得した権限がハイパーバイザ権限であった場合、実行サイクル数テーブル300の列303の行313に記録された実行サイクル数に「1」を加算する(ステップS105)。   Next, the execution cycle number adding unit 190 adds “1” to the execution cycle number of the authority acquired by the thread 1 in the execution cycle number table 300 stored in the execution cycle number table storage unit 191. For example, when the acquired authority is a hypervisor authority, the execution cycle number adding unit 190 adds “1” to the execution cycle number recorded in the row 313 of the column 303 of the execution cycle number table 300 (step S105). ).

(スケジュール調整部192の動作)
スケジュール調整部192は、スレッドスケジューラ160と連携して、実行サイクル数テーブル300のスレッドごとのハイパーバイザ権限の実行サイクル数に基づいて、スケジュール更新周期ごとにスケジュールテーブル200の補填用スケジュールテーブル202を変更する。これによって、スケジュール調整部192は、ハイパーバイザ権限などのユーザ権限以外で動作したスレッドが、後の補填用期間において、補充的に実行されるように調整する。
(Operation of schedule adjustment unit 192)
The schedule adjustment unit 192 changes the compensation schedule table 202 of the schedule table 200 for each schedule update period based on the number of execution cycles of hypervisor authority for each thread in the execution cycle number table 300 in cooperation with the thread scheduler 160. To do. As a result, the schedule adjustment unit 192 performs adjustment so that a thread that operates with a user authority such as a hypervisor authority is supplementarily executed in a later compensation period.

図5は、第1の実施形態のスケジュール調整部192のスケジュール更新周期ごとの動作手順を示すフローチャートである。   FIG. 5 is a flowchart illustrating an operation procedure for each schedule update period of the schedule adjustment unit 192 according to the first embodiment.

まず、スケジュール調整部192は、実行サイクル数テーブル記憶部191からスレッド0のハイパーバイザ権限の実行サイクル数n0を取得する。具体的には、スケジュール調整部192は、実行サイクル数テーブル300の列302、行313に記録された実行サイクル数n0を取得する(ステップS200)。   First, the schedule adjustment unit 192 acquires the execution cycle number n0 of the hypervisor authority of the thread 0 from the execution cycle number table storage unit 191. Specifically, the schedule adjustment unit 192 acquires the execution cycle number n0 recorded in the column 302 and the row 313 of the execution cycle number table 300 (step S200).

次に、スケジュール調整部192は、実行サイクル数テーブル記憶部191からスレッド1のハイパーバイザ権限の実行サイクル数n1を取得する。具体的には、スケジュール調整部192は、実行サイクル数テーブル300の列303、行313に記録された実行サイクル数n1を取得する(ステップS201)。   Next, the schedule adjustment unit 192 acquires the execution cycle number n1 of the hypervisor authority of the thread 1 from the execution cycle number table storage unit 191. Specifically, the schedule adjustment unit 192 acquires the number of execution cycles n1 recorded in the column 303 and the row 313 of the execution cycle number table 300 (step S201).

次に、スケジュール調整部192は、ステップS200で取得した実行サイクル数n0と、ステップS201で取得した実行サイクル数n1との総和N(=n0+n1)を求める(ステップS202)。   Next, the schedule adjustment unit 192 obtains the sum N (= n0 + n1) of the number of execution cycles n0 acquired in step S200 and the number of execution cycles n1 acquired in step S201 (step S202).

次に、スケジュール調整部192は、求めた総和Nが、補填用スケジュールテーブル202のエントリ数Mと同等もしくは少ないか判断する。   Next, the schedule adjustment unit 192 determines whether the obtained sum N is equal to or less than the number of entries M in the compensation schedule table 202.

判断した結果、同等もしくは少ない場合(ステップS203のYESの場合)、ステップS204に進む。判断した結果、多い場合(ステップS203のNOの場合)、ステップS220に進む。   If the result of the determination is equal or less (YES in step S203), the process proceeds to step S204. As a result of the determination, if there are many (NO in step S203), the process proceeds to step S220.

ステップS203でYESの場合は、スケジュール調整部192は、補填用スケジュールテーブル202の第10エントリを起点としてステップS200で取得した実行サイクル数n0個のエントリに「0」を設定する(ステップS204)。さらに、スケジュール調整部192は、実行サイクル数テーブル記憶部191に記録された実行サイクル数テーブル300におけるスレッド0のハイパーバイザ権限の実行サイクル数を0に設定する。具体的には、スケジュール調整部192は、実行サイクル数テーブル300の列302、行313の実行サイクル数を0に設定する(ステップS205)。   If YES in step S203, the schedule adjustment unit 192 sets “0” to the n0 execution cycle entries acquired in step S200 starting from the tenth entry in the compensation schedule table 202 (step S204). Further, the schedule adjustment unit 192 sets the execution cycle number of the hypervisor authority of the thread 0 in the execution cycle number table 300 recorded in the execution cycle number table storage unit 191 to zero. Specifically, the schedule adjustment unit 192 sets the number of execution cycles in column 302 and row 313 of the execution cycle number table 300 to 0 (step S205).

次に、スケジュール調整部192は、補填用スケジュールテーブル202におけるステップS204にて「0」を追加した最後のエントリの直後のエントリを起点としてステップS201で取得した実行サイクル数n1個のエントリに「1」を設定する(ステップS206)。さらに、スケジュール調整部192は、実行サイクル数テーブル記憶部191に記憶された実行サイクル数テーブル300におけるスレッド1のハイパーバイザ権限の実行サイクル数を0に設定する。具体的には、スケジュール調整部192は、実行サイクル数テーブル300の列303、行313の実行サイクル数を0に設定する(ステップS207)。   Next, the schedule adjustment unit 192 adds “1” to the n1 execution cycle entries acquired in step S201 starting from the entry immediately after the last entry to which “0” is added in step S204 in the compensation schedule table 202. "Is set (step S206). Further, the schedule adjustment unit 192 sets the execution cycle number of the hypervisor authority of the thread 1 in the execution cycle number table 300 stored in the execution cycle number table storage unit 191 to 0. Specifically, the schedule adjustment unit 192 sets the number of execution cycles in the column 303 and the row 313 of the execution cycle number table 300 to 0 (step S207).

次に、スケジュール調整部192は、補填用スケジュールテーブル202に残りのエントリがある場合には、ステップS206にて「1」追加した最後のエントリの直後のエントリを起点として最後のエントリ(第14エントリ)まで、「−1」を設定する(ステップS208)。   Next, when there are remaining entries in the supplementary schedule table 202, the schedule adjustment unit 192 starts from the entry immediately after the last entry added with “1” in step S206 as the last entry (fourteenth entry). ) Until "-1" is set (step S208).

ステップS203でNOの場合は、スケジュール調整部192は、補填用スケジュールテーブル202のエントリ数MとステップS202で求めた実行サイクル数の総和Nとの割合R(=M/N)を計算する(ステップS220)。   If NO in step S203, the schedule adjustment unit 192 calculates a ratio R (= M / N) between the number of entries M in the supplementary schedule table 202 and the total number N of execution cycles obtained in step S202 (step S202). S220).

次に、スケジュール調整部192は、割合Rに基づいて、スレッド0のハイパーバイザ権限の実行サイクル数n0を修正した修正実行サイクル数n0′(=n0×R)を算出する。この算出において、小数点以下は切り捨てされる(ステップS221)。   Next, based on the ratio R, the schedule adjustment unit 192 calculates a corrected execution cycle number n0 ′ (= n0 × R) obtained by correcting the execution cycle number n0 of the hypervisor authority of the thread 0. In this calculation, the decimal part is rounded down (step S221).

次に、スケジュール調整部192は、割合Rに基づいて、スレッド1のハイパーバイザ権限の実行サイクル数n1を修正した修正実行サイクル数n1′(=n1×R)を算出する。この算出において、小数点以下は切り捨てされる(ステップS222)。   Next, the schedule adjustment unit 192 calculates a corrected execution cycle number n1 ′ (= n1 × R) obtained by correcting the execution cycle number n1 of the hypervisor authority of the thread 1 based on the ratio R. In this calculation, the decimal part is rounded down (step S222).

次に、スケジュール調整部192は、補填用スケジュールテーブル202のエントリ10を起点としてステップS221で算出した修正実行サイクル数n0′個のエントリに「0」を設定する(ステップS223)。さらに、スケジュール調整部192は、実行サイクル数テーブル記憶部191に記憶された実行サイクル数テーブル300のスレッド0のハイパーバイザ権限の実行サイクル数を修正実行サイクル数n0′だけ減じる。具体的には、スケジュール調整部192は、実行サイクル数テーブル300の列302、行313の実行サイクル数から修正実行サイクル数n0′を減算して、減算した値で上書きする(ステップS224)。   Next, the schedule adjustment unit 192 sets “0” to the entry of the number of correction execution cycles n0 ′ calculated in step S221 starting from the entry 10 of the compensation schedule table 202 (step S223). Further, the schedule adjustment unit 192 reduces the execution cycle number of the hypervisor authority of the thread 0 in the execution cycle number table 300 stored in the execution cycle number table storage unit 191 by the corrected execution cycle number n0 ′. Specifically, the schedule adjustment unit 192 subtracts the modified execution cycle number n0 ′ from the execution cycle number in the column 302 and row 313 of the execution cycle number table 300, and overwrites it with the subtracted value (step S224).

次に、スケジュール調整部192は、補填用スケジュールテーブル202においてステップS223にて「0」を追加した最後のエントリの直後のエントリを起点としてステップS222で取得した修正実行サイクル数n1′個のエントリに「1」を設定する(ステップS225)。さらに、スケジュール調整部192は、実行サイクル数テーブル記憶部191に記憶された実行サイクル数テーブル300のスレッド1のハイパーバイザ権限の実行サイクル数を修正実行サイクル数n1′だけ減じる。具体的には、スケジュール調整部192は、実行サイクル数テーブル300の列303、行313の実行サイクル数から修正実行サイクル数n1′を減算して、減算した値で上書きする(ステップS226)。   Next, the schedule adjustment unit 192 sets the number of correction execution cycles n1 ′ acquired in step S222 as the starting point from the entry immediately after the last entry to which “0” is added in step S223 in the compensation schedule table 202. “1” is set (step S225). Furthermore, the schedule adjustment unit 192 reduces the execution cycle number of the hypervisor authority of the thread 1 in the execution cycle number table 300 stored in the execution cycle number table storage unit 191 by the corrected execution cycle number n1 ′. Specifically, the schedule adjustment unit 192 subtracts the corrected execution cycle number n1 ′ from the execution cycle number in the column 303 and the row 313 of the execution cycle number table 300, and overwrites it with the subtracted value (step S226).

次に、スケジュール調整部192は、補填用スケジュールテーブル202の残りのエントリがある場合には、すなわちステップS226にて「1」追加した最後のエントリの直後のエントリを起点として最後のエントリ(エントリ14)まで、「−1」を設定する(ステップS227)。   Next, when there is a remaining entry in the supplementary schedule table 202, that is, the schedule adjustment unit 192, that is, the entry immediately after the last entry added with “1” in step S226 starts as the last entry (entry 14). ) Until "-1" is set (step S227).

(スケジュール調整の第1の例)
図6は、第1の実施形態におけるスケジュール調整の第1の例を説明するための図である。
(First example of schedule adjustment)
FIG. 6 is a diagram for explaining a first example of schedule adjustment in the first embodiment.

ステップS200にて取得したスレッド0の実行サイクル数n0が「0」とする。
ステップS201にて取得したスレッド1の実行サイクル数n1が「3」とする。
It is assumed that the number of execution cycles n0 of the thread 0 acquired in step S200 is “0”.
The number of execution cycles n1 of the thread 1 acquired in step S201 is “3”.

ステップS202にて総和Nが「3」となる。その結果、ステップS203において、N≦M(=5)となり、ステップS204に進む。   In step S202, the sum N is "3". As a result, in step S203, N ≦ M (= 5), and the process proceeds to step S204.

ステップS204では、n0が「0」によって、補填用スケジュールテーブル202には「0」が設定されない。   In step S204, n0 is “0”, and “0” is not set in the compensation schedule table 202.

ステップS205では、n0が「0」によって、スレッド0のハイパーバイザ権限の実行サイクル数は「0」のまま変化しない。   In step S205, when n0 is “0”, the number of execution cycles of the hypervisor authority of thread 0 remains “0”.

ステップS206では、n1が「3」によって、補填用スケジュールテーブル202の「3」個のエントリ(第10、第11、第12エントリ)には「1」が設定される。   In step S206, “1” is set in “3” entries (tenth, eleventh, and twelfth entries) of n1 in the compensation schedule table 202 because n1 is “3”.

ステップS207では、n1が「3」によって、スレッド1のハイバーバイザ権限の実行サイクル数が「0」に設定される。   In step S207, n1 is set to “3”, and the number of execution cycles of the hypervisor authority of thread 1 is set to “0”.

ステップS208では、補填用スケジュールテーブル202の残りのエントリである第13〜第14エントリに「−1」が設定される。   In step S <b> 208, “−1” is set in the thirteenth to fourteenth entries, which are the remaining entries in the compensation schedule table 202.

(スケジュール調整の第2の例)
図7は、第1の実施形態におけるスケジュール調整の第2の例を説明するための図である。
(Second example of schedule adjustment)
FIG. 7 is a diagram for explaining a second example of schedule adjustment in the first embodiment.

ステップS200にて取得したスレッド0の実行サイクル数n0が「4」とする。
ステップS201にて取得したスレッド1の実行サイクル数n1が「3」とする。
The number of execution cycles n0 of the thread 0 acquired in step S200 is “4”.
The number of execution cycles n1 of the thread 1 acquired in step S201 is “3”.

ステップS202にて総和Nが「7」となる。その結果、ステップS203において、N>M(=5)となり、ステップS220に進む。   In step S202, the sum N is "7". As a result, in step S203, N> M (= 5), and the process proceeds to step S220.

ステップS220では、R=5/7となる。
ステップS221では、4×5/7の整数部分が2なので、n0′は「2」となる。
In step S220, R = 5/7.
In step S221, since the integer part of 4 × 5/7 is 2, n0 ′ is “2”.

ステップS222では、3×5/7の整数部分が2なので、n1′は「2」となる。
ステップS223では、n0′が「2」によって、補填用スケジュールテーブル202の「2」個のエントリ(第10、第11エントリ)に「0」が設定される。
In step S222, since the integer part of 3 × 5/7 is 2, n1 ′ is “2”.
In step S223, “0” is set in “2” entries (tenth and eleventh entries) of the supplementary schedule table 202 because n0 ′ is “2”.

ステップS224では、n0′が「2」によって、スレッド0のハイパーバイザ権限の実行サイクル数は「4」から「2」だけ小さい「2」に設定される。   In step S224, n0 ′ is set to “2”, and the number of execution cycles of the hypervisor authority of thread 0 is set to “2” which is smaller from “4” to “2”.

ステップS225では、n1′が「2」によって、補填用スケジュールテーブル202の「2」個のエントリ(第12、第13エントリ)には「1」が設定される。   In step S225, n1 'is "2", and "1" is set to "2" entries (twelfth and thirteenth entries) in the supplementary schedule table 202.

ステップS226では、n1′が「2」によって、スレッド1のハイバーバイザ権限の実行サイクル数が「3」から「2」だけ小さい「1」に設定される。   In step S226, n1 ′ is set to “2”, and the number of execution cycles of the hypervisor authority of thread 1 is set to “1” which is smaller by “2” from “3”.

ステップS227では、補填用スケジュールテーブル202の残りのエントリである第14エントリに「−1」が設定される。   In step S227, “−1” is set in the fourteenth entry, which is the remaining entry in the compensation schedule table 202.

以上のように、本実施の形態では、スレッドごとに、ハイパーバイザ権限でハイパーバイザが動作した実行サイクル数を記録し、補填用期間において、各スレッドが、記録されたハイパー権限の実行サイクル数に応じたサイクル数だけ実行されるようにする。   As described above, in this embodiment, the number of execution cycles in which the hypervisor operates with the hypervisor authority is recorded for each thread, and each thread has the recorded number of execution cycles of the hyper authority in the compensation period. It will be executed for the corresponding number of cycles.

これによって、プログラムが本来動作する予定であったサイクル数の実行が補填され、プログラムへ配分された処理時間を維持することができる。   As a result, the execution of the number of cycles that the program originally intended to operate is compensated, and the processing time allocated to the program can be maintained.

なお、本実施の形態では、実行サイクル数テーブル300におけるスレッドごとのハイパーバイザ権限の実行サイクル数に基づいて、補填用スケジュールテーブル202に設定するスレッドを決めたが、これに限定するものではない。たとえば、実行サイクル数テーブル300におけるスレッドごとのユーザ権限およびスーパーバイザ権限の実行サイクル数を用いて、ハイパー権限の実行サイクル数を算出して、算出したハイパー権限の実行サイクル数に基づいて、補填用スケジュールテーブル202に設定するスレッドを決めてもよい。   In the present embodiment, the thread to be set in the compensation schedule table 202 is determined based on the number of execution cycles of the hypervisor authority for each thread in the execution cycle number table 300. However, the present invention is not limited to this. For example, the execution cycle number of the hyper authority is calculated using the execution cycle number of the user authority and the supervisor authority for each thread in the execution cycle number table 300, and the compensation schedule is calculated based on the calculated execution cycle number of the hyper authority. A thread to be set in the table 202 may be determined.

[第1の実施の形態の変形例]
第1の実施形態では、実行サイクル数テーブル300におけるスレッドごとのハイパーバイザ権限の実行サイクル数に基づいて、補填用スケジュールテーブル202に設定するスレッドを決めたが、これに限定するものではない。実行サイクル数テーブル300におけるスレッドごとのスーパーバイザ権限の実行サイクル数に基づいて、補填用スケジュールテーブル202を設定するスレッド決めるものとしてもよい。
[Modification of First Embodiment]
In the first embodiment, the thread to be set in the compensation schedule table 202 is determined based on the number of execution cycles of the hypervisor authority for each thread in the execution cycle number table 300. However, the present invention is not limited to this. The thread for setting the supplementary schedule table 202 may be determined based on the number of execution cycles of supervisor authority for each thread in the execution cycle number table 300.

また、実行サイクル数テーブル300におけるスレッドごとのスーパーバイザ権限の実行サイクル数とハイパーバイザ権限の実行サイクル数の和に基づいて、補填用スケジュールテーブル202を設定するスレッド決めるものとしてもよい。   Further, the thread for setting the compensation schedule table 202 may be determined based on the sum of the number of execution cycles of supervisor authority and the number of execution cycles of hypervisor authority for each thread in the execution cycle number table 300.

[第2の実施形態]
第1の実施形態では、ハイパーバイザの動作サイクル数をそのスレッド分として追加するようにしたものである。本実施の形態では、さらに、スレッドの優先度や追加上限値によって、追加するサイクル数を変える。
[Second Embodiment]
In the first embodiment, the number of operation cycles of the hypervisor is added as the number of threads. In the present embodiment, the number of cycles to be added is further changed according to the priority of the thread and the additional upper limit value.

図8は、第2の実施形態のマルチスレッドプロセッサの概略構成の一例である。
第2の実施形態のマルチスレッドプロセッサが、第1の実施形態のマルチスレッドプロセッサと相違する点は、第2の実施形態のマルチスレッドプロセッサが、調整管理テーブル記憶部600を有する点と、第2の実施形態のスケジュール調整部592が第1の実施形態のスケジュール調整部192と機能が相違する点である。
FIG. 8 is an example of a schematic configuration of the multithread processor according to the second embodiment.
The multi-thread processor of the second embodiment is different from the multi-thread processor of the first embodiment in that the multi-thread processor of the second embodiment has an adjustment management table storage unit 600, and second The schedule adjustment unit 592 of the embodiment is different in function from the schedule adjustment unit 192 of the first embodiment.

調整管理テーブル記憶部600は、図9のような調整管理テーブル593を記憶する。
調整管理テーブル593の列601は、スケジュール調整部592が利用するデータの種類を示す。「優先度」は、スレッド0の優先度である。優先度の値が大きいほど優先される(優先度が高い)。「上限サイクル数」は、スレッドでハイパーバイザが動作した場合に割当てるスロット数の上限である。スレッドごとに「上限サイクル数」を設けた理由は、補填用スケジュールテーブル202に優先度の高いスレッドばかりが設定されることによって、優先度の低いスレッドが補填用期間で実行されなくなるのを防止するためである。
The adjustment management table storage unit 600 stores an adjustment management table 593 as shown in FIG.
A column 601 of the adjustment management table 593 indicates the type of data used by the schedule adjustment unit 592. “Priority” is the priority of thread 0. The higher the priority value, the higher the priority (the higher the priority). The “upper limit cycle number” is an upper limit of the number of slots to be allocated when the hypervisor operates in a thread. The reason why the “upper limit cycle number” is set for each thread is that only the high priority threads are set in the supplementary schedule table 202 to prevent the low priority threads from being executed in the supplementary period. Because.

調整管理テーブル593の列602は、スレッド0用の優先度および上限サイクル数を格納する列であり、調整管理テーブル593の列603はスレッド1用の優先度および上限サイクル数を格納する列である。   The column 602 of the adjustment management table 593 is a column for storing the priority for thread 0 and the upper limit cycle number, and the column 603 of the adjustment management table 593 is a column for storing the priority for thread 1 and the upper limit cycle number. .

調整管理テーブル593の行611は、スレッド0、スレッド1の優先度を格納する行である。調整管理テーブル593の行612は、スレッド0、スレッド1の上限サイクル数を格納する行である。   The row 611 of the adjustment management table 593 is a row for storing the priorities of the thread 0 and the thread 1. A row 612 of the adjustment management table 593 is a row for storing the upper limit cycle numbers of the thread 0 and the thread 1.

(スケジュール調整部592の動作)
スケジュール調整部592は、スレッドスケジューラ160と連携して、実行サイクル数テーブル300のスレッドごとのハイパーバイザ権限の実行サイクル数と、調整管理テーブル593のスレッドごとの上限サイクル数および優先度に基づいて、スレッド更新周期ごとにスケジュールテーブル200の補填用スケジュールテーブル202を変更する。
(Operation of schedule adjustment unit 592)
The schedule adjustment unit 592 cooperates with the thread scheduler 160 based on the execution cycle number of the hypervisor authority for each thread in the execution cycle number table 300 and the upper limit cycle number and priority for each thread in the adjustment management table 593. The supplementary schedule table 202 of the schedule table 200 is changed every thread update cycle.

図10〜図12は、第2の実施形態のスケジュール調整部592のスケジュール更新周期ごとの動作手順を示すフローチャートである。   10 to 12 are flowcharts illustrating an operation procedure for each schedule update period of the schedule adjustment unit 592 according to the second embodiment.

まず、スケジュール調整部592は、実行サイクル数テーブル記憶部191の実行サイクル数テーブル300からスレッド0のハイパーバイザ権限の実行サイクル数n0を取得する。具体的には、スケジュール調整部592は、実行サイクル数テーブル300の列302、行313に記憶された実行サイクル数n0を取得する(ステップS500)。   First, the schedule adjustment unit 592 acquires the execution cycle number n0 of the hypervisor authority of the thread 0 from the execution cycle number table 300 of the execution cycle number table storage unit 191. Specifically, the schedule adjustment unit 592 acquires the execution cycle number n0 stored in the column 302 and the row 313 of the execution cycle number table 300 (step S500).

次に、スケジュール調整部592は、実行サイクル数テーブル記憶部191の実行サイクル数テーブル300からスレッド1のハイパーバイザ権限の実行サイクル数n1を取得する。具体的には、スケジュール調整部592は、実行サイクル数テーブル300の列303、行313に記憶された実行サイクル数n1を取得する(ステップS501)。   Next, the schedule adjustment unit 592 acquires the execution cycle number n1 of the hypervisor authority of the thread 1 from the execution cycle number table 300 of the execution cycle number table storage unit 191. Specifically, the schedule adjustment unit 592 acquires the number of execution cycles n1 stored in the column 303 and the row 313 of the execution cycle number table 300 (Step S501).

次に、スケジュール調整部592は、調整管理テーブル593からスレッド0の上限サイクル数を取得する。具体的には、スケジュール調整部592は、調整管理テーブル593の列602、行612に記憶された上限サイクル数u0を取得する(ステップS502)。   Next, the schedule adjustment unit 592 acquires the upper limit cycle number of the thread 0 from the adjustment management table 593. Specifically, the schedule adjustment unit 592 acquires the upper limit cycle number u0 stored in the column 602 and the row 612 of the adjustment management table 593 (step S502).

スケジュール調整部592は、ステップS500にて取得した実行サイクル数n0とステップS502で取得した上限サイクル数u0のうち小さい方を要求サイクル数s0として決定する(ステップS503)。   The schedule adjustment unit 592 determines the smaller of the execution cycle number n0 acquired in step S500 and the upper limit cycle number u0 acquired in step S502 as the request cycle number s0 (step S503).

次に、スケジュール調整部592は、調整管理テーブル593からスレッド1の上限サイクル数を取得する。具体的には、スケジュール調整部592は、調整管理テーブル593の列603、行612に記憶された上限サイクル数u1を取得する(ステップS504)。   Next, the schedule adjustment unit 592 acquires the upper limit cycle number of the thread 1 from the adjustment management table 593. Specifically, the schedule adjustment unit 592 acquires the upper limit cycle number u1 stored in the column 603 and the row 612 of the adjustment management table 593 (step S504).

スケジュール調整部592は、ステップS501にて取得した実行サイクル数n1とステップS504で取得した上限サイクル数u1のうち小さい方を要求サイクル数s1として決定する(ステップS505)。   The schedule adjustment unit 592 determines the smaller of the number of execution cycles n1 acquired in step S501 and the upper limit number of cycles u1 acquired in step S504 as the request cycle number s1 (step S505).

次に、スケジュール調整部592は、ステップS503で決定した要求サイクル数s0と、ステップS505で決定した要求サイクル数s1との総和S(=s0+s1)を求める(ステップS506)。   Next, the schedule adjustment unit 592 obtains the sum S (= s0 + s1) of the request cycle number s0 determined in step S503 and the request cycle number s1 determined in step S505 (step S506).

次に、スケジュール調整部192は、求めた総和Sが、補填用スケジュールテーブル202のエントリ数Mと同等もしくは少ないか判断する。   Next, the schedule adjustment unit 192 determines whether the obtained total sum S is equal to or less than the number of entries M in the compensation schedule table 202.

判断した結果、同等もしくは少ない場合(ステップS507のYESの場合)、ステップS510に進む。判断した結果、多い場合(ステップS507のNOの場合)、ステップS520に進む。   As a result of the determination, if equal or less (YES in step S507), the process proceeds to step S510. As a result of the determination, if there are many (NO in step S507), the process proceeds to step S520.

ステップS507でYESの場合は、スケジュール調整部592は、補填用スケジュールテーブル202の第10エントリを起点としてステップS503で決定した要求サイクル数s0個のエントリに「0」を設定する(ステップS510)。さらに、スケジュール調整部592は、実行サイクル数テーブル記憶部191に記憶された実行サイクル数テーブル300のスレッド0のハイパーバイザ権限の実行サイクル数を要求サイクル数s0だけ減じる。具体的には、スケジュール調整部592は、実行サイクル数テーブル300の列302、行313の実行サイクル数から要求サイクル数s0だけを減算して、減算した値で上書きする(ステップS511)。   If YES in step S507, the schedule adjustment unit 592 sets “0” to the entry of the number of request cycles s0 determined in step S503 starting from the tenth entry of the supplementary schedule table 202 (step S510). Further, the schedule adjustment unit 592 reduces the execution cycle number of the hypervisor authority of the thread 0 in the execution cycle number table 300 stored in the execution cycle number table storage unit 191 by the request cycle number s0. Specifically, the schedule adjustment unit 592 subtracts only the request cycle number s0 from the execution cycle number in the column 302 and row 313 of the execution cycle number table 300, and overwrites it with the subtracted value (step S511).

次に、スケジュール調整部592は、補填用スケジュールテーブル202においてステップS510にて「0」を追加した最後のエントリの直後のエントリを起点としてステップS505で決定した要求サイクル数s1個のエントリに「1」を設定する(ステップS512)。さらに、スケジュール調整部592は、実行サイクル数テーブル記憶部191に記憶された実行サイクル数テーブル300のスレッド1のハイパーバイザ権限の実行サイクル数を要求サイクル数s1だけ減じる。具体的には、スケジュール調整部592は、実行サイクル数テーブル300の列303、行313の実行サイクル数から要求サイクル数s1だけを減算して、減算した値で上書きする(ステップS513)。   Next, the schedule adjustment unit 592 adds “1” to the entry of the request cycle number s1 determined in step S505 starting from the entry immediately after the last entry to which “0” is added in step S510 in the compensation schedule table 202. Is set (step S512). Further, the schedule adjustment unit 592 reduces the execution cycle number of the hypervisor authority of the thread 1 in the execution cycle number table 300 stored in the execution cycle number table storage unit 191 by the request cycle number s1. Specifically, the schedule adjustment unit 592 subtracts only the request cycle number s1 from the execution cycle number in the column 303 and row 313 of the execution cycle number table 300, and overwrites it with the subtracted value (step S513).

次に、スケジュール調整部592は、補填用スケジュールテーブル202の残りのエントリがある場合には、ステップS512にて「1」を追加した最後のエントリの直後のエントリを起点として最後のエントリ(第14エントリ)まで、「−1」を設定する(ステップS514)。   Next, when there is a remaining entry in the compensation schedule table 202, the schedule adjustment unit 592 starts from the entry immediately after the last entry to which “1” is added in step S512 as the last entry (14th entry). "-1" is set up to (entry) (step S514).

ステップS507でNOの場合、スケジュール調整部592は、調整管理テーブル593からスレッド0の優先度を取得する。具体的には、スケジュール調整部592は、調整管理テーブル593の列602、行611に記憶されたスレッド0の優先度を取得する(ステップS520)。   If NO in step S507, the schedule adjustment unit 592 acquires the priority of the thread 0 from the adjustment management table 593. Specifically, the schedule adjustment unit 592 acquires the priority of the thread 0 stored in the column 602 and the row 611 of the adjustment management table 593 (Step S520).

次に、スケジュール調整部592は、調整管理テーブル593からスレッド1の優先度を取得する。具体的には、スケジュール調整部592は、調整管理テーブル593の列603、行611に記憶されたスレッド1の優先度を取得する(ステップS521)。   Next, the schedule adjustment unit 592 acquires the priority of the thread 1 from the adjustment management table 593. Specifically, the schedule adjustment unit 592 acquires the priority of the thread 1 stored in the column 603 and the row 611 of the adjustment management table 593 (step S521).

スケジュール調整部592が、スレッド0の優先度とスレッド1の優先度を比較し、スレッド0の優先度がスレッド1の優先度と同等もしくは高い場合には(ステップS522でYES)、ステップS530に進み、スレッド0の優先度がスレッド1の優先度よりも低い場合には(ステップS522でNO)、ステップS540に進む。   The schedule adjustment unit 592 compares the priority of the thread 0 and the priority of the thread 1, and if the priority of the thread 0 is equal to or higher than the priority of the thread 1 (YES in step S522), the process proceeds to step S530. If the priority of thread 0 is lower than the priority of thread 1 (NO in step S522), the process proceeds to step S540.

ステップS522でYESの場合、スケジュール調整部592は、補填用スケジュールテーブル202のエントリ数Mと要求サイクル数s0のうち小さい方を要求サイクル可能数p0に設定する(ステップS530)。   In the case of YES in step S522, the schedule adjustment unit 592 sets the smaller of the entry number M and the request cycle number s0 in the compensation schedule table 202 to the request cycle possible number p0 (step S530).

スケジュール調整部592は、補填用スケジュールテーブル202の第10エントリを起点としてステップS530で決定した要求サイクル可能数p0だけエントリに「0」を設定する(ステップS531)。さらに、スケジュール調整部592は、実行サイクル数テーブル記憶部191に記憶された実行サイクル数テーブル300のスレッド0のハイパーバイザ権限の実行サイクル数を要求サイクル可能数p0だけ減じる。具体的には、スケジュール調整部592は、実行サイクル数テーブル300の列302、行313の実行サイクル数から要求サイクル可能数p0だけを減算して、減算した値で上書きする(ステップS532)。   The schedule adjustment unit 592 sets “0” to the entries for the required number of possible cycles p0 determined in step S530 starting from the tenth entry of the supplementary schedule table 202 (step S531). Further, the schedule adjustment unit 592 reduces the execution cycle number of the hypervisor authority of the thread 0 of the execution cycle number table 300 stored in the execution cycle number table storage unit 191 by the request cycle possible number p0. Specifically, the schedule adjustment unit 592 subtracts only the request cycle possible number p0 from the number of execution cycles in the column 302 and the row 313 of the execution cycle number table 300, and overwrites it with the subtracted value (step S532).

スケジュール調整部592は、補填用スケジュールテーブル202において現在の更新周期において、未設定のエントリがあるか否かを判断する。未設定のエントリがある場合には(ステップS533でYES)、ステップS534に進む。未設定のエントリがない場合には(ステップS533でNO)、処理を終了する。   The schedule adjustment unit 592 determines whether or not there is an unset entry in the compensation schedule table 202 in the current update cycle. If there is an unset entry (YES in step S533), the process proceeds to step S534. If there is no unset entry (NO in step S533), the process ends.

ステップS533でYESの場合、スケジュール調整部592は、未設定のエントリの数MUと要求サイクル数s1のうち、小さい方を要求サイクル可能数p1として決定する(ステップS534)。   If YES in step S533, the schedule adjustment unit 592 determines the smaller of the number MU of unset entries and the request cycle number s1 as the request cycle possible number p1 (step S534).

スケジュール調整部592は、補填用スケジュールテーブル202のステップS531にて「0」を追加した最後のエントリの直後のエントリを起点としてステップS534で決定した要求サイクル可能数p1個のエントリに「1」を設定する(ステップS535)。さらに、スケジュール調整部592は、実行サイクル数テーブル記憶部191に記憶された実行サイクル数テーブル300のスレッド1のハイパーバイザ権限の実行サイクル数を要求サイクル可能数p1だけ減じる。具体的には、スケジュール調整部592は、実行サイクル数テーブル300の列303、行313の実行サイクル数から要求サイクル可能数p1だけを減算して、減算した値で上書きする(ステップS536)。   The schedule adjustment unit 592 sets “1” to the entry of the request cycle possible number p1 determined in step S534 starting from the entry immediately after the last entry to which “0” is added in step S531 of the compensation schedule table 202. Setting is made (step S535). Further, the schedule adjustment unit 592 reduces the execution cycle number of the hypervisor authority of the thread 1 of the execution cycle number table 300 stored in the execution cycle number table storage unit 191 by the request cycle possible number p1. Specifically, the schedule adjustment unit 592 subtracts only the request cycle possible number p1 from the number of execution cycles in the column 303 and row 313 of the execution cycle number table 300, and overwrites it with the subtracted value (step S536).

次に、スケジュール調整部592は、補填用スケジュールテーブル202の残りのエントリがある場合には、ステップS537にて「1」を追加した最後のエントリの直後のエントリを起点として最後のエントリ(第14エントリ)まで、「−1」を設定する(ステップS537)。   Next, when there are remaining entries in the supplementary schedule table 202, the schedule adjustment unit 592 starts from the entry immediately after the last entry to which “1” is added in step S537 as the last entry (14th entry). "-1" is set up to (entry) (step S537).

ステップS522でNOの場合、スケジュール調整部592は、補填用スケジュールテーブル202のエントリ数Mと要求サイクル数s1のうち小さい方を要求サイクル可能数p1として決定する(ステップS540)。   In the case of NO in step S522, the schedule adjustment unit 592 determines the smaller of the entry number M and the request cycle number s1 in the compensation schedule table 202 as the request cycle possible number p1 (step S540).

スケジュール調整部592は、補填用スケジュールテーブル202の第10エントリを起点としてステップS540で決定した要求サイクル可能数p1個のエントリに「1」を設定する(ステップS541)。さらに、スケジュール調整部592は、実行サイクル数テーブル記憶部191に記憶された実行サイクル数テーブル300のスレッド1のハイパーバイザ権限の実行サイクル数を要求サイクル可能数p1だけ減じる。具体的には、スケジュール調整部592は、実行サイクル数テーブル300の列303、行313の実行サイクル数から要求サイクル可能数p1だけを減算して、減算した値で上書きする(ステップS542)。   The schedule adjustment unit 592 sets “1” to the entry of the request cycle possible number p1 determined in step S540 starting from the tenth entry of the compensation schedule table 202 (step S541). Further, the schedule adjustment unit 592 reduces the execution cycle number of the hypervisor authority of the thread 1 of the execution cycle number table 300 stored in the execution cycle number table storage unit 191 by the request cycle possible number p1. Specifically, the schedule adjustment unit 592 subtracts only the request cycle possible number p1 from the execution cycle number in the column 303 and the row 313 of the execution cycle number table 300, and overwrites it with the subtracted value (step S542).

スケジュール調整部592は、補填用スケジュールテーブル202に、現在の更新周期において、未設定のエントリがあるか否かを判断する。未設定のエントリがある場合には(ステップS543でYES)、ステップS544に進む。未設定のエントリがない場合には(ステップS543でNO)、処理を終了する。   The schedule adjustment unit 592 determines whether or not there is an unset entry in the compensation schedule table 202 in the current update cycle. If there is an unset entry (YES in step S543), the process proceeds to step S544. If there is no unset entry (NO in step S543), the process ends.

ステップS543でYESの場合、スケジュール調整部592は、未設定のエントリの数MUと要求サイクル数s0のうち、小さい方を要求サイクル可能数p0として決定する(ステップS544)。   If YES in step S543, the schedule adjustment unit 592 determines the smaller of the number MU of unset entries and the request cycle number s0 as the request cycle possible number p0 (step S544).

スケジュール調整部592は、補填用スケジュールテーブル202のステップS541にて「0」を追加した最後のエントリの直後のエントリを起点としてステップS544で決定した要求サイクル可能数p0個のエントリに「0」を設定する(ステップS545)。さらに、スケジュール調整部592は、実行サイクル数テーブル記憶部191に記憶された実行サイクル数テーブル300のスレッド0のハイパーバイザ権限の実行サイクル数を要求サイクル可能数p0だけ減じる。具体的には、スケジュール調整部592は、実行サイクル数テーブル300の列302、行313の実行サイクル数から要求サイクル可能数p0だけを減算して、減算した値で上書きする(ステップS546)。   The schedule adjustment unit 592 sets “0” to the p0 requested cycle possible entries determined in step S544 starting from the entry immediately after the last entry to which “0” is added in step S541 of the supplementary schedule table 202. It sets (step S545). Further, the schedule adjustment unit 592 reduces the execution cycle number of the hypervisor authority of the thread 0 of the execution cycle number table 300 stored in the execution cycle number table storage unit 191 by the request cycle possible number p0. Specifically, the schedule adjustment unit 592 subtracts only the request cycle possible number p0 from the execution cycle number in the column 302 and row 313 of the execution cycle number table 300, and overwrites it with the subtracted value (step S546).

次に、スケジュール調整部592は、補填用スケジュールテーブル202の残りのエントリがある場合には、ステップS547にて「0」を追加した最後のエントリの直後のエントリを起点として最後のエントリ(第14エントリ)まで、「−1」を設定する(ステップS547)。
(スケジュール調整の例)
図13は、第2の実施形態におけるスケジュール調整の例を説明するための図である。
Next, when there are remaining entries in the supplementary schedule table 202, the schedule adjustment unit 592 starts from the entry immediately after the last entry to which “0” is added in step S547 as the last entry (14th entry). "-1" is set up to (entry) (step S547).
(Example of schedule adjustment)
FIG. 13 is a diagram for explaining an example of schedule adjustment in the second embodiment.

ステップS500にて取得したスレッド0の実行サイクル数n0が「5」とする。
ステップS501にて取得したスレッド1の実行サイクル数n1が「2」とする。
The number of execution cycles n0 of the thread 0 acquired in step S500 is “5”.
The number of execution cycles n1 of the thread 1 acquired in step S501 is “2”.

ステップS502にて取得したスレッド0の上限サイクル数u0が「4」とする。
ステップS503にて、n0>u0より、要求サイクル数s0は「4」となる。
It is assumed that the upper limit cycle number u0 of the thread 0 acquired in step S502 is “4”.
In step S503, since n0> u0, the required cycle number s0 is “4”.

ステップS504にて取得したスレッド1の上限サイクル数u1が「2」とする。
ステップS505にて、n1=u1より、要求サイクル数s1は「2」となる。
The upper limit cycle number u1 of the thread 1 acquired in step S504 is “2”.
In step S505, since n1 = u1, the required cycle number s1 is “2”.

ステップS506にて、s0とs1の総和Sは「6」となる。
ステップS507にて、S>M(=5)によって、ステップS520に進む。
In step S506, the sum S of s0 and s1 is “6”.
In step S507, S> M (= 5), and the process proceeds to step S520.

ステップS520にて取得したスレッド0の優先度を「100」とする。
ステップS521にて取得したスレッド1の優先度を「40」とする。
The priority of the thread 0 acquired in step S520 is set to “100”.
The priority of the thread 1 acquired in step S521 is set to “40”.

ステップS522にて、スレッド0の優先度>スレッド1の優先度によって、ステップS530に進む。   In step S522, the process proceeds to step S530 depending on the priority of thread 0> priority of thread 1.

ステップS530にて、s0<Mによって、要求サイクル可能数p0が「4」となる。
ステップS531にて、補填用スケジュールテーブル202の「4」個のエントリ(第10〜第13エントリ)が「0」に設定される。
In step S530, the required number of possible cycles p0 becomes “4” due to s0 <M.
In step S531, “4” entries (tenth to thirteenth entries) in the compensation schedule table 202 are set to “0”.

ステップS532にて、スレッド0のハイパーバイザ権限の実行サイクル数が「5」から「4」だけ小さい「1」に設定される。   In step S532, the number of execution cycles of the hypervisor authority of thread 0 is set to “1” which is smaller by “4” than “5”.

ステップS533にて、未設定のエントリ(第14エントリ)があるので、ステップS534に進む。   In step S533, since there is an unset entry (14th entry), the process proceeds to step S534.

ステップS534にて、未設定のエントリ数MUが「1」なので、s1>MUによって、要求サイクル可能数p1が「1」となる。   In step S534, since the number of unset entries MU is “1”, the request cycle possible number p1 becomes “1” because s1> MU.

ステップS535にて、補填用スケジュールテーブル202の「1」個のエントリ(第14エントリ)が「1」に設定される。   In step S535, “1” entries (14th entry) in the compensation schedule table 202 are set to “1”.

ステップS536にて、スレッド1のハイパーバイザ権限の実行サイクル数は「2」から「1」だけ小さい「1」に設定される。   In step S536, the number of execution cycles of the hypervisor authority of thread 1 is set to “1” which is smaller from “2” by “1”.

ステップS537では、補填用スケジュールテーブル202の残りのエントリがないので、「−1」が設定されない。   In step S537, since there are no remaining entries in the compensation schedule table 202, “−1” is not set.

以上のように、本実施の形態では、スレッドごとに、ハイパーバイザ権限でハイパーバイザが動作した実行サイクル数を記録し、補填用期間において、各スレッドが、記録されたハイパー権限の実行サイクル数、優先度および上限サイクル数に応じたサイクル数だけ実行されるようにする。   As described above, in this embodiment, for each thread, the number of execution cycles in which the hypervisor operates with the hypervisor authority is recorded, and in the compensation period, each thread records the number of execution cycles of the recorded hyper authority, Only the number of cycles corresponding to the priority and the upper limit number of cycles is executed.

これによって、第1の実施形態と同様に、プログラムが本来動作する予定であったサイクル数の実行が補填され、プログラムへ配分された処理時間を維持することができる。さらに、本実施の形態では、スレッド上で動作するプログラムの優先度順に補填されることによって、優先度の高いプログラムのデッドラインが守れるようにすることができる。また、本実施の形態では、補填されるスレッドのサイクル数に上限値を設定できるため、優先度の低いプログラムであっても補填することができ、プログラムの時間制約が守れない(デッドラインミス)ことが発生しにくくなる。
(第1および第2の実施形態の変形例)
スケジュールテーブル200、コアスケジュールテーブル201、補填用スケジュールテーブル202のエントリ数は、図2に示すものに限定されるものではなく、任意の数が可能である。
As a result, as in the first embodiment, the execution of the number of cycles that the program was originally supposed to operate is compensated for, and the processing time allocated to the program can be maintained. Furthermore, in this embodiment, the deadline of a program with a high priority can be protected by making up for the programs in order of priority of programs operating on threads. Further, in this embodiment, since an upper limit value can be set for the number of threads to be compensated, even a low priority program can be compensated, and the program time constraint cannot be observed (deadline miss). It becomes difficult to occur.
(Modification of the first and second embodiments)
The number of entries in the schedule table 200, the core schedule table 201, and the compensation schedule table 202 is not limited to that shown in FIG. 2, and any number is possible.

また、コアスケジュールテーブル201、補填用スケジュールテーブル202に含まれるエントリも、図2にしめすものに限定されるものではなく、図14(a)、図14(b)に示すものであってもよい。   Further, the entries included in the core schedule table 201 and the supplementary schedule table 202 are not limited to those shown in FIG. 2, but may be those shown in FIGS. 14 (a) and 14 (b). .

図14(a)に示すように、スケジュールテーブル230は、第5〜第14エントリを含むコアスケジュールテーブル231と、第0〜第4エントリを含む補填用スケジュールテーブル232とを含む。   As shown in FIG. 14A, the schedule table 230 includes a core schedule table 231 including the fifth to fourteenth entries and a compensation schedule table 232 including the zeroth to fourth entries.

また、 図14(b)に示すように、スケジュールテーブル240は、第0、1、3、4、6、7、9、10、12、13エントリを含むコアスケジュールテーブル241と、第2、第5、第8、第11、第14エントリを含む補填用スケジュールテーブル242とを含む。   As shown in FIG. 14B, the schedule table 240 includes a core schedule table 241 including entries 0, 1, 3, 4, 6, 7, 9, 10, 12, 13 and second, second, And a supplementary schedule table 242 including fifth, eighth, eleventh and fourteenth entries.

今回開示された実施の形態はすべての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は上記した説明ではなくて特許請求の範囲によって示され、特許請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。   The embodiment disclosed this time should be considered as illustrative in all points and not restrictive. The scope of the present invention is defined by the terms of the claims, rather than the description above, and is intended to include any modifications within the scope and meaning equivalent to the terms of the claims.

100 命令バス、101,102 主記憶部、110 第0命令バッファ、111 第1命令バッファ、120,121,122 セレクタ、130 デコーダ、140 実行部、145 命令フェッチ部、150 第0レジスタセット、151 第1レジスタセット、160 スレッドスケジューラ、170 データバス、180 スケジュールレジスタ、190 実行サイクル数加算部、191 実行サイクル数テーブル記憶部、192,592 スケジュール調整部、200,230,240 スケジュールテーブル、201,231,241 コアスケジュールテーブル、202,232,242 補填用スケジュールテーブル、300 実行サイクル数テーブル、593 調整管理テーブル、600 調整管理テーブル記憶部。   100 instruction bus, 101, 102 main storage unit, 110 0th instruction buffer, 111 1st instruction buffer, 120, 121, 122 selector, 130 decoder, 140 execution unit, 145 instruction fetch unit, 150 0th register set, 151 1st 1 register set, 160 thread scheduler, 170 data bus, 180 schedule register, 190 execution cycle number addition unit, 191 execution cycle number table storage unit, 192, 592 schedule adjustment unit, 200, 230, 240 schedule table, 201, 231, 241 Core schedule table, 202, 232, 242 Compensation schedule table, 300 execution cycle number table, 593 adjustment management table, 600 adjustment management table storage unit.

Claims (9)

各スレッドがサイクルごとにユーザ権限またはユーザ権限以外の権限で動作するマルチスレッドプロセッサであって、
サイクル単位で実行するスレッドを切り換えるスケジューラと、
オペレーティングシステムまたはハイパーバイザによって実行するスレッドが設定される第1期間以外の第2期間に実行するスレッドを設定するスケジュール調整部とを備え、
前記スケジュール調整部は、ユーザ権限以外の権限で動作したスレッドが、前記第2期間において、補充的に実行されるように調整する、マルチスレッドプロセッサ。
A multi-thread processor in which each thread operates with user authority or non-user authority every cycle,
A scheduler that switches threads to be executed in units of cycles;
A schedule adjustment unit configured to set a thread to be executed in a second period other than the first period in which a thread to be executed by the operating system or the hypervisor is set;
The schedule adjustment unit is a multi-thread processor that adjusts a thread that operates with an authority other than a user authority to be supplementarily executed in the second period.
スレッドごとに、ユーザ権限以外の第1の権限で動作したサイクル数を第1の権限サイクル数として記憶する第1の記憶部と、
所定数のサイクルについて、サイクルごとに実行するスレッドを定めたスケジュールを記憶する第2の記憶部と、
前記スケジュールは、前記第1期間で実行するスレッドを定めた第1スケジュールと、前記第2期間で実行するスレッドを定めた第2スケジュールとを含み、
前記スケジュール調整部は、前記所定数のサイクルごとに、前記第1の記憶部に記憶された前記スレッドごとの前記第1の権限サイクル数に基づいて、前記第2スケジュールのスレッドを設定する、請求項1記載のマルチスレッドプロセッサ。
A first storage unit that stores, as a first authority cycle number, the number of cycles operated with a first authority other than the user authority for each thread;
A second storage unit that stores a schedule that defines threads to be executed for each cycle for a predetermined number of cycles;
The schedule includes a first schedule that defines threads to be executed in the first period, and a second schedule that defines threads to be executed in the second period,
The schedule adjustment unit sets a thread of the second schedule based on the first number of authority cycles for each of the threads stored in the first storage unit for each predetermined number of cycles. Item 4. The multithread processor according to Item 1.
サイクルごとに、ユーザ権限以外の権限で動作したスレッドがある場合に、前記第1の記憶部に記憶されている前記スレッドの前記第1の権限サイクル数を1つインクリメントする実行サイクル数加算部を備え、
前記スケジュール調整部は、所定数のサイクルごとに、前記第2スケジュールに設定した各スレッドの個数を前記第1の記憶部に記憶されている前記各スレッドの前記第1の権限サイクル数から減算する、請求項2記載のマルチスレッドプロセッサ。
An execution cycle number adding unit that increments the first authority cycle number of the thread stored in the first storage unit by one when there is a thread that operates with an authority other than the user authority for each cycle. Prepared,
The schedule adjustment unit subtracts the number of threads set in the second schedule from the first authority cycle number of each thread stored in the first storage unit for each predetermined number of cycles. The multi-thread processor according to claim 2.
前記スケジュール調整部は、前記第1の記憶部に記憶されている各スレッドの前記第1の権限サイクル数の和が前記第2スケジュールに設定可能なスレッド数以下場合には、前記第2スケジュールに設定する各スレッドの個数を前記各スレッドの前記第1の権限サイクル数とする、請求項3記載のマルチスレッドプロセッサ。   When the sum of the first authority cycle numbers of the respective threads stored in the first storage unit is less than or equal to the number of threads that can be set in the second schedule, the schedule adjustment unit sets the second schedule. The multi-thread processor according to claim 3, wherein the number of threads to be set is the first number of authority cycles of each thread. 前記スケジュール調整部は、前記第1の記憶部に記憶される各スレッドの前記第1の権限サイクル数の和が前記第2スケジュールに設定可能なスレッド数よりも大きい場合には、前記第2スケジュールに設定可能なスレッド数の前記第1の権限サイクル数の和に対する比率を計算し、さらに、前記各スレッドの前記第1の権限サイクル数と前記比率とを乗算して、前記各スレッドの前記第1の権限サイクル数の修正値を計算し、前記第2スケジュールに設定する各スレッドの個数を前記各スレッドの前記第1の権限サイクル数の修正値とする、請求項4記載のマルチスレッドプロセッサ。   When the sum of the number of first authority cycles of each thread stored in the first storage unit is larger than the number of threads that can be set in the second schedule, the schedule adjustment unit The ratio of the number of threads that can be set to the sum of the number of the first authority cycles is calculated, and the first authority cycle number of each thread is multiplied by the ratio to calculate the ratio of the first authority cycle number of each thread. 5. The multithread processor according to claim 4, wherein a correction value for one authority cycle number is calculated, and the number of threads set in the second schedule is used as the correction value for the first authority cycle number for each thread. スレッドごとの優先度を記憶する第3の記憶部を備え、
前記スケジュール調整部は、前記所定数のサイクルごとに、前記第1の記憶部に記憶された前記スレッドごとの前記第1の権限サイクル数と、前記第3の記憶部に記憶された前記スレッドごとの優先度に基づいて、前記第2スケジュールのスレッドを設定する、請求項2記載のマルチスレッドプロセッサ。
A third storage unit that stores the priority of each thread;
For each of the predetermined number of cycles, the schedule adjustment unit includes the first authority cycle number for each thread stored in the first storage unit and the thread stored in the third storage unit. The multi-thread processor according to claim 2, wherein a thread of the second schedule is set based on the priority.
スレッドごとに前記第2スケジュールに設定可能な個数の上限値を記憶する第3の記憶部を備え、
前記スケジュール調整部は、前記所定数のサイクルごとに、前記第1の記憶部に記憶された前記スレッドごとの前記第1の権限サイクル数と、前記第3の記憶部に記憶された前記スレッドごとの前記設定可能な個数の上限値に基づいて、前記第2スケジュールのスレッドを設定する、請求項2記載のマルチスレッドプロセッサ。
A third storage unit that stores an upper limit value of the number that can be set in the second schedule for each thread;
For each of the predetermined number of cycles, the schedule adjustment unit includes the first authority cycle number for each thread stored in the first storage unit and the thread stored in the third storage unit. The multi-thread processor according to claim 2, wherein a thread of the second schedule is set based on the upper limit value of the settable number.
前記第1の権限が、ハイパーバイザ権限である、請求項1記載のマルチスレッドプロセッサ。   The multithreaded processor of claim 1, wherein the first authority is a hypervisor authority. 前記第1の権限が、スーパーバイザ権限である、請求項1記載のマルチスレッドプロセッサ。   The multithreaded processor of claim 1, wherein the first authority is a supervisor authority.
JP2013022209A 2013-02-07 2013-02-07 Multi-thread processor Pending JP2014153860A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013022209A JP2014153860A (en) 2013-02-07 2013-02-07 Multi-thread processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013022209A JP2014153860A (en) 2013-02-07 2013-02-07 Multi-thread processor

Publications (1)

Publication Number Publication Date
JP2014153860A true JP2014153860A (en) 2014-08-25

Family

ID=51575690

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013022209A Pending JP2014153860A (en) 2013-02-07 2013-02-07 Multi-thread processor

Country Status (1)

Country Link
JP (1) JP2014153860A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2019079530A (en) * 2017-10-20 2019-05-23 グラフコアー リミテッドGraphcore Limited Scheduling tasks in multi-threaded processor
US10606641B2 (en) 2017-10-20 2020-03-31 Graphcore Limited Scheduling tasks in a multi-threaded processor

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2019079530A (en) * 2017-10-20 2019-05-23 グラフコアー リミテッドGraphcore Limited Scheduling tasks in multi-threaded processor
US10606641B2 (en) 2017-10-20 2020-03-31 Graphcore Limited Scheduling tasks in a multi-threaded processor
US10956165B2 (en) 2017-10-20 2021-03-23 Graphcore Limited Scheduling tasks in a multi-threaded processor
US11550591B2 (en) 2017-10-20 2023-01-10 Graphcore Limited Scheduling tasks in a multi-threaded processor

Similar Documents

Publication Publication Date Title
KR102592376B1 (en) Apparatus and method for controlling command execution operation
US8695002B2 (en) Multi-threaded processors and multi-processor systems comprising shared resources
US9436464B2 (en) Instruction-issuance controlling device and instruction-issuance controlling method
JP5173714B2 (en) Multi-thread processor and interrupt processing method thereof
JP4770664B2 (en) Microprocessor and microcomputer using the same
US20060161924A1 (en) Scheduling method, in particular context scheduling method, and device to be used with a scheduling method
JP7397858B2 (en) Controlling access to the branch prediction unit for a sequence of fetch groups
US10853075B2 (en) Controlling accesses to a branch prediction unit for sequences of fetch groups
JP4865016B2 (en) Processor
JP2014153860A (en) Multi-thread processor
JP5108690B2 (en) DMA apparatus and DMA transfer method
US20200026650A1 (en) Arithmetic processing device and arithmetic processing method
JP2020091751A (en) Operation processing device and method for controlling the same
JP2008015562A (en) Cache mistake/hit prediction
JP5843804B2 (en) Arithmetic apparatus and error processing method
JP2009140130A (en) Data processor, and method for controlling the same
JP7510253B2 (en) Branch Predictor
JP2020077334A (en) Arithmetic processing device and method for controlling arithmetic processing device
JP6160571B2 (en) Data processing device
US20220156074A1 (en) Electronic device and multiplexing method of spatial
JP2023508869A (en) Controlling access to the branch prediction unit for a sequence of fetch groups
JP2012168725A (en) Multi-thread processor
JP2010122787A (en) Semiconductor integrated circuit and register address control device
US10817288B2 (en) Combined instruction for addition and checking of terminals
KR20140057869A (en) Method for controlling data read/write of embedded system of vehicle