Testplan

Testpoints

Stage V1 Testpoints

smoke

Test: keymgr_dpe_smoke

Smoke test exercises the base commands implemented in keymgr_dpe:

  • Advance
  • Versioned key generation (namely: Generate HW output and Generate SW output)
  • Erase
  • Disable

Stimulus:

  • Randomly select a destination slot x and issue an Advance operation (which should latch the root key into slot x). Update the SLOT_POLICY register field with the default root key policy i.e. allow_keygen=0, retain_parent=0, exportable=0, and allow_child=1.
  • Request another Advance operation for the same slot (due to retain_parent=0 of the root key slot). Set allow_child and allow_keygen policy bits to true. Randomly set retain_parent field. Use random values for HW / SW bindings.
  • If retain_parent policy of the previously advanced slot is true, then issue an erase command on a random selection.
  • To generate version keys for HW sideload ports, issue Generate HW Output command to a random dest_sel inside {AES, HMAC, KMAC, OTBN}.
  • To generate version keys for SW CSRs, issue Generate SW Output command. The results are going to be loaded in SW_SHARE0_OUTPUT and SW_SHARE1_OUTPUT.
  • Repeat the above steps a couple of times with randomly picking a valid parent slot. If retain_parent policy bit of the parent slot is true then randomly choose a different invalid child slot. Otherwise derive the secrets to the parent slot.
  • Issue the Disable command at the end which will wipe all the slots.
  • Wipe all the HW sideload key ports and SW_SHARE*_OUTPUT registers.

Checks:

  • Check INTR_STATE.op_done field to check the completion of the operation.
  • Check OP_STATUS.status field to see if the operation was successful.
  • Check DPE context in METADATA_HIGH register.
  • Verify the parent keys in the HW and the modeled slots are the same before an operation.
  • Check that the HW sideload key slots and SW_SHARE*_OUTPUT registers are updated correctly.
  • Before issuing Disable operation, check that the METADATA_* register fields for slots greater than or equal to NumInstHwSlot are read back to 0.
  • After the Disable operation, check that HW sideload and SW keys are preserved.

load_key_command

No Tests Implemented

Similar to smoke test but it also issues Load Root Key and Load Secondary Root Key commands.

Stimulus:

  • First follow the stimulus described in smoke test till step 5.
  • Then on a random selection, load either the root key or secondary root key and set the slot DPE context with default root policy bits.
  • Continue from step 6 in the stimulus list of the smoke test.

Checks: Same as smoke test.

random_commands

No Tests Implemented

Issue random commands to keymgr_dpe.

Stimulus:

  • Send random operations to keymgr_dpe in available state.
  • To request LOAD_KEY commands multiple times within the test, avoid setting the corresponding root key’s LOAD_KEY_LOCK registers.

Checks: Same as smoke test.

csr_hw_reset

Test: keymgr_dpe_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: keymgr_dpe_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: keymgr_dpe_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: keymgr_dpe_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: keymgr_dpe_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:

  • keymgr_dpe_csr_rw
  • keymgr_dpe_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.

Stage V2 Testpoints

csr_testing

No Tests Implemented

Check that keymgr_dpe performs the operations correctly based on the contents of a particular CSR.

Stimulus:

  • Randomly set the fields in ENFORCE_SW_BINDING and LOAD_*_LOCK registers.
  • If LOAD_*_LOCK and ENFORCE_SW_BINDING registers are set, then they are locked until the next reset. Write them when they are locked to check if the access is ignored.
  • Randomly set the fields in SIDELOAD_CLEAR, and RESEED_INTERVAL_SHADOWED registers.
  • Issue regular operations via random_commands test.
  • Keep on updating SIDELOAD_CLEAR, and RESEED_INTERVAL_SHADOWED registers after few operations.

Checks:

  • Check that the corresponding sideload port/s set in SIDELOAD_CLEAR.val are continuously cleared with entropy after the GENERATE_HW_OUTPUT.
  • Check that corresponding sideload ports, unset in SIDELOAD_CLEAR register are untouched.
  • Check that the HW bindings are suppressed when ENFORCE_SW_BINDING.enforce field is set.
  • Check that the LOAD_KEY operation is rejected when the corresponding LOADLOCK register is set. In this scenario, check ERR_CODE.invalid_op field is set and the fields in corresponding METADATA* registers are unchanged.
  • Check that a seed is requested after RESEED_INTERVAL_SHADOWED.val counter hits in keymgr_dpe.
  • Check that writes to LOAD_*_LOCK and ENFORCE_SW_BINDING registers are ignored once they are locked and their effect on an operation remains unchanged until reset.

