A robust SystemVerilog implementation of a configurable Data Aligner module, accompanied by a comprehensive UVM (Universal Verification Methodology) testbench.
The CFS Aligner is a hardware module designed to align streaming data based on offset and size parameters. It bridges a data producer and consumer, managing data alignment, buffering, and flow control. The project includes a full verification environment to ensure functional correctness across various configurations.
In high-speed data processing pipelines, data often arrives unaligned or in varying chunk sizes. This module solves the problem of re-aligning valid data segments for downstream processing, providing a standard interface for control (APB) and data streaming (MD protocol).
- Configurable Design: Parameterizable Data Width (
ALGN_DATA_WIDTH) and FIFO Depth (FIFO_DEPTH). - Standard Control Interface: APB (Advanced Peripheral Bus) Slave interface for configuration and status registers.
- Streaming Data Interface: Custom "MD" (Metadata/Media Data) protocol for RX (Input) and TX (Output) with
valid/readyflow control. - Interrupt Support: Integrated interrupt logic for status reporting.
- UVM Verification:
- Modular UVM Environment (Env, Agents, Scoreboard, Predictor).
- Reusable VIPs (Verification IPs) for APB and MD protocols.
- Functional Coverage and Register Model (RAL).
- Language: SystemVerilog (IEEE 1800)
- Methodology: UVM (Universal Verification Methodology)
- Tools: Compatible with standard EDA simulators (QuestaSim, VCS, Xcelium, Vivado Simulator).
The repository is organized as follows:
- Design (RTL):
cfs_aligner.v: Top-level wrapper.cfs_aligner_core.v: Core alignment logic.cfs_synch_fifo.v: Synchronization FIFO.cfs_*_ctrl.v: Control logic modules.
- Verification (UVM):
cfs_algn_env.sv: Top-level UVM Environment.cfs_apb_agent/: APB Verification IP (Driver, Monitor, Sequencer).cfs_md_agent/: MD Protocol Verification IP.cfs_algn_reg_block.sv: Register Abstraction Layer (RAL) model.cfs_algn_scoreboard.sv: Data integrity checker.cfs_algn_coverage.sv: Functional coverage collector.
- Simulation:
testbench.sv: Top-level testbench module.messages.f: Compilation file list.
-
Clone the repository:
git clone https://github.com/your-username/cfs-aligner-verification.git cd cfs-aligner-verification -
Prerequisites:
- A SystemVerilog simulator (e.g., Siemens QuestaSim, Synopsys VCS, Cadence Xcelium).
- UVM 1.1d or 1.2 library compiled for your simulator.
To run a simulation, you need to compile the design and testbench files listed in messages.f and execute the simulation with a specific UVM test name.
-
Compile:
# Example for QuestaSim vlog -sv +incdir+. -f messages.f -
Simulate:
# Example for QuestaSim vsim -c testbench -do "run -all" +UVM_TESTNAME=cfs_algn_test_random
The following UVM tests are defined in cfs_algn_test_pkg.sv:
| Test Name | Description |
|---|---|
cfs_algn_test_reg_access |
Verifies Read/Write access to APB registers (CSRs). |
cfs_algn_test_random |
Randomized data traffic on RX/TX with random configurations. |
cfs_algn_test_random_rx_err |
Injects errors on the RX interface to verify robustness. |
cfs_algn_test_base |
Base test for sanity checks and environment bring-up. |
The cfs_aligner module can be configured via Verilog parameters:
module cfs_aligner#(
parameter ALGN_DATA_WIDTH = 32, // Width of the data bus
parameter FIFO_DEPTH = 8 // Depth of the internal buffering
) ...The verification environment uses a Scoreboard (cfs_algn_scoreboard) to compare the DUT output against a reference Model (cfs_algn_model).
- Data Path: Verified by sending random packets via
md_rx_agentand checking integrity atmd_tx_agent. - Control Path: Verified via
apb_agentperforming Register Reads/Writes. - Coverage:
cfs_algn_coveragetracks functional coverage points to ensure all scenarios (FIFO full/empty, backpressure, interrupts) are exercised.
- Add Clock Domain Crossing (CDC) support (currently placeholders
CDC_RX_TO_REG,CDC_REG_TO_TXexist). - Expand coverage metrics.
- Add formal verification properties (SVA).
- Provide a
Makefilefor automated regression running.
Contributions are welcome! Please follow these steps:
- Fork the project.
- Create your feature branch (
git checkout -b feature/AmazingFeature). - Commit your changes (
git commit -m 'Add some AmazingFeature'). - Push to the branch (
git push origin feature/AmazingFeature). - Open a Pull Request.
This project was developed as part of a Design Verification with SystemVerilog & UVM course on Udemy.
- Original Author / Instructor: Cristian Florin Slav
- Course: Design Verification with SystemVerilog
While the core logic and architecture follow the course material, this repository serves as a personal implementation and study reference to demonstrate proficiency in UVM environments, agent development, and functional coverage.