CN1328668C - Initial device of elastic buffer and method thereof - Google Patents
Initial device of elastic buffer and method thereof Download PDFInfo
- Publication number
- CN1328668C CN1328668C CNB200310116321XA CN200310116321A CN1328668C CN 1328668 C CN1328668 C CN 1328668C CN B200310116321X A CNB200310116321X A CN B200310116321XA CN 200310116321 A CN200310116321 A CN 200310116321A CN 1328668 C CN1328668 C CN 1328668C
- Authority
- CN
- China
- Prior art keywords
- index
- elastic buffer
- writes
- reads
- write
- 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 - Lifetime
Links
- 239000000872 buffer Substances 0.000 title claims abstract description 75
- 238000000034 method Methods 0.000 title claims abstract description 16
- 238000009434 installation Methods 0.000 description 16
- 238000010586 diagram Methods 0.000 description 10
- 230000007812 deficiency Effects 0.000 description 9
- 241001269238 Data Species 0.000 description 2
- 230000007774 longterm Effects 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- NHDHVHZZCFYRSB-UHFFFAOYSA-N pyriproxyfen Chemical compound C=1C=CC=NC=1OC(C)COC(C=C1)=CC=C1OC1=CC=CC=C1 NHDHVHZZCFYRSB-UHFFFAOYSA-N 0.000 description 1
Images
Landscapes
- Information Transfer Systems (AREA)
Abstract
一种弹性缓冲器的初始装置及其方法。弹性缓冲器是先进先出缓冲器,依据读取索引及写入索引而分别输出与写入数据。首先,产生一随机数;接着,依据随机数及读取索引决定写入索引;最后,依据写入索引与读取索引初始化弹性缓冲区。
An initialization device and method for an elastic buffer. The elastic buffer is a first-in-first-out buffer that outputs and writes data respectively according to a read index and a write index. First, a random number is generated; then, the write index is determined according to the random number and the read index; finally, the elastic buffer is initialized according to the write index and the read index.
Description
Technical field
The present invention relates to a kind of initial installation and method thereof of impact damper, and be particularly related to initial at random (stochastic initialization) devices and methods therefor of a kind of elastic buffer.
Background technology
There are many unit to need transmission data mutually in the electronic installation.Fig. 1 is the electronic installation calcspar.Electronic installation 100 comprises first module 110, second unit 130 and impact damper 120.First module 110 is to give second unit 130 in order to output data, the speed of first module 110 output datas is identical with the speed that second unit 130 receives data on long terms, but may be different in the short time, therefore need impact damper 120 as the temporary usefulness of data.
Out of buffers (buffer underrun) may take place impact damper 120 and buffer zone overflows (buffer overrun) two kinds of mistakes.The mistake of out of buffers is meant that the buffer zone of impact damper 120 is empty, reads less than data.If the mistake of out of buffers then may take place greater than the speed that writes in the speed that reads.The mistake that buffer zone overflows is meant that the buffer zone of impact damper 120 is full, can't write data again.If the mistake that buffer zone overflows then may take place greater than the speed that reads in the speed that writes.
Fig. 2 is the synoptic diagram of impact damper 120.Impact damper 120 is that (storage area that it had can be considered as annular arrangement for First In FirstOut, impact damper FIFO), is that example is done explanation with 11 storage areas in this example, is denoted as 0-10 respectively for first in first out.Impact damper 120 is writing the position that index W indicates first module 110 write buffers 120, and indicates the position of Unit second 130 read buffers 120 to read index R.In Fig. 2, to read index R and be and point to storage area 1, expression is 1 to begin to read in the storage area, it reads the reserved area is storage area 1-7; Write index W and be in the storage area 8 position, it writes the reserved area is to be storage area 8-10, and expression is 8 to begin to write in the storage area.The data that write are to insert corresponding storage area according to writing the position of index W, write a storage area after, write index W and promptly take a step forward with clockwise direction.When reading, be the data that read according to reading the position of index R in the corresponding storage area, then, read index R and promptly take a step forward with clockwise direction.If the speed that reads is too fast, cause and read index R and catch up with and write index W, the data that expression is stored in impact damper 120 read inadequately, and this moment, the mistake of storage area deficiency promptly took place in impact damper 120; If the speed that writes is too fast, cause to write index W and catch up with and read index R, expression impact damper 120 do not have the space can be again for writing, this moment, the mistake that storage areas overflow 120 took place in impact damper.
For the mistake of preventing impact damper 120 takes place, before passing data, need impact damper 120 is carried out initialization, just when impact damper 120 is sky, be predetermined number that writes the reserved area and the number that reads the reserved area.Generally be to set number that writes the reserved area and the number that reads the reserved area, make the wrong less generation that the storage area is not enough or overflow for equating.But, if the number of storage area is an odd number, can't make number that writes the reserved area and the number that reads the reserved area when then initial just for equating, tend to take place the storage area deficiency or tend to take place the mistake that the storage area overflows and elastic buffer 120 is had.
Fig. 3 is impact damper 120 synoptic diagram that tend to take place the mistake of storage area deficiency.When initial, write remain with 6 storage areas after the index W can be for writing, the quantity that just writes the reserved area is 6; Have 5 storage areas can supply to read after reading index, the quantity that just reads the reserved area is 5.The quantity that writes the reserved area is greater than the quantity that reads the reserved area, so the impact damper 120 of this situation tends to take place the mistake of storage area deficiency.
Fig. 3 B is the impact damper synoptic diagram that tends to take place the mistake of overflowing the storage area.When initial, the quantity that writes the reserved area is to be 5, and the quantity that reads the reserved area is to be 6.The quantity that writes the reserved area is less than the quantity that reads the reserved area, so the impact damper of this situation tends to take place the mistake that the storage area overflows.
Because reading speed and writing speed cannot not be fixing and can't predict, thus initial buffer mistake is a problem demanding prompt solution to avoid that the storage area deficiency takes place or overflow etc.
Summary of the invention
In view of this, the invention provides a kind of random mode initial installation and method thereof of buffer zone, that is propose a kind of elastic buffer and How It Works thereof.
The present invention proposes a kind of initial methods of elastic buffer.Elastic buffer is to be first-in first-out buffer, according to reading index and writing index and export and write data respectively.At first, produce a random number; Then, according to random number and read index decision and write index; At last, according to writing index and reading index initialization elastic buffer.
The present invention also proposes a kind of initial methods of elastic buffer.Elastic buffer is a first-in first-out buffer, reads index and according to one and writes index and export and write data respectively.Initial installation comprises: tandom number generator, in order to export a random number; Read the index totalizer, read index in order to generation; Combiner receives random number and reads index and export combined value according to this; Write index generator, write index in order to produce this.Writing index generator comprises: write the index totalizer, write index in order to output; Multiplexer receives combined value and writes pointer and output writes index, and wherein when this elastic buffer of initialization, multiplexer can select combined value as writing index, or selects to write pointer with as writing index.
For foregoing of the present invention, feature and advantage can be become apparent, preferred embodiment cited below particularly, and conjunction with figs. are described in detail below.
Description of drawings
Fig. 1 is the electronic installation calcspar of known technology.
Fig. 2 is the synoptic diagram in the elastic buffer district of known technology.
Fig. 3 A is the buffer zone synoptic diagram of mistake that tends to take place out of buffers of known technology.
Fig. 3 B is the buffer zone synoptic diagram that tends to take place the mistake that buffer zone overflows of known technology.
Fig. 4 is a kind of electronic installation calcspar according to a preferred embodiment of the present invention.
Fig. 5 is the initial methods process flow diagram of elastic buffer.
Fig. 6 is the initial installation synoptic diagram in elastic buffer district.
The reference numeral explanation
110,410: first module
120: impact damper
130,430: the second unit
420: elastic buffer
422: initial installation
612: tandom number generator
614: read the index totalizer
616: combiner
620: write the index totalizer
622: multiplexer
Embodiment
Storage area deficiency (buffer underrun) may take place elastic buffer and the storage area overflows (buffer overrun) two kinds of mistakes.As previously mentioned, the mistake of storage area deficiency is meant that impact damper is empty, reads less than data.If the mistake of storage area deficiency then may take place greater than the speed that writes in the speed that reads.The mistake that the storage area overflows is meant that impact damper is full, can't write data again.If the mistake that the storage area overflows then may take place greater than the speed that reads in the speed that writes.
The index that writes of the elastic buffer when initial with the address of reading index is and the wrong closely bound up of storage area can or can not be taken place afterwards, so the present invention promptly is can effectively avoid the generation of storage area mistake in order to elastification initial elasticity impact damper.Because writing speed and reading speed are unfixed, the present invention adopts the initial mode of random mode to take place with the mistake of avoiding the storage area as far as possible.
Fig. 4 is a kind of electronic installation calcspar according to a preferred embodiment of the present invention.Electronic installation 400 comprises first module 410, second unit 430 and elastic buffer 420.First module 410 is to give second unit 430 in order to output data, the speed of first module 410 output datas is identical with the speed that second unit 430 receives data on long terms, but may be different in the short time, so elasticity of demand buffer zone 420 be as the temporary usefulness of data.
Fig. 5 is the initial methods process flow diagram of elastic buffer 420.At first, produce a random number S, shown in step 502.Then, determine to write index W according to reading index R and random number, shown in step 504.At last, according to reading index R and writing index W and initialization elastic buffer 420, shown in step 506.
Because writing the speed of elastic buffer 420 is unfixed with the speed that reads elastic buffer 420, therefore when initialization elastic buffer 420, the present invention produces random number S in step 502, determine to write index W at random mode, use the number that decision respectively writes the reserved area and reads the reserved area.In the known method, be to write the number and the fixed number that reads the reserved area, for example one of situation of Fig. 3 A or Fig. 3 B of reserved area when initial.If adopt the number that reads the reserved area less than the number that writes the reserved area when initial, as the situation of Fig. 3 A, and just the mistake of storage area deficiency may more often take place faster under the situation in reading speed backward; If adopt the number that writes the reserved area less than the number that reads the reserved area when initial, as the situation of Fig. 3 B, and just the mistake that the storage area overflows may more often take place faster under the situation in writing speed backward.The present invention is the position that determines to write index W in mode at random, may also may therefore can avoid repeating taking place with a kind of storage area mistake, thereby reduce the chance that the storage area mistake takes place as the situation of Fig. 3 B as the situation of Fig. 3 A.
Fig. 6 is initial installation 422 synoptic diagram in the elastic buffer 420.Initial installation 422 comprises tandom number generator 612, reads index totalizer 614, combiner 616 and write index generator.Writing index generator comprises and writes index totalizer 620 and multiplexer 622.Tandom number generator 612 is in order to output random number S.Read index totalizer 614 and read index R (read index R also can be transferred to read index totalizer 614) in order to generation.Combiner 616 is to export combined value C according to reading index R and random number S.Write index totalizer 620 and write index D in order to output.Multiplexer 622 receives combined value C and writes index D and export and writes index W, wherein when initialization elastic buffer 420, multiplexer 622 selects combined value C as the value that writes index W, when the normal access data of elastic buffer 420, multiplexer 622 selects to write index D with as writing index W (write index W also can be transferred to write index totalizer 620).When elastic buffer 420 is sky, promptly can send initialize signal E and give multiplexer 622, multiplexer 622 determines to select combined value C or writes index D according to initialize signal E again.Elastic buffer carries out initialization according to reading index R and write index W, and decision writes the reserved area and read the number of reserved area.
Under the little situation of the storage area of elastic buffer quantity, easier generation storage area overflows or not enough mistake, uses the present invention can reduce the chance that the storage area mistake takes place effectively.At this moment, the random number S that is produced can be 1 or 0, so that the initially quantity gap change between negative 1 to 1 that writes the reserved area and read the reserved area of time.Certainly, also can be other integer, the quantity of storage area is big more, and the round values that random number S can occur is just big more.When especially the number in the storage area of elastic buffer is odd number, writes the reserved area and can not equate, be more suitable for using the present invention, write reserved area and the number that reads the reserved area to change randomly when initial with the number that reads the reserved area.For example add up to (2n+1) in the reserved area of elastic buffer when individual, wherein n is a positive integer, and making the number that writes the reserved area according to random number S is n or (n+1) individual.
The initial installation of the disclosed elastic buffer of the above embodiment of the present invention and method thereof be with at random mode determine when initial elastic buffer write reserved area and the number that reads the reserved area so that elastic buffer can both make the chance of storage area mistake drop to minimum in the environment of various different read or write speeds.
In sum; though the present invention discloses as above with a preferred embodiment; but it is not in order to limit the present invention; anyly have the knack of this skill person; without departing from the spirit and scope of the present invention; when can being used for a variety of modifications and variations, so protection scope of the present invention is as the criterion when looking accompanying the claim person of defining.
Claims (7)
1. the initial method of an elastic buffer, this elastic buffer is a first-in first-out buffer, reads index and according to one and writes index and export and write data respectively, this method comprises the steps:
Produce a random number S, this random number S is an integer;
Read index according to this random number and this and export a combined value;
Required this writes index when determining this elastic buffer initialization according to this combined value; And
According to this read index with determined this write this elastic buffer of index initialization,
Wherein, when this elastic buffer of initialization, for elastic buffer with odd number 2n+1 storage area, distance when this reads index and this difference that writes index and is n or n+1 memory block is for farthest, for having an even number 2n storage area, distance when this reads index and this difference that writes index and is n memory block is for farthest, and wherein, n is a positive integer.
2. the apparatus for initializing of an elastic buffer, in order to this elastic buffer of initialization, this elastic buffer is a first-in first-out buffer, reads index and according to one and writes index and export and write data respectively, this device comprises:
One tandom number generator, in order to export a random number, this random number is an integer;
One reads the index totalizer, reads index in order to produce this;
One combiner receives this random number and this reads index and exports a combined value according to this; And
One writes index generator, writes index in order to produce this, comprising:
Write the index totalizer, write index in order to export one; And
One multiplexer receives this combined value and this and writes index and export this and write index, and wherein when this elastic buffer of initialization, this multiplexer selects this combined value to write index as this.
3. apparatus for initializing as claimed in claim 2, wherein, this elastic buffer comprises 2n+1 storage area, wherein, n is a positive integer.
4. apparatus for initializing as claimed in claim 3, wherein, this writes index and this difference that reads index is n.
5. apparatus for initializing as claimed in claim 3, this writes index and this difference that reads index is n+S, and S is an integer.
6. apparatus for initializing as claimed in claim 3, this reads index and also can be transferred to this and read the index totalizer, and this writes index and also can be transferred to this and write the index totalizer.
7. apparatus for initializing as claimed in claim 2 wherein, when this elastic buffer is sky, promptly sends an initialize signal and gives this multiplexer, and this multiplexer determines to select this combined value according to this initialize signal again, and maybe this writes index.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CNB200310116321XA CN1328668C (en) | 2003-11-19 | 2003-11-19 | Initial device of elastic buffer and method thereof |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CNB200310116321XA CN1328668C (en) | 2003-11-19 | 2003-11-19 | Initial device of elastic buffer and method thereof |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN1545032A CN1545032A (en) | 2004-11-10 |
| CN1328668C true CN1328668C (en) | 2007-07-25 |
Family
ID=34337548
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CNB200310116321XA Expired - Lifetime CN1328668C (en) | 2003-11-19 | 2003-11-19 | Initial device of elastic buffer and method thereof |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN1328668C (en) |
Families Citing this family (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN100430868C (en) * | 2005-12-26 | 2008-11-05 | 威盛电子股份有限公司 | Data buffer system and reading method of data buffer device |
| CN104407809B (en) * | 2014-11-04 | 2018-03-30 | 盛科网络(苏州)有限公司 | The control method of multichannel fifo buffer |
| CN116401242A (en) * | 2023-02-21 | 2023-07-07 | 超聚变数字技术有限公司 | Unique identifier generation method and computing device |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5781802A (en) * | 1995-02-03 | 1998-07-14 | Vlsi Technology, Inc. | First-in-first-out (FIFO) controller for buffering data between systems which are asynchronous and free of false flags and internal metastability |
| US6233629B1 (en) * | 1999-02-05 | 2001-05-15 | Broadcom Corporation | Self-adjusting elasticity data buffer with preload value |
| US20030105985A1 (en) * | 2001-12-03 | 2003-06-05 | Keller James B. | Method and circuit for initializing a de-skewing buffer in a clock forwarded system |
-
2003
- 2003-11-19 CN CNB200310116321XA patent/CN1328668C/en not_active Expired - Lifetime
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5781802A (en) * | 1995-02-03 | 1998-07-14 | Vlsi Technology, Inc. | First-in-first-out (FIFO) controller for buffering data between systems which are asynchronous and free of false flags and internal metastability |
| US6233629B1 (en) * | 1999-02-05 | 2001-05-15 | Broadcom Corporation | Self-adjusting elasticity data buffer with preload value |
| US20030105985A1 (en) * | 2001-12-03 | 2003-06-05 | Keller James B. | Method and circuit for initializing a de-skewing buffer in a clock forwarded system |
Also Published As
| Publication number | Publication date |
|---|---|
| CN1545032A (en) | 2004-11-10 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US8001409B2 (en) | Synchronization device and methods thereof | |
| US10133549B1 (en) | Systems and methods for implementing a synchronous FIFO with registered outputs | |
| JP2002533857A (en) | FIFO unit with single pointer | |
| JP2009540681A5 (en) | ||
| CN105320490A (en) | Method and apparatus for asynchronous FIFO circuit | |
| JP2010027032A (en) | Fifo device and method of storing data in fifo buffer | |
| CN108733594A (en) | Memory controller and data storage device | |
| CN101350218B (en) | Virtual multi-port memory as well as method for storing and reading data thereof | |
| JP7238171B2 (en) | Memory device providing bad column repair and method of operation | |
| US6112268A (en) | System for indicating status of a buffer based on a write address of the buffer and generating an abort signal before buffer overflows | |
| CN113485647A (en) | Data writing method, data reading method and first-in first-out memory | |
| CN115221082A (en) | Data caching method and device and storage medium | |
| US7979607B2 (en) | Cascadable high-performance instant-fall-through synchronous first-in-first-out (FIFO) buffer | |
| CN1328668C (en) | Initial device of elastic buffer and method thereof | |
| US20030172242A1 (en) | Self-synchronous FIFO memory device having high access efficiency, and system provided with interface for data transfer using the same | |
| JP2004062630A (en) | FIFO memory and semiconductor device | |
| CN101587585A (en) | Image processing system and data processing method thereof | |
| US7072998B2 (en) | Method and system for optimized FIFO full conduction control | |
| TWI237765B (en) | Adapting device for use in a computer system | |
| US6715021B1 (en) | Out-of-band look-ahead arbitration method and/or architecture | |
| KR101439844B1 (en) | Storage space allocation method and apparatus | |
| CN110737617B (en) | Direct Memory Access | |
| US7788426B2 (en) | Apparatus and method for initializing an elastic buffer | |
| CN109344105B (en) | Bus interface system | |
| CN101520722A (en) | Method for accessing first-in first-out buffer and controller thereof |
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 | ||
| CX01 | Expiry of patent term |
Granted publication date: 20070725 |
|
| CX01 | Expiry of patent term |