Fix 2x clock frequency bug and add timing investigation tools#58
Merged
Fix 2x clock frequency bug and add timing investigation tools#58
Conversation
…prefix When a netlist wraps cells inside a submodule (e.g., openframe_project_wrapper → top top_inst → cells), NetlistDB produces paths like "top_inst._58619_" but OpenROAD's SDF has flat paths like "_58619_". This caused all SDF lookups to fail silently, resulting in zero timing delays. Fix: sample the first 100 cell paths against the SDF. If most fail but stripping the first dot-separated component succeeds, strip the prefix globally. This correctly detects and handles the wrapper hierarchy without hardcoding module names. Result: 28,381 SDF cells matched (previously 0), timing now properly applied including PnR-inserted output buffers, clock buffers, and fanout buffers. Co-developed-by: Claude Code v2.1.50 (claude-opus-4-6)
Extend jacquard with ability to analyze and dump AIG critical paths with full timing details. Changes: - Add AIG.dump_critical_paths_detailed() method that returns formatted string showing: * Per-endpoint critical path from source to sink * Each node's cell origin (synthesis cells that created it) * Gate delays from Liberty library * Cumulative arrival times - Add 'dump-paths' CLI subcommand to jacquard binary * Takes netlist, SDF, and Liberty library files * Configurable output limit (default: top 5 paths) * Dumps complete path details for debugging timing issues - Update main() to handle new DumpPaths command Tested on MCU SoC (6_final.v): Successfully traces multiple critical paths with cell origins and per-gate timing information. This is the final step of the timing comparison report implementation (goal step 15). Co-developed-by: Claude Haiku 4.5 (claude-haiku-4-5-20251001)
The MultiClockScheduler produces one entry per GCD tick (half-cycle), alternating between falling and rising edges. Each cosim tick does both a fall eval and rise eval, consuming one schedule entry for both phases. For a single clock with schedule [fall, rise], this meant: - Even ticks used the falling-edge entry → posedge_flag=0 → DFFs skip - Odd ticks used the rising-edge entry → posedge_flag=1 → DFFs capture DFFs only captured every other cycle, making the design run at half the correct frequency. This was the root cause of Issue #54 (2x UART baud rate factor). Fix: pair consecutive schedule entries so each cosim tick gets fall_ops from the falling-edge GCD tick and rise_ops from the rising-edge GCD tick. For a single 40ns clock, this reduces the schedule from 2 entries (alternating, broken) to 1 paired entry (correct). Also removes the legacy single-clock code path (build_falling_edge_ops, build_rising_edge_ops, all_posedge_flag_bits, all_negedge_flag_bits) since the multi-clock scheduler now handles all cases. Also adds --dump-dff option for debugging internal DFF state per cycle, and fixes an AIG type reference in run_timing_analysis. Fixes #54 Co-developed-by: Claude Code v2.1.50 (claude-opus-4-6)
The 2x factor in cycles_per_bit was compensating for the half-speed DFF capture bug (now fixed). With DFFs capturing every cycle, the correct cycles_per_bit for 25MHz/115200 baud is 217, not 434. Co-developed-by: Claude Code v2.1.50 (claude-opus-4-6)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--timing-vcdto cosim for native timing-accurate VCD output with per-signal arrival offsets from SDF data--dump-dffto cosim for debugging internal DFF state per cyclescripts/sdf_trace.py) for debugging timing discrepanciesdump-pathsCLI subcommand for AIG critical path analysisarrival_state_offsetthrough CUDA/HIP kernels for cross-platform--timing-vcdKey fix: 2x clock frequency (Issue #54)
The
MultiClockSchedulerproduces one entry per GCD tick (half-cycle). For a single 40ns clock:[falling, rising]. Each cosim tick used ONE entry for both fall and rise phases:posedge_flag=0→ DFFs don't captureposedge_flag=1→ DFFs captureFix: pair consecutive schedule entries so each tick gets correct fall + rise ops.
Fixes #54
Test plan