Add typed and observable global PnR workflow - #53
Merged
Conversation
Replace hard-coded PnR progress output with leveled tracing and periodic routing summaries. Capture compilation artifacts through an ambient run-scoped snapshot hub, write final and diagnostic outputs asynchronously, and make CLI and counter runs emit reproducible snapshot bundles. Default viewer simulation tracing to off to preserve interactive performance.
Package structured compiler snapshots as deterministic .rsnap archives so complete PnR results can be shared as one file. Extend the NBT viewer with snapshot-first examples, artifact navigation, and interactive depth-aware instance bounding boxes for inspecting those results.
Expose snapshot routes and placement boxes as selectable 3D diagnostics, and add independent block and grid visibility controls so placement geometry can be inspected without world clutter.
Persist per-route block coordinates in compiler snapshots so the viewer can isolate real routed structures. Replace bbox dialogs with block isolation, add route isolation and reliable click-versus-drag handling, and refresh the counter snapshot fixture.
Introduce explicit restartable IR stages so Verilog semantics can be inspected before target mapping and PnR. Lower Logical IR directly into Routable IR, emit both stages in snapshots, and document the separate physical-intent direction.
Split local candidate preparation from global placement and routing so snapshots can retain deduplicated candidate libraries and stable typed topology identities. This lets later global experiments replay from .rsnap without paying the local placer cost again.
Derive global routing connectivity from resolved net and endpoint IDs instead of the original legacy graph module. Preserve the existing physical router behind an adapter while attaching stable net and endpoint identities to every routed branch for constraints, snapshots, and diagnostics.
Feed placement connectivity from the resolved topology and use stable NetId values for routing prefixes and retry groups. This removes original legacy module connectivity and display labels from global search decisions while retaining compatibility adapters inside the physical algorithms.
Collect top-level input switches and observable outputs from resolved endpoints and remove the original legacy module from prepared global execution. This confines the remaining GraphModule shape to preparation parity and physical compatibility adapters.
Introduce an rclayout side input that binds stable instance and net names to typed PnR IDs. Apply region, layer, and fixed-origin placement requirements, route priorities and avoid regions, then preserve resolved intent and satisfaction reports across snapshot replay.
Add soft placement preferences and named extension hooks for placement transforms, cost terms, net priorities, and route validators so experiments can be added without modifying the search core.
Load resolved physical constraints and satisfaction reports from snapshots, show status and related design objects in the Files panel, and focus linked boxes or routes for diagnosis.
Derive placement connectivity, cost, layered assignment, and Free3D springs from resolved nets so Routable IR placement no longer round-trips through a legacy GraphModule adapter.
Add an opt-in structurally keyed candidate cache with content verification and CLI configuration so repeated fresh compilations can skip identical local-placement searches safely.
Build top-input fanout and internal route branches from resolved endpoints, removing the legacy GraphModule adapter from the Routable PnR path while retaining compatibility wrappers for legacy callers.
Feed Routable leaf graphs and typed ports directly into local candidate generation, retain Routable hierarchy through preparation and replay, and make structural cache keys deterministic. This completes the typed IR boundary so global PnR and snapshot replay no longer reconstruct a legacy GraphModuleDesign.
Keep top-level fanout proximity edges out of Free3D attraction springs so typed-topology placement preserves legacy seeded candidates and avoids promoting pathological routing attempts. Add a regression test and refresh the successful counter snapshot.
Add a safe RCIR tokenizer and themed token styles so logical and routable IR files are readable in the snapshot artifact dialog. Refresh the bundled counter example after the latest successful snapshot build.
Introduce explicit candidate and design profiles bound at modules, leaves, and ports so PnR behavior is local, reusable, and replayable. Emit the resolved policy in snapshots, preserve candidate reuse, and teach the Viewer to display the new RCIR syntax.
Replace the flat snapshot file list with semantic NBT, IR, instance, constraint, and auxiliary sections. Add a staged IR viewer and connect instance list hover and selection to bounding-box highlighting and isolation in the 3D scene.
Show Verilog, Logical RCIR, and Routable RCIR together in independently scrollable columns with stable line numbers. Preserve the existing code typography and stack the panes on narrow viewports.
Carry non-semantic debug locations through logical lowering and emit a snapshot source map so generated IR remains traceable to its Verilog origin. Use the map in the NBT Viewer for Godbolt-style hover, pinned selection, and cross-pane navigation.
Add a lightweight stateful Verilog tokenizer so source panes and standalone artifacts distinguish keywords, types, literals, directives, operators, system functions, and multiline comments.
Add draggable and keyboard-accessible splitters so wide Routable RCIR can use more horizontal space, while preserving responsive stacking and supporting snapshots with different IR stage counts.
Route the DFF smoke fixture through LogicalDesign so compilation snapshots retain Logical RCIR and source mappings for Viewer navigation. Canonicalize prepared-candidate fingerprints so regenerated RCIR snapshots remain portable across processes and structurally deduplicated leaves.
Model typed source-map entities, lexical scopes, lowering provenance, and instance-definition references so the Viewer can show precise links without leaking into sibling results. Regenerate snapshot fixtures and make the DFF simulator assertion independent of placement coordinates.
rollrat
marked this pull request as ready for review
July 19, 2026 03:18
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.
What changed
GraphModuleadapter round-trips from typed placement and routingrclayout 1physical intent with hard constraints, soft preferences, net priorities, and keep-outs.rsnap, PnR overlays, isolation, and constraint inspectionWhy
Global PnR had tightly coupled heuristics, display-name based topology recovery,
expensive repeated local placement, and limited failed-search visibility. This
establishes typed boundaries plus independently configurable intent and hooks.
Validation
The broad
cargo test --releaseaudit reached the existingworld::simulator::test::simulator_preserves_dff_latch_torch_state_on_initfailure and two historically long local-placer component tests before the
120-second cap. No new targeted regression was observed.