Hyperchannel first in first out data buffering memory storage
Technical field
The present invention relates to use in a kind of ASIC (Application SpecificIntegrated Circuit application-specific IC) or FPGA (the Field Programable GateArray field programmable gate array) design memory bank of first in first out (FIFO, First In FirstOut) mechanism to realize the device that multi-channel data cushions in data communication service.
Background technology
At present, in the ASIC or FPGA design of data communication service, often need to handle the buffering of a plurality of channel datas, common implementation method all is the mode with stack, promptly uses a FIFO to cushion separately to each passage.FIFO also can be regarded as a kind of abbreviation that is used for the memory bank of data buffering in the ASIC/FPGA design.Usually will realize that the FIFO memory function needs three parts: data storage cell, read-write pointer control module and state indicate the unit.Wherein data storage cell uses the two-port RAM store data; Read-write pointer control module is used to indicate the position of next read/write operation, and usage counter is realized usually; State indicates the unit by data being counted the full state of the sky that produces current FIFO.Under the few situation of port number, adopt method for designing clear thinking, the realization of stack FIFO realization multichannel buffer simple, but increase along with port number, ASIC or the FPGA resource used in order to structure FIFO are huge, not only need to be the identical internal control unit of the FIFO repetitive construct of each passage, expend a large amount of counter resources, and take the lot of data interconnection resources at interface.
For instance, as shown in Figure 1, data stream S is through behind the state machine St1, is assigned among the FIFO of 64 stacks and cushions F1-F64.If the data width of each FIFO is 8bit in this case, the FIFO degree of depth is 64, spent resource also need expend the counter of 64 * 2 6bit that constitute the read/write address pointer and the data counter of 64 * 6bit except 64 64 * 8 two-port RAM.What is more important, the output of 8 bit data of 64 FIFO also need multiplexed (MUX) logic that 64 * 8bit is wide, and this MUX will expend a large amount of combination logic resource, and logical wiring herein will be very difficult also simultaneously.Therefore therefore the dominant frequency of total system can be had a strong impact on.As seen, the increase along with port number realizes that the stack meeting of FIFO is more and more difficult.
Summary of the invention
At above-mentioned existing in prior technology defective and deficiency based on stack, the object of the present invention is to provide a kind of simple in structure, save resource, the fast hyperchannel data fifo buffer storage of access speed.
For realizing this purpose, the present invention is core concept with the memory partition, designed a kind of hyperchannel first in first out (FIFO) data buffering memory storage, be used for the data fifo that the buffered data from a plurality of passages carries out is separately cushioned, this device comprises: data storage cell, read-write pointer control module and state indicate the unit;
Described data storage cell by at least one double-port RAM (RAM) (R1), address resource to this RAM is redistributed, it is divided into a plurality of blocks by physical address, each block and each passage form certain mapping relations, for from the read/write operation of certain passage with the corresponding block of this passage in according to the access of FIFO mechanism;
Described read-write pointer control module is made up of read pointer control module and write pointer control module, described read pointer control module can be respectively the position of next read operation in each passage indication and the corresponding block of this passage, and described write pointer control module can be respectively the position of next write operation in each passage indication and the corresponding block of this passage.
Described state indicates sky/full state that unit (F) is used for writing down current each FIFO block of above-mentioned RAM.
More particularly, described two-port RAM (R1) can adopt the mode of high low address combination to conduct interviews, and the high address is corresponding with the port numbers of passage, and status address also is that the position of the next read/write operation of each block is then produced by the read/write pointer control module; Each FIFO block of described two-port RAM (R1) is divided according to the high address.
Because the shared two-port RAM of a plurality of passages (R1) among the present invention, the read/write pointer control of each passage also is integrated in the read/write pointer control module respectively, therefore reduced the resource that a plurality of independent FIFO in the prior art construct employed a large amount of read-write pointer counters, and simplified the complexity of interface logic, the dominant frequency along with saving system in ASIC or FPGA design of the simplification of structure and resource can be improved simultaneously.
Description of drawings
By the accompanying drawing of the following detailed and the corresponding embodiment of the invention, will understand the present invention fully more comprehensively.Certainly, accompanying drawing should not be used to limit the invention in the specific example, and it just plays the effect of explaining and helping to understand.
Fig. 1 shows the system chart that adopts a plurality of FIFO to support multichannel buffer
Fig. 2 shows the internal frame diagram of the instantiation that adopts hyperchannel data fifo snubber assembly of the present invention
Embodiment
Fig. 2 is the internal frame diagram that adopts the instantiation of hyperchannel data fifo snubber assembly of the present invention.As shown in Figure 2, data storage cell comprises that a two-port RAM R1 is used for a plurality of passages are carried out data buffering, and the address resource of this RAM R1 is redistributed, and divides the block visit into by passage, and each block inside can be regarded as the FIFO of respective channel.
The read/write pointer control module is by constituting by at least one totalizer A1/A2 and a single port RAM R2/R3.The address of the single port RAM R2/R3 of described read/write pointer control module is also pressed passage and is divided, with deposit in the corresponding R2/R3 of certain passage address with the corresponding R1 block of this passage in the side-play amount of next read/write operation position.After each read/write operation finishes, all use read/write totalizer A1/A2 that current side-play amount is added and leave in the lump in the R2/R3 unit corresponding, as the side-play amount of the read/write operation next time of the corresponding block of this passage with access port.
The visit of data storage unit is preferably adopted the mode of height address combination generation, the high address uses the port numbers of passage to realize, low order address is then provided by the read/write pointer control module, each block address of R1 is the tunnel ends slogan in the present embodiment, and the storage address of each passage respective block side-play amount also is the port numbers of passage among the R2/R3.
When certain passage has produced the request of writing buffered data, buffered data to be written will be as the input of R1, the port numbers of this passage will be as the high address input of R1, be used to the block of indicating buffered data to write, this port numbers also will be as the address input of R2 simultaneously, be used to indicate the storage address of this block side-play amount, R2 will take out side-play amount and send the low order address input of R1 as R1 to according to this address, R1 will make up the high address and low order address is located the position that buffered data writes, and these data are write.Simultaneously totalizer A1 adds the side-play amount of taking out and returns in the lump in the appropriate address of depositing among the R2, as this passage respective block side-play amount of write operation next time.
When certain passage has produced the request of reading buffered data, the port numbers of this passage will be as the high address input of R1, be used to indicate the block of playback buffer data, this port numbers also will be as the address input of R3 simultaneously, be used to indicate the storage address of this block side-play amount, R3 will send the low order address input of R1 as R1 according to the side-play amount that take out this address to, and R1 will make up the high address and low order address is located buffered data to be read, and with this data output.Simultaneously totalizer A2 adds the side-play amount of taking out and returns in the lump in the appropriate address of depositing among the R3, as the side-play amount of this passage respective block read operation next time.
Realized like this visit of a plurality of ports is only needed one a group of data line and a set of address lines, avoided using the interconnection line of multi-group data line, saved a large amount of logic interconnection resources, and simplified Interface design.
As shown in Figure 2, the address space of R1 is divided equally by port number, and the read/write address of R1 is formed by the output data combination of tunnel ends slogan and R2/R3, and port numbers also is the address of R2/R3 simultaneously.Can realize the mapping one by one in passage and address ram space like this.Therefore the data of each passage can directly be visited at the ram space of mapping.
Still with the example that is applied as of Fig. 1, compare with the FIFO among Fig. 1, the resource of this multiport FIFO is many two 64 * 6 RAM, but saved 63 * 2 * 6bit counter resources that constitutes the read/write address counter has also saved 8 to 64 encoding and decoding logic and a large amount of interconnection resources.
Any reference symbol does not in the present invention limit protection scope of the present invention." comprise " that a speech do not get rid of the appearance of other assembly of the present invention outside listed." one " before assembly or unit does not get rid of the existence of a plurality of this assemblies or unit.