JP3767529B2 - Microprocessor - Google Patents
Microprocessor Download PDFInfo
- Publication number
- JP3767529B2 JP3767529B2 JP2002220714A JP2002220714A JP3767529B2 JP 3767529 B2 JP3767529 B2 JP 3767529B2 JP 2002220714 A JP2002220714 A JP 2002220714A JP 2002220714 A JP2002220714 A JP 2002220714A JP 3767529 B2 JP3767529 B2 JP 3767529B2
- Authority
- JP
- Japan
- Prior art keywords
- task
- data
- stage
- microprocessor
- memory
- 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 - Fee Related
Links
Images
Description
【0001】
【発明の属する技術分野】
本発明は、マイクロプロセッサに関し、特に、例えば、時間的オーバヘッドの少ないタスクスイッチングを可能にしたマイクロプロセッサに関する。特に、ソフトウェア無線技術(software radio)のように、復調処理、誤り訂正処理、プロトコル処理のように種々の異なる処理を要求されるプロセッサに好適なマイクロプロセッサに関する。
【0002】
【従来の技術】
近年、電子機器の高度化が進み、電子機器内部に組み込まれるマイクロプロセッサにおいても、さらなる高度化、かつ、効率的な処理が要求されている。すなわち、大量のプログラムを実行する高速なマイクロプロセッサが必要とされている。
【0003】
一般に、組み込みマイクロプロセッサは、リアルタイム処理を要求されることが多く、複雑なプログラムの中でタイミングに制約のある部分を、確実に、かつ、決められた時間内に実行すること、並びに、プログラムを変更した際に処理時間が間に合うか否かを見通し良く予測することが強く望まれる。
【0004】
その一方で、近年の半導体技術の進歩により、以前に較べ、より多くの回路をマイクロプロセッサに使用することが可能となり、高度化、かつ、効率的な処理の要求が満たされるのであれば、多少の回路量の増大は許容される場合が多くなってきた。
【0005】
また、半導体技術の進歩により、回路の集積密度が向上しているため、マイクロプロセッサとは別のチップとされていたメモリなどを同一チップに集積することができ、パッケージのピン数などの制約を受けることにより制限されてきたマイクロプロセッサとメモリ間のバス幅を大幅に広げることが可能となる。従って、バス幅の増大およびバスの複数化に関して、制約が大幅に緩和されている。
【0006】
ところで、マイクロプロセッサにおいてリアルタイム処理を実行する場合、外部周辺回路から、不定期もしくは周期的な割り込み制御信号の入力を受け付け、各種割り込みに応じたプログラム(いわゆる割り込みサービス)を実行することができる。
【0007】
この際、実行していたプログラムと割り込みサービスの間には連続性がないため、マイクロプロセッサの内部状態(例えば、演算回路に使用しているパイプラインフリップフロップなど)を退避させるか、もしくは、実行をストールするかによって、それまで実行していたプログラムの演算結果を割り込みサービスが変更しないようになされている。
【0008】
ここで、従来のマイクロプロセッサの内部の構成について、図1を参照して説明する。
【0009】
プログラムカウンタ1は、次に実行すべき命令(タスク)のアドレスを記憶しておくためのレジスタであり、記憶されている、次に実行すべき命令のアドレスを命令メモリ2に供給する。命令メモリ2は、プログラムカウンタ1から供給されるアドレスに基づいて読み出された命令を演算回路3に供給する。命令キャッシュ7は、命令メモリ2のデータの出し入れの速度が、演算回路3と比較して遅い場合に、アクセス局所性(Access Locality)を利用して擬似的に高速なデータアクセスをなすための緩衝用のメモリである。
【0010】
このマイクロプロセッサは、ステージ11乃至15の5段のパイプラインのRISC(Reduced Instruction Set Computer)プロセッサで構成されているものとする。
【0011】
ステージ11は、命令メモリ2に記憶されている命令(タスク)を読み出し(IF:Instruction Fetch)、記憶素子20に記憶させる。ステージ12は、記憶素子20に記憶されている命令およびレジスタファイル4に格納されているデータを読み出してデコード(ID:Instruction Decode)し、記憶素子21に記憶させる。
【0012】
ステージ13は、記憶素子21に記憶されている命令を読み出して実行し(EX:Execution)、その命令によって演算されたデータを記憶素子22に記憶させる。
【0013】
ステージ14は、記憶素子22に記憶されているデータを読み出し、記憶素子23に記憶させる。ステージ14はまた、演算回路3内の内部状態に関するデータおよびレジスタファイル4の内容をデータメモリ5に書き込ませる(MEM:Memory access)とともに、データメモリ5に書き込まれているデータを読み出し、演算回路3およびレジスタファイル4に復元させる。ステージ15は、記憶素子23に記憶されているデータを読み出し、レジスタファイル4へライトバック(WB:Write Back)する。データメモリ5とステージ14の間には、擬似的に高速なデータアクセスをなすためのデータキャッシュ6が一般的には存在する。
【0014】
図2は、図1に示したマイクロプロセッサにおける、割り込みサービスによるタスク切り替えのタイミング動作を説明する図である。
【0015】
同図に示されるように、時刻T1において、ステージ11は、命令メモリ2に記憶されているタスク1を読み出し、記憶素子20に記憶させる。時刻T2において、ステージ12は、記憶素子20に記憶されているタスク1を読み出し、それをデコードし、記憶素子21に記憶させる。時刻T3において、ステージ13は、記憶素子21に記憶されているタスク1を読み出し、それを実行し、演算結果を記憶素子22に記憶させる。時刻T4において、ステージ14は、記憶素子22に記憶されているデータを読み出し、記憶素子23に記憶させる。時刻T5において、ステージ15は、記憶素子23に記憶されているデータを読み出し、レジスタファイル4へライトバックする。
【0016】
このように、ステージ(例えば、ステージ11)に入力された信号は、クロック時間Tを経過した後、次のステージ(いまの場合、ステージ12)に供給される。その後、このステージ(ステージ11)に次の入力があっても、この信号は、クロック時間Tを経過した後、次のステージ(ステージ12)に供給される。従って、次のステージ(ステージ12)は、前のステージ(ステージ11)の入力の影響を受ける前に、現在の信号を、さらに次のステージ(いまの場合、ステージ13)に供給することができる。
【0017】
時刻T7において、タスク切り替え制御信号(割り込みサービス)が発生されると、マイクロプロセッサは、時刻T8において、次に実行すべき命令(タスク2)のアドレスを命令メモリ2に供給させるようにプログラムカウンタ1のアドレス切り替えを制御する。その後、演算回路3には、パイプラインストールが発生されるため、レジスタ退避命令が発生されるまで待機する。
【0018】
時刻T12において、ステージ15によってデータがレジスタファイル4へライトバックされると(全てのタスク1が吐き出されると)同時に、レジスタ退避命令が発生され、ステージ14からデータメモリ5に、演算回路3内の内部状態に関するデータおよびレジスタファイル4の内容が退避される。
【0019】
ステージ11のデータ退避が終了する時刻T15において、命令メモリ2に記憶されているタスク2が読み出され、タスク2の実行が開始される。それ以降、上述したタスク1と同様の動作が繰り返し実行される。
【0020】
そして、ステージ11のタスク2の実行が終了する時刻T52において、レジスタ復帰命令が発生され、データメモリ5から、タスク1の実行における演算回路3の内部状態およびレジスタファイル4の内容が復元される。ステージ11のデータ復元が終了する時刻T55において、マイクロプロセッサは、次に実行すべき命令(タスク1)のアドレスを命令メモリ2に供給させるようにプログラムカウンタ1のアドレス復帰を制御する。その後、演算回路3には、パイプラインストールが発生され、ステージ15のデータ復元が終了されるまで待機する。時刻T59において、ステージ15のデータ復元が終了されると、タスク1の実行が再開され、上述した動作が繰り返される。
【0021】
このように、割り込みサービスプログラムの実行によりレジスタファイル4の内容が破壊されないように、割り込みサービスを受け付ける前に、実行中の演算回路3の内部状態およびレジスタファイル4の内容が退避される。そして、割り込みサービスから復帰する場合には、退避させていた演算回路3の内部状態およびレジスタファイル4の内容を復元することにより、割り込みサービスによって、それ以前に実行されていたプログラムの演算結果が変更されることを防止している。
【0022】
また、図3に示されるように、2系統のレジスタファイル4−1および4−2を設け、割り込みサービスを実行する際にレジスタファイルを切り替えることによって瞬時にタスクを切り替えることができるようにしたマイクロプロセッサも存在する。なお、図1と対応する部分には同一の符号を付してあり、その説明は適宜省略する。
【0023】
図3の構成においては、一方のレジスタファイル4−1に記憶されているタスクが実行されている状態で割り込みサービスを受け付けたとき、他方のレジスタファイル4−2に記憶されているタスクを瞬時に実行することができるようにスイッチ31および32がレジスタファイル4−1からレジスタファイル4−2を選択するように切り替えられるため、データ退避のためのオーバヘッドが発生しない。
【0024】
図4は、図3に示したマイクロプロセッサにおける、割り込みサービスによるタスク切り替えのタイミング動作を説明する図である。
【0025】
同図に示されるように、時刻T7において、タスク切り替え制御信号(割り込みサービス)が発生されると、マイクロプロセッサは、時刻T8において、次に実行すべき命令(タスク2)のアドレスを命令メモリ2に供給するようにプログラムカウンタ1のアドレス切り替えを制御する。その後、演算回路3には、パイプラインストールが発生され、時刻T12において、ステージ15によってデータがレジスタファイル4−1へライトバックされると(全てのタスクが吐き出されると)同時に、スイッチ31および32がレジスタファイル4−1からレジスタファイル4−2を選択するように切り替えられ、命令メモリ2に記憶されているタスク2が読み出され、実行される。
【0026】
このように、2系統のレジスタファイルを設けることにより、タスク1およびタスク2の切り替えを瞬時に行うことができる。
【0027】
【発明が解決しようとする課題】
しかしながら、図1および図2の例の場合、レジスタファイルの内部状態の退避およびパイプラインストールのために数十クロックを使用しなければならず、割り込みサービスが発生する毎に、比較的大きな時間的オーバヘッドが生じる課題があった。
【0028】
また、図3および図4の例の場合、予め用意したレジスタファイル群(図3の場合、2個)以上の多重割り込みサービスが存在する場合、やはり、図1の例の場合と同様に、レジスタファイル4の内部状態の退避およびパイプラインストールのための時間的オーバヘッドが生じてしまう課題があった。
【0029】
さらに、マイクロプロセッサにおけるメモリ階層構造の中で、最も高速で動作しなければならないレジスタファイルを大量に設けることは、回路規模が大きくなり、かつ、配線が多くなることを意味し、マイクロプロセッサのクロック速度向上の妨げとなる課題があった。
【0030】
本発明はこのような状況に鑑みてなされたものであり、レジスタファイルを大量に設けなくても、時間的オーバヘッドの少ないタスク切り替えを可能にするとともに、ほぼ無制限の割り込み多重化を実現することができるようにするものである。
【0031】
【課題を解決するための手段】
本発明のマイクロプロセッサは、複数のステージから構成され、複数のステージにおいて複数の命令をずらして順次実行することにより、同時に並行してデータを演算する少なくとも1系統の演算手段と、演算手段を構成する複数のステージにおける状態を、複数のタスクに対応させて記憶するために、ステージごとに対応付けて、演算手段の 1 系統に対して少なくとも2系統設けられる記憶手段と、第1のタスクが実行される場合、複数のステージにおけるそれぞれの状態を記憶するものとして、少なくとも2系統設けられる記憶手段のうち、ステージごとにいずれかの記憶手段を選択するように制御する制御手段と、制御手段によって選択された記憶手段を用いて第1のタスクを実行中に、第1のタスクの実行に用いられていない記憶手段で保持されている第2のタスクに関する複数のステージにおける状態を退避する退避手段と、制御手段によって選択された記憶手段を用いて第1のタスクを実行中に、退避手段に退避されている第3のタスクに関する複数のステージにおける状態を、第1のタスクの実行に用いられていない記憶手段に復元する復元手段とを備えることを特徴とする。
【0032】
制御手段には、タスク切り替え制御信号が発生されたとき、現在のタスクの実行に用いられていない記憶手段を新たなタスクの複数のステージにおけるそれぞれの状態を記憶するものとして選択するように制御させることができ、記憶手段の選択のタイミングは、ステージごとに対応付けて設けられているそれぞれの記憶手段で異なるように制御させることができる。
【0033】
制御手段には、外部から割り込み制御信号の入力を受けたとき、現在のタスクの実行に用いられていない記憶手段を新たなタスクの複数のステージにおけるそれぞれの状態を記憶するものとして選択するように制御させることができ、記憶手段の選択のタイミングは、ステージごとに対応付けて設けられているそれぞれの記憶手段で異なるように制御させることができる。
【0034】
退避手段によりデータを退避している途中で割り込み制御信号の入力を受けたとき、制御手段には、退避手段によりデータの退避が終了するまで割り込み制御信号を保留させ、データの退避が終了したとき、現在のタスクの実行に用いられていない記憶手段を新たなタスクの複数のステージにおけるそれぞれの状態を記憶するものとして選択するように制御させることができ、記憶手段の選択のタイミングは、ステージごとに対応付けて設けられているそれぞれの記憶手段で異なるように制御させることができる。
【0035】
復元手段によりデータを復元している途中で割り込み制御信号の入力を受けたとき、制御手段には、データの復元を中止させ、現在のタスクの実行に用いられていない記憶手段を新たなタスクの複数のステージにおけるそれぞれの状態を記憶するものとして選択するように制御させることができ、記憶手段の選択のタイミングは、ステージごとに対応付けて設けられているそれぞれの記憶手段で異なるように制御させることができる。
【0036】
記憶手段は、レジスタファイルをさらに含むものであるとすることができる。
また、記憶手段は、プログラムカウンタをさらに含むものであるとすることができる。
【0037】
退避手段を複数有し、それらを相互に連結させることができる。
【0038】
退避手段をマイクロプロセッサ外部に存在するメモリ及び1系統の演算手段と接続し、退避手段をマイクロプロセッサ外部に存在するメモリのキャッシュとして動作させることができる。
退避手段をマイクロプロセッサ外部に存在するメモリ及び1系統の演算手段と接続し、退避手段をマイクロプロセッサ外部に存在するメモリの代用として動作させることができる。
【0039】
本発明のマイクロプロセッサにおいては、複数のステージにおいて複数の命令をずらして順次実行することにより同時に並行して演算された複数のステージごとの状態を複数のタスクに対応させて記憶するために、ステージごとに対応付けて、演算経路の 1 系統に対して少なくとも2系統設けられる記憶経路のうちのいずれかが選択され、選択された記憶経路を用いて第1のタスクを実行中に、第1のタスクの実行に用いられていない記憶経路で保持されている第2のタスクに関する複数のステージにおける状態がメモリに退避され、メモリに退避されている第3のタスクに関する複数のステージにおける状態が、第1のタスクの実行に用いられていない記憶経路に復元される。
【0040】
【発明の実施の形態】
以下、図を参照して、本発明の実施の形態について説明する。
【0041】
図5は、本発明を適用したマイクロプロセッサの内部の構成例を示すブロック図である。なお、従来と対応する部分には同一の符号を付してあり、その説明は適宜省略する。本発明においては、プログラムカウンタ1、レジスタファイル4、並びに、演算回路3内の記憶素子20乃至23を、それぞれ2系統で構成するが、勿論、2以上の複数系統で構成するようにしてもよい。これに対して、ステージ11乃至15は、1系統のみで構成されている。厳密に言うと、命令メモリ2とデータメモリ5は、マイクロプロセッサには含まれず、それ以外の部分をマイクロプロセッサコア(Microprocessor Core)という。
【0042】
タスク切替制御部41は、マイクロプロセッサ内のスイッチ51乃至70を、所定の時間毎に発生されるタスク切り替え制御信号により切り替えるように制御するか、もしくは外部割り込み制御信号の入力により切り替えるように制御する。初期状態において、タスク切替制御部41は、プログラムカウンタ1−1および1−2のうち、プログラムカウンタ1−1を選択するようにスイッチ52を制御し、演算回路3内の2系統のパイプラインのうち、記憶素子20−1,21−1,22−1および23−1をそれぞれ選択するようにスイッチ57乃至60を制御し、レジスタファイル4−1および4−2のうち、レジスタファイル4−1を選択するようにスイッチ68および69をそれぞれ制御する。
【0043】
スイッチ51は、退避用読み出しのためのスイッチ(選択装置)であり、タスク切替制御部41の制御の下、プログラムカウンタ1−1または1−2から供給されるアドレスを第1の退避メモリ42に供給する。スイッチ52は、タスク切替制御部41の制御の下、プログラムカウンタ1−1または1−2から供給されるアドレスを命令メモリ2に供給する。
【0044】
命令メモリ2は、スイッチ52を介してプログラムカウンタ1−1または1−2から供給されるアドレスに基づいて読み出される命令(タスク)を、演算回路3に供給する。
【0045】
演算回路3は、ステージ11乃至15の5段のパイプラインのRISCプロセッサで構成されており、記憶素子が2個ずつ設けられているため、2系統のパイプラインとされている。なお、本発明の実施の形態においては、パイプラインが5段になっている例を示したが、段数は任意であり、より多くても少なくてもよい。
【0046】
ステージ11は、命令メモリ2に記憶されている命令(タスク)を読み出し、記憶素子20−1または20−2に記憶させる。ステージ12は、記憶素子20−1または20−2に記憶されている命令をスイッチ57を介して読み出すとともに、レジスタファイル4−1または4−2に格納されているデータをスイッチ68または69を介して読み出し、それらをデコードし、記憶素子21−1または21−2に記憶させる。
【0047】
ステージ13は、記憶素子21−1または21−2に記憶されている命令をスイッチ58を介して読み出し、読み出した命令を実行し、その命令によって演算されたデータを記憶素子22−1または22−2に記憶させる。
【0048】
ステージ14は、記憶素子22−1または22−2に記憶されているデータをスイッチ59を介して読み出し、記憶素子23−1または23−2に記憶させる。ステージ14はまた、タスクの実行により得られるデータをデータメモリ5に書き込ませるとともに、データメモリ5に書き込まれているデータを読み出し、記憶素子23−1または23−2に記憶させる。
【0049】
ステージ15は、記憶素子23−1または23−2に記憶されているデータをスイッチ60を介して読み出し、レジスタファイル4−1または4−2へライトバックする。
【0050】
スイッチ53は、退避用読み出しのためのスイッチ(選択装置)であり、タスク切替制御部41の制御の下、記憶素子20−1または20−2から読み出される命令(タスク)を第1の退避メモリ42に供給する。スイッチ54は、退避用読み出しのためのスイッチであり、タスク切替制御部41の制御の下、記憶素子21−1または21−2から読み出されるデータを第1の退避メモリ42に供給する。スイッチ55は、退避用読み出しのためのスイッチであり、タスク切替制御部41の制御の下、記憶素子22−1または22−2から読み出されるデータを第1の退避メモリ42に供給する。スイッチ56は、退避用読み出しのためのスイッチであり、タスク切替制御部41の制御の下、記憶素子23−1または23−2から読み出されるデータを第1の退避メモリ42に供給する。
【0051】
スイッチ61は、復元用書き込みのためのスイッチであり、第1の退避メモリ42から供給されるデータ(アドレス)を、プログラムカウンタ1−1または1−2に供給する。スイッチ62は、復元用書き込みのためのスイッチであり、第1の退避メモリ42から供給されるデータ(命令)を、記憶素子20−1または20−2に供給する。スイッチ63は、復元用書き込みのためのスイッチであり、第1の退避メモリ42から供給されるデータを、記憶素子21−1または21−2に供給する。スイッチ64は、復元用書き込みのためのスイッチであり、第1の退避メモリ42から供給されるデータを、記憶素子22−1または22−2に供給する。スイッチ65は、復元用書き込みのためのスイッチであり、第1の退避メモリ42から供給されるデータを、記憶素子23−1または23−2に供給する。
【0052】
スイッチ66は、演算データ書き込みのためのスイッチであり、タスク切替制御部41の制御の下、ステージ15からライトバックされるデータを、レジスタファイル4−1または4−2に供給する。
【0053】
スイッチ67は、復元用書き込みのためのスイッチであり、タスク切替制御部41の制御の下、第1の退避メモリ42から供給されるデータを、レジスタファイル4−1または4−2に供給する。
【0054】
スイッチ68および69は、演算データ読み出しのためのスイッチであり、タスク切替制御部41の制御の下、レジスタファイル4−1または4−2から読み出されるデータをステージ12に供給する。
【0055】
スイッチ70は、退避用読み出しのためのスイッチであり、タスク切替制御部41の制御の下、レジスタファイル4−1または4−2から読み出されるデータを、第1の退避メモリ42に供給する。
【0056】
第1の退避メモリ42は、スイッチ51を介して供給されるプログラムカウンタ1−1または1−2からの退避データ、スイッチ53乃至56を介して供給される演算回路3からの退避データ、並びに、スイッチ70を介して供給されるレジスタファイル4−1または4−2からの退避データを書き込む。書き込まれた退避データは、復元時に読み出される。また、第1の退避メモリ42に加え、第2の退避メモリ43が存在するとさらに好適である。例えば、第1の退避メモリ42は容量(capacity)は小さいが、転送速度が早いメモリ(High Access bandwidth)であり、第2の退避メモリ43は、容量は大きいが転送速度が遅い(Low Access bandwidth)ものとする。その場合は、すぐに処理が必要とされないデータは第2の退避メモリ43にセーブしておく、などの多段階の処理が可能になる。
【0057】
また、マイクロプロセッサの外部に存在する命令メモリ2と、第1の退避メモリ42及び第2の退避メモリ43を接続し、さらにその入出力をステージ11へ双方向接続することにより、第1の退避メモリ42又は第2の退避メモリ43を命令キャッシュ7(図1)として利用することもできる。同様に、マイクロプロセッサの外部に存在するデータメモリ5と、第1の退避メモリ42及び第2の退避メモリ43を接続し、さらにその入出力をステージ14へ双方向接続することにより、第1の退避メモリ42又は第2の退避メモリ43をデータキャッシュ6(図1)として利用することもできる。このように、退避メモリとキャッシュを兼用することにより、実装効率(面積効率)を改善することができる。
【0058】
また、命令メモリ2と第1の退避メモリ42及び第2の退避メモリ43が接続されることで、退避メモリを命令メモリ2として代用することも可能になる。これを上述の例にあてはめると、容量は小さいが転送速度の速い第1の退避メモリ42を命令キャッシュ7として代用し、容量は大きいが転送速度の遅い第2の退避メモリ43を命令メモリ2として代用することも可能である。このような構成にすることで、実装効率(面積効率)を改善することもできる。
【0059】
なお、第2の退避メモリ43は、マイクロプロセッサ内部にあってもよいし、外部にあってもよい。
【0060】
なお、退避データは、多重化して順次書き込まれるか、もしくは、並列に同時に書き込まれる。また同様に、復元するデータも、多重化して読み出されるか、もしくは、並列に同時に読み出される。
【0061】
図6は、図5に示したマイクロプロセッサにおける、割り込みサービスによるタスク切り替えのタイミング動作を説明する図である。ここでは、タスク1、タスク2、およびタスク3の順で実行されるようにスケジュールされているものとし、これらタスク1乃至タスク3のうち、タスク3は、以前に、タスクの実行途中に割り込み入力されたことがあり、第1の退避メモリ42に退避データが存在するものとし、タスク2は、第1の退避メモリ42に退避データが存在せず、タスク2の実行開始時において退避データの復元は必要ないものとして説明する。なお、現在演算に使用されているレジスタファイルを「表」、現在演算に使用していないレジスタファイルを「裏」と適宜称することにする。
【0062】
同図に示されるように、初期状態においてタスク1が実行されており、時刻T7において、タスク切り替え制御信号が発生されると、タスク切替制御部41は、時刻T8において、プログラムカウンタ1−1からプログラムカウンタ1−2を選択するようにスイッチ52を制御する。時刻T9において、タスク切替制御部41は、レジスタファイル4−1からレジスタファイル4−2の経路に切り替えるようにスイッチ68および69を制御する。これにより、レジスタファイル4−1が「表」から「裏」に切り替えられ、レジスタファイル4−2が「裏」から「表」に切り替えられ、命令メモリ2に記憶されているタスク2の実行が開始される。それ以降、タスク1と同様の動作が繰り返し実行される。
【0063】
すなわち、タスク切替制御部41は、時刻T8において、記憶素子20−2を選択するようにスイッチ57を切り替え、時刻T9において、記憶素子21−2を選択するようにスイッチ58を切り替え、時刻T10において、記憶素子22−2を選択するようにスイッチ59を切り替え、時刻T11において、記憶素子23−2を選択するようにスイッチ60を切り替える。このように、各ステージ毎にタスク1の実行からタスク2の実行に切り替えられる。
【0064】
時刻T12において、ステージ15によってデータがレジスタファイル4−1へライトバックされると(全てのタスク1が吐き出されると)同時に、タスク切替制御部41は、レジスタファイル4−2にデータをライトバックするように、スイッチ66を切り替える。これにより、レジスタファイル4−1は「裏」(待機状態)となるため、その時間を利用して、第1の退避メモリ42に、レジスタファイル4−1の内容およびタスク1の実行における演算回路3の内部状態に関するデータを退避させ、次に実行すべきタスクを復元させておく。
【0065】
いまの場合、タスク2の次にタスク3が実行されるようにスケジュールされているため、タスク2の実行中に、タスク1のデータ退避、およびタスク3のデータ復元を行うようにする。
【0066】
具体的には、時刻T13において、タスク切替制御部41によって、スイッチ51、スイッチ53乃至56、並びにスイッチ70が、「裏」となるプログラムカウンタ1−1、演算回路3の記憶素子20−1,21−1,22−1および23−1、並びにレジスタファイル4−1をそれぞれ選択するように切り替えられ、プログラムカウンタ1−1、演算回路3の記憶素子20−1,21−1,22−1および23−1、並びにレジスタファイル4−1に記憶されているデータが第1の退避メモリ42に退避される。そして、時刻T32において、データ退避が終了されると、時刻T34において、第1の退避メモリ42に退避されているタスク3のデータが、「裏」となるプログラムカウンタ1−1、演算回路3の記憶素子20−1,21−1,22−1および23−1、並びにレジスタファイル4−1にそれぞれ書き込まれ、復元される。
【0067】
このように、タスク2の実行中に、「裏」となるプログラムカウンタ1−1、演算回路3の記憶素子20−1,21−1,22−1および23−1、並びにレジスタファイル4−1にタスク3の以前の切り替え時のデータが復元されるため、タスク1からタスク2の切り替えと同様に、瞬時にタスク2からタスク3に切り替えられる。
【0068】
また、タスク3を実行中に、「裏」となるレジスタファイル4−2、プログラムカウンタ1−2、演算回路3の記憶素子20−2,21−2,22−2および23−2に記憶されているタスク2のデータを第1の退避メモリ42に退避させ、次に実行すべきタスク1をそれらに復元することによって、時間的オーバヘッドなしにタスク切り替え(タスクスイッチング)を実行することができる。
【0069】
さらに、第1の退避メモリ42の記憶容量に応じて、複数のタスクを自由に切り替えて実行することも可能となる。
【0070】
以上においては、タスク切り替え制御信号が、適切なタイミングで与えられるものとして説明したが、例えば、自走するカウンタによってタスク切り替え制御信号を生成することによって、各タスクに均等に実行時間を与えることもできる。
【0071】
また、プリロード可能なダウンカウンタを設け、そのダウンカウンタの値が0となるタイミングでタスク切り替え制御信号を発生させるものとし、タスク切り替え制御信号が発生したときにプリロード値をダウンカウンタ内にロードするように構成すれば、予め設定するプリロード値を変更するだけで、タスク切り替えの間隔を可変にすることができる。
【0072】
さらに、ダウンカウンタにロードするプリロード値を保持する複数のレジスタを設け、それらのレジスタをどのような順番でロードするかをプログラムによって設定することにより、柔軟なタスク切り替えを実現することができる。
【0073】
また以上においては、予めタスクスイッチが予測可能である場合について説明したが、外部割込みサービスにおいても、時間的オーバヘッドなしにタスク切り替えを実行することができる。
【0074】
なお、マイクロプロセッサ内に第1の退避メモリ42を設ける場合を例にして説明したが、これに限らず、例えば、図示せぬキャッシュメモリに退避メモリを兼用させるようにしてもよい。
【0075】
図7は、外部割込みサービスによるタスク切り替えのタイミング動作を説明する図である。この例の場合、データ退避およびデータ復元が実行されていないタイミングに割り込みサービスがあるため、通常のタスク切り替えと同様に扱うことができる。
【0076】
同図に示されるように、タスク2の実行中に行われるタスク1のデータ退避が時刻T32に終了し、その後、時刻T33において、外部から割り込み制御信号の入力を受け付けると、タスク切替制御部41は、時刻T34において、プログラムカウンタ1−2からプログラムカウンタ1−1を選択するようにスイッチ52を制御するとともに、演算回路3の記憶素子20−1,21−1,22−1および23−1をそれぞれ選択するようにスイッチ61乃至65を制御する。時刻T35において、タスク切替制御部41は、レジスタファイル4−2からレジスタファイル4−1の経路に切り替えるようにスイッチ68および69を制御する。
【0077】
これにより、第1の退避メモリ42に退避されているタスク3のデータが、プログラムカウンタ1−1、演算回路3の記憶素子20−1,21−1,22−1および23−1、並びにレジスタファイル4−1にそれぞれ復元され、タスク3が実行され、いままで実行されていたタスク2は中断される。すなわち、レジスタファイル4−1の内容、およびタスク1の実行における演算回路3の内部状態に関するデータは既に第1の退避メモリ42に退避されているため、直ちにタスク3の実行を行うことができる。
【0078】
時刻T38において、ステージ15によってデータがレジスタファイル4−1へライトバックされると(全てのタスク2が吐き出されると)同時に、タスク切替制御部41は、タスク3をレジスタファイル4−1にライトバックするように、スイッチ66を切り替える。
【0079】
ステージ11のタスク3の実行が終了する時刻T40において、タスク切替制御部41は、レジスタファイル4−1から4−2の経路に切り替えるようにスイッチ68および69を制御する。これにより、割り込みにより中断されていたタスク2の実行が再開される。
【0080】
時刻T41において、タスク切替制御部41によって、スイッチ61乃至65、およびスイッチ67が、「裏」となるプログラムカウンタ1−1、演算回路3の記憶素子20−1,21−1,22−1および23−1、並びにレジスタファイル4−1をそれぞれ選択するように切り替えられ、第1の退避メモリ42に退避されているデータが、レジスタファイル4−1、プログラムカウンタ1−1、演算回路3の記憶素子20−1,21−1,22−1および23−1に書き込まれ、復元される。
【0081】
このように、現在使用していないプログラムカウンタ1−1、演算回路3の記憶素子20−1,21−1,22−1および23−1、並びにレジスタファイル4−1を、割り込みが入ったタスクの演算用に割り当てることにより、割り込みされ、一時中断されたタスク2の状態を保存する必要がない。すなわち、データ退避およびデータ復元は不要となる。
【0082】
図8は、他の外部割り込みサービスによるタスク切り替えのタイミング動作を説明する図である。この例においては、データ退避中に割り込みサービスがあった場合の動作について説明する。
【0083】
同図に示されるように、タスク2の実行中に行われるデータ退避の途中の時刻T31において、外部から割り込み制御信号の入力を受け付けると、タスク切替制御部41は、その受け付けを一旦保留し、データ退避が終了するまで待機する。
【0084】
そして、時刻T32において、タスク2の実行中に行われるデータ退避が終了されると、時刻T33において、タスク切替制御部41は、保留されている割り込み制御信号の入力を受け付ける。時刻T34において、タスク切替制御部41は、プログラムカウンタ1−2からプログラムカウンタ1−1を選択するようにスイッチ52を制御するとともに、演算回路3の記憶素子20−1,21−1,22−1および23−1をそれぞれ選択するようにスイッチ61乃至65を制御する。時刻T35において、タスク切替制御部41は、レジスタファイル4−2からレジスタファイル4−1の経路に切り替えるようにスイッチ68および69を制御する。
【0085】
これにより、第1の退避メモリ42に退避されているタスク3のデータが、プログラムカウンタ1−1、演算回路3の記憶素子20−1,21−1,22−1および23−1、並びにレジスタファイル4−1にそれぞれ復元され、タスク3が実行され、いままで実行されていたタスク2は中断される。
【0086】
時刻T38において、ステージ15によってデータがレジスタファイル4−2へライトバックされると(全てのタスク2が吐き出されると)同時に、タスク切替制御部41は、タスク3をレジスタファイル4−1にライトバックするように、スイッチ66を切り替える。時刻T39において、タスク切替制御部41によって、スイッチ51、スイッチ53乃至56、並びにスイッチ70が、「裏」となるプログラムカウンタ1−2、演算回路3の記憶素子20−1,21−2,22−2および23−2、並びにレジスタファイル4−2をそれぞれ選択するように切り替えられ、プログラムカウンタ1−2、演算回路3の記憶素子20−2,21−2,22−2および23−2、並びにレジスタファイル4−2に記憶されているデータが第1の退避メモリ42に退避される。
【0087】
このように、データの退避中に割り込みが入る場合には、その退避が終了するまで割り込み制御信号の受け付けを保留にすることによって、確実にデータを退避させることができ、かつ、時間的オーバヘッドなしにタスク切り替えを実行することができる。
【0088】
図9は、他の外部割込みサービスによるタスク切り替えのタイミング動作を説明する図である。この例においては、データ復元中に割り込みサービスがあった場合の動作について説明する。
【0089】
同図に示されるように、タスク2の実行中に行われるデータ復元の途中の時刻T11において、外部から割り込み制御信号の入力を受け付けると、データの復元を中止し、時刻T12において、タスク切替制御部41は、プログラムカウンタ1−2からプログラムカウンタ1−1を選択するようにスイッチ52を制御するとともに、レジスタファイル4−2からレジスタファイル4−1の経路に切り替えるようにスイッチ68および69を制御する。
【0090】
これにより、第1の退避メモリ42に退避されているタスク3のデータが、プログラムカウンタ1−1、演算回路3の記憶素子20−1,21−1,22−1および23−1、並びにレジスタファイル4−1にそれぞれ復元され、タスク3が実行され、いままで実行されていたタスク2は中断される。なお、途中まで復元されていたデータは、割り込まれたタスク3によって上書きされる。
【0091】
時刻T19において、割り込みサービスが終了すると、時刻T20において、タスク切替制御部41は、レジスタファイル4−1からレジスタファイル4−2の経路に切り替えるようにスイッチ68および69を制御する。これにより、中断されていたタスク2が再開され、時刻T20において、割り込みにより中止されたデータの復元が再開される。
【0092】
このように、データの復元中に割り込みが入る場合には、その復元を中止し、割り込みサービスが終了した時点で、復元をやり直すことによって、確実にデータを復元させることができ、かつ、時間的オーバヘッドなしにタスク切り替えを実行することができる。
【0093】
以上のように、演算に使用していない裏のレジスタファイルのデータを第1の退避メモリ42に退避させた後、そこに、次に実行すべきデータを第1の退避メモリ42から復元することにより、ほぼ無制限の割り込みサービスに対して、時間的オーバヘッドなしにタスク切り替えを実現することができる。
【0094】
【発明の効果】
本発明のマイクロプロセッサによれば、複数のステージにおいて複数の命令をずらして順次実行することにより同時に並行して演算された複数のステージごとの状態を複数のタスクに対応させて記憶するために、ステージごとに対応付けて、演算経路の 1 系統に対して少なくとも2系統設けられる記憶経路のうちのいずれかを選択し、選択された記憶経路を用いて第1のタスクを実行中に、第1のタスクの実行に用いられていない記憶経路で保持されている第2のタスクに関する複数のステージにおける状態をメモリに退避し、メモリに退避されている第3のタスクに関する複数のステージにおける状態を、他方の記憶経路に復元するようにしたので、ほぼ無制限の割り込みサービスに対して、時間的オーバヘッドなしにタスク切り替えを実現することができる。オーバヘッドをなくすことにより、ソフトウェア無線などで必要とされる性質の異なる処理(復調、誤り訂正など)の高速切り替えを、効率的に行うことができる。
【図面の簡単な説明】
【図1】従来のマイクロプロセッサの内部の構成例を示す図である。
【図2】図1のマイクロプロセッサにおける、割り込みサービスによるタスク切り替えのタイミング動作を説明する図である。
【図3】従来の他のマイクロプロセッサの内部の構成例を示す図である。
【図4】図2のマイクロプロセッサにおける、割り込みサービスによるタスク切り替えのタイミング動作を説明する図である。
【図5】本発明を適用したマイクロプロセッサの内部の構成例を示すブロック図である。
【図6】図5のマイクロプロセッサにおける、割り込みサービスによるタスク切り替えのタイミング動作を説明する図である。
【図7】図5のマイクロプロセッサにおける、外部割り込みサービスによるタスク切り替えのタイミング動作を説明する図である。
【図8】図5のマイクロプロセッサにおける、他の外部割り込みサービスによるタスク切り替えのタイミング動作を説明する図である。
【図9】図5のマイクロプロセッサにおける、他の外部割り込みサービスによるタスク切り替えのタイミング動作を説明する図である。
【符号の説明】
1−1,1−2 プログラムカウンタ, 2 命令メモリ, 3 演算回路,4−1,4−2 レジスタファイル, 5 データメモリ, 6 データキャッシュ, 7 命令キャッシュ, 11乃至15 ステージ, 20−1,20−2,21−1,21−2,22−1,22−2,23−1,23−2 記憶素子, 41 タスク切替制御部, 42 第1の退避メモリ, 43 第2の退避メモリ, 51乃至70 スイッチ[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a microprocessor, and more particularly to a microprocessor that enables task switching with low temporal overhead, for example. In particular, the present invention relates to a microprocessor suitable for a processor that requires various different processing such as demodulation processing, error correction processing, and protocol processing, such as software radio technology.
[0002]
[Prior art]
In recent years, the advancement of electronic devices has progressed, and further advancement and efficient processing have been demanded for microprocessors incorporated in electronic devices. That is, there is a need for a high-speed microprocessor that executes a large amount of programs.
[0003]
In general, an embedded microprocessor is often required to perform real-time processing. In a complicated program, a timing-constrained part can be executed reliably and within a predetermined time, and a program can be executed. It is strongly desired to predict whether the processing time will be in time when the change is made.
[0004]
On the other hand, with recent advances in semiconductor technology, it is possible to use more circuits in microprocessors than before, and if advanced and efficient processing requirements are met, In many cases, the increase in the circuit amount is allowed.
[0005]
In addition, because of the advancement of semiconductor technology, the integration density of circuits has been improved, so it is possible to integrate memory, etc., which was a separate chip from the microprocessor, on the same chip, which limits the number of pins on the package. The bus width between the microprocessor and the memory, which has been limited by receiving, can be greatly increased. Therefore, the restrictions on the increase in bus width and the number of buses are greatly relaxed.
[0006]
By the way, when executing real-time processing in a microprocessor, it is possible to receive an irregular or periodic input of an interrupt control signal from an external peripheral circuit and execute a program (so-called interrupt service) corresponding to various interrupts.
[0007]
At this time, since there is no continuity between the program being executed and the interrupt service, the internal state of the microprocessor (for example, the pipeline flip-flop used in the arithmetic circuit) is saved or executed. The interrupt service does not change the operation result of the program that has been executed so far, depending on whether the program is stalled.
[0008]
Here, an internal configuration of a conventional microprocessor will be described with reference to FIG.
[0009]
The
[0010]
This microprocessor is assumed to be composed of a 5-stage pipelined RISC (Reduced Instruction Set Computer) processor of
[0011]
The
[0012]
The
[0013]
The
[0014]
FIG. 2 is a diagram for explaining the task switching timing operation by the interrupt service in the microprocessor shown in FIG.
[0015]
As shown in the figure, at
[0016]
Thus, the signal input to the stage (for example, the stage 11) is supplied to the next stage (in this case, the stage 12) after the clock time T has elapsed. Thereafter, even if there is a next input in this stage (stage 11), this signal is supplied to the next stage (stage 12) after the clock time T has elapsed. Therefore, the next stage (stage 12) can supply the current signal to the next stage (in this case, stage 13) before being affected by the input of the previous stage (stage 11). .
[0017]
When a task switching control signal (interrupt service) is generated at time T7, the microprocessor counters the
[0018]
At time T12, when data is written back to the
[0019]
At time T15 when the data saving of the
[0020]
At time T52 when execution of
[0021]
In this way, the internal state of the
[0022]
Further, as shown in FIG. 3, two register files 4-1 and 4-2 are provided, and the task can be switched instantaneously by switching the register file when executing the interrupt service. There is also a processor. Note that portions corresponding to those in FIG. 1 are denoted by the same reference numerals, and description thereof is omitted as appropriate.
[0023]
In the configuration of FIG. 3, when an interrupt service is received in a state where a task stored in one register file 4-1 is being executed, the task stored in the other register file 4-2 is instantaneously stored. Since the
[0024]
FIG. 4 is a diagram for explaining the task switching timing operation by the interrupt service in the microprocessor shown in FIG.
[0025]
As shown in the figure, when a task switching control signal (interrupt service) is generated at time T7, the microprocessor assigns the address of the next instruction (task 2) to be executed at time T8 to the
[0026]
Thus, by providing two systems of register files,
[0027]
[Problems to be solved by the invention]
However, in the example of FIGS. 1 and 2, dozens of clocks must be used for saving the internal state of the register file and installing the pipeline, and each time an interrupt service occurs, a relatively large time overhead is generated. There was a problem that occurred.
[0028]
In the case of the example of FIGS. 3 and 4, when there are multiple interrupt services more than the register file group prepared in advance (two in the case of FIG. 3), the register is also registered as in the case of the example of FIG. There has been a problem that a time overhead for saving the internal state of the
[0029]
Furthermore, providing a large number of register files that must operate at the highest speed in the memory hierarchy in the microprocessor means that the circuit scale increases and the wiring increases, and the clock of the microprocessor is increased. There was a problem that hindered speed improvement.
[0030]
The present invention has been made in view of such a situation, and enables task switching with little temporal overhead and realizes almost unlimited interrupt multiplexing without providing a large number of register files. It is something that can be done.
[0031]
[Means for Solving the Problems]
The microprocessor according to the present invention includes a plurality of stages, and by sequentially executing a plurality of instructions while shifting the plurality of instructions in the plurality of stages, at least one system of arithmetic means for simultaneously calculating data, and arithmetic meansCorresponding to the multiple tasks in the multiple stages that make upTo remember, every stageIn association with 1 For the systemStorage means provided in at least two systems;When the first task is executed, it is assumed that each state in a plurality of stages is stored.Of the storage means provided in at least two systems, for each stageAny storage meansDuring execution of the first task using the control means for controlling to select and the storage means selected by the control means,Storage means not used for execution of first taskOn the second task held inStates in multiple stagesEvacuation means for evacuating,During the execution of the first task using the storage means selected by the control means, it is saved in the saving meansAbout the third taskStates in multiple stagesTheStorage means not used for execution of first taskAnd a restoring means for restoring the data.
[0032]
When a task switching control signal is generated in the control means,Not used to perform current taskStorage meansAs a memory for each state of multiple stages of a new taskCan be controlled to chooseThe timing of selecting the storage means can be controlled to be different for each storage means provided in association with each stage.The
[0033]
When the control means receives an interrupt control signal from the outside,Not used to perform current taskStorage meansAs a memory for each state of multiple stages of a new taskCan be controlled to chooseThe timing of selecting the storage means can be controlled to be different for each storage means provided in association with each stage.The
[0034]
When an interrupt control signal is received while data is being saved by the saving means, the control means holds the interrupt control signal until the saving of data is completed by the saving means, and when saving of the data is completed ,Not used to perform current taskStorage meansAs a memory for each state of multiple stages of a new taskCan be controlled to chooseThe timing of selecting the storage means can be controlled to be different for each storage means provided in association with each stage.The
[0035]
When receiving the interrupt control signal in the middle of restoring the data by the restoration means, the control means stops the restoration of the data,Not used to perform current taskStorage meansAs a memory for each state of multiple stages of a new taskCan be controlled to chooseThe timing of selecting the storage means can be controlled to be different for each storage means provided in association with each stage.The
[0036]
The storage means stores the register file.furtherIt can be included.
Also,The storage means may further include a program counter.
[0037]
There are a plurality of retracting means, and they can be connected to each other.
[0038]
Memory existing outside the microprocessor for savingas well asMemory that is connected to one system of computing means and the saving means exists outside the microprocessorofIt can be operated as a cache.
The saving means can be connected to a memory existing outside the microprocessor and one system of calculating means, and the saving means can be operated as a substitute for the memory existing outside the microprocessor.
[0039]
In the microprocessor according to the present invention, a plurality of instructions are shifted and sequentially executed in a plurality of stages, thereby being simultaneously operated in parallel.Matching the status of multiple stages to multiple tasksTo remember, every stageIn association with 1 For the systemWhile any one of the storage paths provided in at least two systems is selected and the first task is executed using the selected storage paths,Not used to execute the first taskRegarding the second task held in the memory pathStates in multiple stagesIs saved in the memory and the third task saved in the memory isStates in multiple stagesBut,Not used to execute the first taskRestored to the storage path.
[0040]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
[0041]
FIG. 5 is a block diagram showing an internal configuration example of a microprocessor to which the present invention is applied. In addition, the same code | symbol is attached | subjected to the part corresponding to the past, and the description is abbreviate | omitted suitably. In the present invention, the
[0042]
The task switching
[0043]
The switch 51 is a switch (selection device) for reading for saving, and the address supplied from the program counter 1-1 or 1-2 is transferred to the first saving memory 42 under the control of the task switching
[0044]
The
[0045]
The
[0046]
The
[0047]
The
[0048]
The
[0049]
The
[0050]
The switch 53 is a switch (selection device) for reading for saving, and commands (tasks) read from the storage element 20-1 or 20-2 under the control of the task switching
[0051]
The switch 61 is a switch for restoring writing, and supplies data (address) supplied from the first save memory 42 to the program counter 1-1 or 1-2. The switch 62 is a switch for restoration writing, and supplies data (command) supplied from the first save memory 42 to the storage element 20-1 or 20-2. The
[0052]
The switch 66 is a switch for writing operation data, and supplies data written back from the
[0053]
The switch 67 is a switch for writing for restoration, and supplies data supplied from the first save memory 42 to the register file 4-1 or 4-2 under the control of the task switching
[0054]
The
[0055]
The
[0056]
The first save memory 42 includes save data from the program counter 1-1 or 1-2 supplied via the switch 51, save data from the
[0057]
In addition, the
[0058]
Further, by connecting the
[0059]
The
[0060]
Note that the save data is multiplexed and sequentially written, or simultaneously written in parallel. Similarly, the data to be restored is multiplexed and read, or is read simultaneously in parallel.
[0061]
FIG. 6 is a diagram for explaining the task switching timing operation by the interrupt service in the microprocessor shown in FIG. Here, it is assumed that
[0062]
As shown in the figure, when
[0063]
That is, the task switching
[0064]
At time T12, when the data is written back to the register file 4-1 by the stage 15 (when all
[0065]
In this case, the
[0066]
Specifically, at time T13, the task switching
[0067]
As described above, during the execution of the
[0068]
In addition, during the execution of
[0069]
Furthermore, a plurality of tasks can be freely switched and executed according to the storage capacity of the first save memory 42.
[0070]
In the above description, it has been described that the task switching control signal is given at an appropriate timing. However, for example, by generating the task switching control signal by a self-running counter, it is possible to equally give execution time to each task it can.
[0071]
Also, a preloadable down counter is provided, and a task switching control signal is generated at the timing when the value of the down counter becomes 0, and the preload value is loaded into the down counter when the task switching control signal is generated. With this configuration, the task switching interval can be made variable simply by changing the preload value set in advance.
[0072]
Further, by providing a plurality of registers for holding preload values to be loaded into the down counter and setting in what order these registers are loaded by a program, flexible task switching can be realized.
[0073]
In the above description, the case where the task switch can be predicted in advance has been described. However, even in the external interrupt service, task switching can be executed without time overhead.
[0074]
Although the case where the first save memory 42 is provided in the microprocessor has been described as an example, the present invention is not limited to this. For example, a cache memory (not shown) may be used as the save memory.
[0075]
FIG. 7 is a diagram for explaining the task switching timing operation by the external interrupt service. In the case of this example, since there is an interrupt service at a timing when data saving and data restoration are not executed, it can be handled in the same way as normal task switching.
[0076]
As shown in the figure, when the
[0077]
Thereby, the data of the
[0078]
At time T38, when data is written back to the register file 4-1 by the stage 15 (when all
[0079]
At the time T40 when the execution of the
[0080]
At time T41, the task switching
[0081]
As described above, the program counter 1-1, the storage elements 20-1, 21-1, 22-1 and 23-1, and the register file 4-1 of the
[0082]
FIG. 8 is a diagram for explaining a task switching timing operation by another external interrupt service. In this example, an operation when there is an interrupt service during data saving will be described.
[0083]
As shown in the figure, when the input of the interrupt control signal is received from the outside at time T31 in the middle of the data saving performed during the execution of the
[0084]
When the data saving performed during the execution of the
[0085]
Thereby, the data of the
[0086]
At time T38, when data is written back to the register file 4-2 by the stage 15 (when all
[0087]
In this way, if an interrupt occurs while saving data, the interrupt control signal reception is suspended until the saving is completed, so that data can be saved reliably and there is no time overhead. Task switching can be executed.
[0088]
FIG. 9 is a diagram for explaining a task switching timing operation by another external interrupt service. In this example, the operation when there is an interrupt service during data restoration will be described.
[0089]
As shown in the figure, when an input of an interrupt control signal is accepted from the outside at time T11 in the middle of data restoration performed during the execution of
[0090]
Thereby, the data of the
[0091]
When the interrupt service ends at time T19, at time T20, the task switching
[0092]
In this way, if an interrupt occurs during data restoration, the restoration is stopped, and when the interruption service ends, the restoration can be performed reliably, and the data can be restored reliably. Task switching can be performed without overhead.
[0093]
As described above, after the data of the back register file that is not used for the operation is saved in the first save memory 42, the data to be executed next is restored from the first save memory 42 there. Thus, task switching can be realized without time overhead for an almost unlimited interrupt service.
[0094]
【The invention's effect】
According to the microprocessor of the present invention, a plurality of instructions are shifted in a plurality of stages and sequentially executed, thereby being simultaneously operated in parallel.Matching the status of multiple stages to multiple tasksTo remember, every stageIn association with 1 For the systemWhile selecting one of the storage paths provided in at least two systems and executing the first task using the selected storage path,Not used to execute the first taskRegarding the second task held in the memory pathStates in multiple stagesIs saved in the memory, and the third task saved in the memory isStates in multiple stagesIs restored to the other storage path, so that task switching can be realized without time overhead for an almost unlimited interrupt service. By eliminating the overhead, it is possible to efficiently perform high-speed switching of processing having different properties (such as demodulation and error correction) required by software radio.
[Brief description of the drawings]
FIG. 1 is a diagram illustrating an internal configuration example of a conventional microprocessor;
FIG. 2 is a diagram for explaining a task switching timing operation by an interrupt service in the microprocessor of FIG. 1;
FIG. 3 is a diagram illustrating an internal configuration example of another conventional microprocessor;
4 is a diagram for explaining a task switching timing operation by an interrupt service in the microprocessor of FIG. 2; FIG.
FIG. 5 is a block diagram showing an example of the internal configuration of a microprocessor to which the present invention is applied.
6 is a diagram for explaining a task switching timing operation by an interrupt service in the microprocessor of FIG. 5; FIG.
7 is a diagram for explaining a task switching timing operation by an external interrupt service in the microprocessor of FIG. 5; FIG.
8 is a diagram illustrating task switching timing operation by another external interrupt service in the microprocessor of FIG. 5; FIG.
FIG. 9 is a diagram illustrating task switching timing operation by another external interrupt service in the microprocessor of FIG. 5;
[Explanation of symbols]
1-1, 1-2 Program counter, 2 instruction memory, 3 arithmetic circuit, 4-1, 4-2 register file, 5 data memory, 6 data cache, 7 instruction cache, 11 to 15 stages, 20-1, 20 -2, 21-1, 21-2, 22-1, 22-2, 23-1, 23-2 storage element, 41 task switching control unit, 42 first save memory, 43 second save memory, 51 70 switches
Claims (10)
前記演算手段を構成する複数の前記ステージにおける状態を、複数のタスクに対応させて記憶するために、前記ステージごとに対応付けて、前記演算手段の 1 系統に対して少なくとも2系統設けられる記憶手段と、
第1のタスクが実行される場合、複数の前記ステージにおけるそれぞれの状態を記憶するものとして、少なくとも2系統設けられる前記記憶手段のうち、前記ステージごとにいずれかの前記記憶手段を選択するように制御する制御手段と、
前記制御手段によって選択された前記記憶手段を用いて前記第1のタスクを実行中に、前記第1のタスクの実行に用いられていない前記記憶手段で保持されている第2のタスクに関する複数の前記ステージにおける状態を退避する退避手段と、
前記制御手段によって選択された前記記憶手段を用いて前記第1のタスクを実行中に、前記退避手段に退避されている第3のタスクに関する複数の前記ステージにおける状態を、前記第1のタスクの実行に用いられていない前記記憶手段に復元する復元手段と
を備えることを特徴とするマイクロプロセッサ。A plurality of stages, and by sequentially executing a plurality of instructions while shifting the plurality of instructions in the plurality of stages, at least one calculation means for calculating data in parallel,
Storage means provided in at least two systems for one system of the computing means in association with each stage in order to store the states in the plurality of stages constituting the computing means in association with a plurality of tasks. When,
If the first task is executed, as storing respective states of the plurality of the stages, of the storage means provided at least two systems, so as to select one of said storage means for each said stage Control means for controlling;
During execution of the first task using said storage means selected by said control means, a plurality of related second task which is held by the first of said storage means is not used for execution of the task Retreating means for retreating the state in the stage ;
While the first task is being executed using the storage means selected by the control means, the states in the plurality of stages related to the third task saved in the saving means are displayed in the first task. A microprocessor comprising: a restoring unit that restores the storage unit that is not used for execution .
ことを特徴とする請求項1に記載のマイクロプロセッサ。When the task switching control signal is generated, the control means selects the storage means that is not used for the execution of the current task as a storage state of each state in the plurality of stages of a new task. 2. The microprocessor according to claim 1 , wherein the timing of selection of the storage means is controlled to be different for each of the storage means provided in association with each stage .
ことを特徴とする請求項1に記載のマイクロプロセッサ。When receiving an interrupt control signal from the outside, the control means selects the storage means that is not used for execution of the current task as one for storing the states of the new tasks in the plurality of stages. 2. The microprocessor according to claim 1 , wherein the timing of selecting the storage means is controlled so as to be different for each of the storage means provided in association with each stage .
ことを特徴とする請求項3に記載のマイクロプロセッサ。When receiving the input of the interrupt control signal while the data is being saved by the saving means, the control means holds the interrupt control signal until the saving of the data is completed by the saving means, When the saving of data is finished, the storage means that is not used for the execution of the current task is controlled to be selected as the storage state of each state in the plurality of stages of the new task, and the storage means 4. The microprocessor according to claim 3 , wherein the selection timing is controlled so as to be different for each of the storage units provided in association with each stage .
ことを特徴とする請求項3に記載のマイクロプロセッサ。When the interrupt control signal is received while the data is being restored by the restoration means, the control means stops the restoration of the data and is not used for execution of the current task. Are selected so as to store the respective states of the new tasks in the plurality of stages , and the storage means is selected in correspondence with the respective storage means provided for each stage. 4. The microprocessor according to claim 3, wherein the microprocessors are controlled differently .
ことを特徴とする請求項1に記載のマイクロプロセッサ。The microprocessor according to claim 1, wherein the storage unit further includes a register file.
ことを特徴とする請求項1に記載のマイクロプロセッサ。The microprocessor according to claim 1, wherein the storage unit further includes a program counter.
ことを特徴とする請求項1に記載のマイクロプロセッサ。The microprocessor according to claim 1, wherein a plurality of the evacuation units are provided and connected to each other.
前記退避手段を前記マイクロプロセッサ外部に存在するメモリのキャッシュとして動作させる
ことを特徴とする請求項1に記載のマイクロプロセッサ。Connecting the evacuation means to a memory outside the microprocessor and the one-system arithmetic means;
The microprocessor according to claim 1, wherein the saving unit is operated as a cache of a memory existing outside the microprocessor.
前記退避手段を前記マイクロプロセッサ外部に存在するメモリの代用として動作させる
ことを特徴とする請求項1に記載のマイクロプロセッサ。Connecting the evacuation means to a memory outside the microprocessor and the one-system arithmetic means;
The microprocessor according to claim 1, wherein the saving unit is operated as a substitute for a memory existing outside the microprocessor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2002220714A JP3767529B2 (en) | 2001-08-28 | 2002-07-30 | Microprocessor |
Applications Claiming Priority (3)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2001257968 | 2001-08-28 | ||
JP2001-257968 | 2001-08-28 | ||
JP2002220714A JP3767529B2 (en) | 2001-08-28 | 2002-07-30 | Microprocessor |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2003150390A JP2003150390A (en) | 2003-05-23 |
JP3767529B2 true JP3767529B2 (en) | 2006-04-19 |
Family
ID=26621120
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2002220714A Expired - Fee Related JP3767529B2 (en) | 2001-08-28 | 2002-07-30 | Microprocessor |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP3767529B2 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4204522B2 (en) | 2004-07-07 | 2009-01-07 | 株式会社東芝 | Microprocessor |
KR100770034B1 (en) | 2006-03-02 | 2007-10-26 | 삼성전자주식회사 | Method and system for providing context switch using multiple register file |
-
2002
- 2002-07-30 JP JP2002220714A patent/JP3767529B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2003150390A (en) | 2003-05-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7836291B2 (en) | Method, medium, and apparatus with interrupt handling in a reconfigurable array | |
JP4610593B2 (en) | Dual thread processor | |
KR100280460B1 (en) | Data processing device and its multiple thread processing method | |
JP3573943B2 (en) | Apparatus for dispatching instructions for execution by a multithreaded processor | |
JP3253303B2 (en) | Context switching apparatus and method | |
US20050108711A1 (en) | Machine instruction for enhanced control of multiple virtual processor systems | |
EP1416376A2 (en) | Multi-threaded embedded processor having deterministic instruction memory | |
WO2011155097A1 (en) | Instruction issue and control device and method | |
WO2007002408A2 (en) | Computer processor pipeline with shadow registers for context switching, and method | |
JP2004171573A (en) | Coprocessor extension architecture built by using novel splint-instruction transaction model | |
US11392407B2 (en) | Semiconductor device | |
US7761688B1 (en) | Multiple thread in-order issue in-order completion DSP and micro-controller | |
US7447887B2 (en) | Multithread processor | |
US6675290B1 (en) | Processor for improving instruction utilization using multiple parallel processors and computer system equipped with the processor | |
JP2008152409A (en) | Semiconductor integrated circuit | |
JP5316407B2 (en) | Arithmetic processing device and control method of arithmetic processing device | |
US7340591B1 (en) | Providing parallel operand functions using register file and extra path storage | |
JP3767529B2 (en) | Microprocessor | |
US7191313B2 (en) | Microprocessor | |
US9342312B2 (en) | Processor with inter-execution unit instruction issue | |
JP2004038751A (en) | Processor and instruction control method | |
JP2007200106A (en) | Data processor, control method, and program | |
WO2009026221A2 (en) | Stall-free pipelined cache for statically scheduled and dispatched execution | |
US20040128484A1 (en) | Method and apparatus for transparent delayed write-back | |
US20030014474A1 (en) | Alternate zero overhead task change circuit |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20040817 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20041029 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20041227 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20050721 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20050902 |
|
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: 20060110 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20060123 |
|
LAPS | Cancellation because of no payment of annual fees |