S6.11.2 Kicked from the Wrong Place

MediumImplement22 minIcarus Verilog · serverReview the topic

Use a field log to decide which heartbeats prove that the application is still doing its job.

Hardware context: ap_soc watchdog supervisor. Recovery of unattended embedded controllers

A pump controller must finish a sensor read and commit a control output in every supervision interval. Its timer handler can still run while either worker is stuck.

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 yes and 0 for no. A kick reloads six ticks. The window is open with one through three ticks left. A timeout or early kick latches a warning. Reset follows two running ticks later. A production halt and sleep leave the watchdog running.

Only trusted boot can arm this design. It must write keys 0x51 and 0xa2 in order, then write one to control. Any intervening watchdog write breaks the sequence. Once armed, only reset can disarm it. Development debug freeze is enabled only on bench units.

The supervisor may kick only after both workers report fresh completion in this interval. Treat each ticket as a separate run. For timing tickets, count from a successful kick at tick zero. Arming tickets start disarmed.

EntryYour decision
READ_DONEAt tick 3 both fresh completions arrived. Is the sensor read proven?
IN_WINDOWIs tick 4 inside the service window?
AT_BOOTIs an immediate second kick legal at tick zero?
HANDLERAt tick 4 only the timer handler ran. Should it kick?
OLD_OUTPUTThe read is fresh, but the output completion belongs to the previous interval. May the supervisor kick at tick 3?
LAST_SLOTBoth workers finished by tick 5. May the supervisor kick then?
WARN_ATWith no service, at which tick does warning rise?
RESET_ATWith no service, at which tick is reset requested?
SLEEPThe processor sleeps through tick 8 with no kicks. Is reset requested?
HALTEDA production halt starts at tick 2. With no kicks, does warning rise by tick 6?
KEY_CHAINBoot writes 0x51, a service word, then 0xa2 and control. Does it arm?
WRITERA normal application writes both correct keys and control. Can it arm supervision?
LOCKA privileged driver writes zero to control after arming. Is the counter still armed?
BENCHA development breakpoint freezes the timer with three ticks left. How many remain after five halted ticks?
RESCUEMay a handler kick during grace to cancel reset?
NEXT_RESETIf the last accepted kick occurred at LAST_KICK and both workers stop, at which absolute tick is reset requested?

Examples

Example 1

READ DONE
Input
At tick 3 both fresh completions arrived. Is the sensor read proven?
Output
matches = 1

The fresh sensor completion records one finished read.

Example 2

IN WINDOW
Input
Is tick 4 inside the service window?
Output
matches = 1

Two ticks remain from the six-tick reload.

Example 3

AT BOOT
Input
Is an immediate second kick legal at tick zero?
Output
matches = 1

Six ticks remain, so the window is still closed.

Constraints and Contract

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

Hints

Hint 1

Count watchdog ticks since the accepted service.

Hint 2

Distinguish fresh progress from a handler that merely runs.

Hint 3

Count warning and reset as separate events.

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

16 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

READ DONE

Input
At tick 3 both fresh completions arrived. Is the sensor read proven?
Expected output
matches = 1

The fresh sensor completion records one finished read.

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

Icarus Verilog · server