科研 Skill
FPGA资源利用率优化
utilization-reduction
Diagnoses and reduces FPGA resource pressure when a design is too big for the part, covering LUT/BRAM/DSP/FF utilization. Use when a design will not fit.
SKILL.md
Utilization Reduction
Reduce resource/area pressure so a design fits the target part. Area work is resource-typed: LUTs, FFs, BRAM/RAMB, DSP, URAM, carry chains, and control sets each have different root causes and different safe fixes. You must measure which resource is the bottleneck before touching anything, fix the dominant resource first, and re-measure after every single change so cause and effect stay attributable.
The cheapest, safest levers are settings (synthesis area strategy, IP right-sizing, RAM/DSP inference thresholds, BRAM ECC/output regs). The expensive, design-altering levers are RTL/architecture (resource sharing, time multiplexing, narrower datapaths, dropping features). Always exhaust the cheap levers first, recommend the expensive ones rather than silently rewriting RTL, and surface the trade-off (area vs. Fmax vs. functionality) before handing back.
When to use
- Synthesis or implementation reports a resource over (or near) 100%: "over-utilized", "placement infeasible", "insufficient sites".
report_utilizationshows any resource column at high % (LUT, FF, BRAM, DSP, URAM, carry, control sets) and the user wants headroom.- The user wants to fit the design into a smaller / cheaper device or free up room for a debug core (ILA/VIO) or a future feature.
- A single resource type is the gate (e.g. design fits except BRAM at 140%).
- Implementation aborts at placement with overutilization errors.
When NOT to use
- Timing is the problem, not area (WNS negative but utilization < ~80%). That is timing-closure work, not this skill.
- Routing congestion with comfortable utilization. Congestion at moderate
utilization is a placement/floorplan problem; use
report_congestion/report_design_analysisunder a congestion playbook, not area reduction. - The design simply does not fit any available part. If the smallest necessary resource already exceeds 100% after all safe levers, that is an architecture decision (bigger part / drop features) — surface it and stop.
- Power, DRC, lint, or CDC are the actual complaint. Different skills.
- You have no fresh utilization numbers and cannot run synthesis. Get numbers first; never guess at area.
Prerequisites (verify first)
Run these and confirm before any analysis. Do not proceed on assumption.
test_connection— Tcl server inside Vivado is reachable. If it fails, stop: nothing below works without the bridge.get_project_info— a project is open; note the target part and its resource ceilings. "Too big" is always relative to a specific part.get_license_status— confirm the report/strategy tools you intend to call are available in the current tier (hierarchical utilization, design analysis, QoR suggestions may be PRO).- Establish you have real numbers, not estimates:
- If an implemented or synthesized design is already open, you can read utilization directly.
- Otherwise run synthesis (step 1 of the methodology) to get a post-synth baseline. Post-synth is enough to find the dominant resource; only post-implementation numbers are signoff-grade for "it fits" (synthesis under-counts after place opt, and over-counts LUTs that later merge).
State the target part and the resource ceilings before you start fixing.
Methodology (measure -> classify -> smallest safe fix -> re-measure)
Step 1 — Establish a fresh utilization baseline
- If no design is open, run synthesis to get post-synth numbers. For a
multi-minute run prefer the async pattern:
run_synthesis_async, then pollget_run_statusuntil complete, thenget_synthesis_reportandcheck_synthesis_issues. (run_synthesissynchronously is fine for small designs.) - Open the design so the report tools have a netlist:
open_synthesized_design(post-synth) — or, for signoff numbers,open_implemented_designafter implementation. report_utilization— capture the flat numbers: used / available / % for LUT (logic vs. memory/LUTRAM split), FF, BRAM (RAMB36/RAMB18), URAM, DSP, carry/CARRY chains, and control sets. Record this as the baseline.
Do not act yet. Numbers first.
Step 2 — Identify the dominant resource and where it lives
- From the baseline, pick the single highest-% resource that exceeds (or threatens) 100%. That is your target. Fixing a resource at 40% buys nothing.
report_utilization_hierarchical(startdepth=2, drill deeper as needed) — find which module/instance dominates that resource. Area reduction is almost always concentrated; attack the top contributors, not the whole tree.report_ip_statusandlist_project_ips— IP cores (FIFOs, memories, clocking, AXI infra, DSP-heavy IP) are common silent hogs and are often the cheapest thing to right-size (see classification table).- Optional context:
report_design_analysis(logic-level / complexity) andreport_qor_suggestions(Vivado's own area/strategy hints — may be empty).
Now you can classify.
Step 3 — Classify the bottleneck (see table) and pick the SMALLEST safe fix
Map dominant resource + where-it-lives to a cause, then to the cheapest fix class that addresses it. Order of preference, always:
- Settings / IP right-sizing — synthesis area strategy, IP depth/width, BRAM output-register / ECC, RAM/DSP inference thresholds. No RTL change.
- Inference-directing constraints / attributes — recommend
ram_style/rom_style/use_dsp/max_fanoutstyle attributes in RTL. These are RTL edits — recommend, do not silently apply. - RTL / architectural change — resource sharing, time-multiplexing, narrower datapaths, feature removal. Highest cost, highest risk — recommend and explain; never silently rewrite.
Apply exactly one change-class per iteration so the re-measured delta is
attributable. Use set_synthesis_strategy (e.g. Flow_AreaOptimized_high,
or Flow_AreaMultThresholdDSP for DSP pressure) and
set_implementation_strategy (Area_Explore) for the settings lever.
Step 4 — Re-measure (mandatory)
- Re-run synthesis (async pattern) → re-open design →
report_utilizationandreport_utilization_hierarchical. Compare against the previous baseline, resource by resource. Show the before/after delta. - A settings/strategy or inference change can move other resources (e.g.
forcing BRAM→distributed trades BRAM for LUTRAM/LUTs; lowering
use_dspmoves multiplies into LUTs). Re-read all resources, not just the one you targeted, to catch a regression where you robbed Peter to pay Paul. - Timing guard: area strategies and resource sharing usually cost Fmax.
If the design had a timing target, after the area change re-check timing
(
report_timing_summary/extract_timing_metrics) so you don't trade an area failure for a timing failure. Report both numbers.
Step 5 — Signoff (only when claiming "it fits")
A "fits the part" claim requires fresh post-implementation evidence, never post-synth inference:
- Run implementation (
run_implementation_async→ pollget_run_status→get_implementation_warnings), thenopen_implemented_design. report_utilizationon the implemented design — every gating resource must be < 100% with real headroom.report_drc— confirm no overutilization / placement DRC violations remain.- If a timing target exists,
report_timing_summarymust still pass.
If implementation still over-utilizes, you are not done — loop back to Step 2 with the new dominant resource, or escalate per the STOP conditions.
Classification: dominant resource -> likely cause -> smallest safe fix
Dominant resource (from report_utilization / hierarchical) | Likely cause | Smallest safe fix first | Escalation (recommend, do not auto-apply) |
|---|---|---|---|
| LUT (logic) high, FF moderate | Combinational logic bloat; replicated logic; wide muxes/comparators; unshared arithmetic | set_synthesis_strategy Flow_AreaOptimized_high; right-size oversized IP | Recommend resource sharing / time-multiplexing of duplicated datapaths; narrow over-wide buses; fold parallel units |
| LUTRAM / memory-LUT high | Small/shallow RAMs/ROMs inferred into distributed RAM instead of BRAM | Recommend (* ram_style = "block" *) / rom_style = "block" on the offending arrays (found via hierarchical) to push them to BRAM | If BRAM is also tight, this is a true capacity wall → present part/architecture trade-off |
| BRAM (RAMB36/18) high | Over-deep/over-wide memories; FIFOs/IP sized larger than needed; ECC or output regs adding banks; many small RAMs not packed | report_ip_status then right-size FIFO/Block-Memory IP depth/width; disable BRAM ECC if not required; cut over-provisioned FIFO depth | Recommend merging small RAMs, moving rarely-touched tables to distributed (LUTRAM) or off-chip; consider URAM if part has it |
| DSP high | Multipliers/MACs each mapped to DSP48; large multiplies split across multiple DSPs | set_synthesis_strategy Flow_AreaMultThresholdDSP to push small mults to fabric; right-size DSP-heavy IP | Recommend (* use_dsp = "no" *) on small/low-rate multiplies, time-shared MAC, or reduced precision — note this adds LUTs, re-measure |
| FF (registers) high | Deep pipelining; wide registered datapaths; auto-replication; SRL-able shift regs as FFs | Allow tool to infer SRLs (srl_style); reduce unnecessary pipeline depth via settings where possible | Recommend trimming pipeline stages (costs Fmax) or narrowing registered width; confirm with user — this is functional/timing-affecting |
| Control sets high (drives LUT/placement pressure even at moderate FF%) | Too many distinct (clock, enable, reset) groups → poor slice packing | Reduce gated/async resets and per-bit enables via settings/attributes where safe | Recommend uniform synchronous reset / fewer enable domains in RTL — surface as design guidance |
| CARRY chains high | Many wide adders/counters/comparators | Flow_AreaOptimized_high lets tool restructure | Recommend sharing adders or restructuring wide arithmetic |
| IO over | Pin count exceeds package | (Not fabric area) — report_io; this is a packaging/part problem | Recommend bus muxing, serialization, or a larger package — present, do not auto-change pinout |
If the dominant resource is an IP core, prefer right-sizing the IP
(get_fifo_config / get_memory_config / get_ip_config to read it, then the
matching configure_* / set_ip_property) before any RTL change — it is
usually the single biggest, lowest-risk win.
Reduction loop and STOP conditions
baseline = report_utilization (+ hierarchical) # Step 1-2
while (gating resource >= 100% OR user wants more headroom):
classify dominant resource (table) # Step 3
apply ONE smallest-safe change-class
re-synth -> report_utilization (+ hierarchical) # Step 4
re-check OTHER resources + timing for regressions
show before/after delta
-- STOP if any condition below --
sign off with implementation evidence # Step 5
STOP (and report) immediately when any of these hold:
- It fits with headroom — every gating resource < 100% on a fresh implemented design, DRC clean, timing still met. → Sign off (Step 5).
- No progress — a change moved the gating resource < ~1–2% (or moved it the wrong way). Do not pile on more of the same lever; reclassify or escalate.
- Whack-a-mole — fixing resource A pushed resource B over 100%. Stop tuning; present the genuine trade-off (the design's resource balance is the issue).
- Safe levers exhausted — area strategies + IP right-sizing applied, and the only remaining moves are RTL/architecture rewrites or a bigger part. Hand back to the human with concrete options + costs (below). Do not thrash, and do not start rewriting RTL on your own.
- Area vs. timing collision — the area fix that makes it fit breaks the timing target (or vice versa). Present both numbers and let the human pick the operating point.
When you stop at "levers exhausted", give the user a ranked options list, e.g.:
(a) right-size IP X (frees ~N BRAM, no Fmax cost) — recommended;
(b) push array Y to BRAM via ram_style (RTL edit, frees ~M LUTRAM);
(c) time-multiplex the K parallel MAC units (frees ~P DSP, costs throughput
+RTL work); (d) move to part Z (bigger, +cost). Then stop.
Safety rails (do not violate)
- Evidence before claims. "It fits" / "we have headroom" REQUIRES fresh
post-implementation
report_utilization+ cleanreport_drc. Never claim fit from post-synth numbers or from inference — synthesis utilization is necessary but not sufficient. No tool output, no claim. - No fake-pass. Do not make a resource go green by removing real functionality, disabling a needed feature (e.g. turning off BRAM ECC the design actually needs), waiving a real overutilization DRC, or shrinking an IP below its required depth/width. If a reduction could break function, ask the user first and state the assumption.
- Smallest safe change first. Settings/strategy and IP right-sizing before any RTL. Always.
- Recommend RTL, never silently rewrite. Resource sharing, time-muxing,
precision/width reduction, dropping pipeline stages, and
ram_style/use_dspattributes are recommendations. Read withread_file/read_file_lines, explain the change and its cost, and apply edits (update_file/replace_in_file) only after the user agrees. Functional or throughput-changing edits ALWAYS need explicit user sign-off. - One change-class per iteration. So every before/after delta is attributable. No batching multiple levers in one pass.
- Watch for displaced resources. Many area fixes move area (BRAM→LUTRAM, DSP→LUT, FF→SRL). Re-read all resources after each change; a "win" that overflows another resource is not a win.
- Guard timing. Area strategies (
Flow_AreaOptimized_high,Area_Explore) and resource sharing typically cost Fmax. If a timing target exists, re-checkreport_timing_summaryafter the area change and report both. - Real tools only. Use only the SynthPilot tool names. If a needed lever isn't exposed as a tool (e.g. a specific synth directive), say so and give the user the manual step rather than inventing a tool.
Output
Report back in this shape:
- Target part & ceilings — device, and the available count for each resource (so % means something).
- Baseline utilization — table of used / available / % for LUT(logic), LUT(mem), FF, BRAM, URAM, DSP, carry, control sets. Mark the gating resource.
- Diagnosis — dominant resource, where it lives
(
report_utilization_hierarchicaltop contributors), and the classification (cause) from the table. - Change applied — exactly one change-class, what it was, and why it's the smallest safe fix.
- Before → After — per-resource delta table, including resources you did not target (to prove no regression) and timing if a target exists.
- Status — one of:
FITS (signed off, impl evidence)/IMPROVED, still over/LEVERS EXHAUSTED — decision needed. Cite the exact tool output backing the status. - If stopped: the ranked options + costs list, then hand back to the human. No further autonomous RTL changes.
Never assert that the design fits without quoting fresh post-implementation
report_utilization and a clean report_drc.
示例提示词
这个设计LUT用超了放不进芯片,帮我分析并减少资源占用。
所属插件
安装该插件会一并获得同领域的 63 个 Skill / MCP。
同插件的其他科研 Skill
- ANDES电力系统动态仿真Runs ANDES power-system dynamic studies via PowerMCP: power flow, eigenvalue analysis, and time-domain simulation. Use for damping, stability, or oscillation-mode questions.
- 电池选型与电源预算Builds an evidence-tagged power budget and sizes a manufacturable battery with pouch outline, seals, and derating. Use when sizing runtime, mAh, charging, or supply rails.
- FPGA比特流生成与烧录Generates a Xilinx FPGA bitstream and programs it over JTAG, or burns an MCS image into flash for power-on boot. Use when flashing a board or diagnosing boot failures.
- 硬件项目发布包组装Assembles a hardware release package (fab files, BOM/CPL, carts, assembly guide, hashed manifest) and runs a ready-to-build gate. Use before ordering prototypes.
- 时钟域交叉风险审查Audits clock-domain-crossing risk on an FPGA design and applies the smallest safe synchronizer or constraint fix. Use to resolve CDC violations before sign-off.
- 硬件产品认证合规规划Plans certifications a hardware product needs per target market (FCC, CE/RED, UKCA, battery/radio rules), with cost and lead-time estimates. Use before PCB or enclosure tooling.
- Vivado XDC时序约束编写Authors a Vivado XDC timing constraint set from scratch: clocks, I/O delays, and timing exceptions. Use first, before timing closure, on a design with no or incomplete constraints.
- N-1/N-2应急违规处置Playbook for N-1/N-2 contingency violations: ranks contingencies and proposes preventive and corrective actions. Use after a study shows voltage or thermal problems.
- 潮流计算不收敛诊断Playbook for power-flow convergence failures in PSS/E, PSLF, PowerWorld, pandapower, PyPSA, surge, or OpenDSS. Use when a case diverges or fails to solve.
- 硬件成本核算与采购Prices a hardware product at multiple volumes with one-time vs per-unit cost, landed cost per country, and sourcing leads. Use to estimate unit cost before a pitch.
- RTL仿真覆盖率收敛Measures RTL simulation code coverage and iteratively closes it toward a target by adding testbench stimulus. Use for a sign-off-grade coverage report.
- 配电网DER接纳能力治理Playbook for distribution DER hosting-capacity limits: voltage rise, reverse flow, and thermal limits from PV and storage. Use to estimate how much DER a feeder can host.
- 电子电路设计与审查Designs, audits, or corrects an electronic circuit from a brief, schematic, or netlist, checking power domains, reset sequencing, and ratings. Use for circuit review.
- 硬件可制造性红队审查Red-team audit that fix-loops a hardware project to ready-to-build, re-deriving parts, rails, battery physics, and cost. Use for a reality check before committing to a design.
- 电力系统动态稳定处置Playbook for dynamic stability problems: poor damping, angle instability, or sustained oscillations from eigenvalue or time-domain studies. Use after an unstable study result.
- Egret电力市场调度优化Runs Egret market/operations optimization (DC-OPF, AC-OPF, unit commitment) via PowerMCP. Use for cheapest dispatch, unit commitment, or congestion checks.
- 电子元器件选型核查Researches electronic components against primary sources: part numbers, datasheet limits, lifecycle, stock, and price breaks, one dossier per part. Use to verify or source a BOM.
- EMC电磁兼容预测试Plans grounding, shielding, and filtering for EMC/EMI, and runs an emissions pre-scan with a root-cause fix sequence. Use before a lab test or after a failed EMI scan.
- 产品外壳参数化建模Designs a hardware enclosure as parametric CAD with STEP/STL/GLB output, a DFM check, and Blender assembly validation. Use when designing a case or checking fit.
- 电网频率响应问题处置Playbook for frequency problems: low inertia, high RoCoF, weak primary response, or UFLS risk after loss of the largest unit. Use when a study flags frequency issues.
- FPGA RTL到比特流全流程Drives a Xilinx FPGA design end to end through RTL, simulation, synthesis, implementation, and bitstream, gated at every stage. Use to run the complete build flow in one pass.
- 硬件产品全流程总协调Leads a physical electronic product from idea to a doable design, coordinating specs, parts, battery, PCB, enclosure, render, and cost sub-skills. Use starting a hardware product.
- 硬件原理图与BOM审查Reviews hardware projects: checks schematics against datasheets, pin connections, and firmware-to-hardware alignment across KiCad/Altium files. Use for a design alignment check.
- FPGA ILA在线逻辑调试Inserts an Integrated Logic Analyzer, programs the board, arms a trigger, and reads captured waveforms on real FPGA hardware. Use when sim passes but the board fails.
常见问题
FPGA资源利用率优化能做什么?
Diagnoses and reduces FPGA resource pressure when a design is too big for the part, covering LUT/BRAM/DSP/FF utilization. Use when a design will not fit。
如何安装FPGA资源利用率优化?
在科搭 Codar 左侧点击「插件」,在「组件」页签搜索「FPGA资源利用率优化」并安装;在 Claude Code 或 Codex 中可以发送本页的安装提示词,或下载 Skill 包后解压到 ~/.claude/skills 或 ~/.codex/skills。
FPGA资源利用率优化需要哪些权限?
该科研 Skill没有声明额外权限;执行具体操作时仍由 Agent 按自身规则请求确认。
FPGA资源利用率优化经过官方审核吗?
是。SpeedSkills 收录的每个版本都会记录内容摘要与权限声明,当前版本已通过安全审核。