JP3595309B2 - Address generation circuit - Google Patents

Address generation circuit Download PDF

Info

Publication number
JP3595309B2
JP3595309B2 JP2002034482A JP2002034482A JP3595309B2 JP 3595309 B2 JP3595309 B2 JP 3595309B2 JP 2002034482 A JP2002034482 A JP 2002034482A JP 2002034482 A JP2002034482 A JP 2002034482A JP 3595309 B2 JP3595309 B2 JP 3595309B2
Authority
JP
Japan
Prior art keywords
circuit
address
signal
output
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP2002034482A
Other languages
Japanese (ja)
Other versions
JP2002236609A (en
Inventor
裕次 小澤
茂志 安孫子
ブトー フレデリック
Original Assignee
日本テキサス・インスツルメンツ株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 日本テキサス・インスツルメンツ株式会社 filed Critical 日本テキサス・インスツルメンツ株式会社
Priority to JP2002034482A priority Critical patent/JP3595309B2/en
Publication of JP2002236609A publication Critical patent/JP2002236609A/en
Application granted granted Critical
Publication of JP3595309B2 publication Critical patent/JP3595309B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Landscapes

  • Executing Machine-Instructions (AREA)

Description

【0001】
【産業上の利用分野】
本発明はメモリ上の所定の記憶領域に対するアドレスを発生するアドレス生成回路に関する。
特に本発明は、ブロックリピートアドレッシング用アドレス回路に関する。
【0002】
【従来の技術】
ディジタルシグナルプロセッサ(DSP)等により、例えばサンプリングした信号についての相関の計算、あるいは、フィルタリング演算を行う場合、所定の記憶領域に記憶されたデータを何度もアクセスする必要が生じることがある。このようなデータが記憶されている記憶領域は、例えばサーキュラブロック(円環ブロック)と呼ばれる。
サーキュラブロックの領域は、サーキュラブロックの先頭の(最も数値の小さい)アドレス(トップアドレス)と、サーキュラブロックの容量を示す数値(ブロックサイズ)で表される。ブロックサイズから1減じた数値にトップアドレスを加算すると、サーキュラブロックの末尾の(最も数値の大きい)アドレス(ボトムアドレス)が得られる。
サーキュラブロックに対するアクセスはステップ値毎に行われ、現在のアドレスに正または負の値をとるステップ値を加算した値が次にアクセスされるアドレスとなる。すなわち、次のアクセスの対象となるアドレス(ポインタ)は、現在のアドレスにステップ値を加算することにより得られる。
【0003】
以下に、サーキュラブロックに対するアクセスであるサーキュラアドレッシングにおける従来のアドレス生成について説明する。
まず、ステップが正の数であり、トップアドレスからボトムアドレスの方向にアクセスする場合について説明する。最初に、現在のアドレスにステップを加算して第1の数値を求める。この第1の数値が次のアドレスとなるが、この第1の数値がボトムアドレスよりも大きいか否かを判定するために、第1の数値からボトムアドレスを減算する。この減算結果が負でない場合には、第1の数値からブロックサイズを減算して第2の数値を求め、この第2の数値をサーキュラアドレッシングにおける次のアドレスとする。一方、第1の数値からボトムアドレスを減算した結果が負である場合には、第1の数値をサーキュラアドレッシングにおける次のアドレスとする。
【0004】
次に、ステップが負の数であり、ボトムアドレスからトップアドレスの方向にアクセスする場合について説明する。ステップが正の数である場合と同様に、最初に、現在のアドレスにステップを加算して第1の数値を求める。この第1の数値が次のアドレスとなるが、この第1の数値がトップアドレスよりも小さいか否かを判定するために、第1の数値からトップアドレスを減算する。この減算結果が負の場合には、第1の数値にブロックサイズを加算して第2の数値を求め、この第2の数値をサーキュラアドレッシングにおける次のアドレスとする。一方、第1の数値からトップアドレスを減算した結果が0または正である場合には、第1の数値をサーキュラアドレッシングにおける次のアドレスとする。
以上に述べた手法により、トップアドレスからボトムアドレスの方向、またはボトムアドレスからトップアドレスの方向へのサーキュラアドレッシングにおけるアドレスが生成される。
【0005】
一方、所定の記憶領域に記憶されたプログラムを所定の回数だけ繰り返し実行する必要がある場合がある。このような所定の記憶領域へのアクセス(ブロックリピートアクセス)を行う場合には、ブロックリピートアドレッシングと呼ばれるアドレッシング方法が採られることがある。以下、図11を参照してブロックリピートアドレッシングについて説明する。
図11はブロックリピートアドレッシングにおける従来のアドレス生成回路9の構成を示す図である。
図11に示すように、アドレス生成回路9は、プログラムカウンタ(PC)900、比較回路902,916、レジスタ(END)904、セレクタ906、レジスタ(START)908、インクリメント回路910、デクリメント回路912、およびレジスタ(BRCR)914から構成される。
まず、ブロックリピートを行う前に、レジスタ904に繰り返し実行するプログラムのボトムアドレス(末尾アドレス)が設定され、レジスタ908に当該プログラムのトップアドレス(先頭アドレス)が設定され、レジスタ914に繰り返し回数が初期値として設定される。
【0006】
プロックリピートアクセスが開始されると、動作周期毎にプログラムカウンタ900からアドレスが発生される。このアドレスはメモリ(図示せず)とインクリメント回路910に供給されると共に、比較回路902にも出力される。インクリメント回路910は、入力したアドレスに1を加算(インクリメント)してセレクタ906に出力する。
比較回路902は、プログラムカウンタ900が出力するアドレスとレジスタ904に記憶されているボトムアドレスとを比較し、これらの一致を検出する。比較回路902がプログラムカウンタ900のアドレスとボトムアドレスとの一致を検出しない場合には、信号PC=ENDは不活性化状態(ローレベル)であり、セレクタ906は入力I0側を選択してプログラムカウンタ900に出力する。すなわち、動作周期におけるアドレスとボトムアドレスとが一致しない場合には、その動作周期のアドレスがインクリメントされ、次の動作周期におけるアドレスとしてプログラムカウンタ900から出力される。
【0007】
比較回路902がプログラムカウンタ900が出力するアドレスとボトムアドレスとの一致を検出した場合には信号PC=ENDが活性化状態(ハイレベル)となり、セレクタ906は入力I1側を選択してプログラムカウンタ900に出力する。すなわち、アドレスがボトムアドレスに達した場合には、次の動作周期におけるアドレスとしてトップアドレスがプログラムカウンタ900から出力される。
更に、信号PC=ENDが活性化状態になると、レジスタ914は繰り返し回数をデクリメント回路912により1つ減算(デクリメント)して、そのデクリメントした値を記憶すると共に比較回路916に出力する。つまり、トップアドレスからボトムアドレスの方向にブロックリピートプログラムの全領域を実行するアドレスの一連の生成が一回終了する毎に、レジスタ914に記憶されている繰り返し回数がデクリメントされることになる。
【0008】
以上に述べた動作が所定の回数繰り返されると、レジスタ914の値が0になる。比較回路916は、レジスタ914に記憶されている繰り返し回数と0とを比較して、これらが一致した場合には禁止信号を活性化状態(ハイレベル)とする。禁止信号が活性化されると、アドレス生成回路9はブロックリピートアクセス動作を終了する。
【0009】
【発明が解決しようとする課題】
サーキュラアドレッシングにおける従来のアドレス生成は、上述したように、3つの演算処理(加算または減算)により次のアドレスを生成しているので、そのアドレス生成回路は3つの演算器を必要とする。具体的には、従来のアドレス生成回路は3つの加算器を必要とする。加算器は一般的にその回路規模が比較的大きなハードウエアであるので、この回路規模の大きな加算器を3つ含む従来のアドレス生成回路は半導体チップに占める面積が大きいという問題がある。
また、アドレス生成の計算のために、ステップとトップアドレスとボトムアドレスとを記憶しておく必要があるという問題がある。
【0010】
また、従来のブロックリピートアドレッシングを行うアドレス生成回路を、他段パイプライン機構を有する演算処理装置(CPU)に用いた場合、パイプライン機構の段数によってブロックリピートのサイズに制限を加える必要があるという問題がある。
すなわち、CPUがブロックリピートアドレッシングによりパイプライン機構にボトムアドレスの命令を取り込んだ時点でアドレス生成回路の繰り返し回数のデクリメントが行われるので、この時点でCPUに対して割り込みが発行されると、割り込み処理から戻ったときに、実行されていない命令(ボトムアドレスの命令)があるのにも拘らず、繰り返し回数を記憶しているレジスタの内容は既にデクリメントされており、前回の一連のプログラムの実行が完了したことを示していることになる。従って、ボトムアドレスからパイプラインの段数分前の命令に対しては割り込みを禁止する必要があり、これに伴ってブロックリピートのサイズ(ボトムアドレスとトップアドレスの差に1を加えた数)をパイプラインの段数に1を加えた数値以上とするような制限が必要になる。
【0011】
本発明の目的は、以上に述べた従来技術の問題点のうち、ブロックリピートアドレッシング用アドレス回路の問題を克服して、CPUのパイプライン機構の段数によりブロックリピートのサイズを制限する必要、およびボトムアドレス付近の命令に対する割り込みの禁止などのプログラム作成上の制限が生じないブロックリピートアドレッシング用アドレス生成回路を提供することにある。
【0012】
【課題を解決するための手段】
本発明によれば、多段パイプライン機構を有するプロセッサにおけるブロックリピートアドレッシング用のアドレスを生成するためのアドレス生成回路であって、
スタートアドレスを記憶する第1の記憶回路と、上記スタートアドレスと同じ又は上記スタートアドレスよりも大きなエンドアドレスを記憶する第2の記憶回路と、インストラクションアドレスを保持するプログラムカウンタと、ループエンド制御信号が非活性状態のときにクロック信号に応答してインクリメントされたアドレスを上記プログラムカウンタに供給し、上記ループエンド制御信号が活性状態のときに上記第1の記憶回路から出力される上記スタートアドレスを上記プログラムカウンタに供給する選択回路と、上記プログラムカウンタと上記第2の記憶回路に接続され、上記インストラクションアドレスと上記エンドアドレスとが等しいときに一致信号を活性化する比較器と、繰り返し値を記憶し、繰り返し値制御信号の活性化に応答して上記繰り返し値がデクリメントされる第3の記憶回路と、上記比較器からの一致信号と上記第3の記憶回路からの繰り返し値とを入力し、上記一致信号に応答して上記ループエンド制御信号を上記選択回路に供給し、上記一致信号に応答して上記繰り返し値制御信号を上記第3の記憶回路に供給する制御回路とを有し、上記制御回路は、上記ループエンド制御信号の活性化からプロセッサのパイプラインの段数または深さに対応した所定の数の周期だけ遅らせて、上記繰り返し値制御信号を活性化する、アドレス生成回路が提供される。
【0013】
好ましくは、上記制御回路は、新たな上記一致信号に応答した上記ループエンド制御信号の活性化処理を、直前の上記一致信号に応答した上記繰り返し値制御信号の活性化処理の後に行なう。
また好ましくは、上記制御回路は、上記クロック信号の所定の数の周期における上記所定の数に対応した段数の直列接続された複数のフリップフロップを有し、初段のフリップフロップの入力端子に上記ループエンド制御信号が供給され、最終段のフリップフロップの出力端子から上記繰り返し値制御信号が供給され、上記複数のフリップフロップのクリア端子に上記プロセッサの割り込みを示す信号が供給される。
【0014】
【実施例】
本発明に係わるサーキュラアドレッシングにおけるアドレス生成の概略を図9を参照して説明する。従来のアドレス生成では直接的に次のアドレスを求めていたが、本発明では相対的に次のアドレスを求める。尚、以下の説明において、アドレスおよびブロックサイズは32ビット構成の2進数であるとする。図9において、ARnは現在のアドレス、BKはブロックサイズ、EB1はサーキュラブロックのトップアドレス、EB2はサーキュラブロックのボトムアドレス、Indexは現在のアドレスにおけるインデックスであり、Index’は次のアドレスにおけるインデックスであり、ARn’はサーキュラアドレッシングにおける次のアドレスであり、14はインデックス生成回路である。
【0015】
(1) ブロックサイズBKにおいて1が存在する最上位のビットを検出する。図9では、ビットNを1が存在する最上位のビットとする。
(2) 次に、現在のアドレスARnのビット31〜ビット(N+1)の値とビットN〜ビット0が全て0である値からトップアドレスEB1のビット31〜ビット0の値を求め、現在のアドレスARnのビット31〜ビット(N+1)の値とブロックサイズBKのビットN〜ビット0の値からボトムアドレスEB2のビット31〜ビット0の値を求める。
(3) 次に、サーキュラアドレッシングにおいてステップ値毎にインクリメントまたはデクリメントされるインデックスIndexを求める。ビット31〜ビット(N+1)が全て0の値と現在のアドレスARnのビットN〜ビット0の値からインデックスIndexのビット31〜ビット0の値が求められる。
(4) 次に、インデックスIndexにステップ値を加算して新たなインデックスIndex’を求める。ここで、インデックスIndexにステップ値を加算した値がブロックサイズBK以上となった場合にはその加算値からブロックサイズBKを減算した値を新たなインデックスIndex’とし、上記加算値が負となった場合にはその加算値にブロックサイズBKを加算した値を新たなインデックスIndex’とする。
(5) 次に、アドレスARnのビット31〜ビット(N+1)の値と新たなインデックスIndex’の値(ビットN〜ビット0)から新たなアドレスARn’のビット31〜ビット0の値を求める。
以下、上記(3) 〜(5) のステップを繰り返すことにより、サーキュラアドレッシングにおけるアドレス生成が実現される。尚、上記Index’はインデックス生成ロジック14にて生成される。
【0016】
次に、図10を参照して、サーキュラアドレッシングにおけるインデックス生成の詳細を説明する。
図10はインデックス生成処理のアルゴリズムを示すフローチャートである。図10において、iは作業用の変数を示し、BKmask[a:b]は作業用の数値BKmaskのビットaからビットbまでの値を示し、BKmask[c]はBKmaskのビットcの値を示し、BK[a:b]はブロックサイズのビットaからビットbまでの値を示し、BK[c]はブロックサイズのビットcの値を示し、ARn[a:b]はアドレス(ポインタ)のビットaからビットbまでの値を示し、Indexはインデックスの値を示し、Stepはインデックスに増減される数値を示し、Index’はインデックス生成処理によって新たに生成されたインデックスを示す。
【0017】
処理101(S101)において、iに31が代入される。
処理102(S102)において、iの値が負であるか否かが判断され、iの値が0以上である場合にはS503の処理に進み、iの値が負の場合にはS105の処理に進む。
処理103(S103)において、BK[i]の値とBKmask[i+1]の値との論理和が算出され、その結果がBKmask[i]に代入される。ここで、i=31のときにはBK[31]がBKmask[31]に代入される。
処理104(S104)においては、iから1が減算(iがデクリメント)される。
この一連の処理によりブロックサイズBKにおいて1が存在する最上位のビットが検出され、図9に示すようにブロックサイズBKのビットNがその最上位のビットである場合には、BKmaskのビット31〜ビットN+1の値は全て0となり、ビットN〜ビット0の値は全て1となる。
【0018】
処理105(S105)において、ARn[31:0]の値とBKmask[31:0]の値との論理積が算出され、その結果がIndexに代入される。ここで、図9の場合には、Indexのビット31〜ビット(N+1)の値は全て0となり、Index[N:0]はARn[N:0]と等しい値となる。
処理106(S106)において、Stepの値が負であるか否かが判断されて、Stepの値が負である、すなわち、ボトムアドレスからトップアドレスの方向にサーキュラアドレッシングが行われる場合にはS107の処理に進み、Stepの値が0以上である、すなわち、トップアドレスからボトムアドレスの方向にサーキュラアドレッシングが行われる場合にはS110の処理に進む。
【0019】
処理107(S107)において、Indexの値とStepの値との和が負であるか否かが判断されて、Indexの値とStepの値との和が負である場合、すなわち、次のアドレスの値がトップアドレスとボトムアドレスの範囲外にある場合にはS108の処理に進み、Indexの値とStepの値との和が0以上である場合、すなわち、次のアドレスの値がトップアドレスとボトムアドレスの範囲内にある場合にはS109の処理に進む。
処理108(S108)において、Indexの値とStepの値とBKの値とが加算されて、新たなIndex’が生成される。
処理109(S109)において、Indexの値とStepの値とが加算されて、新たなIndex’が生成される。
【0020】
処理110(S110)において、Indexの値とStepとの値の和と、BKの値との減算が行われて、その演算結果が負であるか否かが判断される。上記演算結果が負である、すなわち、次のアドレスの値がトップアドレスとボトムアドレスの範囲内にある場合にはS111の処理に進み、上記演算結果が0以上である、すなわち、次のアドレスの値がトップアドレスとボトムアドレスの範囲外にある場合にはS112の処理に進む。
処理111(S111)において、Indexの値とStepの値とが加算されて、新たなIndex’が生成される。
処理112(S112)において、Indexの値とStepとの値の和と、BKの値との減算が行われて、新たなIndex’が生成される。
【0021】
以上の一連の処理により新たなインデックスIndex’が生成され、図9に示すように、アドレスARnのビット31〜ビット(N+1)の値と新たなインデックスIndex’のビットN〜ビット0の値とから、新たなアドレスARn’のビット31〜ビット0の値が生成される。
BKmaskが生成された後のインデックスは、S105以降の処理を実行することにより生成される。
【0022】
以下、図1を参照して本発明のサーキュラアドレッシング用アドレス生成回路30を説明する。尚、本実施例の各演算器のビット数は32ビット構成であるとする。尚、負の数は2の方数形式で表されるものとする。
図1は本発明の第1実施例のアドレス生成回路30の構成を示す図である。加減制御回路300は、加減制御信号(A/S)に従い、第1の動作モードまたは第2の動作モードとなる。加減制御信号(A/S)が加算命令である第1の動作モードにおいては、入力端子Stepに入力されるステップをそのまま加算回路302の入力端子Aに出力する。このとき、加算回路302の入力端子Cにキャリーは出力されず、その値は0である。一方、加減制御信号(A/S)が減算命令である第2の動作モードにおいては、入力端子Stepに入力されるステップの各ビットを反転した数値を算出して加算回路302の入力端子Aに出力すると共に、加算回路302の入力端子Cにキャリー(1)を出力する。尚、加算回路302の入力端子Aおよび入力端子Cに出力される2つの信号がステップ値を構成する。
以上の説明から明らかなように、加減制御信号(A/S)によって加減制御回路300で入力端子Stepに入力されるステップの符合を変換する場合には、2の補数形式で変換されることになる。
【0023】
加減制御回路306は、加算回路302の入力端子Aに出力されるステップ値の最上位ビット(MSB)の値に従い、第1の動作モードまたは第2の動作モードとなる。上記MSBが0、すなわちステップ値が正であり、サーキュラブロックのトップアドレスからボトムアドレスの方向にサーキュラアドレッシングを行う場合には第2の動作モードとなり、入力端子BKから入力されるブロックサイズの各ビットを反転した数値を算出して加算回路310の入力端子Bに出力すると共に、加算回路310の入力端子Cにキャリー(1)を出力する。一方、上記MSBが1、すなわちステップ値が負であり、ボトムアドレスからトップアドレスの方向にサーキュラアドレッシングを行う場合には第1の動作モードとなり、入力端子BKから入力されるブロックサイズをそのまま加算回路310の入力端子Bに出力する。尚、このとき加算回路310の入力端子Cにキャリーは出力されず、その値は0である。
【0024】
ビット分離回路304は、BKmaskに基づいて入力端子ARnから入力されるアドレス(ポインタ)を上位側のビット部分と下位側のビット部分とに分離し、それぞれビット多重回路314と加算回路302の入力端子Bに出力する。尚、BKmaskは図10に示す処理101〜処理104で生成される数値であり、ビット31〜ビット(N+1)の値は全て0であり、ビットN〜ビット0の値は全て1である。加算回路302の入力端子Bに出力されるデータのビット31〜ビット(N+1)の値は全て0であり、ビットN〜ビット0の値はビット分離回路304に入力するアドレスのビットN〜ビット0の値と同じであり、この加算回路302の入力端子Bに出力されるデータは実質的には図10にて説明したIndex(インデックス)である。一方、ビット多重回路314に出力されるデータのビット31〜ビット(N+1)の値はビット分離回路304に入力するアドレスのビット31〜ビット(N+1)の値と同じである。
【0025】
加算回路302は、入力端子A,B,Cに入力されたインデックスとステップ値との全加算演算を行い、その全加算演算結果(信号ADD2)を加算回路310の入力端子Aとマルチプレクサ312の入力端子I1に出力し、キャリーアウト信号(Carry2)をキャリーチェック回路308に出力する。
加算回路310は、入力端子A,B,Cにそれぞれ入力された信号ADD2、各ビットが反転されたブロックサイズまたはブロックサイズ、およびキャリー信号(1または0)について全加算演算を行い、その全加算演算結果(信号ADD3)をマルチプレクサ312の入力端子I2に出力し、キャリーアウト信号(Carry3)をキャリーチェック回路308に出力する。
【0026】
マルチプレクサ312は、キャリーチェック回路308から出力される制御信号SELに従い、入力端子I1,I2に入力される信号ADD2,ADD3の何れか一方を選択し、新たなインデックス(Index’)としてビット多重回路314に出力する。
ビット多重回路314は、BKmaskに基づいてビット分離回路304から出力されるデータの上位側のビット部分とマルチプレクサ312から出力される新たなインデックスの下位側のビット部分とを多重化して、その多重化したデータを出力端子ARn’に新たなアドレスとして出力する。この新たなアドレスのビット31〜ビット(N+1)の値は入力端子ARnに入力したアドレスのビット31〜ビット(N+1)の値と同じであり、新たなアドレスのビットN〜ビット0の値はマルチプレクサ312から出力される新たなインデックスのビットN〜ビット0の値と同じである。
【0027】
キャリーチェック回路308は、加算回路302の入力端子Aに出力されるステップ値の最上位ビット(MSB)、加算回路302のキャリーアウト信号(Carry2)、および加算回路310のキャリーアウト信号(Carry3)に応じた制御信号SELをマルチプレクサ312に出力する。上記MSBが1であり、ステップ値が負の場合、すなわちサーキュラアドレッシングがボトムアドレスからトップアドレスの方向に行われる場合には、加算回路302のキャリーアウト信号のみを監視し、キャリーが出力される、すなわちキャリーアウト信号(Carry2)が1であるときにはマルチプレクサ312が信号ADD2を選択するように制御し、キャリーが出力されない、すなわちキャリーアウト信号(Carry2)が0であるときにはマルチプレクサ312が信号ADD3を選択するように制御する。一方、上記MSBが0であり、ステップ値が正の場合、すなわちサーキュラアドレッシングがトップアドレスからボトムアドレスの方向に行われる場合には、加算回路302および加算回路310のキャリーアウト信号を監視し、何れか一方の加算回路からキャリーが出力されるときにはマルチプレクサ312が信号ADD3を選択するように制御し、何れの加算回路からもキャリーが出力されないときにはマルチプレクサ312が信号ADD2を選択するように制御する。
【0028】
以下に、加算回路302に出力されるステップ値が正であり、トップアドレスからボトムアドレスの方向にサーキュラアドレッシングが行われる場合のアドレス生成回路30の動作について説明する。尚、加減制御回路300,306、加算回路302,310、マルチプレクサ312およびキャリーチェック回路308が、図9におけるインデックス生成回路14に対応する。
加減制御回路300は、正のステップ値を加算回路302に出力する。この場合、加算回路302の入力端子Aに出力されるステップ値のMSBは0となるので、キャリーチェック回路308は加算回路302および加算回路310のキャリーアウト信号の双方を監視し、加減制御回路306は入力するブロックサイズの各ビットを反転して加算回路310に出力すると共に、加算回路310にキャリーを出力する。
【0029】
加算回路302は、インデックスとステップ値との全加算演算を行い、加算回路310は、信号ADD2とブロックサイズの各ビットが反転された信号とキャリー信号との全加算演算、すなわち信号ADD2とブロックサイズとの減算処理を行う。すなわち、加算回路302と加算回路310とで図10のS110の処理を行っており、インデックスとステップ値との和とブロックサイズとの減算結果が負であるか否かの判定を行う。
従って、インデックスとステップ値との和とブロックサイズとの減算結果が負である、すなわち加算回路302および加算回路310の双方からキャリーアウト信号が出力されない場合には、マルチプレクサ312はインデックスにステップ値が加算された信号ADD2、すなわち現在のアドレスのビットN〜ビット0の値にステップ値が加算された値を選択してビット多重回路314に出力する。一方、インデックスとステップとの和とブロックサイズとの減算結果が0以上である、すなわち加算回路302または加算回路310の何れか一方からキャリーアウト信号が出力される場合には、マルチプレクサ312は信号ADD3、すなわちインデックスとステップ値との和とブロックサイズとの減算結果を選択してビット多重回路314に出力する。
【0030】
ビット多重回路314は、ビット分離回路304から出力されるデータのビット31〜ビット(N+1)、すなわち現在のアドレスのビット31〜ビット(N+1)の値とマルチプレクサ312から出力される新たなインデックスのビットN〜ビット0の値とを組み合わせて、新たなアドレスとして出力する。
以上の一連の動作により、トップアドレスからボトムアドレスの方向へのサーキュラアドレッシングにおけるアドレス生成が実現される。
【0031】
次に、加算回路302に出力されるステップ値が負であり、ボトムアドレスからトップアドレスの方向にサーキュラアドレッシングが行われる場合のアドレス生成回路30の動作について説明する。
加減制御回路300は、負のステップ値を加算回路302に出力する。この場合、加算回路302の入力端子Aに出力されるステップ値のMSBは1であるので、キャリーチェック回路308は加算回路302のキャリーアウト信号のみを監視し、加減制御回路306は入力するブロックサイズをそのまま加算回路310に出力する。このとき、加算回路310にキャリーは出力されない。
【0032】
加算回路302はインデックスと負のステップ値との全加算演算を行う。すなわち、加算回路302は図10におけるS107の処理を行っており、インデックスとステップ値との和が負であるか否かの判定を行う。また、加算回路310は、信号ADD2とブロックサイズとの全加算演算を行う。
従って、インデックスとステップ値との和が負である、すなわち加算回路302からキャリーアウト信号が出力されない場合には、マルチプレクサ312はインデックスとステップ値とブロックサイズとの和である信号ADD3を選択してビット多重回路314に出力する。一方、インデックスとステップ値との和が0以上である、すなわち加算回路302からキャリーアウト信号が出力される場合には、マルチプレクサ312はインデックスとステップ値との和である信号ADD2、すなわち現在のアドレスのビットN〜ビット0の値にステップを加算した値を選択してビット多重回路314に出力する。
【0033】
ビット多重回路314は、ビット分離回路304から出力されるデータのビット31〜ビット(N+1)、すなわち現在のアドレスのビット31〜ビット(N+1)の値とマルチプレクサ312から出力される新たなインデックスのビットN〜ビット0の値とを組み合わせて、新たなアドレスとして出力する。
以上の一連の動作により、ボトムアドレスからトップアドレスの方向へのサーキュラアドレッシングにおけるアドレス生成が実現される。
【0034】
以下、図2を参照して本発明のサーキュラアドレッシング用アドレス生成回路40を説明する。尚、本実施例の各演算器のビット数も32ビット構成であるとする。
図2は本発明の第2実施例のアドレス生成回路40の構成を示す図である。加減制御回路400は図1に示す加減制御回路300と同様の機能を有し、加減制御信号(A/S)に従って、第1の動作モードまたは第2の動作モードをとる。加減制御信号(A/S)が加算命令である第1の動作モードにおいては、入力端子Stepに入力されるステップをそのまま部分加算回路406の入力端子I1に出力する。尚、このとき部分加算回路408の入力端子C1にはキャリーは出力されない。一方、加減制御信号(A/S)が減算命令である第2の動作モードにおいては、入力端子Stepに入力されるステップの各ビットを反転した数値を算出して部分加算回路406の入力端子I1に出力すると共に、部分加算回路408の入力端子C1にキャリーを出力する。尚、部分加算回路406の入力端子I1と部分加算回路408の入力端子C1に出力される信号とがステップ値を構成する。
【0035】
加減制御回路402は部分加算回路406の入力端子I1に出力されるステップ値の最上位ビット(MSB)に制御される。上記MSBが0であり、サーキュラブロックのトップアドレスからボトムアドレスの方向にサーキュラアドレッシングを行う場合には、入力端子BKから入力されるブロックサイズの各ビットを反転した数値を算出して部分加算回路406の入力端子I2に出力すると共に、部分加算回路408の入力端子C2にキャリーを出力する。一方、上記MSBが1であり、ボトムアドレスからトップアドレスの方向にサーキュラアドレッシングを行う場合には、部分加算回路406の入力端子I2に0のデータを出力し、部分加算回路408の入力端子C2にキャリーを出力しない。
【0036】
ゲート回路412は、キャリーチェック回路410から出力される制御信号(SEL1)に従って、0のデータを加算回路414の入力端子Bに出力するか、または入力端子BKに入力されるブロックサイズを加算回路414の入力端子Bに出力するかを選択する。
【0037】
ビット分離回路404は図1に示すビット分離回路304と同様の機能を有しており、BKmaskに基づいて入力端子ARnから入力されるアドレスを上位側のビット部分と下位側のビット部分とに分離し、それぞれビット多重回路416と部分加算回路406の入力端子I3に出力する。
ビット多重回路416は図1に示すビット多重回路314と同様の機能を有しており、BKmaskに基づいてビット分離回路404から出力されるデータの上位側のビット部分と加算回路414から出力されるデータ(信号ADD3)の下位側のビット部分とを多重化し、その多重化したデータを出力端子ARn’に新たなアドレスとして出力する。
【0038】
尚、BKmask、部分加算回路406の入力端子I3に出力されるデータ、ビット分離回路404からビット多重回路416に出力されるデータ、加算回路414から出力されるデータ、およびビット多重回路416から出力されるデータは、図1において説明したものと同様のデータフォーマットである。
また、部分加算回路406の入力端子I3に出力されるデータはIndexであり、加算回路414から出力されるデータはIndex’である。
【0039】
部分加算回路406と部分加算回路408は3入力の全加算回路420を構成し、この全加算回路420は図3に示す構成となっている。この全加算回路420は、入力端子I1,I2,I3,C1,C2にそれぞれ入力されたステップ値、各ビットが反転されたブロックサイズまたは0、インデックス、およびキャリー信号(C2)についての全加算演算を行い、その全加算演算結果(信号ADD2)を加算回路414の入力端子Aに出力し、2つのキャリーアウト信号(Carry2,Carry3)をキャリーチェック回路410に出力する。
加算回路414は、入力端子A,Bにそれぞれ入力された信号ADD2とゲート回路412の出力信号との加算演算を行って、その加算演算結果(信号ADD3)を新たなインデックス(Index’)としてビット多重回路416に出力する。
【0040】
キャリーチェック回路410は、全加算回路420に出力されるステップ値の最上位ビット(MSB)、および全加算回路420が出力する2つのキャリーアウト信号に応じた制御信号(SEL1)をゲート回路412に出力する。上記MSBが1である場合、すなわちサーキュラアドレッシングがボトムアドレスからトップアドレスの方向に行われる場合には2つのキャリーアウト信号(Carry2,Carry3)の双方を監視し、キャリーが出力される、すなわち何れか一方のキャリーアウト信号が1であるときにはゲート回路412が0を出力するように制御し、キャリーが出力されない、すなわち2つのキャリーアウト信号が共に0であるときにはゲート回路412がブロックサイズを出力するように制御する。一方、上記MSBが0である場合、すなわちサーキュラアドレッシングがトップアドレスからボトムアドレスの方向に行われる場合には2つのキャリーアウト信号(Carry2,Carry3)を監視し、何れか一方のキャリーアウト信号が1であるときにはゲート回路412が0を出力するように制御し、双方のキャリーアウト信号が0であるときにはゲート回路412がブロックサイズを出力するように制御する。
【0041】
図3は部分加算回路406と部分加算回路408とで構成される3入力の全加算回路420の要部を示す図である。部分加算回路406は、入力端子I1,I2,I3に入力される各信号のビット31〜ビット0についてそれぞれ加算演算を行ってキャリーアウト信号(Carry2)を生成する。部分加算回路408は、部分加算回路406の加算演算結果と加減制御回路400,401からそれぞれ出力される2つのキャリー信号(C1,C2)との加算演算を行って全加算演算結果(ビット31〜ビット0)とキャリーアウト信号(Carry3)を生成する。
【0042】
以下に、全加算回路420に出力されるステップ値が正の数であり、トップアドレスからボトムアドレスの方向にサーキュラアドレッシングが行われる場合のアドレス生成回路40の動作について説明する。尚、加減制御回路400,402、ゲート回路412、部分加算回路406,408、加算回路414、およびキャリーチェック回路410が、図9におけるインデックス生成回路14に対応する。
加減制御回路400は、正のステップ値を全加算回路420に出力する。この場合、全加算回路420に出力されるステップ値のMSBは0となるので、キャリーチェック回路410は全加算回路420から出力される2つのキャリーアウト信号の双方を監視する。加減制御回路401は、入力するブロックサイズの各ビットを反転して全加算回路420に出力すると共に、全加算回路420にキャリーを出力する。
【0043】
全加算回路420は、ステップ値とインデックスとブロックサイズの各ビットが反転された信号と加減制御回路401から出力されるキャリー信号との全加算演算、すなわちインデックスとステップ値との和とブロックサイズとの減算処理を行う。全加算回路420は図10のS110の処理を行っており、インデックスとステップ値との和とブロックサイズとの減算結果が負であるか否かの判定を行う。
従って、インデックスとステップ値との和とブロックサイズとの減算結果が負である、すなわち全加算回路420からキャリーアウト信号が出力されない場合には、ゲート回路412は入力するブロックサイズをそのまま加算回路414に出力する。加算回路414は、全加算回路420から出力される信号ADD2とゲート回路412から出力されるブロックサイズとの加算演算を行い、インデックスにステップ値が加算された信号、すなわち現在のアドレスのビットN〜ビット0の値にステップ値が加算された値を算出してビット多重回路416に出力する。一方、インデックスとステップ値との和とブロックサイズとの減算結果が0以上である、すなわち全加算回路420からキャリーアウト信号が出力される場合にはゲート回路412は0を加算回路414に出力する。加算回路414は全加算回路420から出力される信号ADD2と0との加算演算を行い、インデックスとステップ値との和とブロックサイズとの減算結果を算出してビット多重回路416に出力する。
【0044】
ビット多重回路416は、ビット分離回路404から出力されるデータのビット31〜ビット(N+1)、すなわち現在のアドレスのビット31〜ビット(N+1)の値と、加算回路414から出力される新たなインデックスのビットN〜ビット0の値とを組み合わせて、新たなアドレスとして出力する。
以上の一連の動作により、トップアドレスからボトムアドレスの方向へのサーキュラアドレッシングにおけるアドレス生成が実現される。
【0045】
次に、全加算回路420に出力されるステップ値が負の数であり、ボトムアドレスからトップアドレスの方向にサーキュラアドレッシングが行われる場合のアドレス生成回路40の動作について説明する。
加減制御回路400は、負のステップ値を全加算回路420に出力する。この場合、全加算回路420に出力されるステップ値のMSBは1であるので、キャリーチェック回路410は全加算回路420から出力される2つのキャリーアウト信号の双方を監視する。また、加減制御回路402は、0のデータを全加算回路420に出力し、全加算回路420にキャリー(C2)を出力しない。
【0046】
全加算回路420は、ステップ値とインデックスと0との全加算演算を行う。全加算回路420は図10におけるS107の処理を行っており、インデックスとステップ値との和が負であるか否かの判定を行う。
従って、インデックスとステップ値との和が負である、すなわち全加算回路420からキャリーアウト信号が出力されない場合には、ゲート回路412は入力するブロックサイズをそのまま加算回路414に出力する。加算回路414は、全加算回路420から出力される信号ADD2とゲート回路412から出力されるブロックサイズとの加算演算を行い、インデックスとステップ値とブロックサイズとの和を算出してビット多重回路416に出力する。一方、インデックスとステップ値との和が0以上である、すなわち全加算回路420からキャリーアウト信号が出力される場合には、ゲート回路412は0を加算回路414に出力する。加算回路414は、全加算回路420から出力される信号ADD2と0との加算演算を行い、インデックスとステップ値との和、すなわち現在のアドレスのビットN〜ビット0の値にステップ値を加算した値を算出してビット多重回路416に出力する。
【0047】
ビット多重回路416は、ビット分離回路404から出力されるデータのビット31〜ビット(N+1)、すなわち現在のアドレスのビット31〜ビット(N+1)の値と、加算回路414から出力される新たなインデックスのビットN〜ビット0の値とを組み合わせて、新たなアドレスとして出力する。
以上の一連の動作により、ボトムアドレスからトップアドレスの方向へのサーキュラアドレッシングにおけるアドレス生成が実現される。
【0048】
以下、図4を参照して本発明のサーキュラアドレッシング用アドレス生成回路60を説明する。尚、本実施例の各演算器のビット数も32ビット構成であるとする。
図4は本発明の第3実施例のアドレス生成回路60の構成を示す図である。加減制御回路600は図1に示した加減制御回路300と同様の機能を有し、加減制御信号(A/S)に従い、第1の動作モードまたは第2の動作モードをとる。加減制御信号(A/S)が加算命令である第1の動作モードにおいては、入力端子Stepに入力されるステップをそのまま部分加算回路608の入力端子I1に出力する。尚、このとき部分加算回路610の入力端子C1にはキャリーは出力されない。一方、加減制御信号(A/S)が減算命令である第2の動作モードにおいては、入力端子Stepに入力されるステップの各ビットを反転した数値を算出して部分加算回路608の入力端子I1に出力すると共に、部分加算回路610の入力端子C1にキャリーを出力する。尚、部分加算回路608の入力端子I1と部分加算回路610の入力端子C1に出力される信号とがステップ値を構成する。
【0049】
加減制御回路602は図1に示す加減制御回路306と同様の機能を有し、部分加算回路608の入力端子I1に出力されるステップ値の最上位ビット(MSB)に従い、第1の動作モードまたは第2の動作モードをとる。上記MSBが0であり、サーキュラブロックのトップアドレスからボトムアドレスの方向にサーキュラアドレッシングを行う場合には第2の動作モードとなり、入力端子BKから入力されるブロックサイズの各ビットを反転した数値を算出してゲート回路604に出力すると共にゲート回路604にキャリー(Carry)を出力する。一方、上記MSBが1であり、ボトムアドレスからトップアドレスの方向にサーキュラアドレッシングを行う場合には第1の動作モードとなり、入力端子BKから入力されるブロックサイズをそのままゲート回路604に出力する。尚、このときゲート回路604にはキャリーは出力されない。
ゲート回路604は、クロック信号(CK)とキャリーチェック回路612から出力される制御信号(SEL1)とに従って、加減制御回路602から出力されるブロックサイズとキャリー信号(0)または各ビットが反転されたブロックサイズとキャリー信号(1)をそのまま部分加算回路608の入力端子I2と部分加算回路610の入力端子C2とに出力するか、または0のデ−タとキャリー信号(0)を部分加算回路608の入力端子I2と部分加算回路610の入力端子C2とに出力するかを選択する。
【0050】
ビット分離回路606は図1に示すビット分離回路304と同様の機能を有しており、BKmaskに基づいて入力端子ARnから入力されるアドレスを上位側のビット部分と下位側のビット部分とに分離し、それぞれビット多重回路614と部分加算回路608の入力端子I3に出力する。
ビット多重回路614は図1に示すビット多重回路314と同様の機能を有しており、BKmaskに基づいてビット分離回路606から出力されるデータの上位側のビット部分と部分加算回路610から出力される信号ADD2の下位側のビット部分とを多重化し、その多重化したデータを出力端子ARn’に新たなアドレスとして出力する。
【0051】
尚、BKmask、部分加算回路608の入力端子I3に出力されるデータ、ビット分離回路606からビット多重回路614に出力されるデータ、部分加算回路610から出力されるデータ、およびビット多重回路614から出力されるデータは、図1において説明したものと同様のデータフォーマットである。
また、部分加算回路608の入力端子I3に出力されるデータはIndexであり、部分加算回路610から出力されるデータはIndex’である。
【0052】
部分加算回路608と部分加算回路610は、図2に示す部分加算回路406と部分加算回路408と同様に、図3に示す3入力の全加算回路420を構成しており、入力端子I1,I2,I3,C1,C2にそれぞれ入力された値についての全加算演算を行い、その全加算演算結果(信号ADD2)を新たなインデックス(Index’)としてビット多重回路614に出力し、2つのキャリーアウト信号(Carry2,Carry3)をキャリーチェック回路612に出力する。
【0053】
キャリーチェック回路612は、全加算回路420に出力されるステップ値の最上位ビット(MSB)、全加算回路420が出力する2つのキャリーアウト信号に応じて、クロック信号(CK)の前半(ph1)と後半(ph2)とに分けて、制御信号(SEL1)によりゲート回路604を制御する。
上記MSBが1である場合、すなわちサーキュラアドレッシングがボトムアドレスからトップアドレスの方向に行われる場合には、2つのキャリーアウト信号を監視し、クロック信号(CK)の前半(ph1)においては、ゲート回路604が0のデータとキャリー信号(0)とを部分加算回路608の入力端子I2と部分加算回路610の入力端子C2とに出力するように制御する。クロック信号の後半(ph2)においては、クロック信号の前半においてキャリーが出力される、すなわち何れか一方のキャリーアウト信号が1のときにはゲート回路604が0のデータとキャリー信号(0)とを部分加算回路608の入力端子I2と部分加算回路610の入力端子C2とに出力するように制御し、クロック信号の前半においてキャリーが出力されない、すなわち双方のキャリーアウト信号が0のときにはゲート回路604が加減制御回路602から出力されるブロックサイズとキャリー信号(0)とを部分加算回路608の入力端子I2と部分加算回路610の入力端子C2とに出力するように制御する。
【0054】
一方、上記MSBが0である場合、すなわちサーキュラアドレッシングがトップアドレスからボトムアドレスの方向に行われる場合には、2つのキャリーアウト信号を監視し、クロック信号(CK)の前半(ph1)においては、ゲート回路604が加減制御回路602から出力される各ビットが反転されたブロックサイズとキャリー信号(1)とを部分加算回路608の入力端子I2と部分加算回路610の入力端子C2とに出力するように制御する。クロック信号の後半(ph2)においては、クロック信号の前半において何れか一方のキャリーアウト信号が1のときにはゲート回路604が加減制御回路602から出力される各ビットが反転されたブロックサイズとキャリー信号(1)とを部分加算回路608の入力端子I2と部分加算回路610の入力端子C2とに出力するように制御し、クロック信号の前半において双方のキャリーアウト信号が0のときにはゲート回路604が0のデータとキャリー信号(0)とを部分加算回路608の入力端子I2と部分加算回路610の入力端子C2とに出力するように制御する。
【0055】
以下に、全加算回路420に出力されるステップ値が正の数であり、トップアドレスからボトムアドレスの方向にサーキュラアドレッシングが行われる場合のアドレス生成回路60の動作について説明する。尚、加減制御回路600,602、ゲート回路604、部分加算回路608,610、およびキャリーチェック回路612が、図9のおけるインデックス生成回路14に対応する。
加減制御回路600は、正のステップ値を全加算回路420に出力する。この場合、全加算回路420に出力されるステップ値のMSBは0となるので、キャリーチェック回路612は全加算回路420から出力される2つのキャリーアウト信号の双方を監視し、加減制御回路602は入力するブロックサイズの各ビットを反転してゲート回路604に出力すると共にゲート回路604にキャリー信号(1)を出力する。
ゲート回路604は、クロック信号(CK)の前半(ph1)においては、加減制御回路602から出力される各ビットが反転されたブロックサイズとキャリー信号(1)とを全加算回路420に出力する。
【0056】
全加算回路420は、クロック信号(CK)の前半(ph1)においては、ステップ値とインデックスとブロックサイズの各ビットが反転された信号と加減制御回路602から出力されるキャリー信号(1)との全加算演算、すなわちインデックスとステップ値との和とブロックサイズとの減算処理を行う。全加算回路420は図10のS110の処理を行っており、インデックスとステップ値との和とブロックサイズとの減算結果が負であるか否かの判定を行う。
従って、クロック信号の前半において、インデックスとステップ値との和とブロックサイズとの減算結果が負である、すなわち全加算回路420からキャリーアウト信号が出力されない場合には、ゲート回路604がクロック信号の後半において全加算回路420に0のデータとキャリー信号(0)を出力するので、全加算回路420はクロック信号の後半(ph2)においてステップとインデックスとの全加算演算を行って、インデックスにステップ値が加算された信号、すなわち現在のアドレスのビットN〜ビット0の値にステップ値が加算された値を算出してビット多重回路614に出力する。一方、クロック信号の前半においてインデックスとステップ値との和とブロックサイズとの減算結果が0以上である、すなわち全加算回路420からキャリーアウト信号が出力される場合には、ゲート回路604がクロック信号の後半において全加算回路420に各ビットの値が反転されたブロックサイズとキャリー信号(1)とを出力するので、全加算回路420はクロック信号の後半においてインデックスとステップ値とブロックサイズの各ビットが反転された信号と加減制御回路602から出力されるキャリー信号(1)との全加算演算を行って、インデックスとステップ値との和とブロックサイズとの減算結果を算出してビット多重回路614に出力する。
【0057】
ビット多重回路614は、ビット分離回路404から出力されるデータのビット31〜ビット(N+1)、すなわち現在のアドレスのビット31〜ビット(N+1)の値と、全加算回路420から出力される新たなインデックスのビットN〜ビット0の値とを組み合わせて、新たなアドレスとして出力する。
以上の一連の動作により、トップアドレスからボトムアドレスの方向へのサーキュラアドレッシングにおけるアドレス生成が実現される。
【0058】
次に、全加算回路420に出力されるステップ値が負の数であり、ボトムアドレスからトップアドレスの方向にサーキュラアドレッシングが行われる場合のアドレス生成回路40の動作について説明する。
加減制御回路600は、負のステップ値を全加算回路420に出力する。この場合、全加算回路420に出力されるデータのMSBは1であるので、キャリーチェック回路612は全加算回路420から出力される2つのキャリーアウト信号を監視し、加減制御回路602は入力するブロックサイズをそのままゲート回路402に出力する。尚、このとき、全加算回路420にキャリーは出力されない。
ゲート回路604は、クロック信号の前半(ph1)においては、0のデータとキャリー信号(0)とを全加算回路420に出力する。
【0059】
全加算回路420は、クロック信号の前半(ph1)においては、インデックスとステップ値との全加算演算を行う。全加算回路420は図10のS107の処理を行っており、インデックスとステップ値との和が負であるか否かの判定を行う。
従って、クロック信号の前半においてインデックスとステップ値との和が負である、すなわち全加算回路420からキャリーアウト信号が出力されない場合には、クロック信号の後半(ph2)においてゲート回路604が全加算回路420にブロックサイズとキャリー信号(0)を出力するので、全加算回路420はクロック信号の後半においてインデックスとステップ値とブロックサイズとの全加算演算を行って、その演算結果をビット多重回路614に出力する。一方、クロック信号の前半においてインデックスとステップ値との和が0以上である、すなわち全加算回路420からキャリーアウト信号が出力される場合には、クロック信号の後半においてゲート回路604が全加算回路420に0のデータとキャリー信号(0)を出力するので、全加算回路420はクロック信号の後半においてインデックスとステップ値との全加算演算を行い、インデックスにステップ値が加算された信号、すなわち現在のアドレスのビットN〜ビット0の値にステップ値が加算された値を算出してビット多重回路614に出力する。
【0060】
ビット多重回路614は、ビット分離回路606から出力されるデータのビット31〜ビット(N+1)、すなわち現在のアドレスのビット31〜ビット(N+1)の値と、全加算回路420から出力される新たなインデックスのビットN〜ビット0の値とを組み合わせて、新たなアドレスとして出力する。
以上の一連の動作により、ボトムアドレスからトップアドレスの方向へのサーキュラアドレッシングにおけるアドレス生成が実現される。
【0061】
以上に説明した本発明のサーキュラアドレッシング用アドレス生成回路は、現在のアドレスの値を直接に計算して次のアドレスを求めるのではなく、インデックスとステップ値とブロックサイズを用いて間接的に次のアドレスを求めているので、効率的に計算を行える。また、第1実施例では加算器の数は2個であり、ハードウエアが簡略化されている。更には、第3実施例では1クロックサイクルで次のアドレスを算出することができるので、高速なアプリケーションに適している。
また、本発明のアドレス生成回路によれば、ステップとブロックサイズを記憶しておくだけでよく、トップアドレスとボトムアドレスとを記憶しておく必要がない。
以上に本発明のサーキュラアドレッシング用アドレス生成回路を説明したが、図10に示した本発明の技術思想に基づき、種々の回路形態が考えられることは当業者には明らかであろう。
【0062】
以下、図6を参照して本発明のブロックリピートアドレッシング用アドレス生成回路を説明する。
図6は本発明の第4実施例のアドレス生成回路7の構成を示す図である。アドレス生成回路7は、プログラムカウンタ(PC)72、比較回路74、レジスタ(END)76、セレクタ78、レジスタ(START)80、インクリメント回路82、デクリメント回路84、レジスタ(BRCR)86、およびゼロ検出回路70から構成される。尚、本実施例は、パイプラインの遅延が2段の場合に適用するものである。
本実施例は、図11に示した従来の回路と同ように、ブロックリピートを行う前に、レジスタ76に繰り返し実行するプログラムのボトムアドレス(末尾アドレス)が設定され、レジスタ80に当該プログラムのトップアドレス(先頭アドレス)が設定され、レジスタ86に繰り返し回数が初期値として設定される。
【0063】
図7はゼロ検出回路70の要部の構成を示す図である。フリップフロップ706,708のクロック端子にはパイプライン(CPU)の動作クロックであるクロックCKが入力され、クリア端子には割り込みを示すパイプラインフラッシュ信号が入力されている。フリップフロップ706の入力端子DはAND回路712の出力端子に接続されており、出力端子Qはフリップフロップ708の入力端子DとAND回路704の一方の入力端子に接続されている。フリップフロップ708の出力端子QはAND回路700の一方の入力端子とAND回路704の他方の入力端子に接続されている。AND回路700の他方の入力端子には信号BRCR1が入力され、その出力端子はNOR回路710の第2の入力端子に接続されている。AND回路702の一方の入力端子には信号BRCR2が入力され、他方の入力端子はAND回路704の出力端子に接続されており、出力端子はNOR回路710の第3の入力端子に接続されている。NOR回路710の第1の入力端子には信号BRCR0が入力され、その出力端子はAND回路712の一方の入力端子に接続されている。AND回路712の他方の入力端子には信号PC=ENDが入力される。
【0064】
信号BRCR2,BRCR1,BRCR0はレジスタ86から出力される繰り返し回数をデコードして生成される信号であり、各信号は繰り返し回数がそれぞれ2,1,0のときにハイレベルとなる。信号BRCR0はそのままブロックリピート禁止信号として出力される。また、AND回路712の出力端子からループエンド信号が出力され、フリップフロップ708の出力端子QからBRCR制御信号が出力される。
【0065】
プロックリピートアクセスが開始されると、動作周期毎にプログラムカウンタ72からアドレスが発生される。このアドレスはメモリ(図示せず)とインクリメント回路82に供給されると共に、比較回路74に出力される。インクリメント回路82は入力したアドレスに1を加算(インクリメント)してセレクタ78の入力端子I0に出力する。
比較回路74は、プログラムカウンタ72が出力するアドレスとレジスタ76に記憶されているボトムアドレスとを比較し、これらの一致を検出する。比較回路74がプログラムカウンタ900のアドレスとボトムアドレスとの一致を検出しない場合には信号PC=ENDは不活性化状態(ローレベル)であり、比較回路74がプログラムカウンタ72のアドレスとボトムアドレスとの一致を検出した場合には信号PC=ENDは活性化状態(ハイレベル)となる。
【0066】
セレクタ78はゼロ検出回路70から出力されるループエンド信号により制御され、ループエンド信号が不活性化状態(ローレベル)の場合には入力I0側を選択してプログラムカウンタ72に出力する。すなわち、動作周期におけるアドレスとボトムアドレスとが一致しない場合にはその動作周期のアドレスがインクリメントされ、そのインクリメントされたアドレスが次の動作周期におけるアドレスとしてプログラムカウンタ72から出力される。一方、ループエンド信号が活性化状態(ハイレベル)になると、セレクタ78は入力端子I1側を選択してプログラムカウンタ72に出力する。すなわち、アドレスがボトムアドレスに達した場合には、次の動作周期におけるアドレスとして、トップアドレスがプログラムカウンタ72から出力される。
レジスタ86は、ゼロ検出回路70から出力されるBRCR制御信号に応じて記憶している繰り返し回数をデクリメント回路84により1つ減算(デクリメント)して、そのデクリメントした値を記憶すると共に、ゼロ検出回路70に出力する。
【0067】
次に、ゼロ検出回路70の動作について説明する。繰り返し回数が3以上である場合には信号BRCR2、BRCR1、およびBRCR0は何れもローレベルであるので、NOR回路710の出力は常にハイレベルとなる。ここで、比較回路74が信号PC=ENDを活性化状態(ハイレベル)にすると、AND回路712からハイレベル(活性化状態)のループエンド信号が出力される。このハイレベルのループエンド信号はフリップフロップ706に入力される。フリップフロップ706,708はクロックCKの1パルスが入力してから出力信号を変化させるので、一種の遅延手段として機能する。従って、ノードS1はループエンド信号がハイレベルとなってから1クロックCK分遅れてハイレベルとなり、ノードS2はループエンド信号がハイレベルとなってから2クロックCK分遅れてハイレベルとなる。すなわち、BRCR制御信号は、ループエンド信号がハイレベルとなってから2クロックCK分遅れて活性化状態(ハイレベル)となる。
【0068】
上述のように、BRCR制御信号はループエンド信号がハイレベルとなってから2クロックCK分遅れて活性化状態になるので、パイプラインの遅延が2段の場合には、ボトムアドレスの命令が実行されてからレジスタ86の内容、すなわち繰り返し回数がデクリメントされる。従って、信号PC=ENDが活性化状態となり、ボトムアドレスの命令がフェッチされているときに割り込みが発生してパイプラインフラッシュ信号が活性化状態(ハイレベル)となると、フリップフロップ706,708がクリアされ、たとえボトムアドレスの命令が実行されずに割り込み処理となってもレジスタ86の内容、すなわち繰り返し回数はデクリメントされない。従って、ボトムアドレスの命令を実行していないにも拘らず、繰り返し回数がデクリメントされることがないので、ボトムアドレス近傍の命令に対して割り込み禁止を設定する必要がない。
【0069】
AND回路700,702,704,712とNOR回路710はループエンド処理、すなわちプログラムカウンタ72にトップアドレスが入力される処理を禁止するループエンド処理禁止回路として機能する。ゼロ検出回路70においてはループエンド信号の活性化から2クロックCK分遅れてBRCR信号が活性化されるので、ブロックサイズが2以下、すなわちトップアドレスとボトムアドレスとの差が1以下のときにはレジスタ86に記憶されている繰り返し回数がデクリメントされる前に比較回路74から活性化された次の信号PC=ENDが出力されてしまう場合がある。従って、ブロックサイズが2以下であって繰り返し回数が2以下である場合には、繰り返し回数のデクリメントに先立ってループエンド処理がなされ、結果として繰り返し回数よりも多くブロックリピート処理がなされてしまう。
【0070】
そこで、ブロックサイズが2以下のときに繰り返し回数が2以下になった場合には、前回の信号PC=ENDの活性化に基づくレジスタ86のデクリメント、すなわち信号BRCRの活性化がなされるまでは新たなループエンド処理を禁止している。ブロックサイズはノードS1,S2のハイレベルの組み合わせと繰り返し回数とで識別することができる。従って、レジスタ86に記憶されている繰り返し回数が2のときには、ノードS1およびS2のハイレベルのAND信号(AND回路704の出力)と繰り返し回数が2であることを示すハイレベルの信号(信号BRCR2)とのAND信号(AND回路702の出力)でループエンド処理を禁止している。また、レジスタ86に記憶されている繰り返し回数が1のときには、ノードS2のハイレベルの信号と繰り返し回数が1であることを示すハイレベルの信号(信号BRCR1)とのAND信号(AND回路700の出力)でループエンド処理を禁止している。尚、繰り返し回数が0のときには、繰り返し回数が0であることを示す信号のみでループエンド処理を禁止している。また、この繰り返し回数が0であることを示すハイレベルの信号はブロックリピート禁止信号としても機能しており、この信号の活性化(ハイレベル)によりアドレス生成回路9はブロックリピートアクセス動作を終了する。
【0071】
図8はゼロ検出回路70の変形例の要部の構成を示す図である。このゼロ検出回路740はパイプラインの遅延が3段の場合の例である。
デコーダ回路742はレジスタ86から出力される繰り返し回数(信号BRCR)を入力し、その値に応じて信号d0,d1,d2,d3を制御する。信号d0は繰り返し回数が0のときにハイレベルとなり、信号d1は繰り返し回数の1のときにハイレベルとなり、信号d2は繰り返し回数が2のときにハイレベルとなり、信号d3は繰り返し回数が3のときにハイレベルとなる。信号d0はNOR回路752の第1の入力端子に入力されると共にブロックリピート禁止信号として機能し、信号d1はAND回路746の一方の入力端子に入力され、信号d2はAND回路748の一方の入力端子に入力され、信号d3はAND回路750の一方の入力端子に入力される。
【0072】
フリップフロップ758,760,762のクロック端子にはパイプライン(CPU)の動作クロックであるクロックCKが入力され、クリア端子には割り込みを示すパイプラインフラッシュ信号が入力されている。フリップフロップ758の入力端子DはAND回路754の出力端子に接続されており、出力端子Qはフリップフロップ760の入力端子DとAND回路756の第1の入力端子に接続されている。フリップフロップ760の出力端子Qは、フリップフロップ762の入力端子DとAND回路756第2の入力端子とAND回路748の他方の入力端子に接続されている。フリップフロップ762の出力端子Qは、AND回路756の第3の出力端子とAND回路746の他方の出力端子に接続されている。
【0073】
AND回路756の出力端子はAND回路750の他方の入力端子に接続されている。AND回路746,748,750の出力端子はNOR回路752の第2、第3、および第4の入力端子にそれぞれ接続されている。NOR回路752の出力はAND回路754の一方の入力端子に接続されている。AND回路754の他方の入力端子には、信号PC=ENDが入力される。
ここで、AND回路754の出力信号はループエンド処理信号として機能し、フリップフロップ762の出力信号QはBRCR制御信号として機能する。
【0074】
以下に、このゼロ検出回路740の動作について説明する。繰り返し回数が4以上の場合には、NOR回路752の出力がハイレベルとなるので、信号PC=ENDが活性化状態(ハイレベル)になるとループエンド信号が活性化状態(ハイレベル)となり、ループエンド処理が実行される。また、このループエンド信号から3クロックCK分遅延してBRCR制御信号が活性化状態(ハイレベル)となり、レジスタ86のデクリメントが実行される。
【0075】
ゼロ検出回路740においてはループエンド信号の活性化から3クロックCK分遅れてBRCR制御信号が活性化されるので、ブロックサイズが3以下、すなわちトップアドレスとボトムアドレスとの差が2以下のときにはレジスタ86に記憶されている繰り返し回数がデクリメントされる前に活性化された次の信号PC=ENDが入力されてしまう場合がある。従って、ブロックサイズが3以下であって繰り返し回数が3以下である場合には、繰り返し回数のデクリメントに先立ってループエンド処理がなされ、結果として繰り返し回数よりも多くブロックリピート処理がなされてしまう。
そこで、このゼロ検出回路740では、デコーダ回路742、AND回路746,748,750,754,756、およびNOR回路752でループエンド処理禁止回路を構成し、上述のような繰り返し回数よりもブロックリピート処理が多くなるという不具合を防止している。
【0076】
ブロックサイズはノードS1,S2,S3のハイレベルの組み合わせと繰り返し回数とで識別することができる。従って、レジスタ86に記憶されている繰り返し回数が3のときには、ノードS1、S2、およびS3のハイレベルのAND信号(AND回路756の出力)と繰り返し回数が3であることを示すハイレベルの信号d3とのAND信号(AND回路750の出力)でループエンド処理を禁止している。また、レジスタ86に記憶されている繰り返し回数が2のときには、ノードS2のハイレベルの信号と繰り返し回数が2であることを示すハイレベルの信号d2とのAND信号(AND回路748の出力)でループエンド処理を禁止している。また、レジスタ86に記憶されている繰り返し回数が1のときには、ノードS3のハイレベルの信号と繰り返し回数が1であることを示すハイレベル信号d1とのAND信号(AND回路746の出力)でループエンド処理を禁止している。尚、繰り返し回数が0のときには、繰り返し回数が0であることを示すハイレベルの信号d0のみでループエンド処理を禁止している。また、この繰り返し回数が0であることを示すハイレベルの信号d0はブロックリピート禁止信号としても機能しており、この信号の活性化(ハイレベル)によりアドレス生成回路9はブロックリピートアクセス動作を終了する。
【0077】
本発明のアドレス生成回路7によれば、ブロックリピートアドレッシングにおけるブロックサイズを何等制限する必要がないので、たとえば1つの命令を繰り返す処理の実行時間を削減することができる。
また、上述した実施例では、レジスタ86からゼロ検出回路70に繰り返し回数が入力されているが、デクリメント回路84からゼロ検出回路70に直接に繰り返し回数を入力する構成としてもよい。
また、インクリメント回路82、デクリメント回路84における加算、減算は1以外の数値であってもよい。
更には、上述したアドレス生成回路7はパイプラインの遅延が2段および3段である場合の回路であるが、ゼロ検出回路を適宜に変更することにより、パイプラインの遅延の段数が4またはそれ以上であるものにも本発明を適用できることは当業者には明らかであろう。
【0078】
【発明の効果】
以上に述べたように、本発明のブロックリピートアドレッシング用アドレス生成回路において、パイプラインの遅延の段数により生じるブロックサイズの制限、あるいはプログラム作成上の制限を解消することができる。
【図面の簡単な説明】
【図1】図1は本発明の第1実施例のアドレス生成回路30の構成を示す図である。
【図2】図2は本発明の第2実施例のアドレス生成回路40の構成を示す図である。
【図3】図3は部分加算回路406と部分加算回路408とで構成される3入力の全加算回路の要部を示す図である。
【図4】図4は本発明の第3実施例のアドレス生成回路60の構成を示す図である。
【図5】図5は本発明の第3実施例のアドレス生成回路60の動作周期を説明する図である。
【図6】図6は本発明の第4実施例のアドレス生成回路7の構成を示す図である。
【図7】図7はゼロ検出回路70の要部の構成を示す図である。
【図8】図8はゼロ検出回路70の変形例の要部の構成を示す図である。
【図9】図9はサーキュラアドレッシングにおけるアドレス生成の概略を説明する図である。
【図10】図10はインデックス生成処理のアルゴリズムを示すフローチャートである。
【図11】図11はブロックリピートアドレッシングにおける従来のアドレス生成回路9の構成を示す図である。
【符合の説明】
7,30,40,60・・・アドレス生成回路、70・・・ゼロ検出回路、72・・・プログラムカウンタ、74・・・比較回路、76,80,86・・・レジスタ、78・・・セレクタ、82・・・インクリメント回路、84・・・デクリメント回路、300,306,400,402,600,602・・・加減制御回路、302,310,414・・・加算回路、304,404,604・・・ビット分離回路、312・・・マルチプレクサ、314,414,614・・・ビット多重回路、308,410,612・・・キャリーチェック回路、406,408,608,610・・・部分加算回路、412,604・・・ゲート回路、420・・・全加算回路
[0001]
[Industrial applications]
The present invention relates to an address generation circuit for generating an address for a predetermined storage area on a memory.
In particular, the present invention relates to an address circuit for block repeat addressing.
[0002]
[Prior art]
For example, when a digital signal processor (DSP) or the like performs a correlation calculation or a filtering operation on a sampled signal, it may be necessary to access data stored in a predetermined storage area many times. A storage area in which such data is stored is called, for example, a circular block (annular block).
The area of the circular block is represented by the head address (top address) of the circular block (smallest numerical value) and a numerical value (block size) indicating the capacity of the circular block. When the top address is added to the numerical value obtained by subtracting 1 from the block size, the end (highest numerical value) address (bottom address) at the end of the circular block is obtained.
Access to the circular block is performed for each step value, and a value obtained by adding a step value having a positive or negative value to the current address is the address to be accessed next. That is, the address (pointer) to be accessed next is obtained by adding the step value to the current address.
[0003]
Hereinafter, conventional address generation in circular addressing, which is access to a circular block, will be described.
First, the case where the step is a positive number and access is performed in the direction from the top address to the bottom address will be described. First, a step is added to the current address to obtain a first numerical value. The first numerical value is the next address. To determine whether the first numerical value is larger than the bottom address, the bottom address is subtracted from the first numerical value. If the result of the subtraction is not negative, the block size is subtracted from the first numerical value to obtain a second numerical value, and this second numerical value is used as the next address in the circular addressing. On the other hand, if the result of subtracting the bottom address from the first numerical value is negative, the first numerical value is used as the next address in the circular addressing.
[0004]
Next, the case where the step is a negative number and the access is performed in the direction from the bottom address to the top address will be described. First, as in the case where the step is a positive number, the first address is obtained by adding the step to the current address. The first numerical value becomes the next address. To determine whether the first numerical value is smaller than the top address, the top address is subtracted from the first numerical value. If the result of this subtraction is negative, a second numerical value is obtained by adding the block size to the first numerical value, and this second numerical value is used as the next address in circular addressing. On the other hand, if the result of subtracting the top address from the first numerical value is 0 or positive, the first numerical value is set as the next address in the circular addressing.
By the method described above, an address in circular addressing from the top address to the bottom address or from the bottom address to the top address is generated.
[0005]
On the other hand, the program stored in the predetermined storage area may need to be repeatedly executed a predetermined number of times. When such a predetermined storage area is accessed (block repeat access), an addressing method called block repeat addressing may be employed. Hereinafter, the block repeat addressing will be described with reference to FIG.
FIG. 11 is a diagram showing a configuration of a conventional address generation circuit 9 in block repeat addressing.
As shown in FIG. 11, the address generation circuit 9 includes a program counter (PC) 900, comparison circuits 902 and 916, a register (END) 904, a selector 906, a register (START) 908, an increment circuit 910, a decrement circuit 912, and A register (BRCR) 914 is provided.
First, before performing block repeat, the bottom address (end address) of the program to be repeatedly executed is set in the register 904, the top address (start address) of the program is set in the register 908, and the number of repetitions is initially set in the register 914. Set as a value.
[0006]
When the block repeat access is started, an address is generated from the program counter 900 every operation cycle. This address is supplied to a memory (not shown) and an increment circuit 910, and is also output to a comparison circuit 902. The increment circuit 910 adds (increments) 1 to the input address and outputs the result to the selector 906.
The comparison circuit 902 compares the address output from the program counter 900 with the bottom address stored in the register 904, and detects a match between them. When the comparison circuit 902 does not detect a match between the address of the program counter 900 and the bottom address, the signal PC = END is in an inactive state (low level), and the selector 906 selects the input I0 side to select the program counter. Output to 900. That is, when the address in the operation cycle does not match the bottom address, the address in the operation cycle is incremented and output from the program counter 900 as the address in the next operation cycle.
[0007]
When the comparison circuit 902 detects a match between the address output by the program counter 900 and the bottom address, the signal PC = END is activated (high level), and the selector 906 selects the input I1 side to select the program counter 900. Output to That is, when the address reaches the bottom address, the top address is output from the program counter 900 as an address in the next operation cycle.
Further, when the signal PC = END is activated, the register 914 decrements the repetition count by one by the decrement circuit 912, stores the decremented value, and outputs the decremented value to the comparison circuit 916. That is, each time a series of generation of addresses for executing the entire area of the block repeat program in the direction from the top address to the bottom address is completed once, the number of repetitions stored in the register 914 is decremented.
[0008]
When the above operation is repeated a predetermined number of times, the value of the register 914 becomes 0. The comparison circuit 916 compares the number of repetitions stored in the register 914 with 0, and when they match, sets the inhibition signal to the activated state (high level). When the prohibition signal is activated, the address generation circuit 9 ends the block repeat access operation.
[0009]
[Problems to be solved by the invention]
In the conventional address generation in the circular addressing, as described above, the next address is generated by three operation processes (addition or subtraction), so that the address generation circuit requires three operation units. Specifically, the conventional address generation circuit requires three adders. Since the adder is generally hardware having a relatively large circuit scale, the conventional address generation circuit including three adders having a large circuit scale has a problem that the area occupied by the semiconductor chip is large.
In addition, there is a problem that it is necessary to store a step, a top address, and a bottom address for calculating the address generation.
[0010]
Also, when an address generation circuit for performing conventional block repeat addressing is used in an arithmetic processing unit (CPU) having a multi-stage pipeline mechanism, it is necessary to limit the size of the block repeat according to the number of stages of the pipeline mechanism. There's a problem.
That is, the number of repetitions of the address generation circuit is decremented when the CPU fetches the instruction of the bottom address into the pipeline mechanism by block repeat addressing. When returning from step 2, the contents of the register storing the number of repetitions have already been decremented, despite the fact that there is an instruction that has not been executed (the instruction at the bottom address), This indicates that it has been completed. Therefore, it is necessary to prohibit an interrupt for an instruction that is the number of stages in the pipeline from the bottom address, and accordingly, the size of the block repeat (the number obtained by adding 1 to the difference between the bottom address and the top address) is piped. It is necessary to limit the number of lines to one or more.
[0011]
SUMMARY OF THE INVENTION It is an object of the present invention to overcome the above-mentioned problems of the prior art and to overcome the problem of the address circuit for block repeat addressing, to limit the size of block repeat by the number of stages of the CPU pipeline mechanism, and An object of the present invention is to provide a block repeat addressing address generation circuit which does not cause restrictions on program creation such as prohibition of interruption of an instruction near an address.
[0012]
[Means for Solving the Problems]
According to the present invention, there is provided an address generation circuit for generating an address for block repeat addressing in a processor having a multi-stage pipeline mechanism,
A first storage circuit for storing a start address, a second storage circuit for storing an end address equal to or larger than the start address, a program counter for storing an instruction address, and a loop end control signal. When the loop counter is inactive, the incremented address is supplied to the program counter in response to the clock signal, and when the loop end control signal is in an active state, the start address output from the first storage circuit is converted to the start address. A selection circuit for supplying a program counter, a comparator connected to the program counter and the second storage circuit for activating a coincidence signal when the instruction address and the end address are equal, and storing a repeat value , Activation of the repetition value control signal A third storage circuit in which the repetition value is decremented in response, a match signal from the comparator and a repetition value from the third storage circuit, and the loop end in response to the match signal A control circuit for supplying a control signal to the selection circuit, and supplying the repetition value control signal to the third storage circuit in response to the coincidence signal, the control circuit comprising: An address generation circuit is provided which activates the repetition value control signal by delaying the activation by a predetermined number of cycles corresponding to the number of stages or the depth of the pipeline of the processor.
[0013]
Preferably, the control circuit performs the activation processing of the loop end control signal in response to the new coincidence signal after the activation processing of the repeat value control signal in response to the immediately preceding coincidence signal.
Further preferably, the control circuit has a plurality of serially connected flip-flops corresponding to the predetermined number of the predetermined number of cycles of the clock signal, and the loop is connected to an input terminal of the first-stage flip-flop. An end control signal is supplied, the repetition value control signal is supplied from an output terminal of the last flip-flop, and a signal indicating an interrupt of the processor is supplied to clear terminals of the plurality of flip-flops.
[0014]
【Example】
The outline of address generation in the circular addressing according to the present invention will be described with reference to FIG. In the conventional address generation, the next address is directly obtained, but in the present invention, the next address is relatively obtained. In the following description, it is assumed that the address and the block size are 32-bit binary numbers. In FIG. 9, ARn is the current address, BK is the block size, EB1 is the top address of the circular block, EB2 is the bottom address of the circular block, Index is the index at the current address, and Index 'is the index at the next address. ARn 'is the next address in circular addressing, and 14 is an index generation circuit.
[0015]
(1) The most significant bit having 1 in the block size BK is detected. In FIG. 9, bit N is the most significant bit where 1 exists.
(2) Next, the values of bits 31 to 0 of the top address EB1 are obtained from the values of bits 31 to (N + 1) and bits N to 0 of the current address ARn, and The values of bits 31 to 0 of the bottom address EB2 are obtained from the values of bits 31 to (N + 1) of ARn and the values of bits N to bit 0 of the block size BK.
(3) Next, an index Index to be incremented or decremented for each step value in circular addressing is obtained. The values of bits 31 to 0 of the index Index are obtained from the values of all bits 31 to (N + 1) of 0 and the values of bits N to 0 of the current address ARn.
(4) Next, a new index Index 'is obtained by adding a step value to the index Index. Here, when the value obtained by adding the step value to the index Index is equal to or larger than the block size BK, a value obtained by subtracting the block size BK from the added value is set as a new index Index ′, and the added value becomes negative. In this case, a value obtained by adding the block size BK to the added value is used as a new index Index '.
(5) Next, the values of bits 31 to 0 of the new address ARn 'are obtained from the values of bits 31 to (N + 1) of the address ARn and the value of the new index Index' (bit N to bit 0).
Hereinafter, by repeating the above steps (3) to (5), address generation in circular addressing is realized. The Index 'is generated by the index generation logic 14.
[0016]
Next, details of the index generation in the circular addressing will be described with reference to FIG.
FIG. 10 is a flowchart showing the algorithm of the index generation process. In FIG. 10, i indicates a work variable, BKmask [a: b] indicates a value from bit a to bit b of a work numerical value BKmask, and BKmask [c] indicates a value of bit c of BKmask. , BK [a: b] indicate the values from bit a to bit b of the block size, BK [c] indicates the value of bit c of the block size, and ARn [a: b] indicates the bit of the address (pointer). The value from a to bit b is shown, Index shows the value of the index, Step shows the numerical value to be increased or decreased by the index, and Index 'shows the index newly generated by the index generation processing.
[0017]
In the process 101 (S101), 31 is substituted for i.
In process 102 (S102), it is determined whether the value of i is negative. If the value of i is 0 or more, the process proceeds to S503, and if the value of i is negative, the process of S105. Proceed to.
In the process 103 (S103), the logical sum of the value of BK [i] and the value of BKmask [i + 1] is calculated, and the result is substituted into BKmask [i]. Here, when i = 31, BK [31] is substituted for BKmask [31].
In the process 104 (S104), 1 is subtracted from i (i is decremented).
Through this series of processing, the most significant bit having 1 in the block size BK is detected. When the bit N of the block size BK is the most significant bit as shown in FIG. The value of the bit N + 1 is all 0, and the values of the bits N to 0 are all 1.
[0018]
In processing 105 (S105), the logical product of the value of ARn [31: 0] and the value of BKmask [31: 0] is calculated, and the result is substituted for Index. Here, in the case of FIG. 9, the values of bits 31 to (N + 1) of the Index are all 0, and Index [N: 0] is a value equal to ARn [N: 0].
In step 106 (S106), it is determined whether or not the value of Step is negative. If the value of Step is negative, that is, if circular addressing is performed from the bottom address to the top address, the process proceeds to S107. If the value of Step is 0 or more, that is, if circular addressing is performed in the direction from the top address to the bottom address, the process proceeds to S110.
[0019]
In step 107 (S107), it is determined whether the sum of the value of Index and the value of Step is negative. If the sum of the value of Index and the value of Step is negative, that is, the next address If the value of the index is outside the range of the top address and the bottom address, the process proceeds to S108, and if the sum of the value of the index and the value of the step is 0 or more, that is, the value of the next address is If it is within the range of the bottom address, the process proceeds to S109.
In processing 108 (S108), the value of Index, the value of Step, and the value of BK are added to generate a new Index '.
In processing 109 (S109), the value of Index and the value of Step are added to generate a new Index '.
[0020]
In processing 110 (S110), the sum of the value of Index and the value of Step is subtracted from the value of BK, and it is determined whether or not the result of the calculation is negative. If the operation result is negative, that is, if the value of the next address is within the range of the top address and the bottom address, the process proceeds to S111, and the operation result is 0 or more, that is, the next address If the value is out of the range between the top address and the bottom address, the process proceeds to S112.
In the process 111 (S111), the value of Index and the value of Step are added to generate a new Index '.
In the process 112 (S112), a new Index 'is generated by subtracting the sum of the value of Index and the value of Step from the value of BK.
[0021]
A new index Index ′ is generated by the above series of processing, and as shown in FIG. 9, from the values of bits 31 to (N + 1) of the address ARn and the values of bits N to bit 0 of the new index Index ′, , The values of bits 31 to 0 of the new address ARn ′ are generated.
The index after the generation of the BKmask is generated by executing the processing of S105 and subsequent steps.
[0022]
Hereinafter, the address generation circuit 30 for circular addressing of the present invention will be described with reference to FIG. It is assumed that the number of bits of each arithmetic unit of the present embodiment is 32 bits. It is assumed that a negative number is expressed in the form of a power of two.
FIG. 1 is a diagram showing a configuration of an address generation circuit 30 according to a first embodiment of the present invention. The adjustment control circuit 300 enters the first operation mode or the second operation mode in accordance with the adjustment control signal (A / S). In the first operation mode in which the addition / subtraction control signal (A / S) is an addition command, the step input to the input terminal Step is output to the input terminal A of the addition circuit 302 as it is. At this time, no carry is output to the input terminal C of the adder circuit 302, and its value is 0. On the other hand, in the second operation mode in which the addition / subtraction control signal (A / S) is a subtraction command, a value obtained by inverting each bit of the step input to the input terminal Step is calculated and input to the input terminal A of the addition circuit 302. At the same time, the carry (1) is output to the input terminal C of the adder circuit 302. Note that two signals output to the input terminal A and the input terminal C of the addition circuit 302 constitute a step value.
As is clear from the above description, when the sign of the step input to the input terminal Step is converted by the addition / subtraction control circuit 300 by the addition / subtraction control signal (A / S), the conversion is performed in the two's complement format. Become.
[0023]
The addition / subtraction control circuit 306 enters the first operation mode or the second operation mode according to the value of the most significant bit (MSB) of the step value output to the input terminal A of the addition circuit 302. When the MSB is 0, that is, when the step value is positive and the circular addressing is performed in the direction from the top address to the bottom address of the circular block, the second operation mode is set, and each bit of the block size input from the input terminal BK is set. Is calculated and output to the input terminal B of the addition circuit 310, and carry (1) is output to the input terminal C of the addition circuit 310. On the other hand, when the MSB is 1, that is, the step value is negative, and the circular addressing is performed in the direction from the bottom address to the top address, the first operation mode is set, and the block size input from the input terminal BK is directly added to the addition circuit. It outputs to the input terminal B of 310. At this time, no carry is output to the input terminal C of the addition circuit 310, and its value is 0.
[0024]
The bit separation circuit 304 separates an address (pointer) input from the input terminal ARn into an upper bit portion and a lower bit portion based on BKmask, and separates the input terminal of the bit multiplexing circuit 314 and the input terminal of the addition circuit 302, respectively. Output to B. Note that BKmask is a numerical value generated in processing 101 to processing 104 shown in FIG. 10, the values of bits 31 to (N + 1) are all 0, and the values of bits N to 0 are all 1. The values of bits 31 to (N + 1) of the data output to the input terminal B of the addition circuit 302 are all 0, and the values of bits N to 0 are bits N to 0 of the address input to the bit separation circuit 304. And the data output to the input terminal B of the adding circuit 302 is substantially the index described with reference to FIG. On the other hand, the values of bits 31 to (N + 1) of the data output to bit multiplexing circuit 314 are the same as the values of bits 31 to (N + 1) of the address input to bit separation circuit 304.
[0025]
The addition circuit 302 performs a full addition operation of the index and the step value input to the input terminals A, B, and C, and outputs the full addition operation result (signal ADD2) to the input terminal A of the addition circuit 310 and the input of the multiplexer 312. The signal is output to the terminal I 1, and the carry-out signal (Carry 2) is output to the carry check circuit 308.
The addition circuit 310 performs a full addition operation on the signal ADD2 input to the input terminals A, B, and C, the block size or block size in which each bit is inverted, and the carry signal (1 or 0). The calculation result (signal ADD3) is output to the input terminal I2 of the multiplexer 312, and the carry-out signal (Carry3) is output to the carry check circuit 308.
[0026]
The multiplexer 312 selects one of the signals ADD2 and ADD3 input to the input terminals I1 and I2 in accordance with the control signal SEL output from the carry check circuit 308, and selects the bit multiplexing circuit 314 as a new index (Index '). Output to
The bit multiplexing circuit 314 multiplexes the upper bit portion of the data output from the bit separation circuit 304 and the lower bit portion of the new index output from the multiplexer 312 based on the BKmask, and performs the multiplexing. The output data is output to the output terminal ARn 'as a new address. The value of bit 31 to bit (N + 1) of the new address is the same as the value of bit 31 to bit (N + 1) of the address input to the input terminal ARn, and the value of bit N to bit 0 of the new address is a multiplexer. It is the same as the value of bit N to bit 0 of the new index output from 312.
[0027]
The carry check circuit 308 outputs the most significant bit (MSB) of the step value output to the input terminal A of the addition circuit 302, the carry-out signal (Carry 2) of the addition circuit 302, and the carry-out signal (Carry 3) of the addition circuit 310. The corresponding control signal SEL is output to the multiplexer 312. When the MSB is 1 and the step value is negative, that is, when the circular addressing is performed in the direction from the bottom address to the top address, only the carry-out signal of the adding circuit 302 is monitored, and the carry is output. That is, when the carry-out signal (Carry2) is 1, the multiplexer 312 controls so as to select the signal ADD2. When no carry is output, that is, when the carry-out signal (Carry2) is 0, the multiplexer 312 selects the signal ADD3. Control. On the other hand, when the MSB is 0 and the step value is positive, that is, when the circular addressing is performed in the direction from the top address to the bottom address, the carry-out signals of the addition circuits 302 and 310 are monitored. When a carry is output from one of the adders, the multiplexer 312 controls to select the signal ADD3, and when no carry is output from any of the adders, the multiplexer 312 controls to select the signal ADD2.
[0028]
Hereinafter, the operation of the address generation circuit 30 when the step value output to the addition circuit 302 is positive and circular addressing is performed in the direction from the top address to the bottom address will be described. The addition / subtraction control circuits 300 and 306, the addition circuits 302 and 310, the multiplexer 312, and the carry check circuit 308 correspond to the index generation circuit 14 in FIG.
The addition / subtraction control circuit 300 outputs a positive step value to the addition circuit 302. In this case, the MSB of the step value output to the input terminal A of the addition circuit 302 is 0, so the carry check circuit 308 monitors both the carry-out signals of the addition circuits 302 and 310, and , Inverts each bit of the input block size and outputs it to the addition circuit 310, and outputs a carry to the addition circuit 310.
[0029]
The addition circuit 302 performs a full addition operation of the index and the step value, and the addition circuit 310 performs a full addition operation of the signal ADD2, the signal obtained by inverting each bit of the block size, and the carry signal, that is, the signal ADD2 and the block size. Is subtracted. That is, the addition circuit 302 and the addition circuit 310 perform the process of S110 in FIG. 10, and determine whether the subtraction result of the sum of the index and the step value and the block size is negative.
Accordingly, if the result of subtraction between the sum of the index and the step value and the block size is negative, that is, if the carry-out signal is not output from both the adder circuit 302 and the adder circuit 310, the multiplexer 312 sets the index to the step value. The added signal ADD2, that is, the value obtained by adding the step value to the value of bit N to bit 0 of the current address is selected and output to the bit multiplexing circuit 314. On the other hand, if the subtraction result of the sum of the index and the step and the block size is 0 or more, that is, if the carry-out signal is output from either the addition circuit 302 or the addition circuit 310, the multiplexer 312 outputs the signal ADD3. That is, the result of subtraction between the block size and the sum of the index and the step value is selected and output to the bit multiplexing circuit 314.
[0030]
The bit multiplexing circuit 314 calculates the value of the bits 31 to (N + 1) of the data output from the bit separation circuit 304, that is, the value of the bits 31 to (N + 1) of the current address and the bit of the new index output from the multiplexer 312. The value of N to bit 0 is combined and output as a new address.
Through the above series of operations, address generation in circular addressing from the top address to the bottom address is realized.
[0031]
Next, the operation of the address generation circuit 30 when the step value output to the addition circuit 302 is negative and circular addressing is performed in the direction from the bottom address to the top address will be described.
The addition / subtraction control circuit 300 outputs a negative step value to the addition circuit 302. In this case, since the MSB of the step value output to the input terminal A of the addition circuit 302 is 1, the carry check circuit 308 monitors only the carry-out signal of the addition circuit 302, and the addition / subtraction control circuit 306 determines the input block size. Is output to the addition circuit 310 as it is. At this time, no carry is output to addition circuit 310.
[0032]
The addition circuit 302 performs a full addition operation of the index and the negative step value. That is, the addition circuit 302 performs the process of S107 in FIG. 10, and determines whether the sum of the index and the step value is negative. The addition circuit 310 performs a full addition operation on the signal ADD2 and the block size.
Therefore, when the sum of the index and the step value is negative, that is, when the carry-out signal is not output from the adding circuit 302, the multiplexer 312 selects the signal ADD3 that is the sum of the index, the step value, and the block size. Output to the bit multiplexing circuit 314. On the other hand, when the sum of the index and the step value is 0 or more, that is, when the carry-out signal is output from the adding circuit 302, the multiplexer 312 outputs the signal ADD2 that is the sum of the index and the step value, that is, the current address. And a value obtained by adding a step to the value of bit N to bit 0 is selected and output to the bit multiplexing circuit 314.
[0033]
The bit multiplexing circuit 314 calculates the value of the bits 31 to (N + 1) of the data output from the bit separation circuit 304, that is, the value of the bits 31 to (N + 1) of the current address and the bit of the new index output from the multiplexer 312. The value of N to bit 0 is combined and output as a new address.
Through the above series of operations, address generation in circular addressing from the bottom address to the top address is realized.
[0034]
Hereinafter, the circular addressing address generation circuit 40 of the present invention will be described with reference to FIG. It is assumed that the number of bits of each arithmetic unit of this embodiment is also a 32-bit configuration.
FIG. 2 is a diagram showing a configuration of an address generation circuit 40 according to a second embodiment of the present invention. The addition / subtraction control circuit 400 has the same function as the addition / subtraction control circuit 300 shown in FIG. 1, and takes the first operation mode or the second operation mode according to the addition / subtraction control signal (A / S). In the first operation mode in which the addition / subtraction control signal (A / S) is an addition command, the step input to the input terminal Step is output to the input terminal I1 of the partial addition circuit 406 as it is. At this time, no carry is output to the input terminal C1 of the partial addition circuit 408. On the other hand, in the second operation mode in which the addition / subtraction control signal (A / S) is a subtraction command, a value obtained by inverting each bit of the step input to the input terminal Step is calculated, and the input terminal I1 of the partial addition circuit 406 is calculated. And a carry is output to the input terminal C1 of the partial addition circuit 408. Note that the input terminal I1 of the partial addition circuit 406 and the signal output to the input terminal C1 of the partial addition circuit 408 constitute a step value.
[0035]
The addition / subtraction control circuit 402 is controlled by the most significant bit (MSB) of the step value output to the input terminal I1 of the partial addition circuit 406. When the MSB is 0 and circular addressing is performed in the direction from the top address to the bottom address of the circular block, a value obtained by inverting each bit of the block size input from the input terminal BK is calculated, and the partial addition circuit 406 is obtained. And the carry is output to the input terminal C2 of the partial addition circuit 408. On the other hand, when the MSB is 1 and circular addressing is performed in the direction from the bottom address to the top address, 0 data is output to the input terminal I2 of the partial addition circuit 406, and the data is input to the input terminal C2 of the partial addition circuit 408. Do not output carry.
[0036]
Gate circuit 412 outputs 0 data to input terminal B of adder circuit 414 or adds the block size input to input terminal BK to adder circuit 414 according to the control signal (SEL1) output from carry check circuit 410. Output to the input terminal B is selected.
[0037]
The bit separation circuit 404 has the same function as the bit separation circuit 304 shown in FIG. 1, and separates an address input from the input terminal ARn into an upper bit portion and a lower bit portion based on BKmask. Then, the signals are output to the input terminals I3 of the bit multiplexing circuit 416 and the partial addition circuit 406, respectively.
The bit multiplexing circuit 416 has the same function as the bit multiplexing circuit 314 shown in FIG. 1, and outputs the higher-order bit portion of the data output from the bit separation circuit 404 and the output from the addition circuit 414 based on the BKmask. It multiplexes the lower bit portion of the data (signal ADD3) and outputs the multiplexed data to the output terminal ARn 'as a new address.
[0038]
BKmask, data output to the input terminal I3 of the partial addition circuit 406, data output to the bit multiplexing circuit 416 from the bit separation circuit 404, data output from the addition circuit 414, and output from the bit multiplexing circuit 416 The data has the same data format as that described in FIG.
The data output to the input terminal I3 of the partial addition circuit 406 is Index, and the data output from the addition circuit 414 is Index '.
[0039]
The partial addition circuit 406 and the partial addition circuit 408 constitute a three-input full addition circuit 420, and the full addition circuit 420 has a configuration shown in FIG. The full addition circuit 420 performs a full addition operation on the step values input to the input terminals I1, I2, I3, C1, and C2, the block size or 0 in which each bit is inverted, the index, and the carry signal (C2). , And outputs the result of the full addition operation (signal ADD2) to the input terminal A of the addition circuit 414, and outputs two carry-out signals (Carry2 and Carry3) to the carry check circuit 410.
The addition circuit 414 performs an addition operation of the signal ADD2 input to the input terminals A and B and the output signal of the gate circuit 412, and uses the addition operation result (signal ADD3) as a new index (Index '). Output to the multiplexing circuit 416.
[0040]
Carry check circuit 410 transmits to gate circuit 412 the most significant bit (MSB) of the step value output to full adder circuit 420 and a control signal (SEL1) corresponding to the two carry-out signals output by full adder circuit 420. Output. If the MSB is 1, that is, if the circular addressing is performed in the direction from the bottom address to the top address, both carry-out signals (Carry2 and Carry3) are monitored and a carry is output, that is, any one of them is output. When one carry-out signal is 1, the gate circuit 412 controls to output 0, and when no carry is output, that is, when both carry-out signals are 0, the gate circuit 412 outputs the block size. To control. On the other hand, when the MSB is 0, that is, when the circular addressing is performed in the direction from the top address to the bottom address, two carry-out signals (Carry2, Carry3) are monitored, and one of the carry-out signals is 1 If so, the gate circuit 412 controls to output 0, and if both carry-out signals are 0, the gate circuit 412 controls to output the block size.
[0041]
FIG. 3 is a diagram showing a main part of a three-input full adder circuit 420 composed of a partial adder circuit 406 and a partial adder circuit 408. The partial addition circuit 406 performs an addition operation on bits 31 to 0 of each signal input to the input terminals I1, I2, and I3 to generate a carry-out signal (Carry2). The partial addition circuit 408 performs an addition operation on the addition operation result of the partial addition circuit 406 and two carry signals (C1, C2) output from the addition / subtraction control circuits 400 and 401, respectively, to obtain a full addition operation result (bits 31 to 31). Bit 0) and a carry-out signal (Carry 3).
[0042]
Hereinafter, the operation of the address generation circuit 40 when the step value output to the full addition circuit 420 is a positive number and circular addressing is performed in the direction from the top address to the bottom address will be described. The addition / subtraction control circuits 400 and 402, the gate circuit 412, the partial addition circuits 406 and 408, the addition circuit 414, and the carry check circuit 410 correspond to the index generation circuit 14 in FIG.
The addition / subtraction control circuit 400 outputs a positive step value to the full addition circuit 420. In this case, the MSB of the step value output to full adder 420 is 0, so carry check circuit 410 monitors both carry-out signals output from full adder 420. The addition / subtraction control circuit 401 inverts each bit of the input block size, outputs the inverted bit to the full adder circuit 420, and outputs a carry to the full adder circuit 420.
[0043]
The full addition circuit 420 performs a full addition operation of the signal obtained by inverting each bit of the step value, the index, and the block size and the carry signal output from the addition / subtraction control circuit 401, that is, the sum of the index and the step value, the block size, Is performed. The full addition circuit 420 performs the process of S110 in FIG. 10 and determines whether the result of subtraction of the sum of the index and the step value and the block size is negative.
Therefore, when the result of subtraction between the sum of the index and the step value and the block size is negative, that is, when the carry-out signal is not output from the full addition circuit 420, the gate circuit 412 determines the input block size as it is by the addition circuit 414. Output to The addition circuit 414 performs an addition operation on the signal ADD2 output from the full addition circuit 420 and the block size output from the gate circuit 412, and outputs a signal obtained by adding a step value to the index, that is, bits N to A value obtained by adding the step value to the value of bit 0 is calculated and output to bit multiplexing circuit 416. On the other hand, when the result of subtraction between the sum of the index and the step value and the block size is 0 or more, that is, when the carry-out signal is output from full adder 420, gate circuit 412 outputs 0 to adder 414. . The addition circuit 414 performs an addition operation on the signals ADD2 and 0 output from the full addition circuit 420, calculates the sum of the index and the step value, and the subtraction result of the block size, and outputs the result to the bit multiplexing circuit 416.
[0044]
The bit multiplexing circuit 416 includes a value of bits 31 to (N + 1) of the data output from the bit separation circuit 404, that is, a value of bits 31 to (N + 1) of the current address, and a new index output from the addition circuit 414. , And outputs the result as a new address.
Through the above series of operations, address generation in circular addressing from the top address to the bottom address is realized.
[0045]
Next, the operation of the address generation circuit 40 when the step value output to the full addition circuit 420 is a negative number and circular addressing is performed in the direction from the bottom address to the top address will be described.
The addition / subtraction control circuit 400 outputs a negative step value to the full addition circuit 420. In this case, since the MSB of the step value output to full adder 420 is 1, carry check circuit 410 monitors both carry-out signals output from full adder 420. Further, the addition / subtraction control circuit 402 outputs 0 data to the full addition circuit 420 and does not output carry (C2) to the full addition circuit 420.
[0046]
The full addition circuit 420 performs a full addition operation of the step value, the index, and 0. The full addition circuit 420 performs the process of S107 in FIG. 10, and determines whether the sum of the index and the step value is negative.
Therefore, when the sum of the index and the step value is negative, that is, when the carry-out signal is not output from the full addition circuit 420, the gate circuit 412 outputs the input block size to the addition circuit 414 as it is. The addition circuit 414 performs an addition operation on the signal ADD2 output from the full addition circuit 420 and the block size output from the gate circuit 412, calculates the sum of the index, the step value, and the block size, and calculates the sum of the block size and the bit multiplexing circuit 416. Output to On the other hand, when the sum of the index and the step value is 0 or more, that is, when the carry-out signal is output from full adder 420, gate circuit 412 outputs 0 to adder 414. The addition circuit 414 performs an addition operation on the signals ADD2 and 0 output from the full addition circuit 420, and adds the step value to the sum of the index and the step value, that is, the value of bit N to bit 0 of the current address. The value is calculated and output to the bit multiplexing circuit 416.
[0047]
The bit multiplexing circuit 416 includes a value of bits 31 to (N + 1) of the data output from the bit separation circuit 404, that is, a value of bits 31 to (N + 1) of the current address, and a new index output from the addition circuit 414. , And outputs the result as a new address.
Through the above series of operations, address generation in circular addressing from the bottom address to the top address is realized.
[0048]
Hereinafter, the address generation circuit 60 for circular addressing of the present invention will be described with reference to FIG. It is assumed that the number of bits of each arithmetic unit of this embodiment is also a 32-bit configuration.
FIG. 4 is a diagram showing a configuration of an address generation circuit 60 according to a third embodiment of the present invention. The addition / subtraction control circuit 600 has the same function as the addition / subtraction control circuit 300 shown in FIG. 1, and takes the first operation mode or the second operation mode according to the addition / subtraction control signal (A / S). In the first operation mode in which the addition / subtraction control signal (A / S) is an addition command, the step input to the input terminal Step is output to the input terminal I1 of the partial addition circuit 608 as it is. At this time, no carry is output to the input terminal C1 of the partial addition circuit 610. On the other hand, in the second operation mode in which the addition / subtraction control signal (A / S) is a subtraction instruction, a value obtained by inverting each bit of the step input to the input terminal Step is calculated, and the input terminal I1 of the partial addition circuit 608 is calculated. And a carry to the input terminal C1 of the partial addition circuit 610. The input terminal I1 of the partial addition circuit 608 and the signal output to the input terminal C1 of the partial addition circuit 610 constitute a step value.
[0049]
The addition / subtraction control circuit 602 has a function similar to that of the addition / subtraction control circuit 306 shown in FIG. 1, and according to the most significant bit (MSB) of the step value output to the input terminal I1 of the partial addition circuit 608, the first operation mode or Take the second operation mode. When the MSB is 0 and circular addressing is performed in the direction from the top address to the bottom address of the circular block, the second operation mode is set, and a numerical value obtained by inverting each bit of the block size input from the input terminal BK is calculated. Then, the signal is output to the gate circuit 604 and a carry is output to the gate circuit 604. On the other hand, when the MSB is 1, and circular addressing is performed in the direction from the bottom address to the top address, the first operation mode is set, and the block size input from the input terminal BK is output to the gate circuit 604 as it is. At this time, no carry is output to the gate circuit 604.
The gate circuit 604 inverts the block size and carry signal (0) or each bit output from the addition / subtraction control circuit 602 according to the clock signal (CK) and the control signal (SEL1) output from the carry check circuit 612. The block size and the carry signal (1) are output as they are to the input terminal I2 of the partial addition circuit 608 and the input terminal C2 of the partial addition circuit 610, or the data of 0 and the carry signal (0) are supplied to the partial addition circuit 608. To be output to the input terminal I2 of the partial addition circuit 610 and the input terminal C2 of the partial addition circuit 610.
[0050]
The bit separation circuit 606 has the same function as the bit separation circuit 304 shown in FIG. 1, and separates an address input from the input terminal ARn into an upper bit portion and a lower bit portion based on BKmask. Then, the data is output to the input terminal I3 of the bit multiplexing circuit 614 and the partial addition circuit 608, respectively.
The bit multiplexing circuit 614 has the same function as the bit multiplexing circuit 314 shown in FIG. 1, and outputs the higher-order bit portion of the data output from the bit separation circuit 606 and the output from the partial addition circuit 610 based on BKmask. Multiplexed with the lower bit portion of the signal ADD2, and the multiplexed data is output to the output terminal ARn ′ as a new address.
[0051]
BKmask, data output to the input terminal I3 of the partial addition circuit 608, data output from the bit separation circuit 606 to the bit multiplexing circuit 614, data output from the partial addition circuit 610, and output from the bit multiplexing circuit 614 The data is in the same data format as that described in FIG.
Data output to the input terminal I3 of the partial addition circuit 608 is Index, and data output from the partial addition circuit 610 is Index '.
[0052]
The partial adder circuit 608 and the partial adder circuit 610 constitute a three-input full adder circuit 420 shown in FIG. 3 similarly to the partial adder circuit 406 and the partial adder circuit 408 shown in FIG. , I3, C1 and C2, perform a full addition operation, output the full addition operation result (signal ADD2) as a new index (Index ') to the bit multiplexing circuit 614, and perform two carry-out operations. The signal (Carry2, Carry3) is output to the carry check circuit 612.
[0053]
The carry check circuit 612 determines the first half (ph1) of the clock signal (CK) according to the most significant bit (MSB) of the step value output to the full addition circuit 420 and the two carry-out signals output by the full addition circuit 420. The gate circuit 604 is controlled by the control signal (SEL1) separately into and the latter half (ph2).
When the MSB is 1, that is, when the circular addressing is performed in the direction from the bottom address to the top address, two carry-out signals are monitored, and a gate circuit is provided in the first half (ph1) of the clock signal (CK). 604 controls so that the data of 0 and the carry signal (0) are output to the input terminal I2 of the partial addition circuit 608 and the input terminal C2 of the partial addition circuit 610. In the second half (ph2) of the clock signal, a carry is output in the first half of the clock signal. That is, when one of the carry-out signals is 1, the gate circuit 604 partially adds the data of 0 and the carry signal (0). The gate circuit 604 controls so as to output to the input terminal I2 of the circuit 608 and the input terminal C2 of the partial adder circuit 610, and no carry is output in the first half of the clock signal. Control is performed so that the block size and carry signal (0) output from the circuit 602 are output to the input terminal I2 of the partial addition circuit 608 and the input terminal C2 of the partial addition circuit 610.
[0054]
On the other hand, when the MSB is 0, that is, when the circular addressing is performed in the direction from the top address to the bottom address, two carry-out signals are monitored, and in the first half (ph1) of the clock signal (CK), The gate circuit 604 outputs the block size in which each bit output from the addition / subtraction control circuit 602 is inverted and the carry signal (1) to the input terminal I2 of the partial addition circuit 608 and the input terminal C2 of the partial addition circuit 610. To control. In the second half (ph2) of the clock signal, when one of the carry-out signals is 1 in the first half of the clock signal, the gate circuit 604 inverts the bit size output from the addition / subtraction control circuit 602 and the carry signal ( 1) is output to the input terminal I2 of the partial addition circuit 608 and the input terminal C2 of the partial addition circuit 610. When both carry-out signals are 0 in the first half of the clock signal, the gate circuit 604 outputs 0. The data and the carry signal (0) are controlled to be output to the input terminal I2 of the partial addition circuit 608 and the input terminal C2 of the partial addition circuit 610.
[0055]
Hereinafter, the operation of the address generation circuit 60 when the step value output to the full addition circuit 420 is a positive number and circular addressing is performed in the direction from the top address to the bottom address will be described. The addition / subtraction control circuits 600 and 602, the gate circuit 604, the partial addition circuits 608 and 610, and the carry check circuit 612 correspond to the index generation circuit 14 in FIG.
The addition / subtraction control circuit 600 outputs a positive step value to the full addition circuit 420. In this case, the MSB of the step value output to full adder circuit 420 is 0, so carry check circuit 612 monitors both of the two carry-out signals output from full adder circuit 420, and addition / subtraction control circuit 602 Each bit of the input block size is inverted and output to the gate circuit 604, and a carry signal (1) is output to the gate circuit 604.
In the first half (ph1) of the clock signal (CK), the gate circuit 604 outputs to the full adder circuit 420 the block size in which each bit output from the addition / subtraction control circuit 602 is inverted and the carry signal (1).
[0056]
In the first half (ph1) of the clock signal (CK), the full adder circuit 420 converts the step value, the index, the signal in which each bit of the block size is inverted, and the carry signal (1) output from the addition / subtraction control circuit 602. A full addition operation, that is, a subtraction process of the sum of the index and the step value and the block size is performed. The full addition circuit 420 performs the process of S110 in FIG. 10 and determines whether the result of subtraction of the sum of the index and the step value and the block size is negative.
Therefore, in the first half of the clock signal, if the subtraction result of the sum of the index and the step value and the block size is negative, that is, if the carry-out signal is not output from the full addition circuit 420, the gate circuit 604 outputs the clock signal. Since the data of 0 and the carry signal (0) are output to the full adder circuit 420 in the latter half, the full adder circuit 420 performs a full addition operation of the step and the index in the latter half (ph2) of the clock signal, and the step value is added to the index. Is calculated, that is, the value obtained by adding the step value to the value of bit N to bit 0 of the current address is output to the bit multiplexing circuit 614. On the other hand, in the first half of the clock signal, if the sum of the index and the step value and the subtraction result of the block size are 0 or more, that is, if the carry-out signal is output from the full addition circuit 420, the gate circuit 604 outputs the clock signal. In the latter half of the clock signal, the block size in which the value of each bit is inverted and the carry signal (1) are output to the full adder circuit 420, so that the full adder circuit 420 outputs the index, step value, and each bit of the block size in the latter half of the clock signal. , And a carry signal (1) output from the addition / subtraction control circuit 602 to perform a full addition operation to calculate a subtraction result of the sum of the index and the step value and the block size, thereby obtaining a bit multiplexing circuit 614. Output to
[0057]
The bit multiplexing circuit 614 determines the values of the bits 31 to (N + 1) of the data output from the bit separation circuit 404, that is, the values of the bits 31 to (N + 1) of the current address and the new value output from the full adder 420. The value of the index bit N to bit 0 is combined and output as a new address.
Through the above series of operations, address generation in circular addressing from the top address to the bottom address is realized.
[0058]
Next, the operation of the address generation circuit 40 when the step value output to the full addition circuit 420 is a negative number and circular addressing is performed in the direction from the bottom address to the top address will be described.
The addition / subtraction control circuit 600 outputs a negative step value to the full addition circuit 420. In this case, since the MSB of the data output to full adder circuit 420 is 1, carry check circuit 612 monitors the two carry-out signals output from full adder circuit 420, and add / subtract control circuit 602 outputs the input block. The size is output to the gate circuit 402 as it is. At this time, no carry is output to full adder circuit 420.
Gate circuit 604 outputs 0 data and carry signal (0) to full adder circuit 420 in the first half (ph1) of the clock signal.
[0059]
The full addition circuit 420 performs a full addition operation on the index and the step value in the first half (ph1) of the clock signal. The full addition circuit 420 performs the process of S107 in FIG. 10 and determines whether the sum of the index and the step value is negative.
Therefore, when the sum of the index and the step value is negative in the first half of the clock signal, that is, when the carry-out signal is not output from the full adder 420, the gate circuit 604 sets the full adder in the latter half (ph2) of the clock signal. Since the block size and the carry signal (0) are output to 420, the full adder 420 performs a full addition operation of the index, the step value, and the block size in the latter half of the clock signal, and outputs the operation result to the bit multiplexing circuit 614. Output. On the other hand, if the sum of the index and the step value is 0 or more in the first half of the clock signal, that is, if the carry-out signal is output from full adder circuit 420, gate circuit 604 sets full adder circuit 420 in the latter half of the clock signal. , And the carry signal (0) is output, the full addition circuit 420 performs a full addition operation of the index and the step value in the latter half of the clock signal, and a signal in which the step value is added to the index, that is, the current signal, The value obtained by adding the step value to the value of bit N to bit 0 of the address is calculated and output to bit multiplexing circuit 614.
[0060]
The bit multiplexing circuit 614 determines the values of the bits 31 to (N + 1) of the data output from the bit separation circuit 606, that is, the values of the bits 31 to (N + 1) of the current address, and the new value output from the full adder 420. The value of the index bit N to bit 0 is combined and output as a new address.
Through the above series of operations, address generation in circular addressing from the bottom address to the top address is realized.
[0061]
The circular addressing address generation circuit of the present invention described above does not directly calculate the value of the current address to obtain the next address, but indirectly uses the index, the step value, and the block size to calculate the next address. Since the address is obtained, the calculation can be performed efficiently. In the first embodiment, the number of adders is two, and the hardware is simplified. Further, in the third embodiment, the next address can be calculated in one clock cycle, so that the third embodiment is suitable for high-speed applications.
Further, according to the address generation circuit of the present invention, it is only necessary to store the step and the block size, and it is not necessary to store the top address and the bottom address.
Although the address generation circuit for circular addressing of the present invention has been described above, it will be apparent to those skilled in the art that various circuit forms can be considered based on the technical concept of the present invention shown in FIG.
[0062]
Hereinafter, an address generation circuit for block repeat addressing according to the present invention will be described with reference to FIG.
FIG. 6 is a diagram showing a configuration of the address generation circuit 7 according to the fourth embodiment of the present invention. The address generation circuit 7 includes a program counter (PC) 72, a comparison circuit 74, a register (END) 76, a selector 78, a register (START) 80, an increment circuit 82, a decrement circuit 84, a register (BRCR) 86, and a zero detection circuit. 70. This embodiment is applied to the case where the pipeline delay is two stages.
In the present embodiment, as in the conventional circuit shown in FIG. 11, the bottom address (end address) of the program to be repeatedly executed is set in the register 76 before the block repeat is performed, and the top address of the program is set in the register 80. The address (head address) is set, and the number of repetitions is set in the register 86 as an initial value.
[0063]
FIG. 7 is a diagram showing a configuration of a main part of the zero detection circuit 70. A clock CK, which is an operation clock of the pipeline (CPU), is input to clock terminals of the flip-flops 706 and 708, and a pipeline flush signal indicating an interrupt is input to a clear terminal. The input terminal D of the flip-flop 706 is connected to the output terminal of the AND circuit 712, and the output terminal Q is connected to the input terminal D of the flip-flop 708 and one input terminal of the AND circuit 704. The output terminal Q of the flip-flop 708 is connected to one input terminal of the AND circuit 700 and the other input terminal of the AND circuit 704. The signal BRCR1 is input to the other input terminal of the AND circuit 700, and its output terminal is connected to the second input terminal of the NOR circuit 710. The signal BRCR2 is input to one input terminal of the AND circuit 702, the other input terminal is connected to the output terminal of the AND circuit 704, and the output terminal is connected to the third input terminal of the NOR circuit 710. . The signal BRCR0 is input to a first input terminal of the NOR circuit 710, and its output terminal is connected to one input terminal of the AND circuit 712. The signal PC = END is input to the other input terminal of the AND circuit 712.
[0064]
The signals BRCR2, BRCR1, and BRCR0 are signals generated by decoding the number of repetitions output from the register 86, and each signal is at a high level when the number of repetitions is 2, 1, 0, respectively. The signal BRCR0 is output as it is as a block repeat prohibition signal. A loop end signal is output from the output terminal of the AND circuit 712, and a BRCR control signal is output from the output terminal Q of the flip-flop 708.
[0065]
When the block repeat access is started, an address is generated from the program counter 72 every operation cycle. This address is supplied to a memory (not shown) and an increment circuit 82, and is output to a comparison circuit 74. The increment circuit 82 adds (increments) 1 to the input address and outputs the result to the input terminal I0 of the selector 78.
The comparison circuit 74 compares the address output from the program counter 72 with the bottom address stored in the register 76, and detects a match between them. When the comparison circuit 74 does not detect a match between the address of the program counter 900 and the bottom address, the signal PC = END is in an inactive state (low level), and the comparison circuit 74 determines that the address of the program counter 72 is equal to the bottom address. Is detected, the signal PC = END is activated (high level).
[0066]
The selector 78 is controlled by a loop end signal output from the zero detection circuit 70. When the loop end signal is in an inactive state (low level), the selector 78 selects the input I0 and outputs it to the program counter 72. That is, when the address in the operation cycle does not match the bottom address, the address in the operation cycle is incremented, and the incremented address is output from the program counter 72 as the address in the next operation cycle. On the other hand, when the loop end signal is activated (high level), the selector 78 selects the input terminal I1 and outputs it to the program counter 72. That is, when the address reaches the bottom address, the top address is output from the program counter 72 as the address in the next operation cycle.
The register 86 subtracts (decrements) one from the number of repetitions stored in response to the BRCR control signal output from the zero detection circuit 70 by the decrement circuit 84, and stores the decremented value. 70.
[0067]
Next, the operation of the zero detection circuit 70 will be described. When the number of repetitions is three or more, the signals BRCR2, BRCR1, and BRCR0 are all at low level, and the output of the NOR circuit 710 is always at high level. Here, when the comparison circuit 74 sets the signal PC = END to an activated state (high level), the AND circuit 712 outputs a high-level (activated state) loop end signal. This high-level loop end signal is input to the flip-flop 706. The flip-flops 706 and 708 change the output signal after one pulse of the clock CK is input, and thus function as a kind of delay means. Accordingly, the node S1 becomes high level with a delay of one clock CK after the loop end signal becomes high level, and the node S2 becomes high level with a delay of two clocks CK after the loop end signal becomes high level. That is, the BRCR control signal is activated (high level) with a delay of two clocks CK after the loop end signal goes high.
[0068]
As described above, the BRCR control signal is activated by a delay of two clocks CK after the loop end signal becomes high level. Therefore, when the pipeline delay is two stages, the instruction of the bottom address is executed. After that, the content of the register 86, that is, the number of repetitions is decremented. Accordingly, when the signal PC = END is activated and an interrupt occurs while the instruction of the bottom address is being fetched and the pipeline flush signal is activated (high level), the flip-flops 706 and 708 are cleared. Even if the instruction at the bottom address is not executed and the interrupt processing is performed, the contents of the register 86, that is, the number of repetitions is not decremented. Therefore, even though the instruction at the bottom address is not executed, the number of repetitions is not decremented, so that it is not necessary to disable interrupts for instructions near the bottom address.
[0069]
The AND circuits 700, 702, 704, 712 and the NOR circuit 710 function as a loop end process, that is, a loop end process prohibition circuit for prohibiting the process of inputting the top address to the program counter 72. In the zero detection circuit 70, the BRCR signal is activated with a delay of two clocks CK after the activation of the loop end signal. Therefore, when the block size is 2 or less, that is, when the difference between the top address and the bottom address is 1 or less, the register 86 is activated. May be output from the comparison circuit 74 before the number of repetitions stored in the memory is decremented. Therefore, when the block size is 2 or less and the number of repetitions is 2 or less, the loop end processing is performed before the decrement of the number of repetitions, and as a result, the block repeat processing is performed more than the number of repetitions.
[0070]
Therefore, if the number of repetitions becomes 2 or less when the block size is 2 or less, the decrement of the register 86 based on the previous activation of the signal PC = END, that is, until the activation of the signal BRCR is newly performed. Loop end processing is prohibited. The block size can be identified by the combination of the high level of the nodes S1 and S2 and the number of repetitions. Therefore, when the number of repetitions stored in the register 86 is 2, a high-level AND signal (output of the AND circuit 704) of the nodes S1 and S2 and a high-level signal (signal BRCR2) indicating that the number of repetitions is 2 ) And the output of the AND circuit 702 prohibits loop end processing. When the number of repetitions stored in the register 86 is 1, an AND signal (of the AND circuit 700) of the high-level signal at the node S2 and a high-level signal (signal BRCR1) indicating that the number of repetitions is 1 is obtained. Output) prohibits loop end processing. When the number of repetitions is 0, loop end processing is prohibited only by a signal indicating that the number of repetitions is 0. The high-level signal indicating that the number of repetitions is 0 also functions as a block repeat prohibition signal, and the activation (high level) of this signal causes the address generation circuit 9 to end the block repeat access operation. .
[0071]
FIG. 8 is a diagram showing a configuration of a main part of a modification of the zero detection circuit 70. This zero detection circuit 740 is an example in a case where the delay of the pipeline is three stages.
The decoder circuit 742 receives the number of repetitions (signal BRCR) output from the register 86 and controls the signals d0, d1, d2, and d3 according to the value. The signal d0 goes high when the number of repetitions is 0, the signal d1 goes high when the number of repetitions is 1, the signal d2 goes high when the number of repetitions is 2, and the signal d3 is high when the number of repetitions is 3. Sometimes it goes high. The signal d0 is input to the first input terminal of the NOR circuit 752 and functions as a block repeat inhibition signal. The signal d1 is input to one input terminal of the AND circuit 746, and the signal d2 is input to one input terminal of the AND circuit 748. The signal d3 is input to one terminal of the AND circuit 750.
[0072]
The clock terminals of the flip-flops 758, 760, and 762 receive a clock CK as an operation clock of the pipeline (CPU), and the clear terminal receives a pipeline flush signal indicating an interrupt. The input terminal D of the flip-flop 758 is connected to the output terminal of the AND circuit 754, and the output terminal Q is connected to the input terminal D of the flip-flop 760 and the first input terminal of the AND circuit 756. The output terminal Q of the flip-flop 760 is connected to the input terminal D of the flip-flop 762, the second input terminal of the AND circuit 756, and the other input terminal of the AND circuit 748. The output terminal Q of the flip-flop 762 is connected to the third output terminal of the AND circuit 756 and the other output terminal of the AND circuit 746.
[0073]
The output terminal of the AND circuit 756 is connected to the other input terminal of the AND circuit 750. The output terminals of the AND circuits 746, 748, and 750 are connected to the second, third, and fourth input terminals of the NOR circuit 752, respectively. The output of the NOR circuit 752 is connected to one input terminal of the AND circuit 754. The signal PC = END is input to the other input terminal of the AND circuit 754.
Here, the output signal of the AND circuit 754 functions as a loop end processing signal, and the output signal Q of the flip-flop 762 functions as a BRCR control signal.
[0074]
Hereinafter, the operation of the zero detection circuit 740 will be described. When the number of repetitions is four or more, the output of the NOR circuit 752 becomes high level. Therefore, when the signal PC = END is activated (high level), the loop end signal is activated (high level), End processing is executed. Further, the BRCR control signal is activated (high level) with a delay of three clocks CK from the loop end signal, and the register 86 is decremented.
[0075]
In the zero detection circuit 740, the BRCR control signal is activated with a delay of three clocks CK from the activation of the loop end signal. Therefore, when the block size is 3 or less, that is, when the difference between the top address and the bottom address is 2 or less, the register is set. In some cases, the next signal PC = END activated before the number of repetitions stored in 86 is decremented. Therefore, when the block size is 3 or less and the number of repetitions is 3 or less, the loop end processing is performed before the decrement of the number of repetitions, and as a result, the block repeat processing is performed more than the number of repetitions.
Therefore, in the zero detection circuit 740, a decoder 742, AND circuits 746, 748, 750, 754, 756, and a NOR circuit 752 constitute a loop end processing inhibition circuit, and the block repeat processing is performed more than the number of repetitions as described above. Is prevented from increasing.
[0076]
The block size can be identified by the high-level combination of the nodes S1, S2, and S3 and the number of repetitions. Therefore, when the number of repetitions stored in the register 86 is 3, a high-level AND signal (output of the AND circuit 756) of the nodes S1, S2, and S3 and a high-level signal indicating that the number of repetitions is 3 Loop end processing is inhibited by an AND signal with d3 (output of the AND circuit 750). When the number of repetitions stored in the register 86 is 2, an AND signal (output of the AND circuit 748) between the high-level signal at the node S2 and the high-level signal d2 indicating that the number of repetitions is 2 is obtained. Loop end processing is prohibited. When the number of repetitions stored in the register 86 is 1, a loop is formed by an AND signal (output of the AND circuit 746) between the high-level signal at the node S3 and the high-level signal d1 indicating that the number of repetitions is 1. End processing is prohibited. When the number of repetitions is 0, the loop end processing is prohibited only by a high-level signal d0 indicating that the number of repetitions is 0. The high-level signal d0 indicating that the number of repetitions is 0 also functions as a block repeat prohibition signal, and the activation (high level) of this signal causes the address generation circuit 9 to end the block repeat access operation. I do.
[0077]
According to the address generation circuit 7 of the present invention, since there is no need to limit the block size in block repeat addressing, it is possible to reduce, for example, the execution time of the process of repeating one instruction.
In the above-described embodiment, the number of repetitions is input from the register 86 to the zero detection circuit 70. However, a configuration may be employed in which the number of repetitions is input directly from the decrement circuit 84 to the zero detection circuit 70.
Further, addition and subtraction in the increment circuit 82 and the decrement circuit 84 may be numerical values other than 1.
Furthermore, the address generation circuit 7 described above is a circuit in the case where the pipeline delay is two stages and three stages. By appropriately changing the zero detection circuit, the number of pipeline delay stages is four or less. It will be apparent to those skilled in the art that the present invention can be applied to those described above.
[0078]
【The invention's effect】
As described above, in the address generation circuit for block repeat addressing of the present invention, it is possible to eliminate the restriction on the block size or the restriction on program creation caused by the number of delay stages in the pipeline.
[Brief description of the drawings]
FIG. 1 is a diagram showing a configuration of an address generation circuit 30 according to a first embodiment of the present invention.
FIG. 2 is a diagram showing a configuration of an address generation circuit 40 according to a second embodiment of the present invention.
FIG. 3 is a diagram showing a main part of a three-input full addition circuit composed of a partial addition circuit 406 and a partial addition circuit 408;
FIG. 4 is a diagram showing a configuration of an address generation circuit 60 according to a third embodiment of the present invention.
FIG. 5 is a diagram illustrating an operation cycle of an address generation circuit 60 according to a third embodiment of the present invention.
FIG. 6 is a diagram showing a configuration of an address generation circuit 7 according to a fourth embodiment of the present invention.
FIG. 7 is a diagram showing a configuration of a main part of a zero detection circuit 70;
FIG. 8 is a diagram showing a configuration of a main part of a modified example of the zero detection circuit 70;
FIG. 9 is a diagram for explaining an outline of address generation in circular addressing;
FIG. 10 is a flowchart illustrating an algorithm of an index generation process.
FIG. 11 is a diagram showing a configuration of a conventional address generation circuit 9 in block repeat addressing.
[Description of sign]
7, 30, 40, 60: Address generation circuit, 70: Zero detection circuit, 72: Program counter, 74: Comparison circuit, 76, 80, 86: Register, 78: Selector, 82: increment circuit, 84: decrement circuit, 300, 306, 400, 402, 600, 602: addition / subtraction control circuit, 302, 310, 414: addition circuit, 304, 404, 604 ... bit separation circuit, 312 multiplexer, 314, 414, 614 ... bit multiplexing circuit, 308, 410, 612 ... carry check circuit, 406, 408, 608, 610 ... partial addition circuit , 412, 604: gate circuit, 420: full addition circuit

Claims (3)

多段パイプライン機構を有するプロセッサにおけるブロックリピートアドレッシング用のアドレスを生成するためのアドレス生成回路であって、
スタートアドレスを記憶する第1の記憶回路と、
上記スタートアドレスと同じ又は上記スタートアドレスよりも大きなエンドアドレスを記憶する第2の記憶回路と、
インストラクションアドレスを保持するプログラムカウンタと、
ループエンド制御信号が非活性状態のときにクロック信号に応答してインクリメントされたアドレスを上記プログラムカウンタに供給し、上記ループエンド制御信号が活性状態のときに上記第1の記憶回路から出力される上記スタートアドレスを上記プログラムカウンタに供給する選択回路と、
上記プログラムカウンタと上記第2の記憶回路に接続され、上記インストラクションアドレスと上記エンドアドレスとが等しいときに一致信号を活性化する比較器と、
繰り返し値を記憶し、繰り返し値制御信号の活性化に応答して上記繰り返し値がデクリメントされる第3の記憶回路と、
上記比較器からの一致信号と上記第3の記憶回路からの繰り返し値とを入力し、上記一致信号に応答して上記ループエンド制御信号を上記選択回路に供給し、上記一致信号に応答して上記繰り返し値制御信号を上記第3の記憶回路に供給する制御回路と、
を有し、
上記制御回路は、上記ループエンド制御信号の活性化からプロセッサのパイプラインの段数または深さに対応した所定の数の周期だけ遅らせて、上記繰り返し値制御信号を活性化する、
アドレス生成回路。
An address generation circuit for generating an address for block repeat addressing in a processor having a multi-stage pipeline mechanism,
A first storage circuit for storing a start address;
A second storage circuit that stores an end address that is the same as or larger than the start address;
A program counter for holding an instruction address;
When the loop end control signal is inactive, an incremented address is supplied to the program counter in response to the clock signal, and is output from the first storage circuit when the loop end control signal is active. A selection circuit for supplying the start address to the program counter;
A comparator connected to the program counter and the second storage circuit and activating a coincidence signal when the instruction address is equal to the end address;
A third storage circuit for storing a repetition value and decrementing the repetition value in response to activation of the repetition value control signal;
A match signal from the comparator and a repetition value from the third storage circuit are input, the loop end control signal is supplied to the selection circuit in response to the match signal, and the loop end control signal is supplied to the selection circuit in response to the match signal. A control circuit for supplying the repeat value control signal to the third storage circuit;
Has,
The control circuit, the in-loop end control signal a predetermined allowed number of periods only late al corresponding from the activation to the number of stages or the depth of the processor pipeline, to activate the repeat value control signal,
Address generation circuit.
上記制御回路は、新たな上記一致信号に応答した上記ループエンド制御信号の活性化処理を、直前の上記一致信号に応答した上記繰り返し値制御信号の活性化処理の後に行なう、
請求項1に記載のアドレス生成回路。
The control circuit, the activation process of the loop end control signal in response to the new the coincidence signal, row after the activation treatment of the repeating value control signal in response to immediately preceding coincidence signal,
The address generation circuit according to claim 1 .
上記制御回路上記クロック信号の所定の数の周期における上記所定の数に対応した段数の直列接続された複数のフリップフロップを有し、
初段のフリップフロップの入力端子に上記ループエンド制御信号が供給され、
最終段のフリップフロップの出力端子から上記繰り返し値制御信号が供給され、
上記複数のフリップフロップのクリア端子に上記プロセッサの割り込みを示す信号が供給される
請求項1または2に記載のアドレス生成回路。
The control circuit has a plurality of flip-flops connected in series in a number of stages corresponding to the predetermined number in a predetermined number of cycles of the clock signal,
The above-mentioned loop end control signal is supplied to the input terminal of the first stage flip-flop,
The above-mentioned repetition value control signal is supplied from the output terminal of the last stage flip-flop,
A signal indicating an interrupt of the processor is supplied to a clear terminal of the plurality of flip-flops ,
The address generation circuit according to claim 1 .
JP2002034482A 2002-02-12 2002-02-12 Address generation circuit Expired - Lifetime JP3595309B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002034482A JP3595309B2 (en) 2002-02-12 2002-02-12 Address generation circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002034482A JP3595309B2 (en) 2002-02-12 2002-02-12 Address generation circuit

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP6042819A Division JPH07253922A (en) 1994-03-14 1994-03-14 Address generating circuit

Publications (2)

Publication Number Publication Date
JP2002236609A JP2002236609A (en) 2002-08-23
JP3595309B2 true JP3595309B2 (en) 2004-12-02

Family

ID=19192567

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002034482A Expired - Lifetime JP3595309B2 (en) 2002-02-12 2002-02-12 Address generation circuit

Country Status (1)

Country Link
JP (1) JP3595309B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7206622B2 (en) 2002-11-01 2007-04-17 National Institute Of Information And Communications Technology Device to measure degree of acquisition and method for measuring degree of acquisition

Also Published As

Publication number Publication date
JP2002236609A (en) 2002-08-23

Similar Documents

Publication Publication Date Title
US6038649A (en) Address generating circuit for block repeat addressing for a pipelined processor
JPH07168753A (en) Modulo addition circuit and its operation method
JP5240850B2 (en) Clock signal dividing circuit and clock signal dividing method
JP3714570B2 (en) Division circuit for parallel processing
JP3595309B2 (en) Address generation circuit
US4754422A (en) Dividing apparatus
US5635858A (en) Zero-stopping incrementers
US6738792B1 (en) Parallel mask generator
JPH08139575A (en) Pulse output circuit
JPS63153636A (en) Information processor
US7308560B2 (en) Processing unit
JP2845662B2 (en) Peak / bottom hold circuit
JPH05143447A (en) Digital processor and control method for the processor
JP2009187075A (en) Digital circuit
JP3804591B2 (en) Arithmetic processing unit
JP2757714B2 (en) Frame pulse generation circuit
JPH09116413A (en) Logic circuit and its design method
KR19980045133A (en) Low Power Consumption Adder
JP3685634B2 (en) Address calculation device and address calculation method
KR100273246B1 (en) Apparatus for correcting error of state machine
JPH08212052A (en) Normalized data generation circuit
JP3905022B2 (en) Clock switching device
JP2012174105A (en) Memory access control circuit
JPH05334178A (en) Loop-like data generating circuit
JP3424585B2 (en) Timing pulse generation circuit and timing pulse generation method

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040608

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040809

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: 20040831

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20040902

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: 20070910

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080910

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080910

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090910

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100910

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100910

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110910

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120910

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130910

Year of fee payment: 9

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

EXPY Cancellation because of completion of term