AI-Driven Universal Verification Optimization — Runtime / Instantaneous
A project-agnostic, coverage-driven verification accelerator for hardware RTL simulation. It attaches reinforcement-learning agents to an unmodified third-party HDL/testbench and steers the verification environment while the simulator is still running.
| Arm | What it may touch | Decision cadence |
|---|---|---|
| AI + simulator runtime (SRIE) | live hierarchy, signals, flags, memory geometry via VPI; forces DUT input nets for one force window | every write-clock edge |
| AI + simulator black box | command line (-sv_seed, clock-ratio plusargs, verbosity, test name), transcript, UCDB |
per run, and during a run (tail the log, stop early) |
| No AI baseline | nothing; fixed random seeds and clock ratios | none |
All three arms run the same runner, the same testbench and the same coverage model, so the only difference is the optimiser. That is what makes the side-by-side comparison meaningful.
Nothing in the toolchain edits RTL, testbench, sequence or UVM source. The runtime arm only uses the simulator's own VPI handles; the black-box arm only uses knobs the environment already exposes.
┌────────────────────────────────────────────────┐
│ Python optimizer (local) │
│ │
│ discovery ─► semantic map ─► probe plan │
│ │ │ │
│ ▼ ▼ │
│ coverage tracker ◄──── normalized events │
│ │ ▲ │
│ ▼ │ │
│ RL agent (Q / bandit / DQN) ────┘ │
│ │ │
│ ▼ │
│ action: write / read / idle / corner payload │
└───────┬───────────────────────────┬────────────┘
│ TCP, non-blocking │ subprocess
▼ ▼
┌────────────────────────────┐ ┌──────────────────────────┐
│ aid_uvo_vpi.dll (SRIE) │ │ vsim (black-box arm) │
│ - walks hierarchy (VPI) │ │ -sv_seed / plusargs │
│ - samples probes per step │ │ transcript, UCDB │
│ - pre-edge snapshot │ │ early stop on goal │
│ - force/release window │ └──────────────────────────┘
└────────────┬───────────────┘
▼
┌────────────────────────────┐
│ Questa: unmodified DUT+TB │
└────────────────────────────┘
More diagrams: docs/diagrams.md.
:: 1. Python environment (NumPy only; matplotlib optional)
scripts\setup_env.bat
:: 2. Build the VPI shim (needs MSVC + Questa headers)
vpi\build_vpi.bat "C:\questasim64_2023.4"
:: 3. Compile RTL + UVM testbench
sim\compile.bat "C:\questasim64_2023.4"
:: 4. Interactive menu: choose mode, RL algorithm, runs, seed, coverage goal
sim\run_optimizer.batOne-command three-way comparison:
sim\run_all_modes.bat 10 90 1Individual arms:
sim\run_baseline.bat 12 90 1
sim\run_blackbox_ai.bat 12 bandit 90 1
sim\run_runtime_ai.bat bandit_thompson 95 4000 1 54321No simulator at hand? The runtime pipeline can be exercised with a synthetic backend, clearly labelled as such:
python -m aid_uvo runtime --backend mock --algo qlearning --max-cycles 2000 --out results\smokeEvery artifact produced by the mock backend carries "synthetic": true and the
report prints a warning. It validates plumbing; it is not evidence about the
DUT.
results/<arm>_<timestamp>/
├── result.json common schema, consumed by the comparison report
├── progress.csv elapsed_s, coverage, sim_time_ns, samples
├── coverage.json bin-by-bin hits with first-hit simulation time
├── timeline.json coverage progress series
├── reflection.md runtime only: how signals were identified
├── signal_map.json runtime only: roles, confidence, rejected candidates
├── probe_plan.json runtime only: subscribed probes + coverpoint wrappers
├── inventory.dump runtime only: VPI hierarchy dump (replayable offline)
├── decisions.jsonl runtime only: one line per decision (state, action, reward)
├── campaign.jsonl black box only: one line per run
└── runs/ black box only: per-run log, UCDB, vcover text, JSON
comparison.md is generated by the study/report step:
| Arm | Coverage | Coverage @ budget | Time to target | AUC | Speed-up |
|---|---|---|---|---|---|
| No AI | measured | measured | measured | measured | 1.00x |
| AI + black box | measured | measured | measured | measured | measured |
| AI + runtime | measured | measured | measured | measured | measured |
The shim walks the elaborated design with VPI and reports every scope, net,
width and direction. A semantic metadata layer turns those names and shapes
into roles (wclk, winc, wdata, wfull, …) — it never reads HDL. A probe
plan subscribes to the role nets, and on every write-clock edge the shim sends
a pre-edge snapshot (the values the DUT decided on, not the post-edge
registers). The tracker maps each edge to canonical coverage bins, the agent
picks an action, and the shim opens a force window on the enable/payload
nets at the end of the time step before the next edge, then releases it right
after. The TB driver is never modified; its value reappears when the window
closes. Decision latency is exactly one clock edge.
Details: docs/02_srie_runtime.md.
A tool-independent bin space (40 bins) that can be filled from either channel:
- write/read occupancy buckets, accepted vs blocked traffic,
- full / almost-full / empty / almost-empty boundaries and transitions,
- pointer wrap, fill, drain, concurrent read/write, blocked-both,
- payload classes (all-zero, all-ones, 0xA5, 0x5A, alternating, walking bit, MSB).
Payload bins cannot be seen in a log, so every comparison is computed on the
31-bin log-observable subset, while runtime mode additionally reports the
full 40-bin space. Full table: docs/05_coverage_model.md.
.
├── aid_uvo/ Python optimizer package
│ ├── common/ config, paths, logging, seeding
│ ├── coverage/ bin space, tracker, progress, transcript, UCDB
│ ├── discovery/ hierarchy, semantic roles, probe plan
│ ├── rl/ features, Q-learning, bandits, NumPy DQN
│ ├── runtime/ protocol, TCP bridge, launcher, agent loop
│ ├── blackbox/ run space, Questa runner, campaign
│ ├── baseline/ constrained-random arm
│ ├── report/ three-way comparison, plots
│ ├── experiments/ artifact schema, study driver
│ └── cli.py command line + interactive menu
├── vpi/ native SRIE shim (C + build script)
├── sim/ Questa batch scripts (interactive + per-arm)
├── scripts/ environment setup, archiver
├── config/aid_uvo.json all defaults, no code change needed to tune
├── docs/ 10 focused documents + diagrams
├── results/ artifacts and the illustrative template
└── Testbench_UVM/ sample async-FIFO RTL + UVM TB (reference only)
| Document | Contents |
|---|---|
| 01 Architecture | components, data flow, process model, failure containment |
| 02 SRIE runtime | discovery, edge semantics, force window, decision latency |
| 03 Black box | legal channels, run space, strategies, early stop |
| 04 RL design | MDP, state/action/reward, algorithms, hyperparameters |
| 05 Coverage model | every bin, observability, fairness |
| 06 Usage guide | all commands, menus, artifacts |
| 07 Questa/VPI setup | build, load, plusargs, verification, errors |
| 08 Comparison methodology | metrics, budget rules, statistics |
| 09 Extending | other simulators/HDLs, new bins, new agents |
| 10 FAQ / troubleshooting | symptoms and fixes |
- The sample design (
Testbench_UVM/, asynchronous FIFO with a UVM TB) compiles and runs with Questa on Windows; the scripts here target that flow. - Universality is a direction, not a claim. Name/shape rules cover common
streaming/buffered interfaces;
runtime.role_overridesexists precisely because heuristics are not omniscient. Ports to other simulators keep the same wire protocol (see doc 09).