S4.11.1 Guard the Key Register

MediumImplement22 minIcarus Verilog · serverReview the topic

Qualify a write-only provisioning register and report denied attempts at that word.

Hardware context: APB service register gate. Peripheral access control

The local decoder receives a three-bit word index and a valid transfer pulse. Word 5 is a write-only key slot. Other words have their own responders.

Signals in the Timeline

SignalWidthRole
sample10input of each check
Full specification

The key storage has no read-data port. The response mux returns zero on local denial. This block owns the load strobe and denial signal.

Only secure privileged writes may load the slot. ns means nonsecure. Deny every other valid access to this slot.

Examples

Example 1

Word 5, Valid 1, Write 1, Privileged 1, Nonsecure 0
Input
word 5, valid 1, write 1, privileged 1, nonsecure 0
Output
load_key = 1, deny = 0

A secure privileged write loads the key.

Example 2

Word 5, Valid 1, Write 0, Privileged 1, Nonsecure 0
Input
word 5, valid 1, write 0, privileged 1, nonsecure 0
Output
load_key = 0, deny = 1

Even provisioning software cannot read back this write-only register.

Example 3

Word 4, Valid 1, Write 1, Privileged 1, Nonsecure 0
Input
word 4, valid 1, write 1, privileged 1, nonsecure 0
Output
load_key = 0, deny = 0

The neighboring word belongs to a different responder.

Constraints and Contract

  • Drive both outputs combinationally. For idle cycles and other offsets drive both low.

Hints

Hint 1

Identify ownership before permission.

Hint 2

Check direction even for privileged callers.

Hint 3

Consider the register beside the key.

What the grader checks: The combinational slot decoder is checked on all 128 binary input combinations.

141 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

Word 5, Valid 1, Write 1, Privileged 1, Nonsecure 0

Input
word 5, valid 1, write 1, privileged 1, nonsecure 0
Expected output
load_key = 1, deny = 0

A secure privileged write loads the key.

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

Icarus Verilog · server