Skip to content

Add WNS/TNS timing analysis, clock uncertainty, and event buffer draining#17

Open
robtaylor wants to merge 3 commits intomainfrom
gpu-io-models
Open

Add WNS/TNS timing analysis, clock uncertainty, and event buffer draining#17
robtaylor wants to merge 3 commits intomainfrom
gpu-io-models

Conversation

@robtaylor
Copy link

Summary

  • Extend SimStats with WNS/TNS/WHS/THS slack tracking and per-endpoint unique violation counting
  • Add --clock-uncertainty-ps CLI flag to gpu_sim for modelling clock jitter (added to setup/hold constraints)
  • Drain event buffer in gpu_sim GPU-only simulation loop after each batch, accumulating timing statistics
  • Print timing analysis summary (WNS/TNS, unique endpoints, PASS/FAIL) at end of simulation
  • Update docs/timing-violations.md with new metrics, clock uncertainty, and multi-corner workflow

Test plan

  • All 69 library unit tests pass (cargo test --lib)
  • New WNS/TNS accumulation tests (single drain + multi-drain)
  • gpu_sim, loom, metal_test binaries compile with --features metal
  • mdbook build succeeds, new doc sections render correctly
  • CI: unit tests pass on Linux
  • CI: docs build passes

Extract the Metal co-simulation engine (SPI flash, UART, Wishbone bus
trace models) from the standalone gpu_sim binary into a library module
at src/sim/cosim_metal.rs. Replace the cmd_cosim stub in loom.rs with
a thin wrapper that loads the design via setup::load_design() and calls
cosim_metal::run_cosim().

Key changes:
- New cosim_metal module exposes run_cosim()/CosimOpts/CosimResult
- Design loading reuses setup::load_design() instead of duplicating it
- DesignArgs gains clock_period_ps for configurable SDF clock period
- load_sdf() accepts optional clock_period_ps (default 25000ps)
- CI updated to use `loom cosim` instead of `gpu_sim`
- gpu_sim binary removed from Cargo.toml and deleted

Co-developed-by: Claude Code v2.1.44 (claude-opus-4-6)
…ning

- Extend SimStats with worst/total slack tracking (WNS/TNS/WHS/THS) and
  per-endpoint HashSet for unique violation counting
- Add --clock-uncertainty-ps CLI flag to gpu_sim for modeling clock jitter;
  uncertainty is added to setup/hold constraints via build_timing_constraint_buffer()
- Drain event buffer in gpu_sim.rs GPU-only simulation loop after each batch,
  accumulating timing violation statistics across the full run
- Print timing analysis summary (WNS/TNS, unique endpoints, PASS/FAIL) at
  end of simulation when timing is enabled
- Add unit tests for WNS/TNS accumulation across single and multiple drains

Co-developed-by: Claude Code v2.1.44 (claude-opus-4-6)
- Replace old summary statistics section with WNS/TNS/WHS/THS metric
  definitions and example output
- Add --clock-uncertainty-ps to CLI flags table with explanation
- Add multi-corner analysis section with max/min corner workflow
- Add clock uncertainty section explaining the jitter model
- Update gpu_sim example to show --clock-uncertainty-ps flag

Co-developed-by: Claude Code v2.1.44 (claude-opus-4-6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant