JP4821628B2 - Packet buffer FIFO memory device - Google Patents

Packet buffer FIFO memory device Download PDF

Info

Publication number
JP4821628B2
JP4821628B2 JP2007015034A JP2007015034A JP4821628B2 JP 4821628 B2 JP4821628 B2 JP 4821628B2 JP 2007015034 A JP2007015034 A JP 2007015034A JP 2007015034 A JP2007015034 A JP 2007015034A JP 4821628 B2 JP4821628 B2 JP 4821628B2
Authority
JP
Japan
Prior art keywords
address
data
write
read
packet
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
JP2007015034A
Other languages
Japanese (ja)
Other versions
JP2008182550A (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.)
Oki Electric Industry Co Ltd
Original Assignee
Oki Electric Industry 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 Oki Electric Industry Co Ltd filed Critical Oki Electric Industry Co Ltd
Priority to JP2007015034A priority Critical patent/JP4821628B2/en
Publication of JP2008182550A publication Critical patent/JP2008182550A/en
Application granted granted Critical
Publication of JP4821628B2 publication Critical patent/JP4821628B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、パケットバッファ用メモリに関する。 The present invention relates to a packet buffer memory.

パケットバッファ用FIFOメモリは、パケットを処理する装置において、速度変換、キューイングを用途として用いられている。その典型的な構成は、パケットデータを格納するメモリ、書き込みアドレス制御部、読み出しアドレス制御部、状態制御部からなる。   The packet buffer FIFO memory is used for speed conversion and queuing in an apparatus for processing packets. A typical configuration includes a memory for storing packet data, a write address control unit, a read address control unit, and a state control unit.

従来の構成では、メモリの最終アドレスから先頭アドレスへ連続して書き込みができるリング状の構成をとり、連続した書き込みと読み出しが可能な構成であり、書き込みクロックと読み出しクロックが同期した同じ周波数のクロックである。   The conventional configuration uses a ring-like configuration that allows continuous writing from the last address of the memory to the first address, and allows continuous writing and reading, and a clock with the same frequency that synchronizes the write clock and the read clock. It is.

また、このメモリは読み出しと書き込みが同時にできるデュアルポートRAMの構成をとり、データ読み出し中に次パケットのデータが書き込み可能なメモリである。   In addition, this memory has a dual port RAM configuration capable of reading and writing at the same time, and is a memory in which data of the next packet can be written during data reading.

このパケットバッファ用FIFOメモリの入力条件として、パケットサイズをパケットデータの先頭に付加した書き込みデータ、書き込みアドレス生成用のクロックを含んでいる。   As input conditions for the packet buffer FIFO memory, write data with the packet size added to the beginning of the packet data and a clock for generating a write address are included.

また、書き込む1パケットのデータ開始から終了までをアサートしてメモリへの書き込みを許可する書き込みイネーブル、読み出しアドレス生成用のクロック、メモリ出力側のデバイスをも含む。さらに、モジュールが入力(受け入れ)可能であることを通知して、呼び出しを許可する読み出しイネーブル、書き込みアドレス、読み出しアドレス値のリセットを行うRESET信号がある。   It also includes a write enable that asserts from the start to the end of the data of one packet to be written to allow writing to the memory, a clock for read address generation, and a device on the memory output side. In addition, there is a RESET signal that notifies that the module is ready for input (acceptance) and resets the read enable, write address, and read address values that allow the call.

動作方法として、最初にメモリを空(EMPTY)の状態にするために、書き込みアドレスと読み出しアドレスを外部からのRESET信号によって状態制御部からそれぞれリセットし、メモリを空(EMPTY)の状態にして初期化を行う。このとき、読み出しアドレス制御部はEMPTY信号がアサートされているため読み出し動作を停止している。   As an operation method, in order to first make the memory empty (EMPTY) state, the write address and the read address are reset from the state control unit by an external RESET signal, respectively, and the memory is made empty (EMPTY) state and initialized. To do. At this time, the read address control unit stops the read operation because the EMPTY signal is asserted.

次に、パケットを受信すると書き込みアドレス制御部が、メモリの空き領域がないとき(FULL状態)に状態制御部から出力されるFULL信号がネゲート状態であることを認識し、書き込み可能な状態であると判断する。つまり、メモリは空(EMPTY)の状態である。   Next, when the packet is received, the write address control unit recognizes that the FULL signal output from the state control unit is negated when there is no free memory area (FULL state), and is in a writable state. Judge. That is, the memory is empty (EMPTY).

続いて、書き込みイネーブルがアサートされている間に、書き込みクロックによってインクリメントして生成した書き込みアドレスとメモリへのメモリ書き込みイネーブル信号をメモリに出力する。この書き込みアドレスと、メモリ書き込みイネーブル信号によって、パケットサイズをパケットデータの先頭に付加した書き込みデータをメモリに格納する。   Subsequently, while the write enable is asserted, the write address generated by incrementing with the write clock and the memory write enable signal to the memory are output to the memory. With this write address and a memory write enable signal, write data with the packet size added to the beginning of the packet data is stored in the memory.

次に、状態制御部において、メモリの書き込みアドレスと読み出しアドレスを常時比較し、パケットが書き込まれたことによって生じる書き込みアドレスと読み出しアドレスの差分を検出してEMPTY信号をネゲートさせる。   Next, the state control unit constantly compares the write address and the read address of the memory, detects the difference between the write address and the read address generated by writing the packet, and negates the EMPTY signal.

読み出しアドレス制御部は、EMPTY信号がネゲートされたことで、メモリにデータの書き込みが行われたと判断する。更に、メモリの出力側デバイス、モジュール等が入力(受け入れ)可能であることを示す読み出しイネーブル信号が、アサートされていることを確認する。   The read address control unit determines that data has been written to the memory when the EMPTY signal is negated. Further, it is confirmed that the read enable signal indicating that the memory output side device, module or the like can be input (accepted) is asserted.

読み出しイネーブル信号がアサートされていれば、先頭のアドレスにあるパケットサイズを読み出して、読み出しクロックによってパケットサイズ分だけインクリメントされた読み出しアドレスを生成する。   If the read enable signal is asserted, the packet size at the head address is read, and a read address incremented by the packet size by the read clock is generated.

読み出しアドレス制御部はメモリへのメモリ読み出しイネーブル信号と、生成した読み出しアドレスと共にメモリに出力し、それにより1パケットの読み出しデータがメモリから出力される。   The read address control unit outputs a memory read enable signal to the memory together with the generated read address to the memory, so that one packet of read data is output from the memory.

また、状態制御部は、メモリの残容量が一定以下になった場合、次のパケットサイズのデータを書き込む領域が不足する(FULL状態を越える)ことを、FULL信号をアサートして書き込みアドレス制御部に通知し、事前に書き込み動作を停止させることで、書き込みアドレスが読み出しアドレスを追い越すことのないようにする。   In addition, when the remaining capacity of the memory becomes below a certain level, the status control unit asserts that the area for writing the next packet size data is insufficient (exceeds the FULL state) and asserts the FULL signal to write address control unit. And the write operation is stopped in advance so that the write address does not overtake the read address.

この動作によって、書き込みアドレスが読み出しアドレスを越えて書き込みを行い、未読データを上書きしてしまうことによるデータの消失を防止する。   This operation prevents data loss due to overwriting of unread data by writing over the read address exceeding the read address.

ここで、読み出し側のパケットサイズは、書き込み時もしくは読み出し時に何らかの外因によって、パケットサイズが異常な値を示したと仮定する。   Here, it is assumed that the packet size on the reading side shows an abnormal value due to some external factor at the time of writing or reading.

このとき、仮に正常なパケットサイズより大きい値を示した場合、読み出し制御部は、その値を利用して読み出しを行うため、正常な1パケット分を越えて読み出し動作を継続してしまうことが予想される。この動作を回避する方法として、書き込みアドレス値と読み出しアドレス値の比較を常に行い、同値になることをチェックしている。   At this time, if a value larger than the normal packet size is indicated, the read control unit performs reading using the value, so that it is expected that the read operation will continue beyond one normal packet. Is done. As a method of avoiding this operation, a comparison is always made between the write address value and the read address value to check that they are the same value.

仮に同値になったときは、状態制御部でメモリが空(EMPTY)になったと判断してEMPTY信号をアサートする。   If the values are the same, the state control unit determines that the memory is empty (EMPTY) and asserts the EMPTY signal.

読み出しアドレス制御部では、読み出しが完了していないにも関わらず、EMPTY信号がアサートされたため、ERROR信号を状態制御部に出力する。   The read address control unit outputs the ERROR signal to the state control unit because the EMPTY signal is asserted even though the reading is not completed.

状態制御部は書き込みアドレス制御部と読み出しアドレス制御部の両方にRESET信号を出力することでアドレス値を初期化し、即時にメモリの読み出し動作を停止させ、メモリが空となった状態からメモリ動作を再スタートさせる。   The status control unit initializes the address value by outputting a RESET signal to both the write address control unit and the read address control unit, immediately stops the memory read operation, and starts the memory operation from the state where the memory is empty. Restart.

従来の構成をもつパケットバッファ用FIFOメモリは、読み出しアドレスが書き込みアドレスを追い越した場合に、メモリの異常動作を停止させることができた。   The packet buffer FIFO memory having the conventional configuration can stop the abnormal operation of the memory when the read address exceeds the write address.

また、パケットバッファ用FIFOメモリに格納されるパケットデータの書き込み及び読み込みの制御技術については、例えば、下記に示す特許文献1に記載されている。
特開平9-247213号公報
Further, a technique for controlling the writing and reading of packet data stored in the packet buffer FIFO memory is described in, for example, Patent Document 1 shown below.
JP-A-9-247213

しかし、書き込みと読み出しが常時行われている場合、何らかの外因によってパケットサイズが異常な値を示したときに、読み出しアドレスが書き込みアドレスを追い越さない場合は、従来の回路ではこのような異常を検出できず、状態制御部がEMPTY信号をアサートしない限り(メモリが空になるまで)読み出し動作を繰り返してしまうため、異常なデータ読み出しを続けてしまう。   However, when writing and reading are always performed, if the packet size shows an abnormal value due to some external cause, and the read address does not overtake the write address, the conventional circuit can detect such an abnormality. As long as the state control unit does not assert the EMPTY signal (until the memory becomes empty), the read operation is repeated, and thus abnormal data reading continues.

上記のような動作の場合、書き込みアドレスと読み出しアドレスの整合がとれなくなってしまうため、異常なパケットを読み出す、または、読み出し続けるといった誤動作を生じる可能性があり、誤動作が生じた場合は異常を検出することが困難である。   In the case of the above operation, the write address and the read address are not matched, so there is a possibility of malfunction such as reading an abnormal packet or continuing to read, and if malfunction occurs, the malfunction is detected. Difficult to do.

そこで、本発明は、上記問題点を解決し、パケットサイズが異常な値を示したときにも正常な動作をするパケットバッファ用FIFOメモリを提供することを目的とする。   Therefore, an object of the present invention is to provide a packet buffer FIFO memory that solves the above problems and that operates normally even when the packet size shows an abnormal value.

