Testplan

Testpoints

Stage V1 Testpoints

wake_up

Test: otp_ctrl_wake_up

Wake_up test walks through otp_ctrl’s power-on initialization, read, program, and digest functionalities.

  • drive pwrmgr’s request pin to trigger OTP initialization after reset, check status after OTP initialization
  • write all-ones to a random address within OTP partition 0, wait until this operation completes
  • read out the random selected write address, check if the readout value is all-ones
  • trigger a digest calculation for a Software partition, check if the OtpError interrupt is set
  • trigger a digest calculation for a non-software partition, expect operation completes without the OtpError interrupt
  • read out secrets through the hardware interfaces

smoke

Test: otp_ctrl_smoke

OTP_CTRL smoke test provisions and locks partitions.

  • drive pwrmgr’s request pin to trigger OTP initialization after reset, check status after OTP initialization
  • randomly read out keys pertaining to key_manager, flash, sram, otbn
  • randomly issue LC program request
  • write random values to random addresses within each OTP partition
  • read out the random selected write addresses, check if the readout values are expected
  • during read and write operations, check if direct_access_regwen is correctly set by HW
  • perform a system-level reset and check corresponding CSRs are set correctly
  • lock all partitions except life_cycle by triggering digest calculations
  • read back and verify the digest
  • perform a system-level reset to verify the corresponding CSRs exposing the digests have been populated

Checks:

  • Assertion checks to ensure vendor specific I/Os: otp_vendor_test_status_o, otp_vendor_test_ctrl_i, cio_test_o, and cio_test_en_o are connected currently with lc_dft_en_i On and Off.

csr_hw_reset

Test: otp_ctrl_csr_hw_reset

Verify the reset values as indicated in the RAL specification.

  • Write all CSRs with a random value.
  • Apply reset to the DUT as well as the RAL model.
  • Read each CSR and compare it against the reset value. it is mandatory to replicate this test for each reset that affects all or a subset of the CSRs.
  • It is mandatory to run this test for all available interfaces the CSRs are accessible from.
  • Shuffle the list of CSRs first to remove the effect of ordering.

csr_rw

Test: otp_ctrl_csr_rw

Verify accessibility of CSRs as indicated in the RAL specification.

  • Loop through each CSR to write it with a random value.
  • Read the CSR back and check for correctness while adhering to its access policies.
  • It is mandatory to run this test for all available interfaces the CSRs are accessible from.
  • Shuffle the list of CSRs first to remove the effect of ordering.

csr_bit_bash

Test: otp_ctrl_csr_bit_bash

Verify no aliasing within individual bits of a CSR.

  • Walk a 1 through each CSR by flipping 1 bit at a time.
  • Read the CSR back and check for correctness while adhering to its access policies.
  • This verify that writing a specific bit within the CSR did not affect any of the other bits.
  • It is mandatory to run this test for all available interfaces the CSRs are accessible from.
  • Shuffle the list of CSRs first to remove the effect of ordering.

csr_aliasing

Test: otp_ctrl_csr_aliasing

Verify no aliasing within the CSR address space.

  • Loop through each CSR to write it with a random value
  • Shuffle and read ALL CSRs back.
  • All CSRs except for the one that was written in this iteration should read back the previous value.
  • The CSR that was written in this iteration is checked for correctness while adhering to its access policies.
  • It is mandatory to run this test for all available interfaces the CSRs are accessible from.
  • Shuffle the list of CSRs first to remove the effect of ordering.

csr_mem_rw_with_rand_reset

Test: otp_ctrl_csr_mem_rw_with_rand_reset

Verify random reset during CSR/memory access.

  • Run csr_rw sequence to randomly access CSRs
  • If memory exists, run mem_partial_access in parallel with csr_rw
  • Randomly issue reset and then use hw_reset sequence to check all CSRs are reset to default value
  • It is mandatory to run this test for all available interfaces the CSRs are accessible from.

regwen_csr_and_corresponding_lockable_csr

Tests:

  • otp_ctrl_csr_rw
  • otp_ctrl_csr_aliasing

Verify regwen CSR and its corresponding lockable CSRs.

  • Randomly access all CSRs
  • Test when regwen CSR is set, its corresponding lockable CSRs become read-only registers

Note:

  • If regwen CSR is HW read-only, this feature can be fully tested by common CSR tests - csr_rw and csr_aliasing.
  • If regwen CSR is HW updated, a separate test should be created to test it.

This is only applicable if the block contains regwen and locakable CSRs.

mem_walk

Test: otp_ctrl_mem_walk

Verify accessibility of all memories in the design.

  • Run the standard UVM mem walk sequence on all memories in the RAL model.
  • It is mandatory to run this test from all available interfaces the memories are accessible from.

mem_partial_access

Test: otp_ctrl_mem_partial_access

Verify partial-accessibility of all memories in the design.

  • Do partial reads and writes into the memories and verify the outcome for correctness.
  • Also test outstanding access on memories

Stage V2 Testpoints

bkdr_write_partitions

Test: otp_ctrl_bkdr_write_partitions

Provision the buffered partitions through the otp_ctrl_mem_bkdr_util_pkg helpers that top-level environments use to preload OTP, and check that the hardware accepts the result.

  • backdoor write random contents and the matching digest into every buffered partition through otp_write_<partition>_partition()
  • drive pwrmgr’s request pin to trigger OTP initialization, expect it to complete
  • check that no partition reports an error and that every digest CSR exposes the backdoor-written digest

dai_access_partition_walk

Test: otp_ctrl_partition_walk

Similar to UVM’s memory walk test, this test ensures every address in each partition can be accessed successfully via DAI and TLUL interfaces according to its access policy.

init_fail

Test: otp_ctrl_init_fail

Based on OTP_CTRL smoke test, this test creates OTP_CTRL’s initialization failure:

  • write and read OTP memory via DAI interface
  • randomly issue DAI digest command to lock HW partitions
  • keep writing to OTP memory via DAI interface without asserting reset
  • if digests are not locked, backdoor inject ECC correctable or uncorrectable errors
  • issue reset and power initialization
  • if the injected errors are all correctable errors, disable the lc_bypass_chk_en after LC program request to create an LC partition check failure

If fatal error is triggered, this test will check:

  • OTP initialization failure triggers fatal alert
  • status, intr_state, err_code CSRs reflect correct fatal error

If OTP initialization finished without any fatal error, this test will check:

  • OTP initialization finishes with power init output goes to 1
  • status, intr_state, err_code CSRs reflect ECC correctable error

partition_check

Tests:

  • otp_ctrl_check_fail
  • otp_ctrl_background_chks

Randomly program the partition check related CSRs including:

  • check_timeout
  • integrity_check_period
  • consistency_check_period
  • check_trigger

Create a failure scenario by randomly picking one of these three methods:

  • inject ECC errors into the OTP macro via backdoor
  • set the check_timeout CSR with a very small value
  • write to a random OTP partition after digest is issued but before reset is asserted

Checks:

  • the corresponding alerts are triggered
  • the error_code register is set correctly Note that due to limited simulation time, for background checks, this test only write random value that is less than 20 to the check period.

regwen_during_otp_init

Test: otp_ctrl_regwen

The direct_access_regwen is a RO register which controls the write-enable of other registers. It is not verified by the common CSR tests. HW sets it to 0 when the DAI interface is busy.

Stimulus and checks:

  • randomly read direct_access_regwen and verify that it returns 0 during OTP initialization
  • verify that the writes to the registers controlled by it do not go through during OTP initialization

partition_lock

Test: otp_ctrl_dai_lock

This test will cover two methods of locking read and write: digest calculation and CSR write. After locking the partitions, issue read or program sequences and check if the operations are locked correctly, and check if the AccessError is set.

interface_key_check

Test: otp_ctrl_parallel_key_req

OTP_CTRL will generate keys to flash, sram, and otbn upon their requests. Based on the DAI access sequence, this test will run key requests sequence in parallel, and check if correct keys are generated.

lc_interactions

Tests:

  • otp_ctrl_parallel_lc_req
  • otp_ctrl_parallel_lc_esc

Verify the protocols between OTP_CTRL and LC_CTRL. Based on the DAI access sequence, run the following sequences in parallel:

  • request a LC state transition via the programming interface
  • enable the lc_escalation_en signal
  • issue DAI ZEROIZE commands to zeroizable partitions while LC state transitions are requested

Checks:

  • if the LC program request has AccessError, check the LC program response sets the error bit to 1
  • if lc_escalation_en is enabled, verify that alert is triggered and OTP_CTRL entered terminal state
  • if a ZEROIZE command and a LC program request overlap, the operation already in progress completes first, and when both compete for the next OTP access, the LC program request is served first; check the results of both operations and the order in which they complete

otp_dai_errors

Test: otp_ctrl_dai_errs

Based on the otp_dai_lock test, this test will randomly run the following OTP errors:

  • DAI interface writes non-blank OTP address
  • DAI interface accesses LC partition
  • DAI interface writes HW digests
  • DAI interface writes non-empty memory

Checks:

  • err_code and status CSRs
  • otp_error interrupt

otp_macro_errors

Test: otp_ctrl_macro_errs

Randomly run the following OTP errors:

  • MacroError
  • MacroEccCorrError
  • MacroEccUncorrError

Checks:

  • err_code and status CSRs
  • otp_error interrupt
  • if the error is unrecoverable, verify that alert is triggered and OTP_CTRL entered terminal state

test_access

Test: otp_ctrl_test_access

This test checks if the test access to OTP macro is connected correctly.

Stimulus and Checks:

  • Write and check read results from the prim_tl_i/o.
  • Ensure no error or alert occurs from DUT.

stress_all

Test: otp_ctrl_stress_all

  • combine above sequences in one test to run sequentially, except csr sequence
  • randomly add reset between each sequence

dai_zeroize

No Tests Implemented

Verify zeroization of individual OTP words through the DAI ZEROIZE command.

Stimulus:

  • Backdoor-load random data into a zeroizable partition, locked or unlocked.
  • Issue ZEROIZE via DIRECT_ACCESS_CMD on randomly chosen 64-bit words covering:
    • data words,
    • the digest field,
    • the zeroization marker field.
  • Issue ZEROIZE directly after a completed DIGEST command, without an intervening DAI READ, WRITE or reset, and after each of the other DAI commands.
  • While a ZEROIZE command is in progress, attempt writes to the DAI registers protected by DIRECT_ACCESS_REGWEN.
  • Wait for otp_operation_done, reading STATUS at random times while waiting.

Checks:

  • The addressed word is fully set in the OTP macro (data and ECC bits), checked via backdoor.
  • DIRECT_ACCESS_RDATA holds the population count of the 64 data bits of the zeroized word, as read back from the OTP macro (64 for a fully zeroized word); it does not contain the word contents and is not descrambled.
  • The access is 64 bits wide, as all zeroizable partitions in the supported Earl Grey and Darjeeling configurations are secret partitions with 64-bit words, and the low address bits are ignored accordingly.
  • ZEROIZE succeeds regardless of the preceding DAI command, including directly after DIGEST, since every word in a zeroizable partition is always erasable.
  • While ZEROIZE is in progress, STATUS.DAI_IDLE and DIRECT_ACCESS_REGWEN are low, writes to DIRECT_ACCESS_CMD, DIRECT_ACCESS_ADDRESS and DIRECT_ACCESS_WDATA are ignored, and pwr_otp_o.otp_idle is low. All are restored once the command completes.
  • STATUS and ERR_CODE report no error for the DAI.

dai_zeroize_access_ctrl

No Tests Implemented

Verify which addresses accept or reject a ZEROIZE command, and how the zeroization marker is protected against other DAI commands.

Stimulus:

  • Issue ZEROIZE on random addresses in non-zeroizable partitions, including LIFE_CYCLE, and on out-of-range addresses.
  • Issue ZEROIZE on zeroizable partitions that are write-locked (non-zero digest) and/or read-locked.
  • Issue ZEROIZE in random life cycle states.
  • Issue DAI WRITE and READ commands to the zeroization marker.

Checks:

  • Zeroize on a non-zeroizable partition or out-of-range address is rejected with AccessError in the DAI ERR_CODE, the otp_error interrupt fires, the OTP contents are unchanged and the DAI remains usable (no terminal error state).
  • Zeroize on a zeroizable partition succeeds regardless of its write or read lock.
  • Zeroize is not restricted by the life cycle state. TODO(#32272): Check that this matches the specification when that issue is resolved.
  • On a read-locked partition, ZEROIZE still sets DIRECT_ACCESS_RDATA to the set-bit count.
  • A DAI WRITE to the zeroization marker is always rejected with AccessError.
  • A DAI READ of the marker always succeeds, even when the partition is read-locked, returns the raw value without descrambling and does not raise ECC errors.

dai_zeroize_idempotent

No Tests Implemented

Verify that ZEROIZE can be repeated on the same word, including retries after an incomplete zeroization.

Stimulus:

  • Zeroize a random word, then issue ZEROIZE on the same address one or more times.
  • Incomplete zeroization: during a ZEROIZE command, inject a fault between the programming and the read-back of the word, or force a macro response with NoError and a data value whose population count is below ZeroizationValidBound. Then remove the fault and issue ZEROIZE on the same address again.

Checks:

  • For a successfully zeroized word, every repetition completes without error, returns the same set-bit count and leaves the OTP contents unchanged.
  • For an incomplete zeroization, the command completes with NoError and returns the reduced set-bit count; the retry returns 64 and the word is fully set.

zeroize_check_disable

No Tests Implemented

Verify how a successful zeroization affects background checks before the next reset.

Stimulus:

  • Lock a zeroizable buffered partition, reset, and enable periodic integrity and consistency checks with short periods.
  • Zeroize one or more words of that partition while the periodic checks continue to run, and also trigger checks via CHECK_TRIGGER.
  • Include zeroizations that complete with NoError but return a set-bit count below ZeroizationValidBound, produced by fault injection or a forced macro response as in dai_zeroize_idempotent.
  • Include zeroizations that complete with a forced MacroWriteBlankError response, as in zeroize_errors.
  • After the zeroization, corrupt the partition’s digest in the OTP macro via backdoor, so that an executed consistency check would detect a mismatch.
  • After the zeroization, corrupt the partition’s buffered data, so that an executed integrity check would detect a mismatch.
  • Corrupt the digest of a non-zeroized partition in the OTP macro via backdoor.
  • Zeroize the digest word of a partition while a consistency check of that partition is in progress, and with the zeroization and the check’s OTP read requested at the same time, without zeroizing the marker first.

Checks:

  • After the first zeroization of a word in the partition that completes with NoError, consistency checks for that partition are no longer executed. This also applies if the returned set-bit count is below ZeroizationValidBound.
  • A consistency check that is no longer executed issues no read request for the partition on the OTP macro interface, and raises no fatal_check_error although the digest in the OTP macro was corrupted.
  • Integrity checks continue to run on the buffered data until reset: a corruption of the buffered data is detected with CheckFailError and fatal_check_error.
  • The buffered values of the partition, and the hardware outputs derived from them, remain unchanged until reset.
  • Checks on other, non-zeroized partitions are unaffected: a corrupted digest of such a partition is detected by its next consistency check with CheckFailError and fatal_check_error.
  • A zeroization that completes with MacroWriteBlankError does not disable checks: the next consistency check of the partition issues its OTP read and detects a corrupted digest with CheckFailError and fatal_check_error.
  • When the digest word is zeroized while a consistency check of the partition is in progress, or requested at the same time, the check does not raise a false fatal_check_error.

zeroize_init

No Tests Implemented

Verify partition initialization depending on the zeroization marker.

Stimulus:

  • Backdoor-load the zeroization marker of each zeroizable partition independently with a random number of set bits, including values just below, at and above ZeroizationValidBound, and with random partition contents including uncorrectable ECC errors in zeroized partitions.
  • Backdoor-load a marker with at least ZeroizationValidBound set bits while only some of the data words and the digest are zeroized, the rest keeping its original contents.
  • Backdoor-load a marker with fewer than ZeroizationValidBound set bits, combined with the following partition contents:
    • a locked partition with valid ECC throughout and a nonzero digest that does not match the partition contents,
    • a partition containing a fully zeroized word, which results in an uncorrectable ECC error when read with ECC enabled,
    • an unlocked partition with a blank digest and valid ECC throughout.
  • Force a MacroError response on the OTP macro interface for the marker read of a partition during initialization.
  • Trigger OTP initialization via the power manager interface.

Checks:

  • Marker set-bit count >= ZeroizationValidBound: the partition is treated as zeroized: initialization completes without integrity check and without ECC errors, no periodic integrity or consistency checks run for it (observed as in zeroize_check_disable), and subsequent DAI reads of the partition use raw access without ECC checking.
  • A partition with a zeroized marker but incompletely zeroized contents is detected as zeroized and initializes without errors or alerts.
  • Marker set-bit count < ZeroizationValidBound: the partition is initialized and checked as a normal partition:
    • valid ECC with a mismatching nonzero digest: CheckFailError and fatal_check_error,
    • uncorrectable ECC error: MacroEccUncorrError and fatal_macro_error,
    • unlocked partition with a blank digest and valid ECC: successful initialization.
  • Each zeroizable partition is zeroized independently: the checks above are applied per partition, and each partition’s result depends only on its own marker.
  • The marker is read raw at initialization and is not covered by the digest. A MacroError response on that read moves the partition into its terminal error state with MacroError and raises fatal_macro_error.
  • The hardware outputs of a zeroized partition carry its buffered data, i.e. the descrambled zeroized contents for secret partitions, and the associated valid signals follow the nonzero digest as for non-zeroized partitions (see #32271).

zeroize_interrupted

No Tests Implemented

Verify that an interrupted zeroization can be detected and resumed.

Stimulus:

  • Zeroize the marker of a partition first, then part of its words.
  • Assert reset or lc_escalate_en during a ZEROIZE command, while the word is being programmed, while it is being read back, and while the response is returned to the DAI.
  • Assert reset while the zeroization marker itself is being zeroized.
  • After reset, re-initialize and continue zeroizing the remaining words.

Checks:

  • Escalation moves the DAI into its terminal error state and further DAI commands are rejected.
  • After reset, a partition whose marker was zeroized is detected as zeroized.
  • After reset, a partially set marker (below ZeroizationValidBound) leaves the partition non-zeroized; it initializes normally without alerts, since the marker is not covered by the digest, and zeroizing the marker again completes successfully.
  • Resumed zeroization completes successfully on all remaining words.
  • The programming state of the interrupted word is unknown, so the scoreboard does not predict its contents but updates its model of that word with a backdoor read after reset.

zeroize_errors

No Tests Implemented

Verify error handling during zeroization.

Stimulus:

  • Force MacroError and MacroWriteBlankError onto the OTP macro response interface during a ZEROIZE command, since the generic OTP macro model never returns an error for ZEROIZE.
  • After a recoverable error, issue ZEROIZE on the same address again.
  • Issue ZEROIZE after a fatal alert has been raised.

Checks:

  • On a macro error response, the error code is reported in the DAI ERR_CODE and DIRECT_ACCESS_RDATA is not updated.
  • MacroWriteBlankError is recoverable: the DAI remains usable and a retry of the command succeeds. Checks for the partition stay enabled, observed as in zeroize_check_disable.
  • MacroError raises fatal_macro_error and escalates locally, moving the DAI into its terminal error state.
  • After a fatal alert, ZEROIZE commands are not executed: no request appears on the OTP macro interface and the addressed word in the OTP macro is unchanged, checked via backdoor.

intr_test

Test: otp_ctrl_intr_test

Verify common intr_test CSRs that allows SW to mock-inject interrupts.

  • Enable a random set of interrupts by writing random value(s) to intr_enable CSR(s).
  • Randomly “turn on” interrupts by writing random value(s) to intr_test CSR(s).
  • Read all intr_state CSR(s) back to verify that it reflects the same value as what was written to the corresponding intr_test CSR.
  • Check the cfg.intr_vif pins to verify that only the interrupts that were enabled and turned on are set.
  • Clear a random set of interrupts by writing a randomly value to intr_state CSR(s).
  • Repeat the above steps a bunch of times.

alert_test

Test: otp_ctrl_alert_test

Verify common alert_test CSR that allows SW to mock-inject alert requests.

  • Enable a random set of alert requests by writing random value to alert_test CSR.
  • Check each alert_tx.alert_p pin to verify that only the requested alerts are triggered.
  • During alert_handshakes, write alert_test CSR again to verify that: If alert_test writes to current ongoing alert handshake, the alert_test request will be ignored. If alert_test writes to current idle alert handshake, a new alert_handshake should be triggered.
  • Wait for the alert handshakes to finish and verify alert_tx.alert_p pins all sets back to 0.
  • Repeat the above steps a bunch of times.

tl_d_oob_addr_access

Test: otp_ctrl_tl_errors

Access out of bounds address and verify correctness of response / behavior

tl_d_illegal_access

Test: otp_ctrl_tl_errors

Drive unsupported requests via TL interface and verify correctness of response / behavior. Below error cases are tested bases on the TLUL spec

  • TL-UL protocol error cases
    • invalid opcode
    • some mask bits not set when opcode is PutFullData
    • mask does not match the transfer size, e.g. a_address = 0x00, a_size = 0, a_mask = 'b0010
    • mask and address misaligned, e.g. a_address = 0x01, a_mask = 'b0001
    • address and size aren’t aligned, e.g. a_address = 0x01, a_size != 0
    • size is greater than 2
  • OpenTitan defined error cases
    • access unmapped address, expect d_error = 1
    • write a CSR with unaligned address, e.g. a_address[1:0] != 0
    • write a CSR less than its width, e.g. when CSR is 2 bytes wide, only write 1 byte
    • write a memory with a_mask != '1 when it doesn’t support partial accesses
    • read a WO (write-only) memory
    • write a RO (read-only) memory
    • write with instr_type = True

tl_d_outstanding_access

Tests:

  • otp_ctrl_csr_hw_reset
  • otp_ctrl_csr_rw
  • otp_ctrl_csr_aliasing
  • otp_ctrl_same_csr_outstanding

Drive back-to-back requests without waiting for response to ensure there is one transaction outstanding within the TL device. Also, verify one outstanding when back- to-back accesses are made to the same address.

tl_d_partial_access

Tests:

  • otp_ctrl_csr_hw_reset
  • otp_ctrl_csr_rw
  • otp_ctrl_csr_aliasing
  • otp_ctrl_same_csr_outstanding

Access CSR with one or more bytes of data. For read, expect to return all word value of the CSR. For write, enabling bytes should cover all CSR valid fields.

Stage V2S Testpoints

sec_cm_additional_check

Test: otp_ctrl_sec_cm

Verify the outcome of injecting faults to security countermeasures.

Stimulus: As mentioned in prim_count_check, prim_fsm_check and prim_double_lfsr_check.

Checks:

  • Check the value of status register according to where the fault is injected.
  • Check OTP_CTRL is locked after the fatal fault injection by trying to access OTP_CTRL via dai, kdi, and lci interfaces.

zeroize_sec_cm

No Tests Implemented

Verify the countermeasures protecting the zeroization state.

Stimulus:

  • Force an invalid multi-bit value on the zeroization trigger that the DAI sends to a partition.
  • Force an invalid multi-bit value on a partition’s zeroization indicator, or inject an error into its zeroization marker register.

Checks:

  • An invalid zeroization trigger moves the DAI into its terminal error state with FsmStateError.
  • An invalid zeroization indicator or a marker register error moves the partition into its terminal error state with FsmStateError and raises fatal_check_error.
  • OTP_CTRL is locked afterwards, as checked in sec_cm_additional_check.

Related countermeasures: DAI.FSM.SPARSE, PART.FSM.SPARSE and PART.DATA_REG.INTEGRITY. The multi-bit encoded zeroization trigger and indicator are not listed as a separate countermeasure.

tl_intg_err

Tests:

  • otp_ctrl_tl_intg_err
  • otp_ctrl_sec_cm

Verify that the data integrity check violation generates an alert.

  • Randomly inject errors on the control, data, or the ECC bits during CSR accesses. Verify that triggers the correct fatal alert.
  • Inject a fault at the onehot check in u_reg.u_prim_reg_we_check and verify the corresponding fatal alert occurs

prim_count_check

Test: otp_ctrl_sec_cm

Verify that violating prim_count counter properties generate a fatal alert.

Stimulus:

  • At the falling edge (non-active edge), force the counter to a different value than expected.
  • Randomly force the counter back to a normal value to ensure the error is latched and won’t go away until reset.
  • Within the next few cycles, the violation of hardened counter property should generate a fatal alert.
  • Repeat for ALL prim_count instances in the DUT.

Checks:

  • Check that fatal alert is triggered.
  • Check that err_code/fault_status is updated correctly and preserved until reset.
  • Verify any operations that follow fail (as applicable).

prim_fsm_check

Test: otp_ctrl_sec_cm

Verify that entering to an undefined state generates a fatal alert.

Stimulus:

  • Backdoor force the FSM to any of the undefined values.
  • Randomly force the FSM back to a defined state to ensure the error is latched and won’t go away until reset.
  • Within the next few cycles, the FSM landing in an invalid state should trigger a fatal alert.
  • Repeat for ALL prim_fsm instances in the DUT.

Checks:

  • Check that fatal alert is triggered.
  • Check that err_code/fault_status is updated correctly and preserved until reset.
  • Verify any operations that follow fail (as applicable).

sec_cm_bus_integrity

Test: otp_ctrl_tl_intg_err

Verify the countermeasure(s) BUS.INTEGRITY.

sec_cm_secret_mem_scramble

Test: otp_ctrl_smoke

Verify the countermeasure(s) SECRET.MEM.SCRAMBLE.

sec_cm_part_mem_digest

Test: otp_ctrl_smoke

Verify the countermeasure(s) PART.MEM.DIGEST.

sec_cm_dai_fsm_sparse

Test: otp_ctrl_sec_cm

Verify the countermeasure(s) DAI.FSM.SPARSE.

sec_cm_kdi_fsm_sparse

Test: otp_ctrl_sec_cm

Verify the countermeasure(s) KDI.FSM.SPARSE.

sec_cm_lci_fsm_sparse

Test: otp_ctrl_sec_cm

Verify the countermeasure(s) LCI.FSM.SPARSE.

sec_cm_part_fsm_sparse

Test: otp_ctrl_sec_cm

Verify the countermeasure(s) PART.FSM.SPARSE.

sec_cm_scrmbl_fsm_sparse

Test: otp_ctrl_sec_cm

Verify the countermeasure(s) SCRMBL.FSM.SPARSE.

sec_cm_timer_fsm_sparse

Test: otp_ctrl_sec_cm

Verify the countermeasure(s) TIMER.FSM.SPARSE.

sec_cm_dai_ctr_redun

Test: otp_ctrl_sec_cm

Verify the countermeasure(s) DAI.CTR.REDUN.

sec_cm_kdi_seed_ctr_redun

Test: otp_ctrl_sec_cm

Verify the countermeasure(s) KDI_SEED.CTR.REDUN.

sec_cm_kdi_entropy_ctr_redun

Test: otp_ctrl_sec_cm

Verify the countermeasure(s) KDI_ENTROPY.CTR.REDUN.

sec_cm_lci_ctr_redun

Test: otp_ctrl_sec_cm

Verify the countermeasure(s) LCI.CTR.REDUN.

sec_cm_part_ctr_redun

Test: otp_ctrl_sec_cm

Verify the countermeasure(s) PART.CTR.REDUN.

sec_cm_scrmbl_ctr_redun

Test: otp_ctrl_sec_cm

Verify the countermeasure(s) SCRMBL.CTR.REDUN.

sec_cm_timer_integ_ctr_redun

Test: otp_ctrl_sec_cm

Verify the countermeasure(s) TIMER_INTEG.CTR.REDUN.

sec_cm_timer_cnsty_ctr_redun

Test: otp_ctrl_sec_cm

Verify the countermeasure(s) TIMER_CNSTY.CTR.REDUN.

sec_cm_timer_lfsr_redun

Test: otp_ctrl_sec_cm

Verify the countermeasure(s) TIMER.LFSR.REDUN.

sec_cm_dai_fsm_local_esc

Tests:

  • otp_ctrl_parallel_lc_esc
  • otp_ctrl_sec_cm

Verify the countermeasure(s) DAI.FSM.LOCAL_ESC.

sec_cm_lci_fsm_local_esc

Test: otp_ctrl_parallel_lc_esc

Verify the countermeasure(s) LCI.FSM.LOCAL_ESC.

sec_cm_kdi_fsm_local_esc

Test: otp_ctrl_parallel_lc_esc

Verify the countermeasure(s) KDI.FSM.LOCAL_ESC.

sec_cm_part_fsm_local_esc

Tests:

  • otp_ctrl_parallel_lc_esc
  • otp_ctrl_macro_errs

Verify the countermeasure(s) PART.FSM.LOCAL_ESC.

sec_cm_scrmbl_fsm_local_esc

Test: otp_ctrl_parallel_lc_esc

Verify the countermeasure(s) SCRMBL.FSM.LOCAL_ESC.

sec_cm_timer_fsm_local_esc

Tests:

  • otp_ctrl_parallel_lc_esc
  • otp_ctrl_sec_cm

Verify the countermeasure(s) TIMER.FSM.LOCAL_ESC.

sec_cm_dai_fsm_global_esc

Tests:

  • otp_ctrl_parallel_lc_esc
  • otp_ctrl_sec_cm

Verify the countermeasure(s) DAI.FSM.GLOBAL_ESC.

sec_cm_lci_fsm_global_esc

Test: otp_ctrl_parallel_lc_esc

Verify the countermeasure(s) LCI.FSM.GLOBAL_ESC.

sec_cm_kdi_fsm_global_esc

Test: otp_ctrl_parallel_lc_esc

Verify the countermeasure(s) KDI.FSM.GLOBAL_ESC.

sec_cm_part_fsm_global_esc

Tests:

  • otp_ctrl_parallel_lc_esc
  • otp_ctrl_macro_errs

Verify the countermeasure(s) PART.FSM.GLOBAL_ESC.

sec_cm_scrmbl_fsm_global_esc

Test: otp_ctrl_parallel_lc_esc

Verify the countermeasure(s) SCRMBL.FSM.GLOBAL_ESC.

sec_cm_timer_fsm_global_esc

Tests:

  • otp_ctrl_parallel_lc_esc
  • otp_ctrl_sec_cm

Verify the countermeasure(s) TIMER.FSM.GLOBAL_ESC.

sec_cm_part_data_reg_integrity

Test: otp_ctrl_init_fail

Verify the countermeasure(s) PART.DATA_REG.INTEGRITY.

sec_cm_part_data_reg_bkgn_chk

Test: otp_ctrl_check_fail

Verify the countermeasure(s) PART.DATA_REG.BKGN_CHK.

sec_cm_part_mem_regren

Test: otp_ctrl_dai_lock

Verify the countermeasure(s) PART.MEM.REGREN.

sec_cm_part_mem_sw_unreadable

Test: otp_ctrl_dai_lock

Verify the countermeasure(s) PART.MEM.SW_UNREADABLE.

sec_cm_part_mem_sw_unwritable

Test: otp_ctrl_dai_lock

Verify the countermeasure(s) PART.MEM.SW_UNWRITABLE.

sec_cm_lc_part_mem_sw_noaccess

Test: otp_ctrl_dai_lock

Verify the countermeasure(s) LC_PART.MEM.SW_NOACCESS.

sec_cm_access_ctrl_mubi

Test: otp_ctrl_dai_lock

Verify the countermeasure(s) ACCESS.CTRL.MUBI.

sec_cm_token_valid_ctrl_mubi

Test: otp_ctrl_smoke

Verify the countermeasure(s) TOKEN_VALID.CTRL.MUBI.

sec_cm_lc_ctrl_intersig_mubi

Test: otp_ctrl_dai_lock

Verify the countermeasure(s) LC_CTRL.INTERSIG.MUBI.

sec_cm_test_bus_lc_gated

Test: otp_ctrl_smoke

Verify the countermeasure(s) TEST.BUS.LC_GATED.

sec_cm_test_tl_lc_gate_fsm_sparse

Test: otp_ctrl_sec_cm

Verify the countermeasure(s) TEST_TL_LC_GATE.FSM.SPARSE.

sec_cm_direct_access_config_regwen

Test: otp_ctrl_regwen

Verify the countermeasure(s) DIRECT_ACCESS.CONFIG.REGWEN.

sec_cm_check_trigger_config_regwen

Test: otp_ctrl_smoke

Verify the countermeasure(s) CHECK_TRIGGER.CONFIG.REGWEN.

sec_cm_check_config_regwen

Test: otp_ctrl_smoke

Verify the countermeasure(s) CHECK.CONFIG.REGWEN.

sec_cm_macro_mem_integrity

Test: otp_ctrl_macro_errs

Verify the countermeasure(s) MACRO.MEM.INTEGRITY.

sec_cm_macro_mem_cm

Test: N/A

Verify the countermeasure(s) MACRO.MEM.CM.

Stage V3 Testpoints

otp_ctrl_low_freq_read

Test: otp_ctrl_low_freq_read

This test checks if OTP’s read operation can operate successfully in a low clock frequency before the clock is calibrated.

Stimulus and Checks:

  • Configure OTP_CTRL’s clock to 6MHz low frequency.
  • Backdoor write OTP memory.
  • Use DAI access to read each memory address and compare if the value is correct.
  • If DAI address is in a SW partition, read and check again via TLUL interface.

stress_all_with_rand_reset

Test: otp_ctrl_stress_all_with_rand_reset

This test runs 3 parallel threads - stress_all, tl_errors and random reset. After reset is asserted, the test will read and check all valid CSR registers.

Covergroups

buf_err_code_cg

This is an array of covergroups to cover all applicable error codes in five buffered partitions.

csr_rd_after_alert_cg

Covers if the following CSRs are being read and the value is checked in scoreboard after any fatal alert is triggered:

  • unbuffered partitions’ digest CSRs
  • HW partition’s digest CSRs
  • secrets partitions’ digest CSRs
  • direct_access read data CSRs
  • status CSR
  • error_code CSR

dai_access_secret2_cg

Covers whether lc_creator_seed_sw_rw_en is On during any DAI accesses.

dai_err_code_cg

Covers all applicable error codes in DAI, and cross each error code with all 7 partitions.

dai_zeroize_cg

Covers DAI ZEROIZE commands crossed with partition (each zeroizable partition and a non-zeroizable partition), word type (data, digest, zeroization marker), write-lock state, read-lock state, the preceding DAI command (READ, WRITE, DIGEST, ZEROIZE, none since reset) and result (success, access error, macro error). Excluded: data, digest and marker word types on non-zeroizable partitions, and macro errors on rejected commands.

dai_zeroize_count_cg

Covers the set-bit count returned by ZEROIZE (64, at least ZeroizationValidBound but below 64, below ZeroizationValidBound) crossed with whether the command is a first attempt or a retry, and the outcome of the retry.

issue_checks_after_alert_cg

Covers if sequence issued various OTP_CTRL’s background checks after any fatal alert is triggered.

keymgr_field_entropy_o_cg

Covers whether the partition holding FIELD_ENTROPY is locked when scoreboard checks the keymgr_field_entropy_o value, crossed with whether lc_seed_hw_rd_en_i is On.

keymgr_o_cg

Covers the following conditions when scoreboard checks keymgr_o value:

  • whether secret2 partition is locked
  • whether lc_seed_hw_rd_en_i is On

keymgr_secondary_root_key_o_cg

Covers the following conditions when scoreboard checks the keymgr_secondary_root_key_o value:

  • whether the partition holding SECONDARY_ROOT_KEY_SHARE0/1 is locked
  • whether lc_seed_hw_rd_en_i is On

lc_esc_en_condition_cg

Covers the following conditions when lc_escalation_en is On:

  • whether any key requests is in progress
  • whether LC program request is in progress
  • whether DAI interface is busy

lc_prog_cg

Covers whether the error bit is set during LC program request.

lc_prog_req_condition_cg

Covers the following conditions when lc_escalation_en is On:

  • whether any key requests is in progress
  • whether DAI interface is busy
  • whether lc_esc_en is On

lci_err_code_cg

Covers all applicable error codes in LCI.

nvm_addr_req_condition_cg

Covers the following conditions when lc_escalation_en is On:

  • whether any key requests is in progress
  • whether DAI interface is busy
  • whether lc_esc_en is On

nvm_data_req_condition_cg

Covers the following conditions when lc_escalation_en is On:

  • whether any key requests is in progress
  • whether DAI interface is busy
  • whether lc_esc_en is On

nvm_req_cg

Covers whether secret1 partition is locked during nvm data or address request.

otbn_req_cg

Covers whether secret1 partition is locked during otbn key request.

otbn_req_condition_cg

Covers the following conditions when lc_escalation_en is On:

  • whether any key requests is in progress
  • whether DAI interface is busy
  • whether lc_esc_en is On

power_on_cg

Covers the following conditions when OTP_CTRL finishes power-on initialization:

  • whether lc_escalation_en is On
  • whether any partition (except life cycle partition) is locked

regwen_val_when_new_value_written_cg

Cover each lockable reg field with these 2 cases:

  • When regwen = 1, a different value is written to the lockable CSR field, and a read occurs after that.
  • When regwen = 0, a different value is written to the lockable CSR field, and a read occurs after that.

This is only applicable if the block contains regwen and locakable CSRs.

req_dai_access_after_alert_cg

Covers if sequence issued various DAI requests after any fatal alert is triggered.

sram_0_req_condition_cg

Covers the following conditions when lc_escalation_en is On:

  • whether any key requests is in progress
  • whether DAI interface is busy
  • whether lc_esc_en is On

sram_1_req_condition_cg

Covers the following conditions when lc_escalation_en is On:

  • whether any key requests is in progress
  • whether DAI interface is busy
  • whether lc_esc_en is On

sram_req_cg

Covers whether secret1 partition is locked during all srams key request.

status_csr_cg

Covers the value of every bit in status CSR.

tl_errors_cg

Cover the following error cases on TL-UL bus:

  • TL-UL protocol error cases.
  • OpenTitan defined error cases, refer to testpoint tl_d_illegal_access.

tl_intg_err_cg

Cover all kinds of integrity errors (command, data or both) and cover number of error bits on each integrity check.

Cover the kinds of integrity errors with byte enabled write on memory if applicable: Some memories store the integrity values. When there is a subword write, design re-calculate the integrity with full word data and update integrity in the memory. This coverage ensures that memory byte write has been issued and the related design logic has been verfied.

unbuf_access_lock_cg_wrap_cg

This is an array of covergroups to cover lock conditions below in three unbuffered partitions:

  • the partition is write-locked
  • the partition is read-locked
  • the current operation type Then cross the three coverpoints.

unbuf_err_code_cg

This is an array of covergroups to cover all applicable error codes in three unbuffered partitions.

zeroize_check_cg

Covers integrity and consistency check executions for zeroizable partitions in each zeroization state: not zeroized, zeroized in the current power cycle, zeroized at initialization. Also covers a consistency check that is in progress, or requested at the same time, when the digest word of the same partition is zeroized. Excluded: consistency checks on partitions zeroized in the current power cycle, which must not occur.

zeroize_interrupt_cg

Covers reset and lc_escalate_en assertion during a ZEROIZE command, crossed with the phase of the command (programming, read-back, response to the DAI) and the word type (data, digest, zeroization marker).

zeroize_lc_overlap_cg

Covers a ZEROIZE command overlapping a life cycle programming request: the zeroization in progress when the request arrives, the request in progress when the zeroization is issued, and both requested at the same time.

zeroize_marker_cg

Covers the set-bit count of the zeroization marker sampled at initialization for each zeroizable partition, with bins below, at and above ZeroizationValidBound, and the combination of zeroized partitions at initialization (none, each single partition, several, all).