CN100349442C - Ping pong buffer device - Google Patents

Ping pong buffer device Download PDF

Info

Publication number
CN100349442C
CN100349442C CNB2004100428720A CN200410042872A CN100349442C CN 100349442 C CN100349442 C CN 100349442C CN B2004100428720 A CNB2004100428720 A CN B2004100428720A CN 200410042872 A CN200410042872 A CN 200410042872A CN 100349442 C CN100349442 C CN 100349442C
Authority
CN
China
Prior art keywords
buffer memory
data
additional information
buffer
ping
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CNB2004100428720A
Other languages
Chinese (zh)
Other versions
CN1585373A (en
Inventor
赵琮
陈家锦
何刚跃
何剑
文冠果
陈旭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZTE Corp
Original Assignee
ZTE 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 ZTE Corp filed Critical ZTE Corp
Priority to CNB2004100428720A priority Critical patent/CN100349442C/en
Publication of CN1585373A publication Critical patent/CN1585373A/en
Application granted granted Critical
Publication of CN100349442C publication Critical patent/CN100349442C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Memory System Of A Hierarchy Structure (AREA)

Abstract

The present invention discloses a ping pong buffer storage device which comprises a data additional information analyzing module, an additional information input selector, an input data analyzing module, a buffer storage writing selector, a skipping condition writing processing module, a ping pong buffer storage entity module, an additional information output selector and a buffer storage reading selector. Because the ping pong buffer storage device provided by the present invention, the present invention can realize that only a set of ping pong buffer storage entities is used for the classification buffer for different kinds of data in data flow. The ping pong buffer storage device provided by the present invention expands traditional ping pong buffer storage functions, effectively solves the problem of waste resources for the use of a traditional ping pong buffer storage device, saves circuit resources and raises a data buffer storage efficiency in a system.

Description

A kind of ping-pong buffers device
Technical field
The present invention relates to the metadata cache field, relate in particular to scattered, diversiform data reception, the metadata cache technology that classification quantitatively sends handled.
Background technology
Ping-pong buffer (PingPong Buffer) mechanism is a kind of relatively cache way of increase data bandwidth commonly used.Can be used in any one needs in the system that read operation and write operation carry out simultaneously, such as the data recombination buffer memory in switch and the route system, and the perhaps transmission of the batch data in the computer system.
Fig. 1 is the schematic diagram of common buffer memory.As shown in Figure 1, this is a common buffer memory (buffer), suppose its input (An) and export the processing (batch process) that (Dn) has data cell, in each data cell time (we are referred to as time slot), zero (An=0) or one (An=1) new data cell can be imported, and have zero (Dn=0) or (Dn=1) data cell output; This means that at each time slot two independently storage operation generations are arranged.If the employing dual-ported memory is that can to reach be two purposes that operation is carried out simultaneously; But dual-ported memory costs an arm and a leg, for consideration economically, generally all can adopt one-port memory, this bandwidth of memory (equal buffer memory input rate and output speed and) that just requires buffer memory must be the twice of linear speed (input or output) so.(OC (Optical Carrier, light carrier) is the transmission speed that defines in SONET (Synchronous Optical NETwork, the synchronous optical network) standard with OC-48.The transmission speed of OC definition light device, OC-48 linear speed 2.4Gbps) be example, the bandwidth of memory that it needs is 4.8Gbps, corresponds to 32 memory, the access time of memory is necessary for 6.4ns so, and this requirement to memory and system clock is very harsh.
Except adopting dual-ported memory, also have another mechanism to realize that read and write operates ping-pong buffer mechanism that Here it is simultaneously.Ping-pong buffer adopts two one-port memories, and at each time slot, every block storage only need be carried out a kind of operation (read or write).The general structure of ping-pong buffer as shown in Figure 2, the total capacity of supposing ping-pong buffer is M (unit is a memory cell), its input is handled and output is handled and represented with An and Dn respectively.Ping-pong buffer comprises two memory devices that physically separate, and the capacity of each is respectively M/2, and two memory interfaces are held together, and (from the angle of An and Dn) to buffer memory just from the outside, but operation capacity is M/2.
With respect to general one-port memory buffer memory, in ping-pong buffer, read operation and write operation can take place simultaneously, but alternating action is on different storage component parts respectively.Fig. 3 is the operation example figure of ping-pong buffer.As shown in Figure 3, when input (An) data cell arrived, if wherein a block cache (buffer1) is read, these data cells can be written on the other block cache (buffer2) so; Write completely when buffer memory 1, buffer memory 2 is read after the sky, and operation has just exchanged comes, and An writes in the buffer memory 2, and Dn is from buffer memory 1 total reading of data.From the angle of An or Dn, operation all hockets between two buffer memorys.Ping-pong buffer is a caching mechanism relatively more commonly used at present, and its basic principle is accepted extensively by industry.In the different system for reality, demand is diversified, and concrete control mode is Protean.
But traditional ping-pong buffer still exists some shortcomings in actual applications.For example: common ping-pong buffer can only one of them buffer memory (as buffer memory 1 or buffer memory 2) in ping-pong buffer be write full or is read and redirect just takes place in empty.When data in buffer is data of different types, the data type that system often requires to export also will be consistent respectively, if adopt traditional ping-pong buffer, just must be after distinguishing data type for the data of different types in the data flow, adopt many cover ping-pong buffers to come buffer memory data of different types respectively, this is relatively waste on resource, and can increase the scale and the complexity of whole system undoubtedly.
Summary of the invention
Purpose of the present invention proposes a kind of economic and reliable, is applicable to the ping-pong buffer device of buffer memory different types of data.
Core concept of the present invention is: according to dissimilar with the road data separation of input data, data of different types must make a distinction and leave in the inner different buffer memorys of ping-pong buffer (buffer memory 1 or buffer memory 2), if data type changes, even if buffer memory less than, redirect also will take place in ping-pong buffer, is the data of same type with what guarantee to deposit in each buffer memory (buffer memory 1 or buffer memory 2); For showing with road information is data of the same type, also can further classify to data according to the additional information of data, and different classes of data also leave in the inner different buffer entity of different ping-pong buffers.
Technical scheme of the present invention is:
A kind of ping-pong buffer device comprises:
Data additional information analysis module is used to analyze the data additional information of input, and analysis result is input to the additional information input selector, produces simultaneously to write completely normal redirect condition and the unusual redirect condition of additional information and output to and write redirect condition processing module;
The additional information input selector receives data additional information analysis module and the output result who writes the redirect processing module, selects the data additional information to enter the data additional information register of buffer memory 1 or the data additional information register of buffer memory 2;
The input data analysis module, be used to analyze the data of input and data with road information, the data of analyzing the back additivity are outputed to write the buffer memory selector, and produce the unusual redirect condition of data type and output to and write redirect condition processing module;
Write the buffer memory selector, receive the data of additivity of input data analysis module output and the output of writing the redirect processing module, select to put into data in the buffer memory 1 or in the buffer memory 2;
Write redirect condition processing module, be used to handle the various redirect conditions that receive, the selection result that produces is outputed to the additional information input selector and writes the buffer memory selector select;
The entity module of ping-pong buffer is used for buffer memory input data and input data additional information; Specifically comprise
A, buffer memory 1 and buffer memory 2, two buffer entities in the ping-pong buffer module are used for the data that buffer memory is write the output of buffer memory selector;
Data additional information register in data additional information register and the buffer memory 2 is used to deposit the data additional information that the additional information input selector is exported in B, the buffer memory 1;
The valid data of C, buffer memory 1 number register is gentle deposits a valid data number register of 2, is used to deposit the number of valid data in current cache 1 or the buffer memory 2;
The write pointer register of D, buffer memory 1 and the read pointer register of buffer memory 1 are used to deposit the write pointer and the read pointer of buffer memory 1;
The write pointer register of E, buffer memory 2 and the read pointer register of buffer memory 2 are used to deposit the write pointer and the read pointer of buffer memory 2;
The additional information outlet selector is used for selecting the data additional information of data additional information registers in output buffers 1 interior data additional information register or the buffer memory 2 according to reading the redirect condition;
Read the buffer memory selector, be used for selecting the data of output buffers 1 or buffer memory 2 according to reading the redirect condition.
Above-mentioned buffer memory 1 and buffer memory 2 are storage component parts of the symmetry of physically separating, can be made of single port RAM, also can be built by registers group.It is that the inner buffer degree of depth is a ping-pong buffer of 1 that buffer memory 1 interior data additional information register and buffer memory 2 interior data additional information registers group lump together.
Use the ping-pong buffer device of proposition of the present invention, only can realize can be to the buffer memory of classifying of different types of data in the data flow with a cover ping-pong buffer entity, the table tennis device that the present invention proposes, expanded the function of traditional ping-pong buffer, solved effectively and used traditional ping-pong buffer waste problem of resource, save circuit resource, improved the efficient of metadata cache in the system.
Description of drawings
Fig. 1 is the schematic diagram of common buffer memory;
Fig. 2 is the structural representation of traditional ping-pong buffer;
Fig. 3 is the operation example figure of ping-pong buffer;
Fig. 4 is the structural representation of the ping-pong buffer device that proposes of the present invention.
Embodiment
The present invention is described in further detail below in conjunction with drawings and Examples.
Fig. 1, Fig. 2 and Fig. 3 had carried out detailed description in background technology.
Fig. 4 is the structural representation of the ping-pong buffer device that proposes of the present invention.The main input of the ping-pong buffer device that the present invention relates to is: the additional information of input data and input data.As shown in Figure 4, the ping-pong buffer device of the present invention's proposition comprises:
Data additional information analysis module is used to analyze the data additional information of input, and analysis result is input to the additional information input selector, produces simultaneously to write completely normal redirect condition and the unusual redirect condition of additional information and output to and write redirect condition processing module.
The additional information input selector receives data additional information analysis module and the output result who writes the redirect processing module, selects the data additional information to enter the data additional information register of buffer memory 1 or the data additional information register of buffer memory 2.
The input data analysis module, be used to analyze the data of input and data with road information, the data of analyzing the back additivity are outputed to write the buffer memory selector, and produce the unusual redirect condition of data type and output to and write redirect condition processing module.This analysis module requires to contain data type information in the input data, if do not contain with road information in the input data, then device thinks that all data all are same types, and this has just guaranteed that ping-pong buffer device that the present invention proposes can be fully and traditional buffer unit function compatibility.
Write the buffer memory selector, receive the data of additivity of input data analysis module output and the output of writing the redirect processing module, select to put into data in the buffer memory 1 or in the buffer memory 2;
Write redirect condition processing module, be used to handle the various redirect conditions that receive, the selection result that produces is outputed to the additional information input selector and writes the buffer memory selector select;
The entity module of ping-pong buffer is used for buffer memory input data and input data additional information; Specifically comprise
A, buffer memory 1 and buffer memory 2, two buffer entities in the ping-pong buffer module are used for the data that buffer memory is write the output of buffer memory selector; A data cached high position has been added control informations in real time such as type.
Data additional information register in data additional information register and the buffer memory 2 is used to deposit the data additional information that the additional information input selector is exported in B, the buffer memory 1; Such as destination address etc.
The valid data of C, buffer memory 1 number register is gentle deposits a valid data number register of 2, is used to deposit the number of valid data in current cache 1 or the buffer memory 2;
The write pointer register of D, buffer memory 1 and the read pointer register of buffer memory 1 are used to deposit the write pointer and the read pointer of buffer memory 1;
The write pointer register of E, buffer memory 2 and the read pointer register of buffer memory 2 are used to deposit the write pointer and the read pointer of buffer memory 2;
The additional information outlet selector is used for selecting the data additional information of data additional information registers in output buffers 1 interior data additional information register or the buffer memory 2 according to reading the redirect condition;
Read the buffer memory selector, be used for selecting the data of output buffers 1 or buffer memory 2 according to reading the redirect condition.
Describe the operation principle of ping-pong buffer device proposed by the invention below in detail.At first explain " redirect ".So-called redirect is meant when ping-pong buffer operated (read or write) to jump to another one from a buffer memory that " normal redirect " takes place when referring to write full (for read operation) or reading sky (for read operation)." unusual redirect " just is meant the redirect of writing that triggers generation down in other condition (non-write full condition) so; Therefore: unusual redirect condition only can be created in the write port of ping-pong buffer, the redirect condition of the read port of ping-pong buffer is unique: certain buffer memory that is exactly ping-pong buffer " has been read sky ", and this had also comprised original not write full buffer memory and read sky because of unusual redirect certainly.
The additional information of input data is non-real-times, or by the control information that the final receiver of data is brought, can utilize these information that data are further classified.Data additional information analysis module is analyzed the additional information of data, also can produce unusual redirect condition, and the information after will analyzing exists in the additional information register of buffer memory correspondence at data place, reads use for follow-up processing unit.
It also is that the inner buffer degree of depth is a ping-pong buffer of 1 that buffer memory 1 interior data additional information register and buffer memory 2 interior data additional information registers group lump together.In buffer entity inside, buffer memory 1 and buffer memory 2 are the storage component parts that physically separate, and they are symmetrical, can be made of single port RAM, also can be built by registers group; Storage organization in the buffer memory is: the control of data+data and state information; Wherein control and state information are decided as required, can be need be delivered to the data of next stage processing unit with road information, and also can be the intermediate parameters that will use in this module.The degree of depth of buffer memory can be decided according to concrete needs, is generally 4,8 or 16; The width of buffer memory depends on the width of data width (generally being 32) and state of a control information.
At every turn to each buffer memory (buffer memory 1 or buffer memory 2) read or write operation all is that the original position of buffer memory begins, but because there is the situation of unusual redirect in ping-pong buffer, so might not write full by certain buffer memory, represent the write operation of current cache has been proceeded to which position (it is effective having represented to have in the current cache how many data) so need " write pointer register ", this register begins certain buffer memory is carried out resetting in the write operation at An, when carrying out write operation, bring in constant renewal in, in the time of write operation generation redirect, the value that the write pointer register keeps at that time is constant; When Dn carries out read operation to this buffer memory, can instruct read operation with reference to this write pointer register value, each buffer memory also has one " read pointer register " simultaneously, Dn whenever reads a number, just upgrade once " read pointer register ", update rule is consistent with renewal " write pointer register ", like this when the numerical value of " read pointer register " equals the numerical value of " write pointer register ", just expression is read empty, when reading sky, read pointer zero clearing, read operation jump on the another one buffer memory.

Claims (6)

1, a kind of ping-pong buffer device is characterized in that comprising:
Data additional information analysis module, be used to analyze the data additional information of input, analysis result is input to the additional information input selector, and the unusual redirect condition when producing and write the full or normal redirect condition when reading the sky buffer memory, not writing full buffer memory simultaneously outputs to writes redirect condition processing module;
The additional information input selector receives data additional information analysis module and the output result who writes redirect condition processing module, selects the data additional information to enter the data additional information register of buffer memory 1 or the data additional information register of buffer memory 2;
The input data analysis module, be used to analyze the data of input and data with road information, the data of analyzing the back additivity are outputed to write the buffer memory selector, and produce the unusual redirect condition of data type and output to and write redirect condition processing module;
Write the buffer memory selector, receive the data of additivity of input data analysis module output and the output of writing redirect condition processing module, select to put into data in the buffer memory 1 or in the buffer memory 2;
Write redirect condition processing module, be used to handle the various redirect conditions that receive, the selection result that produces is outputed to the additional information input selector and writes the buffer memory selector select;
The ping-pong buffer module is used for buffer memory input data and input data additional information; Specifically comprise
A, buffer memory 1 and buffer memory 2, two buffers in the ping-pong buffer module are used for the data that buffer memory is write the output of buffer memory selector;
Data additional information register in data additional information register and the buffer memory 2 is used to deposit the data additional information that the additional information input selector is exported in B, the buffer memory 1;
The valid data of C, buffer memory 1 number register is gentle deposits a valid data number register of 2, is used to deposit the number of valid data in current cache 1 or the buffer memory 2;
The write pointer register of D, buffer memory 1 and the read pointer register of buffer memory 1 are used to deposit the write pointer and the read pointer of buffer memory 1;
The write pointer register of E, buffer memory 2 and the read pointer register of buffer memory 2 are used to deposit the write pointer and the read pointer of buffer memory 2;
The additional information outlet selector is used for selecting the data additional information of data additional information registers in output buffers 1 interior data additional information register or the buffer memory 2 according to reading the redirect condition;
Read the buffer memory selector, be used for selecting the data of output buffers 1 or buffer memory 2 according to reading the redirect condition.
2, ping-pong buffer device according to claim 1 is characterized in that: buffer memory 1 and buffer memory 2 are storage component parts of the symmetry of physically separating.
3, ping-pong buffer device according to claim 2 is characterized in that: described storage component part can be made of single port RAM, also can be built by registers group.
4, ping-pong buffer device according to claim 1 is characterized in that: it is that the inner buffer degree of depth is a ping-pong buffer of 1 that buffer memory 1 interior data additional information register and buffer memory 2 interior data additional information registers group lump together.
5, ping-pong buffer device according to claim 1 is characterized in that: in the data in buffer, a data high position has been added the real-time control information of type in buffer memory 1 and buffer memory 2.
6, ping-pong buffer device according to claim 1 is characterized in that: the data additional information that data additional information register is deposited in data additional information register and the buffer memory 2 in the described buffer memory 1 comprises destination address.
CNB2004100428720A 2004-05-28 2004-05-28 Ping pong buffer device Expired - Fee Related CN100349442C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2004100428720A CN100349442C (en) 2004-05-28 2004-05-28 Ping pong buffer device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2004100428720A CN100349442C (en) 2004-05-28 2004-05-28 Ping pong buffer device

Publications (2)

Publication Number Publication Date
CN1585373A CN1585373A (en) 2005-02-23
CN100349442C true CN100349442C (en) 2007-11-14

Family

ID=34601693

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2004100428720A Expired - Fee Related CN100349442C (en) 2004-05-28 2004-05-28 Ping pong buffer device

Country Status (1)

Country Link
CN (1) CN100349442C (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104252331A (en) * 2013-06-29 2014-12-31 华为技术有限公司 Multiplying accumulator

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100372406C (en) * 2005-02-25 2008-02-27 华为技术有限公司 Method and apparatus for transmitting data between substation plates
CN100419723C (en) * 2005-12-30 2008-09-17 北京中星微电子有限公司 Multi-interruption cache device and method
CN1933575B (en) * 2006-09-30 2010-06-23 康佳集团股份有限公司 Video recording method for photographic hand-held equipment
CN101494636B (en) * 2008-01-23 2013-01-16 中兴通讯股份有限公司 Method and apparatus for ordering data based on rapid IO interconnection technology
CN101777031B (en) * 2009-01-14 2012-02-08 中兴通讯股份有限公司 Direct memory access controller and data transmission method
CN102023929B (en) * 2009-09-15 2012-07-25 上海摩波彼克半导体有限公司 Data buffering system structure based on ping-pong buffering way and implementation method thereof
CN102098090B (en) * 2009-12-11 2013-07-24 上海贝尔股份有限公司 Method for caching data in multi-antenna receiver and corresponding device and receiver
CN101848395A (en) * 2010-06-13 2010-09-29 上海交通大学 Decoder for H.264/AVC input code stream and control method thereof
CN102385555B (en) * 2010-08-27 2015-03-04 深圳市朗科科技股份有限公司 Caching system and method of data caching
KR20130021988A (en) * 2011-08-24 2013-03-06 현대모비스 주식회사 Device for overlaying image obtained by camera for vehicle and method thereof
CN103377030B (en) * 2012-04-26 2016-12-21 华为技术有限公司 image rotation control method and device
CN104243341B (en) * 2014-09-22 2017-09-08 曙光信息产业(北京)有限公司 Data processing method and device
CN108153679A (en) * 2016-12-05 2018-06-12 腾讯科技(深圳)有限公司 A kind of data loading, the method, apparatus and equipment of data processing
CN112486901A (en) * 2020-11-30 2021-03-12 清华大学 Memory computing system and method based on ping-pong buffer

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1342953A (en) * 2000-09-13 2002-04-03 瑞昱半导体股份有限公司 Structure and method of processing images of fast scanner
US6721316B1 (en) * 2000-02-14 2004-04-13 Cisco Technology, Inc. Flexible engine and data structure for packet header processing

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6721316B1 (en) * 2000-02-14 2004-04-13 Cisco Technology, Inc. Flexible engine and data structure for packet header processing
CN1342953A (en) * 2000-09-13 2002-04-03 瑞昱半导体股份有限公司 Structure and method of processing images of fast scanner

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104252331A (en) * 2013-06-29 2014-12-31 华为技术有限公司 Multiplying accumulator
CN104252331B (en) * 2013-06-29 2018-03-06 华为技术有限公司 Multiply-accumulator

Also Published As

Publication number Publication date
CN1585373A (en) 2005-02-23

Similar Documents

Publication Publication Date Title
CN100349442C (en) Ping pong buffer device
US11977977B2 (en) Methods and systems for data analysis in a state machine
US11928590B2 (en) Methods and systems for power management in a pattern recognition processing system
US9535861B2 (en) Methods and systems for routing in a state machine
US9075428B2 (en) Results generation for state machine engines
US9509312B2 (en) Boolean logic in a state machine lattice
US20170261956A1 (en) Counter operation in a state machine lattice
US8782624B2 (en) Methods and systems for detection in a state machine
US10254976B2 (en) Methods and systems for using state vector data in a state machine engine
CN103279309A (en) DDR control device and method based on FPGA
CN1329809C (en) Controller of magnetic disk array and its working method
US20230176999A1 (en) Devices for time division multiplexing of state machine engine signals
CN101794258B (en) Interface apparatus, calculation processing apparatus, interface generation apparatus, and circuit generation apparatus
EP2328074A1 (en) Queue management
CN101998135A (en) System for collecting and playing mobile television signal and control method
CN100414648C (en) Semiconductor device
CN103345377A (en) FIFO storer control method and device
CN102930898A (en) Method of structuring multiport asynchronous storage module
CN100461788C (en) Method and device for connection of network proceesor schedling
US20040111247A1 (en) Optimization of timing models using bus compression
CN116893854A (en) Method, device, equipment and storage medium for detecting conflict of instruction resources
Kuusilinna et al. DTNS: a Discrete Time Network Simulator for C/C++ Language Based Digital Hardware Simulations
JPS63278150A (en) Logical simulation device
Beyer Memory optimization for a parallel sorting hardware architecture

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
EE01 Entry into force of recordation of patent licensing contract

Assignee: SHENZHEN ZTE MICROELECTRONICS TECHNOLOGY CO., LTD.

Assignor: ZTE Corporation

Contract fulfillment period: 2007.11.26 to 2013.11.26 contract change

Contract record no.: 2008990001018

Denomination of invention: Ping pong buffer device

Granted publication date: 20071114

License type: Exclusive license

Record date: 20081031

LIC Patent licence contract for exploitation submitted for record

Free format text: EXCLUSIVE LICENSE; TIME LIMIT OF IMPLEMENTING CONTACT: 2007.11.26 TO 2013.11.26; CHANGE OF CONTRACT

Name of requester: SHENZHEN CITY ZHONGXINGWEI ELECTRON TECHNOLOGY CO.

Effective date: 20081031

C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20071114

Termination date: 20140528