Test Plan for 32-Deep Asynchronous FIFO
Objective
To ensure the asynchronous FIFO operates correctly under various conditions, including different clock frequencies, edge cases, and stress scenarios, while maintaining data integrity across clock domains.
FIFO Specifications
Signals:
·???????? wr_clk: Write clock
·???????? rd_clk: Read clock
·???????? rst_n: Active-low reset (assumed synchronous to both clocks for simplicity)
·???????? wr_en: Write enable (active on wr_clk)
·???????? rd_en: Read enable (active on rd_clk)
·???????? data_in: Write data (e.g., 8-bit wide)
·???????? data_out: Read data (e.g., 8-bit wide)
·???????? full: FIFO full flag (in wr_clk domain)
·???????? empty: FIFO empty flag (in rd_clk domain)
?
Parameters:
·???????? Depth: 32 entries
·???????? Data width: 8 bits
?
Behavior:
·???????? Writes occur on posedge wr_clk when wr_en is high and full is low.
·???????? Reads occur on posedge rd_clk when rd_en is high and empty is low.
·???????? Reset clears the FIFO to empty state.
·???????? Flags (full, empty) are synchronized across clock domains.
Test Cases
?
Reset Behavior
·???????? Objective: Verify FIFO initializes correctly after reset in both clock domains.
·???????? Stimulus: Assert rst_n = 0 for a few cycles of both wr_clk and rd_clk, then deassert.
·???????? Checks:
o??? empty = 1, full = 0 post-reset in respective domains.
o??? data_out is undefined or per spec (e.g., 0x00).
?
·???????? Coverage: Reset with both clocks active, one clock stopped.
Basic Write and Read
Fill to Full
·???????? Objective: Ensure FIFO signals full correctly when 32 entries are written.
·???????? Stimulus: Write 32 unique data items (e.g., 0x00 to 0x1F) on wr_clk.
·???????? Checks:
o??? full asserts after 32nd write.
o??? empty remains low until reads begin.
o??? 33rd write is ignored (no overwrite).
·???????? Coverage: Full condition with varying wr_clk/rd_clk ratios
Empty After Full Read
领英推荐
?
?
Random Write/Read Patterns
·???????? Objective: Test mixed operations with asynchronous clocks.
·???????? Stimulus: Randomly assert wr_en and rd_en with varying data and clock frequencies.
·???????? Checks:
o??? Data integrity across domains.
o??? full/empty flags update correctly with CDC delays.
·???????? Coverage: Random occupancy (0–32), clock frequency variations.
?
Simultaneous Write and Read
?
?
Boundary Conditions
?
?
Clock Frequency Extremes
?
?
Reset During Operation
?
?
Stress Test
?
?
Metastability and CDC
Verification Environment
UVM Components:
·???????? Agent: Two agents—one for write domain (wr_agent), one for read domain (rd_agent).
o??? Driver: wr_driver drives wr_en, data_in; rd_driver drives rd_en.
o??? Monitor: wr_monitor captures writes; rd_monitor captures reads, data_out, and flags.
o??? Sequencer: Generates write/read sequences.
·???????? Scoreboard:
o??? Queues writes and compares with reads, accounting for CDC delays.
o??? Checks full/empty consistency.
·???????? Sequences:
o??? Basic, random, stress, boundary, and CDC-focused sequences.