Power optimization

From LNC0831/oh-my-fpga · View interactive version

Power optimization is an AI agent skill from the GitHub repository LNC0831/oh-my-fpga. Analyze and reduce dynamic and static power on a Xilinx Vivado design (total power, junction temperature, thermal margin). Use when the user says "reduce power", "power optimization", "lower power consumption", "power report", "report_power", "too hot / junction temp too high", "battery / thermal bu

How to use this skill

Skill file

Power Optimization

A measurement-driven playbook for analyzing and reducing FPGA power. Power is a

physical, post-implementation property: it depends on placement, routing,

clock enables, switching activity, and I/O drive — not just RTL. Every claim of

power reduction MUST be backed by a fresh report_power from an

implemented design. Synthesis-stage estimates are directional only.

When to use

"cut dynamic power", or "fix leakage / static power".

margin warnings, fan/heatsink concerns, or a battery/thermal budget.

/ breakdown analysis (clocks vs logic vs signals vs BRAM vs DSP vs I/O vs

static).

strategy/constraint change moved the power number.

When NOT to use

paths and make timing worse. Close timing FIRST (use the timing-closure

skill), then optimize power. Refuse to trade away met timing for power

without explicit user sign-off.

design is a wild guess. If only synthesis exists, say so and run

implementation first (or state the estimate is low-confidence).

the matching skill. Power is downstream of a working, routed design.

any RTL exists. This skill operates on a real design in the project.

Prerequisites (verify first)

Run these BEFORE any analysis. Do not assume state.

  1. test_connection — confirm the Tcl bridge to Vivado is live. If it fails,

stop and tell the user to start Vivado + paste tcl_server.tcl.

  1. get_project_info — confirm a project is open and learn the target part

(power is part- and speed-grade-specific) and the active run.

  1. get_run_status — confirm whether implementation is complete. report_power

is only meaningful on an implemented (placed + routed) design.

poll get_run_status until complete. Do NOT block.

open_synthesized_design + report_power is allowed but you MUST label

the result "synthesis estimate, low confidence — not signoff."

  1. open_implemented_design — load the routed design into memory so power and

utilization queries reflect real placement/routing.

  1. Capture the baseline before touching anything:

junction temperature, thermal margin, and the confidence level).

these and with clock count).

Record these numbers. Every later iteration is compared against this

baseline.

Power-report literacy (read before acting)

report_power is only as good as its switching-activity assumptions. Know

which mode you are in:

default primary-clock activity and a default toggle rate (often ~12.5%). The

report's Confidence level will read Low or Medium. Treat the

absolute watts as approximate; treat the relative before/after delta and

the category breakdown as the actionable signal.

simulation SAIF is annotated onto the netlist. This is the only path to a

High confidence number and to trustworthy dynamic power. SynthPilot

cannot annotate a SAIF for you through these tools — if the user needs

signoff-grade dynamic power, tell them to run a post-implementation timing

simulation, dump a SAIF, and annotate it in Vivado directly; this skill then

consumes the resulting report_power.

Always read and report the confidence level. Never present a Low/Medium

vectorless number as a guaranteed result.

Methodology

Work in a strict measure → classify → smallest-safe-change → re-measure

loop. One change-class per iteration so cause and effect are attributable.

1. Establish the baseline and the goal

split, and the dominant categories** (sort the breakdown: Clocks, Logic,

Signals, BRAM, DSP, I/O, GTs/MMCM/PLL, Static/Device).

or near zero, this is a thermal problem (cooling/ambient/derating), not

just a logic-power problem — flag it explicitly.

reasonable." Without a target, optimize the largest movable category and stop

when changes get risky.

and is mostly fixed for a given device. The only real levers are: a

lower-power/slower speed grade, a smaller device, lower Vccint (device/board

decision), or reducing junction temperature (which lowers leakage). Surface

these as decisions; do not pretend RTL changes will move static power much.

