JP3700561B2 - Buffer control device - Google Patents

Buffer control device Download PDF

Info

Publication number
JP3700561B2
JP3700561B2 JP2000260398A JP2000260398A JP3700561B2 JP 3700561 B2 JP3700561 B2 JP 3700561B2 JP 2000260398 A JP2000260398 A JP 2000260398A JP 2000260398 A JP2000260398 A JP 2000260398A JP 3700561 B2 JP3700561 B2 JP 3700561B2
Authority
JP
Japan
Prior art keywords
memory
buffer
empty
control circuit
data
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
JP2000260398A
Other languages
Japanese (ja)
Other versions
JP2002073537A (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 Corp
Panasonic Holdings Corp
Original Assignee
Panasonic Corp
Matsushita Electric Industrial Co 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 Panasonic Corp, Matsushita Electric Industrial Co Ltd filed Critical Panasonic Corp
Priority to JP2000260398A priority Critical patent/JP3700561B2/en
Publication of JP2002073537A publication Critical patent/JP2002073537A/en
Application granted granted Critical
Publication of JP3700561B2 publication Critical patent/JP3700561B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Information Transfer Systems (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、マイコンと周辺回路とのデータ転送速度の速度差を吸収するためのバッファ回路に対して、特にダブルバッファ構成の場合に適用して好適なバッファ制御装置に関する。
【0002】
【従来の技術】
フラッシュメモリカード等を用いる機器では、カードとマイコンとの間でデータ転送を行うインターフェース回路が必要になる。一般にバス幅も小さく転送速度の遅いメモリカードに対して、アプリケーションも実行するマイコンは高速な場合が多い。低速なメモリカードとのデータ転送によって機器全体の能力低下を招いてしまわないように、インターフェース回路では転送速度差を吸収するためのバッファが設けられているのが普通である。
【0003】
まず、従来のシングルバッファ構成のインターフェース回路について説明する。図5はシングルバッファ構成のバッファ制御部を示すブロック図である。図5において、システムバス(system bus)1はアドレス、データ、リード・ライト信号、割り込み信号等からなるホストマイコンの外部バスであり、ホストインターフェース(Host I/F)2はシステムバス1のアドレスデコード、リードライトタイミング調整などを行って第1の制御回路であるホストマイコン(図示せず)の書き込みや読み出しに従ってメモリ4にアクセスする論理回路であり、周辺回路インターフェース3はメモリカードなどと送受信するデータをメモリ4に読み書きする第2の制御回路であり、メモリ4は転送速度吸収用のバッファであり、監視部5は第1の制御回路であるホストマイコン側のアクセスと第2の制御回路である周辺回路インターフェース3経由のアクセスをモニタし、メモリ4に一時記憶されているデータ量を監視し、フル(Full)/エンプティ(Empty)信号を出力する論理回路である。
【0004】
以上のような構成でデータ転送を行う場合のバッファの状態遷移を図6に示す。まずホストマイコンは、バッファの初期化をハードウェアに指示し、バッファを空の状態(1)にした後、周辺回路インターフェース3にデータ転送を指示する。これにより周辺回路インターフェース3は状態(2)に示すようにバッファにデータを書き込みはじめ、状態(3)のようにバッファが一杯になった時点で書き込みを中断する。このとき監視部5はメモリの満杯を検知しFull信号を出力し、割り込み信号IRQが発生する。これによりホストマイコンはバッファが満杯であることを確認し、状態(4)のようにホストマイコンがホストインターフェース2を介してデータ読み出しを開始し、状態(5)のようにバッファが空になるまで読み出し続ける。メモリ4が空になると周辺回路インターフェース3は次のデータ書き込みを再開する。
【0005】
以上の動作を繰り返すことで周辺回路からのデータはホストマイコン側に順次転送される。つまり、メモリへの書き込みと読み出しを時間的に区分して、周辺回路がゆっくりと書き込んだ後に、ホストマイコンが素早く連続的に読み出すことで速度差を吸収するものである。ホストマイコン側からデータを順次周辺回路側に送る場合は逆の動作となり、ホストマイコンが素早く連続的に書き込んだ後に、ゆっくりと周辺回路が読み出せばよい。このような状態遷移は外部の制御回路であるホストマイコンと周辺回路がバッファメモリの記憶データ量を検知することで容易に実現できる。周辺回路からホストマイコンへの転送の場合は、メモリ4が空になると周辺回路が書き込み、ホストマイコンは一杯になると読み出しを行う。ホストマイコンから周辺回路への転送の場合は、ホストマイコンはメモリ4が空になると書き込みを行い、一杯になると周辺回路が読み出しを行うという具合である。
【0006】
以上のようなシングルバッファ構成に対して転送効率をさらに向上させる目的でバッファメモリを2重化したダブルバッファ構成のインターフェース回路も存在する。図7にダブルバッファ構造のインターフェース回路のブロック図を示す。図7においてシステムバス1、ホストインターフェース2、周辺回路3は前記シングルバッファ構成の場合と同一であり、メモリ41、42が転送速度吸収用の2面構成のバッファ、監視部51、52は第1の制御回路であるホストマイコン側のアクセスと第2の制御回路である周辺回路のアクセスをモニタし、メモリ41、42にそれぞれ一時記憶されているデータ量を監視する論理回路である。
切換器6、7はホストマイコン側のアクセスと周辺回路側のアクセスをそれぞれメモリ41、42に接続切り換えする切換器である。
【0007】
以上のような構成でデータ転送を行う場合のバッファの切り換えについて説明する。まずホストマイコンは2つのバッファメモリが空の状態を確認した後に、周辺回路3にデータ転送を指示する。周辺回路3は書き込みモードの場合には2つのメモリの記憶量を検知して空のメモリがあれば切換器7を制御して空のメモリに接続して一杯になるまでデータを書き込む。一方、ホストインターフェース2は2つのメモリの記憶量を検知してどちらかのメモリが満杯になればシングルバッファ構成と同様に割り込み信号を生成する。ホストマイコンはこの割り込みをきっかけに切換器6を制御して満杯のメモリに接続するとともに、そのメモリのデータを読み出す。
【0008】
以上の動作を繰り返すことで周辺回路からのデータはホストマイコン側に順次転送される。つまり、ダブルバッファ化により、ホストの読み出し動作と周辺回路3の書き込み動作が同時に行われておりシングルバッファ構成に比べてより転送効率が向上するものである。このような状態遷移はホストマイコンおよび周辺回路が2つのバッファメモリの記憶データ量を検知することで実現されている。
周辺回路からホストマイコンへの転送の場合は、2つメモリのどちらかが空になると周辺回路3が書き込み、ホストマイコンはどちらかが一杯になると読み出しを行う。ホストマイコンから周辺回路への転送の場合は、ホストマイコンはメモリのどちらかが空になると書き込みを行い、どちらかが一杯になると周辺回路3が読み出すという具合である。
【0009】
【発明が解決しようとする課題】
しかしながら前記のダブルバッファ構成においては、メモリの切り替え制御に代表されるようにホストマイコンはシングルバッファ構成と明らかに異なるメモリ制御を行わなければならないという課題を有している。周辺回路においても同様にダブルバッファ構成専用の回路構成が必要である。つまり、バッファメモリへのアクセスを行う外部の制御回路(ホストマイコンも含む)はシングルバッファ用とダブルバッファ用と別々に用意する必要が生じてしまうという課題を有している。
【0010】
シングルバッファ構成とダブルバッファ構成は性能とコストのトレードオフ関係にある。性能を重視してダブルバッファ化すればコストも上がるため、機器の使用目的によってどのような構成とするかを選択すべきである。バッファ以外の回路やソフトウェアも別途用意するのではさらにコスト高の要因となってしまうため、ホストマイコンのソフトウェアも含めた外部制御回路は全く共通のまま、機器の使用目的に合わせてバッファ部分のみを変更するだけで最適なシステム構成を構築できることが望ましい。
【0011】
本発明は前記課題に鑑み、バッファにアクセスする外部制御回路にとってはシングルバッファ構成もダブルバッファ構成も全く区別する必要がないバッファ制御回路を提供することを目的とする。
【0012】
【課題を解決するための手段】
この課題を解決するために本発明のバッファ制御装置は、一方のメモリに既にデータが満たされた状態でかつ他方のメモリが空になった時点で接続先を入れ替えるか、あるいは一方のメモリが既に空の状態で他方のメモリにデータが満たされた時点で接続先を入れ替えるか、あるいは一方のメモリにデータが満たされると同時に、他方のメモリは空になった時点で接続先を入れ替える接続切換手段と、満杯や空などの記憶状態を示す信号のうち、一つのメモリの状態信号を選択する情報選択手段とを備えたものである。
【0013】
【発明の実施の形態】
本発明の第1の発明は、書き込み側の制御回路が、バッファメモリの記憶データ量を検知しながら記憶状態が空であることを示す状態信号に応じてバッファメモリにデータを書き込み、読み出し側の制御回路が、バッファメモリの記憶データ量を検知しながら記憶状態が満杯であることを示す状態信号に応じてバッファメモリからデータ読み出し、それを繰り返してブロックデータを伝送するバッファ制御において、二つのバッファメモリで構成される一時記憶用のダブルバッファメモリのそれぞれが満杯であるか空であるかの記憶状態に対応して前記書き込み側の制御回路に接続するバッファメモリと前記読み出し側の制御回路に接続するバッファメモリとを入れ替える接続切換手段と、前記書き込み側の制御回路に対して記憶状態が満杯であるか空であるかを通知する状態信号と、前記読み出し側の制御回路に対して記憶状態が満杯であるか空であるかを通知する状態信号とを、前記接続切換手段の切り替え動作に合わせて、一方のバッファメモリの状態信号から他方のバッファメモリの状態信号に互いに切り替える情報選択手段とを備え、前記書き込み側の制御回路および前記読み出し側の制御回路に対して、どちらか一方のバッファメモリの記憶状態が満杯であるか空であるかを示す状態信号を通知し、かつ前記どちらか一方のバッファメモリだけをアクセスできるように接続することにより、前記書き込み側の制御回路および前記読み出し側の制御回路は、バッファメモリの記憶状態が満杯であるか空であるかを示す状態信号に応じて、空になると書き込み側が書き込み、満杯になると読み出し側が読み出すという単一バッファメモリの場合と全く同じ伝送規則によってダブルバッファメモリに対して書き込みあるいは読み出しが可能なものである。
【0014】
また、本発明の第2の発明は、第1の発明に加え、2つのメモリで構成されるダブルバッファメモリであって、前記接続切換手段は一方のメモリに既にデータが満たされた状態でかつ他方のメモリが空になった時点で接続先を入れ替えるか、あるいは一方のメモリが既に空の状態で他方のメモリにデータが満たされた時点で接続先を入れ替えるか、あるいは一方のメモリにデータが満たされると同時に、他方のメモリ空になった時点で接続先を入れ替えるものである。
【0015】
また、本発明の第3の発明は、第1の発明に加え、2つのメモリで構成されるダブルバッファメモリであって、前記接続切換手段は書き込み時においては接続しているメモリが満杯になった時点で他方のメモリに切り換えをおこない、読み出し時においては接続しているメモリが空になった時点で他方のメモリに切り換えを行うものである。
【0016】
また、本発明の第4の発明は、第1の発明に加え、前記情報選択手段は、残留転送量がメモリ容量を越える転送状態では接続されているメモリの状態信号を選択し、残留転送量がメモリ容量以下である転送状態では、読み出しメモリの状態信号を選択可能なものである。
【0017】
また、本発明の第5の発明は、第1の発明に加え、前記接続切換手段にて接続を入れ替えたタイミングで外部制御回路に割り込み要求信号などのイベント信号を発生するものである。
【0019】
以下、本発明の実施の形態について、図面を用いて説明する。
【0020】
(実施の形態1)
図1は本発明の実施の形態1によるバッファ制御装置の構成を示すブロック図である。従来例と構成が同じものには同一符号を付け説明を省略する。
【0021】
図1において、切換検出器8は2つのバッファメモリの記憶状態からバッファメモリの切り換え信号を生成する回路、切換器9、10は2つのバッファメモリの記憶状態信号から一つを選択して外部の制御回路であるホストマイコン側と周辺回路側に受け渡すスイッチ回路である。
【0022】
以上のような構成でのバッファメモリの切り換え制御について、図2のバッファメモリの状態遷移を使って説明する。まずホストマイコンはバッファの初期化をハードウェアに指示し、両方のバッファを空の状態(1)にする。この初期化にてメモリ接続は例えば図2状態(1)に示すように周辺回路側のアクセスがメモリ41に、ホストマイコン側のアクセスがメモリ42に接続される。
【0023】
次にホストマイコンは周辺回路3にデータ転送を指示し、状態(2)に示すように周辺回路3がメモリにデータを書き込みはじめ、状態(3)のようにバッファが一杯になった時点で周辺回路3は書き込みを中断する。このとき、切換検出器8はメモリ42が空の状態の時にメモリ41が満杯になったことを検出してメモリの接続関係を反対にする。つまり、図2状態(3)から状態(4)への遷移に示すように、周辺回路側の接続はメモリ41からメモリ42に切り替わり、その状態信号も切換器10によってメモリ41の満杯状態からメモリ42の空状態に切り替わる。よって周辺回路3はメモリが空であると認識しデータの書き込みを再開し、状態(5)のようにメモリ42にデータを書き込んでいく。
【0024】
一方、状態(3)から状態(4)への遷移においてホストマイコン側に接続されるメモリもメモリ42からメモリ41に切り換わり、メモリの記憶状態を示す信号も切換器9によってメモリ42の空状態からメモリ41の満杯状態に切り換わる。この満杯状態への変化により割り込み信号IRQが発生する。なお、切換信号により直接割り込み信号を生成してもよい。
【0025】
この割り込みをきっかけにホストマイコンはバッファが満杯であることを確認し、これにより状態(5)のようにホストマイコンがホストインターフェース2を介してデータ読み出しを開始する。このように状態(5)では周辺回路からの書き込みとホストマイコンからの読み出しが同時に実行できる。
【0026】
次の状態(6)は周辺回路3からの書き込みの方が先に終了してメモリ42が満杯になった場合を示している。この場合はまだメモリ41が空でないのでメモリ接続の入れ替えは起こらず、周辺回路3は書き込みを中断した状態となり、状態(7)から状態(8)の遷移に示すようにメモリ41が空になった時点でメモリ接続の入れ替えが発生する。この入れ替えにより、前記の入れ替えと同様に周辺回路はメモリが空になったと判断し、ホストマイコンは一杯になったと判断することでデータ転送を続けることになる。
【0027】
以上の動作を繰り返すことで周辺回路からのデータはホストマイコン側に順次転送される。ホストマイコン側からデータを順次周辺回路側に送る場合は逆の動作となるだけである。
【0028】
このような状態遷移は外部の制御回路であるホストマイコンと周辺回路が前記のシングルバッファ構成と全く同じにバッファメモリの記憶データ量を検知しながら、空になると書き込み、一杯になると読み出すというものであり、ダブルバッファとして特別な判断は全くない。
【0029】
以上のように本実施の形態によれば、バッファメモリの接続切り替えを適切な条件で行うと同時に、切り替えに合わせてバッファアクセス制御に必要なメモリ記憶状態を示す信号も切り換えて外部制御回路にインターフェースすることにより、シングルバッファ構成と全く同じ外部制御回路でダブルバッファ構成を実現できる。
【0030】
なお、本実施の形態では、ホストマイコン側と周辺回路側の2つの切換器を同時かつ互いに切り換える方法で説明したが、それぞれが独立に一杯になったらあるいは空になったら接続を切り換えることでも同様の効果が得られる。
【0031】
また本実施の形態では、ホストマイコンなどの外部制御回路のデータ転送終了時の動作について特に触れてはいないが、ホストマイコンや周辺回路の構成によっては、転送が終了した事を認識する必要があることも想定される。例えば、バッファメモリに書き込んだ最後のデータを受け取り先が読み出したことを検出することにより転送終了とし、次の動作に移行するきっかけとする事などが考えられる。外部の制御回路がこのような構成でもシングルバッファ構成の場合は、接続されるメモリが固定されているので、書き込み側で空の状態を検出すれば全てのデータが転送されたことに等しくなる。しかし、ダブルバッファ構成の時は本実施例の構成のままシングルバッファと同じ判断をしてしまうと、バッファメモリの接続が切り替わってしまうので、読み出し側が最後のデータを読み出したかどうかは書き込み側の接続メモリの残量を見ても判断できない。そこで、図3に示すように最終転送時には記憶状態信号を選択するスイッチ回路9、10が反転しないように制御する最終制御部11を設けることで解決される。なお、他の構成は、図1に示したものと同様である。
【0032】
これにより、図4(7)から(8)に示す状態遷移においてメモリの接続先は入れ替えるものの記憶状態信号は図中の点線で示すように読み出し動作側が接続しているメモリの状態信号が選択される。これにより最後に書き込んだデータが読み出されて2つのバッファメモリが全て空になった図4状態(10)を外部制御回路であるホストマイコンも周辺回路も認知することができる。
【0033】
【発明の効果】
以上のように本発明によれば、バッファメモリの接続切り替えを適切な条件で行うと同時に、切り替えに合わせてバッファアクセス制御に必要なメモリ記憶状態を示す信号も切り換えて外部制御回路にインターフェースすることにより、シングルバッファ構成であるかダブルバッファ構成であるかを意識することなく正しいメモリアクセス制御を行うことができ、システム全体の要求仕様に好適なバッファ構成をメモリ部のみの変更で簡単に実現でき、その効果は大きい。
【図面の簡単な説明】
【図1】本発明の実施の形態によるバッファ制御装置の構成を示すブロック図
【図2】同バッファ制御装置のバッファ状態の遷移を示す模式図
【図3】転送終了判断を考慮したバッファ制御装置の構成を示すブロック図
【図4】転送終了判断を行う場合のバッファ状態の遷移を示す模式図
【図5】従来のシングルバッファ構成のバッファ制御装置を示すブロック図
【図6】従来のシングルバッファ構成のバッファ状態の遷移を示す模式図
【図7】従来のダブルバッファ構成のバッファ制御装置を示すブロック図
【符号の説明】
1 システムバス
2 ホストインターフェース
3 周辺回路インターフェース
4、41、42 バッファメモリ
5、51、52 監視部
6、7 切換器
8 切換検出器
9、10 スイッチ回路
11 最終転送制御部
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a buffer control device suitable for a buffer circuit for absorbing a data transfer speed difference between a microcomputer and a peripheral circuit, particularly when applied to a double buffer configuration.
[0002]
[Prior art]
An apparatus using a flash memory card or the like requires an interface circuit for transferring data between the card and the microcomputer. In general, microcomputers that execute applications are often faster than memory cards with smaller bus widths and slower transfer speeds. The interface circuit is usually provided with a buffer for absorbing the transfer speed difference so that the performance of the entire device is not reduced by data transfer with a low-speed memory card.
[0003]
First, a conventional interface circuit having a single buffer configuration will be described. FIG. 5 is a block diagram showing a buffer control unit having a single buffer configuration. In FIG. 5, a system bus 1 is an external bus of a host microcomputer composed of addresses, data, read / write signals, interrupt signals, etc., and a host interface (Host I / F) 2 is an address decode of the system bus 1 , A logic circuit that performs read / write timing adjustment and accesses the memory 4 according to writing and reading of a host microcomputer (not shown) as a first control circuit, and the peripheral circuit interface 3 transmits and receives data to and from a memory card or the like The memory 4 is a buffer for absorbing the transfer rate, and the monitoring unit 5 is a host microcomputer side access and second control circuit which is the first control circuit. Monitors access via peripheral circuit interface 3 and temporarily stores data in memory 4 Monitor, a logic circuit for outputting a full (Full) / empty (Empty) signal.
[0004]
FIG. 6 shows the state transition of the buffer when data transfer is performed with the above configuration. First, the host microcomputer instructs the hardware to initialize the buffer, sets the buffer to an empty state (1), and then instructs the peripheral circuit interface 3 to transfer data. As a result, the peripheral circuit interface 3 starts writing data to the buffer as shown in state (2), and interrupts the writing when the buffer is full as in state (3). At this time, the monitoring unit 5 detects that the memory is full, outputs a Full signal, and generates an interrupt signal IRQ. As a result, the host microcomputer confirms that the buffer is full, and the host microcomputer starts reading data via the host interface 2 as in the state (4), and the buffer becomes empty as in the state (5). Continue reading. When the memory 4 becomes empty, the peripheral circuit interface 3 resumes the next data writing.
[0005]
By repeating the above operation, data from the peripheral circuit is sequentially transferred to the host microcomputer side. In other words, writing to and reading from the memory is divided in terms of time, and after the peripheral circuit writes slowly, the host microcomputer reads it quickly and continuously to absorb the speed difference. When data is sequentially sent from the host microcomputer side to the peripheral circuit side, the operation is reversed, and the peripheral circuit only needs to read the peripheral circuit slowly after the host microcomputer writes it quickly and continuously. Such state transition can be easily realized by detecting the amount of data stored in the buffer memory by the host microcomputer and the peripheral circuit which are external control circuits. In the case of transfer from the peripheral circuit to the host microcomputer, the peripheral circuit writes when the memory 4 is empty, and reads when the host microcomputer is full. In the case of transfer from the host microcomputer to the peripheral circuit, the host microcomputer performs writing when the memory 4 is empty, and the peripheral circuit performs reading when the memory 4 is full.
[0006]
There is also an interface circuit having a double buffer configuration in which buffer memories are duplicated for the purpose of further improving transfer efficiency with respect to the single buffer configuration as described above. FIG. 7 shows a block diagram of an interface circuit having a double buffer structure. In FIG. 7, the system bus 1, the host interface 2, and the peripheral circuit 3 are the same as in the case of the single buffer configuration, the memories 41 and 42 are two-plane buffers for absorbing the transfer rate, and the monitoring units 51 and 52 are the first ones. This is a logic circuit that monitors the access on the host microcomputer side which is the control circuit and the access of the peripheral circuit which is the second control circuit, and monitors the amount of data temporarily stored in the memories 41 and 42, respectively.
Switching units 6 and 7 are switching units for switching connection between the access on the host microcomputer side and the access on the peripheral circuit side to the memories 41 and 42, respectively.
[0007]
A description will be given of buffer switching when data transfer is performed with the above configuration. First, after confirming that the two buffer memories are empty, the host microcomputer instructs the peripheral circuit 3 to transfer data. In the write mode, the peripheral circuit 3 detects the storage amounts of the two memories and, if there is an empty memory, controls the switch 7 to connect to the empty memory and write data until it is full. On the other hand, the host interface 2 detects the storage amounts of the two memories, and generates an interrupt signal as in the single buffer configuration when one of the memories becomes full. In response to this interrupt, the host microcomputer controls the switch 6 to connect to a full memory and reads data from the memory.
[0008]
By repeating the above operation, data from the peripheral circuit is sequentially transferred to the host microcomputer side. That is, the double buffering allows the host read operation and the peripheral circuit 3 write operation to be performed at the same time, thereby improving the transfer efficiency as compared with the single buffer configuration. Such state transition is realized by the host microcomputer and the peripheral circuit detecting the amount of data stored in the two buffer memories.
In the case of transfer from the peripheral circuit to the host microcomputer, the peripheral circuit 3 writes when one of the two memories becomes empty, and the host microcomputer performs reading when either becomes full. In the case of transfer from the host microcomputer to the peripheral circuit, the host microcomputer performs writing when one of the memories becomes empty, and the peripheral circuit 3 reads when either becomes full.
[0009]
[Problems to be solved by the invention]
However, the double buffer configuration has a problem that the host microcomputer has to perform memory control that is clearly different from the single buffer configuration, as represented by memory switching control. Similarly, the peripheral circuit requires a circuit configuration dedicated to the double buffer configuration. That is, there is a problem that an external control circuit (including a host microcomputer) that accesses the buffer memory needs to be prepared separately for the single buffer and the double buffer.
[0010]
The single buffer configuration and the double buffer configuration are in a trade-off relationship between performance and cost. Since the cost increases if the double buffer is made with emphasis on performance, the configuration should be selected according to the purpose of use of the device. If a circuit and software other than the buffer are prepared separately, it becomes a factor of higher cost, so the external control circuit including the host microcomputer software remains completely the same, and only the buffer part is used according to the purpose of use of the device. It is desirable to be able to construct an optimal system configuration simply by changing.
[0011]
An object of the present invention is to provide a buffer control circuit that does not require any distinction between a single buffer configuration and a double buffer configuration for an external control circuit that accesses a buffer.
[0012]
[Means for Solving the Problems]
In order to solve this problem, the buffer control device of the present invention replaces the connection destination when one memory is already filled with data and the other memory becomes empty, or one of the memories already has Connection switching means for switching the connection destination when the other memory is filled with data in an empty state, or for switching the connection destination when the other memory is empty at the same time that one memory is filled with data And information selection means for selecting one memory state signal from among the signals indicating the storage state such as full or empty.
[0013]
DETAILED DESCRIPTION OF THE INVENTION
The first aspect of the present invention, the control circuit of the write side writes the data into the buffer memory in response to the state signal indicating that the memory state while detecting the stored data amount in the buffer memory is empty, the read side of the control circuit, the read buffer memory or La Defense over data in response to the state signal indicating that the memory state is full while detecting stored data amount in the buffer memory, the buffer control for transmitting block data by repeating it The buffer memory connected to the control circuit on the write side and the read corresponding to the storage state of each of the double buffer memories for temporary storage composed of two buffer memories being full or empty a connection switching means for switching the buffer memory connected to the control circuit side, the storage state is fully to the control circuit of the write side And a status signal for notifying the read-side control circuit whether the storage state is full or empty for the switching operation of the connection switching means. In addition, there is provided information selection means for switching from the status signal of one buffer memory to the status signal of the other buffer memory , and either one of the buffers for the control circuit on the write side and the control circuit on the read side The control circuit on the write side and the read side are connected by notifying a state signal indicating whether the storage state of the memory is full or empty, and connecting only one of the buffer memories. the control circuit of the storage state of the buffer memory in response to the state signal indicating either empty or full, the write side writes emptied write , By exactly the same transmission rules as a single buffer memory of the read side becomes full it reads, but also capable of writing or reading from the double buffer memory.
[0014]
The second invention of the present invention is a double buffer memory comprising two memories in addition to the first invention, wherein the connection switching means is in a state where one memory is already filled with data and When the other memory becomes empty, the connection destination is changed, or when one memory is already empty and the other memory is filled with data, the connection destination is changed, or data is stored in one memory. At the same time, the connection destination is switched when the other memory becomes empty.
[0015]
The third invention of the present invention is a double buffer memory composed of two memories in addition to the first invention, wherein the connection switching means fills up the connected memory at the time of writing. When switching, the other memory is switched, and at the time of reading, switching to the other memory is performed when the connected memory becomes empty.
[0016]
According to a fourth aspect of the present invention, in addition to the first aspect, the information selecting means selects a status signal of the connected memory in a transfer state where the residual transfer amount exceeds the memory capacity, and the residual transfer amount In the transfer state in which is less than the memory capacity, the state signal of the read memory can be selected.
[0017]
According to a fifth aspect of the present invention, in addition to the first aspect, an event signal such as an interrupt request signal is generated in the external control circuit at the timing when the connection is switched by the connection switching means.
[0019]
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
[0020]
(Embodiment 1)
FIG. 1 is a block diagram showing a configuration of a buffer control apparatus according to Embodiment 1 of the present invention. Components having the same configuration as the conventional example are denoted by the same reference numerals and description thereof is omitted.
[0021]
In FIG. 1, a switching detector 8 is a circuit that generates a buffer memory switching signal from the storage states of two buffer memories, and switching devices 9 and 10 select one of the storage state signals of two buffer memories and This is a switch circuit that delivers the control circuit to the host microcomputer side and the peripheral circuit side.
[0022]
The switching control of the buffer memory with the above configuration will be described using the state transition of the buffer memory in FIG. First, the host microcomputer instructs the hardware to initialize the buffers, and sets both buffers to an empty state (1). In this initialization, for example, as shown in the state (1) in FIG. 2, the access on the peripheral circuit side is connected to the memory 41, and the access on the host microcomputer side is connected to the memory 42.
[0023]
Next, the host microcomputer instructs the peripheral circuit 3 to transfer data, and when the peripheral circuit 3 starts writing data to the memory as shown in the state (2), the buffer is full as in the state (3). Circuit 3 interrupts the writing. At this time, the switching detector 8 detects that the memory 41 is full when the memory 42 is empty, and reverses the memory connection relationship. That is, as shown in the transition from the state (3) to the state (4) in FIG. 2, the connection on the peripheral circuit side is switched from the memory 41 to the memory 42, and the state signal is also changed from the full state of the memory 41 to the memory by the switch 10. 42 switches to the empty state. Therefore, the peripheral circuit 3 recognizes that the memory is empty, resumes data writing, and writes data to the memory 42 as in the state (5).
[0024]
On the other hand, in the transition from the state (3) to the state (4), the memory connected to the host microcomputer side is also switched from the memory 42 to the memory 41, and the signal indicating the storage state of the memory is also sent to the empty state of the memory 42 by the switch 9. To the memory 41 full state. The change to the full state generates an interrupt signal IRQ. Note that the interrupt signal may be directly generated by the switching signal.
[0025]
In response to this interrupt, the host microcomputer confirms that the buffer is full, and the host microcomputer starts reading data via the host interface 2 as shown in state (5). Thus, in the state (5), writing from the peripheral circuit and reading from the host microcomputer can be executed simultaneously.
[0026]
The next state (6) shows a case where the writing from the peripheral circuit 3 is completed first and the memory 42 is full. In this case, since the memory 41 is not yet empty, the memory connection is not changed, and the peripheral circuit 3 is in a state where writing is interrupted, and the memory 41 becomes empty as shown in the transition from the state (7) to the state (8). At that point, the memory connection is switched. As a result of the replacement, the peripheral circuit determines that the memory is empty, and the host microcomputer determines that the memory is full, and continues data transfer.
[0027]
By repeating the above operation, data from the peripheral circuit is sequentially transferred to the host microcomputer side. When data is sequentially sent from the host microcomputer side to the peripheral circuit side, only the reverse operation is performed.
[0028]
Such a state transition is such that the host microcomputer, which is an external control circuit, and the peripheral circuit detect the amount of data stored in the buffer memory in exactly the same way as in the single buffer configuration, and write when it is empty and read when it is full. There is no special judgment as a double buffer.
[0029]
As described above, according to the present embodiment, the connection of the buffer memory is switched under an appropriate condition, and at the same time, the signal indicating the memory storage state necessary for the buffer access control is switched in accordance with the switching and is interfaced to the external control circuit. By doing so, a double buffer configuration can be realized with the same external control circuit as the single buffer configuration.
[0030]
In the present embodiment, the method of switching the two switches on the host microcomputer side and the peripheral circuit side simultaneously and mutually has been described. However, it is also possible to switch the connection when each becomes independently full or empty. The effect is obtained.
[0031]
In this embodiment, the operation at the end of data transfer of an external control circuit such as a host microcomputer is not particularly mentioned. However, depending on the configuration of the host microcomputer and peripheral circuits, it is necessary to recognize that the transfer has ended. It is also assumed. For example, it can be considered that the end of the transfer is detected by detecting that the recipient has read the last data written in the buffer memory, and that the next operation is started. When the external control circuit has such a configuration but has a single buffer configuration, the memory to be connected is fixed. Therefore, if an empty state is detected on the writing side, all data is transferred. However, in the double buffer configuration, if the same determination as the single buffer is made with the configuration of the present embodiment, the connection of the buffer memory is switched, so whether or not the reading side has read the last data is determined by the connection on the writing side. Cannot be determined by looking at the remaining memory. Accordingly, as shown in FIG. 3, the problem is solved by providing a final control unit 11 that controls the switch circuits 9 and 10 that select the storage state signal so as not to be inverted during the final transfer. Other configurations are the same as those shown in FIG.
[0032]
As a result, although the memory connection destination is changed in the state transitions shown in FIGS. 4 (7) to (8), the memory state signal connected to the read operation side is selected as the storage state signal as shown by the dotted line in the figure. The Thereby, the host microcomputer as the external control circuit and the peripheral circuit can recognize the state (10) in FIG. 4 in which the last written data is read and the two buffer memories are all empty.
[0033]
【The invention's effect】
As described above, according to the present invention, buffer memory connection switching is performed under appropriate conditions, and at the same time, a signal indicating a memory storage state necessary for buffer access control is switched to interface with the external control circuit. This makes it possible to perform correct memory access control without being conscious of whether it is a single buffer configuration or a double buffer configuration, and a buffer configuration suitable for the required specifications of the entire system can be easily realized by changing only the memory section. The effect is great.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a configuration of a buffer control device according to an embodiment of the present invention. FIG. 2 is a schematic diagram showing transition of a buffer state of the buffer control device. FIG. 4 is a schematic diagram showing a transition of a buffer state when a transfer end determination is made. FIG. 5 is a block diagram showing a buffer controller of a conventional single buffer configuration. FIG. 6 is a conventional single buffer. FIG. 7 is a block diagram showing a conventional buffer control device with a double buffer configuration.
DESCRIPTION OF SYMBOLS 1 System bus 2 Host interface 3 Peripheral circuit interface 4, 41, 42 Buffer memory 5, 51, 52 Monitoring part 6, 7 Switch 8 Switching detector 9, 10 Switch circuit 11 Final transfer control part

Claims (5)

書き込み側の制御回路が、バッファメモリの記憶データ量を検知しながら記憶状態が空であることを示す状態信号に応じてバッファメモリにデータを書き込み、読み出し側の制御回路が、バッファメモリの記憶データ量を検知しながら記憶状態が満杯であることを示す状態信号に応じてバッファメモリからデータ読み出し、それを繰り返してブロックデータを伝送するバッファ制御において、
二つのバッファメモリで構成される一時記憶用のダブルバッファメモリのそれぞれが満杯であるか空であるかの記憶状態に対応して前記書き込み側の制御回路に接続するバッファメモリと前記読み出し側の制御回路に接続するバッファメモリとを入れ替える接続切換手段と、
前記書き込み側の制御回路に対して記憶状態が満杯であるか空であるかを通知する状態信号と、前記読み出し側の制御回路に対して記憶状態が満杯であるか空であるかを通知する状態信号とを、前記接続切換手段の切り替え動作に合わせて、一方のバッファメモリの状態信号から他方のバッファメモリの状態信号に互いに切り替える情報選択手段とを備え、
前記書き込み側の制御回路および前記読み出し側の制御回路に対して、どちらか一方のバッファメモリの記憶状態が満杯であるか空であるかを示す状態信号を通知し、かつ前記どちらか一方のバッファメモリだけをアクセスできるように接続することにより、
前記書き込み側の制御回路および前記読み出し側の制御回路は、バッファメモリの記憶状態が満杯であるか空であるかを示す状態信号に応じて、空になると書き込み側が書き込み、満杯になると読み出し側が読み出すという単一バッファメモリの場合と全く同じ伝送規則によってダブルバッファメモリに対しても書き込みあるいは読み出しが可能なバッファ制御装置。
The control circuit of the write side writes the data into the buffer memory in response to the state signal indicating that the memory state while detecting the stored data amount in the buffer memory is empty, the control circuit of the read side, a buffer memory storage state while detecting the stored amount of data read buffer memory or La Defense over data in response to the state signal indicating that the full, the buffer control for transmitting block data by repeating it,
A buffer memory connected to the control circuit on the writing side and a memory on the reading side corresponding to the storage state of whether each of the double buffer memories for temporary storage composed of two buffer memories is full or empty Connection switching means for replacing the buffer memory connected to the control circuit ;
A status signal for notifying the write-side control circuit whether the storage state is full or empty, and a notification for notifying the read-side control circuit whether the storage state is full or empty. And an information selection means for switching the status signal from the status signal of one buffer memory to the status signal of the other buffer memory in accordance with the switching operation of the connection switching means ,
A status signal indicating whether the storage state of one of the buffer memories is full or empty is notified to the control circuit on the write side and the control circuit on the read side, and the one of the buffers By connecting so that only memory is accessible,
The control circuit on the write side and the control circuit on the read side write according to a state signal indicating whether the storage state of the buffer memory is full or empty, the write side writes when it becomes empty, and the read side reads when it becomes full A buffer controller that can write to or read from a double buffer memory according to the same transmission rule as a single buffer memory.
2つのメモリで構成されるダブルバッファメモリであって、前記接続切換手段は一方のメモリに既にデータが満たされた状態でかつ他方のメモリが空になった時点で接続先を入れ替えるか、あるいは一方のメモリが既に空の状態で他方のメモリにデータが満たされた時点で接続先を入れ替えるか、あるいは一方のメモリにデータが満たされると同時に、他方のメモリ空になった時点で接続先を入れ替える請求項1記載のバッファ制御装置。A double buffer memory comprising two memories, wherein the connection switching means switches the connection destination when the data is already filled in one memory and the other memory becomes empty, or When the other memory is filled with data while the other memory is already empty, the connection destination is replaced, or when one memory is filled with data and the other memory is empty, the connection destination is changed. The buffer control device according to claim 1 to be replaced. 2つのメモリで構成されるダブルバッファメモリであって、前記接続切換手段は書き込み時においては接続しているメモリが満杯になった時点で他方のメモリに切り換えをおこない、読み出し時においては接続しているメモリが空になった時点で他方のメモリに切り換えをおこなう請求項1記載のバッファ制御装置。A double buffer memory composed of two memories, wherein the connection switching means switches to the other memory when the connected memory is full at the time of writing, and connects at the time of reading. 2. The buffer control device according to claim 1, wherein when the memory being used becomes empty, switching to the other memory is performed. 前記情報選択手段は、残留転送量がメモリ容量を超える転送状態では接続されているメモリの状態信号を選択し、残留転送量がメモリ容量以下である転送状態では、読み出しメモリの状態信号を選択可能な請求項1記載のバッファ制御装置。  The information selection means can select the status signal of the connected memory when the residual transfer amount exceeds the memory capacity, and can select the status signal of the read memory when the residual transfer amount is less than the memory capacity. The buffer control device according to claim 1. 前記接続切換手段にて接続を入れ替えたタイミングで外部制御回路に割り込み要求信号などのイベント信号を発生する請求項1記載のバッファ制御装置。  2. The buffer control device according to claim 1, wherein an event signal such as an interrupt request signal is generated in the external control circuit at a timing when the connection is switched by the connection switching means.
JP2000260398A 2000-08-30 2000-08-30 Buffer control device Expired - Fee Related JP3700561B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2000260398A JP3700561B2 (en) 2000-08-30 2000-08-30 Buffer control device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2000260398A JP3700561B2 (en) 2000-08-30 2000-08-30 Buffer control device

Publications (2)

Publication Number Publication Date
JP2002073537A JP2002073537A (en) 2002-03-12
JP3700561B2 true JP3700561B2 (en) 2005-09-28

Family

ID=18748415

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000260398A Expired - Fee Related JP3700561B2 (en) 2000-08-30 2000-08-30 Buffer control device

Country Status (1)

Country Link
JP (1) JP3700561B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112822494A (en) * 2020-12-30 2021-05-18 稿定(厦门)科技有限公司 Double-buffer coding system and control method thereof

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100440405B1 (en) * 2001-11-19 2004-07-14 삼성전자주식회사 Device for controlling output of video data using double buffering
EP1499961A2 (en) * 2002-04-30 2005-01-26 Koninklijke Philips Electronics N.V. Apparatus and method for fetching data from memory
JP4498038B2 (en) * 2004-07-06 2010-07-07 株式会社東芝 Data acquisition device
US7420115B2 (en) 2004-12-28 2008-09-02 Yamaha Corporation Memory access controller for musical sound generating system
EP2051170A4 (en) 2006-07-28 2010-04-21 Nec Corp Cpu connection circuit, data processing device, operation device, and mobile communication terminal and data transfer method using them
JP4900299B2 (en) * 2008-01-30 2012-03-21 オンキヨー株式会社 Stream playback apparatus, streaming system, and stream playback program
JP5293233B2 (en) * 2009-02-03 2013-09-18 日本電気株式会社 Data input / output device
JP5458364B1 (en) * 2013-03-22 2014-04-02 株式会社アクセル Motor control device, motor control method, and game machine
JP6376876B2 (en) * 2014-07-24 2018-08-22 キヤノン株式会社 Information processing apparatus, program, and control method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112822494A (en) * 2020-12-30 2021-05-18 稿定(厦门)科技有限公司 Double-buffer coding system and control method thereof

Also Published As

Publication number Publication date
JP2002073537A (en) 2002-03-12

Similar Documents

Publication Publication Date Title
KR100708128B1 (en) An apparatus and method for controlling nand flash memory
US7523235B2 (en) Serial Advanced Technology Attachment (SATA) switch
JP3700561B2 (en) Buffer control device
JP2002009849A (en) Usb transfer control method and usb controller
US20040133708A1 (en) Virtual endpoint for USB devices
JP2002354217A (en) Method and device for forming image
JPH1083372A (en) Circuit for moving data between remote memories and computer including the circuit
WO2006134804A1 (en) External device access device
JP2004206487A (en) Fifo memory circuit
JP2664144B2 (en) Multiplexing device switching method and device
JP4622422B2 (en) Storage device
JP4030951B2 (en) Data duplication apparatus and method
JP2005010966A (en) Lsi device
JP2000295295A (en) Buffer memory for block data transfer and serial data transmission reception system
JPS61233857A (en) Data transfer equipment
JP3531394B2 (en) Peripherals in half-duplex data transfer systems
JP2980163B2 (en) Data transfer method
JP3450392B2 (en) Interface devices and peripherals
JP5166922B2 (en) Shared bus control device and control method thereof
JP2020170448A (en) Information processing system
JPS61201565A (en) Print control system
JPH05233482A (en) Data transfer system
JPH0642227B2 (en) Data transfer device
JPH07306840A (en) Computer system
JPH11120018A (en) Store buffer control system

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20041209

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20041214

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050201

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050308

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050411

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

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

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

Free format text: PAYMENT UNTIL: 20110722

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20120722

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20130722

Year of fee payment: 8

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313113

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees