Verification of ASYNCHRONOUS FIFO

In reply to Blitzz0418:
This is an opinion: Use whatever works for you. The difference I see between the two solutions is how the test environment emulates the real world.
**TWO AGENTS:**These agents are independent from each other and emulate the real world where one device pumps or produces data at its own rate and will, and the other consumes data on an as-needed basis. If the production is faster than the consumption, the producer must stop when a limit is reached. Conversely, if the consumer absorbs more data than produced, it must wait till there is something to consume.
With two agents, the model can be based on independent constraints for the rates of production and consumption. This can answer questions like:

  • What if the rate of production is changed x and the rate of consumption is y?
    How does this affect the latencies and performance of the system?
  • What if I go 2 * x?

Changes to respond to these questions become trivial because of the independent models of the agents.
ONE AGENT: One agent can be used to emulate the consumer and producer, but changing the statistics becomes more complicated and may be harder to support.

Bottom line, I prefer the two-agent method because it emulates the real world, and tuning the rates and statistics can provide system performance information; it can even answer the question: How deep should this FIFO be?

Ben Cohen
http://www.systemverilog.us/ ben@systemverilog.us
For training, consulting, services: contact http://cvcblr.com/home.html
** SVA Handbook 4th Edition, 2016 ISBN 978-1518681448

  1. SVA Package: Dynamic and range delays and repeats SVA: Package for dynamic and range delays and repeats | Verification Academy
  2. Free books: Component Design by Example FREE BOOK: Component Design by Example … A Step-by-Step Process Using VHDL with UART as Vehicle | Verification Academy
    Real Chip Design and Verification Using Verilog and VHDL($3) Amazon.com
  3. Papers: