[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN110705195A - Cross-clock-domain depth self-configuration FIFO system based on FPGA - Google Patents

Cross-clock-domain depth self-configuration FIFO system based on FPGA Download PDF

Info

Publication number
CN110705195A
CN110705195A CN201910868916.1A CN201910868916A CN110705195A CN 110705195 A CN110705195 A CN 110705195A CN 201910868916 A CN201910868916 A CN 201910868916A CN 110705195 A CN110705195 A CN 110705195A
Authority
CN
China
Prior art keywords
port
read
write
module
clock
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.)
Pending
Application number
CN201910868916.1A
Other languages
Chinese (zh)
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.)
East China Normal University
Original Assignee
East China Normal University
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 East China Normal University filed Critical East China Normal University
Priority to CN201910868916.1A priority Critical patent/CN110705195A/en
Publication of CN110705195A publication Critical patent/CN110705195A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Logic Circuits (AREA)

Abstract

The invention discloses a cross-clock domain depth self-configuration FIFO system based on an FPGA, and provides an asynchronous FIFO which is based on the FPGA and can be synthesized, wherein the depth bit width of the FIFO can be self-configured, the empty and full state of the FIFO is not required to be judged by adding one bit, the converted Gray code address is not required to be returned to the previous binary address code, and the Gray code address converted by the binary address is directly compared.

Description

Cross-clock-domain depth self-configuration FIFO system based on FPGA
Technical Field
The invention belongs to the field of digital integrated circuit design, and mainly relates to a cross-clock domain data transmission interaction problem.
Background
In a chip system, high-speed real-time data acquisition and high-performance data transmission in different clock domains are not separated from an asynchronous FI first-in first-out queue (FIFO) to serve as a cache. With the ever-expanding scale of integrated circuits, a system often requires a plurality of different clock controls in the integrated circuit chips of today. But communication and interaction between data is hindered due to the cross-clock domain transmission of data. Meanwhile, the data transmission across clock domains is easy to cause a metastable state phenomenon. Asynchronous FIFO has unique advantage in solving the problem of cross-clock domain transmission of data, can store continuous data in sequence and read the data according to the principle of first-in first-out. Vivado software of Xilinx corporation is provided with an IP core of an asynchronous FIFO, but the IP core of the Vivado software is fixed, application scenes are limited, universality is poor, and particularly the design requirement of data transmission across clock domains under complex conditions can not be met. In the existing technologies, for the design of a cache circuit for transmitting data across clock domains, the circuit structure is complex, the design logic is complex, the universality is poor, and the universality is not good. FPGAs, field programmable gate arrays, are emerging as a semi-custom circuit in the field of application specific integrated circuits. Due to the strong parallel capability of the FPGA, the FPGA is widely applied to the fields of network interface, image processing, video signal processing, digital communication, and the like in recent years. The method is an effective way to construct a comprehensive asynchronous FIFO system by utilizing the internal resources of the FPGA.
Disclosure of Invention
The invention aims to solve the problem of caching data transmission under different clock domains, and provides an integrated FIFO with configurable cross-clock domain depth based on an FPGA. The invention occupies less FPGA internal resources, has simple circuit logic and strong universality, can automatically configure the depth and bit width of data and has high data transmission rate.
The specific technical scheme for realizing the purpose of the invention is as follows:
a cross-clock domain depth self-configuration FIFO system based on FPGA is characterized in that the system comprises a dual-port RAM memory module, a write address module, a full mark logic judgment module, a synchronous to write clock domain module, a read address module, an empty mark logic judgment module and a synchronous to read clock domain module; wherein:
the write address module and the full mark logic judgment module work in a write clock domain; the address reading module and the empty mark logic judgment module work in a reading clock domain;
the write address module has three input ports: a write clock port wclk, a write reset port wrst and a write enable port wr _ en; two output ports: a write address port waddr and a Gray code write address port wptr; the write address port waddr is connected with a write address input end of the dual-port RAM memory module, and the Gray code write address port wptr is connected with an input port of the full mark logic judgment module;
the full flag logic judgment module has four input ports: the write clock port wclk, the write reset port wrst, the gray code write address port wptr and the read address synchronous write clock domain port wq2_ rptr, the read address synchronous write clock domain port wq2_ rptr is connected with the synchronous write clock module, and the output port is provided with: full flag port wfull; the full mark port wfull is connected with the dual-port RAM memory module;
the read address module has three input ports: the read clock port rclk, the read reset port rrst and the read enable port rd _ en are provided by external input; two output ports: reading address port raddr and Gray code reading address port rptr; the read address port raddr is connected with a read address input end of the dual-port RAM memory module, and the Gray code read address port rptr is connected with an input port of the empty mark logic judgment module;
the empty flag logic judgment module has four input ports: a read clock port rclk, a read reset port rrst, a Gray code read address port rptr and a write address synchronous read clock domain port rq2_ wptr; the write address synchronous read clock domain port rq2_ wptr is connected with the synchronous read clock domain module; one output port: an empty flag port repty, the empty flag port repty connected to the dual port RAM memory module;
the module synchronized to the writing clock domain works in the writing clock domain, and the input of the module is connected with a Gray code reading address port rptr;
the synchronous to read clock domain module works in a read clock domain, and the input of the synchronous to read clock domain module is connected with a Gray code write address port wptr;
the dual-port RAM memory module is provided with eleven input ports which are respectively a write data port wdata, a write clock port wclk, a write reset port wrst, a write enable port wr _ en, a write address port waddr, a full mark port wfull, a read clock port rclk, a read reset port rrst, a read enable port rd _ en, a read address port raddr and an empty mark port rempty, and one output port: the read data port rdata.
The read data port rdata of the dual-port RAM memory module only reads data in a read clock domain; the write data port wdata only writes data in a write clock domain; when the empty mark port is 1, data cannot be read; when the full flag port is 1, data cannot be written; the read-write data bit width of the dual-port RAM memory module is set automatically, and the read-write address is configured automatically.
The synchronizing to write clock domain module synchronizes the gray code read address port wptr, which has been synchronized once under the read clock in the read address module, to wq2_ rptr through two stages of D flip-flops under the control of the write clock. The purpose is to further reduce the probability of data metastability transmission under cross-clock domain transmission.
And under the control of the read clock, the synchronous to read clock domain module synchronizes the Gray code write address port rptr which is synchronized once under the write clock in the write address module into rq2_ wptr through a two-stage D flip-flop. The purpose is to further reduce the probability of data metastability transmission under cross-clock domain transmission.
The write data can only be written when the write enable port wr _ en is active and the full flag port wfull is not 1.
The read data can be read only when the read enable port rd _ en is active and the null flag port repty is not 1.
The full mark logic judgment module judges that the highest bits of the gray code write address port wptr data and the synchronous write clock domain port wq2_ rptr data are different, and the second highest bits are also different.
And the empty mark logic judgment module judges that the data of the Gray code read address port rptr is the same as the data of the synchronous read clock domain port rq2_ wptr.
The invention has the advantages that:
1. the circuit of the invention has simple structure and strong universality.
2. The integrated circuit of the invention occupies less resources and has small area.
3. The invention directly compares the gray code addresses, has simple judgment logic and leads the data transmission rate to be faster.
4. The data bit width and the storage depth of the invention can be set by self, and the invention is flexible and convenient.
Drawings
FIG. 1 is a block diagram of the system of the present invention;
FIG. 2 is a simulation of the present invention.
Detailed Description
The invention is described in detail below with reference to the figures and examples.
Example 1
Referring to fig. 1, the present embodiment includes a dual port RAM memory module, a write address module, a full flag logic determination module, a synchronous to write clock domain module, a read address module, an empty flag logic determination module, and a synchronous to read clock domain module.
The specific working conditions of the invention are as follows:
1. the sizes of the write clock wclk and the read clock rclk and the content of externally written data are first determined.
2. And determining whether the state of the write reset wrst is 0, if so, the system is in a reset state, and the write address and the full mark are in a state with an initial value of 0, so that the data writing operation cannot be performed.
3. And determining whether the state of the read reset rrst is 0, if so, the system is in a reset state, the read address and the null mark are in initial value states, and the operation of writing data cannot be performed at this time.
4. If the write reset wrst is invalid, i.e. 1, then if the write enable wr _ en is valid and the full flag is 0, the write address is automatically incremented by one, and the externally written data will be stored in the low address of the dual port RAM memory. If the write enable wr _ en is invalid, the external data cannot be written into the dual port RAM memory.
5. If the read reset rrst is invalid, i.e. 1, then if the read enable rd _ en is valid and the empty flag is 0, the read address is automatically incremented, and the storage content of the dual port RAM memory is read out. If the write enable wr _ en is invalid, the external data cannot be written into the dual port RAM memory.
6. Each time the write address is updated by adding 1, the write address is converted into a corresponding gray code, and meanwhile, the corresponding gray code is synchronized to the write clock domain, so that the subsequent operation of synchronizing to the read clock domain is performed.
7. Each time the read address is updated by adding 1, the read address is converted into a corresponding gray code, and meanwhile, the corresponding gray code is synchronized to the read clock domain, so that the subsequent operation of synchronizing to the write clock domain is performed.
8. In step 6, the gray code synchronized in the write clock domain is synchronized to the read clock domain at the rising edge of the read clock, and passes through two stages of D flip-flops, so that the timing is equivalent to delay for two beats to be wq2_ rptr, and the wq2_ rptr is sent to the full mark logic judgment module.
9. In step 7, the gray code synchronized in the read clock domain is synchronized to the write clock domain at the rising edge of the write clock, and is delayed for two beats in time sequence through the two-stage D flip-flops to become rq2_ wptr, and the rq2_ wptr is sent to the null flag logic judgment module.
10. Wq2_ rptr in step 8 is compared with gray code in step 6 in the write clock domain, if the highest bits of the two sets of address data are different and the second highest bit is also different, the value of the full flag wfull is 1, otherwise, the value of the full flag is 0. When the full flag is 1, no more write operation can be performed.
11. Comparing rq2_ wptr in the step 9 with the gray code in the step 7 in the read clock domain, if the two groups of address data are completely the same, the value of the null flag is 1, otherwise, the value of the null flag is 0. When the empty flag is 1, no further operation for reading data can be performed.
12. The above process is thus circulated.
Example 2
Under Vivado2018.3 version software, an Artix series XC7A35T chip of Xilinx company is selected for synthesis and simulation. The data 0x0d, 0xe5,0x65,0x13 are written to the dual port RAM memory in sequence and read from the RAM.
The external write clock period is 20ns, the read clock period is 40ns, and the read-write enable signal is randomly generated by an external random function.
The read and write reset signals are initially 0 and then both pulled high to 1.
The depth of the FIFO is set to 16, and the data bit width is set to 8.
Referring to fig. 2, it can be seen that data in the RAM is read sequentially, 0x0d, 0xe5,0x65, and 0x13, respectively. The invention is proved to be correct in function.

Claims (8)

1. A cross-clock domain depth self-configuration FIFO system based on FPGA is characterized in that the system comprises a dual-port RAM memory module, a write address module, a full mark logic judgment module, a synchronous to write clock domain module, a read address module, an empty mark logic judgment module and a synchronous to read clock domain module; wherein:
the write address module and the full mark logic judgment module work in a write clock domain; the address reading module and the empty mark logic judgment module work in a reading clock domain;
the write address module has three input ports: a write clock port wclk, a write reset port wrst and a write enable port wr _ en; two output ports: a write address port waddr and a Gray code write address port wptr; the write address port waddr is connected with a write address input end of the dual-port RAM memory module, and the Gray code write address port wptr is connected with an input port of the full mark logic judgment module;
the full flag logic judgment module has four input ports: the write clock port wclk, the write reset port wrst, the gray code write address port wptr and the read address synchronous write clock domain port wq2_ rptr, the read address synchronous write clock domain port wq2_ rptr is connected with the synchronous write clock module, and the output port is provided with: full flag port wfull; the full mark port wfull is connected with the dual-port RAM memory module;
the read address module has three input ports: the read clock port rclk, the read reset port rrst and the read enable port rd _ en are provided by external input; two output ports: reading address port raddr and Gray code reading address port rptr; the read address port raddr is connected with a read address input end of the dual-port RAM memory module, and the Gray code read address port rptr is connected with an input port of the empty mark logic judgment module;
the empty flag logic judgment module has four input ports: a read clock port rclk, a read reset port rrst, a Gray code read address port rptr and a write address synchronous read clock domain port rq2_ wptr; the write address synchronous read clock domain port rq2_ wptr is connected with the synchronous read clock domain module; one output port: an empty flag port repty, the empty flag port repty connected to the dual port RAM memory module;
the module synchronized to the writing clock domain works in the writing clock domain, and the input of the module is connected with a Gray code reading address port rptr;
the synchronous to read clock domain module works in a read clock domain, and the input of the synchronous to read clock domain module is connected with a Gray code write address port wptr;
the dual-port RAM memory module is provided with eleven input ports which are respectively a write data port wdata, a write clock port wclk, a write reset port wrst, a write enable port wr _ en, a write address port waddr, a full mark port wfull, a read clock port rclk, a read reset port rrst, a read enable port rd _ en, a read address port raddr and an empty mark port rempty, and one output port: the read data port rdata.
2. The cross-clock-domain depth self-configurable FIFO system of claim 1, wherein the read data port rdata of the dual-port RAM memory module reads data only in the read clock domain; the write data port wdata only writes data in a write clock domain; when the empty mark port is 1, data cannot be read; when the full flag port is 1, data cannot be written; the read-write data bit width of the dual-port RAM memory module is set automatically, and the read-write address is configured automatically.
3. The cross-clock-domain depth self-configurable FIFO system of claim 1, wherein the synchronization to the write clock domain module synchronizes a gray code read address port wptr, which has been synchronized once under a read clock in the read address module, to wq2_ rptr by a two-stage D flip-flop under control of the write clock.
4. The cross-clock-domain depth self-configurable FIFO system of claim 1, wherein the synchronous to read clock domain module synchronizes the gray code write address port rptr, which has been synchronized once under the write clock in the write address module, to rq2_ wptr by a two-stage D flip-flop under control of the read clock.
5. The cross-clock-domain depth self-configurable FIFO system of claim 2, wherein the write data can only be written when write enable port wr en is valid and full flag port wfull is not 1.
6. The cross-clock-domain depth self-configurable FIFO system of claim 2, wherein the read data can only be read when the read enable port rd _ en is active and the empty flag port repeat is not 1.
7. The cross-clock-domain depth self-configurable FIFO system of claim 1, wherein the full flag logic determines that the highest bits of the data of the Gray code write address port wptr and the data of the synchronous write clock domain port wq2_ rptr are different and the second highest bits are different.
8. The cross-clock-domain depth self-configurable FIFO system of claim 1, wherein the empty flag logic determination module determines that the gray code read address port rptr data and the synchronous read clock domain port rq2_ wptr data are the same.
CN201910868916.1A 2019-09-16 2019-09-16 Cross-clock-domain depth self-configuration FIFO system based on FPGA Pending CN110705195A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910868916.1A CN110705195A (en) 2019-09-16 2019-09-16 Cross-clock-domain depth self-configuration FIFO system based on FPGA

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910868916.1A CN110705195A (en) 2019-09-16 2019-09-16 Cross-clock-domain depth self-configuration FIFO system based on FPGA

Publications (1)

Publication Number Publication Date
CN110705195A true CN110705195A (en) 2020-01-17

Family

ID=69196145

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910868916.1A Pending CN110705195A (en) 2019-09-16 2019-09-16 Cross-clock-domain depth self-configuration FIFO system based on FPGA

Country Status (1)

Country Link
CN (1) CN110705195A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111324562A (en) * 2020-02-16 2020-06-23 苏州浪潮智能科技有限公司 Clock domain crossing system of AHB and working method
CN117852494A (en) * 2024-03-08 2024-04-09 中科鉴芯(北京)科技有限责任公司 Logic simulation acceleration method and device for DFF optimization
CN118567605A (en) * 2024-08-01 2024-08-30 上海韬润半导体有限公司 Method and system for realizing FIFO delay reduction under homologous PLL clock

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101930350A (en) * 2009-06-24 2010-12-29 合肥力杰半导体科技有限公司 Asynchronous FIFO memory design with power of which the depth is not 2
CN107220023A (en) * 2017-06-29 2017-09-29 中国电子科技集团公司第五十八研究所 A kind of embedded configurable FIFO memory
CN107577623A (en) * 2017-07-19 2018-01-12 成都华微电子科技有限公司 Cross clock domain asynchronous fifo and data processing method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101930350A (en) * 2009-06-24 2010-12-29 合肥力杰半导体科技有限公司 Asynchronous FIFO memory design with power of which the depth is not 2
CN107220023A (en) * 2017-06-29 2017-09-29 中国电子科技集团公司第五十八研究所 A kind of embedded configurable FIFO memory
CN107577623A (en) * 2017-07-19 2018-01-12 成都华微电子科技有限公司 Cross clock domain asynchronous fifo and data processing method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
宋歌: ""空间激光通信收发同轴角锥标校技术研究"", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *
王艳秋: ""基于CPRI协议的FPGA高速数据接口模块设计与实现"", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111324562A (en) * 2020-02-16 2020-06-23 苏州浪潮智能科技有限公司 Clock domain crossing system of AHB and working method
CN111324562B (en) * 2020-02-16 2021-08-06 苏州浪潮智能科技有限公司 Clock domain crossing system of AHB and working method
CN117852494A (en) * 2024-03-08 2024-04-09 中科鉴芯(北京)科技有限责任公司 Logic simulation acceleration method and device for DFF optimization
CN117852494B (en) * 2024-03-08 2024-07-09 中科鉴芯(北京)科技有限责任公司 Logic simulation acceleration method and device for DFF optimization
CN118567605A (en) * 2024-08-01 2024-08-30 上海韬润半导体有限公司 Method and system for realizing FIFO delay reduction under homologous PLL clock

Similar Documents

Publication Publication Date Title
CN111367495B (en) Asynchronous first-in first-out data cache controller
US5499344A (en) Programmable dual port data unit for interfacing between multiple buses
CN105320490B (en) Method and apparatus for asynchronous FIFO circuit
KR0145321B1 (en) Two-way data transfer apparatus
JP3156813B2 (en) Buffer control circuit
CN111832240B (en) FIFO data transmission method and FIFO storage device
CN110705195A (en) Cross-clock-domain depth self-configuration FIFO system based on FPGA
JP3645584B2 (en) Data transfer synchronization device
US6249875B1 (en) Interface circuit using plurality of synchronizers for synchronizing respective control signals over a multi-clock environment
JP2004521426A (en) First-in / first-out buffer capable of reading and / or writing a selectable number of data words in each bus cycle
CN101403962A (en) Asynchronous double-FIFO data caching method based on FPGA
CN109388370B (en) Method and device for realizing first-in first-out queue
WO2009000794A1 (en) Data modification module in a microcontroller
US9478272B1 (en) Configurable storage blocks with embedded first-in first-out and last-in first-out circuitry
CN109062538B (en) Circular first-in first-out buffer and data transmission interface, system and method
US5758131A (en) Bus adapter for synchronizing communications between two circuits running at different clock rates
Xie et al. Analysis and comparison of asynchronous fifo and synchronous fifo
CN101833431B (en) Bidirectional high speed FIFO storage implemented on the basis of FPGA
US6546451B1 (en) Method and apparatus for decoupling processor speed from memory subsystem speed in a node controller
CN114201276A (en) FIFO interrupt management based method
CN112948322A (en) Virtual channel based on elastic cache and implementation method
CN104407992A (en) Four-port memory based on dual-port RA (register array)
US5488712A (en) Memory circuit with pipeline processing
CN117908790A (en) ONFI PHY quick switching training device based on single Channel multiple Die
CN115834602A (en) Asynchronous data flow communication interaction system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20200117

WD01 Invention patent application deemed withdrawn after publication