S10.15.1 Follow a Boot Chain by Hand

EasyImplement12 minIcarus Verilog · serverReview the topic

Follow three boots of one chain by hand: who has control after each offer, where a stop is latched, and what a reset changes.

Hardware context: Boot chain of ap_phone: Boot ROM, loader, monitor and operating system. Multi-stage secure boot and anti-rollback

This is the chain of lesson S10.15 with other images and other floors. After a reset the Boot ROM runs. The running stage checks the next image: its signature, and its version against a floor. If both pass, the next stage runs. If not, the running stage keeps control and accepts no further image until the next reset.

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
Stage that has controlCode
Boot ROM1
Loader2
Monitor3
OS4
ImageLowest version accepted (the floor)
Loader5
Monitor3
OS6
EventWhat happens
1Reset
2A loader is offered: signature good, version 5
3A monitor is offered: signature good, version 2
4A monitor is offered: signature good, version 3
5Reset
6A loader is offered: signature good, version 6
7A monitor is offered: signature good, version 3
8An OS is offered: signature wrong, version 6
9An OS is offered: signature good, version 6
10Reset
11A loader is offered: signature good, version 4
12A loader is offered: signature good, version 5

A version passes if it is at the floor or above it. Enter the code of a stage, or a count.

EntryYour decision
AFTER_2The code of the stage that has control after event 2.
AFTER_3The code of the stage that has control after event 3.
AFTER_4The code of the stage that has control after event 4.
AFTER_6The code of the stage that has control after event 6.
AFTER_7The code of the stage that has control after event 7.
AFTER_8The code of the stage that has control after event 8.
AFTER_9The code of the stage that has control after event 9.
AFTER_11The code of the stage that has control after event 11.
AFTER_12The code of the stage that has control after event 12.
CHECKER_8The code of the stage that checks the image of event 8.
IGNOREDHow many of the twelve events offer an image that would pass, to a stage that is already stopped?
RESETSAfter event 12, how many resets are needed before the OS can run?
LAST_OWNERA fresh boot offers a loader, a monitor and an OS, each at its floor. The signature of offer number BAD is wrong (1 the loader, 2 the monitor, 3 the OS, 0 none). Give the code of the stage that has control at the end.

Examples

Example 1

AFTER 2
Input
The code of the stage that has control after event 2.
Output
matches = 1

Version 5 meets the floor of 5, and the signature is good. The loader runs.

Example 2

AFTER 3
Input
The code of the stage that has control after event 3.
Output
matches = 1

Version 2 is below the floor of 3. The loader refuses and keeps control.

Example 3

AFTER 4
Input
The code of the stage that has control after event 4.
Output
matches = 1

The image is good, but the stop of event 3 is latched.

Constraints and Contract

  • Keep the parameter and named constants. Use the numeric codes and units on this page.
  • For LAST_OWNER, enter a constant expression using BAD. Only this entry changes with the parameter. The supported integer range is 0 through 3, inclusive.
  • Replace each unfinished 255 with your decision.

Hints

Hint 1

After a reset the code is 1, and nothing is stopped.

Hint 2

First the signature, then the version against the floor of that image.

Hint 3

After a refusal, cross out every later offer up to the next reset.

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

13 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

AFTER 2

Input
The code of the stage that has control after event 2.
Expected output
matches = 1

Version 5 meets the floor of 5, and the signature is good. The loader runs.

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

Icarus Verilog · server