[go: up one dir, main page]

CN100568382C - FIFO memory - Google Patents

FIFO memory Download PDF

Info

Publication number
CN100568382C
CN100568382C CNB2007101420861A CN200710142086A CN100568382C CN 100568382 C CN100568382 C CN 100568382C CN B2007101420861 A CNB2007101420861 A CN B2007101420861A CN 200710142086 A CN200710142086 A CN 200710142086A CN 100568382 C CN100568382 C CN 100568382C
Authority
CN
China
Prior art keywords
data
cell
row
selection
output
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.)
Active
Application number
CNB2007101420861A
Other languages
Chinese (zh)
Other versions
CN101110259A (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.)
Via Technologies Inc
Original Assignee
Via Technologies Inc
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 Via Technologies Inc filed Critical Via Technologies Inc
Priority to CNB2007101420861A priority Critical patent/CN100568382C/en
Publication of CN101110259A publication Critical patent/CN101110259A/en
Application granted granted Critical
Publication of CN100568382C publication Critical patent/CN100568382C/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides a first-in first-out memory, comprising: a buffer unit including a plurality of cells for storing data; and the output control circuit reads the data stored in the buffer unit according to a reading pointer and a reading byte number. The output control circuit includes: a selection signal generating module for generating a plurality of selection signals according to the reading pointer and the reading byte number; and a data output module, reading the data of the corresponding cell from the buffer unit according to the plurality of selection signals and the reading pointer, and outputting the data as the output data of the first-in first-out memory. The first-in first-out memory greatly reduces the load of a reading pointer and a writing pointer, avoids using a complex driving circuit, thereby reducing the complexity of a control circuit and the number of transmission gates, and has relatively smaller area and higher data transmission speed.

Description

先进先出存储器 FIFO memory

技术领域 technical field

本发明是有关于一种先进先出存储器,特别是有关于一种高速的先进先出存储器(First In First Out,FIFO)。The present invention relates to a first-in-first-out memory, in particular to a high-speed first-in-first-out memory (First In First Out, FIFO).

背景技术 Background technique

图1所示为一现有技术中具有四输入四输出的先进先出存储器(First In First Out,FIFO)。先进先出存储器100可应用于中央处理器(Central Processing Unit,CPU)和北桥(North Bridge)之间进行传输数据。先进先出存储器100具有四路多工器(Mux)111、112、113、114、141、142、143和144,暂存器121、122、123和124以及十六路多工器131、132、133和134。其中,暂存器121、122、123和124均为可储存16组32位数据的先进先出暂存器。FIG. 1 shows a first-in-first-out memory (First In First Out, FIFO) with four inputs and four outputs in the prior art. The FIFO memory 100 can be applied to transmit data between a central processing unit (Central Processing Unit, CPU) and a North Bridge (North Bridge). The FIFO memory 100 has four multiplexers (Mux) 111, 112, 113, 114, 141, 142, 143, and 144, registers 121, 122, 123, and 124, and sixteen multiplexers 131, 132 , 133 and 134. Among them, the registers 121 , 122 , 123 and 124 are first-in first-out registers capable of storing 16 sets of 32-bit data.

输入数据Data0、Data1、Data2和Data3通过四路多工器111、112、113和114存入暂存器121、122、123和124的对应位置。十六路多工器131、132、133和134接收来自暂存器121、122、123和124的暂存数据并输出至四路多工器141、142、143和144。The input data Data0 , Data1 , Data2 and Data3 are stored in the corresponding positions of the temporary registers 121 , 122 , 123 and 124 through the four-way multiplexers 111 , 112 , 113 and 114 . Sixteen-way multiplexers 131 , 132 , 133 and 134 receive temporary data from registers 121 , 122 , 123 and 124 and output to four-way multiplexers 141 , 142 , 143 and 144 .

从图1可以看出,由于四路多工器111、112、113和114必须具有驱动具有储存16组32位的暂存器121、122、123和124的驱动能力,即必须通过写入指针Push从64个32位的存储单元中选择出用来存储数据Data0~Data3的存储单元,使得写入指针Push的负载很大。因此四路多工器111、112、113和114需要较大驱动器,从而增加四路多工器111、112、113和114电路复杂度和传输门的数目,并且由于传输门的数目较多,数据传输也比较慢。同样地,在先进先出存储器100的输出端,存于暂存器121~124的数据需要通过两级多工器,即十六路多工器131~134与四路多工器141~144才能以先进先出的方式输出,进而使得电路复杂度增加而数据传输速度降低。As can be seen from Fig. 1, since the four-way multiplexer 111, 112, 113 and 114 must have the driving ability to drive the temporary registers 121, 122, 123 and 124 that store 16 groups of 32 bits, that is, it must pass the write pointer Push selects the storage units used to store data Data0-Data3 from 64 32-bit storage units, which makes the load of writing pointer Push very heavy. Therefore, the four-way multiplexers 111, 112, 113, and 114 need larger drivers, thereby increasing the circuit complexity and the number of transmission gates of the four-way multiplexers 111, 112, 113, and 114, and because the number of transmission gates is large, Data transfers are also slower. Similarly, at the output end of the FIFO memory 100, the data stored in the temporary registers 121-124 need to pass through two stages of multiplexers, that is, sixteen-way multiplexers 131-134 and four-way multiplexers 141-144 In order to output in a first-in first-out manner, the complexity of the circuit increases and the data transmission speed decreases.

发明内容 Contents of the invention

本发明的目的在于提供一种高速的先进先出存储器。The object of the present invention is to provide a high-speed first-in-first-out memory.

本发明提供一种先进先出存储器,包括:一缓冲单元,包含多个用于存储数据的单元格;一输入控制电路,依据一写入指针与一写入字节数,将接收的数据存入所述缓冲单元;以及一输出控制电路,依据一读取指针与一读取字节数读取所述缓冲单元存储的数据。所述输入控制电路包含:一单元格选择模块,依据所述写入指针与所述写入字节数,将即将用于存储数据的单元格激活;以及一排序模块,依据所述写入指针将接收的数据存入被激活的单元格中。输出控制电路包含:一选择信号产生模块,根据所述读取指针与读取字节数产生多个选择信号;以及一数据输出模块,依据所述多个选择信号由所述缓冲单元中读取多个存储地址连续的数据,并依据读取指针由所述多个存储地址连续的数据中选择输出所述先进先出存储器的输出数据。The present invention provides a first-in-first-out memory, comprising: a buffer unit, including a plurality of cells for storing data; an input control circuit, according to a write pointer and a write byte number, to store received data input into the buffer unit; and an output control circuit for reading the data stored in the buffer unit according to a read pointer and a read byte number. The input control circuit includes: a cell selection module, which activates the cells to be used to store data according to the write pointer and the number of bytes to be written; and a sorting module, which activates the cell according to the write pointer Store the received data into the activated cell. The output control circuit includes: a selection signal generation module, which generates a plurality of selection signals according to the read pointer and the number of read bytes; and a data output module, which reads from the buffer unit according to the plurality of selection signals multiple data with consecutive storage addresses, and select and output the output data of the first-in-first-out memory from the multiple data with consecutive storage addresses according to the read pointer.

本发明所述的先进先出存储器,通过移位寄存器产生对应于即将用来存储或输出数据的单元格,因此大大降低了读取指针与写入指针的负载,避免使用复杂的驱动电路,从而降低了控制电路复杂度和传输门的数目。由于传输门的数目较少,本发明先进先出存储器具有相对较小的面积和较高的数据传输速度。The first-in-first-out memory described in the present invention uses a shift register to generate a cell corresponding to the data to be stored or output, thus greatly reducing the load on the read pointer and write pointer, and avoiding the use of complex drive circuits, thereby Reduced control circuit complexity and the number of transmission gates. Due to the small number of transmission gates, the FIFO memory of the present invention has relatively small area and high data transmission speed.

