Software APIs
rv_plic_testutils.h
1 // Copyright lowRISC contributors (OpenTitan project).
2 // Licensed under the Apache License, Version 2.0, see LICENSE for details.
3 // SPDX-License-Identifier: Apache-2.0
4 
5 #ifndef OPENTITAN_SW_DEVICE_LIB_TESTING_RV_PLIC_TESTUTILS_H_
6 #define OPENTITAN_SW_DEVICE_LIB_TESTING_RV_PLIC_TESTUTILS_H_
7 
9 
10 /**
11  * Enables a range of IRQs at the PLIC.
12  *
13  * All interrupts between the first and the last index (inclusive
14  * of both), which are provided as arguments are enabled. It also sets the
15  * threshold for the target to kDifRvPlicMinPriority and picks the priority of
16  * the interrupts randomly between kDifRvPlicMinPriority + 1 and
17  * kDifRvPlicMaxPriority. We may however, revisit this approach in future as
18  * testing needs evolve.
19  * @param plic A PLIC handle.
20  * @param target An interrupt target.
21  * @param start_irq_id The first interrupt index.
22  * @param start_irq_id The last interrupt index.
23  */
24 void rv_plic_testutils_irq_range_enable(dif_rv_plic_t *plic,
25  dif_rv_plic_target_t target,
26  dif_rv_plic_irq_id_t start_irq_id,
27  dif_rv_plic_irq_id_t end_irq_id);
28 
29 #endif // OPENTITAN_SW_DEVICE_LIB_TESTING_RV_PLIC_TESTUTILS_H_