本発明のパケットバッファFIFOメモリ装置は、順次供給されるパケットデータについてメモリへの書き込み及び前記メモリからの読み出しをFIFO制御の下で行うパケットバッファFIFOメモリ装置であって、前記パケットデータについて書き込みアドレスを指定しつつ前記メモリへの書き込みをなす書込み手段と、読み出しアドレスを指定しつつ前記メモリからデータを順次読み出す読出し手段と、前記書込み手段と前記読出し手段についてFIFO制御をなす状態制御手段と、を含み、前記書込み手段は、前記パケットデータの各書き込みデータに対してパケットの先頭アドレスか否かを値で示す監視フラグ及び当該パケットデータのパケットサイズを挿入する監視フラグ挿入手段を含み、前記読出し手段は、前記メモリから前記書き込みデータを読み出しつつ読み出したデータから前記監視フラグ及び前記パケットサイズを抽出して当該抽出された前記監視フラグの値が前記先頭アドレスを示す期待値であるか否かを判定する異常判定手段を含み、前記読出し手段は、1つの読み出したデータについて前記異常判定手段によって抽出された前記監視フラグの値が前記期待値であると判定され、その後、新たに読み出したデータについて前記異常判定手段によって抽出された前記監視フラグの値が前記期待値でないと判定された場合に、前記1つの読み出したデータについて前記異常判定手段によって抽出された前記パケットサイズ分の前記書き込みデータの読み出しが完了したか否かを判定することを特徴とする。 A packet buffer FIFO memory device according to the present invention is a packet buffer FIFO memory device that performs writing to a memory and reading from the memory under sequentially controlled packet data for sequentially supplied packet data , and sets a write address for the packet data. Write means for writing to the memory while designating, Read means for sequentially reading data from the memory while designating a read address, State control means for performing FIFO control for the write means and the read means, The writing means includes a monitoring flag indicating by a value whether or not it is the start address of the packet for each write data of the packet data, and a monitoring flag inserting means for inserting the packet size of the packet data, and the reading means Read the write data from the memory Look including an abnormality determination unit that the value of the monitoring flag and the monitoring flag by extracting the packet size is the extracted from the read data to determine whether the expected value indicative of the leading address while out, the The reading unit determines that the value of the monitoring flag extracted by the abnormality determination unit for one read data is the expected value, and then the newly extracted data is extracted by the abnormality determination unit. When it is determined that the value of the monitoring flag is not the expected value, it is determined whether or not reading of the write data corresponding to the packet size extracted by the abnormality determination unit is completed for the one read data. It is characterized by that.

本発明によれば、監視フラグのビット値の期待値との対比に基づいて、パケットデータの異常を検出することができ、異常を検出したときに、異常データを読み飛ばし、書き込みポインタ値によってアドレス値の整合性を取ることで、次パケットからのデータの書き込みと読み出しを正常に動作させることができる。   According to the present invention, it is possible to detect an abnormality in packet data based on the comparison between the bit value of the monitoring flag and the expected value. When an abnormality is detected, the abnormal data is skipped and the address is determined by the write pointer value. By taking the consistency of values, it is possible to operate data writing and reading from the next packet normally.

図1は、本発明のパケットバッファ用FIFOメモリの動作を説明するブロック図である。   FIG. 1 is a block diagram for explaining the operation of the packet buffer FIFO memory of the present invention.

本実施例におけるメモリ1は、メモリ1の最終アドレスから先頭アドレスへ連続して書き込みができるリング状の構成をもつ。このメモリ1は連続した書き込みと読み出しが可能であり、書き込みクロック2と読み出しクロック3が同期した同じ周波数のクロックである。   The memory 1 in this embodiment has a ring-like configuration that allows continuous writing from the last address of the memory 1 to the head address. The memory 1 is capable of continuous writing and reading, and is a clock having the same frequency in which the write clock 2 and the read clock 3 are synchronized.

このメモリ1の動作は、最初にメモリ1を空(EMPTY)の状態にするために、外部からのRESET入力4によって、書き込みアドレス制御部5と読み出しアドレス制御部6に状態制御部7からRESET信号8がそれぞれ送られ、メモリ1を空(EMPTY)の状態にして初期化を行う。このとき、読み出しアドレス制御部6はEMPTY信号9がアサートされているため読み出し動作を停止している。   The operation of the memory 1 starts with the RESET signal from the state control unit 7 to the write address control unit 5 and the read address control unit 6 by an external RESET input 4 in order to empty the memory 1 first (EMPTY). 8 is sent to initialize memory 1 to empty (EMPTY). At this time, the read address controller 6 stops the read operation because the EMPTY signal 9 is asserted.

次に、メモリの空き領域がないとき(FULL状態)にパケットを受信すると、状態制御部7から出力されるFULL信号10がネゲート状態であることを書き込みアドレス制御部5が認識すると共にメモリ1が書き込み可能な状態であると判断する。   Next, when a packet is received when there is no free space in the memory (FULL state), the write address control unit 5 recognizes that the FULL signal 10 output from the state control unit 7 is negated and the memory 1 Judge that it is in a writable state.

次に、書き込みイネーブル11がアサートされている間に、書き込みクロック2によってインクリメントして生成した書き込みアドレス12とメモリ1へのメモリ書き込みイネーブル信号13をメモリ1に出力する。   Next, while the write enable 11 is asserted, the write address 12 generated by incrementing the write clock 2 and the memory write enable signal 13 to the memory 1 are output to the memory 1.

書き込みアドレス制御部5は、この書き込みアドレス12と、メモリ書き込みイネーブル信号13と、さらに先頭アドレス情報14によって、パケットデータのパケットサイズをパケットデータの先頭に付加した書き込みデータ15を生成する。 The write address control unit 5 generates write data 15 in which the packet size of the packet data is added to the head of the packet data based on the write address 12, the memory write enable signal 13 , and the head address information 14.

また、先頭アドレス監視/フラグ挿入部16では、パケットの先頭アドレスを示す先頭アドレス監視フラグを生成し、先頭アドレス監視フラグとパケットサイズを付加したデータをメモリ1に格納する。なお、先頭アドレス監視/フラグ挿入部16は、監視フラグ挿入手段を構成する。先頭アドレス監視フラグは、"1"で有意、"0"で無意である。   The head address monitoring / flag insertion unit 16 generates a head address monitoring flag indicating the head address of the packet, and stores the data with the head address monitoring flag and the packet size added thereto in the memory 1. The head address monitoring / flag insertion unit 16 constitutes a monitoring flag insertion unit. The head address monitoring flag is significant at “1” and is insignificant at “0”.

この動作によって、1パケットの先頭アドレスを判別する情報を与えることができる。   By this operation, information for determining the head address of one packet can be given.

書き込みポインタ制御部17では、1パケット毎に書き込みアドレス12に1を加えた値を書き込みポインタに格納する。この動作によって、1パケットを正常に書き込んだときのアドレス値を保持することができる。   The write pointer control unit 17 stores a value obtained by adding 1 to the write address 12 for each packet in the write pointer. With this operation, the address value when one packet is normally written can be held.

次に、状態制御部7では、メモリ1の書き込みアドレス12と読み出しアドレス18を常時比較し、パケットが書き込まれたことによって生じる書き込みアドレス12と読み出しアドレス18の差分を検出してEMPTY信号9をネゲートさせる。   Next, the state control unit 7 constantly compares the write address 12 and the read address 18 of the memory 1 to detect a difference between the write address 12 and the read address 18 generated by writing the packet, and negates the EMPTY signal 9 Let

読み出しアドレス制御部6は、EMPTY信号9がネゲートされたことで、メモリ1にデータの書き込みが行われたと判断する。更に、メモリ1の出力側デバイス、モジュール等(図示せず)が入力(受け入れ)可能であることを示す読み出しイネーブル信号19が、アサートされていることを確認する。   The read address control unit 6 determines that data has been written to the memory 1 when the EMPTY signal 9 is negated. Further, it is confirmed that a read enable signal 19 indicating that an output side device, module, etc. (not shown) of the memory 1 can be input (accepted) is asserted.

本発明の回路構成では、読み出しイネーブル信号19がアサートされていれば、先頭アドレス監視フラグ監視/パケットサイズ読み出し部20は先頭アドレスにあるパケットサイズと先頭アドレス監視フラグを読み出す。   In the circuit configuration of the present invention, if the read enable signal 19 is asserted, the head address monitoring flag monitoring / packet size reading unit 20 reads the packet size and head address monitoring flag at the head address.

先頭アドレス監視フラグが"1"、すなわち、期待値であれば、正常に1パケットの先頭から読み出しができると判断する。   If the head address monitoring flag is “1”, that is, if it is an expected value, it is determined that reading can be normally performed from the head of one packet.

読み出しクロック3によってパケットサイズ情報21分だけ読み出しアドレス18をインクリメントさせてアドレスを生成する。   An address is generated by incrementing the read address 18 by the packet size information 21 by the read clock 3.

次に、読み出しアドレス制御部6からメモリ1へのメモリ読み出しイネーブル信号22と、生成した読み出しアドレス18と共にメモリ1に出力し、メモリ1から1パケットの読み出しデータ23を出力させる。   Next, a memory read enable signal 22 from the read address control unit 6 to the memory 1 and the generated read address 18 are output to the memory 1 and read data 23 of one packet is output from the memory 1.

このとき、先頭アドレス監視フラグ監視/パケットサイズ読み出し部20は先頭アドレスにある先頭アドレス監視フラグとパケットサイズを読み出す。先頭アドレス監視フラグが、1パケットの途中のアドレスであることを示す"0"を読み出した場合は、正常な読み出しが不可能と判断し、先頭アドレスエラー24を読み出しアドレス制御部6に出力する。   At this time, the head address monitoring flag monitoring / packet size reading unit 20 reads the head address monitoring flag and the packet size at the head address. When the head address monitoring flag reads “0” indicating that the address is in the middle of one packet, it is determined that normal reading is impossible, and a head address error 24 is output to the read address control unit 6.

なお、先頭アドレス監視フラグ監視/パケットサイズ読み出し部20は、パケットデータ読み出し時の異常判定手段を構成する。   Note that the head address monitoring flag monitoring / packet size reading unit 20 constitutes an abnormality determining means when reading packet data.

読み出しアドレス制御部6はメモリ読み出し動作を停止させ、読み出しアドレス18を書き込みポインタ制御部17に保持してあった書き込みポインタ値25と合わせる。   The read address control unit 6 stops the memory read operation and matches the read address 18 with the write pointer value 25 held in the write pointer control unit 17.

この動作によって、異常なデータを読み飛ばして、正常な書き込みが完了しているアドレス値である書き込みポインタ値25に読み出しアドレス18を合わせることでアドレス値の整合性を取り、次のメモリ動作から正常に動作させる機能を持つ。   By this operation, abnormal data is skipped, and the address value is matched by matching the read address 18 with the write pointer value 25, which is the address value for which normal writing has been completed. With the function to operate.

図2は本発明の実施例であるメモリ1の書き込み動作を説明するフローチャートである。   FIG. 2 is a flowchart for explaining the write operation of the memory 1 according to the embodiment of the present invention.

まず、受信したパケットデータがメモリ1の空き領域に書き込み可能なサイズかどうか状態制御部7が判定する(ステップS1)。   First, the state control unit 7 determines whether or not the received packet data has a size that can be written to an empty area of the memory 1 (step S1).

不可能な場合にはメモリ1がFULL(書き込み不可能)と判断する(ステップS2)。メモリ1に書き込み可能になるまで判定を繰り返し行う。   If not possible, it is determined that the memory 1 is FULL (not writable) (step S2). The determination is repeated until the memory 1 can be written.

メモリ1の書き込みが可能である場合、書き込みアドレス制御部5及び先頭アドレス監視/フラグ挿入部16が書き込むデータの先頭に先頭アドレスを示す先頭アドレス監視フラグと、1パケットのパケットサイズの情報を書き込み(ステップS3)、続いてパケットデータを書き込む(ステップS4)。   When writing to the memory 1 is possible, the write address control unit 5 and the start address monitoring / flag insertion unit 16 write the start address monitoring flag indicating the start address at the beginning of the data to be written and the packet size information of one packet ( Step S3), followed by writing packet data (step S4).

書き込みアドレス12をインクリメントし(ステップS5)、1パケットのパケットデータが書き込み完了するまで繰り返しアドレスをインクリメントさせてメモリ1にパケットデータを書き込む(ステップS6)。   The write address 12 is incremented (step S5), and the packet data is written to the memory 1 by repeatedly incrementing the address until one packet of packet data is written (step S6).

書き込みが完了した場合、書き込みが完了したアドレス値+1の値を書き込みポインタ制御部17が書き込みポインタ値25として保持し(ステップS7)、メモリ書き込み動作を完了する(ステップS8)。書き込みポインタ値25は後述するメモリ1の読み出し動作時のエラー処理に使用する。   When the writing is completed, the write pointer control unit 17 holds the value of the address value +1 where the writing is completed as the write pointer value 25 (step S7), and the memory write operation is completed (step S8). The write pointer value 25 is used for error processing during a read operation of the memory 1 described later.

図3は本発明の実施例のパケットバッファ用FIFOメモリの読み出し動作を説明するフローチャートである。  FIG. 3 is a flowchart for explaining the read operation of the packet buffer FIFO memory according to the embodiment of the present invention.

メモリ読み出し動作を開始すると、状態制御部7が、アドレス値の差分を検出(書き込みアドレス12が読み出しアドレス18より進んでいるか)を判定する(ステップS11)。差分が検出できなかった場合(書き込みアドレス12と読み出しアドレス18が同値)は、メモリ1が空の状態(EMPTY)と判断し(ステップS12)、アドレス値の差分を検出するまで(メモリに書き込みがあるまで)判定を繰り返し行う。   When the memory read operation is started, the state control unit 7 determines whether a difference between the address values is detected (whether the write address 12 is ahead of the read address 18) (step S11). If the difference could not be detected (write address 12 and read address 18 have the same value), memory 1 is determined to be empty (EMPTY) (step S12), and until the difference between the address values is detected (the memory is not written) Repeat until it is).

アドレス値の差分を検出した場合は、先頭アドレス監視フラグ監視/パケットサイズ読み出し部20が、先頭アドレス監視フラグとパケットサイズを読み出し(ステップS13)、先頭アドレス監視フラグの判定(ステップS14)によって、アドレスの先頭から読み出しが開始できるかを判定する。   When a difference between the address values is detected, the head address monitoring flag monitoring / packet size reading unit 20 reads the head address monitoring flag and the packet size (step S13), and determines the address by determining the head address monitoring flag (step S14). It is determined whether or not reading can be started from the top.

このとき、先頭アドレス監視フラグが"0"、 つまり判定が"No"である場合は、先頭アドレスからの読み出しができていないと判断し、メモリ1からのデータ読み出しを停止して、読み出しアドレス18を書き込みポインタ制御部17が保持する書き込みポインタ値25(書き込みが完了したアドレス値+1)に合わせるエラー処理を行う(ステップS15)。   At this time, if the head address monitoring flag is “0”, that is, the determination is “No”, it is determined that reading from the head address is not possible, data reading from the memory 1 is stopped, and the reading address 18 Is subjected to error processing to match the write pointer value 25 held by the write pointer control unit 17 (address value at which writing has been completed + 1) (step S15).

この動作によって、異常なデータを読み飛ばすことができ、次のパケットデータから正常に書き込み、読み出しができる。   By this operation, abnormal data can be skipped, and the next packet data can be normally written and read.

先頭アドレス監視フラグが"1" 、つまり判定が"Yes"である場合は、先頭アドレスからの読み出しが正常にできると判断し、メモリ1からのデータ読み出しを行う。   When the start address monitoring flag is “1”, that is, the determination is “Yes”, it is determined that the read from the start address can be normally performed, and the data is read from the memory 1.

次に、読み出しアドレス18を1インクリメントし(ステップS16)、次のアドレスのデータ読み出しを開始する。   Next, the read address 18 is incremented by 1 (step S16), and data reading at the next address is started.

このとき、先頭アドレス以外でも先頭アドレス監視フラグを監視し(ステップS17)、パケットサイズ分の読み出しが完了していないにもかかわらず、先頭アドレス監視フラグが"1"、 つまり判定が"Yes"である場合は異常と判断し、メモリ1からのデータ読み出しを停止して、読み出しアドレス制御部6は、読み出しアドレス18を書き込みポインタ値25に合わせるエラー処理を行う(ステップS15)。   At this time, the start address monitoring flag is monitored even at a position other than the start address (step S17). Even though the reading for the packet size has not been completed, the start address monitoring flag is “1”, that is, the determination is “Yes”. If there is, it is determined as abnormal, reading of data from the memory 1 is stopped, and the read address control unit 6 performs error processing for matching the read address 18 with the write pointer value 25 (step S15).

この動作によって次のパケットデータから、正常に書き込みと読み出しができる。先頭アドレス監視フラグが"0"、つまり判定が"No"である場合は、正常と判断し、次のステップに進む。   This operation allows normal writing and reading from the next packet data. When the head address monitoring flag is “0”, that is, the determination is “No”, it is determined as normal and the process proceeds to the next step.

次に、読み出しアドレス制御部6は、読み出しアドレス18が書き込みポインタ値25と同値であるかの判定を行う(ステップS18)。   Next, the read address control unit 6 determines whether the read address 18 is the same value as the write pointer value 25 (step S18).

このとき、判定が"Yes"である場合は、パケットサイズ分のパケットデータの読み出しが完了していないことから、読み出しパケットサイズの情報が何らかの外因によって異常な値となっていると判断し、メモリ1からのデータ読み出しを停止して、読み出しアドレス18を書き込みポインタ値25に合わせるエラー処理を行う(ステップS15)。   At this time, if the determination is “Yes”, reading of packet data for the packet size has not been completed, so it is determined that the read packet size information has an abnormal value due to some external cause, and the memory Data reading from 1 is stopped, and error processing is performed to match the read address 18 with the write pointer value 25 (step S15).

この動作によって次のパケットデータから、正常に書き込みと読み出しができる。   This operation allows normal writing and reading from the next packet data.

また、判定が"No"である場合は、正常と判断し、メモリ1からのデータ読み出しを行う。   If the determination is “No”, it is determined as normal and data is read from the memory 1.

正常にデータを読み出した後、予め読み出しておいたパケットサイズの情報から、パケットサイズ分の読み出しが完了したか否かを判定する(ステップS19)。   After the data is normally read out, it is determined from the packet size information read in advance whether or not the reading for the packet size is completed (step S19).

このとき、判定が"No"である場合は、パケットサイズ分の読み出しが完了していないと判定し、パケットサイズ分の読み出しが完了したと判定されるまで、読み出しアドレス18を1インクリメントして読み出し動作を繰り返す。   At this time, if the determination is “No”, it is determined that reading for the packet size is not completed, and reading is performed by incrementing the reading address 18 by 1 until it is determined that reading for the packet size is completed. Repeat the operation.

判定が"Yes"である場合は、1パケット分のデータ読みだしが完了したと判定し、次のステップに進む。   If the determination is “Yes”, it is determined that data reading for one packet has been completed, and the process proceeds to the next step.

1パケット分のデータ読み出しが完了したら、先頭アドレス監視/フラグ挿入部16は、この1パケットの先頭アドレスを示す、先頭アドレス監視フラグを消去、つまり"0"を書き込む(ステップS20)。   When the data reading for one packet is completed, the head address monitoring / flag insertion unit 16 deletes the head address monitoring flag indicating the head address of this one packet, that is, writes “0” (step S20).

次に、読み出しアドレス18を次パケットの先頭アドレスに合わせるように、読み出しアドレス制御部6は、読み出しアドレスを1インクリメントして(ステップS21)、次のパケットのメモリ読み出し処理を行う。   Next, the read address control unit 6 increments the read address by 1 so as to match the read address 18 with the head address of the next packet (step S21), and performs a memory read process for the next packet.

図4は本発明のパケットバッファ用FIFOメモリのメモリ内部の動作を説明する図である。   FIG. 4 is a diagram for explaining the internal operation of the packet buffer FIFO memory according to the present invention.

ここで、アドレス0x0000から0xffffまでの容量を有するメモリ26があると仮定する。   Here, it is assumed that there is a memory 26 having a capacity from addresses 0x0000 to 0xffff.

メモリ26が書き込み前の空の状態(書き込みアドレス12と読み出しアドレス18が同値)とする。   The memory 26 is in an empty state before writing (the write address 12 and the read address 18 have the same value).

次に、書き込みを開始し、先頭アドレス監視/フラグ挿入部16が、パケットの先頭アドレス毎に用意した先頭アドレス監視フラグに、先頭アドレスであることを示す"1"を書き込み、パケットサイズの情報を書き込む。また、パケットの先頭アドレス以外の先頭アドレス監視フラグには"0"を書き込む。   Next, the writing is started, and the head address monitoring / flag insertion unit 16 writes “1” indicating the head address to the head address monitoring flag prepared for each head address of the packet, and stores the packet size information. Write. Further, “0” is written in the head address monitoring flag other than the head address of the packet.

1パケット分の書き込みが完了したら、書き込みポインタ制御部17が書き込み終了アドレスの次のアドレス値を書き込みポインタ値25として保持する。   When the writing for one packet is completed, the write pointer control unit 17 holds the address value next to the write end address as the write pointer value 25.

次に、状態制御部7が、書き込みアドレス12が読み出しアドレス18より進んだことを検出し、データが書き込まれたと判断して読み出し動作を行う。   Next, the state control unit 7 detects that the write address 12 has advanced from the read address 18, determines that data has been written, and performs a read operation.

読み出し動作時に先頭アドレス監視フラグが先頭アドレスであることを示す"1"であった場合は、読み出し開始位置(アドレス)が正常であると読み出しアドレス制御部6が判断し、先頭アドレスのデータ領域にあるパケットサイズを読み出してパケットサイズ分の読み出しを行う。   When the start address monitoring flag is “1” indicating that the start address is 1 at the time of the read operation, the read address control unit 6 determines that the read start position (address) is normal, and the data is stored in the data area of the start address. A certain packet size is read and the packet size is read.

読み出しが完了したら、先頭アドレス監視/フラグ挿入部16は、先頭アドレス監視フラグを消去し("0"を書き込み)、動作終了となる。   When the reading is completed, the head address monitoring / flag insertion unit 16 erases the head address monitoring flag (writes “0”), and the operation ends.

図5は本発明の実施例による、パケットサイズが異常となった場合の動作を説明する図である。   FIG. 5 is a diagram for explaining the operation when the packet size becomes abnormal according to the embodiment of the present invention.

読み出し時にパケットサイズの情報が何らかの外因により異常となり、1パケットの途中で読み出しアドレスが停止してしまった場合、通常であればメモリ26が空(EMPTY)になるまで読み出し動作を繰り返し行って異常データを出力し続けてしまう。   If the packet size information becomes abnormal due to some external cause during reading, and the reading address stops in the middle of one packet, normally the reading operation is repeated until the memory 26 becomes empty (EMPTY). Will continue to be output.

しかし、本発明では、先頭アドレス監視フラグが"0"であることを読み出して、異常と判断することができ、書き込みポインタ値25まで読み出しポインタをあわせることで、異常なデータを読み飛ばしてメモリのアドレス情報を正常な状態に戻し、次パケットのメモリ動作から正常に動作することができる。   However, in the present invention, it is possible to read that the start address monitoring flag is “0” and determine that it is abnormal. By aligning the read pointer to the write pointer value 25, the abnormal data is skipped and the memory is read. The address information is returned to a normal state, and normal operation can be performed from the memory operation of the next packet.

以上のように、本発明の実施例によれば、パケットバッファ用FIFOメモリ装置に、先頭アドレス監視フラグを用いることによって、従来検出することができなかった読み出しアドレス18の更新が1パケットの途中で停止してしまうような異常があった場合でも、先頭アドレス監視フラグによって異常を検出することができる。   As described above, according to the embodiment of the present invention, by using the head address monitoring flag in the FIFO memory device for the packet buffer, the update of the read address 18 that could not be detected in the past is performed in the middle of one packet. Even if there is an abnormality that stops, the abnormality can be detected by the head address monitoring flag.

異常を検出したときに、異常データを読み飛ばし、書き込みポインタ値25によってアドレス値の整合性を取ることで、次パケットからのデータの書き込みと読み出しを正常に動作させることができる。   When the abnormality is detected, the abnormal data is skipped, and the address value is matched by the write pointer value 25, whereby the data writing and reading from the next packet can be normally operated.

なお、上記の実施例では、パケットデータをメモリ1に書き込みが完了したときに、書き込みが完了したアドレス値+1の値を書き込みポインタ値25として保持するとしたが、書き込みポインタ値25として保持する値として書き込みが完了したアドレス値+N(N=1,2,3,….)としてもよい。   In the above embodiment, when the packet data has been written to the memory 1, the value of the address value + 1 that has been written is held as the write pointer value 25, but the value that is held as the write pointer value 25. The address value + N (N = 1, 2, 3,...) For which writing has been completed may be used.

また、上記の実施例では、先頭アドレス監視フラグは、"1"で有意、"0"で無意としたが、場合により、"0"で有意、"1"で無意とする事もできる。   In the above embodiment, the head address monitoring flag is significant at “1” and unintentional at “0”, but may be significant at “0” and insignificant at “1” depending on circumstances.

本発明のパケットバッファ用FIFOメモリの動作を説明するブロック図である。It is a block diagram explaining operation | movement of the FIFO memory for packet buffers of this invention. 本発明の実施例であるメモリ1の書き込み動作を説明するフローチャートである。4 is a flowchart illustrating a write operation of the memory 1 according to the embodiment of the present invention. 本発明の実施例のメモリの読み出し動作を説明するフローチャートである。It is a flowchart explaining the read-out operation | movement of the memory of the Example of this invention. 本発明によるパケットバッファ用FIFOメモリのメモリ内部の動作を説明する図である。It is a figure explaining operation | movement inside the memory of the FIFO memory for packet buffers by this invention. 本発明による、パケットバッファ用FIFOメモリのパケットサイズが異常となった場合の動作を説明する図である。It is a figure explaining operation | movement when the packet size of the FIFO memory for packet buffers becomes abnormal by this invention.

符号の説明Explanation of symbols

1 メモリ
2 書き込みクロック
3 読み出しクロック
4 RESET入力
5 書き込みアドレス制御部
6 読み出しアドレス制御部
7 状態制御部
8 RESET信号
9 EMPTY信号
10 FULL信号
11 書き込みイネーブル
12 書き込みアドレス
13 メモリ書き込みイネーブル
14 先頭アドレス情報
15 書き込みデータ
16 先頭アドレス監視/フラグ挿入部
17 書き込みポインタ制御部
18 読み出しアドレス
19 読み出しイネーブル
20 先頭アドレス監視フラグ監視/パケットサイズ読み出し部
21 パケットサイズ情報
22 メモリ読み出しイネーブル
23 読み出しデータ
24 先頭アドレスエラー
25 書き込みポインタ値
26 メモリ
1 memory
2 Write clock
3 Read clock
4 RESET input
5 Write address controller
6 Read address controller
7 State controller
8 RESET signal
9 EMPTY signal
10 FULL signal
11 Write enable
12 Write address
13 Memory write enable
14 Start address information
15 Write data
16 Start address monitoring / flag insertion part
17 Write pointer controller
18 Read address
19 Read enable
20 Start address monitoring flag monitoring / packet size reading part
21 Packet size information
22 Memory read enable
23 Read data
24 Start address error
25 Write pointer value
26 memory

Claims (3)