附图说明 Description of drawings

通过下面结合示例性地示出一例的附图进行的描述,本发明的上述和其他目的和特点将会变得更加清楚,其中:The above and other objects and features of the present invention will become more apparent through the following description in conjunction with the accompanying drawings exemplarily showing an example, wherein:

图1为现有技术的四输入四输出的先进先出存储器的示意图;FIG. 1 is a schematic diagram of a prior art four-input four-output FIFO memory;

图2为根据本发明一实施例的先进先出存储器的示意图;2 is a schematic diagram of a first-in-first-out memory according to an embodiment of the present invention;

图3为图2所示先进先出存储器的输入控制电路的示意图;FIG. 3 is a schematic diagram of an input control circuit of the FIFO memory shown in FIG. 2;

图4为图2所示先进先出存储器的输出控制电路的示意图;FIG. 4 is a schematic diagram of an output control circuit of the first-in-first-out memory shown in FIG. 2;

图5为图4所示先进先出存储器的输出控制电路的详细示意图;FIG. 5 is a detailed schematic diagram of the output control circuit of the FIFO memory shown in FIG. 4;

图6a~6c为图5所示选择逻辑的详细示意图。6a-6c are detailed schematic diagrams of the selection logic shown in FIG. 5 .

具体实施方式 Detailed ways

为让本发明的上述和其它目的、特征和优点能更明显易懂,下文特举出较佳实施例,并配合所附图式,作详细说明如下。In order to make the above and other objects, features and advantages of the present invention more comprehensible, preferred embodiments are listed below and described in detail in conjunction with the accompanying drawings.

如图2所示,本发明一实施例的先进先出存储器(First InFirst Out,FIFO)200包括:一控制单元20、一缓冲单元23、一输入控制电路21以及一输出控制电路22。假设本实施例中先进先出存储器200每个周期(cycle)可支持最多4个长度为32bit的数据写入,以及最多4个长度为32bit数据输出。于本实施例中,控制单元20用于依据接收的传输请求request输出一缓冲单元23的写入指针Push与一写入字节数Push_valid至输入控制电路21,以及一读取指针Pop与一读取字节数Pop_valid至输出控制电路22。于本实施例中,控制单元20设于先进先出存储器200中,但不限定于此。如本领域技术人员所知,写入指针Push指向缓冲单元23下一个可存储数据的单元格的存储地址,读取指针Pop用来指向缓冲单元23下一个数据可被读取的单元格的存储地址。假设写入字节数Push_valid与读取字节数Pop_valid均为包含4个位,用来标示将要写入的数据长度和将要读取的数据长度。举例来说,若写入字节数Push_valid为4’b0001,则将一个长度为1DW(即32bit)的数据存入缓冲单元23;若写入字节数Push_valid为4’b0011,则将两个1DW的数据存入缓冲单元23;若写入字节数Push_valid为4’b0111,则将三个1DW的数据存入缓冲单元23;若写入字节数Push_valid为4’b1111,则将四个1DW的数据存入缓冲单元23。控制单元20接收到的传输请求request可以是来自CPU的读取或写入请求。As shown in FIG. 2 , a first-in-first-out memory (First In First Out, FIFO) 200 according to an embodiment of the present invention includes: a control unit 20, a buffer unit 23, an input control circuit 21, and an output control circuit 22. Assume that the first-in-first-out memory 200 in this embodiment can support a maximum of 4 data writes with a length of 32 bits per cycle, and a maximum of 4 data outputs with a length of 32 bits. In this embodiment, the control unit 20 is configured to output a write pointer Push and a write byte number Push_valid of the buffer unit 23 to the input control circuit 21 according to the received transmission request request, and a read pointer Pop and a read Get the byte number Pop_valid to the output control circuit 22 . In this embodiment, the control unit 20 is disposed in the FIFO memory 200 , but it is not limited thereto. As known to those skilled in the art, the write pointer Push points to the storage address of the next cell of the buffer unit 23 that can store data, and the read pointer Pop is used to point to the storage of the next cell of the buffer unit 23 that can be read. address. Assume that both the number of bytes written, Push_valid, and the number of bytes read, Pop_valid, include 4 bits, which are used to indicate the length of data to be written and the length of data to be read. For example, if the number of written bytes Push_valid is 4'b0001, then a length of 1DW (ie 32bit) data is stored in the buffer unit 23; if the number of written bytes Push_valid is 4'b0011, then two The data of 1DW is stored in buffer unit 23; if the number of written bytes Push_valid is 4'b0111, then three 1DW data are stored in buffer unit 23; if the number of written bytes Push_valid is 4'b1111, then four 1DW of data is stored in the buffer unit 23 . The transfer request received by the control unit 20 may be a read or write request from the CPU.

输入控制电路21依据写入指针Push与写入字节数Push_valid将接收到的数据datain0~datain3存入先进先出缓冲单元23的相应单元格中。进一步来说,输入控制电路21包括单元格选择模块216和排序模块210。单元格选择模块216依据写入指针Push与写入字节数Push_valid最多产生四个单元格使能信号act_1~act_4,以将先进先出缓冲单元23中即将用来存储数据的单元格激活。排序模块210依据写入指针Push将接收到的数据datain0~datain3按照先进先出的方式存入由单元格使能信号act1~act4激活的单元格中,从而完成数据存储操作。The input control circuit 21 stores the received data datain0 - datain3 into corresponding cells of the FIFO buffer unit 23 according to the write pointer Push and the write byte number Push_valid. Further, the input control circuit 21 includes a cell selection module 216 and a sorting module 210 . The cell selection module 216 generates at most four cell enable signals act_1 - act_4 according to the write pointer Push and the write byte number Push_valid to activate the cells in the FIFO buffer unit 23 to be used for storing data. The sorting module 210 stores the received data datain0-datain3 into the cells activated by the cell enable signals act1-act4 in a first-in-first-out manner according to the write pointer Push, thereby completing the data storage operation.

输出控制电路22依据读取指针Pop与读取字节数Pop_valid自先进先出缓冲单元23中读取并输出数据dataout0~dataout3。于本实施例中,输出控制电路22包括数据输出模块224和选择信号产生模块225。选择信号产生模块225由多工器220和移位寄存器组221组成。多工器220依据接收的读取指针Pop和读取字节数Pop_valid产生一读取行移位信号R_shift。移位寄存器组221在读取行移位信号R_shift的控制下输出多个选择信号,即RPtr_0~RPtr_a。数据输出模块224依据多个选择信号RPtr_0~RPtr_a由先进先出缓冲单元23中选择输出相应单元格的数据,并进一步依据读取指针Pop选择输出4个数据dataout0~dataout3作为先进先出存储器200的输出。The output control circuit 22 reads and outputs the data dataout0 - dataout3 from the FIFO buffer unit 23 according to the read pointer Pop and the read byte number Pop_valid. In this embodiment, the output control circuit 22 includes a data output module 224 and a selection signal generation module 225 . The selection signal generation module 225 is composed of a multiplexer 220 and a shift register group 221 . The multiplexer 220 generates a read row shift signal R_shift according to the received read pointer Pop and the read byte number Pop_valid. The shift register group 221 outputs a plurality of selection signals, namely RPtr_0˜RPtr_a, under the control of the read row shift signal R_shift. The data output module 224 selects and outputs the data of the corresponding cell from the first-in-first-out buffer unit 23 according to multiple selection signals RPtr_0-RPtr_a, and further selects and outputs four data dataout0-dataout3 as the first-in-first-out memory 200 according to the read pointer Pop output.

以下将结合图3说明本实施例中,输入控制电路21如何依据写入指针Push与写入字节数Push_valid将接收到的数据存入缓冲单元23中。假设输入控制电路21需要将4个长度为1DW的数据datain0~datain3按照先进先出的方式放入缓冲单元23中。The following will describe how the input control circuit 21 stores the received data into the buffer unit 23 according to the write pointer Push and the write byte count Push_valid in this embodiment in conjunction with FIG. 3 . Assume that the input control circuit 21 needs to put four pieces of data datain0 - datain3 with a length of 1DW into the buffer unit 23 in a first-in first-out manner.

如图3所示,本实施例中缓冲单元23由四个先进先出的子存储块bank1~bank4构成,每一子存储块bank1~bank4的数据宽度为1DW,深度为96。也就是说,每一子存储块bank1~bank4均包含96个宽度为1DW的单元格,即单元格cell1_0~cell1_95、单元格cell2_0~cell2_95、单元格cell3_0~cell3_95和单元格cell4_0~cell4_95。因此,本实施例缓冲单元23也可看作一具有96行×4列,共包含有384个宽度为1DW的单元格的存储器。子存储块bank1~bank4位于第n(n=0,1......95)行的单元格1_n~4_n的地址是连续的,且第n+1行的单元格1_n+1与第n行的单元格4_n的地址连续是连续的,因而先进先出存储器200接收到的数据通过输入控制电路21蛇形地存入子存储块bank1~bank4的单元格中。为方便理解,本实施例在描述以及附图中将以datan_n来表示单元格celln_n中存储的数据。譬如说,单元格cell1_30中存储的数据为data1_30。As shown in FIG. 3 , the buffer unit 23 in this embodiment is composed of four first-in first-out sub-storage blocks bank1-bank4, and each sub-storage block bank1-bank4 has a data width of 1DW and a depth of 96. That is to say, each sub-storage block bank1-bank4 includes 96 cells with a width of 1DW, namely cells cell1_0-cell1_95, cells cell2_0-cell2_95, cells cell3_0-cell3_95 and cells cell4_0-cell4_95. Therefore, the buffer unit 23 in this embodiment can also be regarded as a memory with 96 rows×4 columns and totally 384 cells with a width of 1DW. The addresses of the cells 1_n to 4_n in the nth (n=0, 1...95) row of the sub-storage blocks bank1 to bank4 are continuous, and the cell 1_n+1 and the cell 1_n+1 in the n+1th row are The addresses of the cells 4_n in n rows are consecutive, so the data received by the FIFO memory 200 is stored in the cells of the sub-memory blocks bank1 - bank4 in a serpentine manner through the input control circuit 21 . For the convenience of understanding, datan_n will be used to represent the data stored in the cell celln_n in the description and drawings of this embodiment. For example, the data stored in the cell cell1_30 is data1_30.

输入控制电路21包括多工器210、211,第一移位寄存器212、第二移位寄存器213、单元格预选模块214以及一时钟控制模块215。多工器210依据写入指针Push的低两位,即Push[1:0],将接收到的数据datain0~datain3分别依据表1所示的对应关系输出至相应的子存储块bank1~bank4。其中,子存储块bank1用来存储地址的低两位为“00”的数据,子存储块bank2用来存储地址的低两位为“01”的数据,子存储块bank3用来存储地址的低两位为“10”的数据,子存储块bank4用来存储地址的低两位为“11”的数据。The input control circuit 21 includes multiplexers 210 , 211 , a first shift register 212 , a second shift register 213 , a cell preselection module 214 and a clock control module 215 . The multiplexer 210 outputs the received data datain0-datain3 to the corresponding sub-storage blocks bank1-bank4 according to the corresponding relationship shown in Table 1 according to the lower two bits of the write pointer Push, namely Push[1:0]. Among them, the sub-storage block bank1 is used to store the data whose lower two bits of the address are "00", the sub-storage block bank2 is used to store the data whose lower two bits of the address are "01", and the sub-storage block bank3 is used to store the lower two bits of the address. The data whose two bits are "10" and the sub-storage block bank4 are used to store the data whose lower two bits are "11".

表1Table 1

  Push[1:0] Push[1:0] datain0 datain0 datain1 datain1 datain2 datain2 datain3 datain3   00 00 bank1 bank1 bank2 bank2 bank3 bank3 bank4 bank4   01 01 bank2 bank2 bank3 bank3 bank4 bank4 bank1 bank1

  10 10   bank3 bank3   bank4 bank4   bank1 bank1   bank2 bank2   11 11   bank4 bank4   bank1 bank1   bank2 bank2   bank3 bank3

举例来说,若写入指针Push=8’b010100101,则数据datain0将被存入子存储块bank2,数据datain1存入子存储块bank3,数据datain2存入子存储块bank4,数据datain3存入子存储块bank1。换句话说,本实施例中输入控制电路21可通过多工器210确定数据datain0~datain3与子存储块bank1~bank4的对应关系,即确定接收到的数据将分别存入缓冲单元23的哪一列。For example, if the write pointer Push=8'b010100101, the data datain0 will be stored in the sub-storage block bank2, the data datain1 will be stored in the sub-storage block bank3, the data datain2 will be stored in the sub-storage block bank4, and the data datain3 will be stored in the sub-storage block Block bank1. In other words, in this embodiment, the input control circuit 21 can determine the corresponding relationship between the data datain0-datain3 and the sub-storage blocks bank1-bank4 through the multiplexer 210, that is, determine which column of the buffer unit 23 the received data will be respectively stored in. .

多工器211依据写入字节数Push_valid[3:0]与写入指针Push[1:0]产生一写入行移位信号W_shift,用以控制第一移位寄存器212、第二移位寄存器213的移位。第一移位寄存器212包含有96bit,在写入行移位信号W_shift的控制下顺序移位,并输出一第一行选择信号wptr_0[95:0],其96个位分别对应子存储块bank1~bank4的96个单元格,且仅有一个位为“1”。第二移位寄存器213也包含有96位,在写入行移位信号W_shift的控制下输出一第二行选择信号wptr_1[95:0],其96个位分别对应子存储决bank1~bank4的96个单元格,且仅有一个位为“1”。特别地,第一行选择信号wptr_0的起始值为wptr_0[0],即bit0为“1”,对应于缓冲单元23的第1行单元格,而第二行选择信号wptr_1的起始值为wptr_1[1],即bit1为“1”,对应于缓冲单元23的第2行单元格。多工器211依据接收到的写入指针Push[1:0]与写入字节数Push_valid[3:0]来判断即将接收到的数据是否可被完整存入当前第一、第二行选择信号wptr_0,wptr_1所对应的单元格中,若不能,则输出行移位信号W_shift,使得第一移位寄存器212、第二移位寄存器213移位,以通过第一、第二行选择信号wptr_0,wptr_1预选两行(8个)单元格。举例来说,在进行完第一笔数据存储后,若第一移位寄存器212、第二移位寄存器213接收的写入行移位信号W_shift被致能,则第一移位寄存器212输出第一行选择信号由wptr_0[0]变为wptr_0[1],第二移位寄存器213输出第二行选择信号由wptr_1[1]变为wptr_1[2],即预选缓冲单元23的第2行和第3行单元格。The multiplexer 211 generates a write row shift signal W_shift according to the write byte number Push_valid[3:0] and the write pointer Push[1:0] to control the first shift register 212, the second shift register Shift of register 213. The first shift register 212 includes 96 bits, which are sequentially shifted under the control of the write row shift signal W_shift, and output a first row selection signal wptr_0[95:0], whose 96 bits correspond to the sub memory block bank1 respectively 96 cells of ~bank4, and only one bit is "1". The second shift register 213 also includes 96 bits, and outputs a second row selection signal wptr_1[95:0] under the control of the write-in row shift signal W_shift, and its 96 bits correspond to sub-storage blocks bank1-bank4 respectively. 96 cells, and only one bit is "1". In particular, the initial value of the first row selection signal wptr_0 is wptr_0[0], that is, bit0 is "1", corresponding to the cell in the first row of the buffer unit 23, and the initial value of the second row selection signal wptr_1 is wptr_1[1], that is, bit1 is “1”, corresponds to the cell in the second row of the buffer unit 23 . The multiplexer 211 judges whether the data to be received can be completely stored in the current first and second row selections according to the received write pointer Push[1:0] and the number of written bytes Push_valid[3:0] In the cells corresponding to the signals wptr_0 and wptr_1, if not possible, the row shift signal W_shift is output, so that the first shift register 212 and the second shift register 213 are shifted to pass the first and second row selection signals wptr_0 , wptr_1 preselects two rows (8) of cells. For example, after the first data is stored, if the write row shift signal W_shift received by the first shift register 212 and the second shift register 213 is enabled, the first shift register 212 outputs the first One row selection signal is changed from wptr_0[0] to wptr_0[1], and the second shift register 213 outputs the second row selection signal from wptr_1[1] to wptr_1[2], that is, the second row and Row 3 cell.

单元格预选模块214随后依据写入指针Push[1:0]、写入字节数Push_valid[3:0]以及第一行选择信号wptr_0[n]与第二行选择信号wptr_1[n+1],按照表2~表5所示的对应关系输出相应子存储块bank1~bank4的单元格指针addr_1~addr_4,从而由预选的两行单元格中进一步选择出即将用来存储数据的单元格。The cell preselection module 214 is then based on the write pointer Push[1:0], the number of written bytes Push_valid[3:0] and the first row selection signal wptr_0[n] and the second row selection signal wptr_1[n+1] , according to the correspondence shown in Table 2-Table 5, output the cell pointers addr_1-addr_4 of the corresponding sub-storage blocks bank1-bank4, so as to further select the cell to be used to store data from the pre-selected two rows of cells.

表2:(Push_valid=4’b1111)Table 2: (Push_valid=4'b1111)

  Push[1:0] Push[1:0]   addr_1 addr_1 addr_2 addr_2  addr_3 addr_3  addr_4 addr_4   00 00   wptr_0[n] wptr_0[n] wptr_0[n] wptr_0[n]  wptr_0[n] wptr_0[n]  wptr_0[n] wptr_0[n]   01 01   wptr_1[n+1] wptr_1[n+1] wptr_0[n] wptr_0[n]  wptr_0[n] wptr_0[n]  wptr_0[n] wptr_0[n]   10 10   wptr_1[n+1] wptr_1[n+1] wptr_1[n+1] wptr_1[n+1]  wptr_0[n] wptr_0[n]  wptr_0[n] wptr_0[n]   11 11   wptr_1[n+1] wptr_1[n+1] wptr_1[n+1] wptr_1[n+1]  wptr_1[n+1] wptr_1[n+1]  wptr_0[n] wptr_0[n]

表3:(Push_valid=4’b0111)Table 3: (Push_valid=4'b0111)

  Push[1:0] Push[1:0]   addr_1 addr_1 addr_2 addr_2 addr_3 addr_3 addr_4 addr_4   00 00   wptr_0[n] wptr_0[n] wptr_0[n] wptr_0[n] wptr_0[n] wptr_0[n] 0 0   01 01   0 0 wptr_0[n] wptr_0[n] wptr_0[n] wptr_0[n] wptr_0[n] wptr_0[n]   10 10   wptr_1[n+1] wptr_1[n+1] 0 0 wptr_0[n] wptr_0[n] wptr_0[n] wptr_0[n]   11 11   wptr_1[n+1] wptr_1[n+1] wptr_1[n+1] wptr_1[n+1] 0 0 wptr_0[n] wptr_0[n]

表4:(Push_valid=4’b0011)Table 4: (Push_valid=4'b0011)

  Push[1:0] Push[1:0] addr_1 addr_1   addr_2 addr_2   addr_3 addr_3   addr_4 addr_4   00 00 wptr_0[n] wptr_0[n]   wptr_0[n] wptr_0[n]   0 0   0 0   01 01 0 0   wptr_0[n] wptr_0[n]   wptr_0[n] wptr_0[n]   0 0   10 10 0 0   0 0   wptr_0[n] wptr_0[n]   wptr_0[n] wptr_0[n]   11 11 wptr_1[n+1] wptr_1[n+1]   0 0   0 0   wptr_0[n] wptr_0[n]

表5:(Push_valid=4’b0001)Table 5: (Push_valid=4'b0001)

  Push[1:0] Push[1:0]  addr_1 addr_1  addr_2 addr_2   addr_3 addr_3   addr_4 addr_4   00 00  wptr_0[n] wptr_0[n]  0 0   0 0   0 0   01 01  0 0  wptr_0[n] wptr_0[n]   0 0   0 0 1010 00 00 wptr_0[n]wptr_0[n] 00   11 11  0 0  0 0   0 0   wptr_0[n] wptr_0[n]

举例来说,如表2所示,假设单元格预选模块214接收到低两位为“01”的写入指针Push、写入字节数Push_valid=4’b1111、第一行选择信号wptr_0[41]与第二行选择信号wptr_1[42],则单元格预选模决214输出单元格指针addr_1[42],addr_2[41],addr_3[41],addr_4[41],表示其值为“1”的位分别对应子存储块bank1的单元格cell1_42,子存储块bank2~bank4的单元格cell2_41,cell3_41和cell4_41,且这些单元格将被用来存储本次传输周期(cycle)接收到的数据。For example, as shown in Table 2, assume that the cell preselection module 214 receives the write pointer Push whose lower two bits are "01", the number of written bytes Push_valid=4'b1111, the first row selection signal wptr_0[41 ] and the second row selection signal wptr_1[42], then the cell preselection module 214 outputs the cell pointer addr_1[42], addr_2[41], addr_3[41], addr_4[41], indicating that its value is "1" The bits correspond to the cell cell1_42 of the sub-storage block bank1, and the cells cell2_41, cell3_41 and cell4_41 of the sub-storage blocks bank2-bank4, and these cells will be used to store the data received in this transmission cycle (cycle).

为达到省电的目的,单元格预选模块214输出的单元格指针addr_1~addr_4被送到时钟控制模块215。时钟控制模块215依据系统时钟CLK输出四个使能信号act_1~act_4至缓冲单元23的各个单元格,以使即将用来存储数据的单元格,即子存储块bank1~bank4中使能信号act_1~act_4值为“1”的位所对应的单元格被激活(提供时钟信号给该单元格)。In order to save power, the cell pointers addr_1 ˜ addr_4 output by the cell preselection module 214 are sent to the clock control module 215 . The clock control module 215 outputs four enable signals act_1~act_4 to each cell of the buffer unit 23 according to the system clock CLK, so that the cells that will be used to store data, that is, the enable signals act_1~act_4 in the sub memory blocks bank1~bank4 The cell corresponding to the bit whose act_4 value is "1" is activated (a clock signal is provided to the cell).

由以上描述可知,在本实施例先进先出存储器200的输入端,依据第一行选择信号wptr_0和第二行选择信号wptr_1由缓冲单元23中选择出两行单元格,即8个地址连续的单元格,然后再通过单元格预选模块214由这两行单元格中选择出即将用来存储数据的单元格。时钟控制模块215激活被选中的单元格,使得多工器210将接收到的数据datain0~datain3按序存入被启动的单元格中。As can be seen from the above description, at the input end of the FIFO memory 200 in this embodiment, two rows of cells are selected from the buffer unit 23 according to the first row selection signal wptr_0 and the second row selection signal wptr_1, that is, eight consecutive addresses Cell, and then select the cell that will be used to store data from the two rows of cells through the cell preselection module 214. The clock control module 215 activates the selected cells, so that the multiplexer 210 sequentially stores the received data datain0-datain3 into the activated cells.

显然,与现有技术相比,本实施例先进先出存储器200的输入控制电路21通过移位寄存器等相对简单的电路,依据接收到的写入指针Push以及写入字节数Push_valid产生对应于缓冲单元23的每一个单元格的使能信号act1~act_4,从而有效降低了写入指针Push与写入字节数Push_valid的负载。由于本实施例中不需要设计具有很大驱动力的电路来驱动写入指针Push依据写入字节数Push_valid从384个单元格中选择即将用来存储数据的单元格,因而本实施例先进先出存储器200的数据存储效率被有效提高。Apparently, compared with the prior art, the input control circuit 21 of the FIFO memory 200 in this embodiment uses a relatively simple circuit such as a shift register to generate the corresponding The enable signals act1 - act_4 of each cell of the buffer unit 23 effectively reduce the load of the write pointer Push and the write byte count Push_valid. Since there is no need to design a circuit with a large driving force in this embodiment to drive the write pointer Push to select the cell to be used to store data from the 384 cells according to the number of bytes to be written Push_valid, the present embodiment advances The data storage efficiency of the memory 200 is effectively improved.

以下将结合图4说明本实施例中,输出控制电路22如何依据读取指针Pop与读取字节数Pop_valid将数据由缓冲单元23中读出。The following will describe how the output control circuit 22 reads data from the buffer unit 23 according to the read pointer Pop and the read byte count Pop_valid in this embodiment in conjunction with FIG. 4 .

如图4所示,输出控制电路22包含一多工器220、移位寄存器0~a以及数据输出模块224。移位寄存器0~a组成移位寄存器组221。数据输出模块224包括由处理单元2261~2264组成的单元格初选模块226和多工器223。As shown in FIG. 4 , the output control circuit 22 includes a multiplexer 220 , shift registers 0 ˜ a and a data output module 224 . The shift registers 0 to a constitute the shift register group 221 . The data output module 224 includes a cell preliminary selection module 226 and a multiplexer 223 composed of processing units 2261 - 2264 .

多工器220依据读取指针Pop的低三位以及读取字节数Pop_valid输出一读取行移位信号R_shift,用以控制移位寄存器0~a的移位。移位寄存器0~a分别依据行移位信号R_shift输出一选择信号RPtr_0~RPtr_a,每一选择信号RPtr_0~RPtr_a均包含有48个位,且同一时间每个选择信号RPtr_0~RPtr_a只有一个位为“1”。单元格初选模块226依据选择信号RPtr_0~RPtr_a由缓冲单元23的相应子存储块bank1~bank4中选择11个地址连续的单元格,并将选中单元格中存储的数据通过信号cell_out0~cell_outa输出给多工器223。多工器223依据读取指针Pop由初选出来的11个数据中选择输出4个数据dataout0~dataout3,作为先进先出存储器200的输出。The multiplexer 220 outputs a read row shift signal R_shift according to the lower three bits of the read pointer Pop and the read byte number Pop_valid to control shifting of the shift registers 0˜a. Shift registers 0-a respectively output a selection signal RPtr_0-RPtr_a according to the row shift signal R_shift, each selection signal RPtr_0-RPtr_a contains 48 bits, and at the same time each selection signal RPtr_0-RPtr_a has only one bit as " 1". The cell preliminary selection module 226 selects 11 cells with continuous addresses from the corresponding sub-storage blocks bank1-bank4 of the buffer unit 23 according to the selection signals RPtr_0-RPtr_a, and outputs the data stored in the selected cells to Multiplexer 223. The multiplexer 223 selects and outputs 4 data dataout0 - dataout3 from the 11 data initially selected according to the read pointer Pop, as the output of the FIFO memory 200 .

更进一步来说,为减轻选择信号RPtr_0~RPtr_a的负载,每一子存储块bank1~bank3的单元格所存储的数据在输出至相应的处理单元2261~2264时都被分为两组。其中,第一组数据由存储于奇数行单元格中的数据组成,第二组数据由存储于偶数行单元格中的数据组成,因而每组都包含48个数据,且分别对应于相应选择信号RPtr_0~RPtr_a的48个位。为方便说明,子存储块bank1~bank4输出的第一组数据分别用group1_1,group2_1,group3_1和group4_1标示,第二组数据分别用group1_2,group2_2,group3_2和group4_2标示。举例来说,子存储单元bank1输出的第一组数据group1_1由单元格cell1_0,cell1_2,cell1_4......cell1_94中所存储的数据组成,即数据data1_0,data1_2......data1_94(图6a),第二组数据group1_2由单元格cell1_1,cell1_3,cell1_5......cell1_95中所存储的数据组成,即数据data1_1,data1_3......data1_95(图6b)。于本实施例中,处理单元2261~2263还接收一第三组数据,即数据group1_3,group2_3和group3_3。如图所示,数据输出模块224包含调序单元2271~2273,用于对相应的子存储决bank1~bank3输出的第一组数据group1_1,group2_1和group3_1进行调序操作,以获得第三组数据group1_3,group2_3和group3_3。更进一步来说,本实施例中调序单元2271~2273为一循环右移移位寄存器,即可对接收到的数据进行右移操作,从而达到调整数据排列顺序的目的。例如,假设子存储块bank 1输出的第一组数据group1_1由数据data1_0,data1_2......data1_94组成,且排列顺序为data1_94,data1_92......data1_2,data1_0,则经过调序单元2271的循环右移移位操作后,数据的排列顺序变为data1_0,data1_94......data1_4,data1_2(图6c)。简言之,以处理单元2261为例,处理单元2261所接收的第三组数据group1_3是第一组数据group1_1右移所得。处理单元2261~处理单元2264随后依据选择信号RPtr_0~RPtr_a,由数据组group1_1~group4_1,group1_2~group4_2以及group1_3~group3_3中选择11个数据,并通过信号cell_out0~cell_outa输出至多工器223。多工器223依据读取指针Pop的低三位,从数据cell_out0~cell_outa中选择输出四个数据dataout0~dataout3作为本实施例先进先出存储器200的输出数据。Furthermore, in order to reduce the load of the selection signals RPtr_0 - RPtr_a, the data stored in the cells of each of the sub-memory blocks bank1 - bank3 are divided into two groups when output to the corresponding processing units 2261 - 2264 . Among them, the first group of data is composed of data stored in odd-numbered row cells, and the second group of data is composed of data stored in even-numbered row cells, so each group contains 48 data, and they correspond to corresponding selection signals 48 bits of RPtr_0 to RPtr_a. For the convenience of description, the first group of data output by the sub-storage blocks bank1-bank4 are respectively marked by group1_1, group2_1, group3_1 and group4_1, and the second group of data are respectively marked by group1_2, group2_2, group3_2 and group4_2. For example, the first group of data group1_1 output by the sub-storage unit bank1 is composed of the data stored in the cells cell1_0, cell1_2, cell1_4...cell1_94, that is, the data data1_0, data1_2...data1_94 ( FIG. 6 a ), the second group of data group1_2 is composed of data stored in cells cell1_1, cell1_3, cell1_5...cell1_95, namely data data1_1, data1_3...data1_95 (FIG. 6b). In this embodiment, the processing units 2261-2263 also receive a third group of data, namely data group1_3, group2_3 and group3_3. As shown in the figure, the data output module 224 includes sequencer units 2271-2273, which are used to sequence the first group of data group1_1, group2_1 and group3_1 output by the corresponding sub-storage blocks bank1-bank3 to obtain the third group of data group1_3, group2_3 and group3_3. Furthermore, in this embodiment, the ordering units 2271-2273 are a circular right-shift shift register, which can perform a right-shift operation on the received data, so as to achieve the purpose of adjusting the order of the data. For example, assuming that the first group of data group1_1 output by the sub-storage block bank 1 is composed of data data1_0, data1_2...data1_94, and the arrangement order is data1_94, data1_92...data1_2, data1_0, after the sequence After the cyclic right shift operation of the unit 2271, the arrangement order of the data becomes data1_0, data1_94...data1_4, data1_2 (FIG. 6c). In short, taking the processing unit 2261 as an example, the third group of data group1_3 received by the processing unit 2261 is obtained by right-shifting the first group of data group1_1. The processing units 2261 - 2264 then select 11 pieces of data from the data groups group1_1 - group4_1, group1_2 - group4_2 and group1_3 - group3_3 according to the selection signals RPtr_0 - RPtr_a, and output them to the multiplexer 223 through the signals cell_out0 - cell_outa. The multiplexer 223 selects and outputs four data dataout0-dataout3 from the data cell_out0-cell_outa according to the lower three bits of the read pointer Pop as the output data of the FIFO memory 200 of this embodiment.

请一并参阅图4至图6,处理单元2261~2264均包含有多个处理逻辑con0~cona,用于依据相应的选择信号RPtr_0~RPtr_a从对应的子存储块bank1~bank4中选择11个地址连续的单元格中存储的数据输出。请参阅图6a~6c,以选择逻辑0~2为例来说明本实施例中如何通过选择逻辑0~a由缓冲单元23中选择出11个地址连续的单元格。选择逻辑0包含48个与门AN0~47以及一个或门OR0。与门AN0~47均具有两个输入端,一端连接至子存储块bank1的第一组数据group1_1,即数据data1_0,data1_2......data1_94,另一端连接至选择信号RPtr_0[47:0]的相应位。如本领域熟练技术人员所知,通过与门AN0~47,与选择信号RPtr_0中1’b1相对应的数据将被送至或门OR0,并作为数据cell_out0输出。选择逻辑1和选择逻辑2的结构与选择逻辑0相同,只是选择信号RPtr_1的48个位分别对应于第二组数据group_2,即数据data1_1,data1_3......data1_95,选择信号RPtr_2的48个位分别对应于第三组数据group1_3,即数据data1_2,data1_4......data1_94,data1_0。。因此,假设移位寄存器0~2分别输出选择信号RPtr_0[20]~RPtr_2[20],则选择逻辑0~2输出的数据cell_out0~cell_out2分别为单元格cell1_40,cell1_41与cell1_42所存储的数据,即数据data1_40,data1_41与data1_42。换句话说,选择逻辑0~2依据接收到的选择信号0~2自子存储块bank1中选择三个单元格,并将其中存储的数据通过cell_out0~cell_out2输出。与选择逻辑0~2相似,选择逻辑3~5分别依据选择信号RPtr_3~RPtr_5由子存储块bank2中选择三个单元格,并将其中存储的数据通过cell_out3~cell_out5输出。选择逻辑6~8分别依据选择信号RPtr_6~RPtr_8由子存储块bank3中选择三个单元格,并将其存储的数据通过cell_out6~cell_out8输出。选择逻辑9~a分别依据选择信号RPtr_9~RPtr_a由子存储块bank4中选择两个单元格,并将其存储的数据通过cell_out9~cell_outa输出。Please refer to FIG. 4 to FIG. 6 together. The processing units 2261-2264 each include a plurality of processing logics con0-cona for selecting 11 addresses from the corresponding sub-memory blocks bank1-bank4 according to the corresponding selection signals RPtr_0-RPtr_a Data output stored in consecutive cells. Please refer to FIGS. 6 a - 6 c , taking selection logic 0 - 2 as an example to illustrate how to select 11 cells with consecutive addresses from the buffer unit 23 by selecting logic 0 - a in this embodiment. Selection logic 0 includes 48 AND gates AN0-47 and one OR gate OR0. The AND gates AN0-47 all have two input ends, one end is connected to the first data group1_1 of the sub memory block bank1, namely data data1_0, data1_2...data1_94, and the other end is connected to the selection signal RPtr_0[47:0 ] for the corresponding bit. As known to those skilled in the art, through the AND gates AN0-47, the data corresponding to 1'b1 in the selection signal RPtr_0 will be sent to the OR gate OR0 and output as data cell_out0. The structure of selection logic 1 and selection logic 2 is the same as that of selection logic 0, except that the 48 bits of the selection signal RPtr_1 correspond to the second group of data group_2, that is, the data data1_1, data1_3...data1_95, and the 48 bits of the selection signal RPtr_2 The ones digit corresponds to the third group of data group1_3, namely data data1_2, data1_4...data1_94, data1_0. . Therefore, assuming that shift registers 0~2 output selection signals RPtr_0[20]~RPtr_2[20] respectively, the data cell_out0~cell_out2 output by selection logic 0~2 are the data stored in cells cell1_40, cell1_41 and cell1_42 respectively, that is Data data1_40, data1_41 and data1_42. In other words, the selection logic 0-2 selects three cells from the sub-bank bank1 according to the received selection signals 0-2, and outputs the data stored therein through cell_out0-cell_out2. Similar to selection logic 0-2, selection logic 3-5 respectively selects three cells from the sub-memory block bank2 according to selection signals RPtr_3-RPtr_5, and outputs the data stored therein through cell_out3-cell_out5. The selection logics 6-8 select three cells from the sub-memory block bank3 respectively according to the selection signals RPtr_6-RPtr_8, and output the stored data through cell_out6-cell_out8. The selection logic 9-a respectively selects two cells from the sub-memory block bank4 according to the selection signals RPtr_9-RPtr_a, and outputs the stored data through cell_out9-cell_outa.

由以上描述可知,本实施例中输出控制电路22可依据选择信号0~a控制相应的选择逻辑0~a由缓冲单元23中选择出11个地址连续的单元格,并由信号cell_out0~cell_outa将这11个单元格中的数据输出。举例来说,假设移位寄存器0~a分别输出选择信号RPtr_0[20]~RPtr_a[20],则选择逻辑0~a输出的数据cell_out0~cell_outa为单元格cell1_40~cell4_40,cell1_41~cell4_41,cell1_42~cell3_42所存储的数据。多工器223随后依据读取指针Pop的低三位,从数据cell_out0~cell_outa中选择输出四个数据dataout0~dataout3输出。多工器220依据读取指针Pop和读取字节数Pop_valid判断即将读取的数据是否已经由选择逻辑con0~cona输出至多工器223,若否,则输出读取行移位信号R_shift,使得选择逻辑con0~cona依据移位后的选择信号RPtr_0~RPtr_a选择11个数据输出至多工器223。It can be known from the above description that in this embodiment, the output control circuit 22 can control the corresponding selection logic 0-a to select 11 cells with consecutive addresses from the buffer unit 23 according to the selection signals 0-a, and the signals cell_out0-cell_outa will The data output in these 11 cells. For example, assuming that shift registers 0~a respectively output selection signals RPtr_0[20]~RPtr_a[20], the data cell_out0~cell_outa output by selection logic 0~a are cells cell1_40~cell4_40, cell1_41~cell4_41, cell1_42~ The data stored in cell3_42. The multiplexer 223 then selects and outputs four data dataout0-dataout3 from the data cell_out0-cell_outa according to the lower three bits of the read pointer Pop. The multiplexer 220 judges whether the data to be read has been output to the multiplexer 223 by the selection logic con0~cona according to the read pointer Pop and the number of read bytes Pop_valid, if not, then outputs the read line shift signal R_shift, so that The selection logics con0 -cona select 11 pieces of data according to the shifted selection signals RPtr_0 -RPtr_a and output them to the multiplexer 223 .

由于本实施例中输出控制电路22通过一组移位寄存器,即移位寄存器0~a来产生一组选择信号RPtr_0~RPtr_a,使得选择逻辑con0~cona输出一组地址连续的数据cell_out0~cell_outa。因此,与现有技术相比,本发明输出控制电路22只需要驱动读取指针Pop从11个地址连续的数据中选择出4个数据作为先进先出存储器200的输出数据,进而大幅减小了读取指针Pop的负载,使得本实施例先进先出存储器200的数据输出效率被有效提高。In this embodiment, the output control circuit 22 generates a set of selection signals RPtr_0 - RPtr_a through a set of shift registers, ie shift registers 0 - a, so that the selection logics con0 - cona output a set of data cell_out0 - cell_outa with continuous addresses. Therefore, compared with the prior art, the output control circuit 22 of the present invention only needs to drive the read pointer Pop to select 4 data from 11 consecutive data addresses as the output data of the FIFO memory 200, thereby greatly reducing the Reading the load of the pointer Pop effectively improves the data output efficiency of the FIFO memory 200 in this embodiment.

以上说明均假设本实施例中先进先出存储器200每个周期可支持最多4个长度为32bit的数据写入,以及最多4个长度为32bit数据输出,然而,如本领域熟练技术人员所知,以上假设可因应不同的应用环境而改变,且输入/输出控制电路及缓冲单元的结构只需要做简单的更改即可。举例来说,若缓冲单元23由32个位宽为32bit的单元格组成,则输出控制电路22的多工器220可依据读取字节数Pop_valid[3:0]与读取指针Pop[1:0]严生读取行移位信号R_shift。移位寄存器的个数可以相应地由11个减少为8个。此时,每一子存储块bank1~bank4包含8个单元格,其中奇数行的单元格分为一组,偶数行的单元格分为另一组,并分别输出至相应的处理单元2261~2264。移位寄存器0~7依据读取行移位信号R_shift,分别输出选择信号RPtr_0~RPtr_7,每一选择信号RPtr_0~RPtr_7包含有4个位。处理单元2261~2264随后依据选择信号RPtr_0~RPtr_7自缓冲单元23中选择输出两行,共8个地址连续的单元格的数据,以供多工器223依据读取指针Pop[1:0]选择性地输出数据dataout0~dataout3。The above descriptions all assume that the first-in-first-out memory 200 in this embodiment can support at most 4 data writes with a length of 32 bits per cycle, and at most 4 data outputs with a length of 32 bits. However, as known to those skilled in the art, The above assumptions can be changed according to different application environments, and the structures of the input/output control circuit and the buffer unit only need to be changed simply. For example, if the buffer unit 23 is composed of 32 cells with a bit width of 32 bits, the multiplexer 220 of the output control circuit 22 can read the number of bytes Pop_valid[3:0] and the read pointer Pop[1 :0] Strictly read the row shift signal R_shift. The number of shift registers can be reduced from 11 to 8 accordingly. At this time, each sub-storage block bank1-bank4 contains 8 cells, among which the cells of odd-numbered rows are divided into one group, and the cells of even-numbered rows are divided into another group, and are respectively output to corresponding processing units 2261-2264 . The shift registers 0 - 7 respectively output selection signals RPtr_0 - RPtr_7 according to the read row shift signal R_shift, and each selection signal RPtr_0 - RPtr_7 includes 4 bits. The processing units 2261-2264 then select and output two rows from the buffer unit 23 according to the selection signals RPtr_0-RPtr_7, and a total of 8 cells with continuous addresses are used for the multiplexer 223 to select according to the read pointer Pop[1:0] The data dataout0 to dataout3 are sequentially output.

以上所述仅为本发明较佳实施例,然其并非用以限定本发明的范围,任何熟悉本项技术的人员,在不脱离本发明的精神和范围内,可在此基础上做进一步的改进和变化,因此本发明的保护范围当以本申请的权利要求书所界定的范围为准。The above description is only a preferred embodiment of the present invention, but it is not intended to limit the scope of the present invention. Any person familiar with this technology can make further improvements on this basis without departing from the spirit and scope of the present invention. Improvements and changes, so the protection scope of the present invention should be defined by the claims of the present application.

Claims (13)

1.一种先进先出存储器,其特征在于,包括:1. A first-in-first-out memory, characterized in that, comprising: 一缓冲单元,包含多个用于存储数据的单元格;A buffer unit, including a plurality of cells for storing data; 一输入控制电路,依据一写入指针与一写入字节数,将接收的数据存入所述缓冲单元,所述输入控制电路包含:An input control circuit stores received data into the buffer unit according to a write pointer and a number of bytes to be written, and the input control circuit includes: 一单元格选择模块,依据所述写入指针与所述写入字节数,将即将用于存储数据的单元格激活;以及A cell selection module activates the cell to be used to store data according to the write pointer and the number of bytes to be written; and 一排序模块,依据所述写入指针将接收的数据存入被激活的单元格中;以及a sorting module, storing the received data into the activated cell according to the write pointer; and 一输出控制电路,依据一读取指针与一读取字节数读取所述缓冲单元存储的数据,所述输出控制电路包含:An output control circuit for reading the data stored in the buffer unit according to a read pointer and a read byte number, the output control circuit includes: 一选择信号产生模块,根据所述读取指针与所述读取字节数产生多个选择信号;以及A selection signal generation module, which generates multiple selection signals according to the read pointer and the number of read bytes; and 一数据输出模块,依据所述多个选择信号由所述缓冲单元中读取多个存储地址连续的数据,并依据所述读取指针由所述多个存储地址连续的数据中选择输出所述先进先出存储器的输出数据。A data output module, which reads a plurality of data with continuous storage addresses from the buffer unit according to the plurality of selection signals, and selects and outputs the data from the data with continuous storage addresses according to the read pointer. Output data from FIFO memory. 2.根据权利要求1所述的先进先出存储器,其特征在于,所述输出控制电路的所述选择信号产生模块包括:2. The FIFO memory according to claim 1, wherein the selection signal generating module of the output control circuit comprises: 一第一多工器,根据所述读取指针与所述读取字节数产生一读取行移位信号;以及a first multiplexer, generating a read row shift signal according to the read pointer and the read byte number; and 一移位寄存器组,依据所述读取行移位信号输出所述多个选择信号。A shift register group outputs the multiple selection signals according to the read row shift signal. 3.根据权利要求2所述的先进先出存储器,其特征在于,所述第一多工器依据所述读取指针与所述读取字节数判断将要读取的数据是否存储于所述选择信号对应的单元格中,若否,则输出所述读取行移位信号,使所述移位寄存器组输出移位的选择信号。3. The FIFO memory according to claim 2, wherein the first multiplexer judges whether the data to be read is stored in the In the cell corresponding to the selection signal, if not, output the read row shift signal, so that the shift register group outputs a shifted selection signal. 4.根据权利要求1所述的先进先出存储器,其特征在于,所述输出控制电路的所述数据输出模块包括:4. The FIFO memory according to claim 1, wherein the data output module of the output control circuit comprises: 一单元格初选模块,分别依据相应的选择信号,由所述缓冲单元中选择输出相应单元格的数据;以及A cell primary selection module, respectively according to the corresponding selection signal, selects and outputs the data of the corresponding cell from the buffer unit; and 一第二多工器,接收所述单元格初选模块输出的数据,并依据所述读取指针选择多个数据作为所述先进先出存储器的输出数据输出;A second multiplexer, receiving the data output by the primary cell selection module, and selecting a plurality of data as the output data output of the first-in-first-out memory according to the read pointer; 其中,由所述单元格初选模块输出的数据的存储地址连续。Wherein, the storage addresses of the data output by the cell primary selection module are continuous. 5.根据权利要求4所述的先进先出存储器,其特征在于,所述单元格初选模块包含多个选择逻辑,分别依据相应的选择信号由所述缓冲单元中选择输出相应单元格的数据。5. The first-in-first-out memory according to claim 4, wherein the cell primary selection module includes a plurality of selection logics, and selects and outputs the data of the corresponding cell from the buffer unit according to the corresponding selection signal respectively . 6.根据权利要求5所述的先进先出存储器,其特征在于,所述数据输出模块还包括一调序单元,耦接于所述缓冲单元与选择逻辑之间,用于调整所述缓冲单元输出至所述选择逻辑的数据的排列顺序。6. The first-in-first-out memory according to claim 5, wherein the data output module further comprises a sequencing unit, coupled between the buffer unit and the selection logic, for adjusting the buffer unit The sort order of the data output to the selection logic. 7.根据权利要求4所述的先进先出存储器,其特征在于,所述输出控制电路的选择信号的个数等于所述选择逻辑的个数。7. The FIFO memory according to claim 4, wherein the number of selection signals of the output control circuit is equal to the number of selection logics. 8.根据权利要求1所述的先进先出存储器,其特征在于,所述单元格选择模块包括:8. The FIFO memory according to claim 1, wherein the cell selection module comprises: 一第三多工器,依据所述写入指针与所述写入字节数产生一写入行移位信号;A third multiplexer, generating a write row shift signal according to the write pointer and the write byte number; 第一移位寄存器、第二移位寄存器,分别依据所述写入行移位信号输出第一行选择信号、第二行选择信号;以及The first shift register and the second shift register respectively output a first row selection signal and a second row selection signal according to the written row shift signal; and 一单元格预选模块,依据所述第一行选择信号、第二行选择信号、所述写入指针与所述写入字节数产生多个单元格指针,分别指向所述即将用于存储数据的单元格。A cell preselection module, which generates a plurality of cell pointers according to the first row selection signal, the second row selection signal, the write pointer and the number of bytes to be written, respectively pointing to the cells to be used for storing data of cells. 9.根据权利要求8所述的先进先出存储器,其特征在于,所述单元格选择模块还包括一时钟控制模块,用以依据所述单元格预选模块输出的所述单元格指针给相应的单元格提供时钟信号。9. The first-in-first-out memory according to claim 8, wherein the cell selection module further comprises a clock control module for giving corresponding The cell provides the clock signal. 10.根据权利要求8所述的先进先出存储器,其特征在于,所述排序模块包括一第四多工器,依据所述写入指针将所述先进先出存储器接收到的多个数据存入所述单元格指针指向的单元格中,且使所述先进先出存储器接收到的第一个数据存入所述写入指针所对应的单元格中。10. The first-in-first-out memory according to claim 8, wherein the sorting module includes a fourth multiplexer, storing a plurality of data received by the first-in-first-out memory according to the write pointer into the cell pointed to by the cell pointer, and store the first data received by the FIFO memory into the cell corresponding to the write pointer. 11.根据权利要求8所述的先进先出存储器,其特征在于,所述第一行选择信号、第二行选择信号均包括多个位,且所述第二行选择信号为“1”的位比所述第一行选择信号为“1”的位高一位。11. The first-in-first-out memory according to claim 8, wherein the first row selection signal and the second row selection signal each comprise a plurality of bits, and the second row selection signal is "1" The bit is one bit higher than the bit at which the first row selection signal is "1". 12.根据权利要求11所述的先进先出存储器,其特征在于,所述第三多工器依据所述读取指针与所述读取字节数判断将要写入的数据是否能够全部存储于所述第一行选择信号、第二行选择信号所对应的单元格中,并依据判断结果输出所述写入行移位信号,使得所述第一移位寄存器、第二移位寄存器移位。12. The first-in-first-out memory according to claim 11, wherein the third multiplexer judges whether all the data to be written can be stored in the In the cell corresponding to the first row selection signal and the second row selection signal, and output the write row shift signal according to the judgment result, so that the first shift register and the second shift register shift . 13.根据权利要求1所述的先进先出存储器,其特征在于,所述缓冲单元的单元格包含多行多列,且所述缓冲单元的同一行的单元格的存储地址连续,相邻两行中的前一行的最后一个单元格的存储地址与后一行的第一个单元格的存储地址连续。13. The first-in-first-out memory according to claim 1, wherein the cells of the buffer unit comprise multiple rows and multiple columns, and the storage addresses of the cells of the same row of the buffer unit are continuous, two adjacent The storage address of the last cell of the previous row in the row is consecutive to the storage address of the first cell of the next row.
CNB2007101420861A 2007-08-22 2007-08-22 FIFO memory Active CN100568382C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2007101420861A CN100568382C (en) 2007-08-22 2007-08-22 FIFO memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2007101420861A CN100568382C (en) 2007-08-22 2007-08-22 FIFO memory

Publications (2)

Publication Number Publication Date
CN101110259A CN101110259A (en) 2008-01-23
CN100568382C true CN100568382C (en) 2009-12-09

Family

ID=39042278

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2007101420861A Active CN100568382C (en) 2007-08-22 2007-08-22 FIFO memory

Country Status (1)

Country Link
CN (1) CN100568382C (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101552041A (en) * 2009-05-12 2009-10-07 北京中星微电子有限公司 An FIFO memory cell and implementation method thereof
CN102654827B (en) * 2011-03-02 2014-05-28 安凯(广州)微电子技术有限公司 First-in first-out buffer and data caching method
CN105511835B (en) * 2014-09-24 2019-11-15 深圳市中兴微电子技术有限公司 A kind of asynchronous FIFO controller and method for preventing asynchronous FIFO buffer data from overflowing
CN113434545B (en) * 2021-06-02 2022-11-18 中科驭数(北京)科技有限公司 Data caching device and data providing method
CN115604198B (en) * 2022-11-29 2023-03-10 珠海星云智联科技有限公司 Network card controller, network card control method, equipment and medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1116764A (en) * 1994-07-06 1996-02-14 现代电子产业株式会社 First-in first-out buffer memory
CN1122042A (en) * 1993-10-28 1996-05-08 大宇电子株式会社 Fifo buffer system having enhanced controllability
CN1378214A (en) * 2001-03-30 2002-11-06 矽统科技股份有限公司 High-speed multiplex first-in-first-out memory structure

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1122042A (en) * 1993-10-28 1996-05-08 大宇电子株式会社 Fifo buffer system having enhanced controllability
CN1116764A (en) * 1994-07-06 1996-02-14 现代电子产业株式会社 First-in first-out buffer memory
CN1378214A (en) * 2001-03-30 2002-11-06 矽统科技股份有限公司 High-speed multiplex first-in-first-out memory structure

Also Published As

Publication number Publication date
CN101110259A (en) 2008-01-23

Similar Documents

Publication Publication Date Title
CN102197436B (en) Data path for multi-level cell memory, method for storing and method for utilizing memory array
US7327597B1 (en) Static random access memory architecture
JP5107204B2 (en) Multiport memory architecture and integrated circuit
US20090161435A1 (en) Non-volatile memory device and method of programming the same
US20140289460A1 (en) Systems and methods involving data bus inversion memory circuitry, configuration and/or operation including data signals grouped into 10 bits and/or other features
CN100568382C (en) FIFO memory
US6259648B1 (en) Methods and apparatus for implementing pseudo dual port memory
CN113641625B (en) Four-way parallel data processing transposition system based on FPGA
CN101136245A (en) Semiconductor memory device
CN107633858A (en) Memory device and method for reading data from memory device
CN108401467A (en) Storage device, chip and method for controlling storage device
CN102306142B (en) Method and circuit for scheduling data of memory through fast Fourier transform (FFT) reverse operation
US20080247501A1 (en) Fifo register unit and method thereof
CN101667462A (en) Repair module suitable for memory, repair device using same and repair method thereof
US20130100757A1 (en) Dual-Port Memory and a Method Thereof
CN110097902B (en) Read-write control module and method for same port and dual-port memory
CN101506784B (en) Peripheral supplied addressing in simple DMA
CN100356345C (en) Method and system for access of high speed buffer memory line
KR20110088929A (en) Semiconductor memory device
JP2014194619A (en) Buffer circuit and semiconductor integrated circuit
CN107293318B (en) Bit width configurable embedded memory
CN106502931B (en) channel control device
US7372755B2 (en) On-chip storage memory for storing variable data bits
KR20030080313A (en) Synchronous semiconductor memory device using internal prefetch
CN110289035B (en) Memory cell array peripheral circuit and memory device

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