JP4196982B2 - Processor and program execution method - Google Patents
Processor and program execution method Download PDFInfo
- Publication number
- JP4196982B2 JP4196982B2 JP2005287949A JP2005287949A JP4196982B2 JP 4196982 B2 JP4196982 B2 JP 4196982B2 JP 2005287949 A JP2005287949 A JP 2005287949A JP 2005287949 A JP2005287949 A JP 2005287949A JP 4196982 B2 JP4196982 B2 JP 4196982B2
- Authority
- JP
- Japan
- Prior art keywords
- program
- register
- time
- execution
- value
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Lifetime
Links
Images
Landscapes
- Memory System Of A Hierarchy Structure (AREA)
Description
本発明は、プロセッサに関し、特に、効率的にプログラムを実行する技術に関する。 The present invention relates to a processor, and more particularly to a technique for efficiently executing a program.
従来、複数のタスクを1つのプロセッサで擬似並行的に処理するためのOS(Operating System)がある。このOSは、以下の処理をプロセッサに実行させる。即ち、プロセッサは、タスク毎に対応するプログラムの実行位置やデータの格納位置などを示す制御情報(以下、「コンテキスト」という。)をプロセッサ内部のレジスタ群に格納し、格納されたコンテキストにもとづいてプログラムやデータを取得してタスクを実行し、タスクの実行に伴ってコンテキストを更新し、このコンテキストをメモリに書き込むという処理を繰り返す。 Conventionally, there is an OS (Operating System) for processing a plurality of tasks in a pseudo-parallel manner by a single processor. This OS causes the processor to execute the following processing. That is, the processor stores control information (hereinafter referred to as “context”) indicating the execution position of the program corresponding to each task, the data storage position, and the like in a register group inside the processor, and based on the stored context. The process of acquiring a program and data, executing a task, updating the context as the task is executed, and writing the context to the memory is repeated.
ここで、便宜的に、外部のメモリに格納されているコンテキストをレジスタ群に書き込むことを復帰といい、レジスタ群に格納されているコンテキストをこのメモリに書き込むことを退避ということとする。図32は、このようなOSの支配のもと、タスクを実行する従来のプロセッサ1001の機能ブロック図であり、上述のコンテキストを格納しているコンテキストメモリ1010も合わせて示す。
Here, for convenience, writing the context stored in the external memory to the register group is referred to as restoration, and writing the context stored in the register group to the memory is referred to as saving. FIG. 32 is a functional block diagram of a
プロセッサ1001は、タスクを実行する処理実行部1002と、処理実行部1002における処理に関する制御を実施する制御部1003と、実行するタスクのコンテキストを格納するレジスタ群1004とを有する。レジスタ群1004は、1つのタスクに対応するコンテキスト、即ち、レジスタ値群を格納するためのレジスタの集まりである。
処理実行部1002は、新たなコンテキストがレジスタ群1004に格納される毎に、このコンテキストにもとづいてプログラムやデータを取得してタスクを実行する。制御部1003は、レジスタ群1004内に既に格納されているコンテキストをコンテキストメモリ1010に上書きすることにより退避し、次にどのコンテキストをレジスタ群1004への格納対象とすべきかを判断し、この判断により格納対象とされたコンテキストをコンテキストメモリ1010から読み出してレジスタ群1004に書き込むことにより復帰する。
The
Each time a new context is stored in the
したがって、処理実行部1002は、上述の退避、判断及び復帰中においては、レジスタ群1004の内容であるコンテキストを更新している最中であるので、プログラムの実行を中断せざるを得ない。図33は、プロセッサ1001におけるタスク実行の流れ及びレジスタ群1004とコンテキストメモリ1010との間におけるコンテキストの入出力の状況を示す図である。
Therefore, the
この図の左から右へと時間が経過するものとする。ここでは、例えば、タスクA、タスクB、タスクC及びタスクDの4つのタスクがあるものとし、タスクの実行順序は、各タスクが均等に処理されるようにタスクA、タスクB、タスクC及びタスクDの順となっているものとし、タスクDの次は、また、タスクAから実行されるものとする。
従来、各タスクの実行に際し、事前に上述の退避、判断及び復帰に実施される。つまり、各タスクを実行する上で、上述の退避、判断及び復帰がオーバーヘッドとなっている。ここで、タスクAからタスクDまでの処理を1サイクルの処理と定義づけると、上述のOSは、この1サイクルにおける、各タスクの実行順序及びタスクの実行時間、つまり、タスクのスケジュールを規定している。
It is assumed that time elapses from left to right in this figure. Here, for example, it is assumed that there are four tasks, task A, task B, task C, and task D, and the execution order of the tasks is task A, task B, task C, and so that each task is processed equally. It is assumed that task D is in order, and task D is executed from task A next.
Conventionally, when executing each task, the above-described saving, determination, and return are performed in advance. That is, in executing each task, the above-described saving, determining, and returning are overhead. Here, if the processing from task A to task D is defined as one-cycle processing, the OS described above specifies the execution order of each task and the execution time of each task, that is, the task schedule in this one cycle. ing.
制御部1003は、このスケジュールにもとづいて、上述の判断、即ち、レジスタ群1004への格納対象とするコンテキストを決定する。以上のような処理を実施することにより、1つのプロセッサで複数のタスクを擬似並行的に処理することができる。また、上述の退避、判断及び復帰をハードウエアで実行し、複数のタスクを擬似並行的に処理するプロセッサもある。(例えば、特許文献1)
しかしながら、このように1つのプロセッサで複数のタスクを擬似並行的に処理する場合、1つのタスクのみを継続的に実行する場合に比べ、タスクの実行までに上述の退避、判断及び復帰のオーバーヘッドが生じ、タスクの実行開始から次のタスクの実行開始までの時間がかかり、効率的にタスクの実行が行えないという問題がある。
特に、携帯電話などの通信機器及びTV受像機などの放送機器などにおいては、リアルタイムに近い状態でのデータ処理を実行する必要があるが、このような機器において、複数のタスクを擬似並行的に処理する場合、上述のオーバーヘッドがある従来のタスクの実行方法では、上述のようなリアルタイム近い状態でのデータ処理の実施は困難となる。
However, when a plurality of tasks are processed in a pseudo-parallel manner by one processor in this way, the overhead of the above-described saving, judgment and restoration is executed before the task is executed, compared to the case where only one task is continuously executed. As a result, there is a problem that it takes time from the start of execution of a task to the start of execution of the next task, and the task cannot be executed efficiently.
Especially in communication devices such as mobile phones and broadcasting devices such as TV receivers, it is necessary to execute data processing in a state close to real time. In the case of processing, with the conventional task execution method having the overhead described above, it becomes difficult to perform data processing in a state close to real time as described above.
そこで本発明は、上記問題点に鑑みてなされたものであり、1つのプロセッサで擬似並行的に複数のタスク、即ち、プログラムを実行する場合に、効率的にタスクを実行可能なプロセッサ及びプログラム実行方法を提供することを目的とする。 Accordingly, the present invention has been made in view of the above problems, and a processor capable of efficiently executing a task and a program execution when a plurality of tasks, that is, a program is executed in a pseudo-parallel manner by one processor. It aims to provide a method.
上記の目的を達成するために、本発明に係るプロセッサは、メモリに格納されている複数のレジスタ値群を用いて、これらレジスタ値群それぞれに対応するプログラムを逐次実行するプロセッサであって、複数のレジスタ群と、前記複数のレジスタ群のうちいずれか1つを、プログラム実行の基礎とする実行対象レジスタ群として選択し、当該選択先を所定時間毎に切り替える選択先切り替え手段と、前記切り替えがなされる毎に、前記複数のレジスタ群のうち前記選択がなされていない1のレジスタ群に前記レジスタ値群を復帰する復帰手段と、前記切り替えがなされる毎に、前記復帰に先行して、当該復帰の対象となったレジスタ群にある各レジスタ値を、これらレジスタ値に対応する前記メモリ中のレジスタ値群に上書きすることにより退避する退避手段と、前記切り替えがなされる毎に、前記実行対象レジスタ群にあるプログラムカウンタ値を含むレジスタ値群によりプログラムを特定し、前記特定したプログラムを実行するプログラム実行手段とを備え、前記所定時間は、複数のカウント値がそれぞれのプログラムに対応づけられて格納されたテーブル情報にもとづいて、前記カウント値により特定された時間であることを特徴とし、また、複数のレジスタ値群を用いて、これらレジスタ値群それぞれに対応するプログラムを逐次実行するプロセッサであって、前記レジスタ値群のそれぞれを格納する複数のレジスタ群と、前記複数のレジスタ群のうちいずれか1つを、プログラム実行の基礎とする実行対象レジスタ群として選択し、当該選択先を所定時間毎に切り替える選択先切り替え手段と、前記切り替えがなされる毎に、前記実行対象レジスタ群にあるプログラムカウンタ値を含むレジスタ値群によりプログラムを特定し、前記特定したプログラムを実行するプログラム実行手段とを備え、前記所定時間は、複数のカウント値がそれぞれのプログラムに対応づけられて格納されたテーブル情報にもとづいて、前記カウント値により特定された時間であることを特徴とする。 To achieve the above object, a processor according to the present invention uses a plurality of register value groups stored in a memory, and sequentially executes a program corresponding to each of these register value groups. A selection destination switching unit that selects any one of the plurality of register groups and the plurality of register groups as an execution target register group that is a basis for program execution, and switches the selection destination at predetermined time intervals; Each time it is made, a return means for returning the register value group to one register group that has not been selected from among the plurality of register groups, and before each return, By overwriting each register value in the register group to be restored to the register value group in the memory corresponding to these register values. Saving means for saving and program execution means for specifying a program by a register value group including a program counter value in the execution target register group each time the switching is performed, and executing the specified program, The predetermined time is a time specified by the count value based on table information in which a plurality of count values are stored in association with each program, and a plurality of register value groups are used. A processor for sequentially executing a program corresponding to each of these register value groups, wherein a plurality of register groups storing each of the register value groups and any one of the plurality of register groups are program-executed Selected as the execution target register group that is the basis of the target, and the selection destination is switched every predetermined time A selection destination switching means; and a program execution means for specifying a program by a register value group including a program counter value in the execution target register group each time the switching is performed, and executing the specified program, The predetermined time is a time specified by the count value based on table information in which a plurality of count values are stored in association with each program.
また、本発明に係るプログラム実行方法は、複数のレジスタ群を備え、メモリに格納されている複数のレジスタ値群を用いて、これらレジスタ値群それぞれに対応するプログラムを逐次実行するプロセッサにおいて、プログラムを実行するプログラム実行方法であって、前記複数のレジスタ群のうちいずれか1つを、プログラム実行の基礎とする実行対象レジスタ群として選択し、当該選択先を所定時間毎に切り替える選択先切り替えステップと、前記切り替えがなされる毎に、前記複数のレジスタ群のうち前記選択がなされていない1のレジスタ群に前記レジスタ値群を復帰する復帰ステップと、前記切り替えがなされる毎に、前記復帰に先行して、当該復帰の対象となったレジスタ群にある各レジスタ値を、これらレジスタ値に対応する前記メモリ中のレジスタ値群に上書きすることにより退避する退避ステップと、前記切り替えがなされる毎に、前記実行対象レジスタ群にあるプログラムカウンタ値を含むレジスタ値群によりプログラムを特定し、前記特定したプログラムを実行するプログラム実行ステップとを含み、前記所定時間は、複数のカウント値がそれぞれのプログラムに対応づけられて格納されたテーブル情報にもとづいて、前記カウント値により特定された時間であることを特徴とし、また、複数のレジスタ群を備え、複数のレジスタ値群を用いて、これらレジスタ値群それぞれに対応するプログラムを逐次実行するプロセッサにおいて、プログラムを実行するプログラム実行方法であって、前記複数のレジスタ群のうちいずれか1つを、プログラム実行の基礎とする実行対象レジスタ群として選択し、当該選択先を所定時間毎に切り替える選択先切り替えステップと、前記切り替えがなされる毎に、前記実行対象レジスタ群にあるプログラムカウンタ値を含むレジスタ値群によりプログラムを特定し、前記特定したプログラムを実行するプログラム実行ステップとを含み、前記所定時間は、複数のカウント値がそれぞれのプログラムに対応づけられて格納されたテーブル情報にもとづいて、前記カウント値により特定された時間であることを特徴とする。 In addition, a program execution method according to the present invention includes a plurality of register groups, and uses a plurality of register value groups stored in a memory to sequentially execute a program corresponding to each of these register value groups. And a selection destination switching step of selecting any one of the plurality of register groups as an execution target register group as a basis for program execution and switching the selection destination at predetermined time intervals. And a return step of returning the register value group to one register group that has not been selected among the plurality of register groups each time the switching is performed, and to the return each time the switching is performed. Prior to this, each register value in the register group to be restored corresponds to these register values. A save step for saving by overwriting the register value group in the memory, and each time the switching is performed, a program is specified by a register value group including a program counter value in the execution target register group, and the specified A program execution step of executing a program, wherein the predetermined time is a time specified by the count value based on table information in which a plurality of count values are stored in association with each program. A program execution method for executing a program in a processor comprising a plurality of register groups and using a plurality of register value groups to sequentially execute a program corresponding to each register value group. One of the register groups of A selection destination switching step for selecting the execution target register group to be performed and switching the selection destination at predetermined time intervals, and each time the switching is performed, a program is executed by a register value group including a program counter value in the execution target register group. And a program execution step for executing the specified program, wherein the predetermined time is specified by the count value based on table information in which a plurality of count values are stored in association with each program. It is characterized by a long time.
上記構成により、前記所定時間が複数のカウント値にもとづいて特定され、前記所定時間を非固定的な時間に設定することができるため、前記切り替えの間隔、つまりプログラム実行時間を非固定的に設定することができる。また、プログラムの実行に影響を及ぼすことなく、事前にレジスタ値群が実行対象レジスタ群以外のレジスタ群に復帰されるので、当該レジスタ値にもとづいてプログラムを実行しようとする際、前記復帰及び退避などのオーバーヘッドが解消されているため、速やかにプログラムが実行され得る環境となっており、プログラムがより高速に実行される。 With the above configuration, since the predetermined time is specified based on a plurality of count values, and the predetermined time can be set to a non-fixed time, the switching interval, that is, the program execution time is set non-fixed. can do. In addition, since the register value group is restored in advance to a register group other than the execution target register group without affecting the execution of the program, when the program is to be executed based on the register value, the restoration and saving are performed. Therefore, the program can be executed quickly, and the program is executed at higher speed.
また、上述のオーバーヘッドの解消により、頻繁に前記切り替えがなされても、プログラムの実行時間には影響がなく、擬似的なリアルタイム処理の並列実行に効果的である。
また、前記プログラム実行手段は、前記切り替えがなされたとき、前記実行を開始するとしてもよい。
これにより、プログラムを実行しようとする際、速やかにプログラムが実行され、オーバーヘッドがほとんど解消される。
Further, by eliminating the overhead described above, even if the switching is frequently performed, the execution time of the program is not affected, and it is effective for parallel execution of pseudo real-time processing.
Further, the program execution means may start the execution when the switching is performed.
As a result, when the program is to be executed, the program is quickly executed, and the overhead is almost eliminated.
また、前記プロセッサは、さらに、各プログラムに対応するレジスタ値群の順序を示す順序情報を取得する順序情報取得手段を備え、前記復帰手段は、前記順序情報にもとづいて、復帰すべきレジスタ値群を決定し、前記復帰を実施するとしてもよい。
これにより、プログラムの実行順序は、前記順序情報により決定される。
また、前記所定時間は、当該順序情報の前記順序に対応するレジスタ値群全てにおいて前記復帰がなれるとしたときに、当該復帰がなされた各レジスタ群が実行対象レジスタ群として選択される時間の合計が所定の期間以内となるように決められているとしてもよい。
The processor further includes order information acquisition means for acquiring order information indicating the order of register value groups corresponding to each program, and the return means is a register value group to be returned based on the order information. And the return may be performed.
Thereby, the execution order of the program is determined by the order information.
In addition, the predetermined time is the total of the time when each of the register groups that have been restored is selected as the execution target register group when the restoration can be performed in all the register value groups corresponding to the order of the order information. May be determined to be within a predetermined period.
これにより、限られた時間以内で複数の処理が擬似的に並列実行される。つまり、処理時間が限られたリアルタイム処理の擬似的な並列などに有効となる。
また、前記順序情報は、レジスタ値群毎に固有な識別情報が所定の順番に配列されたテーブルであり、前記順序は、前記識別情報の配列の順番により示されるとしてもよい。
これにより、前記レジスタ値群の復帰順序は、識別情報の配列の順番により示され、当該配列の順番を変えることにより、前記レジスタ値群の復帰順序が変更される。
As a result, a plurality of processes are simulated and executed in parallel within a limited time. In other words, it is effective for pseudo-parallel real-time processing with a limited processing time.
The order information may be a table in which identification information unique to each register value group is arranged in a predetermined order, and the order may be indicated by the order of the arrangement of the identification information.
Thereby, the return order of the register value group is indicated by the order of the arrangement of the identification information, and the return order of the register value group is changed by changing the order of the array.
また、前記順序情報は、前記配列中に同一の識別情報を1以上含み、同一の識別情報どうしが位置的に偏らないように配列され、当該配列中における同じ識別情報の数は、各識別情報により特定されるレジスタ値群に対応するプログラム毎に固有であるとしてもよい。
これにより、各プログラムの実行されるタイミングが均等化される。
The order information includes one or more pieces of the same identification information in the array, and is arranged so that the same identification information is not biased in position. The number of the same identification information in the array It may be unique to each program corresponding to the register value group specified by.
Thereby, the execution timing of each program is equalized.
また、前記複数のプログラムは、前記テーブルの変更の要否を判断して前記テーブルを変更するための管理プログラムを含み、前記配列中における、前記管理プログラムに対応するレジスタ値群の所在を特定する識別情報の数は1つのみであるとしてもよい。
これにより、擬似的に並列実行される都度、テーブルを変更する機会が与えられる。
また、前記所定時間は、前記複数のプログラム毎に固有の時間であり、さらに、各識別情報は、当該識別情報により特定されるレジスタ値群に対応するプログラムの前記固有の時間を示す時間情報が付加されており、前記管理プログラムは、各識別情報に付加されている時間情報により示される前記固有の時間の合計が前記所定の期間以内となるように前記変更を実施するとしてもよい。
The plurality of programs includes a management program for determining whether or not the table needs to be changed and changing the table, and specifies a location of a register value group corresponding to the management program in the array. The number of identification information may be only one.
This gives an opportunity to change the table each time it is executed in parallel in a pseudo manner.
The predetermined time is a time unique to each of the plurality of programs, and each identification information includes time information indicating the unique time of the program corresponding to the register value group specified by the identification information. The management program may perform the change so that the total of the specific times indicated by the time information added to each identification information is within the predetermined period.
これにより、限られた時間以内で複数の処理が擬似的に並列実行されるように、管理プログラムにより前記固有の時間が更新される。
また、前記プログラム実行手段は、前記管理プログラムの実行中において、前記テーブルの変更が必要と判断した場合、前記テーブルに対して前記変更がなされた状態のダミーテーブルを生成し、当該ダミーテーブルと前記テーブルとを入れ替えることにより前記変更を実施するとしてもよい。
Thereby, the specific time is updated by the management program so that a plurality of processes are executed in parallel in a pseudo manner within a limited time.
In addition, when the program execution unit determines that the table needs to be changed during the execution of the management program, the program execution unit generates a dummy table in which the change has been made with respect to the table, The change may be performed by replacing the table.
これにより、プログラムの実行に影響を与えることなく、前記テーブルが変更され得る。
また、前記複数のプログラムは、映像処理を実行するための映像処理プログラムを含み、前記配列中における、当該映像処理プログラムに対応するレジスタ値群の所在を特定する識別情報の数は、他のプログラムよりも多いとしてもよい。
Thereby, the table can be changed without affecting the execution of the program.
The plurality of programs includes a video processing program for executing video processing, and the number of pieces of identification information for specifying the location of the register value group corresponding to the video processing program in the array is different from the other programs. It may be more.
これにより、情報量の多い映像処理プログラムについては、総合的にみると、処理時間が長く割り当てられる。
また、前記識別情報は、レジスタ値群が記憶されている領域を示すアドレス値であり、前記復帰手段は、前記アドレス値により復帰すべきレジスタ値群の所在を特定し、前記復帰を実施するとしてもよい。
As a result, a video processing program with a large amount of information is assigned a long processing time when viewed comprehensively.
Further, the identification information is an address value indicating an area in which the register value group is stored, and the return means specifies the location of the register value group to be returned by the address value and performs the return Also good.
これにより、前記レジスタ値群の復帰順序は、アドレス値の大小関係により示され得る。
また、前記順序情報は、レジスタ値群毎に固有な識別情報それぞれに他の識別情報を指し示すポインタが付されているテーブルであり、前記順序は、前記ポインタを辿っていくことにより示されているとしてもよい。
Thereby, the return order of the register value group can be indicated by the magnitude relationship of the address values.
The order information is a table in which each identification information unique to each register value group is attached with a pointer pointing to other identification information, and the order is indicated by tracing the pointer. It is good.
これにより、前記レジスタ値群の復帰順序は、前記ポインタにより示され、当該ポインタの指し示す先を変更することにより、前記レジスタ値群の復帰順序が変更される。
また、さらに、プログラムの実行を中断する中断事由が発生していることを検出する中断事由発生検出手段と、前記中断事由が解消したことを検出する中断事由解消検出手段とを備え、前記プログラム実行手段は、プログラムの実行に際し、当該プログラムについての中断事由の発生が検出された場合、当該中断事由が解消するまで、当該プログラムの実行のために割り当てられるべき実行期間を放棄するとしてもよい。
Thereby, the return order of the register value group is indicated by the pointer, and the return order of the register value group is changed by changing the destination indicated by the pointer.
Further, the program execution includes: an interruption reason occurrence detecting means for detecting that an interruption reason for interrupting execution of the program has occurred; and an interruption reason elimination detecting means for detecting that the interruption reason has been resolved. The means may abandon an execution period to be allocated for the execution of the program until the interruption cause is resolved when the occurrence of the interruption cause for the program is detected.
これにより、意味のないプログラムの実行が回避される。
また、前記中断事由は、複数あり、前記放棄のトリガとして有効な中断事由は、プログラム毎に固有であり、前記プログラム実行手段は、実行中のプログラムに有効な中断事由が発生しているときに限り、前記放棄を実施するとしてもよい。
これにより、プログラム毎に、中断事由が生じたときの放棄の可否が判断される。
This avoids execution of meaningless programs.
Also, there are a plurality of interruption reasons, the interruption reasons effective as a trigger for abandonment are specific to each program, and the program execution means is provided when an effective interruption reason occurs in the program being executed. As long as the above abandonment may be implemented.
As a result, it is determined for each program whether or not the program can be abandoned when an interruption event occurs.
また、さらに、前記複数の中断事由のうちの1つを特定する情報と、特定された当該中断事由の発生の有無を示す情報とを対応づけた中断情報を取得する取得手段を備え、前記レジスタ値群は、前記複数の中断事由のうちの1つを特定する情報と、特定された当該中断事由の有効又は無効を示す情報とを対応づけた設定情報を含み、前記プログラム実行手段は、前記中断情報と前記設定情報とを比較参照して、前記放棄を実施するか否かを判断するとしてもよい。 The register further includes acquisition means for acquiring interruption information in which information specifying one of the plurality of interruption reasons is associated with information indicating whether or not the specified interruption cause has occurred. The value group includes setting information in which information specifying one of the plurality of interruption reasons is associated with information indicating validity or invalidity of the specified interruption reason, and the program execution unit includes It may be determined whether the abandonment is performed by comparing and referring to the interruption information and the setting information.
これにより、前記複数の中断事由が複数あっても、有効な中断事由が特定される。
また、前記設定情報は、中断事由毎に固有のビット位置が定められ、各ビット位置に当該ビット位置に対応する中断事由の有効又は無効を示す値が示されたビット列データあり、前記中断情報は、中断事由毎に固有のビット位置が定められ、各ビット位置に当該ビット位置に対応する中断事由の発生の有無を示す値が示されたビット列データあり、前記プログラム実行手段は、前記設定情報において有効を示す値が存在するビット位置に対応する中断事由が示されている前記中断情報内のビット位置のみを参照して前記判断を実施するとしてもよい。
Thereby, even if there are a plurality of the above-mentioned interruption reasons, an effective interruption reason is specified.
The setting information includes bit string data in which a unique bit position is determined for each interruption reason, and each bit position indicates a value indicating whether the interruption cause corresponding to the bit position is valid or invalid. A unique bit position is defined for each interruption reason, and each bit position has bit string data indicating a value indicating the presence or absence of the interruption cause corresponding to the bit position, and the program execution means includes the setting information The determination may be performed with reference to only the bit position in the interruption information indicating the interruption reason corresponding to the bit position where the value indicating validity exists.
これにより、前記複数の中断事由が複数あっても、参照範囲が限定されるため、有効な中断事由が速やかに特定される。
また、前記プログラム実行手段は、前記放棄を実施するとき、その旨を前記復帰手段に通知し、前記復帰手段は、前記中断事由が解消するまで、前記放棄を行ったプログラムに対応するレジスタ値群を前記復帰の対象としないように、当該レジスタ値群の順序を無視して前記復帰を実施するとしてもよい。
As a result, even if there are a plurality of interruption reasons, the reference range is limited, so that an effective interruption reason can be quickly identified.
Further, when the program execution unit performs the abandonment, the program execution unit notifies the return unit to that effect, and the return unit stores a register value group corresponding to the program that has performed the abandonment until the reason for the interruption is resolved. The return may be performed by ignoring the order of the register value group so that the target is not the return target.
これにより、無駄なレジスタ値群の前記復帰が回避される。
また、前記復帰手段は、前記通知がなされたとき、前記無視を行おうとしている前記レジスタ値群を、例外的に、前記通知後において2回目に実施する復帰における最優先の復帰対象の候補とし、前記2回目の復帰開始までに前記中断事由が解消している場合は、当該レジスタ値群を前記復帰対象に決定し、前記中断事由が解消していない場合、以後中断事由が解消するまで当該レジスタ値群について前記無視を継続するとしてもよい。
Thereby, the return of the useless register value group is avoided.
Further, when the notification is made, the return means exceptionally sets the register value group that is going to be ignored as the highest priority return target candidate for the return to be executed for the second time after the notification. If the reason for the interruption has been resolved before the start of the second return, the register value group is determined as the return target, and if the reason for the interruption has not been resolved, The ignore may be continued for the register value group.
これにより、前記放棄がなされた時間に、他の有効なプログラムが実行され得る。
また、前記復帰手段は、前記無視がなされたレジスタ値群が複数あり、このうち2以上のレジスタ値群について、前記中断事由が解消した場合、これら2以上のレジスタ値群のいずれか1つについて、前記復帰の時期が到来した場合、これら2以上のレジスタ値群のうち、最後に無視されたレジスタ値群を当該時期における復帰対象とするとしてもよい。
Thus, another effective program can be executed at the time when the abandonment is made.
The return means has a plurality of neglected register value groups, and when two or more register value groups are out of the interruption reason, one of the two or more register value groups is ignored. When the return time comes, the register value group that was ignored lastly among the two or more register value groups may be set as the return target at the time.
これにより、中断事由が解消した後において、偏った時期に前記無視がなされたレジスタ値の復帰がなされることが回避される。
また、前記プログラム実行手段は、前記放棄を行うとき、その旨を前記選択先切り替え手段に通知し、前記選択先切り替え手段は、前記通知を受け取ったとき、前記切り替えを実施するとしてもよい。
As a result, after the reason for the interruption is resolved, it is possible to avoid the return of the register value that has been ignored at an unbalanced time.
The program execution unit may notify the selection destination switching unit when the abandonment is performed, and the selection destination switching unit may perform the switching when the notification is received.
これにより、前記放棄がなされた場合において、次のプログラムが速やかに実施され得る。
また、前記中断事由は、プログラムの実行に際して、キャッシュミスが発生したこととしてもよい。これにより、キャッシュミスが発生したとき、次のプログラムが速やかに実施される。
Thereby, when the abandonment is made, the next program can be executed promptly.
The reason for the interruption may be that a cache miss has occurred during execution of the program. Thereby, when a cache miss occurs, the next program is promptly executed.
また、前記中断事由は、プログラム実行の際、外部装置に処理を依頼し、当該外部装置からの処理結果を待つ状態となったこととしてもよい。これにより、前記状態となったとき、次のプログラムが速やかに実施される。
また、前記中断事由は、プログラム実行の際、共有資源を利用しようとして、当該共有資源が開放されるのを待つ状態となったこととしてもよい。
Further, the reason for the interruption may be a state in which processing is requested to an external device and a processing result from the external device is waited for when executing the program. Thereby, when it will be in the said state, the following program will be implemented rapidly.
In addition, the reason for the interruption may be a state in which a shared resource is used to wait for the shared resource to be released when the program is executed.
これにより、前記状態となったとき、次のプログラムが速やかに実施される。
また、前記プログラム実行手段は、プログラム実行用のCPUを有し、前記放棄がなされた実行期間中、当該CPUを停止するとしてもよい。これにより、無駄な電力消費が回避される。
また、前記プログラム実行手段は、プログラム実行用のCPUを有し、前記放棄がなされた実行期間中、当該CPUの駆動周波数を低減するとしてもよい。
Thereby, when it will be in the said state, the following program will be implemented rapidly.
The program execution means may include a CPU for executing a program and stop the CPU during the execution period when the abandonment is performed. Thereby, useless power consumption is avoided.
The program execution means may include a CPU for executing a program and reduce the drive frequency of the CPU during the abandoned execution period.
これにより、無駄な電力消費が低減される。
また、前記プログラム実行手段は、プログラム実行用のCPUを有し、前記複数のプログラムを実行する際、前記CPUの処理能力が、これらプログラムの実行負荷に対して高すぎることにより、処理の空き時間が発生しないように、プログラムの実行負荷に応じて、前記CPUの駆動周波数を調整するとしてもよい。
Thereby, useless power consumption is reduced.
Further, the program execution means has a CPU for program execution, and when executing the plurality of programs, the processing capacity of the CPU is too high for the execution load of these programs, so that the processing free time The CPU drive frequency may be adjusted according to the execution load of the program so as not to occur.
これにより、無駄な電力消費が低減される。
また、前記複数のレジスタ群は、2つであり、前記選択先切り替え手段は、前記2つのレジスタ群に対して、交互に前記切り替えを実施するとしてもよい。これにより、2つのレジスタ群のみにより、オーバーヘッドが解消しつつ、複数のプログラムが擬似的に並列実行される。
Thereby, useless power consumption is reduced.
The plurality of register groups may be two, and the selection destination switching unit may alternately perform the switching for the two register groups. As a result, only two register groups allow a plurality of programs to be executed in parallel in a pseudo manner while eliminating overhead.
即ち、擬似的に並列実行されるプログラムの数に関係なく、2つのレジスタ群で足りる。
また、前記プログラム実行手段は、N段のパイプライン処理を実行し、前記退避手段は、前記選択先切り替えが実施された時点より、(N−1)クロック以降に前記退避を実施するとしてもよい。
In other words, two register groups are sufficient regardless of the number of pseudo-parallel programs.
The program execution means may execute N stages of pipeline processing, and the save means may execute the save after (N-1) clocks from the time when the selection destination is switched. .
これにより、パイプライン処理を実行した場合においても、オーバーヘッドが解消しつつ、複数のプログラムが擬似的に並列実行される。
また、前記選択先切り替え手段は、前記複数のレジスタ群から所定の順序で前記選択先を決定し、前記切り替えを実施し、前記復帰手段は、前記複数のレジスタ群から所定の順序でレジスタ値群の復帰先を決定し、前記復帰を実施するとしてもよい。
Thereby, even when pipeline processing is executed, a plurality of programs are executed in parallel in a pseudo manner while eliminating overhead.
Further, the selection destination switching means determines the selection destination in a predetermined order from the plurality of register groups, performs the switching, and the return means stores register value groups in a predetermined order from the plurality of register groups. The return destination may be determined and the return may be performed.
これにより、前記復帰及び退避などのオーバーヘッドが解消されているため、速やかにプログラムが実行され、プログラムが高速に実行される。
また、前記復帰手段は、前記メモリ内に記憶されている前記レジスタ値群をコピーして前記復帰を実施し、前記プログラム実行手段は、プログラムの実行に伴って、実行対象レジスタ群にあるレジスタ値を変更する場合があり、前記退避手段は、前記プログラム実行手段による前記変更がなされた場合にのみ前記退避を実施するとしてもよい。
As a result, the overhead such as return and saving is eliminated, so the program is executed quickly and the program is executed at high speed.
The return means performs the return by copying the register value group stored in the memory, and the program execution means registers the register values in the execution target register group as the program is executed. The saving unit may execute the saving only when the change is made by the program execution unit.
これにより、変更されたレジスタ値のみを退避するので、退避時間が短縮される。
また、前記複数のレジスタ群の各レジスタは、それぞれのレジスタに復帰されているレジスタ値が変更されたか否かを示す変更情報が付されており、前記退避手段は、前記変更情報にもとづいて、変更がなされたレジスタ値のみを、これらレジスタ値が変更される前の値が記憶されている前記メモリ内の場所にそれぞれ書き込むことにより、前記退避を実施するとしてもよい。
As a result, only the changed register value is saved, so that the save time is shortened.
Further, each register of the plurality of register groups is attached with change information indicating whether or not the register value returned to the respective register has been changed, and the saving means is based on the change information, The saving may be performed by writing only the changed register values to the locations in the memory where the values before the register values are changed are stored.
これにより、変更の有無が容易に認識され、変更されたレジスタ値のみを退避するので、退避時間がより短縮される。
また、前記変更情報は、1ビットのフラグであるとしてもよい。
これにより、前記フラグにより前記変更が示される。
また、前記テーブル情報は、前記各カウント値に前記複数のレジスタ値群のいずれかを特定する特定情報が対応づけられており、前記復帰の対象は、前記特定情報により復帰するレジスタ値群を前記順番にもとづいて、前記順番で前記カウント値により前記選択の都度特定されたものであり、前記特定情報により復帰されたレジスタ値群を含むレジスタ群が実行対象レジスタ群として選択されてから他のレジスタ群が実行対象レジスタ群として選択されるまでの前記所定時間は、当該復帰に用いられた特定情報に対応づけられていたカウント値が示す時間であるとしてもよい。
As a result, whether or not there is a change is easily recognized, and only the changed register value is saved, so that the save time is further shortened.
The change information may be a 1-bit flag.
Thereby, the change is indicated by the flag.
Further, in the table information, specific information that specifies any one of the plurality of register value groups is associated with each count value, and the return target is a register value group that is returned by the specific information. Based on the order, the register value specified by the count value in the order is selected each time the selection is performed, and the register group including the register value group restored by the specifying information is selected as an execution target register group, and then another register is selected. The predetermined time until the group is selected as the execution target register group may be a time indicated by the count value associated with the specific information used for the return.
これにより、前記切り替えの間隔が自由に設定されるとともに、異なるカウント値のそれぞれに同−のレジスタ値群を特定する特定情報を対応づけることもできるため、同じプログラムであっても、違う実行時間に設定することができる。
また、前記所定時間は、前記複数のプログラム毎に固有であるとしてもよい。
これにより、各プログラムの実行に適したプログラム実行時間が割り当てられ得る。
Thus, the switching interval can be freely set, and specific information specifying the same register value group can be associated with each of the different count values. Can be set to
The predetermined time may be unique for each of the plurality of programs.
Thereby, program execution time suitable for execution of each program can be allocated.
また、さらに、プログラムの実行に必要な実行データを格納するための複数のキャッシュと、前記復帰手段による前記復帰に伴って、当該復帰がなされたレジスタ値群を参照して、当該レジスタ値群に対応するプログラムの実行データを特定する実行データ特定手段と、前記複数のキャッシュのうち、プログラムの実行に用いられていないいずれか1つのキャッシュに、特定された前記実行データを書き込むキャッシュ書き込み手段とを備えるとしてもよい。 Further, a plurality of caches for storing execution data necessary for program execution, and the register value group that has been restored in association with the restoration by the restoration means, are referred to as the register value group. Execution data specifying means for specifying execution data of a corresponding program; and cache writing means for writing the specified execution data into any one of the plurality of caches that are not used for program execution. It may be provided.
これにより、キャッシュミスの発生が回避される。
また、本発明に係るプロセッサは、複数のレジスタ値群を用いて、これらレジスタ値群それぞれに対応するプログラムを逐次実行するプロセッサであって、前記レジスタ値群のそれぞれを格納する複数のレジスタ群と、前記複数のレジスタ群のうちいずれか1つを、プログラム実行の基礎とする実行対象レジスタ群として選択し、当該選択先を所定時間毎に切り替える選択先切り替え手段と、前記切り替えがなされる毎に、前記実行対象レジスタ群にあるプログラムカウンタ値を含むレジスタ値群によりプログラムを特定し、前記特定したプログラムを実行するプログラム実行手段とを備え、前記所定時間は、複数のカウント値がそれぞれのプログラムに対応づけられて格納されたテーブル情報にもとづいて、前記カウント値により特定された時間であることを特徴とし、また、本発明に係るプログラム実行方法は、複数のレジスタ群を備え、複数のレジスタ値群を用いて、これらレジスタ値群それぞれに対応するプログラムを逐次実行するプロセッサにおいて、プログラムを実行するプログラム実行方法であって、前記複数のレジスタ群のうちいずれか1つを、プログラム実行の基礎とする実行対象レジスタ群として選択し、当該選択先を所定時間毎に切り替える選択先切り替えステップと、前記切り替えがなされる毎に、前記実行対象レジスタ群にあるプログラムカウンタ値を含むレジスタ値群によりプログラムを特定し、前記特定したプログラムを実行するプログラム実行ステップとを含み、前記所定時間は、複数のカウント値がそれぞれのプログラムに対応づけられて格納されたテーブル情報にもとづいて、前記カウント値により特定された時間であることを特徴とする。
Thereby, occurrence of a cache miss is avoided.
The processor according to the present invention is a processor that sequentially executes a program corresponding to each register value group using a plurality of register value groups, and a plurality of register groups storing each of the register value groups; Selecting any one of the plurality of register groups as an execution target register group that is a basis for program execution, and a selection destination switching unit that switches the selection destination at predetermined time intervals, and each time the switching is performed. A program execution means for specifying a program by a register value group including a program counter value in the execution target register group and executing the specified program, and a plurality of count values are assigned to each program for the predetermined time. Based on the table information stored in association with each other, it is specified by the count value. The program execution method according to the present invention includes a plurality of register groups, and uses a plurality of register value groups to sequentially execute a program corresponding to each of these register value groups. A program execution method for executing a program, wherein one of the plurality of register groups is selected as an execution target register group as a basis for program execution, and a selection destination for switching the selection destination every predetermined time A switching step; and a program execution step of specifying a program by a register value group including a program counter value in the execution target register group each time the switching is performed, and executing the specified program, the predetermined time Stores multiple count values associated with each program Based on the table information, characterized in that it is a time specified by the count value.
これにより、それぞれのプログラムの実行時間に影響を及ぼすことなく、速やかにプログラムが実行され得る環境となっており、複数のプログラムが所定時間毎に頻繁に切り替えられながら高速に実行されるので、擬似的なリアルタイム処理の並列実行に効果的である。 As a result, the program can be executed quickly without affecting the execution time of each program, and a plurality of programs are executed at high speed while being frequently switched every predetermined time. This is effective for parallel real-time processing.
<第1の実施形態>
(1.構成)
本発明の第1の実施形態について、図面を参照しながら詳細に説明する。図1は、本発明の第1の実施形態における仮想マルチプロセッサ100の機能ブロック図である。
仮想マルチプロセッサ100は、プレートの逐次切り替え実行を行うプロセッサである。ここで、プレートとは、従来のタスク又はOSのスケジューリング単位である1以上のタスクをまとめたものであり、プロセッサ側から見た実行対象をいう。1つのプレートは、1つの実行位置、即ち、プログラム中の命令位置を有する。
<First Embodiment>
(1. Configuration)
A first embodiment of the present invention will be described in detail with reference to the drawings. FIG. 1 is a functional block diagram of the
The
また、図1には、上述のプレート毎に用意されるプレートに対応するプログラムの実行位置を示すプログラムカウンタの値、上述のプログラム及びデータの格納位置を示すアドレスなどの制御情報、即ち、コンテキストが格納されているコンテキストメモリ200も合わせて示している。ここで、上述のプレートに対応するプログラムを実行することを、プレートの実行ということとする。
FIG. 1 also shows control information such as the value of the program counter indicating the execution position of the program corresponding to the plate prepared for each plate described above, the address indicating the storage location of the program and data, that is, the context. A stored
上述のコンテキストメモリ200は、SRAMにより構成され、複数のプレートの各コンテキストが格納されているコンテキスト格納領域201及び各プレートの実行順序を示す実行順序テーブル300が格納されている実行順序テーブル格納領域202を有する。この実行順序テーブル300は、1つのプレートに含まれる管理用アプリケーションプログラム(以下、「管理アプリケーション」という。)により生成されたプレートの実行スケジュールを定めたテーブルであり、コンテキスト格納領域201における複数のメモリアドレス(以下、「コンテキストアドレス」という。)の値の配列であり、これらコンテキストアドレスの値により示されるそれぞれの場所には、各プレートを実行するのに必要なコンテキストが存在する。
The above-described
なお、実行順序テーブル格納領域202において、各コンテキストアドレスの値が格納されている物理的位置を示すアドレスを以下、テーブルアドレスということとする。上述のテーブルアドレスは、数値で示されるものであって、この数値の大小関係は、このテーブルアドレスにより特定される位置に格納されたコンテキストアドレスの上記配列における順序に対応する。
In the execution order
つまり、スケジューリング1サイクルにおいては、テーブルアドレスの値が小さい順に、このテーブルアドレスの値により示される物理的位置に格納されたコンテキストアドレスの値により特定されるコンテキストアドレスと対応するプレートが実行されることとなる。このようにして、実行順序テーブル300に、プレートの実行順序が、A→B→C→A→D→Cと示されている場合、このような順序で1サイクル分の各プレートの実行が終了し、このサイクルが複数回繰り返されることとなる。 That is, in one scheduling cycle, plates corresponding to the context address specified by the context address value stored in the physical location indicated by the table address value are executed in ascending order of the table address value. It becomes. In this way, when the execution order table 300 indicates that the execution order of the plates is A → B → C → A → D → C, the execution of each plate for one cycle is completed in this order. This cycle is repeated a plurality of times.
各プレートの1回分の処理時間をいずれも同じ時間となっており、処理に時間がかかるプレートは、上述のプレートAのように、1サイクルにおける実行回数が多くなっている。
図34は、仮想マルチプロセッサ100と外部プロセッサ30との接続関係を示す図である。
The processing time for one time of each plate is the same time, and a plate that takes a long time for processing has a larger number of executions in one cycle like the plate A described above.
FIG. 34 is a diagram illustrating a connection relationship between the
上述の機能部の他に、仮想マルチプロセッサ100に関連し、以下の機能部がある。即ち、プログラム及びデータなどを格納し、DRAMからなる主メモリ10と、図示していないが、この主メモリ10と仮想マルチプロセッサ100との間に接続され、SRAMからなる上述のプログラム及びデータなどを格納するためのキャッシュメモリとが存在し、これらはバス700を介して仮想マルチプロセッサ100に接続されている。
In addition to the functional units described above, the following functional units are associated with the
また、仮想マルチプロセッサ100は、複数のプレートを擬似並行的に実行するものであるが、これら複数のプレートのうちの1つが、外部のプロセッサに処理を依頼する場合もあり、そのための外部プロセッサが、上記と同様にバスを介して仮想マルチプロセッサ100に接続されている。即ち、図34に示すように、外部プロセッサ30と主メモリ10はバス700によって接続されており、仮想マルチプロセッサ100と外部プロセッサ30は、主メモリ10を介して接続されている。
The
仮想マルチプロセッサ100は、上述のバス700を介して、主メモリ10に外部プロセッサ30が実行する処理の入力データをライトし、主メモリ10から外部プロセッサ30が実行した処理の結果であるデータをリードする。
また、外部プロセッサ30は、主メモリ10から処理の入力データをリードし、主メモリ10に処理結果であるデータをライトする。
The
The
外部プロセッサ処理要求信号線701及び外部プロセッサ処理完了信号線702は、上述のバス700とは独立して設けられ、それぞれ仮想マルチプロセッサ100と外部プロセッサ30と接続する。より具体的には、上記外部プロセッサ処理要求信号線701は、処理要求信号を仮想マルチプロセッサ100から外部プロセッサ30へと送信するための信号系統であり、また、外部プロセッサ処理完了信号線702は、処理完了信号を外部プロセッサ30から仮想マルチプロセッサ100へと送信するための信号系統である。
The external processor processing
これらそれぞれの信号の伝達により、仮想マルチプロセッサ100から外部プロセッサへの処理の依頼と、外部プロセッサから仮想マルチプロセッサ100への処理完了の通知とがなされる。仮想マルチプロセッサ100は、SIMD(Single Instruction / MultipleData)型のプロセッサであって、処理実行部110と、処理制御部111と、レジスタ切替部112と、切替入替制御部113と、第1レジスタ群114と、第2レジスタ群115と、サイクルカウンタ116と、外部I/F117と、DMA管理部118と、完了通知レジスタ119と、制御レジスタ120と、設定フラグレジスタ121とを有する。
By transmitting these signals, a request for processing from the
第1レジスタ群114及び第2レジスタ群115は、コンテキストの内容であるプログラムカウンタの値、プログラム及びデータの格納位置を示すアドレスなどのレジスタ値をそれぞれ格納するためのレジスタの集まりである。
また、各レジスタは、プレートが実行される際、このレジスタに格納されたプログラムカウンタなどの値が更新されたか否かを示す更新フラグの値を格納するための1ビットの記憶領域を有する。
The
Each register has a 1-bit storage area for storing a value of an update flag indicating whether a value of a program counter or the like stored in the register is updated when the plate is executed.
上述の値が更新された場合、更新フラグの値は1を示し、更新がなされていない場合、更新フラグの値は0を示す。なお、デフォルトの状態では、第1レジスタ群114及び第2レジスタ群115の各レジスタの更新フラグの値は0となっている。レジスタ切替部112は、切替入替制御部113からの指示にしたがい、第1レジスタ群114及び第2レジスタ群115のうちいずれか1つのレジスタ群をプログラム実行の際に使用するレジスタ群(以下、「カレントレジスタ群」)として選択する。
When the above-mentioned value is updated, the value of the update flag indicates 1, and when the update is not performed, the value of the update flag indicates 0. In the default state, the value of the update flag of each register of the
ここで、便宜的にカレントレジスタ群として選択されていない方のレジスタ群をスタンバイレジスタ群といい、上述の選択対象を現在選択がなされているレジスタからもう一方のレジスタに切り替えることを、レジスタ切り替えということとする。処理実行部110は、上述のレジスタ切り替え、つまり、カレントレジスタ群の選択がなされると、このカレントレジスタ群に格納されているコンテキストにもとづいて、実行するプログラム及びこのプログラムの実行に必要なデータの所在を特定し、DMA管理部118にこれらプログラム及びデータを取得するように指示する。
Here, for convenience, the register group that is not selected as the current register group is referred to as a standby register group, and switching the above-described selection target from the currently selected register to the other register is referred to as register switching. I will do it. When the above-described register switching, that is, selection of the current register group is made, the
これらプログラム及びデータの取得は、キャッシュメモリからの取得を前提としており、キャッシュメモリに目的とするデータが存在する場合(以下、「キャッシュヒット」という。)、または、例外的に後述する外部記憶装置からブログラム及びデータを取得した場合、処理実行部110は、これらプログラム及びデータを取得し、これらプログラム及びデータを用いて、処理制御部111からの指示にしたがいプレートを実行する。
The acquisition of these programs and data is premised on the acquisition from the cache memory, and when the target data exists in the cache memory (hereinafter referred to as “cache hit”), or as an exception, an external storage device described later When the program and data are acquired from the program, the
ただし、処理実行部110は、例外的にDMA管理部118に図示されない外部記憶装置からプログラム及びデータを取得するように指示する場合もある。この外部記憶装置は、同じく図示されない他の入出力装置などによってアクセス(例えばリード、ライト)することも可能であり.複数の装置からアクセスする場合と、1つの装置からアクセスする場合とではそのアクセスの時間が異なる(複数の装置からのアクセス時間の方が長くなる)。
However, the
一方、キャッシュメモリに目的とするデータが存在しない場合、即ち、キャッシュミスが生じた場合、または、外部記憶装置へのアクセスに時間がかかると判断された場合、処理実行部110は、その旨を処理制御部111に通知し、処理制御部111からの指示にしたがって以降の処理を実施する。このプレートの実行に伴い、処理実行部110は、コンテキストに格納されている値でプログラムカウンタなどの更新すべき値を更新し、値を更新したレジスタに含まれる更新フラグの値を1にする。
On the other hand, when the target data does not exist in the cache memory, that is, when a cache miss occurs or when it is determined that it takes time to access the external storage device, the
また、処理実行部110は、プレートの実行中に後述の待ち要因が発生した場合、プレートをスリープさせたことを示す通知を、処理制御部111を介して切替入替制御部113に出力すると共に、設定フラグレジスタ121内における発生した待ち要因の種別に対応する後述の設定フラグの値を1に変更する。
また、処理実行部110は、先の待ち要因の発生したとき、外部プロセッサ30に処理を依頼する。
In addition, when a waiting factor described later occurs during execution of the plate, the
Further, the
さらに、この待ち要因の解消となる事由が、外部プロセッサ30から処理結果を受け取ることである場合、処理実行部110は、外部プロセッサ30に処理を依頼してプレートをスリープさせたことを示す通知を、処理制御部111を介して切替入替制御部113に出力する。このとき、切替入替制御部113は、後述の外部I/F117に処理要求信号を出力する。
Further, when the reason for eliminating the waiting factor is to receive the processing result from the
なお、図1は、ある瞬間の状態を示す図であり、処理実行部110(プレートB実行)とあるのは、第1レジスタ群114にプレートBに対応するコンテキストが格納され、さらに、この第1レジスタ群114がカレントレジスタとして選択されている時点の状態を示すものである。仮想マルチプロセッサ100内部でのデータの入出力と、コンテキストメモリ200、主メモリ10、キャッシュメモリ及び外部プロセッサとにおけるデータの入出力は、DMA転送により実施され、DMA管理部118は、このDMA転送を制御する。
FIG. 1 is a diagram showing a state at a certain moment. The processing execution unit 110 (plate B execution) is that the context corresponding to the plate B is stored in the
また、DMA管理部118は、各機能部からの要求にもとづいてDMA転送を実施してその転送が完了したとき、その旨を示す信号(以下、「転送完了信号」という。)を切替入替制御部113に出力し、また、キャッシュメモリからプログラム及びデータを取得しようとして、キャッシュミスが生じた場合、キャッシュミスが生じたことを示す信号(以下、「キャッシュミス信号」という。)を切替入替制御部113に出力する。
Also, the
さらに、DMA管理部118は、図示されない外部記憶装置からプログラム及びデータを取得しようとして、外部記憶装置へのアクセスに時間がかかる(レイテンシが大きい)と判断されたとき、メモリレイテンシが大きいことを示す信号(以下、「メモリアクセス遅延信号」という)を切替入替制御部113に出力する。
外部I/F117は、外部プロセッサなどの外部機器に接続するインターフェースであり、例えば、外部プロセッサに依頼した処理が完了したことを示す、外部プロセッサ処理完了信号などの外部からの信号を切替入替制御部113に通知する。
Furthermore, the
The external I /
また、外部I/F117は、例えば、外部プロセッサ30に処理を依頼することを示す処理要求信号を外部プロセッサ30に通知する。
つまり、前述したように、外部I/F117は、切替入替制御部113から外部I/F117に処理要求信号が通知されたとき、処理要求信号を外部プロセッサ30に出力する。処理制御部111は、プレート実行の開始から終了まで、処理実行部110において、継続的にプレートを実行させるように制御する。
Also, the external I /
That is, as described above, the external I /
サイクルカウンタ116は、クロックカウンタを有し、切替入替制御部113及び処理制御部111を介し、処理実行部110において、管理アプリケーションが含まれるプレートが実行されたことにより決定された値を、このカウント値を初期値として登録する。
また、サイクルカウンタ116は、上述の初期値から1クロック毎に1づつディクリメントすることによりカウントダウンを行い、値が0となったとき、切替入替制御部113にその旨を示す信号(以下、「カウント値0信号」という。)を出力すると共に、再度初期値設定を行ってカウントダウンを開始するという処理を繰り返す。
The
Further, the
なお、上述のカウント値の初期値は、各プレート共通の値である。制御レジスタ120は、現在の実行中のプレート及び次に実行すべきプレートを特定する情報を格納するためのレジスタである。より具体的には、制御レジスタ120は、現在の実行中のプレートに対応するコンテキストアドレスの値が格納されている物理的位置のテーブルアドレス(以下、「カレントアドレス」という。)の値及び次に実行すべきプレートに対応するコンテキストアドレスが格納されている物理的位置のテーブルアドレス(以下、「ネクストアドレス」という。)の値を格納しており、さらに、実行順序テーブル格納領域202において、最も小さなテーブルアドレス(以下、「テーブル先頭アドレス」という。)の値と、最も大きなテーブルアドレス(以下、「テーブル終端アドレス」という。)の値とを格納している。
The initial value of the count value is a value common to each plate. The
ところで、タスクの実行時に使用する共有資源が、他の機器により利用されており、直ちに使用できないことによる待機の発生及びいわゆる割り込みの発生などをトリガとしてソフトウエアにより、非定常的に現在実行中のタスクを中断してタスクの実行スケジュールから除外し、このタスクに割り当てられた実行時間を他のタスクに明け渡し、また、タスク中断のトリガとなった要因が解消されたときに、このタスクの実行順序を再度スケジューリングして実行することは、公知技術である。 By the way, shared resources used at the time of task execution are used by other devices and are currently being executed non-steadily by software triggered by the occurrence of waiting and so-called interrupts due to the fact that they cannot be used immediately. Suspend the task and remove it from the task execution schedule, give the execution time assigned to this task to other tasks, and execute the task execution order when the factor that triggered the task suspension is resolved It is a well-known technique to execute the scheduling again.
本発明は、さらに、ハードウエアにより、プレート実行中断のトリガとなり得る所定の要因(以下、「待ち要因」という。)が発生したとき、レジスタ切り替え、即ち、プレートの切り替えを実施し、レジスタ切り替えがなされたプレートを実行順序から除外するスリープを実行し、また、この待ち要因が解消したとき、このプレートの実行を試みるウエイクアップを実施する。 Further, according to the present invention, when a predetermined factor (hereinafter referred to as a “waiting factor”) that can trigger a plate execution interruption occurs by hardware, register switching, that is, plate switching is performed. The sleep which excludes the made plate from the execution order is executed, and when this waiting factor is resolved, the wakeup which tries to execute this plate is executed.
このようなスリープ及びウエイクアップを実施する際、ウエイクアップのトリガとなる待ち要因を特定するために、プレート毎にどのような待ち要因でスリープが発生しているのかを知る必要がある。
また、外部からの割り込み要求などが到来した場合、外部からの要求に応えるべきか否かを事前に知る必要がある。
When performing such sleep and wakeup, it is necessary to know what wait factor causes the sleep for each plate in order to identify the wait factor that triggers the wakeup.
In addition, when an external interrupt request or the like arrives, it is necessary to know in advance whether or not to respond to the external request.
そのため、各プレートのコンテキストの中に、スリープの発生のトリガとなった待ち要因の種別、割り込み要求を受け付けるか否かなどをそれぞれ示す設定フラグの値を格納する領域を有する。このように待ち要因には複数の種別があり、これら種別毎に設定フラグ、つまり、設定フラグ群がある。
この設定フラグ群は、コンテキスト格納領域201に格納されている各コンテキスト内に含まれている。設定フラグレジスタ121は、2つのプレートに含まれている設定フラグ群それぞれを格納するためのレジスタである。プレートの実行に際し、実行されたプレート自らがプレートの実行の中断を要求し、又は、外部からプレートの実行を中断させる要求などが到来したことなどにより、待ち要因が発生したとき、現在実行中のプレートに対応するコンテキストの複数設定フラグのうち発生した待ち要因の種別に対応する設定フラグの値が処理実行部110により0から1に変更される。
For this reason, the context of each plate has an area for storing the value of a setting flag indicating the type of the waiting factor that triggered the occurrence of sleep, whether or not to accept an interrupt request, and the like. Thus, there are a plurality of types of waiting factors, and there is a setting flag, that is, a set flag group for each type.
This set flag group is included in each context stored in the
ここで、上述のプレートの実行を中断させる要求には、いわゆる割り込み要求を含んでおり、このような割り込みが発生した場合に実行中のプレートを必ずしも中断する必要はなく、割り込みを受け付けるか否かは、プレート毎に定められている。そのため、割り込みを許容するプレートにおいては、プログラム設計者により割り込み要求を受け付けるか否かを示す設定フラグの値に割り込み可能を示す値である1が格納されている。 Here, the above-described request for interrupting the execution of the plate includes a so-called interrupt request. When such an interrupt occurs, it is not always necessary to interrupt the plate being executed. Is determined for each plate. Therefore, in the plate that allows interruption, 1 is set as a value indicating that interruption is possible in the value of a setting flag that indicates whether or not an interruption request is accepted by the program designer.
完了通知レジスタ119は、上述の待ち要因が現在解消されているか否か、割り込み要求が発生したか否かなどをそれぞれ示すフラグ(以下、「完了通知フラグ」という。)を格納するためのレジスタである。この完了通知フラグは、1つのコンテキスト中に含まれる設定フラグの数と同数存在し、各完了通知フラグは、待ち要因の種別毎に存在する各設定フラグのそれぞれと1対1に対応している。
The
つまり、完了通知フラグの集まりを構成する完了通知フラグ群のビット列長は、設定フラグの集まりを構成する設定フラグ群のビット列長と同一であり、先頭からのビット位置が同じであれば同じ待ち要因についての値を格納している。切替入替制御部113は、サイクルカウンタ116からカウント値0信号を受け取ったとき、処理実行部110からプレートをスリープさせたことを示す通知を受け取ったとき、及び、DMA管理部118よりキャッシュミス信号を受け取ったとき、または、メモリアクセス遅延信号を受け取ったとき、後述のフラグ判定処理を実施して現状のネクストアドレスの値をそのままにしておくのか、それとも、他のテーブルアドレスの値を新たなネクストアドレスの値とするのかを判断してネクストアドレスの値の見直しを図りつつ、制御レジスタ120内に格納されているネクストアドレスの値を新たなカレントアドレスの値として格納し直すと共に、上述のネクストアドレスの値の次に大きなテーブルアドレスの値を新たなネクストアドレスの値として格納し、上述のレジスタ切り替えを実施するようにレジスタ切替部112に指示する。
In other words, the bit string length of the completion notification flag group that constitutes the collection of completion notification flags is the same as the bit string length of the setting flag group that constitutes the collection of setting flags, and if the bit position from the head is the same, the same wait factor Stores a value for. When the switching
さらに、切替入替制御部113は、このレジスタ切り替えが実施された結果、スタンバイレジスタ群となったレジスタ群の各レジスタの更新フラグを参照し、更新フラグの値が1となっているレジスタに格納されているレジスタ値をコンテキスト格納領域201のこのレジスタ値に対応する記憶領域、即ち、レジスタ群への格納時に変更される前のレジスタ値が読み出された場所に上書きすることにより退避するようにDMA管理部118に指示すると共に、後述のフラグ判定処理を実施する。
Further, as a result of this register switching, the switching
また、切替入替制御部113は、前記退避に伴って、当該退避されるコンテキストの設定フラグを、設定フラグレジスタ121から読み出して、コンテキスト格納領域201内のこの設定フラグに対応する記憶領域、即ち、設定フラグレジスタ121への格納時に設定フラグが読み出された場所に上書きすることにより設定フラグの値を退避する。
上述の退避及び後述のフラグ判定処理が完了すると、切替入替制御部113は、制御レジスタ120内のネクストアドレスの値により特定されるプレートのコンテキストをスタンバイレジスタ群の各レジスタに格納、即ち、復帰する。このとき、切替入替制御部113は、各レジスタの更新フラグの値を0にクリアする。
Further, the switching
When the above-described saving and flag determination processing described later are completed, the switching
切替入替制御部113は、上述の退避、フラグ判定処理及び復帰を、カレントレジスタ群に格納されたコンテキストを用いた処理実行部110によるプレートの実行と並行して実施する。なお、上述の退避、フラグ判定処理及び復帰に要する時間は、上述のプレートの実行時間よりも短くなるように、管理アプリケーションなどにより、上述のレジスタ切り替えのタイムスパンが定められている。
The switching
以下、切替入替制御部113におけるフラグ判定処理の詳細について説明する。切替入替制御部113は、コンテキスト格納領域201内に存在し、制御レジスタ120のネクストアドレスの値により特定されるコンテキストに含まれる設定フラグ群のビット列のうち、1の値が格納されているビット(以下、「有効ビット」という。)の位置を把握する。
Hereinafter, the details of the flag determination process in the switching
このような有効ビットの位置を把握する処理を有効ビット位置検索処理ということとする。このとき、設定フラグ群のビット列のうち、有効ビットが1つもない場合、切替入替制御部113は、ネクストアドレスの値をそのままにしてフラグ判定処理を終了する。
設定フラグ群のビット列のうち、有効ビットがある場合、切替入替制御部113は、完了通知レジスタ119内の完了通知フラグ群のビット列における上述の有効ビットの位置に対応する位置のみを参照し、この有効ビットの位置に対応する位置全てに1の値が格納されている場合は、ネクストアドレスの値をそのままにしてフラグ判定処理を終了する。
Such processing for grasping the position of the effective bit is referred to as effective bit position search processing. At this time, if there is no valid bit in the bit string of the set flag group, the switching /
When there is a valid bit in the bit string of the setting flag group, the switching
なお、有効ビットの位置に対応する位置とは、設定フラグ群のビット列の先頭位置から有効ビットまでのビット数と同じビット数分、完了通知フラグ群のビット列の先頭位置から離れた位置(以下、「有効ビット対応位置」という。)のことである。一方、完了通知フラグ群の有効ビット対応位置のいずれかに0の値が格納されている場合、切替入替制御部113は、実行順序テーブル格納領域202に示されている現時点におけるネクストアドレスの値につづき、次に大きな値のテーブルアドレスの値を暫定的に新たなネクストアドレスの値とする。
The position corresponding to the position of the valid bit is a position separated from the head position of the bit string of the completion notification flag group by the same number of bits as the number of bits from the head position of the bit string of the setting flag group to the valid bit (hereinafter, "Position corresponding to valid bit"). On the other hand, when a value of 0 is stored in any of the valid bit corresponding positions of the completion notification flag group, the switching /
そして、切替入替制御部113は、この暫定的なネクストアドレスの値により特定されるコンテキストに含まれている設定フラグについて、上述の有効ビット位置検索処理を実施した後、完了通知フラグ群の有効ビット対応位置の値に応じてネクストアドレスを見直す上述の処理を、フラグ判定処理が終了するまで繰り返し実施する。
なお、現状のネクストアドレスの値がテーブル終端アドレスの値である場合、ネクストアドレスの値につづき、次に大きな値のテーブルアドレスの値とは、テーブル先頭アドレスの値とする。
(2.データ)
以下、仮想マルチプロセッサ100において用いられるデータについて説明する。
Then, the switching
When the current next address value is the table end address value, the next largest table address value is the table top address value following the next address value.
(2. Data)
Hereinafter, data used in the
図2は、コンテキストメモリ200に格納されている実行順序テーブル300及びコンテキストのデータ構成を示す図である。実行順序テーブル300は、コンテキストが格納されているコンテキスト格納領域201内のコンテキストアドレスの値が複数示されており、これらコンテキストアドレスの値の物理的な格納位置、即ち、テーブルアドレスが各コンテキストアドレスにより特定されるプレートの実行順序を決定している。
FIG. 2 is a diagram showing an execution order table 300 stored in the
つまり、小さな値のテーブルアドレスが割り当てられている場所に格納されているコンテキストアドレスほどこのコンテキストアドレスに対応するプレートの実行順序が先順位となっている。上述のフラグ判定処理により、プレートの実行順序が飛ばされることがあるものの、基本的にはコンテキストアドレスの値の物理的格納位置、即ち、配列により示される順序に従ってプレートが実行され、テーブル最終アドレスがカレントアドレスとなっている場合における、カレントアドレスにより特定されるプレートが実行された後は、テーブル先頭アドレスをカレントアドレスとすることにより特定されるプレートが実行される。 That is, the execution order of the plate corresponding to the context address is higher in the context address stored in the place where the table address having a smaller value is assigned. Although the execution order of the plates may be skipped by the flag determination process described above, the plates are basically executed according to the physical storage position of the context address values, that is, the order indicated by the array, and the table final address is set. After the plate specified by the current address is executed in the case of the current address, the plate specified by using the table head address as the current address is executed.
つまり、コンテキストアドレスの物理的格納位置、即ち、テーブルアドレスは、1サイクルのプレートの実行順序を示す。図2において、テーブルアドレスは、2000から2005までの値を有しており、この場合、テーブル先頭アドレスの値は、2000となり、テーブル終端アドレスの値は、2005となる。
小さい値のテーブルアドレスに格納されているコンテキストアドレスのプレートほど実行順序が先となる。図3は、完了通知フラグ群及び設定フラグ群の各フラグについて説明する図である。完了通知フラグ群は、強制待ちフラグ、キューの空き通知フラグ、割り込み通知フラグ、ソフトウエアの待ち指示フラグ、外部プロセッサ処理完了通知フラグ、転送通知フラグなどを有する。
That is, the physical storage position of the context address, that is, the table address indicates the execution order of the plates in one cycle. In FIG. 2, the table address has a value from 2000 to 2005. In this case, the value of the table head address is 2000 and the value of the table end address is 2005.
The execution order of the plate of the context address stored in the smaller table address is first. FIG. 3 is a diagram illustrating each flag of the completion notification flag group and the setting flag group. The completion notification flag group includes a forced wait flag, a queue empty notification flag, an interrupt notification flag, a software wait instruction flag, an external processor processing completion notification flag, a transfer notification flag, and the like.
強制待ちフラグは、0の値が固定的に格納されているフラグである。キューの空き通知フラグは、プレートの実行中、容量的に空きが少ないキューに命令などをキュー登録しようとした場合など、キューを管理する外部機器からキューに空きがないことを示す通知が到来したか否かを示すフラグであり、キューに空きがないことを示す通知がなされた場合、0の値をとり、キューに空きがある状態では、1の値をとる。 The forced waiting flag is a flag in which a value of 0 is fixedly stored. Queue availability notification flag indicates that there is no vacancy in the queue from an external device that manages the queue, such as when trying to queue an instruction in a queue with less capacity while the plate is running It is a flag indicating whether or not there is a vacancy in the queue, takes a value of 0, and takes a value of 1 if the queue has a vacancy.
割り込み通知フラグは、外部機器から割り込み要求が到来したか否かを示すフラグであり、割り込み要求が到来していない場合、デフォルト値である1の値をとり、また、割り込み要求が到来した場合、切替入替制御部113により0の値にされる。ソフトウエアの待ち指示フラグは、アプリケ−ションソフトなどからプレートの実行を待たせる指示が到来したか否かを示すフラグであり、上述の指示が到来していない場合、デフォルト値である1の値をとり、上述の指示が到来した場合、切替入替制御部113により0の値にされる。
The interrupt notification flag is a flag indicating whether or not an interrupt request has arrived from an external device. When the interrupt request has not arrived, the interrupt notification flag takes a default value of 1, and when an interrupt request has arrived, The switching
外部プロセッサ処理完了通知フラグは、プレートの実行時に外部のプロセッサに処理を依頼した場合、依頼した処理が完了したことを示す通知が到来したか否かを示すフラグであり、すなわち、キャッシュミス信号あるいはメモリアクセス遅延信号を発生させる要因となったDMA転送や、プログラムによって要求されるDMA転送などの完了を示すフラグであり、この通知が到来していない場合、デフォルト値である0の値をとり、また、依頼した処理が完了したことを示す通知が到来した場合、切替入替制御部113により、1の値にされる。
The external processor processing completion notification flag is a flag indicating whether or not a notification indicating that the requested processing has been completed has been received when processing is requested to an external processor during execution of the plate, that is, a cache miss signal or This flag indicates completion of DMA transfer that has caused a memory access delay signal, DMA transfer requested by a program, etc. If this notification has not arrived, it takes a default value of 0, Further, when a notification indicating that the requested process has been completed has arrived, the switching
転送通知フラグは、DMA転送が完了したことを示す通知が到来したか否かを示すフラグであり、この通知が到来していない場合、デフォルト値である0の値をとり、また、DMA転送が完了したことを示す通知が到来した場合、切替入替制御部113により、1の値にされる。なお、これら上述のフラグそれぞれは、そのフラグをトリガとして、新たなプレートが実行された場合、そのプレートの実行によりそのフラグの値が、切替入替制御部113により上述のデフォルト値にリ復帰されることとなる。
The transfer notification flag is a flag indicating whether or not a notification indicating that the DMA transfer has been completed has arrived. When this notification has not arrived, the transfer notification flag takes a default value of 0, and the DMA transfer is not performed. When a notification indicating completion is received, the switching
設定フラグ群を構成する各フラグは、完了通知フラグ群の各フラグに対応するフラグであって、対応するフラグを無視するか否かを示す。コンテキスト中に含まれる設定フラグ群を構成する設定フラグの値が0の場合、対応する完了通知フラグの値に影響されることなく、このコンテキストにもとづいてプレートが実行される。
また、設定フラグの値に1がある場合、対応する完了通知フラグの値により、この設定フラグを含むコンテキストに対応するプレートを実行対象とするか否かが切替入替制御部113により判断される。なお、設定フラグの値に1が格納される例としては、以前この設定フラグを含むコンテキストに対応するプレートが実行されたとき、待ち要因が発生し、プレートの実行が中断されたなどが挙げられ、このようなプレートは、持ち要因が解消されるまで、スリープ状態となる。
Each flag constituting the setting flag group is a flag corresponding to each flag of the completion notification flag group, and indicates whether or not to ignore the corresponding flag. When the value of the setting flag constituting the setting flag group included in the context is 0, the plate is executed based on this context without being affected by the value of the corresponding completion notification flag.
When the value of the setting flag is 1, the switching
より具体的には、対応するものどうしの完了通知フラグの値及び設定フラグの値が1の場合、この設定フラグを含むコンテキストに対応するプレートが実行対象とされ、対応するものどうしの完了通知フラグの値が0で、設定フラグの値が1の場合、このコンテキストに対応するプレートが非実行対象とされ、即ち、プレートの実行順序から除外される。
つまり、対応する完了通知フラグの値及び設定フラグの値が1の場合、この設定フラグを含むコンテキストに対応するプレートが切替入替制御部113によりウエイクアップされ、対応する完了通知フラグの値が0で、設定フラグの値が1の場合、このプレートのスリープ状態となる。
More specifically, when the value of the completion notification flag and the setting flag of the corresponding items are 1, the plate corresponding to the context including the setting flag is set as the execution target, and the completion notification flag of the corresponding items is set. When the value of is 0 and the value of the setting flag is 1, the plate corresponding to this context is set as a non-execution target, that is, excluded from the execution order of the plates.
That is, when the value of the corresponding completion notification flag and the value of the setting flag are 1, the plate corresponding to the context including the setting flag is waked up by the switching
また、設定フラグの値が0の場合、この0の値が格納されている場所の対応する種別の待ち要因については切替入替制御部113より無視がなされ、この待ち要因に対応する完了通知フラグも参照されない。
図4は、タスクとプレートとの関係を示す図である。ソフトウエア側には、複数のタスクが存在し、そのうち、リアルタイムで処理するタスクは、OSを介さず直接、管理アプリケーションの管理下に置かれている。なお、実行順序テーブル300の内容を更新するための管理アプリケーションが、上述のリアルタイムで処理するタスクに含まれており、このタスク、即ち、プレートが実行されるとき、例えば、新たな処理を実行すべき状態となっていれば、処理実行部110により、実行順序テーブル300の内容が更新されることとなる。
If the value of the setting flag is 0, the switching
FIG. 4 is a diagram illustrating the relationship between tasks and plates. There are a plurality of tasks on the software side, and among these tasks, tasks to be processed in real time are directly under the management of the management application without going through the OS. Note that a management application for updating the contents of the execution order table 300 is included in the task to be processed in real time, and when this task, that is, a plate is executed, for example, a new process is executed. If it is in the power state, the
これにより、1サイクル分プレートが実行される毎に、少なくとも1回はタスクのスケジューリングを見直す機会が発生する。より具体的には、管理アプリケーションに対応するプレートが実行される毎に、前記条件の発生の有無を判断し、この条件が発生した場合に、新たな内容の実行順序テーブルであるダミーテーブルを実行順序テーブル格納領域202内に生成し、プレート実行の基礎とする実行順序テーブルを現状の実行順序テーブル300からダミーテーブルへと切り替えることにより更新する。
As a result, every time the plate for one cycle is executed, an opportunity to review the task scheduling at least once occurs. More specifically, each time a plate corresponding to the management application is executed, the presence / absence of the condition is determined, and when this condition occurs, a dummy table that is an execution order table of new contents is executed. The execution order table generated in the order
一方、リアルタイムで処理する必要のないタスクは、まず、OSの管理下に置かれ、さらに管理アプリケーションの管理下に置かれている。プレートは、ハードウエア側、即ち、処理実行部110における1実行単位であり、1つのタスクそのものである場合と、複数のタスクをまとめたものである場合とがあり、これらのプレートの割り振りは、プログラミングにより自由に決定可能である。
(3.動作)
以下、仮想マルチプロセッサ100において、1つのプロセッサにより擬似並行的にプレートを実行する際、効率的なプレートの実行を実現する処理について説明する。
On the other hand, tasks that do not need to be processed in real time are first placed under the management of the OS and further under the management of the management application. The plate is one execution unit in the hardware side, that is, the
(3. Operation)
Hereinafter, a process for realizing efficient plate execution when the
図5は、仮想マルチプロセッサ100において実施される処理を示すフローチャートである。切替入替制御部113は、コンテキストメモリ200内の実行順序テーブル300を参照し、制御レジスタ120内に、テーブル先頭アドレス、カレントアドレス、ネクストアドレス及びテーブル終端アドレスを登録する(ステップS500)。
第1レジスタ群114及び第2レジスタ群115内の全ての値をクリアする(ステップS501)。切替入替制御部113は、第1レジスタ群114及び第2レジスタ群115のうちカレントレジスタ群及スタンバイレジスタ群を選択する(ステップS502)。
FIG. 5 is a flowchart showing processing executed in the
All values in the
そして、切替入替制御部113は、カレントアドレスにより特定されるコンテキストをカレントレジスタ群に格納させる(ステップS503)。つづいて、切替入替制御部113は、処理制御部111を介して処理実行部110にプレート実行の指示を与え、その結果、処理実行部110は、カレントレジスタ群に格納されているコンテキストにもとづいて、プレートの実行を開始する(ステップS504)。
Then, the switching
サイクルカウンタ116は、プレート実行開始と共に、プレートの実行により設定される初期値からカウントダウンを開始する(ステップS505)。切替入替制御部113は、外部I/F117及びDMA管理部118からの信号入力を受付け、入力された信号に応じて完了通知レジスタ119の完了通知フラグの値を更新する(ステップS506)。
そして、切替入替制御部113は、フラグ判定処理を実施して、制御レジスタ120内のネクストアドレスの値を確定する(ステップS507)。つづいて、切替入替制御部113は、スタンバイレジスタ群を構成する各レジスタの更新フラグの値が1となっているコンテキスト部分のみをコンテキスト格納領域201に退避させ(ステップS508)、スタンバイレジスタ群に格納されている値を全てクリアする(ステップS509)。
The
Then, the switching /
さらに、切替入替制御部113は、制御レジスタ120内のネクストアドレスにより特定されるコンテキストをスタンバイレジスタ群に格納させる(ステップS510)。そして、切替入替制御部113は、制御レジスタ120内のネクストアドレスをカレントアドレスとして登録し直し、ネクストアドレスの次のアドレスを新たなネクストアドレスとして登録し直す(ステップS511)。
Further, the switching
切替入替制御部113は、サイクルカウンタ116よりカウント値0信号が入力された、即ち、プレート実行の終了が指示されたか又は処理実行部110より実行中のプレートをスリープさせたことを示す通知があったかどうか、さらに、その通知が外部プロセッサ30に処理を依頼してからプレートをスリープさせたことを示す通知であったかどうかを判断し(ステップS512)、これら信号の入力又は通知がなされた場合、処理実行部110にプレートの実行を終了させ、さらに、外部プロセッサ30に処理を依頼してからプレートをスリープさせた場合は、切替入替制御部113から外部I/F117に処理要求信号を通知させ、外部I/F117から外部プロセッサ30に処理要求信号を出力させ(ステップS513)、レジスタ切替部112にレジスタ切り替えを実施させ(ステップS514)、プレートの実行を開始するステップS504に戻る。
Whether the switching /
一方、これら信号の入力又は通知がなされない場合、現在のプレートの実行を継続し、終了又はスリープさせたことを示す通知があったかどうかを判断するステップS512に戻る。図6は、フラグ判定処理を示すフローチャートである。切替入替制御部113は、コンテキスト格納領域201内に存在し、制御レジスタ120のネクストアドレスにより特定されるコンテキストに含まれる設定フラグ群のビット列のうち、1の値が格納されている有効ビットの位置を把握する有効ビット位置検索処理を実施する(ステップS600)。
On the other hand, if these signals are not input or notified, the execution of the current plate is continued, and the process returns to step S512 for determining whether there is a notification indicating that the plate is ended or put to sleep. FIG. 6 is a flowchart showing the flag determination process. The switching /
そして、切替入替制御部113は、有効ビットが1つも存在しないかどうかを判断し(ステップS601)、有効ビットが1つも存在しない場合、制御レジスタ120におけるネクストアドレスの値をそのままにしてフラグ判定処理を終了する。一方、有効ビットが1以上存在する場合、切替入替制御部113は、完了通知レジスタ119内の完了通知フラグ群のビット列における上述の有効ビットの位置のみを参照し(ステップS602)、この有効ビット全てに1の値が格納されているか否かを判断する(ステップS603)。
Then, the switching /
完了通知フラグ群の有効ビット全てに1の値が格納されている場合、切替入替制御部113は、ネクストアドレスの値をそのままにしてフラグ判定処理を終了する(ステップS604)。一方、完了通知フラグ群のビット列における有効ビットのいずれかに0の値が格納されている場合、切替入替制御部113は、実行順序テーブル格納領域202内に示されている現時点におけるネクストアドレスの次のアドレスを暫定的に新たなネクストアドレスとし(ステップS604)、有効ビット位置検索処理を実施するステップS600に戻る。
When a value of 1 is stored in all the valid bits of the completion notification flag group, the switching
以上の処理を実施することにより、仮想マルチプロセッサ100は、プレートの終了から次のプレートの開始までの間に、コンテキストの退避、判断及び復帰に要する時間を介在させることなくプレートを実行することができる。図7は、このような状態を時系列的に説明する図である。コンテキストの退避、判断及び復帰は、プレートの実行と並行して実施されている。
By performing the above processing, the
このため、プレートの終了から次のプレートの開始までの間に、コンテキストの退避、判断及び復帰に要する時間が介在することが回避されている。以上のように、本実施形態によれば、1つの仮想マルチプロセッサ100において、擬似並行的に複数のプレートを実行しても、コンテキストの退避、判断及び復帰は、プレートの実行と並行して実施するため、プレートの実行時間にコンテキストの退避、判断及び復帰に要する時間が介在することがないので、効率的にタスクを実行することができる。
For this reason, it is avoided that the time required for context evacuation, determination and return is interposed between the end of the plate and the start of the next plate. As described above, according to the present embodiment, even if a plurality of plates are executed in a pseudo-parallel manner in one
なお、本実施の形態では、この実行順序テーブル300は、プレートの実行順序を示し、この実行順序テーブル300内におけるコンテキストアドレスの値の物理的格納位置、即ち、配列により基本的なプレートの実行順序が定められているが、この方法に限らず、例えば、実行順序テーブル300内にコンテキストアドレスの値とテーブルアドレスの値との組を格納し、このテーブルアドレスの値が次の実行順序に対応するコンテキストアドレスの物理的な格納位置を示すことにより、つまり、このテーブルアドレスの値をポインタとして用いることにより、プレートの実行順序を定めるとしてもよい。 In this embodiment, the execution order table 300 indicates the execution order of the plates, and the physical storage position of the value of the context address in the execution order table 300, that is, the basic execution order of the plates according to the arrangement. However, the present invention is not limited to this method. For example, a set of a context address value and a table address value is stored in the execution order table 300, and the table address value corresponds to the next execution order. The plate execution order may be determined by indicating the physical storage position of the context address, that is, by using the value of this table address as a pointer.
その場合、格納されているコンテキストアドレスの値の物理的な格納位置に実行順序が左右されず、また、このポインタを変更することにより、容易に実行順序の変更を行うことができる。図8は、このようなポインタを用いる場合の実行順序を示すテーブルのデータ構成を示す図であり、コンテキストの格納位置との対応関係を示すために、コンテキスト格納領域201におけるデータ構成も合わせて示している。
In this case, the execution order is not affected by the physical storage position of the stored context address value, and the execution order can be easily changed by changing this pointer. FIG. 8 is a diagram showing the data structure of a table indicating the execution order when such pointers are used, and also shows the data structure in the
この実行順序テーブルは、上述のコンテキストアドレスと次の実行順序を指し示すポインタとしてのテーブルアドレスとの組を格納している。
また、本実施の形態において、切替入替制御部113は、フラグ判定処理を、実行順序テーブル300により示される実行順序にもとづいて実施するものとしたことにより、スリープされたプレートがウエイクアップするタイミングは、実行順序テーブル300に規定されたそのプレートの実行順序が巡ってきたときとなるが、フラグ判定処理に際して、スリープしているプレートのコンテキスト内の設定フラグ群を優先的に参照して、フラグ判定処理を実施し、ウエイクアップの条件が揃えば、スリープしているプレートの実行順序を待たずに実行するとしてもよい。
This execution order table stores a set of the above-described context address and a table address as a pointer indicating the next execution order.
In the present embodiment, the switching
図9は、このような場合におけるプレート実行状況を時系列的に示す図である。t0において、プレートAは、外部プロセッサ30に処理を依頼し、外部のプロセッサ30から処理結果を受け取るまでスリープに入るいわゆる突き放しを実施している。
ここで、この突き放しについて説明する。まず、仮想マルチプロセッサは、主メモリ10に外部プロセッサ30が実施する処理の入力データをライトした後、処理要求信号を出力し外部プロセッサ30に処理を要求すると共に、プレートをスリープさせる。外部プロセッサ30は、主メモリ10から命令をフエッチし動作すると共に、主メモリから処理の入力データをリードして要求された処理を行い、その処理結果であるデータを主メモリにライトする。
FIG. 9 is a diagram showing the plate execution status in such a case in time series. At t0, the plate A requests the
Here, this protrusion will be described. First, the virtual multiprocessor writes input data of processing executed by the
その後、外部プロセッサ30は、処理完了信号を出力し、仮想マルチプロセッサ100に処理が完了した旨を通知する。処理の完了が通知されると、図5、図6において先述したフラグ判定処理などにより、仮想マルチプロセッサ100は、スリープしたプレートを再度実行し、主メモリ10から外部プロセッサ30が処理した結果であるデータをリードする。
Thereafter, the
このように、プレートを実行することにより、仮想マルチプロセッサ100は、外部のプロセッサに処理を依頼し、外部のプロセッサから処理結果を受け取るまでスリープする。以下、具体的に動作を説明する。まず、t0では、設定フラグ群における、外部プロセッサ処理完了通知フラグの値が1に変更される。
t2からt4までにおいて、プレートAについて優先的にフラグ判定処理を実施するが、完了通知レジスタ119内の有効ビット、即ち、外部プロセッサ処理完了通知フラグの値は0であるためウエイクアップされない。プレートDの実行期間中であるt5において、外部プロセッサ処理完了通知フラグの値が1となっているためウエイクアップされる。
As described above, by executing the plate, the
From t2 to t4, the flag determination process is preferentially performed for the plate A. However, the valid bit in the
このウエイクアップに伴って、切替入替制御部113は、ウエイクアップされたプレートのコンテキストをスタンバイレジスタ群に格納する。そして、t6において、切替入替制御部113は、レジスタ切替部112にレジスタ切り替えを実施させる。そして、処理実行部110は、カレントレジスタに格納されたプレートAに対応するコンテキストにもとづいて、プレートAを実行する。
With this wake-up, the switching
なお、この後、再度プレートAが実行されるのは、プレートAの正規の実行順序が巡ってきたときとなる。
また、図9においては、スリープしているプレートが1つの場合を示したが、複数のプレートがスリープしている場合も考えられ、このような場合、早くスリープされたプレートのコンテキストに対して優先的にフラグ判定処理を実施してもよく、逆に、遅くスリープされたプレートのコンテキストに対して優先的にフラグ判定処理を実施してもよい。
After that, the plate A is executed again when the regular execution order of the plate A comes around.
Further, FIG. 9 shows the case where there is one sleeping plate, but there may be a case where a plurality of plates are sleeping. In such a case, priority is given to the context of the plate that has been sleeping early. Alternatively, the flag determination process may be performed on the contrary, and conversely, the flag determination process may be performed preferentially on the context of the plate that has slept late.
図10は、遅くスリープされたプレートのコンテキストに対して優先的にフラグ判定処理を実施する例を時系列的に示す図である。プレートBにつづきプレートDがスリープ状態となっており、図中における5回目の判定において、プレートB及びプレートDが実行可能な状態と判定され、この時点においてスリープしている時間が最も短いプレートDが優先的にウエイクアップされ、これにつづいてプレートBがウエイクアップされている。 FIG. 10 is a diagram illustrating an example in which the flag determination process is preferentially performed on the context of a plate that has been slept late. The plate D following the plate B is in the sleep state, and in the fifth determination in the figure, it is determined that the plate B and the plate D are executable, and the plate D having the shortest sleep time at this time point is determined. Is preferentially waked up, and then plate B is waked up.
これは、先にスリープされたプレートの実行の順序は、後にスリープされたプレートよりも近づいてきているため、先にスリープされたプレートをウエイクアップして実行してしまうと、直ぐに、またこのプレートの実行順序が巡ってきてしまうため、この時点を捕らえれば、プレートの実行開始の間隔が極端に狭くなり、プレートの実行時間が均等化されない可能性があるためである。 This is because the execution order of the previously sleeping plate is closer to that of the later sleeping plate, so if you wake up and run the previously sleeping plate, it will immediately reappear. This is because if the time point is captured, the plate execution start interval becomes extremely narrow, and the plate execution time may not be equalized.
また、図9及び図10を用いて説明した上述のフラグ判定処理において、プレートのスリープ時間が決められた時間を超える場合、上述の優先を取り止めるとしてもよい。
また、本実施の形態では、完了通知フラグ群及び設定フラグ群は、強制待ちフラグ、キューの空き通知フラグ、割り込み通知フラグ、ソフトウエアの待ち指示フラグ、外部プロセッサ処理完了通知フラグ、転送通知フラグなどを有するとしたが、これ以外のフラグを設けてもよい。
Further, in the above-described flag determination processing described with reference to FIGS. 9 and 10, when the sleep time of the plate exceeds a predetermined time, the above-described priority may be canceled.
In this embodiment, the completion notification flag group and the setting flag group include a forced wait flag, a queue empty notification flag, an interrupt notification flag, a software wait instruction flag, an external processor processing completion notification flag, a transfer notification flag, and the like. However, other flags may be provided.
例えば、複数のプレートがスリープしている場合、種々の完了通知フラグがどのプレートに対応するものなのかが判らなくなる。そこで、プレートを識別するための番号が対応づけられているフラグを、完了通知フラグ群及び設定フラグ群に設け、スリープが生じたとき、処理実行部110から実行中のプレートを特定するためのユニークな番号を発生させ、この番号を設定フラグ群内に新たに設けたフラグに登録すると共に、この番号をスリープの発生のトリガとなった外部機器に対し通知する。
For example, when a plurality of plates are sleeping, it is impossible to determine which plate the various completion notification flags correspond to. Therefore, a flag associated with a number for identifying a plate is provided in the completion notification flag group and the setting flag group, and when the sleep occurs, the
待ち要因が解消されたとき、例えば、外部プロセッサなどの外部機器により、外部プロセッサ処理管理信号などと共に、上述の番号が合わせて通知されることにより、外部プロセッサ処理完了通知フラグが1とされるのに加え、この番号を示すフラグも1とされるので、どのプレートに対応するものかを判定することが可能となる。
また、本実施の形態では、待ち要因が発生した場合、実行中のプレートに割り当てられている実行時間を放棄して他のプレートに明け渡す例を示したが、これによらず、プレートの実行時間を他のプレートに明け渡さずに、上述の放棄がなされている時間分だけ、プロセッサの駆動周波数を下げ、電力消費を抑えるとしてもよい。
When the wait factor is resolved, for example, the external processor processing completion notification flag is set to 1 by notifying the external processor processing management signal and the like together with the above-mentioned number from an external device such as an external processor. In addition, since the flag indicating this number is set to 1, it is possible to determine which plate it corresponds to.
In this embodiment, when a wait factor occurs, an example in which the execution time assigned to the plate being executed is abandoned and transferred to another plate has been shown. Instead of surrendering to other plates, the processor drive frequency may be lowered and the power consumption may be reduced by the time for which the above-mentioned abandonment has been made.
その場合、プレートの実行に割り当てられた絶対時間が変らないようにするため、例えば、プロセッサの駆動周波数、即ち、クロック周波数を2分の1に低減した場合、サイクルカウンタ116は、1クロックあたり1づつディクリメントしていたものを、1クロックあたり2づつディクリメントすることとなる。本実施の形態では、退避、フラグ判定処理及び復帰に要する時間は、上述のプレートの実行時間よりも短くなるように、管理アプリケーションなどにより、上述のレジスタ切り替えのタイムスパンが定められているとしたが、これはこのタイムスパンの下限値を決定する制約条件である。
In that case, in order to prevent the absolute time allocated to the execution of the plate from changing, for example, when the drive frequency of the processor, that is, the clock frequency is reduced by a factor of two, the
一方、このタイムスパンの上限値を決める制約条件について、本実施の形態では、特筆していないが、このタイムスパンは、プレートを実行することができる限界の時間であり、各プレートの実質的な実行時間が、この限界の時間に対して極めて短い時間で処理を実施していた場合、各プレートの実行に際して、処理が行われていない無駄な時間が生じていることとなり、このような無駄を避けるために、管理アプリケーションは、プレートの実質的な実行時間と上述のタイムスパンがほぼ同様の時間で、かつ、上述のタイムスパンが各プレートの実質的な実行時間以上となるようにタイムスパンの上限値を決定してもよい。 On the other hand, the constraint condition for determining the upper limit value of the time span is not particularly mentioned in the present embodiment, but this time span is a limit time during which the plate can be executed. If the processing is performed in an extremely short time with respect to this limit time, there will be wasted time during which each plate is not being processed. To avoid this, the management application should ensure that the time span of the plate is such that the actual execution time of the plate is approximately the same as the time span described above, and that the time span described above is greater than or equal to the actual execution time of each plate. An upper limit value may be determined.
ところで、通信処理などのリアルタイムな処理では、プレートの実行により処理すべきデータの到来する周期がほぼ決まっている。つまり、1サイクルにおける各プレートの処理負荷が決まっており、上述のように決められた上限値及び下限値を有するタイムスパンを用いて、1サイクル分の各プレートが実行されたとしても、次のサイクルで処理すべきデータが到来していなかったのでは意味がない。 By the way, in real-time processing such as communication processing, the period of arrival of data to be processed by the execution of the plate is almost determined. That is, the processing load of each plate in one cycle is determined, and even if each plate for one cycle is executed using the time span having the upper limit value and the lower limit value determined as described above, It is meaningless if the data to be processed in the cycle has not arrived.
そこで、処理実行部110における処理能力が、1サイクルで処理すべきプレートの処理負荷に勝って処理時間に余裕が生じている場合、このような余裕が生じなくなる程度に、処理実行部110におけるプロセッサの駆動周波数、即ち、処理能力を低減し、各プレートの実質的な実行時間を大きくするようにしてもよい。
その場合、各プレートの実行に際して、処理が行われていない無駄な時間が削減され、かつ、プロセッサの駆動周波数を下げることにより消費電力も低減される。
Therefore, when the processing capacity of the
In that case, when each plate is executed, useless time during which processing is not performed is reduced, and power consumption is also reduced by lowering the drive frequency of the processor.
また、現在実行中のプレートの次に実行すべきプレート、即ち、スタンバイレジスタ群に格納されているコンテキストに対応するプレートの実行に必要なデータを事前にキャッシュに格納しておくとしてもよい。
その場合、スタンバイレジスタ群に格納されているコンテキストを事前に参照し、次のプレートの実行に必要なデータを把握し、このデータをキャッシュに格納する機能部が必要となる。
Further, a plate to be executed next to a plate currently being executed, that is, data necessary for execution of a plate corresponding to a context stored in the standby register group may be stored in a cache in advance.
In this case, a function unit is required that refers to the context stored in the standby register group in advance, grasps data necessary for execution of the next plate, and stores this data in the cache.
また、メインメモリの容量を物理的な容量よりも仮想的に大きくするために、「プログラムによって指定される論理アドレス」と「プロセッサが物理的にアクセスする物理アドレス」との対応関係(マッピング)を管理する「仮想メモリ機能部」を本実施の形態に付与してもよい。
なお、この仮想メモリ機能は公知技術である。この場合、キャッシュには、論理アドレスと物理アドレスとの対応関係(マッピング)を示す「アドレス変換テーブル」を格納する「アドレス変換テーブルキャッシュ」が含まれ、この「アドレス変換テーブルキャッシュ」に、次に実行すべきプレートに必要となるデータを示す論理アドレスを物理アドレスに変換できる「アドレス変換テーブル」を格納しておくとしてもよい。
Also, in order to make the main memory capacity virtually larger than the physical capacity, the correspondence (mapping) between the “logical address specified by the program” and the “physical address physically accessed by the processor” is set. A “virtual memory function unit” to be managed may be added to the present embodiment.
This virtual memory function is a known technique. In this case, the cache includes an “address conversion table cache” that stores an “address conversion table” indicating a correspondence relationship (mapping) between a logical address and a physical address. An “address conversion table” that can convert a logical address indicating data required for a plate to be executed into a physical address may be stored.
その場合、現在実行中のプレートの次に実行すべきプレート、即ち、スタンバイレジスタ群に格納されているコンテキストを事前に参照し、次のプレートの実行に必要なデータを把握し、さらに、そのデータの論理アドレスを物理アドレスに変換できるアドレス変換テーブルの値を把握して、それをアドレス変換テーブルキャッシュに格納する機能部が必要となる。 In that case, refer to the plate to be executed next to the currently executed plate, that is, the context stored in the standby register group in advance, and grasp the data necessary for the execution of the next plate. It is necessary to have a functional unit that grasps the value of the address conversion table that can convert the logical address to the physical address and stores it in the address conversion table cache.
また、サイクルカウンタ116におけるカウント値の初期値は、各プレート共通の値であるとしたが、プレート毎に異なっているとしてもよい。つまり、この初期値は、プレートの実行のために用意される時間を示し、プレートの処理の内容に応じてプレート固有の実行時間を割り当ててもよい。その場合、図11に示すように、実行順序テーブル格納領域202内にコンテキストアドレスに対応づけられてカウント値の初期値が格納される。
In addition, although the initial value of the count value in the
そして、切替入替制御部113は、制御レジスタ120内のカレントアドレスス及びネクストアドレスそれぞれに上述のカウント値の初期値を対応づけて格納する。
また、これに伴い、サイクルカウンタ116は、オーバーヘッドを解消しつつ随時異なる初期値にもとづいてカウントダウンを実施するために、2つ設けることが望ましい。
また、サイクルカウンタ116は、図12に示す機能部構成とすることもできる。この図において、サイクルカウンタ116は、入出力部301と、第1メモリ302と、第2メモリ303と、カウントダウン部304とを有する。入出力部301は、切替入替制御部113からカウント値の初期値を受信し、受信した上述の初期値を交互に第1メモリ301及び第2メモリ303に格納する機能を有する。
Then, the switching /
Accordingly, it is desirable to provide two cycle counters 116 in order to count down based on different initial values as needed while eliminating overhead.
Further, the
また、入出力部301は、カウントダウン部304からの信号を受け取ったとき、切替入替制御部113にカウント値0信号を出力する。第1メモリ302及び第2メモリ303は、FIFOメモリである。カウントダウン部304は、第1メモリ302及び第2メモリ303から交互に初期値を読み出してその初期値にもとづきカウントダウンを実施する。
Further, when the input /
以上のような構成により、プレートの処理の内容に応じてプレート固有の実行時間を割り当てることができる。
また、処理実行部110は、N段のパイプライン処理によりプレートを実行するとしてもよい。図13は、4段のパイプライン処理を実施する例を示す。
この場合、1段目で、プレートAの処理の実行が終了しても、2段目から4段目までは、まだプレートAが実行中の状態である。つまり、この状態は、カレントレジスタ群のレジスタ値が必要であるため、プレートAのレジスタ値の退避はできない。1段目のプレートAの処理の実行が終了してから3クロック経過したとき、4段目のプレートAの実行が終了するので、ここでプレートAのレジスタ値が退避可能となる。
With the configuration as described above, an execution time unique to the plate can be assigned according to the content of the plate processing.
Further, the
In this case, even if execution of the processing of the plate A is completed at the first stage, the plate A is still being executed from the second stage to the fourth stage. That is, in this state, the register value of the plate A cannot be saved because the register value of the current register group is necessary. When three clocks have elapsed since the execution of the processing of the first-stage plate A has been completed, the execution of the fourth-stage plate A is completed, so that the register value of the plate A can be saved here.
よって、例えば、N段のパイプライン処理によりプレートが実行される場合は、1段目のプレートの実行が終了してから少なくとも(N−1)クロック後でなければ、レジスタ値、即ち、コンテキストを退避できないこととなる。
また、本実施の形態では、一旦プレートがスリープすると、ウエイクアップする機会は、実行順序テーブル300に示された、次の実行順序のみであったが、待ち要因が発生してスリープしても、この待ち要因が瞬時に解消される場合もあるため、これを考慮し、スリープとなった直後から1回分のプレート実行までの間については、スリープしたプレートの実行順序を最先の順序とし、このスリープしたプレートを優先的に実行させてもよい。 図14は、このようなプレート実行がなされた場合における、プレート実行状況を説明する図である。
Therefore, for example, when the plate is executed by N-stage pipeline processing, the register value, that is, the context is set unless at least (N−1) clocks after the execution of the first-stage plate is completed. It cannot be evacuated.
Further, in the present embodiment, once the plate sleeps, the opportunity to wake up is only the next execution order shown in the execution order table 300. In some cases, this waiting factor may be resolved instantaneously. Considering this, the sleep plate execution order is the earliest order from immediately after going to sleep until the first plate execution. A sleep plate may be preferentially executed. FIG. 14 is a diagram for explaining the state of plate execution when such plate execution is performed.
この図において、プレートCがスリープした直後にスリープの原因となった待ち要因が解消されており、プレートDの実行中は、プレートCの実行順序を最先の順位にしているので、プレートDが実行された後にプレートCが実行されている。ただし、この場合、待ち要因の解消タイミングが、プレートDの実行終了間際であった場合、本実施の形態においては、スタンバイレジスタの数は、1つのみであるため、本来プレートDの後に実施されるはずであるプレートAの復帰の時間のマージンを見込まなければならない。 In this figure, the waiting factor that caused the sleep immediately after the plate C sleeps has been eliminated, and the execution order of the plate C is the earliest during the execution of the plate D. After execution, plate C is executed. However, in this case, when the timing for eliminating the waiting factor is just before the end of the execution of the plate D, in this embodiment, since the number of standby registers is only one, it is originally executed after the plate D. The margin for the return time of plate A, which should be expected, must be taken into account.
そのため、スリープしたプレートの実行順序を最優先とする時間(以下、「優先期間」という。)は、この図の場合、プレートDの実行時間よりも短くなっている。このような不都合を解消すべく、レジスタ群を少なくとも3つ設け、このうちの1つをカレントレジスタ群、また、残りの2つをスタンバイレジスタ群とすることにより、図14におけるプレートCのコンテキストと、プレートAのコンテキストとを同時に、2つのスタンバイレジスタ群に格納することにより、上述の優先期間は、プレートDの実行終了間際まで長くなる。 Therefore, the time in which the execution order of the sleeping plates is given the highest priority (hereinafter referred to as “priority period”) is shorter than the execution time of the plate D in this figure. In order to eliminate such an inconvenience, at least three register groups are provided, one of which is a current register group and the other two are standby register groups. By storing the context of the plate A in the two standby register groups at the same time, the above-described priority period becomes longer until the end of the execution of the plate D.
また、第1の実施形態では、プレートの数は、レジスタ群の数を上回っていることを前提として説明していたが、これに限らず、プレートの数がレジスタ群の数以下であってもよい。その場合、コンテキストメモリ内のコンテキスト格納領域を備えなくても良く、退避、復帰のステップが不要となる。
具体的には、図5におけるS508(退避)、S509(スタンバイレジスタ群のクリア)が不要となり、S510とS514の処理が変更される。つまり、第1の実施形態では、S510(スタンバイレジスタ群への格納)は、S507のフラグ判定処理で決定される制御レジスタ120内のネクストアドレスにより特定されるコンテキストをスタンバイレジスタ群に格納させる処理であったが、コンテキスト格納領域が無い場合は、S510を「S507で判断されるネクストアドレスにより特定されるコンテキストにあらかじめ対応づけられているレジスタ群」を「次のカレントレジスタ群」として切替入替制御部113に選択し記憶させる処理とすればよい。
In the first embodiment, the description has been made on the assumption that the number of plates exceeds the number of register groups. However, the present invention is not limited to this, and the number of plates may be equal to or less than the number of register groups. Good. In this case, it is not necessary to provide a context storage area in the context memory, and the saving and restoring steps are not necessary.
Specifically, S508 (save) and S509 (clear standby register group) in FIG. 5 are not necessary, and the processing of S510 and S514 is changed. In other words, in the first embodiment, S510 (storage in the standby register group) is a process of storing in the standby register group the context specified by the next address in the control register 120 determined in the flag determination process in S507. If there is no context storage area, the switch replacement control unit sets S510 as "the next current register group" as "the register group previously associated with the context specified by the next address determined in S507" The process may be selected and stored in 113.
そして、S514で、切替入替制御部113が先ほど「次のカレントレジスタ群」として選択したレジスタ群がカレントレジスタ群になるように、レジスタ切替部112はレジスタ切り替えを実施すればよい。この場合、切替入替制御部113は、上記のネクストアドレスにより特定されるコンテキストに対応付けられているレジスタ群がどれであるかを把握して記憶する機能を、レジスタ切巻部112は、切替入替制御部113が記憶したレジスタ群にカレントレジスタ群を切り替える機能を、それぞれ有することとなる。
In step S514, the
ここで、プレート及びレジスタ群の数が2つの場合、より具体的には、プレートAは第1レジスタ群、プレートBは第2レジスタ群に対応付けられているとする。例えば、切替入替制御部113は、プレートAを実行するときは、コンテキストメモリからレジスタ値群を復帰する動作なしで、第1レジスタ群をカレントレジスタ群として選択する。
また、レジスタ群及びプレート(プレートA、B、Cがあり、プレートCは第3レジスタ群に対応付けられているものとする。)の数が3つの場合であっても、カレントレジスタ群として選択されているのが実行対象レジスタ群であって、それ以外がスタンバイレジスタ群となる。プレートCを実行する際、第3レジスタ群をカレントレジスタ群として選択される。
Here, when the number of plates and register groups is two, more specifically, it is assumed that plate A is associated with the first register group and plate B is associated with the second register group. For example, when executing the plate A, the switching
Even if the number of register groups and plates (there are plates A, B, and C, and plate C is associated with the third register group) is three, it is selected as the current register group. What is executed is a register group to be executed, and the others are standby register groups. When executing the plate C, the third register group is selected as the current register group.
選択先を切り替えた後も、コンテキストメモリにレジスタ値群を退避する動作は不要である。コンテキスト格納領域を備えない上記の構成でも、複数のプログラムが所定時間毎に頻繁に切り替えられながら高速に実行されるので、擬似的なリアルタイム処理の並列実行に効果的である。
また、本第1の実施形態では、コンテキストメモリ200は、SRAMにより構成されるとしたが、DRAMであってもよく、さらに、これらメモリに限らず、高速にアクセスされるレジスタや低速にアクセスされる外部記憶装置であってもよい。
Even after the selection destination is switched, the operation of saving the register value group in the context memory is unnecessary. Even in the above configuration that does not include a context storage area, a plurality of programs are executed at high speed while being frequently switched every predetermined time, which is effective for parallel execution of pseudo real-time processing.
In the first embodiment, the
また、本第1の実施形態では、管理アプリケーションが1つのプレートに含まれているとしたが、複数のプレートに含まれているとしてもよい。
<第2の実施形態>
(1.構成)
第2の実施形態について、図面を参照しながら詳細に説明する。
In the first embodiment, the management application is included in one plate. However, the management application may be included in a plurality of plates.
<Second Embodiment>
(1. Configuration)
The second embodiment will be described in detail with reference to the drawings.
図15は、第2の実施形態における仮想マルチプロセッサ400の機能ブロック図である。仮想マルチプロセッサ400は、第1の実施形態における仮想マルチプロセッサ100と同様に、複数のプログラムを擬似並行的に実行するプロセッサである。
この仮想マルチプロセッサ400は、複数のタイムスロットそれぞれに割り当てられたプログラムを逐次実行することにより、複数のプログラムを擬似並行的に実行する。ここで、タイムスロットとは、プログラムを時分割して実行する場合における、最小のプログラム実行時間枠のことである。
FIG. 15 is a functional block diagram of the
The
第1の実施形態における仮想マルチプロセッサ100では、プレートそのもの、即ち、プログラムの実行順序が規定されているが、第2の実施形態の仮想マルチプロセッサ400では、まず、タイムスロットの順序が規定され、さらに、タイムスロット毎に実行されるプログラムの候補が用意されている点で第1の実施形態とは異なる。
より具体的には、各タイムスロットには、自タイムスロットへの割り当て候補となる4つ又は1つのプログラムが対応づけられおり、通常、これらのプログラムのうちいずれか1つが前記割り当ての対象となる。原則的には、規定されたタイムスロットの順序にもとづいて各タイムスロットに割り当てられているプログラムが逐次実行される。
In the
More specifically, each time slot is associated with four or one program that is a candidate for allocation to the own time slot, and usually one of these programs is the target of the allocation. . In principle, the program assigned to each time slot is sequentially executed based on the prescribed time slot order.
また、仮想マルチプロセッサ400は、前記割り当ての対象となるプログラムが実行不可能な状態となった場合における処理の内容が、第1の実施形態における仮想マルチプロセッサ100とは異なる。なお、プロセッサ側からみた実行対象となるプログラムのことを、便宜上、ロジカルプロセッサ(以下、「LP」という。)という。
図15には、プログラムの実行位置を示すプログラムカウンタの値、プログラム及びデータの格納位置を示すアドレスなどの制御情報、即ち、コンテキストが格納されているコンテキストメモリ500も合わせて示している。このコンテキストメモリ500は、SRAMにより構成され、各プログラムに対応するコンテキストが格納されているコンテキスト格納領域501を有する。
The
FIG. 15 also shows control information such as the value of the program counter indicating the execution position of the program and the address indicating the storage position of the program and data, that is, the
コンテキスト格納領域501は、コンテキストメモリ500内の決められた記憶領域にあって、各プログラムに対応するコンテキストの値が格納されている。さらに、図15には、基準信号を生成する発振器600と、この基準信号にもとづいて仮想マルチプロセッサ400に供給するクロックパルスを生成するPLL601とが示されている。
また、これらの機能部の他に、仮想マルチプロセッサ400に関連し、図示していない以下の機能部がある。即ち、プログラム及びデータなどを格納し、DRAMからなる主メモリと、SRAMからなる上述のプログラム及びデータなどを格納するためのキャッシュメモリとが、バスを介して仮想マルチプロセッサ400に接続されている。
The
In addition to these functional units, the following functional units not shown are related to the
仮想マルチプロセッサ400は、時間割付情報格納レジスタ402と、処理実行部410と、処理制御部411と、レジスタ切替部412と、スケジューリング制御部413と、第1レジスタ群414と、第2レジスタ群415と、サイクルカウンタ416と、外部I/F417と、DMA管理部418と、リクエスト検出部419と、制御レジスタ420と、設定フラグレジスタ421と、LP状態格納レジスタ424と、プロセッサ状態格納部425と、クロックマスク部427とを有する。
The
時間割付情報格納レジスタ402は、タイムスロット及びプログラムに関する情報が格納されている。より具体的には、この情報は、タイムスロットのプログラム実行時間枠と実行順序などを規定する1)タイムスロット情報と、各タイムスロットにおいて実行されるプログラムの候補を特定するための2)LP情報と、プログラムの候補の範囲を限定するための3)優先度&モード情報と、実行可能なプログラムの候補がタイムスロットに存在しない場合における処理の内容を決定するための4)アイドルオプション情報と、実行中のプログラムが中断した場合における処理の内容を決定するための5)タイムオプション情報とからなる。
The time allocation
タイムスロット毎に、これら5種類の情報が存在し、タイムスロット単位で互いに関連付けられている。第1レジスタ群414及び第2レジスタ群415は、コンテキストの内容であるプログラムカウンタの値、プログラム及びデータの格納位置を示すアドレスなどのレジスタ値をそれぞれ格納するためのレジスタの集まりである。
レジスタ切替部412は、スケジューリング制御部413からの指示にしたがい、第1レジスタ群414及び第2レジスタ群415のうちいずれか1つのレジスタ群をプログラム実行の際に使用するレジスタ群、即ち、カレントレジスタ群として選択する。第1の実施形態と同様に、この選択先の切り替えを、レジスタ切り替えといい、カレントレジスタ群として選択されていない方のレジスタ群をスタンバイレジスタ群ということとする。
These five types of information exist for each time slot, and are associated with each other in units of time slots. The
In accordance with an instruction from the
ちなみに、このレジスタ切り替えのことを、コンテキストスイッチングと呼ぶ場合もある。 処理実行部410は、プログラム実行するためのCPUなどを有し、上述のレジスタ切り替え、つまり、カレントレジスタ群の選択がなされると、このカレントレジスタ群に格納されているコンテキストにもとづいて、実行するプログラム及びこのプログラムの実行に必要なデータの所在を特定し、DMA管理部418にこれらプログラム及びこのプログラムの実行に必要なデータを取得するように指示する。
Incidentally, this register switching is sometimes called context switching. The
そして、処理実行部410は、プログラムの実行に必要なデータが取得されたとき、処理制御部411からの指示にしたがいプログラムの実行を開始する。
また、処理実行部410は、プログラムの実行中に、処理が続行できない状況となった場合、プログラムの実行を中断する旨を示すウエイトコードを処理制御部411に出力する。
Then, when data necessary for executing the program is acquired, the
In addition, the
なお、上述のCPUは、クロックマスク部427を介しPLL601から出力されるクロックパルスに同期して駆動しており、このクロックパルスが途絶えた場合、プログラム実行も停止する。LP状態格納レジスタ424は、各プログラムの状態及び属性などを示すプログラム状態情報と各タイムスロットの設定内容が示されたタイムスロット設定情報を格納するためのレジスタである。
The CPU described above is driven in synchronization with the clock pulse output from the
より具体的には、このタイムスロット設定情報は、タイムスロットを特定するためのID(以下。「TS_ID」という。)と、このタイムスロットの属性を示すコードとからなる。ここで、タイムスロットの属性のコードとして、そのタイムスロットが、定常的に実行されることを原則とするプログラムの実行用として用意されたタイムドリブン型タイムスロットである場合には「TD」が、また、イベントが発生した場合にのみに実行するような非定常的なプログラム実行のために用意されたイベントドリブン型タイムスロットである場合には「ED」が示されている。 More specifically, the time slot setting information includes an ID (hereinafter referred to as “TS_ID”) for specifying the time slot and a code indicating the attribute of the time slot. Here, as a time slot attribute code, when the time slot is a time-driven type time slot prepared for executing a program based on the principle that it is executed on a regular basis, “TD” Further, “ED” is shown in the case of an event-driven time slot prepared for non-stationary program execution that is executed only when an event occurs.
つまり、タイムドリブン型タイムスロットは、イベントが発生しなくても、実行対象となり得るが、イベントドリブン型タイムスロットは、イベントが発生したときでなくては、実行対象とはなり得えない。 上述のプログラム状態情報には、プログラムを特定するIDの値と、プログラムの状態を特定するコードと、このプログラムの属性を示すコードと、プログラムを起床又は回復させるタイミング(以下、「起床タイミング」という。)を示すコードとが示されている。 In other words, a time-driven time slot can be an execution target even if no event occurs, but an event-driven time slot cannot be an execution target unless an event occurs. The above-mentioned program status information includes an ID value that identifies a program, a code that identifies the program status, a code that indicates the attribute of the program, and a timing at which the program wakes up or recovers (hereinafter referred to as “wakeup timing”). .) Is shown.
プログラムの状態を特定するコードとしては、waiting、ready、running、suspended-waiting、suspended-ready、non-existentの6つがある。このうち、ready及びrunningは、現在、プログラムが実行できる状況であり、特に、runningは、現在プログラム実行中であることを示す。
また、waiting及びsuspended-waitingは、現在、プログラムが実行できない状態にあることを示す。
There are six codes that specify the state of the program: waiting, ready, running, suspended-waiting, suspended-ready, and non-existent. Among these, “ready” and “running” indicate that the program can be executed at present. In particular, “running” indicates that the program is currently being executed.
“Waiting” and “suspended-waiting” indicate that the program cannot be executed at present.
non-existentは、現在、プログラムを実行する必要がない状態にあることを示す。つまり、これらwaiting、suspended-waiting及びnon-existentの状態であるプログラムは、プログラム実行のスケジューリングの対象範囲外となる。
また、プログラム実行中にプログラム実行ができない状態となり、これらコードがsuspended-waitingへと遷移した場合、その時点において割り当てられていたタイムスロットのTS_IDの値がこれらコードに付されることとなる。
Non-existent indicates that the program is not currently required to be executed. That is, the programs in the waiting, suspended-waiting, and non-existent states are outside the target range for program execution scheduling.
Further, when the program cannot be executed during the program execution and these codes transit to suspended-waiting, the TS_ID value of the time slot assigned at that time is attached to these codes.
なお、これらのコードは、プログラム実行が可能となった時点で、それぞれsuspended-readyへと遷移するが、プログラムの実行がなされるまで上述のTS_IDの値が付されたままとなる。プログラムの属性を示すコードとしては、そのプログラムが、定常的に実行されることを原則とするプログラムである場合には「TD」が、また、イベントが発生した場合にのみに実行されるプログラムである場合には「ED」が示されている。 These codes transition to suspended-ready when the program can be executed, but remain with the above-described TS_ID value until the program is executed. As a code indicating the attribute of the program, “TD” is used when the program is a program whose principle is to be executed on a regular basis, and the program is executed only when an event occurs. In some cases, “ED” is indicated.
起床タイミングを示すコードとしては、プログラムの実行要求が発生したときにスタンバイレジスタ群となっているレジスタ群が開放された後、コンテキストを格納して実行するプログラム、つまり、処理時間の制約が少ないプログラムの場合には、「n」が示され、また、既にスタンバイレジスタ群内に格納したコンテキストを入れ替えてまで早急に実行を必要とするプログラムの場合、「e」のコードが示されている。 As a code indicating the wake-up timing, a program that stores and executes a context after a register group that is a standby register group is released when a program execution request is generated, that is, a program with less processing time restrictions In the case of “n”, “n” is indicated, and in the case of a program that needs to be executed immediately until the context already stored in the standby register group is replaced, the code “e” is indicated.
制御レジスタ420は、現在実行対象となっているタイムスロット及び次の実行対象とすべきタイムスロットを特定する情報を格納するためのレジスタである。より具体的には、制御レジスタ420は、現在実行対象となっているタイムスロットに対応するタイムスロット情報が格納されている場所を示すカレントアドレスの値と、次の実行対象とすべきタイムスロットに対応するタイムスロット情報が格納されている場所を示すネクストアドレスの値を格納している。
The
仮想マルチプロセッサ400においては、16個タイムスロットが設定されており、これに伴い、タイムスロット情報の数も16存在する。上記16個のタイムスロットのうち、プログラムの実行に通常用いられるタイムスロットは、4つのみである。なお、この4つのタイムスロットに対応するタイムスロット情報のアドレスの値が、連続した値をとるように、タイムスロット情報が時間割付情報格納レジスタ402に格納されている。
In the
制御レジスタ420は、上述の連続したアドレス値における、その値が最も小さい先頭アドレスの値及びその値が最も大きい終端アドレスの値も格納している。各タイムスロット情報は、各タイムスロットを特定するためのTS_IDの値(0から15のいずれか)を含んでいる。
このTS_IDの値が小さいほど、時間割付情報格納レジスタ402において、タイムスロット情報が格納されている場所のアドレスの値も小さい。プログラムの実行に通常用いられる上記4つタイムスロットには、0から3までのTS_IDの値が対応づけられている。つまり、上述の先頭アドレスには、TS_IDの値0が示されたタイムスロット情報が格納されており、また、上述の終端アドレスには、TS_IDの値3が示されたタイムスロット情報が格納されている。
The
The smaller the value of TS_ID, the smaller the value of the address where the time slot information is stored in the time allocation
上記4つタイムスロットのそれぞれには、優劣関係があり、先頭アドレスに格納されているタイムスロット情報により特定されるタイムスロット(TS_ID=0)が最も優先度が高く、終端アドレスに向かってアドレスの値が大きくなるほど、そのアドレスに格納されているタイムスロットの優先度が低くなる。このタイムスロットの優先度とは、リアルタイム処理が必要とされる度合いを示し、特に、終端アドレスに格納されているタイムスロット情報(TS_ID=3)により特定されるタイムスロットにおいては、リアルタイム処理を保証しない。 Each of the above four time slots has a superiority or inferiority relationship, and the time slot (TS_ID = 0) specified by the time slot information stored at the head address has the highest priority, and the address of the address toward the end address The higher the value, the lower the priority of the time slot stored at that address. The priority of this time slot indicates the degree to which real-time processing is required. In particular, in the time slot specified by the time slot information (TS_ID = 3) stored in the end address, real-time processing is guaranteed. do not do.
プロセッサ状態格納部425は、現在実行中のプログラムの状態に関する情報を格納するレジスタである。この情報は、1)現在においてレジスタ切替部412による切り替えが禁止されているか否かを示す切替禁止フラグの値と、2)現在、後述の共通割り込処理が実行されているか否かを示す共通割込フラグの値とからなる。
前記切り替えが禁止及び前記共通割り込みが生じている場合には、それぞれのフラグの値は、1となり、それ以外の場合には0の値をとる。設定フラグレジスタ421は、プログラムに関する設定情報を格納するためのレジスタである。より具体的には、この設定情報とは、プログラム毎に用意されているフラグの集まり(以下、「設定フラグ群」という。)であり、これら設定フラグ群の各フラグの値が示す内容は、例えば、自プログラムが受付可能な固有割り込み処理要求又はイベント処理要求の種別などである。
The processor
When the switching is prohibited and the common interrupt is generated, the value of each flag is 1, and otherwise, the value is 0. The setting
リクエスト検出部419は、プログラム毎に用意されているフラグの集まり(以下、「固有フラグ群」という。)と、各プログラムに共通して用意されているフラグの集まり(以下、「共通フラグ群」という。)を有する。この固有フラグ群の各フラグは、設定フラグレジスタ421に格納されている設定フラグ群の各フラグと1対1に対応しており、固有フラグ群を構成するビットデータのビット列長は、設定フラグ群を構成するビットデータのビット列長と同一であり、先頭からのビット位置が同じであれば同じ項目についての値を示している。
The
なお、これらのフラグには、各フラグが示す項目に関連する情報、例えば、この項目に対応するプログラムを特定するIDなどの関連情報が付されているものがある。リクエスト検出部419は、外部I/F417から受け取った外部信号のビットデータの配列及び値にもとづいて、上述の固有フラグ群及び共通フラグ群の値を更新する。
つまり、リクエスト検出部419は、受け取った外部信号を理解可能なデータ形式へと変換する。リクエスト検出部419は、更新された共通フラグ群の各フラグの値、及び、設定フラグレジスタ421内の設定フラグ群の値と固有フラグ群の値とを照合した結果にもとづいて、この外部信号の内容を把握する。
Some of these flags have information related to an item indicated by each flag, for example, related information such as an ID for specifying a program corresponding to the item. The
That is, the
このような処理を、便宜的に、外部信号解読処理という。外部信号の内容としては、大別すると、割り込み処理要求とイベント処理要求の2つがある。割り込み処理要求には、さらに、固有割り込み処理要求と共通割り込み処理要求とがある。
ここで、固有割り込み処理要求とは、特定のプログラムのみにおいて実行可能な処理の実行要求であって、この特定のプログラムのみが固有割り込み処理の実行を必要としている。
Such processing is called external signal decoding processing for convenience. The contents of the external signal are roughly classified into two types: an interrupt processing request and an event processing request. The interrupt processing request further includes a specific interrupt processing request and a common interrupt processing request.
Here, the specific interrupt process request is a process execution request that can be executed only in a specific program, and only the specific program needs to execute the specific interrupt process.
また、共通割り込み処理要求とは、全てのプログラムにおいて実行可能な処理の実行要求であって、これらプログラムが共通してこの共通割り込み処理の実行を必要としている。
上述の共通フラグ群は、この共通割り込み処理要求の内容ついて示すものである。なお、これら割り込み処理は、実行可能なプログラム上からサブルーチンプログラムにジャンプして実行される。イベント処理要求とは、実行できない状態となっているプログラム又は現在実行の必要がないプログラムにおいて、実行可能な状態となるイベント又は実行を必要とするイベントが発生したために生じるこれらプログラムの実行要求である。
The common interrupt processing request is an execution request for processing that can be executed in all programs, and these programs need to execute the common interrupt processing in common.
The above-described common flag group indicates the contents of the common interrupt processing request. These interrupt processes are executed by jumping from an executable program to a subroutine program. An event processing request is an execution request for a program that is in an inexecutable state or a program that is not currently required to be executed because an event that can be executed or an event that requires execution has occurred. .
より具体的には、リクエスト検出部419は、上述の外部信号解読処理の実行により、受け取った外部信号が、固有割り込み処理要求、共通割り込み処理要求及びイベント処理要求のいずれを示すのかを判別する。上記判別結果が、固有割り込み処理要求であった場合、リクエスト検出部419は、上述の関連情報により、この固有割り込み処理の割込み先となるプログラムを特定するID(以下、「固有P_ID」という。)及び固有割り込み処理を実行するサブルーチンプログラムを特定するID(以下、「固有SP_ID」という。)も取得する。
More specifically, the
また、上記判別結果が、共通割り込み処理要求であった場合、リクエスト検出部419は、上述の関連情報により、上述の外部信号から共通割り込み処理を実行するサブルーチンプログラムを特定するID(以下、「共通SP_ID」という。)を取得する。
また、上記判別結果が、イベント処理要求であった場合、リクエスト検出部419は、上述の関連情報により、上述の外部信号から実行要求がなされたプログラムを特定するID(以下、「イベントP_ID」という。)を取得する。
If the determination result is a common interrupt processing request, the
If the determination result is an event processing request, the
リクエスト検出部419は、上述の取得に伴い、取得したこれらIDをスケジューリング制御部413に出力する。
また、リクエスト検出部419は、上述の固有割り込み処理要求、共通割り込み処理要求及びイベント処理要求に応じる処理の実行が完了した旨をスケジューリング制御部413から受け取ったとき、完了した処理に該当する項目のフラグの値をデフォルト値に変更する。
The
In addition, when the
さらに、リクエスト検出部419は、上記判別結果が、イベント処理要求であった場合、先に述べたイベントP_IDのスケジューリング制御部413への出力に先行して、LP状態格納レジスタ424を参照する。このとき、このイベントP_IDにより特定されるプログラムの属性が「ED」を示す場合、つまり、このプログラムが非定常的に実行されるイベントドリブン型のプログラムである場合、リクエスト検出部419は、後述するサイクル先頭信号の直近の受信時点から現在までにおいて、プログラムの属性が「ED」であるプログラムを示すP_IDをスケジューリング制御部413に出力したことがない場合に限り、このP_IDをスケジューリング制御部413に出力するものとする。
Further, when the determination result is an event processing request, the
リクエスト検出部419は、以上の処理を実施した結果、P_IDの出力できなかったものについて、このP_IDを記憶し、次にサイクル先頭信号を受信したときに、スケジューリング制御部413に出力するようにする。スケジューリング制御部413は、1タイムスロット分のプログラム実行時間枠内において、プログラム実行のスケジューリングを実施し、コンテキストをスタンバイレジスタ群に復帰するための処理(以下、「復帰処理」という。)を実施し、レジスタ切り替えのための処理(以下、「レジスタ切り替え処理」という。)を実施し、スタンバイレジスタ群からコンテキストをコンテキストメモリ500上に退避するための処理(以下、「退避処理」という。)を実施する機能を有する。(1−1.スケジューリング)まず、上述のスケジューリングについて説明する。
The
スケジューリングには、定常的な処理の実行についてのスケジューリングである1)タイムドリブンスケジューリング、現在スケジューリングの対象外となっているプログラムの実行についてのスケジューリングである2)イベントドリブンスケジューリング及びプログラムの実行中にプログラムの実行時間が放棄された場合におけるスケジューリングである3)放棄スケジューリングの3つがある。 Scheduling consists of 1) time-driven scheduling, which is execution of routine processing, and 2) event-driven scheduling, which is scheduling of execution of programs that are not currently scheduled, and programs during program execution. There are three types of scheduling: 3) Abandoned scheduling.
スケジューリング制御部413は、これら3つのスケジューリング及びレジスタ切り替え処理の予備的処理として、(1)目的タイムスロット検索処理、(2)目的TS割り当てプログラム検索処理、(3)優先度&モード情報検索処理、(4)アイドルオプション情報検索処理及び(5)タイムオプション情報検索処理を実施する。
(1−1−1.目的タイムスロット検索処理)
以下、目的タイムスロット検索処理について説明する。
As a preliminary process of these three scheduling and register switching processes, the
(1-1-1. Target Time Slot Search Process)
The target time slot search process will be described below.
スケジューリング制御部413は、制御レジスタ420内に格納されているカレントアドレスの値、ネクストアドレスの値、先頭アドレスの値及び終端アドレスの値のうち、目的とするいずれか1つのアドレス(以下、「目的アドレス」という。)の値を参照し、時間割付情報格納レジスタ402内の目的アドレスに格納されているタイムスロット情報内のTS_IDの値を参照し、当該タイムスロット(以下、「目的TS」という。)を特定し、さらに、このタイムスロットに割り当てられているプログラム実行時間枠、即ち、基本サイクルの値を取得する。
(1−1−2.目的TS割り当てプログラム検索処理)
以下、目的TS割り当てプログラム検索処理について説明する。
The
(1-1-2. Target TS allocation program search process)
The target TS allocation program search process will be described below.
スケジューリング制御部413は、目的TSに対応づけられているLP情報を参照し、このLP情報が示す4つのプログラムを特定し、さらに、これらプログラムそれぞれに対応づけられている優先度(0から3のいずれか)を把握する。
(1−1−3.優先度&モード情報検索処理)以下、優先度&モード情報検索処理について説明する。
The
(1-1-3. Priority & Mode Information Search Process) The priority & mode information search process will be described below.
スケジューリング制御部413は、目的TSに対応づけられている優先度&モード情報を参照し、優先度として0から3のいずれが示されているのか、さらに、モードとしてIndexモード及びLevelモードのいずれが示されているのかを把握する。上述のIndexモード及びLevelモードとは、タイムスロットへのプログラムの割り付け方を規定する設定情報であり、優先度&モード情報にIndexモードが示されている場合、ある1つのプログラムのみに対してタイムスロットへの割り付けを試み、また、優先度&モード情報にLevelモードが示されている場合、指定された優先度よりも上位の優先度を有するプログラムのみに対してタイムスロットへの割り付けを試みられることとなる。
(1−1−4.アイドルオプション情報検索処理)
以下、アイドルオプション情報検索処理について説明する。
The
(1-1-4. Idle option information search process)
Hereinafter, idle option information retrieval processing will be described.
スケジューリング制御部413は、アイドルオプション情報検索処理として、目的TSに対応づけられているアイドルオプション情報を参照し、「SWITCH」及び「MICRO-SLEEP」のいずれが示されているのかを判別する。
(1−1−5.タイムオプション情報検索処理)
スケジューリング制御部413は、タイムオプション情報検索処理として、目的TSに対応づけられているタイムオプション情報の内容を参照し、「LP_SWITCH」、「TS_SWITCH」及び「MICRO-SLEEP」のいずれが示されているのかを判別する。
(1−2.タイムドリブンスケジューリング)
以下、タイムドリブンスケジューリングについて説明する。
The
(1-1-5. Time option information search process)
The
(1-2. Time-driven scheduling)
Hereinafter, time-driven scheduling will be described.
タイムドリブンスケジューリングとは、通常のプログラム実行に関するスケジューリングである。後述のイベントドリブンスケジューリング及び放棄スケジューリングが実行されない限り、スケジューリング制御部413は、タイムドリブンスケジューリングを実行し、これにもとづいて復帰処理、レジスタ切り替え処理及び退避処理を実施する。
スケジューリング制御部413は、タイムドリブンスケジューリングとして、以下のスケジューリング処理を実施する。
(1−2−1.スケジューリング処理)
以下、スケジューリング処理について説明する。スケジューリング制御部413は、ネクストアドレスを目的アドレスとして先に述べた目的タイムスロット検索処理を実施し、目的TS(以下、ここでは、「ネクストTS」という。)を特定した後、先に述べた目的TS割り当てプログラム検索処理を実施してこのネクストTSに対応づけられている4つのプログラムを特定し、さらに、これらプログラムそれぞれに対応づけられている優先度を把握する。
Time-driven scheduling is scheduling related to normal program execution. As long as event-driven scheduling and abandonment scheduling, which will be described later, are not executed, the
The
(1-2-1. Scheduling process)
Hereinafter, the scheduling process will be described. The
次に、スケジューリング制御部413は、先に述べた優先度&モード情報検索処理を実行し、上述のネクストTSに対応づけられている優先度&モード情報の内容、即ち、優先度及びモードを検索する。検索されたモードがLevelモードであるとき、スケジューリング制御部413は、検索された優先度の値以下の値が対応づけられている全てのプログラムを上述の目的TSへと割り当てるプログラムの候補(以下、「候補プログラム」という。)とする。
Next, the
検索されたモードがIndexモードであるとき、スケジューリング制御部413は、優先度&モード情報検索処理により検索された優先度の値が対応づけられている1つのプログラムを上述の候補プログラムとする。さらに、スケジューリング制御部413は、LP状態格納レジスタ424内の各候補プログラムに対応するプログラム状態情報を参照し、各候補プログラムがそれぞれ実行可能であるか否かを検出する。
When the retrieved mode is the Index mode, the
より具体的には、スケジューリング制御部413は、候補プログラムのプログラム状態情報がreadyを示している場合に、そのプログラムが実行可能であると判断し、そのプログラムを上述のネクストTSへの割り付け候補として有効にする。このようにして有効とされた候補プログラムを、有効候補プログラムという。
スケジューリング制御部413は、1つのネクストTSに対して、複数の有効候補プログラムが存在する場合には、優先度の値が最も小さな値が対応づけられている有効候補プログラムをこのネクストTSへの割り付け対象とする。
More specifically, when the program status information of the candidate program indicates “ready”, the
When there are a plurality of valid candidate programs for one next TS, the
また、スケジューリング制御部413は、1つのネクストTSに対して、1つの有効候補プログラムが存在する場合には、その有効候補プログラムをこのネクストTSへの割り付け対象とする。
有効候補プログラムをネクストTSへの割り付け対象とするのに伴い、スケジューリング制御部413は、当該ネクストTSのタイムスロット情報に有効候補プログラムを特定するIDを対応づける。さらに、スケジューリング制御部413は、上述の有効候補プログラムの実行が完了したとき、上述のタイムスロット情報から当該有効候補プログラムを特定するIDを抹消する。
In addition, when there is one valid candidate program for one next TS, the
As the valid candidate program is assigned to the next TS, the
また、1つのネクストTSに対して、有効候補プログラムが1つも存在しない場合には、スケジューリング制御部413は、アイドルオプション情報検索処理を実施することにより得られる情報の内容にもとづいて、その後の処理の内容を決定する。より具体的には、スケジューリング制御部413は、上述の情報の内容が、「MICRO-SLEEP」を示す場合、いずれのプログラムも上述のネクストTSへの割り当て対象としない。
If there is no valid candidate program for one next TS, the
なお、このようにしてプログラムが割り当てられなかったタイムスロットをエンプティタイムスロットという。
また、上述の情報の内容が、「SWITCH」を示す場合、スケジューリング制御部413は、ネクストアドレスの値に1を加えた値(ただし、ネクストアドレスが終端アドレスであった場合に限り、先頭アドレスの値)を新たなネクストアドレスとし、上述のスケジューリング処理を繰り返し実施する。
A time slot to which no program is assigned in this way is called an empty time slot.
When the content of the above information indicates “SWITCH”, the
以上のようなタイムドリブンスケジューリングを実施した後、スケジューリング制御部413は、復帰処理、レジスタ切り替え処理及び退避処理を実施する。
(1−3.イベントドリブンスケジューリング)以下、イベントドリブンスケジューリングについて説明する。イベントドリブンスケジューリングとは、現在スケジューリングの対象外となっている以下のプログラムの実行要求が生じているとき、前記タイムドリブンスケジューリングに代えて実施されるスケジューリングである。
After performing the time-driven scheduling as described above, the
(1-3. Event Driven Scheduling) Event driven scheduling will be described below. Event-driven scheduling is scheduling that is executed in place of the time-driven scheduling when a request to execute the following program that is currently not subject to scheduling occurs.
実行要求が生じている上述のプログラムとは、即ち、EDの属性を有するプログラムであって、waitingの状態からreadyへと遷移したもの、及び、TD又はEDの属性を有するプログラムであって、suspended- waiting 又はrunningの状態からsuspended-readyの状態となっているプログラムである。なお、スケジューリング制御部413は、タイムドリブンスケジューリングを実施しようとしたとき、その直前において、上述のプログラムの実行要求が生じているか否かを判断する。
The above-mentioned program in which an execution request has occurred is a program having an ED attribute that has transitioned from a waiting state to ready, and a program that has a TD or ED attribute and is suspended. -The program has been suspended-ready from the waiting or running state. Note that the
スケジューリング制御部413は、リクエスト検出部419からイベントP_IDを受け取ったとき、受け取ったイベントP_IDによりプログラムを特定し、LP状態格納レジスタ424を参照し、このプログラムの状態とTS_IDの値、プログラムの属性、起床タイミングを把握し、把握した内容に応じて以下の処理を実施する。
(1−3−1.回復イベント処理)
スケジューリング制御部413は、上記特定プログラムの状態がwaiting、属性が「TD」、起床タイミングが「n」を示す場合、LP状態格納レジスタ424におけるイベントP_IDにより特定される現在のプログラムの状態をreadyに遷移させる。
When the
(1-3-1. Recovery event processing)
The
スケジューリング制御部413は、このような回復イベント処理の実施後、タイムドリブンスケジューリング後に実施する復帰処理、レジスタ切り替え処理及び退避処理を実施する。
(1−3−2.緊急回復イベント処理)
上記特定プログラムの状態がsuspended-waiting、属性が「TD」、起床タイミングが「e」を示す場合、スケジューリング制御部413は、この特定プログラムの状態をsuspended-readyに遷移させる。
The
(1-3-2. Emergency recovery event processing)
When the state of the specific program indicates suspended-waiting, the attribute indicates “TD”, and the wakeup timing indicates “e”, the
そして、スケジューリング制御部413は、この特定プログラムの状態を示すコードに付されているTS_IDの値からタイムスロット(以下、「特定TS」という。)を特定し、この特定TSに上述の特定プログラムを割り当てる。このような緊急回復イベント処理を実施した後、スケジューリング制御部413は、後述の緊急復帰処理を実施し、また、タイムドリブンスケジューリング後に実施されるレジスタ切り替え処理に代えて、後述の緊急レジスタ切り替え処理を実施する。
(1−3−3.イベント起床処理)また、上記特定プログラムの状態がsuspended-waiting、属性が「TD」、起床タイミングが「n」を示す場合、LP状態格納レジスタ424におけるイベントP_IDにより特定される現在のプログラムの状態をsuspended-readyに遷移させる。
Then, the
(1-3-3. Event wake-up process) When the state of the specific program is suspended-waiting, the attribute is “TD”, and the wake-up timing is “n”, it is specified by the event P_ID in the LP
さらに、上記特定プログラムの状態がwaiting又はsuspended-waiting、属性が「ED」、起床タイミングが「n」を示す場合、スケジューリング制御部413は、受け取ったイベントP_IDにより特定されるプログラムの状態がwaitingであればreadyに、suspended-waitingであればsuspended-readyに変更する。加えて、スケジューリング制御部413は、イベントドリブンスケジューリング後に実施される起床タイミング「e」の緊急レジスタ切り替え処理が発生した場合、その事象の発生によって、実行中のプログラムの状態を属性に関係なくrunningからsuspended-readyへと変更する。
Furthermore, when the status of the specific program is waiting or suspended-waiting, the attribute is “ED”, and the wake-up timing indicates “n”, the
このイベント起床処理を実施した場合、スケジューリング制御部413は、タイムドリブンスケジューリング後に実施される復帰処理に代えて、後述の早期復帰処理を実施し、カウント値0信号の到来をトリガとして、後述のレジスタ切り替え処理を実施する。このようなイベント処理をイベント起床処理という。
(1−3−4.緊急イベント起床処理)また、上記特定プログラムの状態がwaiting又はsuspended-waiting、属性が「ED」、起床タイミングが「e」を示す場合、スケジューリング制御部413は、特定プログラムの状態がwaitingであればreadyに、suspended-waitingであればsuspended-readyに変更する。
When this event wake-up process is performed, the
(1-3-4. Emergency event wake-up process) When the status of the specific program is waiting or suspended-waiting, the attribute is “ED”, and the wake-up timing is “e”, the
この緊急イベント起床処理を実施した場合、スケジューリング制御部413は、タイムドリブンスケジューリング後に実施される復帰処理に代えて、後述の緊急復帰処理を実施し、また、タイムドリブンスケジューリング後に実施されるレジスタ切り替え処理に代えて、後述の緊急レジスタ切り替え処理を実施する。このようなイベント処理を緊急イベント起床処理という。
(1−4.放棄スケジューリング)
スケジューリング制御部413が、処理制御部411を介して処理実行部410からウエイトコードを受け取った場合、もしくは、DMA管理部418から後に述べるキャッシュミス信号を受け取った場合に実施する放棄スケジューリングについて説明する。
When this emergency event wake-up process is performed, the
(1-4. Abandonment scheduling)
Abandonment scheduling performed when the
上述のウエイトコードとは、実行中のプログラムの継続が不可能となったとき、実行中のプログラムに割り当てられている時間が放棄されたことを示すコードであり、このウエイトコードには、「vmp_wait」と、「vmp_sus」とがある。「vmp_wait」コードは、上述の放棄時間が比較的長いことが見込まれる場合に、処理実行部410により発せられるコードであり、また、「vmp_sus」コードは、上述の放棄時間が比較的短いことが見込まれる場合に、処理実行部410により発せられるコードである。
The above-described wait code is a code indicating that the time allocated to the running program is abandoned when the running program cannot be continued. This wait code includes “vmp_wait And “vmp_sus”. The “vmp_wait” code is a code issued by the
スケジューリング制御部413は、処理制御部411を介して処理実行部410から「vmp_wait」コード、「vmp_sus」コード及びキャッシュミス信号を受け取った場合、LP状態格納レジスタ424内に格納されている実行中のプログラムの状態を更新する。より具体的には、「vmp_wait」コードを受け取った場合、スケジューリング制御部413は、実行中のプログラムの状態をrunningからwaitingに変更する。
When the
また、「vmp_sus」コードを受け取った場合、又は、キャッシュミス信号を受け取った場合、スケジューリング制御部413は、実行中のプログラムの状態をrunningからsuspended-waitingに変更する。そして、スケジューリング制御部413は、カレントアドレスを目的アドレスとして、先に述べたタイムオプション情報検索処理を実施する。
受け取ったウエイトコードが「vmp_sus」の場合、スケジューリング制御部413は、タイムオプション情報に関係なく、後述の緊急レジスタ切り替え処理を実施し、退避処理を実施して、さらに後述の制御レジスタ値更新処理を実施する。
Further, when the “vmp_sus” code is received or the cache miss signal is received, the
When the received wait code is “vmp_sus”, the
また、受け取ったウエイトコードが「vmp_wait」であり、かつ、タイムオプション情報の内容が「TS_SWITCH」を示す場合においても、上記と同様にスケジューリング制御部413は、後述の緊急レジスタ切り替え処理を実施し、退避処理を実施して、さらに後述の制御レジスタ値更新処理を実施する。
なお、前記緊急レジスタ切り替え処理が実施される直前のスタンバイレジスタ群では、タイムドリブンスケジューリングによる復帰処理か、又は、イベントドリブンスケジューリングで実施されるイベント起床処理後の早期復帰処理がなされている。
Further, even when the received wait code is “vmp_wait” and the content of the time option information indicates “TS_SWITCH”, the
In the standby register group immediately before the emergency register switching process is performed, the return process by time-driven scheduling or the early return process after the event wake-up process performed by event-driven scheduling is performed.
また、受け取ったウエイトコードが「vmp_wait」であって、かつ、タイムオプション情報の内容が「LP_SWITCH」を示すとき、スケジューリング制御部413は、現在実行対象となっているタイムスロットに有効候補プログラムが存在するか否かを判断し、有効候補プログラムが存在する場合には、有効候補プログラムのうち最も優先度が高いプログラム(有効候補プログラムが1つの場合には、そのプログラム)に対応するコンテキストのレジスタ値をスタンバイレジスタ群に格納、即ち、復帰を実施する。
In addition, when the received wait code is “vmp_wait” and the content of the time option information indicates “LP_SWITCH”, the
その後、スケジューリング制御部413は、後述の緊急レジスタ切り替え処理を実施し、退避処理を実施する。
また、有効候補プログラムが存在しない場合、及び、タイムオプション情報の内容が「MICRO-SLEEP」を示す場合、スケジューリング制御部413は、処理実行部410においてカレントレジスタ群内のレジスタ値の更新を伴わないプログラム実行である後述のNOP実行させるように処理制御部411に指示すると共に、以下の処理を実施する。
Thereafter, the
In addition, when there is no valid candidate program, and when the content of the time option information indicates “MICRO-SLEEP”, the
即ち、スケジューリング制御部413は、直ちにマスク信号のクロックマスク部427への出力を開始し、さらに、スタンバイレジスタ群に格納されているコンテキストの内容を参照し、このコンテキストに対応するプログラムの実行に必要なデータが格納されているメモリのアドレスの値を取得し、このアドレスに格納されているデータをキャッシュメモリに書き込むようにDMA管理部418に指示する。
That is, the
さらに、スケジューリング制御部413は、次にレジスタ切り替え、又は緊急レジスタ切り替えが実施されるとき、マスク信号のクロックマスク部427への出力を停止する。スケジューリング制御部413は、サイクルカウンタ416からカウント値0信号を受け取ったとき、後述のレジスタ切り替え処理及び退避処理を実施する。
次に、復帰処理、緊急復帰処理及び早期復帰処理などの復帰に関する処理について説明する。
(1−5−1.復帰処理)
復帰処理とは、タイムドリブンスケジューリング実施後において、スケジューリング制御部413により実施される、レジスタ値をスタンバイレジスタ群に格納するための処理である。
Further, the
Next, processing related to restoration, such as restoration processing, emergency restoration processing, and early restoration processing, will be described.
(1-5-1. Return processing)
The return processing is processing for storing the register value in the standby register group, which is performed by the
スケジューリング制御部413は、復帰処理として、スタンバイレジスタ群が開放されたとき、即ち、退避が完了したとき、上述のタイムドリブンスケジューリングにより割り当てられたプログラムのコンテキストのレジスタ値を、上述のスタンバイレジスタ群に格納するようにDMA管理部418に指示する。
(1−5−2.緊急復帰処理)
緊急復帰処理とは、イベントドリブンスケジューリングを実施した結果、先に述べた特定プログラムの起床タイミングが「e」を示す場合において、スケジューリング制御部413により実施される、レジスタ値をスタンバイレジスタ群に格納するための処理である。
When the standby register group is released, that is, when the saving is completed, the
(1-5-2. Emergency return processing)
The emergency return process is a case where, as a result of performing event-driven scheduling, when the wake-up timing of the specific program described above indicates “e”, the register value executed by the
スケジューリング制御部413は、緊急復帰処理として、上述の緊急回復イベント処理又は緊急イベント起床処理を実行が完了したとき、スタンバイレジスタ群に格納されているレジスタ値を退避して、直ちに特定プログラムに対応するコンテキストのレジスタ値を上述のスタンバイレジスタ群に格納、即ち、緊急的な復帰を実施するようにDMA管理部418に指示する。
The
なお、上述の退避及び復帰は、レジスタ群単位ではなく、各レジスタ単位で実行することが可能であり、レジスタ毎に退避、復帰を順次実施することにより、これらの退避及び復帰が擬似並行的に実施されることとなる。
(1−5−3.早期復帰処理)
早期復帰処理とは、イベントドリブンスケジューリングを実施した結果、先に述べた特定プログラムの起床タイミングが「n」を示す場合において、スケジューリング制御部413により実施される、レジスタ値をスタンバイレジスタ群に格納するための処理である。
Note that the above-described saving and restoring can be executed in units of registers, not in register groups. By performing saving and restoring in sequence for each register, these saving and restoration are performed in a pseudo-parallel manner. Will be implemented.
(1-5-3. Early return processing)
The early return process is a process in which event-driven scheduling is performed, and when the wake-up timing of the specific program described above indicates “n”, the register value executed by the
スケジューリング制御部413は、早期復帰処理として、スタンバイレジスタ群が開放されたとき、即ち、退避が完了したとき、直ちに特定プログラムに対応するコンテキストのレジスタ値を、上述のスタンバイレジスタ群に格納するようにDMA管理部418に指示する。なお、スケジューリング制御部413は、緊急復帰処理と同様に、上述の格納に先行して、スタンバイレジスタ群のレジスタ値の初期化を実施する。
As an early return process, the
つづいて、レジスタ切り替え処理及び緊急レジスタ切り替え処理などのレジスタ切り替えに関する処理について説明する。
(1−6−1.レジスタ切り替え処理)
スケジューリング制御部413は、サイクルカウンタ416からカウント値0信号を受け取ったとき、後述の基本サイクル調整処理を実施し、さらに後述の切り替えタイミング確認処理を行った上でレジスタ切り替えを実施するようにレジスタ切替部412に指示する。
Subsequently, processing related to register switching such as register switching processing and emergency register switching processing will be described.
(1-6-1. Register switching processing)
When the
また、スケジューリング制御部413は、レジスタ切り替えが完了した旨の通知をレジスタ切替部412から受け取ったとき、基本サイクルの値をサイクルカウンタ416に出力し、さらに、後述の実時間保存処理及び後述の制御レジスタ値更新処理を実施する。この時、実行対象となっているタイムスロットが先に述べたエンプティタイムスロットである場合、スケジューリング制御部413は、基本サイクルの値をサイクルカウンタ416に出力するのに伴い、処理実行部410においてNOP実行させるように処理制御部411に指示すると共に、クロックマスク部427へのマスク信号の出力を開始し、さらに、スタンバイレジスタ群に格納されているコンテキストの内容を参照し、このコンテキストに対応するプログラムの実行に必要なデータが格納されているメモリのアドレスの値を取得し、このアドレスに格納されているデータをキャッシュメモリに書き込むようにDMA管理部418に指示する。
Further, when the
また、スケジューリング制御部413は、次にレジスタ切り替え又は緊急レジスタ切り替えが実施されたとき、このマスク信号のクロックマスク部427への出力を停止する。
(1−6−1−1.基本サイクル調整処理)
以下、基本サイクル調整処理について説明する。
スケジューリング制御部413は、レジスタ切り替えの直前に、LP状態格納レジスタ424を参照し、スタンバイレジスタ群に格納されているレジスタ値群に対応するプログラムの状態がsuspended-readyであるか否かを判断し、suspended-readyである場合には、スタンバイレジスタ群内の後述の残余サイクル値記憶領域から後述の実カウント値を取得する。
The
(1-6-1-1. Basic cycle adjustment process)
Hereinafter, the basic cycle adjustment process will be described.
The
そして、スケジューリング制御部413は、次回のプログラム実行時において、このプログラムが割り当てられているタイムスロットのタイムスロット情報に示されている正規の基本サイクルに代えて、この実カウント値をこのプログラムの実行時間、つまり、このプログラムが割り当てられているタイムスロットの基本サイクルとする。
さらに、このタイムスロットのTS_IDの値が3である場合、即ち、リアルタイム処理を保証しないタイムスロットである場合、スケジューリング制御部413は、TS_IDの値が3を示すタイムスロット情報内のタイムラグ値を取得し、このタイムラグ値を上述の基本サイクルの値から差し引いたものを、次回のプログラム実行時における新たな基本サイクルとすると共に、このタイムスロット情報内の前記タイムラグ値を0に更新する。
Then, at the next program execution, the
Furthermore, when the TS_ID value of this time slot is 3, that is, when the time slot does not guarantee real-time processing, the
なお、スケジューリング制御部413は、処理制御部411からプログラム実行の開始の通知を受け取ったとき、以上のように求められた基本サイクルの値をサイクルカウンタ416に出力する。
(1−6−1−2.切り替えタイミング確認処理)
以下、切り替えタイミング確認処理について説明する。
When the
(1-6-1-2. Switching timing confirmation processing)
Hereinafter, the switching timing confirmation process will be described.
プログラムを時分割実行する場合、例えば、プログラムの実行に用いられる共有資源などの都合によりプログラムの実行を任意の時間に終了することができない。つまり、任意の時間でレジスタ切り替えを実施することはできない。このため、スケジューリング制御部413は、まず、プログラムの終了を処理制御部411に依頼し、プログラムの実行の終了が可能な点でプログラムを終了させ、レジスタ切り替えが可能であるか否かを確認する。
When executing a program in a time-sharing manner, the execution of the program cannot be terminated at an arbitrary time due to, for example, shared resources used for executing the program. That is, register switching cannot be performed at an arbitrary time. For this reason, the
より具体的には、上述の依頼後、スケジューリング制御部413は、プロセッサ状態格納部425内の切替禁止フラグの値及び共通割り込みフラグの値を参照し、この切替禁止フラグの値及び共通割り込みフラグの値が0である場合にはレジスタ切り替えが可能であり、切替禁止フラグの値及び共通割り込みフラグの値が1である場合にはレジスタ切り替えが不可能であると判断する。
(1−6−1−3.実時間保存処理)
以下、実時間保存処理について説明する。
More specifically, after the above request, the
(1-6-1-3. Real-time storage processing)
The real time storage process will be described below.
スケジューリング制御部413は、レジスタ切り替えを実施するようにレジスタ切替部412に指示したとき、その時点においてサイクルカウンタ416が有するカウント値を取得し、このカウント値(以下、「実カウント値」という。)が正の値をとり、かつ、上述のレジスタ切り替えのトリガとなる「vmp_sus」コードを受け取っている場合、この実カウント値を、前記レジスタ切り替えが実行された結果、スタンバイレジスタ群となるレジスタ群の決められた領域(以下、「残余サイクル値記憶領域」という。)に書き込む。
When the
このようにすることにより、実行を終了したプログラムの実カウント値が、このプログラムのコンテキストに付され、このコンテキストの退避に伴い、コンテキストメモリ500へと格納されるため、次回プログラム実行時において、前回のプログラム実行時における実カウント値が取得可能となる。
また、上記実カウント値が負の値をとる場合、もしくは、上記実カウント値が正の値をとり、かつ、上述のレジスタ切り替えのトリガとなる「vmp_wait」コードを受け取っている場合、スケジューリング制御部413は、終端アドレスを目的アドレスとして目的タイムスロット検索処理を実施し、これにより特定されるタイムスロット(TS_ID=3)のタイムスロット情報の格納場所を特定し、このタイムスロット情報に格納されているタイムラグ値からこの実カウント値を加えることにより、このタイムラグ値を更新する。
In this way, the actual count value of the program that has finished executing is attached to the context of this program, and is stored in the
Further, when the actual count value takes a negative value, or when the actual count value takes a positive value and the “vmp_wait” code that triggers the register switching is received, the
なお、上述の切り替えタイミング確認処理の説明において述べた理由により、切り替えのタイミングをタイムスロットの基本サイクルと厳密に一致させることはできず、通常、数サイクル程度オーバーして切り替えるため、上述の実カウント値は、負の値をとり、また、プログラムの実行が中断されることによりレジスタ切り替えが行なわれたときなどには、実カウント値は、実行対象となっているタイムスロットの基本サイクル未満となるため正の値をとる。
(1−6−1−4.制御レジスタ値更新処理)
以下、制御レジスタ値更新処理について説明する。
Note that, for the reason described in the description of the switching timing confirmation process described above, the switching timing cannot be strictly matched with the basic cycle of the time slot. The value takes a negative value, and the actual count value is less than the basic cycle of the time slot to be executed, for example, when register switching is performed by interrupting program execution. Therefore, it takes a positive value.
(1-6-1-4. Control register value update processing)
Hereinafter, the control register value update processing will be described.
制御レジスタ値更新処理とは、以下に示すスケジューリングの実施に伴って実行される制御レジスタ420内のデータ更新である。上述のスケジューリングの実施とは、即ち、1)タイムドリブンスケジューリングの実施、2)タイムオプション情報の内容が「TS_SWITCH」を示す場合における放棄スケジューリングの実施のことである。
スケジューリング制御部413は、現時点におけるネクストアドレスの値を新たなカレントアドレスの値とすると共に、当該ネクストアドレスの値に1を加えた値(ただし、ネクストアドレスが終端アドレスであった場合に限り、先頭アドレスの値)を新たなネクストアドレスとし、これに伴って、制御レジスタ420内に格納されているカレントアドレスの値及びネクストアドレスの値を更新する。
The control register value update process is a data update in the control register 420 that is executed in accordance with the following scheduling. The implementation of the above-mentioned scheduling means that 1) implementation of time-driven scheduling and 2) implementation of abandonment scheduling when the content of the time option information indicates “TS_SWITCH”.
The
また、スケジューリング制御部413は、カレントアドレスの値を、終端アドレスの値から先頭アドレスの値へと移行させたとき、サイクル先頭信号をリクエスト検出部419に出力する。
(1−6−2.緊急レジスタ切り替え処理)
以下、緊急レジスタ切り替え処理について説明する。
Also, the
(1-6-2. Emergency register switching process)
Hereinafter, the emergency register switching process will be described.
スケジューリング制御部413は、放棄スケジューリングのタイムオプション処理において、タイムオプション情報の内容が「TS_SWITCH」を示すとき、並びに、イベントドリブンスケジューリング時の緊急回復イベント処理及び緊急イベント起床処理後に緊急復帰処理が完了したときに、上述の基本サイクル調整処理を実施し、さらに上述の切り替えタイミング確認処理を行った上でレジスタ切り替えを実施するようにレジスタ切替部412に指示する。
In the abandon scheduling time option process, the
そして、スケジューリング制御部413は、レジスタ切り替えが完了した旨の通知をレジスタ切替部412から受け取ったとき、基本サイクルの値をサイクルカウンタ416に出力し、さらに、上述の実時間保存処理を実施する。
(1−7−1.退避処理)
スケジューリング制御部413は、レジスタ切り替えが完了した旨の通知をレジスタ切替部412から受け取ったとき、このレジスタ切り替えによりスタンバイレジスタ群となるレジスタ群に格納されているコンテキストのレジスタ値を、もともとこのコンテキストが格納されていたコンテキストメモリ500上の記憶領域に上書きする、即ち、退避するようにDMA管理部418に指示する。
When the
(1-7-1. Saving process)
When the
なお、上述のレジスタ切り替えが実施される直前において、実行対象となっていたタイムスロットが先に述べたエンプティタイムスロットであるときにおいても上述の退避を行う。
(1−8−1.固有割込み処理)
また、スケジューリング制御部413は、リクエスト検出部419から、固有P_ID及び固有SP_IDを受け取った場合、以下の処理を実施する。
Note that, immediately before the above-described register switching is performed, the above-described saving is performed even when the time slot that is the execution target is the empty time slot described above.
(1-8-1. Specific interrupt processing)
When the
即ち、スケジューリング制御部413は、LP状態格納レジスタ424を参照し、受け取った固有P_IDにより特定されるプログラムが、現在実行中であるか否かを判断し、現在実行中である場合、直ちに処理制御部411を介し、処理実行部410に受け取った固有SP_IDにより特定されるサブルーチンプログラムにジャンプして処理を実行するように指示する。
That is, the
また、受け取った固有P_IDにより特定されるプログラムが、現在実行中でない場合、スケジューリング制御部413は、リクエスト検出部419内のフラグを参照することによりこのサブルーチンプログラムの割込み先となるプログラムを特定し、この特定されたプログラムが実行される時に、処理制御部411を介して処理実行部410にこのサブルーチンプログラムにジャンプして処理を実行するように指示する。
(1−8−2.共通割り込み処理)
また、スケジューリング制御部413は、リクエスト検出部419から、共通SP_IDを受け取った場合、直ちに処理制御部411を介し、処理実行部410に受け取った共通SP_IDにより特定されるサブルーチンプログラムにジャンプして処理を実行するように指示し、処理制御部411から当該サブルーチンプログラムの実行開始の通知を受け取ったとき、サイクルカウンタ416にカウントダウンを中断するように指示する。
If the program identified by the received unique P_ID is not currently being executed, the
(1-8-2. Common interrupt processing)
Further, when the
また、スケジューリング制御部413は、処理制御部411から上述の共通SP_IDにより特定されるサブルーチンプログラムの実行が完了したことを示す通知を受け取ったとき、サイクルカウンタ416にカウントダウンの再開を指示するカウント再開信号を出力する。以上のように、スケジューリング制御部413は、様々な処理を実行する機能を有する。
When the
処理制御部411は、処理実行部410におけるプログラムの実行状況を管理する機能を有し、処理実行部410のプログラム実行状況を監視し、処理実行部410におけるプログラム実行の開始タイミング及び終了タイミングと、割込み処理の開始タイミング及び終了タイミングを把握する。処理制御部411は、これらタイミングが到来するごとに、これらタイミングが到来した旨をスケジューリング制御部413に通知する。
The
また、処理制御部411は、処理実行部410からウエイトコードを受け取ったとき、このウエイトコードをスケジューリング制御部413に出力する。さらに、処理制御部411は、処理実行部410におけるプログラム実行が中断できない状態にあるとき、プロセッサ状態格納部425内の切替禁止フラグの値を1(デフォルト値は0)にし、また、処理実行部410において、共通SP_IDにより特定されるサブルーチンプログラムが実行されている間、プロセッサ状態格納部425内の共通割り込みフラグの値を1(デフォルト値は0)にする。
When the
さらに、処理制御部411は、処理実行部410からレジスタ切替禁止命令を受け取ったとき、プロセッサ状態格納部425内の切替禁止フラグの値を1にし、また、処理実行部410からレジスタ切替禁止解除命令を受け取ったとき、上記切替禁止フラグの値を0にする。 また、処理制御部411は、スケジューリング制御部413からNOP実行させる指示を受け取った場合、処理実行部410をNOP実行させる。
Further, when the
DMA管理部418は、DMA転送を円滑に実施し、管理する機能部であり、処理実行部410、スケジューリング制御部413などの各機能部からの要求にもとづいてDMA転送を実施する。
また、DMA管理部418は、各機能部から要求されたDMA転送が完了したとき、その旨を示す信号(以下、「転送完了信号」という。)を当該機能部及びスケジューリング制御部413に出力し、また、処理実行部410からの要求に応じ、キャッシュメモリからプログラム及びデータを取得しようとして、キャッシュミスが生じた場合、キャッシュミスが生じたことを示す信号(以下、「キャッシュミス信号」という。)をスケジューリング制御部413に出力する。
The DMA management unit 418 is a functional unit that smoothly performs and manages DMA transfer, and performs DMA transfer based on requests from the respective functional units such as the
Further, when the DMA transfer requested by each functional unit is completed, the DMA management unit 418 outputs a signal indicating the fact (hereinafter referred to as “transfer completion signal”) to the functional unit and the
外部I/F417は、外部プロセッサなどの外部機器に接続するインターフェースであり、外部から受け取った信号をスケジューリング制御部413およびリクエスト検出部419に出力する。サイクルカウンタ416は、クロックカウンタを有し、スケジューリング制御部413から基本サイクルの値を受け取ったとき、この値をカウンタの初期値としてカウントダウンを開始する。
The external I / F 417 is an interface connected to an external device such as an external processor, and outputs a signal received from the outside to the
サイクルカウンタ416は、上述の初期値から1クロック毎に1づつディクリメントすることにより上述のカウントダウンを行い、値が0となったとき、スケジューリング制御部413にその旨を示す信号(以下、「カウント値0信号」という。)を出力する。
また、サイクルカウンタ416は、スケジューリング制御部413からの指示にもとづき、カウントダウンを中断し、再開し、さらに、指示された時点におけるカウンタの値である実カウント値をスケジューリング制御部413に出力する。
The cycle counter 416 decrements one by one every clock from the initial value described above, and when the value becomes 0, when the value becomes 0, a signal (hereinafter referred to as “count”) indicating the fact to the
Further, the cycle counter 416 interrupts and restarts the countdown based on an instruction from the
クロックマスク部427は、スケジューリング制御部413からマスク信号を受信している間、処理実行部410へのクロックパルスの信号経路を遮断する機能を有する。
(2.データ)図16は、時間割付情報格納レジスタ402及びLP状態格納レジスタ424に格納されている情報の内容を示す図である。
時間割付情報格納レジスタ402には、1)タイムスロット情報と、2)LP情報と、3)優先度&モード情報と、4)アイドルオプション情報と、5)タイムオプション情報とが格納されている。これらの情報は、タイムスロット毎に用意され、互いに関連付けられている。
(2−1−1.タイムスロット情報)タイムスロット情報には、タイムスロットを特定するためのTS_IDの値と、基本サイクルの値とが含まれている。
The
(2. Data) FIG. 16 is a diagram showing the contents of information stored in the time allocation
The time allocation
(2-1-1. Time Slot Information) The time slot information includes a TS_ID value for specifying a time slot and a basic cycle value.
また、TS_IDの値が3のタイムスロット情報には、さらに、タイムラグ値が含まれている。
また、スケジューリング制御部413によりスケジューリングが実施されると、プログラムが割り当てられたタイムスロットのTS_IDの値に、このプログラムのIDが対応づけられることとなる。
(2−1−2.LP情報)LP情報には、タイムスロットへの割り当て候補となるプログラムに関する情報が格納されている。
The time slot information with a TS_ID value of 3 further includes a time lag value.
When scheduling is performed by the
(2-1-2. LP information) The LP information stores information about programs that are candidates for assignment to time slots.
1つのタイムスロットへの割り当て候補となるプログラムの属性及び数は、割り当て先のタイムスロットの属性により異なる。即ち、TDの属性を有するプログラムは、必ずTDの属性を有するタイムスロットに割り当てられる。
また、TDの属性を有する各タイムスロットには、TDの属性を有する4つの候補プログラムが用意されている。
The attributes and number of programs that are candidates for assignment to one time slot differ depending on the attributes of the assignment time slot. That is, a program having the TD attribute is always assigned to a time slot having the TD attribute.
Also, four candidate programs having the TD attribute are prepared for each time slot having the TD attribute.
一方、EDの属性を有するプログラムは、必ずEDの属性を有するタイムスロットに割り当てられる。
また、EDの属性を有する各タイムスロットには、EDの属性を有する1つの候補プログラムが用意されているのみである。各LP情報は、上述の割り当て先のタイムスロットに対応するタイムスロット情報に対応づけられている。
On the other hand, a program having the ED attribute is always assigned to a time slot having the ED attribute.
Further, only one candidate program having the ED attribute is prepared for each time slot having the ED attribute. Each LP information is associated with time slot information corresponding to the above-mentioned time slot of the assignment destination.
LP情報には、プログラムを特定するためのIDの値と、優先度を示す値と、このプログラムに対応するコンテキストが格納されているコンテキストメモリ500上のアドレスの値との組が、割り当て候補となるプログラムの数だけ格納されている。上述の優先度を示す値は、0、1、2、3のいずれかの値であって、割り当て候補となる各プログラム同士の優先度が重複しないように設定されている。
The LP information includes a combination of an ID value for specifying a program, a value indicating a priority, and an address value on the
なお、割り当て候補となるプログラムの数が1つの場合の優先度を示す値は、0となる。
(2−1−3.優先度&モード情報)
優先度&モード情報には、タイムスロットへの割り当て候補となるプログラムの指定に関する情報が格納されている。
Note that the value indicating the priority when the number of allocation candidate programs is one is zero.
(2-1-3. Priority & Mode information)
The priority & mode information stores information related to the designation of programs that are candidates for assignment to time slots.
即ち、優先度&モード情報には、優先度を示す0、1、2、3のいずれか1つの値と、モードを示すコード「I」又は「L」が格納されている。ここでコード「I」は、Indexモードを示し、コード「L」は、Levelモードを示す。この優先度&モード情報の内容を変更することにより、有効となる候補プログラムの範囲が変化するため、各候補プログラムの実行頻度を設計上好ましい値に近づけることができる。
(2−1−4.アイドルオプション情報)
アイドルオプション情報には、タイムスロットに割り付けようとしたプログラムが全て実行不可能な状態となっている場合におけるプログラム実行動作を決定する情報が格納されている。
That is, the priority & mode information stores one of 0, 1, 2, and 3 indicating the priority, and the code “I” or “L” indicating the mode. Here, the code “I” indicates the Index mode, and the code “L” indicates the Level mode. By changing the contents of the priority & mode information, the range of valid candidate programs changes, so that the execution frequency of each candidate program can be brought close to a design-preferable value.
(2-1-4. Idle option information)
The idle option information stores information for determining the program execution operation when all the programs to be assigned to the time slots are in an inexecutable state.
即ち、アイドルオプション情報には、省電力化を示すコード「MICRO-SLEEP」又は高効率なプログラム実行を示すコード「SWITCH」が格納されている。
(2−1−5.タイムオプション情報)
タイムオプション情報には、実行中のプログラムが中断した場合における、中断以降のプログラム実行動作を決定する情報が格納されている。
That is, in the idle option information, a code “MICRO-SLEEP” indicating power saving or a code “SWITCH” indicating highly efficient program execution is stored.
(2-1-5. Time option information)
The time option information stores information for determining the program execution operation after the interruption when the program being executed is interrupted.
即ち、タイムオプション情報には、実行中のプログラムが中断した場合、このプログラムに代えて、このプログラムが属しているタイムスロットに対応づけられている実行可能な別のプログラムをタイムスロットに割り付けることを示すコード「LP_SWITCH」、次のタイムスロットを実行対象とすることを示すコード「TS_SWITCH」、又は、省電力化を示すコード「MICRO-SLEEP」が格納されている。 That is, in the time option information, when a running program is interrupted, another executable program associated with the time slot to which this program belongs is assigned to the time slot instead of this program. A code “LP_SWITCH”, a code “TS_SWITCH” indicating that the next time slot is to be executed, or a code “MICRO-SLEEP” indicating power saving is stored.
LP状態格納レジスタ424には、1)プログラム状態情報と、2)タイムスロット設定情報とが格納されている。
(2−2.プログラム状態情報)
プログラム状態情報には、プログラム毎に、プログラムを特定するためのIDと、プログラム状態を示すコード及びプログラムの属性ならびにプログラムを起床又は回復させるタイミングを示すコードが格納されている。
The LP
(2-2. Program status information)
The program status information stores, for each program, an ID for identifying the program, a code indicating the program status, a program attribute, and a code indicating the timing to wake up or recover the program.
プログラム状態を示すコードとしては、waiting、suspended-waiting、ready、suspended- ready、running、nonexistentの6つがある。waitingコードは、現在、プログラムの実行時間を放棄しており、かつ、次回プログラム実行時に通常のタイムスロットのプログラム実行時間枠でプログラム実行することを示し、また、suspended-waitingコードは、現在、プログラムの実行時間を放棄しており、かつ、放棄して使用されなかった時間(最大1スロット分)を次回プログラム実行時におけるプログラム実行時間とすることを示す。
There are six codes indicating the program state: waiting, suspended-waiting, ready, suspended-ready, running, and nonexistent. The waiting code indicates that the execution time of the program is currently abandoned and the program is executed in the program execution time frame of the normal time slot at the next program execution, and the suspended-waiting code is currently It is shown that the execution time of the program is abandoned, and the time (
readyコードは、現在、プログラムが実行可能な状態であることを示し、suspended- readyコードは、suspended-waitingコードであったプログラムが、現在、プログラムが実行可能な状態であることを示す。
また、プログラム実行時間が放棄されたことにより、waitingコード、suspended-waitingコード及びsuspended- readyコードの状態に遷移した場合には、これらコードに、前記放棄が生じた時点において割り当て先となっていたタイムスロットのTS_IDの値が付されている。
The ready code indicates that the program is currently executable, and the suspended-ready code indicates that the program that has been the suspended-waiting code is currently executable.
In addition, when the program execution time is abandoned, when the state transits to a waiting code, a suspended-waiting code, and a suspended-ready code, these codes were assigned to when the abandonment occurred. The value of TS_ID of the time slot is attached.
なお、このTS_IDの値は、実行されるまでクリアされないため、 readyコード及びsuspended-readyコードにも付されている場合がある。runningコードは、現在、プログラムが実行可能な状態であり、かつ、実行中であることを示す。nonexistentコードは、現在、プログラムがスケジューリングの対象範囲外にあることを示す。
ここでスケジューリングの対象範囲外とは、現時点において、候補プログラムにさえなり得ないプログラムの状態を意味する。ちなみに、候補プログラムであって、waiting又はsuspended-waitingの状態となっているものを、候補スケジューリングの対象外ということとする。なお、先に述べたプログラムの回復とは、「TD」属性のプログラムが、waitingの状態からreadyになったこと、あるいは、「TD」属性のプログラムがsuspended-waitingの状態から上述したタイミング「e」で、suspended-readyになったことを意味する。
Since the value of TS_ID is not cleared until it is executed, it may be added to the ready code and the suspended-ready code. The running code indicates that the program is currently in an executable state and is being executed. The nonexistent code indicates that the program is currently outside the scheduling target range.
Here, “outside the scope of scheduling” means a state of a program that cannot be a candidate program at the present time. Incidentally, a candidate program that is in a waiting or suspended-waiting state is excluded from candidate scheduling. Note that the program recovery described above means that the program with the “TD” attribute has changed from the waiting state to the ready state, or that the program with the “TD” attribute has the timing “e” described above from the suspended-waiting state. ”Means suspended-ready.
また、プログラムの起床とは、「TD」属性のプログラムが、suspended-waitingの状態から上述したタイミング「n」で、suspended-readyになったこと、あるいは、「ED」属性のプログラムが、waiting又はsuspended-waitingの状態からそれぞれready又はsuspended-readyの状態となったことを意味する。なお、このようなプログラムを起床又は回復させるタイミングを総称して、本実施例では、先に述べたように単に起床タイミングと呼んでいる。 The wake-up of the program means that the program with the “TD” attribute is suspended-ready at the timing “n” described above from the suspended-waiting state, or the program with the “ED” attribute is waiting or It means that it has changed from the suspended-waiting state to the ready or suspended-ready state, respectively. It should be noted that the timing for waking up or recovering such a program is generically called a wake-up timing in this embodiment as described above.
プログラムの属性を示すコードには、イベントが発生すると候補スケジューリングの対象範囲内となりイベントドリブンスケジューリングにて、タイムドリブンスケジューリングで決定される所定の順番に関係なく、タイムスロットに割り付けられて実行されるイベントドリブン型のプログラムであることを示すコード「ED」と、イベントが発生すると、候補スケジューリングの対象範囲内となるが、タイムドリブンスケジューリングにより所定の順番まで待ってからタイムスロットに割り付けられて実行されるプログラム、即ち、タイムドリブン型のプログラムであることを示すコード「TD」がある。 When the event occurs, the code indicating the attribute of the program falls within the scope of the candidate scheduling, and the event that is assigned to the time slot and executed in the event-driven scheduling regardless of the predetermined order determined by the time-driven scheduling When an event occurs with the code “ED” indicating that it is a driven type program, it will fall within the candidate scheduling target range, but it will be assigned to a time slot and executed after waiting for a predetermined order by time-driven scheduling There is a code “TD” indicating that the program is a time-driven program.
つまり、ED属性のプログラムは、waiting又はsuspended‐waitingの状態からそれぞれready又はsuspended‐readyに移行し、イベントドリブンスケジューリングによりタイムスロットに割り付けられ、一方、TD属性のプログラムはwaitingからreadyに遷移し、タイムドリブンスケジューリングにより、タイムスロットに割り付けられる。
ただし、例外として、タイムドリブン型のプログラムであっても、イベントが発生すると候補スケジューリングの対象範囲内となり、イベントドリブンスケジューリングにて、タイムドリブンスケジューリングで決定される所定の順番に関係なくタイムスロットに割り付けられ実行される場合がある。つまり、この例外とは、タイムドリブン型のプログラムがsuspended‐waitingの状態からsuspended‐readyに遷移し、イベントドリブンスケジューリングにより、タイムスロットに割り付けられる場合である。
That is, an ED attribute program transitions from a waiting or suspended-waiting state to ready or suspended-ready, respectively, and is assigned to a time slot by event-driven scheduling, while a TD attribute program transitions from waiting to ready, Assigned to time slots by time-driven scheduling.
However, as an exception, even for time-driven programs, if an event occurs, it is within the scope of candidate scheduling, and in event-driven scheduling, it is assigned to a time slot regardless of the predetermined order determined by time-driven scheduling. May be executed. That is, this exception is a case where a time-driven program transitions from a suspended-waiting state to a suspended-ready and is allocated to a time slot by event-driven scheduling.
起床タイミングを示すコードには、既にスタンバイレジスタ群への格納が完了したコンテキストを消去してまでも、カウント値0信号を受け取るまで待つことなく緊急的にプログラムを実行する必要があることを示すコード「e」、及び、スタンバイレジスタ群から退避処理が完了した後、スタンバイレジスタ群への格納が完了し、カウント値0信号を受け取ってからプログラムを実行することを示すコード「n」がある。
The code indicating the wake-up timing is a code indicating that it is necessary to execute the program urgently without waiting until the
設定フラグレジスタ421には、プログラム毎に用意された設定フラグ群が格納されている。この設定フラグ群は、各プログラムが許容する割込みやイベントの内容を特定するためのものであり、プログラム毎に用意されている以外は、第1の実施形態において述べた設定フラグ群と同様であるため、ここでは詳細な説明を省略する。
リクエスト検出部419には、図15に示すように、プログラム毎に用意されたLP固有フラグ群及び1つの共通フラグ群が格納されている。LP固有フラグ群とは、固有割込みに関する情報であり、現在、どのプログラムに対してどのような固有割込みの実行要求が発生しているのかを示す。このLP固有フラグ群は、見かけ上プログラム毎に存在するが、その実態は1つのビット列データであって、各フラグは、割込みを許容するプログラム及び固有割込みの内容に対応するビット位置に存在している。
The setting
As shown in FIG. 15, the
つまり、或るプログラムにおいてその内容の割込みを許容する場合には、そのプログラム及び割込みの内容に対応するビット位置に存在するLP固有フラグの値(デフォルト値は0)が1となっている。そのデータ構成については、第1の実施形態において述べた完了通知フラグと同様であるため、ここでは詳細な説明を省略する。
共通フラグ群とは、共通割り込みの実行要求が発生しているか否かを示すフラグの集まりである。ここで、共通割り込みの実行要求とは、どのプログラムにおいても実行可能なサブルーチンプログラムの実行要求を意味する。共通フラグ群の実態は、1つのビット列データであって、割り込んで実行すべきサブルーチンプログラム固有のビット位置が存在する。
That is, when an interrupt of the contents is permitted in a certain program, the value of the LP specific flag (default value is 0) existing in the bit position corresponding to the contents of the program and the interrupt is 1. Since the data structure is the same as the completion notification flag described in the first embodiment, detailed description thereof is omitted here.
The common flag group is a collection of flags indicating whether or not a common interrupt execution request is generated. Here, the execution request for the common interrupt means an execution request for a subroutine program that can be executed in any program. The actual state of the common flag group is one bit string data, and there is a bit position specific to the subroutine program to be interrupted and executed.
つまり、共通割込み要求が生じているサブルーチンプログラムがある場合に、そのサブルーチンプログラムに対応するビット位置のフラグの値が1(デフォルト値は0)となっている。プロセッサ状態格納部425は、切替禁止フラグの値及び共通割り込みフラグの値を格納している。
切替禁止フラグは、例えば、プログラムの実行中において共有資源へアクセスしており、プログラムを即座に中断することができないなどの理由により、現在レジスタ切り替えを実行できない状況にあることを示し、レジスタ切り替えを実行できない間、1(デフォルト値は0)の値をとる。この切替禁止フラグの値は、実行中のプログラムが発する命令により、書き換えが可能である。
That is, when there is a subroutine program in which a common interrupt request has occurred, the value of the flag at the bit position corresponding to the subroutine program is 1 (the default value is 0). The processor
The switch prohibition flag indicates, for example, that a shared resource is being accessed during program execution, and that it is currently impossible to perform register switch because the program cannot be interrupted immediately. While it cannot be executed, it takes a value of 1 (default value is 0). The value of the switch prohibition flag can be rewritten by an instruction issued by the program being executed.
共通割り込みフラグは、現在、共通割り込みの処理が実行中であることを示し、共通割り込みの処理が実行されている間、1(デフォルト値は0)の値をとる。
(3.動作)
以下、仮想マルチプロセッサ400において、1つのプロセッサにより擬似並行的にプログラムを実行する際、効率的なプログラムの実行を実現する処理について説明する。
The common interrupt flag indicates that a common interrupt process is currently being executed, and takes a value of 1 (default value is 0) while the common interrupt process is being executed.
(3. Operation)
Hereinafter, a process for realizing efficient program execution when a
図17は、仮想マルチプロセッサ400において実施される処理を示すフローチャートである。処理実行部410は、処理制御部411からの指示にもとづいて、プログラムの実行を開始する(ステップS100)。このプログラム実行に並行して、スケジューリング制御部413は、スタンバイレジスタ群に格納されているレジスタ値を対象とする退避処理を実施し(ステップS101)、リクエスト検出部419は、外部I/F417から受け取った外部信号にもとづいて、イベント処理要求が発生しているか否かを判別する(ステップS102)。
FIG. 17 is a flowchart showing processing executed in the
イベント処理要求が発生している場合、リクエスト検出部419は、イベントP_IDをスケジューリング制御部413に出力する。スケジューリング制御部413は、このイベントP_IDにもとづいて、イベントドリブンスケジューリングを実施する(ステップS103)。なお、イベントドリブンスケジューリング実施後に実施される処理の内容は、イベントドリブンスケジューリングの実施結果により異なる。
If an event processing request has occurred, the
イベント処理要求が発生していない場合、スケジューリング制御部413は、目的TSをネクストTSとし(ステップS104)、タイムドリブンスケジューリングを実施し(ステップS105)、さらに、復帰処理を実施する(ステップS106)。そして、リクエスト検出部419は、割込み処理要求が発生しているか否かを判別し(ステップS107)、割込み処理要求が発生している場合、割込みの種別に応じて、固有P_ID、固有SP_ID及び共通SP_IDなどをスケジューリング制御部413に出力する。
When an event processing request has not occurred, the
これらIDを受け取ったとき、スケジューリング制御部413は、割込み処理を実行する(ステップS108)。一方、割込み処理要求が発生していない場合、スケジューリング制御部413は、ウエイトコード及びキャッシュミス信号にもとづいて、プログラム実行時間の放棄又はキャッシュミスが発生しているか否かを判断し(ステップS109)、これらが発生している場合には、放棄スケジューリングを実施する(ステップS110)。
When receiving these IDs, the
なお、放棄スケジューリング実施後に実施される処理の内容は、放棄スケジューリングの実施結果により異なる。一方、プログラム実行時間の放棄又はキャッシュミスが発生していない場合、スケジューリング制御部413は、カウント値0信号をサイクルカウンタ416から受け取ったとき、処理実行部410におけるプログラム実行を終了させ(ステップS111)、レジスタ切り替え処理を実施した後(ステップS112)、処理実行部410によるプログラム実行を開始するステップS100に戻る。
Note that the content of the processing performed after the abandonment scheduling is performed differs depending on the execution result of the abandonment scheduling. On the other hand, if the abandonment of the program execution time or the cache miss has not occurred, the
図18は、スケジューリング制御部413により実施されるタイムドリブンスケジューリングの内容を示すフローチャートである。まず、目的TSをネクストTSとした場合の動作を説明する。スケジューリング制御部413は、図18(A)のステップS104の処理に引き続き、目的タイムスロット検索処理を実施する(ステップS120)。
より具体的には、スケジューリング制御部413は、時間割付情報格納レジスタ402内のネクストアドレスに格納されているタイムスロット情報を参照し、タイムスロットを特定するTS_IDによりネクストTSを特定し、さらに、このタイムスロットに割り当てられている基本サイクルの値を取得する。そして、スケジューリング制御部413は、目的TS割り当てプログラム検索処理を実施する(ステップS121)。
FIG. 18 is a flowchart showing the contents of time-driven scheduling performed by the
More specifically, the
より具体的には、スケジューリング制御部413は、ネクストTSに対応づけられているLP情報を参照し、このLP情報が示す候補プログラムを特定し、さらに、これらプログラムそれぞれに対応づけられている優先度を把握する。そして、スケジューリング制御部413は、優先度&モード情報検索処理を実施する(ステップS122)。
より具体的には、スケジューリング制御部413は、ネクストTSに対応づけられている優先度&モード情報を参照し、優先度として0から3のいずれが示されているのか、さらに、モードとしてIndexモード及びLevelモードのいずれが示されているのかを把握する。
More specifically, the
More specifically, the
また、スケジューリング制御部413は、アイドルオプション情報検索処理を実施する(ステップS123)。
より具体的には、スケジューリング制御部413は、ネクストTSに対応づけられているアイドルオプション情報を参照し、「SWITCH」及び「MICRO-SLEEP」のいずれが示されているのかを判別する。つづいて、スケジューリング制御部413は、スケジューリング処理を実施する(ステップS124)。
Also, the
More specifically, the
より具体的には、スケジューリング制御部413は、目的タイムスロット検索処理により得られたネクストTSに対応づけられている4つのプログラムを特定し、目的TS割り当てプログラム検索処理により、これらプログラムそれぞれに対応づけられている優先度を把握する。そして、スケジューリング制御部413は、優先度&モード情報検索処理により得られた、優先度及びモードにもとづいて、上記4つのプログラムから候補プログラムを選出する。
More specifically, the
さらに、スケジューリング制御部413は、LP状態格納レジスタ424内の各候補プログラムに対応するプログラム状態情報を参照し、各候補プログラムがそれぞれ実行可能であるか否かを検出し、候補プログラムから有効候補プログラムを選出する。このとき、有効候補プログラムが複数ある場合、優先度の値が最も小さな値が対応づけられている有効候補プログラムをこのネクストTSへの割り付け対象とする。
Further, the
また、有効候補プログラムが1つも存在しない場合には、スケジューリング制御部413は、アイドルオプション情報検索処理を実施することにより得られる情報の内容にもとづいて、その後の処理の内容を決定する。即ち、上述の情報の内容が、「MICRO-SLEEP」を示す場合、スケジューリング制御部413は、いずれのプログラムも上述のネクストTSへの割り当て対象としない。
If there is no valid candidate program, the
この場合、スケジューリング制御部413は、このネクストTSが実行対象となっている期間、処理実行部410にNOP実行させる共に、クロックマスク部427に処理実行部410へのクロックパルスの供給を遮断させる。
また、上述の情報の内容が、「SWITCH」を示す場合、スケジューリング制御部413は、ネクストアドレスの値に1を加えた値(ただし、ネクストアドレスが終端アドレスであった場合に限り、先頭アドレスの値)を新たなネクストアドレスとし、ステップS120からS124のスケジューリング処理を繰り返し実施する。
In this case, the
When the content of the above information indicates “SWITCH”, the
以上の処理が終了したとき、割込み処理要求が発生しているか否かを判別する上述のステップS106へと移行する。なお、目的TSをカレントTSとする場合の動作については、後述する。図19は、スケジューリング制御部413により実施されるイベントドリブンスケジューリングの内容を示すフローチャートである。
スケジューリング制御部413は、リクエスト検出部419から受け取ったイベントP−IDによりプログラムを特定する。
When the above processing ends, the process proceeds to step S106 described above for determining whether or not an interrupt processing request has occurred. The operation when the target TS is the current TS will be described later. FIG. 19 is a flowchart showing the contents of event-driven scheduling performed by the
The
また、スケジューリング制御部413は、実行中のプログラムがイベントドリブンスケジューリングにより緊急レジスタ切り替えすることで中断させられるとき、中断させられるこのプログラムを特定する(ステップS130)。
さらに、スケジューリング制御部413は、LP状態格納レジスタ424を参照し、このプログラムの属性、状態、起床タイミングを判別する。そして、スケジューリング制御部413は、以下に示す(1)から(3)のいずれかに該当しているか否かを判断する(ステップS131)。
(1)プログラムの属性がEDである。
(2)プログラムの属性がTDであって、プログラム状態がsuspended‐waitingであり、かつ、起床タイミングが「n」である。
(3)running状態であったプログラムがイベントドリブンスケジューリングにより緊急レジスタ切り替えされた。
In addition, when the program being executed is interrupted by switching the emergency register by event-driven scheduling, the
Further, the
(1) The attribute of the program is ED.
(2) The attribute of the program is TD, the program state is suspended-waiting, and the wake-up timing is “n”.
(3) The emergency register was switched by the event-driven scheduling for the program that was in the running state.
この判定の結果、該当しなかった場合、つまり、「いいえ」のとき、スケジューリング制御部413は、LP状態格納レジスタ424を参照し、このプログラムの起床タイミングが「e」であるか否かを判別し(ステップS132)、「e」でない場合、即ち、「n」である場合、回復イベント処理を実施する。より具体的には、スケジューリング制御部413は、LP状態格納レジスタ424に示されているこのプログラムの状態がwaitingであればreadyに変更する。
If the result of this determination is not applicable, that is, “No”, the
この後、タイムドリブンスケジューリングを実施する上述のステップS104へと移行する。
また、ステップS132における判別結果が、「e」である場合、スケジューリング制御部413は、先に述べた緊急回復イベント処理を実施し(ステップS134)、先に述べた緊急復帰処理を実施し(ステップS135)、さらに、先に述べた緊急レジスタ切り替え処理を実施した後(ステップS136)、上述のステップS100へと移行させる。
Thereafter, the process proceeds to step S104 described above in which time-driven scheduling is performed.
When the determination result in step S132 is “e”, the
また、上述のステップS131において、判定の結果、該当した場合、即ち、「はい」の場合、スケジューリング制御部413は、LP状態格納レジスタ424を参照し、このプログラムの起床タイミングが「e」であるか否かを判別し(ステップS137)、「e」でない場合、即ち、「n」である場合、先に述べたイベント起床処理を実施し(ステップS141)、先に述べた早期復帰処理を実施し(ステップS142)、上述のステップS107へと移行させる。
Further, in the above-described step S131, if the result of determination is applicable, that is, if “Yes”, the
また、上述のステップS137における判別において、起床タイミングが「e」である場合、スケジューリング制御部413は、先に述べた緊急イベント起床処理を実施し(ステップS138)、先に述べた緊急復帰処理を実施し(ステップS139)、さらに、先に述べた緊急レジスタ切り替え処理を実施した後(ステップS140)、上述のステップS100へと移行させる。
In the determination in step S137, when the wake-up timing is “e”, the
図20は、上述のステップS108において実施される割込み処理の内容を示すフローチャートである。スケジューリング制御部413は、リクエスト検出部419から受け取る固有P_ID、固有SP_ID及び共通SP_IDにもとづいて、共通割込み処理の要求が発生しているか否かを判別する(ステップS150)。
共通割込み処理の要求が発生している場合、即ち、リクエスト検出部419から共通SP_IDを受け取った場合、スケジューリング制御部413は、この共通SP_IDにより特定されるサブルーチンプログラムが実行されている間、サイクルカウンタ416におけるカウントダウンを中断させる(ステップS151〜ステップS152)一方、共通割込み処理の要求が発生しておらず、固有割込み処理の要求が発生している場合、つまり、リクエスト検出部419から固有P_ID及び固有SP_IDを受け取った場合、スケジューリング制御部413は、この固有SP_IDにより特定されるサブルーチンプログラムが実行されている間、サイクルカウンタ416におけるカウントダウンについては特に何もしない(ステップS153〜ステップS154)。
FIG. 20 is a flowchart showing the contents of the interrupt process performed in step S108 described above. The
When a request for common interrupt processing occurs, that is, when a common SP_ID is received from the
以上の処理が実行された後、上述のステップS109へと移行する。図21は、上述のステップS110において実施される放棄スケジューリングの内容を示すフローチャートである。スケジューリング制御部413は、DMA管理部418からキャッシュミス信号を受け取ったか否かを判別し(ステップS160)、キャッシュミス信号を受け取っている場合、実行中のプログラムのプログラム状態をsuspended-waitingに変更し(ステップS161)、先に述べたタイムオプション情報検索処理を実施する(ステップS162)。
After the above processing is executed, the process proceeds to step S109 described above. FIG. 21 is a flowchart showing the contents of abandonment scheduling performed in step S110 described above. The
また、キャッシュミス信号を受け取っていない場合、スケジューリング制御部413は、さらに、「vmp_sus」コードを受け取っているか否かを判別し(ステップS163)、「vmp_sus」コードを受け取っている場合、実行中のプログラムのプログラム状態をsuspended-waitingに変更し(ステップS161)、先に述べたタイムオプション情報検索処理を実施する(ステップS162)。
If the cache miss signal has not been received, the
上述のステップS163における判別において、「vmp_sus」コードを受け取っていない場合、必然的に「vmp_wait」コードを受け取っているので、スケジューリング制御部413は、実行中のプログラムのプログラム状態をwaitingに変更し(ステップS166)、先に述べたタイムオプション情報検索処理を実施する(ステップS162)。
スケジューリング制御部413は、このタイムオプション情報検索処理を実行することにより、タイムオプション情報の内容を認識する。そして、スケジューリング制御部413は、タイムオプション情報の内容が「MICRO-SLEEP」を示すか否かを判別し、(ステップS165)タイムオプション情報の内容が「MICRO-SLEEP」である場合、処理制御部411を介して処理実行部410にnop実行させ(ステップS166)、上述のステップS102へと移行させる。
In the determination in step S163 described above, if the “vmp_sus” code is not received, the “vmp_wait” code is inevitably received, so the
The
また、タイムオプション情報の内容が「MICRO-SLEEP」でない場合、スケジューリング制御部413は、さらに、タイムオプション情報の内容が「TS_SWITCH」を示すか否かを判別し、「TS_SWITCH」を示す場合、緊急レジスタ切り替え処理を実施し(ステップS168)、上述のステップS100へと移行させる。
また、タイムオプション情報の内容が「TS_SWITCH」を示していない場合、タイムオプション情報の内容は、必然的に「LP_SWITCH」となるので、スケジューリング制御部413は、ここでは、目的TSをカレントTSとし(ステップS169)、先に述べたタイムドリブンスケジューリングを実施する(ステップS170)。
When the content of the time option information is not “MICRO-SLEEP”, the
Further, when the content of the time option information does not indicate “TS_SWITCH”, the content of the time option information inevitably becomes “LP_SWITCH”, and therefore the
ここで、ステップS170において実施するタイムドリブンスケジューリングの内容について、ステップS105において実施するタイムドリブンスケジューリングの内容との相違点を挙げつつ説明する。上記2つのタイムドリブンスケジューリングの内容について、以下の2つの違いがある。
即ち、ステップS170において実施するタイムドリブンスケジューリングでは、目的TSがネクストTSではなくカレントTSであるという点と、スケジューリング処理を実施した結果、有効候補プログラムが存在しないときにアイドルオプション情報とは無関係にNOP実行へと移行するという点である。より具体的には、図18(B)ステップS169の処理にひき続き、スケジューリング制御部413は、目的タイムスロット検索処理を実施する(ステップS120)。
Here, the contents of the time-driven scheduling performed in step S170 will be described with the difference from the contents of the time-driven scheduling performed in step S105. There are the following two differences in the contents of the above two time-driven scheduling.
That is, in the time-driven scheduling performed in step S170, the target TS is the current TS, not the next TS, and the result of the scheduling process is that the NOP is independent of the idle option information when there is no valid candidate program. The point is to move to execution. More specifically, following the process of step S169 in FIG. 18B, the
つまり、スケジューリング制御部413は、時間割付情報格納レジスタ402内のカレントアドレスに格納されているタイムスロット情報を参照し、タイムスロットを特定するTS−IDによりカレントTSを特定し、さらに、このタイムスロットに割り当てられている基本サイクルの値を取得する。そして、スケジューリング制御部413は、目的TS割り当てプログラム検索処理を実施し(ステップS121)、優先度&モード情報検索処理を実施する(ステップS122)。
That is, the
つづいて、スケジューリング制御部413は、アイドルオプション情報検索処理を実施し(ステップS123)、スケジューリング処理を実施する(ステップS124)。より具体的には、スケジューリング制御部413は、目的タイムスロット検索処理により得られたカレントTSに対応付けられている4つのプログラムを特定し、目的TS割り当てプログラム検索処理により、これらプログラムそれぞれに対応づけられている優先度を把握する。
Subsequently, the
そして、スケジューリング制御部413は、優先度&モード情報検索処理により得られた、優先度及びモードにもとづいて、上記4つのプログラムから候補プログラムを選出する。さらに、スケジューリング制御部413は、LP状態格納レジスタ424内の各候補プログラムに対応するプログラム状態情報を参照し、各候補プログラムがそれぞれ実行可能であるか否かを検出し、候補プログラムから有効候補プログラムを選出する。
Then, the
このとき、有効候補プログラムが複数ある場合、優先度の値が最も小さな値が対応付けられている有効候補プログラムをこのカレントTSへの割り付け対象とする。もし、有効候補プログラムが1つも存在しない場合には、取得したアイドルオプションに関わりなく有効候補プログラムが存在しないことを記憶する。
以上の処理が、目的TSをカレントTSとするステップS170におけるタイムドリブンスケジューリングである。このようなタイムドリブンスケジューリングを実行した後、スケジューリング制御部413は、有効候補プログラムがあるか否かを判断する(ステップS171)。
At this time, when there are a plurality of valid candidate programs, the valid candidate program associated with the smallest priority value is set as the allocation target to the current TS. If no valid candidate program exists, it is stored that there is no valid candidate program regardless of the acquired idle option.
The above processing is the time-driven scheduling in step S170 in which the target TS is the current TS. After executing such time-driven scheduling, the
有効候補プログラムがない場合、スケジューリング制御部413は、処理制御部411を介して処理実行部410にnop実行させると共に(ステップS166)、nop実行させている間、クロックマスク部427に処理実行部410へのクロック供給を遮断するように指示し、上述のステップS102へと移行させる。
この指示の結果、処理実行部410へのクロックの供給は、遮断される。一方、有効候補プログラムがある場合、復帰処理を実施し(ステップS172)、緊急レジスタ切り替え処理を実施して(ステップS168)、上述のステップS100へと移行させる。
(4.プロセッサ駆動時におけるプログラム実行状況)以下、仮想マルチプロセッサ400の駆動時におけるプログラム実行状況について説明する。
(4−1.基本的なプログラム実行状態)
仮想マルチプロセッサ400では、先に述べたように、複数のタイムスロット及び各タイムスロットに割り当てられたプログラムにもとづいてプログラム実行される。
If there is no valid candidate program, the
As a result of this instruction, the supply of the clock to the
(4. Program Execution Status when Processor is Driven) The program execution status when the
(4-1. Basic program execution state)
The
図22は、このタイムスロットについて説明する図である。以下、便宜上、各タイムスロットを、TSn(nは、0から15までの整数)と記し、このnの値は、タイムスロット毎に固有であるものとする。設定上16個のタイムスロット用意されており、このうち4つのタイムスロット(TS0〜TS3)が通常のスケジューリングに用いられるタイムドリブン型のタイムスロットである。 FIG. 22 is a diagram for explaining this time slot. Hereinafter, for convenience, each time slot is denoted as TSn (n is an integer from 0 to 15), and the value of n is unique to each time slot. Sixteen time slots are prepared for setting, and four of these time slots (TS0 to TS3) are time-driven time slots used for normal scheduling.
つまり、TS0からTS3までの各タイムスロットに割り当てられている1つのプログラムが順次実行され、TS3のタイムスロットに割り当てられているプログラムの実行が終了すると、また、TS0のタイムスロットに割り当てられているプログラムから実行されることとなる。TS0からTS2までのタイムスロットは、映像や音声などを対象とするリアルタイムでの処理を前提とするプログラム実行用のタイムスロットである。 That is, one program assigned to each time slot from TS0 to TS3 is sequentially executed, and when the execution of the program assigned to the time slot of TS3 is completed, the program is assigned to the time slot of TS0. It will be executed from the program. The time slots from TS0 to TS2 are program execution time slots that are premised on real-time processing for video and audio.
また、TS3(TS_ID=3)は、リアルタイムでの処理を前提としないプログラム実行用のタイムスロットである。その他のタイムスロット(TS4〜TS15)は、イベントが発生したときに起床するイベントドリブン型のタイムスロットである。図22(a)に示すように、各タイムスロットは、基本サイクルの値が対応づけられており、この基本サイクルの値に相当する時間が、プログラム実行時間枠となる。 TS3 (TS_ID = 3) is a time slot for program execution that does not assume real-time processing. Other time slots (TS4 to TS15) are event-driven time slots that wake up when an event occurs. As shown in FIG. 22A, each time slot is associated with a basic cycle value, and a time corresponding to the basic cycle value is a program execution time frame.
図22(b)に示すように、切り替えのタイミングをタイムスロットの基本サイクルと厳密に一致させることはできず、通常、数サイクル程度オーバーして切り替わる。仮想マルチプロセッサ400では、先に述べた基本サイクル調整処理を実施することにより、TS0からTS3までのタイムスロットにおいて、実行時間枠からオーバーした時間をTS3のタイムスロットの実行時間枠から差し引き、実行時間に破綻を来たさないようにする。
As shown in FIG. 22 (b), the switching timing cannot be made exactly the same as the basic cycle of the time slot, and the switching is usually over several cycles. In the
また、仮想マルチプロセッサ400では、実行予定のプログラムに割り当てられているプログラム実行時間が放棄されている場合、効率的なプログラム実行又は省電力化を図るための措置の内容を決定するものとして、タイムオプション情報及びアイドルオプション情報の2つの情報がある。
(4−2.放棄時におけるタイムオプション情報にもとづくプログラム実行状態)タイムオプション情報とは、先に述べたように、プログラム実行中にこのプログラムが実行不可能となり、このプログラムの実行時間が放棄された以後のプログラム実行の内容を決定するタイムスロットについての情報である。
Further, in the
(4-2. Program execution state based on time option information when abandoned) As described above, the time option information indicates that this program cannot be executed during program execution, and the execution time of this program is abandoned. This is information about a time slot that determines the contents of program execution thereafter.
図23は、プログラム実行時間が放棄された場合のタイムオプション情報にもとづくプログラム実行状態、即ち、タイムオプション情報検索処理によるプログラム実行状態について説明する図である。以下、便宜上、各プログラムを、LPm(mは、0から31までの整数)と記し、このmの値は、プログラム毎に固有であるものとする。
図23(a)に示すように、タイムドリブン型のタイムスロットであるTS0、TS1、TS2及びTS3において、有効な候補プログラムがある場合、各タイムスロットの実行時間枠内で順次プログラムが実行される。ここで、TS0にはLP0が、TS1にはLP1が、TS2にはLP2が、TS3にはLP3がそれぞれ割り当てられている。
FIG. 23 is a diagram for explaining a program execution state based on time option information when the program execution time is abandoned, that is, a program execution state by time option information search processing. Hereinafter, for convenience, each program is referred to as LPm (m is an integer from 0 to 31), and the value of m is specific to each program.
As shown in FIG. 23A, when there are valid candidate programs in the time-driven time slots TS0, TS1, TS2, and TS3, the programs are sequentially executed within the execution time frame of each time slot. . Here, LP0 is assigned to TS0, LP1 is assigned to TS1, LP2 is assigned to TS2, and LP3 is assigned to TS3.
図23(b)に示すように、TS1の実行時間枠においてLP1の実行中に、処理実行部410による「vmp_wait」コード出力をトリガとして、プログラム実行時間の放棄が行なわれ、かつ、このTS1のタイムオプション情報が「LP_SWITCH」を示す場合には、先に述べた各機能部における処理が実行されることにより、以下のようにプログラム実行される。
As shown in FIG. 23B, during execution of LP1 in the execution time frame of TS1, the program execution time is abandoned by using the “vmp_wait” code output by the
即ち、このTS1の実行時間枠を使いきるまで、LP1に代わって、同じTS1に対応づけられ実行可能な状態となっている有効候補プログラムであって、最も優先度が高い候補プログラムであるLP4が実行される。このとき、スタンバイレジスタ群に格納されていたLP2に対応するコンテキストのレジスタ値は一旦破棄され、LP4に対応するコンテキストのレジスタ値が格納される。 That is, LP4, which is an effective candidate program that is associated with the same TS1 and can be executed, is the highest priority candidate program, instead of LP1, until the execution time frame of TS1 is used up. Executed. At this time, the register value of the context corresponding to LP2 stored in the standby register group is once discarded, and the register value of the context corresponding to LP4 is stored.
このような破棄やLP4の復帰を行い、LP4の実行が開始されるまでにt2の時間を要する。通常、このt2は、サイクルカウンタ416によるパルス出力のおよそ30サイクル分に相当する時間である。ところで、TS1に有効候補プログラムが1つもないとき、もはやこのタイムスロットにおいてのプログラム実行は不可能となり、このような場合、スケジューリング制御部413は、後述のTS1のタイムオプション情報が「MICRO-SLEEP」を示す場合におけるプログラム実行と同様のプログラム実行を行うように制御するものとする。
It takes time t2 to perform such destruction and return of LP4 and start execution of LP4. Normally, t2 is a time corresponding to approximately 30 cycles of pulse output by the cycle counter 416. By the way, when there is no valid candidate program in TS1, it is no longer possible to execute the program in this time slot. In such a case, the
なお、有効候補プログラムが1つもないために、実行対象範囲外となったTS1のようなタイムスロットをスリーピングタイムスロットという。上述のプログラム実行時間の放棄が行なわれ、かつ、このTS1のタイムオプション情報が「TS_SWITCH」を示す場合には、以下のようにプログラム実行される。
即ち、図23(c)に示すように、速やかにレジスタ切り替えが行われ、次のTS2に割り当てられているLP2が繰り上げられて実行される。このとき、スタンバイレジスタ群には、既に、LP2が格納されているため、LP2が速やかに実行される。
Since there is no valid candidate program, a time slot such as TS1 that is out of the execution target range is called a sleeping time slot. When the above program execution time is abandoned and the time option information of this TS1 indicates “TS_SWITCH”, the program is executed as follows.
That is, as shown in FIG. 23C, register switching is performed quickly, and LP2 assigned to the next TS2 is moved up and executed. At this time, since LP2 is already stored in the standby register group, LP2 is executed promptly.
また、上述のプログラム実行時間の放棄が行なわれ、かつ、このTS1のタイムオプション情報が「MICRO-SLEEP」を示す場合には、図23(d)に示すように、このTS1の実行時間枠を使いきるまで、本来実行するプログラムとは無関係な意味のないプログラムの実行、即ち、nop実行される。
なお、上述のnop実行されている間、処理実行部410へのクロックの出力が遮断され、その結果、駆動電力が低減される。
(4−3.放棄時におけるアイドルオプション情報にもとづくプログラム実行状態)アイドルオプション情報とは、先に述べたように、あるタイムスロットにおいて有効な候補プログラムが1つも存在しない場合におけるプログラム実行の内容を決定するタイムスロットについての情報である。
When the above program execution time is abandoned and the time option information of this TS1 indicates “MICRO-SLEEP”, the execution time frame of this TS1 is set as shown in FIG. Until it is used up, execution of a program having no meaning unrelated to the program that is originally executed, that is, nop execution is performed.
In addition, while the above-mentioned nop is being executed, the output of the clock to the
(4-3. Program Execution State Based on Idle Option Information at Abandonment) As described above, the idle option information is the contents of program execution when there is no valid candidate program in a certain time slot. Information about the time slot to be determined.
図24(a)、(b)、(c)は、タイムドリブン型のタイムスロットにおいて、有効な候補プログラムが1つもない場合のアイドルオプション情報にもとづくプログラム実行の状況を説明する図である。図24(a)は、タイムドリブン型の各タイムスロットにおいて、有効な候補プログラムが少なくとも1つある場合のプログラム実行状況を示す。
このような状況を前提とし、以下、TS1において、有効な候補プログラムが1つも存在しないこととなった場合のプログラム実行について説明する。TS1において、有効な候補プログラムが1つも存在せず、かつ、このTS1のアイドルオプション情報が「SWITCH」を示す場合には、先に述べた各機能部における処理が実行されることにより、図24(b)に示すように、TS1に代わり、TS2に割り当てられているLP2が実行される。
FIGS. 24A, 24B, and 24C are diagrams for explaining the state of program execution based on idle option information when there is no valid candidate program in the time-driven time slot. FIG. 24A shows a program execution situation when there is at least one effective candidate program in each time-driven time slot.
Based on such a situation, the following describes the program execution when there is no valid candidate program in TS1. When there is no valid candidate program in TS1 and the idle option information of TS1 indicates “SWITCH”, the processing in each functional unit described above is executed, so that FIG. As shown in (b), LP2 assigned to TS2 is executed instead of TS1.
また、TS1において、有効な候補プログラムが1つも存在せず、かつ、このTS1のアイドルオプション情報が「MICRO-SLEEP」を示す場合には、図24(c)に示すように、このTS1の実行時間枠を使いきるまでnop実行される。なお、上述のnop実行されている間、処理実行部410、即ち、CPUへのクロックパルスの出力が遮断され、その結果、駆動電力が低減される。
(4−4.ウエイト状態解消時におけるプログラム実行状態)vmp_susコード出力をトリガとして、実行中であったプログラムは実行不可能な中断状態(suspended‐waiting)となる。
If there is no valid candidate program in TS1 and the idle option information of TS1 indicates “MICRO-SLEEP”, execution of TS1 is executed as shown in FIG. Nop is executed until the time frame is used up. In addition, while the above-mentioned nop is being executed, the output of the clock pulse to the
(4-4. Program Execution State when Wait State is Cleared) The program being executed becomes suspended-waiting (suspended-waiting) triggered by vmp_sus code output.
また、緊急レジスタ切り替えをともなって他のプログラムにより中断されたときに、実行中であったプログラムは実行可能な中断状態(suspended‐ready)となる。これらのプログラムが実行中に割り付けられていたタイムスロットを中断タイムスロットといい、上述したとおりプログラムのP_IDがTS_IDに関連付けられて記憶されている。
上述の実行不可能な中断状態となったプログラムは、ウエイト状態が解消したときに有効候補プログラムとなる。
In addition, when the program is interrupted by another program with the emergency register switching, the program being executed becomes an executable suspended state (suspended-ready). A time slot assigned during execution of these programs is called an interrupt time slot, and the P_ID of the program is stored in association with TS_ID as described above.
The above-described suspended program that cannot be executed becomes a valid candidate program when the wait state is resolved.
また、他のプログラムにより中断させられたプログラムは、実行可能な中断状態となったときに有効候補プログラムとなる。以下、一旦中断させられたプログラムが有効候補プログラムとなり、中断タイムスロットに割り付けられてタイムスロットの途中から実行を再開する状況について説明する。
図25(a)、(b)は、このような状況におけるプログラムの実行状況を説明する図である。図25(a)は、TS0からTS3の4つのタイムスロットのうち、既にTS3が、中断タイムスロットとなっており、処理実行部410からの「vmp_sus」コード出力をトリガとして、TS0に割り当てられているLP0が有効でなくなり、新たにTS0が中断タイムスロットとなった場合のプログラムの実行状況を示す。
A program interrupted by another program becomes a valid candidate program when it becomes an executable interrupted state. Hereinafter, a situation will be described in which a program that has been interrupted becomes a valid candidate program and is assigned to an interrupt time slot and execution is resumed from the middle of the time slot.
FIGS. 25A and 25B are diagrams for explaining the execution status of the program in such a situation. FIG. 25A shows that among the four time slots from TS0 to TS3, TS3 is already a suspended time slot, and is assigned to TS0 using the “vmp_sus” code output from the
このとき、TS0においては、設定されている実行時間枠に相当する時間t3が使いきられていない。「vmp_sus」コードを受け取った場合、スケジューリング制御部413は、LP0のプログラム状態をsuspended-waitingに更新し、実行時間枠内において使われずに残った時間t4を実カウント値としてコンテキスト内に保存する。
そして、図25(a)に示すように、TS1及びTS2のみが繰り返し実行対象となる。図25(b)は、中断タイムスロットとなったTS0に割り当てられているLP0にウエイト状態の解消、つまり、実行不可能な中断状態(suspended-waiting)の解消が生じ、かつ、LP状態格納レジスタ424においてLP0の起床タイミングが「n」、即ち通常に起床させる旨を示す場合におけるプログラムの実行状況を示す。
At this time, in TS0, the time t3 corresponding to the set execution time frame is not used up. When the “vmp_sus” code is received, the
Then, as shown in FIG. 25A, only TS1 and TS2 are repeatedly executed. FIG. 25 (b) shows that a wait state is resolved in LP0 assigned to TS0 that has become a suspended time slot, that is, an unexecutable suspended state (suspended-waiting) is resolved, and the LP state storage register In 424, the execution status of the program in the case where the wake-up timing of LP0 indicates “n”, that is, the normal wake-up timing is shown.
この場合、スケジューリング制御部413は、図25(b)に示すように、実行不可能な中断状態の解消が生じたとき、LP0のプログラム状態をsuspended-readyに更新するが、即座にLP0を実行させようとせず、カウント値0信号を待って、他のTSでのプログラム実行を中断させないタイミングで、LP0を実行するように制御する。
これにより、実行不可能な中断状態の解消が生じた時点において、既に、スタンバイレジスタ群に格納されているレジスタ値が使用され、この格納が無駄とならない。このとき、スケジューリング制御部413は、コンテキスト内に保存されている実カウント値分の時間t4だけ、LP0を実行するように制御する。
In this case, as shown in FIG. 25B, the
As a result, the register value already stored in the standby register group is used at the time when the non-executable interruption state is resolved, and this storage is not wasted. At this time, the
なお、このLP0の実行は、イベントドリブンスケジューリングによりなされる。そして、これにつづいて、通常のタイムドリブンスケジューリングにより実行対象となったTS0に割り当てられているLP0がt3だけ実行されることとなる。
以下、上述のケースにおいて、LP状態格納レジスタ424におけるLP0の起床タイミングが「e」を示している場合における、ウエイトの解消時、つまり、実行不可能な中断状態が解消したときのプログラム実行状況について説明する。
(4−5.緊急的な復帰イベント発生時におけるプログラム実行状態)図26(a)は、図25(a)と同様に、TS0からTS3の4つのタイムスロットのうち、既にTS3が、中断タイムスロットとなっており、処理実行部410からの「vmp_sus」コード出力をトリガとして、TS0に割り当てられているLP0が有効でなくなり、新たにTS0が中断タイムスロットとなった場合のプログラムの実行状況を示す。
Note that LP0 is executed by event-driven scheduling. Subsequently, LP0 assigned to TS0 that is the execution target by normal time-driven scheduling is executed for t3.
Hereinafter, in the above-described case, when the wake-up timing of LP0 in the LP
(4-5. Program Execution State at Urgent Return Event Occurrence) FIG. 26 (a) shows the same as in FIG. 25 (a), among the four time slots TS0 to TS3, TS3 has already been suspended. The execution status of the program when LP0 assigned to TS0 becomes invalid and TS0 becomes a suspended time slot is triggered by the output of the “vmp_sus” code from the
このとき、TS0においては、設定されている実行時間枠t5が全て使い切られていない。
また、図25(a)と同様に、「vmp_sus」コードを受け取った場合、スケジューリング制御部413は、LP0のプログラム状態をsuspended-waitingに更新し、実行時間枠内において使われずに残った時間t6を実カウント値としてコンテキスト内に保存する。
At this time, in TS0, the set execution time frame t5 is not completely used up.
Similarly to FIG. 25A, when the “vmp_sus” code is received, the
図26(b)は、スリーピングタイムスロットとなったTS0に割り当てられているLP0にウエイトの解消、つまり、実行不可能な中断状態の解消が生じ、かつ、LP状態格納レジスタ424においてLP0の起床タイミングが「e」、即ち緊急的に起床させる旨を示している場合におけるプログラムの実行状況を示す。
この場合、スケジューリング制御部413は、図26(b)に示すように、ウエイトの解消、つまり、実行不可能な中断状態の解消が生じたとき、LP0のプログラム状態をsuspended-readyに更新し、即座にLP0を実行させようとする。ここで上述の即座とは、復帰処理やレジスタ切り替えなどに要するオーバーヘッド(t2)でのプログラム実行を意味する。
FIG. 26B shows a state in which a wait is canceled in LP0 assigned to TS0 that has become a sleeping time slot, that is, an unexecutable interrupted state is resolved, and LP0 wake-up timing in LP
In this case, as shown in FIG. 26 (b), the
より具体的には、スケジューリング制御部413は、ウエイトの解消、つまり、実行不可能な中断状態の解消が生じた時点において、既に、スタンバイレジスタ群に格納されているレジスタ値を破棄し、このスタンバイレジスタ群にLP0に対応するコンテキストのレジスタ値を格納するという緊急復帰処理を実施し、緊急レジスタ切り替え処理を実行し、直ちにLP0を上述のt6の時間分実行させると共に、LP1のプログラム状態をsuspended-readyに更新し、TS1の実行時間枠内において使われずに残った時間t7を実カウント値としてLP1のコンテキスト内に保存する。
More specifically, the
上述のレジスタ切り替え処理を実行によりスタンバイレジスタ群となったレジスタ群には、それまで実行されていたLP1に対応するコンテキストのレジスタ値が存在するが、スケジューリング制御部413は、このLP1のレジスタ値を退避し、LP0の実行に伴い復帰処理を実行し、LP0の実行が終了後、レジスタ切り替え処理を実施して、直ちにLP1を上述のt7の時間分実行させる。
In the register group that has become the standby register group by executing the register switching process described above, the register value of the context corresponding to LP1 that has been executed so far exists, but the
なお、このLP1の実行も、イベントドリブンスケジューリングによりなされ、具体的には、イベント起床処理(起床タイミング「n」)により実行再開される。
(4−6.イベント処理要求が発生した場合におけるプログラム実行状態)イベント処理要求が発生しない場合、図27(a)に示すように、TS0、TS1、TS2及びTS3が順次実行対象となり、これらタイムスロットそれぞれに割り当てられたプログラムLP0、LP1、LP2及びLP3が逐次実行される。
The LP1 is also executed by event-driven scheduling. Specifically, the execution is resumed by an event wake-up process (wake-up timing “n”).
(4-6. Program Execution State When Event Processing Request Occurs) When no event processing request occurs, TS0, TS1, TS2, and TS3 are sequentially executed as shown in FIG. The programs LP0, LP1, LP2, and LP3 assigned to the slots are sequentially executed.
図27(b)は、上述の状態を前提として、イベント用のタイムスロットであるTS4のLP4を実行するイベント処理要求が発生し、かつ、LP状態格納レジスタ424においてLP4の起床タイミングが「n」、即ち通常に起床させる旨を示す場合におけるプログラムの実行状況を示す。この場合、スケジューリング制御部413は、図27(b)に示すように、イベント処理要求が発生したとき、LP4のプログラム状態をwaitingからreadyに更新するが、即座にLP4を実行させようとせず、イベント処理要求が発生したときにカレントレジスタ群となっているレジスタ群が、スタンバイレジスタ群となり、かつ、このレジスタ群が開放されたとき、このレジスタ群にLP4に対応するコンテキストのレジスタ値を格納し、このレジスタ群がカレントレジスタ群となったときに、LP4を実行するようにする。
In FIG. 27B, on the assumption of the above-described state, an event processing request for executing LP4 of TS4 that is a time slot for an event is generated, and the wake-up timing of LP4 is “n” in LP
これにより、イベント処理要求が発生した時点において、既に、スタンバイレジスタ群に格納されているレジスタ値が使用され、この格納が無駄とならない。図27(c)は、イベント用のタイムスロットであるTS4のLP4を実行するイベント処理要求が発生し、かつ、LP状態格納レジスタ424においてLP4の起床タイミングが「e」、即ち緊急的に起床させる旨を示している場合におけるプログラムの実行状況を示す。
Thereby, when an event processing request is generated, the register values already stored in the standby register group are used, and this storage is not wasted. FIG. 27C shows an event processing request for executing LP4 of TS4 which is a time slot for an event, and the wakeup timing of LP4 is “e” in the LP
この場合、スケジューリング制御部413は、図27(c)に示すように、イベント処理要求が発生したとき、LP4のプログラム状態をreadyに更新し、即座に、即ち、上述のt2でLP4を実行させようとする。より具体的には、スケジューリング制御部413は、イベント処理要求が発生した時点において、既に、スタンバイレジスタ群に格納されているレジスタ値を破棄し、このスタンバイレジスタ群にLP4に対応するコンテキストのレジスタ値を格納し、緊急レジスタ切り替え処理を実行し、直ちにLP4を実行させると共に、実行が中断されたLP1のプログラム状態をsuspended-readyに更新し、TS1の実行時間枠内において使われずに残った時間、即ち、実カウント値をLP1のコンテキスト内に保存する。
In this case, as shown in FIG. 27C, the
上述のレジスタ切り替え処理を実行によりスタンバイレジスタ群となったレジスタ群には、それまで実行されていたLP1に対応するコンテキストのレジスタ値が存在し、スケジューリング制御部413は、このレジスタ値を一旦退避するそして、再度このレジスタ値をスタンバイレジスタ群に復帰して、LP4の実行が終了後、直ちにレジスタ切り替え処理を実施して、直ちにLP1を上述の使われずに残った時間分実行させるように制御する。
The register group that has become the standby register group by executing the register switching process described above has a context register value corresponding to LP1 that has been executed so far, and the
なお、このLP1の実行も、イベントドリブンスケジューリングによりなされ、具体的には、イベント起床処理(起床タイミング「n」)により実行再開される。
(4−7.共通割り込み処理要求が発生した場合におけるプログラム実行状況)図28(a)、(b)は、共通割り込み処理要求が発生した場合におけるプログラム実行状況を説明する図である。
The LP1 is also executed by event-driven scheduling. Specifically, the execution is resumed by an event wake-up process (wake-up timing “n”).
(4-7. Program Execution Situation When Common Interrupt Processing Request Occurs) FIGS. 28A and 28B are diagrams for explaining the program execution situation when a common interrupt processing request occurs.
図28(a)に示すように、共通割り込み処理要求が発生していない場合、TS0からTS3の4つのタイムスロットが順次実行対象のタイムスロットとなり、これらタイムスロットそれぞれに割り当てられているLP0、LP1、LP2及びLP3が逐次実行される。TS2におけるLP2実行中に共通割り込み処理要求が発生した場合、図28(b)に示すように、スケジューリング制御部413は、LP2のプログラム実行中にこの共通割り込み処理専用サブルーチンにジャンプして共通割り込み処理を実行させ、この共通割り込み処理が完了した後、LP2に戻ってプログラム実行させる。
As shown in FIG. 28A, when no common interrupt processing request is generated, four time slots from TS0 to TS3 are sequentially executed time slots, and LP0 and LP1 assigned to these time slots, respectively. , LP2 and LP3 are sequentially executed. When a common interrupt processing request is generated during execution of LP2 in TS2, as shown in FIG. 28B, the
このとき、スケジューリング制御部413は、上述のサブルーチンにおけるプログラム実行時間を、割り込まれたLP2の実行時間に含めないように制御する。より具体的には、スケジューリング制御部413は、上述のサブルーチンにおいて、共通割り込み処理が実行されている間、サイクルカウンタ416におけるカウントダウンをストップさせる。
この結果、TS2の実行時間枠t9に上述のサブルーチンにおいてプログラムが実行されていた時間t10を加えた時間がLP2の実行時間となる。このように、共通割り込み処理の実行時間を、割り込まれたLP2の本来の実行時間に含めないようにするのは、全てのプログラムが共通割り込み処理の実行を必要としているにもかかわらず、偶然に割り込まれたある1つのタイムスロットの実行時間枠を消費することにより、このタイムスロットに割り当てられているプログラムだけ実行時間が減少するという不公平が生じることを是正するためである。
(4−8.固有割込み処理要求が発生した場合におけるプログラム実行状況)
図29(a)、(b)、(c)は、固有割込み処理要求が発生した場合におけるプログラム実行状況を説明する図である。
At this time, the
As a result, a time obtained by adding the time t10 during which the program is executed in the above-described subroutine to the execution time frame t9 of TS2 is the execution time of LP2. In this way, the execution time of the common interrupt process is not included in the original execution time of the interrupted LP2, even though all programs need to execute the common interrupt process. This is to correct the unfairness that the execution time is reduced by the program assigned to this time slot by consuming the execution time frame of one interrupted time slot.
(4-8. Program execution status when a specific interrupt processing request occurs)
FIGS. 29A, 29B, and 29C are diagrams for explaining the program execution status when a specific interrupt processing request is generated.
図29(a)に示すように、固有割込み処理要求が発生していない場合、TS0からTS3の4つのタイムスロットが順次実行対象のタイムスロットとなり、これらタイムスロットそれぞれに割り当てられているLP0、LP1、LP2及びLP3が逐次実行される。図29(b)に示すように、TS2におけるLP2実行中にLP3に対応する固有割込み処理要求が発生した場合、スケジューリング制御部413は、次にLP3が実行されるときに、この固有割込み処理専用サブルーチンにジャンプして固有割込み処理を実行させ、この固有割込み処理が完了した後、LP3に戻ってプログラム実行させる。
As shown in FIG. 29A, when a specific interrupt processing request is not generated, four time slots from TS0 to TS3 are sequentially executed time slots, and LP0 and LP1 assigned to these time slots, respectively. , LP2 and LP3 are sequentially executed. As shown in FIG. 29 (b), when a unique interrupt processing request corresponding to LP3 is generated during execution of LP2 in TS2, the
このとき、スケジューリング制御部413は、固有割込み処理専用サブルーチンにおけるプログラム実行時間を、割り込まれたLP3の実行時間に含める。つまり、スケジューリング制御部413は、上述のサブルーチンにおいて、固有割込み処理が実行されている間、サイクルカウンタ416におけるカウントダウンをストップさせない。
このように、LP3に対応する固有割込み処理の実行時間を、割り込まれたLP3の本来の実行時間に含めるのは、LP3のみがこの固有割込み処理の実行を必要としており、固有割込み処理の実行を必要とするプログラムの実行時間から固有割込み処理の実行時間が消費されるとしても、共通割り込み処理の場合のような実行時間についてのプログラム間における不公平が生じないためである。
At this time, the
Thus, the reason for including the execution time of the specific interrupt process corresponding to LP3 in the original execution time of the interrupted LP3 is that only LP3 needs to execute this specific interrupt process, This is because even if the execution time of the intrinsic interrupt processing is consumed from the execution time of the necessary program, unfairness between the programs regarding the execution time as in the case of the common interrupt processing does not occur.
また、図29(c)に示すように、TS3におけるLP3実行中にLP3に対応する固有割込み処理要求が発生した場合、スケジューリング制御部413は、直ちにこの固有割込み処理専用サブルーチンにジャンプして固有割込み処理を実行させ、この固有割込み処理が完了した後、LP3に戻ってプログラム実行させる。
このときも上述と同様に、スケジューリング制御部413は、固有割込み処理実行用サブルーチンにおけるプログラム実行時間を、割り込まれたLP3の実行時間に含める。以上のように、第2の実施形態によれば、1つの仮想マルチプロセッサ400において、擬似並行的に複数のプログラムを実行しても、コンテキストの退避、判断及び復帰は、プログラムの実行と並行して実施するため、プログラムの実行時間にコンテキストの退避、判断及び復帰に要する時間が介在することがないので、効率的にタスクを実行することができる。
Also, as shown in FIG. 29 (c), when a specific interrupt processing request corresponding to LP3 occurs during execution of LP3 in TS3, the
Also at this time, as described above, the
また、タイムスロット毎に複数のプログラムが用意されているため、1つのプログラムが実行できない状態となっても、そのプログラムに代わって別のプログラムが実行することができ、プログラムの実行時間を有効に使用することができる。さらに、プログラムが実行できない状態となった場合、そのプログラムの実行時間において、処理実行部410にNOP実行させている状態で駆動を停止させることにより消費電力を低減することができる。
In addition, since multiple programs are prepared for each time slot, even if one program cannot be executed, another program can be executed instead of that program, and the execution time of the program becomes effective. Can be used. Further, when the program cannot be executed, the power consumption can be reduced by stopping the driving while the
なお、本実施形態では、スケジューリング制御部413は、固有割込み処理実行用サブルーチンにおけるプログラム実行時間を、割り込まれたプログラムの実行時間に含めるとしたが、これに限らず、例えば、以下のようにしてもよい。ここで、図30(a)に示すように、固有割込み処理が発生していない場合には、TS0からTS3の4つのタイムスロットが順次実行対象のタイムスロットとなり、これらタイムスロットそれぞれに割り当てられているLP0、LP1、LP2及びLP3が逐次実行されているものとする。
In the present embodiment, the
各タイムスロットに割り当てられているLP0からLP3までのプログラムが実行されたとき、1巡目のプログラム実行が終了する。図30(b)に示すように、k巡目のLP2の実行中において、LP2に対応する固有割込み処理が発生した場合、スケジューリング制御部413は、このときに限り、固有割込み処理実行用サブルーチンにおけるプログラム実行時間t13を、割り込まれたプログラム(LP)の実行時間に含めない。
When the programs from LP0 to LP3 assigned to each time slot are executed, the program execution of the first round is completed. As shown in FIG. 30B, when the unique interrupt process corresponding to LP2 occurs during the execution of LP2 in the k-th cycle, the
つまり、スケジューリング制御部413は、固有割込み処理実行用サブルーチンにおいてプログラム実行している時間t13の間、サイクルカウンタ416におけるカウントダウンをストップさせる。そして、スケジューリング制御部413は、図30(c)に示すように、k+1順目において、TS2に割り当てられているLP2が実行されるとき、このTS2の実行時間枠t12から上述のおけるプログラム実行時間t13を差し引いた時間分LP2を実行させる。
That is, the
より具体的には、スケジューリング制御部413は、サイクルカウンタ416に出力する基本サイクルの値に代えて、上述のt12からt13を差し引いた時間に相当する値をサイクルカウンタ416に出力する。なお、k+2巡目では、図30(a)に示すような通常の実行がなされる。
また、本実施形態では、図31(a)に示すように、クロックマスク部427が、スケジューリング制御部413からマスク信号を受信している間、処理実行部410へのクロックパルスの信号経路を遮断することにより、処理実行部410の電力消費を低減しているが、これに限らず、以下のようにしてもよい。
More specifically, the
Further, in this embodiment, as shown in FIG. 31A, while the
即ち、図31(b)に示すように、処理実行部410への電力供給経路上に配置される電力制御部430が、スケジューリング制御部413から上述のマスク信号に代わる電力制御信号を受信している間、この電力供給経路を遮断することにより、処理実行部410における電力消費を0にしてもよい。
また、図31(c)に示すように、発振器600と処理実行部410との間にあるクロックパルスの信号経路上に配置される分周器などからなる分周部431が、スケジューリング制御部413から上述のマスク信号に代わる分周信号を受信している間、例えば、4分周することにより、処理実行部410の駆動周波数を下げて電力消費を低減してもよい。
That is, as shown in FIG. 31B, the
Further, as shown in FIG. 31C, a
さらに、図31(d)に示すように、発振器600と仮想マルチプロセッサ400との間にあるクロックパルスの信号経路上に配置される分周器などからなる分周部431が、スケジューリング制御部413から上述のマスク信号に代わる分周信号を受信している間、このクロックパルスの周波数を、例えば、4分周することにより、処理実行部410の駆動周波数を下げて電力消費を低減してもよい。
Further, as shown in FIG. 31D, a
このとき、サイクルカウンタ416は、従来の機能を発揮する通常処理部432に加え、逓倍器などからなる逓倍部433を有し、クロックパルスの周波数を、例えば、4逓倍するなどして上述の分周による影響を相殺し、カウントダウンを行うとしてもよい。なお、上述の分周及び逓倍の値は、無論、4に限るものではない。
また、第2の実施形態では、リクエスト検出部419は、イベントP_IDの出力を行おうとするとき、現在を起点として所定時間分過去に遡った期間における記憶された前記イベントP_IDの出力回数が、予め決められているしきい値を越えることとなる場合、前記出力回数が前記しきい値以下となるように上述の出力を遅延するとしたが、前記出力回数が当該しきい値を越えることとなる場合、前記イベントP_IDの出力を取り止める、即ち、イベント処理要求を無視するとしてもよい。
At this time, the cycle counter 416 includes a
Further, in the second embodiment, when the
また、第2の実施形態では、スケジューリング制御部413は、スタンバイレジスタ群に格納されているコンテキストに対応するプログラムの実行に必要なデータをキャッシュメモリに書き込むようにDMA管理部418に指示するとしたが、これに代えて、ガーベジコレクションを実行する機能部に対し、ガーベジコレクションの実行を指示するとしてもよい。
In the second embodiment, the
また、本第2の実施形態では、或る時点において、2以上のプログラムの状態が新たにready 又はsuspended-readyとなった場合、即ち、イベントドリブンスケジューリングの候補内、つまり、スケジューリングの対象範囲内に、複数のプログラムが存在するとき、いずれのプログラムを先に実行するのかについては、記載していないが、プログラムに付与された優先度にもとづいて、優先度が最も高いものから先に実行対象としてもよい。 In the second embodiment, when a state of two or more programs newly becomes ready or suspended-ready at a certain point in time, that is, within an event-driven scheduling candidate, that is, within a scheduling target range. However, when there are multiple programs, which program is executed first is not described, but based on the priority assigned to the program, the program with the highest priority is executed first. It is good.
例えば、プログラムIDの値が小さいものほど、優先度が高いとする場合、プログラムのIDの小さなものから先に実行対象とすることとなる。
また、第2の実施形態では、プログラム(LP)の数は、レジスタ群の数を上回っていることを前提として説明していたが、これに限らず、プログラムの数がレジスタ群の数以下であってもよい。
For example, when the priority is higher as the value of the program ID is smaller, the program having the smaller program ID is selected as the execution target first.
In the second embodiment, the description has been made on the assumption that the number of programs (LP) exceeds the number of register groups. However, the present invention is not limited to this, and the number of programs is less than or equal to the number of register groups. There may be.
その場合、コンテキストメモリ500を備えなくても良く、退避、復帰のステップが不要となる。プログラムの数が2つの場合、LP0は、第1レジスタ群に、LP1は、第2レジスタ群にそれぞれ対応付けられているものとする。例えば、スケジューリング制御部413は、LP0を実行するときは、コンテキストメモリからレジスタ値群を復帰する動作なしで、第1レジスタ群をカレントレジスタ群として選択する。
In this case, the
仮に、プログラム及びレジスタ群の数が3つの場合であっても、カレントレジスタ群として選択されているものが実行対象レジスタ群であって、それ以外がスタンバイレジスタ群となる。ここで、LP2は第3レジスタ群に対応付けられているものとする。LP2を実行するときは、第3レジスタ群をカレントレジスタ群として選択する。
選択先を切り替えた後も、コンテキストメモリにレジスタ値群を退避する動作は不要である。
Even if the number of programs and register groups is three, what is selected as the current register group is the execution target register group, and the others are standby register groups. Here, LP2 is assumed to be associated with the third register group. When executing LP2, the third register group is selected as the current register group.
Even after the selection destination is switched, the operation of saving the register value group in the context memory is unnecessary.
また、コンテキストメモリ500は、SRAMにより構成されるとしたが、DRAMであってもよく、さらに、これらメモリに限らず、高速にアクセスされるレジスタや低速にアクセスされる外部記憶装置であってもよい。
In addition, the
10 主メモリ
30 外部プロセッサ
100 仮想マルチプロセッサ
110 処理実行部
111 処理制御部
112 レジスタ切替部
113 切替入替制御部
114 レジスタ群
115 レジスタ群
116 サイクルカウンタ
117 外部I/F
118 DMA管理部
119 完了通知レジスタ
120 制御レジスタ
121 設定フラグレジスタ
200 コンテキストメモリ
201 コンテキスト格納領域
202 実行順序テーブル格納領域
301 入出力部
302 第1メモリ
303 第2メモリ
304 カウントダウン部
400 仮想マルチプロセッサ
402 時間割付情報格納レジスタ
410 処理実行部
411 処理制御部
412 レジスタ切替部
413 スケジューリング制御部
414 レジスタ群
415 レジスタ群
416 サイクルカウンタ
417 外部I/F
418 DMA管理部
419 リクエスト検出部
420 制御レジスタ
421 設定フラグレジスタ
424 LP状態格納レジスタ
425 プロセッサ状態格納部
427 クロックマスク部
430 電力制御部
431 逓倍部
432 通常処理部
433 分周部
500 コンテキストメモリ
501 コンテキスト格納領域
600 発振器
601 PLL
700 バス
701 外部プロセッサ処理要求信号線
702 外部プロセッサ処理完了信号線
10
118
418
700
Claims (21)
複数のレジスタ群と、前記複数のレジスタ群のうちいずれか1つを、プログラム実行の基礎とする実行対象レジスタ群として選択し、当該選択先を所定時間毎に切り替える選択先切り替え手段と、
前記切り替えがなされる毎に、前記複数のレジスタ群のうち前記選択がなされていない1のレジスタ群に前記レジスタ値群を復帰する復帰手段と、
前記切り替えがなされる毎に、前記復帰に先行して、当該復帰の対象となったレジスタ群にある各レジスタ値を、これらレジスタ値に対応する前記メモリ中のレジスタ値群に上書きすることにより退避する退避手段と、
前記切り替えがなされる毎に、前記実行対象レジスタ群にあるプログラムカウンタ値を含むレジスタ値群によりプログラムを特定し、前記特定したプログラムを実行するプログラム実行手段と、
プログラム実行手段を占有する時間を配分するために定められる、プログラムの実行時間枠となるタイムスロットを特定する順序情報を取得する順序情報取得手段とを備え、
前記所定時間は、所望の処理時間が異なるプログラムに応じて、前記タイムスロットを介して、複数のカウント値がそれぞれのプログラムに対応づけられて格納されたテーブル情報にもとづいて、前記カウント値により特定される時間であり、
さらに、前記復帰の候補となる優先順位が対応づけられた候補レジスタ値群が複数存在し、
前記復帰手段は、前記順序情報を参照して、前記タイムスロットを所定の順番で周期的に切り替えるために、現在実行対象となっているタイムスロット及び次の実行対象とすべきタイムスロットを特定した後、前記カウント値と複数の候補レジスタ値群とをタイムスロットと関連づけた時間割付情報を参照して、
前記特定したタイムスロットに割り当てられているプログラムの実行時間枠を取得し、前記特定したタイムスロットに割り当てられている複数の候補レジスタ値群のうちから、前記優先順位にもとづいて、前記復帰の対象とするレジスタ値群を決定して前記復帰を実施し、
前記プログラム実行手段は、前記切り替えがなされたとき、前記実行を開始し、
さらに、前記所定時間は、前記プログラム実行手段が前記特定したプログラムを実行する時間の合計に対して、所定の割合となるべくタイムスロット毎に決められていることを特徴とするプロセッサ。 A processor that sequentially executes a program corresponding to each of these register value groups using a plurality of register value groups stored in a memory,
A selection destination switching means for selecting a plurality of register groups and any one of the plurality of register groups as an execution target register group as a basis for program execution, and switching the selection destination at predetermined time intervals;
Returning means for returning the register value group to one register group that is not selected among the plurality of register groups each time the switching is performed;
Each time the switching is performed, prior to the return, each register value in the register group targeted for the return is saved by overwriting the register value group in the memory corresponding to the register value. Evacuation means to perform,
Program execution means for specifying a program by a register value group including a program counter value in the execution target register group each time the switching is performed, and executing the specified program;
Order information obtaining means for obtaining order information for specifying a time slot serving as an execution time frame of the program, which is determined in order to allocate time for occupying the program execution means,
The predetermined time is specified by the count value based on table information in which a plurality of count values are stored in association with each program through the time slot according to a program having a desired processing time. Time to be
Furthermore, there are a plurality of candidate register value groups associated with the priority order of the return candidates,
The return means refers to the order information, and identifies the current time slot to be executed and the next time slot to be executed in order to periodically switch the time slots in a predetermined order. Then, referring to the time allocation information that associates the count value and a plurality of candidate register value groups with a time slot,
The execution time frame of the program assigned to the specified time slot is obtained, and the return target is selected from among a plurality of candidate register value groups assigned to the specified time slot based on the priority order. And determine the register value group to implement the return,
The program execution means starts the execution when the switching is performed ,
Further, the processor is characterized in that the predetermined time is determined for each time slot to be a predetermined ratio with respect to the total time for the program execution means to execute the specified program .
前記復帰の対象は、前記特定情報により復帰するレジスタ値群を前記順番にもとづいて、前記順番で前記カウント値により前記選択の都度特定されたものであり、
前記特定情報により復帰されたレジスタ値群を含むレジスタ群が実行対象レジスタ群として選択されてから他のレジスタ群が実行対象レジスタ群として選択されるまでの前記所定時間は、当該復帰に用いられた特定情報に対応づけられていたカウント値が示す時間であることを特徴とする請求項2記載のプロセッサ。 In the table information, specific information for specifying any of the plurality of register value groups is associated with each count value,
The return target is specified each time the selection is made by the count value in the order based on the order of the register value group to be returned by the specific information,
The predetermined time from when the register group including the register value group restored by the specific information is selected as the execution target register group until the other register group is selected as the execution target register group is used for the restoration. 3. The processor according to claim 2, wherein the time is indicated by a count value associated with the specific information.
前記復帰手段による前記復帰に伴って、当該復帰がなされたレジスタ値群を参照して、当該レジスタ値群に対応するプログラムの実行データを特定する実行データ特定手段と、
前記複数のキャッシュのうち、プログラムの実行に用いられていないいずれか1つのキャッシュに、特定された前記実行データを書き込むキャッシュ書き込み手段とを備えることを特徴とする請求項1記載のプロセッサ。 Furthermore, a plurality of caches for storing execution data necessary for program execution,
With the return by the return means, referring to the register value group that has been returned, execution data specifying means for specifying execution data of a program corresponding to the register value group,
2. The processor according to claim 1, further comprising cache writing means for writing the specified execution data into any one of the plurality of caches not used for program execution.
前記複数のレジスタ群のうちいずれか1つを、プログラム実行の基礎とする実行対象レジスタ群として選択し、当該選択先を所定時間毎に切り替える選択先切り替えステップと、
前記切り替えがなされる毎に、前記複数のレジスタ群のうち前記選択がなされていない1のレジスタ群に前記レジスタ値群を復帰する復帰ステップと、
前記切り替えがなされる毎に、前記復帰に先行して、当該復帰の対象となったレジスタ群にある各レジスタ値を、これらレジスタ値に対応する前記メモリ中のレジスタ値群に上書きすることにより退避する退避ステップと、
前記切り替えがなされる毎に、前記実行対象レジスタ群にあるプログラムカウンタ値を含むレジスタ値群によりプログラムを特定し、前記特定したプログラムを実行するプログラム実行ステップと、
プログラム実行ステップを占有する時間を配分するために定められる、プログラムの実行時間枠となるタイムスロットを特定する順序情報を取得する順序情報取得ステップとを含み、
前記所定時間は、所望の処理時間が異なるプログラムに応じて、前記タイムスロットを介して、複数のカウント値がそれぞれのプログラムに対応づけられて格納されたテーブル情報にもとづいて、前記カウント値により特定される時間であり、
さらに、前記復帰の候補となる優先順位が対応づけられた候補レジスタ値群が複数存在し、
前記復帰ステップは、前記順序情報を参照して、前記タイムスロットを所定の順番で周期的に切り替えるために、現在実行対象となっているタイムスロット及び次の実行対象とすべきタイムスロットを特定した後、前記カウント値と複数の候補レジスタ値群とをタイムスロットと関連づけた時間割付情報を参照して、前記特定したタイムスロットに割り当てられているプログラムの実行時間枠を取得し、前記特定したタイムスロットに割り当てられている複数の候補レジスタ値群のうちから、前記優先順位にもとづいて、前記復帰の対象とするレジスタ値群を決定して前記復帰を実施し、
前記プログラム実行ステップは、前記切り替えがなされたとき、前記実行を開始し、
前記所定時間は、前記プログラム実行ステップで特定したプログラムを実行する時間の合計に対して、所定の割合となるべくタイムスロット毎に決められていることを特徴とするプログラム実行方法。 A program execution method for executing a program in a processor including a plurality of register groups and using a plurality of register value groups stored in a memory and sequentially executing a program corresponding to each of these register value groups,
A selection destination switching step of selecting any one of the plurality of register groups as an execution target register group based on program execution, and switching the selection destination at predetermined time intervals;
A return step of returning the register value group to one register group that is not selected among the plurality of register groups each time the switching is performed;
Each time the switching is performed, prior to the return, each register value in the register group targeted for the return is saved by overwriting the register value group in the memory corresponding to the register value. Evacuation step to
A program execution step of specifying a program by a register value group including a program counter value in the execution target register group each time the switching is performed, and executing the specified program;
An order information obtaining step for obtaining order information for specifying a time slot serving as an execution time frame of the program, which is defined in order to allocate time for occupying the program execution step;
The predetermined time is specified by the count value based on table information in which a plurality of count values are stored in association with each program through the time slot according to a program having a desired processing time. Time to be
Furthermore, there are a plurality of candidate register value groups associated with the priority order of the return candidates,
The returning step refers to the order information, and identifies the current time slot to be executed and the next time slot to be executed in order to periodically switch the time slots in a predetermined order. Thereafter, referring to time allocation information in which the count value and a plurality of candidate register value groups are associated with a time slot, an execution time frame of a program assigned to the specified time slot is acquired, and the specified time Among the plurality of candidate register value groups assigned to the slot, based on the priority order, determine the register value group to be restored, and perform the restoration,
The program execution step starts the execution when the switching is performed ,
The program execution method characterized in that the predetermined time is determined for each time slot to be a predetermined ratio with respect to the total time for executing the program specified in the program execution step .
前記レジスタ値群のそれぞれを格納する複数のレジスタ群と、
前記複数のレジスタ群のうちいずれか1つを、プログラム実行の基礎とする実行対象レジスタ群として選択し、当該選択先を所定時間毎に切り替える選択先切り替え手段と、
前記切り替えがなされる毎に、前記実行対象レジスタ群にあるプログラムカウンタ値を含むレジスタ値群によりプログラムを特定し、前記特定したプログラムを実行するプログラム実行手段と、
プログラム実行手段を占有する時間を配分するために定められる、プログラムの実行時間枠となるタイムスロットを特定する順序情報を取得する順序情報取得手段とを備え、
前記所定時間は、所望の処理時間が異なるプログラムに応じて、前記タイムスロットを介して、複数のカウント値がそれぞれのプログラムに対応づけられて格納されたテーブル情報にもとづいて、前記カウント値により特定される時間であり、
さらに、前記復帰の候補となる優先順位が対応づけられた候補レジスタ値群が複数存在し、
前記復帰手段は、前記順序情報を参照して、前記タイムスロットを所定の順番で周期的に切り替えるために、現在実行対象となっているタイムスロット及び次の実行対象とすべきタイムスロットを特定した後、前記カウント値と複数の候補レジスタ値群とをタイムスロットと関連づけた時間割付情報を参照して、前記特定したタイムスロットに割り当てられているプログラムの実行時間枠を取得し、前記特定したタイムスロットに割り当てられている複数の候補レジスタ値群のうちから、前記優先順位にもとづいて、前記復帰の対象とするレジスタ値群を決定して前記復帰を実施し、
前記プログラム実行手段は、前記切り替えがなされたとき、前記実行を開始し、
前記所定時間は、前記プログラム実行手段が特定したプログラムを実行する時間の合計に対して、所定の割合となるべくタイムスロット毎に決められていることを特徴とするプロセッサ。 A processor that sequentially executes a program corresponding to each register value group using a plurality of register value groups,
A plurality of register groups storing each of the register value groups;
Selection destination switching means for selecting any one of the plurality of register groups as an execution target register group based on program execution and switching the selection destination every predetermined time;
Program execution means for specifying a program by a register value group including a program counter value in the execution target register group each time the switching is performed, and executing the specified program;
Order information obtaining means for obtaining order information for specifying a time slot serving as an execution time frame of the program, which is determined in order to allocate time for occupying the program execution means,
The predetermined time is specified by the count value based on table information in which a plurality of count values are stored in association with each program through the time slot according to a program having a desired processing time. Time to be
Furthermore, there are a plurality of candidate register value groups associated with the priority order of the return candidates,
The return means refers to the order information, and identifies the current time slot to be executed and the next time slot to be executed in order to periodically switch the time slots in a predetermined order. Thereafter, referring to time allocation information in which the count value and a plurality of candidate register value groups are associated with a time slot, an execution time frame of a program assigned to the specified time slot is acquired, and the specified time Among the plurality of candidate register value groups assigned to the slot, based on the priority order, determine the register value group to be restored, and perform the restoration,
The program execution means starts the execution when the switching is performed ,
The processor according to claim 1, wherein the predetermined time is determined for each time slot to be a predetermined ratio with respect to a total time for executing the program specified by the program execution means .
前記複数のレジスタ群のうちいずれか1つを、プログラム実行の基礎とする実行対象レジスタ群として選択し、当該選択先を所定時間毎に切り替える選択先切り替えステップと、
前記切り替えがなされる毎に、前記実行対象レジスタ群にあるプログラムカウンタ値を含むレジスタ値群によりプログラムを特定し、前記特定したプログラムを実行するプログラム実行ステップと、
プログラム実行ステップを占有する時間を配分するために定められる、プログラムの実行時間枠となるタイムスロットを特定する順序情報を取得する順序情報取得ステップとを含み、
前記所定時間は、所望の処理時間が異なるプログラムに応じて、前記タイムスロットを介して、複数のカウント値がそれぞれのプログラムに対応づけられて格納されたテーブル情報にもとづいて、前記カウント値により特定される時間であり、
さらに、前記復帰の候補となる優先順位が対応づけられた候補レジスタ値群が複数存在し、
前記復帰ステップは、前記順序情報を参照して、前記タイムスロットを所定の順番で周期的に切り替えるために、現在実行対象となっているタイムスロット及び次の実行対象とすべきタイムスロットを特定した後、前記カウント値と複数の候補レジスタ値群とをタイムスロットと関連づけた時間割付情報を参照して、前記特定したタイムスロットに割り当てられているプログラムの実行時間枠を取得し、前記特定したタイムスロットに割り当てられている複数の候補レジスタ値群のうちから、前記優先順位にもとづいて、前記復帰の対象とするレジスタ値群を決定して前記復帰を実施し、
前記プログラム実行ステップは、前記切り替えがなされたとき、前記実行を開始し、
前記所定時間は、前記プログラム実行ステップで特定したプログラムを実行する時間の合計に対して、所定の割合となるべくタイムスロット毎に決められていることを特徴とするプログラム実行方法。 A program execution method for executing a program in a processor including a plurality of register groups and using a plurality of register value groups to sequentially execute a program corresponding to each of these register value groups,
A selection destination switching step of selecting any one of the plurality of register groups as an execution target register group as a basis for program execution, and switching the selection destination at predetermined time intervals;
A program execution step of specifying a program by a register value group including a program counter value in the execution target register group each time the switching is performed, and executing the specified program;
An order information obtaining step for obtaining order information for specifying a time slot serving as an execution time frame of the program, which is defined in order to allocate time for occupying the program execution step;
The predetermined time is specified by the count value based on table information in which a plurality of count values are stored in association with each program through the time slot according to a program having a desired processing time. Time to be
Furthermore, there are a plurality of candidate register value groups associated with the priority order of the return candidates,
The returning step refers to the order information, and identifies the current time slot to be executed and the next time slot to be executed in order to periodically switch the time slots in a predetermined order. Thereafter, referring to time allocation information in which the count value and a plurality of candidate register value groups are associated with a time slot, an execution time frame of a program assigned to the specified time slot is acquired, and the specified time Among the plurality of candidate register value groups assigned to the slot, based on the priority order, determine the register value group to be restored, and perform the restoration,
The program execution step starts the execution when the switching is performed ,
The program execution method characterized in that the predetermined time is determined for each time slot to be a predetermined ratio with respect to the total time for executing the program specified in the program execution step .
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2005287949A JP4196982B2 (en) | 2002-01-09 | 2005-09-30 | Processor and program execution method |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2002002816 | 2002-01-09 | ||
| JP2005287949A JP4196982B2 (en) | 2002-01-09 | 2005-09-30 | Processor and program execution method |
Related Parent Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2003001616A Division JP3813930B2 (en) | 2002-01-09 | 2003-01-07 | Processor and program execution method |
Related Child Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2007101054A Division JP4295792B2 (en) | 2002-01-09 | 2007-04-06 | Processor and program execution method |
Publications (3)
| Publication Number | Publication Date |
|---|---|
| JP2006107503A JP2006107503A (en) | 2006-04-20 |
| JP2006107503A5 JP2006107503A5 (en) | 2007-05-24 |
| JP4196982B2 true JP4196982B2 (en) | 2008-12-17 |
Family
ID=36377051
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2005287949A Expired - Lifetime JP4196982B2 (en) | 2002-01-09 | 2005-09-30 | Processor and program execution method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP4196982B2 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114036079B (en) * | 2021-09-07 | 2023-02-17 | 联芸科技(杭州)股份有限公司 | Mapping table compression method and system, memory controller, solid state disk and data reading method |
-
2005
- 2005-09-30 JP JP2005287949A patent/JP4196982B2/en not_active Expired - Lifetime
Also Published As
| Publication number | Publication date |
|---|---|
| JP2006107503A (en) | 2006-04-20 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP3813930B2 (en) | Processor and program execution method | |
| US10949249B2 (en) | Task processor | |
| US9170841B2 (en) | Multiprocessor system for comparing execution order of tasks to a failure pattern | |
| US9047120B2 (en) | Virtual queue processing circuit and task processor | |
| US9753779B2 (en) | Task processing device implementing task switching using multiple state registers storing processor id and task state | |
| JP5347451B2 (en) | Multiprocessor system, conflict avoidance program, and conflict avoidance method | |
| JPH09128351A (en) | Parallel process scheduling method for parallel computer and processor for parallel computer | |
| KR20050016170A (en) | Method and system for performing real-time operation | |
| CN108694079A (en) | Semiconductor equipment | |
| CN101103336A (en) | Data processing system and method for task scheduling | |
| JP4825257B2 (en) | Processor | |
| JP4295792B2 (en) | Processor and program execution method | |
| JP4196982B2 (en) | Processor and program execution method | |
| JP4238246B2 (en) | Processor | |
| JP2012008767A (en) | Processor, reproducing device, and processing device | |
| JP2010165209A (en) | Multi-thread processor system |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20060106 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20070403 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20071002 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20071203 |
|
| 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: 20080826 |
|
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20080922 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20111010 Year of fee payment: 3 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 4196982 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20121010 Year of fee payment: 4 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20131010 Year of fee payment: 5 |
|
| S111 | Request for change of ownership or part of ownership |
Free format text: JAPANESE INTERMEDIATE CODE: R313111 |
|
| R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| S111 | Request for change of ownership or part of ownership |
Free format text: JAPANESE INTERMEDIATE CODE: R313113 |
|
| R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| EXPY | Cancellation because of completion of term |