S5.4.1 Record the Cause

MediumImplement22 minIcarus Verilog · serverReview the topic

Keep the boot log intact when firmware acknowledges an old event on the edge of a new reset.

Hardware context: Always-on reset event recorder. Diagnosing field restarts

Implement the always-on event register for a service revision of ap_soc. The inputs are synchronous samples in its clock domain. Firmware can acknowledge individual flags.

Signals in the Timeline

SignalWidthRole
sample12input of each check
Full specification

cause[0] records cold start. events[3:0] represent debug, software, watchdog and pin, in that order. The pin needs two consecutive high samples. Cold clears its sample history. The other three sources qualify on every high sample.

The active-high cold input starts a new history containing just bit zero. It takes priority over all other inputs.

Examples

Example 1

Cold Boot
Input
Assert cold with idle event inputs.
Output
cause = 0x1, resets = 0x7

Bit zero opens a fresh log.

Example 2

Watchdog Expiry
Input
Pulse events=2 on the following edge.
Output
cause = 0x5, resets = 0x3

The watchdog joins the existing cold flag.

Example 3

Acknowledge Boot
Input
Write clear_mask=1 with no new event.
Output
cause = 0x4, resets = 0x0

The watchdog remains available for another reader.

Constraints and Contract

  • Register resets[2:0] for debug logic, I/O and core respectively. Cold requests all three. A qualified pin, watchdog or software event requests I/O and core. Debug requests core only. When every source is quiet, drive all three outputs low.
  • Each qualified warm source sets its corresponding cause bit from four down to one. Update only on rising edges. On a completed clear write, clear_valid is high and each one in clear_mask acknowledges that flag. Zeros preserve their flags.
  • A concurrent event survives a clear of its bit. Multiple sources can fire together. Between events and clear writes retain the entire history.

Hints

Hint 1

Sketch the previous word.

Hint 2

Mark the bits named by the write.

Hint 3

Trace an event on one of those bits.

What the grader checks: Every mask and every event pattern appears with and without a qualified write. Timing checks observe the low and high clock phases.

338 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

Cold Boot

Input
Assert cold with idle event inputs.
Expected output
cause = 0x1, resets = 0x7

Bit zero opens a fresh log.

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

Icarus Verilog · server