順次供給されるパケットデータについてメモリへの書き込み及び前記メモリからの読み出しをFIFO制御の下で行うパケットバッファFIFOメモリ装置であって、
前記パケットデータについて書き込みアドレスを指定しつつ前記メモリへの書き込みをなす書込み手段と、
読み出しアドレスを指定しつつ前記メモリからデータを順次読み出す読出し手段と、
前記書込み手段と前記読出し手段についてFIFO制御をなす状態制御手段と、を含み、
前記書込み手段は、前記パケットデータ先頭アドレスの書き込みデータに対して期待値を示す監視フラグ及び当該パケットデータのパケットサイズを挿入し、前記先頭アドレス以外の前記書き込みデータに対して前記監視フラグを前記期待値と異なる値として挿入する監視フラグ挿入手段を含み、
前記読出し手段は、前記メモリから前記書き込みデータを読み出しつつ読み出したデータから前記監視フラグ及び前記パケットサイズを抽出して当該抽出された前記監視フラグの値が前記期待値であるか否かを判定する異常判定手段を含み、
前記読出し手段は、1つの読み出したデータについて前記異常判定手段によって抽出された前記監視フラグの値が前記期待値であると判定され、その後、新たに読み出したデータについて前記異常判定手段によって抽出された前記監視フラグの値が前記期待値でないと判定された場合に、前記1つの読み出したデータについて前記異常判定手段によって抽出された前記パケットサイズ分の前記書き込みデータの読み出しが完了したか否かを判定することを特徴とするパケットバッファFIFOメモリ装置。
A packet buffer FIFO memory device that performs writing to a memory and reading from the memory for sequentially supplied packet data under FIFO control,
A writing means for writing to the memory while designating a write address for the packet data;
Read means for sequentially reading data from the memory while designating a read address;
State control means for performing FIFO control for the writing means and the reading means,
The writing means inserts a monitoring flag indicating an expected value for the write data at the head address of the packet data and a packet size of the packet data, and sets the monitoring flag for the write data other than the head address. Including monitoring flag insertion means for inserting as a value different from the expected value ;
It said reading means determines whether or not the value of the monitoring flag and the monitoring flag by extracting the packet size is the extracted from data read while reading the write data from the memory is the expected value look including an abnormality determination means,
The reading means determines that the value of the monitoring flag extracted by the abnormality determination means for one read data is the expected value, and then the newly read data is extracted by the abnormality determination means. When it is determined that the value of the monitoring flag is not the expected value, it is determined whether reading of the write data corresponding to the packet size extracted by the abnormality determination unit is completed for the one read data A packet buffer FIFO memory device.
前記書込み手段は、前記書き込みデータ毎の書込み終了位置を示す書込み終了位置アドレスを保持する書込みポインタを有し、
前記読出し手段は、前記1つの読み出したデータについて前記異常判定手段が前記監視フラグの値を前記期待値でないと判定した場合、及び前記新たに読み出したデータについて前記異常判定手段が前記監視フラグの値を前記期待値であると判定した場合には、前記読み出しアドレスを前記書込み終了位置アドレスと整合せしめることを特徴とする請求項1記載のパケットバッファFIFOメモリ装置。
It said write means includes a write pointer which holds the write end position address indicating a write end position of each of the write data,
When the abnormality determining unit determines that the value of the monitoring flag is not the expected value for the one read data, and the value of the monitoring flag is set by the abnormality determining unit for the newly read data. 2. The packet buffer FIFO memory device according to claim 1 , wherein the read address is matched with the write end position address when it is determined that the value is the expected value .
前記読出し手段は、前記パケットサイズ分の前記書き込みデータの読み出しが完了したと判定した場合に、前記監視フラグを消去することを特徴とする請求項1記載のパケットバッファFIFOメモリ装置。 2. The packet buffer FIFO memory device according to claim 1, wherein the reading unit deletes the monitoring flag when it is determined that reading of the write data for the packet size is completed .
JP2007015034A 2007-01-25 2007-01-25 Packet buffer FIFO memory device Expired - Fee Related JP4821628B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007015034A JP4821628B2 (en) 2007-01-25 2007-01-25 Packet buffer FIFO memory device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007015034A JP4821628B2 (en) 2007-01-25 2007-01-25 Packet buffer FIFO memory device

Publications (2)

Publication Number Publication Date
JP2008182550A JP2008182550A (en) 2008-08-07
JP4821628B2 true JP4821628B2 (en) 2011-11-24

Family

ID=39726101

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007015034A Expired - Fee Related JP4821628B2 (en) 2007-01-25 2007-01-25 Packet buffer FIFO memory device

Country Status (1)

Country Link
JP (1) JP4821628B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5132612B2 (en) * 2009-03-12 2013-01-30 日本電信電話株式会社 Data transfer method and apparatus
JP5001318B2 (en) * 2009-03-18 2012-08-15 富士通テレコムネットワークス株式会社 Digital audio signal transmission apparatus and digital audio signal transmission method
JP5346780B2 (en) * 2009-11-10 2013-11-20 本田技研工業株式会社 Data discard method for first-in first-out buffer and first-in first-out buffer

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2885538B2 (en) * 1991-05-07 1999-04-26 富士通株式会社 Malfunction detection method and recovery method for fixed-length data transfer buffer
JPH09297677A (en) * 1996-05-02 1997-11-18 Fujitsu Ltd Fifo buffer for erasing partial data group
JP3191701B2 (en) * 1996-10-29 2001-07-23 日本電気株式会社 Transmission frame format conversion circuit
JP2004128764A (en) * 2002-10-01 2004-04-22 Ando Electric Co Ltd Memory control system and method in ethernet (r)-atm converter
JP2005039661A (en) * 2003-07-17 2005-02-10 Sony Corp Information processing apparatus

Also Published As

Publication number Publication date
JP2008182550A (en) 2008-08-07

Similar Documents

Publication Publication Date Title
US20080250196A1 (en) Data Sequence Sample and Hold Method, Apparatus and Semiconductor Integrated Circuit
US8356203B2 (en) Asynchronous interface circuit and data transfer method
US8291138B2 (en) Skip based control logic for first in first out buffer
JP4821628B2 (en) Packet buffer FIFO memory device
JP2011227834A (en) Signal control device and signal control method
US10658046B2 (en) Memory device and method for operating the same
JP4569163B2 (en) Data input / output device and data input / output method
US5710800A (en) Data receiving device
JPH08139727A (en) Atm cell format conversion circuit
KR100818837B1 (en) Using pci bridge of duplex apparatus
JP2923892B1 (en) ATM cell insertion system and method
JPH10340596A (en) Data storage device and semiconductor memory
JP3075273B2 (en) Cell buffer control circuit
JP3856016B2 (en) Signal processing device
TWI390404B (en) Data accessing system
JPH09274599A (en) Buffer memory device
JP2002073411A (en) Method and device to judge memory capacity of eeprom
JP2010020815A (en) Fifo access circuit
JP2003297098A (en) Semiconductor memory device
JP2010154156A (en) Data compressing apparatus
JP2007156935A (en) Data input/output system, slave equipment, and signal processing method thereof
JP2001128166A (en) Integrated circuit for image compression and image compressing device
JP2007305035A (en) Transfer format determination device and transfer format determination method
JP2006268251A (en) Data transfer unit
JP2005039661A (en) Information processing apparatus

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20091214

A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20110114

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20110217

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110301

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110428

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

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20110822

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20140916

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees