Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP2000330761A - Ring buffer control device and ring buffer control method - Google Patents
[go: Go Back, main page]

JP2000330761A - Ring buffer control device and ring buffer control method - Google Patents

Ring buffer control device and ring buffer control method

Info

Publication number
JP2000330761A
JP2000330761A JP11137697A JP13769799A JP2000330761A JP 2000330761 A JP2000330761 A JP 2000330761A JP 11137697 A JP11137697 A JP 11137697A JP 13769799 A JP13769799 A JP 13769799A JP 2000330761 A JP2000330761 A JP 2000330761A
Authority
JP
Japan
Prior art keywords
address
ring buffer
highest
indicated
capacity
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.)
Withdrawn
Application number
JP11137697A
Other languages
Japanese (ja)
Inventor
Takuyuki Matsuo
卓幸 松尾
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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP11137697A priority Critical patent/JP2000330761A/en
Publication of JP2000330761A publication Critical patent/JP2000330761A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Communication Control (AREA)
  • Memory System (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

(57)【要約】 【課題】 動作中にリングバッファの容量を動的に変更
することのできるリングバッファ制御装置を提供する。 【解決手段】 リングバッファの容量を変更する指示を
受けたときに、最高位アドレスを変更可能な状態である
否かを、リングバッファボトムアドレス保持手段101
1に記憶された最高位アドレス、ライトポインタ保持手
段1003に記憶されたライトポインタの示すアドレ
ス、およびリードポインタ保持手段1007に記憶され
たリードポインタの示すアドレスから判定し、最高位ア
ドレスを変更可能な状態でないと判定されたときに、リ
ードポインタの示すアドレスが最高位アドレスを越えた
際に割込み制御手段1005から割り込み信号を発生し
て最高位アドレスを変更してリングバッファの容量を変
更する。
(57) [Problem] To provide a ring buffer control device capable of dynamically changing the capacity of a ring buffer during operation. SOLUTION: When receiving an instruction to change the capacity of a ring buffer, a ring buffer bottom address holding means 101 determines whether or not the highest address can be changed.
1 and the address indicated by the write pointer stored in the write pointer holding means 1003 and the address indicated by the read pointer stored in the read pointer holding means 1007, and the highest address can be changed. When it is determined that the state is not the state, when the address indicated by the read pointer exceeds the highest address, an interrupt signal is generated from the interrupt control means 1005 to change the highest address and change the capacity of the ring buffer.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明はリングバッファ制御
装置およびリングバッファ制御方法に関し、特に、アド
レスの連続したメモリ領域の最高位アドレスを最低位ア
ドレスに論理的に隣接したアドレスとして設定し、循環
的に書き込みおよび読み出しが可能に構成されたリング
バッファのサイズを制御するリングバッファ制御装置お
よびリングバッファ制御方法に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a ring buffer control device and a ring buffer control method, and more particularly, to a method of setting the highest address of a memory area having continuous addresses as an address logically adjacent to the lowest address, and performing a cyclic operation. The present invention relates to a ring buffer control device and a ring buffer control method for controlling the size of a ring buffer configured so that writing and reading are possible.

【0002】[0002]

【従来の技術】ホストコンピュータから送信されたコマ
ンドやデータなどに応じて動作するプリンタ等の装置に
おいては、動作速度とデータ受信速度の差を吸収する目
的で受信バッファが使用され、このような受信バッファ
の構成としては、データをFIFO(先入れ先出し)方
式で格納可能であり、論理的にリング形状としたリング
バッファが用いられている。
2. Description of the Related Art In a device such as a printer which operates in response to a command or data transmitted from a host computer, a reception buffer is used for the purpose of absorbing a difference between an operation speed and a data reception speed. As a buffer configuration, a ring buffer that can store data in a FIFO (first-in first-out) system and has a logical ring shape is used.

【0003】またプリンタ装置は、上記受信バッファ以
外に、プリンタの記録機構が扱える形式で記録イメージ
データを格納するいわゆる記録バッファも備えている。
[0003] In addition to the above-mentioned reception buffer, the printer device also has a so-called recording buffer for storing recording image data in a format that can be handled by the recording mechanism of the printer.

【0004】通常受信バッファと記録バッファは、同一
の半導体上に設けられて領域を分割して使用されるか、
または複数の半導体装置からなるモジュールとして形成
されており、連続したバッファエリアとしてアクセスが
可能であり、領域を分割して用いるように構成されてい
る。
[0004] Normally, the reception buffer and the recording buffer are provided on the same semiconductor and used by dividing the area.
Alternatively, it is formed as a module including a plurality of semiconductor devices, can be accessed as a continuous buffer area, and is configured to divide and use the area.

【0005】プリンタ装置においては、リングバッファ
の容量と記録バッファの容量はトレードオフの関係にあ
る。すなわち、接続するホストコンピュータの性能、転
送するイメージデータの量および形式、記録用紙や記録
品位等に応じて、必要なリングバッファと記録バッファ
の容量配分を変化させることが望ましい。
In a printer, the capacity of a ring buffer and the capacity of a recording buffer are in a trade-off relationship. That is, it is desirable to change the required capacity distribution of the ring buffer and the recording buffer according to the performance of the host computer to be connected, the amount and format of the image data to be transferred, the recording paper and the recording quality, and the like.

【0006】プリンタの動作時間あるいはホストコンピ
ュータのデータ転送待ち時間を最短にしようとするなら
ば、状況に応じてリングバッファの容量を変更させるこ
とが必要になる場合がある。例えば、リングバッファの
容量を増加させたい場合や、記録バッファの容量を増や
すべくリングバッファの容量を減らしたい場合がある。
If the operation time of the printer or the data transfer waiting time of the host computer is to be minimized, it may be necessary to change the capacity of the ring buffer depending on the situation. For example, there is a case where it is desired to increase the capacity of the ring buffer, or a case where it is desired to reduce the capacity of the ring buffer in order to increase the capacity of the recording buffer.

【0007】リングバッファの容量を変更するために
は、リングバッファへの書き込みを停止し、バッファ内
に残ったデータを全て読み出し、リングバッファ内を空
にしてからその大きさを変更する必要がある。
In order to change the capacity of the ring buffer, it is necessary to stop writing to the ring buffer, read out all the data remaining in the buffer, empty the ring buffer, and then change its size. .

【0008】[0008]

【発明が解決しようとする課題】上記のようにリングバ
ッファの容量を変更する際には、リングバッファ内に格
納していたデータへのアクセスを禁止することとなるの
で、システムのパフォーマンス低下につながる。
When the capacity of the ring buffer is changed as described above, access to the data stored in the ring buffer is prohibited, leading to a decrease in system performance. .

【0009】これは特に、イメージバッファの容量を拡
大するべくリングバッファの大きさを縮小する場合に
は、リングバッファ内のデータを、リングバッファおよ
びイメージバッファ以外のバッファに一旦待避させる必
要があるので、そのため待避用バッファが更に必要にな
るので顕著である。
In particular, when the size of the ring buffer is reduced in order to increase the capacity of the image buffer, it is necessary to temporarily save the data in the ring buffer to a buffer other than the ring buffer and the image buffer. This is notable because an evacuation buffer is further required.

【0010】本発明は以上のような状況に鑑みてなされ
たものであり、動作中にリングバッファの容量を動的に
変更することのできるリングバッファ制御装置およびリ
ングバッファ制御方法を提供することを目的とする。
The present invention has been made in view of the above situation, and provides a ring buffer control device and a ring buffer control method capable of dynamically changing the capacity of a ring buffer during operation. Aim.

【0011】[0011]

【課題を解決するための手段】上記目的を達成するため
に本発明のリングバッファ制御装置は、アドレスの連続
したメモリ領域の最高位アドレスを最低位アドレスに論
理的に隣接したアドレスとして設定し、循環的に書き込
みおよび読み出しが可能に構成されたリングバッファを
制御するリングバッファ制御装置であって、前記最高位
アドレスを記憶するボトムアドレス記憶手段と、次に書
き込むべきアドレスを示すライトポインタを記憶するラ
イトポインタ記憶手段と、次に読み出すべきアドレスを
示すリードポインタを記憶するリードポインタ記憶手段
と、前記リングバッファの容量を変更する指示を受けた
ときに、前記最高位アドレスを変更可能な状態である否
かを、前記最高位アドレス、前記ライトポインタの示す
アドレスおよび前記リードポインタの示すアドレスから
判定する判定手段と、前記リードポインタの示すアドレ
スが前記最高位アドレスを越えたときに、割り込み信号
を発生する割り込み制御手段とを備え、前記判定手段に
より前記最高位アドレスを変更可能な状態でないと判定
されたときに、前記割込み信号を受信した際に前記最高
位アドレスを変更して前記リングバッファの容量を変更
するように構成されている。
In order to achieve the above object, a ring buffer control device according to the present invention sets a highest address of a memory area having continuous addresses as an address logically adjacent to a lowest address, A ring buffer control device for controlling a ring buffer configured to be able to write and read cyclically, wherein a bottom address storage means for storing the highest address and a write pointer indicating an address to be written next. A write pointer storage unit, a read pointer storage unit that stores a read pointer indicating an address to be read next, and a state in which the highest address can be changed when an instruction to change the capacity of the ring buffer is received. Whether or not the highest address, the address indicated by the write pointer and the Determining means for determining from the address indicated by the read pointer; and interrupt control means for generating an interrupt signal when the address indicated by the read pointer exceeds the highest address, wherein the highest address is determined by the determining means. When it is determined that the state cannot be changed, the highest address is changed to change the capacity of the ring buffer when the interrupt signal is received.

【0012】また、上記目的を達成する本発明のリング
バッファ制御方法は、アドレスの連続したメモリ領域の
最高位アドレスを最低位アドレスに論理的に隣接したア
ドレスとして設定し、循環的に書き込みおよび読み出し
が可能に構成されたリングバッファを制御するリングバ
ッファ制御方法であって、前記最高位アドレスを記憶す
るボトムアドレス記憶工程と、次に書き込むべきアドレ
スを示すライトポインタを記憶するライトポインタ記憶
工程と、次に読み出すべきアドレスを示すリードポイン
タを記憶するリードポインタ記憶工程と、前記リングバ
ッファの容量を変更する指示を受けたときに、前記最高
位アドレスを変更可能な状態である否かを、前記最高位
アドレス、前記ライトポインタの示すアドレスおよび前
記リードポインタの示すアドレスから判定する判定工程
と、前記リードポインタの示すアドレスが前記最高位ア
ドレスを越えたときに、割り込み信号を発生する割り込
み制御工程と、前記判定工程により前記最高位アドレス
を変更可能な状態でないと判定されたときに、前記割込
み信号を受信した際に前記最高位アドレスを変更して前
記リングバッファの容量を変更する割り込み変更工程と
を備えている。
According to the ring buffer control method of the present invention, which achieves the above object, the highest address of a memory area having continuous addresses is set as an address logically adjacent to the lowest address, and writing and reading are performed cyclically. A ring buffer control method for controlling a ring buffer configured to be capable of, a bottom address storage step of storing the highest address, and a write pointer storage step of storing a write pointer indicating an address to be written next, A read pointer storing step of storing a read pointer indicating an address to be read next, and determining whether or not the highest address can be changed when an instruction to change the capacity of the ring buffer is received. Address, the address indicated by the write pointer, and the read pointer A judging step of judging from the address indicated by the address, an interrupt control step of generating an interrupt signal when the address indicated by the read pointer exceeds the highest address, and a state in which the highest address cannot be changed by the judging step. And when the interrupt signal is received, the highest address is changed to change the capacity of the ring buffer.

【0013】すなわち、リングバッファの容量を変更す
る指示を受けたときに、最高位アドレスを変更可能な状
態である否かを、最高位アドレス、ライトポインタの示
すアドレスおよびリードポインタの示すアドレスから判
定し、最高位アドレスを変更可能な状態でないと判定さ
れたときに、リードポインタの示すアドレスが最高位ア
ドレスを越えた際に発生される、割り込み信号を受信し
た際に最高位アドレスを変更してリングバッファの容量
を変更する。
That is, when an instruction to change the capacity of the ring buffer is received, whether or not the highest address can be changed is determined from the highest address, the address indicated by the write pointer, and the address indicated by the read pointer. When it is determined that the highest address cannot be changed, the highest address is changed when an interrupt signal is received, which is generated when the address indicated by the read pointer exceeds the highest address. Change the ring buffer capacity.

【0014】このようにすると、リングバッファの容量
の変更が可能であると判定されたときにはすぐに容量を
変更し、現在は容量が変更できないと判定されたときに
は、変更が可能となった際に割り込み信号を発生させて
その旨を通知して容量を変更することができるので、リ
ングバッファ内のデータを待避させることなく動作中に
動的にリングバッファの容量を変更することができる。
With this configuration, when it is determined that the capacity of the ring buffer can be changed, the capacity is changed immediately, and when it is determined that the capacity cannot be changed at present, the capacity is changed when the change becomes possible. Since the capacity can be changed by generating an interrupt signal and notifying the fact, the capacity of the ring buffer can be dynamically changed during operation without saving the data in the ring buffer.

【0015】[0015]

【発明の実施の形態】以下図面を参照しながら本発明の
好適な実施の形態について詳細に説明する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS Preferred embodiments of the present invention will be described below in detail with reference to the drawings.

【0016】図2は、本発明のリングバッファ制御装置
を用いたシステムの実施形態の構成を示すブロック図で
ある。該システムは、装置全体を制御するCPU101
と、制御プログラムを格納するROM103と、ワーク
メモリおよびリングバッファとして使用する領域を有す
るRAM105と、リングバッファを制御する本発明の
リングバッファ制御装置の実施形態としてのリングバッ
ファコントローラ104とが、バス101を介して互い
に接続されている。
FIG. 2 is a block diagram showing the configuration of an embodiment of a system using the ring buffer control device of the present invention. The system includes a CPU 101 that controls the entire apparatus.
A ROM 103 for storing a control program, a RAM 105 having an area used as a work memory and a ring buffer, and a ring buffer controller 104 as an embodiment of the ring buffer control device of the present invention for controlling the ring buffer. Are connected to each other.

【0017】CPU102は、リングバッファコントロ
ーラ104を介してリングバッファに格納されたデータ
を読み出す。またバス101を介してリングバッファコ
ントローラ104の各種制御レジスタ群にアクセスし
て、リングバッファコントローラ104を制御する。
The CPU 102 reads data stored in the ring buffer via the ring buffer controller 104. In addition, the CPU 101 accesses the various control registers of the ring buffer controller 104 via the bus 101 to control the ring buffer controller 104.

【0018】図3は、リングバッファ110の構造を示
す図である。リングバッファ110は、連続したメモリ
領域の最低位アドレス(リングトップ:RT)と最高位
アドレス(リングボトム:RB)とを論理的に隣接した
ものとみなしてリング状のメモリ領域を構成し、そのリ
ング状のメモリを書き込みポインタ(ライトポインタ:
WP)が指す位置(アドレス)に対してデータを書き込
み、読み出しポインタ(リードポインタ:RP)で指す
アドレスからデータを読み出す。
FIG. 3 is a diagram showing the structure of the ring buffer 110. The ring buffer 110 configures a ring-shaped memory area by regarding the lowest address (ring top: RT) and the highest address (ring bottom: RB) of a continuous memory area as logically adjacent to each other. Write the ring-shaped memory to the write pointer (write pointer:
WP) to write data to a position (address), and read data from an address indicated by a read pointer (read pointer: RP).

【0019】リングバッファコントローラは現在のライ
トポインタWPの指すアドレスにデータを書き込み、さ
らにライトポインタWPをインクリメントする。インク
リメントの結果、あらかじめ設定されていたリングバッ
ファの最高位アドレスRBを超えた場合には、ライトポ
インタWPをバッファの最低位アドレスRTに設定す
る。インクリメントによりポインタの移動する方向は、
図中矢印CCWで示すように反時計方向である。
The ring buffer controller writes data to the address indicated by the current write pointer WP, and further increments the write pointer WP. If the increment exceeds the highest address RB of the ring buffer that has been set in advance, the write pointer WP is set to the lowest address RT of the buffer. The direction in which the pointer moves by increment is
It is counterclockwise as indicated by the arrow CCW in the figure.

【0020】リードポインタRPに関しても同様に、リ
ードの度にリードポインタRPをインクリメントし、リ
ングバッファの最高位アドレスRBを超えた場合には、
リードポインタRPをバッファの最低位アドレスRTに
設定する。このように制御することにより、1次元のメ
モリをリング状に循環してアクセスすることができる。
Similarly, with respect to the read pointer RP, the read pointer RP is incremented each time the read is performed, and when the read pointer RP exceeds the highest address RB of the ring buffer,
The read pointer RP is set to the lowest address RT of the buffer. By controlling in this way, it is possible to circulate and access the one-dimensional memory in a ring shape.

【0021】図1は、本発明のリングバッファ制御装置
の実施形態である、リングバッファコントローラ104
の構成を示すブロック図である。リングバッファコント
ローラ104は、書き込みに関する構成として、書き込
み制御手段1001、ライとポインタインクリメント手
段1002、ライトポインタ保持手段1003、比較手
段1004を有しており、読み出しに関する構成とし
て、割り込み制御手段1005、リードポインタインク
リメント手段1006、リードポインタ保持手段100
7、比較手段1008を有している。
FIG. 1 shows a ring buffer controller 104 according to an embodiment of the present invention.
FIG. 3 is a block diagram showing the configuration of FIG. The ring buffer controller 104 includes a write control unit 1001, a line / pointer increment unit 1002, a write pointer holding unit 1003, and a comparison unit 1004 as components related to writing, and an interrupt control unit 1005, a read pointer Increment unit 1006, read pointer holding unit 100
7. It has comparison means 1008.

【0022】また、リングバッファのトップアドレスR
TおよびボトムアドレスRBを保持する手段として、リ
ングバッファトップアドレス保持手段1010およびリ
ングバッファボトムアドレス保持手段1011を有して
いる。
The top address R of the ring buffer
As means for holding the T and the bottom address RB, a ring buffer top address holding means 1010 and a ring buffer bottom address holding means 1011 are provided.

【0023】書き込み制御手段1001は、ライトポイ
ンタインクリメント手段1002のポインタインクリメ
ント動作を監視・抑制することによって書き込み動作を
禁止させることができる。
The write control means 1001 can inhibit the write operation by monitoring and suppressing the pointer increment operation of the write pointer increment means 1002.

【0024】割り込み制御手段1005は、リードポイ
ンタRPがリングバッファボトムアドレス保持手段10
11に保持されているボトムアドレスRBを越えた場
合、すなわち、ボトムアドレスRBに記憶されているデ
ータを読み出したときに、CPU102に対して割り込
み信号をアサートする。CPU102はこの割り込み制
御手段1005に対して、割り込みの許可・禁止が行え
る。
The interrupt control means 1005 determines that the read pointer RP is
When the data exceeds the bottom address RB held in No. 11, that is, when the data stored in the bottom address RB is read, an interrupt signal is asserted to the CPU 102. The CPU 102 can permit / prohibit the interruption to the interruption control means 1005.

【0025】リードポインタRPおよびライトポインタ
WPの現在の値と、リングバッファトップアドレスRT
およびボトムアドレスRBの値とは、バスを介してCP
U102から読み出しあるいは設定が可能である。
The current values of the read pointer RP and the write pointer WP and the ring buffer top address RT
And the value of the bottom address RB,
Reading or setting is possible from U102.

【0026】次に、本実施形態における、リングバッフ
ァのサイズを拡張および縮小する方法について具体例を
挙げて説明する。
Next, a method for expanding and reducing the size of the ring buffer in the present embodiment will be described with reference to a specific example.

【0027】図3に関して上記で説明したように、本実
施形態ではリングバッファを一次元的に連続したメモリ
として循環的に使用することを前提にしている。またリ
ードポインタRPとライトポインタWPは、バッファア
ドレスの増加する方向CCWにインクリメントされてい
くものと想定している。
As described above with reference to FIG. 3, this embodiment assumes that the ring buffer is used cyclically as a one-dimensionally continuous memory. Further, it is assumed that the read pointer RP and the write pointer WP are incremented in the direction CCW in which the buffer address increases.

【0028】ここでは、リングバッファの縮小/拡張に
伴って削除/付加される領域は、リングバッファの高位
アドレスRB側の領域が対象となるものとして説明をす
る。
Here, the description will be made assuming that the area to be deleted / added in accordance with the reduction / expansion of the ring buffer is the area on the higher address RB side of the ring buffer.

【0029】本実施形態におけるリングバッファの使
用、およびサイズの縮小/拡張処理は次のように行われ
る。すなわち、図2におけるCPU102が実行するR
OM103内のプログラムが、リングバッファコントロ
ーラ104によって制御されるRAM105内のリング
バッファ内のデータを読み出して処理を行う。
The use of the ring buffer and the size reduction / expansion processing in this embodiment are performed as follows. That is, R executed by CPU 102 in FIG.
A program in the OM 103 reads data in a ring buffer in the RAM 105 controlled by the ring buffer controller 104 and performs processing.

【0030】リングバッファへのデータの書き込みは、
図2のバス101を介して接続されている不図示のハー
ドウエアからリングバッファコントローラ104を経由
して行われる。リングバッファのサイズの縮小/拡張
は、CPU102によって実行されるプログラムからの
関数呼び出しによって処理が開始される。
Writing data to the ring buffer is as follows:
The processing is performed from hardware (not shown) connected via the bus 101 in FIG. 2 via the ring buffer controller 104. The process of reducing / expanding the size of the ring buffer is started by a function call from a program executed by the CPU 102.

【0031】前述したように、本実施形態においては、
リングバッファコントローラ104はリードポインタR
PのアドレスがリングボトムRBのアドレスを越えた時
点で、CPU102に対して割り込みを発生するように
構成されている。
As described above, in this embodiment,
The ring buffer controller 104 has a read pointer R
When the address of P exceeds the address of the ring bottom RB, an interrupt is generated for the CPU 102.

【0032】すなわちソフトウエアによって現在のリー
ドポインタRPからデータを読み出して、リングボトム
RBに対応するデータを読み出し終わった瞬間に割り込
みを発生させ、これにより割り込み処理ルーチンが呼び
出される。リングバッファ110のサイズの縮小/拡張
を行う関数とこの割り込み処理ルーチンの相互作用によ
ってリングバッファ110のサイズの縮小/拡張が実現
される。
That is, the data is read from the current read pointer RP by software, and an interrupt is generated at the moment when the data corresponding to the ring bottom RB has been read, whereby the interrupt processing routine is called. The interaction between the function for reducing / expanding the size of the ring buffer 110 and the interrupt processing routine realizes the reduction / expansion of the size of the ring buffer 110.

【0033】はじめに、リングバッファ110のサイズ
を拡張する方法について、図5を参照して説明する。図
5(a)は拡張前の状態を示しており、リングバッファ
110のリングトップとリングボトムは論理的に隣接さ
れていると認識される。ここでリングバッファ110の
サイズを拡張する場合には、現在のリングボトムの次の
アドレスからの連続したメモリ領域を、リングバッファ
拡張領域120として用意する。
First, a method of expanding the size of the ring buffer 110 will be described with reference to FIG. FIG. 5A shows a state before expansion, and it is recognized that the ring top and the ring bottom of the ring buffer 110 are logically adjacent. Here, when expanding the size of the ring buffer 110, a continuous memory area from the address next to the current ring bottom is prepared as the ring buffer expansion area 120.

【0034】そして図5(b)に示すように、新たなリ
ングボトムNRBのアドレスを、リングバッファ拡張領
域120の最高位アドレスとして設定し、リングバッフ
ァ110を、リングトップRTから新たなリングボトム
NRBまでの連続したメモリ領域として認識し直すこと
で、図5(c)に示すように、サイズの拡張された新た
なリングバッファ110として使用できる。
Then, as shown in FIG. 5B, the address of the new ring bottom NRB is set as the highest address of the ring buffer extension area 120, and the ring buffer 110 is moved from the ring top RT to the new ring bottom NRB. By re-recognizing the memory area as a continuous memory area up to, it can be used as a new ring buffer 110 whose size has been expanded, as shown in FIG.

【0035】ここで、リングバッファの拡張を行う関数
について説明する。図7はリングバッファのサイズの拡
張を実行する「リング拡張」関数の処理を示すフローチ
ャートである。この関数は、新たなリングボトムアドレ
スを引数として呼び出されると、この引数はワークメモ
リに設けた引数記憶エリアに記憶される。
Here, a function for expanding the ring buffer will be described. FIG. 7 is a flowchart showing the processing of the “ring expansion” function for expanding the size of the ring buffer. When this function is called with a new ring bottom address as an argument, this argument is stored in an argument storage area provided in the work memory.

【0036】はじめにステップS71で、現在のRP
(リードポインタ)とWP(ライトポインタ)の比較が
行われる。WPがRP以上である場合とは、両者の値が
一致しているリングバッファが空の状態か、もしくはデ
ータは存在するがリングボトムの位置とリングトップの
位置にまたがってデータが存在していない場合を表す。
First, in step S71, the current RP
(Read pointer) and WP (write pointer) are compared. The case where WP is equal to or larger than RP means that the ring buffer whose values match each other is empty or that data exists but data does not exist across the ring bottom position and the ring top position. Represents the case.

【0037】この場合はリングバッファの拡張が行い得
る状況である。従って、ステップS74へ進み、リング
バッファコントローラ104の書き込み制御手段100
1によって、リングバッファへの書き込みを禁止し、次
に現在のリングボトムRBのアドレスの次のアドレスか
ら連続する、リングバッファ拡張領域120の最高位ア
ドレスを、新たなリングボトムNRBとしてリングバッ
ファボトムアドレス手段1011に設定する(ステップ
S75)。
In this case, the ring buffer can be expanded. Therefore, the process proceeds to step S74, and the write control unit 100 of the ring buffer controller 104
1, the writing to the ring buffer is prohibited, and the highest address of the ring buffer extension area 120, which is continuous from the next address of the current ring bottom RB, is set as the new ring bottom NRB. It is set in the means 1011 (step S75).

【0038】その後、ステップS76で禁止してあった
リングバッファへの書き込みを許可し、リングバッファ
の拡張を完了する。リングバッファへの操作が正常に終
了したことを示すために、ステップS77でグローバル
変数として用意されているリングバッファ操作完了フラ
グをセットする。このフラグは後述するリングバッファ
操作完了確認関数が参照するためのものである。
Thereafter, the writing to the ring buffer prohibited in step S76 is permitted, and the expansion of the ring buffer is completed. In order to indicate that the operation on the ring buffer has been completed normally, a ring buffer operation completion flag prepared as a global variable is set in step S77. This flag is for reference by a ring buffer operation completion confirmation function to be described later.

【0039】一方、ステップS71でRPがWPより大
きい場合には、現在のリングトップRTとリングボトム
RBを挟んでリードポインタRPとライトポインタWP
が存在している状態である。この状態ではリードポイン
タRPが現在のリングトップRTアドレス以上になるま
でデータを読み出さない限り拡張は行えない。
On the other hand, if RP is larger than WP in step S71, the read pointer RP and the write pointer WP sandwich the current ring top RT and ring bottom RB.
Is present. In this state, expansion cannot be performed unless data is read out until the read pointer RP becomes equal to or greater than the current ring top RT address.

【0040】そこでリングバッファコントローラ104
の割り込み制御手段1001によって、リードポインタ
RPがリングボトムRBのアドレスを超えたらCPU1
02に対して割り込みを発生させるように設定する。更
にステップS72で、後述する割り込み処理ルーチンに
おいて対応する処理が行えるように、ケース番号「1」
をワークメモリに設けたケース記憶エリアに記憶してお
く。割り込み処理ルーチンでは種々のケースに応じて処
理を分ける必要があるため、このようにケース番号を保
持する必要がある。
Therefore, the ring buffer controller 104
When the read pointer RP exceeds the address of the ring bottom RB, the CPU 1
02 is set to generate an interrupt. Further, in step S72, the case number "1" is set so that a corresponding process can be performed in an interrupt processing routine described later.
Is stored in the case storage area provided in the work memory. In the interrupt processing routine, it is necessary to divide the processing according to various cases, and thus it is necessary to hold the case numbers.

【0041】そしてステップS73で、リングバッファ
コントローラ104の割り込み制御手段1001の割り
込みマスクを解除して、CPU102に対して割り込み
の発生を行えるように設定する。これは、リングバッフ
ァの拡張が実行できる状態となるまでは、引き続きリン
グバッファからのデータの読み出しを行えるようにする
ためである。
In step S73, the interrupt mask of the interrupt control means 1001 of the ring buffer controller 104 is released, and the CPU 102 is set so that an interrupt can be generated. This is so that data can be continuously read from the ring buffer until the ring buffer can be expanded.

【0042】プログラムによるデータ読み出しの結果、
リードポインタRPがリングボトムRBを超えた瞬間
(リングボトムに格納されていたデータを読み出した時
点)で、割り込みが発生し、後述する割り込み処理ルー
チンが呼び出される。
As a result of reading data by the program,
At the moment when the read pointer RP exceeds the ring bottom RB (when data stored in the ring bottom is read), an interrupt occurs, and an interrupt processing routine described later is called.

【0043】次に、リングバッファのサイズを縮小する
方法について、図4を参照して説明する。図中NRB
は、新たなリングボトムを示し、現在リングバッファと
して使用されている領域中のアドレス値である。このア
ドレスの次のアドレスから現在のリングボトムアドレス
までのメモリ領域が、図4(b)に示すようにリングバ
ッファ削除領域130として、リングバッファ110か
ら取り除かれる。
Next, a method of reducing the size of the ring buffer will be described with reference to FIG. NRB in the figure
Indicates a new ring bottom, and is an address value in an area currently used as a ring buffer. The memory area from the address following this address to the current ring bottom address is removed from the ring buffer 110 as the ring buffer deletion area 130 as shown in FIG.

【0044】図4(c)はリングバッファ削除領域13
0が取り除かれたあとのリングバッファ110の状態を
示しており、NRBとRTとが隣接しているようなリン
グ状の領域としてリングバッファ110は認識される。
FIG. 4C shows the ring buffer deletion area 13.
This shows the state of the ring buffer 110 after 0 has been removed, and the ring buffer 110 is recognized as a ring-shaped area where the NRB and the RT are adjacent to each other.

【0045】このリングバッファのサイズの縮小は、プ
ログラムから「リング縮小」関数を呼び出して行われ
る。関数を呼び出すときに、削除したいバッファ量が引
数として渡される。この引数はワークエリアの引数保持
領域に格納される。
The size of the ring buffer is reduced by calling a "ring reduction" function from a program. When calling the function, the amount of buffer to be deleted is passed as an argument. This argument is stored in the argument holding area of the work area.

【0046】本実施形態では、リング縮小関数が呼び出
された時点のリードポインタおよびライトポインタの指
すアドレスと、新たなリングボトムアドレスの大小関係
によって場合分けを行う。図6は、本実施形態における
ケース1とケース2との状態を示した図である。
In this embodiment, cases are classified according to the magnitude relationship between the addresses pointed to by the read pointer and the write pointer at the time when the ring reduction function is called, and the new ring bottom address. FIG. 6 is a diagram illustrating a state of the case 1 and the case 2 in the present embodiment.

【0047】図6(a)に示すケース1は、NRB≧W
P≧RP≧RTとなる場合であり、図中斜線で示した、
書き込まれているが読み出されていないデータ領域14
0、すなわち、リードポインタRPの指すアドレスから
ライトポインタWPの指すアドレスまでの領域が、リン
グバッファの削除領域130(NRB〜RB)に含まれ
ていない場合である。
In case 1 shown in FIG. 6A, NRB ≧ W
This is the case where P ≧ RP ≧ RT, which is indicated by hatching in the figure.
Data area 14 that has been written but not read
0, that is, the case where the area from the address indicated by the read pointer RP to the address indicated by the write pointer WP is not included in the ring buffer deletion area 130 (NRB to RB).

【0048】一方、図6(b)に示すケース2は、WP
≧NRBかつWP≧RPとなる場合であり、書き込まれ
ているが読み出されていないデータ領域140の一部
が、リングバッファの削除領域130(NRB〜RB)
に含まれており、ライトポインタRTの指すアドレスの
みが削除領域に入っている場合である。
On the other hand, Case 2 shown in FIG.
≧ NRB and WP ≧ RP, and a part of the data area 140 that has been written but not read is the ring buffer deletion area 130 (NRB to RB).
And only the address pointed to by the write pointer RT is in the deletion area.

【0049】次に、「リング縮小」関数の動作を図8の
フローチャートに沿って説明する。はじめにリング縮小
関数はステップS801で、リングバッファへの書き込
みを禁止し、次にステップS802で、現在のリングバ
ッファの状態がケース1、ケース2、その他のいずれに
該当するかの分岐判定が行われる。
Next, the operation of the "ring reduction" function will be described with reference to the flowchart of FIG. First, the ring reduction function prohibits writing to the ring buffer in step S801, and then in step S802, a branch determination is made as to whether the current state of the ring buffer corresponds to case 1, case 2, or other. .

【0050】ケース1の場合は、削除領域にはデータが
存在しないのですぐに削除が可能である。従って、ステ
ップS803へ進み、リングバッファボトムアドレス保
持手段1011に、引数として与えられた削除バッファ
量と現在のリングボトムアドレスRBから算出される新
リングボトムアドレスNRBを設定する。その後ステッ
プS804で、禁止していたリングバッファへの書き込
みを許可し、最後にステップS805で、リングバッフ
ァ操作完了フラグをセットしてリングバッファの縮小を
完了する。
In case 1, since there is no data in the deletion area, the data can be deleted immediately. Therefore, the process proceeds to step S803, and the new ring bottom address NRB calculated from the deletion buffer amount given as an argument and the current ring bottom address RB is set in the ring buffer bottom address holding unit 1011. Thereafter, in step S804, writing to the prohibited ring buffer is permitted. Finally, in step S805, the ring buffer operation completion flag is set to complete the reduction of the ring buffer.

【0051】ケース2の場合は、削除領域のうちライト
ポインタRTの指すアドレスからリングボトムアドレス
RBまでの部分はデータが入っていないので削除でき
る。これはステップS806で、リングボトムアドレス
保持手段1011に現在のライトポインタRPの指すア
ドレス値を設定することで行われる。この場合削除可能
な部分を削除した後でも、NRBからライトポインタR
Pの指すアドレスまでは読み出されるデータが存在して
いるので、プログラムによるデータ読み出しの完了を待
つ必要がある。
In case 2, the portion from the address pointed to by the write pointer RT to the ring bottom address RB in the deletion area contains no data and can be deleted. This is performed by setting the address value indicated by the current write pointer RP in the ring bottom address holding unit 1011 in step S806. In this case, even after the part that can be deleted is deleted, the write pointer R
Since data to be read exists up to the address indicated by P, it is necessary to wait for completion of data reading by the program.

【0052】従って、ステップS807で、割り込み処
理ルーチンにおいて後に対応する処理が行えるように、
ケース番号「2」をワークメモリに設けたケース記憶エ
リアに記憶しておく。そしてステップS808で、デー
タの読み出しが進みリードポインタRPがリングバッフ
ァボトムアドレスRBを越えた時点で割り込みが発生す
るように、割り込みマスクを解除する。
Therefore, in step S807, the corresponding processing can be performed later in the interrupt processing routine.
The case number “2” is stored in a case storage area provided in the work memory. Then, in step S808, the interrupt mask is released so that an interrupt occurs when the reading of data proceeds and the read pointer RP exceeds the ring buffer bottom address RB.

【0053】上記ケース1にもケース2にも該当しない
その他の場合をケース3とする。この場合には少なくと
もリングバッファ削除領域内にリードポインタが存在す
るので、一部の領域すら削除できない。従って、このま
まリードポインタがリングボトムに達するのを待つしか
ない。この場合、ステップS809でケース番号「3」
をワークメモリに設けたケース記憶エリアに記憶してお
く。そしてステップS810でデータの読み出しが進
み、リードポインタがリングバッファボトムアドレスを
越えた時点で割り込みが発生するように割り込みマスク
を解除する。
Other cases that do not correspond to Case 1 or Case 2 are referred to as Case 3. In this case, since the read pointer exists at least in the ring buffer deletion area, even a part of the area cannot be deleted. Therefore, there is no choice but to wait until the read pointer reaches the ring bottom. In this case, in step S809, case number "3"
Is stored in the case storage area provided in the work memory. Then, in step S810, the data reading proceeds, and the interrupt mask is released so that an interrupt occurs when the read pointer exceeds the ring buffer bottom address.

【0054】以上のようにリング縮小関数での処理が終
了すると、リング縮小関数を呼び出したプログラムで
は、後述するリング操作終了確認関数を呼び出してその
戻り値を調べる。このとき、戻り値が「FALSE」の
場合には削除操作は完了していないことを意味するの
で、リングバッファからのデータ読み出しを続け、定期
的にあるいは随時にリング操作終了確認関数を呼び出し
て、バッファ縮小の完了を確認する必要がある。
When the processing by the ring reduction function is completed as described above, the program that has called the ring reduction function calls a ring operation end confirmation function, which will be described later, and checks the return value. At this time, if the return value is “FALSE”, it means that the delete operation has not been completed, so that the data read from the ring buffer is continued, and the ring operation end confirmation function is called periodically or as needed. You need to confirm the completion of buffer reduction.

【0055】次に、割り込みハンドラでの処理につい
て、図9のフローチャートを参照して説明する。割り込
みが発生すると、ステップS91でケース番号記憶エリ
アの内容をチェックし、ケース番号によって処理を分岐
する。本実施形態における割り込みの種類は、図7に関
して説明した「リング拡張」のステップS72に対応す
るケース1と、図8に関して説明した「リング縮小」の
ステップS807およびステップS809にそれぞれ対
応するケース2およびケース3の3種類である。
Next, the processing in the interrupt handler will be described with reference to the flowchart in FIG. When an interrupt occurs, the contents of the case number storage area are checked in step S91, and the process branches depending on the case number. The types of interrupts in the present embodiment include a case 1 corresponding to step S72 of “ring expansion” described with reference to FIG. 7, and a case 2 corresponding to steps S807 and S809 of “ring reduction” described with reference to FIG. Case 3 is three types.

【0056】ケース番号「1」に対する処理は、はじめ
にステップS92でリングバッファへの書き込みを禁止
した後に、ステップS93で、リングバッファボトムア
ドレス保持手段1011に引数記憶エリアから読み出し
た新リングバッファボトムアドレスNRBを設定し、リ
ングバッファを再構成する。その後ステップS94で禁
止していたリングバッファへの書き込みを許可し、最後
にステップS92でリングバッファ操作完了フラグをセ
ットして、リングバッファの拡張を完了する。
In the process for case number "1", first, writing to the ring buffer is prohibited in step S92, and in step S93, the new ring buffer bottom address NRB read from the argument storage area is stored in the ring buffer bottom address holding means 1011. And reconfigure the ring buffer. Thereafter, writing to the ring buffer, which was prohibited in step S94, is permitted. Finally, in step S92, a ring buffer operation completion flag is set to complete the expansion of the ring buffer.

【0057】ケース番号「2」および「3」に対する処
理は、ステップS96で、リングバッファボトムアドレ
ス保持手段1011に引数記憶エリアから読み出した新
リングバッファボトムアドレスNRBを設定し、リング
バッファを再構成する。その後ステップS97で禁止し
ていたリングバッファへの書き込みを許可し、最後にス
テップS98でリングバッファ操作完了フラグをセット
して、リングバッファの縮小を完了する。
In the processing for the case numbers "2" and "3", the new ring buffer bottom address NRB read from the argument storage area is set in the ring buffer bottom address holding means 1011 in step S96, and the ring buffer is reconfigured. . Thereafter, the writing into the ring buffer, which was prohibited in step S97, is permitted. Finally, in step S98, the ring buffer operation completion flag is set, and the reduction of the ring buffer is completed.

【0058】このように、ケース番号「2」および
「3」に対する処理では、ケース番号「1」に対する処
理で行っている、リングバッファへの書き込みの禁止を
行わない。これはリングバッファ縮小関数のステップS
801で既に禁止しているからである。
As described above, in the processing for the case numbers "2" and "3", the write to the ring buffer, which is performed in the processing for the case number "1", is not inhibited. This is step S of the ring buffer reduction function.
This is because 801 has already been prohibited.

【0059】リング拡張関数やリング縮小関数などのリ
ングバッファ操作関数は、その戻り時点で必ずしもリン
グバッファへの操作が完了しているとは限らない。その
ため図10に示す、別に設けたリング操作終了確認関数
を呼び出してその戻り値が「TRUE」であることを確
認する必要がある。
The ring buffer operation functions such as the ring expansion function and the ring reduction function do not always complete the operation on the ring buffer at the time of return. Therefore, it is necessary to call a separately provided ring operation end confirmation function shown in FIG. 10 and confirm that the return value is “TRUE”.

【0060】リング操作終了確認関数での処理は、ステ
ップS101でリングバッファ完了フラグがセットされ
ているか否かを確認し、フラグがセットされていればス
テップS102へ進み、戻り値として「TRUE」を返
し、セットされていなければステップS103へ進み戻
り値として「FALSE」を返す。
In the processing by the ring operation end confirmation function, it is confirmed whether or not the ring buffer completion flag is set in step S101. If the flag is set, the process proceeds to step S102, and "TRUE" is returned as a return value. If not, the flow advances to step S103 to return "FALSE" as a return value.

【0061】以上説明した本実施形態によれば、リング
バッファの読み出しポインタがリングボトムアドレスを
越えた時点で割り込みが発生するように構成されている
ことにより、動的にリングバッファのサイズを変更する
ことができ、以ってバッファの効率的な利用が可能とな
る。
According to the above-described embodiment, the size of the ring buffer is dynamically changed by generating an interrupt when the read pointer of the ring buffer exceeds the ring bottom address. This allows efficient use of the buffer.

【0062】なお、本発明は、複数の機器(例えばホス
トコンピュータ、インタフェイス機器、リーダ、プリン
タなど)から構成されるシステムに適用しても、一つの
機器からなる装置(例えば、複写機、ファクシミリ装置
など)に適用してもよい。
Even if the present invention is applied to a system including a plurality of devices (for example, a host computer, an interface device, a reader, a printer, etc.), an apparatus including one device (for example, a copier, a facsimile) Device).

