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
| Signal | Width | Role |
|---|---|---|
question | 8 | input of each check |
Full specification
| Code | What a reset does to it |
|---|---|
| 1 | Kept: nothing resets it |
| 2 | Cleared by start-up code on every boot |
| 3 | Back to its reset value |
| 4 | Keeps 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.
| Entry | Your decision |
|---|---|
| AFTER_PIN_SOFT | RESET_CAUSE after power-on, a pin reset, then a software reset. |
| AFTER_WDOG | RESET_CAUSE after power-on and one watchdog reset. |
| AFTER_ALL_POR | RESET_CAUSE after power-on, a pin, a watchdog, then a second power-on. |
| AFTER_DEBUG_PIN | RESET_CAUSE after power-on, a debug reset, then a pin reset. |
| TB_ARG_PIN | TB_ARG, written by firmware, across a pin reset. |
| BSS_PIN | A C variable with no first value, across a pin reset. |
| DATA_PIN | A C variable with a first value (SRAM layout), across a pin reset. |
| UART_DIV_PIN | UART0 DIV, set to 8 by firmware, across a software reset. |
| DMA_DEBUG | A DMA job in progress, across a debug reset. |
| STRAP_PIN | The sampled BOOT strap (STRAPS), across a pin reset. |
| DOG_PIN | An armed watchdog, across a pin reset. |
| CAUSE_AFTER | RESET_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