S5.7.1 What Must Stay On

MediumImplement22 minIcarus Verilog · serverReview the topic

Keep a sensor node able to wake from deep sleep while removing everything its service contract allows.

Hardware context: ap_soc timer power island. Sleep and wake planning

A sleeping node must wake on a button or RTC alarm and preserve the cause until firmware reads it. The peripheral island loses power. Firmware rebuilds its configuration on wake.

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

Use 1 for a function that needs a live supply throughout deep sleep. Use 2 for switchable logic rebuilt on wake. Use 3 for state that needs storage across sleep but no running logic. A separate retention bank is available. The button and alarm are independent.

EntryYour decision
BUTTONThe receiver sensing the selected button pad.
BAUDThe UART baud counter, initialized by firmware.
TRIMThe only saved copy of calibration bits, read after wake.
ROUTEA mux between the button pad and wake detector, with no bypass.
COUNTThe real-time counter that advances the alarm deadline.
CONTROLThe sequencer driving the peripheral switch.
FIFOAn empty SPI FIFO allowed to restart empty.
CAUSEA latch that records which source fired while the island was off.
FILTERA digital button filter normally feeds the live detector. BYPASS=1 selects a qualified direct pad route and permits filter reset.

Examples

Example 1

BUTTON
Input
The receiver sensing the selected button pad.
Output
matches = 1

The external level needs a powered receiver. Record BUTTON = 1.

Example 2

BAUD
Input
The UART baud counter, initialized by firmware.
Output
matches = 1

UART resumes from initialization. Record BAUD = 2.

Example 3

TRIM
Input
The only saved copy of calibration bits, read after wake.
Output
matches = 1

The bits survive but are unused while asleep. Record TRIM = 3.

Constraints and Contract

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

Hints

Hint 1

Start where the external event originates.

Hint 2

Walk through the receiver, routing, detector and rail controller.

Hint 3

Separate a bit that must change asleep from one that merely survives.

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

10 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

Report a problem with this page

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

BUTTON

Input
The receiver sensing the selected button pad.
Expected output
matches = 1

The external level needs a powered receiver. Record BUTTON = 1.

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

Icarus Verilog · server