JP3700504B2 - Memory interface - Google Patents

Memory interface Download PDF

Info

Publication number
JP3700504B2
JP3700504B2 JP33456599A JP33456599A JP3700504B2 JP 3700504 B2 JP3700504 B2 JP 3700504B2 JP 33456599 A JP33456599 A JP 33456599A JP 33456599 A JP33456599 A JP 33456599A JP 3700504 B2 JP3700504 B2 JP 3700504B2
Authority
JP
Japan
Prior art keywords
data
memory
address
read
length
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
JP33456599A
Other languages
Japanese (ja)
Other versions
JP2001154908A (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.)
Panasonic Electric Works Co Ltd
Original Assignee
Matsushita Electric Works Ltd
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 Matsushita Electric Works Ltd filed Critical Matsushita Electric Works Ltd
Priority to JP33456599A priority Critical patent/JP3700504B2/en
Publication of JP2001154908A publication Critical patent/JP2001154908A/en
Application granted granted Critical
Publication of JP3700504B2 publication Critical patent/JP3700504B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明はメモリに対するデータの書き込み処理の空き時間を利用してメモリからデータの読み出し動作を行うためのメモリインターフェイスに関するものである。
【0002】
【従来の技術】
従来、メモリに対するデータの書き込みと読み出しは、CPU等の制御装置により管理され、通常は、データを処理してその結果をメモリに書き込むメインの動作を行いながら、時には割り込み処理によりメインの動作を一時停止させ、データを読み出すことが行われている。すなわち、メモリへのデータの書き込み優先であっても、メモリからデータの読み出しが行われているときは待ち信号を発生し、書き込みを一時的に停止させて、読み出し時間の確保が行われている。
【0003】
特開平4−133141号には、メモリのアクセス時間を測定し、それに基づいてメモリの読み出し制御を行う技術が提案されているが、これはメモリの種類に応じてアクセス時間が異なる場合に対処する技術であり、書き込まれるデータに応じて処理時間が異なる場合には対処できない。
【0004】
【発明が解決しようとする課題】
メモリに書き込まれるデータが、例えばデータの開始位置のアドレスと、データの長さを示すランレングスのデータである場合、データを処理してその結果をメモリに書き込む装置は、ランレングスの長いデータでは書き込みの間に長い空き時間が生じるのに対して、ランレングスの短いデータでは書き込みの間に空き時間は殆ど生じない。このように、データを処理してその結果をメモリに書き込む装置において、そのデータの処理時間が一定でない場合には、データの書き込み動作の間を利用してデータの読み出し動作を行う所謂サイクルスチールが常に可能であるとは限らない。
【0005】
本発明はこのような点に鑑みてなされたものであり、データの処理時間が一定していない場合であっても、データを処理してその結果をメモリに書き込むメインの動作を停止させることなく、メモリからデータを読み出すことを可能とするメモリインターフェイスを提供することを課題とする。
【0006】
【課題を解決するための手段】
本発明のメモリインターフェイスによれば、上記の課題を解決するために、図1に示すように、データを処理してその結果をメモリに書き込む装置において、データの変化を検出してメモリ3に書き込まれるデータの処理を開始するタイミングを判定する微分回路21と、微分回路21の出力によりリセットされてメモリ3に書き込まれるデータの処理に要する時間をカウントするカウンタ22と、該カウンタ22の値が所定値以上であることを検知する検知回路23と、検知回路23によりカウンタ22の値が所定値以上であることが検知され、且つデータの読み出し要求があればメモリ3からデータを読み出すメモリリード制御部24とを備えることを特徴とするものである。ここで、メモリ3に書き込まれるデータは、例えば、データの開始位置のアドレスと、データの長さを示すランレングスのデータであり、データの処理に要する時間はランレングスに応じて変動する場合に本発明を適用すれば特に好ましい。
【0007】
【発明の実施の形態】
図1は本発明のメモリインターフェイスの回路構成例を示している。図中、1は制御部、2はメモリインターフェイス、3はメモリである。メモリ3は、チップセレクト信号CSがLowレベルであるときに、メモリリード信号ReadがHighレベルからLowレベルに変化すると、アドレスバスで指定されたメモリアドレスのデータをデータバスに読み出す動作を行う。また、チップセレクト信号CSがLowレベルであるときに、メモリライト信号WriteがHighレベルからLowレベルに変化すると、アドレスバスで指定されたメモリアドレスにデータバス上のデータを書き込む動作を行う。メモリインターフェイス2は、制御部1とメモリ3の間に介在し、制御部1からの読み出し要求があると、メモリ3が書き込み動作中であっても、データを書き込んでいないタイミングを自動的に検出して、その検出した読み出し可能な時間幅でメモリ3からデータを読み出すことにより、データを処理してその結果をメモリ3に書き込むメインの動作を停止させることなく、メモリ3からデータを読み出すことを可能とする。
【0008】
図2は図1に示すメモリインターフェイスの動作波形図である。この例は、データのランレングスデータを抽出し、メモリ3に保存する構成になっていて、連続する2回の書き込みで、そのデータの開始位置を示すアドレスとデータの続く長さの情報を保存している。読み出し側も2回の読み出しを実行するシステムである。書き込み側がデータを2段シフトしているのは、2回連続でデータを書くシステムのためである。
【0009】
まず、書き込み時の動作(イ)について説明する。図中、B,I,O,Sなどはデータの開始位置を示すアドレスのデータであり、それに続くa,d,f,…などはデータの長さ(ランレングスデータ)を意味する。例えば、メモリ書き込みデータとしてのB,aは、データの開始位置のアドレスがBで、このアドレスBから開始されるデータの長さがaであることを意味する。これらのデータB,aはメモリ3のアドレス0,1に連続して書き込まれる。また、メモリ書き込みデータとしてのI,dは、データの開始位置のアドレスがIで、このアドレスIから開始されるデータの長さがdであることを意味する。これらのデータI,dはメモリ3のアドレス2,3に連続して書き込まれる。同様に、メモリ書き込みデータとしてのO,fは、データの開始位置のアドレスがOで、このアドレスOから開始されるデータの長さがfであることを意味する。これらのデータO,fはメモリ3のアドレス4,5に連続して書き込まれる。
【0010】
メモリライト信号が立ち下がるタイミングでは、メモリ3のチップセレクト信号CSがLowレベルとなっており、1回目のメモリライト信号の立ち下がりで、アドレスデータBがメモリ3のアドレス0に書き込まれ、2回目のメモリライト信号の立ち下がりで、データaがメモリ3のアドレス1に書き込まれ、しばらく間を置いて、3回目のメモリライト信号の立ち下がりで、アドレスデータIがメモリ3のアドレス2に書き込まれ、4回目のメモリライト信号の立ち下がりで、データdがメモリ3のアドレス3に書き込まれ、しばらく間を置いて、5回目のメモリライト信号の立ち下がりで、アドレスデータOがメモリ3のアドレス4に書き込まれ、6回目のメモリライト信号の立ち下がりで、データfがメモリ3のアドレス5に書き込まれる。
【0011】
次に、読み出し時の動作(ロ)について説明する。メモリリード信号が立ち下がるタイミングでは、メモリ3のチップセレクト信号CSがLowレベルとなっている。メモリリード信号がLowレベルである期間において、メモリアドレスが0であると、メモリ3のアドレス0のデータがメモリ読み出しデータBとして読み出され、メモリアドレスが1になると、メモリ3のアドレス1のデータがメモリ読み出しデータBaとして読み出される。ここで、データBaはアドレスBから開始されるデータの長さがaであることを意味している。次に、メモリリード信号がLowレベルである期間において、メモリアドレスが2であると、メモリ3のアドレス2のデータがメモリ読み出しデータIとして読み出され、メモリアドレスが3になると、メモリ3のアドレス3のデータがメモリ読み出しデータIdとして読み出される。ここで、データIdはアドレスIから開始されるデータの長さがdであることを意味している。
【0012】
以上の説明から明らかなように、図2の動作波形において、メモリアドレス0,1,2,3,4,5,6,…等はメモリ3のアドレスを指しており、図2の上から2段目に記載されたアドレスA,B,C,…,U,V,W,…は、メモリ3にデータの開始位置とデータの長さを保存しておかれる第2のメモリのアドレスを指している。メモリ3のメモリアドレス0,1からデータの開始位置のアドレスBと、そのデータの長さaを読み出すことにより、第2のメモリのアドレスBから長さaのデータが格納されていることが分かる仕組みとなっている。同様に、メモリ3のメモリアドレス2,3からデータの開始アドレスIと、そのデータの長さdを読み出すことにより、第2のメモリのアドレスIから長さdのデータが格納されていることが分かる仕組みとなっている。
【0013】
ここで、メモリインターフェイスの機能は、図2に示す書き込み時の動作(イ)と読み出し時の動作(ロ)を実現することにあり、そのために、メモリインターフェイスはメモリ書き込み時には、図2(イ)に示すように、メモリアドレスを0,1,2,3,4,5,…のように順次変化させ、メモリ書き込みデータをB,a,I,d,O,f,…のように順次変化させている。このようなメモリ書き込み動作を実行している途中でメモリ3に対する読み出し要求が制御部1から発生すると、従来は、一連のメモリ書き込み動作を一時停止させて、図2(ロ)に示す読み出し時の動作を行うことにより、メモリ3からデータを読み出していた。しかしながら、図2(イ)のメモリ書き込み時の動作を見れば分かるように、2回の連続したメモリライト信号によりメモリ3のアドレス0,1にデータB,aを書き込んだ後、しばらく間を置いて、再び2回の連続したメモリライト信号によりメモリ3のアドレス2,3にデータI,dを書き込んでおり、その間、メモリ3のアドレスは次回の書き込みに備えて、アドレス2の状態に保持されており、メモリ3への書き込みデータは最後に書き込んだデータaが保持されている。
【0014】
このような状態が生じる理由は、この実施例の場合について言えば、メモリ3に格納されるデータがランレングスデータであるという特有の事情に基づくものであり、データの開始アドレスBから次のデータの開始アドレスIまでの間、さらに次のデータの開始アドレスOまで間に、それぞれ時間が掛かるからである。もちろん、この実施例とは異なる他のシステムであっても、書き込み動作中にメモリのアドレスとデータが変化しない空き時間が生じることはあり得る。
【0015】
そこで、本発明では、図2の動作波形における書き込み時の動作(イ)と読み出し時の動作(ロ)を組み合わせて、図2の(ハ)に示すように、書き込み動作中であっても、メモリ3のアドレスとデータが空いている時間を検出して、その時間に読み出し動作を行うようにしている。この例では、説明を簡単にするために、直前の書き込み動作により書き込まれたデータを読み出す動作を行っているが、別のデータを読み出す動作を行うものであっても構わない。
【0016】
以下、図2の(ハ)の動作について説明する。メモリライト信号が立ち下がるタイミングでは、メモリ3のチップセレクト信号CSがLowレベルとなっており、1回目のメモリライト信号の立ち下がりで、データBがメモリ3のアドレス0に書き込まれ、2回目のメモリライト信号の立ち下がりで、データaがメモリ3のアドレス1に書き込まれる。メモリ3のチップセレクト信号CSがLowレベルのままで、メモリアドレスが0となり、メモリリード信号がLowレベルになると、メモリ3のアドレス0のデータがメモリ読み出しデータBとして読み出され、メモリアドレスが1になると、メモリ3のアドレス1のデータがメモリ読み出しデータaとして読み出される。メモリ3のチップセレクト信号CSとメモリリード信号がHighレベルとなり、しばらく間を置いて、再びメモリ3のチップセレクト信号CSがLowレベルとなり、3回目のメモリライト信号の立ち下がりで、データIがメモリ3のアドレス2に書き込まれ、4回目のメモリライト信号の立ち下がりで、データdがメモリ3のアドレス3に書き込まれる。メモリ3のチップセレクト信号CSがLowレベルのままで、メモリアドレスが2となり、メモリリード信号がLowレベルになると、メモリ3のアドレス2のデータがメモリ読み出しデータIとして読み出され、メモリアドレスが3になると、メモリ3のアドレス3のデータがメモリ読み出しデータdとして読み出される。メモリ3のチップセレクト信号CSとメモリリード信号がHighレベルとなり、しばらく間を置いて、再びメモリ3のチップセレクト信号CSがLowレベルとなり、5回目のメモリライト信号の立ち下がりで、データOがメモリ3のアドレス4に書き込まれ、6回目のメモリライト信号の立ち下がりで、データfがメモリ3のアドレス5に書き込まれる。
【0017】
ところで、このような書き込み動作と読み出し動作を組み合わせることは常に可能であるとは限らない。その理由は、この実施例について言えば、メモリ3に格納されるデータがランレングスデータであるという特有の事情に基づくものであり、データの開始位置とその長さをメモリ3に格納していくときに、データの間隔が十分に長ければ、次のデータの開始位置とその長さを格納するタイミングが来るまでに空き時間が生じるが、データの間隔が短いと、次のデータの開始位置とその長さを格納するタイミングは直ぐに到来してしまうので、十分な空き時間は生じない。例えば、図2の動作波形で説明すると、データの開始位置がアドレスBであり、そのデータの長さがaである場合と、データの開始位置がアドレスIであり、そのデータの長さがdである場合には、十分な空き時間が生じているが、データの開始位置がアドレスOであり、そのデータの長さがfである場合については、次のデータの開始位置(アドレスS)までの間に十分な時間が無く、その間に読み出し動作を挿入することはできない。
【0018】
そこで、この実施例では、単純に書き込み動作と読み出し動作を交互に行うのではなく、図1に示すように、微分回路21、カウンタ22、検知部23、メモリリード制御部24を設けて、メモリ読み出し動作の可否を自動的に判定している。読み出し側の時間幅の検知の方法は、図2の読み出し時の動作(ロ)に示す入力データと、これをシフトレジスタにより1サイクル分遅延させたデータシフト1により微分回路21を構成し、立ち下がり側に、1クロックサイクル分だけイネーブル信号が出るようにしてある。つまり、データシフト1がHighレベルで、入力データがLowレベルである期間にのみ微分回路21はHighレベルの信号を出力する。この信号をタイミングカウント用のカウンタ22のリセット信号としており、信号の立ち下がりのタイミングでカウンタ22をリセットしている。タイミングカウントのカウンタ22の値が4以上(2回の読み出しを行うため5サイクル分の時間幅が必要)になったとき、読み出し動作が行われる。一連の読み出しが終わったときにも、タイミングカウント用のカウンタ22の値が4以上であれば、続けて読み出しが行われる。したがって、開始アドレスの間隔の短いデータの書き込みにより空き時間が少なく、そのときはデータの読み出しが出来なくても、その後、開始アドレスの間隔の長いデータの書き込みにより空き時間が多く生じたときに、データの読み出しを何回も行うことができる。この繰り返しは、読み出し側のメモリアドレスと書き込み側のメモリアドレスによって制御され、読み出し側のアドレスが書き込み側のアドレスを越えないようになっている。
【0019】
次に、以上のようなハードウェアが具体的にはどのような用途に適用できるかについて一例を挙げて説明する。図3(a)のA,B,C,D,…は画像メモリの画素アドレスを意味しており、これが図2のアドレスA,B,C,D,…に対応しているものとする。図3(a)の画像メモリの各画素を2値化したデータが例えば図3(b)のようになったとする。図3(b)の白い四角□はその画素アドレスの画素値を2値化したデータが0であることを意味し、図3(b)の黒い四角■はその画素アドレスの画素値を2値化したデータが1であることを意味するものとする。これが図2のアドレスA,B,C,D,…の下に併記したデータの1,0に対応しているものとする。次に、図3(c)に示されたB,2,I,2,O,1,S,1,…というリストデータは、図3(a)の画素アドレスBから2個のデータが存在し、画素アドレスIから2個のデータが存在し、画素アドレスOから1個のデータが存在し、画素アドレスSから1個のデータが存在することを意味しており、これが図1のメモリ3に格納されるデータに対応している。2値化データに白地が多い場合やランレングスが大きなデータが存在する場合には、図3(c)のリスト構造のデータを作成するメリットがある。
【0020】
さて、このような用途について、データの開始位置やデータの長さを検出する方法について、図2の書き込み時の動作(イ)を参照しながら説明する。図2(イ)において、データシフト2は入力データをシフトレジスタにより2サイクル分遅延させたデータであり、データシフト3は入力データをシフトレジスタにより3サイクル分遅延させたデータである。データシフト3が立ち上がると、位置データ取込タイミング信号が立ち上がり、1サイクルの時間で位置データ取り込みタイミング信号は立ち下がる。このとき、開始アドレスの位置データが取り込まれると同時に、長さカウントが開始される。次に、データシフト3が立ち下がると、長さ検出タイミング信号が立ち上がり、長さカウントのデータが読み込まれる。長さ検出タイミング信号は1サイクルの時間で立ち下がり、このとき、長さカウントのデータはリセットされる。
【0021】
【発明の効果】
請求項1の発明によれば、データを処理してその結果をメモリに書き込む装置において、データの変化を検出してメモリに書き込まれるデータの処理を開始するタイミングを判定する微分回路と、微分回路の出力によりリセットされてメモリに書き込まれるデータの処理に要する時間をカウントするカウンタと、該カウンタの値が所定値以上であることを検知する検知回路と、検知回路によりカウンタの値が所定値以上であることが検知され、且つデータの読み出し要求があればメモリからデータを読み出すメモリリード制御部とを備えるものであるから、データを処理してその結果をメモリに書き込むメインの動作を停止させることなく、読み出し要求があると時間幅を回路自身で自動的に検知し、データを読み出すことができる。
【0022】
請求項2の発明によれば、メモリに書き込まれるデータは、データの開始位置のアドレスと、データの長さを示すランレングスのデータであり、データの処理に要する時間はランレングスに応じて変動するものであるから、本発明のメモリインターフェイスを用いれば、データを処理してその結果をメモリに書き込むメインの動作には全く影響することなく、ランレングスの長いデータの処理により生じた空き時間を利用してメモリの読み出し動作を行うことができる。
【図面の簡単な説明】
【図1】本発明のメモリインターフェイスの回路構成図である。
【図2】本発明のメモリインターフェイスの動作波形図である。
【図3】本発明のメモリインターフェイスを画像処理に応用した場合の動作説明図である。
【符号の説明】
1 制御部
2 メモリインターフェイス
3 メモリ
21 微分回路
22 カウンタ
23 検知回路
24 メモリリード制御部
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a memory interface for performing a data read operation from a memory by using a free time of a data write process to the memory.
[0002]
[Prior art]
Conventionally, the writing and reading of data to and from the memory are managed by a control device such as a CPU. Usually, the main operation is temporarily performed by interrupt processing while processing the data and writing the result into the memory. Stopping and reading data is performed. That is, even if priority is given to writing data to the memory, a waiting signal is generated when data is being read from the memory, and writing is temporarily stopped to ensure the reading time. .
[0003]
Japanese Patent Application Laid-Open No. 4-133141 proposes a technique for measuring the memory access time and performing memory read control based on the measured memory access time, which deals with the case where the access time differs depending on the type of memory. This is a technology and cannot be handled when the processing time differs depending on the data to be written.
[0004]
[Problems to be solved by the invention]
If the data written to the memory is, for example, run-length data indicating the address of the start position of the data and the length of the data, the device that processes the data and writes the result to the memory is not long-run data. While a long idle time occurs during writing, data having a short run length hardly causes an idle time during writing. In this way, in a device that processes data and writes the result to the memory, if the data processing time is not constant, a so-called cycle steal that performs a data read operation using the data write operation is performed. It is not always possible.
[0005]
The present invention has been made in view of such points, and even when the data processing time is not constant, the main operation of processing the data and writing the result into the memory is not stopped. An object of the present invention is to provide a memory interface capable of reading data from a memory.
[0006]
[Means for Solving the Problems]
According to the memory interface of the present invention, in order to solve the above problem, as shown in FIG. 1, in a device that processes data and writes the result in the memory, a change in the data is detected and written in the memory 3. Differentiating circuit 21 for determining the timing of starting the processing of the data to be processed, a counter 22 for counting the time required for processing the data that is reset by the output of the differentiating circuit 21 and written to the memory 3, and the value of the counter 22 is predetermined. A detection circuit 23 that detects that the value is equal to or greater than the value, and a memory read control unit that reads the data from the memory 3 if the detection circuit 23 detects that the value of the counter 22 is equal to or greater than the predetermined value and there is a data read request. 24. Here, the data written in the memory 3 is, for example, the address of the start position of the data and the run length data indicating the length of the data, and the time required for processing the data varies depending on the run length. It is particularly preferable to apply the present invention.
[0007]
DETAILED DESCRIPTION OF THE INVENTION
FIG. 1 shows a circuit configuration example of a memory interface of the present invention. In the figure, 1 is a control unit, 2 is a memory interface, and 3 is a memory. If the memory read signal Read changes from the High level to the Low level when the chip select signal CS is at the Low level, the memory 3 performs an operation of reading data at the memory address specified by the address bus to the data bus. Further, when the memory select signal Write changes from the High level to the Low level when the chip select signal CS is at the Low level, the operation of writing data on the data bus to the memory address specified by the address bus is performed. The memory interface 2 is interposed between the control unit 1 and the memory 3, and when there is a read request from the control unit 1, the timing at which data is not written is automatically detected even if the memory 3 is performing a write operation. Then, by reading the data from the memory 3 with the detected readable time width, the data can be read from the memory 3 without stopping the main operation of processing the data and writing the result into the memory 3. Make it possible.
[0008]
FIG. 2 is an operation waveform diagram of the memory interface shown in FIG. In this example, the run length data of the data is extracted and stored in the memory 3, and the address indicating the start position of the data and the length information following the data are stored by two consecutive writes. doing. The reading side is also a system that executes two readings. The writing side shifts the data by two stages because it is a system that writes data continuously twice.
[0009]
First, the operation (a) at the time of writing will be described. In the figure, B, I, O, S, etc. are data at addresses indicating the start position of data, and a, d, f,... Following the data mean the length of data (run-length data). For example, B and a as memory write data means that the address of the data start position is B and the length of data starting from this address B is a. These data B and a are written continuously at addresses 0 and 1 of the memory 3. Further, I and d as memory write data means that the address of the start position of data is I and the length of data starting from this address I is d. These data I and d are written continuously at addresses 2 and 3 of the memory 3. Similarly, O and f as memory write data means that the address of the start position of data is O and the length of data starting from this address O is f. These data O and f are written continuously at addresses 4 and 5 of the memory 3.
[0010]
At the timing when the memory write signal falls, the chip select signal CS of the memory 3 is at the low level, and at the fall of the first memory write signal, the address data B is written to the address 0 of the memory 3 and the second time. The data a is written to the address 1 of the memory 3 at the falling edge of the memory write signal, and the address data I is written to the address 2 of the memory 3 at the falling edge of the third memory write signal after a while. The data d is written to the address 3 of the memory 3 at the falling edge of the fourth memory write signal. After a while, the address data O becomes the address 4 of the memory 3 at the falling edge of the fifth memory write signal. And data f is written to address 5 of the memory 3 at the falling edge of the sixth memory write signal. It is.
[0011]
Next, the operation (b) at the time of reading will be described. At the timing when the memory read signal falls, the chip select signal CS of the memory 3 is at the low level. When the memory read signal is low level, if the memory address is 0, the data at address 0 in the memory 3 is read as the memory read data B, and if the memory address is 1, the data at address 1 in the memory 3 is read. Is read as memory read data Ba. Here, data Ba means that the length of data starting from address B is a. Next, in the period when the memory read signal is at the low level, if the memory address is 2, the data at address 2 of the memory 3 is read as the memory read data I, and if the memory address becomes 3, the address of the memory 3 is read. 3 data is read as memory read data Id. Here, data Id means that the length of data starting from address I is d.
[0012]
As apparent from the above description, in the operation waveform of FIG. 2, the memory addresses 0, 1, 2, 3, 4, 5, 6,... Indicate the addresses of the memory 3, and 2 from the top of FIG. The addresses A, B, C,..., U, V, W,... Described in the row indicate the addresses of the second memory in which the data start position and the data length are stored in the memory 3. ing. By reading the address B of the data start position from the memory addresses 0 and 1 of the memory 3 and the length a of the data, it can be seen that the data of the length a is stored from the address B of the second memory. It is a mechanism. Similarly, by reading the data start address I and the data length d from the memory addresses 2 and 3 of the memory 3, data of the length d from the address I of the second memory is stored. It is a mechanism to understand.
[0013]
Here, the function of the memory interface is to realize the operation (a) at the time of writing and the operation (b) at the time of reading (b) shown in FIG. As shown, the memory address is sequentially changed as 0, 1, 2, 3, 4, 5,..., And the memory write data is sequentially changed as B, a, I, d, O, f,. I am letting. When a read request to the memory 3 is generated from the control unit 1 while such a memory write operation is being performed, conventionally, a series of memory write operations are temporarily stopped to perform a read operation shown in FIG. Data was read from the memory 3 by performing the operation. However, as can be seen from the operation at the time of memory writing in FIG. 2A, after data B and a are written to the addresses 0 and 1 of the memory 3 by two consecutive memory write signals, there is a short pause. Then, the data I and d are written to the addresses 2 and 3 of the memory 3 again by two consecutive memory write signals. During this time, the address of the memory 3 is held in the address 2 state in preparation for the next writing. As the data written to the memory 3, the last written data a is held.
[0014]
The reason why such a state occurs is, in the case of this embodiment, based on the specific situation that the data stored in the memory 3 is run-length data. This is because it takes time until the next start address I and further until the start address O of the next data. Of course, even in another system different from this embodiment, it is possible that an idle time in which the memory address and data do not change occurs during the write operation.
[0015]
Therefore, in the present invention, as shown in (c) of FIG. 2, by combining the operation at the time of writing (A) and the operation at the time of reading (B) in the operation waveform of FIG. The time when the address and data in the memory 3 are free is detected, and the read operation is performed at that time. In this example, in order to simplify the explanation, the operation of reading the data written by the immediately preceding write operation is performed, but the operation of reading another data may be performed.
[0016]
Hereinafter, the operation of FIG. 2C will be described. At the timing when the memory write signal falls, the chip select signal CS of the memory 3 is at the low level, and at the fall of the first memory write signal, the data B is written to the address 0 of the memory 3 and the second time. Data a is written to address 1 of the memory 3 at the falling edge of the memory write signal. When the chip select signal CS of the memory 3 remains low level, the memory address becomes 0, and when the memory read signal becomes low level, the data at address 0 of the memory 3 is read as the memory read data B, and the memory address is 1 Then, data at address 1 in the memory 3 is read as memory read data a. The chip select signal CS and the memory read signal of the memory 3 become the high level, and after a while, the chip select signal CS of the memory 3 again becomes the low level, and the data I is stored in the memory at the fall of the third memory write signal. 3 is written to address 2 and data d is written to address 3 of the memory 3 at the falling edge of the fourth memory write signal. When the chip select signal CS of the memory 3 remains low level, the memory address becomes 2, and when the memory read signal becomes low level, the data at the address 2 of the memory 3 is read as the memory read data I, and the memory address is 3 Then, data at address 3 in the memory 3 is read as memory read data d. The chip select signal CS and the memory read signal of the memory 3 become the high level, and after a while, the chip select signal CS of the memory 3 becomes the low level again, and the data O becomes the memory at the falling edge of the fifth memory write signal. 3 is written to address 4 and data f is written to address 5 of the memory 3 at the falling edge of the sixth memory write signal.
[0017]
By the way, it is not always possible to combine such a write operation and a read operation. The reason for this is based on the specific situation that the data stored in the memory 3 is run-length data in this embodiment, and the start position and length of the data are stored in the memory 3. Sometimes, if the data interval is long enough, there will be free time before the next data start position and the timing to store the length, but if the data interval is short, the next data start position Since the timing for storing the length comes immediately, there is not enough free time. For example, referring to the operation waveform of FIG. 2, the data start position is address B and the data length is a, and the data start position is address I and the data length is d. In the case where there is sufficient free time, when the data start position is the address O and the length of the data is f, the next data start position (address S) is reached. There is not enough time between them and no read operation can be inserted between them.
[0018]
Therefore, in this embodiment, instead of simply performing the write operation and the read operation alternately, as shown in FIG. 1, a differentiation circuit 21, a counter 22, a detection unit 23, and a memory read control unit 24 are provided, Whether the read operation is possible is automatically determined. The method of detecting the time width on the read side is configured by configuring the differentiation circuit 21 by the input data shown in the operation (b) at the time of reading in FIG. 2 and the data shift 1 delayed by one cycle by the shift register. On the lower side, an enable signal is output for one clock cycle. That is, the differentiation circuit 21 outputs a high level signal only during a period when the data shift 1 is at a high level and the input data is at a low level. This signal is used as a reset signal for the counter 22 for timing counting, and the counter 22 is reset at the falling timing of the signal. When the value of the counter 22 of the timing count becomes 4 or more (a time width of 5 cycles is necessary for performing the reading twice), the reading operation is performed. Even when a series of reading is finished, if the value of the counter 22 for timing count is 4 or more, the reading is continued. Therefore, there is little free time by writing data with a short start address interval, and even when data cannot be read at that time, when there is a lot of free time after writing data with a long start address interval, Data can be read many times. This repetition is controlled by the memory address on the reading side and the memory address on the writing side, so that the address on the reading side does not exceed the address on the writing side.
[0019]
Next, an example of how the above hardware can be applied will be described. In FIG. 3A, A, B, C, D,... Mean pixel addresses of the image memory, and these correspond to the addresses A, B, C, D,. Assume that the data obtained by binarizing each pixel of the image memory in FIG. 3A is as shown in FIG. The white square □ in FIG. 3B means that the data obtained by binarizing the pixel value of the pixel address is 0, and the black square ■ in FIG. 3B is a binary value of the pixel address of the pixel address. It means that the digitized data is 1. It is assumed that this corresponds to data 1 and 0 shown below addresses A, B, C, D,. Next, the list data B, 2, I, 2, O, 1, S, 1,... Shown in FIG. 3 (c) has two data from the pixel address B in FIG. This means that there are two data from the pixel address I, one data from the pixel address O, and one data from the pixel address S, which is the memory 3 in FIG. Corresponds to the data stored in. When the binarized data has many white backgrounds or data with a large run length, there is an advantage of creating data having a list structure shown in FIG.
[0020]
Now, for such applications, a method for detecting the start position of data and the length of data will be described with reference to the write operation (a) in FIG. In FIG. 2A, data shift 2 is data obtained by delaying input data by two cycles by the shift register, and data shift 3 is data obtained by delaying input data by three cycles by the shift register. When the data shift 3 rises, the position data take-in timing signal rises and the position data take-in timing signal falls in one cycle time. At this time, the position data of the start address is fetched, and at the same time, the length count is started. Next, when the data shift 3 falls, the length detection timing signal rises and the length count data is read. The length detection timing signal falls in one cycle time, and at this time, the length count data is reset.
[0021]
【The invention's effect】
According to the first aspect of the present invention, in the device for processing data and writing the result into the memory, the differentiation circuit for detecting the change of the data and determining the timing of starting the processing of the data written to the memory, and the differentiation circuit Counter that counts the time required to process the data that is reset and output to the memory, a detection circuit that detects that the value of the counter is greater than or equal to a predetermined value, and a counter value that is greater than or equal to the predetermined value by the detection circuit And a memory read control unit that reads data from the memory if there is a data read request, the main operation of processing the data and writing the result into the memory is stopped. If there is a read request, the circuit can automatically detect the time width and read the data.
[0022]
According to the second aspect of the present invention, the data to be written in the memory is the data of the start position of the data and the run length data indicating the length of the data, and the time required for processing the data varies depending on the run length. Therefore, if the memory interface of the present invention is used, the free time caused by the processing of data with a long run length can be reduced without affecting the main operation of processing the data and writing the result into the memory. A memory read operation can be performed by using this.
[Brief description of the drawings]
FIG. 1 is a circuit configuration diagram of a memory interface of the present invention.
FIG. 2 is an operation waveform diagram of the memory interface of the present invention.
FIG. 3 is an operation explanatory diagram when the memory interface of the present invention is applied to image processing;
[Explanation of symbols]
DESCRIPTION OF SYMBOLS 1 Control part 2 Memory interface 3 Memory 21 Differentiation circuit 22 Counter 23 Detection circuit 24 Memory read control part

Claims (2)

データを処理してその結果をメモリに書き込む装置において、データの変化を検出してメモリに書き込まれるデータの処理を開始するタイミングを判定する微分回路と、微分回路の出力によりリセットされてメモリに書き込まれるデータの処理に要する時間をカウントするカウンタと、該カウンタの値が所定値以上であることを検知する検知回路と、検知回路によりカウンタの値が所定値以上であることが検知され、且つデータの読み出し要求があればメモリからデータを読み出すメモリリード制御部とを備えることを特徴とするメモリインターフェイス。In a device that processes data and writes the result to memory, a differentiation circuit that detects a change in data and determines the timing of starting processing of data written to the memory, and is reset by the output of the differentiation circuit and written to the memory A counter that counts the time required to process the data to be processed, a detection circuit that detects that the value of the counter is greater than or equal to a predetermined value, and the detection circuit detects that the value of the counter is greater than or equal to the predetermined value and data And a memory read control unit that reads data from the memory when there is a read request. メモリに書き込まれるデータは、データの開始位置のアドレスと、データの長さを示すランレングスのデータであり、データの処理に要する時間はランレングスに応じて変動することを特徴とする請求項1のメモリインターフェイス。The data written in the memory is run-length data indicating the address of the start position of the data and the length of the data, and the time required for processing the data varies according to the run-length. Memory interface.
JP33456599A 1999-11-25 1999-11-25 Memory interface Expired - Lifetime JP3700504B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP33456599A JP3700504B2 (en) 1999-11-25 1999-11-25 Memory interface

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP33456599A JP3700504B2 (en) 1999-11-25 1999-11-25 Memory interface

Publications (2)

Publication Number Publication Date
JP2001154908A JP2001154908A (en) 2001-06-08
JP3700504B2 true JP3700504B2 (en) 2005-09-28

Family

ID=18278834

Family Applications (1)

Application Number Title Priority Date Filing Date
JP33456599A Expired - Lifetime JP3700504B2 (en) 1999-11-25 1999-11-25 Memory interface

Country Status (1)

Country Link
JP (1) JP3700504B2 (en)

Also Published As

Publication number Publication date
JP2001154908A (en) 2001-06-08

Similar Documents

Publication Publication Date Title
KR940011670B1 (en) Interrupt controller
JP3700504B2 (en) Memory interface
JP2711111B2 (en) Data processing device, measuring method and control method
JP2789900B2 (en) State history storage device
JP2804406B2 (en) Pulse measuring device
KR100304290B1 (en) Fail Search Circuit
JPH06202715A (en) State change detecting and recording circuit
JPH03296104A (en) Programmable controller system
JPH03119449A (en) Calculating device
JP3691340B2 (en) Memory access control circuit
JPH07105048B2 (en) Eye pattern detection circuit
JP3207890B2 (en) Memory access method for waveform storage device
JP3523059B2 (en) Horizontal synchronization signal frequency detection method and horizontal synchronization signal frequency detection circuit
KR19980028915U (en) Micom's timer input capture device
JPH0229457Y2 (en)
JP3939078B2 (en) Data write control circuit
JPH0721838B2 (en) Measuring device
JPH04236576A (en) Run pattern extracting device
JPH0581052A (en) Microprocessor runaway check circuit
JPH01228375A (en) Image processing rum length coding circuit
JPH0830502A (en) Circuit for continuous writing in flash memory
JPH0530967U (en) Image processing device
JPH0568143B2 (en)
JPH07231488A (en) State change detection system
JPH01274260A (en) Adapter for controlling input/output

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20050610

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20050704

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

Year of fee payment: 4

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

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

Free format text: PAYMENT UNTIL: 20090722

Year of fee payment: 4

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

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

Free format text: PAYMENT UNTIL: 20090722

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20100722

Year of fee payment: 5