Skip to content

Commit c52bb7b

Browse files
Preston-WalkerPreston Walker
andauthored
Updated validation to use reactive stimulus for better error detection (#24)
* Updated validation to use reactive stimulus for better error detection * Addressed concerns about validation pull request --------- Co-authored-by: Preston Walker <prwalker@xsjprwalker50x.amd.com>
1 parent 9f6342a commit c52bb7b

2 files changed

Lines changed: 558 additions & 77 deletions

File tree

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ After running `dcp_optimizer.py`, you should validate that the optimized design
291291

292292
**Phase 2: Functional Simulation** (via Vivado + xsim)
293293
- Exports both designs as Verilog simulation models
294-
- Generates testbench with random stimulus (LFSR-based)
294+
- Generates a testbench with LFSR-based stimulus and reactive drivers for recognized ready/valid, command/response, streaming, and HLS control interfaces
295295
- Runs xsim simulation with configurable test vector count
296296
- Compares outputs cycle-by-cycle for mismatches
297297

@@ -306,6 +306,9 @@ python3 validate_dcps.py golden.dcp optimized.dcp --vectors 10000
306306

307307
# Enable debug logging
308308
python3 validate_dcps.py golden.dcp optimized.dcp --debug
309+
310+
# Disable reactive interface stimulus and use pure LFSR randomness
311+
python3 validate_dcps.py golden.dcp optimized.dcp --no-reactive
309312
```
310313

311314
### Example
@@ -369,7 +372,7 @@ python3 validate_dcps.py fpl26_contest_benchmarks/logicnets_jscl_2025.1.dcp logi
369372
# Simulation Results:
370373
# Cycles: 200
371374
# Mismatches: 0
372-
# Log: /tmp/dcp_validation_xyz/simulation.log
375+
# Log: dcp_validation_xyz/simulation.log
373376
#
374377
# Phase 2: PASSED ✓
375378
# ----------------------------------------------------------------------
@@ -400,18 +403,21 @@ python3 validate_dcps.py fpl26_contest_benchmarks/logicnets_jscl_2025.1.dcp logi
400403
| `revised_dcp` | Revised (optimized) DCP file to validate | Required |
401404
| `--vectors`, `-n` | Number of random test vectors to simulate | 200 |
402405
| `--debug` | Enable debug logging | False |
406+
| `--no-reactive` | Disable reactive interface stimulus and use pure LFSR randomness | False |
403407

404408
### Notes
405409

406410
- **Simulation time**: Dominated by `xelab` (must compile every cell in both designs) plus per-cycle `xsim` cost. For huge benchmarks like `corescore_500_mod` (~6.7K user modules, ~100K primitives) `xelab` alone takes ~14 minutes, so run-to-run wall-clock is bounded by that even with very few vectors.
407411
- **Vector count**: 200 vectors is sufficient to catch functional regressions on most designs while keeping wall-clock reasonable on the largest benchmarks. For higher confidence on small/medium designs use `--vectors 10000` (or more). xsim cost scales roughly linearly with vectors.
408-
- **Working directory**: Preserved after validation in `/tmp/dcp_validation_*` with simulation logs and intermediate files.
412+
- **Working directory**: Preserved after validation in a repo-local `dcp_validation_*` directory with simulation logs and intermediate files.
409413
- **No testbench required**: The tool automatically generates stimulus based on design I/O structure.
414+
- **Reactive stimulus**: By default, the generated testbench recognizes common interface naming patterns and drives simple reactive behavior. This is a heuristic, golden-driven shared environment: the testbench uses the golden DUT's recognized control outputs to schedule shared inputs, and separately checks corresponding control outputs for divergence. Use `--no-reactive` to fall back to pure LFSR stimulus if those heuristics are not appropriate for a design or benchmark.
410415
- **Clock/reset detection**: Automatically identifies clock and reset signals by name pattern matching.
411416

412417
### Limitations
413418

414419
- Simulation-based validation is not exhaustive (depends on test vector coverage)
420+
- Simulator crashes, timeouts, or tool failures are treated as validation failures, even if no output mismatches were observed before the failure.
415421
- For formal proof of equivalence, use commercial tools like Synopsys Formality or Cadence Conformal
416422
- Designs with encrypted IP blocks are not supported
417423
- Asynchronous designs may require custom testbenches

0 commit comments

Comments
 (0)