This project is an end-to-end Machine Learning framework for functional coverage closure in verification.
It learns the relationship between stimulus knobs and coverage bin hits, then recommends targeted knob settings to close unhit bins faster than standard constrained-random loops.
Core script: ml_cov_framework.py
Traditional constrained-random verification can spend many redundant cycles trying to hit rare corner bins.
This framework reduces that waste by:
- Generating labeled coverage data.
- Training a multi-label model to predict bin-hit probability.
- Running inverse optimization to suggest knob constraints for unhit bins.
Instead of blindly sampling a large stimulus space, the model estimates:
Then optimization searches for:
Where:
-
$C_i$ is coverage bin$i$ . -
$x$ is the stimulus knob vector. -
$\mathcal{T}$ is the set of target (unhit) bins.
This typically cuts simulation effort for hard bins by a large factor.
- Verification Engineers working on coverage closure.
- DV Leads who need faster regression convergence.
- Teams using UVM/cocotb-style randomized flows.
- Researchers prototyping ML-guided verification.
ml_cov_framework.pyrequirements.txt
- Python 3.10+
- Packages in
requirements.txt
Install:
pip install -r requirements.txtRun from this directory.
python3 ml_cov_framework.py datagen --seeds 2000Output: coverage_dataset.csv
python3 ml_cov_framework.py train --model rfOutputs:
cov_predictor.joblibfeature_importance.csv
python3 ml_cov_framework.py optimize --target cov_all_stress cov_cross_s0d3 cov_heavy_bp --mode loopOutput: optimizer report with best knobs and UVM-style constraint block.
python3 ml_cov_framework.py all --seeds 2000 --target cov_all_stress cov_cross_s0d3 cov_heavy_bp- Data generation progress and per-bin hit rates.
- Validation metrics such as Hamming loss and Macro/Micro F1.
- Feature-importance summary (RF mode).
- Optimized knob values and predicted hit probabilities for target bins.
- Auto-generated constraint block for targeted reruns.
- Fewer redundant simulations.
- Faster closure of rare bins.
- Better visibility into knob-to-coverage influence.
- Repeatable and automatable steering loop for regressions.
- This README describes the simulator-free flow.
- The script is self-contained for data generation, training, and optimization.
- If needed, RTL/cocotb integration can be layered on top later.