V9.1.2 Reset Sources and What Survives

EasyImplement12 minIcarus Verilog · serverReview the topic

Work out what RESET_CAUSE reads after a series of resets, and what each kind of reset leaves behind on ap_soc.

Hardware context: ap_soc v1.5's reset controller ap_crg with its five reset sources and the RESET_CAUSE record. The record and what survives each kind of reset.

RESET_CAUSE (0x1000_4004) has bit 0 power-on, 1 pin, 2 watchdog, 3 software, 4 debug. Power-on sets the word to 0x01; every other source sets its own bit and leaves the rest. A debug reset reaches the core only; pin, watchdog and software reach the core, the bus and the peripherals. Enter cause words as decimal numbers.

This worksheet uses named constants. The first three entries show how to record your decisions.

Replace each unresolved value of 65535 with your result.

Signals in the Timeline

SignalWidthRole
question8input of each check
Full specification
CodeWhat a reset does to it
1Kept: nothing resets it
2Cleared by start-up code on every boot
3Back to its reset value
4Keeps running through it

The SRAM layout of the firmware kit: start-up code clears .bss and leaves .data alone, because .data is already in place. The scratch registers (TB_STATUS to TB_ARG) are cleared by power-on only. Recorded on ap_soc v1.5 (V9.1 lab): after a pin reset a .data variable held its last value. A .bss variable read 0.

EntryYour decision
AFTER_PIN_SOFTRESET_CAUSE after power-on, a pin reset, then a software reset.
AFTER_WDOGRESET_CAUSE after power-on and one watchdog reset.
AFTER_ALL_PORRESET_CAUSE after power-on, a pin, a watchdog, then a second power-on.
AFTER_DEBUG_PINRESET_CAUSE after power-on, a debug reset, then a pin reset.
TB_ARG_PINTB_ARG, written by firmware, across a pin reset.
BSS_PINA C variable with no first value, across a pin reset.
DATA_PINA C variable with a first value (SRAM layout), across a pin reset.
UART_DIV_PINUART0 DIV, set to 8 by firmware, across a software reset.
DMA_DEBUGA DMA job in progress, across a debug reset.
STRAP_PINThe sampled BOOT strap (STRAPS), across a pin reset.
DOG_PINAn armed watchdog, across a pin reset.
CAUSE_AFTERRESET_CAUSE, as a decimal number, after power-on and the sources of row SEQ. Row 0: pin, pin. Row 1: watchdog, software. Row 2: debug, pin. Row 3: software, por, watchdog. Row 4: pin, debug, watchdog, por. "por" is a second power-on.

Examples

Example 1

AFTER PIN SOFT
Input
RESET_CAUSE after power-on, a pin reset, then a software reset.
Output
matches = 1

0x01 | 0x02 | 0x08 = 0x0B = 11. The record is sticky.

Example 2

AFTER WDOG
Input
RESET_CAUSE after power-on and one watchdog reset.
Output
matches = 1

0x01 | 0x04 = 5.

Example 3

AFTER ALL POR
Input
RESET_CAUSE after power-on, a pin, a watchdog, then a second power-on.
Output
matches = 1

Power-on starts a new record: 0x01 = 1.

Constraints and Contract

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

Hints

Hint 1

Start at 0x01; OR in each warm source's bit; power-on starts again at 0x01.

Hint 2

Debug: the core only. Pin, watchdog, software: core, bus and peripherals. Power-on: everything.

Hint 3

.bss is cleared by start-up code at every boot; .data is not copied in the SRAM layout.

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

AFTER PIN SOFT

Input
RESET_CAUSE after power-on, a pin reset, then a software reset.
Expected output
matches = 1

0x01 | 0x02 | 0x08 = 0x0B = 11. The record is sticky.

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

Icarus Verilog · server