JP3871424B2 - Memory control device - Google Patents

Memory control device Download PDF

Info

Publication number
JP3871424B2
JP3871424B2 JP00310398A JP310398A JP3871424B2 JP 3871424 B2 JP3871424 B2 JP 3871424B2 JP 00310398 A JP00310398 A JP 00310398A JP 310398 A JP310398 A JP 310398A JP 3871424 B2 JP3871424 B2 JP 3871424B2
Authority
JP
Japan
Prior art keywords
data
input
output
buffer memory
memory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP00310398A
Other languages
Japanese (ja)
Other versions
JPH11203104A (en
Inventor
吉範 浅村
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP00310398A priority Critical patent/JP3871424B2/en
Publication of JPH11203104A publication Critical patent/JPH11203104A/en
Application granted granted Critical
Publication of JP3871424B2 publication Critical patent/JP3871424B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Television Signal Processing For Recording (AREA)

Description

【0001】
【発明の属する技術分野】
この発明は、メモリを用いてデータ転送速度の変換を行うメモリ制御装置に関する。
【0002】
【従来の技術】
図10は従来のメモリ制御装置を示すブロック回路図である。図10のメモリ制御装置は、入力されるデータを一度メモリに蓄えた後に入力時とは異なるタイミングでメモリから読み出す。図10において、51は入力端子、52はFIFOメモリ、53は出力端子、54はライトデータカウンタ、55はリードデータカウンタである。
【0003】
次に動作について説明する。図11は従来のメモリ制御装置の動作タイミング図であり、ライン単位で入力されるディジタル画像データを扱う場合の一例である。図11に示すように、入力端子1を介して連続する1ライン分(720データ)のデータがFIFOメモリ52に書き込まれる。このライン単位でFIFOメモリ52に書き込まれたデータは16データ毎に分割して読み出される。
【0004】
FIFOメモリ52に書き込まれるデータの数はライトデータカウンタ54によってカウントされ、1ラインの先頭を表すスタートパルスに同期して、FIFOメモリ52に720個の連続するデータが書き込まれるようにライトデータカウンタ54によって制御される。
【0005】
一方、スタートパルスから8クロック遅れてFIFOメモリ52のデータが16データ単位で読み出されるようにリードデータカウンタ55によって制御される。データの読み出しにおいては、16データ毎に2クロック分のマスク期間が設けられている。
【0006】
図11に示すように、画像データの場合は1ライン720画素のデータが連続して入力されるが、各ラインの間には858−720=138クロック分のブランキング期間が存在する。このため、720画素連続入力されるデータを16データ毎に2クロック分のマスク期間を設けて読み出しても、ライン間のブランキング期間で吸収することができる。
【0007】
【発明が解決しようとする課題】
しかしながら上記従来のメモリ制御装置はFIFOメモリに書き込まれるデータ数とFIFOメモリから読み出されるデータ数がある周期の時間内で同じであることを前提に構成されているため、FIFOメモリへのデータの入出力の関係が周期的でない場合はFIFOメモリへのデータのリード/ライトの制御ができないという問題があった。
【0008】
この発明は、上記のような従来の問題を解消するためになされたものであり、バッファメモリに対する入出力データ数の関係が周期的でない場合でも、小さな容量のバッファメモリ及び小さなハードウェア規模でバッファメモリに対するデータ入出力をコントロールすることができるメモリ制御装置を提供することを目的とする。
【0009】
【課題を解決するための手段】
請求項1の発明に係るメモリ制御装置は、入力データをカウントするnビット幅の入力側カウンタと、出力データをカウントするnビット幅の出力側カウンタと、前記入力側カウンタと前記出力側カウンタのカウント値を比較する手段と、前記入力側カウンタが一巡する際にフラグを“1”にセットし、前記出力側カウンタが一巡する際に前記フラグを“0”にリセットする手段と、前記比較手段による比較結果と前記フラグ値とに基づいて、前記入力側カウンタと前記出力側カウンタのカウント値が一致し、かつ前記フラグが“1”になったことを検知すると前記バッファメモリへのデータの入力を制限する手段と、前記比較手段による比較結果と前記フラグの値とに基づいて、前記入力側カウンタと前記出力側カウンタのカウント値が一致し、かつ前記フラグが“0”になったことを検知すると前記バッファメモリからのデータの出力を制限する手段とを有し、前記バッファメモリに対するデータの入出力をコントロールする。
【0010】
請求項2の発明に係るメモリ制御装置は、請求項1の発明に係るメモリ制御装置において、入力側カウンタが、m(mは2以上の整数)個のデータからなる入力データブロックをカウントし、出力側カウンタがm個のデータからなる出力データブロックをカウントし、前記バッファメモリに対するデータブロックの入出力をコントロールする。
【0011】
請求項3の発明に係るメモリ制御装置は、請求項1の発明に係るメモリ制御装置において、前記バッファメモリが、シングルポートのメモリであり、前記バッファメモリに対するデータの入出力経路を切り換える手段を有し、前記バッファメモリのシングルポートに対するデータの入出力をコントロールする。
【0012】
【発明の実施の形態】
実施の形態1.
次に、本発明の実施の形態1について説明する。図1は本実施の形態1のメモリ制御装置のブロック回路図である。図において、1は信号生成回路、2はバッファメモリ、3は信号処理回路、4はライトカウンタ、5はリードカウンタ、6はメモリ制御回路である。
【0013】
信号生成回路1は、内部でディジタル信号処理したデータを順次バッファメモリ2に入力し(書き込み)、データを入力する際にライトカウンタ4にデータ入力信号を発行する。また、信号処理回路3は、バッファメモリ2から出力させた(読み出した)データを信号処理し、データを出力させる際にリードカウンタ5にデータ出力信号を発行する。また、バッファメモリ2は、容量2n ビット以上のFIFOメモリにより構成されており、信号生成回路1から入力されたデータを一時的に記憶し、このデータを信号処理回路3に出力する。上記のnは、ライトカウンタ4及びリードカウンタ5のビット数であり、正の整数である。ここでは、バッファメモリ2の容量は、28 ビットであるものとする(n=8であるものとする)。なお、信号生成回路1はバッファメモリ2にデータを入力する回路であれば良く、信号処理回路3はバッファメモリ2から出力されたデータを入力とする回路であれば良い。また、信号生成回路1及び信号処理回路3は、メモリ制御装置の外部に設けられていても良い。
【0014】
ライトカウンタ4は、nビットのカウンタで構成されており、信号生成回路1からのデータ入力信号をカウントアップすることによりバッファメモリ2に入力されたデータ数をカウントし、nビットカウンタのカウント値WCUTと、nビットカウンタが一巡する際に発生する(“0”から“1”となる)キャリービットWCYとをメモリ制御回路6に出力する。また、リードカウンタ5は、ライトカウンタ4と同様にnビットのカウンタで構成されており、信号処理回路3からのデータ出力信号をカウントアップすることによりバッファメモリ2から出力されたデータ数をカウントし、nビットカウンタのカウント値RCUTと、nビットカウンタが一巡する際に発生する(“0”から“1”となる)キャリービットRCYとをメモリ制御回路6に出力する。ここでは、ライトカウンタ4及びリードカウンタ5は、8ビットのカウンタであるものとしているので、WCUT及びRCUTは、カウント値が”FF”から“0”に戻る際に発行される。
【0015】
メモリ制御回路6は、ライトカウンタ4から出力されるWCUTおよびWCYと、リードカウンタ5から出力されるRCUTおよびRCYとに基づいて、ライトカウンタ4が一巡してリードカウンタ5に追いついたことを検知すると、信号生成回路1に対して入力ウエイト信号W−WAITを発行して信号生成回路1によるバッファメモリ2へのデータ入力をストップさせる。また、リードカウンタ5がライトカウンタ4に追いついたことを検知すると、信号処理回路3に対して出力ウエイト信号R−WAITを発行して信号処理回路3によるバッファメモリ2からのデータ出力をストップさせる。この場合、メモリ制御回路6は、これ以上バッファメモリ2にデータを入力しようとするとバッファメモリ2がオーバーフローを起こす場合にバッファメモリ2へのデータ入力をストップさせ、これ以上バッファメモリ2からデータを出力しようとするとバッファメモリ2がアンダーフローを起こす場合にバッファメモリ2からのデータ出力をストップさせる。
【0016】
図2はメモリ制御回路6の構成を示すブロック回路図である。図2において、メモリ制御回路6は、比較回路11と、判別回路12と、ライト制御回路13と、リード制御回路14により構成されている。
【0017】
比較回路11は、WCUTとRCUTの値をビット毎に比較するnビットの比較回路であり、WCUT=RCUTの場合は“1”、WCUT≠RCUTの場合は“0”を比較結果とし、この比較結果をそれぞれライト制御回路13とリード制御回路14に出力する。
【0018】
判別回路12は、追い越し判別フラグTFFを記憶する1ビットレジスタ(TFFレジスタと称する)を備え、WCUTの値が一巡する際に発行されるWCYが入力されるとTFFを“1”にセットし、RCUTの値が一巡する際に発行されるRCYが入力されるとTFFを“0”にリセットし、このTFFをそれぞれライト制御回路13とリード制御回路14に出力する。なお、判別回路12は、電源が投入されたときやリセットされたときにはTFFを“0”に設定する。
【0019】
ライト制御回路13は、比較回路11からの比較結果及び判別回路12からのTFFに基づいて、WCUT=RCUTでかつTFF=1の場合はライトカウンタ4が一巡してリードカウンタ5に追いついているため、これ以上データをバッファメモリ2に入力するとオーバーフローが起こると判断し、信号生成回路1に対して入力ウエイト信号W−WAITを発行し(W−WAITを“1”とし)、信号生成回路1によるバッファメモリ2へのデータ入力を停止させる。WCUT≠RCUTまたはTFF=0の場合はW−WAITを発行しない(W−WAITを“0”とする)。
【0020】
リード制御回路14は、比較回路11からの比較結果及び判別回路12からのTFFに基づいて、WCUT=RCUTでかつTFF=0の場合はリードカウンタ5がライトカウンタ4に追いついているため、これ以上データをバッファメモリ2から読み出すとアンダーフローが起こると判断し、信号処理回路3に対して出力ウエイト信号R−WAITを発行し(R−WAITを“1”とし)、信号生成回路1によるバッファメモリ2からのデータ出力を停止させる。WCUT≠RCUTまたはTFF=1の場合はR−WAITを発行しない(R−WAITを“0”とする)。
【0021】
次に、動作を説明する。図3及び図4は、本実施の形態1のメモリ制御装置の動作タイミング図であり、図3はW−WAITが発行される様子を示し、図4はR−WAITが発行される様子を示す。図3及び図4において、(a)はバッファメモリ2へのデータ入力(データ書き込み)動作及びバッファメモリ2からのデータ出力(データ読み出し)動作の基本クロック、(b)はバッファメモリ2への入力データ、(c)及び(d)はライトカウンタ4によるWCUT及びWCY、(e)はバッファメモリ2からの出力データ、(f)及び(g)はリードカウンタ5によるRCUT及びRCYである。また、(h)は判別回路12によるTFF、(i)は比較回路11による比較結果、(j)はライト制御回路13によるW−WAIT、(k)はリード制御回路14によるR−WAITである。
【0022】
図3においては、データD0〜D201が信号生成回路1からバッファメモリ2に連続的に順次入力される。また、データD201の入力期間の次の2クロック期間においては、ライト制御回路13により入力ウエイト信号W−WAITが発行され(W−WAIT=1となり)、信号生成回路1によるデータ入力が制限されるので、バッファメモリ2にはデータが入力されない((b)参照)。ライトカウンタ4による入力データ数のカウント値WCUTは、データD0〜DFFの入力期間において“0”から“FF”へ順次インクリメントされていき、データD100が入力されると一巡して“0”に戻り、データD100〜D1FFの入力期間において再び順次インクリメントされ、データD200が入力されると再び一巡して“0”に戻り、データ201が入力されると“1”にインクリメントされ、データ201の入力期間の次の2クロック期間において“1”に保持される((c)参照)。ライトカウンタ4による入力データカウントのキャリービットWCYは、WCUTが“FF”となるデータDFF及びD1FFの入力期間においてそれぞれ“1”となる((d)参照)。
【0023】
データD0、D1、D104〜D201の入力期間においては信号処理回路3はバッファメモリ2にデータの出力を要求せず、従ってバッファメモリ2からデータが出力されない。データD2〜D103の入力期間においては信号処理回路3からの要求によりバッファメモリ2からデータD0〜D101が連続的に順次出力される。また、データD201の入力期間から2クロック期間後にバッファメモリ2からデータD102が出力される((e)参照)。リードカウンタ5による出力データ数のカウント値RCUTは、データD0〜DFFの出力期間において“0”から“FF”へ順次インクリメントされていき、データD100が出力されると一巡して“0”に戻り、データD101が出力されると“1”にインクリメントされ、データD102が出力されるまでの期間“1”に保持され、データD102が出力されると“2”にインクリメントされる((f)参照)。リードカウンタ5による出力データカウントのキャリービットRCYは、RCUTが“FF”となるデータDFFの出力期間(データD101の入力期間)において“1”となる((g)参照)。
【0024】
判定回路12による追い越し判別フラグTFFは、データDFFの入力期間のWCYによりデータD100が入力されると“1”にセットされ、データDFFの出力期間のRCYによりデータD100が出力されると“0”にリセットされ、データD1FFの入力期間のWCYによりデータD200が入力されると“1”にセットされる((h)参照)。比較回路11による比較結果は、データD0〜D200の入力期間においてはWCUT≠RCUTなので“0”であり、データD201が入力されるとWCUTが“1”にインクリメントされ、WCUT=RCUTとなるのでデータD201の入力期間の次のクロック期間で“1”に変化し、データD102が出力されるとRCUTが“2”にインクリメントされ、WCUT≠RCUTとなるのでデータD102の出力期間の次のクロック期間で“0”に戻る((i)参照)。
【0025】
ライト制御回路13による入力ウエイト信号W−WAITは、TFF=1かつWCUT=RCUT(比較結果が“1”)となる期間、すなわちデータD201の入力期間の次のクロック期間及びデータD102の出力期間において“1”となり((j)参照)、これにより信号生成回路1からのデータ入力が制限される。なお、リード制御回路14による出力ウエイト信号R−WAITは、TFF=0かつWCUT=RCUTとなる期間がないので常に“0”であり((k)参照)、従って信号処理回路3は制限を受けない。
【0026】
図4においては、データD0〜D102が信号生成回路1からバッファメモリ2に連続的に順次入力される。また、データD102の入力期間の次の3クロック期間においては信号生成回路1はバッファメモリ2にデータを入力しない。また、データ102の入力期間から4クロック期間後にバッファメモリ2にデータD103が入力される((b)参照)。データD0〜D102の入力期間における(c)〜(k)の波形は図3と同じである。
【0027】
WCUTは、データD102の入力期間の次の3クロック期間において“2”に保持され、データD103が入力されると“3”にインクリメントされる((c)参照)。WCYは、データD100の入力期間以降において“0”に保持される((d)参照)。
【0028】
データD100の出力期間の次の2クロック期間においてデータD101及びD102がバッファメモリ2から連続的に順次出力される。また、データD102の出力期間の次の2クロック期間においては、リード制御回路14により出力ウエイト信号R−WAITが発行され(R−WAIT=1となり)、信号処理回路3によるデータの出力要求が制限されるので、バッファメモリ2からはデータが出力されない((e)参照)。RCUTは、データD0〜DFFの出力期間において“0”から“FF”へ順次インクリメントされていき、データD101が出力されると“1”にインクリメントされ、データD102が出力され“2”にインクリメントされ、データD102の出力期間の次の2クロック期間において“2”に保持される((f)参照)。RCYは、データD100の出力期間以降において“0”に保持される((g)参照)。
【0029】
追い越し判別フラグTFFは、データD102の入力期間(データD100の出力期間)以降において“0”にリセットされている((h)参照)。比較回路11による比較結果は、データD0〜D200の入力期間においてはWCUT≠RCUTなので“0”であり、データD102が出力されるとRCUTが“2”にインクリメントされ、WCUT=RCUTとなるのでデータD102の出力期間の次のクロック期間で“1”に変化し、データD103が入力されるとWCUTが“3”にインクリメントされ、WCUT≠RCUTとなるのでデータD201の入力期間の次のクロック期間で“0”に戻る((i)参照)。
【0030】
R−WAITは、TFF=0かつWCUT=RCUT(比較結果が“1”)となる期間、すなわちデータD102の出力期間の次のクロック期間及びデータD201の入力期間において“1”となり((k)参照)、これにより信号処理回路3によるデータの出力要求が制限される。なお、W−WAITは、TFF=1かつWCUT=RCUTとなる期間がないので常に“0”であり((j)参照))、従って信号生成回路1は制限を受けない。
【0031】
以上の様に実施の形態1によれば、入力データ数及び出力データ数をそれぞれライトカウンタ4及びリードカウンタ5によりカウントし、ライトカウンタ4のカウント値WCUTとリードカウンタ5のカウント値RCUTの一致/不一致を比較回路11により比較するとともに、判別回路12によりライトカウンタ4が一巡する際に“1”にセットされリードカウンタ5が一巡する際に“0”にリセットされる追い越し判別フラグTFFを生成し、比較回路11による比較結果及び追い越し判別フラグTFFに基づいて、リード制御回路13によりバッファメモリ2がオーバーフローする直前の状態を検知してデータ入力を制限し、ライト制御回路14によりバッファメモリ2がアンダーフローする直前の状態を検知してデータ出力を制限するようにしたことにより、バッファメモリ2に対する非同期の入出力データの制御を小さなバッファメモリ容量で実現することができる。さらに、簡単なアルゴリズムでバッファメモリ2の状態を検知することができるので、バッファメモリ2に対する非同期の入出力データの制御を小さなハードウェア規模で実現することができるとともに、判定に要する時間が短く、高速動作が可能なメモリ制御装置を実現することができる。
【0032】
なお、上記実施の形態1では、バッファメモリ2にFIFOメモリを使ったが、必ずしもFIFOメモリである必要はなく、デュアルポートメモリを使っても良い。また、上記実施の形態1では、バッファメモリ2に対するデータの入出力を同一のクロックにより行ったが、必ずしも同一のクロックを用いる必要はなく、データ書き込みとデータ読み出しに速度の異なる別々のクロックを用いても良い。
【0033】
実施の形態2.
次に、本発明の実施の形態2について説明する。上記実施の形態1ではデータのコントロールを1データ毎に行っていたが、m(mは2以上の整数)個の連続するデータからなるデータブロック、例えば画像データのようにデータが連続するデータブロックをライン単位で構成している場合は、バッファメモリのデータをライン単位で管理することによりアルゴリズムを簡略化することができる。実施の形態2のメモリ制御装置は、ライン単位のデータブロックを扱うものである。ここでは、1ライン分のデータ数mを510とする。なお、1ライン分の連続する510個のデータD0〜D1FE(データブロック)を、単にラインデータと称することとする。
【0034】
本実施の形態2のメモリ制御装置のブロック回路図は、基本的には図1及び図2と同じであるが、以下の点が異なる。信号生成回路1は、m個の連続するデータからなるラインデータをバッファメモリ2に入力し、1ラインの最後のデータを入力した時点でライトカウンタ4にラインデータ入力終了信号WENDを発行する。信号処理回路3は、m個の連続するデータからなるラインデータをバッファメモリ2から出力させ、1ラインの最後のデータを出力させた時点でリードカウンタ5にラインデータ出力終了信号RENDを発行する。また、ライトカウンタ4はWENDをカウントアップすることにより、バッファメモリ2に入力されるラインデータ数をカウントするものとする。リードカウンタ5はRENDをカウントアップすることにより、バッファメモリ2から出力されるラインデータ数をカウントするものとする。また、ライトカウンタ4及びリードカウンタ5は2ビットのカウンタであるものとし、比較回路11も2ビットの比較回路であるものとする(n=2とする)。従ってバッファメモリ2の容量は、1ラインのデータ個数m×22 ビット以上であれば良く、ここではm×22 ビットであるものとする。また、メモリ制御回路6は、ライトカウンタ4及びリードカウンタ5からのWCUT、RCUT、WCY,RCYに基づいて、バッファメモリ2のラインデータを管理する。
【0035】
次に、動作を説明する。図5及び図6は本実施の形態2のメモリ制御装置の動作タイミング図であり、図5はW−WAITが発行される様子を示し、図6はR−WAITが発行される様子を示す。図5及び図6において、(a)は基本クロック、(b)は入力データ、(c)はラインデータ入力終了信号WEND、(d)は入力ラインデータ数のカウント値WCUT、(e)はWCUTのキャリービットWCY、(f)は出力データ、(g)はラインデータ出力終了信号REND、(h)は出力ラインデータ数のカウント値RCUT、(i)はRCUTのキャリービットRCY、(j)は追い越し判別フラグTFF、(k)は比較回路11による比較結果、(l)は入力ウエイト信号W−WAIT、(m)は出力ウエイト信号R−WAITである。
【0036】
図5においては、1ライン分のラインデータD0〜D1FEが信号生成回路1からバッファメモリ2に間隔をおいて順次入力される((b)参照)。WENDは、各ラインデータの最後のデータD1FEの入力期間においてそれぞれ“1”となる((c)参照)。WCUTは、4N+2(Nは正の整数)ライン目のデータD1FEの入力が終了すると“2”から“3”にインクリメントされ、4N+3ライン目のデータD1FEの入力が終了すると一巡して“0”に戻り、4N+4ライン目のデータD1FEの入力が終了すると“1”にインクリメントされる((d)参照)。WCYは、WCUTが“3”から“0”に戻る4N+3ライン目のデータD1FEの入力期間において“1”となる((e)参照)。
【0037】
また、1ライン分のラインデータが信号処理回路3からの要求によりバッファメモリ2から間隔をおいて順次出力される。なお、出力されるラインデータは、同時に入力されるラインデータよりも前にバッファメモリ2に入力されたデータである。また、4N+4ライン目のラインデータの入力期間においては、信号処理回路3はバッファメモリ2にデータの出力を要求せず、従ってバッファメモリ2からラインデータが出力されない((f)参照)。RENDは、各ラインデータの最後のデータD1FEの出力期間においてそれぞれ“1”となる((g)参照)。RCUTは、4N−1ライン目のデータD1FEの出力が終了すると一巡して“3”から“0”に戻り、4Nライン目のデータD1FEの出力が終了すると“1”にインクリメントされる((h)参照)。RCYは、RCUTが“3”から“0”に戻る4N−1ライン目のデータD1FEの出力期間において“1”となる((i)参照)。
【0038】
追い越し判定フラグTFFは、4N−1ライン目の出力期間のRCYによりデータD1FEの出力が終了すると“1”から“0”にリセットされ、4N+3ライン目の入力期間のWCYによりデータD1FEの入力が終了すると“1”にセットされる((j)参照)。比較回路11による比較結果は、4N+4ライン目の入力期間が終了するまでWCUT≠RCUTなので“0”であり、4N+4ライン目の入力期間が終了するとWCUTが“1”にインクリメントされ、WCUT=RCUTとなるので“1”に変化する((k)参照)。
【0039】
入力ウエイト信号W−WAITは、TFF=1かつWCUT=RCUT(比較結果が“1”)となる期間、すなわち4N+4ライン目の入力期間が終了した後の期間において“1”となり((l)参照)、これにより信号生成回路1からのデータ入力が制限される。なお、出力ウエイト信号R−WAITは、TFF=0かつWCUT=RCUTとなる期間がないので常に“0”であり((m)参照)、従って信号処理回路3は制限を受けない。
【0040】
図6においては、1ライン分のラインデータが間隔をおいて順次入力される((b)参照)。WENDは、各ラインデータの最後のデータD1FEの入力期間においてそれぞれ“1”となる((c)参照)。WCUTは、4N+3ライン目のデータD1FEの入力が終了すると一巡して“3”から“0”に戻り、4N+4ライン目のデータD1FEの入力が終了すると“1”にインクリメントされる((d)参照)。WCYは、WCUTが“3”から“0”に戻る4N+3ライン目のデータD1FEの入力期間において“1”となる((e)参照)。
【0041】
また、1ライン分のラインデータが間隔をおいて順次出力される((f)参照)。RENDは、各ラインデータのデータD1FEの出力期間においてそれぞれ“1”となる((g)参照)。RCUTは、4N+2ライン目のデータD1FEの出力が終了すると“2”から“3”にインクリメントされ、4N+3ライン目のデータD1FEの出力が終了すると一巡して“3”から“0”に戻り、4N+4ライン目のデータD1FEの出力が終了すると“1”にインクリメントされる((h)参照)。RCYは、RCUTが“3”から“0”に戻る4N+3ライン目のデータD1FEの出力期間において“1”となる((i)参照)。
【0042】
追い越し判定フラグTFFは、4N+3ライン目の入力期間のWCYによりデータD1FEの入力が終了すると“0”から“1”にセットされ、4N+3ライン目の出力期間のRCYによりデータD1FEの出力が終了すると“0”にリセットされる((j)参照)。比較回路11による比較結果は、4N+4ライン目の出力期間が終了するまでWCUT≠RCUTなので“0”であり、4N+4ライン目の出力期間が終了するとRCUTが“1”にインクリメントされ、WCUT=RCUTとなるので“1”に変化する((k)参照)。
【0043】
出力ウエイト信号R−WAITは、TFF=0かつWCUT=RCUT(比較結果が“1”)となる期間、すなわち4N+4ライン目の出力期間が終了した後の期間において“1”となり((m)参照)、これにより信号処理回路3によるデータの出力要求が制限される。なお、入力ウエイト信号W−WAITは、TFF=1かつWCUT=RCUTとなる期間がないので常に“0”であり((l)参照)、従って信号生成回路1は制限を受けない。
【0044】
以上の様に実施の形態2によれば、上記実施の形態1と同様に非同期で入出力されるm個の連続するデータからなるラインデータの制御を小さなバッファメモリ容量で実現することができ、高速動作が可能なメモリ制御装置を実現することができるとともに、入出力ラインデータ数をリードカウンタ4及びライトカウンタ5によりカウントするようにしたことにより、ハードウェア規模を上記実施の形態1よりもさらに小さくすることができる。
【0045】
実施の形態3.
次に、本発明の実施の形態3について説明する。図7は本実施の形態2のメモリ制御装置のブロック回路図である。図において、1は信号生成回路、7はバッファメモリ、8はセレクタ回路、3は信号処理回路、4はライトカウンタ、5はリードカウンタ、9はメモリ制御回路である。なお、図7において、図1と同じものには同じ符号を付してある。図7のメモリ制御装置は、図1のメモリ制御装置において、バッファメモリ2及びメモリ制御回路6をそれぞれバッファメモリ7及びメモリ制御回路9とし、セレクタ回路8を設けたものである。
【0046】
バッファメモリ7は、シングルポートのDRAMにより構成されている。また、セレクタ回路8は、バッファメモリ7のデータ入出力ポートを信号生成回路1または信号処理回路3に切り換え接続する。すなわち、セレクタ回路8はバッファメモリ7のデータ入出力経路(リード/ライト方向)を切り換える。
【0047】
メモリ制御回路9は、上記実施の形態1のメモリ制御回路6と同様に、ライトカウンタ4から出力されるWCUTおよびWCYと、リードカウンタ5から出力されるRCUTおよびRCYとに基づいて、バッファメモリ2に入力されバッファメモリ2から出力されていないデータの個数を管理し、入力ウエイト信号W−WAIT及び出力ウエイト信号R−WAITにより信号生成回路1及び信号処理回路3の動作を制限する。さらに、メモリ制御回路9は、1データ毎にバッファメモリ7のライトアドレスとリードアドレスを生成してバッファメモリ7に出力すると同時に、セレクタ回路8を制御する。すなわち、上記のライトアドレスをライトカウンタ4から出力されるWCUTから生成し、上記のリードアドレスをリードカウンタ5から出力されるRCUTから生成し、セレクタ回路8によるデータのリード/ライト方向の切り換えを入力データ及び出力データのサンプリング周波数の2倍のクロックに同期して行う。
【0048】
図8はメモリ制御回路9の構成を示すブロック回路図である。図8において、メモリ制御回路9は、比較回路11と、判別回路12と、ライト制御回路13と、リード制御回路14と、アドレス生成回路25により構成されている。なお、図8において、図2と同じものには同じ符号を付してある。メモリ制御回路9は、図2のメモリ制御回路において、アドレス生成回路25を設けたものである。アドレス生成回路25は、入力データ及び出力データのサンプリング周波数の2倍のクロックW/Rを生成し、セレクタ回路8及びバッファメモリ7に出力するとともに、入力データのカウント値WCUT及び出力データのカウント値RCUTに基づいてライトアドレス及びリードアドレスを生成し、これらのアドレスをバッファメモリ7に出力する。ここでは、セレクタ回路8はクロックW/Rの立ち上がりでバッファメモリ7のデータ入出力ポートを信号生成回路1側に切り換え、クロックW/Rの立ち下がりでデータ入出力ポートを信号処理回路3側に切り換えるものとする。また、バッファメモリ7は、クロックW/Rがハイレベルである期間においてデータライト動作をし、クロックW/Rがローレベルである期間において立ち下がりにおいてデータリード動作をするものとする。
【0049】
次に、動作を説明する。図9は本実施の形態3のメモリ制御装置の動作タイミング図である。図9において、(a)はバッファメモリ7のライトデータ(入力データのライトタイミング)、(b)は入力データ数のカウント値WCUT、(c)はWCUTのキャリービットWCY、(d)はアドレス生成回路25によるクロックW/R、(e)はバッファメモリ7からの出力データ(記憶データのリードタイミング)、(f)は出力データ数のカウント値RCUT、(g)はRCUTのキャリービットRCY、(h)は追い越し判別フラグTFF、(i)は比較回路11による比較結果、(j)は入力ウエイト信号W−WAIT、(k)は出力ウエイト信号R−WAITである。
【0050】
図9において、信号生成回路1からバッファメモリ7にデータが入力される場合には、クロックW/Rの立ち上がりに同期して入力データがバッファメモリ7に書き込まれる。また、信号処理回路3からデータの出力要求がある場合には、クロックW/Rの立ち立ち下がりに同期してバッファメモリ7からデータが読み出される((a)、(d)、(e)参照)。
【0051】
また、WCUT、RCUT、WCY、RCY、TFF、比較回路11による比較結果、W−WAIT、R−WAITの所作は、上記実施の形態1と同様である。WCUT及びRCUTは、それぞれデータの入出力に応じてインクリメントされ、”FF”になると次のデータの入出力で“0”に戻る((b)、(f)参照)。WCY及びRCYは、WCUT、RCUTが”FF”である期間においてそれぞれ“1”となる((c)、(g)参照)。追い越し判別フラグTFFは、WCYが“1”になると“1”にセットされ、RCYが“0”になると“0”にリセットされる((h)参照)。比較回路11による比較結果は、WCUT≠RCUTのとき“0”となり、WCUT=RCUTのとき“1”となる((i)参照)。入力ウエイト信号W−WAITは、TFF=1かつWCUT=RCUTとなる期間において“1”となり((j)参照)、これにより信号生成回路1からのデータ入力が制限される。出力ウエイト信号R−WAITは、TFF=0かつWCUT=RCUTとなる期間において“1”となり((k)参照)、これにより信号処理回路3によるデータの出力要求が制限される。
【0052】
以上の様に実施の形態3によれば、上記実施の形態1と同様に非同期で入出力されるデータの制御を小さなバッファメモリ容量及び小さなハードウェア規模で実現することができ、高速動作が可能なメモリ制御装置を実現することができるとともに、シングルポートのメモリを用いたことにより、安価なメモリ制御装置を実現することができる。
【0053】
なお、上記実施の形態3では、バッファメモリ7にシングルポートのDRAMを使ったが、必ずしもDRAMである必要はなく、SRAM等のメモリを使っても良い。また、上記実施の形態3では、1データ単位でバッファメモリ7のリード/ライト方向を切り換えていたが、必ずしも1データ単位である必要はなく、任意のデータ単位で切り換えるようにしても良い。
【0054】
【発明の効果】
請求項1の発明に係るメモリ制御装置によれば、入出力データ数をそれぞれ入力側カウンタ及び出力側カウンタによりカウントし、両カウンタのカウント値を比較するとともに、入力側カウンタが一巡する際に“1”にセットされ出力側カウンタが一巡する際に“0”にリセットされるフラグを生成し、カウント値の比較結果及びフラグの値に基づいて、両カウント値が一致し、かつフラグが“1”になったことを検知するとデータ入力を制限し、両カウント値が一致し、かつフラグが“0”になったことを検知するとデータ出力を制限するようにしたことにより、非同期で入出力されるデータの制御を小さなバッファメモリ容量で実現することができるという効果がある。また、データの入出力を制限するか否かを簡単なアルゴリズムで判定することができるので、非同期で入出力されるデータの制御を小さなハードウェア規模で実現することができるとともに、判定に要する時間が短く、高速動作が可能なメモリ制御装置を実現することができるという効果がある。
【0055】
請求項2の発明に係るメモリ制御装置によれば、非同期で入出力されるm個のデータからなるデータブロックの制御を小さなバッファメモリ容量で実現することができるとともに、入出力データブロック数を入力側カウンタ及び出力側カウンタによりカウントするようにしたことにより、ハードウェア規模をさらに小さくすることができるという効果がある。
【0056】
請求項3の発明に係るメモリ制御装置によれば、非同期で入出力されるデータの制御を小さなバッファメモリ容量及び小さなハードウェア規模で実現することができ、高速動作が可能なメモリ制御装置を実現することができるとともに、シングルポートのメモリを用いたことにより、安価なメモリ制御装置を実現することができるという効果がある。
【図面の簡単な説明】
【図1】 本発明の実施の形態1のメモリ制御装置の構成を示すブロック回路図である。
【図2】 本発明の実施の形態1におけるメモリ制御回路の構成を示すブロック回路図である。
【図3】 本発明の実施の形態1のメモリ制御装置の動作タイミング図である。
【図4】 本発明の実施の形態1のメモリ制御装置の動作タイミング図である。
【図5】 本発明の実施の形態2のメモリ制御装置の動作タイミング図である。
【図6】 本発明の実施の形態2のメモリ制御装置の動作タイミング図である。
【図7】 本発明の実施の形態3のメモリ制御装置の構成を示すブロック回路図である。
【図8】 本発明の実施の形態3におけるメモリ制御回路の構成を示すブロック回路図である。
【図9】 本発明の実施の形態3のメモリ制御装置の動作タイミング図である。
【図10】 従来のメモリ制御装置の構成を示すブロック回路図である。
【図11】 従来のメモリ制御装置の動作タイミング図である。
【符号の説明】
2,7 バッファメモリ、 4 ライトカウンタ、 5 リードカウンタ、 6,9 メモリ制御回路、 10 比較回路、 11 比較回路、 12 判別回路、 13 ライト制御回路、 14 リード制御回路。
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a memory control device that converts a data transfer rate using a memory.
[0002]
[Prior art]
FIG. 10 is a block circuit diagram showing a conventional memory control device. The memory control device of FIG. 10 stores input data once in the memory and then reads it from the memory at a timing different from that at the time of input. In FIG. 10, 51 is an input terminal, 52 is a FIFO memory, 53 is an output terminal, 54 is a write data counter, and 55 is a read data counter.
[0003]
Next, the operation will be described. FIG. 11 is an operation timing chart of the conventional memory control apparatus, and is an example in the case of handling digital image data input in line units. As shown in FIG. 11, data for one continuous line (720 data) is written to the FIFO memory 52 via the input terminal 1. The data written in the FIFO memory 52 in units of lines is divided and read out every 16 data.
[0004]
The number of data written in the FIFO memory 52 is counted by the write data counter 54, and in synchronization with a start pulse representing the head of one line, the write data counter 54 is written so that 720 consecutive data are written in the FIFO memory 52. Controlled by.
[0005]
On the other hand, the read data counter 55 controls the data in the FIFO memory 52 to be read in units of 16 data with a delay of 8 clocks from the start pulse. In reading data, a mask period of 2 clocks is provided for every 16 data.
[0006]
As shown in FIG. 11, in the case of image data, data of 720 pixels per line is continuously input, but there is a blanking period of 858−720 = 138 clocks between the lines. For this reason, even if 720 pixels of continuous input data are read by providing a mask period of 2 clocks for every 16 data, they can be absorbed in the blanking period between lines.
[0007]
[Problems to be solved by the invention]
However, since the conventional memory control device is configured on the assumption that the number of data written to the FIFO memory and the number of data read from the FIFO memory are the same within a certain period of time, the data input to the FIFO memory is not possible. When the output relationship is not periodic, there is a problem that it is impossible to control the reading / writing of data to the FIFO memory.
[0008]
The present invention has been made to solve the above-described conventional problems. Even when the relationship between the number of input / output data with respect to the buffer memory is not periodic, the buffer memory with a small capacity and the buffer size with a small hardware scale are provided. An object of the present invention is to provide a memory control device capable of controlling data input / output with respect to a memory.
[0009]
[Means for Solving the Problems]
According to a first aspect of the present invention, there is provided a memory control device comprising: an n-bit width input side counter for counting input data; an n-bit width output side counter for counting output data; and the input side counter and the output side counter. Means for comparing count values, means for setting a flag to "1" when the input side counter makes a round, and means for resetting the flag to "0" when the output side counter makes a round; and the comparison means When the count value of the input side counter matches the count value of the output side counter and the flag is set to “1” based on the comparison result and the flag value, data input to the buffer memory is detected. Based on the comparison result by the comparison means and the value of the flag, the count values of the input side counter and the output side counter are equal to each other. And, and the flag when it is detected that it is now "0" and a means for limiting the output of data from said buffer memory to control the input and output of data to the buffer memory.
[0010]
The memory control device according to a second aspect of the present invention is the memory control device according to the first aspect of the invention, wherein the input side counter counts input data blocks consisting of m (m is an integer of 2 or more) pieces of data, The output counter counts output data blocks composed of m pieces of data, and controls the input / output of the data blocks with respect to the buffer memory.
[0011]
A memory control device according to a third aspect of the present invention is the memory control device according to the first aspect of the present invention, wherein the buffer memory is a single-port memory, and has means for switching a data input / output path to the buffer memory. Then, data input / output with respect to the single port of the buffer memory is controlled.
[0012]
DETAILED DESCRIPTION OF THE INVENTION
Embodiment 1 FIG.
Next, Embodiment 1 of the present invention will be described. FIG. 1 is a block circuit diagram of the memory control device according to the first embodiment. In the figure, 1 is a signal generation circuit, 2 is a buffer memory, 3 is a signal processing circuit, 4 is a write counter, 5 is a read counter, and 6 is a memory control circuit.
[0013]
The signal generation circuit 1 sequentially inputs (writes) data internally digital signal processed to the buffer memory 2 and issues a data input signal to the write counter 4 when data is input. The signal processing circuit 3 performs signal processing on the data output (read) from the buffer memory 2 and issues a data output signal to the read counter 5 when outputting the data. The buffer memory 2 has a capacity of 2 n It is composed of a FIFO memory having bits or more, and temporarily stores the data input from the signal generation circuit 1 and outputs this data to the signal processing circuit 3. The above n is the number of bits of the write counter 4 and the read counter 5, and is a positive integer. Here, the capacity of the buffer memory 2 is 2 8 Suppose that it is a bit (assuming n = 8). The signal generation circuit 1 may be any circuit that inputs data to the buffer memory 2, and the signal processing circuit 3 may be any circuit that receives data output from the buffer memory 2. Further, the signal generation circuit 1 and the signal processing circuit 3 may be provided outside the memory control device.
[0014]
The write counter 4 is composed of an n-bit counter, counts the number of data input to the buffer memory 2 by counting up the data input signal from the signal generation circuit 1, and counts the count value WCUT of the n-bit counter. Then, the carry bit WCY (changed from “0” to “1”) generated when the n-bit counter makes a round is output to the memory control circuit 6. The read counter 5 is composed of an n-bit counter like the write counter 4 and counts the number of data output from the buffer memory 2 by counting up the data output signal from the signal processing circuit 3. The count value RCUT of the n-bit counter and the carry bit RCY that occurs when the n-bit counter makes a round (from “0” to “1”) are output to the memory control circuit 6. Here, since the write counter 4 and the read counter 5 are assumed to be 8-bit counters, the WCUT and the RCUT are issued when the count value returns from “FF” to “0”.
[0015]
When the memory control circuit 6 detects that the write counter 4 has caught up with the read counter 5 once based on the WCUT and WCY output from the write counter 4 and the RCUT and RCY output from the read counter 5. The input wait signal W-WAIT is issued to the signal generation circuit 1 to stop the data input to the buffer memory 2 by the signal generation circuit 1. When it is detected that the read counter 5 has caught up with the write counter 4, the output wait signal R-WAIT is issued to the signal processing circuit 3 to stop the data output from the buffer memory 2 by the signal processing circuit 3. In this case, when the memory control circuit 6 tries to input data to the buffer memory 2 further, when the buffer memory 2 overflows, the memory control circuit 6 stops the data input to the buffer memory 2 and outputs data from the buffer memory 2 any more. When trying to do so, the data output from the buffer memory 2 is stopped when the buffer memory 2 underflows.
[0016]
FIG. 2 is a block circuit diagram showing the configuration of the memory control circuit 6. In FIG. 2, the memory control circuit 6 includes a comparison circuit 11, a determination circuit 12, a write control circuit 13, and a read control circuit 14.
[0017]
The comparison circuit 11 is an n-bit comparison circuit that compares the values of WCUT and RCUT bit by bit. The comparison result is “1” when WCUT = RCUT and “0” when WCUT ≠ RCUT. The results are output to the write control circuit 13 and the read control circuit 14, respectively.
[0018]
The determination circuit 12 includes a 1-bit register (referred to as a TFF register) that stores an overtaking determination flag TFF. When WCY issued when the value of the WCUT makes a round is input, the TFF is set to “1”. When the RCY issued when the RCUT value makes a round is input, the TFF is reset to “0”, and the TFF is output to the write control circuit 13 and the read control circuit 14, respectively. The discrimination circuit 12 sets TFF to “0” when the power is turned on or reset.
[0019]
Based on the comparison result from the comparison circuit 11 and the TFF from the determination circuit 12, the write control circuit 13 makes a round of the write counter 4 to catch up with the read counter 5 when WCUT = RCUT and TFF = 1. When it is determined that an overflow occurs when more data is input to the buffer memory 2, the input wait signal W-WAIT is issued to the signal generation circuit 1 (W-WAIT is set to “1”). Data input to the buffer memory 2 is stopped. When WCUT ≠ RCUT or TFF = 0, W-WAIT is not issued (W-WAIT is set to “0”).
[0020]
Based on the comparison result from the comparison circuit 11 and the TFF from the determination circuit 12, the read control circuit 14 catches up with the write counter 4 when WCUT = RCUT and TFF = 0. When data is read from the buffer memory 2, it is determined that an underflow occurs, and an output wait signal R-WAIT is issued to the signal processing circuit 3 (R-WAIT is set to “1”). 2 stops data output. When WCUT ≠ RCUT or TFF = 1, R-WAIT is not issued (R-WAIT is set to “0”).
[0021]
Next, the operation will be described. 3 and 4 are operation timing diagrams of the memory control device according to the first embodiment. FIG. 3 shows a state in which W-WAIT is issued, and FIG. 4 shows a state in which R-WAIT is issued. . 3 and 4, (a) is a basic clock for data input (data write) operation and data output (data read) operation from the buffer memory 2, and (b) is input to the buffer memory 2. (C) and (d) are WCUT and WCY by the write counter 4, (e) is output data from the buffer memory 2, and (f) and (g) are RCUT and RCY by the read counter 5. (H) is TFF by the discrimination circuit 12, (i) is a comparison result by the comparison circuit 11, (j) is W-WAIT by the write control circuit 13, and (k) is R-WAIT by the read control circuit 14. .
[0022]
In FIG. 3, data D <b> 0 to D <b> 201 are sequentially and sequentially input from the signal generation circuit 1 to the buffer memory 2. In the next two clock periods after the input period of the data D201, the write control circuit 13 issues an input wait signal W-WAIT (W-WAIT = 1), and data input by the signal generation circuit 1 is restricted. Therefore, no data is input to the buffer memory 2 (see (b)). The count value WCUT of the number of input data by the write counter 4 is sequentially incremented from “0” to “FF” in the input period of the data D0 to DFF, and returns to “0” once when the data D100 is input. The data D100 to D1FF are sequentially incremented again in the input period. When the data D200 is input, the data D100 to D1FF are returned to “0” once again. When the data 201 is input, the data D100 is incremented to “1”. Is held at “1” in the next two clock periods (see (c)). The carry bit WCY of the input data count by the write counter 4 becomes “1” in the input period of the data DFF and D1FF where the WCUT is “FF” (see (d)).
[0023]
During the input period of the data D0, D1, D104 to D201, the signal processing circuit 3 does not request the buffer memory 2 to output data, and therefore no data is output from the buffer memory 2. During the input period of the data D2 to D103, the data D0 to D101 are successively and sequentially output from the buffer memory 2 in response to a request from the signal processing circuit 3. Further, the data D102 is output from the buffer memory 2 after two clock periods from the input period of the data D201 (see (e)). The count value RCUT of the number of output data by the read counter 5 is sequentially incremented from “0” to “FF” in the output period of the data D0 to DFF, and returns to “0” once when the data D100 is output. When data D101 is output, it is incremented to "1", held for a period "1" until data D102 is output, and when data D102 is output, it is incremented to "2" (see (f)). ). The carry bit RCY of the output data count by the read counter 5 becomes “1” in the output period of data DFF (input period of data D101) in which RCUT is “FF” (see (g)).
[0024]
The overtaking determination flag TFF by the determination circuit 12 is set to “1” when the data D100 is input by the WCY of the input period of the data DFF, and “0” when the data D100 is output by the RCY of the output period of the data DFF. When data D200 is input by WCY in the input period of data D1FF, it is set to “1” (see (h)). The comparison result by the comparison circuit 11 is “0” because WCUT ≠ RCUT in the input period of the data D0 to D200. When the data D201 is input, the WCUT is incremented to “1” and WCUT = RCUT. It changes to “1” in the clock period next to the input period of D201, and when the data D102 is output, RCUT is incremented to “2” and WCUT ≠ RCUT, and therefore, in the clock period next to the output period of data D102. Return to “0” (see (i)).
[0025]
The input wait signal W-WAIT by the write control circuit 13 is a period in which TFF = 1 and WCUT = RCUT (comparison result is “1”), that is, a clock period next to the input period of the data D201 and an output period of the data D102. “1” (see (j)), thereby restricting data input from the signal generation circuit 1. Note that the output wait signal R-WAIT by the read control circuit 14 is always “0” because there is no period in which TFF = 0 and WCUT = RCUT (see (k)), and therefore the signal processing circuit 3 is limited. Absent.
[0026]
In FIG. 4, data D <b> 0 to D <b> 102 are sequentially and sequentially input from the signal generation circuit 1 to the buffer memory 2. Further, the signal generation circuit 1 does not input data to the buffer memory 2 in the next three clock periods after the input period of the data D102. Further, data D103 is input to the buffer memory 2 after four clock periods from the input period of the data 102 (see (b)). The waveforms (c) to (k) in the input period of the data D0 to D102 are the same as those in FIG.
[0027]
The WCUT is held at “2” in the next three clock periods after the input period of the data D102, and is incremented to “3” when the data D103 is input (see (c)). WCY is held at “0” after the input period of data D100 (see (d)).
[0028]
Data D101 and D102 are sequentially and sequentially output from the buffer memory 2 in the next two clock periods after the output period of the data D100. In the next two clock periods after the output period of the data D102, the read control circuit 14 issues an output wait signal R-WAIT (R-WAIT = 1), and the signal output request by the signal processing circuit 3 is limited. Therefore, no data is output from the buffer memory 2 (see (e)). RCUT is sequentially incremented from “0” to “FF” in the output period of data D0 to DFF. When data D101 is output, it is incremented to “1”, and data D102 is output and incremented to “2”. The data D102 is held at “2” in the next two clock periods (see (f)). RCY is held at “0” after the output period of the data D100 (see (g)).
[0029]
The overtaking determination flag TFF is reset to “0” after the input period of the data D102 (output period of the data D100) (see (h)). The comparison result by the comparison circuit 11 is “0” because WCUT ≠ RCUT in the input period of the data D0 to D200. When the data D102 is output, RCUT is incremented to “2” and WCUT = RCUT. It changes to “1” in the next clock period after the output period of D102, and when the data D103 is input, the WCUT is incremented to “3” and WCUT ≠ RCUT, and therefore, in the next clock period of the input period of the data D201. Return to “0” (see (i)).
[0030]
R-WAIT becomes “1” in the period when TFF = 0 and WCUT = RCUT (comparison result is “1”), that is, the clock period next to the output period of the data D102 and the input period of the data D201 ((k) As a result, the data output request by the signal processing circuit 3 is limited. Note that W-WAIT is always “0” because there is no period in which TFF = 1 and WCUT = RCUT (see (j)), and therefore the signal generation circuit 1 is not limited.
[0031]
As described above, according to the first embodiment, the number of input data and the number of output data are counted by the write counter 4 and the read counter 5 respectively, and the count value WCUT of the write counter 4 and the count value RCUT of the read counter 5 match / The discrepancy is compared by the comparison circuit 11 and the determination circuit 12 generates an overtaking determination flag TFF that is set to “1” when the write counter 4 makes a round and reset to “0” when the read counter 5 makes a round. Based on the comparison result by the comparison circuit 11 and the overtaking determination flag TFF, the read control circuit 13 detects the state immediately before the buffer memory 2 overflows, restricts data input, and the write control circuit 14 underestimates the buffer memory 2 Detect data just before flow and limit data output By the the above, it is possible to realize a control of the asynchronous input and output data to the buffer memory 2 with a small buffer memory capacity. Furthermore, since the state of the buffer memory 2 can be detected with a simple algorithm, control of asynchronous input / output data to the buffer memory 2 can be realized on a small hardware scale, and the time required for determination is short. A memory control device capable of high-speed operation can be realized.
[0032]
In the first embodiment, the FIFO memory is used as the buffer memory 2. However, the FIFO memory is not necessarily used, and a dual port memory may be used. In the first embodiment, data input / output with respect to the buffer memory 2 is performed using the same clock. However, the same clock is not necessarily used, and separate clocks having different speeds are used for data writing and data reading. May be.
[0033]
Embodiment 2. FIG.
Next, a second embodiment of the present invention will be described. In the first embodiment, data is controlled for each data. However, a data block composed of m (m is an integer of 2 or more) continuous data, for example, a data block in which data is continuous such as image data. Is configured in units of lines, the algorithm can be simplified by managing the data in the buffer memory in units of lines. The memory control apparatus according to the second embodiment handles data blocks in units of lines. Here, the number of data m for one line is 510. Note that 510 continuous data D0 to D1FE (data block) for one line is simply referred to as line data.
[0034]
The block circuit diagram of the memory control device according to the second embodiment is basically the same as that shown in FIGS. 1 and 2, except for the following points. The signal generation circuit 1 inputs line data composed of m pieces of continuous data to the buffer memory 2 and issues a line data input end signal WEND to the write counter 4 when the last data of one line is input. The signal processing circuit 3 outputs line data composed of m continuous data from the buffer memory 2 and issues a line data output end signal REND to the read counter 5 when the last data of one line is output. The write counter 4 counts the number of line data input to the buffer memory 2 by counting up WEND. The read counter 5 counts the number of line data output from the buffer memory 2 by counting up REND. The write counter 4 and the read counter 5 are assumed to be 2-bit counters, and the comparison circuit 11 is also assumed to be a 2-bit comparison circuit (n = 2). Accordingly, the capacity of the buffer memory 2 is the number of data per line m × 2 2 It should be more than bits, here m × 2 2 It shall be a bit. The memory control circuit 6 manages the line data of the buffer memory 2 based on the WCUT, RCUT, WCY, and RCY from the write counter 4 and the read counter 5.
[0035]
Next, the operation will be described. 5 and 6 are operation timing diagrams of the memory control apparatus according to the second embodiment. FIG. 5 shows a state in which W-WAIT is issued, and FIG. 6 shows a state in which R-WAIT is issued. 5 and 6, (a) is the basic clock, (b) is the input data, (c) is the line data input end signal WEND, (d) is the count value WCUT of the number of input line data, and (e) is the WCUT. (F) is output data, (g) is a line data output end signal REND, (h) is a count value RCUT of the number of output line data, (i) is a carry bit RCY of RCUT, (j) is The overtaking determination flag TFF, (k) is a comparison result by the comparison circuit 11, (l) is an input wait signal W-WAIT, and (m) is an output wait signal R-WAIT.
[0036]
In FIG. 5, line data D0 to D1FE for one line are sequentially input from the signal generation circuit 1 to the buffer memory 2 at intervals (see (b)). WEND becomes “1” in the input period of the last data D1FE of each line data (see (c)). The WCUT is incremented from “2” to “3” when the input of the data D1FE of the 4N + 2 (N is a positive integer) line is completed, and is set to “0” once the input of the data D1FE of the 4N + 3 line is completed. Returning, when the input of the data D1FE of the 4N + 4th line is completed, it is incremented to “1” (see (d)). WCY becomes “1” in the input period of data D1FE on the 4N + 3rd line when WCUT returns from “3” to “0” (see (e)).
[0037]
Further, line data for one line is sequentially output from the buffer memory 2 at intervals in response to a request from the signal processing circuit 3. The output line data is data input to the buffer memory 2 before the line data input simultaneously. In the input period of line data of the 4N + 4th line, the signal processing circuit 3 does not request the buffer memory 2 to output data, and therefore no line data is output from the buffer memory 2 (see (f)). REND becomes “1” in the output period of the last data D1FE of each line data (see (g)). RCUT returns from "3" to "0" once when the output of the data D1FE on the 4N-1 line ends, and increments to "1" when the output of the data D1FE on the 4N line ends ((h )reference). RCY becomes “1” in the output period of the data D1FE on the 4N−1th line where RCUT returns from “3” to “0” (see (i)).
[0038]
The overtaking determination flag TFF is reset from “1” to “0” when the output of the data D1FE is completed by the RCY of the output period of the 4N−1 line, and the input of the data D1FE is completed by the WCY of the input period of the 4N + 3 line. Then, it is set to “1” (see (j)). The comparison result by the comparison circuit 11 is “0” because WCUT ≠ RCUT until the input period of the 4N + 4th line ends, and WCUT is incremented to “1” when the input period of the 4N + 4th line ends, and WCUT = RCUT Therefore, it changes to “1” (see (k)).
[0039]
The input wait signal W-WAIT becomes “1” in a period when TFF = 1 and WCUT = RCUT (comparison result is “1”), that is, a period after the input period of the 4N + 4th line is finished (see (l)). Thus, data input from the signal generation circuit 1 is limited. The output wait signal R-WAIT is always “0” (see (m)) since there is no period in which TFF = 0 and WCUT = RCUT (see (m)), and therefore the signal processing circuit 3 is not limited.
[0040]
In FIG. 6, line data for one line is sequentially input at intervals (see (b)). WEND becomes “1” in the input period of the last data D1FE of each line data (see (c)). The WCUT loops from “3” to “0” once the input of the data D1FE on the 4N + 3th line is completed, and is incremented to “1” when the input of the data D1FE on the 4N + 4th line is completed (see (d)). ). WCY becomes “1” in the input period of data D1FE on the 4N + 3rd line when WCUT returns from “3” to “0” (see (e)).
[0041]
Further, line data for one line is sequentially output at intervals (see (f)). REND becomes “1” in the output period of the data D1FE of each line data (see (g)). The RCUT is incremented from “2” to “3” when the output of the data D1FE of the 4N + 2 line is completed, and returns from “3” to “0” once when the output of the data D1FE of the 4N + 3 line is completed, 4N + 4 When the output of the data D1FE of the line ends, it is incremented to “1” (see (h)). RCY becomes “1” in the output period of the data D1FE on the 4N + 3rd line when RCUT returns from “3” to “0” (see (i)).
[0042]
The overtaking determination flag TFF is set from “0” to “1” when the input of the data D1FE is completed by the WCY in the input period of the 4N + 3th line, and is “ It is reset to 0 ″ (see (j)). The comparison result by the comparison circuit 11 is “0” because WCUT ≠ RCUT until the output period of the 4N + 4th line ends, and RCUT is incremented to “1” when the output period of the 4N + 4th line ends, and WCUT = RCUT Therefore, it changes to “1” (see (k)).
[0043]
The output wait signal R-WAIT becomes “1” in a period when TFF = 0 and WCUT = RCUT (comparison result is “1”), that is, a period after the output period of the 4N + 4th line is finished (see (m)). Thus, the data output request by the signal processing circuit 3 is limited. The input wait signal W-WAIT is always “0” because there is no period in which TFF = 1 and WCUT = RCUT (see (l)), and therefore the signal generation circuit 1 is not limited.
[0044]
As described above, according to the second embodiment, as in the first embodiment, control of line data composed of m continuous data input / output asynchronously can be realized with a small buffer memory capacity. A memory control device capable of high-speed operation can be realized, and the number of input / output line data is counted by the read counter 4 and the write counter 5, thereby further increasing the hardware scale compared to the first embodiment. Can be small.
[0045]
Embodiment 3 FIG.
Next, a third embodiment of the present invention will be described. FIG. 7 is a block circuit diagram of the memory control device according to the second embodiment. In the figure, 1 is a signal generation circuit, 7 is a buffer memory, 8 is a selector circuit, 3 is a signal processing circuit, 4 is a write counter, 5 is a read counter, and 9 is a memory control circuit. In FIG. 7, the same components as those in FIG. The memory control device in FIG. 7 is the same as the memory control device in FIG. 1 except that the buffer memory 2 and the memory control circuit 6 are replaced with a buffer memory 7 and a memory control circuit 9, respectively, and a selector circuit 8 is provided.
[0046]
The buffer memory 7 is composed of a single port DRAM. The selector circuit 8 switches and connects the data input / output port of the buffer memory 7 to the signal generation circuit 1 or the signal processing circuit 3. That is, the selector circuit 8 switches the data input / output path (read / write direction) of the buffer memory 7.
[0047]
Similar to the memory control circuit 6 of the first embodiment, the memory control circuit 9 is based on the WCUT and WCY output from the write counter 4 and the RCUT and RCY output from the read counter 5. The number of data input to the buffer memory 2 and not output from the buffer memory 2 is managed, and the operations of the signal generation circuit 1 and the signal processing circuit 3 are limited by the input wait signal W-WAIT and the output wait signal R-WAIT. Further, the memory control circuit 9 generates a write address and a read address of the buffer memory 7 for each data and outputs them to the buffer memory 7 and at the same time controls the selector circuit 8. That is, the write address is generated from the WCUT output from the write counter 4, the read address is generated from the RCUT output from the read counter 5, and switching of the data read / write direction by the selector circuit 8 is input. This is performed in synchronization with a clock twice the sampling frequency of data and output data.
[0048]
FIG. 8 is a block circuit diagram showing the configuration of the memory control circuit 9. In FIG. 8, the memory control circuit 9 includes a comparison circuit 11, a determination circuit 12, a write control circuit 13, a read control circuit 14, and an address generation circuit 25. In FIG. 8, the same components as those in FIG. The memory control circuit 9 is provided with an address generation circuit 25 in the memory control circuit of FIG. The address generation circuit 25 generates a clock W / R that is twice the sampling frequency of input data and output data, outputs the clock W / R to the selector circuit 8 and the buffer memory 7, and also counts the input data count value WCUT and the output data count value. A write address and a read address are generated based on RCUT, and these addresses are output to the buffer memory 7. Here, the selector circuit 8 switches the data input / output port of the buffer memory 7 to the signal generation circuit 1 side at the rising edge of the clock W / R, and the data input / output port to the signal processing circuit 3 side at the falling edge of the clock W / R. Shall be switched. The buffer memory 7 performs a data write operation during a period in which the clock W / R is at a high level, and performs a data read operation at a falling edge in a period in which the clock W / R is at a low level.
[0049]
Next, the operation will be described. FIG. 9 is an operation timing chart of the memory control device according to the third embodiment. 9, (a) is the write data (input data write timing) of the buffer memory 7, (b) is the count value WCUT of the number of input data, (c) is the carry bit WCY of WCUT, and (d) is the address generation. Clock W / R by the circuit 25, (e) is output data (read timing of stored data) from the buffer memory 7, (f) is a count value RCUT of the number of output data, (g) is a carry bit RCY of the RCUT, ( h) is an overtaking determination flag TFF, (i) is a comparison result by the comparison circuit 11, (j) is an input wait signal W-WAIT, and (k) is an output wait signal R-WAIT.
[0050]
In FIG. 9, when data is input from the signal generation circuit 1 to the buffer memory 7, the input data is written to the buffer memory 7 in synchronization with the rising edge of the clock W / R. When there is a data output request from the signal processing circuit 3, the data is read from the buffer memory 7 in synchronization with the falling edge of the clock W / R (see (a), (d), (e)). ).
[0051]
In addition, the WCUT, RCUT, WCY, RCY, TFF, comparison results by the comparison circuit 11, and the operations of W-WAIT and R-WAIT are the same as those in the first embodiment. WCUT and RCUT are each incremented according to the input / output of data, and when “FF” is reached, return to “0” by the next input / output of data (see (b) and (f)). WCY and RCY are each “1” during a period in which WCUT and RCUT are “FF” (see (c) and (g)). The overtaking determination flag TFF is set to “1” when WCY becomes “1”, and is reset to “0” when RCY becomes “0” (see (h)). The comparison result by the comparison circuit 11 becomes “0” when WCUT ≠ RCUT, and becomes “1” when WCUT = RCUT (see (i)). The input wait signal W-WAIT becomes “1” during a period in which TFF = 1 and WCUT = RCUT (see (j)), thereby restricting data input from the signal generation circuit 1. The output wait signal R-WAIT is “1” during the period in which TFF = 0 and WCUT = RCUT (see (k)), thereby limiting the data output request by the signal processing circuit 3.
[0052]
As described above, according to the third embodiment, as in the first embodiment, control of data input / output asynchronously can be realized with a small buffer memory capacity and a small hardware scale, and high-speed operation is possible. A simple memory control device can be realized, and an inexpensive memory control device can be realized by using a single-port memory.
[0053]
In the third embodiment, a single port DRAM is used as the buffer memory 7. However, it is not always necessary to use a DRAM, and a memory such as an SRAM may be used. In the third embodiment, the read / write direction of the buffer memory 7 is switched in units of one data. However, the direction is not necessarily in units of one data, and may be switched in arbitrary data units.
[0054]
【The invention's effect】
According to the memory control device of the first aspect of the present invention, the number of input / output data is counted by the input side counter and the output side counter, respectively, and the count values of both counters are compared. A flag that is set to “1” and reset to “0” when the output side counter makes a round is generated, both count values match based on the comparison result of the count value and the flag value, and the flag is set to “1”. The data input is limited when it is detected as "", and the data output is limited when both count values match and the flag is set to "0". There is an effect that it is possible to realize control of data with a small buffer memory capacity. In addition, since it is possible to determine whether or not to limit data input / output with a simple algorithm, control of data input / output asynchronously can be realized on a small hardware scale, and the time required for determination Therefore, it is possible to realize a memory control device that is short and can operate at high speed.
[0055]
According to the memory control device of the second aspect of the invention, it is possible to realize control of data blocks composed of m pieces of data input / output asynchronously with a small buffer memory capacity, and to input the number of input / output data blocks. By counting with the side counter and the output side counter, the hardware scale can be further reduced.
[0056]
According to the memory control device of the third aspect of the present invention, it is possible to realize a memory control device capable of controlling data input / output asynchronously with a small buffer memory capacity and a small hardware scale and capable of high-speed operation. In addition, since a single-port memory is used, an inexpensive memory control device can be realized.
[Brief description of the drawings]
FIG. 1 is a block circuit diagram showing a configuration of a memory control device according to a first embodiment of the present invention.
FIG. 2 is a block circuit diagram showing a configuration of a memory control circuit according to the first embodiment of the present invention.
FIG. 3 is an operation timing chart of the memory control device according to the first embodiment of the present invention.
FIG. 4 is an operation timing chart of the memory control device according to the first embodiment of the present invention.
FIG. 5 is an operation timing chart of the memory control device according to the second embodiment of the present invention;
FIG. 6 is an operation timing chart of the memory control device according to the second embodiment of the present invention.
FIG. 7 is a block circuit diagram showing a configuration of a memory control device according to a third embodiment of the present invention.
FIG. 8 is a block circuit diagram showing a configuration of a memory control circuit according to a third embodiment of the present invention.
FIG. 9 is an operation timing chart of the memory control device according to the third embodiment of the present invention.
FIG. 10 is a block circuit diagram showing a configuration of a conventional memory control device.
FIG. 11 is an operation timing chart of the conventional memory control device.
[Explanation of symbols]
2,7 buffer memory, 4 write counter, 5 read counter, 6,9 memory control circuit, 10 comparison circuit, 11 comparison circuit, 12 discrimination circuit, 13 write control circuit, 14 read control circuit.

Claims (3)

入力されたデータをバッファメモリに一時的に記憶し、入力されたデータとは異なるタイミングで前記バッファメモリからデータを出力するメモリ制御装置において、
入力データをカウントするn(nは正の整数)ビット幅の入力側カウンタと、
出力データをカウントするnビット幅の出力側カウンタと、
前記入力側カウンタと前記出力側カウンタのカウント値を比較する手段と、
前記入力側カウンタが一巡する際にフラグを“1”にセットし、前記出力側カウンタが一巡する際に前記フラグを“0”にリセットする手段と、
前記比較手段による比較結果と前記フラグ値とに基づいて、前記入力側カウンタと前記出力側カウンタのカウント値が一致し、かつ前記フラグが“1”になったことを検知すると前記バッファメモリへのデータの入力を制限する手段と、
前記比較手段による比較結果と前記フラグ値とに基づいて、前記入力側カウンタと前記出力側カウンタのカウント値が一致し、かつ前記フラグが“0”になったことを検知すると前記バッファメモリからのデータの出力を制限する手段と
を有する
ことを特徴としたメモリ制御装置。
In a memory control device that temporarily stores input data in a buffer memory and outputs data from the buffer memory at a timing different from the input data,
An input side counter of n (n is a positive integer) bit width for counting input data;
An n-bit output counter for counting output data;
Means for comparing count values of the input side counter and the output side counter;
Means for setting a flag to “1” when the input-side counter makes a round, and resetting the flag to “0” when the output-side counter makes a round;
Based on the comparison result by the comparison means and the flag value, when it is detected that the count values of the input-side counter and the output-side counter match and the flag is “1”, the buffer memory is read. A means of restricting data entry;
Based on the comparison result by the comparison means and the flag value, when it is detected that the count values of the input-side counter and the output-side counter match and the flag is “0”, the buffer memory reads And a memory control device for limiting data output.
請求項1記載のメモリ制御装置において、
入力されたm(mは2以上の整数)個のデータからなるデータブロックをバッファメモリに一時的に記憶し、入力されたデータとは異なるタイミングで前記バッファメモリから前記データブロックを出力し、
前記入力側カウンタが、前記入力データブロックをカウントし、
前記出力側カウンタが、前記出力データブロックをカウントする
ことを特徴としたメモリ制御装置。
The memory control device according to claim 1.
Temporarily storing in the buffer memory a data block consisting of input m (m is an integer of 2 or more) data, and outputting the data block from the buffer memory at a timing different from the input data,
The input-side counter counts the input data block;
The memory control device, wherein the output side counter counts the output data block.
請求項1記載のメモリ制御装置において、
前記バッファメモリが、シングルポートのメモリであり、
前記バッファメモリに対するデータの入出力経路を切り換える手段を有する
ことを特徴としたメモリ制御装置。
The memory control device according to claim 1.
The buffer memory is a single-port memory;
A memory control device comprising means for switching a data input / output path to the buffer memory.
JP00310398A 1998-01-09 1998-01-09 Memory control device Expired - Fee Related JP3871424B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP00310398A JP3871424B2 (en) 1998-01-09 1998-01-09 Memory control device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP00310398A JP3871424B2 (en) 1998-01-09 1998-01-09 Memory control device

