S6.18.1 Read the Watchdog Run

MediumImplement22 minIcarus Verilog · serverReview the topic

Read three recorded runs of bring-up step 5, and turn them into the numbers that firmware must respect.

Hardware context: The watchdog of ap_soc under firmware on a small processor model, its early warning through ap_plic, checked against the real ap_rv32. Watchdog arming and kicking in firmware

The watchdog of ap_soc loads 6 at each kick. It takes 1 away at each supervision tick, one in every 32 ticks of mtime in the lab. A kick is early while more than 3 ticks are left. The warning comes on the tick that finds 1 left. The reset request follows 2 ticks after the warning.

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
Rows recorded from the labs of S6.18
RunRows
Kick from the main loop, every 128 ticks of mtimeevery kick: "watchdog kick, 2 ticks were left"
Job 3 fails, main stays in a loopt=286 the last kick; t=448 the early warning; t=512 the reset request; last words: source 6 at 000000a8
Job 3 fails, the kick is in a timer handlerjobs=3 kicks=9, warning=0, reset=0, after 1200 ticks
Kick at once after armingt=32 "watchdog kick, 5 ticks were left", then the early warning

All answers are decimal. Times are in ticks of mtime unless the entry says supervision ticks.

EntryYour decision
TICKS_PER_GAPSupervision ticks between two kicks of the healthy run.
LEFT_AT_KICKSupervision ticks left at each kick of the healthy run.
FEWEST_TICKSFewest supervision ticks after a kick before the next kick is not early.
MOST_TICKSMost supervision ticks after a kick that the next kick may wait without a warning.
SMALLEST_GAPSmallest gap between kicks, a multiple of 32 ticks of mtime, that is not early.
LARGEST_GAPLargest gap between kicks, a multiple of 32 ticks of mtime, with no warning.
WARN_AFTERTicks of mtime from the last kick to the early warning, when job 3 fails.
GRACE_TIMETicks of mtime from the early warning to the reset request.
LAST_ADDRESSThe address in the last words, in decimal.
QUIZ_LEFTTicks left at the kick straight after arming.
TIMER_WARNINGSEarly warnings in the run with the kick in a timer handler.
LEFT_AFTER_NA loop kicks exactly every N supervision ticks. How many ticks are left at each of its kicks?

Examples

Example 1

TICKS PER GAP
Input
Supervision ticks between two kicks of the healthy run.
Output
matches = 1

128 ticks of mtime, one supervision tick in every 32: 128 / 32 = 4.

Example 2

LEFT AT KICK
Input
Supervision ticks left at each kick of the healthy run.
Output
matches = 1

The kick loaded 6, and 4 ticks took 4 away.

Example 3

FEWEST TICKS
Input
Fewest supervision ticks after a kick before the next kick is not early.
Output
matches = 1

A kick is early while more than 3 are left. After 3 ticks, 3 are left.

Constraints and Contract

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

Hints

Hint 1

Divide a time in ticks of mtime by 32.

Hint 2

A kick needs 3 ticks or fewer left. The warning comes on the tick that finds 1 left.

Hint 3

Subtract the recorded times. Convert the address from hexadecimal.

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

12 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

TICKS PER GAP

Input
Supervision ticks between two kicks of the healthy run.
Expected output
matches = 1

128 ticks of mtime, one supervision tick in every 32: 128 / 32 = 4.

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

Icarus Verilog · server