【0063】また、本発明の目的は、前述した実施形態
の機能を実現するソフトウェアのプログラムコードを記
録した記憶媒体(または記録媒体)を、システムあるい
は装置に供給し、そのシステムあるいは装置のコンピュ
ータ(またはCPUやMPU)が記憶媒体に格納されたプログ
ラムコードを読み出し実行することによっても、達成さ
れることは言うまでもない。この場合、記憶媒体から読
み出されたプログラムコード自体が前述した実施形態の
機能を実現することになり、そのプログラムコードを記
憶した記憶媒体は本発明を構成することになる。また、
コンピュータが読み出したプログラムコードを実行する
ことにより、前述した実施形態の機能が実現されるだけ
でなく、そのプログラムコードの指示に基づき、コンピ
ュータ上で稼働しているオペレーティングシステム(OS)
などが実際の処理の一部または全部を行い、その処理に
よって前述した実施形態の機能が実現される場合も含ま
れることは言うまでもない。
Further, an object of the present invention is to supply a storage medium (or a recording medium) in which a program code of software for realizing the functions of the above-described embodiments is recorded to a system or an apparatus, and a computer (a computer) of the system or the apparatus. It is needless to say that the present invention can also be achieved by a CPU or an MPU) reading and executing the program code stored in the storage medium. In this case, the program code itself read from the storage medium implements the functions of the above-described embodiment, and the storage medium storing the program code constitutes the present invention. Also,
When the computer executes the readout program code, not only the functions of the above-described embodiments are realized, but also the operating system (OS) running on the computer based on the instructions of the program code.
It is needless to say that a case in which the functions of the above-described embodiments are implemented by performing part or all of the actual processing.

