5 #include "sw/device/lib/testing/lc_ctrl_testutils.h"
11 #include "sw/device/lib/testing/test_framework/check.h"
16 LOG_INFO(
"Life cycle state: TEST_UNLOCKED0");
19 LOG_INFO(
"Life cycle state: TEST_UNLOCKED1");
22 LOG_INFO(
"Life cycle state: TEST_UNLOCKED2");
25 LOG_INFO(
"Life cycle state: TEST_UNLOCKED3");
28 LOG_INFO(
"Life cycle state: TEST_UNLOCKED4");
31 LOG_INFO(
"Life cycle state: TEST_UNLOCKED5");
34 LOG_INFO(
"Life cycle state: TEST_UNLOCKED6");
37 LOG_INFO(
"Life cycle state: TEST_UNLOCKED7");
46 LOG_INFO(
"Life cycle state: PROD_END");
52 LOG_ERROR(
"CPU is executing in locked/invalid life cycle state: %d",
54 return FAILED_PRECONDITION();
59 status_t lc_ctrl_testutils_debug_func_enabled(
const dif_lc_ctrl_t *lc_ctrl,
60 bool *debug_enabled) {
75 *debug_enabled =
true;
78 *debug_enabled =
false;
84 status_t lc_ctrl_testutils_check_transition_count(
const dif_lc_ctrl_t *lc_ctrl,
85 uint8_t exp_lc_count) {
86 LOG_INFO(
"Read LC count and check with expect_val=%d", exp_lc_count);
89 TRY_CHECK(lc_count == exp_lc_count,
90 "LC_count error, expected %d but actual count is %d", exp_lc_count,
95 status_t lc_ctrl_testutils_check_lc_state(
const dif_lc_ctrl_t *lc_ctrl,
97 LOG_INFO(
"Read LC state and check with expect_state=%d", exp_lc_state);
100 TRY_CHECK(lc_state == exp_lc_state,
101 "LC_state error, expected %d but actual state is %d", exp_lc_state,
106 status_t lc_ctrl_testutils_operational_state_check(
107 const dif_lc_ctrl_t *lc_ctrl) {
114 return FAILED_PRECONDITION();