Entity: lc_ctrl_fsm

Diagram

lc_keymgr_div_t RndCnstLcKeymgrDivInvalid lc_keymgr_div_t RndCnstLcKeymgrDivTestDevRma lc_keymgr_div_t RndCnstLcKeymgrDivProduction clk_i rst_ni init_req_i esc_scrap_state0_i esc_scrap_state1_i lc_state_valid_i lc_state_e lc_state_i lc_cnt_e lc_cnt_i lc_tx_t secrets_valid_i use_ext_clock_i lc_token_t test_unlock_token_i lc_token_t test_exit_token_i lc_tx_t test_tokens_valid_i lc_token_t rma_token_i lc_tx_t rma_token_valid_i trans_cmd_i dec_lc_state_e trans_target_i token_hash_ack_i token_hash_err_i lc_token_t hashed_token_i otp_prog_ack_i otp_prog_err_i lc_tx_t lc_clk_byp_ack_i lc_tx_t lc_flash_rma_ack_i init_done_o idle_o dec_lc_state_e dec_lc_state_o dec_lc_cnt_t dec_lc_cnt_o dec_lc_id_state_e dec_lc_id_state_o token_hash_req_o token_hash_req_chk_o otp_prog_req_o lc_state_e otp_prog_lc_state_o lc_cnt_e otp_prog_lc_cnt_o trans_success_o trans_cnt_oflw_error_o trans_invalid_error_o token_invalid_error_o flash_rma_error_o otp_prog_error_o state_invalid_error_o lc_tx_t lc_raw_test_rma_o lc_tx_t lc_dft_en_o lc_tx_t lc_nvm_debug_en_o lc_tx_t lc_hw_debug_en_o lc_tx_t lc_cpu_en_o lc_tx_t lc_creator_seed_sw_rw_en_o lc_tx_t lc_owner_seed_sw_rw_en_o lc_tx_t lc_iso_part_sw_rd_en_o lc_tx_t lc_iso_part_sw_wr_en_o lc_tx_t lc_seed_hw_rd_en_o lc_tx_t lc_keymgr_en_o lc_tx_t lc_escalate_en_o lc_tx_t lc_check_byp_en_o lc_tx_t lc_clk_byp_req_o lc_tx_t lc_flash_rma_req_o lc_keymgr_div_t lc_keymgr_div_o

Description

Copyright lowRISC contributors. Licensed under the Apache License, Version 2.0, see LICENSE for details. SPDX-License-Identifier: Apache-2.0

Main Life Cycle Controller FSM.

Generics

Generic name Type Value Description
RndCnstLcKeymgrDivInvalid lc_keymgr_div_t LcKeymgrDivWidth'(0) Random netlist constants
RndCnstLcKeymgrDivTestDevRma lc_keymgr_div_t LcKeymgrDivWidth'(1)
RndCnstLcKeymgrDivProduction lc_keymgr_div_t LcKeymgrDivWidth'(2)

Ports

Port name Direction Type Description
clk_i input This module is combinational, but we need the clock and reset for the assertions.
rst_ni input
init_req_i input Initialization request from power manager.
init_done_o output
idle_o output
esc_scrap_state0_i input Escalatio input
esc_scrap_state1_i input
lc_state_valid_i input Life cycle state vector from OTP.
lc_state_i input lc_state_e
lc_cnt_i input lc_cnt_e
secrets_valid_i input lc_tx_t
use_ext_clock_i input Defines whether we switch to an external clock when initiating a transition.
test_unlock_token_i input lc_token_t Token input from OTP (these are all hash post-images).
test_exit_token_i input lc_token_t
test_tokens_valid_i input lc_tx_t
rma_token_i input lc_token_t
rma_token_valid_i input lc_tx_t
trans_cmd_i input Transition trigger interface.
trans_target_i input dec_lc_state_e
dec_lc_state_o output dec_lc_state_e Decoded life cycle state for CSRs.
dec_lc_cnt_o output dec_lc_cnt_t
dec_lc_id_state_o output dec_lc_id_state_e
token_hash_req_o output Token hashing interface
token_hash_req_chk_o output
token_hash_ack_i input
token_hash_err_i input
hashed_token_i input lc_token_t
otp_prog_req_o output OTP programming interface
otp_prog_lc_state_o output lc_state_e
otp_prog_lc_cnt_o output lc_cnt_e
otp_prog_ack_i input
otp_prog_err_i input
trans_success_o output Error outputs going to CSRs
trans_cnt_oflw_error_o output
trans_invalid_error_o output
token_invalid_error_o output
flash_rma_error_o output
otp_prog_error_o output
state_invalid_error_o output
lc_raw_test_rma_o output lc_tx_t Local life cycle signal
lc_dft_en_o output lc_tx_t Life cycle broadcast outputs.
lc_nvm_debug_en_o output lc_tx_t
lc_hw_debug_en_o output lc_tx_t
lc_cpu_en_o output lc_tx_t
lc_creator_seed_sw_rw_en_o output lc_tx_t
lc_owner_seed_sw_rw_en_o output lc_tx_t
lc_iso_part_sw_rd_en_o output lc_tx_t
lc_iso_part_sw_wr_en_o output lc_tx_t
lc_seed_hw_rd_en_o output lc_tx_t
lc_keymgr_en_o output lc_tx_t
lc_escalate_en_o output lc_tx_t
lc_check_byp_en_o output lc_tx_t
lc_clk_byp_req_o output lc_tx_t Request and feedback to/from clock manager and AST.
lc_clk_byp_ack_i input lc_tx_t
lc_flash_rma_req_o output lc_tx_t Request and feedback to/from flash controller
lc_flash_rma_ack_i input lc_tx_t
lc_keymgr_div_o output lc_keymgr_div_t State group diversification value for keymgr

Signals

Name Type Description
lc_clk_byp_ack lc_tx_t [2:0] /////////////////////////// Synchronizers / Buffers // /////////////////////////// We use multiple copies of these signals in the FSM checks below.
lc_flash_rma_ack lc_tx_t [1:0]
fsm_state_d fsm_state_e
fsm_state_q fsm_state_e
lc_state_valid_d logic Continuously feed in valid signal for LC state.
lc_state_valid_q logic Continuously feed in valid signal for LC state.
lc_state_d lc_state_e
lc_state_q lc_state_e
next_lc_state lc_state_e
lc_cnt_d lc_cnt_e
lc_cnt_q lc_cnt_e
next_lc_cnt lc_cnt_e
lc_clk_byp_req lc_tx_t
lc_flash_rma_req lc_tx_t
lc_check_byp_en lc_tx_t
hashed_token_valid_mux logic Hashed token to compare against.
hashed_token_mux lc_token_t
state_invalid_error logic [5:0] Multibit state error from state decoder
fsm_state_raw_q logic [FsmStateWidth-1:0] /////////////// State Flops // /////////////// This primitive is used to place a size-only constraint on the flops in order to prevent FSM state encoding optimizations.
lc_state_raw_q logic [LcStateWidth-1:0]
lc_cnt_raw_q logic [LcCountWidth-1:0]
hashed_tokens lc_token_t [2**TokenIdxWidth-1:0] ///////////// Token mux // ///////////// This indexes the correct token, based on the transition arc. Note that we always perform a token comparison, even in case of unconditional transitions. In the case of unconditional tokens we just pass an all-zero constant through the hashing function.
hashed_tokens_valid logic [2**TokenIdxWidth-1:0]
token_idx logic [TokenIdxWidth-1:0]

Processes

Type: always_comb

Type: always_ff

Type: always_comb

Instantiations

Description
//////////////////////////////////////////////////////////////////
Decoding and transition logic for redundantly encoded LC state //
//////////////////////////////////////////////////////////////////
This decodes the state into a format that can be exposed in the CSRs,
and flags any errors in the state encoding. Errors will move the
main FSM into INVALID right away.

Description
LC transition checker logic and next state generation.

Description
LC signal decoder and broadcasting logic.

Description
Conditional signals set by main FSM.