【0064】さらに、記憶媒体から読み出されたプログ
ラムコードが、コンピュータに挿入された機能拡張カー
ドやコンピュータに接続された機能拡張ユニットに備わ
るメモリに書込まれた後、そのプログラムコードの指示
に基づき、その機能拡張カードや機能拡張ユニットに備
わるCPUなどが実際の処理の一部または全部を行い、そ
の処理によって前述した実施形態の機能が実現される場
合も含まれることは言うまでもない。
Further, after the program code read from the storage medium is written into the memory provided in the function expansion card inserted into the computer or the function expansion unit connected to the computer, the program code is read based on the instruction of the program code. Needless to say, the CPU included in the function expansion card or the function expansion unit performs part or all of the actual processing, and the processing realizes the functions of the above-described embodiments.

【0065】本発明を上記記憶媒体に適用する場合、そ
の記憶媒体には、先に説明した(図7、8、9および/
または図10に示す)フローチャートに対応するプログ
ラムコードが格納されることになる。
When the present invention is applied to the above-mentioned storage medium, the storage medium described above (FIGS. 7, 8, 9 and / or
Alternatively, a program code corresponding to the flowchart (shown in FIG. 10) is stored.

【0066】[0066]

【発明の効果】以上詳細に説明したように、本発明によ
れば、リングバッファの容量の変更が可能であると判定
されたときにはすぐに容量を変更し、現在は容量が変更
できないと判定されたときには、変更が可能となった際
に割り込み信号を発生させてその旨を通知して容量を変
更することができるので、リングバッファ内のデータを
待避させることなく動作中に動的にリングバッファの容
量を変更することができるという効果がある。
As described above in detail, according to the present invention, when it is determined that the capacity of the ring buffer can be changed, the capacity is changed immediately, and it is determined that the capacity cannot be changed at present. When a change is possible, an interrupt signal can be generated to notify the fact and the capacity can be changed, so the ring buffer can be dynamically changed during operation without saving the data in the ring buffer. There is an effect that the capacity of the data can be changed.

【0067】これは特に、メモリエリアを分割して2つ
のバッファ領域として使用する装置において、装置の動
作状態やデータ転送速度等に応じて適宜2つのバッファ
の割り当てを変更することができるので、極めて有効で
ある。
Particularly, in an apparatus in which a memory area is divided and used as two buffer areas, the allocation of two buffers can be changed as appropriate according to the operation state of the apparatus, the data transfer rate, and the like. It is valid.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明のリングバッファコントローラの実施形
態の構成を示すブロック図である。
FIG. 1 is a block diagram showing a configuration of an embodiment of a ring buffer controller of the present invention.

【図2】システム全体の構成を示すブロック図である。FIG. 2 is a block diagram showing the configuration of the entire system.

【図3】リングバッファの構造を示す図である。FIG. 3 is a diagram showing a structure of a ring buffer.

【図4】リングバッファの縮小処理を説明するための図
である。
FIG. 4 is a diagram for explaining a reduction process of a ring buffer;

【図5】リングバッファの拡張処理を説明するための図
である。
FIG. 5 is a diagram for explaining a process of expanding a ring buffer;

【図6】リングバッファ縮小時における場合分けを説明
するための図である。
FIG. 6 is a diagram for explaining the case division when the ring buffer is reduced.

【図7】リングバッファの拡張関数の処理を示すフロー
チャートである。
FIG. 7 is a flowchart illustrating processing of an extension function of a ring buffer.

【図8】リングバッファの縮小関数の処理を示すフロー
チャートである。
FIG. 8 is a flowchart showing processing of a ring buffer reduction function.

【図9】割り込みハンドラ関数の処理を示すフローチャ
ートである。
FIG. 9 is a flowchart illustrating processing of an interrupt handler function.

【図10】リング操作終了確認関数の処理を示すフロー
チャートである。
FIG. 10 is a flowchart illustrating processing of a ring operation end confirmation function.

【符号の説明】[Explanation of symbols]

101 バス 102 CPU 103 ROM 104 リングバッファコントローラ 105 RAM 110 リングバッファ 120 拡張領域 130 削除領域 140 データ領域 1001 書き込み制御手段 1002 ライトポインタインクリメント手段 1003 ライトポインタ保持手段 1004 比較手段 1005 割り込み制御手段 1006 リードポインタインクリメント手段 1007 リードポインタ保持手段 1008 比較手段 1010 リングバッファトップアドレス保持手段 1011 リングバッファボトムアドレス保持手段 101 Bus 102 CPU 103 ROM 104 Ring buffer controller 105 RAM 110 Ring buffer 120 Extended area 130 Delete area 140 Data area 1001 Write control means 1002 Write pointer increment means 1003 Write pointer holding means 1004 Comparison means 1005 Interrupt control means 1006 Read pointer increment means 1007 read pointer holding means 1008 comparing means 1010 ring buffer top address holding means 1011 ring buffer bottom address holding means

Claims (11)

【特許請求の範囲】[Claims] 【請求項1】 アドレスの連続したメモリ領域の最高位
アドレスを最低位アドレスに論理的に隣接したアドレス
として設定し、循環的に書き込みおよび読み出しが可能
に構成されたリングバッファを制御するリングバッファ
制御装置であって、 前記最高位アドレスを記憶するボトムアドレス記憶手段
と、 次に書き込むべきアドレスを示すライトポインタを記憶
するライトポインタ記憶手段と、 次に読み出すべきアドレスを示すリードポインタを記憶
するリードポインタ記憶手段と、 前記リングバッファの容量を変更する指示を受けたとき
に、前記最高位アドレスを変更可能な状態である否か
を、前記最高位アドレス、前記ライトポインタの示すア
ドレスおよび前記リードポインタの示すアドレスから判
定する判定手段と、 前記リードポインタの示すアドレスが前記最高位アドレ
スを越えたときに、割り込み信号を発生する割り込み制
御手段とを備え、 前記判定手段により前記最高位アドレスを変更可能な状
態でないと判定されたときに、前記割込み信号を受信し
た際に前記最高位アドレスを変更して前記リングバッフ
ァの容量を変更するように構成されていることを特徴と
するリングバッファ制御装置。
1. A ring buffer control for setting a highest address of a memory area having continuous addresses as an address logically adjacent to a lowest address, and controlling a ring buffer configured to be able to write and read cyclically. An apparatus, comprising: a bottom address storage means for storing the highest address; a write pointer storage means for storing a write pointer indicating an address to be written next; and a read pointer for storing a read pointer indicating an address to be read next. Storage means, when receiving an instruction to change the capacity of the ring buffer, determines whether or not the highest address can be changed, by determining the highest address, the address indicated by the write pointer, and the read pointer. Determining means for determining from the indicated address; Interrupt control means for generating an interrupt signal when the address indicated by the address exceeds the highest address.When the determination means determines that the highest address cannot be changed, the interrupt signal is output. The ring buffer control device is configured to change the highest address and change the capacity of the ring buffer when receiving the ring buffer.
【請求項2】 前記リングバッファの容量を変更する指
示が、新たに最高位アドレスとすべきアドレスと共に送
信されることを特徴とする請求項1に記載のリングバッ
ファ制御装置。
2. The ring buffer control device according to claim 1, wherein the instruction to change the capacity of the ring buffer is transmitted together with an address to be newly set as the highest address.
【請求項3】 前記判定手段は、前記リングバッファの
容量を拡張する指示を受けたときに、前記リードポイン
タの示すアドレスが前記ライトポインタの示すアドレス
より大きいときに前記最高位アドレスを変更可能な状態
でないと判定することを特徴とする請求項1または2に
記載のリングバッファ制御装置。
3. The high-order address can be changed when an address indicated by the read pointer is larger than an address indicated by the write pointer when an instruction to expand the capacity of the ring buffer is received. 3. The ring buffer control device according to claim 1, wherein it is determined that the state is not the state.
【請求項4】 前記判定手段は、前記リングバッファの
容量を縮小する指示を受けたときに、前記新たに最高位
アドレスとすべきアドレスが前記ライトポインタの示す
アドレス以上であり、かつ前記ライトポインタの示すア
ドレスが前記リードポインタの示すアドレス以上である
ときに、前記最高位アドレスを変更可能であると判定す
ることを特徴とする請求項2に記載のリングバッファ制
御装置。
4. The method according to claim 1, wherein when the instruction to reduce the capacity of the ring buffer is received, the address to be newly set as the highest address is equal to or greater than the address indicated by the write pointer. 3. The ring buffer control device according to claim 2, wherein when the address indicated by is higher than the address indicated by the read pointer, it is determined that the highest address can be changed.
【請求項5】 前記判定手段は、前記リングバッファの
容量を縮小する指示を受けたときに、前記新たに最高位
アドレスとすべきアドレスが前記ライトポインタの示す
アドレスより小さく、かつ前記ライトポインタの示すア
ドレスが前記リードポインタの示すアドレス以上である
ときに、前記最高位アドレスを変更可能でないと判定す
ると共に、前記ライトポインタの示すアドレスを前記最
高位アドレスとして設定することを特徴とする請求項4
に記載のリングバッファ制御装置。
5. When the determination means receives an instruction to reduce the capacity of the ring buffer, the address to be the new highest address is smaller than the address indicated by the write pointer, and 5. The method according to claim 4, wherein when the indicated address is equal to or greater than the address indicated by the read pointer, it is determined that the highest address cannot be changed, and the address indicated by the write pointer is set as the highest address.
3. The ring buffer control device according to item 1.
【請求項6】 連続したメモリ領域を有するメモリモジ
ュールを備えており、該メモリモジュールのメモリ領域
を分割して、一方を受信データを一時的に記憶する受信
バッファとして使用し、他方を記録データを一時的に記
憶する記録バッファとして使用するように構成された記
録装置であって、前記受信バッファが請求項1から5の
いずれか1項に記載のリングバッファ制御装置によって
制御される前記リングバッファからなることを特徴とす
る記録装置。
6. A memory module having a continuous memory area, wherein a memory area of the memory module is divided, one of which is used as a reception buffer for temporarily storing reception data, and the other is used for recording data. A recording device configured to be used as a recording buffer for temporarily storing, wherein the reception buffer is configured to receive the signal from the ring buffer controlled by the ring buffer control device according to any one of claims 1 to 5. A recording device, comprising:
【請求項7】 アドレスの連続したメモリ領域の最高位
アドレスを最低位アドレスに論理的に隣接したアドレス
として設定し、循環的に書き込みおよび読み出しが可能
に構成されたリングバッファを制御するリングバッファ
制御方法であって、 前記最高位アドレスを記憶するボトムアドレス記憶工程
と、 次に書き込むべきアドレスを示すライトポインタを記憶
するライトポインタ記憶工程と、 次に読み出すべきアドレスを示すリードポインタを記憶
するリードポインタ記憶工程と、 前記リングバッファの容量を変更する指示を受けたとき
に、前記最高位アドレスを変更可能な状態である否か
を、前記最高位アドレス、前記ライトポインタの示すア
ドレスおよび前記リードポインタの示すアドレスから判
定する判定工程と、 前記リードポインタの示すアドレスが前記最高位アドレ
スを越えたときに、割り込み信号を発生する割り込み制
御工程と、 前記判定工程により前記最高位アドレスを変更可能な状
態でないと判定されたときに、前記割込み信号を受信し
た際に前記最高位アドレスを変更して前記リングバッフ
ァの容量を変更する割り込み変更工程とを備えることを
特徴とするリングバッファ制御方法。
7. A ring buffer control for setting a highest address of a memory area having continuous addresses as an address logically adjacent to a lowest address, and controlling a ring buffer configured to be capable of cyclically writing and reading. A bottom address storing step of storing the highest address, a write pointer storing step of storing a write pointer indicating an address to be written next, and a read pointer storing a read pointer indicating an address to be read next. A storage step, when receiving an instruction to change the capacity of the ring buffer, determines whether or not the highest address can be changed, by determining the highest address, the address indicated by the write pointer, and the read pointer. A determination step for determining from the indicated address; An interrupt control step of generating an interrupt signal when the address indicated by the address exceeds the highest address; and receiving the interrupt signal when the determination step determines that the highest address is not in a changeable state. An interrupt changing step of changing the highest-order address and changing the capacity of the ring buffer at the time of execution.
【請求項8】 前記リングバッファの容量を変更する指
示が、新たに最高位アドレスとすべきアドレスと共に送
信されることを特徴とする請求項7に記載のリングバッ
ファ制御方法。
8. The ring buffer control method according to claim 7, wherein the instruction to change the capacity of the ring buffer is transmitted together with an address to be newly set as the highest address.
【請求項9】 前記判定工程は、前記リングバッファの
容量を拡張する指示を受けたときに、前記リードポイン
タの示すアドレスが前記ライトポインタの示すアドレス
より大きいときに前記最高位アドレスを変更可能な状態
でないと判定することを特徴とする請求項7または8に
記載のリングバッファ制御方法。
9. The method according to claim 1, wherein the determining step is configured to change the highest address when an address indicated by the read pointer is larger than an address indicated by the write pointer when an instruction to expand the capacity of the ring buffer is received. 9. The ring buffer control method according to claim 7, wherein it is determined that the state is not the state.
【請求項10】 前記判定工程は、前記リングバッファ
の容量を縮小する指示を受けたときに、前記新たに最高
位アドレスとすべきアドレスが前記ライトポインタの示
すアドレス以上であり、かつ前記ライトポインタの示す
アドレスが前記リードポインタの示すアドレス以上であ
るときに、前記最高位アドレスを変更可能であると判定
することを特徴とする請求項8に記載のリングバッファ
制御方法。
10. The method according to claim 1, wherein when the instruction to reduce the capacity of the ring buffer is received, the address to be newly set as the highest address is equal to or greater than the address indicated by the write pointer. 9. The ring buffer control method according to claim 8, wherein when the address indicated by is higher than the address indicated by the read pointer, it is determined that the highest address can be changed.
【請求項11】 前記判定工程は、前記リングバッファ
の容量を縮小する指示を受けたときに、前記新たに最高
位アドレスとすべきアドレスが前記ライトポインタの示
すアドレスより小さく、かつ前記ライトポインタの示す
アドレスが前記リードポインタの示すアドレス以上であ
るときに、前記最高位アドレスを変更可能でないと判定
すると共に、前記ライトポインタの示すアドレスを前記
最高位アドレスとして設定することを特徴とする請求項
10に記載のリングバッファ制御方法。
11. The method according to claim 11, wherein when the instruction to reduce the capacity of the ring buffer is received, the address to be the new highest address is smaller than the address indicated by the write pointer, and 11. The method according to claim 10, wherein when the indicated address is equal to or larger than the address indicated by the read pointer, it is determined that the highest address cannot be changed, and the address indicated by the write pointer is set as the highest address. 3. The ring buffer control method according to 1.
JP11137697A 1999-05-18 1999-05-18 Ring buffer control device and ring buffer control method Withdrawn JP2000330761A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP11137697A JP2000330761A (en) 1999-05-18 1999-05-18 Ring buffer control device and ring buffer control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP11137697A JP2000330761A (en) 1999-05-18 1999-05-18 Ring buffer control device and ring buffer control method

Publications (1)

Publication Number Publication Date
JP2000330761A true JP2000330761A (en) 2000-11-30

Family

ID=15204706

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11137697A Withdrawn JP2000330761A (en) 1999-05-18 1999-05-18 Ring buffer control device and ring buffer control method

Country Status (1)

Country Link
JP (1) JP2000330761A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003242024A (en) * 2001-12-21 2003-08-29 Agere Systems Inc Method and apparatus for buffer partitioning without loss of data
US7194191B2 (en) 2000-12-05 2007-03-20 Pioneer Corporation Information recording and reproducing apparatus
US7286744B2 (en) * 2000-12-18 2007-10-23 Pioneer Corporation Apparatus for recording and reproducing information onto and from a recording medium having a ring buffer area
JP2010200264A (en) * 2009-02-27 2010-09-09 Hitachi Ltd Buffer control method and packet communication device
JP2017126203A (en) * 2016-01-14 2017-07-20 株式会社デンソー Arithmetic processing unit
JP2019130772A (en) * 2018-01-31 2019-08-08 ブラザー工業株式会社 Image formation apparatus and program

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7194191B2 (en) 2000-12-05 2007-03-20 Pioneer Corporation Information recording and reproducing apparatus
US7286744B2 (en) * 2000-12-18 2007-10-23 Pioneer Corporation Apparatus for recording and reproducing information onto and from a recording medium having a ring buffer area
JP2003242024A (en) * 2001-12-21 2003-08-29 Agere Systems Inc Method and apparatus for buffer partitioning without loss of data
JP2010200264A (en) * 2009-02-27 2010-09-09 Hitachi Ltd Buffer control method and packet communication device
JP2017126203A (en) * 2016-01-14 2017-07-20 株式会社デンソー Arithmetic processing unit
JP2019130772A (en) * 2018-01-31 2019-08-08 ブラザー工業株式会社 Image formation apparatus and program

Similar Documents

Publication Publication Date Title
US5940866A (en) Information handling system having a local address queue for local storage of command blocks transferred from a host processing side
JP3226095B2 (en) Network printer
US5968143A (en) Information handling system for transfer of command blocks to a local processing side without local processor intervention
JPH0827707B2 (en) Control device and control method for FIFO buffer and device for controlling data transfer
JPH01277928A (en) Printer
US5905912A (en) System for implementing peripheral device bus mastering in a computer using a list processor for asserting and receiving control signals external to the DMA controller
US6687763B2 (en) ATAPI command receiving method
JP4373255B2 (en) Direct memory access control apparatus and method
JP2000330761A (en) Ring buffer control device and ring buffer control method
JP2008009697A (en) Image processing apparatus and program
JP2018106222A (en) Information processing apparatus and communication control method
JPH10334037A (en) Communication dma device
EP1035467B1 (en) Printer and printer data processing method
JP3756215B2 (en) Interface controller and method
US5764865A (en) Page printer controller
JP3951084B2 (en) Storage control device and printer having the storage control device
JP3528976B2 (en) Information output device
JPS5921051B2 (en) Communication control device
JPH05242009A (en) Direct memory access device
JPH02310649A (en) Received frame transfer method and communication control device
JP2001144817A (en) Data communication system
JPS6398049A (en) Bus control system in buffer nullifying processing
JPH0475153A (en) Multi reception print control method
JP2003186666A (en) Microcomputer and DMA control circuit
JPH11184712A (en) Information processing device

Legal Events

Date Code Title Description
A300 Application deemed to be withdrawn because no request for examination was validly filed

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20060801