shinei-nouzen-arch/fpga-agent/vivado-timing-closure
Claude Code and agent skill by shinei-nouzen-arch/fpga-agent
- community
Checking that the SKILL.md file is still in the repository.
Vivado FPGA timing closure and optimization assistant. Covers systematic timing analysis, constraint validation, implementation strategy selection (place_design/phys_opt_design/route_design directives), pblock-based area constraints, RapidWright-assisted netlist optimization, and iterative convergence workflows. Use when users mention timing closure, WNS/TNS violations, Fmax improvement, FPGA timing optimization, DCP optimization, or post-route ECO fixes. Also trigger for questions about check_…
Install
npx vskill@latest install shinei-nouzen-arch/fpga-agent/vivado-timing-closureSKILL.md
Vivado Timing Closure & Optimization
Systematic FPGA timing convergence based on AMD UltraFast Design Methodology (UG949) and the XTP301 checklist, combined with practical optimization experience.
For explanation or report-only requests, analyze the available evidence and identify any missing verification without requiring a new build. Run optimization only when it is within the user's request, and reuse valid results for the current design. Existing authorization covers necessary in-scope follow-up; changing a strategy or consulting vivado-tcl does not require repeated confirmation. Preserve explicit limits on RTL, netlist, interfaces, constraints, target frequency, runtime, and hardware operations.
Quick Decision Flow
Timing Acceptance Criteria
| Metric | Requirement | Check Command | |
|---|---|---|---|
| Setup WNS/TNS | WNS > 0 ns, TNS = 0 ns | report_timing_summary | |
| Hold WHS/THS | WHS > 0 ns, THS = 0 ns | report_timing_summary -delay_type min_max | |
| Pulse Width WPWS/TPWS | WPWS > 0 ns, TPWS = 0 ns | report_timing_summary | |
| Route Status | Design fully routed; 0 routing errors | report_route_status | |
| Fmax | 1000 / (clock_period - WNS) MHz | WNS is negative for failing paths |
For a timing-closure task, apply these checks to the same final design with the full intended constraints, including I/O timing. Verify zero unconstrained internal endpoints, intended exception coverage, and applicable CDC, DRC, and methodology findings. Run report_bus_skew separately when bus-skew constraints exist. Resolve findings or use justified waivers only within the task's authorization; do not weaken constraints to produce a pass.
WNS >= 0 or a high QoR score starts final verification; neither is a completion condition. Keep the positive-margin requirements above unless the user has explicitly specified a different acceptance policy. Missing metrics or checks remain unverified, not passed. Timing closure is complete only after the applicable checks pass and the requested artifacts and validation results are delivered; bitstream generation or hardware programming is not an automatic next stage.
Important: Fmax is NOT explicitly shown in Vivado reports. Always calculate it: Fmax = 1000 / (period - WNS) where WNS is the value from the timing summary (negative means failing).
Layer 1: Constraint Validation (ALWAYS START HERE)
Before any optimization, verify the design is properly constrained. Skipping this wastes hours optimizing paths that aren't the real problem.
Essential checks (in priority order):
Interpreting QoR Assessment:
- Score 1-2: Major constraint or methodology issues — fix these first
- Score 3: Design has timing challenges but constraints are reasonable
- Score 4-5: Good design quality, remaining issues are fine-grained
Read references/methodology-checklist.md for specific DRC checks mapped from XTP301.
Layer 2: Tool-Managed Implementation Optimization (May Change the Netlist)
This is where the biggest gains come from. The directives below are ordered by typical impact.
Built-in physical optimization can replicate cells, restructure logic, or move registers even when RTL source is unchanged. Honor explicit restrictions on netlist changes; this layer does not exempt tool-managed changes from those restrictions. Preserve a baseline checkpoint and compare the candidate's timing, resources, and applicable functional checks.
The Golden Sequence (proven 20-45% Fmax improvement):
Directive Reference:
| Directive | Tool | Use When | Expected Impact | |
|---|---|---|---|---|
Explore | place_design | Always first choice | 20-45% Fmax | |
ExtraTimingOpt | place_design | Still failing after Explore | +0-5% additional | |
Explore | phys_opt_design | After placement, before routing | +2-10% | |
AggressiveExplore | phys_opt_design | Close to closure, last push | +0.5-2% | |
NoTimingRelaxation | route_design | Final routing push | ±1% (prevents degrade) | |
AlternateReplication | phys_opt_design | Multiple failing paths, high fanout | variable |
Iteration Pattern:
After each applicable phys_opt/routing cycle, compare WNS, TNS, failing endpoints, hold, pulse width, route status, and any stated resource limits on a consistent constraint baseline. TNS or endpoint improvements can be meaningful progress even when WNS is unchanged. Preserve the best candidate, including candidates that would otherwise be lost to a later regression.
- If WNS >= 0, run the full Timing Acceptance Criteria above and investigate any remaining failures or missing checks.
- End the current strategy's repeated loop after 3 consecutive rounds without material progress, or when WNS improvement per round is < 0.005 ns with no meaningful progress in the other relevant metrics.
- At a plateau, re-examine the limiting paths and continue another evidence-backed strategy within the existing scope and overall attempt, runtime, and resource limits. Do not request confirmation merely to switch an already-authorized strategy.
- If no feasible in-scope next step remains, or an overall limit is reached, report that closure is incomplete, retain the best result, and identify the remaining violations and concrete constraint or missing decision. Do not treat a plateau as success or restart the search indefinitely.
Stage rule: Post-place phys_opt_design can run after placement. Post-route optimization requires the appropriate routed design state. Check the actual design state and tool requirements; do not impose the post-route prerequisite on post-place optimization. See vivado-impl for stage-specific options.
Using ML Strategy Suggestions:
Outputs RQS_STRAT strategies recommended by Vivado's ML analysis. The top 3 strategies are auto-generated for your specific design. Each includes specific directives for opt_design/place_design/phys_opt_design/route_design.
Layer 3: Pblock Area Constraints
Use when critical-path analysis shows substantial physical spread; Manhattan distance > 70 tiles on 5+ critical paths is a heuristic, not a required output from a specific helper.
Pblock Flow:
- Use
report_design_analysis,get_timing_paths, and cell placement properties to inspect critical-path spread and select the affected logic. - Use
report_utilizationfor that logic and inspect device sites/clock regions to size a region with resource headroom. - If available, the environment-specific helpers
analyze_critical_path_spread,report_utilization_for_pblock,analyze_fabric_for_pblock, andconvert_fabric_region_to_pblockcan assist. They are not built-in Vivado commands and their implementations are not included here; inspect the available tool or script interface before use. Check whether a helper already includes sizing headroom. - Without those helpers or RapidWright, use the native reports, object queries, and manual sizing guidance below. An unavailable optional tool does not block the rest of the task or authorize its installation. If a particular result cannot be verified, state that limitation and continue unaffected work.
Apply the chosen constraint to the selected logic in a candidate design and compare it with the baseline. Adapt the following Non-Project Mode example to the current flow:
Rules of thumb for manual pblock sizing:
- Compute centroid of critical path cells (average X/Y coordinates)
- Size region to ~2x the needed SLICE count (aim for 50% utilization)
- Expand to cover the critical cell bounding box + 20% margin
- Clamp to device SLICE bounds (xcvu3p: X[0:168], Y[0:299])
- Avoid expanding to entire chip — that negates the constraint effect
Layer 4: Netlist-Level Optimization (Use with Caution)
Only proceed when physical optimization (Layers 2-3) is exhausted. These modify the netlist and can degrade timing if misapplied.
Evaluate the applicable physical strategies; lack of an optional helper alone is not evidence that those strategies are exhausted. The RapidWright calls below are examples of optional helper interfaces, not guaranteed package APIs. Use them only when an installed tool exposes the operation. Prefer available Vivado capabilities for equivalent work when suitable, and preserve explicit limits on netlist editing.
Always test manual netlist changes on a copy first. Use a tool's documented dry-run or --test option only if that tool supports it. Otherwise perform appropriate structural/functional validation on the candidate and re-check routing, timing, and resources. Do not adopt an unverified candidate merely because a specific test option is unavailable; report that limitation while continuing other feasible work.
Fanout Splitting:
When fanout > 100 on critical path nets:
Warning: Fanout splitting replicates source drivers, adding cells. This can cause placement congestion. On designs with inherently high fanout architecture (e.g., neural network accelerators), it may degrade WNS by 0.5+ ns. Always compare before/after.
LUT Input Cone Merging:
When paths have chains of small LUTs (LUT2-LUT5 feeding each other):
Pre-check: Count LUT types. If LUT6 dominates (>80%) with few LUT2-LUT5, merging has no targets and won't help.
Cell Re-placement (ECO):
When report_qor_suggestions shows route delay > 60% on specific paths:
Congestion Analysis & Resolution
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingvivado-timing-closure/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/shinei-nouzen-arch/fpga-agent/vivado-timing-closure)