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
| Signal | Width | Role |
|---|---|---|
question | 8 | input of each check |
Full specification
| Run | Rows |
|---|---|
| Kick from the main loop, every 128 ticks of mtime | every kick: "watchdog kick, 2 ticks were left" |
| Job 3 fails, main stays in a loop | t=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 handler | jobs=3 kicks=9, warning=0, reset=0, after 1200 ticks |
| Kick at once after arming | t=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.
| Entry | Your decision |
|---|---|
| TICKS_PER_GAP | Supervision ticks between two kicks of the healthy run. |
| LEFT_AT_KICK | Supervision ticks left at each kick of the healthy run. |
| FEWEST_TICKS | Fewest supervision ticks after a kick before the next kick is not early. |
| MOST_TICKS | Most supervision ticks after a kick that the next kick may wait without a warning. |
| SMALLEST_GAP | Smallest gap between kicks, a multiple of 32 ticks of mtime, that is not early. |
| LARGEST_GAP | Largest gap between kicks, a multiple of 32 ticks of mtime, with no warning. |
| WARN_AFTER | Ticks of mtime from the last kick to the early warning, when job 3 fails. |
| GRACE_TIME | Ticks of mtime from the early warning to the reset request. |
| LAST_ADDRESS | The address in the last words, in decimal. |
| QUIZ_LEFT | Ticks left at the kick straight after arming. |
| TIMER_WARNINGS | Early warnings in the run with the kick in a timer handler. |
| LEFT_AFTER_N | A 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