Skip to content

Commit 14121ff

Browse files
AWSdmarquetAWSaalluri
authored andcommitted
Update afi_power.md (#500)
1 parent cb3635e commit 14121ff

File tree

1 file changed

+32
-2
lines changed

1 file changed

+32
-2
lines changed

hdk/docs/afi_power.md

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
# AFI Power
2+
There are 2 power related scenarios that need to be avoided:
3+
1. Exceeding the Maximum FPGA power
4+
1. Ramping too quickly between low power and high power states
5+
6+
## Exceeding Maximum FPGA power
27
The Xilinx UltraScale+ FPGA devices used on the F1 instances have a maximum power limit that must be maintained. If a loaded AFI consumes maximum power, the F1 instance will automatically gate the input clocks provided to the AFI in order to prevent errors within the FPGA. This is called an afi-power-violation. Specifically, when power (Vccint) is greater than 85 watts, the CL will have a power warning bit set. Above that level, the CL is in danger of being clock gated due to an afi-power-violation.
38

4-
## Preventing power violations
9+
## Ramping too Quickly Between Low Power and High Power States
10+
Even though your design may have a max power which is lower than the previously described limit, you might see issues if you rapidly switch between low power and high power states. A common scenario is upon startup the design goes from a low power reset state to the max power state instantly. In failing cases the host will appear to lose contact with the FPGA card and can only recover with an instance stop/restart. To prevent this from happening care must be taken to sequence the design such that it slowly increases the power requirements to max power instead of instantaneously doing so.
11+
12+
# Measuring FPGA Power - Live or Offline via Vivado
13+
## Live Measurement of FPGA Power
514
In order to help developers understand how much power their AFIs actually use in the field, AWS now presents power metrics in the fpga-describe-local-image tool. These metrics are updated every minute, and will reflect the most recently measured FPGA power, the average power over the run of the AFI, and the maximum power consumption detected in the run of the AFI. The current and average power consumption will be available on the first power update after the AFI is loaded, while the max power measurements will start after this first update (max power will not include the time immediately after the FPGA is loaded).
615

716
For example,
@@ -17,6 +26,7 @@ Power consumption (Vccint):
1726

1827
Power consumption may drift slightly over time, and may vary from instance to instance. In order to prevent a power violation, it's important to take into account this natural variation, and design with margin accordingly.
1928

29+
## Lowering Power Based on High Power Events Reported by the Shell
2030
In order to help developers avoid these overpower events, the F1 system indicates a afi-power-warning on the CL interface (sh_cl_pwr_state[1:0]) when the FPGA power levels are above 85 watts, and the CL is in danger of having it's clocks disabled. This should allow the CL to self-throttle, or reduce power-hungry optimizations, and avoid having its input clocks disabled.
2131

2232
Power state of the FPGA: sh_cl_pwr_state[1:0]
@@ -30,7 +40,7 @@ The fpga-describe-local-image command will show that the AFI load has failed due
3040

3141
```
3242
# fpga-describe-local-image -S 0
33-
AFI 0 none load-failed 7 afi-power-violation 17 0x04261818
43+
AFI 0 none load-failed 7 afi-power-violation 17 0x071417d3
3444
AFIDEVICE 0 0x1d0f 0xf000 0000:00:1d.0
3545
```
3646

@@ -62,4 +72,24 @@ Using a lower clock frequency from the [supported clock recipe](./clock_recipes.
6272
## Recovering from clock gating
6373
When an afi-power-violation occurs, the FPGA can still be loaded and cleared, but the clocks cannot be re-enabled without reloading the FPGA. Any AFI load or clear will restore full functionality to the FPGA.
6474

75+
# Power Savings Techniques
76+
Here are some low power design techniques that can be used to lower the overall power or minimize instantaneous power ramps.
77+
78+
Power is consumed whenever a node in the design switches high or low. Reducing the switching activity will reduce the power requirements.
79+
80+
**Clock Nets:** The largest component of switching activity are the clock nets in the design. Power is consumed on both transition edges of the clock. Some common techniques to reduce clock power are:
81+
1. Clocking design at lower frequencies will lower clock power linearly. This isn’t always possible.
82+
1. If the entire design doesn’t need to be clocked at full frequency, create lower frequency clocks for the slower logic.
83+
1. If parts of the logic don’t need to always be clocked, you can gate the clocks to them (AND the clock with an enable signal). The gated clock net will draw no power when it’s gated off.
84+
85+
**Outputs of Sequential Elements:** Outputs of FF’s and RAMs cause downstream logic to consume power every time they switch. There are many times when these sequential elements don’t need to switch every cycle. Some common techniques to reduce sequential element power are:
86+
1. Add enables to as many FF’s as possible. This will cause the FF’s output to switch less often, lowering power on all downstream nodes.
87+
1. Add chip-selects or read-enables to your RAMs. Same concept as #1.
88+
1. Shift-register structures (LFSR’s, CRC, random number generators, etc.) burn power because their outputs switch. Add enables to these FF’s to switch them only when needed.
89+
90+
**Architectural Power Savings**: A global power savings technique is to control power at the top-level Architectural Level. There is typically a block diagram of the overall design. By gating the clocks to top-level blocks and/or creating enables for the sequential elements in the design, these blocks can be put into low power modes when they aren't being used. It's critical to only enable the blocks that are required for the job.
91+
92+
**Reducing Instantaneous Swings in Power**: Care must be taken to ensure there aren't large swings between low power and high power states. Sequencing the enables to the top-level architectural blocks will allow the design to slowly ramp to max power levels.
93+
94+
6595

0 commit comments

Comments
 (0)