| # Copyright 2023 Google LLC. | 
 | # Copyright lowRISC contributors. | 
 | # Licensed under the Apache License, Version 2.0, see LICENSE for details. | 
 | # SPDX-License-Identifier: Apache-2.0 | 
 |  | 
 | load("//rules:matcha_test.bzl", "matcha_dv_test") | 
 |  | 
 | matcha_dv_test( | 
 |     name = "uart_tx_rx_test", | 
 |     srcs = ["uart_tx_rx_test.c"], | 
 |     deps = [ | 
 |         "//sw/device/lib/dif:clkmgr", | 
 |         "//sw/device/lib/dif:pinmux", | 
 |         "//sw/device/lib/dif:rv_plic_sec", | 
 |         "//sw/device/lib/testing:clkmgr_testutils", | 
 |         "//sw/device/tests:test_dv_lib", | 
 |         "@lowrisc_opentitan//hw/ip/lc_ctrl/data:lc_ctrl_regs", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:lc_ctrl", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:uart", | 
 |     ], | 
 | ) | 
 |  | 
 | matcha_dv_test( | 
 |     name = "rv_dm_ndm_reset_req", | 
 |     srcs = ["rv_dm_ndm_reset_req.c"], | 
 |     deps = [ | 
 |         "//sw/device/lib/dif:pinmux", | 
 |         "//sw/device/lib/dif:rstmgr", | 
 |         "//sw/device/tests:test_dv_lib", | 
 |         "@lowrisc_opentitan//hw/ip/adc_ctrl/data:adc_ctrl_regs", | 
 |         "@lowrisc_opentitan//hw/ip/flash_ctrl/data:flash_ctrl_regs", | 
 |         "@lowrisc_opentitan//hw/ip/keymgr/data:keymgr_regs", | 
 |         "@lowrisc_opentitan//hw/ip/otp_ctrl/data:otp_ctrl_regs", | 
 |         "@lowrisc_opentitan//hw/ip/sysrst_ctrl/data:sysrst_ctrl_regs", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:adc_ctrl", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:flash_ctrl", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:keymgr", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:otp_ctrl", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:sysrst_ctrl", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:rstmgr_testutils", | 
 |     ], | 
 | ) | 
 |  | 
 | matcha_dv_test( | 
 |     name = "i2c_host_tx_rx_test", | 
 |     srcs = ["i2c_host_tx_rx_test.c"], | 
 |     deps = [ | 
 |         "//sw/device/lib/dif:pinmux", | 
 |         "//sw/device/lib/dif:rstmgr", | 
 |         "//sw/device/lib/testing:i2c_testutils", | 
 |         "//sw/device/lib/testing:isr_testutils", | 
 |         "//sw/device/tests:test_dv_lib", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:i2c", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:rand_testutils", | 
 |     ], | 
 | ) | 
 |  | 
 | cc_library( | 
 |     name = "pwrmgr_reset_test_lib", | 
 |     deps = [ | 
 |         "//sw/device/lib/dif:alert_handler", | 
 |         "//sw/device/lib/dif:pinmux", | 
 |         "//sw/device/lib/dif:rstmgr", | 
 |         "//sw/device/lib/dif:rv_plic_sec", | 
 |         "//sw/device/lib/testing:alert_handler_testutils", | 
 |         "//sw/device/lib/testing:pinmux_testutils", | 
 |         "//sw/device/tests:test_dv_lib", | 
 |         "@lowrisc_opentitan//sw/device/lib/base:abs_mmio", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:aon_timer", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:flash_ctrl", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:pwrmgr", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:rv_timer", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:sysrst_ctrl", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:aon_timer_testutils", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:flash_ctrl_testutils", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:pwrmgr_testutils", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:rstmgr_testutils", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:rv_plic_testutils", | 
 |     ], | 
 | ) | 
 |  | 
 | matcha_dv_test( | 
 |     name = "pwrmgr_random_sleep_all_reset_reqs_test", | 
 |     srcs = ["pwrmgr_random_sleep_all_reset_reqs_test.c"], | 
 |     deps = [ | 
 |         ":pwrmgr_reset_test_lib", | 
 |     ], | 
 | ) | 
 |  | 
 | matcha_dv_test( | 
 |     name = "pwrmgr_deep_sleep_all_reset_reqs_test", | 
 |     srcs = ["pwrmgr_deep_sleep_all_reset_reqs_test.c"], | 
 |     deps = [ | 
 |         ":pwrmgr_reset_test_lib", | 
 |     ], | 
 | ) | 
 |  | 
 | matcha_dv_test( | 
 |     name = "pwrmgr_normal_sleep_all_reset_reqs_test", | 
 |     srcs = ["pwrmgr_normal_sleep_all_reset_reqs_test.c"], | 
 |     deps = [ | 
 |         ":pwrmgr_reset_test_lib", | 
 |     ], | 
 | ) | 
 |  | 
 | matcha_dv_test( | 
 |     name = "pwrmgr_random_sleep_power_glitch_reset_test", | 
 |     srcs = ["pwrmgr_random_sleep_power_glitch_reset_test.c"], | 
 |     deps = [ | 
 |         ":pwrmgr_reset_test_lib", | 
 |     ], | 
 | ) | 
 |  | 
 | matcha_dv_test( | 
 |     name = "pwrmgr_b2b_sleep_reset_test", | 
 |     srcs = ["pwrmgr_b2b_sleep_reset_test.c"], | 
 |     deps = [ | 
 |         ":pwrmgr_reset_test_lib", | 
 |     ], | 
 | ) | 
 |  | 
 | cc_library( | 
 |     name = "pwrmgr_sleep_all_wake_ups_impl", | 
 |     srcs = [ | 
 |         "pwrmgr_sleep_all_wake_ups_impl.c", | 
 |         "pwrmgr_sleep_all_wake_ups_impl.h", | 
 |     ], | 
 |     deps = [ | 
 |         "//sw/device/lib/dif:pinmux", | 
 |         "//sw/device/lib/dif:rv_plic_sec", | 
 |         "//sw/device/lib/testing:isr_testutils", | 
 |         "//sw/device/tests:test_dv_lib", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:adc_ctrl", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:pwrmgr", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:sensor_ctrl", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:usbdev", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:aon_timer_testutils", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:flash_ctrl_testutils", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:pwrmgr_testutils", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:rv_plic_testutils", | 
 |     ], | 
 | ) | 
 |  | 
 | matcha_dv_test( | 
 |     name = "pwrmgr_normal_sleep_all_wake_ups", | 
 |     srcs = ["pwrmgr_normal_sleep_all_wake_ups.c"], | 
 |     deps = [ | 
 |         ":pwrmgr_sleep_all_wake_ups_impl", | 
 |     ], | 
 | ) | 
 |  | 
 | matcha_dv_test( | 
 |     name = "pwrmgr_deep_sleep_all_wake_ups", | 
 |     srcs = ["pwrmgr_deep_sleep_all_wake_ups.c"], | 
 |     deps = [ | 
 |         ":pwrmgr_sleep_all_wake_ups_impl", | 
 |     ], | 
 | ) | 
 |  | 
 | matcha_dv_test( | 
 |     name = "pwrmgr_random_sleep_all_wake_ups", | 
 |     srcs = ["pwrmgr_random_sleep_all_wake_ups.c"], | 
 |     deps = [ | 
 |         ":pwrmgr_sleep_all_wake_ups_impl", | 
 |     ], | 
 | ) | 
 |  | 
 | matcha_dv_test( | 
 |     name = "ast_clk_rst_inputs", | 
 |     srcs = ["ast_clk_rst_inputs.c"], | 
 |     deps = [ | 
 |         "//sw/device/lib/dif:alert_handler", | 
 |         "//sw/device/lib/dif:clkmgr", | 
 |         "//sw/device/lib/dif:rstmgr", | 
 |         "//sw/device/lib/dif:rv_plic_sec", | 
 |         "//sw/device/lib/testing:alert_handler_testutils", | 
 |         "//sw/device/lib/testing:clkmgr_testutils", | 
 |         "//sw/device/lib/testing:isr_testutils", | 
 |         "//sw/device/tests:test_dv_lib", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:aon_timer", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:entropy_src", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:pwrmgr", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:sensor_ctrl", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:aon_timer_testutils", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:pwrmgr_testutils", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:rstmgr_testutils", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:rv_plic_testutils", | 
 |     ], | 
 | ) | 
 |  | 
 | matcha_dv_test( | 
 |     name = "spi_host_tx_rx_test", | 
 |     srcs = ["spi_host_tx_rx_test.c"], | 
 |     deps = [ | 
 |         "//sw/device/lib/dif:pinmux", | 
 |         "//sw/device/lib/testing:pinmux_testutils", | 
 |         "//sw/device/tests:test_dv_lib", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:spi_host", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:rand_testutils", | 
 |     ], | 
 | ) | 
 |  | 
 | matcha_dv_test( | 
 |     name = "spi_passthrough_test", | 
 |     srcs = ["spi_passthrough_test.c"], | 
 |     deps = [ | 
 |         "//sw/device/lib/dif:pinmux", | 
 |         "//sw/device/lib/dif:rv_plic_sec", | 
 |         "//sw/device/lib/testing:pinmux_testutils", | 
 |         "//sw/device/tests:test_dv_lib", | 
 |         "@lowrisc_opentitan//sw/device/lib/base:bitfield", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:spi_device", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:spi_host", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:spi_device_testutils", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:spi_flash_testutils", | 
 |     ], | 
 | ) | 
 |  | 
 | cc_library( | 
 |     name = "sleep_pin_test_lib", | 
 |     deps = [ | 
 |         "//sw/device/lib/dif:pinmux", | 
 |         "//sw/device/lib/dif:rv_plic_sec", | 
 |         "//sw/device/lib/testing:isr_testutils", | 
 |         "//sw/device/tests:test_dv_lib", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:pwrmgr", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:pwrmgr_testutils", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:rand_testutils", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:rv_plic_testutils", | 
 |     ], | 
 | ) | 
 |  | 
 | matcha_dv_test( | 
 |     name = "sleep_pin_mio_dio_val_test", | 
 |     srcs = ["sleep_pin_mio_dio_val_test.c"], | 
 |     deps = [ | 
 |         ":sleep_pin_test_lib", | 
 |     ], | 
 | ) | 
 |  | 
 | matcha_dv_test( | 
 |     name = "sleep_pin_wake_test", | 
 |     srcs = ["sleep_pin_wake_test.c"], | 
 |     deps = [ | 
 |         ":sleep_pin_test_lib", | 
 |     ], | 
 | ) | 
 |  | 
 | matcha_dv_test( | 
 |     name = "sleep_pin_retention_test", | 
 |     srcs = ["sleep_pin_retention_test.c"], | 
 |     deps = [ | 
 |         ":sleep_pin_test_lib", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:gpio", | 
 |     ], | 
 | ) | 
 |  | 
 | cc_library( | 
 |     name = "sysrst_ctrl_test_lib", | 
 |     deps = [ | 
 |         "//sw/device/lib/dif:pinmux", | 
 |         "//sw/device/tests:test_dv_lib", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:sysrst_ctrl", | 
 |     ], | 
 | ) | 
 |  | 
 | matcha_dv_test( | 
 |     name = "sysrst_ctrl_inputs_test", | 
 |     srcs = ["sysrst_ctrl_inputs_test.c"], | 
 |     deps = [ | 
 |         ":sysrst_ctrl_test_lib", | 
 |     ], | 
 | ) | 
 |  | 
 | matcha_dv_test( | 
 |     name = "sysrst_ctrl_in_irq_test", | 
 |     srcs = ["sysrst_ctrl_in_irq_test.c"], | 
 |     deps = [ | 
 |         ":sysrst_ctrl_test_lib", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:rv_plic_testutils", | 
 |     ], | 
 | ) | 
 |  | 
 | matcha_dv_test( | 
 |     name = "sysrst_ctrl_ulp_z3_wakeup_test", | 
 |     srcs = ["sysrst_ctrl_ulp_z3_wakeup_test.c"], | 
 |     deps = [ | 
 |         ":sysrst_ctrl_test_lib", | 
 |         "//sw/device/lib/dif:rstmgr", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:pwrmgr", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:flash_ctrl_testutils", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:pwrmgr_testutils", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:rstmgr_testutils", | 
 |     ], | 
 | ) | 
 |  | 
 | matcha_dv_test( | 
 |     name = "sysrst_ctrl_reset_test", | 
 |     srcs = ["sysrst_ctrl_reset_test.c"], | 
 |     deps = [ | 
 |         ":sysrst_ctrl_test_lib", | 
 |         "//sw/device/lib/dif:rstmgr", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:pwrmgr", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:pwrmgr_testutils", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:rstmgr_testutils", | 
 |     ], | 
 | ) | 
 |  | 
 | matcha_dv_test( | 
 |     name = "sysrst_ctrl_outputs_test", | 
 |     srcs = ["sysrst_ctrl_outputs_test.c"], | 
 |     deps = [ | 
 |         ":sysrst_ctrl_test_lib", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:flash_ctrl_testutils", | 
 |     ], | 
 | ) | 
 |  | 
 | matcha_dv_test( | 
 |     name = "rv_dm_access_after_wakeup", | 
 |     srcs = ["rv_dm_access_after_wakeup.c"], | 
 |     deps = [ | 
 |         "//sw/device/lib/dif:alert_handler", | 
 |         "//sw/device/lib/dif:pinmux", | 
 |         "//sw/device/lib/dif:rstmgr", | 
 |         "//sw/device/lib/dif:rv_plic_sec", | 
 |         "//sw/device/lib/testing:alert_handler_testutils", | 
 |         "//sw/device/lib/testing:pinmux_testutils", | 
 |         "//sw/device/tests:test_dv_lib", | 
 |         "@lowrisc_opentitan//sw/device/lib/base:abs_mmio", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:aon_timer", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:flash_ctrl", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:pwrmgr", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:rv_timer", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:sysrst_ctrl", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:aon_timer_testutils", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:flash_ctrl_testutils", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:pwrmgr_testutils", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:rstmgr_testutils", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:rv_plic_testutils", | 
 |     ], | 
 | ) | 
 |  | 
 | matcha_dv_test( | 
 |     name = "pwrmgr_sysrst_ctrl_test", | 
 |     srcs = ["pwrmgr_sysrst_ctrl_test.c"], | 
 |     deps = [ | 
 |         "//sw/device/lib/dif:pinmux", | 
 |         "//sw/device/lib/dif:rstmgr", | 
 |         "//sw/device/lib/testing:pinmux_testutils", | 
 |         "//sw/device/tests:test_dv_lib", | 
 |         "@lowrisc_opentitan//sw/device/lib/base:abs_mmio", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:aon_timer", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:flash_ctrl", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:pwrmgr", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:sysrst_ctrl", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:aon_timer_testutils", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:flash_ctrl_testutils", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:pwrmgr_testutils", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:rstmgr_testutils", | 
 |     ], | 
 | ) | 
 |  | 
 | matcha_dv_test( | 
 |     name = "data_integrity_escalation_reset_test", | 
 |     srcs = ["@lowrisc_opentitan//sw/device/tests/sim_dv:data_integrity_escalation_reset_test.c"], | 
 |     copts = [ | 
 |         # Mask the code error from OT source | 
 |         "-Wno-unused-variable", | 
 |     ], | 
 |     deps = [ | 
 |         "//sw/device/lib/dif:alert_handler", | 
 |         "//sw/device/lib/dif:rstmgr", | 
 |         "//sw/device/lib/dif:rv_plic_sec", | 
 |         "//sw/device/tests:test_dv_lib_opentitan", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:aon_timer", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:flash_ctrl", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:rv_core_ibex", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:sram_ctrl", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:alert_handler_testutils", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:aon_timer_testutils", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:flash_ctrl_testutils", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:rstmgr_testutils", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:rv_plic_testutils", | 
 |     ], | 
 | ) | 
 |  | 
 | matcha_dv_test( | 
 |     name = "i2c_device_tx_rx_test", | 
 |     srcs = ["i2c_device_tx_rx_test.c"], | 
 |     deps = [ | 
 |         "//hw/top_matcha:clkmgr_regs", | 
 |         "//sw/device/lib/dif:pinmux", | 
 |         "//sw/device/lib/dif:rv_plic_sec", | 
 |         "//sw/device/lib/testing:i2c_testutils", | 
 |         "//sw/device/lib/testing:isr_testutils", | 
 |         "//sw/device/tests:test_dv_lib", | 
 |         "@lowrisc_opentitan//hw/ip/lc_ctrl/data:lc_ctrl_regs", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:i2c", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:rand_testutils", | 
 |     ], | 
 | ) | 
 |  | 
 | matcha_dv_test( | 
 |     name = "sram_ctrl_scrambled_access_test", | 
 |     srcs = ["sram_ctrl_scrambled_access_test.c"], | 
 |     deps = [ | 
 |         "//sw/device/lib/dif:rstmgr", | 
 |         "//sw/device/tests:test_dv_lib", | 
 |         "@lowrisc_opentitan//hw/ip/sram_ctrl/data:sram_ctrl_regs", | 
 |         "@lowrisc_opentitan//sw/device/lib/base:macros", | 
 |         "@lowrisc_opentitan//sw/device/lib/base:multibits", | 
 |         "@lowrisc_opentitan//sw/device/lib/base:stdasm", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:flash_ctrl", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:flash_ctrl_testutils", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:rstmgr_testutils", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:sram_ctrl_testutils", | 
 |     ], | 
 | ) | 
 |  | 
 | ################################################################################ | 
 | #  Place the Opentitan-sourced DV test below.                                  # | 
 | #  Opentitan DV binary build flow does not support centOS7, so we pull the     # | 
 | #  source code and build them here using `matcha_dv_test` rule.                # | 
 | ################################################################################ | 
 |  | 
 | matcha_dv_test( | 
 |     name = "spi_tx_rx_test", | 
 |     srcs = ["@lowrisc_opentitan//sw/device/tests/sim_dv:spi_tx_rx_test.c"], | 
 |     targets = ["dv"], | 
 |     deps = [ | 
 |         "//sw/device/lib/arch:device", | 
 |         "//sw/device/lib/dif:rv_plic_sec", | 
 |         "//sw/device/tests:test_dv_lib_opentitan", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:base", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:spi_device", | 
 |     ], | 
 | ) | 
 |  | 
 | matcha_dv_test( | 
 |     name = "rom_ctrl_integrity_check_test", | 
 |     srcs = ["@lowrisc_opentitan//sw/device/tests/sim_dv:rom_ctrl_integrity_check_test.c"], | 
 |     targets = ["dv"], | 
 |     deps = [ | 
 |         "//sw/device/tests:test_dv_lib_opentitan", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:lc_ctrl", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:rom_ctrl", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing/test_framework:status", | 
 |     ], | 
 | ) | 
 |  | 
 | matcha_dv_test( | 
 |     name = "alert_handler_escalation_test", | 
 |     srcs = ["@lowrisc_opentitan//sw/device/tests/sim_dv:alert_handler_escalation.c"], | 
 |     copts = [ | 
 |         # Mask the code error from OT source | 
 |         "-Wno-unused-variable", | 
 |     ], | 
 |     deps = [ | 
 |         "//hw/top_matcha:alert_handler_regs_h", | 
 |         "//sw/device/lib/arch:device", | 
 |         "//sw/device/lib/dif:alert_handler", | 
 |         "//sw/device/lib/dif:clkmgr", | 
 |         "//sw/device/lib/dif:rstmgr", | 
 |         "//sw/device/lib/testing:alert_handler_testutils", | 
 |         "//sw/device/tests:test_dv_lib_opentitan", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:keymgr", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:rv_core_ibex", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:keymgr_testutils", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:rstmgr_testutils", | 
 |     ], | 
 | ) | 
 |  | 
 | matcha_dv_test( | 
 |     name = "rv_dm_ndm_reset_req_when_cpu_halted", | 
 |     srcs = ["@lowrisc_opentitan//sw/device/tests/sim_dv:rv_dm_ndm_reset_req_when_cpu_halted.c"], | 
 |     deps = [ | 
 |         "//sw/device/lib/dif:rstmgr", | 
 |         "//sw/device/tests:test_dv_lib_opentitan", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:rstmgr_testutils", | 
 |     ], | 
 | ) | 
 |  | 
 | matcha_dv_test( | 
 |     name = "sensor_ctrl_status_test", | 
 |     srcs = ["@lowrisc_opentitan//sw/device/tests/sim_dv:sensor_ctrl_status.c"], | 
 |     deps = [ | 
 |         "//hw/top_matcha/ip/sensor_ctrl/data:sensor_ctrl_regs", | 
 |         "//sw/device/lib/dif:rv_plic_sec", | 
 |         "//sw/device/tests:test_dv_lib_opentitan", | 
 |         "@lowrisc_opentitan//sw/device/lib/base:abs_mmio", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:sensor_ctrl", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:isr_testutils", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:rv_plic_testutils", | 
 |     ], | 
 | ) | 
 |  | 
 | matcha_dv_test( | 
 |     name = "all_escalation_resets_test", | 
 |     srcs = ["@lowrisc_opentitan//sw/device/tests/sim_dv:all_escalation_resets_test.c"], | 
 |     copts = [ | 
 |         # Mask the code error from OT source | 
 |         "-Wno-unused-variable", | 
 |     ], | 
 |     deps = [ | 
 |         "//sw/device/lib/dif:alert_handler", | 
 |         "//sw/device/lib/dif:clkmgr", | 
 |         "//sw/device/lib/dif:rstmgr", | 
 |         "//sw/device/lib/dif:rv_plic_sec", | 
 |         "//sw/device/lib/testing:alert_handler_testutils", | 
 |         "//sw/device/tests:test_dv_lib_opentitan", | 
 |         "@lowrisc_opentitan//sw/device/lib/base:abs_mmio", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:aes", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:aon_timer", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:flash_ctrl", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:kmac", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:lc_ctrl", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:otp_ctrl", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:pwrmgr", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:rom_ctrl", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:rv_core_ibex", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:sram_ctrl", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:aon_timer_testutils", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:flash_ctrl_testutils", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:rstmgr_testutils", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:rv_plic_testutils", | 
 |     ], | 
 | ) | 
 |  | 
 | matcha_dv_test( | 
 |     name = "pwrmgr_sleep_power_glitch_test", | 
 |     srcs = ["@lowrisc_opentitan//sw/device/tests/sim_dv:pwrmgr_sleep_power_glitch_test.c"], | 
 |     deps = [ | 
 |         "//sw/device/lib/dif:rstmgr", | 
 |         "//sw/device/tests:test_dv_lib_opentitan", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:pwrmgr", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:pwrmgr_testutils", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:rstmgr_testutils", | 
 |     ], | 
 | ) | 
 |  | 
 | matcha_dv_test( | 
 |     name = "pwrmgr_deep_sleep_power_glitch_test", | 
 |     srcs = ["@lowrisc_opentitan//sw/device/tests/sim_dv:pwrmgr_deep_sleep_power_glitch_test.c"], | 
 |     deps = [ | 
 |         "//sw/device/lib/dif:rstmgr", | 
 |         "//sw/device/tests:test_dv_lib_opentitan", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:pwrmgr", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:pwrmgr_testutils", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:rstmgr_testutils", | 
 |     ], | 
 | ) | 
 |  | 
 | matcha_dv_test( | 
 |     name = "gpio_test", | 
 |     srcs = ["@lowrisc_opentitan//sw/device/tests/sim_dv:gpio_test.c"], | 
 |     deps = [ | 
 |         "//sw/device/lib/dif:rv_plic_sec", | 
 |         "//sw/device/lib/testing:pinmux_testutils", | 
 |         "//sw/device/tests:test_dv_lib_opentitan", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:gpio", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:rv_plic_testutils", | 
 |     ], | 
 | ) | 
 |  | 
 | matcha_dv_test( | 
 |     name = "sram_ctrl_execution_main_test", | 
 |     srcs = ["@lowrisc_opentitan//sw/device/tests/sim_dv:sram_ctrl_execution_main_test.c"], | 
 |     deps = [ | 
 |         "//sw/device/tests:test_dv_lib_opentitan", | 
 |         "@lowrisc_opentitan//hw/ip/otp_ctrl/data:otp_ctrl_regs", | 
 |         "@lowrisc_opentitan//sw/device/lib/base:bitfield", | 
 |         "@lowrisc_opentitan//sw/device/lib/base:macros", | 
 |         "@lowrisc_opentitan//sw/device/lib/base:multibits", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:sram_ctrl", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:lc_ctrl_testutils", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:otp_ctrl_testutils", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:sram_ctrl_testutils", | 
 |     ], | 
 | ) | 
 |  | 
 | matcha_dv_test( | 
 |     name = "lc_ctrl_program_error", | 
 |     srcs = ["@lowrisc_opentitan//sw/device/tests/sim_dv:lc_ctrl_program_error.c"], | 
 |     deps = [ | 
 |         "//sw/device/lib/arch:device", | 
 |         "//sw/device/lib/dif:alert_handler", | 
 |         "//sw/device/lib/dif:rstmgr", | 
 |         "//sw/device/lib/testing:alert_handler_testutils", | 
 |         "//sw/device/tests:test_dv_lib_opentitan", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:lc_ctrl", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:lc_ctrl_testutils", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:rstmgr_testutils", | 
 |     ], | 
 | ) | 
 |  | 
 | cc_library( | 
 |     name = "lc_ctrl_transition_impl", | 
 |     srcs = ["@lowrisc_opentitan//sw/device/tests/sim_dv:lc_ctrl_transition_impl.c"], | 
 |     hdrs = ["lc_ctrl_transition_impl.h"], | 
 |     deps = [ | 
 |         "//sw/device/tests:test_dv_lib_opentitan", | 
 |         "@lowrisc_opentitan//sw/device/lib/base:bitfield", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:lc_ctrl", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:lc_ctrl_testutils", | 
 |     ], | 
 | ) | 
 |  | 
 | matcha_dv_test( | 
 |     name = "clkmgr_external_clk_src_for_lc_test", | 
 |     srcs = ["@lowrisc_opentitan//sw/device/tests/sim_dv:clkmgr_external_clk_src_for_lc_test.c"], | 
 |     deps = [ | 
 |         ":lc_ctrl_transition_impl", | 
 |     ], | 
 | ) | 
 |  | 
 | matcha_dv_test( | 
 |     name = "pwrmgr_main_power_glitch_test", | 
 |     srcs = ["@lowrisc_opentitan//sw/device/tests/sim_dv:pwrmgr_main_power_glitch_test.c"], | 
 |     deps = [ | 
 |         "//sw/device/lib/dif:rstmgr", | 
 |         "//sw/device/tests:test_dv_lib_opentitan", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:rstmgr_testutils", | 
 |     ], | 
 | ) | 
 |  | 
 | cc_library( | 
 |     name = "lc_walkthrough_lib", | 
 |     deps = [ | 
 |         "//sw/device/lib/dif:rstmgr", | 
 |         "//sw/device/tests:test_dv_lib_opentitan", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:lc_ctrl", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:otp_ctrl", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:lc_ctrl_testutils", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing:otp_ctrl_testutils", | 
 |     ], | 
 | ) | 
 |  | 
 | matcha_dv_test( | 
 |     name = "lc_walkthrough_test", | 
 |     srcs = ["@lowrisc_opentitan//sw/device/tests/sim_dv:lc_walkthrough_test.c"], | 
 |     deps = [ | 
 |         ":lc_walkthrough_lib", | 
 |         "@lowrisc_opentitan//sw/device/lib/testing/test_framework:ottf_test_config", | 
 |     ], | 
 | ) | 
 |  | 
 | matcha_dv_test( | 
 |     name = "lc_walkthrough_testunlocks_test", | 
 |     srcs = ["@lowrisc_opentitan//sw/device/tests/sim_dv:lc_walkthrough_testunlocks_test.c"], | 
 |     deps = [ | 
 |         ":lc_walkthrough_lib", | 
 |     ], | 
 | ) | 
 |  | 
 | matcha_dv_test( | 
 |     name = "exit_test_unlocked_bootstrap", | 
 |     srcs = ["@lowrisc_opentitan//sw/device/tests/sim_dv:exit_test_unlocked_bootstrap.c"], | 
 |     deps = [ | 
 |         "//sw/device/lib/dif:rstmgr", | 
 |         "//sw/device/tests:test_dv_lib_opentitan", | 
 |         "@lowrisc_opentitan//hw/ip/otp_ctrl/data:otp_ctrl_regs", | 
 |         "@lowrisc_opentitan//sw/device/lib/base:abs_mmio", | 
 |         "@lowrisc_opentitan//sw/device/lib/dif:lc_ctrl", | 
 |     ], | 
 | ) |