JP2004220093A - Processor, execution task deciding device and arithmetic processing method - Google Patents

Processor, execution task deciding device and arithmetic processing method Download PDF

Info

Publication number
JP2004220093A
JP2004220093A JP2003003428A JP2003003428A JP2004220093A JP 2004220093 A JP2004220093 A JP 2004220093A JP 2003003428 A JP2003003428 A JP 2003003428A JP 2003003428 A JP2003003428 A JP 2003003428A JP 2004220093 A JP2004220093 A JP 2004220093A
Authority
JP
Japan
Prior art keywords
task
register set
unit
register
execution
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2003003428A
Other languages
Japanese (ja)
Inventor
Satoshi Kaburagi
木 智 鏑
Yukimasa Miyamoto
本 幸 昌 宮
Shinichi Kanno
野 伸 一 菅
Masaya Taruie
家 昌 也 樽
Hiroshi Oneda
拓 大根田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Toshiba Corp
Original Assignee
Toshiba Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Toshiba Corp filed Critical Toshiba Corp
Priority to JP2003003428A priority Critical patent/JP2004220093A/en
Priority to US10/752,703 priority patent/US20040139441A1/en
Priority to CNA2004100020726A priority patent/CN1517869A/en
Publication of JP2004220093A publication Critical patent/JP2004220093A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To efficiently execute a plurality of tasks in a real time. <P>SOLUTION: This processor is provided with a task starting part 11 for determining whether or not each of a plurality of tasks can be started, an execution task deciding part 12 for deciding a task to be started based on the determination result of the task starting part 11 and a processor core 13 for executing the task decided by the execution task deciding part 12. A plurality of FIFO 10 are connected to the task starting part 11. Data to be inputted to the task are stored in the FIFO 10, and whether or not any free area is present in another FIOF 10 where the execution result of the task should be stored is determined by the task starting part 11, and the task to be started is decided by the execution task deciding part 12 based on the determination result. Thus, it is possible to execute the scheduling of the task without providing any operating system, and to eliminate the overhead of the operating system. <P>COPYRIGHT: (C)2004,JPO&NCIPI

Description

【0001】
【発明の属する技術分野】
本発明は、複数のタスクを時分割で実行するプロセッサ及び実行タスク決定装置に関する。
【0002】
【従来の技術】
プロセッサが時分割で複数のタスクを実行する場合、オペレーティングシステムなどのソフトウェアを用いてタスク切り替えを行うのが一般的である。
【0003】
オペレーティングシステムは、一定時間ごとに、各タスクが実行可能になったかどうかを検出する。実行可能の可否は、たとえば処理対象となるデータが準備できているかで判断できる。
【0004】
このような判断処理をオペレーティングシステムが行っている間は、タスクの実行を中断しなければならない。タスクの実行を中断する際には、汎用レジスタ、スタックポインタ(SP)及びプログラムカウンタ(PC)などの内容がプロセッサ外部の主記憶メモリなどに退避される。退避された各種の情報は タスクの識別情報(タスクID)とともにオペレーティングシステムが管理する。
【0005】
オペレーティングシステムはスケジューラを持っており、このスケジューラにより、たとえばラウンドロビンなどの方式に従って、実行可能なタスクの中から実際に実行するタスクを決定する。
【0006】
オペレーティングシステムは、スケジューラにより実行が決定されたタスクについての、主記憶メモリ等に退避された各種情報を取得し、汎用レジスタ、スタックポインタ(SP)及びプログラムカウンタ(PC)などの内容を退避先のプロセッサ外の主記憶装置などから各レジスタに復元し、その後タスクの実行を開始する。
【0007】
ハードウェアによる複数のデータ処理ユニットを用いてリアルタイムデータの並列処理を実現する方法も提案されている(たとえば特許文献1を参照)。しかしながら並列処理を行うためにデータ処理コアを複数設け、さらにそれらの調停機構を設けるなど、構成自体が複雑となる問題点がある。
【0008】
【特許文献1】
特表2000−509528公報
【0009】
【発明が解決しようとする課題】
オペレーティングシステムなどのソフトウェアを用いたタスク切り替えでは、オペレーティングシステム自体の動作によるオーバーヘッドがあるため、本来のタスク処理に必要な性能よりも高い性能のプロセッサを用意する必要があった。
【0010】
また、オペレーティングシステムによるタスク切り替えでは、タスク切り替えに時間がかかり、リアルタイム性のあるシステムの構築が困難であった。
【0011】
さらにオペレーティングシステムは、タスクが実行可能かどうかの判断を一定時間ごとにしか行わないため、タスクが実行可能になってからオペレーティングシステムに実行可能と判断され、実際にタスクが実行されるまでに時間がかかることがあり、応答性が悪かった。この応答性の悪さがリアルタイム性のあるシステムの構築をさらに困難にしていた。
【0012】
また、処理対象となるデータの準備が出来たかどうかを条件としてタスク起動可能を判定する場合、処理結果を格納する領域にデータを格納出来ない場合があり、そのような場合はデータを失うことになる。
【0013】
一方、多くをハードウェア化しリアルタイム処理を実現しようとすると、従来は構成が複雑かつコスト高になりやすい傾向があった。
【0014】
本発明は、このような点に鑑みてなされたものであり、その目的は、複数のタスクをリアルタイムに効率よく実行できるプロセッサおよび実行タスク決定装置を提供することにある。
【0015】
【課題を解決するための手段】
上述した課題を解決するために、本発明は、複数のタスクを時分割で処理するプロセッサにおいて、予め定めたタスクに対して、該タスクの処理で使用されるデータを記憶する1以上の第1のFIFO(First In First Out)型記憶手段と、前記第1のFIFO型記憶手段から取得したデータを使用して前記タスクの処理を行った後の処理結果を記憶するとともに、この記憶した処理結果を使用する他のタスクがある場合には該他のタスクの処理で使用されるデータを記憶する1以上の第2のFIFO型記憶手段と、前記第1のFIFO型記憶手段が前記タスクの処理に使用するデータを保持しているか否か、および前記タスクの処理結果を記憶する空き領域を前記第2のFIFO型記憶手段が有しているか否かを判断するタスク判断手段と、前記タスク判断手段の判断結果に基づいて、前記複数のタスクのうちから次に起動すべきタスクを決定する実行タスク決定手段と、を備える。
【0016】
【発明の実施の形態】
以下、本発明に係るプロセッサ及び実行タスク決定装置について、図面を参照しながら具体的に説明する。
【0017】
(本発明の原理)
複数のタスクを時分割でリアルタイムに実行したいという要求が高まっている。例えば、図1はソフトウェア無線機の処理内容を示す図である。図1のソフトウェア無線機では、処理A〜処理Dを連続的に実行する。例えば、処理Bは、処理Aの出力を入力として所定の演算処理を行った結果を処理Cに渡す。
【0018】
図1において、各処理での出力データ数とその次の処理を起動するのに必要なデータ数とは必ずしも一致しない。また、各処理の処理量も処理内容によってさまざまである。さらに、処理間でデータ受け渡しのタイミングが異なるため、各処理の段間で同期を取る必要がある。
【0019】
図1の処理を効率よく実現するために、各処理を1つ以上のタスクとして生成することが多い。各タスクは、ソフトウェアで実現される場合とハードウェアで実現される場合がある。
【0020】
本発明では、タスク同士の厳密な同期を取らなくても済むように、タスク間にFIFO(First In First Out)を挿入する。FIFOとは一般にはデータの格納方法を指すが、以下に示す実施形態では格納したデータが過去に格納したものから順に取り出される方式、つまりFIFO型の記憶装置を指している。一番新しく格納されたデータがもっとも最後に取り出されるもので、たとえばキューと呼ばれるデータ構造はこの方式の記憶装置である。この場合のプロセッサの概略構成は図2のようになる。
【0021】
図2において、FIFO1はタスク1への入力データを出力し、FIFO2はタスク1からの出力データを受け取るとともに、タスク2への入力データを出力する。
【0022】
図2では、各タスクの入力側及び出力側に1つずつFIFOを設けているが、複数のFIFOを設けてもよい。
【0023】
ソフトウェア無線機を図2の構成で実現することも可能であるが、各タスク同士で同期を取るための処理量が多いことから、FIFOを利用したとしても、ソフトウェアで同期を取るのは、プロセッサのオーバーヘッドが大きくなり、実現が困難である。
【0024】
ここで、各タスクの起動条件に着目すると、各タスクは入力データが存在しなときには起動する必要はない。また、各タスクの出力側のFIFOに各タスクの処理結果を格納する空き領域が存在しない場合には、各タスクの処理結果を失うおそれがあり、この場合もタスクを起動する必要はない。
【0025】
そこで、以下に説明する本発明の各実施形態は、FIFO内のデータの格納状態を監視しておき、各タスクへの入力データが存在し、かつ出力側のFIFOに空き領域が存在する場合のみ、タスクを起動している。
【0026】
(第1の実施形態)
図3は本発明に係るプロセッサの第1の実施形態の概略構成を示すブロック図である。図3のプロセッサは、複数のタスクそれぞれが起動可能か否かを判断するタスク起動部11と、タスク起動部11の判断結果に基づいて起動すべきタスクを決定する実行タスク決定部12と、実行タスク決定部12で決定されたタスクを実行するプロセッサコア13とを備えている。
【0027】
タスク起動部11には、複数のFIFO10が接続されている。各FIFO10は、図2のFIFO10に対応するものであり、タスク起動部11は各FIFO10間でデータの受け渡しを行う。より具体的には、タスク起動部11は、タスクに入力されるべきFIFO10の出力データを保持するとともに、タスクの処理結果を格納すべき他のFIFO10に空き領域が存在するか否かを確認する。そして、タスクに入力されるべきFIFO10の出力データが存在し、かつタスクの処理結果を格納すべき他のFIFO10に空き領域が存在する場合に限り、タスクを起動すべきと判断する。
【0028】
実行タスク決定部12は、起動可能なタスクが複数存在する場合には、その中からいずれか1つのタスクを選択する。例えば、各タスクを識別するためのタスクIDが最小のタスクを実行する。
【0029】
プロセッサコア13は、例えば、命令取得部、命令解釈部、命令実行部、命令実行結果を格納する命令実行結果格納部、及び命令の実行状態を格納する命令実行状態格納部を有する。
【0030】
このように、第1の実施形態では、タスクに入力されるべきデータをFIFO10が保持し、かつタスクの実行結果を格納すべき他のFIFO10に空き領域が存在するか否かをタスク起動部11で判断し、その判断結果に基づいて実行タスク決定部12が起動すべきタスクを決定するようにしたため、オペレーティングシステムなしでタスクのスケジューリングを行うことができ、オペレーティングシステムのオーバーヘッドの影響を受けなくなり、タスクのリアルタイム処理が可能になる。
【0031】
(第2の実施形態)
第2の実施形態は、複数のタスクに優先順位をつけて、優先順位に従ってタスクの実行を行うものである。
【0032】
図4は本発明に係るプロセッサの第2の実施形態の概略構成を示すブロック図である。図4のプロセッサは、図3の構成に加えて、複数のタスクそれぞれのタスクIDと優先順位を供給するタスクID・優先順位供給部14を備えている。
【0033】
図5は実行タスク決定部12とタスクID・優先順位供給部14の詳細構成を示すブロック図である。図示のように、タスクID・優先順位供給部14は、各タスクのタスクIDと優先順位との対応関係を記憶している。実行タスク決定部12は、タスク起動部11から通知された実行可能なタスクの一覧を登録した実行可能タスクIDリスト15と、起動すべきタスクを決定するプライオリティ・エンコーダ16とを有する。
【0034】
プライオリティ・エンコーダ16は、タスクIDリストに登録されているタスクの優先順位をタスクID・優先順位供給部14から取得し、例えば優先順位が最も高いタスクを起動タスクとして決定する。
【0035】
タスクID・優先順位供給部14が供給する優先順位の設定方法については特に制限はないが、例えば、新たなタスクを生成するときに、そのタスクの優先順位を設定してもよいし、事後的に優先順位を変更できるようにしてもよい。
【0036】
図6は図5の実行タスク決定部12の処理手順を示すフローチャートである。まず、実行可能タスクIDリスト15に登録されているタスクのタスクIDを参照し(ステップS1)、そのタスクIDに対応する優先順位をタスクID・優先順位供給部14から取得する(ステップS2)。
【0037】
次に、ステップS2で取得した優先順位が、タスクの起動候補の優先順位より高いか否かを判定し(ステップS3)、高ければ、ステップS1で参照したタスクIDをもつタスクを起動候補として設定する(ステップS4)。
【0038】
ステップS4の処理が終了した場合、またはステップS3で高くないと判定された場合には、まだ優先順位を比較していないタスクが実行可能タスクIDリスト15に残っているか否かを判定し(ステップS5)、残っている場合にはステップS1以降の処理を繰返し、残っていない場合には処理を終了する。
【0039】
このように、第2の実施形態では、タスクの優先順位を予め定めておくため、複数のタスクが起動候補として挙げられた場合に、優先順位の高いタスクを優先的に実行でき、処理の効率化が図れる。また、起動すべきタスクの選択を迅速に行うこともできる。
【0040】
(第3の実施形態)
第3の実施形態は、動的に優先順位を変更できるようにしたものである。
【0041】
図7は本発明に係るプロセッサの第3の実施形態の概略構成を示すブロック図である。図7のプロセッサは、図4の構成に加えて、タスクの優先順位を動的に変更する優先順位変更部30を備えている。
【0042】
優先順位変更部30は、タスクごとの実行時刻を計測する時刻計測部17と、各タスクのタスクIDと過去の起動時刻との対応関係を登録した起動時刻テーブル18と、各タスクの起動間隔の平均を計算する平均時間間隔計算部19と、平均時間間隔計算部19での計算結果に基づいて各タスクの優先順位を決定する優先順位決定部20とを有する。
【0043】
平均時間間隔計算部19の計算結果が小さいほど、より頻繁に起動されるタスクであることを示している。このため、優先順位決定部20は、例えば、平均時間間隔計算部19の計算結果が小さいタスクほど、優先順位を高くする。
【0044】
より具体的には、平均時間間隔計算部19は各FIFO10へのデータ入力間隔を算出し、その間隔の短いFIFO10に対応するタスクの優先順位が高くなるように、優先順位決定部20で優先順位を決定する。あるいは、平均時間間隔計算部19はプロセッサコア13から通知される各タスクの実行間隔を算出し、その間隔の短いタスクの優先順位が高くなるように、優先順位決定部20で優先順位を決定してもよい。あるいは、平均時間間隔計算部19は各タスクにデータを供給する各FIFO10の空き領域を監視し、空き領域の少ないFIFO10に対応するタスクの優先順位が高くなるように、優先順位決定部20で優先順位を決定してもよい。あるいは、平均時間間隔計算部19は各タスクから各FIFO10へのデータ出力間隔を算出し、その間隔の短いFIFO10に対応するタスクの優先順位が高くなるように、優先順位決定部20で優先順位を決定してもよい。
【0045】
このように、第3の実施形態では、各タスクの優先順位を動的に変更できるようにしたため、過去の実行履歴を参考にしてタスクのスケジューリングを行うことができる。
【0046】
(第4の実施形態)
第4の実施形態は、実行中のタスクよりも優先順位の高いタスクの起動準備が整うと、実行中のタスクを中断して、優先順位の高いタスクを起動するものである。
【0047】
第4の実施形態のブロック構成は、図4や図7と同様である。図8は本発明に係るプロセッサの第4の実施形態の動作を説明するタイムチャートである。図8は3つのタスクA,B,Cが存在し、タスクAの優先順位が最も高く、次にタスクBの優先順位が高く、タスクCの優先順位が最も低い例を示している。
【0048】
まず、時刻t0でタスクCが起動したとする。その後、時刻t1でタスクBの起動準備が整ったとする。これにより、実行タスク決定部12はタスクCの実行を中断して、代わりにタスクBの起動を開始する。
【0049】
その後、時刻t2でタスクAの起動準備が整ったとする。これにより、実行タスク決定部12はタスクBの実行を中断して、代わりにタスクAの起動を開始する。
【0050】
その後、時刻t3でタスクAの実行が終了したとすると、次に優先順位の高いタスクBの実行を再開し、時刻t4でタスクBの実行が終了したとすると、次に一番優先順位の低いタスクCの実行を開始する。
【0051】
このように、第4の実施形態では、実行中のタスクよりも優先順位の高いタスクの起動準備が整うと、実行中のタスクの処理を中断して、優先順位の高いタスクの実行を開始するようにしたため、重要なタスクを常に優先的に処理でき、プロセッサ全体の処理能力の向上が図れる。
【0052】
(第5の実施形態)
以下に説明する第5〜第11の実施形態は、実行中のタスクを迅速に切り替える仕組みに関する。
【0053】
図9は本発明に係るプロセッサの第5の実施形態の概略構成を示すブロック図である。図9のプロセッサは、図4と同様のタスク起動部11、実行タスク決定部12及びタスクID・優先順位供給部14を備えており、その他に、複数のレジスタセットからなるレジスタセット群21と、レジスタセット群21の中からいずれか1つのレジスタセットを選択するレジスタセット選択部22と、選択されたレジスタセットを用いて演算処理を行う演算部23と、を備えている。これらレジスタセット、レジスタセット選択部22及び演算部23でプロセッサコア13を構成している。
【0054】
レジスタセット選択部22の内部には、レジスタセット群21の中から1つのレジスタセットを選択するデコーダ22aが設けられている。このデコーダ22aは、実行タスク決定部12からのタスクIDに対応するレジスタセットの選択信号を出力する。
【0055】
各レジスタセットは、個々のタスクに固有の情報をすべて含む1以上のレジスタからなる。レジスタセットを構成する各レジスタの種類は、プロセッサのアーキテクチャに依存し、例えば、プログラムカウンタ(PC)、スタックポインタ(SP)、または汎用レジスタ(R0,R1,…)などである。本明細書では、1つのレジスタセット内のレジスタの総数をr(rは1以上の整数)とする。
【0056】
レジスタセットの総数は、時分割で実行可能なタスクの数n以上のm個(mは整数)である。各レジスタセットは、固有の識別番号(レジスタセットID)で識別される。
【0057】
実行中のタスクは、1つのレジスタセットを用いる。タスクごとに使用するレジスタの種類が異なる場合には、各タスクごとに専用のレジスタセットを設けてもよい。プロセッサの設計時に、レジスタセットを構成するレジスタの種類を決めてもよいし、プログラム命令により事後的にレジスタセットを構成するレジスタの種類を変更してもよい。
【0058】
タスクごとに使用するレジスタの種類が異なる場合には、必要に応じて、図10に示すようなタスクIDとレジスタセットIDとの対応関係を登録したレジスタセットIDタスクID対応部24を設け、このテーブルを参照して、各タスクに対応するレジスタセットを決定してもよい。
【0059】
レジスタセットIDタスクID対応部24は、より詳細には、図11のようなテーブルで構成される。図11のテーブルは、プロセッサの設計時に作成してその後の変更ができないようにしてもよいし、プロセッサの起動後に何らかの命令によりテーブルの内容を変更できるようにしてもよい。
【0060】
図9や図10の実行タスク決定部12がタスクの切替を行うと、切替後のタスクのタスクIDが実行タスク決定部12からレジスタセット選択部22に通知される。レジスタセット選択部22は、図11のテーブル等を用いて、切替後のタスクに対応するレジスタセットIDを取得し、そのIDに対応するレジスタセットの値を演算部23に供給する。演算部23は、レジスタセット選択部22で選択されたレジスタセットの値を各レジスタに設定して演算処理を行い、その演算処理結果をレジスタセット選択部22で選択されたレジスタセットに格納する。
【0061】
このように、第5の実施形態では、タスクの切替が起きると、レジスタセットも切り替えるようにしたため、タスク切替時の処理準備時間を短縮でき、タスクの高速切替を実現できる。また、いったんタスクの処理を中断した後に再開する場合も、再開前にレジスタセットの値を読み込めばよいため、いったん中断したタスクの処理を迅速に再開することができる。
【0062】
(第6の実施形態)
第6の実施形態は、レジスタセット群21の中の少なくとも一部のレジスタセットを外部に退避するものである。
【0063】
図12は本発明に係るプロセッサの第6の実施形態の概略構成を示すブロック図である。図12のプロセッサは、図10の構成に加えて、ヒット判定部31と、外部レジスタセット記憶部32と、外部記憶制御部33と、レジスタセット転送部34と、を有する。
【0064】
本実施形態のレジスタセット群21は、時分割で実行するタスクの数nより多くても少なくても等しくても構わない。
【0065】
ヒット判定部31は、実行すべきタスクのレジスタセットがレジスタセットIDタスクID対応部24に登録されているか否かを判定する。レジスタセット転送部34は、レジスタセット群21の中の少なくとも一部のレジスタセットの内容を外部レジスタセット記憶部32に転送するとともに、外部レジスタセット記憶部32から読み出したレジスタセットの内容をレジスタセット群21に転送する。外部レジスタセット記憶部32は、レジスタセット群21の中の少なくとも一部のレジスタセットの内容を記憶する。
【0066】
図13は外部レジスタセット記憶部32のデータ構成を示す図である。外部レジスタセット記憶部32は、レジスタセット群21に含まれる任意のレジスタセットの内容を記憶でき、また記憶したレジスタセットの内容をレジスタセット群21に転送することもできる。外部レジスタセット記憶部32に記憶された各レジスタセットはタスクIDで管理され、いったん記憶されたレジスタセットの内容を呼び出す際も、タスクIDを指定する。
【0067】
このように、外部レジスタセット記憶部32は、レジスタセット群21の中の少なくとも一部のレジスタセットの内容を一時的に退避し、必要に応じてレジスタセット群21に転送することができる。
【0068】
外部レジスタセット記憶部32は、専用のハードウェアで構成してもよいし、主記憶メモリなどの予め設けられているメモリの一部領域を利用してもよい。
【0069】
図14はヒット判定部31の処理手順を示すフローチャートである。まず、実行すべきタスクを表すタスクIDに対応するレジスタセットIDがレジスタセットIDタスクID対応部24に登録されているか否かを判定する(ステップS11)。登録されていれば、ヒットしたと判定して、該当するタスクIDに対応するレジスタセットIDを取得する(ステップS12)。この場合、図5と同様の手順でタスク切替を行う。
【0070】
一方、登録されていなければ、ミスしたと判定し(ステップS13)、外部レジスタセット記憶部32から該当するレジスタセットを呼び出して、レジスタセット群21の一部の入れ替え処理を行う。
【0071】
より具体的には、まず、レジスタセット群21の中の少なくとも一部のレジスタセットの内容をレジスタセット転送部34を介して外部レジスタセット記憶部32に転送する。同時に、実行すべきタスクが利用するレジスタセットの内容を外部レジスタセット記憶部32から読み出して、レジスタセット転送部34を介してレジスタセット群21に転送する。
【0072】
このように、第6の実施形態では、レジスタセット群21の中の少なくとも一部のレジスタセットの内容を外部レジスタセット記憶部32に退避し、必要に応じて外部レジスタセット記憶部32からレジスタセット群21にレジスタセットの内容を戻せるようにしたため、レジスタセット群21の中のレジスタセットの総数以上のタスクを処理することができる。したがって、レジスタセット群21の中のレジスタセットの数を削減でき、プロセッサのサイズを小型化できる。
【0073】
(第7の実施形態)
第7の実施形態は、ヒット判定部31でヒットしなかったときに、退避させるべきレジスタセットを予め指定するものである。
【0074】
図15は本発明に係るプロセッサの第7の実施形態の概略構成を示すブロック図である。図15のプロセッサは、図12の構成に加えて、退避レジスタセット決定部35を備えている。
【0075】
退避レジスタセット決定部35は、タスクID・優先順位供給部14から供給された優先順位に基づいて、外部レジスタセット記憶部32に退避させるべきレジスタセットをレジスタセット群21の中から決定する。レジスタセット転送部34は、退避レジスタセット決定部35で決定されたレジスタセットの内容を外部レジスタセット記憶部32に転送するとともに、外部レジスタセット記憶部32から読み出したレジスタセットの内容をレジスタセット群21に転送する。
【0076】
図16は退避レジスタセット決定部35の処理手順を示すフローチャートである。まず、レジスタセット群21の中に利用するレジスタセットが存在し、かつそのレジスタセットに対応するタスクが実行不可能であるか否かを判定する(ステップS21)。判定がYesの場合、該当するタスクの中で最も優先順位の低いタスクを選択する(ステップS22)。
【0077】
一方、ステップS21の判定がNoの場合、レジスタセット群21の中の各レジスタセットに対応するタスクのうち、最も優先順位の低いタスクを選択する(ステップS23)。
【0078】
ステップS22またはS23の処理が終了すると、選択されたタスクが利用するレジスタセットのID(レジスタセットID)を取得し(ステップS24)、取得したIDをレジスタセット転送部34に指示する(ステップS25)。
【0079】
このように、第7の実施形態では、外部レジスタセット記憶部32に退避すべきレジスタセットを明示的に指定できるようにしたため、使用頻度の低いレジスタセットを入れ替えることができ、レジスタセットの退避による処理効率の低下を防止できる。
【0080】
(第8の実施形態)
上述した第6及び第7の実施形態は、実行すべきタスクが利用するレジスタセットがレジスタセット群21に存在するか否かをヒット判定部31で判定する処理を行うため、タスクの切替を迅速に行えないおそれがある。そこで、以下に説明する第8の実施形態は、ヒット判定部31が処理を行っている間に、ヒット判定部31の判定結果の影響を受けないタスクの処理を行うものである。
【0081】
図17は本発明に係るプロセッサの第8の実施形態の概略構成を示すブロック図である。図17の実行タスク決定部12は、図15の実行タスク決定部12とは異なる処理を行う。すなわち、図17の実行タスク決定部12は、ヒット判定部31に対して判定結果の送信を要求し、ヒット判定部31からの判定結果を受信する。
【0082】
図17のレジスタセットIDタスクID対応部24は、図18に示すように、個々のタスクID及びレジスタセットIDに対応づけて、フラグを有する。このフラグは、あるタスクを実行しようとしたが、ヒット判定部31でミスし、そのタスクが利用するレジスタセットの内容を外部レジスタセット記憶部32から転送する処理を行っている最中にセットされる。
【0083】
実行タスク決定部12は、実行するタスクを切り替える際に、ミス時転送ヒット判定要求またはヒット判定要求のいずれかを出す。ミス時転送ヒット判定要求は、ヒット判定部31に対してタスクIDを通知し、ミスした場合には、そのタスクが利用するレジスタセットを外部レジスタセット転送装置からレジスタセット群21に転送するようレジスタセット選択部22に指示するものである。
【0084】
ミス時転送ヒット判定要求を受けた場合のヒット判定部31の処理手順は図19のフローチャートで表される。まず、実行すべきタスクのタスクIDがレジスタセットIDタスクID対応部24に登録されているか否かを判定する(ステップS31)。登録されていれば、該当するタスクIDに対応するレジスタセットIDを取得し(ステップS32)、登録されていなければ、ミスと判定して(ステップS33)、該当するタスクが利用するレジスタセットの転送をレジスタセット転送部34に指示する(ステップS34)。
【0085】
一方、ヒット判定要求は、ヒット判定部31に対してタスクIDを通知し、フラグが有効であるレジスタセットを除外してヒット判定を行うものである。ミスした場合でもレジスタセットの転送は行わない。
【0086】
ヒット判定要求を受けた場合のヒット判定部31の処理手順は図20のフローチャートで表される。まず、フラグがセットされているタスクIDを除いて、実行すべきタスクのタスクIDがレジスタセットIDタスクID対応部24に登録されているか否かを判定する(ステップS41)。登録されていれば、そのタスクIDに対応するレジスタセットIDを取得し(ステップS42)、登録されていなければ、ミスしたと判定する(ステップS43)。
【0087】
レジスタセットIDタスクID対応部24の中に、セットされているフラグが存在しない場合には、実行タスク決定部12は、実行するタスクを切り替える際に、切替後のタスクIDでミス時転送ヒット判定要求を出す。ヒットした場合には、実行タスク決定部12は、ヒットした新しいタスクIDに対応するレジスタセットIDをレジスタセットIDタスクID対応部24から取得し、そのレジスタセットIDをレジスタセット選択部22に通知し、新しいタスクの実行を開始する。一方、ミスした場合は、ヒット判定部31はレジスタセット転送部34にレジスタセットの転送を指示し、レジスタセットIDタスクID対応部24は、転送を行うレジスタセットに対応するフラグをセットする。
【0088】
レジスタセットの転送が終了すると、レジスタセット転送部34は、レジスタセットIDタスクID対応部24に転送完了を通知する。この通知に従って、レジスタセットIDタスクID対応部24はレジスタセットのフラグを無効化する。
【0089】
実行タスク決定部12は、実行すべきタスクに対応するレジスタセットIDをレジスタセットIDタスクID対応部24から取得し、取得したレジスタセットIDをレジスタセット選択部22に通知して、そのタスクの実行を開始する。
【0090】
レジスタセットIDタスクID対応部24の中に、セットされているフラグが存在する場合には、実行タスク決定部12は、実行するタスクを切り替える際に、切替後のタスクIDでヒット判定要求を出す。ヒットした場合には、実行タスク決定部12は、ヒットした新しいタスクIDに対応するレジスタセットIDをレジスタセットIDタスクID対応部24から取得し、そのレジスタセットIDをレジスタセット選択部22に通知し、新しいタスクの実行を開始する。一方、ミスした場合には、タスクの切替を行わない。
【0091】
図21はレジスタセットIDタスクID対応部24の中にセットされているフラグが存在する場合のタスクの実行形態を説明する図である。この例では、タスクID5のタスクを実行中に、このタスクよりも優先順位の高いタスクID1のタスクの実行が可能になったときに、実行タスク決定部12はヒット判定部31に対してタスクID1のミス時転送ヒット判定要求を行う。
【0092】
この例では、この要求を受けたヒット判定部31はミス判定を行っており、これにより、レジスタセット転送部34はタスクID1が利用するレジスタをレジスタセット群21で転送を開始する。この転送には、時刻t3までの時間がかかる。
【0093】
時刻t1〜t3の間の時刻t2でタスクID5の実行が終了すると、実行タスク決定分は実行可能なタスクの中で最も優先順位の高いタスク(図21の例ではタスクID7)のヒット判定要求を行う。ヒットした場合には、タスクID7の実行を行う。
【0094】
その後、時刻t3になると、レジスタセット転送部34からの転送完了が通知され、それによって実行タスク決定分はタスクID1の実行を開始する。
【0095】
このように、第8の実施形態では、あるタスクが利用するレジスタセットの転送中に、そのタスクの実行に影響しない他のタスクの実行を行うようにしたため、レジスタセットの転送完了を待つことなくタスクの処理を行え、タスクの処理効率を向上できる。
【0096】
(第9の実施形態)
第9の実施形態は、レジスタセットを構成する各レジスタに、レジスタの内容が更新されたか否かを示すフラグを設けるものである。
【0097】
第9の実施形態は、図12と同様のブロック構成を有するが、レジスタセット群21のレジスタセットのデータ構造が図12とは異なっている。図22は第9の実施形態のレジスタセットのデータ構造を示す図である。図示のように、レジスタセットを構成する各レジスタに対応して変更フラグが設けられている。この変更フラグは、対応するレジスタの内容を書き換えるときにセットされる。この場合の処理手順は図23のようなフローチャートで表される。
【0098】
図23において、まず、書き換えるレジスタに対応する変更フラグをセットし(ステップS51)、その後にレジスタを書き換える(ステップS52)。
【0099】
図22の変更フラグは、外部レジスタセット記憶部32に記憶されているレジスタセットを読み込むときにクリアされる。外部レジスタセット記憶部32からレジスタセット群21への転送要求があった場合の処理手順は図24のようなフローチャートで表される。
【0100】
図24において、まず、転送先のレジスタセット内の変更フラグをすべてクリアし(ステップS61)、その後にレジスタセットを転送する(ステップS62)。
【0101】
図25はレジスタセット群21が外部レジスタセット記憶部32にレジスタセットの内容の転送要求を行った場合のレジスタセット転送部34の処理手順を示すフローチャートである。まず、転送するレジスタセット内の1つのレジスタについて注目し(ステップS71)、注目したレジスタセットの変更フラグがセットされているか否かを判定する(ステップS72)。
【0102】
セットされている場合には、転送するレジスタを外部レジスタセット記憶部32に転送する(ステップS73)。セットされていない場合か、ステップS73の処理が終了した場合は、すべてのレジスタについて処理を行ったか否かを判定し(ステップS74)、処理を行っていないものがあればステップS71に戻り、処理を行った場合は終了する。
【0103】
このように、第9の実施形態では、レジスタセット群21の中に含まれるレジスタのうち、変更のあったものだけを外部レジスタセット記憶部32に転送するようにしたため、転送すべきデータ量を削減でき、転送時間の削減が図れる。
【0104】
(第10の実施形態)
第10の実施形態は、外部レジスタセット記憶部32の中に、各レジスタセットの各レジスタが書き換えられたか否かを示すフラグを有する。
【0105】
図26は外部レジスタセット記憶部32のデータ構造を示す図である。図示のように、各レジスタセットの各レジスタに対応して、有効フラグが設けられている。この有効フラグは、対応するレジスタが書き換えられた場合にセットされる。
【0106】
図27は有効フラグの初期化処理を示すフローチャートであり、タスクの起動時に外部記憶制御部33が行う処理である。外部記憶制御部33は、起動するタスクに対応するレジスタセット内の有効フラグすべてをクリアする(ステップS81)。
【0107】
図28は有効フラグのセット処理を示すフローチャートであり、レジスタセット転送部34から外部レジスタセット記憶部32へのレジスタセットの転送要求があったときに、外部記憶制御部33が行う処理である。外部記憶制御部33は、外部レジスタセット記憶部32の転送するレジスタに対応する有効フラグをセットする(ステップS91)。その後、レジスタセット群21から外部レジスタセット記憶部32への該当レジスタの転送を行う(ステップS92)。
【0108】
図29は外部レジスタセット記憶部32からレジスタセット群21への転送要求があった場合の外部記憶制御部33の処理手順を示すフローチャートである。まず、転送するレジスタセット内の有効フラグを読み込む(ステップS101)。次に、転送するレジスタセット内の1つのレジスタについて着目する(ステップS102)。
【0109】
このレジスタに対応する有効フラグがセットされているか否かを判定し(ステップS103)、セットされていれば、レジスタを外部レジスタセット記憶部32に転送する(ステップS104)。次に、すべてのレジスタについて処理を行ったか否かを判定し(ステップS105)、まだ処理を行っていないレジスタがあれば、ステップS101以降の処理を繰り返す。
【0110】
このように、第10の実施形態では、外部レジスタセット記憶部32の中に、レジスタの書き換えを行ったか否かを示す有効フラグを設けるため、レジスタの内容が書き換えられた場合のみ、外部レジスタセット記憶部32からレジスタセット群21にレジスタの内容を転送すればよく、転送回数を削減できるとともに、転送時間も短縮できる。
【0111】
(第11の実施形態)
第11の実施形態は、外部レジスタセット記憶部32の各タスクのレジスタセットをリスト構造にするものである。
【0112】
図30は第11の実施形態の外部レジスタセット記憶部32のデータ構造を示す図である。外部レジスタセット記憶部32は、リスト構造になっており、変更のあったレジスタの値を記憶するレジスタ値記憶領域と、レジスタ値記憶領域に記憶されているレジスタの識別番号(レジスタID)とを組にして記憶する。すなわち、外部レジスタセット記憶部32は、内容に変更のないレジスタの値は記憶しない。
【0113】
図31は外部レジスタセット記憶部32からレジスタセット群21への転送要求があった場合の外部記憶制御部33の処理手順を示すフローチャートである。まず、転送するレジスタセットのリストの先頭にポインタを移動する(ステップS111)。次に、外部レジスタセット記憶部32のリストからレジスタIDとレジスタの値を読み込む(ステップS112)。次に、レジスタIDに対応するレジスタセット群21のレジスタにレジスタの値を書き込む(ステップS113)。次に、リストの最後か否かを判定する(ステップS114)。リストの最後であれば処理を終了し、リストの最後でなければ、リストの次の項目に移動してステップS111以降の処理を繰り返す。
【0114】
図32はレジスタセット転送部34から外部レジスタセット記憶部32にレジスタの転送要求があった場合の外部記憶制御部33の処理手順を示すフローチャートである。まず、転送するレジスタIDが外部レジスタセット記憶部32の対応するリスト中にあるか否かを判定する(ステップS121)。リスト中になければ、リストに転送するレジスタIDの項目を追加する(ステップS122)。
【0115】
ステップS121でリスト中にあると判定された場合か、ステップS122の処理が終了した場合は、リストの転送するレジスタIDに対応するレジスタ値記憶領域に、レジスタの値を書き込む(ステップS123)。
【0116】
図33はタスク終了時の外部記憶制御部33の処理手順を示すフローチャートである。外部レジスタセット記憶部32の中の終了したタスクに対応するリストの内容を破棄する(ステップS131)。
【0117】
このように、第11の実施形態では、外部レジスタセット記憶部32をリスト構造にし、変更のあったレジスタの値のみを記憶するようにしたため、外部レジスタセット記憶部32のメモリ容量を削減できるとともに、レジスタセット群21との間で転送されるデータ量も削減できる。
【0118】
上述した第1〜第11の実施形態では、本発明をプロセッサに適用した例を説明したが、本発明はプロセッサ以外の半導体集積装置にも適用可能である。例えば、図1等の実行タスク決定部12のみをプロセッサとは別個に設けてもよい。
【0119】
【発明の効果】
以上詳細に説明したように、本発明によれば、第1及び第2のFIFO型記憶手段のデータ格納状態によりタスクの起動準備が整ったか否かを判断し、起動準備が整ったタスクのみ起動するようにしたため、オペレーティングシステムなしでタスクの起動スケジューリングを行うことができ、オペレーティングシステムのオーバーヘッドがなくなって、複数のタスクを効率よく処理することができる。
【0120】
また、タスクで処理するデータを格納する第1及び第2のFIFO型記憶手段を監視するため、データを消失するおそれがなくなり、信頼性の高いタスク処理を行うことができる。
【図面の簡単な説明】
【図1】ソフトウェア無線機の処理内容を示す図。
【図2】タスク間にFIFOを設けたプロセッサの概略構成図。
【図3】本発明に係るプロセッサの第1の実施形態の概略構成を示すブロック図。
【図4】本発明に係るプロセッサの第2の実施形態の概略構成を示すブロック図。
【図5】実行タスク決定部12とタスクID・優先順位供給部14の詳細構成を示すブロック図。
【図6】図5の実行タスク決定部12の処理手順を示すフローチャート。
【図7】本発明に係るプロセッサの第3の実施形態の概略構成を示すブロック図。
【図8】本発明に係るプロセッサの第4の実施形態の動作を説明するタイムチャート。
【図9】本発明に係るプロセッサの第5の実施形態の概略構成を示すブロック図。
【図10】図9の変形例を示すプロセッサのブロック図。
【図11】レジスタセットIDタスクID対応部24のデータ構造を示す図。
【図12】本発明に係るプロセッサの第6の実施形態の概略構成を示すブロック図。
【図13】外部レジスタセット記憶部32のデータ構成を示す図。
【図14】ヒット判定部31の処理手順を示すフローチャート。
【図15】本発明に係るプロセッサの第7の実施形態の概略構成を示すブロック図。
【図16】退避レジスタセット決定部35の処理手順を示すフローチャート。
【図17】本発明に係るプロセッサの第8の実施形態の概略構成を示すブロック図。
【図18】第8の実施形態のレジスタセットIDタスクID対応部のデータ構造を示す図。
【図19】ミス時転送ヒット判定要求を受けた場合のヒット判定部の処理手順を示すフローチャート。
【図20】ヒット判定要求を受けた場合のヒット判定部の処理手順を示すフローチャート。
【図21】レジスタセットIDタスクID対応部24の中にセットされているフラグが存在する場合のタスクの実行形態を説明する図。
【図22】第9の実施形態のレジスタセットのデータ構造を示す図。
【図23】レジスタの書き換え要求があった場合の処理手順を示すフローチャート。
【図24】外部レジスタセット記憶部からレジスタセット群への転送要求があった場合の処理手順を示すフローチャート。
【図25】レジスタセット群から外部レジスタセット記憶部への転送要求があった場合の処理手順を示すフローチャート。
【図26】外部レジスタセット記憶部32のデータ構造を示す図。
【図27】タスク起動時の処理手順を示すフローチャート。
【図28】レジスタセット転送部から外部レジスタセット記憶部へのレジスタ転送要求があった場合の処理手順を示すフローチャート。
【図29】外部レジスタセット記憶部からレジスタセット群への転送要求があった場合の処理手順を示すフローチャート。
【図30】第11の実施形態の外部レジスタセット記憶部32のデータ構造を示す図。
【図31】外部レジスタセット記憶部からレジスタセット群への転送要求があった場合の処理手順を示すフローチャート。
【図32】レジスタセット転送部から外部レジスタセット記憶部へのレジスタ転送要求があった場合の処理手順を示すフローチャート。
【図33】タスク終了処理を示すフローチャート。
【符号の説明】
11 タスク起動部
12 実行タスク決定部
13 プロセッサコア
14 タスクID・優先順位供給部
15 実行可能タスクIDリスト
16 プライオリティエンコーダ
17 時刻計測部
18 起動時刻テーブル
19 平均時間感覚計算部
20 優先順位決定部
21 レジスタセット群
22 レジスタセット選択部
23 演算部
24 レジスタセットIDタスクID対応部
30 優先順位変更部
31 ヒット判定部
32 外部レジスタセット記憶部
33 外部記憶制御部
34 レジスタセット転送部
35 退避レジスタセット決定部
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a processor that executes a plurality of tasks in a time-sharing manner and an execution task determination device.
[0002]
[Prior art]
When a processor executes a plurality of tasks in a time-division manner, it is common to switch tasks using software such as an operating system.
[0003]
The operating system detects whether or not each task becomes executable at regular intervals. Whether or not execution is possible can be determined by, for example, whether data to be processed is ready.
[0004]
While the operating system is performing such determination processing, the task execution must be interrupted. When the execution of a task is interrupted, the contents of a general-purpose register, a stack pointer (SP), and a program counter (PC) are saved in a main memory outside the processor. The saved information is managed by the operating system together with the task identification information (task ID).
[0005]
The operating system has a scheduler, and the scheduler determines a task to be actually executed from executable tasks according to a method such as round robin.
[0006]
The operating system acquires various information saved in the main memory or the like for the task determined to be executed by the scheduler, and stores the contents of the general-purpose register, the stack pointer (SP), and the program counter (PC) in the save destination. Each register is restored from a main storage device or the like outside the processor, and then execution of the task is started.
[0007]
A method of realizing parallel processing of real-time data using a plurality of hardware data processing units has also been proposed (for example, see Patent Document 1). However, there is a problem that the configuration itself is complicated, such as providing a plurality of data processing cores for performing parallel processing and further providing an arbitration mechanism for them.
[0008]
[Patent Document 1]
JP 2000-509528 Gazette
[0009]
[Problems to be solved by the invention]
In task switching using software such as an operating system, there is an overhead due to the operation of the operating system itself, and it is necessary to prepare a processor with higher performance than that required for the original task processing.
[0010]
Further, in task switching by the operating system, it takes time to switch tasks, and it is difficult to construct a system with real-time properties.
[0011]
Furthermore, since the operating system only determines whether a task can be executed at regular time intervals, the operating system determines that the task can be executed after the task is executable, and waits until the task is actually executed. However, the response was poor. This poor response has made it more difficult to construct a system with real-time characteristics.
[0012]
In addition, when it is determined that the task can be started on the condition that data to be processed is ready, data may not be stored in an area for storing a processing result, and in such a case, data may be lost. Become.
[0013]
On the other hand, when realizing real-time processing by using many hardware, conventionally, the configuration tends to be complicated and the cost tends to be high.
[0014]
The present invention has been made in view of such a point, and an object of the present invention is to provide a processor and an execution task determination device that can efficiently execute a plurality of tasks in real time.
[0015]
[Means for Solving the Problems]
In order to solve the above-described problem, the present invention provides a processor for processing a plurality of tasks in a time-division manner, wherein one or more first and / or first processors for storing data used in the processing of the predetermined task for a predetermined task. (First In First Out) type storage means and a processing result after performing the task processing using the data obtained from the first FIFO type storage means, and the stored processing result If there is another task that uses the task, one or more second FIFO-type storage means for storing data used in the processing of the other task, and the first FIFO-type storage means performs processing of the task. To determine whether or not the second FIFO type storage means has data to be used in the second FIFO type storage means, and whether or not there is a free area for storing the processing result of the task. Comprising a click determining means, based on the determination result of the task determining means, and a execution task determining means for determining a next to be started task from among the plurality of tasks.
[0016]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, a processor and an execution task determination device according to the present invention will be specifically described with reference to the drawings.
[0017]
(Principle of the present invention)
There is an increasing demand to execute multiple tasks in real time on a time-sharing basis. For example, FIG. 1 is a diagram showing processing contents of a software defined radio. In the software defined radio of FIG. 1, processes A to D are continuously executed. For example, in the process B, the result of performing a predetermined arithmetic process using the output of the process A as an input is passed to the process C.
[0018]
In FIG. 1, the number of output data in each process does not always match the number of data required to start the next process. Also, the processing amount of each processing varies depending on the processing content. Furthermore, since the timing of data transfer differs between processes, it is necessary to synchronize between stages of each process.
[0019]
In order to efficiently realize the processing of FIG. 1, each processing is often generated as one or more tasks. Each task may be realized by software or hardware.
[0020]
In the present invention, a FIFO (First In First Out) is inserted between tasks so that strict synchronization between tasks is not required. The FIFO generally refers to a method of storing data. In the embodiments described below, a method in which stored data is sequentially retrieved from those stored in the past, that is, a FIFO type storage device. The most recently stored data is the last to be retrieved, and for example, a data structure called a queue is a storage device of this type. The schematic configuration of the processor in this case is as shown in FIG.
[0021]
In FIG. 2, FIFO 1 outputs input data to task 1, and FIFO 2 receives output data from task 1 and outputs input data to task 2.
[0022]
In FIG. 2, one FIFO is provided on the input side and one output side of each task. However, a plurality of FIFOs may be provided.
[0023]
Although it is possible to realize the software defined radio with the configuration shown in FIG. 2, since the amount of processing for synchronizing each task is large, even if a FIFO is used, software synchronization is performed by a processor. Overhead becomes large and implementation is difficult.
[0024]
Here, focusing on the activation condition of each task, each task does not need to be activated when input data does not exist. If there is no free space for storing the processing result of each task in the FIFO on the output side of each task, there is a possibility that the processing result of each task may be lost. In this case, there is no need to activate the task.
[0025]
Therefore, each embodiment of the present invention described below monitors the storage state of data in the FIFO, and only when there is input data to each task and there is a free area in the FIFO on the output side. Have started the task.
[0026]
(1st Embodiment)
FIG. 3 is a block diagram showing a schematic configuration of the first embodiment of the processor according to the present invention. The processor in FIG. 3 includes a task activation unit 11 that determines whether each of a plurality of tasks can be activated, an execution task determination unit 12 that determines a task to be activated based on the determination result of the task activation unit 11, A processor core 13 for executing the task determined by the task determining unit 12.
[0027]
A plurality of FIFOs 10 are connected to the task activation unit 11. Each FIFO 10 corresponds to the FIFO 10 in FIG. 2, and the task activating unit 11 exchanges data between the FIFOs 10. More specifically, the task activation unit 11 holds the output data of the FIFO 10 to be input to the task, and checks whether there is an empty area in another FIFO 10 in which the processing result of the task is to be stored. . Then, it is determined that the task should be started only when there is output data of the FIFO 10 to be input to the task and there is a free area in another FIFO 10 in which the processing result of the task is to be stored.
[0028]
When there are a plurality of tasks that can be activated, the execution task determination unit 12 selects any one of the tasks. For example, the task with the smallest task ID for identifying each task is executed.
[0029]
The processor core 13 includes, for example, an instruction acquisition unit, an instruction interpretation unit, an instruction execution unit, an instruction execution result storage unit that stores an instruction execution result, and an instruction execution state storage unit that stores an execution state of an instruction.
[0030]
As described above, in the first embodiment, the FIFO 10 holds the data to be input to the task, and determines whether or not there is a free area in another FIFO 10 in which the execution result of the task is to be stored. Since the execution task determination unit 12 determines the task to be started based on the determination result, the task can be scheduled without an operating system, and is not affected by the overhead of the operating system. Tasks can be processed in real time.
[0031]
(Second embodiment)
In the second embodiment, priorities are assigned to a plurality of tasks, and the tasks are executed according to the priorities.
[0032]
FIG. 4 is a block diagram showing a schematic configuration of a second embodiment of the processor according to the present invention. The processor in FIG. 4 includes a task ID / priority supply unit 14 for supplying task IDs and priorities of a plurality of tasks in addition to the configuration in FIG.
[0033]
FIG. 5 is a block diagram showing the detailed configurations of the execution task determination unit 12 and the task ID / priority supply unit 14. As shown in the figure, the task ID / priority supply unit 14 stores the correspondence between the task ID of each task and the priority. The execution task determining unit 12 includes an executable task ID list 15 in which a list of executable tasks notified from the task activating unit 11 is registered, and a priority encoder 16 that determines a task to be activated.
[0034]
The priority encoder 16 acquires the priority of the tasks registered in the task ID list from the task ID / priority supply unit 14, and determines, for example, the task with the highest priority as the activation task.
[0035]
There is no particular limitation on the method of setting the priority supplied by the task ID / priority supply unit 14. For example, when a new task is generated, the priority of the task may be set, The priority order may be changed.
[0036]
FIG. 6 is a flowchart showing a processing procedure of the execution task determining unit 12 of FIG. First, the task ID of the task registered in the executable task ID list 15 is referred to (step S1), and the priority corresponding to the task ID is acquired from the task ID / priority supply unit 14 (step S2).
[0037]
Next, it is determined whether or not the priority acquired in step S2 is higher than the priority of the task activation candidate (step S3). If higher, the task having the task ID referred to in step S1 is set as the activation candidate. (Step S4).
[0038]
When the processing in step S4 is completed, or when it is determined in step S3 that the task is not high, it is determined whether or not a task whose priority has not yet been compared remains in the executable task ID list 15 (step S4). S5) If remaining, the processing after step S1 is repeated, and if not remaining, the processing is terminated.
[0039]
As described above, in the second embodiment, since the priorities of the tasks are determined in advance, when a plurality of tasks are listed as the activation candidates, the task with the higher priority can be executed preferentially, and the processing efficiency can be improved. Can be achieved. In addition, it is possible to quickly select a task to be started.
[0040]
(Third embodiment)
In the third embodiment, the priority can be dynamically changed.
[0041]
FIG. 7 is a block diagram showing a schematic configuration of a third embodiment of the processor according to the present invention. The processor in FIG. 7 includes a priority changing unit 30 that dynamically changes task priorities in addition to the configuration in FIG.
[0042]
The priority change unit 30 includes a time measurement unit 17 that measures the execution time of each task, a startup time table 18 in which a correspondence between the task ID of each task and a past startup time is registered, and a startup interval of each task. It has an average time interval calculation unit 19 for calculating an average, and a priority determination unit 20 for determining the priority of each task based on the calculation result of the average time interval calculation unit 19.
[0043]
The smaller the calculation result of the average time interval calculator 19, the more frequently the task is started. For this reason, the priority determination unit 20 sets a higher priority, for example, for a task with a smaller calculation result of the average time interval calculator 19.
[0044]
More specifically, the average time interval calculation unit 19 calculates the data input interval to each FIFO 10 and sets the priority order in the priority order determination unit 20 so that the priority order of the task corresponding to the FIFO 10 whose interval is short becomes higher. Is determined. Alternatively, the average time interval calculation unit 19 calculates the execution interval of each task notified from the processor core 13 and determines the priority in the priority order determination unit 20 so that the priority of the task with the short interval becomes higher. You may. Alternatively, the average time interval calculating unit 19 monitors the free area of each FIFO 10 that supplies data to each task, and the priority order determining unit 20 sets the priority of the task corresponding to the FIFO 10 with the small free area to be higher. The ranking may be determined. Alternatively, the average time interval calculation unit 19 calculates the data output interval from each task to each FIFO 10, and sets the priority order by the priority order determination unit 20 so that the priority order of the task corresponding to the FIFO 10 having the shortest interval becomes higher. You may decide.
[0045]
As described above, in the third embodiment, since the priority of each task can be dynamically changed, task scheduling can be performed with reference to the past execution history.
[0046]
(Fourth embodiment)
In the fourth embodiment, when a task having a higher priority than a task being executed is ready to be activated, the task being executed is interrupted and a task with a higher priority is activated.
[0047]
The block configuration of the fourth embodiment is the same as in FIGS. FIG. 8 is a time chart for explaining the operation of the fourth embodiment of the processor according to the present invention. FIG. 8 shows an example in which there are three tasks A, B, and C, in which task A has the highest priority, task B has the highest priority, and task C has the lowest priority.
[0048]
First, it is assumed that the task C is activated at time t0. Thereafter, it is assumed that the preparation for starting the task B is completed at time t1. As a result, the execution task determination unit 12 suspends the execution of the task C and starts the activation of the task B instead.
[0049]
Thereafter, it is assumed that the preparation for starting the task A is completed at time t2. As a result, the execution task determination unit 12 suspends the execution of the task B, and starts the activation of the task A instead.
[0050]
Thereafter, assuming that the execution of the task A is completed at time t3, the execution of the task B having the next highest priority is resumed. Execution of task C is started.
[0051]
As described above, in the fourth embodiment, when the preparation for starting a task having a higher priority than the task being executed is ready, the processing of the task being executed is interrupted, and the execution of the task having the higher priority is started. Thus, important tasks can always be processed with priority, and the processing performance of the entire processor can be improved.
[0052]
(Fifth embodiment)
The fifth to eleventh embodiments described below relate to a mechanism for quickly switching a task being executed.
[0053]
FIG. 9 is a block diagram showing a schematic configuration of a fifth embodiment of the processor according to the present invention. The processor of FIG. 9 includes a task start unit 11, an execution task determination unit 12, and a task ID / priority supply unit 14 similar to those of FIG. 4, and a register set group 21 including a plurality of register sets. A register set selecting unit 22 for selecting any one register set from the register set group 21 and an operation unit 23 for performing an operation process using the selected register set are provided. The processor core 13 is composed of the register set, the register set selection unit 22 and the operation unit 23.
[0054]
A decoder 22a for selecting one register set from the register set group 21 is provided inside the register set selection unit 22. The decoder 22a outputs a register set selection signal corresponding to the task ID from the execution task determination unit 12.
[0055]
Each register set consists of one or more registers that contain all the information specific to the individual task. The type of each register constituting the register set depends on the architecture of the processor, and is, for example, a program counter (PC), a stack pointer (SP), or a general-purpose register (R0, R1,...). In this specification, the total number of registers in one register set is r (r is an integer of 1 or more).
[0056]
The total number of register sets is m (m is an integer) equal to or greater than the number n of tasks that can be executed in a time-division manner. Each register set is identified by a unique identification number (register set ID).
[0057]
The task being executed uses one register set. If the type of register used differs for each task, a dedicated register set may be provided for each task. At the time of designing the processor, the types of the registers configuring the register set may be determined, or the types of the registers configuring the register set may be changed a posteriori by a program instruction.
[0058]
When the type of register used for each task is different, a register set ID task ID correspondence unit 24 in which the correspondence between the task ID and the register set ID is registered as shown in FIG. The register set corresponding to each task may be determined with reference to the table.
[0059]
More specifically, the register set ID task ID correspondence unit 24 is configured by a table as shown in FIG. The table in FIG. 11 may be created at the time of designing the processor so that it cannot be changed thereafter, or the contents of the table may be changed by some instruction after the processor is started.
[0060]
When the execution task determination unit 12 in FIG. 9 or FIG. 10 switches the task, the execution task determination unit 12 notifies the register set selection unit 22 of the task ID of the switched task. The register set selection unit 22 obtains a register set ID corresponding to the task after switching using the table or the like in FIG. 11 and supplies the register set value corresponding to the ID to the calculation unit 23. The operation unit 23 performs an operation by setting the value of the register set selected by the register set selection unit 22 to each register, and stores the operation result in the register set selected by the register set selection unit 22.
[0061]
As described above, in the fifth embodiment, when the task switching occurs, the register set is also switched, so that the processing preparation time at the time of task switching can be reduced, and high-speed switching of tasks can be realized. Also, when the processing of a task is interrupted and then resumed, the value of the register set may be read before resuming, so that the processing of the task that has been interrupted can be quickly resumed.
[0062]
(Sixth embodiment)
In the sixth embodiment, at least some of the register sets in the register set group 21 are saved to the outside.
[0063]
FIG. 12 is a block diagram showing a schematic configuration of a sixth embodiment of the processor according to the present invention. The processor in FIG. 12 includes a hit determination unit 31, an external register set storage unit 32, an external storage control unit 33, and a register set transfer unit 34 in addition to the configuration in FIG.
[0064]
The register set group 21 of the present embodiment may be more, less or equal to the number n of tasks to be executed in a time division manner.
[0065]
The hit determination unit 31 determines whether the register set of the task to be executed is registered in the register set ID task ID correspondence unit 24. The register set transfer unit 34 transfers the contents of at least a part of the register sets in the register set group 21 to the external register set storage unit 32, and transfers the contents of the register set read from the external register set storage unit 32 to the register set. Transfer to group 21. The external register set storage unit 32 stores the contents of at least some of the register sets in the register set group 21.
[0066]
FIG. 13 is a diagram showing a data configuration of the external register set storage unit 32. The external register set storage unit 32 can store the contents of an arbitrary register set included in the register set group 21, and can also transfer the stored contents of the register set to the register set group 21. Each register set stored in the external register set storage unit 32 is managed by a task ID, and the task ID is designated when the contents of the register set once stored are called.
[0067]
As described above, the external register set storage unit 32 can temporarily save the contents of at least a part of the register sets in the register set group 21 and transfer the contents to the register set group 21 as necessary.
[0068]
The external register set storage unit 32 may be configured by dedicated hardware, or may use a partial area of a memory provided in advance such as a main storage memory.
[0069]
FIG. 14 is a flowchart illustrating the processing procedure of the hit determination unit 31. First, it is determined whether a register set ID corresponding to a task ID indicating a task to be executed is registered in the register set ID task ID corresponding unit 24 (step S11). If registered, it is determined that a hit has occurred, and a register set ID corresponding to the corresponding task ID is obtained (step S12). In this case, task switching is performed in the same procedure as in FIG.
[0070]
On the other hand, if not registered, it is determined that a mistake has occurred (step S13), the corresponding register set is called from the external register set storage unit 32, and a part of the register set group 21 is replaced.
[0071]
More specifically, first, the contents of at least a part of the register sets in the register set group 21 are transferred to the external register set storage unit 32 via the register set transfer unit 34. At the same time, the contents of the register set used by the task to be executed are read from the external register set storage unit 32 and transferred to the register set group 21 via the register set transfer unit 34.
[0072]
As described above, in the sixth embodiment, the contents of at least some of the register sets in the register set group 21 are saved in the external register set storage unit 32, and the contents of the register set are stored in the external register set storage unit 32 as necessary. Since the contents of the register set can be returned to the group 21, tasks more than the total number of register sets in the register set group 21 can be processed. Therefore, the number of register sets in the register set group 21 can be reduced, and the size of the processor can be reduced.
[0073]
(Seventh embodiment)
In the seventh embodiment, a register set to be saved is specified in advance when the hit determination unit 31 does not hit.
[0074]
FIG. 15 is a block diagram showing a schematic configuration of a seventh embodiment of the processor according to the present invention. The processor in FIG. 15 includes a save register set determining unit 35 in addition to the configuration in FIG.
[0075]
The save register set determination unit 35 determines a register set to be saved in the external register set storage unit 32 from the register set group 21 based on the priority supplied from the task ID / priority supply unit 14. The register set transfer unit 34 transfers the contents of the register set determined by the save register set determination unit 35 to the external register set storage unit 32, and transfers the contents of the register set read from the external register set storage unit 32 to a register set group. Transfer to 21.
[0076]
FIG. 16 is a flowchart showing a processing procedure of the save register set determining unit 35. First, it is determined whether a register set to be used exists in the register set group 21 and a task corresponding to the register set cannot be executed (step S21). If the determination is Yes, the task with the lowest priority is selected from the tasks (step S22).
[0077]
On the other hand, if the determination in step S21 is No, the task with the lowest priority is selected from the tasks corresponding to each register set in the register set group 21 (step S23).
[0078]
When the processing in step S22 or S23 ends, the ID of the register set (register set ID) used by the selected task is obtained (step S24), and the obtained ID is instructed to the register set transfer unit 34 (step S25). .
[0079]
As described above, in the seventh embodiment, the register set to be saved can be explicitly specified in the external register set storage unit 32. Therefore, the register set that is not frequently used can be replaced, and the register set to be saved can be replaced. A reduction in processing efficiency can be prevented.
[0080]
(Eighth embodiment)
In the sixth and seventh embodiments, the hit determination unit 31 determines whether or not the register set used by the task to be executed exists in the register set group 21. May not be possible. Therefore, in an eighth embodiment described below, processing of a task that is not affected by the determination result of the hit determination unit 31 is performed while the hit determination unit 31 is performing processing.
[0081]
FIG. 17 is a block diagram showing a schematic configuration of an eighth embodiment of the processor according to the present invention. The execution task determination unit 12 of FIG. 17 performs a different process from the execution task determination unit 12 of FIG. That is, the execution task determination unit 12 in FIG. 17 requests the hit determination unit 31 to transmit the determination result, and receives the determination result from the hit determination unit 31.
[0082]
As shown in FIG. 18, the register set ID task ID correspondence unit 24 in FIG. 17 has a flag in association with each task ID and register set ID. This flag is set during execution of a process for transferring a content of a register set used by the task from the external register set storage unit 32 when an attempt is made to execute a certain task, but a miss occurs in the hit determination unit 31. You.
[0083]
When switching the task to be executed, the execution task determination unit 12 issues either a miss transfer hit determination request or a hit determination request. The miss transfer hit determination request notifies the hit determination unit 31 of the task ID. If a miss occurs, the register set used by the task is transferred from the external register set transfer device to the register set group 21. This is an instruction to the set selection unit 22.
[0084]
The processing procedure of the hit judging unit 31 in the case of receiving a transfer hit judging request at the time of a miss is shown in the flowchart of FIG. First, it is determined whether the task ID of the task to be executed is registered in the register set ID task ID correspondence unit 24 (step S31). If registered, a register set ID corresponding to the corresponding task ID is obtained (step S32). If not registered, a mistake is determined (step S33), and transfer of the register set used by the corresponding task is performed. To the register set transfer unit 34 (step S34).
[0085]
On the other hand, the hit determination request notifies the hit determination unit 31 of the task ID, and performs a hit determination while excluding a register set whose flag is valid. Even if a mistake is made, the register set is not transferred.
[0086]
The processing procedure of the hit determination unit 31 when a hit determination request is received is shown in the flowchart of FIG. First, it is determined whether or not the task ID of the task to be executed is registered in the register set ID task ID correspondence unit 24 except for the task ID for which the flag is set (step S41). If the task ID has been registered, a register set ID corresponding to the task ID is obtained (step S42), and if not, it is determined that a mistake has occurred (step S43).
[0087]
If the set flag does not exist in the register set ID task ID correspondence unit 24, the execution task determination unit 12 determines, when switching the task to be executed, a transfer hit at the time of a miss using the switched task ID. Make a request. If there is a hit, the execution task determination unit 12 acquires the register set ID corresponding to the new hit task ID from the register set ID task ID correspondence unit 24, and notifies the register set ID to the register set selection unit 22. , Start executing a new task. On the other hand, when a miss occurs, the hit determination unit 31 instructs the register set transfer unit 34 to transfer the register set, and the register set ID task ID corresponding unit 24 sets a flag corresponding to the register set to be transferred.
[0088]
When the transfer of the register set is completed, the register set transfer unit 34 notifies the register set ID task ID corresponding unit 24 of the completion of the transfer. According to this notification, the register set ID task ID corresponding unit 24 invalidates the register set flag.
[0089]
The execution task determination unit 12 acquires the register set ID corresponding to the task to be executed from the register set ID task ID correspondence unit 24, notifies the acquired register set ID to the register set selection unit 22, and executes the task. To start.
[0090]
If the set flag exists in the register set ID task ID correspondence unit 24, the execution task determination unit 12 issues a hit determination request with the switched task ID when switching the task to be executed. . If there is a hit, the execution task determination unit 12 acquires the register set ID corresponding to the new hit task ID from the register set ID task ID correspondence unit 24, and notifies the register set ID to the register set selection unit 22. , Start executing a new task. On the other hand, if a mistake is made, the task is not switched.
[0091]
FIG. 21 is a diagram for explaining a task execution mode when a flag set in the register set ID task ID correspondence unit 24 exists. In this example, during execution of the task with the task ID 5, when it becomes possible to execute the task with the task ID 1 having a higher priority than this task, the execution task determination unit 12 sends the task ID 1 to the hit determination unit 31. Request for a transfer hit determination at the time of a miss.
[0092]
In this example, the hit judging unit 31 that has received this request makes a miss judgment, whereby the register set transfer unit 34 starts transferring registers used by the task ID 1 in the register set group 21. This transfer takes time until time t3.
[0093]
When the execution of task ID5 ends at time t2 between times t1 and t3, the execution task determination part issues a hit determination request for the task with the highest priority (task ID7 in the example of FIG. 21) among the executable tasks. Do. If there is a hit, task ID 7 is executed.
[0094]
Thereafter, at time t3, the completion of the transfer is notified from the register set transfer unit 34, whereby the execution task determination starts the execution of the task ID1.
[0095]
As described above, in the eighth embodiment, during the transfer of the register set used by a certain task, another task that does not affect the execution of the task is executed, so that the transfer of the register set is not waited for. Task processing can be performed, and task processing efficiency can be improved.
[0096]
(Ninth embodiment)
In the ninth embodiment, a flag indicating whether or not the contents of a register has been updated is provided in each register constituting the register set.
[0097]
The ninth embodiment has the same block configuration as that of FIG. 12, but differs from FIG. 12 in the data structure of the register set of the register set group 21. FIG. 22 is a diagram illustrating a data structure of a register set according to the ninth embodiment. As shown, a change flag is provided for each register constituting the register set. This change flag is set when rewriting the contents of the corresponding register. The processing procedure in this case is represented by a flowchart as shown in FIG.
[0098]
In FIG. 23, first, a change flag corresponding to a register to be rewritten is set (step S51), and thereafter, the register is rewritten (step S52).
[0099]
The change flag in FIG. 22 is cleared when the register set stored in the external register set storage unit 32 is read. The processing procedure when there is a transfer request from the external register set storage unit 32 to the register set group 21 is represented by a flowchart as shown in FIG.
[0100]
In FIG. 24, first, all the change flags in the transfer destination register set are cleared (step S61), and thereafter, the register set is transferred (step S62).
[0101]
FIG. 25 is a flowchart showing a processing procedure of the register set transfer unit 34 when the register set group 21 requests the external register set storage unit 32 to transfer the contents of the register set. First, attention is paid to one register in the register set to be transferred (step S71), and it is determined whether or not a change flag of the noted register set is set (step S72).
[0102]
If it is set, the register to be transferred is transferred to the external register set storage unit 32 (step S73). If it has not been set or if the processing of step S73 has been completed, it is determined whether or not processing has been performed for all the registers (step S74). If it is done, it ends.
[0103]
As described above, in the ninth embodiment, only the changed registers among the registers included in the register set group 21 are transferred to the external register set storage unit 32. The transfer time can be reduced.
[0104]
(Tenth embodiment)
In the tenth embodiment, the external register set storage unit 32 has a flag indicating whether each register of each register set has been rewritten.
[0105]
FIG. 26 shows the data structure of the external register set storage unit 32. As shown, a valid flag is provided for each register of each register set. This valid flag is set when the corresponding register is rewritten.
[0106]
FIG. 27 is a flowchart showing a process of initializing a valid flag, which is a process performed by the external storage control unit 33 when a task is activated. The external storage control unit 33 clears all the valid flags in the register set corresponding to the task to be started (Step S81).
[0107]
FIG. 28 is a flowchart showing the setting process of the valid flag, which is performed by the external storage control unit 33 when a register set transfer request from the register set transfer unit 34 to the external register set storage unit 32 is issued. The external storage control unit 33 sets a valid flag corresponding to the register to be transferred from the external register set storage unit 32 (Step S91). After that, the corresponding register is transferred from the register set group 21 to the external register set storage unit 32 (Step S92).
[0108]
FIG. 29 is a flowchart showing a processing procedure of the external storage control unit 33 when there is a transfer request from the external register set storage unit 32 to the register set group 21. First, a valid flag in the register set to be transferred is read (step S101). Next, attention is paid to one register in the register set to be transferred (step S102).
[0109]
It is determined whether or not the valid flag corresponding to this register is set (step S103). If it is set, the register is transferred to the external register set storage unit 32 (step S104). Next, it is determined whether or not processing has been performed on all registers (step S105). If there is a register that has not been processed, the processing from step S101 is repeated.
[0110]
As described above, in the tenth embodiment, since the valid flag indicating whether the register has been rewritten is provided in the external register set storage unit 32, the external register set is stored only when the contents of the register are rewritten. What is necessary is just to transfer the contents of the registers from the storage unit 32 to the register set group 21, so that the number of transfers can be reduced and the transfer time can be shortened.
[0111]
(Eleventh embodiment)
In the eleventh embodiment, the register set of each task in the external register set storage unit 32 has a list structure.
[0112]
FIG. 30 is a diagram showing a data structure of the external register set storage unit 32 according to the eleventh embodiment. The external register set storage unit 32 has a list structure, and stores a register value storage area for storing a changed register value and an identification number (register ID) of the register stored in the register value storage area. Store as a set. That is, the external register set storage unit 32 does not store the values of the registers whose contents do not change.
[0113]
FIG. 31 is a flowchart showing a processing procedure of the external storage control unit 33 when there is a transfer request from the external register set storage unit 32 to the register set group 21. First, the pointer is moved to the head of the list of register sets to be transferred (step S111). Next, the register ID and the register value are read from the list in the external register set storage unit 32 (Step S112). Next, the value of the register is written to the register of the register set group 21 corresponding to the register ID (step S113). Next, it is determined whether or not the end of the list is reached (step S114). If it is at the end of the list, the process ends. If it is not at the end of the list, the process moves to the next item in the list and repeats the processing from step S111.
[0114]
FIG. 32 is a flowchart showing a processing procedure of the external storage control unit 33 when a register transfer request is issued from the register set transfer unit 34 to the external register set storage unit 32. First, it is determined whether the register ID to be transferred is in the corresponding list in the external register set storage unit 32 (step S121). If it is not in the list, an item of the register ID to be transferred to the list is added (step S122).
[0115]
If it is determined in step S121 that it is in the list, or if the processing in step S122 is completed, the value of the register is written to the register value storage area corresponding to the register ID to be transferred in the list (step S123).
[0116]
FIG. 33 is a flowchart showing a processing procedure of the external storage control unit 33 when the task is completed. The contents of the list corresponding to the completed task in the external register set storage unit 32 are discarded (step S131).
[0117]
As described above, in the eleventh embodiment, since the external register set storage unit 32 has a list structure and stores only the values of the changed registers, the memory capacity of the external register set storage unit 32 can be reduced, and , The amount of data transferred to and from the register set group 21 can also be reduced.
[0118]
In the first to eleventh embodiments described above, examples in which the present invention is applied to a processor have been described. However, the present invention is also applicable to semiconductor integrated devices other than processors. For example, only the execution task determination unit 12 shown in FIG. 1 or the like may be provided separately from the processor.
[0119]
【The invention's effect】
As described above in detail, according to the present invention, it is determined whether or not the task is ready to be started based on the data storage states of the first and second FIFO storage units, and only the task that is ready to be started is started. As a result, task activation scheduling can be performed without an operating system, and the overhead of the operating system can be eliminated, and a plurality of tasks can be processed efficiently.
[0120]
In addition, since the first and second FIFO storage units that store data to be processed by the task are monitored, there is no possibility that data will be lost, and highly reliable task processing can be performed.
[Brief description of the drawings]
FIG. 1 is a diagram showing processing contents of a software defined radio.
FIG. 2 is a schematic configuration diagram of a processor provided with a FIFO between tasks.
FIG. 3 is a block diagram showing a schematic configuration of a first embodiment of a processor according to the present invention.
FIG. 4 is a block diagram showing a schematic configuration of a second embodiment of the processor according to the present invention.
FIG. 5 is a block diagram showing a detailed configuration of an execution task determination unit 12 and a task ID / priority order supply unit 14.
FIG. 6 is a flowchart showing a processing procedure of an execution task determining unit 12 of FIG. 5;
FIG. 7 is a block diagram showing a schematic configuration of a third embodiment of the processor according to the present invention.
FIG. 8 is a time chart for explaining the operation of a fourth embodiment of the processor according to the present invention.
FIG. 9 is a block diagram showing a schematic configuration of a fifth embodiment of the processor according to the present invention.
FIG. 10 is a block diagram of a processor showing a modification of FIG. 9;
FIG. 11 is a diagram showing a data structure of a register set ID task ID correspondence unit 24.
FIG. 12 is a block diagram showing a schematic configuration of a sixth embodiment of the processor according to the present invention.
FIG. 13 is a diagram showing a data configuration of an external register set storage unit 32.
FIG. 14 is a flowchart showing a processing procedure of a hit determination unit 31.
FIG. 15 is a block diagram showing a schematic configuration of a seventh embodiment of the processor according to the present invention.
FIG. 16 is a flowchart showing a processing procedure of a save register set determining unit 35;
FIG. 17 is a block diagram showing a schematic configuration of an eighth embodiment of a processor according to the present invention.
FIG. 18 is a diagram illustrating a data structure of a register set ID task ID corresponding unit according to the eighth embodiment.
FIG. 19 is a flowchart illustrating a processing procedure of a hit determination unit when a transfer hit determination request at the time of a miss is received;
FIG. 20 is a flowchart illustrating a processing procedure of a hit determination unit when a hit determination request is received.
FIG. 21 is a view for explaining a task execution mode when a flag set in the register set ID task ID correspondence unit 24 exists.
FIG. 22 is a view showing a data structure of a register set according to the ninth embodiment;
FIG. 23 is a flowchart showing a processing procedure when a register rewrite request is issued.
FIG. 24 is a flowchart showing a processing procedure when there is a transfer request from the external register set storage unit to the register set group.
FIG. 25 is a flowchart showing a processing procedure when there is a transfer request from a register set group to an external register set storage unit.
FIG. 26 is a diagram showing a data structure of an external register set storage unit 32.
FIG. 27 is a flowchart showing a processing procedure when a task is started.
FIG. 28 is a flowchart showing a processing procedure when a register transfer request is sent from the register set transfer unit to the external register set storage unit.
FIG. 29 is a flowchart showing a processing procedure when there is a transfer request from the external register set storage unit to the register set group.
FIG. 30 is a diagram illustrating a data structure of an external register set storage unit 32 according to the eleventh embodiment.
FIG. 31 is a flowchart showing a processing procedure when there is a transfer request from the external register set storage unit to the register set group.
FIG. 32 is a flowchart showing a processing procedure when there is a register transfer request from the register set transfer unit to the external register set storage unit.
FIG. 33 is a flowchart showing task end processing.
[Explanation of symbols]
11 Task launcher
12. Execution task determination unit
13 processor core
14 Task ID / Priority Supply Unit
15 Executable task ID list
16 priority encoder
17 Time measurement unit
18 Start time table
19 Average Time Perception Calculator
20 Priority order determination unit
21 Register set group
22 Register set selector
23 Calculation section
24 Register Set ID Task ID Corresponding Section
30 Priority change unit
31 Hit judgment unit
32 External register set storage
33 External storage control unit
34 Register set transfer section
35 Save register set decision unit

