How vyas789/i3c_avip works
1. This repository is a SystemVerilog/UVM verification collateral package for an accelerated MIPI I3C VIP. The architecture is split into a synthesizable HDL top and a non-synthesizable HVL top so the same bench can run in simulation or emulation.
2. The DUT is the I3C controller RTL in rtl_dev/src. The core is built from I3C_TOP, i3c_bit_engine, i3c_cmd_ctrl, i3c_sdr_fsm, i3c_daa_fsm, i3c_scl_gen, FIFO blocks, a register interface, and a device table. This is the hardware block under verification.
3. The HDL top in src/hdl_top is the accelerated, synthesizable side of the testbench. It contains the bus and protocol interfaces (apb_if, i3c_if), a wrapper around the DUT, and BFM-style components for APB, I3C controller, and I3C target driving/monitoring.
4. The HVL top in src/hvl_top is the UVM side. It contains the APB master agent, I3C controller agent, I3C target agent, environment configuration, virtual sequencer, scoreboard, RAL model, and coverage components. This is where constrained-random stimulus, checking, and test orchestration live.
5. APB is the control/configuration path into the DUT. The APB master agent programs DUT registers through the HDL-top APB interface and RAL layer, which then influences protocol behavior such as address setup, FIFO access, and mode control.
6. The main protocol data path is I3C traffic between the controller-side BFM and target-side BFM, coordinated by the HVL sequences. The controller and target agents model the two bus participants and support write, read, repeated-start, multi-transfer, and dynamic address assignment scenarios.
7. The verification environment is organized around layered sequences. Base sequences and virtual sequences are defined separately for APB, controller, target, and top-level test behavior, with many scenario-specific tests for 8/16/32/64-bit transfers, random transfer widths, start/stop combinations, FIFO-full behavior, invalid address handling, and DAA flows.
8. Scoreboarding and checking are centralized in src/hvl_top/env/i3c_scoreboard*. The scoreboard compares expected versus observed protocol outcomes, including address/NACK behavior and transaction ordering, while coverage components track exercised protocol and feature space.
9. The test catalog is explicit and regression-oriented. Individual tests live under src/hvl_top/test, and regression lists are under src/hvl_top/testlists such as i3c_standard_mode_regression.list. This makes it straightforward to map a test suite to coverage goals and to a diagram of stimulus selection.
10. Simulation infrastructure is split by tool in sim/. There are make-based flows for Questasim, Synopsys VCS, and Cadence Xcelium, plus generated waveform and coverage artifacts per test and merged regression coverage. The checked-in sim/questa_sim results show the repository is used as a complete verification delivery, not just source code.
11. Unit-test collateral under unit_test/ validates individual HDL and HVL components in isolation, such as BFMs, agent config, driver proxies, and transaction objects. This is an important boundary: component correctness is verified separately from full system protocol behavior.
12. The repository also includes architecture and planning documents under doc/ and rtl_dev/doc/. These define the intended design, verification plan, naming conventions, and coverage model, which are useful reference layers for understanding the intended subsystem boundaries in a diagram.
Main entry points: i3c_env.sv I3C Env · I3C_TOP.v I3C Top · i3c_controller_agent.sv Ctrl Agent · i3c_target_agent.sv Tgt Agent
Components 24
DUT RTL
Synthesizable I3C controller under verification.
- I3C Top · Main RTL controller integration block under test.
rtl_dev/src/I3C_TOP.v - Core Engines · Bit engine, command control, SDR, DAA, SCL generation, FIFOs, register interface, and device table.
rtl_dev/src/i3c_bit_engine.v - Register Plane · Register interface and device table programming plane.
rtl_dev/src/i3c_reg_interface.v
HDL Top
Accelerated synthesizable testbench side.
- HDL Top · Synthesizable top-level verification wrapper for emulation/simulation.
src/hdl_top/hdl_top.sv - Bus IFs · APB and I3C interface definitions shared across bench components.
src/hdl_top/apb_if/apb_if.sv - DUT Wrapper · Wraps the DUT and binds it to the accelerated testbench fabric.
src/hdl_top/i3c_wrapper.sv - APB BFM · Synthesizable APB master driver and monitor for register programming.
src/hdl_top/apb_master_agent_bfm/apb_master_agent_bfm.sv - Ctrl BFM · Controller-side protocol driver and monitor for I3C traffic.
src/hdl_top/controller_agent_bfm/i3c_controller_agent_bfm.sv - Tgt BFM · Target-side protocol driver and monitor for I3C traffic.
src/hdl_top/target_agent_bfm/i3c_target_agent_bfm.sv
HVL Top
UVM stimulus, checking, and orchestration.
- HVL Top · Non-synthesizable UVM testbench entry and orchestration layer.
src/hvl_top/hvl_top.sv - APB Agent · APB master agent, proxies, sequencer, driver, monitor, and coverage.
src/hvl_top/apb_master/apb_master_agent.sv - Ctrl Agent · I3C controller-side agent for protocol stimulus and observation.
src/hvl_top/controller/i3c_controller_agent.sv - Tgt Agent · I3C target-side agent for protocol stimulus and observation.
src/hvl_top/target/i3c_target_agent.sv - I3C Env · Connects agents, configuration, scoreboard, RAL, and virtual sequencing.
src/hvl_top/env/i3c_env.sv - Virtual Seq · Virtual sequencer coordinating APB, controller, and target flows.
src/hvl_top/env/virtual_sequencer/i3c_virtual_sequencer.sv - Scoreboard · Central protocol and transaction-order checking, including NACK/address behavior.
src/hvl_top/env/i3c_scoreboard.sv - RAL Model · Register abstraction used to program DUT control and status fields.
src/hvl_top/env/i3c_ral_reg_block.sv - Tests · Top-level tests and scenario-specific virtual sequences.
src/hvl_top/test/test.sv - Regression Lists · Explicit regression selections and suite definitions.
src/hvl_top/testlists/i3c_standard_mode_regression.list
Simulation
Tool flows, regressions, and generated artifacts.
- Sim Flows · Questa, VCS, and Xcelium make-based simulation flows.
sim/questa_sim/makefile - Coverage Artifacts · Per-test and merged waveform/coverage outputs from regression runs.
sim/questa_sim/merged_cov_html_report/index.html
Unit Tests
Isolated component-level verification collateral.
- HDL Unit · Isolated HDL component tests, including controller BFM behavior.
unit_test/hdl_unit_test/controller_agent_bfm_unit_test/i3c_controller_driver_bfm_unit_test/i3c_controller_driver_bfm_unit_test.sv - HVL Unit · Isolated HVL component tests for configs, proxies, transactions, and target sequences.
unit_test/hvl_unit_test/controller_unit_test/controller_tx_unit_test/i3c_controller_tx_unit_test.sv
Docs
Architecture and verification planning references.
- Plans & Docs · Architectural, verification, coverage, and coding guidance documents.
doc/i3c_avip_main_architectural_document.md
Connections 25
- HDL Top → Bus IFs: uses · Top instantiates shared APB/I3C interfaces.
- HDL Top → DUT Wrapper: wraps · Synthesizable top wraps the DUT integration.
- DUT Wrapper → I3C Top: instantiates · Wrapper contains the RTL controller block.
- I3C Top → Core Engines: builds from · Top-level RTL is composed from protocol engines and FIFOs.
- I3C Top → Register Plane: controls via · Register plane configures protocol and data-path behavior.
- HVL Top → I3C Env: creates · UVM top constructs the environment.
- I3C Env → APB Agent: connects · Environment includes APB configuration agent.
- I3C Env → Ctrl Agent: connects · Environment includes controller-side agent.
- I3C Env → Tgt Agent: connects · Environment includes target-side agent.
- I3C Env → Virtual Seq: coordinates · Virtual sequencer orchestrates cross-agent scenarios.
- I3C Env → Scoreboard: checks · Environment centralizes scoreboarding and protocol checking.
- I3C Env → RAL Model: programs · Environment uses RAL for register access abstraction.
- APB Agent → APB BFM: drives · UVM APB agent talks through synthesizable APB BFM.
- Ctrl Agent → Ctrl BFM: drives · Controller agent maps to accelerated controller BFM.
- Tgt Agent → Tgt BFM: drives · Target agent maps to accelerated target BFM.
- RAL Model → Register Plane: programs · RAL writes reach DUT register interface.
- Tests → Virtual Seq: launches · Tests select and start layered virtual sequences.
- Regression Lists → Tests: selects · Regression lists enumerate the test catalog.
- Sim Flows → Coverage Artifacts: produces · Simulation flows generate waveforms and coverage reports.
- Sim Flows → Tests: runs · Tool flows execute the regression test catalog.
- HDL Unit → Ctrl BFM: validates · HDL unit tests cover BFM behavior in isolation.
- HVL Unit → Ctrl Agent: validates · HVL unit tests cover agent/config/proxy behavior.
- HVL Unit → Tgt Agent: validates · HVL unit tests cover target-side transaction logic.
- Plans & Docs → I3C Env: defines · Docs describe environment boundaries and intent.
- Plans & Docs → I3C Top: specifies · Docs capture DUT architecture and design intent.