regwen

No Tests Implemented

Verify that the registers gated by *REGWEN are wired up correctly. Also, the ones affecting the operation are unmodifiable once they are locked.

Stimulus:

  • Program and lock all the registers gated by *REGWEN registers.
  • During an operation, attempt to write them to verify that their accesses are blocked.
  • Randomly enable / disable the *REGWEN register and request accesses to their corresponding register

Checks:

  • Expect to see the registers either update their contents or ignore the access based on the respective *REGWEN.
  • Expect to see the participating registers in an operation are non-modifiable during that.
  • After an operation, check that the HW has released those registers and they are accessible again.

lc_disable

No Tests Implemented

Inject disable through life cycle control at random durations while running the random_commands test in parallel.

Checks:

  • Expect to see DEBUG.inactive_lc_en set.
  • Expect state to be INVALID in WORKING_STATE register.
  • Expect to see all the HW sideload ports, SW keys in SW_SHARE*_OUTPUT registers and all the slots wiped in an INVALID state.

stress_all

No Tests Implemented

  • Combine the non-error sequences (smoke, load_key_command, and random_commands) into a single test that runs them sequentially for multiple iterations.

invalid_hw_bindings

No Tests Implemented

Issue all-ones or all-zeros as HW binding or drive their valid bit low.

Stimulus:

  • Once the keymgr_dpe comes into an available state, request an Advance operation and do the following:
  • Drive all-ones, all-zeros, or combination of them as HW bindings for key derivation function.
  • Alternatively, drive the valid bit of any of the HW binding inputs to low.

Checks:

  • Check INTR_STATE.op_done field to check the completion of the operation.
  • Expect DEBUG register fields to trigger on invalid HW bindings.
  • Expect to see ERR_CODE.invalid_kmac_input.
  • Expect the contents of the slot to be unchanged.

invalid_sw_input

No Tests Implemented

Perform commands with invalid SW inputs.

Stimulus: Do the following to drive bad SW input.

  • Generate version key when KEY_VERSION > MAX_KEY_VERSION.
  • Derive a non-existing slot such that CONTROL_SHADOWED.slot_src_sel and CONTROL_SHADOWED.slot_dst_sel are greater than or equal to NumInstHwSlot parameter.
  • Send an undefined command.
  • Write CONTROL_SHADOWED.dest_sel with an undefined enumerated value.

Checks:

  • Expect to see ERR_CODE.invalid_op.

invalid_slot_operations

No Tests Implemented

Derive a key from an invalid slot to a valid slot.

Stimulus: To drive invalid slot operations, do the following:

  • Request an Advance operation from an invalid slot (when WORKING_STATE.state=AVAILABLE) or to a different valid slot or both.
  • Request a version key generation operation from an invalid slot.
  • Request an erase operation for an invalid slot.

Checks:

  • Check ERR_CODE.invalid_op field is set.
  • Verify that the METADATA_* registers fields and sideload HW / SW keys are unchanged.

invalid_parent_policy_operations

No Tests Implemented

The parent policy of a DPE context determines how the operation to derive the child would be carried out. Whether a parent slot can derive secrets, generate a version key, derive a secret to its own slot or a different slot, etc depends on the parent’s policy bits.

Stimulus: To request an operation that mismatches with the parent’s slot policy bits, do the following:

  • Request an Advance operation from a slot having policy bit allow_child=false.
  • Request a versioned key generation operation from a slot having policy bit allow_keygen=false.
  • Request an Advance operation for a different child slot with parent policy bit retain_parent=false.
  • Request an Advance operation for the same slot with parent policy bit retain_parent=true.

Checks:

  • Check ERR_CODE.invalid_op field is set.
  • Verify the METADATA_* register fields are unchanged.
  • Verify that the sideload ports and SW_SHARE*_OUTPUT registers are unchanged.

load_key_without_default_policy

No Tests Implemented

Perform the loading operation of root / secondary root key (either in reset or via load commands) without the default UDS policy bits and maximum key version. The slot policy fields in METADATA_HIGH and max_key_version field in METADATA_LOW register should not be updated by the non-default values written by SW.