Claims (17)

複数のタスクを時分割で処理するプロセッサにおいて、
予め定めたタスクに対して、該タスクの処理で使用されるデータを記憶する1以上の第1のFIFO(First In First Out)型記憶手段と、
前記第1のFIFO型記憶手段から取得したデータを使用して前記タスクの処理を行った後の処理結果を記憶するとともに、この記憶した処理結果を使用する他のタスクがある場合には該他のタスクの処理で使用されるデータを記憶する1以上の第2のFIFO型記憶手段と、
前記第1のFIFO型記憶手段が前記タスクの処理に使用するデータを保持しているか否か、および前記タスクの処理結果を記憶する空き領域を前記第2のFIFO型記憶手段が有しているか否かを判断するタスク判断手段と、
前記タスク判断手段の判断結果に基づいて、前記複数のタスクのうちから次に起動すべきタスクを決定する実行タスク決定手段と、を備えることを特徴とするプロセッサ。
In a processor that processes multiple tasks in a time-sharing manner,
One or more first FIFO (First In First Out) storage means for storing data used in processing of the predetermined task;
Using the data obtained from the first FIFO type storage means, store the processing result after performing the processing of the task, and if there is another task using the stored processing result, One or more second FIFO-type storage means for storing data used in the processing of the task of
Whether the first FIFO storage means holds data used for processing the task, and whether the second FIFO storage means has a free area for storing the processing result of the task. Task determining means for determining whether or not
An execution task determining unit that determines a task to be started next from the plurality of tasks based on a determination result of the task determining unit.
前記複数のタスクのそれぞれに優先順位を設定する優先順位設定手段を備え、前記実行タスク決定手段は、前記優先順位設定手段により設定された優先順位に基づいて、前記起動すべきタスクを決定することを特徴とする請求項1に記載のプロセッサ。Priority setting means for setting a priority for each of the plurality of tasks, wherein the execution task determining means determines the task to be started based on the priority set by the priority setting means. The processor of claim 1, wherein: 前記複数のタスクそれぞれの起動頻度を計測する起動頻度計測手段を備え、
前記優先順位設定手段は、前記起動頻度計測手段で計測された起動頻度に基づいて、前記優先順位を設定することを特徴とする請求項2に記載のプロセッサ。
Comprising a start frequency measuring means for measuring the start frequency of each of the plurality of tasks,
3. The processor according to claim 2, wherein the priority order setting unit sets the priority order based on the activation frequency measured by the activation frequency measurement unit.
前記優先順位設定手段は、前記起動頻度がより高いタスクほど優先順位を高く設定することを特徴とする請求項3に記載のプロセッサ。The processor according to claim 3, wherein the priority setting unit sets a higher priority for a task having a higher activation frequency. 前記実行タスク決定手段は、第1のタスクの起動中に、該第1のタスクよりも優先順位の高い第2のタスクに使用されるデータを前記第1のFIFO型記憶手段が保持し、かつ前記第2のタスクの処理結果を格納すべき空き領域を前記第2のFIFO型記憶手段が有する場合、前記第1のタスクの起動を中断して、前記第2のタスクを起動することを特徴とする請求項2に記載のプロセッサ。The execution task determination means, during the activation of the first task, the first FIFO type storage means holds data used for a second task having a higher priority than the first task, and When the second FIFO type storage unit has a free area in which to store the processing result of the second task, the activation of the first task is interrupted and the second task is activated. 3. The processor according to claim 2, wherein 個々のタスクに固有の情報をすべて含む1以上のレジスタからなるレジスタセットを、時分割で実行可能なタスクの総数以上設けたレジスタセット群と、
前記実行タスク決定手段により決定したタスクが利用する前記レジスタセットを選択するレジスタセット選択手段と、
前記レジスタセット選択手段で選択したレジスタセットを利用して、前記実行タスク決定手段により決定したタスクの処理を行う演算処理手段と、を備えることを特徴とする請求項1に記載のプロセッサ。
A register set group including at least a total number of tasks that can be executed in a time-sharing manner, including a register set including at least one register including all information unique to each task;
Register set selecting means for selecting the register set used by the task determined by the execution task determining means;
2. The processor according to claim 1, further comprising: an arithmetic processing unit that performs processing of the task determined by the execution task determining unit using a register set selected by the register set selecting unit.
タスクと、該タスクが利用する前記レジスタセットと、の対応関係を記憶する対応関係記憶手段を備え、
前記レジスタセット選択手段は、前記対応関係記憶手段に記憶した対応関係に基づいて、前記実行タスク決定手段によって決定したタスクが利用するレジスタセットを選択することを特徴とする請求項6に記載のプロセッサ。
A correspondence storage unit for storing a correspondence between a task and the register set used by the task,
7. The processor according to claim 6, wherein the register set selection unit selects a register set used by the task determined by the execution task determination unit based on the correspondence stored in the correspondence storage unit. .
個々のタスクに固有の情報をすべて含む1以上のレジスタからなるレジスタセットを、時分割で実行可能なタスクの総数に満たない数だけ設けたレジスタセット群と、
前記実行タスク決定手段により決定したタスクが利用する前記レジスタセットを選択するレジスタセット選択手段と、
前記レジスタセット選択手段で選択したレジスタセットを利用して、前記実行タスク決定手段により決定したタスクの処理を行う演算処理手段と、
前記レジスタセット群に含まれる任意のレジスタセットの内容を記憶可能な外部レジスタセット記憶手段と、
前記タスクが利用するレジスタセットの内容を、前記外部レジスタセット記憶手段に記憶している場合には、
前記レジスタセット群に含まれる、中断中か中断すべきタスクが利用するレジスタセットの内容を前記外部レジスタセット記憶手段に転送するとともに、前記外部レジスタセット記憶手段に記憶した前記タスクが利用するレジスタセットの内容を、前記レジスタセット群のうちの前記外部レジスタセット記憶手段に転送したレジスタセットに対応するレジスタセットに転送する記憶制御手段と、を備えることを特徴とする請求項1に記載のプロセッサ。
A register set group including at least one register set including at least one register including all information unique to each task, the number of registers being less than the total number of tasks executable in a time-sharing manner;
Register set selecting means for selecting the register set used by the task determined by the execution task determining means;
Using a register set selected by the register set selecting means, an arithmetic processing means for processing the task determined by the execution task determining means,
External register set storage means capable of storing the contents of any register set included in the register set group,
When the contents of the register set used by the task are stored in the external register set storage means,
A register set used by the task stored in the external register set storage means, while transferring the contents of the register set used by the task being interrupted or to be interrupted included in the register set group to the external register set storage means. 2. The processor according to claim 1, further comprising: storage control means for transferring the contents of the register set to a register set corresponding to the register set transferred to the external register set storage means in the register set group.
前記実行タスク決定手段により決定されたタスクが利用する前記レジスタセットが前記レジスタセット群の中に存在するか否かを判定するヒット判定手段を備え、
前記ヒット判定手段が、前記タスクが利用するレジスタセットが前記レジスタセット群に存在すると判定した場合には、
前記レジスタセット選択手段は、前記レジスタセット群のうちの前記レジスタセットを選択し、
他方、存在しないと判断した場合には、
前記記憶制御手段が前記外部レジスタセット記憶手段に記憶している前記タスクが利用するレジスタセットの内容を、前記レジスタセット群のうちの転送先に対応するレジスタセットに転送した後に、前記レジスタセット選択手段はこの転送後のレジスタセットを選択することを特徴とする請求項8に記載のプロセッサ。
Hit determination means for determining whether the register set used by the task determined by the execution task determination means is present in the register set group,
When the hit determination means determines that the register set used by the task exists in the register set group,
The register set selecting means selects the register set from the register set group,
On the other hand, if it is determined that it does not exist,
After transferring the contents of the register set used by the task stored in the external register set storage means to the register set corresponding to the transfer destination in the register set group, the storage control means selects the register set. 9. The processor according to claim 8, wherein the means selects the register set after the transfer.
前記ヒット判定手段により存在しないと判定したときに、前記外部レジスタセット記憶手段に待避させるべき前記レジスタセット群のレジスタセットを選択する待避レジスタセット決定手段を備え、
前記記憶制御手段は、前記待避レジスタセット決定手段により選択されたレジスタセットの内容を前記外部レジスタセット記憶手段に転送することを特徴とする請求項9に記載のプロセッサ。
When the hit determination unit determines that the register set does not exist, the external register set storage unit includes a save register set determination unit that selects a register set of the register set group to be saved.
10. The processor according to claim 9, wherein the storage control unit transfers the contents of the register set selected by the save register set determination unit to the external register set storage unit.
前記実行タスク決定手段は、前記タスク判断手段による判断結果を考慮に入れるとともに、前記記憶制御手段が前記レジスタセット群と前記外部レジスタセット記憶手段との間でレジスタセットの入れ替え処理を行っている最中にも、他のタスクの処理ができるように該入れ替え処理の影響を受けずに実行可能なタスクを決定することを特徴とする請求項8に記載のプロセッサ。The execution task determination unit takes into account the determination result of the task determination unit, and the storage control unit performs a register set exchange process between the register set group and the external register set storage unit. 9. The processor according to claim 8, wherein a task that can be executed without being affected by the replacement process is determined so that another task can be processed. 前記記憶制御手段は、前記外部レジスタセット記憶手段の記憶内容を更新する必要がある場合、前記レジスタセット群の変更のあったレジスタの値のみ、前記外部レジスタセット記憶手段に転送することを特徴とする請求項8に記載のプロセッサ。The storage control unit, when it is necessary to update the storage content of the external register set storage unit, transfers only the changed register value of the register set group to the external register set storage unit. The processor of claim 8, wherein 前記記憶制御手段は、前記外部レジスタセット記憶手段から前記レジスタセット群にデータを転送する必要がある場合には、他のタスクの実行によって前記レジスタセット群のレジスタの値が書き換えられてしまったレジスタの内容のみ、前記外部レジスタセット記憶手段から前記レジスタセット群に転送することを特徴とする請求項8のいずれかに記載のプロセッサ。The storage control means, when it is necessary to transfer data from the external register set storage means to the register set group, a register whose register value of the register set group has been rewritten by execution of another task. 9. The processor according to claim 8, wherein only the contents of the register set are transferred from the external register set storage unit to the register set group. 前記記憶制御手段は、前記外部レジスタセット記憶手段に記憶されているレジスタセットと同じレジスタセットが前記レジスタセット群に存在しない場合に限り、該レジスタセットの内容を前記外部レジスタセット記憶手段に転送することを特徴とする請求項8に記載のプロセッサ。The storage control unit transfers the contents of the register set to the external register set storage unit only when the same register set as the register set stored in the external register set storage unit does not exist in the register set group. The processor of claim 8, wherein: 前記外部レジスタセット記憶手段は、変更のあったレジスタの値及び該レジスタの識別情報だけを記憶することを特徴とする請求項8に記載のプロセッサ。9. The processor according to claim 8, wherein the external register set storage means stores only the value of the changed register and the identification information of the register. 複数のタスクを時分割で処理するプロセッサの、前記複数のタスクの中から次に起動すべきタスクを決定する実行タスク決定装置において、
前記複数のタスクのそれぞれについて、該タスクの処理の入力データを記憶するための1以上の第1のFIFO型記憶手段に、前記タスクが処理可能なデータが記憶されているか否か、および前記タスクの処理結果を記憶するための1以上の第2のFIFO型記憶手段に、該処理結果のデータを記憶できる空き領域があるか否かを判断し、この判断に基づいて前記複数のタスクの中から次に起動すべきタスクを決定する実行タスク決定手段を備えることを特徴とする実行タスク決定装置。
In an execution task determination device for determining a task to be started next from among the plurality of tasks,
For each of the plurality of tasks, whether or not data that can be processed by the task is stored in one or more first FIFO type storage means for storing input data of processing of the task, and It is determined whether or not one or more second FIFO-type storage means for storing the processing result of the above has a free area in which the data of the processing result can be stored. An execution task determination unit that determines a task to be started next from the execution task determination device.
複数のタスクを時分割で処理する演算処理方法において、
前記複数のタスクのそれぞれについて、該タスクの処理の入力データを記憶するための1以上の第1のFIFO型記憶手段に、前記タスクが処理可能なデータが記憶されているか否か、および前記タスクの処理結果を記憶するための1以上の第2のFIFO型記憶手段に、該処理結果のデータを記憶できる空き領域があるか否かを判断し、この判断に基づいて前記複数のタスクの中から次に起動すべきタスクを決定することを特徴とする演算処理方法。
In an arithmetic processing method for processing a plurality of tasks in a time-division manner,
For each of the plurality of tasks, whether or not data that can be processed by the task is stored in one or more first FIFO type storage means for storing input data of processing of the task, and It is determined whether or not one or more second FIFO-type storage means for storing the processing result of the above has a free area in which the data of the processing result can be stored. An operation processing method characterized in that a task to be started next is determined from the following.
JP2003003428A 2003-01-09 2003-01-09 Processor, execution task deciding device and arithmetic processing method Pending JP2004220093A (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP2003003428A JP2004220093A (en) 2003-01-09 2003-01-09 Processor, execution task deciding device and arithmetic processing method
US10/752,703 US20040139441A1 (en) 2003-01-09 2004-01-08 Processor, arithmetic operation processing method, and priority determination method
CNA2004100020726A CN1517869A (en) 2003-01-09 2004-01-09 Processor, arithmetic processing method and priority decision method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003003428A JP2004220093A (en) 2003-01-09 2003-01-09 Processor, execution task deciding device and arithmetic processing method

Publications (1)

Publication Number Publication Date
JP2004220093A true JP2004220093A (en) 2004-08-05

Family

ID=32894698

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003003428A Pending JP2004220093A (en) 2003-01-09 2003-01-09 Processor, execution task deciding device and arithmetic processing method

Country Status (1)

Country Link
JP (1) JP2004220093A (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010508574A (en) * 2006-10-31 2010-03-18 ヒューレット−パッカード デベロップメント カンパニー エル.ピー. Middleware framework
JP2011138401A (en) * 2009-12-28 2011-07-14 Fujitsu Ltd Processor system, method of controlling the same, and control circuit
JP2013058228A (en) * 2012-11-01 2013-03-28 Nihon Univ Security processing device
US8606039B2 (en) 2008-10-06 2013-12-10 Canon Kabushiki Kaisha Information processing apparatus, control method for the same, and computer program
JP2021029338A (en) * 2019-08-19 2021-03-01 株式会社ユニバーサルエンターテインメント Game machine
JP2021029320A (en) * 2019-08-19 2021-03-01 株式会社ユニバーサルエンターテインメント Game machine
JP2021029321A (en) * 2019-08-19 2021-03-01 株式会社ユニバーサルエンターテインメント Game machine
JP2021029336A (en) * 2019-08-19 2021-03-01 株式会社ユニバーサルエンターテインメント Game machine
JP2021029337A (en) * 2019-08-19 2021-03-01 株式会社ユニバーサルエンターテインメント Game machine
US11204799B2 (en) 2018-10-31 2021-12-21 Renesas Electronics Corporation Semiconductor device and systems using the same
US11263046B2 (en) 2018-10-31 2022-03-01 Renesas Electronics Corporation Semiconductor device

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010508574A (en) * 2006-10-31 2010-03-18 ヒューレット−パッカード デベロップメント カンパニー エル.ピー. Middleware framework
US8606039B2 (en) 2008-10-06 2013-12-10 Canon Kabushiki Kaisha Information processing apparatus, control method for the same, and computer program
JP2011138401A (en) * 2009-12-28 2011-07-14 Fujitsu Ltd Processor system, method of controlling the same, and control circuit
JP2013058228A (en) * 2012-11-01 2013-03-28 Nihon Univ Security processing device
US11204799B2 (en) 2018-10-31 2021-12-21 Renesas Electronics Corporation Semiconductor device and systems using the same
US11263046B2 (en) 2018-10-31 2022-03-01 Renesas Electronics Corporation Semiconductor device
JP2021029320A (en) * 2019-08-19 2021-03-01 株式会社ユニバーサルエンターテインメント Game machine
JP2021029321A (en) * 2019-08-19 2021-03-01 株式会社ユニバーサルエンターテインメント Game machine
JP2021029336A (en) * 2019-08-19 2021-03-01 株式会社ユニバーサルエンターテインメント Game machine
JP2021029337A (en) * 2019-08-19 2021-03-01 株式会社ユニバーサルエンターテインメント Game machine
JP2021029338A (en) * 2019-08-19 2021-03-01 株式会社ユニバーサルエンターテインメント Game machine
JP7149602B2 (en) 2019-08-19 2022-10-07 株式会社ユニバーサルエンターテインメント game machine
JP7149603B2 (en) 2019-08-19 2022-10-07 株式会社ユニバーサルエンターテインメント game machine
JP7179338B2 (en) 2019-08-19 2022-11-29 株式会社ユニバーサルエンターテインメント game machine
JP7179336B2 (en) 2019-08-19 2022-11-29 株式会社ユニバーサルエンターテインメント game machine

Similar Documents

Publication Publication Date Title
US7213137B2 (en) Allocation of processor bandwidth between main program and interrupt service instruction based on interrupt priority and retiring micro-ops to cache
JP4693326B2 (en) System and method for multi-threading instruction level using zero-time context switch in embedded processor
EP1557764A2 (en) Processor system, DMA control circuit, DMA control method, control method for DMA controller, graphic processing method, and graphic processing circuit
US7134124B2 (en) Thread ending method and device and parallel processor system
US20040139441A1 (en) Processor, arithmetic operation processing method, and priority determination method
US20090158293A1 (en) Information processing apparatus
JP2006260571A (en) Dual thread processor
JP2004220093A (en) Processor, execution task deciding device and arithmetic processing method
US20080235695A1 (en) Resource allocation system for jobs, resource allocation method and resource allocation program for jobs
JPWO2008023426A1 (en) Task processing device
US7590990B2 (en) Computer system
KR20060023514A (en) Information processing device, process control method, and computer program
JPWO2009150815A1 (en) Multiprocessor system
US8042116B2 (en) Task switching based on the execution control information held in register groups
EP2159691B1 (en) Simultaneous multithreaded instruction completion controller
JP5076616B2 (en) Processor and prefetch control method
JP5155655B2 (en) Microprocessor output port and control of instructions provided from it
WO2006109835A1 (en) Processor
JP6368452B2 (en) Improved scheduling of tasks performed by asynchronous devices
US8099531B2 (en) Information processing method and computer program comprising network card wherein a plurality of processors switches use of network card related to setting of resource flag
JP5859472B2 (en) Computer having a plurality of processors sharing a process queue and process dispatch processing method
KR101085393B1 (en) Method and apparatus for executing command to multitasking a plurality of process
JPWO2007108133A1 (en) Multiprocessing method and multiprocessor system
JP2006195705A (en) Processor
JP2010117970A (en) Disk controller and firmware update method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20040604

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20060901

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060908

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20070109