Publications (2)

Publication Number Publication Date
JPH11203104A JPH11203104A (en) 1999-07-30
JP3871424B2 true JP3871424B2 (en) 2007-01-24

Family

ID=11548026

Family Applications (1)

Application Number Title Priority Date Filing Date
JP00310398A Expired - Fee Related JP3871424B2 (en) 1998-01-09 1998-01-09 Memory control device

Country Status (1)

Country Link
JP (1) JP3871424B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6223513B2 (en) * 2016-08-04 2017-11-01 株式会社三共 Game machine

Also Published As

Publication number Publication date
JPH11203104A (en) 1999-07-30

Similar Documents

Publication Publication Date Title
US5884099A (en) Control circuit for a buffer memory to transfer data between systems operating at different speeds
US5384744A (en) Look ahead flag for FIFO
JPH06259225A (en) Synchronizer of data transfer
US5594743A (en) Fifo buffer system having an error detection and correction device
JPS60179837A (en) Buffer circuit of receiving data
JP2551493B2 (en) Key signal delay device
JP3871424B2 (en) Memory control device
US6525980B1 (en) High speed FIFO synchronous programmable full and empty flag generation
JPS603714B2 (en) variable length shift register
US6445635B1 (en) High speed asynchronous and programmable state machine for generating almost empty synchronous flags in a synchronous FIFO
JP4569163B2 (en) Data input / output device and data input / output method
JP4355383B2 (en) Data accumulation monitoring device
JP2002084316A (en) Variable length packet write and read circuit
JP4696003B2 (en) Data transfer circuit
JP2870468B2 (en) Data transfer rate difference absorption method
JP2007524893A (en) Asynchronous jitter reduction technique
JP2000315381A (en) Circuit and method for generating pointer
US7116599B1 (en) High speed FIFO synchronous programmable full and empty flag generation
JP3256464B2 (en) Asynchronous transfer control method
JP2615004B2 (en) Integrated sequential access memory circuit
JP2000011637A (en) Fifo-type storage
JP2003273846A (en) Data taking-in circuit
JPH07253920A (en) Fifo ram controller
JPH01112449A (en) Speed converting memory device
JP2001188752A (en) Device and method for controlling asynchronous data transfer

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20040412

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20061010

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20061017

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

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20101027

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20111027

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20121027

Year of fee payment: 6

LAPS Cancellation because of no payment of annual fees