S9.6.2 Life Cycle and the Debug Port

MediumImplement20 minIcarus Verilog · serverReview the topic

Decode the ap_soc life-cycle state and open or close each debug and test door. A damaged state must close every door.

Hardware context: ap_soc boot image gate and life-cycle debug gate. Secure boot and production debug lock

ap_soc reads its life-cycle state from one-time memory as an 8-bit code. Each pair of the four valid codes differs in at least four bits. One flipped bit can never turn one state into another.

Any other code is invalid. An invalid code means the memory is damaged or under attack, so the gate closes everything and raises lc_fault. The states, codes and doors are ap_soc design choices.

Signals in the Timeline

SignalWidthRole
sample10input of each check
Full specification
StateCodetap_enhalt_en, bus_entest_enkey_en
TEST8'h3C1110
DEV8'h5A1101
PROD8'h961dbg_unlocked0not dbg_unlocked
RMA8'hC31110
Any other-0000

lc_fault is 1 exactly when the code is invalid. dbg_unlocked comes from debug authentication and matters only in PROD.

Examples

Example 1

PROD, Locked
Input
lc_state=8'h96, dbg_unlocked=0
Output
lc_fault = 0, key_en = 1, test_en = 0, bus_en = 0, halt_en = 0, tap_en = 1

Debug is closed and the keys are usable. The TAP stays reachable so authentication can happen.

Example 2

PROD, Unlocked
Input
lc_state=8'h96, dbg_unlocked=1
Output
lc_fault = 0, key_en = 0, test_en = 0, bus_en = 1, halt_en = 1, tap_en = 1

Authentication opened halt and bus access, so the keys are withdrawn.

Example 3

One Bit Away from PROD
Input
lc_state=8'h97, dbg_unlocked=0
Output
lc_fault = 1, key_en = 0, test_en = 0, bus_en = 0, halt_en = 0, tap_en = 0

8'h97 is not a valid code. Every door closes and lc_fault rises.

Constraints and Contract

  • Implement module lc_debug_gate with combinational logic.
  • Use only your ports. Force, release, defparam, bind and hierarchical names are refused.

Hints

Hint 1

Decode each valid state with a full 8-bit compare.

Hint 2

Write one signal for "debug is open" and reuse it.

Hint 3

Check what happens to every output when no state matches.

What the grader checks: All 256 codes are tested with dbg_unlocked at 0 and 1.

515 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

PROD, Locked

Input
lc_state=8'h96, dbg_unlocked=0
Expected output
lc_fault = 0, key_en = 1, test_en = 0, bus_en = 0, halt_en = 0, tap_en = 1

Debug is closed and the keys are usable. The TAP stays reachable so authentication can happen.

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

Icarus Verilog · server