18 #ifndef __CORE_FEATURE_ECLIC__
19 #define __CORE_FEATURE_ECLIC__
42 #include "core_feature_base.h"
44 #if defined(__ECLIC_PRESENT) && (__ECLIC_PRESENT == 1)
99 #if defined(__SMODE_PRESENT) && (__SMODE_PRESENT == 1)
102 __IM uint8_t RESERVED2;
106 uint32_t RESERVED4[1021];
107 #if defined(__SMODE_PRESENT) && (__SMODE_PRESENT == 1)
121 #define CLIC_CLICCFG_NLBIT_Pos 1U
122 #define CLIC_CLICCFG_NLBIT_Msk (0xFUL << CLIC_CLICCFG_NLBIT_Pos)
124 #define CLIC_CLICINFO_CTLBIT_Pos 21U
125 #define CLIC_CLICINFO_CTLBIT_Msk (0xFUL << CLIC_CLICINFO_CTLBIT_Pos)
127 #define CLIC_CLICINFO_VER_Pos 13U
128 #define CLIC_CLICINFO_VER_Msk (0xFFUL << CLIC_CLICINFO_VER_Pos)
130 #define CLIC_CLICINFO_NUM_Pos 0U
131 #define CLIC_CLICINFO_NUM_Msk (0x1FFFUL << CLIC_CLICINFO_NUM_Pos)
133 #define CLIC_CLICINFO_SHD_NUM_Pos 25U
134 #define CLIC_CLICINFO_SHD_NUM_Msk (0xFUL << CLIC_CLICINFO_SHD_NUM_Pos)
136 #define CLIC_INTIP_IP_Pos 0U
137 #define CLIC_INTIP_IP_Msk (0x1UL << CLIC_INTIP_IP_Pos)
139 #define CLIC_INTIE_IE_Pos 0U
140 #define CLIC_INTIE_IE_Msk (0x1UL << CLIC_INTIE_IE_Pos)
142 #if defined(__SMODE_PRESENT) && (__SMODE_PRESENT == 1)
143 #define CLIC_INTATTR_MODE_Pos 6U
144 #define CLIC_INTATTR_MODE_Msk (0x3U << CLIC_INTATTR_MODE_Pos)
147 #define CLIC_INTATTR_TRIG_Pos 1U
148 #define CLIC_INTATTR_TRIG_Msk (0x3UL << CLIC_INTATTR_TRIG_Pos)
150 #define CLIC_INTATTR_SHV_Pos 0U
151 #define CLIC_INTATTR_SHV_Msk (0x1UL << CLIC_INTATTR_SHV_Pos)
153 #define ECLIC_MAX_NLBITS 8U
154 #define ECLIC_MODE_MTVEC_Msk 3U
156 #define ECLIC_NON_VECTOR_INTERRUPT 0x0
157 #define ECLIC_VECTOR_INTERRUPT 0x1
160 typedef enum ECLIC_TRIGGER {
167 #ifndef __ECLIC_BASEADDR
169 #error "__ECLIC_BASEADDR is not defined, please check!"
172 #ifndef __ECLIC_INTCTLBITS
174 #define __ECLIC_INTCTLBITS (__ECLIC_GetInfoCtlbits())
178 #define ECLIC_BASE __ECLIC_BASEADDR
179 #define ECLIC ((CLIC_Type *) ECLIC_BASE)
205 #if defined(__ONLY_FOR_DOXYGEN_DOCUMENT_GENERATION__)
240 #ifdef NMSIS_ECLIC_VIRTUAL
241 #ifndef NMSIS_ECLIC_VIRTUAL_HEADER_FILE
242 #define NMSIS_ECLIC_VIRTUAL_HEADER_FILE "nmsis_eclic_virtual.h"
244 #include NMSIS_ECLIC_VIRTUAL_HEADER_FILE
246 #define ECLIC_SetCfgNlbits __ECLIC_SetCfgNlbits
247 #define ECLIC_GetCfgNlbits __ECLIC_GetCfgNlbits
248 #define ECLIC_GetInfoVer __ECLIC_GetInfoVer
249 #define ECLIC_GetInfoCtlbits __ECLIC_GetInfoCtlbits
250 #define ECLIC_GetInfoNum __ECLIC_GetInfoNum
251 #define ECLIC_GetInfoShadowNum __ECLIC_GetInfoShadowNum
252 #define ECLIC_SetMth __ECLIC_SetMth
253 #define ECLIC_GetMth __ECLIC_GetMth
254 #define ECLIC_EnableIRQ __ECLIC_EnableIRQ
255 #define ECLIC_GetEnableIRQ __ECLIC_GetEnableIRQ
256 #define ECLIC_DisableIRQ __ECLIC_DisableIRQ
257 #define ECLIC_SetPendingIRQ __ECLIC_SetPendingIRQ
258 #define ECLIC_GetPendingIRQ __ECLIC_GetPendingIRQ
259 #define ECLIC_ClearPendingIRQ __ECLIC_ClearPendingIRQ
260 #define ECLIC_SetTrigIRQ __ECLIC_SetTrigIRQ
261 #define ECLIC_GetTrigIRQ __ECLIC_GetTrigIRQ
262 #define ECLIC_SetShvIRQ __ECLIC_SetShvIRQ
263 #define ECLIC_GetShvIRQ __ECLIC_GetShvIRQ
264 #define ECLIC_SetCtrlIRQ __ECLIC_SetCtrlIRQ
265 #define ECLIC_GetCtrlIRQ __ECLIC_GetCtrlIRQ
266 #define ECLIC_SetLevelIRQ __ECLIC_SetLevelIRQ
267 #define ECLIC_GetLevelIRQ __ECLIC_GetLevelIRQ
268 #define ECLIC_SetPriorityIRQ __ECLIC_SetPriorityIRQ
269 #define ECLIC_GetPriorityIRQ __ECLIC_GetPriorityIRQ
271 #define ECLIC_EnableShadow __ECLIC_EnableShadow
272 #define ECLIC_DisableShadow __ECLIC_DisableShadow
273 #define ECLIC_SetShadowLevel __ECLIC_SetShadowLevel
274 #define ECLIC_GetShadowLevel __ECLIC_GetShadowLevel
275 #define ECLIC_SetShadowLevelReg __ECLIC_SetShadowLevelReg
276 #define ECLIC_GetShadowLevelReg __ECLIC_GetShadowLevelReg
280 #if defined(__SMODE_PRESENT) && (__SMODE_PRESENT == 1)
281 #define ECLIC_SetModeIRQ __ECLIC_SetModeIRQ
282 #define ECLIC_SetSth __ECLIC_SetSth
283 #define ECLIC_GetSth __ECLIC_GetSth
284 #define ECLIC_SetPendingIRQ_S __ECLIC_SetPendingIRQ_S
285 #define ECLIC_GetPendingIRQ_S __ECLIC_GetPendingIRQ_S
286 #define ECLIC_ClearPendingIRQ_S __ECLIC_ClearPendingIRQ_S
287 #define ECLIC_SetTrigIRQ_S __ECLIC_SetTrigIRQ_S
288 #define ECLIC_GetTrigIRQ_S __ECLIC_GetTrigIRQ_S
289 #define ECLIC_SetShvIRQ_S __ECLIC_SetShvIRQ_S
290 #define ECLIC_GetShvIRQ_S __ECLIC_GetShvIRQ_S
291 #define ECLIC_SetCtrlIRQ_S __ECLIC_SetCtrlIRQ_S
292 #define ECLIC_GetCtrlIRQ_S __ECLIC_GetCtrlIRQ_S
293 #define ECLIC_SetLevelIRQ_S __ECLIC_SetLevelIRQ_S
294 #define ECLIC_GetLevelIRQ_S __ECLIC_GetLevelIRQ_S
295 #define ECLIC_SetPriorityIRQ_S __ECLIC_SetPriorityIRQ_S
296 #define ECLIC_GetPriorityIRQ_S __ECLIC_GetPriorityIRQ_S
297 #define ECLIC_EnableIRQ_S __ECLIC_EnableIRQ_S
298 #define ECLIC_GetEnableIRQ_S __ECLIC_GetEnableIRQ_S
299 #define ECLIC_DisableIRQ_S __ECLIC_DisableIRQ_S
301 #define ECLIC_EnableShadow_S __ECLIC_EnableShadow_S
302 #define ECLIC_DisableShadow_S __ECLIC_DisableShadow_S
303 #define ECLIC_SetShadowLevel_S __ECLIC_SetShadowLevel_S
304 #define ECLIC_GetShadowLevel_S __ECLIC_GetShadowLevel_S
305 #define ECLIC_SetShadowLevelReg_S __ECLIC_SetShadowLevelReg_S
306 #define ECLIC_GetShadowLevelReg_S __ECLIC_GetShadowLevelReg_S
312 #ifdef NMSIS_VECTAB_VIRTUAL
313 #ifndef NMSIS_VECTAB_VIRTUAL_HEADER_FILE
314 #define NMSIS_VECTAB_VIRTUAL_HEADER_FILE "nmsis_vectab_virtual.h"
316 #include NMSIS_VECTAB_VIRTUAL_HEADER_FILE
318 #define ECLIC_SetVector __ECLIC_SetVector
319 #define ECLIC_GetVector __ECLIC_GetVector
321 #if defined(__SMODE_PRESENT) && (__SMODE_PRESENT == 1)
322 #define ECLIC_SetVector_S __ECLIC_SetVector_S
323 #define ECLIC_GetVector_S __ECLIC_GetVector_S
339 uint8_t temp =
ECLIC->CFG;
578 uint8_t temp =
ECLIC->CTRL[IRQn].INTATTR;
619 uint8_t temp =
ECLIC->CTRL[IRQn].INTATTR;
656 ECLIC->CTRL[IRQn].INTCTRL = intctrl;
672 return (
ECLIC->CTRL[IRQn].INTCTRL);
693 uint8_t intctlbits = (uint8_t)__ECLIC_INTCTLBITS;
699 if (nlbits > intctlbits) {
702 uint8_t maxlvl = ((1UL << nlbits) - 1);
703 if (lvl_abs > maxlvl) {
708 cur_ctrl = cur_ctrl << nlbits;
709 cur_ctrl = cur_ctrl >> nlbits;
727 uint8_t intctlbits = (uint8_t)__ECLIC_INTCTLBITS;
733 if (nlbits > intctlbits) {
758 uint8_t intctlbits = (uint8_t)__ECLIC_INTCTLBITS;
759 if (nlbits < intctlbits) {
760 uint8_t maxpri = ((1UL << (intctlbits - nlbits)) - 1);
765 uint8_t mask = ((uint8_t)(-1)) >> intctlbits;
788 uint8_t intctlbits = (uint8_t)__ECLIC_INTCTLBITS;
789 if (nlbits < intctlbits) {
791 uint8_t pri = cur_ctrl << nlbits;
851 __STATIC_INLINE void __ECLIC_SetShadowLevel(
unsigned long idx, uint8_t level)
860 uint8_t max_level = (1U << nlbits) - 1;
861 if (level > max_level) {
866 uint8_t level_shifted = (uint8_t)((level << (8 - nlbits)) | ((1U << (8 - nlbits)) - 1));
868 #if __RISCV_XLEN == 64
871 uint32_t bit_pos = idx << 3;
873 uint64_t mask = (uint64_t)0xFFUL << bit_pos;
876 current_val = (current_val & ~mask) | (((uint64_t)level_shifted) << bit_pos);
882 uint32_t bit_pos = idx << 3;
883 uint32_t mask = 0xFFUL << bit_pos;
885 current_val = (current_val & ~mask) | (((uint32_t)level_shifted) << bit_pos);
889 uint32_t bit_pos = (idx - 4) << 3;
890 uint32_t mask = 0xFFUL << bit_pos;
892 current_val = (current_val & ~mask) | (((uint32_t)level_shifted) << bit_pos);
925 #if __RISCV_XLEN == 64
928 uint32_t bit_pos = idx << 3;
931 uint8_t extracted_val = (uint8_t)((current_val >> bit_pos) & 0xFF);
933 uint8_t level = (extracted_val >> (8 - nlbits));
939 uint32_t bit_pos = idx << 3;
942 uint8_t extracted_val = (uint8_t)((current_val >> bit_pos) & 0xFF);
944 uint8_t level = (extracted_val >> (8 - nlbits));
948 uint32_t bit_pos = (idx - 4) << 3;
951 uint8_t extracted_val = (uint8_t)((current_val >> bit_pos) & 0xFF);
953 uint8_t level = (extracted_val >> (8 - nlbits));
976 #if __RISCV_XLEN == 64
1001 #if __RISCV_XLEN == 64
1030 unsigned long vec_base;
1032 vec_base += ((
unsigned long)IRQn) *
sizeof(
unsigned long);
1033 (* (
unsigned long *) vec_base) = vector;
1034 #if (defined(__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1))
1035 #if (defined(__CCM_PRESENT) && (__CCM_PRESENT == 1))
1039 #if (defined(__ICACHE_PRESENT) && (__ICACHE_PRESENT == 1))
1040 #if (defined(__CCM_PRESENT) && (__CCM_PRESENT == 1))
1062 #if __RISCV_XLEN == 32
1064 #elif __RISCV_XLEN == 64
1071 #if defined(__SMODE_PRESENT) && (__SMODE_PRESENT == 1)
1127 return (
ECLIC->STH);
1200 uint8_t temp =
ECLIC->SCTRL[IRQn].INTATTR;
1242 uint8_t temp =
ECLIC->SCTRL[IRQn].INTATTR;
1279 ECLIC->SCTRL[IRQn].INTCTRL = intctrl;
1295 return (
ECLIC->SCTRL[IRQn].INTCTRL);
1316 uint8_t intctlbits = (uint8_t)__ECLIC_INTCTLBITS;
1322 if (nlbits > intctlbits) {
1323 nlbits = intctlbits;
1325 uint8_t maxlvl = ((1UL << nlbits) - 1);
1326 if (lvl_abs > maxlvl) {
1331 cur_ctrl = cur_ctrl << nlbits;
1332 cur_ctrl = cur_ctrl >> nlbits;
1351 uint8_t intctlbits = (uint8_t)__ECLIC_INTCTLBITS;
1357 if (nlbits > intctlbits) {
1358 nlbits = intctlbits;
1382 uint8_t intctlbits = (uint8_t)__ECLIC_INTCTLBITS;
1383 if (nlbits < intctlbits) {
1384 uint8_t maxpri = ((1UL << (intctlbits - nlbits)) - 1);
1389 uint8_t mask = ((uint8_t)(-1)) >> intctlbits;
1412 uint8_t intctlbits = (uint8_t)__ECLIC_INTCTLBITS;
1413 if (nlbits < intctlbits) {
1415 uint8_t pri = cur_ctrl << nlbits;
1416 pri = pri >> nlbits;
1491 volatile unsigned long vec_base;
1493 vec_base += ((
unsigned long)IRQn) *
sizeof(
unsigned long);
1494 (* (
unsigned long *) vec_base) = vector;
1495 #if (defined(__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1))
1496 #if (defined(__CCM_PRESENT) && (__CCM_PRESENT == 1))
1500 #if (defined(__ICACHE_PRESENT) && (__ICACHE_PRESENT == 1))
1501 #if (defined(__CCM_PRESENT) && (__CCM_PRESENT == 1))
1523 #if __RISCV_XLEN == 32
1525 #elif __RISCV_XLEN == 64
1532 #if __ECLIC_VER == 2
1583 __STATIC_INLINE void __ECLIC_SetShadowLevel_S(
unsigned long idx, uint8_t level)
1592 uint8_t max_level = (1U << nlbits) - 1;
1593 if (level > max_level) {
1598 uint8_t level_shifted = (uint8_t)((level << (8 - nlbits)) | ((1U << (8 - nlbits)) - 1));
1600 #if __RISCV_XLEN == 64
1603 uint32_t bit_pos = idx << 3;
1605 uint64_t mask = (uint64_t)0xFFUL << bit_pos;
1608 current_val = (current_val & ~mask) | (((uint64_t)level_shifted) << bit_pos);
1614 uint32_t bit_pos = idx << 3;
1615 uint32_t mask = 0xFFUL << bit_pos;
1617 current_val = (current_val & ~mask) | (((uint32_t)level_shifted) << bit_pos);
1621 uint32_t bit_pos = (idx - 4) << 3;
1622 uint32_t mask = 0xFFUL << bit_pos;
1624 current_val = (current_val & ~mask) | (((uint32_t)level_shifted) << bit_pos);
1657 #if __RISCV_XLEN == 64
1660 uint32_t bit_pos = idx << 3;
1663 uint8_t extracted_val = (uint8_t)((current_val >> bit_pos) & 0xFF);
1665 uint8_t level = (extracted_val >> (8 - nlbits));
1671 uint32_t bit_pos = idx << 3;
1674 uint8_t extracted_val = (uint8_t)((current_val >> bit_pos) & 0xFF);
1676 uint8_t level = (extracted_val >> (8 - nlbits));
1680 uint32_t bit_pos = (idx - 4) << 3;
1683 uint8_t extracted_val = (uint8_t)((current_val >> bit_pos) & 0xFF);
1685 uint8_t level = (extracted_val >> (8 - nlbits));
1708 #if __RISCV_XLEN == 64
1733 #if __RISCV_XLEN == 64
1842 #if __ECLIC_VER == 2
1843 #define SAVE_SSUBM_VAR() rv_csr_t __ssubm = __RV_CSR_READ(CSR_SSUBM);
1844 #define RESTORE_SSUBM_VAR() __RV_CSR_WRITE(CSR_SSUBM, __ssubm);
1846 #define SAVE_SSUBM_VAR()
1847 #define RESTORE_SSUBM_VAR()
1880 #define SAVE_IRQ_CSR_CONTEXT() \
1881 rv_csr_t __mcause = __RV_CSR_READ(CSR_MCAUSE); \
1882 rv_csr_t __mepc = __RV_CSR_READ(CSR_MEPC); \
1883 rv_csr_t __msubm = __RV_CSR_READ(CSR_MSUBM); \
1887 #define SAVE_IRQ_CSR_CONTEXT_S() \
1888 rv_csr_t __scause = __RV_CSR_READ(CSR_SCAUSE); \
1889 rv_csr_t __sepc = __RV_CSR_READ(CSR_SEPC); \
1903 #define RESTORE_IRQ_CSR_CONTEXT() \
1905 __RV_CSR_WRITE(CSR_MSUBM, __msubm); \
1906 __RV_CSR_WRITE(CSR_MEPC, __mepc); \
1907 __RV_CSR_WRITE(CSR_MCAUSE, __mcause);
1910 #define RESTORE_IRQ_CSR_CONTEXT_S() \
1911 __disable_irq_s(); \
1912 RESTORE_SSUBM_VAR(); \
1913 __RV_CSR_WRITE(CSR_SEPC, __sepc); \
1914 __RV_CSR_WRITE(CSR_SCAUSE, __scause);
#define SECLIC_CTL_SHADOW_EN
#define MECLIC_CTL_SHADOW_EN
#define __RV_CSR_CLEAR(csr, val)
CSR operation Macro for csrc instruction.
#define __RV_CSR_READ(csr)
CSR operation Macro for csrr instruction.
__STATIC_FORCEINLINE void __FENCE_I(void)
Fence.i Instruction.
#define __RV_CSR_WRITE(csr, val)
CSR operation Macro for csrw instruction.
#define __RV_CSR_SET(csr, val)
CSR operation Macro for csrs instruction.
#define __STATIC_FORCEINLINE
Define a static function that should be always inlined by the compiler.
#define __STATIC_INLINE
Define a static function that may be inlined by the compiler.
__STATIC_INLINE void MFlushDCacheLine(unsigned long addr)
Flush one D-Cache line specified by address in M-Mode.
__STATIC_INLINE void SFlushDCacheLine(unsigned long addr)
Flush one D-Cache line specified by address in S-Mode.
#define CLIC_CLICCFG_NLBIT_Pos
CLIC CLICCFG: NLBIT Position.
#define CLIC_CLICINFO_CTLBIT_Msk
CLIC INTINFO: CLICINTCTLBITS Mask.
#define CLIC_CLICINFO_SHD_NUM_Msk
CLIC CLICINFO: SHD_NUM Mask.
#define CLIC_CLICINFO_VER_Msk
CLIC CLICINFO: VERSION Mask.
#define CLIC_INTATTR_SHV_Msk
CLIC INTATTR: SHV Mask.
#define ECLIC_MODE_MTVEC_Msk
ECLIC Mode mask for MTVT CSR Register.
#define CLIC_CLICINFO_VER_Pos
CLIC CLICINFO: VERSION Position.
#define ECLIC_MAX_NLBITS
Max nlbit of the CLICINTCTLBITS.
ECLIC_TRIGGER_Type
ECLIC Trigger Enum for different Trigger Type.
#define CLIC_CLICINFO_NUM_Pos
CLIC CLICINFO: NUM_INTERRUPT Position.
#define CLIC_INTATTR_TRIG_Msk
CLIC INTATTR: TRIG Mask.
#define CLIC_INTATTR_SHV_Pos
CLIC INTATTR: SHV Position.
#define CLIC_INTATTR_MODE_Msk
CLIC INTATTA: Mode Mask.
#define CLIC_CLICCFG_NLBIT_Msk
CLIC CLICCFG: NLBIT Mask.
#define CLIC_INTIE_IE_Msk
CLIC INTIE: IE Mask.
#define CLIC_CLICINFO_NUM_Msk
CLIC CLICINFO: NUM_INTERRUPT Mask.
#define CLIC_INTATTR_MODE_Pos
CLIC INTATTA: Mode Position.
#define ECLIC
CLIC configuration struct.
#define CLIC_INTATTR_TRIG_Pos
CLIC INTATTR: TRIG Position.
#define CLIC_CLICINFO_CTLBIT_Pos
CLIC INTINFO: CLICINTCTLBITS Position.
#define CLIC_CLICINFO_SHD_NUM_Pos
CLIC CLICINFO: SHD_NUM Position.
#define CLIC_INTIP_IP_Msk
CLIC INTIP: IP Mask.
@ ECLIC_POSTIVE_EDGE_TRIGGER
Postive/Rising Edge Triggered, trig[0] = 1, trig[1] = 0.
@ ECLIC_LEVEL_TRIGGER
Level Triggerred, trig[0] = 0.
@ ECLIC_MAX_TRIGGER
MAX Supported Trigger Mode.
@ ECLIC_NEGTIVE_EDGE_TRIGGER
Negtive/Falling Edge Triggered, trig[0] = 1, trig[1] = 1.
__STATIC_INLINE void SInvalICacheLine(unsigned long addr)
Invalidate one I-Cache line specified by address in S-Mode.
__STATIC_INLINE void MInvalICacheLine(unsigned long addr)
Invalidate one I-Cache line specified by address in M-Mode.
__STATIC_FORCEINLINE rv_csr_t __get_exc_entry(void)
Get Exception entry address.
__STATIC_FORCEINLINE uint32_t __ECLIC_GetInfoVer(void)
Get the ECLIC version number.
__STATIC_FORCEINLINE uint8_t __ECLIC_GetCtrlIRQ(IRQn_Type IRQn)
Get ECLIC Interrupt Input Control Register value for a specific interrupt.
__STATIC_INLINE void __ECLIC_SetVector_S(IRQn_Type IRQn, rv_csr_t vector)
Set Interrupt Vector of a specific interrupt in supervisor mode.
__STATIC_INLINE uint8_t __ECLIC_GetPriorityIRQ_S(IRQn_Type IRQn)
Get ECLIC Interrupt priority of a specific interrupt in supervisor mode.
__STATIC_FORCEINLINE void __ECLIC_SetTrigIRQ_S(IRQn_Type IRQn, uint32_t trig)
Set trigger mode and polarity for a specific interrupt in supervisor mode.
__STATIC_FORCEINLINE uint8_t __ECLIC_GetSth(void)
Get supervisor-mode Interrupt Level Threshold in supervisor mode.
__STATIC_FORCEINLINE uint32_t __ECLIC_GetCfgNlbits(void)
Get nlbits value.
__STATIC_FORCEINLINE void __ECLIC_SetShvIRQ(IRQn_Type IRQn, uint32_t shv)
Set interrupt working mode for a specific interrupt.
__STATIC_FORCEINLINE void __ECLIC_SetCtrlIRQ_S(IRQn_Type IRQn, uint8_t intctrl)
Modify ECLIC Interrupt Input Control Register for a specific interrupt in supervisor mode.
__STATIC_FORCEINLINE uint8_t __ECLIC_GetShvIRQ_S(IRQn_Type IRQn)
Get interrupt working mode for a specific interrupt in supervisor mode.
__STATIC_INLINE void __ECLIC_SetVector(IRQn_Type IRQn, rv_csr_t vector)
Set Interrupt Vector of a specific interrupt.
__STATIC_FORCEINLINE uint32_t __ECLIC_GetInfoNum(void)
Get number of maximum interrupt inputs supported.
__STATIC_FORCEINLINE void __ECLIC_SetCtrlIRQ(IRQn_Type IRQn, uint8_t intctrl)
Modify ECLIC Interrupt Input Control Register for a specific interrupt.
__STATIC_INLINE void __ECLIC_SetLevelIRQ(IRQn_Type IRQn, uint8_t lvl_abs)
Set ECLIC Interrupt level of a specific interrupt.
__STATIC_FORCEINLINE uint8_t __ECLIC_GetMth(void)
Get Machine Mode Interrupt Level Threshold.
__STATIC_FORCEINLINE void __ECLIC_ClearPendingIRQ_S(IRQn_Type IRQn)
Clear a specific interrupt from pending in supervisor mode.
__STATIC_FORCEINLINE void __ECLIC_SetCfgNlbits(uint32_t nlbits)
Set nlbits value.
__STATIC_FORCEINLINE void __ECLIC_SetSth(uint8_t sth)
Set supervisor-mode Interrupt Level Threshold in supervisor mode.
__STATIC_INLINE void __ECLIC_SetLevelIRQ_S(IRQn_Type IRQn, uint8_t lvl_abs)
Set ECLIC Interrupt level of a specific interrupt in supervisor mode.
__STATIC_INLINE rv_csr_t __get_nonvec_entry(void)
Get Non-vector interrupt entry address.
__STATIC_FORCEINLINE uint32_t __ECLIC_GetInfoShadowNum(void)
Get number of shadow register groups.
__STATIC_INLINE void __ECLIC_SetPriorityIRQ_S(IRQn_Type IRQn, uint8_t pri)
Set ECLIC Interrupt priority of a specific interrupt in supervisor mode.
__STATIC_INLINE uint8_t __ECLIC_GetLevelIRQ_S(IRQn_Type IRQn)
Get ECLIC Interrupt level of a specific interrupt.
__STATIC_FORCEINLINE int32_t __ECLIC_GetPendingIRQ_S(IRQn_Type IRQn)
Get the pending specific interrupt in supervisor mode.
__STATIC_FORCEINLINE uint32_t __ECLIC_GetInfoCtlbits(void)
Get CLICINTCTLBITS.
__STATIC_FORCEINLINE void __ECLIC_ClearPendingIRQ(IRQn_Type IRQn)
Clear a specific interrupt from pending.
__STATIC_FORCEINLINE rv_csr_t __ECLIC_GetVector(IRQn_Type IRQn)
Get Interrupt Vector of a specific interrupt.
IRQn_Type
Definition of IRQn numbers.
__STATIC_FORCEINLINE void __ECLIC_SetModeIRQ(IRQn_Type IRQn, uint32_t mode)
Set privilege mode of a specific interrupt.
__STATIC_INLINE uint8_t __ECLIC_GetPriorityIRQ(IRQn_Type IRQn)
Get ECLIC Interrupt priority of a specific interrupt.
__STATIC_FORCEINLINE void __ECLIC_EnableIRQ_S(IRQn_Type IRQn)
Enable a specific interrupt in supervisor mode.
__STATIC_FORCEINLINE int32_t __ECLIC_GetPendingIRQ(IRQn_Type IRQn)
Get the pending specific interrupt.
__STATIC_FORCEINLINE void __ECLIC_DisableIRQ(IRQn_Type IRQn)
Disable a specific interrupt.
__STATIC_INLINE void __ECLIC_SetPriorityIRQ(IRQn_Type IRQn, uint8_t pri)
Get ECLIC Interrupt priority of a specific interrupt.
__STATIC_FORCEINLINE uint8_t __ECLIC_GetEnableIRQ_S(IRQn_Type IRQn)
Get a specific interrupt enable status in supervisor mode.
__STATIC_FORCEINLINE uint8_t __ECLIC_GetTrigIRQ_S(IRQn_Type IRQn)
Get trigger mode and polarity for a specific interrupt in supervisor mode.
__STATIC_FORCEINLINE uint32_t __ECLIC_GetTrigIRQ(IRQn_Type IRQn)
Get trigger mode and polarity for a specific interrupt.
__STATIC_FORCEINLINE void __ECLIC_SetPendingIRQ_S(IRQn_Type IRQn)
Set a specific interrupt to pending in supervisor mode.
__STATIC_INLINE void __set_nonvec_entry(rv_csr_t addr)
Set Non-vector interrupt entry address.
__STATIC_FORCEINLINE rv_csr_t __get_nmi_entry(void)
Get NMI interrupt entry from 'CSR_MNVEC'.
__STATIC_FORCEINLINE void __ECLIC_DisableIRQ_S(IRQn_Type IRQn)
Disable a specific interrupt in supervisor mode.
__STATIC_FORCEINLINE uint8_t __ECLIC_GetCtrlIRQ_S(IRQn_Type IRQn)
Get ECLIC Interrupt Input Control Register value for a specific interrupt in supervisor mode.
__STATIC_FORCEINLINE uint32_t __ECLIC_GetShvIRQ(IRQn_Type IRQn)
Get interrupt working mode for a specific interrupt.
__STATIC_FORCEINLINE uint32_t __ECLIC_GetEnableIRQ(IRQn_Type IRQn)
Get a specific interrupt enable status.
__STATIC_INLINE uint8_t __ECLIC_GetLevelIRQ(IRQn_Type IRQn)
Get ECLIC Interrupt level of a specific interrupt.
__STATIC_FORCEINLINE void __ECLIC_SetPendingIRQ(IRQn_Type IRQn)
Set a specific interrupt to pending.
__STATIC_FORCEINLINE void __ECLIC_EnableIRQ(IRQn_Type IRQn)
Enable a specific interrupt.
__STATIC_FORCEINLINE void __ECLIC_SetShvIRQ_S(IRQn_Type IRQn, uint32_t shv)
Set interrupt working mode for a specific interrupt in supervisor mode.
__STATIC_FORCEINLINE void __set_exc_entry(rv_csr_t addr)
Set Exception entry address.
__STATIC_FORCEINLINE void __ECLIC_SetTrigIRQ(IRQn_Type IRQn, uint32_t trig)
Set trigger mode and polarity for a specific interrupt.
__STATIC_FORCEINLINE void __ECLIC_SetMth(uint8_t mth)
Set Machine Mode Interrupt Level Threshold.
__STATIC_FORCEINLINE rv_csr_t __ECLIC_GetVector_S(IRQn_Type IRQn)
Get Interrupt Vector of a specific interrupt in supervisor mode.
@ SysTimerSW_IRQn
System Timer SW interrupt.
@ Reserved10_IRQn
Internal reserved.
@ Reserved2_IRQn
Internal reserved.
@ Reserved15_IRQn
Internal reserved.
@ Reserved14_IRQn
Internal reserved.
@ SysTimer_IRQn
System Timer Interrupt.
@ Reserved0_IRQn
Internal reserved.
@ Reserved16_IRQn
Internal reserved.
@ Reserved9_IRQn
Internal reserved.
@ Reserved11_IRQn
Internal reserved.
@ Reserved6_IRQn
Internal reserved.
@ Reserved12_IRQn
Internal reserved.
@ Reserved13_IRQn
Internal reserved.
@ Reserved5_IRQn
Internal reserved.
@ Reserved4_IRQn
Internal reserved.
@ Reserved8_IRQn
Internal reserved.
@ FirstDeviceSpecificInterrupt_IRQn
First Device Specific Interrupt.
@ Reserved1_IRQn
Internal reserved.
@ SOC_INT_MAX
Number of total interrupts.
@ Reserved7_IRQn
Internal reserved.
@ Reserved3_IRQn
Internal reserved.
#define __IM
Defines 'read only' structure member permissions.
#define __IOM
Defines 'read/write' structure member permissions.
unsigned long rv_csr_t
Type of Control and Status Register(CSR), depends on the XLEN defined in RISC-V.
Access to the machine mode register structure of INTIP, INTIE, INTATTR, INTCTL.
__IOM uint8_t INTIP
Offset: 0x000 (R/W) Interrupt set pending register.
__IOM uint8_t INTIE
Offset: 0x001 (R/W) Interrupt set enable register.
__IOM uint8_t INTATTR
Offset: 0x002 (R/W) Interrupt set attributes register.
__IOM uint8_t INTCTRL
Offset: 0x003 (R/W) Interrupt configure register.
Access to the structure of ECLIC Memory Map.
__IOM uint8_t SSTH
Offset: 0x2009 (R) CLIC supervisor mode threshold register, which is a mirror to mintthresh....
__IM uint32_t INFO
Offset: 0x004 (R/ ) CLIC information register.
__IOM uint8_t CFG
Offset: 0x000 (R/W) CLIC configuration register.
__IOM uint8_t STH
Offset: 0x009 (R/W ) CLIC supervisor mode interrupt-level threshold.
__IOM uint8_t MTH
Offset: 0x00B(R/W) CLIC machine mode interrupt-level threshold.
Union type to access CLICFG configure register.
__IM uint8_t nmbits
bit: 5..6 ties to 1 if supervisor-level interrupt supported, or else it's reserved
uint8_t w
Type used for byte access.
__IOM uint8_t nlbits
bit: 1..4 specified the bit-width of level and priority in the register clicintctl[i]
Union type to access CLICINFO information register.
__IM uint32_t _reserved0
bit: 29..31 Reserved
__IM uint32_t intctlbits
bit: 21..24 specifies how many hardware bits are actually implemented in the clicintctl registers
__IM uint32_t w
Type used for word access.
__IM uint32_t version
bit: 13..20 Hardware implementation version number.
__IM uint32_t shd_num
bit: 25..28 number of shadow register groups for single mode(M/S mode)
__IM uint32_t numint
bit: 0..12 number of maximum interrupt inputs supported