S6.11.1 A Windowed Watchdog

MediumImplement25 minIcarus Verilog · serverReview the topic

Build a supervisor that detects both a missing heartbeat and a service loop running too fast.

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

Build a supervisor that detects both a missing heartbeat and a service loop running too fast.

Signals in the Timeline

SignalWidthRole
sample12input of each check
Full specification

This exercise measures age upward from the last valid service. Inputs satisfy 0 ≤ open_at < timeout_at ≤ 15. Settings are stable throughout each interval.

Synchronous active-high reset clears age, warning and restart. Otherwise pause freezes all state. A latched restart holds everything until reset.

While healthy, service at the current age is legal from open_at through timeout_at minus one. A legal service clears age and takes priority over a simultaneous tick. An early service raises warning immediately.

Without service increment age on each tick. When the next increment would reach timeout_at, raise warning and freeze the last healthy age. Keep age frozen on every fault.

After warning, ignore service. The first unpaused tick after the warning edge asserts restart. Hold warning and restart until reset.

Examples

Example 1

Reset with Window [1,4)
Input
Reset with window [1,4)
Output
age = 0, warning = 0, restart = 0

Reset starts a new supervision interval at age zero.

Example 2

One Tick with No Service
Input
One tick with no service
Output
age = 1, warning = 0, restart = 0

Age reaches one, the first legal service age.

Example 3

Service and Tick Together
Input
Service and tick together
Output
age = 0, warning = 0, restart = 0

The accepted service restarts the interval at age zero.

Constraints and Contract

  • Use rising edges and the given ports. Service may arrive between ticks.

Hints

Hint 1

Check reset and pause before consuming an event.

Hint 2

Test the service against the age already reached.

Hint 3

Give diagnostics one tick before requesting restart.

What the grader checks: Checks nine window settings across the four-bit range, both sides of its opening, timeout, service priority and the diagnostic grace tick.

405 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

Reset with Window [1,4)

Input
Reset with window [1,4)
Expected output
age = 0, warning = 0, restart = 0

Reset starts a new supervision interval at age zero.

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

Icarus Verilog · server