2. Classify the dominant power source

Use the breakdown to pick ONE target category, then consult the table below.

Attack the biggest movable contributor first.

3. Apply the SMALLEST SAFE change first (constraints/strategy before RTL)

Ordered by safety:

  1. Tool strategy — power-aware implementation strategy. Set

set_implementation_strategy (e.g. Area_Explore to shrink logic/route, or

Flow_RuntimeOptimized only for quick iteration). Vivado's

power_opt_design (intelligent clock gating) is enabled inside power-oriented

strategies; this is the safest single lever because it does not touch RTL.

Re-run implementation and re-measure.

  1. Constraints / I/O properties — for I/O-dominated power, the fix is in the

XDC (slew, drive strength, on-chip termination, lower-power I/O standard via

create_io_constraint / editing the constraint file). For unused clocks,

removing or gating the source.

  1. IP reconfiguration — for BRAM/DSP/MMCM/PLL-dominated power, reconfigure

the offending IP (e.g. BRAM cascade/sleep, fewer MMCM/PLL outputs, lower

clock frequency in configure_clocking_wizard / create_clocking_wizard).

  1. RTL / architecture (recommend, do not silently apply) — clock-enable

gating, reducing active clock domains, operand isolation, RAM enable gating,

downclocking idle logic. Propose the edit, show the file/line via read_file

/ read_file_lines, and let the user approve before update_file /

replace_in_file.

Apply exactly ONE change-class, then go to step 4. Never stack a strategy

change, an I/O change, and an RTL change in one pass — you will not know what

worked.

4. Re-implement and re-measure (the only proof)

(Never claim a power result from a stale run.)

previous iteration: total W, the targeted category, AND the confidence level.

have gone negative) and report_drc (no new violations). A power win that

breaks timing or DRC is not a win — revert it.

revert it and pick the next item from the table.

5. Loop or stop (see STOP conditions)

Repeat steps 2–4. Stop when a STOP condition is met, then produce the Output.

Classification table — symptom → likely cause → smallest safe fix

| Dominant category in report_power | Likely root cause | Smallest safe fix first | Tools |

|---|---|---|---|

| Clocks high | Too many/high-freq clock nets always toggling; ungated clock trees; redundant MMCM/PLL outputs | Power-aware impl strategy (enables clock gating); reduce clock frequency where spec allows; remove unused generated clocks; consolidate clock domains | report_clock_networks, report_clock_utilization, set_implementation_strategy, configure_clocking_wizard, then re-impl + report_power |

| Logic / Signals high | High average toggle rate; large always-active combinational/sequential mass; high-fanout nets driving wide loads | Power-aware impl strategy + power_opt clock gating; then RECOMMEND clock-enable gating / operand isolation in RTL | report_high_fanout_nets, report_utilization_hierarchical (find the hot module), set_implementation_strategy, then RECOMMEND RTL via read_file_lines |

| BRAM high | Memories with enable always asserted; over-wide/over-deep RAMs; no sleep/cascade | Reconfigure memory IP (narrower/cascade/sleep); RECOMMEND RAM enable gating so unused banks idle | report_utilization, get_memory_config, configure_memory, then re-impl + report_power |

| DSP high | DSP slices clocked/active when idle; no operand isolation | Strategy that reduces/area-optimizes DSP (Flow_AreaMultThresholdDSP synth); RECOMMEND operand isolation / DSP enable gating | set_synthesis_strategy, report_utilization, then RECOMMEND RTL |

| I/O high | Excess slew rate, high drive strength, power-hungry I/O standard, unnecessary on-chip termination, high-toggle outputs | Edit XDC: lower SLEW (SLOW), reduce DRIVE, choose lower-power IOSTANDARD, remove needless termination | report_io, create_io_constraint / edit constraint file via read_file+replace_in_file, then re-impl + report_power |

| MMCM / PLL / GT high | More clock outputs or transceiver lanes than used; high VCO; unused GT channels powered | Reduce MMCM/PLL outputs & VCO; disable unused GT lanes (IP reconfigure) | report_clock_utilization, configure_clocking_wizard, IP reconfigure, then re-impl + report_power |

| Static / Device high (large share) | Silicon leakage: high junction temp, hot speed grade, oversized device | Mostly a device/thermal DECISION: lower junction temp (cooling/ambient), lower-power speed grade, smaller part. Surface as options — do NOT expect RTL to move it | report_power (junction temp, thermal margin), then present options + STOP |

| Junction temp / thermal margin critical | Inadequate cooling, high ambient, or genuinely high total power | Reduce dynamic power (rows above) AND flag cooling/ambient/derating; recompute margin after | report_power, then iterate dynamic-power rows + surface thermal trade-off |

Loop and STOP conditions

Iterate the measure→fix→re-measure loop. STOP and hand back to the human

when any of:

or temperature target AND report_timing_summary shows WNS ≥ 0 (or unchanged

from baseline) AND report_drc is clean. Report the confidence level with the

number.

power improvement. Further squeezing isn't worth the risk; present remaining

options.

used up and only RTL/architectural rewrites or a device/speed-grade/board

change remain. Present those options + their costs (timing risk, redesign

effort, BOM change) and STOP. Do not start large RTL surgery autonomously.

below the user's margin, changing the device/part, or waiving a real DRC.

Stop, state the trade-off, ask the user.

that only a device/thermal decision can move. Present device/cooling options

and STOP.

and the user needs signoff-grade dynamic power. Stop and request a SAIF from

post-implementation simulation; do not present the estimate as final.

Never thrash: if a change doesn't help, revert it and move to the next table

row rather than re-trying variants of the same lever.

Safety rails (do not violate)

report_power from a completed implementation run — never inferred from

synthesis, never from a stale run, never extrapolated. Always state the

confidence level of the number you quote.

report_timing_summary (no new negative slack) and report_drc (no new

violations). A lower power number on a now-failing design is a regression.

report to an optimistic activity assumption, lowering the default toggle

rate, or quoting a Low-confidence vectorless estimate as final. Do NOT silence

a real DRC/methodology violation to clear the path. If you must assume a

switching activity, state the assumption explicitly.

Recommend RTL and architectural edits (clock gating, operand isolation,

enable gating) — show the file and lines, and get user approval before

update_file / replace_in_file. Never silently rewrite RTL for power.

sign-off. Lowering frequency, gating clocks, or shrinking memories can change

functional behavior or break timing — surface the consequence first.

meaningfully reduce static/leakage power. State plainly that static power is a

device/speed-grade/junction-temperature property and route those to a human

decision.

capability is missing (e.g. automated SAIF annotation), say so rather than

inventing a tool.

Output

Produce a concise power report, not a narrative:

  1. Baseline: total power (W), dynamic/static split, top 3 categories with

their watts/percent, junction temp + thermal margin, target part, and the

report confidence level.

  1. Findings: the dominant movable category and its root cause (per the

classification table).

  1. Change log (per iteration): what change-class was applied (strategy /

constraint / IP / recommended-RTL), and the before→after numbers for total

power, the targeted category, WNS, and DRC status. Show your work.

  1. Result: final total power and dynamic/static split from the LAST

implemented report_power, with confidence level, plus confirmation that

report_timing_summary and report_drc are still clean. Quantify the

reduction vs baseline (W and %).

  1. Remaining options (if stopped before goal): the exhausted-safe-options

list — RTL/architectural edits, device/speed-grade/board changes, cooling

changes, or a SAIF-driven re-measure for signoff — each with its cost and

risk. Hand back to the human; do not proceed unilaterally.

  1. Caveat: if numbers are vectorless Low/Medium confidence, state that

dynamic-power figures are estimates and signoff requires a SAIF-annotated

re-measure.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.