S5.13.1 Find the Break-Even Time

EasyImplement12 minIcarus Verilog · serverReview the topic

Add up the energy of one idle gap in three modes, find the gap at which deep sleep starts to pay, and apply a wake deadline.

Hardware context: Power modes of ap_soc: run, sleep and deep sleep, each with an idle power, a transition energy and a wake time. Choosing a sleep mode for a battery device from its duty cycle

This is the calculator of lesson S5.13 with other costs. A chip has nothing to do for a while, the idle gap. It can stay in run mode, go to sleep, or go to deep sleep. All numbers are exercise values, not measurements of a chip. A power of 1 mW for 1 microsecond is an energy of 1 nJ.

This worksheet uses named constants. The first three entries show how to record your decisions.

Signals in the Timeline

SignalWidthRole
question8input of each check
Full specification
ModeEnergy to enter and leavePower while idleTime to wake
Run0 nJ12 mW0
Sleep4 nJ5 mW2 microseconds
Deep sleep28 nJ2 mW9 microseconds

The energy of a mode over a gap is its energy to enter and leave, plus its idle power times the gap. Enter energies in nJ and times in microseconds, as plain numbers. For a choice of mode enter 1 for sleep and 2 for deep sleep.

EntryYour decision
RUN_4Energy of run mode over a gap of 4 microseconds.
SLEEP_4Energy of sleep over a gap of 4 microseconds.
DEEP_4Energy of deep sleep over a gap of 4 microseconds.
CHEAPER_4The cheaper sleep mode for a gap of 4 microseconds: 1 or 2.
SLEEP_12Energy of sleep over a gap of 12 microseconds.
DEEP_12Energy of deep sleep over a gap of 12 microseconds.
CHEAPER_12The cheaper sleep mode for a gap of 12 microseconds: 1 or 2.
EXTRA_COSTHow much more deep sleep costs to enter and leave than sleep.
SAVED_EACH_USHow much less energy deep sleep uses in each microsecond of the gap.
BREAK_EVENThe gap, in microseconds, at which the two sleep modes cost the same.
DEEP_IN_TIMEThe chip must answer within 6 microseconds of a wake event. Does deep sleep wake in time? 1 for yes, 2 for no.
CHOICE_12The mode to choose for a gap of 12 microseconds with that deadline: 1 or 2.
DEEP_ENERGY_NWhat is the energy of deep sleep, in nJ, for an idle gap of N microseconds?

Examples

Example 1

RUN 4
Input
Energy of run mode over a gap of 4 microseconds.
Output
matches = 1

12 mW for 4 microseconds is 48 nJ. Run mode has nothing to enter or leave.

Example 2

SLEEP 4
Input
Energy of sleep over a gap of 4 microseconds.
Output
matches = 1

4 nJ to enter and leave, plus 5 mW for 4 microseconds: 4 + 20.

Example 3

DEEP 4
Input
Energy of deep sleep over a gap of 4 microseconds.
Output
matches = 1

28 nJ to enter and leave, plus 2 mW for 4 microseconds: 28 + 8.

Constraints and Contract

  • Keep the parameter and named constants. Use the numeric codes and units on this page.
  • For DEEP_ENERGY_N, enter a constant expression using N. Only this entry changes with the parameter. The supported integer range is 2 through 12, inclusive.

Hints

Hint 1

Energy to enter and leave, plus idle power times the gap.

Hint 2

Divide the extra cost of the deeper mode by what it saves in each microsecond.

Hint 3

A mode that wakes too late is ruled out, however little energy it uses.

What the grader checks: Each check compares the full eight-bit answer. Parameter trials change one condition and keep the other decisions fixed.

13 checks on Icarus Verilog · server. Run the examples first, then check the full regression. Full checks use the server judge. Downloads contain your source only; samples require the simulation service. A passing result establishes the tested cases, not a proof for all possible inputs.

See all 1 problem on this path

Report a problem with this page

Your code SystemVerilogSaved locally
Ln 1, Col 1Tab indents · Ctrl/⌘ + Enter runs samples
Not run yet

RUN 4

Input
Energy of run mode over a gap of 4 microseconds.
Expected output
matches = 1

12 mW for 4 microseconds is 48 nJ. Run mode has nothing to enter or leave.

Run samples executes all 3 public checks. Check all tests runs 13 checks on the server.

Icarus Verilog · server