S11.7.1 Locate the First Edge After Sleep

MediumImplement22 minIcarus Verilog · serverReview the topic

Account for the interval when a stopped processor shares a board with a running detector.

Hardware context: A gated core beside an always-on button detector. Find the first full core pulse after a synchronized button event.

The board requests sleep on GPIO bit zero after the DMA copy. The always-on logic waits four edges before the button rises.

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
Recorded release board observations.
edge=71 sleep pc=00000094
edge=78 wake pending=1 gated_edges=0 pc=00000094
edge=78 resume pc=00000094 sp=80010000 source=0000004b copy=0000004b
t=60 | GPIO OUT = 0000
t=62 | UART0 sends 4b "K"
t=63 | the program stops at 000000a0
copy=0000004b console=K interrupts=1 exceptions=0

Give times in board rising edges. Give addresses as decimal byte addresses.

EntryYour decision
GAPHow many always-on edges separate sleep and the pending observation?
CORE_EDGESHow many core rising edges passed in that interval?
SAVED_PCWhich instruction address waits across sleep?
BUTTONHow many rising edges after the button changes does pending assert?
FIRSTWhich board rising edge next reaches the core?
NEXT_EDGEDelay the same button event by DELAY additional rising edges. Which rising edge next reaches the core?

Examples

Example 1

GAP
Input
How many always-on edges separate sleep and the pending observation?
Output
matches = 1

Subtract edge 71 from edge 78.

Example 2

CORE EDGES
Input
How many core rising edges passed in that interval?
Output
matches = 1

The monitor counts actual gated clock edges.

Example 3

SAVED PC
Input
Which instruction address waits across sleep?
Output
matches = 1

The hexadecimal address 94 equals decimal 148.

Constraints and Contract

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

Hints

Hint 1

Use the two board timestamps.

Hint 2

Pending changes at a rising edge. The gate samples at the following falling edge.

Hint 3

The saved next instruction still has to execute.

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

6 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

GAP

Input
How many always-on edges separate sleep and the pending observation?
Expected output
matches = 1

Subtract edge 71 from edge 78.

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

Icarus Verilog · server