Skip to content

Add typed and observable global PnR workflow - #53

Merged
rollrat merged 26 commits into
masterfrom
codex/pnr-observability
Jul 19, 2026
Merged

Add typed and observable global PnR workflow#53
rollrat merged 26 commits into
masterfrom
codex/pnr-observability

Conversation

@rollrat

@rollrat rollrat commented Jul 18, 2026

Copy link
Copy Markdown
Member

What changed

  • add typed Logical and Routable RCIR stages and drive global PnR from resolved topology
  • remove legacy GraphModule adapter round-trips from typed placement and routing
  • add rclayout 1 physical intent with hard constraints, soft preferences, net priorities, and keep-outs
  • add named extension hooks for placement transforms, costs, net priorities, and route validators
  • add replayable snapshots containing IR, candidates, placement, routing, intent, and reports
  • add an opt-in persistent local-candidate cache with content verification
  • extend the NBT viewer with .rsnap, PnR overlays, isolation, and constraint inspection
  • improve global PnR progress logging and diagnostics

Why

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

  • targeted physical-intent, placement, routing, cache, snapshot, and global-PnR release tests pass
  • 49 global router tests pass
  • NBT viewer TypeScript/Vite production build passes
  • browser smoke check reports no viewer console errors

The broad cargo test --release audit reached the existing
world::simulator::test::simulator_preserves_dff_latch_torch_state_on_init
failure and two historically long local-placer component tests before the
120-second cap. No new targeted regression was observed.

rollrat added 26 commits July 18, 2026 13:26
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
rollrat marked this pull request as ready for review July 19, 2026 03:18
@rollrat
rollrat merged commit c7f6bb7 into master Jul 19, 2026
2 checks passed
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