Skip to content

sarafouad02/Synchronous-FIFO-verification-in-UVM

Repository files navigation

Synchronous FIFO SystemVerilog Project

Project Overview

This repository contains the implementation and verification environment for a parameterizable synchronous FIFO (First-In-First-Out) buffer in SystemVerilog. The design supports key FIFO operations along with status flags and includes a comprehensive UVM-based testbench and verification infrastructure.

Features

  • Configurable FIFO depth and data width

  • Asynchronous reset with proper initialization of memory and control signals

  • Write (wr_en) and read (rd_en) operations with simultaneous read/write handling

  • Status flags:

    • full, almost_full
    • empty, almost_empty
    • overflow, underflow
    • wr_ack acknowledgement for successful writes

Directory Structure

├── design/                  # RTL source for FIFO and related modules
├── tb/                      # Top-level testbench instantiation
├── pkg/
│   ├── coverage_pkg/       # Coverage definitions and configurations
│   ├── transaction_pkg/    # Sequence item and transaction definitions
│   ├── monitor_pkg/        # Monitors for interface and protocol checking
│   └── scoreboard_pkg/     # Scoreboard and reference model integration
├── interface/              # UVM interfaces and virtual interface definitions
├── shared_pkg/             # Shared types, parameters, and utilities
├── sim/                     # Simulation scripts, run files, transcripts, waveforms
└── reports/
    └── coverage_report/    # Generated coverage reports

Verification Plan

The functional verification plan defines the following directed and random scenarios to validate FIFO behavior, along with corresponding coverage goals and reference model checks:

Label Design Requirement Stimulus Coverage & Checks
FIFO_1 Reset clears FIFO and all flags are reset correctly Directed reset, then random reset deassertion Immediate assertions on clear and flags reset
FIFO_2 Write stores data and updates full/ almost_full flags Randomize wr_en and data_in (no read) Cover all data_in values and flag updates
Concurrent assertions against reference model
FIFO_3 Read outputs data and updates empty/ almost_empty flags Randomize rd_en (no write) Cover flag transitions during reads
Scoreboard-based data checking
FIFO_4 Only one operation occurs when both wr_en and rd_en are high Randomize both wr_en and rd_en Cover simultaneous read/write cases
Reference model asserts correct behavior
FIFO_5 Ignore writes when full; assert overflow on invalid write Randomize wr_en when FIFO is full Cover full flag transitions and overflow events
Immediate overflow detection assertions
FIFO_6 Ignore reads when empty; assert underflow on invalid read Randomize rd_en when FIFO is empty Cover empty flag transitions and underflow events
Immediate underflow detection assertions
FIFO_7 Assert wr_ack on valid writes Randomize wr_en when FIFO not full Cover write acknowledgments
Concurrent assertions for wr_ack
FIFO_8 Handle boundary transitions (e.g., full→almost_full, empty→almost_empty) Push FIFO to boundary through reads/writes Cover boundary condition transitions
Concurrent assertions for correct flag handling

Detailed plan and expected coverage goals are outlined in the Verification Plan document. fileciteturn1file1

Identified Changes and Bug Fixes

During design reviews and verification runs, the following modifications were applied to enhance correctness and robustness:

  1. Initialization of Memory Array

    • Added explicit initialization of the internal memory (mem) to all zeros on reset. fileciteturn1file2
  2. Write Acknowledgement (wr_ack)

    • Ensured wr_ack is initialized to 0 on reset and asserted only on successful write transactions. fileciteturn1file2
  3. Underflow Handling

    • Moved underflow flag assignment into a sequential block under the read logic to avoid combinational hazards. fileciteturn1file2
  4. Count Management for Simultaneous Read/Write

    • Added explicit cases to increment/decrement count appropriately when both read and write are asserted. fileciteturn1file2
  5. Almost Full / Almost Empty Signals

    • Corrected thresholds: almost_full now triggers at FIFO_DEPTH - 1; almost_empty at count == 1. fileciteturn1file2

Getting Started

  1. Requirements

    • SystemVerilog-capable simulator (e.g., VCS, Xcelium, or QuestaSim)
    • UVM library installed and accessible in your simulation environment
  2. Running Simulations

    cd sim
    ./run_fifo_uvm.sh   # Executes all UVM tests and generates reports
  3. Viewing Results

    • Waveforms: Available in sim/waves/
    • Transcript Logs: Available in sim/logs/
    • Coverage Reports: HTML reports in reports/coverage_report/

Contributing

Contributions are welcome! Please fork the repository and submit pull requests for bug fixes, feature enhancements, or improved coverage scenarios.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors