Budget the entire idle interval and return with enough time and state to service the next request.
Hardware context: ap_soc timer power island. Sleep and wake planning
These integer costs are exercise values for one ap_soc workload. Choose the lowest total energy among feasible modes. A mode meets a deadline at equality. Break an energy tie using the lower mode code.
This worksheet uses named constants. The first three entries show how to record your decisions.
Signals in the Timeline
| Signal | Width | Role |
|---|---|---|
question | 8 | input of each check |
Full specification
| Code / mode | Entry + exit energy (nJ) | Idle power (mW) | Wake (µs) | Wake source / context |
|---|---|---|---|---|
| 1 Run | 0 | 9 | 0 | Any / full |
| 2 Sleep | 4 | 5 | 1 | Any / full |
| 3 Deep sleep | 16 | 1 | 5 | RTC or button / saved |
| 4 Off | 32 | 0 | 12 | External restart / none |
Energy in nJ equals transition energy plus idle power times dwell in microseconds. Wake time is a separate response constraint. The energy model includes the transitions once. A request for saved context allows full context too.
| Entry | Your decision |
|---|---|
| NOW | Dwell 20 µs, RTC, full context, deadline 0 µs. |
| FAST | Dwell 20 µs, RTC, full context, deadline 1 µs. |
| BUTTON | Dwell 20 µs, button, saved context, deadline 5 µs. |
| SHORT | Dwell 1 µs, button, saved context, deadline 6 µs. |
| SERIAL | Dwell 50 µs, UART, no context requirement, deadline 20 µs. |
| COLD | Dwell 60 µs, external restart, no context requirement, deadline 12 µs. |
| LATE | Dwell 30 µs, button, saved context, deadline 4 µs. |
| EQUAL | Dwell 3 µs, RTC, saved context, deadline 5 µs. |
| NIGHT | RTC wake, saved context, 5 µs deadline. Choose the mode for DWELL µs. |
Examples
Example 1
NOW- Input
Dwell 20 µs, RTC, full context, deadline 0 µs.
- Output
matches = 1
Only run can respond immediately. Record NOW = 1.
Example 2
FAST- Input
Dwell 20 µs, RTC, full context, deadline 1 µs.
- Output
matches = 1
Sleep is feasible and saves energy at this dwell. Record FAST = 2.
Example 3
BUTTON- Input
Dwell 20 µs, button, saved context, deadline 5 µs.
- Output
matches = 1
Deep sleep costs 36 nJ and meets the deadline exactly. Record BUTTON = 3.
Constraints and Contract
- Keep the parameter and named constants. Use the numeric codes and units on this page.
- For NIGHT, enter a constant expression using DWELL. Only this entry changes with the parameter. The supported integer range is 0 through 16, inclusive.
Hints
Hint 1
Remove modes that lose required state or the wake source.
Hint 2
Check response time separately from energy.
Hint 3
Compute total energy including entry and exit, then resolve ties.
What the grader checks: Each check compares the full eight-bit answer. Parameter trials change one condition and keep the other decisions fixed.
25 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 2 problems on this path