Stimulus:

  • Write the SLOT_POLICY and MAX_KEY_VER_SHADOWED registers with non-default contents for root keys.

Checks:

  • Expect METADATA_HIGH.valid to be true, showing that the slot is valid.
  • Expect the METADATA_HIGH slot policy fields to return default root secret policy.
  • Expect the METADATA_LOW.max_key_version to return the default root secret maximum key version.

load_key_in_occupied_slot

No Tests Implemented

Attempt to reload the root or secondary root key into an occupied slot.

Stimulus:

  • Send Load Root / Secondary Root Key command and select a destination slot whose METADATA_HIGH*.valid field is true.

Checks:

  • Check ERR_CODE.invalid_op field is set.
  • Verify the METADATA_* register fields are unchanged.

lock_loading_key_command

No Tests Implemented

Attempt to load the root or secondary root key when their respective lock registers (LOAD_ROOT_KEY_LOCK and LOAD_SECONDARY_ROOT_KEY_LOCK) are set.

Stimulus:

  • Set the lock register, then attempt to issue the load command.

Checks:

  • Check ERR_CODE.invalid_op field is set.
  • Verify the METADATA_* register fields are unchanged.

invalid_root_key

No Tests Implemented

Verify keymgr_dpe behavior when either of the root keys contains all-zeros / all-ones or have their respective valid bits driven low in the HW when loading them. This should cover both scenarios of latching the root key when WORKING_STATE.state = RESET or reloading root / secondary root key via their respective commands in WORKING_STATE.state=AVAILABLE state.

Stimulus: To invalidate the root key, do the following:

  • Drive all-zeros / all-ones to the root key during the latching cycle or either of the root keys between a reloading operation.
  • Deassert the valid bit of either of the root keys.

Checks:

  • Expect to see DEBUG.invalid_root_key or DEBUG.invalid_secondary_root_key fields be set.
  • Verify the METADATA_* register fields are unchanged.
  • Check that WORKING_STATE.state reads back to INVALID.

kmac_error_response

No Tests Implemented

Verify keymgr_dpe behavior when an error response is received from KMAC after an operation.

Stimulus:

  • Assert the KMAC error signal while the KMAC output valid signal is high.
  • Alternatively, drive all-zeros or all-ones to the KMAC digest in KMAC response.

Checks:

  • Expect to see FAULT_STATUS.kmac_op and FAULT_STATUS.kmac_out field set.

debug_reg

No Tests Implemented

Perform operations that can trigger fields in the DEBUG register.

Stimulus: Stimulus could be anything that can set fields in the DEBUG register. Some of them are listed below:

  • Invalidate either of the root keys in HW so that their METADATA_HIGH.valid field reads back as zero.
  • Write invalid content in the root keys.
  • Disable LC control that will deactivate the keymgr_dpe block.
  • Send invalid HW bindings mentioned in “invalid_hw_bindings” testpoint.

Checks:

  • Check corresponding DEBUG register fields.
  • Check WORKING_STATE.state field in case of INVALID / DISABLED states.

err_code_reg

No Tests Implemented

Perform operations that can trigger fields in ERR_CODE register.

Stimulus: Stimulus could be anything that can set fields in the ERR_CODE register. Some of them are listed below:

  • Send an invalid operation. For example:
    • “invalid_parent_policy_operations” test.
    • “invalid_slot_operations” test.
    • requesting a versioned key generation from a root key slot.
    • Advance a slot having boot_stage<=2 with CONTROL_SHADOWED.sw_binding_only=0 when ENFORCE_SW_BINDING.enforce is set.
  • Send an invalid KMAC input. One example can be “invalid_hw_bindings” testpoint.
  • After an operation, overwrite a *shadowed register and expect to see ERR_CODE.invalid_shadow_update.
  • Issue operations when WORKING_STATE.state inside {RESET, DISABLED, INVALID}. Note that Advance operation in RESET state is acceptable.

Checks:

  • Expect to see the corresponding field in the ERR_CODE register be set.
  • For rejected operations, check that the METADATA_* register fields, and sideload HW / SW keys are unchanged.

fault_status_reg

No Tests Implemented

Perform operations in a way that will trigger synchronous and asynchronous fatal faults.

Stimulus: Stimulus could be anything that can set fields in the FAULT_STATUS register. Some of them are listed below:

  • Drive invalid data to KMAC, sideload control, reseed_counter and control FSM.
  • Drive register integrity and shadow copy errors.
  • Drive the reseed counter to a bad value.
  • Inject a METADATA ECC error.
  • Drive a non-onehot command to KMAC interface.
  • Drive bad response from KMAC.

Checks:

  • Check that the alert is triggered.
  • Check that corresponding fields in ERR_CODE and FAULT_STATUS registers are set.

intr_test

Test: keymgr_dpe_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: keymgr_dpe_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: keymgr_dpe_tl_errors

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

tl_d_illegal_access

Test: keymgr_dpe_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:

  • keymgr_dpe_csr_hw_reset
  • keymgr_dpe_csr_rw
  • keymgr_dpe_csr_aliasing
  • keymgr_dpe_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:

  • keymgr_dpe_csr_hw_reset
  • keymgr_dpe_csr_rw
  • keymgr_dpe_csr_aliasing
  • keymgr_dpe_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

tl_intg_err

Tests:

  • keymgr_dpe_tl_intg_err
  • keymgr_dpe_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

shadow_reg_update_error

Test: keymgr_dpe_shadow_reg_errors

Verify shadowed registers’ update error.

  • Randomly pick a shadowed register in the DUT.
  • Write it twice with different values.
  • Verify that the update error alert is triggered and the register value remains unchanged.
  • Verify the update_error status register field is set to 1.
  • Repeat the above steps a bunch of times.

shadow_reg_read_clear_staged_value

Test: keymgr_dpe_shadow_reg_errors

Verify reading a shadowed register will clear its staged value.

  • Randomly pick a shadowed register in the DUT.
  • Write it once and read it back to clear the staged value.
  • Then write it twice with the same new value (but different from the previous step).
  • Read it back to verify the new value and ensure that the update error alert did not trigger.
  • Verify the update_error status register field remains the same value.
  • Repeat the above steps a bunch of times.

shadow_reg_storage_error

Test: keymgr_dpe_shadow_reg_errors

Verify shadowed registers’ storage error.

  • Randomly pick a shadowed register in the DUT.
  • Backdoor write to shadowed or committed flops to create a storage fatal alert.
  • Check if fatal alert continuously fires until reset.
  • Verify that all other frontdoor write attempts are blocked during the storage error.
  • Verify that storage_error status register field is set to 1.
  • Reset the DUT.
  • Read all CSRs to ensure the DUT is properly reset.
  • Repeat the above steps a bunch of times.

shadowed_reset_glitch

Test: keymgr_dpe_shadow_reg_errors

Verify toggle shadowed_rst_n pin can trigger storage error.

  • Randomly drive shadowed_rst_n pin to low or rst_n pin to low.
  • check if any registers have been written before the reset. If so check if storage error fatal alert is triggered.
  • Check status register.
  • Drive shadowed_rst_n pin or rst_n pin back to high.
  • If fatal alert is triggered, reset the DUT.
  • Read all CSRs to ensure the DUT is properly reset.
  • Repeat the above steps a bunch of times.

shadow_reg_update_error_with_csr_rw

Test: keymgr_dpe_shadow_reg_errors_with_csr_rw

Run shadow_reg_update_error sequence in parallel with csr_rw sequence.

  • Randomly select one of the above sequences.
  • Apply csr_rw sequence in parallel but disable the csr_access_abort to ensure all shadowed registers’ write/read to be executed without aborting.
  • Repeat the above steps a bunch of times.

prim_count_check

Test: keymgr_dpe_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: keymgr_dpe_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

No Tests Implemented

Verify the countermeasure(s) BUS.INTEGRITY.

sec_cm_config_shadow

No Tests Implemented

Verify the countermeasure(s) CONFIG.SHADOW.

sec_cm_op_config_regwen

No Tests Implemented

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

sec_cm_reseed_config_regwen

No Tests Implemented

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

sec_cm_kdf_engine_config_regwen

No Tests Implemented

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

sec_cm_sw_binding_config_regwen

No Tests Implemented

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

sec_cm_max_key_ver_config_regwen

No Tests Implemented

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

sec_cm_slot_policy_config_regwen

No Tests Implemented

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

sec_cm_load_root_key_lock_ctrl_lock_mubi

No Tests Implemented

