JP2013135383A - Packet buffer device and packet buffer control method - Google Patents

Packet buffer device and packet buffer control method Download PDF

Info

Publication number
JP2013135383A
JP2013135383A JP2011285526A JP2011285526A JP2013135383A JP 2013135383 A JP2013135383 A JP 2013135383A JP 2011285526 A JP2011285526 A JP 2011285526A JP 2011285526 A JP2011285526 A JP 2011285526A JP 2013135383 A JP2013135383 A JP 2013135383A
Authority
JP
Japan
Prior art keywords
packet
block
data
buffer
partition
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.)
Granted
Application number
JP2011285526A
Other languages
Japanese (ja)
Other versions
JP5748288B2 (en
Inventor
Kenji Kawai
健治 川合
Masami Urano
正美 浦野
Mamoru Nakanishi
衛 中西
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.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP2011285526A priority Critical patent/JP5748288B2/en
Publication of JP2013135383A publication Critical patent/JP2013135383A/en
Application granted granted Critical
Publication of JP5748288B2 publication Critical patent/JP5748288B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Abstract

PROBLEM TO BE SOLVED: To minimize increase in the extra circuit scale incident to increase in the data memory for storing packets, even if the number of packets to be stored is increased.SOLUTION: A packet buffer device 10 includes a memory 12, a write block buffer 13A, and a read block buffer 14A. A packet control unit 11 stores input packet data sequentially in the write block buffer 13A, stores the packet boundary information indicating the end position of packet data in the write block buffer 13A therein, writes the data of a predetermined volume in the memory 12 at a moment in time when it is stored, reads the data from the memory 12 in response to an output instruction and stores that data in a read block buffer 14A, and then reads and outputs each packet data contained in that data on the basis of the packet boundary information contained in that data.

Description

本発明は、パケット処理技術に関し、特に入力されたパケットをメモリに格納するとともに、出力指示に応じてメモリからパケットを取り出して出力するパケットバッファ制御技術に関するものである。   The present invention relates to a packet processing technique, and more particularly to a packet buffer control technique for storing an input packet in a memory and extracting and outputting the packet from the memory in response to an output instruction.

FTTH(Fiber To The Home)を初めとする光通信網の普及により、データ通信回線における通信速度が大幅に高速化され、ネットワークアダプタなどのパケットを送受信するパケット通信装置、特にパケットをバッファリングして処理するパケットバッファ装置において、その処理能力の改善が検討されている。
従来、このようなパケットバッファ装置において、パケット処理をハードウェア化することにより、処理能力を改善したものが提案されている(例えば、非特許文献1など参照)。
With the spread of optical communication networks such as FTTH (Fiber To The Home), the communication speed in the data communication line has been greatly increased, and packet communication devices that transmit and receive packets such as network adapters, especially by buffering packets. In the packet buffer device to be processed, improvement of the processing capability is being studied.
Conventionally, such a packet buffer device has been proposed in which packet processing is improved by hardware processing (see, for example, Non-Patent Document 1).

図15は、従来のパケットバッファ装置の構成を示すブロックである。図16は、従来のパケットバッファ装置の動作を示す説明図である。
図15のパケットバッファ装置50は、バッファ制御部51、データ用メモリ52、およびジョブ用メモリ53から構成される。
このパケットバッファ装置50は、複数のキュー(FIFOメモリ)を備え、入力された可変長のパケットを前記キューに格納し、入力された出力指示情報に応じて、前記キューに格納されていた前記パケットを前記キューから取り出して出力する機能を有している。
FIG. 15 is a block diagram showing a configuration of a conventional packet buffer device. FIG. 16 is an explanatory diagram showing the operation of the conventional packet buffer device.
15 includes a buffer control unit 51, a data memory 52, and a job memory 53.
The packet buffer device 50 includes a plurality of queues (FIFO memories), stores input variable-length packets in the queue, and stores the packets stored in the queue according to input output instruction information. Is taken out from the queue and output.

データ用メモリ52は、キュー毎に異なるアドレス領域を有し、前記キューのパケットデータを、当該キューと対応する前記領域に蓄積する機能を有している。
ジョブ用メモリ53は、キュー毎に異なるアドレス領域を有し、入力パケット毎に生成される固定長のパケットジョブ(ジョブ情報)を、前記キューに対応する前記領域に蓄積する機能を有している。パケットジョブは、前記データ用メモリ52における各パケットの境界位置を特定するためのパケット境界情報を含んでいる。
これら前記データ用メモリ52および前記ジョブ用メモリ53は、バッファ制御部51により、FIFOバッファとして制御される。
The data memory 52 has a different address area for each queue, and has a function of storing packet data of the queue in the area corresponding to the queue.
The job memory 53 has a different address area for each queue, and has a function of storing a fixed-length packet job (job information) generated for each input packet in the area corresponding to the queue. . The packet job includes packet boundary information for specifying the boundary position of each packet in the data memory 52.
The data memory 52 and the job memory 53 are controlled as FIFO buffers by the buffer control unit 51.

バッファ制御部51は、可変長のパケットの入力に応じて、当該パケットのパケットデータをデータ用メモリ52に書き込む機能と、この書き込みに基づいてパケットジョブを生成してジョブ用メモリ53に書き込む機能とを有している。パケットジョブは、データ用メモリに前記パケットデータの先頭が格納されたアドレス値を含む。
また、バッファ制御部51は、出力指示情報の入力に応じて、ジョブ用メモリ53からパケットジョブを読み出す機能と、このパケットジョブに基づいて、データ用メモリ52から、対応するパケットのパケットデータを読み出して出力する機能とを有している。
The buffer control unit 51 has a function of writing packet data of the packet to the data memory 52 in response to the input of a variable-length packet, and a function of generating a packet job based on the writing and writing the packet job to the job memory 53. have. The packet job includes an address value in which the top of the packet data is stored in the data memory.
Further, the buffer control unit 51 reads a packet job from the job memory 53 according to the input of the output instruction information, and reads the packet data of the corresponding packet from the data memory 52 based on the packet job. Output function.

このようなパケットバッファ装置50では、例えば、バッファ制御部51がLSIチップ(RENA−CHIP)で構成されており、データ用メモリ52がDDR−SDRAM(Double-Data-Rate Synchronous Dynamic Random Access Memory)で構成されており、各キューがバッファ制御部51のLSI内に配置した内部メモリで構成されている。
したがって、入力されたパケットデータは、バッファ制御部51により、DDR−SDRAMに格納される。このとき、DDR−SDRAMにおける前記パケットデータの格納位置を含むパケットジョブが、バッファ制御部51により、内部メモリに格納される。また、出力指示情報に応じて、DDR−SDRAMからパットデータが読み出されて出力される。
In such a packet buffer device 50, for example, the buffer control unit 51 is configured by an LSI chip (RENA-CHIP), and the data memory 52 is a DDR-SDRAM (Double-Data-Rate Synchronous Dynamic Random Access Memory). Each queue is constituted by an internal memory arranged in the LSI of the buffer control unit 51.
Accordingly, the input packet data is stored in the DDR-SDRAM by the buffer control unit 51. At this time, the packet job including the storage position of the packet data in the DDR-SDRAM is stored in the internal memory by the buffer control unit 51. Also, the pad data is read from the DDR-SDRAM and output in accordance with the output instruction information.

NTTジャーナル2006 vol. 18 No. 7 「RENA−CHIPのハードウェア構成技術」、http://www.ntt.co.jp/journal/0607/files/jn200607022.htmlNTT Journal 2006 vol. 18 No. 7 “RENA-CHIP Hardware Configuration Technology”, http://www.ntt.co.jp/journal/0607/files/jn200607022.html

このような従来技術では、パケットを蓄積するためのデータ用メモリ52に加えて、パケット毎に固定長のパケットジョブを蓄積するためのジョブ用メモリ53が必要となる。パケットは可変長であるため、短いパケットが続けて入力される場合、データ用メモリの蓄積量は少なくとも、ジョブ用メモリの蓄積量は多くなる。   In such a conventional technique, in addition to the data memory 52 for storing packets, a job memory 53 for storing a fixed-length packet job for each packet is required. Since the packet has a variable length, when a short packet is continuously input, the amount of data stored in the memory for data is at least increased.

このため、データ用メモリ52を、いかなる長さのパケットが入力された場合にも使い切ることを可能とするためには、最短パケットのみでデータ用メモリが充足された場合に蓄積されるパケット数分のパケットジョブを蓄積できるだけの容量を持ったジョブ用メモリ53が必要となる。
また、データ用メモリ52にはSDRAMのように大容量のメモリを使用することが一般的であるが、ジョブ用メモリ53は、データ用メモリほどの容量を必要としないことから、ジョブ用メモリ53専用にSDRAMを使用することは回路規模の増大を招くため、一般的にはSRAMが使用される。
For this reason, in order to be able to use up the data memory 52 no matter how long the packet is input, the number of packets stored when the data memory is filled with only the shortest packet. The job memory 53 having a capacity sufficient to store the packet job is required.
In general, a large capacity memory such as SDRAM is used for the data memory 52. However, the job memory 53 does not require as much capacity as the data memory. Since the use of dedicated SDRAM increases the circuit scale, SRAM is generally used.

データ用メモリ52とジョブ用メモリ53とでメモリを分ける理由は、データ用メモリ52の帯域利用効率を上げるためである。SDRAMからの読み出しを行う場合は、読み出しコマンドを発行した後、一定の時間を待って、前記読み出しコマンドに対応したデータをSDRAMから受け取る必要がある。したがって、前の読み出し結果を受けて、次の読み出しを行う、という動作をSDRAMに対して行うと、前記待ち時間によって、SDRAMのインタフェースが持つ帯域を有効に利用できない。   The reason for dividing the memory between the data memory 52 and the job memory 53 is to increase the bandwidth utilization efficiency of the data memory 52. When reading from the SDRAM, it is necessary to wait for a certain time after issuing the read command and receive data corresponding to the read command from the SDRAM. Therefore, if the SDRAM performs the operation of receiving the previous reading result and performing the next reading, the bandwidth of the SDRAM interface cannot be used effectively due to the waiting time.

すなわち、メモリに記憶されたパケットデータを読み出す前に、前記パケットデータの格納位置を知る必要があるため、格納位置を読み取った後にパケットデータを読み出すという順番になる。
このとき、格納位置の情報とパケットデータの両方が同一のSDRAMに記憶されていると、格納位置の情報をメモリから読み出すために読み出しコマンドをメモリに発行し、一定の待ち時間の経過後に、前記格納位置の情報をメモリから受け取り、その後、前記格納位置の情報に基づいて、パケットデータを読み出すために読み出しコマンドをメモリに発行し、一定の待ち時間の経過後に、前記パケットデータをメモリから受け取る、という手順になる。
That is, since it is necessary to know the storage position of the packet data before reading the packet data stored in the memory, the packet data is read after reading the storage position.
At this time, if both the storage location information and the packet data are stored in the same SDRAM, a read command is issued to the memory in order to read the storage location information from the memory. Receiving storage location information from the memory, and then issuing a read command to the memory to read packet data based on the storage location information, and receiving the packet data from the memory after a certain waiting time; It becomes the procedure.

このため、1つのパケットのパケットデータをメモリから読み出すのに、待ち時間が2回もかかるため、メモリの帯域利用効率を下がる。したがって、帯域利用効率を上げるために、データ用メモリ52であるSDRAMとは別に、読み出し開始から完了までの時間が短いSRAMを用いたジョブ用メモリ53が設けられている。
SRAMは、1ビットあたりの面積がSDRAMより大きいが、メモリからの読み出しを短時間に行うことができる、という特徴を備えている。SRAM上のジョブ用メモリ53から短時間でパケットジョブを読み出し、このパケットジョブの情報に基づいて、SDRAM上のデータ用メモリ52からパケットデータを読み出すことにより、SDRAMの帯域利用効率を上げている。
For this reason, it takes twice as long to read the packet data of one packet from the memory, so that the bandwidth utilization efficiency of the memory is lowered. Therefore, in order to increase the bandwidth utilization efficiency, a job memory 53 using an SRAM having a short time from the start of reading to completion is provided separately from the SDRAM which is the data memory 52.
The SRAM has a feature that the area per bit is larger than that of the SDRAM, but reading from the memory can be performed in a short time. By reading the packet job from the job memory 53 on the SRAM in a short time and reading the packet data from the data memory 52 on the SDRAM based on the packet job information, the bandwidth utilization efficiency of the SDRAM is increased.

しかしながら、SRAMは、ビット当たりの面積がSDRAMと比較して大きいため、回路規模の増加を招く。したがって、前述した従来技術によれば、SDRAMに加えてSRAMを用いる必要があるため、蓄積するパケット数の増大を目的として、データ用メモリ52の容量を増大させた場合、これに伴ってSRAMからなるジョブ用メモリ53の容量も増大し、結果として回路規模が余分に増加するという課題があった。   However, since the area per bit of the SRAM is larger than that of the SDRAM, the circuit scale is increased. Therefore, according to the above-described prior art, it is necessary to use an SRAM in addition to the SDRAM. Therefore, when the capacity of the data memory 52 is increased for the purpose of increasing the number of packets to be accumulated, the SRAM is associated with this. As a result, the capacity of the job memory 53 increases, resulting in a problem that the circuit scale increases excessively.

本発明はこのような課題を解決するためのものであり、蓄積するパケット数を増大させた場合でも、パケットを蓄積するデータ用メモリの増大に伴う余分な回路規模の増加を抑制できるパケットバッファ制御技術を提供することを目的としている。   The present invention is for solving such problems, and even when the number of packets to be accumulated is increased, packet buffer control capable of suppressing an increase in an extra circuit scale accompanying an increase in data memory for accumulating packets. The purpose is to provide technology.

このような目的を達成するために、本発明にかかるパケットバッファ装置は、固定長の記憶領域からなるブロックを複数有し、これらブロックごとにデータの書き込みおよび読み出しを行うメモリ部と、少なくとも前記ブロック分のデータを保持する書込ブロックバッファと、少なくとも前記ブロック分のデータを保持する読出ブロックバッファと、入力された可変長のパケットのパケットデータを、前記書込ブロックバッファへ順次格納するとともに、当該書込ブロックバッファへ格納した各パケットデータの終端位置を示すパケット境界情報を含むブロック管理情報を当該書込ブロックバッファへ格納し、当該書込ブロックバッファ内に所定量のデータが格納された時点で、当該データを前記メモリ部へ書き込み、入力された出力指示に応じて、前記メモリ部から前記データを読み出して前記読出ブロックバッファへ格納し、当該データに含まれる前記ブロック管理情報の前記パケット境界情報に基づいて、当該データに含まれる各パケットデータを読み出して出力するパケット制御部とを備えている。   In order to achieve such an object, a packet buffer device according to the present invention has a plurality of blocks each having a fixed-length storage area, and writes and reads data for each block, and at least the blocks A write block buffer for holding data for a minute, a read block buffer for holding data for at least the block, and packet data of input variable-length packets are sequentially stored in the write block buffer, and When block management information including packet boundary information indicating the end position of each packet data stored in the write block buffer is stored in the write block buffer, and when a predetermined amount of data is stored in the write block buffer , Write the data to the memory unit, Next, the data is read from the memory unit and stored in the read block buffer, and each packet data included in the data is read and output based on the packet boundary information of the block management information included in the data A packet control unit.

また、本発明にかかるパケットバッファ装置の一構成例は、前記パケット制御部が、前記パケットデータを前記書込ブロックバッファへ格納する際に、当該書込ブロックバッファの空き容量が不足して当該パケットデータの全てを格納できない場合、当該書込ブロックバッファに格納されているデータを前記メモリ部へ書き込んだ後、残りのパケットデータを当該書込ブロックバッファの先頭から格納するようにしたものである。   Also, in one configuration example of the packet buffer device according to the present invention, when the packet control unit stores the packet data in the write block buffer, the packet block device has insufficient free space in the write block buffer. When all of the data cannot be stored, after the data stored in the write block buffer is written to the memory unit, the remaining packet data is stored from the top of the write block buffer.

また、本発明にかかるパケットバッファ装置の一構成例は、前記ブロックが、複数バイトの固定長からなるワードを単位として複数個に分割されてなり、前記パケット制御部が、前記書込ブロックバッファに前記ブロック管理情報を格納する際、前記書込ブロックバッファ内の前記ワードの先頭ワードから前記ブロック管理情報を格納し、前記書込ブロックバッファに前記パケットデータを書き込む際、前記ブロック管理情報の末尾バイトを格納した前記先頭ワードの次のワードから順に格納用のワードを選択し、選択したワードに前記パケットデータを格納する際、当該ワードの先頭バイトから順に当該パケットデータの各バイトを格納するとともに、当該パケットデータの末尾バイトを格納したバイトの次のバイトから所定のパケット終端パタンを格納し、前記書込ブロックバッファに前記ブロック管理情報を格納する際、前記パケット境界情報に代えて、前記各ワードにおける前記パケットデータの末尾バイトの存在有無を示す境界判定ビット列を含む前記ブロック管理情報を格納するようにしたものである。   Also, in one configuration example of the packet buffer device according to the present invention, the block is divided into a plurality of words each having a fixed length of a plurality of bytes, and the packet control unit is provided in the write block buffer. When storing the block management information, the block management information is stored from the first word of the word in the write block buffer, and when writing the packet data to the write block buffer, the last byte of the block management information When selecting the word for storage in order from the next word of the first word storing the packet, and storing the packet data in the selected word, each byte of the packet data is stored in order from the first byte of the word, The end of a given packet is started from the byte following the byte storing the last byte of the packet data. When the block is stored and the block management information is stored in the write block buffer, the block includes a boundary determination bit string indicating the presence / absence of the last byte of the packet data in each word instead of the packet boundary information Management information is stored.

また、本発明にかかるパケットバッファ装置の一構成例は、前記パケット制御部が、前記ブロックから前記パケットデータを読み出す際、最初に当該ブロックの先頭ワードから前記ブロック管理情報を取得して、このブロック管理情報の前記境界判定ビット列に基づき、当該ブロックにおけるパケットデータの末尾バイトの存在有無を判定し、当該末尾バイトが存在しない場合には、前記メモリ部に対して次のブロックの読出要求を行い、当該末尾バイトが存在しない場合には、前記先頭ワードの次のワードから順に前記パケットデータの読出を行うようにしたものである。   Also, in one configuration example of the packet buffer device according to the present invention, when the packet control unit reads the packet data from the block, the block management information is first obtained from the head word of the block, Based on the boundary determination bit string of the management information, the presence / absence of the end byte of the packet data in the block is determined, and when the end byte does not exist, the memory unit is requested to read the next block, When the tail byte does not exist, the packet data is read sequentially from the next word after the top word.

また、本発明にかかるパケットバッファ装置の一構成例は、前記バッファ制御部が、複数個の前記ブロックで構成された区画のうち、前記キュー入力指示情報で指定されたキューと対応する区画に対して、前記パケットデータを書き込むことにより、前記パケットデータを前記キューに蓄積し、前記メモリ部のうち、前記キュー出力指示情報で指定されたキューと対応する区画から、前記パケットデータの読み出すことにより、前記パケットデータを前記キューから取り出し、前記区画への前記パケットデータの書き込みが満了した場合、当該区画に対して空き区画を連結区画として連結した後、当該空き区画に対する前記パケットデータの書き込みを継続し、前記区画からの前記パケットデータの読み出しが満了した場合、当該区画を空き区画として解放するとともに、当該区画に連結されている連結区画からの前記パケットデータの読み出しを継続するようにしたものである。   Also, in one configuration example of the packet buffer device according to the present invention, the buffer control unit is configured for a partition corresponding to the queue specified by the queue input instruction information among the partitions configured by the plurality of blocks. By writing the packet data, the packet data is accumulated in the queue, and by reading the packet data from the partition corresponding to the queue specified by the queue output instruction information in the memory unit, When the packet data is taken out from the queue and the writing of the packet data to the partition is completed, after the free partition is connected to the partition as a connected partition, the writing of the packet data to the free partition is continued. When the reading of the packet data from the partition expires, the partition is freed Thereby releasing a picture, in which so as to continue the reading of the packet data from the connection section which is connected to the compartment.

また、本発明にかかるパケットバッファ制御方法は、入力されたパケットをキュー(FIFOメモリ)に格納するとともに、出力指示に応じてキューからパケットを取り出して出力するパケットバッファ装置で用いられるパケットバッファ制御方法であって、固定長の記憶領域からなるブロックを複数有し、これらブロックごとにデータの書き込みおよび読み出しを行うメモリ部と、少なくとも前記ブロック分のデータを保持する書込ブロックバッファと、少なくとも前記ブロック分のデータを保持する読出ブロックバッファとを備え、パケット制御部が、入力された可変長のパケットのパケットデータを、前記書込ブロックバッファへ順次格納するとともに、当該書込ブロックバッファへ格納した各パケットデータの終端位置を示すパケット境界情報を含むブロック管理情報を当該書込ブロックバッファへ格納するステップと、当該書込ブロックバッファ内に所定量のデータが格納された時点で、当該データを前記メモリ部へ書き込み、入力された出力指示に応じて、前記メモリ部から前記データを読み出して前記読出ブロックバッファへ格納し、当該データに含まれる前記ブロック管理情報の前記パケット境界情報に基づいて、当該データに含まれる各パケットデータを読み出して出力するステップとを備えている。   The packet buffer control method according to the present invention stores an input packet in a queue (FIFO memory), and extracts and outputs a packet from the queue in response to an output instruction. A plurality of blocks each having a fixed-length storage area, a memory unit for writing and reading data for each block, a write block buffer for holding at least the data for the blocks, and at least the blocks And a read block buffer that holds the data for a minute, and the packet control unit sequentially stores the packet data of the input variable-length packet in the write block buffer and stores each packet data in the write block buffer. Packet indicating the end position of packet data A step of storing block management information including boundary information in the write block buffer, and when a predetermined amount of data is stored in the write block buffer, the data is written to the memory unit and inputted output In response to an instruction, the data is read from the memory unit, stored in the read block buffer, and each packet data included in the data is read based on the packet boundary information of the block management information included in the data. Output step.

本発明によれば、入力パケット毎に生成されるパケット境界情報含む固定長のブロック管理情報が、パケットデータと連結して、メモリ部のキューに格納される。このため、従来のように、キューとは別個に、固定長のパケットジョブ(ジョブ情報)を蓄積するための、SRAMからなるジョブ用メモリを、設ける必要はない。したがって、蓄積するパケット数を増大させた場合でも、パケットを蓄積するデータ用メモリの増大に伴う余分な回路規模の増加を抑制することができる。   According to the present invention, fixed-length block management information including packet boundary information generated for each input packet is concatenated with the packet data and stored in the queue of the memory unit. For this reason, unlike the prior art, it is not necessary to provide a job memory including an SRAM for accumulating fixed-length packet jobs (job information) separately from the queue. Therefore, even when the number of packets to be accumulated is increased, it is possible to suppress an increase in an extra circuit scale accompanying an increase in the data memory for accumulating packets.

第1の実施の形態にかかるパケットバッファ装置の構成を示すブロック図である。It is a block diagram which shows the structure of the packet buffer apparatus concerning 1st Embodiment. 第1の実施の形態にかかるメモリ部におけるパケットデータ蓄積状態を示す説明図である。It is explanatory drawing which shows the packet data storage state in the memory part concerning 1st Embodiment. 第1の実施の形態にかかる書込動作を示す状態遷移図である。FIG. 6 is a state transition diagram illustrating a write operation according to the first embodiment. 第1の実施の形態にかかる読出動作を示す状態遷移図である。FIG. 6 is a state transition diagram illustrating a read operation according to the first embodiment. 第2の実施の形態にかかるメモリ部の構成例である。It is an example of composition of a memory part concerning a 2nd embodiment. 第3の実施の形態にかかるパケットバッファ装置の構成を示すブロック図である。It is a block diagram which shows the structure of the packet buffer apparatus concerning 3rd Embodiment. メモリ部(ブロック分割)の構成例である。It is a structural example of a memory part (block division). 第3の実施の形態にかかるメモリ部におけるパケットデータ蓄積状態を示す説明図である。It is explanatory drawing which shows the packet data storage state in the memory part concerning 3rd Embodiment. 第3の実施の形態にかかる書込動作を示す状態遷移図である。FIG. 10 is a state transition diagram illustrating a write operation according to a third embodiment. 第3の実施の形態にかかるブロック書込動作を示す状態遷移図である。FIG. 10 is a state transition diagram showing a block write operation according to a third embodiment. 第3の実施の形態にかかる読出動作を示す状態遷移図である。FIG. 10 is a state transition diagram illustrating a read operation according to a third embodiment. 第3の実施の形態にかかるブロック読出動作を示す状態遷移図である。FIG. 10 is a state transition diagram illustrating a block read operation according to a third embodiment. 区画連結動作を示す状態遷移図である。It is a state transition diagram which shows division connection operation | movement. 区画解放動作を示す状態遷移図である。It is a state transition diagram showing a partition release operation. 従来のパケットバッファ装置の構成を示すブロックである。It is a block which shows the structure of the conventional packet buffer apparatus. 従来のパケットバッファ装置の動作を示す説明図である。It is explanatory drawing which shows operation | movement of the conventional packet buffer apparatus.

次に、本発明の実施の形態について図面を参照して説明する。
[第1の実施の形態]
まず、図1を参照して、本発明の第1の実施の形態にかかるパケットバッファ装置10について説明する。図1は、第1の実施の形態にかかるパケットバッファ装置の構成を示すブロック図である。
Next, embodiments of the present invention will be described with reference to the drawings.
[First Embodiment]
First, a packet buffer device 10 according to a first embodiment of the present invention will be described with reference to FIG. FIG. 1 is a block diagram showing the configuration of the packet buffer device according to the first embodiment.

このパケットバッファ装置10は、パケットを送受信するパケット通信装置で用いられて、入力されたパケットをキュー(FIFOメモリ)に格納するとともに、出力指示に応じてキューからパケットを取り出して出力する機能を有している。
このパケットバッファ装置10には、主な機能部として、バッファ制御部11、メモリ部12、書込バッファ部13、および読出バッファ部14が設けられている。
This packet buffer device 10 is used in a packet communication device that transmits and receives packets, and has a function of storing an input packet in a queue (FIFO memory) and extracting and outputting the packet from the queue according to an output instruction. doing.
The packet buffer device 10 includes a buffer control unit 11, a memory unit 12, a write buffer unit 13, and a read buffer unit 14 as main functional units.

バッファ制御部11は、入力されたパケットのパケットデータをメモリ部12に書き込むことで、メモリ部12にパケットを蓄積する機能と、蓄積されたパケットを取り出すタイミングを指定する出力指示情報に基づいて、メモリ部12からパケットデータを読み出して出力する機能とを有している。なお、バッファ制御部11に、外部装置(図示せず)から入力される出力指示情報を、前記外部装置が生成するための情報として、蓄積状態を表す蓄積状態情報を前記外部装置に対して出力する機能を設けてもよい。   The buffer control unit 11 writes the packet data of the input packet to the memory unit 12 to store the packet in the memory unit 12 and the output instruction information that specifies the timing to extract the stored packet. It has a function of reading packet data from the memory unit 12 and outputting it. The buffer control unit 11 outputs, to the external device, storage state information indicating the storage state as output instruction information input from an external device (not shown) as information for the external device to generate. A function may be provided.

メモリ部12は、バッファ制御部11から、パケットデータとこのパケットデータを書き込むアドレスを受け取って、前記アドレスに対応するメモリセルに前記パケットデータを書き込む機能と、バッファ制御部11から、パケットデータを読み出すアドレスを受け取って、前記アドレスに対応するメモリセルが保持するパケットデータをバッファ制御部11に出力する機能とを有している。   The memory unit 12 receives the packet data and an address for writing the packet data from the buffer control unit 11, and reads the packet data from the buffer control unit 11, and a function for writing the packet data to the memory cell corresponding to the address. It has a function of receiving an address and outputting packet data held in a memory cell corresponding to the address to the buffer control unit 11.

書込バッファ部13は、少なくとも1ブロック分のデータ、すなわちブロックデータを保持する書込ブロックバッファ13Aを有し、バッファ制御部11から、パケットデータとブロック管理情報を受け取って、書込ブロックバッファ13Aに前記パケットデータを格納する機能と、バッファ制御部11からの出力指示に応じて、書込ブロックバッファ13Aに保持していたブロックデータをバッファ制御部11に出力する機能とを有している。   The write buffer unit 13 includes a write block buffer 13A that holds at least one block of data, that is, block data. The write buffer unit 13 receives packet data and block management information from the buffer control unit 11, and receives the write block buffer 13A. And the function of outputting the block data held in the write block buffer 13A to the buffer control unit 11 in response to an output instruction from the buffer control unit 11.

読出バッファ部14は、少なくとも1ブロック分のブロックデータを保持する読出ブロックバッファ14Aを有し、バッファ制御部11からブロックデータを受け取って、読出ブロックバッファ14Aに格納する機能と、バッファ制御部11からの出力指示に応じて、読出ブロックバッファ14Aで保持していたブロックデータをバッファ制御部11に出力する機能とを有している。   The read buffer unit 14 has a read block buffer 14A that holds at least one block of block data. The read buffer unit 14 receives block data from the buffer control unit 11 and stores it in the read block buffer 14A. In response to the output instruction, the block data held in the read block buffer 14A is output to the buffer control unit 11.

図2は、第1の実施の形態にかかるメモリ部におけるパケットデータ蓄積状態を示す説明図である。
メモリ部12は、バッファ制御部11からの制御に基づき、固定長であるKバイトのブロック単位でパケットをシーケンシャルで書き込み/読み出しする。本例では、アドレスが連続するメモリ領域を、Kバイトずつに区切って各々をブロックとし、パケットの入力順に、アドレスが小さい方のブロックから格納されている。
FIG. 2 is an explanatory diagram illustrating a packet data accumulation state in the memory unit according to the first embodiment.
Based on the control from the buffer control unit 11, the memory unit 12 sequentially writes / reads packets in blocks of a fixed length of K bytes. In this example, memory areas with consecutive addresses are divided into K bytes and each block is stored, and the blocks are stored from the block with the smallest address in the order of packet input.

Kは1ブロックのバイト数であり、Kの値を、ブロックを記憶するメモリの1バーストでアクセスできるデータ量の整数倍とすることで、効率的なブロックの書き込み/読み出しが可能となる。1バーストあたりのデータ量は、一般的に2のべき乗の値をとるが、その値はメモリのデータ幅やバースト長に依存する。Kが大きくなると、1ブロック分のデータを保持するためのメモリ量が増大するため、書込バッファ部13と読出バッファ部14の回路規模が増大するという問題が生じる。   K is the number of bytes in one block, and by making the value of K an integer multiple of the amount of data that can be accessed in one burst of the memory storing the block, efficient writing / reading of the block becomes possible. The amount of data per burst is generally a power of 2, but this value depends on the data width and burst length of the memory. When K increases, the amount of memory for holding data for one block increases, which causes a problem that the circuit scale of the write buffer unit 13 and the read buffer unit 14 increases.

また、Kが最小パケット長よりも小さいと、パケット境界が含まれないブロックの割合が増大し、ブロック管理情報のために使用されるメモリが無駄になるという問題が生じる。
また、メモリが複数のバンクに分かれている場合は、マルチ・バンク・オペレーションによって、メモリの帯域利用効率を向上させることができるので、Kを、バーストあたりのデータ量×バンク数の整数倍とすると、1ブロックのアクセスを予め決めておいたメモリへのコマンド発行手順によって行うことで、簡単な回路でマルチ・バンク・オペレーションを実現することができる。Kの値の例は、128,256,512,1024である。
Also, if K is smaller than the minimum packet length, the ratio of blocks that do not include a packet boundary increases, causing a problem that the memory used for block management information is wasted.
In addition, when the memory is divided into a plurality of banks, the bandwidth utilization efficiency of the memory can be improved by the multi-bank operation. Therefore, if K is an integral multiple of the data amount per burst × the number of banks A multi-bank operation can be realized with a simple circuit by performing one block access by a predetermined command issuing procedure to the memory. Examples of the value of K are 128, 256, 512, and 1024.

ブロックの境界は、パケットの境界とは無関係に定められているため、1個のブロックに1個のパケットのパケットデータが完全に収容される場合と、複数のブロックにまたがって収容される場合がある。
各ブロックには、パケットデータの他に、固定長(Hバイト)のブロック管理情報が含まれ、ブロック管理情報のブロック内での位置が定められている。本例では、ブロックの先頭側すなわちアドレス最小側に寄せて配置される。
Since the block boundary is determined independently of the packet boundary, packet data of one packet is completely accommodated in one block, and cases where it is accommodated across a plurality of blocks. is there.
Each block includes, in addition to packet data, block management information having a fixed length (H bytes), and the position of the block management information in the block is determined. In this example, it is arranged close to the head side of the block, that is, the address minimum side.

また、本例では、ブロック管理情報は、パケット境界情報の他に、そのブロックのパケットデータ領域を使い切っているか否かを示す、パケットデータ継続フラグを持つ。前記パケットデータ継続フラグが「1」の場合は、パケットデータ領域を使い切っている場合であり、パケットデータ領域の最後まで有効なパケットデータが格納されていることを示す。
一方、前記パケットデータ継続フラグが「0」の場合は、前記領域内に含まれるパケットデータの末尾(1個のブロックに複数のパケットが収容されている場合は最後のパケットのデータ末尾)より後ろに、有効なパケットデータが格納されていないことを示す。
In this example, the block management information has a packet data continuation flag indicating whether or not the packet data area of the block has been used, in addition to the packet boundary information. When the packet data continuation flag is “1”, it means that the packet data area is used up and that valid packet data is stored up to the end of the packet data area.
On the other hand, when the packet data continuation flag is “0”, it is after the end of the packet data included in the area (the end of the data of the last packet when a plurality of packets are accommodated in one block). Indicates that valid packet data is not stored.

Hはブロック管理情報のバイト数である。ブロック内に入り得るパケット数分のパケット境界位置を示すパケット終端位置を含む必要がある。パケット終端位置をブロック先頭からのバイト数として表す場合は、1個のパケット終端位置は、ブロックのバイト数未満の値を表現するため、log2(K−1)以上のビット数となる。また、ブロック内のデータをバイト単位ではなくワード単位で扱う場合には、ブロック管理情報を1ワードまたは予め決められた個数のワードに収めるよう規定することで、ワード単位での扱いに整合する。   H is the number of bytes of the block management information. It is necessary to include packet end positions indicating packet boundary positions corresponding to the number of packets that can enter the block. When the packet end position is expressed as the number of bytes from the head of the block, one packet end position represents a value less than the number of bytes in the block, and therefore has a bit number equal to or greater than log2 (K-1). Further, when data in a block is handled in units of words instead of in units of bytes, it is matched with handling in units of words by defining the block management information to be stored in one word or a predetermined number of words.

さらに、ブロック管理情報がパケットデータ継続フラグを含む場合には、ブロック管理情報に加えて前記フラグ用に少なくとも1ビットを必要となる。最小パケット長が64Byteのとき、Hの値の例は、2,4,8,16、であり、各々、K=128,256,512,1024に対応する。
ただし、K=512,1024の場合、パケット終端位置はブロック先頭からのバイト数ではなく、ブロック先頭からのワード数を表すと仮定している。前記により、パケット終端位置は、ブロック内のデータのバイト数を2進数として表現可能なビット数よりも少ないビット数で表現できるためである。例えば、K=512のとき、ブロック先頭からのバイト数としてパケット終端位置を規定すると8bit長となるが、ブロック先頭からの4Byte長のワード数パケット終端位置を規定すると6bit長で済む。
Further, when the block management information includes a packet data continuation flag, at least one bit is required for the flag in addition to the block management information. When the minimum packet length is 64 bytes, examples of the value of H are 2, 4, 8, and 16, corresponding to K = 128, 256, 512, and 1024, respectively.
However, in the case of K = 512, 1024, it is assumed that the packet end position represents the number of words from the block head, not the number of bytes from the block head. This is because the packet end position can be expressed by a smaller number of bits than the number of bits that can be expressed as a binary number in the block. For example, when K = 512, if the packet end position is defined as the number of bytes from the head of the block, the length is 8 bits. However, if the 4-byte length word count from the block head is defined, the packet end position is 6 bits.

パケット境界情報は、M個のパケット終端位置からなる。各パケット終端位置は、ブロックに含まれるパケットデータ末尾バイトのブロック内での位置、すなわち、パケットデータ領域の先頭バイトから前記パケットデータ末尾バイトまでのバイト数で表される。この際、パケット終端位置が「1」となる場合は、パケットデータ領域の先頭バイトがパケットデータ末尾バイトである場合である。なお、パケット終端位置が「0」の値である場合は、前記パケット終端位置が無効であることを意味し、1個のブロックに含まれるパケットデータ末尾バイトの数がM個より少ない場合に生じる。   The packet boundary information consists of M packet end positions. Each packet end position is represented by the position within the block of the last byte of packet data included in the block, that is, the number of bytes from the first byte of the packet data area to the last byte of the packet data. At this time, when the packet end position is “1”, the first byte of the packet data area is the last byte of the packet data. When the packet end position is a value of “0”, this means that the packet end position is invalid, and occurs when the number of end bytes of packet data included in one block is less than M. .

Mはブロック内に入り得るパケット数の最大値である。したがって、M≧K/最小パケット長となる。最小パケット長が64Byteのとき、Mの値の例は、M=2,4,8,16、であり、各々、K=128,256,512,1024に対応する。ただし、パケット境界位置情報はブロック先頭からのバイト数ではなくブロック先頭からのワード数を表すと仮定している。   M is the maximum number of packets that can enter a block. Therefore, M ≧ K / minimum packet length. When the minimum packet length is 64 bytes, examples of the value of M are M = 2, 4, 8, 16, and correspond to K = 128, 256, 512, 1024, respectively. However, it is assumed that the packet boundary position information represents the number of words from the block head, not the number of bytes from the block head.

[第1の実施の形態の書込動作]
次に、図3を参照して、本実施の形態にかかるパケットバッファ装置10の書込動作について説明する。図3は、第1の実施の形態にかかる書込動作を示す状態遷移図である。
[Write Operation of First Embodiment]
Next, the writing operation of the packet buffer device 10 according to the present embodiment will be described with reference to FIG. FIG. 3 is a state transition diagram showing a write operation according to the first embodiment.

この書込動作において、次のような制御変数が用いられる。
パケット終端位置は、各パケットデータの末尾バイトの位置を示す変数であり、1個のブロックデータ内のパケットデータ領域の先頭バイトからのバイト数で表現される。
変数iは、1個のブロックデータ内に含まれるパケット末尾バイトの個数を計数するためのカウンタである。
変数Mは、1個のブロックデータ内に含みうるパケット数の最大値である。
格納位置は、パケットデータを1バイトずつ書込ブロックバッファ13A内のパケットデータ領域に格納するときの位置を指定する変数(バイトアドレス)である。
パケットデータ継続フラグは、パケットデータ領域を使い切っているか否かを示す変数である。
In this writing operation, the following control variables are used.
The packet end position is a variable indicating the position of the last byte of each packet data, and is represented by the number of bytes from the first byte of the packet data area in one block data.
The variable i is a counter for counting the number of packet end bytes included in one block data.
The variable M is the maximum number of packets that can be included in one block data.
The storage position is a variable (byte address) that specifies the position when packet data is stored byte by byte in the packet data area in the write block buffer 13A.
The packet data continuation flag is a variable indicating whether or not the packet data area is used up.

[初期化状態]
パケットバッファ装置10は、電源投入後、パケットの入力を開始する前に、初期化状態(ステップ100)に遷移して、初期化処理を実行する。また、パケットバッファ装置10に正常な動作を維持することができない異常の発生をパケットバッファ装置10自身が検出した場合や、外部からのリセット要求があった場合にも、初期化が行われる。
[Initialization status]
The packet buffer device 10 transitions to an initialization state (step 100) after the power is turned on and before starting to input a packet, and executes an initialization process. The initialization is also performed when the packet buffer device 10 itself detects the occurrence of an abnormality in which normal operation cannot be maintained in the packet buffer device 10 or when there is a reset request from the outside.

初期化状態(ステップ100)において、バッファ制御部11は、書込ブロックバッファ13Aを初期化する。この初期化処理において、バッファ制御部11は、M個のパケット終端位置の値を「0」に初期化するとともに、変数iの値を「0」に初期化する。また、バッファ制御部11は、書込バッファ部13の格納位置を初期化する。これにより、格納位置は、パケットデータ領域の先頭位置にセットされる。   In the initialization state (step 100), the buffer control unit 11 initializes the write block buffer 13A. In this initialization process, the buffer control unit 11 initializes the values of the M packet end positions to “0” and initializes the value of the variable i to “0”. In addition, the buffer control unit 11 initializes the storage position of the write buffer unit 13. Thereby, the storage position is set at the head position of the packet data area.

バッファ制御部11は、初期化状態(ステップ100)において、初期化が完了した時点で、パケットの入力を待つ、入力待ち状態(ステップ101)に遷移する。   In the initialization state (step 100), the buffer control unit 11 transitions to an input wait state (step 101) in which the input of a packet is waited when the initialization is completed.

[入力待ち状態]
入力待ち状態(ステップ101)において、パケットの入力があった時点、すなわち「入力あり」の場合、バッファ制御部11は、前記パケットのパケットデータを書込ブロックバッファ13Aに格納する、データ格納状態(ステップ102)に遷移する。
[Waiting for input]
In the input waiting state (step 101), when a packet is input, that is, when “input is present”, the buffer control unit 11 stores the packet data of the packet in the write block buffer 13A (data storage state ( Transition to step 102).

また、入力待ち状態(ステップ101)において、パケットの入力がなく、メモリ部12に蓄積されたブロックがあるか、または、書込バッファ部13に保持されているパケットデータがない場合、すなわち「入力なし and(メモリ蓄積あり or データ保持なし)」の場合、バッファ制御部11は、他の状態に遷移せずに、パケットの入力を待ち受ける入力待ち状態(ステップ101)に留まる。   In the input waiting state (step 101), when there is no packet input and there is a block accumulated in the memory unit 12 or there is no packet data held in the write buffer unit 13, that is, “input” In the case of “none and (with memory accumulation or no data retention)”, the buffer control unit 11 does not transition to another state but remains in an input waiting state (step 101) for waiting for packet input.

書込バッファ部13は、1ブロック分のパケットデータが揃うまで、書込ブロックバッファ13A内で前記パケットデータを保持する。例えば、初期状態(空の状態)の書込ブロックバッファ13Aに、3.5ブロック分の長さのパケットデータを持つ1個のパケットが入力された場合、このパケットデータは、先頭から3個のブロックに順に分割されて、メモリ部12に書き込まれるが、ブロック1個分に満たない残り0.5ブロック分のパケットデータについては、書込ブロックバッファ13A内で、次のパケットが入力されることによって、ブロック1個分のデータが揃うのを待つことになる。   The write buffer unit 13 holds the packet data in the write block buffer 13A until packet data for one block is prepared. For example, when one packet having packet data of 3.5 blocks in length is input to the write block buffer 13A in the initial state (empty state), the packet data includes three packets from the beginning. The data is divided into blocks in order and written to the memory unit 12, but for the remaining 0.5 blocks of packet data less than one block, the next packet is input in the write block buffer 13A. Therefore, it waits for the data for one block to be prepared.

このような場合に、メモリ部12から前記パケットデータを読み出すとき、メモリ部12に蓄積された3個のブロックのデータについては読み出しが行われるが、書込ブロックバッファ13A内に残ったパケットデータについてはメモリ部12に蓄積されていないので、このままでは、メモリ部12から読み出した3個のブロックデータからパケットを再生することができない。
そこで、このような状況では、ブロック書き込み2状態(ステップ104)に遷移することによって、書込ブロックバッファ13A内に残された残りのデータを、1ブロック分のブロックデータが揃っていなくともメモリ部12に書き込むことにより、メモリ部12から1個のパケットデータを全て読み出せるようにしている。
In such a case, when the packet data is read from the memory unit 12, the data of the three blocks stored in the memory unit 12 are read, but the packet data remaining in the write block buffer 13A is read. Are not stored in the memory unit 12, the packet cannot be reproduced from the three block data read out from the memory unit 12 as it is.
Therefore, in such a situation, by making a transition to the block write 2 state (step 104), the remaining data remaining in the write block buffer 13A can be stored in the memory unit even if block data for one block is not prepared. By writing to 12, all the packet data can be read from the memory unit 12.

すなわち、入力待ち状態(ステップ101)において、パケットの入力がなく、メモリ部12に蓄積されたブロックがなく、かつ、書込バッファ部13に保持されているデータがある場合、すなわち「入力なし and(メモリ蓄積なし and データ保持あり)」の場合、バッファ制御部11は、1ブロック分のパケットデータが揃うのを待たずに、未満了状態のブロックをメモリ部12に書き込むため、ブロック書き込み2状態(ステップ104)に遷移する。この遷移は、入力がなくメモリ部12に蓄積されたパケットデータを出し尽くし、書込ブロックバッファ13Aに残った最後のデータが出力されない状況を回避するためのものである。   That is, in the input waiting state (step 101), when there is no packet input, there is no block stored in the memory unit 12, and there is data held in the write buffer unit 13, that is, “no input and In the case of “No memory storage and data retention”, the buffer control unit 11 writes the block in the incomplete state to the memory unit 12 without waiting for the packet data for one block to be prepared, so that the block write 2 state Transition to (Step 104). This transition is for avoiding a situation where the packet data accumulated in the memory unit 12 without input is exhausted and the last data remaining in the write block buffer 13A is not output.

[データ格納状態]
データ格納状態(ステップ102)において、バッファ制御部11は、書込ブロックバッファ13Aのうち、格納位置が示すパケットデータ領域内の位置に、入力されたパケットデータを1バイトずつ格納し、併せて、前記格納位置を1バイトずつ後ろに移動させる。
[Data storage status]
In the data storage state (step 102), the buffer control unit 11 stores the input packet data byte by byte at a position in the packet data area indicated by the storage position in the write block buffer 13A. The storage position is moved backward by 1 byte.

また、データ格納状態(ステップ102)において、パケットデータが後続し、かつ、書込ブロックバッファ13Aのパケットデータ領域に空きがある場合、すなわち「パケット継続 and ブロック未満了」の場合、バッファ制御部11は、データ格納状態(ステップ102)に留まって、前記パケットデータの格納を継続する。   Further, in the data storage state (step 102), when packet data follows and the packet data area of the writing block buffer 13A has an empty space, that is, “packet continuation and block less than end”, the buffer control unit 11 Stays in the data storage state (step 102) and continues to store the packet data.

一方、データ格納状態(ステップ102)において、パケットデータが後続し、かつ、書込ブロックバッファ13Aのパケットデータ領域に空きがなくなった場合、すなわち「パケット継続 and ブロック満了」の場合、バッファ制御部11は、書込ブロックバッファ13Aに保持されたブロックデータをメモリ部12に書き込む、ブロック書き込み1状態(ステップ103)に遷移する。   On the other hand, in the data storage state (step 102), when the packet data follows and the packet data area of the writing block buffer 13A is full, that is, when “packet continuation and block expiration”, the buffer control unit 11 Transitions to the block write 1 state (step 103), in which the block data held in the write block buffer 13A is written to the memory unit 12.

また、データ格納状態(ステップ102)において、パケットデータをその末尾バイトまで書込ブロックバッファ13Aへ入力し終えた場合、すなわち「パケット終了」時、バッファ制御部11は、書込ブロックバッファ13Aにパケット終端位置を格納する、パケット終端位置更新状態(ステップ105)に遷移する。   Further, in the data storage state (step 102), when the packet data has been input to the write block buffer 13A up to the last byte, that is, at the “packet end”, the buffer control unit 11 sends a packet to the write block buffer 13A. Transition to the packet end position update state (step 105) in which the end position is stored.

[データ終端位置更新状態]
データ終端位置更新状態(ステップ105)において、バッファ制御部11は、変数iの値に「1」を加算する。
さらに、バッファ制御部11は、直前のデータ格納状態(ステップ102)において、パケットデータの末尾バイトを書込ブロックバッファ13Aに格納した際、その格納位置に相当するバイト数、すなわち、前記書込ブロックバッファ13Aのパケットデータ領域先頭から前記末尾バイトまでのバイト数を、ブロック管理情報に含まれるパケット終端位置#iとして、書込ブロックバッファ13Aに格納する。
[Data end position update status]
In the data end position update state (step 105), the buffer control unit 11 adds “1” to the value of the variable i.
Furthermore, when the last byte of the packet data is stored in the write block buffer 13A in the previous data storage state (step 102), the buffer control unit 11 stores the number of bytes corresponding to the storage position, that is, the write block The number of bytes from the beginning of the packet data area of the buffer 13A to the end byte is stored in the writing block buffer 13A as the packet end position #i included in the block management information.

データ終端位置更新状態(ステップ105)において、書込ブロックバッファ13Aのパケットデータ領域に空きがある場合、すなわち「ブロック未満了」時、バッファ制御部11は、入力待ち状態(ステップ101)に遷移する。
また、データ終端位置更新状態(ステップ105)において、書込ブロックバッファ13Aのパケットデータ領域に空きがなくなった場合、すなわち「ブロック満了」時、バッファ制御部11は、書込ブロックバッファ13Aに保持されたブロックをメモリ部12に書き込む、ブロック書き込み2状態(ステップ104)に遷移する。
In the data end position update state (step 105), when there is a vacancy in the packet data area of the write block buffer 13A, that is, when “less than block end”, the buffer control unit 11 transitions to an input waiting state (step 101). .
In addition, in the data end position update state (step 105), when there is no more space in the packet data area of the write block buffer 13A, that is, when “block expiration” occurs, the buffer control unit 11 is held in the write block buffer 13A. The block is written to the memory unit 12, and the state transits to the block write 2 state (step 104).

[ブロック書き込み1状態]
ブロック書き込み1状態(ステップ103)において、バッファ制御部11は、書込ブロックバッファ13A内にブロック管理情報として保持されているパケットデータ継続フラグの値を「1」とし、書込ブロックバッファ13Aに保持されているブロックデータを、メモリ部12内の所定のアドレスに書き込む。
[Block write 1 status]
In the block write 1 state (step 103), the buffer control unit 11 sets the value of the packet data continuation flag held as block management information in the write block buffer 13A to “1” and holds it in the write block buffer 13A. The written block data is written to a predetermined address in the memory unit 12.

さらに、バッファ制御部11は、書込ブロックバッファ13Aを初期化する。この初期化では、M個のパケット終端位置の値を「0」に初期化するとともに、変数iを「0」に初期化する。また、書込バッファ部13で保持する格納位置を初期化する。これにより、格納位置は、パケットデータ領域の先頭位置にセットされる。その後、バッファ制御部11は、データ格納状態(ステップ102)に遷移する。   Further, the buffer control unit 11 initializes the writing block buffer 13A. In this initialization, the values of the M packet end positions are initialized to “0”, and the variable i is initialized to “0”. Further, the storage position held in the write buffer unit 13 is initialized. Thereby, the storage position is set at the head position of the packet data area. Thereafter, the buffer control unit 11 transitions to a data storage state (step 102).

[ブロック書き込み2状態]
ブロック書き込み2状態(ステップ104)において、バッファ制御部11は、書込ブロックバッファ13A内にブロック管理情報として保持されているパケットデータ継続フラグの値を「0」に初期化し、書込ブロックバッファ13Aに保持されたブロックデータを、メモリ部12内の所定のアドレスに書き込む。
[Block write 2 status]
In the block write 2 state (step 104), the buffer control unit 11 initializes the value of the packet data continuation flag held as block management information in the write block buffer 13A to “0”, and writes the write block buffer 13A. The block data held in is stored in a predetermined address in the memory unit 12.

さらに、バッファ制御部11は、書込ブロックバッファ13Aを初期化する。この初期化では、M個のパケット終端位置の値を「0」に初期化するとともに、変数iを「0」に初期化する。また、書込バッファ部13の格納位置を「0」に初期化する。これにより、格納位置がパケットデータ領域の先頭位置にセットされる。その後、バッファ制御部11は、入力待ち状態(ステップ101)に遷移する。   Further, the buffer control unit 11 initializes the writing block buffer 13A. In this initialization, the values of the M packet end positions are initialized to “0”, and the variable i is initialized to “0”. Further, the storage position of the write buffer unit 13 is initialized to “0”. As a result, the storage position is set at the head position of the packet data area. Thereafter, the buffer control unit 11 transitions to an input waiting state (step 101).

なお、以上で説明した書込動作において、ブロック書き込み1状態(ステップ103)またはブロック書き込み2状態(ステップ104)では、メモリ部12に保持していたブロックデータを書き込む処理を行うが、メモリ部12でのブロックの蓄積がなく、かつ、読出バッファ部14にブロックの保持がない場合は、前記のようにメモリ部12に書き込むのではなく、読出バッファ部14に格納する処理を行ってもよい。これにより、入力されたパケットが蓄積されず出力される状況において、メモリ部12への蓄積を省くことができるため、メモリ部12での消費電力の削減が可能となる。   In the write operation described above, in the block write 1 state (step 103) or the block write 2 state (step 104), the block data held in the memory unit 12 is written. If the block is not accumulated in the block and the read buffer unit 14 does not hold the block, a process of storing the block in the read buffer unit 14 instead of writing in the memory unit 12 as described above may be performed. As a result, in the situation where the input packet is output without being stored, the storage in the memory unit 12 can be omitted, so that the power consumption in the memory unit 12 can be reduced.

[第1の実施の形態の読出動作]
次に、図4を参照して、本実施の形態にかかるパケットバッファ装置10の読出動作について説明する。図4は、第1の実施の形態にかかる読出動作を示す状態遷移図である。
[Read Operation of First Embodiment]
Next, the read operation of the packet buffer device 10 according to the present embodiment will be described with reference to FIG. FIG. 4 is a state transition diagram showing a read operation according to the first embodiment.

この読出動作において、次のような制御変数が用いられる
データ保持有無は、読出ブロックバッファ14Aでのデータ保持あり/なしを示す変数である。
変数iは、1個のブロックデータ内に含まれるパケット末尾バイトの個数を計数するためのカウンタである。
変数Mは、1個のブロックデータ内に含みうるパケット数の最大値である。
パケット終端位置は、各パケットデータの末尾バイトの位置を示す変数であり、1個のブロックデータ内のパケットデータ領域の先頭バイトからのバイト数で表現される。
In this reading operation, the following control variables are used. Data holding / non-holding is a variable indicating whether data is held in the reading block buffer 14A.
The variable i is a counter for counting the number of packet end bytes included in one block data.
The variable M is the maximum number of packets that can be included in one block data.
The packet end position is a variable indicating the position of the last byte of each packet data, and is represented by the number of bytes from the first byte of the packet data area in one block data.

格納位置は、パケットデータを1バイトずつ読出ブロックバッファ14A内のパケットデータ領域に格納するときの位置を指定する変数(バイトアドレス)である。
取得位置は、パケットデータを1バイトずつ読出ブロックバッファ14A内のパケットデータ領域から取得するときの位置を指定する変数(バイトアドレス)である。
パケットデータ継続フラグは、パケットデータパケットデータ領域を使い切っているか否かを示す変数である。
The storage position is a variable (byte address) that specifies a position when packet data is stored byte by byte in the packet data area in the read block buffer 14A.
The acquisition position is a variable (byte address) that specifies a position when packet data is acquired byte by byte from the packet data area in the read block buffer 14A.
The packet data continuation flag is a variable indicating whether or not the packet data packet data area is used up.

[初期化状態]
パケットバッファ装置10は、電源投入後、パケットの出力を開始する前に、初期化状態(ステップ110)に遷移して、初期化処理を実行する。また、パケットバッファ装置10に正常な動作を維持することができない異常の発生をパケットバッファ装置10自身が検出した場合や、外部からのリセット要求があった場合にも、初期化が行われる。
[Initialization status]
The packet buffer device 10 transitions to the initialization state (step 110) after the power is turned on and before starting the output of the packet, and executes the initialization process. The initialization is also performed when the packet buffer device 10 itself detects the occurrence of an abnormality in which normal operation cannot be maintained in the packet buffer device 10 or when there is a reset request from the outside.

初期化状態(ステップ110)において、バッファ制御部11は、読出ブロックバッファ14Aを初期化する。この初期化処理において、バッファ制御部11は、データ保持有無の値をデータ保持なしに初期化する。   In the initialization state (step 110), the buffer control unit 11 initializes the read block buffer 14A. In this initialization process, the buffer control unit 11 initializes a value indicating whether data is retained without retaining data.

また、この初期化において、バッファ制御部11は、M個のパケット終端位置の値を「0」に初期化するとともに、変数iの値を「0」に初期化する。また、バッファ制御部11は、読出バッファ部14の格納位置を初期化する。これにより、格納位置は、パケットデータ領域の先頭位置にセットされる。
バッファ制御部11は、初期化状態(ステップ110)において、初期化が完了した時点で、出力指示情報の入力を待つ、入力待ち状態(ステップ111)に遷移する。
In this initialization, the buffer control unit 11 initializes the values of the M packet end positions to “0” and initializes the value of the variable i to “0”. Further, the buffer control unit 11 initializes the storage position of the read buffer unit 14. Thereby, the storage position is set at the head position of the packet data area.
In the initialization state (step 110), the buffer control unit 11 transitions to an input waiting state (step 111) where the input of the output instruction information is waited when the initialization is completed.

[入力待ち状態]
入力待ち状態(ステップ111)において、バッファ制御部11は、出力指示情報の入力があるまで、他の状態に遷移せずに、出力指示情報の入力を待ち受ける入力待ち状態(ステップ111)に留まる。
また、入力待ち状態(ステップ111)において、出力指示情報の入力があった時点で、前記データ保持有無がデータ保持ありを示す場合、すなわち「入力あり and データ保持あり」の場合、バッファ制御部11は、データ取得状態(ステップ112)に遷移する。
[Waiting for input]
In the input waiting state (step 111), the buffer control unit 11 remains in the input waiting state (step 111) waiting for the input of the output instruction information without transitioning to another state until the output instruction information is input.
Further, in the input waiting state (step 111), when the output instruction information is input, if the data holding presence / absence indicates that there is data holding, that is, “with input and with data holding”, the buffer control unit 11 Transitions to the data acquisition state (step 112).

一方、入力待ち状態(ステップ111)において、出力指示情報の入力があった時点で、前記データ保持有無がデータ保持なしを示す場合、すなわち「入力あり and データ保持なし」の場合、バッファ制御部11は、ブロック読み出し状態(ステップ113)に遷移する。   On the other hand, in the input waiting state (step 111), when the output instruction information is input, if the data holding presence / absence indicates no data holding, that is, “with input and no data holding”, the buffer control unit 11 Transitions to the block read state (step 113).

[データ取得状態]
データ取得状態(ステップ112)において、バッファ制御部11は、読出ブロックバッファ14Aから、取得位置が示す位置から、パケットデータを1バイトずつ取得して出力し、併せて、前記取得位置を1バイトずつ後ろに移動させる。なお、パケットデータが1バイト単位で出力するのではなく、予め定められたバイト数単位で出力する場合には、前記バイト数単位で格納と格納位置の移動を行う。
[Data acquisition status]
In the data acquisition state (step 112), the buffer control unit 11 acquires and outputs packet data byte by byte from the position indicated by the acquisition position from the read block buffer 14A, and also sets the acquisition position byte by byte. Move back. When packet data is not output in units of 1 byte but in units of a predetermined number of bytes, storage and storage position movement are performed in units of the number of bytes.

また、データ取得状態(ステップ112)において、バッファ制御部11は、パケット継続/終了と、残データあり/なし、すなわち読出ブロックバッファ14A内に取得前のパケットデータがあるか/ないかとを判定する。
この際、前記パケット終了は、読出ブロックバッファ14Aに格納されたパケット終端位置#iが示す位置に前記取得位置が達したこと、すなわち、取得中のパケットデータの末尾バイトまで取得を終えたことを条件として判定する。なお、変数iは、読出ブロックバッファ14Aに含まれるM個のパケット終端位置のうち、取得対象のパケットに対するパケット終端位置を特定する変数としても用いられる。
Further, in the data acquisition state (step 112), the buffer control unit 11 determines whether or not there is packet continuation / end and whether or not there is remaining data, that is, whether or not there is packet data before acquisition in the read block buffer 14A. .
At this time, the end of the packet indicates that the acquisition position has reached the position indicated by the packet end position #i stored in the read block buffer 14A, that is, that acquisition has been completed up to the last byte of the packet data being acquired. Judge as a condition. The variable i is also used as a variable for specifying the packet end position for the acquisition target packet among the M packet end positions included in the read block buffer 14A.

また、パケット継続は、前記パケット終了の条件を満たさないことを条件として判定する。この際、パケット終端位置#iの値が「0」の場合あるいはi>Mの場合は、取得中のパケットの末尾バイトを読出ブロックバッファ14Aに含まれず後続ブロックに含まれることを意味するため、前記判定はパケット継続となる。
一方、前記残データありは、前記取得位置がパケットデータ領域の最終バイト位置に達していないことであり、残データなしの条件は、前記残データありの条件を満たさないことを条件として判定する。
Further, the packet continuation is determined on condition that the condition for ending the packet is not satisfied. At this time, if the value of the packet end position #i is “0” or if i> M, it means that the last byte of the packet being acquired is not included in the read block buffer 14A but is included in the subsequent block. The determination is packet continuation.
On the other hand, the presence of remaining data means that the acquisition position has not reached the final byte position of the packet data area, and the condition of no remaining data is determined on the condition that the condition of remaining data is not satisfied.

また、データ取得状態(ステップ112)において、パケットデータの末尾バイトまでデータを取得し終えた場合、すなわち「パケット終了」時、バッファ制御部11は、前記データ保持有無の値を、以下に示す判定に基づいて更新し、その後、入力待ち状態(ステップ111)に遷移する。   Further, in the data acquisition state (step 112), when the data acquisition is completed up to the last byte of the packet data, that is, at the time of “end of packet”, the buffer control unit 11 determines the data holding presence / absence value as follows: And then transitions to an input wait state (step 111).

バッファ制御部11は、上記判定において、まず、前記取得位置がパケットデータ領域の最終バイト位置に達した場合、データ保持有無の値を保持なしと設定する。
一方、前記取得位置がパケットデータ領域の最終バイト位置に達していない場合は、バッファ制御部11は、変数iの値に「1」を加算する。
In the above determination, when the acquisition position reaches the final byte position of the packet data area, the buffer control unit 11 first sets the data holding presence / absence value as not holding.
On the other hand, when the acquisition position has not reached the final byte position of the packet data area, the buffer control unit 11 adds “1” to the value of the variable i.

この際、変数iの更新後に、読出ブロックバッファ14Aに格納されたパケット終端位置#iの値が「0」の場合あるいはi>Mであり、かつ、パケットデータ継続フラグの値が「1」の場合、すなわち、「(i>M)or パケット終端位置[i]==0)and パケットデータ継続フラグ==1」の場合、バッファ制御部11は、データ保持有無の値を保持ありと設定する。   At this time, after updating the variable i, the value of the packet end position #i stored in the read block buffer 14A is “0” or i> M, and the value of the packet data continuation flag is “1”. In this case, that is, in the case of “(i> M) or packet end position [i] == 0) and packet data continuation flag == 1”, the buffer control unit 11 sets the value of whether or not the data is retained as retained. .

一方、前記パケット終端位置#iの値が「0」の場合あるいはi>Mであり、かつ、パケットデータ継続フラグの値が「0」の場合、すなわち、「(i>M)or パケット終端位置[i]==0)and パケットデータ継続フラグ==0」の場合、バッファ制御部11は、データ保持有無の値を保持なしと設定する。
また、前記以外、すなわち、前記パケット終端位置#iの値が「0」以外、かつ、i≦Mの場合、バッファ制御部11は、データ保持有無の値を保持ありと設定する。
On the other hand, when the value of the packet end position #i is “0” or i> M and the value of the packet data continuation flag is “0”, that is, “(i> M) or packet end position In the case of [i] == 0) and packet data continuation flag == 0, the buffer control unit 11 sets the data holding presence / absence value as no holding.
In addition, when the value of the packet end position #i is other than “0” and i ≦ M, the buffer control unit 11 sets the data holding / non-holding value as holding.

また、データ取得状態(ステップ112)において、パケット継続であり、かつ、残データなしの場合、すなわち「パケット継続 and 残データなし」時、バッファ制御部11は、メモリ部12が蓄積するブロックを読み出し、読出ブロックバッファ14Aに格納する、ブロック読み出し状態(ステップ113)に遷移する。   Further, in the data acquisition state (step 112), when the packet is continuation and there is no remaining data, that is, “packet continuation and no remaining data”, the buffer control unit 11 reads out the blocks stored in the memory unit 12 Transition to the block read state (step 113) stored in the read block buffer 14A.

一方、データ取得状態(ステップ112)において、パケット継続であり、かつ、残データありの場合、すなわち「パケット継続 and 残データあり」時、バッファ制御部11は、データ取得状態(ステップ112)に留まって、読出ブロックバッファ14Aからパケットデータを取得して出力する。   On the other hand, in the data acquisition state (step 112), when there is packet continuation and there is remaining data, that is, “packet continuation and remaining data exists”, the buffer control unit 11 remains in the data acquisition state (step 112). The packet data is acquired from the read block buffer 14A and output.

[ブロック読み出し状態]
ブロック読み出し状態(ステップ113)において、バッファ制御部11は、メモリ部12の所定アドレスから1個のブロックデータを読み出して、読出ブロックバッファ14Aに前記ブロックデータを格納する。また、バッファ制御部11は、前記取得位置の値を、読出ブロックバッファ14A内のパケットデータ領域の先頭位置を示す値に初期化するとともに、前記データ保持有無の値を保持ありに初期化し、さらに、変数iの値を「1」に初期化する。
[Block read status]
In the block read state (step 113), the buffer control unit 11 reads one block data from a predetermined address of the memory unit 12, and stores the block data in the read block buffer 14A. Further, the buffer control unit 11 initializes the value of the acquisition position to a value indicating the start position of the packet data area in the read block buffer 14A, initializes the value of the data holding presence / absence with holding, , The value of the variable i is initialized to “1”.

[第1の実施の形態の効果]
このように、本実施の形態にかかるパケットバッファ装置10は、固定長の記憶領域であるブロックを単位としてデータの書き込みおよび読み出しを行うメモリ部12と、少なくとも前記ブロック分のデータを保持する書込ブロックバッファ13Aと、少なくとも前記ブロック分のデータを保持する読出ブロックバッファ14Aとを備え、パケット制御部11において、入力された可変長のパケットのパケットデータを、前記書込ブロックバッファ13Aへ順次格納するとともに、当該書込ブロックバッファ13A内における当該パケットデータの終端位置を示すパケット境界情報を当該書込ブロックバッファ13Aへ格納し、当該書込ブロックバッファ13A内に所定量のデータが格納された時点で、当該データをメモリ部12へ書き込み、入力された出力指示に応じて、メモリ部12から前記データを読み出して前記読出ブロックバッファ14Aへ格納し、当該データに含まれる前記パケット境界情報に基づいて、当該データに含まれる各パケットデータを読み出して出力するようにしたものである。
[Effect of the first embodiment]
As described above, the packet buffer device 10 according to the present embodiment includes a memory unit 12 that writes and reads data in units of blocks, which are fixed-length storage areas, and a write that holds data for at least the blocks. A block buffer 13A and a read block buffer 14A for holding at least the data for the block are provided, and the packet controller 11 sequentially stores the input packet data of variable length packets in the write block buffer 13A. At the same time, packet boundary information indicating the end position of the packet data in the write block buffer 13A is stored in the write block buffer 13A, and when a predetermined amount of data is stored in the write block buffer 13A. Write the data to the memory unit 12 In response to the input output instruction, the data is read from the memory unit 12 and stored in the read block buffer 14A, and each packet data included in the data is read based on the packet boundary information included in the data. Output.

これにより、入力パケット毎に生成されるパケット境界情報含む固定長のブロック管理情報が、パケットデータと連結して、メモリ部12のキューに格納される。このため、本実施の形態にかかるパケットバッファ装置10によれば、従来のような固定長のパケットジョブ(ジョブ情報)を蓄積するため、SRAMからなるジョブ用メモリを、キューとは別個に設ける必要はない。したがって、蓄積するパケット数を増大させた場合でも、パケットを蓄積するデータ用メモリの増大に伴う余分な回路規模の増加を抑制することができる。   As a result, fixed-length block management information including packet boundary information generated for each input packet is connected to the packet data and stored in the queue of the memory unit 12. Therefore, according to the packet buffer device 10 according to the present embodiment, in order to store a conventional fixed-length packet job (job information), it is necessary to provide a job memory composed of SRAM separately from the queue. There is no. Therefore, even when the number of packets to be accumulated is increased, it is possible to suppress an increase in an extra circuit scale accompanying an increase in the data memory for accumulating packets.

また、本実施の形態によれば、ブロック単位でメモリ部12にアクセスするため、ブロック長を、メモリをバーストアクセスするときの1度のアクセスで書き込み/読み出しするデータ量の、整数倍とすることにより、メモリを効率よくアクセスすることができる。
これにより、メモリのデータバス幅やクロック周波数を低減することができるため、回路規模および消費電力を削減することができる。
Further, according to the present embodiment, since the memory unit 12 is accessed in units of blocks, the block length is set to an integral multiple of the amount of data written / read in one access when burst accessing the memory. Thus, the memory can be accessed efficiently.
Thereby, since the data bus width and clock frequency of the memory can be reduced, the circuit scale and the power consumption can be reduced.

また、本実施の形態によれば、ブロック管理情報はブロック内の予め定められた位置に配置され、前記ブロックは固定長であるため、ブロック管理情報とパケットデータを、それらが格納されているメモリのアドレス値によって、確実に識別することができる。
したがって、メモリにソフトエラー等が発生し、前記エラーが発生したブロックに格納されているパケットデータを正常に読み出すことができなくなったとしても、続く正常なブロックとブロック管理情報を読み出すことができるため、後続のパケットについては、正常にそのパケットデータを読み出すことができる。これにより、ブロック管理情報にエラーがないことを確認するためのパリティを付加やチェックは不要であり、前記パリティ演算や保持のための回路を削減することができる。また、エラーが発生した場合にも、メモリ部12の初期化といった正常なパケットまでも廃棄される深刻な影響をもたらすエラー回復処理を必要としない。
In addition, according to the present embodiment, the block management information is arranged at a predetermined position in the block, and the block has a fixed length. Therefore, the block management information and the packet data are stored in the memory in which they are stored. The address value can be reliably identified.
Accordingly, even if a soft error or the like occurs in the memory and the packet data stored in the block in which the error has occurred cannot be normally read, the subsequent normal block and block management information can be read. For subsequent packets, the packet data can be read normally. Thereby, it is not necessary to add or check the parity for confirming that there is no error in the block management information, and it is possible to reduce the circuit for the parity calculation and holding. Further, even when an error occurs, an error recovery process that causes a serious effect of discarding even normal packets such as initialization of the memory unit 12 is not required.

また、パケット境界情報は、ブロック内でのパケット境界の位置を示す情報であるため、メモリ全体でのパケット境界の位置を示す情報よりも、少ないビット数で済む。これにより、パケット境界情報によってメモリが占有される割合を低減することができるため、前記メモリに、多くのパケットデータを蓄積することが可能となる。   Further, since the packet boundary information is information indicating the position of the packet boundary in the block, the number of bits is smaller than the information indicating the position of the packet boundary in the entire memory. As a result, the rate at which the memory is occupied by the packet boundary information can be reduced, so that a large amount of packet data can be stored in the memory.

以下、本実施の形態と従来技術とを対比することにより、本実施の形態にかかる効果について説明する。
本実施の形態にかかるパケットバッファ装置10は、前述したように、ジョブ用メモリを必要としないため、蓄積されるパケット数の増大に伴う回路規模の増大を抑制することができる。
Hereinafter, the effects of the present embodiment will be described by comparing the present embodiment with the prior art.
Since the packet buffer device 10 according to the present embodiment does not require a job memory as described above, it is possible to suppress an increase in circuit scale accompanying an increase in the number of accumulated packets.

従来のパケットバッファ装置では、パケットデータのみをデータ用メモリに蓄積していたのに対して、本発明のパケットバッファ装置10では、パケットデータに加えてブロック管理情報を蓄積するため、蓄積量は増大するが、SDRAMといった大容量のメモリを用いることで、前記蓄積量の増大によって生じる回路規模の増大を抑制可能である。
本発明は、ブロックとしてパケットデータをメモリ(SDRAM)に記憶するが、前記ブロックのブロック管理情報を記憶したメモリ領域に連接するメモリ領域に前記ブロックのデータを記憶する。
In the conventional packet buffer device, only the packet data is stored in the data memory, whereas in the packet buffer device 10 of the present invention, the block management information is stored in addition to the packet data, so the storage amount increases. However, by using a large-capacity memory such as SDRAM, it is possible to suppress an increase in circuit scale caused by the increase in the accumulation amount.
According to the present invention, packet data is stored as a block in a memory (SDRAM), but the data of the block is stored in a memory area connected to the memory area storing the block management information of the block.

ブロック管理情報とブロックのデータの少なくとも一部を、1つのバースト読み出しコマンドをメモリに対して発行することで、メモリから効率的に読み出すことができる。
一方、ブロック管理情報とブロックのデータを、メモリの異なる領域に分離して記憶した場合は、ブロックを読み出すとき、管理情報を読み出すための読み出しコマンドと、データを読み出すための読み出しコマンドの、少なくとも2回のコマンドをメモリに対して発行する必要がある。
By issuing one burst read command to the memory, at least a part of the block management information and the block data can be efficiently read from the memory.
On the other hand, when block management information and block data are stored separately in different areas of the memory, at least two of a read command for reading management information and a read command for reading data are read when the block is read. Commands must be issued to memory.

このとき、コマンドを発行してから、次のコマンドを発行できるようになるまでの時間を待つ必要がある。この待ち時間によって、メモリの帯域利用効率が下がる。
また、ブロック単位でメモリにアクセスするため、ブロック長を、メモリをバーストアクセスするときの1度のアクセスで書き込み/読み出しするデータ量の、整数倍とすることにより、メモリを効率よくアクセスすることができる。
これにより、メモリのデータバス幅やクロック周波数を低減することができるため、回路規模と消費電力を削減することができる。
At this time, it is necessary to wait for a time from when a command is issued until the next command can be issued. This waiting time reduces the bandwidth utilization efficiency of the memory.
In addition, since the memory is accessed in units of blocks, the memory can be accessed efficiently by setting the block length to an integral multiple of the amount of data written / read in one access when burst accessing the memory. it can.
Thereby, the data bus width and clock frequency of the memory can be reduced, so that the circuit scale and power consumption can be reduced.

また、ブロック管理情報はブロック内の予め定められた位置に配置され、前記ブロックは固定長であるため、ブロック管理情報とパケットデータを、それらが格納されているメモリのアドレス値によって、確実に識別することができる。
したがって、メモリにソフトエラー等が発生し、前記エラーが発生したブロックに格納されているパケットデータを正常に読み出すことができなくなったとしても、続く正常なブロックとブロック管理情報を読み出すことができるため、後続のパケットについては、正常にそのパケットデータを読み出すことができる。
The block management information is arranged at a predetermined position in the block, and the block has a fixed length. Therefore, the block management information and the packet data are surely identified by the address value of the memory in which they are stored. can do.
Accordingly, even if a soft error or the like occurs in the memory and the packet data stored in the block in which the error has occurred cannot be normally read, the subsequent normal block and block management information can be read. For subsequent packets, the packet data can be read normally.

これにより、ブロック管理情報にエラーがないことを確認するためのパリティを付加やチェックは不要であり、前記パリティ演算や保持のための回路を削減することができる。また、エラーが発生した場合にも、メモリ部12の初期化といった正常なパケットまでも廃棄される深刻な影響をもたらすエラー回復処理を必要としない。   Thereby, it is not necessary to add or check the parity for confirming that there is no error in the block management information, and it is possible to reduce the circuit for the parity calculation and holding. Further, even when an error occurs, an error recovery process that causes a serious effect of discarding even normal packets such as initialization of the memory unit 12 is not required.

本発明では、メモリにソフトエラー等が発生し、誤りがある管理情報を含むブロックを読み取った場合にも、後続のブロックを読み取ることが可能であり、パケット境界を含んだ後続ブロックを読み取ることで、前記エラーを生じたパケット境界より後にバッファに蓄積されたパケットを、メモリから読み取ることが可能となる。これは、ブロックが固定長(全てのブロックは同一長)であり、メモリはブロックを単位としたFIFOバッファとして管理され、ブロック管理情報はブロック内の予め定められた位置に配置されていることによって、ブロック管理情報の値とは関係なく、ブロック管理情報やブロックのメモリ上の位置が定められているため、ブロック管理情報の値の誤りが、その後のブロックやブロック管理情報の読み取り位置に誤りを与えないためである。   In the present invention, even when a soft error or the like occurs in the memory and a block including management information having an error is read, the subsequent block can be read, and the subsequent block including the packet boundary can be read. Packets accumulated in the buffer after the packet boundary in which the error has occurred can be read from the memory. This is because the block is a fixed length (all blocks have the same length), the memory is managed as a FIFO buffer in units of blocks, and the block management information is arranged at a predetermined position in the block. Because the position of the block management information and the block in the memory is determined regardless of the value of the block management information, an error in the value of the block management information causes an error in the subsequent reading position of the block or block management information. It is because it does not give.

一方、ブロックを可変長とし、前記ブロックは、パケット長などのパケット境界位置情報を含むブロック管理情報と1個のパケットの全データを含むとした場合は、メモリから読み取ったパケット長に誤りがあると、次のブロックが格納されているメモリ上の位置を誤ることになり、前記読み取り位置が誤ったブロックのパケット長にも誤りが発生し、その次のブロックの読み取りも誤る、といったように、誤りの連鎖が発生し、誤りが発生したパケットより後にバッファに蓄積されたパケット全てに誤りを生じることになる。   On the other hand, if the block has a variable length, and the block includes block management information including packet boundary position information such as the packet length and all data of one packet, the packet length read from the memory has an error. Then, the position on the memory where the next block is stored will be mistaken, the error occurs in the packet length of the block where the reading position is wrong, the reading of the next block is wrong, and so on. An error chain occurs, and an error occurs in all packets stored in the buffer after the packet in which the error has occurred.

なお、ジョブ用メモリを別に設け、パケットジョブとしてパケットの格納位置を前記ジョブ用メモリに記憶する場合は、本発明と同様、上記の問題は発生しないが、ジョブ用メモリからパケットジョブを読み出した後にデータ用メモリからパケットデータを読み出すという手順が必要であり、ジョブ用メモリとデータ用メモリの両方をSDRAM上に配置する場合は、パケットジョブの読み出しまでの待ち時間によって、メモリの帯域利用効率が下がる。ジョブ用メモリの読み出しを高速に行うことができるSRAM上に配置した場合、SRAMのビット当たりの面積がデータ用メモリに利用されるSDRAMのビット当たりの面積と比べると大きいため、本発明よりも回路面積が増大する。   In the case where a job memory is provided separately and the packet storage location is stored in the job memory as a packet job, the above problem does not occur as in the present invention, but after the packet job is read from the job memory. The procedure of reading the packet data from the data memory is necessary, and when both the job memory and the data memory are arranged on the SDRAM, the memory bandwidth utilization efficiency decreases due to the waiting time until the packet job is read. . When arranged on an SRAM that can read out the job memory at high speed, the area per bit of the SRAM is larger than the area per bit of the SDRAM used for the data memory, so that the circuit is more than the present invention. The area increases.

また、パケット境界情報は、ブロック内でのパケット境界の位置を示す情報であるため、メモリ全体でのパケット境界の位置を示す情報よりも、少ないビット数で済む。これにより、パケット境界情報によってメモリが占有される割合を低減することができるため、前記メモリに、多くのパケットデータを蓄積することが可能となる。   Further, since the packet boundary information is information indicating the position of the packet boundary in the block, the number of bits is smaller than the information indicating the position of the packet boundary in the entire memory. As a result, the rate at which the memory is occupied by the packet boundary information can be reduced, so that a large amount of packet data can be stored in the memory.

本発明は、ブロックを蓄積単位とするFIFOバッファにより、バッファを構成する。例えば、ブロックaを読み出したとき、次に読み出すブロックbの格納位置は、ブロックaの格納位置から1ブロック分移動した位置であるので、各ブロックの格納位置を記憶しておく必要はなく、1個前に読み出されたブロックの格納位置に基づいて計算できる。前記を実現するための構成として、例えば、メモリ上の各ブロックの配置において、各ブロックの領域が隣接するように配列されたリングバッファがある。前記構成では、前記リングバッファの書き込みブロック位置と読み出しブロック位置を示す2個のポインタにより、次に書き込むべきブロックのメモリ上の位置や、次に読み出すべきブロックの位置を知ることができる。したがって、各ブロックについてメモリ上での位置を記憶するテーブル等は不要である。   In the present invention, a buffer is constituted by a FIFO buffer having a block as a storage unit. For example, when the block a is read, the storage position of the block b to be read next is a position moved by one block from the storage position of the block a, so there is no need to store the storage position of each block. Calculation can be performed based on the storage position of the block read out last. As a configuration for realizing the above, for example, there is a ring buffer arranged so that the areas of the respective blocks are adjacent in the arrangement of the respective blocks on the memory. In the above configuration, the position on the memory of the block to be written next and the position of the block to be read next can be known from the two pointers indicating the write block position and the read block position of the ring buffer. Therefore, a table or the like for storing the position on the memory for each block is unnecessary.

従来例において、ジョブ用メモリのメモリ量の具体例を示します。データ用メモリのメモリ量を8MB、フレームの最小長=64byte、とすると、データ用メモリには、最大8000000/64=125000個のフレームが蓄積できる。データ用メモリのデータ幅=4byteとすると、そのアドレス数は8000000/4=2000000個になるので、前記アドレスを2進数表現するためのビット数は21となる(log2(2000000)以上の整数)。   An example of the memory capacity of the job memory in the conventional example is shown below. Assuming that the memory capacity of the data memory is 8 MB and the minimum frame length is 64 bytes, a maximum of 8000000/64 = 125000 frames can be stored in the data memory. If the data width of the data memory is 4 bytes, the number of addresses is 8000000/4 = 2000000. Therefore, the number of bits for expressing the address in binary is 21 (an integer greater than or equal to log 2 (2000000)).

したがって、蓄積したパケット1個につき1個のパケットジョブをジョブ用メモリに格納しパケットジョブにパケットを格納したデータ用メモリのアドレスを格納する場合、各パケットジョブのビット数が21bit、ジョブ用メモリへのパケットジョブの蓄積数は最大のフレーム蓄積数と同じく125000個となり、ジョブ用メモリのメモリ量は、21 bit×125000=2625000bit=328kByteとなる。   Therefore, when one packet job is stored in the job memory for each accumulated packet and the address of the data memory storing the packet is stored in the packet job, the bit number of each packet job is 21 bits, and the data is stored in the job memory. The number of stored packet jobs is 125,000, the same as the maximum number of stored frames, and the memory capacity of the job memory is 21 bits × 125000 = 22625000 bits = 328 kBytes.

一方、本発明において、ブロック長=256 Byte、ブロック管理情報=4 Byteとすると、8 MByte分のデータを蓄積するためのブロック数は8 MByte/(256Byte−4Byte)=31746個であり、パケットジョブに相当するブロック管理情報に必要となるメモリ量は、4byte×31746個=127KByteとなる。なお、ブロック内に入るパケット数は最大4個であるので、1個のブロック管理情報に、4個のパケットの境界位置を保持することができればよい。パケット境界位置をブロック先頭からのバイト数として表すと、各パケット境界情報のビット数は8bitあれば足りるため、1個のブロック管理情報は4byte以上の長さがあればよい。   On the other hand, in the present invention, assuming that the block length = 256 bytes and the block management information = 4 bytes, the number of blocks for storing 8 Mbytes of data is 8 MByte / (256 bytes−4 bytes) = 31746, and the packet job The amount of memory required for the block management information corresponding to is 4 bytes × 31746 = 127 Kbytes. Since the maximum number of packets entering a block is four, it is sufficient that one block management information can hold the boundary positions of four packets. If the packet boundary position is expressed as the number of bytes from the head of the block, the number of bits of each packet boundary information is enough to be 8 bits. Therefore, one block management information only needs to have a length of 4 bytes or more.

ジョブ用メモリのメモリ量328kByteをSRAMで実現したときのジョブ用メモリの面積は、製造プロセスにもよるが約mmである。すなわち、DRAMを回路の外部デバイスとして回路面積から除外する場合、本願によって、ジョブ用メモリ分の面積であるmmを、回路面積から削減できる。また、DRAMの面積を合わせた場合の面積削減については、本願(ブロック長=256 Byte、1ブロックの管理情報=4Byteの場合)を採用すると、DRAMは管理情報分として127KByteの増加となるが、ジョブ用メモリは不要となる。DRAMの1ビットあたりの面積はSRAMの1ビットあたりの面積の1/4とすると、管理情報分として0.8mm2のDRAMの面積増加となる。したがって、本願によって8−0.8=7.4mm2の回路面積を削減することができる。 The area of the job memory when the memory amount of 328 kByte of the job memory is realized by the SRAM is about mm although it depends on the manufacturing process. That is, when the DRAM is excluded from the circuit area as an external device of the circuit, according to the present application, mm, which is the area for the job memory, can be reduced from the circuit area. Regarding the area reduction when the areas of the DRAM are combined, if the present application (block length = 256 bytes, management information of 1 block = 4 bytes) is adopted, the DRAM will increase by 127 Kbytes as management information. Job memory is not required. If the area per bit of the DRAM is 1/4 of the area per bit of the SRAM, the area of the DRAM is increased by 0.8 mm 2 as management information. Therefore, the circuit area of 8−0.8 = 7.4 mm 2 can be reduced according to the present application.

さらに、データ用メモリとして使用されるDRAMがメモリ量によらずその消費電力がほぼ一定であるのに対して、ジョブ用メモリとして使用されるSRAMはメモリ量によって増加する。本願で管理情報分の面積増加となったときも、DRAMがメモリ量によらず一定電力であることから、DRAMで消費される電力は、従来例も本願でも同じである。本願ではジョブ用メモリは不要であるため前記に相当する消費電力である、700mWが本願の採用によって削減できる効果がある。なお、メモリの面積・電力を計算は、例えば、文献http://www2.renesas.com/process/ja/edramadvantages.htmlを参考とした。   Further, while the DRAM used as the data memory has a substantially constant power consumption regardless of the amount of memory, the SRAM used as the job memory increases with the amount of memory. Even when the area of the management information is increased in this application, the power consumed by the DRAM is the same in the conventional example and the present application because the DRAM has a constant power regardless of the amount of memory. Since no job memory is required in the present application, the power consumption equivalent to the above, 700 mW, can be reduced by adopting the present application. The memory area and power were calculated with reference to, for example, the document http://www2.renesas.com/process/en/edramadvantages.html.

このように、従来例も少ない量のメモリ(上記具体例では従来例のジョブ用メモリサイズの39%程度のメモリ量で)で、パケットジョブに相当するブロック管理情報を記憶することができる。   As described above, the block management information corresponding to the packet job can be stored in the conventional example with a small amount of memory (in the above specific example, the amount of memory is about 39% of the job memory size of the conventional example).

また、一般的には、固定長のブロックに複数のパケットデータを格納する場合、ブロック番号から当該ブロックの先頭アドレスを計算式で特定し、これら先頭アドレスに基づき、各ブロックにパケットデータを格納することができる。さらに、パケットデータが固定長であれば、ブロック内の決められたアドレスからパケットデータを格納することを前提として、ブロック内に格納したパケットデータの先頭アドレスをそれぞれ計算式で特定することも可能である。   In general, when storing a plurality of packet data in a fixed-length block, the head address of the block is specified by a calculation formula from the block number, and the packet data is stored in each block based on the head address. be able to. Furthermore, if the packet data has a fixed length, it is also possible to specify the start address of the packet data stored in the block by a calculation formula, assuming that the packet data is stored from a predetermined address in the block. is there.

しかしながら、本発明の課題とするパケットデータが可変長の場合、上記の方法では、ブロック内に格納したパケットデータの先頭アドレスを特定することはできない。したがって、前述したパケットジョブ(ジョブ情報)と同様の管理情報を、ブロックごとに別個のメモリで管理する必要があり、これらメモリの増大に伴う回路規模が大幅に増加する。
これに対して、本実施の形態にかかるパケットバッファ装置10によれば、ブロックごとに設けたブロック管理情報に、ブロック内に格納されたパケットデータの終端位置を示すパケット境界情報が含まれている。このため、このパケット境界情報に基づき、ブロック内に格納されている各パケットデータの先頭アドレスを、極めて容易に特定することができ、メモリの増大に伴う余分な回路規模の増加を抑制することも可能となる。
However, when the packet data of the present invention has a variable length, the above method cannot specify the start address of the packet data stored in the block. Therefore, it is necessary to manage the same management information as the packet job (job information) described above in a separate memory for each block, and the circuit scale increases with the increase in these memories.
On the other hand, according to the packet buffer device 10 according to the present embodiment, the block management information provided for each block includes the packet boundary information indicating the end position of the packet data stored in the block. . For this reason, the start address of each packet data stored in the block can be specified very easily based on this packet boundary information, and an increase in the extra circuit scale accompanying an increase in memory can be suppressed. It becomes possible.

[第2の実施の形態]
次に、本発明の第2の実施の形態にかかるパケットバッファ装置10について説明する。
本実施の形態にかかるパケットバッファ装置10は、図1に示した第1の実施の形態と同様の構成を有しているが、図3および図4に示した状態遷移とは一部異なる処理を行うことで、メモリ部12に蓄積されるブロックの内部構造が異なっている。
[Second Embodiment]
Next, the packet buffer device 10 according to the second embodiment of the present invention will be described.
The packet buffer device 10 according to the present embodiment has the same configuration as that of the first embodiment shown in FIG. 1, but is partially different from the state transition shown in FIGS. As a result, the internal structure of the blocks stored in the memory unit 12 is different.

図5は、第2の実施の形態にかかるメモリ部の構成例である。
本実施の形態にかかるパケットバッファ装置10において、メモリ部12は、図5に示すように、バッファ制御部11によって、固定長(Kワード、各ワードはKビット)のブロック単位でパケットを蓄積するよう制御される。
本例では、メモリ部12内のアドレスが連続するメモリ領域を、Kワードずつに区切って各々をブロックを構成し、パケットデータが入力されるごとに、アドレスの小さいブロックから順に格納する。
FIG. 5 is a configuration example of a memory unit according to the second embodiment.
In the packet buffer device 10 according to the present embodiment, as shown in FIG. 5, the memory unit 12 stores packets in block units of fixed length (K words, each word is K bits) by the buffer control unit 11. It is controlled as follows.
In this example, a memory area in the memory unit 12 where addresses are continuous is divided into K words to form blocks, and each time packet data is input, the blocks are stored in order from the smallest address.

ブロックの境界は、パケットデータの境界とは無関係に定められているため、1個のパケットデータが1個のブロック内に完全に収容される場合と、複数のブロックにまたがって収容される場合がある。
各ブロックには、パケットデータの他に、例えば1ワード分からなる固定長のブロック管理情報が含まれ、このブロック管理情報の格納位置は、各ブロック内で固定された位置が定められている。本例において、ブロック管理情報はブロックの先頭側すなわちアドレス最小側に寄せて配置される。
Since the block boundary is determined independently of the packet data boundary, there is a case where one packet data is completely accommodated in one block and a case where it is accommodated across a plurality of blocks. is there.
Each block includes, in addition to packet data, fixed-length block management information consisting of, for example, one word, and the storage position of this block management information is fixed in each block. In this example, the block management information is arranged close to the head side of the block, that is, the address minimum side.

ブロック管理情報をブロックの中で最初に読み出される位置に配置してメモリに格納すると、複数ブロックに分割格納されていないパケットデータをメモリから読み出すときと比較して、複数のブロックに分割格納されているパケットデータの場合でも、パケットデータをメモリから読み取るときのメモリの帯域利用効率を低下を回避して、分割されたパケットデータを含む複数のブロックをメモリから中断なく読み取ることが可能となる。   When the block management information is placed in the first read position in the block and stored in the memory, the packet data that is not divided and stored in multiple blocks is divided and stored in multiple blocks compared to when reading from the memory. Even in the case of packet data, it is possible to avoid a decrease in the bandwidth utilization efficiency of the memory when reading the packet data from the memory, and to read a plurality of blocks including the divided packet data from the memory without interruption.

これは、以下の動作による。ブロックの読み出し時に最初に読み出されるブロック管理情報から、ブロック内にパケット終端が含まれるか否かを判断し、パケット終端が含まれない場合は、ブロックに継続するブロックを読み出すコマンドをメモリに発行する。すなわち、ブロック管理情報をブロックの中で最初に読み出される位置に格納することで、ブロックをメモリから読み出した直後に、前記ブロック内にパケット終端が含まれるか否かを判断することができるため、パケット終端が含まれない場合に早く次のブロックの読み出しを開始できる。このため、ブロックの読み出しと次のブロックの読み出しの間の時間を最小にすることができる。   This is due to the following operations. From the block management information that is read first when reading a block, it is determined whether or not the end of the packet is included in the block. If the end of the packet is not included, a command to read the block that continues to the block is issued to the memory . That is, by storing the block management information at a position where it is first read out in the block, immediately after reading out the block from the memory, it is possible to determine whether or not the end of the packet is included in the block. When the end of the packet is not included, reading of the next block can be started early. For this reason, the time between reading of a block and reading of the next block can be minimized.

各ブロックのパケットデータ領域は、K−1個のワードで構成されたパケットデータを収容する。ここで、パケットデータの先頭バイトを含むワードにおいて、前記先頭バイトを前記ワードの先頭バイトに配置する。また、前記パケットデータの末尾バイトに続けて、所定のパケット終端パタンとする。   The packet data area of each block accommodates packet data composed of K-1 words. Here, in the word including the first byte of the packet data, the first byte is arranged in the first byte of the word. Further, a predetermined packet end pattern is set after the last byte of the packet data.

本例において、パケット終端パタンは、パケット終端バイトとパケット終端パッドパタンとから構成されている。すなわち、前記パケットデータの末尾バイトの次のバイトを、値「0」のパケット終端バイトとし、前記パケット終端バイトと次のパケットデータの先頭バイトの間、すなわち、パケット終端バイトを含むワード内でパケット終端バイトの次から前記ワードの末尾までに、各バイト値が「255」のパケット終端パッドパタンが挿入される。なお、パケット終端バイトがワードの末尾に位置する場合は、終端パッドパタンは挿入されない。また、パケットデータの末尾バイトがワード末尾にくる場合は、続くパケット終端バイトは次のワードの先頭となり、そのワードの末尾まで終端パッドパタンが挿入される。   In this example, the packet end pattern is composed of a packet end byte and a packet end pad pattern. That is, a byte next to the end byte of the packet data is set as a packet end byte having a value “0”, and a packet is included between the packet end byte and the first byte of the next packet data, that is, within a word including the packet end byte. A packet end pad pattern having a byte value of “255” is inserted from the end of the end byte to the end of the word. When the packet end byte is located at the end of the word, the end pad pattern is not inserted. When the last byte of the packet data comes to the end of the word, the subsequent packet end byte is the beginning of the next word, and the end pad pattern is inserted up to the end of the word.

前記ブロック管理情報は、パケットデータ継続フラグの1ビットと、パケットデータ領域を構成する各ワードがパケット終端バイトを含むか否かを示すK−1個の境界判定ビット列から構成される。
前記パケットデータ継続フラグは、そのブロックのパケットデータ領域を使い切っているか否かを示す。前記パケットデータ継続フラグが「1」の場合は、パケットデータ領域を使い切っている場合であり、パケットデータ領域の最後まで有効なパケットデータが格納されていることを示す。一方、前記パケットデータ継続フラグが「0」の場合は、前記領域内に含まれるパケットデータの末尾(1個のブロックに複数のパケットが収容されている場合は最後のパケットのデータ末尾)より後ろに、有効なパケットデータが格納されていないことを示す。
The block management information is composed of one bit of the packet data continuation flag and K−1 boundary determination bit strings indicating whether or not each word constituting the packet data area includes a packet end byte.
The packet data continuation flag indicates whether or not the packet data area of the block is used up. When the packet data continuation flag is “1”, it means that the packet data area is used up and that valid packet data is stored up to the end of the packet data area. On the other hand, when the packet data continuation flag is “0”, it is after the end of the packet data included in the area (the end of the data of the last packet when a plurality of packets are accommodated in one block). Indicates that valid packet data is not stored.

なお、本例では、1ワードのビット数と1ブロックに含まれるワード数が一致しているため、ブロック管理情報の1ワードは、パケットデータ継続フラグと境界判定ビット列のみから構成されることになるが、1ワードのビット数<1ブロックに含まれるワード数の場合は、ブロック管理情報を2ワード以上で構成することになる。また、1ワードのビット数>1ブロックに含まれるワード数の場合は、ブロック管理情報として、パケットデータ継続フラグと境界判定ビット列の他に、ブロック毎に所定の方法により算出したパリティを含めることや、ブロック管理情報のワード数を、パケットデータ継続フラグと境界判定ビット列のみを含む場合のワード数より大きくし、前記パリティをブロック管理情報に含めることも可能である。   In this example, since the number of bits of one word matches the number of words included in one block, one word of the block management information is composed only of a packet data continuation flag and a boundary determination bit string. However, when the number of bits of one word <the number of words included in one block, the block management information is composed of two or more words. If the number of bits in one word> the number of words included in one block, the block management information includes a parity calculated by a predetermined method for each block in addition to the packet data continuation flag and the boundary determination bit string. The number of words in the block management information can be made larger than the number of words when only the packet data continuation flag and the boundary determination bit string are included, and the parity can be included in the block management information.

[第2の実施の形態の書込動作]
次に、前述した図3を参照して、本実施の形態にかかるパケットバッファ装置10の書込動作について説明する。なお、本実施の形態にかかる読出動作は、図3の状態遷移図の一部において相違しているところがある。
[Write Operation of Second Embodiment]
Next, the write operation of the packet buffer device 10 according to the present embodiment will be described with reference to FIG. 3 described above. The read operation according to the present embodiment is different in part of the state transition diagram of FIG.

この書込動作において、次のような制御変数が用いられる。
境界判定ビットは、ワードごとに、当該ワードにおけるパケット末尾バイトの存在有無を示す変数である。
変数iは、1個のブロックデータ内に含まれるパケット末尾バイトの個数を計数するためのカウンタである。
格納位置は、パケットデータを1ワードずつ書込ブロックバッファ13A内のパケットデータ領域に格納するときの位置を指定する変数(ワードアドレス)である。
パケットデータ継続フラグは、パケットデータパケットデータ領域を使い切っているか否かを示す変数である。
In this writing operation, the following control variables are used.
The boundary determination bit is a variable indicating whether or not the packet end byte exists in the word for each word.
The variable i is a counter for counting the number of packet end bytes included in one block data.
The storage position is a variable (word address) that specifies a position when packet data is stored word by word in the packet data area in the write block buffer 13A.
The packet data continuation flag is a variable indicating whether or not the packet data packet data area is used up.

[初期化状態]
初期化状態(ステップ100)において、バッファ制御部11は、書込ブロックバッファ13Aを初期化する。この初期化処理において、バッファ制御部11は、書込ブロックバッファ13Aの全ての境界判定ビットの値を「0」とする。また、書込バッファ部13の格納位置を初期化する。これにより、格納位置は、パケットデータ領域の先頭位置にセットされる。
バッファ制御部11は、初期化状態(ステップ100)において、初期化が完了した時点で、パケットの入力を待つ、入力待ち状態(ステップ101)に遷移する。
[Initialization status]
In the initialization state (step 100), the buffer control unit 11 initializes the write block buffer 13A. In this initialization process, the buffer control unit 11 sets the values of all the boundary determination bits of the write block buffer 13A to “0”. Also, the storage position of the write buffer unit 13 is initialized. Thereby, the storage position is set at the head position of the packet data area.
In the initialization state (step 100), the buffer control unit 11 transitions to an input wait state (step 101) in which the input of a packet is waited when the initialization is completed.

[入力待ち状態]
入力待ち状態(ステップ101)において、パケットの入力があった時点、すなわち「入力あり」の場合、バッファ制御部11は、前記パケットのパケットデータを書込ブロックバッファ13Aに格納する、データ格納状態(ステップ102)に遷移する。
[Waiting for input]
In the input waiting state (step 101), when a packet is input, that is, when “input is present”, the buffer control unit 11 stores the packet data of the packet in the write block buffer 13A (data storage state ( Transition to step 102).

また、入力待ち状態(ステップ101)において、パケットの入力がなく、メモリ部12に蓄積されたブロックがあるか、または、書込バッファ部13に保持されているパケットデータがない場合、すなわち「入力なし and(メモリ蓄積あり or データ保持なし)」の場合、バッファ制御部11は、他の状態に遷移せずに、パケットの入力を待ち受ける入力待ち状態(ステップ101)に留まる。   In the input waiting state (step 101), when there is no packet input and there is a block accumulated in the memory unit 12 or there is no packet data held in the write buffer unit 13, that is, “input” In the case of “none and (with memory accumulation or no data retention)”, the buffer control unit 11 does not transition to another state but remains in an input waiting state (step 101) for waiting for packet input.

また、入力待ち状態(ステップ101)において、パケットの入力がなく、メモリ部12に蓄積されたブロックがなく、かつ、書込バッファ部13に保持されているパケットデータがある場合、すなわち「入力なし and(メモリ蓄積なし and データ保持あり)」の場合、バッファ制御部11は、1ブロック分のパケットデータが揃うのを待たずに、未満了状態のブロックをメモリ部12に書き込むため、ブロック書き込み2状態(ステップ104)に遷移する。この遷移は、入力がなくメモリ部12に蓄積されたパケットデータを出し尽くし、書込ブロックバッファ13Aに残った最後のパケットデータが出力されない状況を回避するためのものである。   In the input waiting state (step 101), when there is no packet input, there is no block stored in the memory unit 12, and there is packet data held in the write buffer unit 13, that is, “no input” In the case of “and (without memory accumulation and data retention)”, the buffer control unit 11 writes the block in the incomplete state to the memory unit 12 without waiting for packet data for one block to be prepared, so that the block write 2 Transition to the state (step 104). This transition is for avoiding a situation in which the packet data stored in the memory unit 12 without input is exhausted and the last packet data remaining in the writing block buffer 13A is not output.

[データ格納状態]
データ格納状態(ステップ102)において、バッファ制御部11は、書込ブロックバッファ13Aのうち、格納位置が示すパケットデータ領域内の位置に、入力されたパケットデータを1ワードずつ格納し、併せて、前記格納位置を1ワードずつ後ろに移動させる。なお、パケットデータの先頭バイトが、前記バイトを含むワードの先頭位置となるように、前記パケットデータをワード単位で分割する。
[Data storage status]
In the data storage state (step 102), the buffer control unit 11 stores the input packet data word by word at a position in the packet data area indicated by the storage position in the write block buffer 13A. The storage position is moved backward by one word. The packet data is divided in units of words so that the first byte of the packet data is the start position of the word including the byte.

また、データ格納状態(ステップ102)において、パケットデータが後続し、かつ、書込ブロックバッファ13Aのパケットデータ領域に空きがある場合、すなわち「パケット継続 and ブロック未満了」の場合、バッファ制御部11は、データ格納状態(ステップ102)に留まって、前記データ格納を継続する。   Further, in the data storage state (step 102), when packet data follows and the packet data area of the writing block buffer 13A has an empty space, that is, “packet continuation and block less than end”, the buffer control unit 11 Stays in the data storage state (step 102) and continues the data storage.

一方、データ格納状態(ステップ102)において、パケットデータが後続し、かつ、書込ブロックバッファ13Aのパケットデータ領域に空きがなくなった場合、すなわち「パケット継続 and ブロック満了」の場合、バッファ制御部11は、書込ブロックバッファ13Aに保持されたブロックをメモリ部12に書き込む、ブロック書き込み1状態(ステップ103)に遷移する。   On the other hand, in the data storage state (step 102), when the packet data follows and the packet data area of the writing block buffer 13A is full, that is, when “packet continuation and block expiration”, the buffer control unit 11 Changes to the block writing 1 state (step 103), in which the block held in the writing block buffer 13A is written to the memory unit 12.

また、データ格納状態(ステップ102)において、パケットデータの末尾バイトまでデータを入力し終えた場合、すなわち「パケット終了」時、バッファ制御部11は、書込ブロックバッファ13Aにパケット終端位置を格納する、パケット終端位置更新状態(ステップ105)に遷移する。   Further, in the data storage state (step 102), when the data has been input up to the last byte of the packet data, that is, at the “packet end”, the buffer control unit 11 stores the packet end position in the write block buffer 13A. , Transition to the packet end position update state (step 105).

[データ終端位置更新状態]
データ終端位置更新状態(ステップ105)において、バッファ制御部11は、データ格納状態において格納した最後のワード内に含まれるパケットデータの末尾バイトに続けて、パケット終端パタンを格納する。本例では、前記パケットデータの末尾バイトの次のバイト位置に、値「0」のパケット終端バイトを格納し、さらに、前記パケット終端バイトを含むワード内において、前記パケット終端バイトの次のバイト位置から前記ワードの末尾バイト位置までに、各バイト値が「255」のパケット終端パッドパタンを格納する。さらに、データ終端位置更新状態(ステップ105)において、バッファ制御部11は、パケット終端バイトを格納したワードに対応する境界判定ビットに「1」を格納する。
[Data end position update status]
In the data end position update state (step 105), the buffer control unit 11 stores the packet end pattern following the end byte of the packet data included in the last word stored in the data storage state. In this example, the packet end byte having the value “0” is stored in the byte position next to the end byte of the packet data, and the byte position next to the packet end byte is included in the word including the packet end byte. To the end byte position of the word, a packet end pad pattern having each byte value “255” is stored. Further, in the data end position update state (step 105), the buffer control unit 11 stores “1” in the boundary determination bit corresponding to the word storing the packet end byte.

また、データ終端位置更新状態(ステップ105)において、書込ブロックバッファ13Aのパケットデータ領域に空きがある場合、すなわち「ブロック未満了」時、バッファ制御部11は、入力待ち状態(ステップ101)に遷移する。
一方、データ終端位置更新状態(ステップ105)において、書込ブロックバッファ13Aのパケットデータ領域に空きがなくなった場合、すなわち「ブロック満了」時、バッファ制御部11は、書込ブロックバッファ13Aに保持されたブロックをメモリ部12に書き込む、ブロック書き込み2状態(ステップ104)に遷移する。
In the data end position update state (step 105), when there is an empty packet data area in the writing block buffer 13A, that is, when “less than block end”, the buffer control unit 11 enters the input waiting state (step 101). Transition.
On the other hand, in the data end position update state (step 105), when there is no more space in the packet data area of the write block buffer 13A, that is, when “block expiration” occurs, the buffer control unit 11 is held in the write block buffer 13A. The block is written to the memory unit 12, and the state transits to the block write 2 state (step 104).

[ブロック書き込み1状態]
ブロック書き込み1状態(ステップ103)において、バッファ制御部11は、書込ブロックバッファ13A内のブロック管理情報に保持されているパケットデータ継続フラグの値を「1」とし、書込ブロックバッファ13Aに保持されているブロックデータを、メモリ部12内の所定のアドレスに書き込む。
[Block write 1 status]
In the block write 1 state (step 103), the buffer control unit 11 sets the value of the packet data continuation flag held in the block management information in the write block buffer 13A to “1” and holds it in the write block buffer 13A. The written block data is written to a predetermined address in the memory unit 12.

さらに、バッファ制御部11は、書込ブロックバッファ13Aを初期化する。この初期化では、全ての境界判定ビットの値を「0」とする。また、書込バッファ部13の格納位置を初期化する。これにより、格納位置は、パケットデータ領域の先頭ワードにセットされる。その後、バッファ制御部11は、データ格納状態(ステップ102)に遷移する。   Further, the buffer control unit 11 initializes the writing block buffer 13A. In this initialization, the values of all boundary determination bits are set to “0”. Also, the storage position of the write buffer unit 13 is initialized. As a result, the storage position is set to the first word of the packet data area. Thereafter, the buffer control unit 11 transitions to a data storage state (step 102).

[ブロック書き込み2状態]
ブロック書き込み2状態(ステップ104)において、バッファ制御部11は、書込ブロックバッファ13A内に保持されているパケットデータ継続フラグの値を「0」に初期化し、書込ブロックバッファ13Aに保持されているブロックデータを、メモリ部12内の所定のアドレスに書き込む。
[Block write 2 status]
In the block write 2 state (step 104), the buffer control unit 11 initializes the value of the packet data continuation flag held in the write block buffer 13A to “0” and is held in the write block buffer 13A. The block data is written to a predetermined address in the memory unit 12.

さらに、バッファ制御部11は、書込ブロックバッファ13Aを初期化する。この初期化では、全ての境界判定ビットの値を「0」に初期化し、書込バッファ部13の格納位置を「0」に初期化する。これにより、格納位置がパケットデータ領域の先頭ワードにセットされる。その後、バッファ制御部11は、入力待ち状態(ステップ101)に遷移する。   Further, the buffer control unit 11 initializes the writing block buffer 13A. In this initialization, the values of all boundary determination bits are initialized to “0”, and the storage position of the write buffer unit 13 is initialized to “0”. As a result, the storage position is set to the first word of the packet data area. Thereafter, the buffer control unit 11 transitions to an input waiting state (step 101).

なお、以上で説明した書込動作において、ブロック書き込み1状態(ステップ103)またはブロック書き込み2状態(ステップ104)では、メモリ部12に保持しているブロックデータを書き込む処理を行うが、メモリ部12でのブロックの蓄積がなく、かつ、読出ブロックバッファ14Aにブロックの保持がない場合は、前記のようにメモリ部12に書き込むのではなく、読出ブロックバッファ14Aに格納する処理を行ってもよい。これにより、入力されたパケットが蓄積されず出力される状況において、メモリ部12への蓄積を省くことができるため、メモリ部12での消費電力の削減が可能となる。   In the writing operation described above, in the block writing 1 state (step 103) or the block writing 2 state (step 104), a process of writing block data held in the memory unit 12 is performed. If the block is not stored in the block and the block is not held in the read block buffer 14A, a process of storing in the read block buffer 14A instead of writing in the memory unit 12 as described above may be performed. As a result, in the situation where the input packet is output without being stored, the storage in the memory unit 12 can be omitted, so that the power consumption in the memory unit 12 can be reduced.

[第2の実施の形態の読出動作]
次に、図4を参照して、本実施の形態にかかるパケットバッファ装置10の読出動作について説明する。なお、本実施の形態にかかる読出動作は、図4の状態遷移図の一部において相違しているところがある。
[Read Operation of Second Embodiment]
Next, the read operation of the packet buffer device 10 according to the present embodiment will be described with reference to FIG. Note that the read operation according to the present embodiment is different in part of the state transition diagram of FIG.

この読出動作において、次のような制御変数が用いられる
データ保持有無は、読出ブロックバッファ14Aでのデータ保持あり/なしを示す変数である。
変数iは、1個のブロックデータ内に含まれるパケット末尾バイトの個数を計数するためのカウンタである。
パケット終端位置は、各パケットデータの末尾バイトの位置を示す変数であり、1個のブロックデータ内のパケットデータ領域の先頭バイトからのバイト数で表現される。
In this reading operation, the following control variables are used. Data holding / non-holding is a variable indicating whether data is held in the reading block buffer 14A.
The variable i is a counter for counting the number of packet end bytes included in one block data.
The packet end position is a variable indicating the position of the last byte of each packet data, and is represented by the number of bytes from the first byte of the packet data area in one block data.

格納位置は、パケットデータを1ワードずつ読出ブロックバッファ14A内のパケットデータ領域に格納するときの位置を指定する変数(ワードアドレス)である。
取得位置は、パケットデータを1ワードずつ読出ブロックバッファ14A内のパケットデータ領域から取得するときの位置を指定する変数(ワードアドレス)である。
パケットデータ継続フラグは、パケットデータパケットデータ領域を使い切っているか否かを示す変数である。
The storage position is a variable (word address) that specifies a position when packet data is stored word by word in the packet data area in the read block buffer 14A.
The acquisition position is a variable (word address) that specifies a position when packet data is acquired word by word from the packet data area in the read block buffer 14A.
The packet data continuation flag is a variable indicating whether or not the packet data packet data area is used up.

[初期化状態]
初期化状態(ステップ110)において、バッファ制御部11は、読出ブロックバッファ14Aを初期化する。この初期化処理において、バッファ制御部11は、データ保持有無の値をデータ保持なしに初期化する。
バッファ制御部11は、初期化状態(ステップ110)において、初期化が完了した時点で、出力指示情報の入力を待つ、入力待ち状態(ステップ111)に遷移する。
[Initialization status]
In the initialization state (step 110), the buffer control unit 11 initializes the read block buffer 14A. In this initialization process, the buffer control unit 11 initializes a value indicating whether data is retained without retaining data.
In the initialization state (step 110), the buffer control unit 11 transitions to an input waiting state (step 111) where the input of the output instruction information is waited when the initialization is completed.

[入力待ち状態]
入力待ち状態(ステップ111)において、バッファ制御部11は、出力指示情報の入力があるまで、他の状態に遷移せずに、出力指示情報の入力を待ち受ける入力待ち状態(ステップ111)に留まる。
また、入力待ち状態(ステップ111)において、出力指示情報の入力があった時点で、前記データ保持有無がデータ保持ありを示す場合、すなわち「入力あり and データ保持あり」の場合、バッファ制御部11は、データ取得状態(ステップ112)に遷移する。
[Waiting for input]
In the input waiting state (step 111), the buffer control unit 11 remains in the input waiting state (step 111) waiting for the input of the output instruction information without transitioning to another state until the output instruction information is input.
Further, in the input waiting state (step 111), when the output instruction information is input, if the data holding presence / absence indicates that there is data holding, that is, “with input and with data holding”, the buffer control unit 11 Transitions to the data acquisition state (step 112).

一方、入力待ち状態(ステップ111)において、出力指示情報の入力があった時点で、前記データ保持有無がデータ保持なしを示す場合、すなわち「入力あり and データ保持あり」の場合、バッファ制御部11は、ブロック読み出し状態(ステップ113)に遷移する。   On the other hand, in the input waiting state (step 111), when the output instruction information is input, if the data holding presence / absence indicates no data holding, that is, “with input and with data holding”, the buffer control unit 11 Transitions to the block read state (step 113).

[データ取得状態]
データ取得状態(ステップ112)において、バッファ制御部11は、読出ブロックバッファ14Aから、取得位置が示す位置から、パケットデータを1ワードずつ取得して出力し、併せて、前記取得位置を1ワードずつ後ろに移動させる。
[Data acquisition status]
In the data acquisition state (step 112), the buffer control unit 11 acquires and outputs packet data from the read block buffer 14A from the position indicated by the acquisition position one word at a time. Move back.

また、データ取得状態(ステップ112)において、バッファ制御部11は、パケット継続/終了と、残データあり/なしを判定する。
この際、前記パケット終了は、読出ブロックバッファ14Aから取得したワードに対応した境界判定ビットが「1」となる(前記ワード内にパケット終端バイトを含む)こと、すなわち、取得中のパケットデータの末尾バイトまで取得を終えたことを条件として判定する。また、パケット継続は、前記パケット終了の条件を満たさないことを条件として判定する。
Further, in the data acquisition state (step 112), the buffer control unit 11 determines whether the packet continues / ends and whether there is remaining data.
At this time, the end of the packet indicates that the boundary determination bit corresponding to the word acquired from the read block buffer 14A is “1” (including the packet end byte in the word), that is, the end of the packet data being acquired. Judgment is made on the condition that acquisition to the byte is completed. Further, the packet continuation is determined on condition that the condition for ending the packet is not satisfied.

一方、前記残データありは、前記取得位置がパケットデータ領域の最終ワード位置に達していないことであり、残データなしの条件は、前記残データありの条件を満たさないことを条件として判定する。   On the other hand, the presence of remaining data means that the acquisition position has not reached the final word position of the packet data area, and the condition of no remaining data is determined on the condition that the condition of remaining data is not satisfied.

また、データ取得状態(ステップ112)において、パケットデータの末尾バイトまでデータを取得し終えた場合、すなわち「パケット終了」時、バッファ制御部11は、前記データ保持有無の値を、以下に示す判定に基づいて更新し、その後、入力待ち状態(ステップ111)に遷移する。   Further, in the data acquisition state (step 112), when the data acquisition is completed up to the last byte of the packet data, that is, at the time of “end of packet”, the buffer control unit 11 determines the data holding presence / absence value as follows: And then transitions to an input wait state (step 111).

バッファ制御部11は、上記判定において、まず、前記取得位置がパケットデータ領域の最終ワード位置に達した場合、保持なしとする。
一方、前記取得位置がパケットデータ領域の最終ワード位置に達していない場合、かつ、パケットデータ継続フラグの値が「1」の場合は、保持ありとする。
In the above determination, the buffer control unit 11 first determines that there is no holding when the acquisition position reaches the final word position of the packet data area.
On the other hand, if the acquisition position has not reached the final word position of the packet data area and the value of the packet data continuation flag is “1”, the data is held.

また、前記取得位置がパケットデータ領域の最終ワード位置に達していない場合、かつ、パケットデータ継続フラグの値が「0」の場合、かつ、前記パケットデータ領域内にある取得済みのワードより後のワードに対応する境界判定ビットの中に「1」の値をとるものが含まれる場合、保持ありとする。
また、前記以外は、保持なしとする。
Further, when the acquisition position has not reached the final word position of the packet data area, and the value of the packet data continuation flag is “0”, and after the acquired word in the packet data area If a boundary determination bit corresponding to a word includes a value having a value of “1”, the word is held.
Other than the above, there is no holding.

また、データ取得状態(ステップ112)において、パケット継続であり、かつ、残データなしの場合、すなわち「パケット継続 and 残データなし」時、バッファ制御部11は、メモリ部12が蓄積するブロックを読み出して、読出ブロックバッファ14Aに格納する、ブロック読み出し状態(ステップ113)に遷移する。   Further, in the data acquisition state (step 112), when the packet is continuation and there is no remaining data, that is, “packet continuation and no remaining data”, the buffer control unit 11 reads out the blocks stored in the memory unit 12 Thus, a transition is made to the block read state (step 113) stored in the read block buffer 14A.

一方、データ取得状態(ステップ112)において、パケット継続であり、かつ、残データありの場合、すなわち「パケット継続 and 残データあり」時、バッファ制御部11は、データ取得状態(ステップ112)に留まって、読出ブロックバッファ14Aからパケットデータを取得して出力する。   On the other hand, in the data acquisition state (step 112), when there is packet continuation and there is remaining data, that is, “packet continuation and remaining data exists”, the buffer control unit 11 remains in the data acquisition state (step 112). The packet data is acquired from the read block buffer 14A and output.

[ブロック読み出し状態]
ブロック読み出し状態(ステップ113)において、バッファ制御部11は、メモリ部12の所定アドレスから1個のブロックを読み出して、読出ブロックバッファ14Aに前記ブロックを格納する。また、バッファ制御部11は、前記取得位置を示す変数値を、読出ブロックバッファ14A内のパケットデータ領域の先頭ワード位置を示す値に初期化するとともに、データ保持有無の値を保持ありに初期化する。
[Block read status]
In the block read state (step 113), the buffer control unit 11 reads one block from a predetermined address in the memory unit 12, and stores the block in the read block buffer 14A. In addition, the buffer control unit 11 initializes the variable value indicating the acquisition position to a value indicating the start word position of the packet data area in the read block buffer 14A, and initializes the data holding presence / absence value with holding. To do.

[第2の実施の形態の効果]
このように、本実施の形態にかかるパケットバッファ装置10は、メモリ部12の前記ブロックが、複数バイトの固定長からなるワードを単位として複数個に分割されてなり、前記パケット制御部11は、前記書込ブロックバッファ13Aに前記ブロック管理情報を格納する際、前記書込ブロックバッファ13A内の前記ワードの先頭ワードから前記ブロック管理情報を格納し、前記書込ブロックバッファ13Aに前記パケットデータを書き込む際、前記ブロック管理情報の末尾バイトを格納した前記先頭ワードの次のワードから順に格納用のワードを選択し、選択したワードに前記パケットデータを格納する際、当該ワードの先頭バイトから順に当該パケットデータの各バイトを格納するとともに、当該パケットデータの末尾バイトを格納したバイトの次のバイトから所定のパケット終端パタンを格納し、前記書込ブロックバッファ13Aに前記ブロック管理情報を格納する際、前記パケット境界情報に代えて、前記各ワードにおける前記パケットデータの末尾バイトの存在有無を示す境界判定ビット列を含む前記ブロック管理情報を格納するようにしたものである。
[Effect of the second embodiment]
Thus, in the packet buffer device 10 according to the present embodiment, the block of the memory unit 12 is divided into a plurality of words each having a fixed length of a plurality of bytes, and the packet control unit 11 When storing the block management information in the write block buffer 13A, the block management information is stored from the first word of the word in the write block buffer 13A, and the packet data is written to the write block buffer 13A When selecting the word for storage in order from the next word of the first word storing the last byte of the block management information, and storing the packet data in the selected word, the packet in order from the first byte of the word Stores each byte of data and the last byte of the packet data When a predetermined packet end pattern is stored from the byte next to the specified byte and the block management information is stored in the write block buffer 13A, the last byte of the packet data in each word instead of the packet boundary information The block management information including a boundary determination bit string indicating the presence / absence of the block is stored.

これにより、本実施の形態にかかるパケットバッファ装置10によれば、ブロック管理情報およびパケットデータを固定長のワードの整数倍とすることができ、バイト単位ではなく、より大きなワード単位での処理が可能となるため、書き込みバッファの回路を簡易化することができる。
また、境界判定ビット列をパケット境界情報としているため、ブロック先頭バイトからのバイト数を計数する必要がなくなり、パケット境界情報を生成するための回路を簡易化することができる。同様に、パケット境界情報に基づいてブロックから個々のパケットを抽出するための回路を簡易化することができる。
Thereby, according to the packet buffer device 10 according to the present embodiment, the block management information and the packet data can be set to an integer multiple of a fixed-length word, and processing in a larger word unit, not a byte unit, can be performed. This makes it possible to simplify the write buffer circuit.
Further, since the boundary determination bit string is used as packet boundary information, it is not necessary to count the number of bytes from the first byte of the block, and the circuit for generating the packet boundary information can be simplified. Similarly, a circuit for extracting individual packets from a block based on packet boundary information can be simplified.

上記の効果について、以下に説明する。
第2の実施の形態では、ブロック管理情報およびパケットデータを、固定長のワード単位で扱うが、第1の実施の形態ではバイト単位で扱う。
パケットの宛先や送信元など表す情報を含むヘッダは、パケットデータの先頭バイトを基準として決まった位置にあり、パケットに対する処理を行うとき、例えば、パケットを入出力する複数のポートを装置が備えるときパケットのヘッダの値に応じて、どのポートから出力するかを決める、複数のキューを備えるときパケットのヘッダの値に応じて、どのキューにパケットを蓄積するかを決める、など、パケットデータのヘッダの値を読み取る処理が行われる。
The above effect will be described below.
In the second embodiment, block management information and packet data are handled in units of fixed-length words, but in the first embodiment, they are handled in units of bytes.
The header containing information indicating the destination and source of the packet is at a fixed position based on the first byte of the packet data, and when processing the packet, for example, when the device has multiple ports that input and output the packet Packet data headers, such as deciding which port to output according to the header value of the packet, or deciding which queue to store packets according to the header value of the packet when multiple queues are provided The process of reading the value of is performed.

また、前記の処理では、パケットデータをバイト列ではなく、ワードの列とし、前記ワード列に対する処理として回路を構成して回路のクロック周波数を低減することが、一般的に行われる。
ここで、パケット先頭バイトが、ワード内のどのバイトにも現れる可能性があるような回路では、パケットデータのワード列からヘッダの値を読み取るとき、前記パケット先頭バイトのワード内での位置を考慮した処理が必要となる。
In the above processing, packet data is not a byte string but a word string, and a circuit is generally configured as a process for the word string to reduce the clock frequency of the circuit.
Here, in a circuit in which the packet first byte may appear in any byte in the word, the position of the packet first byte in the word is taken into account when reading the header value from the word string of the packet data. Processing is required.

一方、パケット先頭バイトが、ワード内の第1バイトのみに現れるように、整列されたパケットデータである場合は、前記の考慮は不要となり、ヘッダを処理するための回路を簡易化することができる。このため、パケット先頭バイトが、ワード内の第1バイトのみに現れるよう整列させることが、一般的に行われている。   On the other hand, when the packet head byte is packet data arranged so that it appears only in the first byte in the word, the above consideration is not necessary, and the circuit for processing the header can be simplified. . For this reason, it is common practice to align the first byte of the packet so that it appears only in the first byte in the word.

第2の実施の形態では、上記のパケット先頭バイト位置をワード内の第1バイトのみに現れるように整列されたワード列として扱う回路に適合する。
すなわち、第2の実施の形態にかかるパケットバッファ装置10が、パケット先頭バイト位置をワード内の第1バイトのみに現れるように整列されたワード列として扱う装置の後段あるいは前段にあり、装置間の信号形式が、パケット先頭バイト位置をワード内の第1バイトのみに現れるように整列されたワード列、という場合は、その信号形式を保ったまま、ブロック化してメモリに蓄積することができるので、バイト列としてパケットデータを扱う第1の実施の形態にかかるパケットバッファ装置10では必要であった信号形式の変換が不要となる。
The second embodiment is suitable for a circuit that handles the above-mentioned packet head byte position as a word string arranged so as to appear only in the first byte in the word.
That is, the packet buffer device 10 according to the second embodiment is in the subsequent stage or the previous stage of the device that handles the packet head byte position as a word string arranged so as to appear only in the first byte in the word. If the signal format is a word string aligned so that the first byte position of the packet appears only in the first byte in the word, it can be blocked and stored in the memory while maintaining the signal format. The signal format conversion required in the packet buffer device 10 according to the first embodiment, which handles packet data as a byte string, becomes unnecessary.

なお、装置間の信号に上記信号形式を用いる場合、ワード列を通信する信号線の他に、前記ワード列がパケット境界を示すか否かを示す信号が必要となる。このパケット境界信号のビット値をブロック内に格納されたワードの順に配列すると、第2の実施の形態における境界判定ビット列とすることができる。このため、第2の実施の形態で境界判定ビット列を生成してブロック管理情報を生成するための回路は、第1の実施の形態のパケット終端位置を生成するためのブロック先頭位置からパケット末尾バイトまでのバイト数を計数し、さらに、書込ブロックバッファ13Aに保持されたデータに含まれるパケット末尾バイトの個数を計数する必要がないため、簡易化できる。   When the above signal format is used for the signal between devices, a signal indicating whether or not the word string indicates a packet boundary is required in addition to the signal line for communicating the word string. If the bit values of the packet boundary signal are arranged in the order of the words stored in the block, the boundary determination bit string in the second embodiment can be obtained. For this reason, the circuit for generating the boundary determination bit string and generating the block management information in the second embodiment uses the packet end byte from the block start position for generating the packet end position in the first embodiment. This can be simplified because it is not necessary to count the number of bytes up to and the number of packet end bytes included in the data held in the write block buffer 13A.

[第3の実施の形態]
次に、図6を参照して、本発明の本実施の形態にかかるパケットバッファ装置10について説明する。図6は、第3の実施の形態にかかるパケットバッファ装置の構成を示すブロック図である。
前述した第1の実施の形態では、固定長の記憶領域からなるブロックを単位として、入力された各パケットのパケットデータを、メモリ部12で蓄積する場合を例として説明した。本実施の形態は、複数個のブロックで区画を構成し、入力された各パケットのパケットデータを、指定されたキューと対応する区画内のブロックで蓄積するようにしたものである。
[Third Embodiment]
Next, the packet buffer device 10 according to the present embodiment of the present invention will be described with reference to FIG. FIG. 6 is a block diagram illustrating a configuration of a packet buffer device according to the third embodiment.
In the first embodiment described above, the case where the packet data of each input packet is stored in the memory unit 12 is described as an example in units of blocks each including a fixed-length storage area. In this embodiment, a partition is constituted by a plurality of blocks, and packet data of each input packet is accumulated in blocks in the partition corresponding to the designated queue.

このパケットバッファ装置10は、前述の図1に示した第1の実施の形態にある、バッファ制御部11、メモリ部12、書込バッファ部13、読出バッファ部14に加えて、書込位置情報保持部21、読出位置情報保持部22、連結区画情報保持部23、空き区画情報保持部24を備えている。   This packet buffer device 10 includes write position information in addition to the buffer control unit 11, the memory unit 12, the write buffer unit 13, and the read buffer unit 14 in the first embodiment shown in FIG. A holding unit 21, a reading position information holding unit 22, a connected partition information holding unit 23, and an empty partition information holding unit 24 are provided.

書込位置情報保持部21は、各キューについての、パケットのデータをメモリに書き込み始める区画を特定する区画識別子である書込区画識別子と、前記区画内での書き込み始める位置を示す書込区画内位置情報とを保持する機能と、バッファ制御部11からキュー識別子の値を受け取って、前記キュー識別子によって特定されたキューの、書込区画識別子と書込区画内位置情報の値をバッファ制御部11に出力する機能、あるいは、バッファ制御部11からキュー識別子の値と、前記キュー識別子によって特定されたキューの、更新された書込区画識別子と書込区画内位置情報の値を受け取って、前記キューについて保持していた書込区画識別子と書込区画内位置情報の値を、前記更新された書込区画識別子と書込区画内位置情報の値に書き換える機能とを有している。これら機能は、キュー識別子の値をアドレスとし、前記アドレスによって特定されるワードに、対応する書込区画識別子の値と書込区画内位置情報の値とを保持するメモリ回路によって実現可能である。   The write position information holding unit 21 includes a write partition identifier that is a partition identifier for identifying a partition where packet data is to be written to the memory for each queue, and a write partition information indicating a position at which writing is started in the partition. The function of holding the position information and the value of the queue identifier from the buffer control unit 11, and the buffer control unit 11 receives the value of the write partition identifier and the position information in the write partition of the queue specified by the queue identifier. Or a queue identifier value and an updated write partition identifier and write partition position information value of the queue specified by the queue identifier from the buffer control unit 11, The values of the writing partition identifier and the writing partition position information held for the above are written in the updated writing partition identifier and writing partition position information values. And it has a function and a frog. These functions can be realized by a memory circuit which uses the value of the queue identifier as an address and holds the value of the corresponding write partition identifier and the value of the position information in the write partition in the word specified by the address.

読出位置情報保持部22は、各キューについての、パケットのデータをメモリから読み出し始める区画を特定する区画識別子である読出区画識別子と、前記区画内での読み出し始める位置を示す読出区画内位置情報とを保持する機能と、バッファ制御部11からキュー識別子の値を受け取って、前記キュー識別子によって特定されたキューの、読出区画識別子と読出区画内位置情報の値をバッファ制御部11に出力する機能、あるいは、バッファ制御部11からキュー識別子の値と、前記キュー識別子によって特定されたキューの、更新された読出区画識別子と読出区画内位置情報の値を受け取って、前記キューについて保持していた読出区画識別子と読出区画内位置情報の値を、前記更新された読出区画識別子と読出区画内位置情報の値に書き換える機能とを有している。これら機能は、キュー識別子の値をアドレスとし、前記アドレスによって特定されるワードに、対応する読出区画識別子の値と読出区画内位置情報の値とを保持するメモリ回路によって実現可能である。   The read position information holding unit 22 reads, for each queue, a read section identifier that is a section identifier that identifies a section from which packet data is to be read from the memory, and read section position information that indicates the position at which reading is started in the section. And a function of receiving the value of the queue identifier from the buffer control unit 11 and outputting the value of the read partition identifier and the read partition position information of the queue specified by the queue identifier to the buffer control unit 11; Alternatively, the value of the queue identifier and the updated read section identifier and the value of the position information in the read section of the queue specified by the queue identifier are received from the buffer control unit 11, and the read section held for the queue The value of the identifier and the position information in the reading section is changed to the value of the updated reading section identifier and the position information in the reading section. And a can replace function. These functions can be realized by a memory circuit that uses the value of the queue identifier as an address, and holds the value of the corresponding read partition identifier and the value of position information in the read partition in the word specified by the address.

連結区画情報保持部23は、各区画についての、前記区画に連結される区画を特定する区画識別子である連結区画識別子を保持する機能と、バッファ制御部11から区画識別子の値を受け取って、前記区画識別子によって特定された区画に連結される区画を特定する連結区画識別子の値を出力する機能、あるいは、バッファ制御部11から区画識別子の値と、前記区画識別子によって特定された区画の、更新された連結区画識別子の値を受け取って、前記区画について保持していた連結区画識別子の値を、前記更新された読出区画識別子と読出区画内位置情報の値に書き換える機能とを有している。これら機能は、区画識別子の値をアドレスとし、前記アドレスによって特定されるワードに、対応する連結区画識別子の値を保持するメモリ回路によって実現可能である。
なお、本実施の形態では、連結区画情報保持部23は、連結区画識別子の値としてMを保持することが可能であり、前記値は連結された区画がないことを意味する。
The connected partition information holding unit 23 receives, for each partition, a function of holding a connected partition identifier that is a partition identifier that identifies a partition connected to the partition, and a value of the partition identifier from the buffer control unit 11. A function of outputting a value of a connected partition identifier that specifies a partition connected to the partition specified by the partition identifier, or a value of the partition identifier from the buffer control unit 11 and an update of the partition specified by the partition identifier are updated. A function of receiving the value of the connected partition identifier and rewriting the value of the connected partition identifier held for the partition to the updated read partition identifier and the value of the position information in the read partition. These functions can be realized by a memory circuit that uses the value of the partition identifier as an address and holds the value of the linked partition identifier corresponding to the word specified by the address.
In the present embodiment, the connected partition information holding unit 23 can hold M as the value of the connected partition identifier, which means that there is no connected partition.

空き区画情報保持部24は、バッファ制御部11がパケットのデータが蓄積されていない区画を空き区画のリストとして管理するために、空き区画リストの最初の区画を特定する区画識別子である空き区画連結開始識別子と、空き区画リストの最後の区画を特定する区画識別子である空き区画連結終了識別子とを保持する機能と、バッファ制御部11に、空き区画連結開始識別子と空き区画連結終了識別子の値を出力する機能、あるいは、バッファ制御部11から、更新された空き区画連結開始識別子と空き区画連結終了識別子の値を受け取って、保持していた空き区画連結開始識別子と空き区画連結終了識別子の値を、前記更新された値に変更する機能とを有している。これら機能は、区画識別子の値をアドレスとし、前記アドレスによって特定されるワードに、対応する空き区画連結開始識別子と空き区画連結終了識別子の値を保持するメモリ回路によって実現可能である。   The free partition information holding unit 24 is a free partition concatenation that is a partition identifier that identifies the first partition of the free partition list so that the buffer control unit 11 manages a partition in which packet data is not stored as a list of free partitions. A function of holding a start identifier and a free partition connection end identifier that is a partition identifier for specifying the last partition in the free partition list, and the buffer control unit 11 are provided with values of a free partition connection start identifier and a free partition connection end identifier. The updated empty partition connection start identifier and the empty partition connection end identifier values received from the function to be output or the buffer control unit 11, and the stored empty partition connection start identifier and empty partition connection end identifier values are retained. And a function of changing to the updated value. These functions can be realized by a memory circuit which uses the value of the partition identifier as an address and holds the values of the corresponding free partition connection start identifier and the free partition connection end identifier in the word specified by the address.

図7は、メモリ部(ブロック分割)の構成例である。
メモリ部12は、図7に示すように、バッファ制御部11によって、複数の互いに重ならないアドレス範囲で区分けされ、前記区分けされた複数の区画として管理される。本実施の形態では、M個の区画に区分けされる。Mはキューの個数N以上の値をとる整数である。前記Mに対する制約は、すべてのキューに同時にパケットを蓄積可能とするために必要な制約であり、すべてのキューに同時にパケットを蓄積することが必要とされない実施形態では、前記制約は必要ない。また、メモリ部12のアドレス順に区分けしたときの各区画に割り付けられた番号を、前記区画を特定するための区画識別子とし、その値は0からM−1までの整数のうち何れかの値をとる。
FIG. 7 is a configuration example of the memory unit (block division).
As shown in FIG. 7, the memory unit 12 is divided into a plurality of non-overlapping address ranges by the buffer control unit 11, and managed as the divided plurality of partitions. In this embodiment, it is divided into M sections. M is an integer that takes a value equal to or greater than the number N of queues. The constraint on M is a constraint necessary to allow packets to be stored in all queues simultaneously, and in embodiments where it is not necessary to store packets in all queues simultaneously, the constraints are not necessary. The number assigned to each partition when the memory unit 12 is sorted in the order of addresses is used as a partition identifier for specifying the partition, and the value is any one of integers from 0 to M-1. Take.

また、各区画の内部は、複数の互いに重ならないアドレス範囲でさらに区分けされ、固定長であるKバイトのブロックで管理されており、1個の区画に最大B個のブロックを蓄積することができる。これにより、メモリ部12は、バッファ制御部11からの制御に基づき、任意の区画についてパケットデータを書き込み/読み出しする際、ブロック単位で、パケットデータをシーケンシャルで書き込み/読み出しする。   Each partition is further divided into a plurality of non-overlapping address ranges and managed by a fixed-length K-byte block, and a maximum of B blocks can be stored in one partition. . Thus, the memory unit 12 sequentially writes / reads packet data in units of blocks when writing / reading packet data for an arbitrary partition based on the control from the buffer control unit 11.

図8は、第3の実施の形態にかかるメモリ部におけるパケットデータ蓄積状態を示す説明図である。
本実施の形態では、メモリ部12のうち、アドレスが連続するメモリ領域を、Kバイトずつに区切ってB個のブロックを設け、パケットの入力順に、アドレスが小さい方のブロックから格納される。
上記Bは、各区画に含まれるブロック数であるが、Bの値は自然数であり値に制限はない。ただし、B×K×Mの値は、パケットバッファが蓄積すべきデータの全バイト数より大きくすべき値なので、BやKやMの値の範囲に定めがあり、パケットバッファが蓄積すべきデータの全バイト数が規定されている場合には、Bの取りうる範囲が前記式によって実用上制約を受ける。
FIG. 8 is an explanatory diagram of a packet data accumulation state in the memory unit according to the third embodiment.
In the present embodiment, the memory area 12 of the memory section 12 is divided into K bytes each for a memory area where addresses are continuous, and B blocks are provided. The blocks are stored in the order of packet input from the block with the smaller address.
B is the number of blocks included in each section, but the value of B is a natural number and there is no limit on the value. However, since the value of B × K × M is a value that should be larger than the total number of bytes of data to be stored in the packet buffer, the range of values of B, K, and M is determined, and the data to be stored in the packet buffer When the total number of bytes is defined, the range that B can take is practically restricted by the above equation.

なお、ある区画内のメモリ領域にデータ書き込みや読み出しを行うとき、前記区画内の位置、例えば区画先頭ワードからのワード数を、2進数として表現するポインタを使用するが、前記ポインタ値の演算(区画をFIFOとして使用するときのポインタ値更新など)において、Bを2のべき乗とすると、前記の演算回路を簡易に構成することができる。   When data is written to or read from a memory area in a certain partition, a pointer that expresses the position in the partition, for example, the number of words from the first word of the partition as a binary number, is used. In the case of updating the pointer value when the partition is used as a FIFO, etc., if B is a power of 2, the arithmetic circuit can be configured easily.

一方、上記Mの値は、キューの個数N以上の値とすべきである。M=Nのとき、各キューに1個の区画を割り当てることができるが、M<Nの場合は、区画が割り当てられないキューが生じる。
パケットバッファが蓄積すべきデータの全ビット数が規定されているとき、Mの値を大きくすれば、各区画のビット数を小さくすることができる。これにより、キューに対して割当済である区画のうち、データを記憶していない空き領域の大きさを小さくすることが可能である、これは、空き領域が、最悪で、1区画分のメモリ量程度になるためである。
On the other hand, the value of M should be equal to or greater than the number N of queues. When M = N, one partition can be assigned to each queue. However, when M <N, a queue to which no partition is assigned is generated.
When the total number of bits of data to be accumulated in the packet buffer is specified, the number of bits in each partition can be reduced by increasing the value of M. As a result, it is possible to reduce the size of the free area that does not store data among the partitions allocated to the queue. This is because it becomes about the amount.

したがって、Mを大きくすると、メモリの利用効率が向上し、必要なメモリ量を、パケットバッファが蓄積すべきデータの全ビット数に近づけることができる。この場合、各キューに区画を割り当てたものの蓄積に利用されなかったという状況が最も空きが多い状況であるため、蓄積に使用された区画数/全区画数=(M−N)/Mがメモリ利用効率に相当する値になる。
ただし、Mを大きくすると、バッファ制御部11が管理すべき区画数が増えるので、各キューの区画連結の状態を保持する連結区画情報保持部23や、空き区画を管理する空き区画情報保持部24の回路規模が増大する。つまり、メモリ利用効率を100%に近づけようとすると上記回路規模の増大が問題となるので、前記利用効率を80%から90%とする場合の指標である、M=N×5〜N×10程度が実用的な範囲である。
Therefore, when M is increased, the memory utilization efficiency is improved, and the required memory amount can be made close to the total number of bits of data to be stored in the packet buffer. In this case, since the situation where the partition is allocated to each queue but was not used for accumulation is the situation where there is the most free space, the number of partitions used for accumulation / the total number of partitions = (M−N) / M is the memory. A value corresponding to the utilization efficiency.
However, if M is increased, the number of partitions to be managed by the buffer control unit 11 increases. Therefore, a connected partition information holding unit 23 that holds the partition connection state of each queue, and a free partition information holding unit 24 that manages empty partitions. The circuit scale increases. That is, if the memory utilization efficiency approaches 100%, the increase in the circuit scale becomes a problem. Therefore, M = N × 5 to N × 10, which is an index when the utilization efficiency is changed from 80% to 90%. The degree is a practical range.

Kは1ブロックのバイト数であり、Kの値を、ブロックを記憶するメモリの1バーストでアクセスできるデータ量の整数倍とすることで、効率的なブロックの書き込み/読み出しが可能となる。1バーストあたりのデータ量は、一般的に2のべき乗の値をとるが、その値はメモリのデータ幅やバースト長に依存する。Kが大きくなると、1ブロック分のデータを保持するためのメモリ量が増大するため、書込バッファ部13と読出バッファ部14の回路規模が増大するという問題が生じる。   K is the number of bytes in one block, and by making the value of K an integer multiple of the amount of data that can be accessed in one burst of the memory storing the block, efficient writing / reading of the block becomes possible. The amount of data per burst is generally a power of 2, but this value depends on the data width and burst length of the memory. When K increases, the amount of memory for holding data for one block increases, which causes a problem that the circuit scale of the write buffer unit 13 and the read buffer unit 14 increases.

また、Kが最小パケット長よりも小さいと、パケット境界が含まれないブロックの割合が増大し、ブロック管理情報のために使用されるメモリが無駄になるという問題が生じる。
また、メモリが複数のバンクに分かれている場合は、マルチ・バンク・オペレーションによって、メモリの帯域利用効率を向上させることができるので、Kを、バーストあたりのデータ量×バンク数の整数倍とすると、1ブロックのアクセスを予め決めておいたメモリへのコマンド発行手順によって行うことで、簡単な回路でマルチ・バンク・オペレーションを実現することができる。Kの値の例は、128,256,512,1024である。
Also, if K is smaller than the minimum packet length, the ratio of blocks that do not include a packet boundary increases, causing a problem that the memory used for block management information is wasted.
In addition, when the memory is divided into a plurality of banks, the bandwidth utilization efficiency of the memory can be improved by the multi-bank operation. Therefore, if K is an integral multiple of the data amount per burst × the number of banks A multi-bank operation can be realized with a simple circuit by performing one block access by a predetermined command issuing procedure to the memory. Examples of the value of K are 128, 256, 512, and 1024.

ブロックの境界は、パケットの境界とは無関係に定められているため、1個のブロックに1個のパケットのパケットデータが完全に収容される場合と、複数のブロックにまたがって収容される場合がある。
各ブロックには、パケットデータの他に、固定長(Hバイト)のブロック管理情報が含まれ、ブロック管理情報のブロック内での位置が定められている。本例では、ブロックの先頭側すなわちアドレス最小側に寄せて配置される。
Since the block boundary is determined independently of the packet boundary, packet data of one packet is completely accommodated in one block, and cases where it is accommodated across a plurality of blocks. is there.
Each block includes, in addition to packet data, block management information having a fixed length (H bytes), and the position of the block management information in the block is determined. In this example, it is arranged close to the head side of the block, that is, the address minimum side.

また、本例では、ブロック管理情報は、パケット境界情報の他に、そのブロックのパケットデータ領域を使い切っているか否かを示す、パケットデータ継続フラグを持つ。前記パケットデータ継続フラグが「1」の場合は、パケットデータ領域を使い切っている場合であり、パケットデータ領域の最後まで有効なパケットデータが格納されていることを示す。
一方、前記パケットデータ継続フラグが「0」の場合は、前記領域内に含まれるパケットデータの末尾(1個のブロックに複数のパケットが収容されている場合は最後のパケットのデータ末尾)より後ろに、有効なパケットデータが格納されていないことを示す。
In this example, the block management information has a packet data continuation flag indicating whether or not the packet data area of the block has been used, in addition to the packet boundary information. When the packet data continuation flag is “1”, it means that the packet data area is used up and that valid packet data is stored up to the end of the packet data area.
On the other hand, when the packet data continuation flag is “0”, it is after the end of the packet data included in the area (the end of the data of the last packet when a plurality of packets are accommodated in one block). Indicates that valid packet data is not stored.

Hはブロック管理情報のバイト数である。ブロック内に入り得るパケット数分のパケット境界位置を示すパケット終端位置を含む必要がある。パケット終端位置をブロック先頭からのバイト数として表す場合は、1個のパケット終端位置は、ブロックのバイト数未満の値を表現するため、log2(K−1)以上のビット数となる。また、ブロック内のデータをバイト単位ではなくワード単位で扱う場合には、ブロック管理情報を1ワードまたは予め決められた個数のワードに収めるよう規定することで、ワード単位での扱いに整合する。   H is the number of bytes of the block management information. It is necessary to include packet end positions indicating packet boundary positions corresponding to the number of packets that can enter the block. When the packet end position is expressed as the number of bytes from the head of the block, one packet end position represents a value less than the number of bytes in the block, and therefore has a bit number equal to or greater than log2 (K-1). Further, when data in a block is handled in units of words instead of in units of bytes, it is matched with handling in units of words by defining the block management information to be stored in one word or a predetermined number of words.

さらに、ブロック管理情報がパケットデータ継続フラグを含む場合には、ブロック管理情報に加えて前記フラグ用に少なくとも1ビットを必要となる。最小パケット長が64Byteのとき、Hの値の例は、2,4,8,16であり、各々、K=128,256,512,1024に対応する。
ただし、K=512,1024の場合、パケット終端位置はブロック先頭からのバイト数ではなく、ブロック先頭からのワード数を表すと仮定している。前記により、パケット終端位置は、ブロック内のデータのバイト数を2進数として表現可能なビット数よりも少ないビット数で表現できるためである。例えば、K=512のとき、ブロック先頭からのバイト数としてパケット終端位置を規定すると8bit長となるが、ブロック先頭からの4Byte長のワード数パケット終端位置を規定すると6bit長で済む。
Further, when the block management information includes a packet data continuation flag, at least one bit is required for the flag in addition to the block management information. When the minimum packet length is 64 bytes, examples of the value of H are 2, 4, 8, and 16, corresponding to K = 128, 256, 512, and 1024, respectively.
However, in the case of K = 512, 1024, it is assumed that the packet end position represents the number of words from the block head, not the number of bytes from the block head. This is because the packet end position can be expressed by a smaller number of bits than the number of bits that can be expressed as a binary number in the block. For example, when K = 512, if the packet end position is defined as the number of bytes from the head of the block, the length is 8 bits. However, if the 4-byte length word count from the block head is defined, the packet end position is 6 bits.

パケット境界情報は、P個のパケット終端位置からなる。各パケット終端位置は、ブロックに含まれるパケットデータ末尾バイトのブロック内での位置、すなわち、パケットデータ領域の先頭バイトから前記パケットデータ末尾バイトまでのバイト数で表される。この際、パケット終端位置が「1」となる場合は、パケットデータ領域の先頭バイトがパケットデータ末尾バイトである場合である。なお、パケット終端位置が「0」の値である場合は、前記パケット終端位置が無効であることを意味し、1個のブロックに含まれるパケットデータ末尾バイトの数がP個より少ない場合に生じる。   The packet boundary information consists of P packet end positions. Each packet end position is represented by the position within the block of the last byte of packet data included in the block, that is, the number of bytes from the first byte of the packet data area to the last byte of the packet data. At this time, when the packet end position is “1”, the first byte of the packet data area is the last byte of the packet data. When the packet end position is a value of “0”, it means that the packet end position is invalid, and occurs when the number of end bytes of packet data included in one block is less than P. .

Pはブロック内に入り得るパケット数の最大値である。したがって、P≧K/最小パケット長となる。最小パケット長が64Byteのとき、Pの値の例は、P=2,4,8,16、であり、各々、K=128,256,512,1024に対応する。ただし、パケット境界位置情報はブロック先頭からのバイト数ではなくブロック先頭からのワード数を表すと仮定している。   P is the maximum number of packets that can enter a block. Therefore, P ≧ K / minimum packet length. When the minimum packet length is 64 bytes, examples of the value of P are P = 2, 4, 8, and 16, corresponding to K = 128, 256, 512, and 1024, respectively. However, it is assumed that the packet boundary position information represents the number of words from the block head, not the number of bytes from the block head.

[第3の実施の形態の書込動作]
次に、図9を参照して、本実施の形態にかかるパケットバッファ装置10において、キュー入力指示情報の入力に応じて、入力されたパケットのパケットデータを、書込ブロックバッファ13Aへワード単位で順次格納した後、ブロック単位で、メモリ部12内の対応する区画へ書き込む書込動作について説明する。図9は、第3の実施の形態にかかる書込動作を示す状態遷移図である。なお、書込動作動作のうち、ブロック書き込み1状態(ステップ203)およびブロック書き込み2状態(ステップ204)におけるブロック書込動作の詳細については、図10を参照して後述する。
[Write Operation of Third Embodiment]
Next, referring to FIG. 9, in the packet buffer device 10 according to the present embodiment, in response to the input of the queue input instruction information, the packet data of the input packet is transferred to the write block buffer 13A in units of words. A writing operation in which data is sequentially written and then written in a corresponding partition in the memory unit 12 in units of blocks will be described. FIG. 9 is a state transition diagram showing a write operation according to the third embodiment. Of the write operation, the details of the block write operation in the block write 1 state (step 203) and the block write 2 state (step 204) will be described later with reference to FIG.

この書込動作において、次のような制御変数が用いられる。
パケット終端位置は、各パケットデータの末尾バイトの位置を示す変数であり、1個のブロックデータ内のパケットデータ領域の先頭バイトからのバイト数で表現される。
変数Pは、1個のブロックデータ内に含みうるパケット数の最大値である。
変数iは、1個のブロックデータ内に含まれるパケット末尾バイトの個数を計数するためのカウンタであり、最大値P個以下の値をとる。
格納位置は、パケットデータを1バイトずつ書込ブロックバッファ13A内のパケットデータ領域に格納するときの位置を指定する変数(バイトアドレス)である。
パケットデータ継続フラグは、パケットデータ領域を使い切っているか否かを示す変数である。
In this writing operation, the following control variables are used.
The packet end position is a variable indicating the position of the last byte of each packet data, and is represented by the number of bytes from the first byte of the packet data area in one block data.
The variable P is the maximum number of packets that can be included in one block data.
The variable i is a counter for counting the number of packet end bytes included in one block data, and takes a value equal to or less than the maximum value P.
The storage position is a variable (byte address) that specifies the position when packet data is stored byte by byte in the packet data area in the write block buffer 13A.
The packet data continuation flag is a variable indicating whether or not the packet data area is used up.

[初期化状態]
パケットバッファ装置10は、電源投入後、パケットの入力を開始する前に、初期化状態(ステップ200)に遷移して、初期化処理を実行する。また、パケットバッファ装置10に正常な動作を維持することができない異常の発生をパケットバッファ装置10自身が検出した場合や、外部からのリセット要求があった場合にも、初期化が行われる。
[Initialization status]
The packet buffer device 10 transitions to the initialization state (step 200) after the power is turned on and before the packet input is started, and executes the initialization process. The initialization is also performed when the packet buffer device 10 itself detects the occurrence of an abnormality in which normal operation cannot be maintained in the packet buffer device 10 or when there is a reset request from the outside.

初期化状態(ステップ200)において、バッファ制御部11は、書込ブロックバッファ13Aを初期化する。この初期化処理において、バッファ制御部11は、M個のパケット終端位置の値を「0」に初期化するとともに、変数iの値を「0」に初期化する。また、バッファ制御部11は、書込バッファ部13の格納位置を初期化する。これにより、格納位置は、パケットデータ領域の先頭位置にセットされる。   In the initialization state (step 200), the buffer control unit 11 initializes the write block buffer 13A. In this initialization process, the buffer control unit 11 initializes the values of the M packet end positions to “0” and initializes the value of the variable i to “0”. In addition, the buffer control unit 11 initializes the storage position of the write buffer unit 13. Thereby, the storage position is set at the head position of the packet data area.

バッファ制御部11は、初期化状態(ステップ200)において、初期化が完了した時点で、パケットの入力を待つ、入力待ち状態(ステップ201)に遷移する。   In the initialization state (step 200), the buffer control unit 11 transitions to an input waiting state (step 201) where the input of the packet is waited when the initialization is completed.

[入力待ち状態]
入力待ち状態(ステップ201)において、パケットの入力があった時点で、バッファ制御部11は、パケットデータを蓄積可能か否かを判定する。この際、蓄積可否は、現在の書込区画内での書込区画内位置(ブロック)が満了であり、かつ、連結区画が連結されていない状態を蓄積不可と判定し、他の状態を蓄積可と判定する。
したがって、パケットの入力があって、パケットの蓄積が可能であった場合、すなわち「入力あり and メモリ蓄積可」の場合、バッファ制御部11は、前記パケットのパケットデータを書込ブロックバッファ13Aに格納する、データ格納状態(ステップ202)に遷移する。
[Waiting for input]
In the input waiting state (step 201), when a packet is input, the buffer control unit 11 determines whether or not packet data can be stored. At this time, whether or not storage is possible is determined by determining that the state (block) in the writing partition in the current writing partition is expired and that the connected partition is not connected cannot be stored, and storing other states. Judge that it is possible.
Therefore, when there is an input of a packet and the packet can be accumulated, that is, when “input and memory accumulation is possible”, the buffer control unit 11 stores the packet data of the packet in the write block buffer 13A. To the data storage state (step 202).

また、入力待ち状態(ステップ201)において、パケットの入力がなく、メモリ部12に蓄積されたブロックがあるか、または、書込バッファ部13に保持されているパケットデータがない場合、すなわち「入力なし and(メモリ蓄積あり or データ保持なし)」の場合、バッファ制御部11は、他の状態に遷移せずに、パケットの入力を待ち受ける入力待ち状態(ステップ201)に留まる。   In the input waiting state (step 201), when there is no packet input and there is a block accumulated in the memory unit 12, or there is no packet data held in the write buffer unit 13, that is, “input” In the case of “none and (with memory accumulation or no data retention)”, the buffer control unit 11 remains in an input waiting state (step 201) waiting for input of a packet without transitioning to another state.

書込バッファ部13は、1ブロック分のパケットデータが揃うまで、書込ブロックバッファ13A内で前記パケットデータを保持する。例えば、初期状態(空の状態)の書込ブロックバッファ13Aに、3.5ブロック分の長さのパケットデータを持つ1個のパケットが入力された場合、このパケットデータは、先頭から3個のブロックに順に分割されて、メモリ部12に書き込まれるが、ブロック1個分に満たない残り0.5ブロック分のパケットデータについては、書込ブロックバッファ13A内で、次のパケットが入力されることによって、ブロック1個分のデータが揃うのを待つことになる。   The write buffer unit 13 holds the packet data in the write block buffer 13A until packet data for one block is prepared. For example, when one packet having packet data of 3.5 blocks in length is input to the write block buffer 13A in the initial state (empty state), the packet data includes three packets from the beginning. The data is divided into blocks in order and written to the memory unit 12, but for the remaining 0.5 blocks of packet data less than one block, the next packet is input in the write block buffer 13A. Therefore, it waits for the data for one block to be prepared.

このような場合に、メモリ部12から前記パケットデータを読み出すとき、メモリ部12に蓄積された3個のブロックのデータについては読み出しが行われるが、書込ブロックバッファ13A内に残ったパケットデータについてはメモリ部12に蓄積されていないので、このままでは、メモリ部12から読み出した3個のブロックデータからパケットを再生することができない。
そこで、このような状況では、ブロック書き込み2状態(ステップ204)に遷移することによって、書込ブロックバッファ13A内に残された残りのデータを、1ブロック分のブロックデータが揃っていなくともメモリ部12に書き込むことにより、メモリ部12から1個のパケットデータを全て読み出せるようにしている。
In such a case, when the packet data is read from the memory unit 12, the data of the three blocks stored in the memory unit 12 are read, but the packet data remaining in the write block buffer 13A is read. Are not stored in the memory unit 12, the packet cannot be reproduced from the three block data read out from the memory unit 12 as it is.
Therefore, in such a situation, by making a transition to the block write 2 state (step 204), the remaining data remaining in the write block buffer 13A can be stored in the memory unit even if block data for one block is not prepared. By writing to 12, all the packet data can be read from the memory unit 12.

すなわち、入力待ち状態(ステップ201)において、パケットの入力がなく、メモリ部12に蓄積されたブロックがなく、かつ、書込バッファ部13に保持されているデータがある場合、すなわち「入力なし and(メモリ蓄積なし and データ保持あり)」の場合、バッファ制御部11は、1ブロック分のパケットデータが揃うのを待たずに、未満了状態のブロックをメモリ部12に書き込むため、ブロック書き込み2状態(ステップ204)に遷移する。この遷移は、入力がなくメモリ部12に蓄積されたパケットデータを出し尽くし、書込ブロックバッファ13Aに残った最後のデータが出力されない状況を回避するためのものである。   That is, in the input waiting state (step 201), when there is no packet input, there is no block stored in the memory unit 12, and there is data held in the write buffer unit 13, that is, “no input and In the case of “No memory storage and data retention”, the buffer control unit 11 writes the block in the incomplete state to the memory unit 12 without waiting for the packet data for one block to be prepared, so that the block write 2 state Transition to (Step 204). This transition is for avoiding a situation where the packet data accumulated in the memory unit 12 without input is exhausted and the last data remaining in the write block buffer 13A is not output.

一方、入力待ち状態(ステップ201)において、パケットの入力があって、パケットの蓄積が不可能であった場合、すなわち「入力あり and メモリ蓄積不可」の場合、バッファ制御部11は、入力パケット廃棄状態(ステップ206)に遷移し、前記パケットを蓄積せず廃棄する。   On the other hand, in the input waiting state (step 201), if there is a packet input and the packet cannot be stored, that is, if “input and memory cannot be stored”, the buffer control unit 11 discards the input packet. Transition to the state (step 206) and discard the packet without accumulating.

[入力パケット廃棄状態]
入力パケット廃棄状態(ステップ206)において、バッファ制御部11は、パケットデータの入力が終了するまで、前記状態に留まり、前記パケットデータの入力終了に応じて、入力待ち状態(ステップ201)に遷移する。これにより、パケット単位で、パケットデータを廃棄することができる。したがって、パケットデータが途中まで書き込まれた後、その後半だけが廃棄されるという不連続パケットデータの発生を回避でき、不連続パケットデータに起因するパケット読み出し時の不具合発生を抑止することが可能となる。
[Input packet discard status]
In the input packet discarding state (step 206), the buffer control unit 11 remains in the state until the input of the packet data is completed, and transitions to an input waiting state (step 201) according to the end of the input of the packet data. . Thereby, packet data can be discarded in units of packets. Therefore, it is possible to avoid the occurrence of discontinuous packet data in which only half of the packet data is discarded after the packet data has been written halfway, and it is possible to suppress the occurrence of defects at the time of packet reading caused by the discontinuous packet data. Become.

[データ格納状態]
データ格納状態(ステップ202)において、バッファ制御部11は、書込ブロックバッファ13Aのうち、格納位置が示すパケットデータ領域内の位置に、入力されたパケットデータを1バイトずつ格納し、併せて、前記格納位置を1バイトずつ後ろに移動させる。なお、パケットデータが1バイト単位で入力されるのではなく、予め定められたバイト数単位で入力される場合には、前記バイト数単位で格納と格納位置の移動を行う。
[Data storage status]
In the data storage state (step 202), the buffer control unit 11 stores the input packet data byte by byte at a position in the packet data area indicated by the storage position in the write block buffer 13A. The storage position is moved backward by 1 byte. When packet data is input not in units of 1 byte but in units of a predetermined number of bytes, storage and movement of the storage position are performed in units of the number of bytes.

また、データ格納状態(ステップ202)において、パケットデータが後続し、かつ、書込ブロックバッファ13Aのパケットデータ領域に空きがある場合、すなわち「パケット継続 and ブロック未満了」の場合、バッファ制御部11は、データ格納状態(ステップ202)に留まって、前記パケットデータの格納を継続する。   In the data storage state (step 202), when packet data follows and the packet data area of the writing block buffer 13A has a vacancy, that is, “packet continuation and block less than end”, the buffer control unit 11 Stays in the data storage state (step 202) and continues storing the packet data.

一方、データ格納状態(ステップ202)において、パケットデータが後続し、かつ、書込ブロックバッファ13Aのパケットデータ領域に空きがなくなった場合、すなわち「パケット継続 and ブロック満了」の場合、バッファ制御部11は、書込ブロックバッファ13Aに保持されたブロックデータをメモリ部12に書き込む、ブロック書き込み1状態(ステップ203)に遷移する。   On the other hand, in the data storage state (step 202), when the packet data follows and the packet data area of the writing block buffer 13A is full, that is, “packet continuation and block expiration”, the buffer control unit 11 Changes to the block writing 1 state (step 203), in which the block data held in the writing block buffer 13A is written to the memory unit 12.

また、データ格納状態(ステップ202)において、パケットデータをその末尾バイトまで書込ブロックバッファ13Aへ入力し終えた場合、すなわち「パケット終了」時、バッファ制御部11は、書込ブロックバッファ13Aにパケット終端位置を格納する、パケット終端位置更新状態(ステップ205)に遷移する。   In the data storage state (step 202), when the packet data has been input to the write block buffer 13A up to the last byte, that is, at the “packet end”, the buffer control unit 11 sends a packet to the write block buffer 13A. Transition is made to the packet end position update state (step 205) in which the end position is stored.

[データ終端位置更新状態]
データ終端位置更新状態(ステップ205)において、バッファ制御部11は、変数iの値に「1」を加算する。
さらに、バッファ制御部11は、直前のデータ格納状態(ステップ202)において、パケットデータの末尾バイトを書込ブロックバッファ13Aに格納した際、その格納位置に相当するバイト数、すなわち、前記書込ブロックバッファ13Aのパケットデータ領域先頭から前記末尾バイトまでのバイト数を、ブロック管理情報に含まれるパケット終端位置#iとして、書込ブロックバッファ13Aに格納する。
[Data end position update status]
In the data end position update state (step 205), the buffer control unit 11 adds “1” to the value of the variable i.
Further, when the last byte of the packet data is stored in the write block buffer 13A in the previous data storage state (step 202), the buffer control unit 11 stores the number of bytes corresponding to the storage position, that is, the write block The number of bytes from the beginning of the packet data area of the buffer 13A to the end byte is stored in the writing block buffer 13A as the packet end position #i included in the block management information.

データ終端位置更新状態(ステップ205)において、書込ブロックバッファ13Aのパケットデータ領域に空きがある場合、すなわち「ブロック未満了」時、バッファ制御部11は、入力待ち状態(ステップ201)に遷移する。
また、データ終端位置更新状態(ステップ205)において、書込ブロックバッファ13Aのパケットデータ領域に空きがなくなった場合、すなわち「ブロック満了」時、バッファ制御部11は、書込ブロックバッファ13Aに保持されたブロックをメモリ部12に書き込む、ブロック書き込み2状態(ステップ204)に遷移する。
In the data end position update state (step 205), when the packet data area of the writing block buffer 13A has an empty space, that is, when “less than block end”, the buffer control unit 11 transitions to an input waiting state (step 201). .
In addition, in the data end position update state (step 205), when there is no more space in the packet data area of the write block buffer 13A, that is, when “block expiration” occurs, the buffer control unit 11 is held in the write block buffer 13A. The block is written to the memory unit 12, and the state transits to the block write 2 state (step 204).

[ブロック書き込み1状態]
ブロック書き込み1状態(ステップ203)において、バッファ制御部11は、書込ブロックバッファ13A内にブロック管理情報として保持されているパケットデータ継続フラグの値を「1」とし、書込ブロックバッファ13Aに保持されているブロックデータを、メモリ部12内の所定のアドレスに書き込む。
[Block write 1 status]
In the block write 1 state (step 203), the buffer control unit 11 sets the value of the packet data continuation flag held as block management information in the write block buffer 13A to “1” and holds it in the write block buffer 13A. The written block data is written to a predetermined address in the memory unit 12.

さらに、バッファ制御部11は、書込ブロックバッファ13Aを初期化する。この初期化では、P個のパケット終端位置の値を「0」に初期化するとともに、変数iを「0」に初期化する。また、書込バッファ部13で保持する格納位置を初期化する。これにより、格納位置は、パケットデータ領域の先頭位置にセットされる。その後、バッファ制御部11は、データ格納状態(ステップ202)に遷移する。   Further, the buffer control unit 11 initializes the writing block buffer 13A. In this initialization, the values of the P packet end positions are initialized to “0” and the variable i is initialized to “0”. Further, the storage position held in the write buffer unit 13 is initialized. Thereby, the storage position is set at the head position of the packet data area. Thereafter, the buffer control unit 11 transitions to a data storage state (step 202).

[ブロック書き込み2状態]
ブロック書き込み2状態(ステップ204)において、バッファ制御部11は、書込ブロックバッファ13A内にブロック管理情報として保持されているパケットデータ継続フラグの値を「0」に初期化し、書込ブロックバッファ13Aに保持されたブロックデータを、メモリ部12内の所定のアドレスに書き込む。
[Block write 2 status]
In the block write 2 state (step 204), the buffer control unit 11 initializes the value of the packet data continuation flag held as block management information in the write block buffer 13A to “0”, and writes the write block buffer 13A. The block data held in is stored in a predetermined address in the memory unit 12.

さらに、バッファ制御部11は、書込ブロックバッファ13Aを初期化する。この初期化では、P個のパケット終端位置の値を「0」に初期化するとともに、変数iを「0」に初期化する。また、書込バッファ部13の格納位置を「0」に初期化する。これにより、格納位置がパケットデータ領域の先頭位置にセットされる。その後、バッファ制御部11は、入力待ち状態(ステップ201)に遷移する。   Further, the buffer control unit 11 initializes the writing block buffer 13A. In this initialization, the values of the P packet end positions are initialized to “0” and the variable i is initialized to “0”. Further, the storage position of the write buffer unit 13 is initialized to “0”. As a result, the storage position is set at the head position of the packet data area. Thereafter, the buffer control unit 11 transitions to an input waiting state (step 201).

なお、以上で説明した書込動作において、ブロック書き込み1状態(ステップ203)またはブロック書き込み2状態(ステップ204)では、メモリ部12に保持していたブロックデータを書き込む処理を行うが、メモリ部12でのブロックの蓄積がなく、かつ、読出バッファ部14にブロックの保持がない場合は、前記のようにメモリ部12に書き込むのではなく、読出バッファ部14に格納する処理を行ってもよい。これにより、入力されたパケットが蓄積されず出力される状況において、メモリ部12への蓄積を省くことができるため、メモリ部12での消費電力の削減が可能となる。   In the writing operation described above, in the block writing 1 state (step 203) or the block writing 2 state (step 204), a process for writing the block data held in the memory unit 12 is performed. If the block is not accumulated in the block and the read buffer unit 14 does not hold the block, a process of storing the block in the read buffer unit 14 instead of writing in the memory unit 12 as described above may be performed. As a result, in the situation where the input packet is output without being stored, the storage in the memory unit 12 can be omitted, so that the power consumption in the memory unit 12 can be reduced.

[第3の実施の形態のブロック書込動作]
次に、図10を参照して、前述した図9のブロック書き込み1状態(ステップ203)およびブロック書き込み2状態(ステップ204)において、書込ブロックバッファ13A内のブロックデータを、ブロックデータ単位で、メモリ部12内の対応する区画へ書き込むブロック書込動作について説明する。図10は、第3の実施の形態にかかるブロック書込動作を示す状態遷移図である。
[Block Write Operation of Third Embodiment]
Next, referring to FIG. 10, in the block write 1 state (step 203) and block write 2 state (step 204) of FIG. 9 described above, the block data in the write block buffer 13A is expressed in block data units. A block write operation for writing to a corresponding partition in the memory unit 12 will be described. FIG. 10 is a state transition diagram showing a block write operation according to the third embodiment.

このブロック書込動作において、次のような制御変数が用いられる。
書込区画識別子は、前記キューごと設けられて、当該キューと対応する前記パケットデータを書き込む区画を特定するための識別子である。
書込区画内位置情報は、前記キューごと設けられて、当該キューの書込区画識別子で特定される区画内における書込開始ブロック位置を示す情報である。
アドレスは、書込区画内位置情報と対応する記憶場所を示す、メモリ部12におけるアドレス値である。
変数Bは、区画内に設けられたブロックの全ブロック数である。
変数Kは、ブロック内の記憶領域の大きさを示すバイト数である。
In this block writing operation, the following control variables are used.
The write partition identifier is an identifier that is provided for each of the queues and identifies a partition in which the packet data corresponding to the queue is written.
The writing partition position information is information that is provided for each queue and indicates the writing start block position in the partition specified by the writing partition identifier of the queue.
The address is an address value in the memory unit 12 indicating a storage location corresponding to the position information in the writing section.
The variable B is the total number of blocks provided in the partition.
The variable K is the number of bytes indicating the size of the storage area in the block.

連結区画識別子は、前記区画ごと設けられて、当該区画に連結された区画を特定するための識別子である。
区画連結位置は、区画に対するパケットデータの書き込み処理中に、当該区画に対して新たな区画を連結をするための区画連結信号を出力するタイミングを特定するための、区画内における書込位置情報である。
変数Mは、メモリ部12に設けられた区画の全区画数であり、書込区画識別子の最大値に相当する。
The connected partition identifier is an identifier that is provided for each of the partitions and identifies a partition connected to the partition.
The partition connection position is write position information in the partition for specifying the timing of outputting a partition connection signal for connecting a new partition to the partition during the writing process of packet data to the partition. is there.
The variable M is the total number of partitions provided in the memory unit 12 and corresponds to the maximum value of the writing partition identifier.

[初期化状態]
パケットバッファ装置10は、電源投入後、パケットの入力を開始する前に、初期化状態(ステップ210)に遷移して、初期化処理を実行する。また、パケットバッファ装置10に正常な動作を維持することができない異常の発生をパケットバッファ装置10自身が検出した場合や、外部からのリセット要求があった場合にも、初期化が行われる。
[Initialization status]
The packet buffer device 10 transitions to the initialization state (step 210) after the power is turned on and before the packet input is started, and executes the initialization process. The initialization is also performed when the packet buffer device 10 itself detects the occurrence of an abnormality in which normal operation cannot be maintained in the packet buffer device 10 or when there is a reset request from the outside.

バッファ制御部11は、初期化状態(ステップ210)において、初期化が完了した時点で、パケットとキュー入力指示情報の入力を待つ、入力待ち状態(ステップ211)に遷移する。   In the initialization state (step 210), the buffer control unit 11 transitions to an input waiting state (step 211) in which the packet and the queue input instruction information are waited for input when the initialization is completed.

[入力待ち状態]
入力待ち状態(ステップ211)において、パケットとキュー入力指示情報の入力があった時点で、書込位置情報取得状態(ステップ212)に遷移する。前記入力がない間、バッファ制御部11は、他の状態に遷移せずに、パケットの入力を待ち受ける入力待ち状態(ステップ211)に留まる。
[Waiting for input]
In the input waiting state (step 211), when a packet and queue input instruction information are input, the state shifts to the writing position information acquisition state (step 212). While there is no input, the buffer control unit 11 stays in an input waiting state (step 211) waiting for input of a packet without making a transition to another state.

[書込位置情報取得状態]
書込位置情報取得状態(ステップ212)において、バッファ制御部11は、書込位置情報保持部21に対して、入力されたキュー入力指示情報に含まれるキュー識別子の値を出力し、パケットを蓄積するキューの、書込区画識別子(区画単位)と書込区画内位置情報(ブロック単位)の値を書込位置情報保持部21から受け取って、アドレス算出状態(ステップ213)に遷移する。
[Writing position information acquisition status]
In the write position information acquisition state (step 212), the buffer control unit 11 outputs the value of the queue identifier included in the input queue input instruction information to the write position information holding unit 21, and accumulates the packet. The value of the writing partition identifier (partition unit) and the writing partition position information (block unit) of the queue to be received is received from the writing position information holding unit 21, and the state shifts to the address calculation state (step 213).

[アドレス算出状態]
アドレス算出状態(ステップ213)において、バッファ制御部11は、書込区画識別子と書込区画内位置情報との値に基づいて、パケットデータをワード単位で書き込むときのメモリのアドレスを算出する。本実施の形態では、アドレス=書込区画識別子値×B×K+書込区画内位置情報値×K、で算出する。前記算出後、バッファ制御部11は、ブロックデータ書き込み状態(ステップ214)に遷移する。
[Address calculation status]
In the address calculation state (step 213), the buffer control unit 11 calculates a memory address when packet data is written in units of words based on the values of the write partition identifier and the write partition position information. In the present embodiment, calculation is performed using an address = writing partition identifier value × B × K + writing partition position information value × K. After the calculation, the buffer control unit 11 transitions to a block data write state (step 214).

[ブロックデータ書き込み状態]
ブロックデータ書き込み状態(ステップ214)において、バッファ制御部11は、算出されたアドレスと、書込ブロックバッファ13A内の1ブロック分のデータを、メモリ部12に出力する。
これにより、メモリ部12では、前記アドレスのメモリセルに1ブロックデータが保持される。前記出力後、以下の条件に応じて、書込区画内位置更新状態(ステップ215)、あるいは、連結区画情報取得状態(ステップ216)のいずれかに一方に遷移する。
[Block data write status]
In the block data writing state (step 214), the buffer control unit 11 outputs the calculated address and data for one block in the writing block buffer 13A to the memory unit 12.
Thereby, in the memory unit 12, one block data is held in the memory cell at the address. After the output, the state transits to either the writing partition position update state (step 215) or the linked partition information acquisition state (step 216) according to the following conditions.

上記書込区画内位置更新状態(ステップ215)への遷移条件は、書込区画内位置が未満了の場合、すなわち、書き込み中の区画への書き込みを継続して行うことができる場合であり、本実施の形態では書込区画内位置情報値<B−1が、前記条件となる。
なお、書込区画内位置情報は、書き込みを行う区画内のワードの番号にあたる。実施例では、区画先頭のブロックの番号を0としており、区画内のワード数はBなので、区画最後のワードの番号はB−1になる。また、書込区画内位置が未満了とは、書込区画内位置情報値が区画最後のブロックより手前(区画先頭側にある)ということであり、書込区画内位置情報値<B−1が、前記条件を表す式となる。
The transition condition to the writing partition position update state (step 215) is when the writing partition position is less than the end, that is, when writing to the partition being written can be continued. In the present embodiment, the write partition position information value <B-1 is the condition.
The position information in the writing section corresponds to the word number in the section where writing is performed. In the embodiment, since the number of the block at the head of the partition is 0 and the number of words in the partition is B, the number of the last word of the partition is B-1. Further, the fact that the position in the writing partition is less than that means that the position information value in the writing partition is before the last block of the partition (at the head of the partition), and the position information value in the writing partition <B−1. Is an expression representing the condition.

一方、上記連結区画情報取得状態(ステップ216)への遷移条件は、書込区画内位置が満了の場合、すなわち、書込区画内位置が最大値を超えた場合であり、本実施の形態では書込区画内位置値≧B−1が、前記条件となる。なお、書込区画内位置値はB−1が最大値となり、書込区画内位置情報値>B−1には通常ならない。
なお、区画先頭のワードの位置における書込区画内位置情報値を0と規定したとき、区画最後のブロックの位置における書込画内位置情報値はB−1となる。区画内のワード数はBであり、書込区画内位置情報値が区画内のワードを指す場合には、書込区画内位置情報値がB以上となることや負の値をとることは発生しない。
On the other hand, the transition condition to the connected partition information acquisition state (step 216) is when the position in the writing partition is expired, that is, when the position in the writing partition exceeds the maximum value. The writing partition position value ≧ B−1 is the condition. In addition, B-1 is the maximum value in the writing partition position value, and the writing partition position information value> B-1 is not normal.
When the position information value in the writing area at the position of the word at the head of the section is defined as 0, the position information value in the written image at the position of the last block in the section is B-1. If the number of words in a partition is B and the position information value in the writing partition indicates a word in the partition, the position information value in the writing partition may be greater than or equal to B or take a negative value. do not do.

[書込区画内位置更新状態]
書込区画内位置更新状態(ステップ215)において、バッファ制御部11は、書込区画内位置を書き込みを終えた位置から次の位置に更新する。本実施の形態では、書込区画内位置情報の値を+1する。この後、書込位置情報更新状態(ステップ218)に遷移する。
[Writing section update status]
In the writing partition position update state (step 215), the buffer control unit 11 updates the writing partition position from the position where writing has been completed to the next position. In the present embodiment, the value of the position information in the writing section is incremented by one. Thereafter, the state transits to the writing position information update state (step 218).

また、書込区画内位置更新状態(ステップ215)において、バッファ制御部11は、書込区画内位置情報の値が、区画連結位置の値に一致したとき、区画連結信号を生成する。前記区画連結信号を契機として、後述する区画連結に関わる状態遷移の処理により、空き区画のリストから空き区画の1つを外して、書き込み中の区画に対して保持された連結区画識別子を前記空き区画を示す値とする区画連結が行われる。   In addition, in the writing partition position update state (step 215), the buffer control unit 11 generates a partition connection signal when the value of the writing partition position information matches the value of the partition connection position. In response to the partition connection signal, one of the free partitions is removed from the list of free partitions by state transition processing related to partition connection, which will be described later, and the connected partition identifier held for the partition being written is used as the free space. Compartment concatenation is performed with a value indicating the section.

[連結区画情報取得状態]
連結区画情報取得状態(ステップ216)において、バッファ制御部11は、連結区画情報保持部23に対して、書込区画識別子の値を出力し、連結区画情報保持部23から、書き込み中の区画に連結されている区画を特定する連結区画識別子の値を入力する。その後、書込区画情報更新状態(ステップ217)へ遷移する。なお、本実施の形態では、前記連結区画識別子値としてMを入力した場合、連結されている区画がないことを意味する。
[Linked partition information acquisition status]
In the connected partition information acquisition state (step 216), the buffer control unit 11 outputs the value of the write partition identifier to the connected partition information holding unit 23, and from the connected partition information holding unit 23 to the partition being written. Enter the value of the connected partition identifier that identifies the connected partition. Thereafter, the state transits to the writing partition information update state (step 217). In this embodiment, when M is input as the connected partition identifier value, it means that there is no connected partition.

[書込区画情報更新状態]
書込区画情報更新状態(ステップ217)において、バッファ制御部11は、書込区画識別子の値を連結区画識別子の値に更新する。併せて、書込区画内位置の値を初期化する。本実施の形態では書込区画内位置の値を0に更新する。すなわち、書き込みを行う位置を、連結された区画の先頭位置に変更する。その後、書込位置情報更新状態(ステップ218)に遷移する。
[Write partition information update status]
In the write partition information update state (step 217), the buffer control unit 11 updates the value of the write partition identifier to the value of the linked partition identifier. At the same time, the value of the position in the writing section is initialized. In the present embodiment, the value of the position in the writing section is updated to zero. That is, the writing position is changed to the head position of the connected section. Thereafter, the state transits to the writing position information update state (step 218).

[書込位置情報更新状態]
書込位置情報更新状態(ステップ218)において、バッファ制御部11は、入力されたキュー入力指示情報に含まれるキュー識別子の値と、更新された書込区画識別子と書込区画内位置情報の値とを、書込位置情報保持部21に出力し、書込位置情報保持部21が保持している値を更新する。すなわち、パケットデータのメモリ部12への書き込みによって、書込区画識別子と書込区画内位置情報が更新されるが、これらの値を前記パケットデータの書き込みを完了した時点で、書込位置情報保持部21での保持値に反映させ、入力待ち状態(ステップ211)に遷移する。
[Write position information update status]
In the write position information update state (step 218), the buffer controller 11 sets the queue identifier value, the updated write partition identifier, and the write partition position information value included in the input queue input instruction information. Is output to the writing position information holding unit 21, and the value held in the writing position information holding unit 21 is updated. That is, the writing partition identifier and the writing partition position information are updated by writing the packet data to the memory unit 12, but when these packet data writing is completed, these values are retained. The state is reflected in the holding value in the unit 21 and the state shifts to an input waiting state (step 211).

[第3の実施の形態の読出動作]
次に、図11参照して、本実施の形態にかかるパケットバッファ装置10において、キュー出力指示情報の入力に応じて、指定されたキューのパケットデータを、メモリ部12内の対応する区画から、ブロック単位で読み出して読出ブロックバッファ14Aへ格納した後、読出ブロックバッファ14Aから該当するパケットデータを読み出す際の読出動作について説明する。図11は、第3の実施の形態にかかる読出動作を示す状態遷移図である。なお、読出動作のうち、ブロック読出状態(ステップ223)におけるブロック読出動作の詳細については、図12を参照して後述する。
[Read Operation of the Third Embodiment]
Next, referring to FIG. 11, in the packet buffer device 10 according to the present embodiment, in response to the input of the queue output instruction information, the packet data of the designated queue is sent from the corresponding section in the memory unit 12. A read operation when reading corresponding packet data from the read block buffer 14A after reading in block units and storing in the read block buffer 14A will be described. FIG. 11 is a state transition diagram showing a read operation according to the third embodiment. Of the read operation, details of the block read operation in the block read state (step 223) will be described later with reference to FIG.

この読出動作において、次のような制御変数が用いられる
データ保持有無は、読出ブロックバッファ14Aでのデータ保持あり/なしを示す変数である。
変数iは、1個のブロックデータ内に含まれるパケット末尾バイトの個数を計数するためのカウンタである。
変数Pは、1個のブロックデータ内に含みうるパケット数の最大値である。
パケット終端位置は、各パケットデータの末尾バイトの位置を示す変数であり、1個のブロックデータ内のパケットデータ領域の先頭バイトからのバイト数で表現される。
In this reading operation, the following control variables are used. Data holding / non-holding is a variable indicating whether data is held in the reading block buffer 14A.
The variable i is a counter for counting the number of packet end bytes included in one block data.
The variable P is the maximum number of packets that can be included in one block data.
The packet end position is a variable indicating the position of the last byte of each packet data, and is represented by the number of bytes from the first byte of the packet data area in one block data.

格納位置は、パケットデータを1バイトずつ読出ブロックバッファ14A内のパケットデータ領域に格納するときの位置を指定する変数(バイトアドレス)である。
取得位置は、パケットデータを1バイトずつ読出ブロックバッファ14A内のパケットデータ領域から取得するときの位置を指定する変数(バイトアドレス)である。
パケットデータ継続フラグは、パケットデータパケットデータ領域を使い切っているか否かを示す変数である。
The storage position is a variable (byte address) that specifies a position when packet data is stored byte by byte in the packet data area in the read block buffer 14A.
The acquisition position is a variable (byte address) that specifies a position when packet data is acquired byte by byte from the packet data area in the read block buffer 14A.
The packet data continuation flag is a variable indicating whether or not the packet data packet data area is used up.

[初期化状態]
パケットバッファ装置10は、電源投入後、パケットの出力を開始する前に、初期化状態(ステップ220)に遷移して、初期化処理を実行する。また、パケットバッファ装置10に正常な動作を維持することができない異常の発生をパケットバッファ装置10自身が検出した場合や、外部からのリセット要求があった場合にも、初期化が行われる。
[Initialization status]
The packet buffer device 10 transitions to an initialization state (step 220) after the power is turned on and before starting to output a packet, and executes an initialization process. The initialization is also performed when the packet buffer device 10 itself detects the occurrence of an abnormality in which normal operation cannot be maintained in the packet buffer device 10 or when there is a reset request from the outside.

初期化状態(ステップ220)において、バッファ制御部11は、読出ブロックバッファ14Aを初期化する。この初期化処理において、バッファ制御部11は、データ保持有無の値をデータ保持なしに初期化する。   In the initialization state (step 220), the buffer control unit 11 initializes the read block buffer 14A. In this initialization process, the buffer control unit 11 initializes a value indicating whether data is retained without retaining data.

また、この初期化において、バッファ制御部11は、M個のパケット終端位置の値を「0」に初期化するとともに、変数iの値を「0」に初期化する。また、バッファ制御部11は、読出バッファ部14の格納位置を初期化する。これにより、格納位置は、パケットデータ領域の先頭位置にセットされる。
バッファ制御部11は、初期化状態(ステップ220)において、初期化が完了した時点で、キュー出力指示情報の入力を待つ、入力待ち状態(ステップ221)に遷移する。
In this initialization, the buffer control unit 11 initializes the values of the M packet end positions to “0” and initializes the value of the variable i to “0”. Further, the buffer control unit 11 initializes the storage position of the read buffer unit 14. Thereby, the storage position is set at the head position of the packet data area.
In the initialization state (step 220), the buffer control unit 11 transitions to an input waiting state (step 221) where the input of queue output instruction information is waited when the initialization is completed.

[入力待ち状態]
入力待ち状態(ステップ221)において、バッファ制御部11は、キュー出力指示情報の入力があるまで、他の状態に遷移せずに、キュー出力指示情報の入力を待ち受ける入力待ち状態(ステップ221)に留まる。
また、入力待ち状態(ステップ221)において、キュー出力指示情報の入力があった時点で、前記データ保持有無がデータ保持ありを示す場合、すなわち「入力あり and データ保持あり」の場合、バッファ制御部11は、データ取得状態(ステップ222)に遷移する。
[Waiting for input]
In the input waiting state (step 221), the buffer control unit 11 enters an input waiting state (step 221) for waiting for the input of the queue output instruction information without transitioning to another state until the queue output instruction information is input. stay.
Further, in the input waiting state (step 221), when the queue output instruction information is input, if the data holding presence / absence indicates that there is data holding, that is, “with input and with data holding”, the buffer control unit 11 transitions to the data acquisition state (step 222).

一方、入力待ち状態(ステップ221)において、キュー出力指示情報の入力があった時点で、前記データ保持有無がデータ保持なしを示す場合、すなわち「入力あり and データ保持なし」の場合、バッファ制御部11は、ブロック読み出し状態(ステップ223)に遷移する。   On the other hand, when the queue output instruction information is input in the input waiting state (step 221), if the data holding presence / absence indicates no data holding, that is, “with input and no data holding”, the buffer control unit 11 transits to a block read state (step 223).

[データ取得状態]
データ取得状態(ステップ222)において、バッファ制御部11は、読出ブロックバッファ14Aから、取得位置が示す位置から、パケットデータを1バイトずつ取得して出力し、併せて、前記取得位置を1バイトずつ後ろに移動させる。なお、パケットデータが1バイト単位で出力するのではなく、予め定められたバイト数単位で出力する場合には、前記バイト数単位で格納と格納位置の移動を行う。
[Data acquisition status]
In the data acquisition state (step 222), the buffer control unit 11 acquires and outputs packet data byte by byte from the position indicated by the acquisition position from the read block buffer 14A, and also sets the acquisition position byte by byte. Move back. When packet data is not output in units of 1 byte but in units of a predetermined number of bytes, storage and storage position movement are performed in units of the number of bytes.

また、データ取得状態(ステップ222)において、バッファ制御部11は、パケット継続/終了と、残データあり/なし、すなわち読出ブロックバッファ14A内に取得前のパケットデータがあるか/ないかとを判定する。
この際、前記パケット終了は、読出ブロックバッファ14Aに格納されたパケット終端位置#iが示す位置に前記取得位置が達したこと、すなわち、取得中のパケットデータの末尾バイトまで取得を終えたことを条件として判定する。なお、変数iは、読出ブロックバッファ14Aに含まれるP個のパケット終端位置のうち、取得対象のパケットに対するパケット終端位置を特定する変数としても用いられる。
Further, in the data acquisition state (step 222), the buffer control unit 11 determines whether or not there is packet continuation / end and whether or not there is remaining data, that is, whether or not there is packet data before acquisition in the read block buffer 14A. .
At this time, the end of the packet indicates that the acquisition position has reached the position indicated by the packet end position #i stored in the read block buffer 14A, that is, that acquisition has been completed up to the last byte of the packet data being acquired. Judge as a condition. Note that the variable i is also used as a variable for specifying the packet end position for the acquisition target packet among the P packet end positions included in the read block buffer 14A.

また、パケット継続は、前記パケット終了の条件を満たさないことを条件として判定する。この際、パケット終端位置#iの値が「0」の場合あるいはi>Pの場合は、取得中のパケットの末尾バイトを読出ブロックバッファ14Aに含まれず後続ブロックに含まれることを意味するため、前記判定はパケット継続となる。
一方、前記残データありは、前記取得位置がパケットデータ領域の最終バイト位置に達していないことであり、残データなしの条件は、前記残データありの条件を満たさないことを条件として判定する。
Further, the packet continuation is determined on condition that the condition for ending the packet is not satisfied. At this time, if the value of the packet end position #i is “0” or i> P, it means that the last byte of the packet being acquired is not included in the read block buffer 14A but is included in the subsequent block. The determination is packet continuation.
On the other hand, the presence of remaining data means that the acquisition position has not reached the final byte position of the packet data area, and the condition of no remaining data is determined on the condition that the condition of remaining data is not satisfied.

また、データ取得状態(ステップ222)において、パケットデータの最終バイトまでデータを取得し終えた場合、すなわち「パケット終了」時、バッファ制御部11は、前記データ保持有無の値を、以下に示す判定に基づいて更新し、その後、入力待ち状態(ステップ221)に遷移する。   In the data acquisition state (step 222), when data has been acquired up to the last byte of the packet data, that is, at the time of “end of packet”, the buffer control unit 11 determines the data holding presence / absence value as follows: And then transitions to an input wait state (step 221).

バッファ制御部11は、上記判定において、まず、前記取得位置がパケットデータ領域の最終バイト位置に達した場合、データ保持有無の値を保持なしと設定する。
一方、前記取得位置がパケットデータ領域の最終バイト位置に達していない場合は、バッファ制御部11は、変数iの値に「1」を加算する。
In the above determination, when the acquisition position reaches the final byte position of the packet data area, the buffer control unit 11 first sets the data holding presence / absence value as not holding.
On the other hand, when the acquisition position has not reached the final byte position of the packet data area, the buffer control unit 11 adds “1” to the value of the variable i.

この際、変数iの更新後に、読出ブロックバッファ14Aに格納されたパケット終端位置#iの値が「0」の場合あるいはi>Pであり、かつ、パケットデータ継続フラグの値が「1」の場合、すなわち、「(i>P)or パケット終端位置[i]==0)and パケットデータ継続フラグ==1」の場合、バッファ制御部11は、データ保持有無の値を保持ありと設定する。   At this time, after updating the variable i, the value of the packet end position #i stored in the read block buffer 14A is “0” or i> P, and the value of the packet data continuation flag is “1”. In this case, that is, when “(i> P) or packet end position [i] == 0) and packet data continuation flag == 1”, the buffer control unit 11 sets a value indicating whether or not data is retained as retained. .

一方、前記パケット終端位置#iの値が「0」の場合あるいはi>Pであり、かつ、パケットデータ継続フラグの値が「0」の場合、すなわち、「(i>P)or パケット終端位置[i]==0)and パケットデータ継続フラグ==0」の場合、バッファ制御部11は、データ保持有無の値を保持なしと設定する。
また、前記以外、すなわち、前記パケット終端位置#iの値が「0」以外、かつ、i≦Pの場合、バッファ制御部11は、データ保持有無の値を保持ありと設定する。
On the other hand, when the value of the packet end position #i is “0” or i> P and the value of the packet data continuation flag is “0”, that is, “(i> P) or packet end position In the case of [i] == 0) and packet data continuation flag == 0, the buffer control unit 11 sets the data holding presence / absence value as no holding.
In addition, when the value of the packet end position #i is other than “0” and i ≦ P, the buffer control unit 11 sets the data holding / non-holding value as holding.

また、データ取得状態(ステップ222)において、パケット継続であり、かつ、残データなしの場合、すなわち「パケット継続 and 残データなし」時、バッファ制御部11は、メモリ部12が蓄積するブロックを読み出し、読出ブロックバッファ14Aに格納する、ブロック読み出し状態(ステップ223)に遷移する。   Further, in the data acquisition state (step 222), when the packet is continuation and there is no remaining data, that is, “packet continuation and no remaining data”, the buffer control unit 11 reads the blocks accumulated in the memory unit 12 Transition to the block read state (step 223) stored in the read block buffer 14A.

一方、データ取得状態(ステップ222)において、パケット継続であり、かつ、残データありの場合、すなわち「パケット継続 and 残データあり」時、バッファ制御部11は、データ取得状態(ステップ222)に留まって、読出ブロックバッファ14Aからパケットデータを取得して出力する。   On the other hand, in the data acquisition state (step 222), when there is packet continuation and there is remaining data, that is, when "packet continuation and remaining data exists", the buffer control unit 11 remains in the data acquisition state (step 222). The packet data is acquired from the read block buffer 14A and output.

[ブロック読み出し状態]
ブロック読み出し状態(ステップ223)において、バッファ制御部11は、メモリ部12の所定アドレスから1個のブロックデータを読み出して、読出ブロックバッファ14Aに前記ブロックデータを格納する。また、バッファ制御部11は、前記取得位置の値を、読出ブロックバッファ14A内のパケットデータ領域の先頭位置を示す値に初期化するとともに、前記データ保持有無の値を保持ありに初期化し、さらに、変数iの値を「1」に初期化する。
[Block read status]
In the block read state (step 223), the buffer control unit 11 reads one block data from a predetermined address of the memory unit 12, and stores the block data in the read block buffer 14A. Further, the buffer control unit 11 initializes the value of the acquisition position to a value indicating the start position of the packet data area in the read block buffer 14A, initializes the value of the data holding presence / absence with holding, , The value of the variable i is initialized to “1”.

[第3の実施の形態のブロック読出動作]
次に、図12を参照して、前述した図11のブロック読み出し状態(ステップ223)において、メモリ部12内の対応する区画から、ブロックデータを読み出して、読出ブロックバッファ14Aへ格納するブロック読出動作について説明する。図12は、第3の実施の形態にかかるブロック読出動作を示す状態遷移図である。
[Block Read Operation of Third Embodiment]
Next, referring to FIG. 12, in the block read state of FIG. 11 (step 223) described above, the block read operation for reading the block data from the corresponding partition in the memory unit 12 and storing it in the read block buffer 14A Will be described. FIG. 12 is a state transition diagram showing a block read operation according to the third embodiment.

このブロック読出動作において、次のような制御変数が用いられる。
読出区画識別子は、前記キューごと設けられて、当該キューと対応する前記パケットデータを読み出す区画を特定するための識別子である。
読出区画内位置情報は、前記キューごと設けられて、当該キューの読出区画識別子で特定される区画内における読出開始ブロック位置を示す情報である。
アドレスは、読出区画内位置情報と対応する記憶場所を示す、メモリ部12におけるアドレス値である。
In the block read operation, the following control variables are used.
The read partition identifier is provided for each of the queues, and is an identifier for specifying a partition from which the packet data corresponding to the queue is read.
The read section position information is information that is provided for each of the queues and indicates the read start block position in the section specified by the read section identifier of the queue.
The address is an address value in the memory unit 12 indicating a storage location corresponding to the position information in the reading section.

変数Bは、区画内に設けられたブロックの全ブロック数である。
変数Kは、ブロック内の記憶領域の大きさを示すバイト数である。
連結区画識別子は、前記区画ごと設けられて、当該区画に連結された区画を特定するための識別子である。
The variable B is the total number of blocks provided in the partition.
The variable K is the number of bytes indicating the size of the storage area in the block.
The connected partition identifier is an identifier that is provided for each of the partitions and identifies a partition connected to the partition.

[初期化状態]
パケットバッファ装置10は、電源投入後、パケットの出力を開始する前に、初期化状態(ステップ230)に遷移して、初期化処理を実行する。また、パケットバッファ装置10に正常な動作を維持することができない異常の発生をパケットバッファ装置10自身が検出した場合や、外部からのリセット要求があった場合にも、初期化が行われる。
バッファ制御部11は、初期化状態(ステップ230)において、初期化が完了した時点で、パケットとキュー入力指示情報の入力を待つ、入力待ち状態(ステップ231)に遷移する。
[Initialization status]
The packet buffer device 10 transitions to an initialization state (step 230) after the power is turned on and before starting to output a packet, and executes an initialization process. The initialization is also performed when the packet buffer device 10 itself detects the occurrence of an abnormality in which normal operation cannot be maintained in the packet buffer device 10 or when there is a reset request from the outside.
In the initialization state (step 230), the buffer control unit 11 transitions to an input waiting state (step 231) waiting for input of a packet and queue input instruction information when the initialization is completed.

[入力待ち状態]
入力待ち状態(ステップ231)において、バッファ制御部11は、キュー出力指示情報の入力があった時点で、読出位置情報取得状態(ステップ232)に遷移する。前記入力がない間は、他の状態に遷移せずに、キュー出力指示情報の入力を待ち受ける入力待ち状態(ステップ231)に留まる。
[Waiting for input]
In the input waiting state (step 231), the buffer control unit 11 transitions to the reading position information acquisition state (step 232) when the queue output instruction information is input. While there is no input, the state remains in the input waiting state (step 231) waiting for input of the queue output instruction information without transitioning to another state.

[読出位置情報取得状態]
読出位置情報取得状態(ステップ232)において、バッファ制御部11は、読出位置情報保持部22に対して、入力されたキュー出力指示情報に含まれるキュー識別子の値を出力し、パケットを蓄積するキューの、読出区画識別子と読出区画内位置情報の値を読出位置情報保持部22から受け取って、アドレス算出状態(ステップ233)に遷移する。
[Reading position information acquisition status]
In the read position information acquisition state (step 232), the buffer control unit 11 outputs the queue identifier value included in the input queue output instruction information to the read position information holding unit 22, and stores the packet. The read section identifier and the value of the position information in the read section are received from the read position information holding unit 22 and the state shifts to the address calculation state (step 233).

[アドレス算出状態]
アドレス算出状態(ステップ233)では、読出区画識別子と読出位置情報との値に基づいて、パケットのデータをワード単位で書き込むときのメモリのアドレスを算出する。本実施の形態では、アドレス=読出区画識別子値×B×K+読出位置情報値×K、で算出する。前記算出後、ブロックデータ読み出し状態(ステップ234)に遷移する。
[Address calculation status]
In the address calculation state (step 233), based on the values of the read section identifier and the read position information, the memory address for writing packet data in word units is calculated. In the present embodiment, the address is calculated as follows: address = read section identifier value × B × K + read position information value × K. After the calculation, the block data reading state (step 234) is entered.

[ブロックデータ読み出し状態]
ブロックデータ読み出し状態(ステップ234)において、バッファ制御部11は、算出されたアドレスをメモリ部12に出力し、前記アドレスに対応するメモリ部12内のメモリセルに保持された1ブロック分のデータをメモリ部12から読み出す。前記読み出し後、以下の条件に応じて、読出区画内位置更新状態(ステップ235)、あるいは、連結区画情報取得状態(ステップ236)のいずれかに一方に遷移する。
[Block data read status]
In the block data reading state (step 234), the buffer control unit 11 outputs the calculated address to the memory unit 12, and stores the data for one block held in the memory cell in the memory unit 12 corresponding to the address. Read from the memory unit 12. After the reading, the state transitions to either the reading section position update state (step 235) or the connected section information acquisition state (step 236) according to the following conditions.

上記読出区画内位置更新状態(ステップ235)への遷移条件は、読出区画内位置が未満了の場合、すなわち、読み出し中の区画からの読み出しを継続して行うことができる場合であり、本実施の形態では読出区画内位置情報値<B−1が、前記条件となる。なお、読出区画内位置情報は、読み出しを行う区画内のブロックの番号にあたる。本実施の形態では、区画先頭のブロックの番号を0としており、区画内のブロック数はBなので、区画最後のブロックの番号はB−1になる。また、読出区画内位置が未満了とは、読出区画内位置情報値が区画最後のブロックより手前(区画先頭側にある)ということであり、読出区画内位置情報値<B−1が、前記条件を表す式となる。   The transition condition to the reading section position update state (step 235) is when the position within the reading section is less than the end, that is, when reading from the section being read can be continuously performed. In the embodiment, the position information value in the readout section <B-1 is the condition. Note that the position information in the reading section corresponds to the block number in the section where reading is performed. In this embodiment, the number of the block at the head of the partition is 0, and the number of blocks in the partition is B, so the block number at the end of the partition is B-1. Further, the reading section position is less than that means that the reading section position information value is in front of the last block of the section (at the head of the section), and the reading section position information value <B-1 is An expression representing the condition.

一方、上記連結区画情報取得状態(ステップ236)への遷移条件は、読出区画内位置が満了の場合、すなわち、読出区画内位置が最大値を超えた場合であり、本実施の形態では、読出区画内位置情報値≧B−1が、前記条件となる。なお、読出区画内位置情報値はB−1が最大値となり、読出区画内位置情報値>B−1には通常ならない。なお、区画先頭のブロックの位置における読出区画内位置情報値を0と規定したとき、区画最後のブロックの位置における読出画内位置情報値はB−1となる。区画内のブロック数はBであり、読出区画内位置情報値が区画内のブロックを指す場合には、読出区画内位置情報値がB以上となることや負の値をとることは発生しない。   On the other hand, the transition condition to the linked section information acquisition state (step 236) is when the position within the read section is expired, that is, when the position within the read section exceeds the maximum value. The intra-compartment position information value ≧ B−1 is the condition. It should be noted that B-1 is the maximum value of the position information value in the reading section, and the position information value in the reading section is not normally larger than B-1. When the position information value in the read section at the position of the first block in the section is defined as 0, the position information value in the read image at the position of the last block in the section is B-1. When the number of blocks in a partition is B and the position information value in the read partition indicates a block in the partition, the position information value in the read partition does not exceed B or takes a negative value.

前記異常値を発生させないようにするための方法は、読出区画内位置情報値を監視しておき、値に異常が生じた場合に、装置異常等の処理(リセットなど)を行うことである。また、読出区画内位置情報値を表現する全ビットが1となるとき、読出区画内位置情報値=B−1であるように、Bの値を決める(Bを2のべき乗とすることで可能)ことで、異常値は発生しなくなる。これは、読出区画内位置情報値としてどのような値をとったとしても正常範囲に入るためである。また、読出区画内位置情報値がB−1となるときは、読出位置が区画最後のブロックに到達したことを意味する。   The method for preventing the occurrence of the abnormal value is to monitor the position information value in the reading section and perform processing such as device abnormality (reset or the like) when an abnormality occurs in the value. Further, when all the bits representing the position information value in the reading section are 1, the value of B is determined so that the position information value in the reading section = B−1 (it is possible by making B a power of 2). Therefore, the abnormal value will not occur. This is because no matter what value is taken as the position information value in the reading section, it falls within the normal range. Further, when the position information value in the reading section is B-1, it means that the reading position has reached the last block in the section.

[読出区画内位置更新状態]
読出区画内位置更新状態(ステップ235)において、バッファ制御部11は、読出区画内位置を読み出しを終えた位置から次の位置に更新する。本実施の形態で読出区画内位置の値を+1する。その後、読出位置情報更新状態(ステップ237)に遷移する。
[Reading position update status]
In the reading section position update state (step 235), the buffer control unit 11 updates the reading section position from the position where reading is completed to the next position. In the present embodiment, the value of the position in the readout section is incremented by one. Thereafter, the reading position information update state (step 237) is entered.

[連結区画情報取得状態]
連結区画情報取得状態(ステップ236)において、バッファ制御部11は、連結区画情報保持部23に対して、読出区画識別子の値を出力し、連結区画情報保持部23から、読み出し中の区画に連結されている区画を特定する連結区画識別子の値を受け取って、読出区画情報更新状態(ステップ238)に遷移する。
また、連結区画情報取得状態(ステップ236)において、バッファ制御部11は、区画解放信号を生成する。前記区画解放信号を契機として、後述する区画解放に関わる状態遷移の処理により区画を空き区画のリストに戻す区画解放が行われる。
[Linked partition information acquisition status]
In the connected partition information acquisition state (step 236), the buffer control unit 11 outputs the value of the read partition identifier to the connected partition information holding unit 23, and connects to the partition being read from the connected partition information holding unit 23. The value of the connected partition identifier that identifies the partition that has been set is received, and a transition is made to the read partition information update state (step 238).
In the connected partition information acquisition state (step 236), the buffer control unit 11 generates a partition release signal. Triggered by the partition release signal, partition release is performed to return the partition to the list of free partitions by state transition processing related to partition release described later.

[読出区画情報更新状態]
読出区画情報更新状態(ステップ238)において、バッファ制御部11は、読出区画識別子の値を連結区画識別子の値に更新する。併せて、読出区画内位置の値を初期化する。本実施の形態では読出区画内位置の値を0に更新する。すなわち、読み出しを行う位置を、連結された区画の先頭位置に変更する。この後、読出位置情報更新状態(ステップ237)へ遷移する。
[Reading section information update status]
In the read section information update state (step 238), the buffer control unit 11 updates the value of the read section identifier to the value of the connected section identifier. At the same time, the value of the position in the reading section is initialized. In this embodiment, the value of the position in the readout section is updated to 0. That is, the reading position is changed to the head position of the connected section. Thereafter, the process proceeds to the read position information update state (step 237).

[読出位置情報更新状態]
読出位置情報更新状態(ステップ237)において、バッファ制御部11は、バッファ制御部11は、読出位置情報保持部22に対して、入力されたキュー出力指示情報に含まれるキュー識別子の値と、更新された読出区画識別子と読出区画内位置情報の値とを、読出位置情報保持部22に出力し、読出位置情報保持部22が保持している値を更新する。すなわち、ブロックデータをメモリ部12から読み出すことによって、読出区画識別子と読出区画内位置情報が更新されるが、これらの値を前記ブロックデータの読み出しを完了した時点で、読出位置情報保持部22での保持値に反映させ、入力待ち状態(ステップ231)に遷移する。
[Reading position information update status]
In the read position information update state (step 237), the buffer control unit 11 updates the read position information holding unit 22 with the value of the queue identifier included in the input queue output instruction information, and the update. The read section identifier and the value of the position information in the read section are output to the read position information holding unit 22, and the value held in the read position information holding unit 22 is updated. That is, reading the block data from the memory unit 12 updates the reading section identifier and the reading section position information. When the reading of the block data is completed, these values are read by the reading position information holding unit 22. The state is reflected in the stored value, and a transition is made to the input wait state (step 231).

[第3の実施の形態の区画連結動作]
次に、図13を参照して、本実施の形態にかかるパケットバッファ装置10の区画連結動作について説明する。図13は、区画連結動作を示す状態遷移図である。前述した図10の書込区画内位置更新状態(ステップ215)において、区画連結信号が生成された場合、バッファ制御部11は、図13の状態遷移に基づいて、区画連結動作を実行する。
[Partition Linking Operation of Third Embodiment]
Next, with reference to FIG. 13, the partition connection operation of the packet buffer device 10 according to the present embodiment will be described. FIG. 13 is a state transition diagram showing the partition connection operation. When the partition connection signal is generated in the writing partition position update state (step 215) of FIG. 10 described above, the buffer control unit 11 executes the partition connection operation based on the state transition of FIG.

[初期化状態]
パケットバッファ装置10は、電源投入後、パケットの出力を開始する前に、初期化状態(ステップ240)に遷移して、初期化処理を実行する。また、パケットバッファ装置10に正常な動作を維持することができない異常の発生をパケットバッファ装置10自身が検出した場合や、外部からのリセット要求があった場合にも、初期化が行われる。
[Initialization status]
The packet buffer device 10 transitions to an initialization state (step 240) after the power is turned on and before starting to output a packet, and executes an initialization process. The initialization is also performed when the packet buffer device 10 itself detects the occurrence of an abnormality in which normal operation cannot be maintained in the packet buffer device 10 or when there is a reset request from the outside.

初期化状態(ステップ240)において、バッファ制御部11は、連結区画情報保持部23と空き区画情報保持部24に対して、全区画を空き区画リストに加える初期化を行う。本実施の形態では、空き区画情報保持部24に空き区画連結開始識別子の値として「0」を、空き区画連結終了識別子の値としてM−1を出力することで、空き区画情報保持部24が保持する空き区画連結開始識別子と空き区画連結終了識別子を初期化する。   In the initialization state (step 240), the buffer control unit 11 performs initialization to add all partitions to the free partition list for the linked partition information holding unit 23 and the free partition information holding unit 24. In this embodiment, the empty partition information holding unit 24 outputs “0” as the value of the empty partition connection start identifier and M−1 as the value of the empty partition connection end identifier. The empty partition connection start identifier and the empty partition connection end identifier to be held are initialized.

さらに、バッファ制御部11は、連結区画情報保持部23に、全区画識別子について、連結区画識別子の値として前記区画識別子+1を出力することで、連結区画情報保持部23が保持する各区画識別子(0〜M−1)に対する連結区画識別子[m](m=0〜M−1)の値を初期化する。
バッファ制御部11は、初期化状態(ステップ240)において、初期化が完了した時点で、区画連結信号を待つ、区画連結信号待ち状態(ステップ241)に遷移する。
Furthermore, the buffer control unit 11 outputs the partition identifier +1 as the value of the connected partition identifier for all partition identifiers to the connected partition information holding unit 23, so that each partition identifier held by the connected partition information holding unit 23 ( The value of the connected partition identifier [m] (m = 0 to M−1) for 0 to M−1) is initialized.
In the initialization state (step 240), the buffer control unit 11 transitions to a partition connection signal waiting state (step 241), which waits for a partition connection signal when initialization is completed.

[区画連結信号待ち状態]
区画連結信号待ち状態(ステップ241)において、バッファ制御部11は、区画連結信号があった時点で、空き区画情報取得状態(ステップ242)に遷移する。前記信号がない間は遷移しない。なお、区画連結信号があった時点での、バッファ制御部11のパケットデータ書込の対象となっている区画を特定する書込区画識別子の値を保持しておく。
[Block connection signal waiting state]
In the partition connection signal waiting state (step 241), the buffer control unit 11 transitions to the free partition information acquisition state (step 242) when there is a partition connection signal. There is no transition while the signal is not present. It should be noted that the value of the write partition identifier for specifying the partition that is the target of packet data writing of the buffer control unit 11 at the time when the partition connection signal is received is held.

[空き区画情報取得状態]
空き区画情報取得状態(ステップ242)において、バッファ制御部11は、空き区画情報保持部24から、空き区画連結開始識別子の値を入力する。前記入力後、以下の条件に応じて、未連結状態(ステップ243)、あるいは、空き区画取得状態(ステップ244)のいずれかに一方に遷移する。
[Free partition information acquisition status]
In the free partition information acquisition state (step 242), the buffer control unit 11 inputs the value of the free partition connection start identifier from the free partition information holding unit 24. After the input, the state transitions to either the unconnected state (step 243) or the empty partition acquisition state (step 244) according to the following conditions.

上記未連結状態(ステップ243)への遷移条件は空き区画なしの場合であり、本実施の形態では上記取得した空き区画連結開始識別子の値がMの場合である。
一方、上記空き区画取得状態(ステップ244)への遷移条件は空き区画ありの場合であり、本実施の形態では、上記取得した空き区画連結開始識別子の値が有効な区画識別子の範囲(0からM−1までの整数)にある場合である。
The transition condition to the unconnected state (step 243) is when there is no empty partition, and in this embodiment, the value of the acquired empty partition connection start identifier is M.
On the other hand, the transition condition to the empty partition acquisition state (step 244) is a case where there is an empty partition. In this embodiment, the acquired empty partition connection start identifier value is a valid partition identifier range (from 0 This is the case of an integer up to M-1.

[空き区画取得状態]
空き区画取得状態(ステップ244)において、バッファ制御部11は、連結区画情報保持部23に対して、空き区画情報取得状態(ステップ242)で空き区画情報保持部24から取得した空き区画連結開始識別子の値を区画識別子として出力し、連結区画情報保持部23から、前記区画識別子に連結されている区画を特定する連結区画識別子の値を入力する。さらに、空き区画情報保持部24に対して、空き区画連結開始識別子の値を、前記入力した連結区画識別子の値に更新する。
[Free partition acquisition status]
In the free partition acquisition state (step 244), the buffer control unit 11 sends the free partition connection start identifier acquired from the free partition information storage unit 24 in the free partition information acquisition state (step 242) to the connected partition information storage unit 23. Is output as a partition identifier, and a connected partition identifier value for specifying a partition connected to the partition identifier is input from the connected partition information holding unit 23. Further, the empty partition connection start identifier value is updated to the input connected partition identifier value for the empty partition information holding unit 24.

なお、前記入力した連結区画識別子の値が、連結されている区画がないことを意味する連結区画識別子の値である場合は、さらに、空き区画情報保持部24に対して、空き区画連結終了識別子の値を、連結されている区画がないことを意味する連結区画識別子の値に更新する。本実施の形態では、前記連結されている区画がないことを意味する連結区画識別子の値はMである。その後、連結更新状態(ステップ245)に遷移する。これにより、空き区画のリストから1つの区画を取り外したことになる。   When the input connected partition identifier value is a connected partition identifier value indicating that there is no connected partition, the empty partition connection end identifier is further transmitted to the empty partition information holding unit 24. Is updated to the value of the connected partition identifier, which means that there is no connected partition. In the present embodiment, the value of the connected partition identifier that means that there is no connected partition is M. Thereafter, the state transits to a linked update state (step 245). As a result, one partition is removed from the list of free partitions.

[連結更新状態]
連結更新状態(ステップ245)において、バッファ制御部11は、連結区画情報保持部23に対して、区画連結信号があった時点で保持した書込区画識別子の値と、空き区画情報取得状態(ステップ242)で空き区画情報保持部24から取得した空き区画連結開始識別子の値とを出力することで、前記書込区画の連結区画識別子の値を、前記空き区画連結開始識別子の値へと書き換える。
これにより、書込が満了を向える(書込区画内位置が満了する予定の)区画に、空き区画のリストから取り外した1つの区画を連結したことになる。その後、区画連結信号待ち状態(ステップ241)に遷移する。
[Consolidated update status]
In the concatenated update state (step 245), the buffer control unit 11 instructs the concatenated partition information holding unit 23 to store the value of the write partition identifier held when the partition concatenation signal is received and the free partition information acquisition state (step In 242), the value of the empty partition connection start identifier acquired from the empty partition information holding unit 24 is output, so that the value of the connected partition identifier of the writing partition is rewritten to the value of the empty partition connection start identifier.
As a result, one partition removed from the list of empty partitions is connected to the partition whose writing is about to expire (the position in the writing partition is scheduled to expire). Thereafter, the state transits to a partition connection signal waiting state (step 241).

[未連結状態]
未連結状態(ステップ243)において、バッファ制御部11は、連結区画情報保持部23に対して、区画連結信号があった時点で保持した書込区画識別子の値と、連結されている区画がないことを意味する連結区画識別子の値を出力し、前記書込区画の連結区画識別子の値を、連結されている区画がないことを意味する連結区画識別子の値へと書き換え、区画連結信号待ち状態(ステップ241)に遷移する。本実施の形態では、前記連結されている区画がないことを意味する連結区画識別子の値はMである。
[Unconnected state]
In the unconnected state (step 243), the buffer control unit 11 does not have a partition connected with the value of the write partition identifier held when the partition connection signal is given to the connected partition information holding unit 23. A connected partition identifier value indicating that the write partition is connected, and the connected partition identifier value of the writing partition is rewritten to a connected partition identifier value indicating that there is no connected partition. Transition to (Step 241). In the present embodiment, the value of the connected partition identifier that means that there is no connected partition is M.

[第3の実施の形態の区画解放動作]
次に、図14を参照して、本実施の形態にかかるパケットバッファ装置10の区画解放動作について説明する。図14は、区画解放動作を示す状態遷移図である。前述した図12の連結区画情報取得状態(ステップ236)において、区画解放信号が生成された場合、バッファ制御部11は、図14の状態遷移に基づいて、区画解放動作を実行する。
[Partition release operation of the third embodiment]
Next, the partition release operation of the packet buffer device 10 according to the present embodiment will be described with reference to FIG. FIG. 14 is a state transition diagram showing the partition release operation. When the partition release signal is generated in the connected partition information acquisition state (step 236) of FIG. 12 described above, the buffer control unit 11 executes the partition release operation based on the state transition of FIG.

[初期化状態]
パケットバッファ装置10は、電源投入後、パケットの出力を開始する前に、初期化状態(ステップ250)に遷移して、初期化処理を実行する。また、パケットバッファ装置10に正常な動作を維持することができない異常の発生をパケットバッファ装置10自身が検出した場合や、外部からのリセット要求があった場合にも、初期化が行われる。
バッファ制御部11は、初期化状態(ステップ250)において、初期化が完了した時点で、区画解放信号を待つ、区画解放信号待ち状態(ステップ251)に遷移する。
[Initialization status]
The packet buffer device 10 transitions to the initialization state (step 250) after the power is turned on and before starting the output of the packet, and executes the initialization process. The initialization is also performed when the packet buffer device 10 itself detects the occurrence of an abnormality in which normal operation cannot be maintained in the packet buffer device 10 or when there is a reset request from the outside.
When the initialization is completed in the initialization state (step 250), the buffer control unit 11 transitions to a partition release signal wait state (step 251) waiting for the partition release signal.

[区画解放信号待ち状態]
区画解放信号待ち状態(ステップ251)において、区画解放信号があった時点で、空き区画情報取得状態(ステップ252)に遷移する。前記信号がない間は遷移しない。なお、区画解放信号があった時点での、バッファ制御部11のパケットデータ読出の対象となっている区画を特定する読出区画識別子の値を保持しておく。
[Partition release signal waiting state]
When there is a partition release signal in the partition release signal waiting state (step 251), the state transits to the free partition information acquisition state (step 252). There is no transition while the signal is not present. It should be noted that the value of the read partition identifier for specifying the partition that is the target of packet data reading by the buffer control unit 11 at the time when the partition release signal is received is held.

[空き区画情報取得状態]
空き区画情報取得状態(ステップ252)において、バッファ制御部11は、空き区画情報保持部24から、空き区画連結終了識別子の値を受け取って、空き区画返却状態(ステップ253)に遷移する。
[Free partition information acquisition status]
In the free partition information acquisition state (step 252), the buffer control unit 11 receives the value of the free partition connection end identifier from the free partition information holding unit 24, and transitions to the free partition return state (step 253).

[空き区画返却状態]
空き区画返却状態(ステップ253)において、バッファ制御部11は、連結区画情報保持部23に対して、区画解放信号があった時点で保持した読出区画識別子の値と、連結されている区画がないことを意味する連結区画識別子の値を出力し、前記読出区画識別子の値によって特定される区画の連結区画識別子の値を、連結されている区画がないことを意味する連結区画識別子の値へと書き換える。本実施の形態では、前記連結されている区画がないことを意味する連結区画識別子の値はMである。さらに、連結区画情報保持部23に対して、空き区画情報取得状態(ステップ252)で入力した空き区画連結終了識別子の値と、区画解放信号があった時点で保持した読出区画識別子の値とを出力し、前記空き区画連結終了識別子によって特定される
[Free space return status]
In the empty partition return state (step 253), the buffer controller 11 instructs the connected partition information holding unit 23 that there is no connected partition and the value of the read partition identifier held when the partition release signal is received. The value of the connected partition identifier meaning that the connected partition identifier value of the partition specified by the read partition identifier value is changed to the value of the connected partition identifier meaning that there is no connected partition. rewrite. In the present embodiment, the value of the connected partition identifier that means that there is no connected partition is M. Furthermore, the value of the empty partition connection end identifier input in the empty partition information acquisition state (step 252) and the value of the read partition identifier held when the partition release signal is received are given to the connected partition information holding unit 23. Output and specified by the empty partition connection end identifier

区画の連結区画識別子の値を、前記読出区画識別子の値へと書き換える。ただし、空き区画連結終了識別子の値が、連結されている区画がないことを意味する連結区画識別子の値であった場合は、前記書き換えを行わない。これらにより、読出が満了した区画を空き区画のリストの最後の区画に連結したことになる。前記の後、空き区画更新状態(ステップ254)に遷移する。   The value of the connected partition identifier of the partition is rewritten to the value of the read partition identifier. However, when the value of the empty partition connection end identifier is a value of a connected partition identifier that means that there is no connected partition, the rewriting is not performed. As a result, the section whose reading has been completed is connected to the last section in the list of free sections. After the above, a transition is made to the empty partition update state (step 254).

[空き区画更新状態]
空き区画更新状態(ステップ254)では、バッファ制御部11は、空き区画情報保持部24に対して、空き区画連結終了識別子の値を、区画解放信号があった時点で保持した読出区画識別子の値に更新する。ただし、空き区画情報取得状態(ステップ252)で入力した空き区画連結終了識別子の値が、連結されている区画がないことを意味する連結区画識別子の値であった場合は、前記に加えて、空き区画情報保持部24に対して、空き区画連結開始識別子の値を、区画解放信号があった時点で保持した読出区画識別子の値に更新する。その後、区画解放信号待ち状態(ステップ251)に遷移する。
[Free partition update status]
In the free partition update state (step 254), the buffer control unit 11 sets the value of the free partition connection end identifier to the free partition information holding unit 24 and the value of the read partition identifier held when the partition release signal is received. Update to However, if the value of the empty partition connection end identifier input in the empty partition information acquisition state (step 252) is the value of a connected partition identifier that means that there is no connected partition, in addition to the above, For the free partition information holding unit 24, the value of the free partition connection start identifier is updated to the value of the read partition identifier held when the partition release signal is received. Thereafter, the state transits to a partition release signal waiting state (step 251).

[第3の実施の形態の効果]
このように、本実施の形態は、第1の実施の形態において、複数個のブロックで区画を構成し、入力された各パケットのパケットデータを、指定されたキューと対応する区画内のブロックで蓄積するようにしたものである。
[Effect of the third embodiment]
As described above, in this embodiment, in the first embodiment, a partition is configured by a plurality of blocks, and the packet data of each input packet is represented by a block in the partition corresponding to the designated queue. It is to be accumulated.

より具体的には、前記バッファ制御部11が、複数個の前記ブロックで構成された区画のうち、前記キュー入力指示情報で指定されたキューと対応する区画に対して、前記パケットデータを書き込むことにより、前記パケットデータを前記キューに蓄積し、前記メモリ部12のうち、前記キュー出力指示情報で指定されたキューと対応する区画から、前記パケットデータの読み出すことにより、前記パケットデータを前記キューから取り出し、前記区画への前記パケットデータの書き込みが満了した場合、当該区画に対して空き区画を連結区画として連結した後、当該空き区画に対する前記パケットデータの書き込みを継続し、前記区画からの前記パケットデータの読み出しが満了した場合、当該区画を空き区画として解放するとともに、当該区画に連結されている連結区画からの前記パケットデータの読み出しを継続するようにしたものである。   More specifically, the buffer control unit 11 writes the packet data to a partition corresponding to the queue specified by the queue input instruction information among the partitions configured by a plurality of blocks. The packet data is accumulated in the queue, and the packet data is read from the queue by reading the packet data from the partition corresponding to the queue designated by the queue output instruction information in the memory unit 12. When the writing of the packet data to the partition is completed, the packet data from the partition is continuously written after the empty partition is connected to the partition as a connected partition. When the data reading has expired, the partition is released as an empty partition and It is obtained so as to continue the reading of the packet data from the connection section which is connected to the partition.

これにより、第1の実施の形態と同様に、入力パケット毎に生成されるパケット境界情報含む固定長のブロック管理情報が、パケットデータと連結して、メモリ部12のキューに格納される。このため、本実施の形態にかかるパケットバッファ装置10によれば、従来のような固定長のパケットジョブ(ジョブ情報)を蓄積するため、SRAMからなるジョブ用メモリを、キューとは別個に設ける必要はない。したがって、蓄積するパケット数を増大させた場合でも、パケットを蓄積するデータ用メモリの増大に伴う余分な回路規模の増加を抑制することができる。   As a result, similarly to the first embodiment, fixed-length block management information including packet boundary information generated for each input packet is concatenated with the packet data and stored in the queue of the memory unit 12. Therefore, according to the packet buffer device 10 according to the present embodiment, in order to store a conventional fixed-length packet job (job information), it is necessary to provide a job memory composed of SRAM separately from the queue. There is no. Therefore, even when the number of packets to be accumulated is increased, it is possible to suppress an increase in an extra circuit scale accompanying an increase in the data memory for accumulating packets.

これに加えて、特定のキューにパケットの蓄積が集中する場合に、そのキューがオーバーフローする前に区画の連結を行うとともに、パケットの蓄積が少ないキューに対しては、そのキューへの区画の連結を行わず、また、パケットの出力による蓄積量の減少に応じて区画を解放することになる。したがって、キューごとに必要な容量がばらついた場合や、蓄積量が時間経過に伴って変動した場合にも、各キューに対して容量の配分が適切に行われるので、従来技術を適用したパケットバッファ装置と比較して、メモリの必要容量を小さくすることができる。   In addition to this, when packet accumulation is concentrated in a specific queue, the partitions are connected before the queue overflows, and for queues with little packet accumulation, the partitions are connected to the queue. In addition, the partition is released according to the decrease in the accumulated amount due to the output of the packet. Therefore, even when the required capacity varies for each queue, or when the accumulated amount fluctuates over time, the capacity is appropriately allocated to each queue. Compared with the device, the required memory capacity can be reduced.

この効果を従来技術の説明で用いた例により説明する。本実施の形態では、パケットがキューに蓄積される過程で、既にキューに割り当てていたメモリ量のうち空きが少なくなってきたとき追加の割り当てを行う。例えば、メモリを64KByteの容量を持つ区画に分割しておき、キューに割り当て済みの区画の空きが2KByteとなった時点で、新たな区画をそのキューに追加する場合、各キューに割り当て済みの区画に生じる空き容量の最大値は、新たな区画を割り当てる条件である2KByte+新たな1個の区画の容量である64KByteであるため、66KByteとなる。   This effect will be described using an example used in the description of the prior art. In the present embodiment, in the process of accumulating packets in the queue, additional allocation is performed when there is less free space in the memory amount already allocated to the queue. For example, if the memory is divided into partitions having a capacity of 64 KBytes, and a new partition is added to the queue when the space allocated to the queue becomes 2 KBytes, the partition allocated to each queue Since the maximum value of the free capacity generated in 2 is 2 Kbytes which is a condition for assigning a new partition + 64 Kbytes which is the capacity of one new partition, it is 66 Kbytes.

したがって、すべてのキューで前記空き容量が生じた状況が、最もメモリの使用率が低い状況であるため、蓄積に必要となる12.5MByteに、前記空き容量の合計値66KByte×8を加えた値である13MByteが、本実施の形態での必要なメモリ量となる。この例で示されるように、従来は100MByteのメモリ量を必要としていたのに対して13MByteで済むため、メモリ量を87%削減することができるという効果が、本実施の形態にある。   Therefore, the situation where the free capacity is generated in all the queues is the situation where the memory usage rate is the lowest. Therefore, the value obtained by adding the total free capacity value 66 KB x 8 to 12.5 Mbytes required for accumulation. 13 Mbytes is a necessary memory amount in the present embodiment. As shown in this example, the memory amount of 100 MBytes is conventionally required, but 13 MBytes is sufficient. Therefore, the present embodiment has an effect that the memory amount can be reduced by 87%.

また、本実施の形態は、各キューに蓄積するパケットのデータを保持するメモリの領域を、区画が連結された仮想的なFIFOバッファとして管理するため、従来技術を適用したパケットバッファ装置と同じく、複雑なバッファ制御が不要である。
また、本実施の形態は、1つの区画内ではメモリにアクセスするときのアドレスを連続させることができ、従来技術を適用したパケットバッファ装置と同じく、メモリに対するバーストアクセスを可能とする。これにより、1つのキューからの出力が連続して行われるような用途で使用される場合、メモリからの読み出しを高速に行うことができるため、キューからのパケット取り出しが速い。
In addition, the present embodiment manages the area of the memory that holds the packet data accumulated in each queue as a virtual FIFO buffer in which partitions are connected. Complex buffer control is not required.
Further, according to the present embodiment, addresses for accessing the memory can be made continuous in one partition, and burst access to the memory is possible as in the packet buffer device to which the conventional technique is applied. As a result, when used in an application where the output from one queue is continuously performed, reading from the memory can be performed at a high speed, so that the packet extraction from the queue is fast.

メモリアクセスするときのアドレスを連続させることが可能であるのは、具体的には、メモリ部12が複数の互いに重ならないアドレス範囲で区分けして、これらを各区画とすることによって行う。すなわち、各区画にアドレスの範囲を定めておくことにとって、ある区画にアクセスしたときのアドレスの次のアドレスが、前記区画に定められたアドレスの範囲内であれば、前記次のアドレスにアクセスすると、前記区画内のメモリ領域にアクセスしたことになるからである。   Specifically, the addresses at the time of memory access can be made continuous by dividing the memory unit 12 into a plurality of address ranges that do not overlap with each other, and setting these as respective partitions. In other words, in order to determine the address range for each partition, if the next address of the address when accessing a certain partition is within the range of the address determined for the partition, the next address is accessed. This is because the memory area in the partition has been accessed.

また、本実施の形態は、区画内の書き込み位置に所定の位置に達したことを条件に次に書き込みを行う区画の連結を行うため、書き込み中の区画が満杯になる前に、次の区画を準備することができるため、区画をまたぐ書き込みを行う場合にも、書き込みが途切れず、キューへのパケット蓄積が速い。   Further, in this embodiment, since a partition to be written next is connected on the condition that the write position in the partition has reached a predetermined position, the next partition is written before the partition being written becomes full. Therefore, even when writing is performed across partitions, writing is not interrupted and packet accumulation in the queue is fast.

なお、パケット読出の高速化や効率的なメモリ使用を実現可能なメモリ区画のサイズ範囲は、バッファに入出力するパケットのバースト長やパケット長の最大値や平均値によって異なる。
各区画の大きさをmとし、入力されたパケットが連続して蓄積されるときの最大蓄積データ量(=バースト長)をLbとし、キューがデータ量Lbを蓄積するとき、Lb/m個の区画が使用される。
Note that the size range of the memory partition that can realize high-speed packet reading and efficient memory use varies depending on the burst length of packets input to and output from the buffer and the maximum and average packet lengths.
When the size of each partition is m, the maximum stored data amount (= burst length) when input packets are continuously stored is Lb, and when the queue stores the data amount Lb, Lb / m A partition is used.

したがって、Lb/mの値が小さくなるようmの値を大きくすると、必要となる区画数が減るため区画を連結するための回路規模を削減できる一方で、キューに割り当て済の区画のうち、データを記憶していない空き領域の平均量(m/2)が大きくなるためメモリの蓄積率Rs=1−m/(2×Lb)が低下する。   Therefore, if the value of m is increased so that the value of Lb / m is decreased, the number of necessary partitions is reduced, so that the circuit scale for connecting the partitions can be reduced. On the other hand, among the partitions allocated to the queue, data Since the average amount (m / 2) of empty areas that do not store is increased, the memory accumulation rate Rs = 1−m / (2 × Lb) decreases.

また、mの値を小さくすると区画の連結処理や解放処理の回数が増大するため、処理量の増大によって消費電力の増加や、パケットの入出力速度の低下を招く可能性がある。また、データの書き込み/読み出しを行っている途中で区画が変わるため、DDR−SDRAMなどのようなメモリを用いる場合は、メモリへのアクセスが中断されて、メモリのアクセス帯域の利用効率が低下する。特に、mの値が平均パケット長Lp以下になると、パケット途中での区画切り替えの確率Pc=Lp/mが1以上となるため、各パケットの読み出しや書き込みを行う途中で区画が切り替わりが発生し、問題が深刻化する。   In addition, if the value of m is reduced, the number of partition connection processing and release processing increases, so that an increase in processing amount may cause an increase in power consumption and a decrease in packet input / output speed. Further, since the partition changes during data writing / reading, when a memory such as a DDR-SDRAM is used, access to the memory is interrupted and the use efficiency of the access bandwidth of the memory is lowered. . In particular, when the value of m is equal to or less than the average packet length Lp, the partition switching probability Pc = Lp / m in the middle of the packet is 1 or more, so that the partition switching occurs during the reading or writing of each packet. The problem gets worse.

このため、実用的なmの範囲は、Lb,Lp,Rs,Pcが与えられたとき、Lp/Pc≦m≦2×Rs×Lbで示される範囲となり、mは前記範囲内で大きい値をとる方が回路規模や消費電力が小さくなる。例えば、Bb=1MByte,Lp=750byte,Rs=0.05,Pc=0.1とすると、7.5Kbyte≦m≦100Kbyteとなり、区画は100Kbyteが望ましい。
なお、Lb,Lp,Rs,Pcの与えられ方によっては、実用的な範囲のmが存在しないこともあるが、この場合は、本発明が有効ではなく従来構成を採用した方がよいと判断できる。
Therefore, a practical range of m is a range represented by Lp / Pc ≦ m ≦ 2 × Rs × Lb when Lb, Lp, Rs, and Pc are given, and m is a large value within the range. The circuit scale and power consumption are reduced by taking the circuit. For example, if Bb = 1 Mbyte, Lp = 750 bytes, Rs = 0.05, and Pc = 0.1, 7.5 Kbytes ≦ m ≦ 100 Kbytes, and the partition is preferably 100 Kbytes.
Depending on how Lb, Lp, Rs, and Pc are given, m in the practical range may not exist. In this case, it is determined that the present invention is not effective and the conventional configuration should be adopted. it can.

また、キューごとに、平均パケット長やバースト長が異なる場合があるが、このような場合は、各キューについて、適切な区画の大きさの範囲を得たとき、これらの範囲をすべて満たす値の範囲のうち最大値を区画の大きさとして採用すればよい。このようにすることで、全てのキューに対して適切な範囲でmを定めることができる。   In addition, the average packet length and burst length may be different for each queue. In such a case, when obtaining an appropriate partition size range for each queue, a value that satisfies all these ranges is obtained. What is necessary is just to employ | adopt the maximum value among the ranges as the magnitude | size of a division. In this way, m can be determined within an appropriate range for all the queues.

さらに、キューによって平均パケット長やバースト長が大きく異なるために上記mが存在しないような場合には、メモリ領域を、区画サイズm1でM1個に区画化した領域A1、区画サイズm2でM2個に区画化した領域A2、…、区画サイズmkでMk個に区画化した領域Akに区分し、各キューを、区画サイズが適切な範囲にある前記区分A1〜Akの何れか1つに所属させる。各キューへのパケットの蓄積にあたっては、前記キューが所属する区分内の区画を利用して、前記パケットを蓄積する。各区分内での区画の連結や解放の処理は、既に説明したとおりである。   Further, when the above-mentioned m does not exist because the average packet length and burst length vary greatly depending on the queue, the memory area is divided into M1 areas with a partition size m1 and M2 areas with a partition size m2. The partitioned areas A2,... Are partitioned into Mk partitioned areas Ak with a partition size mk, and each queue is assigned to any one of the sections A1 to Ak having a partition size in an appropriate range. When accumulating packets in each queue, the packets are accumulated using a section in a section to which the queue belongs. The processing for connecting and releasing partitions within each section is as described above.

なお、各区分に割り当てるメモリ量は、その区分に所属するキューのバースト長の合計値以下で、統計多重効果(同時に各キューが最大長になる確率が低いためにキュー長の合計値が最大長の合計値より小さくなる効果)を考慮した値に設定すればよい。   Note that the amount of memory allocated to each category is less than or equal to the total burst length of the queues belonging to that category, and the statistical multiplexing effect (the total queue length is the maximum length because each queue is unlikely to have the maximum length). The effect may be set to a value that takes into account an effect that is smaller than the total value.

[実施の形態の拡張]
以上、実施形態を参照して本発明を説明したが、本発明は上記実施形態に限定されるものではない。本発明の構成や詳細には、本発明のスコープ内で当業者が理解しうる様々な変更をすることができる。また、各実施形態については、矛盾しない範囲で任意に組み合わせて実施することができる。
[Extended embodiment]
The present invention has been described above with reference to the embodiments, but the present invention is not limited to the above embodiments. Various changes that can be understood by those skilled in the art can be made to the configuration and details of the present invention within the scope of the present invention. In addition, each embodiment can be implemented in any combination within a consistent range.

10…パケットバッファ装置、11…バッファ制御部、12…メモリ部、13…書込バッファ部、13A…書込ブロックバッファ、14…読出バッファ部、14A…読出ブロックバッファ、21…書込位置情報保持部、22…読出位置情報保持部、23…連結区画情報保持部、24…空き区画情報保持部。   DESCRIPTION OF SYMBOLS 10 ... Packet buffer apparatus, 11 ... Buffer control part, 12 ... Memory part, 13 ... Write buffer part, 13A ... Write block buffer, 14 ... Read buffer part, 14A ... Read block buffer, 21 ... Write position information holding , 22 ... Reading position information holding unit, 23 ... Linked partition information holding unit, 24 ... Free partition information holding unit.

Claims (6)

固定長の記憶領域からなるブロックを複数有し、これらブロックごとにデータの書き込みおよび読み出しを行うメモリ部と、
少なくとも前記ブロック分のデータを保持する書込ブロックバッファと、
少なくとも前記ブロック分のデータを保持する読出ブロックバッファと、
入力された可変長のパケットのパケットデータを、前記書込ブロックバッファへ順次格納するとともに、当該書込ブロックバッファへ格納した各パケットデータの終端位置を示すパケット境界情報を含むブロック管理情報を当該書込ブロックバッファへ格納し、当該書込ブロックバッファ内に所定量のデータが格納された時点で、当該データを前記メモリ部へ書き込み、入力された出力指示に応じて、前記メモリ部から前記データを読み出して前記読出ブロックバッファへ格納し、当該データに含まれる前記ブロック管理情報の前記パケット境界情報に基づいて、当該データに含まれる各パケットデータを読み出して出力するパケット制御部と
を備えることを特徴とするパケットバッファ装置。
A memory unit having a plurality of blocks each having a fixed-length storage area, and writing and reading data for each of these blocks;
A write block buffer for holding at least data for the block;
A read block buffer for holding at least data for the block;
The packet data of the input variable length packet is sequentially stored in the write block buffer, and block management information including packet boundary information indicating the end position of each packet data stored in the write block buffer is stored in the write block buffer. When a predetermined amount of data is stored in the write block buffer, the data is written to the memory unit, and the data is read from the memory unit according to the input output instruction. A packet control unit that reads and stores the packet data in the read block buffer, and reads and outputs each packet data included in the data based on the packet boundary information of the block management information included in the data. Packet buffer device.
請求項1に記載のパケットバッファ装置において、
前記パケット制御部は、前記パケットデータを前記書込ブロックバッファへ格納する際に、当該書込ブロックバッファの空き容量が不足して当該パケットデータの全てを格納できない場合、当該書込ブロックバッファに格納されているデータを前記メモリ部へ書き込んだ後、残りのパケットデータを当該書込ブロックバッファの先頭から格納することを特徴とするパケットバッファ装置。
The packet buffer device according to claim 1, wherein
When storing the packet data in the write block buffer, the packet control unit stores the packet data in the write block buffer if the write block buffer has insufficient free space to store all of the packet data. After the written data is written to the memory unit, the remaining packet data is stored from the head of the write block buffer.
請求項1に記載のパケットバッファ装置において、
前記ブロックは、複数バイトの固定長からなるワードを単位として複数個に分割されてなり、
前記パケット制御部は、
前記書込ブロックバッファに前記ブロック管理情報を格納する際、前記書込ブロックバッファ内の前記ワードの先頭ワードから前記ブロック管理情報を格納し、
前記書込ブロックバッファに前記パケットデータを書き込む際、前記ブロック管理情報の末尾バイトを格納した前記先頭ワードの次のワードから順に格納用のワードを選択し、選択したワードに前記パケットデータを格納する際、当該ワードの先頭バイトから順に当該パケットデータの各バイトを格納するとともに、当該パケットデータの末尾バイトを格納したバイトの次のバイトから所定のパケット終端パタンを格納し、
前記書込ブロックバッファに前記ブロック管理情報を格納する際、前記パケット境界情報に代えて、前記各ワードにおける前記パケットデータの末尾バイトの存在有無を示す境界判定ビット列を含む前記ブロック管理情報を格納する
ことを特徴とするパケットバッファ装置。
The packet buffer device according to claim 1, wherein
The block is divided into a plurality of words each having a fixed length of a plurality of bytes.
The packet control unit
When storing the block management information in the writing block buffer, storing the block management information from the first word of the word in the writing block buffer,
When writing the packet data to the write block buffer, a word for storage is selected in order from the next word after the first word storing the last byte of the block management information, and the packet data is stored in the selected word When storing each byte of the packet data in order from the first byte of the word, and storing a predetermined packet end pattern from the byte next to the byte storing the tail byte of the packet data,
When storing the block management information in the write block buffer, the block management information including a boundary determination bit string indicating the presence / absence of the last byte of the packet data in each word is stored instead of the packet boundary information. A packet buffer device.
請求項3に記載のパケットバッファ装置において、
前記パケット制御部は、
前記ブロックから前記パケットデータを読み出す際、最初に当該ブロックの先頭ワードから前記ブロック管理情報を取得して、このブロック管理情報の前記境界判定ビット列に基づき、当該ブロックにおけるパケットデータの末尾バイトの存在有無を判定し、当該末尾バイトが存在しない場合には、前記メモリ部に対して次のブロックの読出要求を行い、当該末尾バイトが存在しない場合には、前記先頭ワードの次のワードから順に前記パケットデータの読出を行う
ことを特徴とするパケットバッファ装置。
The packet buffer device according to claim 3, wherein
The packet control unit
When reading the packet data from the block, the block management information is first obtained from the head word of the block, and based on the boundary determination bit string of the block management information, the presence or absence of the last byte of the packet data in the block If the tail byte does not exist, the memory unit is requested to read the next block. If the tail byte does not exist, the packet is sequentially received from the word next to the head word. A packet buffer device for reading data.
請求項1〜請求項4のいずれか1つに記載のパケットバッファ装置において、
前記バッファ制御部は、
複数個の前記ブロックで構成された区画のうち、前記キュー入力指示情報で指定されたキューと対応する区画に対して、前記パケットデータを書き込むことにより、前記パケットデータを前記キューに蓄積し、前記メモリ部のうち、前記キュー出力指示情報で指定されたキューと対応する区画から、前記パケットデータの読み出すことにより、前記パケットデータを前記キューから取り出し、
前記区画への前記パケットデータの書き込みが満了した場合、当該区画に対して空き区画を連結区画として連結した後、当該空き区画に対する前記パケットデータの書き込みを継続し、前記区画からの前記パケットデータの読み出しが満了した場合、当該区画を空き区画として解放するとともに、当該区画に連結されている連結区画からの前記パケットデータの読み出しを継続する
ことを特徴とするパケットバッファ装置。
In the packet buffer device according to any one of claims 1 to 4,
The buffer control unit
The packet data is stored in the queue by writing the packet data to a partition corresponding to the queue specified by the queue input instruction information among the partitions configured by a plurality of blocks. The packet data is taken out from the queue by reading the packet data from the partition corresponding to the queue specified by the queue output instruction information in the memory unit,
When writing of the packet data to the partition has expired, after linking an empty partition to the partition as a connected partition, the writing of the packet data to the empty partition is continued, and the packet data from the partition is When reading is completed, the packet is released as an empty partition, and the packet data is continuously read from the connected partition connected to the partition.
入力されたパケットをキュー(FIFOメモリ)に格納するとともに、出力指示に応じてキューからパケットを取り出して出力するパケットバッファ装置で用いられるパケットバッファ制御方法であって、
固定長の記憶領域からなるブロックを複数有し、これらブロックごとにデータの書き込みおよび読み出しを行うメモリ部と、
少なくとも前記ブロック分のデータを保持する書込ブロックバッファと、
少なくとも前記ブロック分のデータを保持する読出ブロックバッファとを備え、
パケット制御部が、
入力された可変長のパケットのパケットデータを、前記書込ブロックバッファへ順次格納するとともに、当該書込ブロックバッファへ格納した各パケットデータの終端位置を示すパケット境界情報を含むブロック管理情報を当該書込ブロックバッファへ格納するステップと、
当該書込ブロックバッファ内に所定量のデータが格納された時点で、当該データを前記メモリ部へ書き込み、入力された出力指示に応じて、前記メモリ部から前記データを読み出して前記読出ブロックバッファへ格納し、当該データに含まれる前記ブロック管理情報の前記パケット境界情報に基づいて、当該データに含まれる各パケットデータを読み出して出力するステップとを備える
ことを特徴とするパケットバッファ制御方法。
A packet buffer control method used in a packet buffer device for storing an input packet in a queue (FIFO memory) and extracting and outputting the packet from the queue according to an output instruction,
A memory unit having a plurality of blocks each having a fixed-length storage area, and writing and reading data for each of these blocks;
A write block buffer for holding at least data for the block;
A read block buffer for holding at least the data for the block;
The packet controller
The packet data of the input variable length packet is sequentially stored in the write block buffer, and block management information including packet boundary information indicating the end position of each packet data stored in the write block buffer is stored in the write block buffer. Storing in the embedded block buffer;
When a predetermined amount of data is stored in the write block buffer, the data is written to the memory unit, and the data is read from the memory unit in response to the input output instruction, and sent to the read block buffer. A packet buffer control method comprising: storing and reading each packet data included in the data based on the packet boundary information of the block management information included in the data and outputting the packet data.
JP2011285526A 2011-12-27 2011-12-27 Packet buffer device and packet buffer control method Expired - Fee Related JP5748288B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011285526A JP5748288B2 (en) 2011-12-27 2011-12-27 Packet buffer device and packet buffer control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011285526A JP5748288B2 (en) 2011-12-27 2011-12-27 Packet buffer device and packet buffer control method

Publications (2)

Publication Number Publication Date
JP2013135383A true JP2013135383A (en) 2013-07-08
JP5748288B2 JP5748288B2 (en) 2015-07-15

Family

ID=48911791

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011285526A Expired - Fee Related JP5748288B2 (en) 2011-12-27 2011-12-27 Packet buffer device and packet buffer control method

Country Status (1)

Country Link
JP (1) JP5748288B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115190089A (en) * 2022-05-26 2022-10-14 中科驭数(北京)科技有限公司 Message storage method, device, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01296740A (en) * 1988-05-25 1989-11-30 Hitachi Ltd Packet data transmission and memory storage system
JPH0388450A (en) * 1989-06-19 1991-04-12 Hitachi Ltd Communication equipment
JPH1023102A (en) * 1996-06-28 1998-01-23 Sony Corp Information processing unit and its method
JP2002084316A (en) * 2000-09-08 2002-03-22 Toyo Commun Equip Co Ltd Variable length packet write and read circuit
JP2009077453A (en) * 2003-04-22 2009-04-09 Agere Systems Inc Method and apparatus for shared multi-bank memory

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01296740A (en) * 1988-05-25 1989-11-30 Hitachi Ltd Packet data transmission and memory storage system
JPH0388450A (en) * 1989-06-19 1991-04-12 Hitachi Ltd Communication equipment
JPH1023102A (en) * 1996-06-28 1998-01-23 Sony Corp Information processing unit and its method
JP2002084316A (en) * 2000-09-08 2002-03-22 Toyo Commun Equip Co Ltd Variable length packet write and read circuit
JP2009077453A (en) * 2003-04-22 2009-04-09 Agere Systems Inc Method and apparatus for shared multi-bank memory

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115190089A (en) * 2022-05-26 2022-10-14 中科驭数(北京)科技有限公司 Message storage method, device, equipment and storage medium
CN115190089B (en) * 2022-05-26 2024-03-22 中科驭数(北京)科技有限公司 Message storage method, device, equipment and storage medium

Also Published As

Publication number Publication date
JP5748288B2 (en) 2015-07-15

Similar Documents

Publication Publication Date Title
US8225026B2 (en) Data packet access control apparatus and method thereof
WO2021088466A1 (en) Method for improving message storage efficiency of network chip, device, and storage medium
US10205673B2 (en) Data caching method and device, and storage medium
US20110002345A1 (en) Method and apparatus for dequeuing data
US9304939B2 (en) Method and multi-core communication processor for replacing data in system cache
US8943507B2 (en) Packet assembly module for multi-core, multi-thread network processors
WO2020199760A1 (en) Data storage method, memory and server
US7000073B2 (en) Buffer controller and management method thereof
JP5332430B2 (en) Shared memory system
CN116955247B (en) Cache descriptor management device and method, medium and chip thereof
JP5748288B2 (en) Packet buffer device and packet buffer control method
US8363653B2 (en) Packet forwarding method and device
US20160085683A1 (en) Data receiving device and data receiving method
JP5748287B2 (en) Packet buffer device and packet buffer control method
US7620770B2 (en) Device and method for storing and processing data units
CN114401072B (en) Dynamic buffer control method and system for frame disassembly reordering queue based on HINOC protocol
CN102571535B (en) Device and method for delaying data and communication system
CN114610231A (en) Control method, system, equipment and medium for large-bit-width data bus segmented storage
US9128785B2 (en) System and method for efficient shared buffer management
US20140297972A1 (en) Memory control device and memory control method
KR20160109733A (en) Storage apparatus and method for processing a plurality of client data
KR102335798B1 (en) Storage apparatus and method for processing a plurality of client data
US9544229B2 (en) Packet processing apparatus and packet processing method
CN113347112B (en) Data packet forwarding method and device based on multi-level cache
JP5750387B2 (en) Frame control device, transmission device, network system, and buffer read control method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20140307

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20141106

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20141125

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20150126

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20150508

R150 Certificate of patent or registration of utility model

Ref document number: 5748288

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees