JP3778573B2 - Data processor and data processing system - Google Patents
Data processor and data processing system Download PDFInfo
- Publication number
- JP3778573B2 JP3778573B2 JP51547898A JP51547898A JP3778573B2 JP 3778573 B2 JP3778573 B2 JP 3778573B2 JP 51547898 A JP51547898 A JP 51547898A JP 51547898 A JP51547898 A JP 51547898A JP 3778573 B2 JP3778573 B2 JP 3778573B2
- Authority
- JP
- Japan
- Prior art keywords
- instruction
- task
- register
- selector
- 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.)
- Expired - Fee Related
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/461—Saving or restoring of program or task context
- G06F9/462—Saving or restoring of program or task context with multiple register sets
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Advance Control (AREA)
- Executing Machine-Instructions (AREA)
Description
技術分野
本発明は、データプロセッサ、更にはデータプロセッサにおけるマルチタスキング若しくはタスク切換え技術に関し、例えば複数のタスクをパイプライン的に処理するデータプロセッサ、そしてそのデータプロセッサを適用したデータ処理システムに適用して有効な技術に関するものである。
背景技術
データプロセッサによるデータ処理を高速化する技術としてパイプライン処理がある。パイプライン処理は、一つの大きな処理を複数の処理要素に分割し、各処理要素に必要な時間即ちパイプラインピッチで次々に新しい処理を実行することにより、データ処理のスループットを向上させるものである。例えば、一つの命令を実行するための制御処理を、命令フェッチ、命令デコード、演算、メモリアクセス及びレジスタストアの各処理に分けた場合、前記夫々の処理を一つのパイプラインステージとし、一つのパイプラインステージのピッチ(パイプラインピッチ)毎に命令フェッチを行って、見掛け上、一つの命令を1パイプラインピッチで実行していく。
このようなパイプライン処理の途上で、タスク切換えを行う場合には、後から、現在実行中のタスクに復帰できるように、プログラムカウンタ、ステータスレジスタ及びデータレジスタなどの値をスタック領域に退避する処理を行わなければならない。
しかしながら、そのような退避処理には少なからず時間を要するため、パイプラインに乱れを生ずることになる。特に、複雑な処理を行う場合には、プログラム実行状態を局所的に見てもタスク切換えが頻繁に生ずることになる。これにより、折角パイプライン処理を採用しても、思うようにデータ処理のスループットを向上させることができなくなる。
特開昭62−237531号公報には、複数のプログラムを時分割で実行する場合に、割り込みでは処理が複雑になるから、プログラムROMとプログラムカウンタを2組み設け、各組におけるROMアクセスタイミングをずらし、セレクタで交互にROMの出力を選択して命令レジスタに命令を供給する様にし、これによって、複数のプログラムを簡単に時分割で実行できるようにする技術が示されている。
これは、クロック信号に基づいてプログラムを単に交互に切り替えてプログラムを完全時分割で実行させるための技術であり、複数のプログラムを見掛け上、単に並列的に実行する場合を想定しており、特定のイベントがデータプロセッサの内外で発生するのに応じてタスクを切り替えることについては考慮されていない。機器制御などに汎用的に利用されるデータプロセッサでは少なくともそれを考慮し、タスク切換えに際してパイプラインの乱れ等を小さくし、スループットを向上することが要求される。
また、スーパスカラアーキテクチャーのデータプロセッサは、複数の命令を複数のパイプラインによって同時に実行することができる。このようなデータプロセッサにおいて、ある命令が他の命令の実行結果を利用するようというようなデータコンフリクトの状態に代表される命令相互間の依存関係を管理しなければならない。並列実行されるべき命令にデータコンフリクトを生ずることが明らかになった場合、複数のパイプラインの一部は命令実行を停止して他方の命令実行の完了を待つことになる。このようにデータコンフリクトによって空いたパイプラインを別のタスクの実行に利用することを考慮すると、やはり、タスク切換えに伴う処理時間を短くしてパイプラインの乱れを最小限に抑えなければならないことが本発明者によって明らかにされた。
また、データプロセッサはオペランドアクセスを高速化するためにキャッシュメモリを搭載することができる。キャッシュメモリのキャッシュラインが書き換えられると、それに対応されるメモリの内容も書き換えられなければならない。例えばデータプロセッサのみが主メモリを占有しているなら、キャッシュラインのリプレースが行われるときだけ前記書き換えられた内容を主メモリに反映させればよい。このような動作をライトバックと称する。
しかしながら、データプロセッサの外部に接続されたDMA(Direct Memory Access)コントローラは、キャッシュメモリの書き換えが主メモリに反映されていない誤ったデータを主メモリから読出してデータ転送を行う虞がある。このような虞をキャッシュ・コヒーレンシの問題と称し、これを解消するために、メモリライト動作時にキャッシュヒットであっても、その都度メモリライト動作を行うライトスルー方式をキャッシュメモリに採用すると共に、ライトバッファを用いてキャッシュメモリをノンブロッキング構成にすることができる。ところが、キャッシュ・コヒーレンシのために、メモリライト動作が頻発すると、データプロセッサはDMAコントローラと主メモリを接続するバスのデータ転送能力をキャッシュ・コヒーレンシのために使い切ってしまい、DMAコントローラによって高速のデータ転送を行うとき、そのデータ転送速度が制限されてしまうという問題を生ずる。
そこで、ライトスルーを採用せず、ライトバック方式でキャッシュ・コヒーレンシを保つために、キャッシュコヒーレンシを保たない動作を検出し、その時点でライトバックさせる技術を採用することができる。例えば、データプロセッサは、DMAコントローラがキャッシュメモリに蓄積されているデータをリードアクセスする動作(バス・スヌープ)を検出すると、そのデータをライトバックする動作を割り込ませ、その後で、DMA転送を可能にする。しかしながら、データプロセッサは、キャッシュコヒーレンシを保たない動作を検出するための負担が増すことになる。
本発明の目的は、タスクの切換えに伴う処理を軽減でき、データ処理能力を向上させることができるデータプロセッサを提供することにある。
本発明の別の目的は、タスク切換えに際してパイプラインの乱れを最小限に抑えることができるデータプロセッサを提供することにある。
本発明の更に別の目的は、スーパスカラアーキテクチャーのデータプロセッサにおいて、データコンフリクトによって空いたパイプラインを別のタスクの実行に切り替えて有効利用できるようにすることにある。
本発明のその他の目的は、ライトバック方式のキャッシュメモリを内蔵するとき、DMA転送に際してキャッシュ・コヒーレンシを保たせるための負担を最小限に抑えることができるデータプロセッサを提供することにある。
本発明の前記ならびにその他の目的と新規な特徴は本明細書の以下の記述から明らかにされるであろう。
発明の開示
本発明において、第1図に例示されるように、命令フェッチユニット(10)が命令をフェッチし、命令レジスタ(11)にラッチされた命令を命令デコーダ(12)が解読し、その解読結果に基づいて命令実行ユニット(13)が命令を実行するデータプロセッサ(1)は、プログラムの格納領域(160,170)とその領域に格納され命令を順次読出すためのポインタ(161,171)とを夫々が備えた複数個のタスクバッファ(16,17)と、前記夫々のタスクバッファ毎に専用化され、前記命令実行ユニットに配置されたレジスタ手段(S1,S2)と、前記複数個のタスクバッファと命令フェッチユニットとの中から一つを選択的に前記命令レジスタに接続するセレクタ(18)と、初期状態において前記セレクタに前記命令フェッチユニットを選択させると共に、内部又は外部で発生されるイベントに従って前記セレクタを選択制御する切換え制御手段(19)と、前記命令実行ユニットの制御に基づいて前記複数個のタスクバッファの全部又は一部をデータ書き込み可能に外部とインタフェースするインタフェース手段(21,BUS)とを含む。
前記タスクバッファは夫々固有のポインタを有し、命令実行ユニットは夫々のタスクバッファに割り当てられた固有のレジスタ手段を有するから、実行すべきタスクが、命令フェッチユニットのプログラムに従った通常命令処理とタスクバッファのプログラムに従ったスワップタスク処理との間で切換えられるとき、中断される通常命令処理の実行状態(例えばプログラムカウンタや汎用レジスタの値)を退避したり復帰したりするために外部メモリのスタック領域をアクセスする処理を必要としない。これにより、タスク切換えの高速化と、タスク切換えに伴う処理の軽減とが達成され、データプロセッサのデータ処理能力向上に寄与する。
前記命令レジスタ、命令デコーダ及び命令実行ユニットが、パイプラインステージ単位で処理を進めて命令をパイプライン処理を行う場合、上記により、パイプラインの乱れを最小限に抑えることができる。
前記命令実行ユニットは、前記命令レジスタに命令をラッチさせる指示信号(LIR)を出力し、前記セレクタは、その指示信号を前記切換え制御手段が選択する命令フェッチユニット又はタスクバッファに供給し、命令フェッチユニットは命令レジスタに供給すべき命令をその指示信号に基づいて更新し、前記タスクバッファは前記ポインタをその指示信号に基づいて更新することができる。この制御は、前記タスクバッファのポインタ制御を容易化する。
前記スワップタスク処理から通常命令処理への復帰の手法として、前記切換え制御手段が選択したタスクバッファから命令デコーダに供給された命令の解読結果に基づいて当該切換え制御手段が前記セレクタを前記命令フェッチユニットの選択状態に戻すようにできる。即ち、選ばれたスワップタスク処理の完了を以って、通常命令処理に復帰させる。
スワップタスク処理を最優先に完了させることを考慮した場合、第1図に例示されるように、前記切換え制御手段は、前記タスクバッファの選択に呼応して、命令実行ユニットに入力される割り込み信号を無効化する割り込み禁止信号(INH)を出力するとよい。これにより、スワップタスク処理中において割込み要求は受け付けられない。
割り込み受け付けを許容する場合、第12図に例示されるデータプロセッサ(1A)のように、前記切換え制御手段(19)は、前記タスクバッファ(16、17)を選択しているとき、前記命令実行ユニット(13)による割り込みの受け付けに対応される制御信号ICNTにより前記セレクタ(18)を命令フェッチユニットの選択状態に戻すと共に、その直前のタスクバッファの選択状態を退避させればよい。
データプロセッサ(1)は、前記命令実行ユニットと外部との間にデータキャッシュメモリ(15)を備えることができる。このデータプロセッサは、第20図に例示されるように、バス(4)を介してメモリ等の複数の周辺回路(2,5)に接続されてデータ処理システムを構成する。このとき、前記タスクバッファにDMA転送制御プログラム若しくはDMA転送及びデータ変換制御プログラムを設定した場合、キャッシュコヒーレンシの問題を解決するためのデータプロセッサの負担を軽減することができる。すなわち、データプロセッサの処理タスクがセレクタ等を介してDMA転送制御処理に切換えられた状態において、DMAコントローラとしての機能は実行ユニットが実現することになる。従って、データプロセッサの外部メモリ間、或いは外部メモリと外部の入出力回路間でDMAデータ転送を制御する場合、DMA転送制御のためのアドレス信号若しくはアクセス制御情報は必ずデータキャッシュメモリを通ることになる。換言すれば、キャッシュメモリがライトバック方式を採用する場合に、データキャッシュメモリの書き換えが外部メモリに反映されていない状態でDMA転送が開始されても、そのような外部メモリに反映されていないデータはデータキャッシュメモリから命令実行ユニットに読み込まれて、転送されることになる。これにより、データプロセッサは、キャッシュコヒーレンシを保たないDMA転送動作を検出するとともに検出したときには予じめライトバック動作を行なわせることを要せず、キャッシュコヒーレンシを保たないDMA転送動作を検出するというデータプロセッサの処理負担を軽減することができる。当然データプロセッサで実現するDMA転送制御機能において、転送データは一旦データプロセッサに読み込まれることになる。
上記タスク切換え手段は、第14図及び第16図に例示されるスーパスカラ形式のデータプロセッサ(1B,1C)にも応用できる。すなわち、命令レジスタ(11A,11B)にラッチした命令を命令デコーダ(12A,12B)で解読して命令実行ユニット(13A,13B)がその命令を実行する命令実行制御系列を複数系列備えると共に、命令をフェッチする命令フェッチユニット(10)を含み、複数の命令を前記複数の命令実行制御系列で並列実行可能なデータプロセッサ(1B、1C)は、プログラムの格納領域とその領域に格納され命令を順次読出すためのポインタとを夫々が備えた複数個のタスクバッファ(16、17)と、前記夫々のタスクバッファ毎に専用化され、特定の前記命令実行ユニットに配置されたレジスタ手段(S1,S2)と、前記複数個のタスクバッファと命令フェッチユニットとの中から一つを選択して前記特定の命令実行ユニットに対応される命令レジスタに接続するセレクタ(18)と、初期状態において前記セレクタに前記命令フェッチユニットを選択させると共に、内部又は外部で発生されるイベントに従って前記セレクタを選択制御する切換え制御手段(19)とを有する。このデータプロセッサにおいても、一方の命令実行制御系を利用して通常命令処理とスワップタスク処理を切換えられるので、上記同様、タスク切換えの高速化とタスク切換えに伴うデータプロセッサの負担軽減とを達成でき、また、パイプラインの乱れも最小限に抑えることができる。したがって、スーパスカラアーキテクチャが本来企図する高いデータ処理能力を保証することができる。
複数の命令を並列実行可能なスーパスカラデータプロセッサにおいて、データコンフリクトのような命令相互の依存関係をハードウェアによって調停する場合、前記夫々の命令実行制御系列に含まれる命令デコーダからの命令解読結果に基づいて、相互に異なる命令実行制御系列による命令の並列実行が可能か否かについてそれら命令相互間の依存関係を調べ、他の命令の実行結果に依存する命令の実行を遅らせる競合管理ユニット(25)を備えることになる。
このとき、前記切換え制御手段は、第16図に例示されるように、データコンフリクトなどによって前記競合管理ユニットが特定の命令の実行を遅らせるとき、それを通知する制御信号250に応答して前記セレクタ(18)にタスクバッファを選択させることにより、処理が中断される一方の命令実行制御系若しくはパイプによる通常命令処理をスワップタスク処理に切換えることができ、命令実行制御系列を有効利用することができる。特にタスク切換え時には前述の通り、途中で中断される通常命令処理の実行状態の退避を要しないから、命令実行制御系列の空き時間が短い場合にも効率的にタスク切換えを行ってスワップタスク処理に移行することができる。
前記データコンフリクト等の競合状態は命令デコード結果に基づいて競合管理ユニット(25)が判定し、そのとき、処理が遅延されるべき命令は既にデコードを終了している。その後で、スワップタスク処理に切換えられるが、処理が中断される通常命令処理と、それに代えて処理が開始されるスワップタスク処理とが相互に同じ命令レジスタ及び命令デコーダを用いる場合には、第17図に例示されるように、パイプ1におけるパイプラインステージmの命令フェッチ(In)と同じ命令をパイプ1のステージm+2で再度フェッチし、パイプ1におけるパイプラインステージm+1の命令デコード(Dn)と同じ命令をパイプ1のステージm+3で再度デコードしなければならず、この意味においてパイプラインが乱れることになる。従って、スワップタスク処理の後に、処理が中断された通常命令処理に復帰するときは命令フェッチから再開しなければならない。
上述のデータコンフリクトによる通常命令処理からスワップタスク処理書への切換えにおいて、パイプラインに全く乱れを生じないようにするには、第18図に例示されるように、データプロセッサ(1D)は、一方の命令実行制御系に、スワップタスク処理専用の命令レジスタ(11C)と命令デコーダ(12C)を追加すればよい。すなわち、命令レジスタ(11A,11B)にラッチした命令を命令デコーダ(12A,12B)で解読して命令実行ユニット(13A,13B)が命令を実行する命令実行制御系列を複数系列備えると共に、命令をフェッチする命令フェッチユニット(10)を含み、複数の命令を前記複数の命令実行制御系列で並列実行可能とされることを前提とする。そして、このデータプロセッサ(1D)は、プログラムの格納領域とその領域に格納され命令を順次読出すためのポインタとを夫々が備えた複数個のタスクバッファ(16、17)と、前記複数個のタスクバッファに専用化された特定タスク用命令レジスタ(11C)と、前記特定タスク用命令レジスタにラッチされた命令を解読する特定タスク用命令デコーダ(12C)と、前記夫々のタスクバッファ毎に専用化され、特定の命令実行ユニットに配置されたレジスタ手段(S1,S2)と、前記複数個のタスクバッファと命令フェッチユニットとの中から一つを選択的して前記特定の命令実行ユニットに対応される命令レジスタに接続する第1のセレクタ(18)と、前記複数個のタスクバッファの中から一つを選択して前記特定タスク用命令レジスタに接続する第2のセレクタ(26)と、前記特定の命令実行ユニットに対応される命令デコーダの出力と前記特定タスク用命令デコーダの出力を選択的に前記特定の命令実行ユニットに接続する第3のセレクタ(27)と、前記夫々の命令実行制御系列に含まれる命令デコーダからの命令解読結果に基づいて、相互に異なる命令実行制御系列による命令の並列実行が可能か否かについてそれら命令相互間の依存関係を調べ、他の命令の実行結果に依存する特定の命令の実行を遅らせ、当該特定の命令の実行を遅らせるとき前記第3のセレクタに前記特定タスク用命令デコーダを選択させる競合管理ユニット(25)と、初期状態において前記命令フェッチユニットを前記第1のセレクタに選択させると共に第2のセレクタを非選択状態に制御し、内部又は外部で発生されるイベントに従って前記第1のセレクタを選択制御し、また、前記第3のセレクタによる前記特定タスク用命令デコーダの選択に呼応して第2のセレクタに内部又は外部で発生されるイベントに応じたタスクバッファを選択させる切換え制御手段(19)とを含む。
【図面の簡単な説明】
第1図は本発明の第1の実施例に係るデータプロセッサのブロック図、
第2図は命令フェッチユニットの一例ブロック図、
第3図はスワップタスクバッファの第1の例を示すブロック図、
第4図はスワップタスクバッファの第2の例を示すブロック図、
第5図はスワップタスクバッファの第3の例を示すブロック図、
第6図はスワップタスクバッファの第4の例を示すブロック図、
第7図は命令実行ユニットに含まれるレジスタセットの一例説明図、
第8図は第1の実施例に係るデータプロセッサにおけるタスク切換え動作の一例説明図、
第9図は通常命令処理と割り込み処理との切換え動作の一例説明図、
第10図は第1の実施例に係るデータプロセッサにおけるタスク切換えとパイプラインとの関係を示す一例タイミングチャート、
第11図はスワップタスク中に割り込みを受け付けない第1の実施例に係るデータプロセッサの一例動作タイミングチャート、
第12図は本発明の第2の実施例に係るデータプロセッサのブロック図、
第13図はスワップタスク中に割り込みを受け付ける第2の実施例に係るデータプロセッサの一例動作タイミングチャート、
第14図は本発明の第3の実施例に係るデータプロセッサのブロック図、
第15図は第3の実施例に係るデータプロセッサにおいてデータコンフリクトを生じた場合の制御とタスク切換え制御の内容を示す一例タイミングチャート、
第16図は本発明の第4の実施例に係るデータプロセッサのブロック図、
第17図は第4の実施例に係るデータプロセッサにデータコンフリクトを生じたときのタスク切換え制御の内容を示すタイミングチャート、
第18図は本発明の第5の実施例に係るデータプロセッサのブロック図、
第19図はデータコンフリクトを生じたとき第5の実施例に係るデータプロセッサで行われるタスク切換え制御を示すタイミングチャート、
第20図は本発明のデータプロセッサを適用したデータ処理システムの一例ブロック図、
第21図はDMA転送制御及びデータ変換制御プログラムによるタスクの一例を示す説明図、
第22図はDMA転送制御及びデータ変換制御プログラムのプログラム記述の最小単位の一例を示す説明図、
第23図はライトバック方式を採用するキャッシュメモリとデータプロセッサの外部に配置されたDMAコントローラとを含むデータ処理システムの一例ブロック図である。
発明を実施するための最良の形態
第1図には本発明の第1の実施例に係るデータプロセッサのブロック図が示される。同図に示されるデータプロセッサ1は、特に制限されないが、公知の半導体集積回路製造技術によって単結晶シリコンのような1個の半導体基板に形成されている。
第1図において10は命令フェッチユニット、11は命令レジスタ、12は命令デコーダ、13は命令実行ユニット、14は命令キャッシュメモリ、15はデータキャッシュメモリ、16,17は代表的に示されたスワップタスクバッファ、18はセレクタ、19は切換え制御回路、20は内蔵周辺モジュールを総称する回路ブロックである。
前記命令実行ユニット13は、プログラムカウンタPC、汎用レジスタGR、夫々のスワップタスクバッファ16,17に個々に割り当てられたレジスタセットS1,S2、割り込み制御回路131、シーケンス制御回路132、演算回路等133などを含む。
本実施例のデータプロセッサ1において、命令レジスタ11、命令デコーダ12及び命令実行ユニット13はパイプラインステージ単位で処理を進めて、命令をパイプライン処理する。命令レジスタ11、命令デコーダ12及び命令実行ユニット13における動作サイクルは、データプロセッサ1の図示を省略する動作基準クロック信号に同期して、前記シーケンス制御回路132が制御する。
この命令実行ユニット13は、特に制限されないが、内部バスBUSに接続されたデータキャッシュメモリ15を介して外部にインタフェースされる。データキャッシュメモリのキャッシュの対象は外部メモリ2等とされる。データキャッシュメモリ15は図示を省略するキャッシュデータ部、キャッシュタグ部及びキャッシュコントローラを含む回路ブロックとして図示されている。キャッシュデータ部は外部メモリ2等が保有するデータの一部を保持する。キャッシュタグ部はキャッシュデータ部が保有するデータと対応させてそのアドレスの一部(アドレスタグ)をキャッシュタグとして保有する。キャッシュコントローラは外部アクセスにおいてキャッシュ・ヒットの場合には、ヒットに係るデータをキャッシュデータ部から内部バスBUSに出力し、或いはヒットに係るデータを新たなエントリとしてキャッシュデータ部に書き込む。キャッシュ・ミスの場合には外部メモリ2等から読み込んだデータを内部バスBUSに与え、或い外部メモリ2等を書き込みアクセスする。キャッシュミスにおいては、キャッシュラインのリプレースを行うことができる。特に制限されないが、このキャッシュコントローラは、キャッシュヒットによって書き換えられたキャッシュデータ部の内容を外部メモリ2等に書き戻すための処理は、キャッシュラインのリプレースが行われるときだけ行う、所謂ライトバックによって行う。
前記プログラムカウンタPCは次に実行すべき命令アドレスを保有する。命令フェッチユニット10は、特に制限されないが、プログラムカウンタPCの値に基づいて、将来実行されると予想される命令(例えばプログラムカウンタPCによって指定される命令からその先の複数命令)をフェッチする。フェッチされるべき命令は、特に制限されないが、外部メモリ3に格納されている。この実施例において外部メモリ3と命令フェッチユニット10との間には命令キャッシュメモリ14が配置されている。
この命令キャッシュメモリ14は、図示を省略するキャッシュデータ部、キャッシュタグ部及びキャッシュコントローラを含む回路ブロックとして図示されている。キャッシュデータ部は外部メモリ3等が保有する命令の一部を保持する。キャッシュタグ部はキャッシュデータ部が保有する命令と対応させてそのアドレスの一部(アドレスタグ)をキャッシュタグとして保有する。キャッシュコントローラは命令フェッチユニット10によるメモリアクセスにおいてキャッシュ・ヒットの場合にはキャッシュデータ部が保有する命令を命令フェッチユニット10に与え、キャッシュ・ミスの場合には外部メモリ3等から命令を読み込んで命令フェッチユニット10に与える。
命令フェッチユニット10は、特に制限されないが、先入れ・先出し(First-in・First-out)バッファの機能を有し、プログラムカウンタPCの値に対して複数ワード分の命令をプリフェッチすることができる。例えば第2図に示されるように4段のラッチ100A〜100Dが直列配置され、セレクタ101A〜101Cを介して前段のラッチを介することなく直接外部若しくは命令キャッシュメモリ14からの命令を取り込むことができるようにされている。102は命令フェッチのための制御回路であり、プログラムカウンタPCの値に基づいてフェッチすべき命令のアドレスを出力するとともに、それによって入力される命令を先入れ・先出し形態で前記ラッチ100A〜100Dに保持させ且つラッチ100A〜100Dから出力させる。特に制限されないが、ラッチ100A〜100Dは2ワード単位で命令をラッチし、命令デコーダ12は1ワード単位で命令をデコードする。これに応じて、データラッチ100Dの出力はセレクタ103で下位ワードと上位ワードに分けて出力される。
前記夫々のスワップタスクバッファ16、17は、プログラム格納領域160、170とその格納領域160、170に格納された命令を順次読み出すためのポインタ161、171とを有する。特に制限されないが、スワップタスクバッファ16は内部バスBUSを介して実行ユニット13によりそのプログラム格納領域160に対する書込みが可能にされている。また、スワップタスクバッファ17は、命令実行ユニット13により制御されるシリアルインタフェース(その制御線は図示を省略してある)21を介してそのプログラム格納領域170に対する書込みが可能にされている。
スワップタスクバッファ16、17の一例は第3図〜第6図に示されている。第3図の例はシフトレジスタとセレクタを格納領域160(170)とするものであり、複数個の並列入出力型のラッチLATが縦続されて成るシフトレジスタと、夫々のラッチLATの並列出力から1ビットづつ選択して並列出力するセレクタSELと、セレクタSELを介して、各位ラッチLATの出力を上位側或いは下位側から順番にセレクタSELに選択させるポインタ160(170)とによって構成することができる。例えば夫々mビットのラッチLATをn段備えるとすると、nビット単位で順次命令をm回出力することができる。シフトレジスタへのデータ書込みはシリアルインタフェース21又は命令実行ユニット13の制御で行われる。前記ラッチLATの段数は命令のビット数に応じて決定され、第4図には第3図とはラッチLATの段数が異なる構成が示されている。第5図の例はダイナミック型メモリセル又はスタティック方メモリセルをマトリクス配置したメモリセルアレイMCA1とアドレスデコーダADEC1から成るRAM(Random Access Memory)を格納領域160とするものであり、ポインタ161がRAMに対するアクセスアドレスを生成する。RAMに対する書込みは命令実行ユニット13が制御する。第6図の例は不揮発性記憶素子をマトリクス配置したメモリセルアレイMCA2とアドレスデコーダADEC2から成るROM(Read Only Memory)を格納領域160とするものであり、ポインタ161がROMに対するアクセスアドレスを生成する。
スワップタスクバッファ16,17には、一つのまとまった処理を実現するための命令系列によって構成されるプログラムが格納される。特定の命令系列によって実現される一つのまとまった処理の単位をタスクと定義するならば、特定のタスクに係る処理プログラムが格納される。例えば、DMA転送のための処理プログラム、データ圧縮・伸長のための処理プログラムなどが設定される。スワップタスクバッファ16,17への処理プログラムのロードは、特に制限されないが、パワーオンリセットなどによるシステムイニシャライズ時にシリアルインタフェース21や命令実行ユニット13を介して行うことができる。
前記セレクタ18はスワップタスクバッファ16、17と命令フェッチユニット10との中から一つを選択して命令レジスタ11に接続する。その接続制御は切換え制御回路19が行う。この切換え制御回路19は、データプロセッサ1のイニシャライズリセット時に前記セレクタ18に命令フェッチユニット10を選択させ、その後、内外で発生される所定のイベント、例えば、内蔵周辺回路モジュール20からの割り込み信号22や外部における所定のイベント発生の通知信号23に従ってセレクタ18にスワップタスクバッファ16又は17の出力を選択させる。どのスワップタスクバッファを選択するかは、イベントの発生元とスワップタスクバッファとの対応テーブルを切換え制御回路19が備えて判定したり、或いはイベント発生の通知信号毎に固有のスワップタスクバッファを割り当てて制御することができる。
特に制限されないが、前記命令実行ユニット13は、前記命令レジスタ11に命令をラッチさせる指示信号LIRを出力する。命令レジスタ11はその指示信号LIRに同期して命令をラッチする。このとき、前記セレクタ18は、前記切換え制御回路19が選択する命令フェッチユニット10又はスワップタスクバッファ16,17にその指示信号LIRを供給する。命令フェッチユニット10はその指示信号LIRを受けると、命令レジスタ11に供給すべき命令をその指示信号に基づいて更新する。また、前記タスクバッファ16,17はその指示信号LIRを受けると、前記ポインタ161,171をその指示信号LIRに基づいて更新する。これにより、セレクタ18で選択されるスワップタスクバッファ16又は17のポインタ161又は171が順次更新され、そのポインタの値に応じた命令が格納領域160,170から命令レジスタ11に供給されることになる。
スワップタスクバッファ16,17に格納されたプログラムの実行終了は、当該プログラムの最後に実行される命令が命令デコーダ12でデコードされて出力される終了信号120によって切換え制御回路19が認識する。切換え制御回路19は、そのデコード結果(終了信号120)を受け取ると、前記セレクタ18を命令フェッチユニット10の選択状態に戻す。
第7図には命令実行ユニット13のレジスタ構成例が示される。汎用レジスタGRは、レジスタSR,R0〜R15を含む。SRはステータスレジスタに割り当てられ、R0〜R7はデータレジスタやアドレスレジスタに割り当てられ、R8〜R15はデータレジスタ、アドレスレジスタ、スタックポインタ等に割り当てられる。前記レジスタセットS1はレジスタS1SR,S1R0〜S1R7を含み、前記レジスタセットS2はレジスタS2SR,S2R0〜S2R7を含み、それらレジスタセットS1,S2は、汎用レジスタGRのレジスタSR,R0〜R7に代えて利用されるものであり、夫々固有のレジスタアドレスを有する。レジスタセットS1はスワップタスクバッファ16に格納されたプログラムの実行に専用的に割り当てられ、レジスタセットS2はスワップタスクバッファ17に格納されたプログラムの実行に専用的に割り当てられ、汎用レジスタGRのレジスタSR,R0〜R7は命令フェッチユニット10から出力された命令の実行に割り当てられる。
特に制限されないが、汎用レジスタGRのレジスタSR,R0〜R7、レジスタセットS1又はレジスタセットS2のどのレジスタを利用するかは、レジスタ番号とタスクの種類によって決定され、例えばそれは、命令のオペランドフィールドで指定される。命令フェッチユニット18から出力される命令が選択されるとき命令実行ユニット13は命令実行に前記レジスタSR,R0〜R15を用い、スワップタスクバッファ16から出力される命令が選択されるとき命令実行ユニット13は命令実行に前記レジスタS1SR,S1R0〜S1R7を用い、スワップタスクバッファ17から出力される命令が選択されるとき命令実行ユニット13は命令実行に前記レジスタS2SR,S2R0〜S2R7を用いる。
上述のように、スワップタスクバッファ16,17は夫々固有のポインタ161,171を有し、夫々のスワップタスクバッファ16,17に割り当てられた固有のレジスタセットS1,S2を有するから、実行すべきタスクが命令フェッチユニット10とスワップタスクバッファ16,17との間で切換えられたとき、プログラムカウンタPCやレジスタGRの値を退避したり復帰したりするために外部メモリ2等のスタック領域をアクセスする処理を必要としない。
第8図にはタスク切換えの動作例が示される。前記命令フェッチユニット10からの命令を実行する(通常命令処理)状態の途上で、例えば信号23によって、スワップタスクバッファ16に格納されているプログラム(スワップタスク1)の実行が要求されると、切換え制御回路19は、パイプラインステージの切換わりに同期して、セレクタ18による選択状態をスワップタスクバッファ16に切換える。これにより、スワップタスクバッファ16は指示信号LIRに同期してスワップタスク1の先頭の命令をポインタ161で指示して出力し、命令レジスタ11がこれをラッチする。また、命令実行ユニット13は、スワップタスクを実行するときは、当該タスクの命令記述によって指定されるレジスタセットS1を利用する。これにより、プログラムカウンタPCの退避、レジスタSR,R0〜R7の退避を要せずに、スワップタスク1の実行に移ることができる。切換えられたスワップタスク1の最後の命令が命令デコーダ12で解読されると、切換え制御回路19はセレクタ18に命令フェッチユニット10を選択させる。このとき、プログラムカウンタPC、ステータスレジスタSR,データ及びアドレスレジスタR0〜R7は、前記ワップタスク1への切換え直前の値をそのまま維持している。スワップタスクバッファ16に格納されていた命令の実行においてレジスタR8〜R15は利用されない。したがって、通常命令への切換えに際しても、復帰のためのメモリアクセスを必要としない。第9図に示される通常命令処理と割り込み処理との切換えの場合には、切換えの度に退避、復帰のためのメモリアクセスが必要になる。退避、復帰のためのメモリアクセスは、タスク切換え若しくはパイプライン切換えのオーバヘッドになる。
第10図には通常命令処理とスワップタスク1との切換え時におけるパイプラインの状態の一例が示される。特に制限されないが、本実施例のデータプロセッサ1におけるパイプラインステージは5段とされ、通常命令処理におけるパイプラインステージは、命令フェッチ(In)、命令デコード(Dn)、演算(En)、メモリアクセス(An)及びレジスタストア(Sn)の各ステージとされる。スワップタスクにおけるパイプラインステージは、命令転送(Cs)、命令デコード(Ds)、演算(Es)、メモリアクセス(As)及びレジスタストア(Ss)の各ステージとされる。
例えば、パイプラインステージmにおいてスワップタスク1の実行が要求されると、切換え制御回路19は、パイプラインステージm+1においてセレクタ18による選択状態をスワップタスクバッファ16に切換え、当該パイプラインステージm+1においてスワップタスク1の先頭の命令に対する命令が命令レジスタ11に転送(Cs1)される。タスク切換え時には前述の通りプログラムカウンタPCやレジスタSR,R0〜R7の退避を要せずに、スワップタスク1の実行に移ることができる。以下パイプラインステージ毎に処理が一つずつ進められる。命令実行ユニット13は、通常命令処理の実行では汎用レジスタGRを利用するが、スワップタスク1の実行ではレジスタセットS1を利用する。どのレジスタを利用するかは夫々の命令記述によって決定される。切換えられたスワップタスク1の最後の命令がパイプラインステージnにおいて命令デコーダ12で解読(Ds1)されると、切換え制御回路19に終了信号120が供給される。切換え制御回路19はパイプラインステージn+1でセレクタ18に命令フェッチユニット10を選択させ、これによってパイプラインステージn+1以降では命令レジスタ11には命令フェッチユニット10から命令が供給される。通常命令処理への切換えに際しても、前述の通り、復帰のためのメモリアクセスを必要としない。以上のように、通常命令処理とスワップタスク1との間でのタスク切換えに際して、パイプラインは一切乱れを生じていない。
第1図において前記割り込み制御回路131には、代表的に示された割り込み要求信号IRQが供給される。割り込み制御回路131はそれに設定されている割り込み優先度に応じて割り込み要求を受け付ける。本実施例では、前記切換え制御回路19は、スワップタスクバッファ16又は17をセレクタ18に選択させている状態において、割り込み受け付け禁止信号INHをイネーブルにして割り込み制御回路131に供給する。割り込み制御回路131は、割り込み禁止信号INHがイネーブルにされているとき割り込み要求を一切受け付けない。したがって、データプロセッサ1は、スワップタスクバッファ16又は17のプログラムに従ったタスクを実行しているとき、そのタスクの実行完了まで、タスクの切換えは行われない。換言すれば、スワップタスクバッファ16又は17に格納されたプログラムによるタスクには最も高い実行優先度が与えられることになる。割り込み制御回路131は、割り込み要求を受け付けると、現在の命令実行を中断し、プログラムカウンタPC、ステータスレジスタSR、データ及びアドレスレジスタR0〜R15の内容等を外部メモリ2等のスタック領域に退避し、その後、受け付けた割り込み要求処理プログラムに分岐される。
第11図には上述のようにスワップタスク中に割り込みを受け付けない場合の動作例が示される。通常処理の途中で割り込み要求があると、戻り番地などを退避した後、割り込み処理に分岐され、割り込み処理が終了されると、復帰処理を行った後に、通常処理に戻される。通常処理においてスワップタスク1の実行要求があると、切換え制御回路19はスワップタスクバッファ16を選択させて、即座にスワップタスク1の実行に移される。スワップタスク1の実行中は前記割り込み禁止信号INHがイネーブルにされるので、割込み要求があっても、その間は割り込み要求は受け付けられない。受け付け禁止されていた割り込み要求は、スワップタスク1の実行完了後に割り込み禁止信号INHがディスエーブルにされた後受け付けられる。割り込み処理に分岐する際には先ず、中断されている通常命令処理の戻り番地やレジスタの値を退避させ、その後割り込み処理に分岐される。割り込み処理終了後は、退避された情報を復帰させた後、通常命令処理に戻される。
第12図には本発明に係るデータプロセッサの第2の実施例が示される。同図に示されるデータプロセッサ1Aは、スワップタスクバッファ16又は17に格納されたプログラムによるタスクの実行中にも割り込みを受付可能にした点が、第1図のデータプロセッサ1と相違される。その他の点については第1図と同じであり、それと同一機能の回路ブロックには同一符号を付してその詳細な説明を省略する。
データプロセッサ1Aにおいて、割り込み制御回路131は割り込み要求を受け付けると、割り込み制御信号ICNTをイネーブルにして前記切換え制御回路19に供給する。切換え制御回路19は、セレクタ18がスワップタスクバッファ16又は17を選択しているとき、割り込み制御信号ICNTがイネーブルにされると、セレクタ18による選択状態を命令フェッチユニット10に切換え制御する。更に、切換え直前に選択されていたスワップタスクバッファ16,17を特定するための情報(スワップタスク選択情報)を退避する。退避先は、切換え制御回路19内部の図示を省略する退避用ラッチとすることが望ましい。外部メモリ2等のスタック領域に退避させてもよいが、その場合には、当該割り込み処理からスワップタスクに復帰する時にスワップタスク選択情報を復帰させるのに外部バスアクセスサイクルを起動しなければならず、スワップタスク処理への復帰が遅れるからである。
スワップタスクの実行中に割り込みを受け付ける場合、それ以前に通常命令処理からスワップタスクへの分岐が行われている。したがって、当該割り込み処理を完了した後、現在中断中の通常処理に復帰出来るようにしなければならない。このため、前記セレクタ18の切換えとスワップタスク選択情報の退避の後、現在中断している通常命令処理の戻り番地とレジスタ情報が退避され、その後、割り込み処理プログラムに分岐される。
第13図にはスワップタスク中に割り込みを受け付ける場合の動作例が示される。通常命令処理の途中で割り込み要求があると、戻り番地などを退避した後、割り込み処理に分岐され、割り込み処理が終了されると、復帰処理を行った後に、通常命令処理に戻される。通常命令処理においてスワップタスク1の実行要求があると、切換え制御回路19はスワップタスクバッファ16をセレクタ18に選択させて、即座にスワップタスク1の実行に移される。割り込み制御回路131は、スワップタスク1の実行中でも割り込みを受け付けることができ、割り込みを受け付けると、割り込み制御信号ICNTをイネーブルにして前記切換え制御回路19に供給する。これによって切換え制御回路19は、セレクタ18による選択状態を命令フェッチユニット10に切換え制御すると共に、そのとき選択されていたスワップタスクバッファを特定するためのスワップタスク選択情報を退避する。そして、割り込みを受け付けた命令実行ユニット13は、それ以前に処理が中断されている通常命令処理の戻り番地とレジスタ情報をスタック領域に退避(S1)した後、割り込み処理プログラムに分岐する。この割り込み処理が終了(T1)されると、前記割り込み制御信号ICNTがディスエーブルにされ、これによって切換え制御回路19は、退避されているスワップタスク選択情報に従って、中断されていたスワップタスク1の実行を再開する。このスワップタスク1の最後の命令が命令デコーダ12で解読されると、終了信号120が切換え制御回路19に与えられ、これによって、切換え制御回路19はセレクタ18に命令フェッチ回路10の出力を選択させる。そうすると、前記割り込み処理の後の復帰処理(S2)が開始され、退避されていた通常命令処理の戻り番地やレジスタ情報が復帰されて、通常命令処理が再開される。その復帰処理(S2)は、割り込み処理終了(T1)後に再開されるスワップタスク処理1の終了まで引き伸ばされているが、これは、割り込み処理が終了(T1)されたとき、切換え制御回路19は、前記スワプタスク選択情報が退避されていることに基づいて、セレクタ18を先ずスワップタスクバッファ16に切換えるからである。
第14図には本発明に係るデータプロセッサの第3の実施例が示される。同図に示されるデータプロセッサ1Bはスーパスカラアーキテクチャを有し、複数の命令を2本のパイプラインによって並列的に実行することができる。すなわち、命令レジスタ11Aにラッチした命令を命令デコーダ12Aで解読して命令実行ユニット13Aがその命令を実行する第1の命令実行制御系列と、命令レジスタ11Bにラッチした命令を命令デコーダ12Bで解読して命令実行ユニット13Bがその命令を実行する第2の命令実行制御系列とを有する。第1の命令実行制御系列で行われるパイプライン処理をパイプ0と称し、第2の命令実行制御系列で行われるパイプライン処理をパイプ1と称する。LIRAは命令レジスタ11Aに対する命令ラッチの指示信号、LIRBは命令レジスタ11Bに対する命令ラッチの指示信号であり、前記指示信号LIRに対応される。
前記命令実行ユニット13A、13Bは夫々に専用化されたシーケンス制御回路132A,132Bと演算回路133A,133Bを有する。パイプ0とパイプ1との間で生ずるデータコンフリクトのような命令相互間の依存関係は競合管理ユニット25が命令デコーダ12A,12Bのデコード結果に基づいて検出する。すなわち、競合管理ユニット25は、命令デコーダ12A,12Bからの命令解読結果に基づいて、パイプ0とパイプ1による命令の並列実行が可能か否かについてそれら命令相互間の依存関係を調べ、他の命令の実行結果に依存することになる命令の実行を遅らせるように、制御信号ARBA,ARBBによってシーケンス制御回路132A,132Bを制御する。
割り込み制御回路131、プログラムカウンタPC,汎用レジスタGRは双方の命令実行ユニット13A,13Bに共有されている。レジスタセットS1,S2は命令実行ユニット13Bに専用化されている。それらの詳細については第1図のデータプロセッサと同じである。
このスーパスカラアーキテクチャーのデータプロセッサ1Bにおいて、前記セレクタ18、切換え制御回路19及びスワップタスクバッファ16,17は命令レジスタ11B側の命令実行制御系列に配置されている。そして、第1図のデータプロセッサと同様に、命令フェッチユニット10、命令キャッシュメモリ14、内蔵周辺モジュール20、データキャッシュメモリ15などが設けられている。第14図において第1図と同一機能を有するものには同一符号を付してその詳細な説明を省略する。尚、第14図の場合、双方のスワップタスクバッファ16、17は内部バスBUSを介してプログラムの初期ロードが行われるようになっている。
第15図にはデータプロセッサ1Bにおいてデータコンフリクトを生じた場合の制御とタスク切換え制御の内容が例示されている。
例えばパイプラインステージmで夫々命令レジスタ11A,11Bにラッチされた命令のデコードステージ(m+1)で競合管理ユニット25がデータコンフリクトを検出すると、後から実行されるべき命令の実行は、先に実行されるべき命令の実行結果が得られるまでNOP(ノン・オペレーション)とされる。すなわち、パイプラインステージ(m+4)におけるパイプ0のレジスタストア(Sn)の結果を当該ステージ(m+4)におけるパイプ1の演算ステージ(En)で利用できるようになるまで、パイプ1のパイプラインステージがNOPとされる。
また、パイプラインステージm+3においてスワップタスク1の実行が要求されると、切換え制御回路19は、パイプラインステージm+4においてセレクタ18による選択状態をスワップタスクバッファ16に切換え、当該パイプラインステージm+4においてパイプ1ではスワップタスク1の先頭の命令に対する命令が命令レジスタ11Bに転送される(Cs1)。タスク切換え時には前述の通りプログラムカウンタPCやレジスタSR,R0〜R7の退避を要せずに、スワップタスク1の実行に移ることができる。以下パイプ1のパイプラインステージ毎に処理が順次進められる。このとき、命令実行ユニット13Bは、スワップタスク1の実行にはレジスタセットS1を利用する。どのレジスタを利用するかは前記の例と同様に夫々の命令記述によって決定される。切換えられたスワップタスク1の最後の命令がパイプ1におけるパイプラインステージn+1で命令デコーダ12Bにてデコードされると、切換え制御回路19に終了信号120が供給される。切換え制御回路19はパイプラインステージn+1でセレクタ18に命令フェッチユニット10を選択させ、これによってパイプ1のパイプラインステージn+1以降では命令レジスタ11Bには命令フェッチユニット10から命令が供給される。これによってパイプ1では通常命令処理が再開される。通常命令処理への切換えに際しても、前述の通り、復帰のためのメモリアクセスを必要としない。以上のように、通常命令処理とスワップタスク1との間でのタスク切換えに際して、パイプラインは一切乱れを生じていない。
第16図には本発明に係るデータプロセッサの第4の実施例が示される。同図に示されるデータプロセッサ1Cは前記データプロセッサ1Bと同様にスーパスカラアーキテクチャを有し、複数の命令を2本のパイプラインによって並列的に実行することができる。データプロセッサ1Bと相違する点は、パイプ0及びパイプ1によって通常命令処理を行っているときのデータコンフリクトの発生をスワップタスクへの切換え要因の一つとして有することである。競合管理ユニット25はデータコンフリクトの発生に同期する制御信号250を切換え制御回路19に与える。これによって切換え制御回路19は、データコンフリクトによる通常命令処理におけるパイプ1の空きを利用してスワップタスク1の処理を行なう。但し、パイプ1側の命令レジスタ11B及び命令デコーダ12Bは一組しかないので、データコンフリクトによって実行が中断された命令実行の再開に際しては、命令フェッチからやり直すことになる。その制御はシーケンス制御回路132Bが行なう。その他の構成は図14のデータプロセッサ1Bと同じであるのでその構成の詳細な説明は省略する。
第17図にはデータコンフリクトを生じたときのタスク切換え制御の内容が例示されている。例えばパイプラインステージmで夫々命令レジスタ11A,11Bにラッチされた命令のデコードステージ(m+1)で競合管理ユニット25がデータコンフリクトを検出すると、後から実行されるべき命令の実行は、先に実行されるべき命令の実行結果を利用できるまでNOP(ノン・オペレーション)とされる。すなわち、パイプラインステージ(m+4)におけるパイプ0のレジスタストア(Sn)の結果を当該ステージ(m+4)におけるパイプ1の演算ステージ(En)で利用できるようになるまで、パイプ1のパイプラインステージにおける通常命令処理の実行が停止される。その指示は制御信号ARBBによって命令実行ユニット13Bに通知される。このとき、競合管理ユニット25は制御信号250を活性化して切換え制御回路19に与える。切換え制御回路19は、それに応答してセレクタ18にスワップタスクバッファ16を選択させる。これにより、パイプラインステージm+1〜m+5においてパイプ1は、スワップタスク1の処理を行うことができる。スワップタスク1の処理に許容される期間は、データコンフリクトによってパイプ1の通常命令処理が中断される期間であり、その期間は競合管理ユニット25で制御され、制御信号250に反映され、当該制御信号250がインアクティブにされることによって、セレクタ18の選択状態は元の通常命令処理の選択状態(命令フェッチユニット10の選択状態)に戻される。タスク切換え時には前述の通りプログラムカウンタPCやレジスタSR,R0〜R7の退避を要せずに、スワップタスク1の実行に移ることができる。このとき、命令実行ユニット13Bは、スワップタスク1の実行にはレジスタセットS1を利用する。どのレジスタを利用するかは前記の例と同様に夫々の命令記述によって決定される。
図17の例では、パイプラインステージm+3で夫々命令レジスタ11A,11Bにラッチされた命令のデコードステージ(m+4)においても競合管理ユニット25がデータコンフリクトを検出して、上記同様に、パイプラインステージ(m+7)におけるパイプ0のレジスタストア(Sn)の結果を当該ステージ(m+7)におけるパイプ1の演算ステージ(En)で利用できるようになるまで、パイプ1のパイプラインステージにおける通常命令処理の実行が停止され、それに代えて、パイプ1は、スワップタスク1の処理を行なってる。この例では、スワップタスク1の処理は細切れであり、その処理タイミングもデータコンフリクト発生時に限定されているが、データコンフリクトに固有の処理や処理インターバルに制限のない処理に適用して有効である。また、制御信号250は、前記信号22、23で選択されたスワップタスクを実際に処理するタイミングを規定する制御信号として利用してもよい。
第18図には本発明に係るデータプロセッサの第5の実施例が示される。同図に示されるデータプロセッサ1Dは前記データプロセッサ1Bと同様にスーパスカラアーキテクチャを有し、複数の命令を2本のパイプラインによって並列的に実行することができる。データプロセッサ1Dは、データプロセッサ1Cと同様に、パイプ0及びパイプ1によって通常命令処理を行っているときのデータコンフリクトの発生をスワップタスクへの切換え要因の一つとするが、そのとき実行されるスワップタスクに専用的に割り当てられる命令レジスタ11Cと命令デコーダ12Cを備える点が前記データプロセッサ1Cと相違される。命令レジスタ11Cの入力の選択はセレクタ26が行い、命令デコーダ12B又は12Cの出力はセレクタ27によって選択される。
競合管理ユニット25はデータコンフリクトの発生に同期してイネーブルにされる制御信号250を切換え制御回路19と前記セレクタ27に与える。これによってセレクタ27は命令デコーダ12Cの出力を選択すると共に、制御信号LIRBも命令レジスタ11C側に供給され、命令レジスタ11Bは現在保持している命令をそのまま維持し、それに代えて命令レジスタ11Cが制御信号LIRBに従って新たな命令をラッチ可能にされる。また、切換え制御回路19は、イネーブル状態の制御信号250によってセレクタ26によってスワップタスクバッファ16又は17を命令レジスタ11Cに接続する。どちらを接続するかは選択可能であっても固定的であってもよい。例えばデータプロセッサのイニシャライズリセット時に設定される動作モードに応じて何れを選択するかを決定するようにできる。
データコンフリクトによる通常命令処理のパイプ1の空きを利用して例えばスワップタスク1の処理を行なう場合、パイプ1側にはそれ専用の命令レジスタ11C及び命令デコーダ12Cを備えるから、データコンフリクトによって実行が中断された命令実行の再開に際しては、データプロセッサ1Cのように命令フェッチからやり直す必要はない。即ちパイプラインは一切乱れない。その他の構成はデータプロセッサ1Cと同じであるのでその構成の詳細な説明は省略する。
第19図にはデータコンフリクトを生じたときデータプロセッサ1Dで行われるタスク切換え制御の内容が例示されている。例えばパイプラインステージmで夫々命令レジスタ11A,11Bにラッチされた命令のデコードステージ(m+1)で競合管理ユニット25がデータコンフリクトを検出すると、後から実行されるべき命令実行は、先に実行されるべき命令の実行結果が得られるまでNOP(ノン・オペレーション)とされる。すなわち、パイプラインステージ(m+4)におけるパイプ0のレジスタストア(Sn)の結果を当該ステージ(m+4)におけるパイプ1の演算ステージ(En)で利用できるようになるまで、パイプ1のパイプラインステージにおける通常命令処理の実行が停止される。第17図との相違点は、第19図のステージm+4のパイプ1における演算ステージ(En)のために改めて命令フェッチ及びデコードを繰り返すことを要しないということである。パイプ1のパイプラインステージにおける通常命令処理の実行停止の指示は、制御信号ARBBによって命令実行ユニット13Bに通知される。このとき、競合管理ユニット25は制御信号250を活性化して切換え制御回路19に与える。切換え制御回路19は、それに応答してセレクタ18にスワップタスクバッファ16を選択させる。これにより、パイプラインステージm+1〜m+5においてパイプ1は、スワップタスク1の処理を行うことができる。スワップタスク1の処理に許容される期間は、データコンフリクトによってパイプ1の通常命令処理が中断される期間であり、その期間は競合管理ユニット15で制御され、制御信号250に反映され、当該信号250がインアクティブにされることによって、セレクタ18の選択状態は元の通常命令処理の選択状態(命令フェッチユニット10の選択状態)に戻される。タスク切換え時には前述の通りプログラムカウンタPCやレジスタSR,R0〜R7の退避を要せずに、スワップタスク1の実行に移ることができる。このとき、命令実行ユニット13Bは、スワップタスク1の実行にはレジスタセットS1を利用する。どのレジスタを利用するかは前記の例と同様に夫々の命令記述によって決定される。
図19の例では、パイプラインステージm+3で夫々命令レジスタ11A,11Bにラッチされた命令のデコードステージ(m+4)においても競合管理ユニット25がデータコンフリクトを検出して、上記同様に、パイプラインステージ(m+7)におけるパイプ0のレジスタストア(Sn)の結果を当該ステージ(m+7)におけるパイプ1の演算ステージ(En)で利用できるようになるまで、パイプ1のパイプラインステージにおける通常命令処理の実行が停止され、それに代えて、パイプ1は、スワップタスク1の処理を行なってる。
第20図には前記データプロセッサ1を適用したデータ処理システムの一例が示される。スデータプロセッサ1の外部バス4には前記外部メモリ2及び入出力回路5が代表的に示されている。外部バス4はアドレスバスABUS,データバスDBUS及びコントロールバスCBUSを含む。このシステムにおいて、データプロセッサ1のスワップタスクバッファ16にはDMA転送制御及びデータ変換制御プログラムが格納されている。このDMA転送制御及びデータ変換制御プログラムの起動は前記制御信号23の一つに割り当てられた割り込み信号230とされる。この割り込み信号230は、入出力回路5から供給される。
第21図には前記DMA転送制御及びデータ変換制御プログラムによるタスクの一例が示される。すなわち、入出力回路5から割込み信号230が切換え制御回路19に与えられると、データプロセッサ1の処理プログラムは、スワップタスクバッファ16に格納されているDMA転送制御及びデータ変換制御プログラムに切換えられる。このプログラムによって処理されるタスクは、入出力回路5からデータを読み込み、読み込んだデータを命令実行ユニット13でデータ変換(例えば圧縮や座標変換)し、変換されたデータをメモリ2の所定領域に書込み制御する。読み出しアドレスと書込みアドレスは、データ転送及びデータ変換毎に、前記プログラムによって順次更新される。そのようなDMA転送制御及びデータ変換制御プログラムのプログラム記述の最小単位の例を第22図に示す。スワップタスクバッファを用いたタスク切換えには前述の通り、通常の割り込み処理のような退避処理を必要とせずパイプラインの乱れもないから、発生したイベントに対して高速に応答することができる。
また、データプロセッサ1に代表される上記実施例において、スワップタスクバッファ16、17にDMA転送制御プログラムを設定した場合、第23図に例示されるようなシステム構成に比べて、キャッシュコヒーレンシの問題を解決するいためのデータプロセッサ1の負担を軽減することができる。すなわち、第23図のシステム構成では、キャッシュメモリ15がライトバック方式を採用するとき、キャッシュメモリ15の書き換えが外部メモリに反映されていない状態でDMAコントローラ6がDMA転送を開始するとキャッシュコヒーレンシを保てなくなるので、データプロセッサ1Eはキャッシュコヒーレンシを保たないDMA転送動作の起動を常時監視し、それを検出したときは予じめライトバック動作を行なわせることが必要であり、データプロセッサ1Eは、キャッシュコヒーレンシを保たない動作を検出するための処理を負担しなければならない。これに対し、第1図のデータプロセッサ1を例にすると、データプロセッサ1の処理タスクがセレクタ18等を介してDMA転送制御処理に切換えられた状態において、DMAコントローラとしての機能は実行ユニット13が実現することになる。従って、データプロセッサ1の外部メモリ間、或いは外部メモリと外部の入出力回路間でDAMデータ転送を制御する場合、DMA転送制御のためのアドレス信号若しくはアクセス制御情報は必ずデータキャッシュメモリ15を通すことになる。これにより、キャッシュメモリ15がライトバック方式を採用する場合に、キャッシュメモリ15の書き換えが外部メモリに反映されていない状態でDMA転送が開始されても、そのような外部メモリに反映されていないデータはキャッシュメモリ15から命令実行ユニット13に読み込まれて、転送されることになるから、データプロセッサ1は、キャッシュコヒーレンシを保たない動作を検出するための処理を負担する必要がない。尚、データプロセッサ1で実現するDMA転送制御機能において、転送データは一旦データプロセッサ1に読み込まれることになる。
以上本発明者によってなされた発明を実施例に基づいて具体的に説明したが、本発明はそれに限定されるものではなく、その要旨を逸脱しない範囲において種々変更可能であることは言うまでもない。
例えば、スワップタスクバッファの数は上記実施例に限定されず適宜変更することができる。また、キャッシュメモリはデータキャッシュメモリと命令キャッシュメモリを分離した構成に限定されず、命令とデータに兼用されるユニファイド・キャッシュメモリであってもよい。また、パイプラインステージの段数は上記実施例の5段に限定されない。また、スーパスカラデータプロセッサにおける並列動作可能なパイプの数は2本に限定されず、それ以上であってもよい。更に、スワップタスクの内容は必要に応じてどのようなものでも適用でき、制限されない。
産業上の利用可能性
以上のように、本発明に係るデータプロセッサは、種々のデータ処理システム、特に頻繁にタスクの切換えが行われるシステム、データ処理能力の向上を必要とするシステムに広く適用することができ、例えば、ディジタルカメラにおける撮影データの転送とデータ圧縮とをスワップタスクとして備えた組み込み機器制御用のコンピュータシステムなどに適用することができる。Technical field
The present invention relates to a data processor, and further to multitasking or task switching technology in the data processor. For example, the present invention is effective when applied to a data processor that processes a plurality of tasks in a pipeline and a data processing system to which the data processor is applied. Technology.
Background art
There is pipeline processing as a technique for speeding up data processing by a data processor. Pipeline processing improves data processing throughput by dividing one large process into a plurality of processing elements and executing new processes one after another at the time required for each processing element, that is, the pipeline pitch. . For example, when control processing for executing one instruction is divided into instruction fetch, instruction decode, operation, memory access, and register store processes, each of the processes is set as one pipeline stage, and one pipe stage is set. Instruction fetch is performed at every line stage pitch (pipeline pitch), and one instruction is apparently executed at one pipeline pitch.
When switching tasks in the middle of such pipeline processing, processing to save values such as the program counter, status register, and data register to the stack area so that you can return to the currently executing task later Must be done.
However, since such a save process requires a certain amount of time, the pipeline is disturbed. In particular, when complicated processing is performed, task switching frequently occurs even when the program execution state is viewed locally. As a result, the throughput of data processing cannot be improved as expected even when the angle pipeline processing is adopted.
In JP-A-62-237531, when a plurality of programs are executed in a time-sharing manner, processing is complicated with interrupts. Therefore, two sets of a program ROM and a program counter are provided, and the ROM access timing in each set is shifted. A technique has been shown in which a selector output is alternately selected by a selector and an instruction is supplied to an instruction register so that a plurality of programs can be easily executed in a time-sharing manner.
This is a technology for simply switching programs based on a clock signal and executing them in complete time division. Apparently, multiple programs are apparently executed in parallel. It is not considered that the task is switched in response to the occurrence of this event inside or outside the data processor. A data processor that is generally used for device control or the like is required to consider at least that, and to reduce the disturbance of the pipeline at the time of task switching and to improve the throughput.
A superscalar architecture data processor can execute a plurality of instructions simultaneously by a plurality of pipelines. In such a data processor, it is necessary to manage a dependency relationship between instructions represented by a data conflict state in which a certain instruction uses an execution result of another instruction. When it becomes clear that a data conflict occurs in an instruction to be executed in parallel, a part of the plurality of pipelines stops the instruction execution and waits for the completion of the execution of the other instruction. Considering the use of a pipeline vacated by data conflict in this way for the execution of another task, it is still necessary to shorten the processing time associated with task switching and minimize pipeline disruption. Revealed by the inventor.
In addition, the data processor can be equipped with a cache memory in order to speed up operand access. When the cache line of the cache memory is rewritten, the contents of the corresponding memory must be rewritten. For example, if only the data processor occupies the main memory, the rewritten content may be reflected in the main memory only when the cache line is replaced. Such an operation is called a write back.
However, there is a risk that a DMA (Direct Memory Access) controller connected to the outside of the data processor reads erroneous data from which the cache memory rewrite is not reflected in the main memory and transfers the data. This concern is called a cache coherency problem. To solve this problem, even if a cache hit occurs during a memory write operation, a write-through method that performs a memory write operation each time is adopted for the cache memory, and The cache memory can be configured to be non-blocking using a buffer. However, if memory write operations occur frequently due to cache coherency, the data processor uses up the data transfer capability of the bus connecting the DMA controller and main memory for cache coherency, and high-speed data transfer is performed by the DMA controller. This causes a problem that the data transfer speed is limited.
Therefore, in order to maintain the cache coherency by the write-back method without adopting the write-through, it is possible to adopt a technique of detecting an operation that does not maintain the cache coherency and writing back at that time. For example, when the DMA controller detects an operation (bus snoop) for reading and accessing data stored in the cache memory, the data processor interrupts the operation for writing back the data, and then enables DMA transfer. To do. However, the data processor increases the burden for detecting an operation that does not maintain cache coherency.
An object of the present invention is to provide a data processor that can reduce processing accompanying task switching and can improve data processing capability.
Another object of the present invention is to provide a data processor capable of minimizing pipeline disturbance during task switching.
Still another object of the present invention is to enable a data processor of a superscalar architecture to effectively use a pipeline freed by data conflict by switching to execution of another task.
Another object of the present invention is to provide a data processor capable of minimizing the burden for maintaining cache coherency during DMA transfer when a write-back cache memory is incorporated.
The above and other objects and novel features of the present invention will become apparent from the following description of the present specification.
Disclosure of the invention
In the present invention, as illustrated in FIG. 1, the instruction fetch unit (10) fetches an instruction, and the instruction latch (12) decodes the instruction latched in the instruction register (11). The data processor (1) on which the instruction execution unit (13) executes instructions based on the program storage area (160, 170) and pointers (161, 171) for sequentially reading instructions stored in the area. Each of the plurality of task buffers (16, 17) provided therein, the register means (S1, S2) dedicated to each of the task buffers and disposed in the instruction execution unit, and the plurality of task buffers And a selector (18) for selectively connecting one of the instruction fetch unit and the instruction fetch unit to the instruction register in the initial state. A switching control means (19) for selecting a fetch unit and selecting and controlling the selector according to an event generated internally or externally, and all or a part of the plurality of task buffers based on the control of the instruction execution unit Interface means (21, BUS) for interfacing with the outside so that data can be written.
Since each task buffer has its own pointer and each instruction execution unit has its own register means assigned to each task buffer, the task to be executed is a normal instruction process according to the program of the instruction fetch unit. When switching between swap task processing according to the task buffer program, the execution status of the interrupted normal instruction processing (for example, the value of the program counter or general-purpose register) is saved in or restored from the external memory. Does not require processing to access the stack area. Thereby, speeding up of task switching and reduction of processing accompanying task switching are achieved, which contributes to improvement of data processing capability of the data processor.
When the instruction register, the instruction decoder, and the instruction execution unit advance the processing in units of pipeline stages and perform the pipeline processing of the instructions, the above can minimize the disturbance of the pipeline.
The instruction execution unit outputs an instruction signal (LIR) for latching an instruction in the instruction register, and the selector supplies the instruction signal to an instruction fetch unit or a task buffer selected by the switching control unit, and an instruction fetch The unit can update the instruction to be supplied to the instruction register based on the instruction signal, and the task buffer can update the pointer based on the instruction signal. This control facilitates pointer control of the task buffer.
As a technique for returning from the swap task processing to the normal instruction processing, the switching control means sets the selector to the instruction fetch unit based on the result of decoding the instruction supplied from the task buffer selected by the switching control means to the instruction decoder. You can return to the selected state. In other words, upon completion of the selected swap task process, the normal command process is resumed.
When considering that the swap task processing is completed with the highest priority, as illustrated in FIG. 1, the switching control means is adapted to receive an interrupt signal input to the instruction execution unit in response to the selection of the task buffer. An interrupt disable signal (INH) for invalidating the signal may be output. As a result, no interrupt request is accepted during the swap task processing.
When accepting interrupts, the switching control means (19) executes the instruction when the task buffer (16, 17) is selected as in the data processor (1A) illustrated in FIG. The selector (18) may be returned to the instruction fetch unit selection state by the control signal ICNT corresponding to the acceptance of the interrupt by the unit (13), and the task buffer selection state immediately before that may be saved.
The data processor (1) may include a data cache memory (15) between the instruction execution unit and the outside. As illustrated in FIG. 20, this data processor is connected to a plurality of peripheral circuits (2, 5) such as a memory via a bus (4) to constitute a data processing system. At this time, when a DMA transfer control program or a DMA transfer and data conversion control program is set in the task buffer, the burden on the data processor for solving the cache coherency problem can be reduced. That is, in the state where the processing task of the data processor is switched to the DMA transfer control process via the selector or the like, the function as the DMA controller is realized by the execution unit. Therefore, when DMA data transfer is controlled between the external memory of the data processor or between the external memory and the external input / output circuit, the address signal or access control information for DMA transfer control always passes through the data cache memory. . In other words, when the cache memory adopts the write-back method, even if the DMA transfer is started in a state where the rewrite of the data cache memory is not reflected in the external memory, the data not reflected in such external memory Are read from the data cache memory into the instruction execution unit and transferred. As a result, the data processor detects a DMA transfer operation that does not maintain cache coherency, and does not require a write-back operation in advance when detected, and detects a DMA transfer operation that does not maintain cache coherency. This reduces the processing burden on the data processor. Of course, in the DMA transfer control function realized by the data processor, the transfer data is once read into the data processor.
The task switching means can also be applied to the superscalar type data processors (1B, 1C) illustrated in FIGS. That is, the instruction latched in the instruction register (11A, 11B) is decoded by the instruction decoder (12A, 12B) and the instruction execution unit (13A, 13B) includes a plurality of instruction execution control sequences for executing the instruction. A data processor (1B, 1C) that includes an instruction fetch unit (10) that fetches a plurality of instructions in parallel with the plurality of instruction execution control sequences, and sequentially stores instructions stored in the program storage area A plurality of task buffers (16, 17) each having a pointer for reading, and register means (S1, S2) dedicated to each task buffer and arranged in a specific instruction execution unit And the specific instruction execution unit by selecting one of the plurality of task buffers and the instruction fetch unit. A selector (18) connected to the corresponding instruction register, and a switching control means (19) for causing the selector to select the instruction fetch unit in an initial state and for selecting and controlling the selector according to an event generated internally or externally And have. In this data processor as well, normal instruction processing and swap task processing can be switched using one instruction execution control system, so that the task switching speed can be increased and the burden on the data processor accompanying task switching can be reduced as described above. In addition, pipeline disturbance can be minimized. Therefore, the high data processing capability originally intended by the superscalar architecture can be guaranteed.
In a superscalar data processor capable of executing a plurality of instructions in parallel, when arbitration between instructions such as data conflict is arbitrated by hardware, it is based on an instruction decoding result from an instruction decoder included in each instruction execution control sequence. Then, a conflict management unit (25) that checks the dependency relationship between instructions as to whether or not instructions can be executed in parallel by mutually different instruction execution control sequences and delays the execution of instructions depending on the execution result of other instructions. Will be provided.
At this time, as shown in FIG. 16, when the contention management unit delays execution of a specific instruction due to data conflict or the like, the switching control means responds to the
The contention state such as the data conflict is determined by the contention management unit (25) based on the instruction decode result. At this time, the instruction whose processing is to be delayed has already been decoded. Thereafter, the process is switched to the swap task process. However, when the normal instruction process in which the process is interrupted and the swap task process in which the process is started instead use the same instruction register and instruction decoder, As illustrated in the figure, the same instruction as the instruction fetch (In) of the pipeline stage m in the
In order to prevent the pipeline from being disturbed at all in the switching from the normal instruction processing to the swap task processing document due to the data conflict described above, the data processor (1D), as illustrated in FIG. An instruction register (11C) dedicated to swap task processing and an instruction decoder (12C) may be added to the instruction execution control system. That is, the instruction execution unit (13A, 13B) decodes the instruction latched in the instruction register (11A, 11B) by the instruction decoder (12A, 12B) and the instruction execution unit (13A, 13B) executes the instruction. It is assumed that an instruction fetch unit (10) for fetching is included, and a plurality of instructions can be executed in parallel by the plurality of instruction execution control sequences. The data processor (1D) includes a plurality of task buffers (16, 17) each having a program storage area and pointers for sequentially reading instructions stored in the area; A specific task instruction register (11C) dedicated to the task buffer, a specific task instruction decoder (12C) for decoding the instruction latched in the specific task instruction register, and dedicated to each task buffer And selecting one of the register means (S1, S2) arranged in a specific instruction execution unit, the plurality of task buffers and the instruction fetch unit, and corresponding to the specific instruction execution unit. A first selector (18) connected to the instruction register, and one for the specific task by selecting one of the plurality of task buffers A second selector (26) connected to the instruction register, an output of the instruction decoder corresponding to the specific instruction execution unit, and an output of the specific task instruction decoder are selectively connected to the specific instruction execution unit. Based on the third selector (27) and the result of instruction decoding from the instruction decoder included in each of the instruction execution control sequences, whether or not instructions can be executed in parallel by different instruction execution control sequences. A contention that checks the dependency between each other, delays the execution of a specific instruction depending on the execution result of another instruction, and causes the third selector to select the instruction decoder for the specific task when delaying the execution of the specific instruction The management unit (25), in the initial state, causes the instruction selector to be selected by the first selector and deselects the second selector. The state is controlled, the first selector is selected and controlled according to an event generated internally or externally, and the second selector is internally controlled in response to selection of the instruction decoder for the specific task by the third selector. Or switching control means (19) for selecting a task buffer according to an externally generated event.
[Brief description of the drawings]
FIG. 1 is a block diagram of a data processor according to a first embodiment of the present invention,
FIG. 2 is an example block diagram of an instruction fetch unit;
FIG. 3 is a block diagram showing a first example of a swap task buffer;
FIG. 4 is a block diagram showing a second example of the swap task buffer.
FIG. 5 is a block diagram showing a third example of the swap task buffer;
FIG. 6 is a block diagram showing a fourth example of the swap task buffer.
FIG. 7 is a diagram illustrating an example of a register set included in the instruction execution unit.
FIG. 8 is an explanatory diagram showing an example of task switching operation in the data processor according to the first embodiment;
FIG. 9 is an explanatory diagram showing an example of switching operation between normal instruction processing and interrupt processing,
FIG. 10 is an example timing chart showing the relationship between task switching and pipeline in the data processor according to the first embodiment;
FIG. 11 is an example operation timing chart of the data processor according to the first embodiment that does not accept an interrupt during the swap task;
FIG. 12 is a block diagram of a data processor according to the second embodiment of the present invention,
FIG. 13 is an example operation timing chart of the data processor according to the second embodiment for accepting an interrupt during the swap task;
FIG. 14 is a block diagram of a data processor according to a third embodiment of the present invention,
FIG. 15 is an example timing chart showing the contents of control and task switching control when a data conflict occurs in the data processor according to the third embodiment;
FIG. 16 is a block diagram of a data processor according to the fourth embodiment of the present invention,
FIG. 17 is a timing chart showing the contents of task switching control when a data conflict occurs in the data processor according to the fourth embodiment;
FIG. 18 is a block diagram of a data processor according to a fifth embodiment of the present invention,
FIG. 19 is a timing chart showing task switching control performed by the data processor according to the fifth embodiment when a data conflict occurs;
FIG. 20 is a block diagram showing an example of a data processing system to which the data processor of the present invention is applied.
FIG. 21 is an explanatory diagram showing an example of tasks by the DMA transfer control and data conversion control program;
FIG. 22 is an explanatory diagram showing an example of a minimum unit of program description of the DMA transfer control and data conversion control program;
FIG. 23 is a block diagram showing an example of a data processing system including a cache memory employing a write-back method and a DMA controller arranged outside the data processor.
BEST MODE FOR CARRYING OUT THE INVENTION
FIG. 1 shows a block diagram of a data processor according to a first embodiment of the present invention. The
In FIG. 1, 10 is an instruction fetch unit, 11 is an instruction register, 12 is an instruction decoder, 13 is an instruction execution unit, 14 is an instruction cache memory, 15 is a data cache memory, and 16 and 17 are representatively shown swap tasks. A buffer, 18 is a selector, 19 is a switching control circuit, and 20 is a circuit block generically referring to a built-in peripheral module.
The
In the
The
The program counter PC holds an instruction address to be executed next. Although not particularly limited, the instruction fetch
The
Although not particularly limited, the instruction fetch
Each of the swap task buffers 16 and 17 has
An example of the swap task buffers 16 and 17 is shown in FIGS. In the example of FIG. 3, a shift register and a selector are used as the storage area 160 (170), and a shift register in which a plurality of parallel input / output type latches LAT are cascaded and the parallel outputs of the respective latches LAT are used. A selector SEL that selects one bit at a time and outputs it in parallel, and a pointer 160 (170) that causes the selector SEL to select the output of each latch LAT in order from the upper side or the lower side via the selector SEL. . For example, if n stages of m-bit latches LAT are provided, instructions can be sequentially output m times in units of n bits. Data writing to the shift register is performed under the control of the
The swap task buffers 16 and 17 store a program composed of an instruction sequence for realizing a single process. If a single unit of processing realized by a specific instruction sequence is defined as a task, a processing program related to the specific task is stored. For example, a processing program for DMA transfer and a processing program for data compression / decompression are set. The loading of the processing program to the swap task buffers 16 and 17 is not particularly limited, but can be performed via the
The
Although not particularly limited, the
The end of execution of the program stored in the swap task buffers 16 and 17 is recognized by the switching
FIG. 7 shows a register configuration example of the
Although not particularly limited, which register of the registers SR, R0 to R7, the register set S1, or the register set S2 of the general-purpose register GR is determined by the register number and the type of the task. It is specified. When an instruction output from the instruction fetch
As described above, the swap task buffers 16 and 17 have their
FIG. 8 shows an example of task switching operation. When execution of a program (swap task 1) stored in the
FIG. 10 shows an example of the pipeline state at the time of switching between the normal instruction processing and the
For example, when execution of the
In FIG. 1, the interrupt
FIG. 11 shows an operation example when no interrupt is accepted during the swap task as described above. If there is an interrupt request in the middle of normal processing, the return address is saved and then branched to interrupt processing. When the interrupt processing is completed, the return processing is performed and then the normal processing is returned. If there is a request to execute the
FIG. 12 shows a second embodiment of the data processor according to the present invention. The
In the
When an interrupt is accepted during the execution of the swap task, the branch from the normal instruction processing to the swap task is performed before that. Therefore, after completing the interrupt processing, it is necessary to be able to return to the normal processing that is currently suspended. For this reason, after switching the
FIG. 13 shows an example of operation when accepting an interrupt during a swap task. If there is an interrupt request in the middle of normal instruction processing, the return address and the like are saved and then branched to interrupt processing. When the interrupt processing ends, the return processing is performed and then the normal instruction processing is returned. When there is a request to execute the
FIG. 14 shows a third embodiment of the data processor according to the present invention. The data processor 1B shown in the figure has a superscalar architecture, and can execute a plurality of instructions in parallel by two pipelines. That is, the
The
The interrupt
In the data processor 1B of the superscalar architecture, the
FIG. 15 illustrates the contents of control and task switching control when a data conflict occurs in the data processor 1B.
For example, when the
When execution of the
FIG. 16 shows a fourth embodiment of the data processor according to the present invention. The
FIG. 17 illustrates the contents of task switching control when a data conflict occurs. For example, when the
In the example of FIG. 17, the
FIG. 18 shows a fifth embodiment of the data processor according to the present invention. The data processor 1D shown in the figure has a superscalar architecture similar to the data processor 1B, and can execute a plurality of instructions in parallel by two pipelines. As with the
The
For example, when processing of the
FIG. 19 illustrates the contents of task switching control performed by the data processor 1D when a data conflict occurs. For example, when the
In the example of FIG. 19, the
FIG. 20 shows an example of a data processing system to which the
FIG. 21 shows an example of tasks by the DMA transfer control and data conversion control program. That is, when the interrupt
Further, in the above-described embodiment represented by the
Although the invention made by the present inventor has been specifically described based on the embodiments, it is needless to say that the present invention is not limited thereto and can be variously modified without departing from the gist thereof.
For example, the number of swap task buffers is not limited to the above embodiment, and can be changed as appropriate. Further, the cache memory is not limited to a configuration in which the data cache memory and the instruction cache memory are separated, and may be a unified cache memory that is used for both instructions and data. Further, the number of pipeline stages is not limited to five in the above embodiment. Further, the number of pipes that can be operated in parallel in the superscalar data processor is not limited to two, and may be more than that. Further, the contents of the swap task can be applied as needed, and are not limited.
Industrial applicability
As described above, the data processor according to the present invention can be widely applied to various data processing systems, in particular, systems in which tasks are frequently switched, and systems that require improvement in data processing capability. The present invention can be applied to a computer system for controlling an embedded device provided with a transfer task and data compression in a digital camera as a swap task.
Claims (3)
プログラムの格納領域とその領域に格納された命令を順次読出すためのポインタとを夫々が備えた複数個のタスクバッファと、
前記夫々のタスクバッファ毎に専用化され、特定の前記命令実行ユニットに配置されたレジスタ手段と、
前記複数個のタスクバッファと命令フェッチユニットとの中から一つを選択して前記特定の命令実行ユニットに対応される命令レジスタに接続するセレクタと、
初期状態において前記セレクタに前記命令フェッチユニットを選択させると共に、内部又は外部で発生されるイベントに従って前記セレクタを選択制御する切換え制御手段と、を設け、
前記夫々の命令実行制御系列に含まれる命令レジスタ、命令デコーダ及び命令実行ユニットは、パイプラインステージ単位で処理を進めて命令をパイプライン処理するものであり、
前記夫々の命令実行制御系列に含まれる命令デコーダからの命令解読結果に基づいて、相互に異なる命令実行制御系列による命令の並列実行が可能か否かについてそれら命令相互間の依存関係を調べ、他の命令の実行結果に依存する命令の実行を遅らせる競合管理ユニットを更に有し、
前記切換え制御手段は、前記競合管理ユニットが特定の命令の実行を遅らせるとき、前記選択手段にタスクバッファを選択させるものであることを特徴とするデータプロセッサ。 An instruction decoder decodes an instruction latched in an instruction register and an instruction execution unit includes a plurality of instruction execution control sequences for executing the instruction, and includes an instruction fetch unit for fetching an instruction, and a plurality of instructions are included in the plurality of instructions. In a data processor that can be executed in parallel in an execution control sequence,
A plurality of tasks buffer the storage area of the program and the pointer for out sequentially read the instructions stored in that region each comprising,
Register means dedicated to each of the respective task buffers and arranged in a specific instruction execution unit;
A selector that selects one of the plurality of task buffers and an instruction fetch unit and connects to an instruction register corresponding to the specific instruction execution unit;
Switching control means for selecting and controlling the selector according to an event generated internally or externally, and causing the selector to select the instruction fetch unit in an initial state ;
The instruction register, instruction decoder, and instruction execution unit included in each of the instruction execution control series are for processing the pipeline in units of pipeline stages,
Based on the result of instruction decoding from the instruction decoder included in each of the instruction execution control sequences, whether or not instructions can be executed in parallel by mutually different instruction execution control sequences is examined, A contention management unit for delaying execution of instructions depending on the execution result of
The data processor characterized in that the switching control means causes the selection means to select a task buffer when the contention management unit delays execution of a specific instruction.
プログラムの格納領域とその領域に格納された命令を順次読出すためのポインタとを夫々が備えた複数個のタスクバッファと、
前記複数個のタスクバッファに専用化された特定タスク用命令レジスタと、
前記特定タスク用命令レジスタにラッチされた命令を解読する特定タスク用命令デコーダと、
前記夫々のタスクバッファ毎に専用化され、特定の命令実行ユニットに配置されたレジスタ手段と、
前記複数個のタスクバッファと命令フェッチユニットとの中から一つを選択的して前記特定の命令実行ユニットに対応される命令レジスタに接続する第1のセレクタと、
前記複数個のタスクバッファの中から一つを選択して前記特定タスク用命令レジスタに接続する第2のセレクタと、
前記特定の命令実行ユニットに対応される命令デコーダの出力と前記特定タスク用命令デコーダの出力を選択的に前記特定の命令実行ユニットに接続する第3のセレクタと、
前記夫々の命令実行制御系列に含まれる命令デコーダからの命令解読結果に基づいて、相互に異なる命令実行制御系列による命令の並列実行が可能か否かについてそれら命令相互間の依存関係を調べ、他の命令の実行結果に依存する特定の命令の実行を遅らせ、当該特定の命令の実行を遅らせるとき前記第3のセレクタに前記特定タスク用命令デコーダを選択させる競合管理ユニットと、
初期状態において前記命令フェッチユニットを前記第1のセレクタに選択させると共に第2のセレクタを非選択状態に制御し、内部又は外部で発生されるイベントに従って前記第1のセレクタを選択制御し、また、前記第3のセレクタによる前記特定タスク用命令デコーダの選択に呼応して第2のセレクタに内部又は外部で発生されるイベントに応じたタスクバッファを選択させる切換え制御手段と、を設けて成るものであることを特徴とするデータプロセッサ。An instruction decoder decodes an instruction latched in the instruction register and an instruction execution unit executes a plurality of instruction execution control sequences, and includes an instruction fetch unit that fetches instructions, and executes a plurality of instructions. In a data processor that can be executed in parallel in a control sequence,
A plurality of tasks buffer the storage area of the program and the pointer for out sequentially read the instructions stored in that region each comprising,
A specific task instruction register dedicated to the plurality of task buffers;
A specific task instruction decoder for decoding an instruction latched in the specific task instruction register;
Register means dedicated to each task buffer and arranged in a specific instruction execution unit;
A first selector that selectively connects one of the plurality of task buffers and an instruction fetch unit to an instruction register corresponding to the specific instruction execution unit;
A second selector for selecting one of the plurality of task buffers and connecting to the specific task instruction register;
A third selector for selectively connecting the output of the instruction decoder corresponding to the specific instruction execution unit and the output of the instruction decoder for the specific task to the specific instruction execution unit;
Based on the result of instruction decoding from the instruction decoder included in each of the instruction execution control sequences, whether or not instructions can be executed in parallel by mutually different instruction execution control sequences is examined, A contention management unit that delays the execution of a specific instruction depending on the execution result of the instruction, and causes the third selector to select the instruction decoder for the specific task when delaying the execution of the specific instruction;
In the initial state, the instruction selector is selected by the first selector and the second selector is controlled to a non-selected state, and the first selector is selected and controlled according to an event generated internally or externally. Switching control means for causing the second selector to select a task buffer corresponding to an event generated internally or externally in response to the selection of the instruction decoder for the specific task by the third selector. A data processor characterized by being.
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/JP1996/002819 WO1998013759A1 (en) | 1996-09-27 | 1996-09-27 | Data processor and data processing system |
Publications (1)
Publication Number | Publication Date |
---|---|
JP3778573B2 true JP3778573B2 (en) | 2006-05-24 |
Family
ID=14153908
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP51547898A Expired - Fee Related JP3778573B2 (en) | 1996-09-27 | 1996-09-27 | Data processor and data processing system |
Country Status (3)
Country | Link |
---|---|
JP (1) | JP3778573B2 (en) |
TW (1) | TW332272B (en) |
WO (1) | WO1998013759A1 (en) |
Families Citing this family (44)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6463553B1 (en) | 1999-10-01 | 2002-10-08 | Stmicroelectronics, Ltd. | Microcomputer debug architecture and method |
US6779145B1 (en) | 1999-10-01 | 2004-08-17 | Stmicroelectronics Limited | System and method for communicating with an integrated circuit |
US6408381B1 (en) | 1999-10-01 | 2002-06-18 | Hitachi, Ltd. | Mechanism for fast access to control space in a pipeline processor |
US6434665B1 (en) | 1999-10-01 | 2002-08-13 | Stmicroelectronics, Inc. | Cache memory store buffer |
US6449712B1 (en) | 1999-10-01 | 2002-09-10 | Hitachi, Ltd. | Emulating execution of smaller fixed-length branch/delay slot instructions with a sequence of larger fixed-length instructions |
US6496905B1 (en) | 1999-10-01 | 2002-12-17 | Hitachi, Ltd. | Write buffer with burst capability |
US6502210B1 (en) | 1999-10-01 | 2002-12-31 | Stmicroelectronics, Ltd. | Microcomputer debug architecture and method |
US6928073B2 (en) | 1999-10-01 | 2005-08-09 | Stmicroelectronics Ltd. | Integrated circuit implementing packet transmission |
US6530047B1 (en) | 1999-10-01 | 2003-03-04 | Stmicroelectronics Limited | System and method for communicating with an integrated circuit |
US6349371B1 (en) | 1999-10-01 | 2002-02-19 | Stmicroelectronics Ltd. | Circuit for storing information |
US6351803B2 (en) | 1999-10-01 | 2002-02-26 | Hitachi Ltd. | Mechanism for power efficient processing in a pipeline processor |
US6412047B2 (en) | 1999-10-01 | 2002-06-25 | Stmicroelectronics, Inc. | Coherency protocol |
US6298394B1 (en) | 1999-10-01 | 2001-10-02 | Stmicroelectronics, Ltd. | System and method for capturing information on an interconnect in an integrated circuit |
US6598177B1 (en) * | 1999-10-01 | 2003-07-22 | Stmicroelectronics Ltd. | Monitoring error conditions in an integrated circuit |
US6693914B1 (en) | 1999-10-01 | 2004-02-17 | Stmicroelectronics, Inc. | Arbitration mechanism for packet transmission |
US6684348B1 (en) | 1999-10-01 | 2004-01-27 | Hitachi, Ltd. | Circuit for processing trace information |
US6918065B1 (en) | 1999-10-01 | 2005-07-12 | Hitachi, Ltd. | Method for compressing and decompressing trace information |
US6546480B1 (en) | 1999-10-01 | 2003-04-08 | Hitachi, Ltd. | Instructions for arithmetic operations on vectored data |
US6820195B1 (en) | 1999-10-01 | 2004-11-16 | Hitachi, Ltd. | Aligning load/store data with big/little endian determined rotation distance control |
US6567932B2 (en) | 1999-10-01 | 2003-05-20 | Stmicroelectronics Limited | System and method for communicating with an integrated circuit |
US6457118B1 (en) | 1999-10-01 | 2002-09-24 | Hitachi Ltd | Method and system for selecting and using source operands in computer system instructions |
US6557119B1 (en) | 1999-10-01 | 2003-04-29 | Stmicroelectronics Limited | Microcomputer debug architecture and method |
US7260745B1 (en) | 1999-10-01 | 2007-08-21 | Stmicroelectronics Ltd. | Detection of information on an interconnect |
US6615370B1 (en) | 1999-10-01 | 2003-09-02 | Hitachi, Ltd. | Circuit for storing trace information |
US6574651B1 (en) | 1999-10-01 | 2003-06-03 | Hitachi, Ltd. | Method and apparatus for arithmetic operation on vectored data |
US6826191B1 (en) | 1999-10-01 | 2004-11-30 | Stmicroelectronics Ltd. | Packets containing transaction attributes |
US6859891B2 (en) | 1999-10-01 | 2005-02-22 | Stmicroelectronics Limited | Apparatus and method for shadowing processor information |
US6590907B1 (en) | 1999-10-01 | 2003-07-08 | Stmicroelectronics Ltd. | Integrated circuit with additional ports |
US6460174B1 (en) | 1999-10-01 | 2002-10-01 | Stmicroelectronics, Ltd. | Methods and models for use in designing an integrated circuit |
US6601189B1 (en) | 1999-10-01 | 2003-07-29 | Stmicroelectronics Limited | System and method for communicating with an integrated circuit |
US6591369B1 (en) | 1999-10-01 | 2003-07-08 | Stmicroelectronics, Ltd. | System and method for communicating with an integrated circuit |
US6629115B1 (en) | 1999-10-01 | 2003-09-30 | Hitachi, Ltd. | Method and apparatus for manipulating vectored data |
US6701405B1 (en) | 1999-10-01 | 2004-03-02 | Hitachi, Ltd. | DMA handshake protocol |
US7072817B1 (en) | 1999-10-01 | 2006-07-04 | Stmicroelectronics Ltd. | Method of designing an initiator in an integrated circuit |
US7266728B1 (en) | 1999-10-01 | 2007-09-04 | Stmicroelectronics Ltd. | Circuit for monitoring information on an interconnect |
US6542983B1 (en) | 1999-10-01 | 2003-04-01 | Hitachi, Ltd. | Microcomputer/floating point processor interface and method |
US6665816B1 (en) | 1999-10-01 | 2003-12-16 | Stmicroelectronics Limited | Data shift register |
US6633971B2 (en) | 1999-10-01 | 2003-10-14 | Hitachi, Ltd. | Mechanism for forward data in a processor pipeline using a single pipefile connected to the pipeline |
US6487683B1 (en) | 1999-10-01 | 2002-11-26 | Stmicroelectronics Limited | Microcomputer debug architecture and method |
US7000078B1 (en) | 1999-10-01 | 2006-02-14 | Stmicroelectronics Ltd. | System and method for maintaining cache coherency in a shared memory system |
US7191313B2 (en) | 2001-08-28 | 2007-03-13 | Sony Corporation | Microprocessor |
JPWO2004023291A1 (en) * | 2002-08-30 | 2005-12-22 | 株式会社ルネサステクノロジ | Information processing equipment |
CN102135867B (en) * | 2010-01-21 | 2014-04-02 | 联阳半导体股份有限公司 | Data processing module and method thereof |
US9552206B2 (en) * | 2010-11-18 | 2017-01-24 | Texas Instruments Incorporated | Integrated circuit with control node circuitry and processing circuitry |
Family Cites Families (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US3728692A (en) * | 1971-08-31 | 1973-04-17 | Ibm | Instruction selection in a two-program counter instruction unit |
JPS60263238A (en) * | 1984-06-11 | 1985-12-26 | Nippon Telegr & Teleph Corp <Ntt> | Information processor |
JPS6314241A (en) * | 1986-07-04 | 1988-01-21 | Hitachi Ltd | Memory expansion system |
JPH02115958A (en) * | 1988-10-26 | 1990-04-27 | Hitachi Ltd | Data transfer control system |
JPH02183342A (en) * | 1989-01-10 | 1990-07-17 | Fuji Electric Co Ltd | Interruption controller |
JPH02190936A (en) * | 1989-01-20 | 1990-07-26 | Nec Corp | Program execution system for bank switching type computer |
JPH0443434A (en) * | 1990-06-08 | 1992-02-13 | Mitsubishi Electric Corp | Microprocessor |
JPH0644089A (en) * | 1992-05-18 | 1994-02-18 | Matsushita Electric Ind Co Ltd | Information processor |
JP2689914B2 (en) * | 1994-08-16 | 1997-12-10 | 日本電気株式会社 | Information processing device |
JPH0895786A (en) * | 1994-09-27 | 1996-04-12 | Toshiba Corp | Arithmetic processor |
-
1996
- 1996-09-27 JP JP51547898A patent/JP3778573B2/en not_active Expired - Fee Related
- 1996-09-27 WO PCT/JP1996/002819 patent/WO1998013759A1/en active Application Filing
- 1996-11-20 TW TW085114272A patent/TW332272B/en active
Also Published As
Publication number | Publication date |
---|---|
WO1998013759A1 (en) | 1998-04-02 |
TW332272B (en) | 1998-05-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP3778573B2 (en) | Data processor and data processing system | |
US6141734A (en) | Method and apparatus for optimizing the performance of LDxL and STxC interlock instructions in the context of a write invalidate protocol | |
US4926323A (en) | Streamlined instruction processor | |
US5293500A (en) | Parallel processing method and apparatus | |
US9367472B2 (en) | Observation of data in persistent memory | |
KR970008187B1 (en) | Processor controlled interface with instruction streaming | |
US5202972A (en) | Store buffer apparatus in a multiprocessor system | |
JP2701179B2 (en) | Data processing system | |
US4755935A (en) | Prefetch memory system having next-instruction buffer which stores target tracks of jumps prior to CPU access of instruction | |
KR100286962B1 (en) | Cache controller | |
US5333297A (en) | Multiprocessor system having multiple classes of instructions for purposes of mutual interruptibility | |
US6907517B2 (en) | Interprocessor register succession method and device therefor | |
JP3531167B2 (en) | System and method for assigning tags to instructions to control instruction execution | |
EP0848331A1 (en) | Multi-ported and interleaved cache memory | |
US6963962B2 (en) | Memory system for supporting multiple parallel accesses at very high frequencies | |
US7836253B2 (en) | Cache memory having pipeline structure and method for controlling the same | |
JPH10283203A (en) | Method and device for reducing thread changeover waiting time in multi-thread processor | |
CA2016532C (en) | Serializing system between vector instruction and scalar instruction in data processing system | |
JPH02166539A (en) | Cash line withdrawal | |
JP2007133456A (en) | Semiconductor device | |
WO2002088970A1 (en) | Crossbar multipath resource controller system and method | |
US6675287B1 (en) | Method and apparatus for store forwarding using a response buffer data path in a write-allocate-configurable microprocessor | |
EP0374598B1 (en) | Control store addressing from multiple sources | |
EP0797803A1 (en) | Chunk chaining for a vector processor | |
JPH08249175A (en) | Method and apparatus for selective support of nonarchitectural instruction at inside of superscalar processor device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20051025 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20051226 |
|
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: 20060214 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20060228 |
|
R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20090310 Year of fee payment: 3 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100310 Year of fee payment: 4 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110310 Year of fee payment: 5 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110310 Year of fee payment: 5 |
|
S111 | Request for change of ownership or part of ownership |
Free format text: JAPANESE INTERMEDIATE CODE: R313111 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110310 Year of fee payment: 5 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110310 Year of fee payment: 5 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120310 Year of fee payment: 6 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130310 Year of fee payment: 7 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130310 Year of fee payment: 7 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20140310 Year of fee payment: 8 |
|
LAPS | Cancellation because of no payment of annual fees |