Verify the countermeasure(s) LOAD_ROOT_KEY_LOCK.CTRL.LOCK_MUBI.

sec_cm_load_secondary_root_key_lock_ctrl_lock_mubi

No Tests Implemented

Verify the countermeasure(s) LOAD_SECONDARY_ROOT_KEY_LOCK.CTRL.LOCK_MUBI.

sec_cm_enforce_sw_binding_ctrl_lock_mubi

No Tests Implemented

Verify the countermeasure(s) ENFORCE_SW_BINDING.CTRL.LOCK_MUBI.

sec_cm_kdf_engine_ctrl_mubi

No Tests Implemented

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

sec_cm_metadata_config_regren

No Tests Implemented

Verify the countermeasure(s) METADATA.CONFIG.REGREN.

sec_cm_lc_ctrl_intersig_mubi

No Tests Implemented

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

sec_cm_constants_consistency

No Tests Implemented

Verify the countermeasure(s) CONSTANTS.CONSISTENCY.

sec_cm_intersig_consistency

No Tests Implemented

Verify the countermeasure(s) INTERSIG.CONSISTENCY.

sec_cm_hw_key_sw_noaccess

No Tests Implemented

Verify the countermeasure(s) HW.KEY.SW_NOACCESS.

sec_cm_internal_key_sw_noaccess

No Tests Implemented

Verify the countermeasure(s) INTERNAL.KEY.SW_NOACCESS.

sec_cm_output_keys_ctrl_redun

No Tests Implemented

Verify the countermeasure(s) OUTPUT_KEYS.CTRL.REDUN.

sec_cm_ctrl_fsm_sparse

No Tests Implemented

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

sec_cm_data_fsm_sparse

No Tests Implemented

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

sec_cm_ctrl_fsm_local_esc

No Tests Implemented

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

sec_cm_ctrl_fsm_consistency

No Tests Implemented

Verify the countermeasure(s) CTRL.FSM.CONSISTENCY.

sec_cm_ctrl_fsm_global_esc

No Tests Implemented

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

sec_cm_ctrl_ctr_redun

No Tests Implemented

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

sec_cm_kmac_if_fsm_sparse

No Tests Implemented

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

sec_cm_kmac_if_ctr_redun

No Tests Implemented

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

sec_cm_kmac_if_cmd_ctrl_consistency

No Tests Implemented

Verify the countermeasure(s) KMAC_IF_CMD.CTRL.CONSISTENCY.

sec_cm_kmac_if_done_ctrl_consistency

No Tests Implemented

Verify the countermeasure(s) KMAC_IF_DONE.CTRL.CONSISTENCY.

sec_cm_reseed_ctr_redun

No Tests Implemented

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

sec_cm_side_load_sel_ctrl_consistency

No Tests Implemented

Verify the countermeasure(s) SIDE_LOAD_SEL.CTRL.CONSISTENCY.

sec_cm_sideload_ctrl_fsm_sparse

No Tests Implemented

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

sec_cm_ctrl_key_integrity

No Tests Implemented

Verify the countermeasure(s) CTRL.KEY.INTEGRITY.

Stage V3 Testpoints

stress_all_with_rand_reset

Test: keymgr_dpe_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

debug_cg

  • Cover all DEBUG register fields.
  • Sampled when DEBUG is read.

enforce_sw_bindings_cg

  • Covers an Advance operation that uses SW bindings only as input messages for KMAC key derivation function.
  • Cross with Advance operation, CONTROL_SHADOWED.sw_binding_only and all boot stages.

err_code_cg

  • Cover all ERR_CODE register fields.
  • Sampled when ERR_CODE register is read.

fault_status_cg

  • Cover all FAULT_STATUS register fields.
  • Sampled when FAULT_STATUS is read.

invalid_allow_child_cg

  • Cover advancing a valid slot with METADATA_HIGH*.allow_child_policy = false.

invalid_allow_keygen_cg

  • Issue Generate HW / SW Output commands from a valid slot with METADATA_HIGH*.allow_keygen_policy = false.

invalid_hw_bindings_cg

  • Cover all ones/zeros on the creator root and secondary root keys, ROM digest, creator and owner seeds, and device id.
  • Cover the scenario when their valid input is low.
  • Cross it with the Advance, Generate HW Output and Generate SW Output operations that use HW bindings for key derivation.

invalid_kmac_command_cg

On KMAC interface, the commands issued by keymgr_dpe are onehot encoded. Send a non-onehot command to KMAC interface inside keymgr_dpe.

invalid_retain_parent_cg

  • Cover advancing a valid slot with METADATA_HIGH*.retain_parent_policy field true / false.
  • Cross it with CONTROL_SHADOWED.SLOT_SRC_SEL == CONTROL_SHADOWED.SLOT_DST_SEL when retain_parent field is set and vice versa.

invalid_root_key_cg

  • Cover the root keys (both root and secondary root) with either containing all-zeros / all-ones or their respective valid bit is low.
  • Cross it with WORKING_STATE.state inside {RESET, AVAILABLE} and operations inside {Advance, Load Root Key, Load Secondary Root Key}.

invalid_slot_op_cg

  • Cover scenarios where an operation uses an invalid parent slot or valid child slot (when retain_parent=true).
  • Cross it with every operation.

invalid_sw_input_cg

Write SW registers such as CONTROL_SHADOWED, MAX_KEY_VER_SHADOWED, KEY_VERSION, and SLOT_POLICY with invalid contents. Example:

  • Generating version key when KEY_VERSION > MAX_KEY_VERSION.
  • CONTROL_SHADOWED.slot_src_sel / CONTROL_SHADOWED.slot_dst_sel >= NumInstHwSlot.
  • Set an invalid operation in CONTROL_SHADOWED.operation.
  • Set SLOT_POLICY fields with invalid contents.
  • Write CONTROL_SHADOWED.dest_sel with undefined enumerated value.

key_version_compare_cg

  • Cover all comparison outcomes (equal, less than, greater than) between KEY_VERSION and the MAX_KEY_VERSION.
  • Crossed with Generate HW Output and Generate SW Output commands.

kmac_err_rsp_cg

Cover a scenario where KMAC responds with an error that will trigger kmac fields in ERR_CODE and FAULT_STATUS registers. Cross it with Advance, Generate HW Output and Generate SW Output commands.

lc_disable_cg

  • Cover LC disable events during each operation type.
  • Sample when LC disables keymgr_dpe.

load_key_with_lock_cg

Load Root / Secondary Root Key when their respective *LOCK.lock register field is set.

non_existing_slot_cg

  • Cover a scenario where CONTROL_SHADOWED.slot_src_sel or CONTROL_SHADOWED.slot_dst_sel or both are greater than or equal to NumInstHwSlot parameter.
  • Cross with each operation.

operation_cg

  • Cover all operations crossed with all slots picked as source and destination, all boot stages included, slot policy bits set with both true / false values, and all working states.
  • Generate versioned key for all the HW sideload ports crossed with CONTROL_SHADOWED.dest_sel.
  • Sample with both DONE_SUCCESS and DONE_ERROR statuses in OP_STATUS.status.
  • Sample once each operation completes.

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.

reseed_interval_cg

  • Cover small intervals to issue frequent requests for a new entropy seed.
  • Cover values between small, medium, and high ranges.

shadow_field_errs_cg

Cover all shadow register errors for each register field.

For all register fields within the shadowed register, this coverpoint covers the following errors:

  • Update error
  • Storage error

sideload_clear_cg

  • Cover all possible values for SIDELOAD_CLEAR.val used after versioned key generation for HW.
  • Cross it with the list of enumerated values outside the allowed list to see if all the sideload ports are continuously cleared.
  • Cross with every combination of sideload interface (AES, HMAC, KMAC, OTBN).
  • Cross it with both WORKING_STATE.state inside {AVAILABLE, DISABLED} (In DISABLED state, the SW and sideload keys are preserved).
  • Sample after Generate HW Output operation for HW.

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.

wipe_keys_cg

  • Covers that the SW keys in SW_SHARE*_OUTPUT registers and sideload ports are wiped (with entropy) only in invalid state.
  • Cross it with WORKING_STATE.state inside {DISABLED, INVALID}.
  • Sample it only when the slot was valid before Disable or Invalid state.

wipe_slots_only_cg

  • Covers that all the slots are wiped but SW keys in SW_SHARE*_OUTPUT registers and sideload ports are preserved in DISABLED state.
  • Cross it with WORKING_STATE.state inside {DISABLED, INVALID}.
  • Sample it only when the slot was valid before Disable or Invalid state.