NMSIS-Core  Version 1.6.0
NMSIS-Core support for Nuclei processor-based devices
core_feature_eclic.h
1 /*
2  * Copyright (c) 2019 Nuclei Limited. All rights reserved.
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  *
6  * Licensed under the Apache License, Version 2.0 (the License); you may
7  * not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an AS IS BASIS, WITHOUT
14  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 #ifndef __CORE_FEATURE_ECLIC__
19 #define __CORE_FEATURE_ECLIC__
20 
24 /*
25  * ECLIC Feature Configuration Macro:
26  * 1. __ECLIC_PRESENT: Define whether Enhanced Core Local Interrupt Controller (ECLIC) Unit is present or not
27  * * 0: Not present
28  * * 1: Present
29  * 2. __ECLIC_BASEADDR: Base address of the ECLIC unit.
30  * 3. __ECLIC_INTCTLBITS: Optional, if defined, it should set to the value of ECLIC_GetInfoCtlbits(), define the number of hardware bits are actually implemented in the clicintctl registers.
31  * Valid number is 1 - 8.
32  * 4. __ECLIC_INTNUM: Define the external interrupt number of ECLIC Unit
33  * 5. __SMODE_PRESENT: Define whether S-Mode present, if present, ECLIC will present with S-Mode ECLIC feature
34  * * 0: Not present
35  * * 1: Present
36  * 6. __ECLIC_VER: Optional, define the ECLIC version, if not defined, defaults to 1
37  * * 1: ECLICv1 (default)
38  * * 2: ECLICv2 (supports hardware context saving and shadow registers)
39  *
40  */
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
45 #include "core_feature_base.h"
46 
47 #if defined(__ECLIC_PRESENT) && (__ECLIC_PRESENT == 1)
48 
59 typedef union
60 {
61  struct {
62  __IM uint8_t _reserved0:1;
63  __IOM uint8_t nlbits:4;
64  __IM uint8_t nmbits:2;
65  __IM uint8_t _reserved1:1;
66  } b;
67  uint8_t w;
68 } CLICCFG_Type;
69 
73 typedef union {
74  struct {
75  __IM uint32_t numint:13;
76  __IM uint32_t version:8;
77  __IM uint32_t intctlbits:4;
78  __IM uint32_t shd_num:4;
79  __IM uint32_t _reserved0:3;
80  } b;
81  __IM uint32_t w;
83 
87 typedef struct {
88  __IOM uint8_t INTIP;
89  __IOM uint8_t INTIE;
90  __IOM uint8_t INTATTR;
91  __IOM uint8_t INTCTRL;
93 
97 typedef struct {
98  __IOM uint8_t CFG;
99  __IM uint8_t RESERVED0[3];
100  __IM uint32_t INFO;
101  __IM uint8_t RESERVED1;
102 #if defined(__SMODE_PRESENT) && (__SMODE_PRESENT == 1)
103  __IOM uint8_t STH;
104 #else
105  __IM uint8_t RESERVED2;
106 #endif
107  __IM uint8_t RESERVED3;
108  __IOM uint8_t MTH;
109  uint32_t RESERVED4[1021];
110 #if defined(__SMODE_PRESENT) && (__SMODE_PRESENT == 1)
111  CLIC_CTRL_Type CTRL[1024];
112  __IM uint32_t RESERVED5[2];
113  __IM uint8_t RESERVED6;
114  __IOM uint8_t SSTH;
115  __IM uint8_t RESERVED7;
116  __IM uint8_t RESERVED8;
117  __IM uint32_t RESERVED9[1021];
118  CLIC_CTRL_Type SCTRL[1024];
119 #else
120  CLIC_CTRL_Type CTRL[4096];
121 #endif
122 } CLIC_Type;
123 
124 #define CLIC_CLICCFG_NLBIT_Pos 1U
125 #define CLIC_CLICCFG_NLBIT_Msk (0xFUL << CLIC_CLICCFG_NLBIT_Pos)
127 #define CLIC_CLICINFO_CTLBIT_Pos 21U
128 #define CLIC_CLICINFO_CTLBIT_Msk (0xFUL << CLIC_CLICINFO_CTLBIT_Pos)
130 #define CLIC_CLICINFO_VER_Pos 13U
131 #define CLIC_CLICINFO_VER_Msk (0xFFUL << CLIC_CLICINFO_VER_Pos)
133 #define CLIC_CLICINFO_NUM_Pos 0U
134 #define CLIC_CLICINFO_NUM_Msk (0x1FFFUL << CLIC_CLICINFO_NUM_Pos)
136 #define CLIC_CLICINFO_SHD_NUM_Pos 25U
137 #define CLIC_CLICINFO_SHD_NUM_Msk (0xFUL << CLIC_CLICINFO_SHD_NUM_Pos)
139 #define CLIC_INTIP_IP_Pos 0U
140 #define CLIC_INTIP_IP_Msk (0x1UL << CLIC_INTIP_IP_Pos)
142 #define CLIC_INTIE_IE_Pos 0U
143 #define CLIC_INTIE_IE_Msk (0x1UL << CLIC_INTIE_IE_Pos)
145 #if defined(__SMODE_PRESENT) && (__SMODE_PRESENT == 1)
146 #define CLIC_INTATTR_MODE_Pos 6U
147 #define CLIC_INTATTR_MODE_Msk (0x3U << CLIC_INTATTR_MODE_Pos)
148 #endif
149 
150 #define CLIC_INTATTR_TRIG_Pos 1U
151 #define CLIC_INTATTR_TRIG_Msk (0x3UL << CLIC_INTATTR_TRIG_Pos)
153 #define CLIC_INTATTR_SHV_Pos 0U
154 #define CLIC_INTATTR_SHV_Msk (0x1UL << CLIC_INTATTR_SHV_Pos)
156 #define ECLIC_MAX_NLBITS 8U
157 #define ECLIC_MODE_MTVEC_Msk 3U
159 #define ECLIC_NON_VECTOR_INTERRUPT 0x0
160 #define ECLIC_VECTOR_INTERRUPT 0x1
163 typedef enum ECLIC_TRIGGER {
168 } ECLIC_TRIGGER_Type;
169 
170 #ifndef __ECLIC_BASEADDR
171 /* Base address of ECLIC(__ECLIC_BASEADDR) should be defined in <Device.h> */
172 #error "__ECLIC_BASEADDR is not defined, please check!"
173 #endif
174 
175 #ifndef __ECLIC_INTCTLBITS
176 /* Define __ECLIC_INTCTLBITS to get via ECLIC->INFO if not defined */
177 #define __ECLIC_INTCTLBITS (__ECLIC_GetInfoCtlbits())
178 #endif
179 
180 #ifndef __ECLIC_VER
181 /* Define __ECLIC_VER to 1 if not defined, assume ECLICv1 by default */
182 #define __ECLIC_VER 1U
183 #endif
184 
185 /* ECLIC Memory mapping of Device */
186 #define ECLIC_BASE __ECLIC_BASEADDR
187 #define ECLIC ((CLIC_Type *) ECLIC_BASE) /* end of group NMSIS_Core_ECLIC_Registers */
190 
191 /* ########################## ECLIC functions #################################### */
209 /* The following enum IRQn definition in this file
210  * is only used for doxygen documentation generation,
211  * The <Device>.h is the real file to define it by vendor
212  */
213 #if defined(__ONLY_FOR_DOXYGEN_DOCUMENT_GENERATION__)
214 typedef enum IRQn {
215  /* ========= Nuclei N/NX Core Specific Interrupt Numbers =========== */
216  /* Core Internal Interrupt IRQn definitions */
237  /* ========= Device Specific Interrupt Numbers =================== */
238  /* ToDo: add here your device specific external interrupt numbers.
239  * 19~max(NUM_INTERRUPT, 1023) is reserved number for user.
240  * Maxmum interrupt supported could get from clicinfo.NUM_INTERRUPT.
241  * According the interrupt handlers defined in startup_Device.S
242  * eg.: Interrupt for Timer#1 eclic_tim1_handler -> TIM1_IRQn */
245 } IRQn_Type;
246 #endif /* __ONLY_FOR_DOXYGEN_DOCUMENT_GENERATION__ */
247 
248 #ifdef NMSIS_ECLIC_VIRTUAL
249  #ifndef NMSIS_ECLIC_VIRTUAL_HEADER_FILE
250  #define NMSIS_ECLIC_VIRTUAL_HEADER_FILE "nmsis_eclic_virtual.h"
251  #endif
252  #include NMSIS_ECLIC_VIRTUAL_HEADER_FILE
253 #else
254  #define ECLIC_SetCfgNlbits __ECLIC_SetCfgNlbits
255  #define ECLIC_GetCfgNlbits __ECLIC_GetCfgNlbits
256  #define ECLIC_GetInfoVer __ECLIC_GetInfoVer
257  #define ECLIC_GetInfoCtlbits __ECLIC_GetInfoCtlbits
258  #define ECLIC_GetInfoNum __ECLIC_GetInfoNum
259  #define ECLIC_GetInfoShadowNum __ECLIC_GetInfoShadowNum
260  #define ECLIC_SetMth __ECLIC_SetMth
261  #define ECLIC_GetMth __ECLIC_GetMth
262  #define ECLIC_EnableIRQ __ECLIC_EnableIRQ
263  #define ECLIC_GetEnableIRQ __ECLIC_GetEnableIRQ
264  #define ECLIC_DisableIRQ __ECLIC_DisableIRQ
265  #define ECLIC_SetPendingIRQ __ECLIC_SetPendingIRQ
266  #define ECLIC_GetPendingIRQ __ECLIC_GetPendingIRQ
267  #define ECLIC_ClearPendingIRQ __ECLIC_ClearPendingIRQ
268  #define ECLIC_SetTrigIRQ __ECLIC_SetTrigIRQ
269  #define ECLIC_GetTrigIRQ __ECLIC_GetTrigIRQ
270  #define ECLIC_SetShvIRQ __ECLIC_SetShvIRQ
271  #define ECLIC_GetShvIRQ __ECLIC_GetShvIRQ
272  #define ECLIC_SetCtrlIRQ __ECLIC_SetCtrlIRQ
273  #define ECLIC_GetCtrlIRQ __ECLIC_GetCtrlIRQ
274  #define ECLIC_SetLevelIRQ __ECLIC_SetLevelIRQ
275  #define ECLIC_GetLevelIRQ __ECLIC_GetLevelIRQ
276  #define ECLIC_SetPriorityIRQ __ECLIC_SetPriorityIRQ
277  #define ECLIC_GetPriorityIRQ __ECLIC_GetPriorityIRQ
278 #if __ECLIC_VER == 2
279  #define ECLIC_EnableShadow __ECLIC_EnableShadow
280  #define ECLIC_DisableShadow __ECLIC_DisableShadow
281  #define ECLIC_SetShadowLevel __ECLIC_SetShadowLevel
282  #define ECLIC_GetShadowLevel __ECLIC_GetShadowLevel
283  #define ECLIC_SetShadowLevelReg __ECLIC_SetShadowLevelReg
284  #define ECLIC_GetShadowLevelReg __ECLIC_GetShadowLevelReg
285 #endif
286 
287  /* For S-Mode */
288 #if defined(__SMODE_PRESENT) && (__SMODE_PRESENT == 1)
289  #define ECLIC_SetModeIRQ __ECLIC_SetModeIRQ
290  #define ECLIC_SetSth __ECLIC_SetSth
291  #define ECLIC_GetSth __ECLIC_GetSth
292  #define ECLIC_SetPendingIRQ_S __ECLIC_SetPendingIRQ_S
293  #define ECLIC_GetPendingIRQ_S __ECLIC_GetPendingIRQ_S
294  #define ECLIC_ClearPendingIRQ_S __ECLIC_ClearPendingIRQ_S
295  #define ECLIC_SetTrigIRQ_S __ECLIC_SetTrigIRQ_S
296  #define ECLIC_GetTrigIRQ_S __ECLIC_GetTrigIRQ_S
297  #define ECLIC_SetShvIRQ_S __ECLIC_SetShvIRQ_S
298  #define ECLIC_GetShvIRQ_S __ECLIC_GetShvIRQ_S
299  #define ECLIC_SetCtrlIRQ_S __ECLIC_SetCtrlIRQ_S
300  #define ECLIC_GetCtrlIRQ_S __ECLIC_GetCtrlIRQ_S
301  #define ECLIC_SetLevelIRQ_S __ECLIC_SetLevelIRQ_S
302  #define ECLIC_GetLevelIRQ_S __ECLIC_GetLevelIRQ_S
303  #define ECLIC_SetPriorityIRQ_S __ECLIC_SetPriorityIRQ_S
304  #define ECLIC_GetPriorityIRQ_S __ECLIC_GetPriorityIRQ_S
305  #define ECLIC_EnableIRQ_S __ECLIC_EnableIRQ_S
306  #define ECLIC_GetEnableIRQ_S __ECLIC_GetEnableIRQ_S
307  #define ECLIC_DisableIRQ_S __ECLIC_DisableIRQ_S
308 #if __ECLIC_VER == 2
309  #define ECLIC_EnableShadow_S __ECLIC_EnableShadow_S
310  #define ECLIC_DisableShadow_S __ECLIC_DisableShadow_S
311  #define ECLIC_SetShadowLevel_S __ECLIC_SetShadowLevel_S
312  #define ECLIC_GetShadowLevel_S __ECLIC_GetShadowLevel_S
313  #define ECLIC_SetShadowLevelReg_S __ECLIC_SetShadowLevelReg_S
314  #define ECLIC_GetShadowLevelReg_S __ECLIC_GetShadowLevelReg_S
315 #endif
316 
317 #endif
318 #endif /* NMSIS_ECLIC_VIRTUAL */
319 
320 #ifdef NMSIS_VECTAB_VIRTUAL
321  #ifndef NMSIS_VECTAB_VIRTUAL_HEADER_FILE
322  #define NMSIS_VECTAB_VIRTUAL_HEADER_FILE "nmsis_vectab_virtual.h"
323  #endif
324  #include NMSIS_VECTAB_VIRTUAL_HEADER_FILE
325 #else
326  #define ECLIC_SetVector __ECLIC_SetVector
327  #define ECLIC_GetVector __ECLIC_GetVector
328 
329 #if defined(__SMODE_PRESENT) && (__SMODE_PRESENT == 1)
330  #define ECLIC_SetVector_S __ECLIC_SetVector_S
331  #define ECLIC_GetVector_S __ECLIC_GetVector_S
332 #endif
333 #endif /* (NMSIS_VECTAB_VIRTUAL) */
334 
346 {
347  uint8_t temp = ECLIC->CFG;
348 
349  ECLIC->CFG = (temp & ~CLIC_CLICCFG_NLBIT_Msk) | \
350  ((uint8_t)((nlbits << CLIC_CLICCFG_NLBIT_Pos) & CLIC_CLICCFG_NLBIT_Msk));
351 }
352 
364 {
365  return ((uint32_t)((ECLIC->CFG & CLIC_CLICCFG_NLBIT_Msk) >> CLIC_CLICCFG_NLBIT_Pos));
366 }
367 
380 {
381  return ((uint32_t)((ECLIC->INFO & CLIC_CLICINFO_VER_Msk) >> CLIC_CLICINFO_VER_Pos));
382 }
383 
397 {
398  return ((uint32_t)((ECLIC->INFO & CLIC_CLICINFO_CTLBIT_Msk) >> CLIC_CLICINFO_CTLBIT_Pos));
399 }
400 
413 {
414  return ((uint32_t)((ECLIC->INFO & CLIC_CLICINFO_NUM_Msk) >> CLIC_CLICINFO_NUM_Pos));
415 }
416 
433 {
434  return ((uint32_t)((ECLIC->INFO & (CLIC_CLICINFO_SHD_NUM_Msk)) >> CLIC_CLICINFO_SHD_NUM_Pos));
435 }
436 
449 {
450  ECLIC->MTH = mth;
451 }
452 
462 {
463  return (ECLIC->MTH);
464 }
465 
466 
478 {
479  ECLIC->CTRL[IRQn].INTIE |= CLIC_INTIE_IE_Msk;
480 }
481 
497 {
498  return ((uint32_t) (ECLIC->CTRL[IRQn].INTIE) & CLIC_INTIE_IE_Msk);
499 }
500 
512 {
513  ECLIC->CTRL[IRQn].INTIE &= ~CLIC_INTIE_IE_Msk;
514 }
515 
531 {
532  return ((uint32_t)(ECLIC->CTRL[IRQn].INTIP) & CLIC_INTIP_IP_Msk);
533 }
534 
547 {
548  ECLIC->CTRL[IRQn].INTIP |= CLIC_INTIP_IP_Msk;
549 }
550 
564 {
565  ECLIC->CTRL[IRQn].INTIP &= ~CLIC_INTIP_IP_Msk;
566 }
567 
584 __STATIC_FORCEINLINE void __ECLIC_SetTrigIRQ(IRQn_Type IRQn, uint32_t trig)
585 {
586  uint8_t temp = ECLIC->CTRL[IRQn].INTATTR;
587 
588  ECLIC->CTRL[IRQn].INTATTR = (temp & ~CLIC_INTATTR_TRIG_Msk) | \
589  ((uint8_t)(trig << CLIC_INTATTR_TRIG_Pos));
590 }
591 
608 {
609  return ((uint32_t)(((ECLIC->CTRL[IRQn].INTATTR) & CLIC_INTATTR_TRIG_Msk) >> CLIC_INTATTR_TRIG_Pos));
610 }
611 
625 __STATIC_FORCEINLINE void __ECLIC_SetShvIRQ(IRQn_Type IRQn, uint32_t shv)
626 {
627  uint8_t temp = ECLIC->CTRL[IRQn].INTATTR;
628 
629  ECLIC->CTRL[IRQn].INTATTR = (temp & ~CLIC_INTATTR_SHV_Msk) | \
630  ((uint8_t)(shv << CLIC_INTATTR_SHV_Pos));
631 }
632 
647 {
648  return ((uint32_t)(((ECLIC->CTRL[IRQn].INTATTR) & CLIC_INTATTR_SHV_Msk) >> CLIC_INTATTR_SHV_Pos));
649 }
650 
662 __STATIC_FORCEINLINE void __ECLIC_SetCtrlIRQ(IRQn_Type IRQn, uint8_t intctrl)
663 {
664  ECLIC->CTRL[IRQn].INTCTRL = intctrl;
665 }
666 
679 {
680  return (ECLIC->CTRL[IRQn].INTCTRL);
681 }
682 
698 __STATIC_INLINE void __ECLIC_SetLevelIRQ(IRQn_Type IRQn, uint8_t lvl_abs)
699 {
700  uint8_t nlbits = __ECLIC_GetCfgNlbits();
701  uint8_t intctlbits = (uint8_t)__ECLIC_INTCTLBITS;
702 
703  if (nlbits == 0) {
704  return;
705  }
706 
707  if (nlbits > intctlbits) {
708  nlbits = intctlbits;
709  }
710  uint8_t maxlvl = ((1UL << nlbits) - 1);
711  if (lvl_abs > maxlvl) {
712  lvl_abs = maxlvl;
713  }
714  uint8_t lvl = lvl_abs << (ECLIC_MAX_NLBITS - nlbits);
715  uint8_t cur_ctrl = __ECLIC_GetCtrlIRQ(IRQn);
716  cur_ctrl = cur_ctrl << nlbits;
717  cur_ctrl = cur_ctrl >> nlbits;
718  __ECLIC_SetCtrlIRQ(IRQn, (cur_ctrl | lvl));
719 }
720 
733 {
734  uint8_t nlbits = __ECLIC_GetCfgNlbits();
735  uint8_t intctlbits = (uint8_t)__ECLIC_INTCTLBITS;
736 
737  if (nlbits == 0) {
738  return 0;
739  }
740 
741  if (nlbits > intctlbits) {
742  nlbits = intctlbits;
743  }
744  uint8_t intctrl = __ECLIC_GetCtrlIRQ(IRQn);
745  uint8_t lvl_abs = intctrl >> (ECLIC_MAX_NLBITS - nlbits);
746  return lvl_abs;
747 }
748 
763 __STATIC_INLINE void __ECLIC_SetPriorityIRQ(IRQn_Type IRQn, uint8_t pri)
764 {
765  uint8_t nlbits = __ECLIC_GetCfgNlbits();
766  uint8_t intctlbits = (uint8_t)__ECLIC_INTCTLBITS;
767  if (nlbits < intctlbits) {
768  uint8_t maxpri = ((1UL << (intctlbits - nlbits)) - 1);
769  if (pri > maxpri) {
770  pri = maxpri;
771  }
772  pri = pri << (ECLIC_MAX_NLBITS - intctlbits);
773  uint8_t mask = ((uint8_t)(-1)) >> intctlbits;
774  pri = pri | mask;
775  uint8_t cur_ctrl = __ECLIC_GetCtrlIRQ(IRQn);
776  cur_ctrl = cur_ctrl >> (ECLIC_MAX_NLBITS - nlbits);
777  cur_ctrl = cur_ctrl << (ECLIC_MAX_NLBITS - nlbits);
778  __ECLIC_SetCtrlIRQ(IRQn, (cur_ctrl | pri));
779  }
780 }
781 
794 {
795  uint8_t nlbits = __ECLIC_GetCfgNlbits();
796  uint8_t intctlbits = (uint8_t)__ECLIC_INTCTLBITS;
797  if (nlbits < intctlbits) {
798  uint8_t cur_ctrl = __ECLIC_GetCtrlIRQ(IRQn);
799  uint8_t pri = cur_ctrl << nlbits;
800  pri = pri >> nlbits;
801  pri = pri >> (ECLIC_MAX_NLBITS - intctlbits);
802  return pri;
803  } else {
804  return 0;
805  }
806 }
807 
808 #if __ECLIC_VER == 2
809 
820 __STATIC_FORCEINLINE void __ECLIC_EnableShadow(void)
821 {
823 }
824 
836 __STATIC_FORCEINLINE void __ECLIC_DisableShadow(void)
837 {
839 }
840 
859 __STATIC_INLINE void __ECLIC_SetShadowLevel(unsigned long idx, uint8_t level)
860 {
861  /* Check if idx is valid (0-7) */
862  if (idx > 7) {
863  return;
864  }
865 
866  uint8_t nlbits = (uint8_t)__ECLIC_GetCfgNlbits();
867  /* Limit the level value to the available number of bits */
868  uint8_t max_level = (1U << nlbits) - 1;
869  if (level > max_level) {
870  level = max_level;
871  }
872 
873  /* Position the level value in the upper nlbits of the 8-bit field and set the low (8-nlbits) bits to 1 */
874  uint8_t level_shifted = (uint8_t)((level << (8 - nlbits)) | ((1U << (8 - nlbits)) - 1));
875 
876 #if __RISCV_XLEN == 64
877  /* For RV64, all 8 shadow registers are in CSR_MSHADGPRLVL0 */
878  /* Calculate the bit position for the 8-bit field of the specified index */
879  uint32_t bit_pos = idx << 3; /* idx * 8 using bit shift */
880  /* Create mask to clear the 8-bit field for the specified index */
881  uint64_t mask = (uint64_t)0xFFUL << bit_pos;
882  /* Read, modify, and write the CSR register */
883  uint64_t current_val = __RV_CSR_READ(CSR_MSHADGPRLVL0);
884  current_val = (current_val & ~mask) | (((uint64_t)level_shifted) << bit_pos);
885  __RV_CSR_WRITE(CSR_MSHADGPRLVL0, current_val);
886 #else
887  /* For RV32, calculate bit position and select appropriate register */
888  if (idx < 4) {
889  /* Shadow registers 1-4 are in CSR_MSHADGPRLVL0 */
890  uint32_t bit_pos = idx << 3; /* idx * 8 using bit shift */
891  uint32_t mask = 0xFFUL << bit_pos;
892  uint32_t current_val = __RV_CSR_READ(CSR_MSHADGPRLVL0);
893  current_val = (current_val & ~mask) | (((uint32_t)level_shifted) << bit_pos);
894  __RV_CSR_WRITE(CSR_MSHADGPRLVL0, current_val);
895  } else {
896  /* Shadow registers 5-8 are in CSR_MSHADGPRLVL1 */
897  uint32_t bit_pos = (idx - 4) << 3; /* (idx - 4) * 8 using bit shift */
898  uint32_t mask = 0xFFUL << bit_pos;
899  uint32_t current_val = __RV_CSR_READ(CSR_MSHADGPRLVL1);
900  current_val = (current_val & ~mask) | (((uint32_t)level_shifted) << bit_pos);
901  __RV_CSR_WRITE(CSR_MSHADGPRLVL1, current_val);
902  }
903 #endif
904 }
905 
924 __STATIC_INLINE uint8_t __ECLIC_GetShadowLevel(unsigned long idx)
925 {
926  /* Check if idx is valid (0-7) */
927  if (idx > 7) {
928  return 0;
929  }
930 
931  uint8_t nlbits = (uint8_t)__ECLIC_GetCfgNlbits();
932 
933 #if __RISCV_XLEN == 64
934  /* For RV64, all 8 shadow registers are in CSR_MSHADGPRLVL0 */
935  /* Calculate the bit position for the 8-bit field of the specified index */
936  uint32_t bit_pos = idx << 3; /* idx * 8 using bit shift */
937  /* Read the CSR register and extract the 8-bit field */
938  uint64_t current_val = __RV_CSR_READ(CSR_MSHADGPRLVL0);
939  uint8_t extracted_val = (uint8_t)((current_val >> bit_pos) & 0xFF);
940  /* Extract the level from the upper nlbits of the 8-bit field */
941  uint8_t level = (extracted_val >> (8 - nlbits));
942  return level;
943 #else
944  /* For RV32, calculate bit position and select appropriate register */
945  if (idx < 4) {
946  /* Shadow registers 1-4 are in CSR_MSHADGPRLVL0 */
947  uint32_t bit_pos = idx << 3; /* idx * 8 using bit shift */
948  /* Read the CSR register and extract the 8-bit field */
949  uint32_t current_val = __RV_CSR_READ(CSR_MSHADGPRLVL0);
950  uint8_t extracted_val = (uint8_t)((current_val >> bit_pos) & 0xFF);
951  /* Extract the level from the upper nlbits of the 8-bit field */
952  uint8_t level = (extracted_val >> (8 - nlbits));
953  return level;
954  } else {
955  /* Shadow registers 5-8 are in CSR_MSHADGPRLVL1 */
956  uint32_t bit_pos = (idx - 4) << 3; /* (idx - 4) * 8 using bit shift */
957  /* Read the CSR register and extract the 8-bit field */
958  uint32_t current_val = __RV_CSR_READ(CSR_MSHADGPRLVL1);
959  uint8_t extracted_val = (uint8_t)((current_val >> bit_pos) & 0xFF);
960  /* Extract the level from the upper nlbits of the 8-bit field */
961  uint8_t level = (extracted_val >> (8 - nlbits));
962  return level;
963  }
964 #endif
965 }
966 
982 __STATIC_INLINE void __ECLIC_SetShadowLevelReg(uint64_t value)
983 {
984 #if __RISCV_XLEN == 64
986 #else
987  __RV_CSR_WRITE(CSR_MSHADGPRLVL0, (uint32_t)value);
988  __RV_CSR_WRITE(CSR_MSHADGPRLVL1, (uint32_t)(value >> 32));
989 #endif
990 }
991 
1007 __STATIC_INLINE uint64_t __ECLIC_GetShadowLevelReg(void)
1008 {
1009 #if __RISCV_XLEN == 64
1011 #else
1012  uint64_t value = __RV_CSR_READ(CSR_MSHADGPRLVL1);
1013  value <<= 32;
1014  value |= __RV_CSR_READ(CSR_MSHADGPRLVL0);
1015  return value;
1016 #endif
1017 }
1018 #endif
1019 
1037 {
1038  unsigned long vec_base;
1039  vec_base = ((unsigned long)__RV_CSR_READ(CSR_MTVT));
1040  vec_base += ((unsigned long)IRQn) * sizeof(unsigned long);
1041  (* (unsigned long *) vec_base) = vector;
1042 #if (defined(__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1))
1043 #if (defined(__CCM_PRESENT) && (__CCM_PRESENT == 1))
1044  MFlushDCacheLine((unsigned long)vec_base);
1045 #endif
1046 #endif
1047 #if (defined(__ICACHE_PRESENT) && (__ICACHE_PRESENT == 1))
1048 #if (defined(__CCM_PRESENT) && (__CCM_PRESENT == 1))
1049  MInvalICacheLine((unsigned long)vec_base);
1050 #else
1051  __FENCE_I();
1052 #endif
1053 #endif
1054 }
1055 
1069 {
1070 #if __RISCV_XLEN == 32
1071  return (*(uint32_t *)(__RV_CSR_READ(CSR_MTVT) + IRQn * 4));
1072 #elif __RISCV_XLEN == 64
1073  return (*(uint64_t *)(__RV_CSR_READ(CSR_MTVT) + IRQn * 8));
1074 #else // TODO Need cover for XLEN=128 case in future
1075  return (*(uint64_t *)(__RV_CSR_READ(CSR_MTVT) + IRQn * 8));
1076 #endif
1077 }
1078 
1079 #if defined(__SMODE_PRESENT) && (__SMODE_PRESENT == 1)
1080 
1094 __STATIC_FORCEINLINE void __ECLIC_SetModeIRQ(IRQn_Type IRQn, uint32_t mode)
1095 {
1096  /*
1097  * only 1 or 3 can be assigned to mode in one step.the default value of mode is 3,
1098  * which can't be clear to 0 firstly, then OR it to 1
1099  */
1100  ECLIC->CTRL[IRQn].INTATTR = (uint8_t)(mode << CLIC_INTATTR_MODE_Pos) + \
1101  (ECLIC->CTRL[IRQn].INTATTR & (~CLIC_INTATTR_MODE_Msk));
1102 }
1103 
1118 {
1119  ECLIC->STH = sth;
1120 }
1121 
1134 {
1135  return (ECLIC->STH);
1136 }
1137 
1150 {
1151  ECLIC->SCTRL[IRQn].INTIP |= CLIC_INTIP_IP_Msk;
1152 }
1153 
1169 {
1170  return ((uint32_t)(ECLIC->SCTRL[IRQn].INTIP) & CLIC_INTIP_IP_Msk);
1171 }
1172 
1186 {
1187  ECLIC->SCTRL[IRQn].INTIP &= ~CLIC_INTIP_IP_Msk;
1188 }
1189 
1206 __STATIC_FORCEINLINE void __ECLIC_SetTrigIRQ_S(IRQn_Type IRQn, uint32_t trig)
1207 {
1208  uint8_t temp = ECLIC->SCTRL[IRQn].INTATTR;
1209 
1210  ECLIC->SCTRL[IRQn].INTATTR = (temp & ~CLIC_INTATTR_TRIG_Msk) | \
1211  ((uint8_t)(trig << CLIC_INTATTR_TRIG_Pos));
1212 }
1213 
1230 {
1231  return ((uint8_t)(((ECLIC->SCTRL[IRQn].INTATTR) & CLIC_INTATTR_TRIG_Msk) >> CLIC_INTATTR_TRIG_Pos));
1232 }
1233 
1234 
1248 __STATIC_FORCEINLINE void __ECLIC_SetShvIRQ_S(IRQn_Type IRQn, uint32_t shv)
1249 {
1250  uint8_t temp = ECLIC->SCTRL[IRQn].INTATTR;
1251 
1252  ECLIC->SCTRL[IRQn].INTATTR = (temp & ~CLIC_INTATTR_SHV_Msk) | \
1253  ((uint8_t)(shv << CLIC_INTATTR_SHV_Pos));
1254 }
1255 
1270 {
1271  return ((uint8_t)(((ECLIC->SCTRL[IRQn].INTATTR) & CLIC_INTATTR_SHV_Msk) >> CLIC_INTATTR_SHV_Pos));
1272 }
1273 
1285 __STATIC_FORCEINLINE void __ECLIC_SetCtrlIRQ_S(IRQn_Type IRQn, uint8_t intctrl)
1286 {
1287  ECLIC->SCTRL[IRQn].INTCTRL = intctrl;
1288 }
1289 
1302 {
1303  return (ECLIC->SCTRL[IRQn].INTCTRL);
1304 }
1305 
1321 __STATIC_INLINE void __ECLIC_SetLevelIRQ_S(IRQn_Type IRQn, uint8_t lvl_abs)
1322 {
1323  uint8_t nlbits = __ECLIC_GetCfgNlbits();
1324  uint8_t intctlbits = (uint8_t)__ECLIC_INTCTLBITS;
1325 
1326  if (nlbits == 0) {
1327  return;
1328  }
1329 
1330  if (nlbits > intctlbits) {
1331  nlbits = intctlbits;
1332  }
1333  uint8_t maxlvl = ((1UL << nlbits) - 1);
1334  if (lvl_abs > maxlvl) {
1335  lvl_abs = maxlvl;
1336  }
1337  uint8_t lvl = lvl_abs << (ECLIC_MAX_NLBITS - nlbits);
1338  uint8_t cur_ctrl = __ECLIC_GetCtrlIRQ_S(IRQn);
1339  cur_ctrl = cur_ctrl << nlbits;
1340  cur_ctrl = cur_ctrl >> nlbits;
1341  __ECLIC_SetCtrlIRQ_S(IRQn, (cur_ctrl | lvl));
1342 }
1343 
1344 
1357 {
1358  uint8_t nlbits = __ECLIC_GetCfgNlbits();
1359  uint8_t intctlbits = (uint8_t)__ECLIC_INTCTLBITS;
1360 
1361  if (nlbits == 0) {
1362  return 0;
1363  }
1364 
1365  if (nlbits > intctlbits) {
1366  nlbits = intctlbits;
1367  }
1368  uint8_t intctrl = __ECLIC_GetCtrlIRQ_S(IRQn);
1369  uint8_t lvl_abs = intctrl >> (ECLIC_MAX_NLBITS - nlbits);
1370  return lvl_abs;
1371 }
1372 
1387 __STATIC_INLINE void __ECLIC_SetPriorityIRQ_S(IRQn_Type IRQn, uint8_t pri)
1388 {
1389  uint8_t nlbits = __ECLIC_GetCfgNlbits();
1390  uint8_t intctlbits = (uint8_t)__ECLIC_INTCTLBITS;
1391  if (nlbits < intctlbits) {
1392  uint8_t maxpri = ((1UL << (intctlbits - nlbits)) - 1);
1393  if (pri > maxpri) {
1394  pri = maxpri;
1395  }
1396  pri = pri << (ECLIC_MAX_NLBITS - intctlbits);
1397  uint8_t mask = ((uint8_t)(-1)) >> intctlbits;
1398  pri = pri | mask;
1399  uint8_t cur_ctrl = __ECLIC_GetCtrlIRQ_S(IRQn);
1400  cur_ctrl = cur_ctrl >> (ECLIC_MAX_NLBITS - nlbits);
1401  cur_ctrl = cur_ctrl << (ECLIC_MAX_NLBITS - nlbits);
1402  __ECLIC_SetCtrlIRQ_S(IRQn, (cur_ctrl | pri));
1403  }
1404 }
1405 
1418 {
1419  uint8_t nlbits = __ECLIC_GetCfgNlbits();
1420  uint8_t intctlbits = (uint8_t)__ECLIC_INTCTLBITS;
1421  if (nlbits < intctlbits) {
1422  uint8_t cur_ctrl = __ECLIC_GetCtrlIRQ_S(IRQn);
1423  uint8_t pri = cur_ctrl << nlbits;
1424  pri = pri >> nlbits;
1425  pri = pri >> (ECLIC_MAX_NLBITS - intctlbits);
1426  return pri;
1427  } else {
1428  return 0;
1429  }
1430 }
1431 
1443 {
1444  ECLIC->SCTRL[IRQn].INTIE |= CLIC_INTIE_IE_Msk;
1445 }
1446 
1462 {
1463  return ((uint8_t) (ECLIC->SCTRL[IRQn].INTIE) & CLIC_INTIE_IE_Msk);
1464 }
1465 
1477 {
1478  ECLIC->SCTRL[IRQn].INTIE &= ~CLIC_INTIE_IE_Msk;
1479 }
1480 
1498 {
1499  volatile unsigned long vec_base;
1500  vec_base = ((unsigned long)__RV_CSR_READ(CSR_STVT));
1501  vec_base += ((unsigned long)IRQn) * sizeof(unsigned long);
1502  (* (unsigned long *) vec_base) = vector;
1503 #if (defined(__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1))
1504 #if (defined(__CCM_PRESENT) && (__CCM_PRESENT == 1))
1505  SFlushDCacheLine((unsigned long)vec_base);
1506 #endif
1507 #endif
1508 #if (defined(__ICACHE_PRESENT) && (__ICACHE_PRESENT == 1))
1509 #if (defined(__CCM_PRESENT) && (__CCM_PRESENT == 1))
1510  SInvalICacheLine((unsigned long)vec_base);
1511 #else
1512  __FENCE_I();
1513 #endif
1514 #endif
1515 }
1516 
1530 {
1531 #if __RISCV_XLEN == 32
1532  return (*(uint32_t *)(__RV_CSR_READ(CSR_STVT) + IRQn * 4));
1533 #elif __RISCV_XLEN == 64
1534  return (*(uint64_t *)(__RV_CSR_READ(CSR_STVT) + IRQn * 8));
1535 #else // TODO Need cover for XLEN=128 case in future
1536  return (*(uint64_t *)(__RV_CSR_READ(CSR_STVT) + IRQn * 8));
1537 #endif
1538 }
1539 
1540 #if __ECLIC_VER == 2
1541 
1552 __STATIC_FORCEINLINE void __ECLIC_EnableShadow_S(void)
1553 {
1555 }
1556 
1568 __STATIC_FORCEINLINE void __ECLIC_DisableShadow_S(void)
1569 {
1571 }
1572 
1591 __STATIC_INLINE void __ECLIC_SetShadowLevel_S(unsigned long idx, uint8_t level)
1592 {
1593  /* Check if idx is valid (0-7) */
1594  if (idx > 7) {
1595  return;
1596  }
1597 
1598  uint8_t nlbits = (uint8_t)__ECLIC_GetCfgNlbits();
1599  /* Limit the level value to the available number of bits */
1600  uint8_t max_level = (1U << nlbits) - 1;
1601  if (level > max_level) {
1602  level = max_level;
1603  }
1604 
1605  /* Position the level value in the upper nlbits of the 8-bit field and set the low (8-nlbits) bits to 1 */
1606  uint8_t level_shifted = (uint8_t)((level << (8 - nlbits)) | ((1U << (8 - nlbits)) - 1));
1607 
1608 #if __RISCV_XLEN == 64
1609  /* For RV64, all 8 shadow registers are in CSR_SSHADGPRLVL0 */
1610  /* Calculate the bit position for the 8-bit field of the specified index */
1611  uint32_t bit_pos = idx << 3; /* idx * 8 using bit shift */
1612  /* Create mask to clear the 8-bit field for the specified index */
1613  uint64_t mask = (uint64_t)0xFFUL << bit_pos;
1614  /* Read, modify, and write the CSR register */
1615  uint64_t current_val = __RV_CSR_READ(CSR_SSHADGPRLVL0);
1616  current_val = (current_val & ~mask) | (((uint64_t)level_shifted) << bit_pos);
1617  __RV_CSR_WRITE(CSR_SSHADGPRLVL0, current_val);
1618 #else
1619  /* For RV32, calculate bit position and select appropriate register */
1620  if (idx < 4) {
1621  /* Shadow registers 1-4 are in CSR_SSHADGPRLVL0 */
1622  uint32_t bit_pos = idx << 3; /* idx * 8 using bit shift */
1623  uint32_t mask = 0xFFUL << bit_pos;
1624  uint32_t current_val = __RV_CSR_READ(CSR_SSHADGPRLVL0);
1625  current_val = (current_val & ~mask) | (((uint32_t)level_shifted) << bit_pos);
1626  __RV_CSR_WRITE(CSR_SSHADGPRLVL0, current_val);
1627  } else {
1628  /* Shadow registers 5-8 are in CSR_SSHADGPRLVL1 */
1629  uint32_t bit_pos = (idx - 4) << 3; /* (idx - 4) * 8 using bit shift */
1630  uint32_t mask = 0xFFUL << bit_pos;
1631  uint32_t current_val = __RV_CSR_READ(CSR_SSHADGPRLVL1);
1632  current_val = (current_val & ~mask) | (((uint32_t)level_shifted) << bit_pos);
1633  __RV_CSR_WRITE(CSR_SSHADGPRLVL1, current_val);
1634  }
1635 #endif
1636 }
1637 
1656 __STATIC_INLINE uint8_t __ECLIC_GetShadowLevel_S(unsigned long idx)
1657 {
1658  /* Check if idx is valid (0-7) */
1659  if (idx > 7) {
1660  return 0;
1661  }
1662 
1663  uint8_t nlbits = (uint8_t)__ECLIC_GetCfgNlbits();
1664 
1665 #if __RISCV_XLEN == 64
1666  /* For RV64, all 8 shadow registers are in CSR_SSHADGPRLVL0 */
1667  /* Calculate the bit position for the 8-bit field of the specified index */
1668  uint32_t bit_pos = idx << 3; /* idx * 8 using bit shift */
1669  /* Read the CSR register and extract the 8-bit field */
1670  uint64_t current_val = __RV_CSR_READ(CSR_SSHADGPRLVL0);
1671  uint8_t extracted_val = (uint8_t)((current_val >> bit_pos) & 0xFF);
1672  /* Extract the level from the upper nlbits of the 8-bit field */
1673  uint8_t level = (extracted_val >> (8 - nlbits));
1674  return level;
1675 #else
1676  /* For RV32, calculate bit position and select appropriate register */
1677  if (idx < 4) {
1678  /* Shadow registers 1-4 are in CSR_SSHADGPRLVL0 */
1679  uint32_t bit_pos = idx << 3; /* idx * 8 using bit shift */
1680  /* Read the CSR register and extract the 8-bit field */
1681  uint32_t current_val = __RV_CSR_READ(CSR_SSHADGPRLVL0);
1682  uint8_t extracted_val = (uint8_t)((current_val >> bit_pos) & 0xFF);
1683  /* Extract the level from the upper nlbits of the 8-bit field */
1684  uint8_t level = (extracted_val >> (8 - nlbits));
1685  return level;
1686  } else {
1687  /* Shadow registers 5-8 are in CSR_SSHADGPRLVL1 */
1688  uint32_t bit_pos = (idx - 4) << 3; /* (idx - 4) * 8 using bit shift */
1689  /* Read the CSR register and extract the 8-bit field */
1690  uint32_t current_val = __RV_CSR_READ(CSR_SSHADGPRLVL1);
1691  uint8_t extracted_val = (uint8_t)((current_val >> bit_pos) & 0xFF);
1692  /* Extract the level from the upper nlbits of the 8-bit field */
1693  uint8_t level = (extracted_val >> (8 - nlbits));
1694  return level;
1695  }
1696 #endif
1697 }
1698 
1714 __STATIC_INLINE void __ECLIC_SetShadowLevelReg_S(uint64_t value)
1715 {
1716 #if __RISCV_XLEN == 64
1718 #else
1719  __RV_CSR_WRITE(CSR_SSHADGPRLVL0, (uint32_t)value);
1720  __RV_CSR_WRITE(CSR_SSHADGPRLVL1, (uint32_t)(value >> 32));
1721 #endif
1722 }
1723 
1739 __STATIC_INLINE uint64_t __ECLIC_GetShadowLevelReg_S(void)
1740 {
1741 #if __RISCV_XLEN == 64
1743 #else
1744  uint64_t value = __RV_CSR_READ(CSR_SSHADGPRLVL1);
1745  value <<= 32;
1746  value |= __RV_CSR_READ(CSR_SSHADGPRLVL0);
1747  return value;
1748 #endif
1749 }
1750 
1751 #endif
1752 
1753 #endif /* defined(__SMODE_PRESENT) && (__SMODE_PRESENT == 1) */
1754 
1767 {
1768  addr &= (rv_csr_t)(~0x3F);
1769  addr |= ECLIC_MODE_MTVEC_Msk;
1770  __RV_CSR_WRITE(CSR_MTVEC, addr);
1771 }
1772 
1785 {
1786  unsigned long addr = __RV_CSR_READ(CSR_MTVEC);
1787  return (addr & ~ECLIC_MODE_MTVEC_Msk);
1788 }
1789 
1802 {
1803  if (__RV_CSR_READ(CSR_MTVT2) & 0x1) {
1804  __RV_CSR_WRITE(CSR_MTVT2, addr | 0x01);
1805  } else {
1806  addr &= (rv_csr_t)(~0x3F);
1807  addr |= ECLIC_MODE_MTVEC_Msk;
1808  __RV_CSR_WRITE(CSR_MTVEC, addr);
1809  }
1810 }
1811 
1824 {
1825  if (__RV_CSR_READ(CSR_MTVT2) & 0x1) {
1826  return __RV_CSR_READ(CSR_MTVT2) & (~(rv_csr_t)(0x1));
1827  } else {
1829  return (addr & ~ECLIC_MODE_MTVEC_Msk);
1830  }
1831 }
1832 
1844 {
1845  return __RV_CSR_READ(CSR_MNVEC);
1846 }
1847 
1848 /* NOTE: SSUBM CSR is introduced in ECLIC v2, without this the S_Mode vector interrupt nesting
1849  * and non-vector interrupt nesting will not work properly */
1850 #if __ECLIC_VER == 2
1851 #define SAVE_SSUBM_VAR() rv_csr_t __ssubm = __RV_CSR_READ(CSR_SSUBM);
1852 #define RESTORE_SSUBM_VAR() __RV_CSR_WRITE(CSR_SSUBM, __ssubm);
1853 #else
1854 #define SAVE_SSUBM_VAR()
1855 #define RESTORE_SSUBM_VAR()
1856 #endif
1857 
1888 #define SAVE_IRQ_CSR_CONTEXT() \
1889  rv_csr_t __mcause = __RV_CSR_READ(CSR_MCAUSE); \
1890  rv_csr_t __mepc = __RV_CSR_READ(CSR_MEPC); \
1891  rv_csr_t __msubm = __RV_CSR_READ(CSR_MSUBM); \
1892  __enable_irq();
1893 
1895 #define SAVE_IRQ_CSR_CONTEXT_S() \
1896  rv_csr_t __scause = __RV_CSR_READ(CSR_SCAUSE); \
1897  rv_csr_t __sepc = __RV_CSR_READ(CSR_SEPC); \
1898  SAVE_SSUBM_VAR(); \
1899  __enable_irq_s();
1900 
1901 
1911 #define RESTORE_IRQ_CSR_CONTEXT() \
1912  __disable_irq(); \
1913  __RV_CSR_WRITE(CSR_MSUBM, __msubm); \
1914  __RV_CSR_WRITE(CSR_MEPC, __mepc); \
1915  __RV_CSR_WRITE(CSR_MCAUSE, __mcause);
1916 
1918 #define RESTORE_IRQ_CSR_CONTEXT_S() \
1919  __disable_irq_s(); \
1920  RESTORE_SSUBM_VAR(); \
1921  __RV_CSR_WRITE(CSR_SEPC, __sepc); \
1922  __RV_CSR_WRITE(CSR_SCAUSE, __scause);
1923  /* End of Doxygen Group NMSIS_Core_IntExc */
1924 
1925 #endif /* defined(__ECLIC_PRESENT) && (__ECLIC_PRESENT == 1) */
1926 
1927 #ifdef __cplusplus
1928 }
1929 #endif
1930 #endif /* __CORE_FEATURE_ECLIC__ */
__IM
#define __IM
Defines 'read only' structure member permissions.
Definition: nmsis_compiler.h:65
__ECLIC_GetVector
__STATIC_FORCEINLINE rv_csr_t __ECLIC_GetVector(IRQn_Type IRQn)
Get Interrupt Vector of a specific interrupt.
Definition: core_feature_eclic.h:1068
__ECLIC_EnableIRQ_S
__STATIC_FORCEINLINE void __ECLIC_EnableIRQ_S(IRQn_Type IRQn)
Enable a specific interrupt in supervisor mode.
Definition: core_feature_eclic.h:1442
SysTimer_IRQn
@ SysTimer_IRQn
System Timer Interrupt.
Definition: core_feature_eclic.h:224
CSR_SSHADGPRLVL0
#define CSR_SSHADGPRLVL0
Definition: riscv_encoding.h:1105
__ECLIC_SetVector_S
__STATIC_INLINE void __ECLIC_SetVector_S(IRQn_Type IRQn, rv_csr_t vector)
Set Interrupt Vector of a specific interrupt in supervisor mode.
Definition: core_feature_eclic.h:1497
Reserved5_IRQn
@ Reserved5_IRQn
Internal reserved.
Definition: core_feature_eclic.h:223
CLIC_Type::INFO
__IM uint32_t INFO
Offset: 0x004 (R/ ) CLIC information register.
Definition: core_feature_eclic.h:100
CLIC_INTIE_IE_Msk
#define CLIC_INTIE_IE_Msk
CLIC INTIE: IE Mask.
Definition: core_feature_eclic.h:143
__ECLIC_SetShvIRQ
__STATIC_FORCEINLINE void __ECLIC_SetShvIRQ(IRQn_Type IRQn, uint32_t shv)
Set interrupt working mode for a specific interrupt.
Definition: core_feature_eclic.h:625
Reserved3_IRQn
@ Reserved3_IRQn
Internal reserved.
Definition: core_feature_eclic.h:221
CLICINFO_Type::shd_num
__IM uint32_t shd_num
bit: 25..28 number of shadow register groups for single mode(M/S mode)
Definition: core_feature_eclic.h:78
CLIC_INTATTR_TRIG_Pos
#define CLIC_INTATTR_TRIG_Pos
CLIC INTATTR: TRIG Position.
Definition: core_feature_eclic.h:150
CSR_MECLIC_CTL
#define CSR_MECLIC_CTL
Definition: riscv_encoding.h:1037
CLICCFG_Type::w
uint8_t w
Type used for byte access.
Definition: core_feature_eclic.h:67
Reserved14_IRQn
@ Reserved14_IRQn
Internal reserved.
Definition: core_feature_eclic.h:233
__ECLIC_DisableIRQ_S
__STATIC_FORCEINLINE void __ECLIC_DisableIRQ_S(IRQn_Type IRQn)
Disable a specific interrupt in supervisor mode.
Definition: core_feature_eclic.h:1476
CLIC_Type::RESERVED7
__IM uint8_t RESERVED7
Definition: core_feature_eclic.h:115
CLICINFO_Type::numint
__IM uint32_t numint
bit: 0..12 number of maximum interrupt inputs supported
Definition: core_feature_eclic.h:75
CLIC_INTATTR_MODE_Msk
#define CLIC_INTATTR_MODE_Msk
CLIC INTATTA: Mode Mask.
Definition: core_feature_eclic.h:147
__ECLIC_GetTrigIRQ
__STATIC_FORCEINLINE uint32_t __ECLIC_GetTrigIRQ(IRQn_Type IRQn)
Get trigger mode and polarity for a specific interrupt.
Definition: core_feature_eclic.h:607
__ECLIC_SetVector
__STATIC_INLINE void __ECLIC_SetVector(IRQn_Type IRQn, rv_csr_t vector)
Set Interrupt Vector of a specific interrupt.
Definition: core_feature_eclic.h:1036
ECLIC_NEGTIVE_EDGE_TRIGGER
@ ECLIC_NEGTIVE_EDGE_TRIGGER
Negtive/Falling Edge Triggered, trig[0] = 1, trig[1] = 1.
Definition: core_feature_eclic.h:166
CSR_MTVEC
#define CSR_MTVEC
Definition: riscv_encoding.h:672
Reserved7_IRQn
@ Reserved7_IRQn
Internal reserved.
Definition: core_feature_eclic.h:226
__RV_CSR_CLEAR
#define __RV_CSR_CLEAR(csr, val)
CSR operation Macro for csrc instruction.
Definition: core_feature_base.h:799
__ECLIC_GetShvIRQ_S
__STATIC_FORCEINLINE uint8_t __ECLIC_GetShvIRQ_S(IRQn_Type IRQn)
Get interrupt working mode for a specific interrupt in supervisor mode.
Definition: core_feature_eclic.h:1269
CSR_SECLIC_CTL
#define CSR_SECLIC_CTL
Definition: riscv_encoding.h:1107
MInvalICacheLine
__STATIC_INLINE void MInvalICacheLine(unsigned long addr)
Invalidate one I-Cache line specified by address in M-Mode.
Definition: core_feature_cache.h:651
CLIC_INTATTR_SHV_Pos
#define CLIC_INTATTR_SHV_Pos
CLIC INTATTR: SHV Position.
Definition: core_feature_eclic.h:153
__set_exc_entry
__STATIC_FORCEINLINE void __set_exc_entry(rv_csr_t addr)
Set Exception entry address.
Definition: core_feature_eclic.h:1766
__ECLIC_GetInfoShadowNum
__STATIC_FORCEINLINE uint32_t __ECLIC_GetInfoShadowNum(void)
Get number of shadow register groups.
Definition: core_feature_eclic.h:432
__ECLIC_GetMth
__STATIC_FORCEINLINE uint8_t __ECLIC_GetMth(void)
Get Machine Mode Interrupt Level Threshold.
Definition: core_feature_eclic.h:461
__ECLIC_SetShvIRQ_S
__STATIC_FORCEINLINE void __ECLIC_SetShvIRQ_S(IRQn_Type IRQn, uint32_t shv)
Set interrupt working mode for a specific interrupt in supervisor mode.
Definition: core_feature_eclic.h:1248
__ECLIC_SetLevelIRQ
__STATIC_INLINE void __ECLIC_SetLevelIRQ(IRQn_Type IRQn, uint8_t lvl_abs)
Set ECLIC Interrupt level of a specific interrupt.
Definition: core_feature_eclic.h:698
Reserved6_IRQn
@ Reserved6_IRQn
Internal reserved.
Definition: core_feature_eclic.h:225
__ECLIC_GetLevelIRQ
__STATIC_INLINE uint8_t __ECLIC_GetLevelIRQ(IRQn_Type IRQn)
Get ECLIC Interrupt level of a specific interrupt.
Definition: core_feature_eclic.h:732
__ECLIC_SetPendingIRQ_S
__STATIC_FORCEINLINE void __ECLIC_SetPendingIRQ_S(IRQn_Type IRQn)
Set a specific interrupt to pending in supervisor mode.
Definition: core_feature_eclic.h:1149
Reserved0_IRQn
@ Reserved0_IRQn
Internal reserved.
Definition: core_feature_eclic.h:217
CLIC_Type::STH
__IOM uint8_t STH
Offset: 0x009 (R/W ) CLIC supervisor mode interrupt-level threshold.
Definition: core_feature_eclic.h:103
CLIC_CTRL_Type::INTIE
__IOM uint8_t INTIE
Offset: 0x001 (R/W) Interrupt set enable register.
Definition: core_feature_eclic.h:89
__ECLIC_GetPriorityIRQ
__STATIC_INLINE uint8_t __ECLIC_GetPriorityIRQ(IRQn_Type IRQn)
Get ECLIC Interrupt priority of a specific interrupt.
Definition: core_feature_eclic.h:793
CLICCFG_Type::nlbits
__IOM uint8_t nlbits
bit: 1..4 specified the bit-width of level and priority in the register clicintctl[i]
Definition: core_feature_eclic.h:63
CSR_MSHADGPRLVL1
#define CSR_MSHADGPRLVL1
Definition: riscv_encoding.h:1036
CLIC_CLICCFG_NLBIT_Msk
#define CLIC_CLICCFG_NLBIT_Msk
CLIC CLICCFG: NLBIT Mask.
Definition: core_feature_eclic.h:125
CLICCFG_Type
Union type to access CLICFG configure register.
Definition: core_feature_eclic.h:59
CLICCFG_Type::_reserved1
__IM uint8_t _reserved1
Definition: core_feature_eclic.h:65
Reserved8_IRQn
@ Reserved8_IRQn
Internal reserved.
Definition: core_feature_eclic.h:227
__ECLIC_SetPriorityIRQ_S
__STATIC_INLINE void __ECLIC_SetPriorityIRQ_S(IRQn_Type IRQn, uint8_t pri)
Set ECLIC Interrupt priority of a specific interrupt in supervisor mode.
Definition: core_feature_eclic.h:1387
__IOM
#define __IOM
Defines 'read/write' structure member permissions.
Definition: nmsis_compiler.h:69
CLIC_CTRL_Type::INTATTR
__IOM uint8_t INTATTR
Offset: 0x002 (R/W) Interrupt set attributes register.
Definition: core_feature_eclic.h:90
CLICINFO_Type::_reserved0
__IM uint32_t _reserved0
bit: 29..31 Reserved
Definition: core_feature_eclic.h:79
ECLIC_POSTIVE_EDGE_TRIGGER
@ ECLIC_POSTIVE_EDGE_TRIGGER
Postive/Rising Edge Triggered, trig[0] = 1, trig[1] = 0.
Definition: core_feature_eclic.h:165
CSR_MTVT
#define CSR_MTVT
Definition: riscv_encoding.h:1002
__ECLIC_GetCtrlIRQ_S
__STATIC_FORCEINLINE uint8_t __ECLIC_GetCtrlIRQ_S(IRQn_Type IRQn)
Get ECLIC Interrupt Input Control Register value for a specific interrupt in supervisor mode.
Definition: core_feature_eclic.h:1301
CSR_STVT
#define CSR_STVT
Definition: riscv_encoding.h:657
__ECLIC_GetInfoVer
__STATIC_FORCEINLINE uint32_t __ECLIC_GetInfoVer(void)
Get the ECLIC version number.
Definition: core_feature_eclic.h:379
ECLIC_MODE_MTVEC_Msk
#define ECLIC_MODE_MTVEC_Msk
ECLIC Mode mask for MTVT CSR Register.
Definition: core_feature_eclic.h:157
CLIC_INTATTR_MODE_Pos
#define CLIC_INTATTR_MODE_Pos
CLIC INTATTA: Mode Position.
Definition: core_feature_eclic.h:146
IRQn
IRQn
Definition of IRQn numbers.
Definition: core_feature_eclic.h:214
__ECLIC_SetLevelIRQ_S
__STATIC_INLINE void __ECLIC_SetLevelIRQ_S(IRQn_Type IRQn, uint8_t lvl_abs)
Set ECLIC Interrupt level of a specific interrupt in supervisor mode.
Definition: core_feature_eclic.h:1321
__ECLIC_SetMth
__STATIC_FORCEINLINE void __ECLIC_SetMth(uint8_t mth)
Set Machine Mode Interrupt Level Threshold.
Definition: core_feature_eclic.h:448
ECLIC
#define ECLIC
CLIC configuration struct.
Definition: core_feature_eclic.h:187
__RV_CSR_WRITE
#define __RV_CSR_WRITE(csr, val)
CSR operation Macro for csrw instruction.
Definition: core_feature_base.h:725
CLIC_Type
Access to the structure of ECLIC Memory Map.
Definition: core_feature_eclic.h:97
__ECLIC_SetPriorityIRQ
__STATIC_INLINE void __ECLIC_SetPriorityIRQ(IRQn_Type IRQn, uint8_t pri)
Get ECLIC Interrupt priority of a specific interrupt.
Definition: core_feature_eclic.h:763
CSR_SSHADGPRLVL1
#define CSR_SSHADGPRLVL1
Definition: riscv_encoding.h:1106
SECLIC_CTL_SHADOW_EN
#define SECLIC_CTL_SHADOW_EN
Definition: riscv_encoding.h:285
__ECLIC_GetPriorityIRQ_S
__STATIC_INLINE uint8_t __ECLIC_GetPriorityIRQ_S(IRQn_Type IRQn)
Get ECLIC Interrupt priority of a specific interrupt in supervisor mode.
Definition: core_feature_eclic.h:1417
__ECLIC_SetCtrlIRQ
__STATIC_FORCEINLINE void __ECLIC_SetCtrlIRQ(IRQn_Type IRQn, uint8_t intctrl)
Modify ECLIC Interrupt Input Control Register for a specific interrupt.
Definition: core_feature_eclic.h:662
__ECLIC_ClearPendingIRQ_S
__STATIC_FORCEINLINE void __ECLIC_ClearPendingIRQ_S(IRQn_Type IRQn)
Clear a specific interrupt from pending in supervisor mode.
Definition: core_feature_eclic.h:1185
__ECLIC_GetPendingIRQ_S
__STATIC_FORCEINLINE int32_t __ECLIC_GetPendingIRQ_S(IRQn_Type IRQn)
Get the pending specific interrupt in supervisor mode.
Definition: core_feature_eclic.h:1168
CLIC_CLICINFO_CTLBIT_Pos
#define CLIC_CLICINFO_CTLBIT_Pos
CLIC INTINFO: CLICINTCTLBITS Position.
Definition: core_feature_eclic.h:127
__ECLIC_SetTrigIRQ
__STATIC_FORCEINLINE void __ECLIC_SetTrigIRQ(IRQn_Type IRQn, uint32_t trig)
Set trigger mode and polarity for a specific interrupt.
Definition: core_feature_eclic.h:584
__FENCE_I
__STATIC_FORCEINLINE void __FENCE_I(void)
Fence.i Instruction.
Definition: core_feature_base.h:841
SOC_INT_MAX
@ SOC_INT_MAX
Number of total interrupts.
Definition: core_feature_eclic.h:244
CLICCFG_Type::_reserved0
__IM uint8_t _reserved0
Definition: core_feature_eclic.h:62
CLIC_CTRL_Type
Access to the machine mode register structure of INTIP, INTIE, INTATTR, INTCTL.
Definition: core_feature_eclic.h:87
CLIC_Type::RESERVED3
__IM uint8_t RESERVED3
Definition: core_feature_eclic.h:107
__ECLIC_GetInfoNum
__STATIC_FORCEINLINE uint32_t __ECLIC_GetInfoNum(void)
Get number of maximum interrupt inputs supported.
Definition: core_feature_eclic.h:412
ECLIC_LEVEL_TRIGGER
@ ECLIC_LEVEL_TRIGGER
Level Triggerred, trig[0] = 0.
Definition: core_feature_eclic.h:164
CLIC_CLICINFO_SHD_NUM_Msk
#define CLIC_CLICINFO_SHD_NUM_Msk
CLIC CLICINFO: SHD_NUM Mask.
Definition: core_feature_eclic.h:137
CLICINFO_Type::intctlbits
__IM uint32_t intctlbits
bit: 21..24 specifies how many hardware bits are actually implemented in the clicintctl registers
Definition: core_feature_eclic.h:77
SInvalICacheLine
__STATIC_INLINE void SInvalICacheLine(unsigned long addr)
Invalidate one I-Cache line specified by address in S-Mode.
Definition: core_feature_cache.h:693
CLIC_INTATTR_SHV_Msk
#define CLIC_INTATTR_SHV_Msk
CLIC INTATTR: SHV Mask.
Definition: core_feature_eclic.h:154
ECLIC_MAX_TRIGGER
@ ECLIC_MAX_TRIGGER
MAX Supported Trigger Mode.
Definition: core_feature_eclic.h:167
__STATIC_INLINE
#define __STATIC_INLINE
Define a static function that may be inlined by the compiler.
Definition: nmsis_gcc.h:65
CLIC_Type::RESERVED1
__IM uint8_t RESERVED1
Definition: core_feature_eclic.h:101
__ECLIC_GetShvIRQ
__STATIC_FORCEINLINE uint32_t __ECLIC_GetShvIRQ(IRQn_Type IRQn)
Get interrupt working mode for a specific interrupt.
Definition: core_feature_eclic.h:646
__ECLIC_GetSth
__STATIC_FORCEINLINE uint8_t __ECLIC_GetSth(void)
Get supervisor-mode Interrupt Level Threshold in supervisor mode.
Definition: core_feature_eclic.h:1133
__ECLIC_DisableIRQ
__STATIC_FORCEINLINE void __ECLIC_DisableIRQ(IRQn_Type IRQn)
Disable a specific interrupt.
Definition: core_feature_eclic.h:511
CLIC_CLICINFO_SHD_NUM_Pos
#define CLIC_CLICINFO_SHD_NUM_Pos
CLIC CLICINFO: SHD_NUM Position.
Definition: core_feature_eclic.h:136
__ECLIC_EnableIRQ
__STATIC_FORCEINLINE void __ECLIC_EnableIRQ(IRQn_Type IRQn)
Enable a specific interrupt.
Definition: core_feature_eclic.h:477
FirstDeviceSpecificInterrupt_IRQn
@ FirstDeviceSpecificInterrupt_IRQn
First Device Specific Interrupt.
Definition: core_feature_eclic.h:243
Reserved16_IRQn
@ Reserved16_IRQn
Internal reserved.
Definition: core_feature_eclic.h:235
Reserved9_IRQn
@ Reserved9_IRQn
Internal reserved.
Definition: core_feature_eclic.h:228
CLIC_CTRL_Type::INTIP
__IOM uint8_t INTIP
Offset: 0x000 (R/W) Interrupt set pending register.
Definition: core_feature_eclic.h:88
__ECLIC_SetTrigIRQ_S
__STATIC_FORCEINLINE void __ECLIC_SetTrigIRQ_S(IRQn_Type IRQn, uint32_t trig)
Set trigger mode and polarity for a specific interrupt in supervisor mode.
Definition: core_feature_eclic.h:1206
CLIC_Type::MTH
__IOM uint8_t MTH
Offset: 0x00B(R/W) CLIC machine mode interrupt-level threshold.
Definition: core_feature_eclic.h:108
CLIC_Type::RESERVED8
__IM uint8_t RESERVED8
Definition: core_feature_eclic.h:116
CLIC_CLICINFO_NUM_Msk
#define CLIC_CLICINFO_NUM_Msk
CLIC CLICINFO: NUM_INTERRUPT Mask.
Definition: core_feature_eclic.h:134
__STATIC_FORCEINLINE
#define __STATIC_FORCEINLINE
Define a static function that should be always inlined by the compiler.
Definition: nmsis_gcc.h:70
__ECLIC_GetEnableIRQ
__STATIC_FORCEINLINE uint32_t __ECLIC_GetEnableIRQ(IRQn_Type IRQn)
Get a specific interrupt enable status.
Definition: core_feature_eclic.h:496
MFlushDCacheLine
__STATIC_INLINE void MFlushDCacheLine(unsigned long addr)
Flush one D-Cache line specified by address in M-Mode.
Definition: core_feature_cache.h:1576
__ECLIC_GetCfgNlbits
__STATIC_FORCEINLINE uint32_t __ECLIC_GetCfgNlbits(void)
Get nlbits value.
Definition: core_feature_eclic.h:363
Reserved15_IRQn
@ Reserved15_IRQn
Internal reserved.
Definition: core_feature_eclic.h:234
ECLIC_MAX_NLBITS
#define ECLIC_MAX_NLBITS
Max nlbit of the CLICINTCTLBITS.
Definition: core_feature_eclic.h:156
Reserved2_IRQn
@ Reserved2_IRQn
Internal reserved.
Definition: core_feature_eclic.h:219
CLIC_CLICCFG_NLBIT_Pos
#define CLIC_CLICCFG_NLBIT_Pos
CLIC CLICCFG: NLBIT Position.
Definition: core_feature_eclic.h:124
CSR_MNVEC
#define CSR_MNVEC
Definition: riscv_encoding.h:1017
CLICINFO_Type
Union type to access CLICINFO information register.
Definition: core_feature_eclic.h:73
Reserved11_IRQn
@ Reserved11_IRQn
Internal reserved.
Definition: core_feature_eclic.h:230
CLIC_CTRL_Type::INTCTRL
__IOM uint8_t INTCTRL
Offset: 0x003 (R/W) Interrupt configure register.
Definition: core_feature_eclic.h:91
__RV_CSR_READ
#define __RV_CSR_READ(csr)
CSR operation Macro for csrr instruction.
Definition: core_feature_base.h:707
__set_nonvec_entry
__STATIC_INLINE void __set_nonvec_entry(rv_csr_t addr)
Set Non-vector interrupt entry address.
Definition: core_feature_eclic.h:1801
__get_nmi_entry
__STATIC_FORCEINLINE rv_csr_t __get_nmi_entry(void)
Get NMI interrupt entry from 'CSR_MNVEC'.
Definition: core_feature_eclic.h:1843
__ECLIC_GetEnableIRQ_S
__STATIC_FORCEINLINE uint8_t __ECLIC_GetEnableIRQ_S(IRQn_Type IRQn)
Get a specific interrupt enable status in supervisor mode.
Definition: core_feature_eclic.h:1461
CLIC_INTATTR_TRIG_Msk
#define CLIC_INTATTR_TRIG_Msk
CLIC INTATTR: TRIG Mask.
Definition: core_feature_eclic.h:151
Reserved10_IRQn
@ Reserved10_IRQn
Internal reserved.
Definition: core_feature_eclic.h:229
__ECLIC_GetCtrlIRQ
__STATIC_FORCEINLINE uint8_t __ECLIC_GetCtrlIRQ(IRQn_Type IRQn)
Get ECLIC Interrupt Input Control Register value for a specific interrupt.
Definition: core_feature_eclic.h:678
CSR_MSHADGPRLVL0
#define CSR_MSHADGPRLVL0
Definition: riscv_encoding.h:1035
SFlushDCacheLine
__STATIC_INLINE void SFlushDCacheLine(unsigned long addr)
Flush one D-Cache line specified by address in S-Mode.
Definition: core_feature_cache.h:1617
__ECLIC_SetCtrlIRQ_S
__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.
Definition: core_feature_eclic.h:1285
__ECLIC_GetPendingIRQ
__STATIC_FORCEINLINE int32_t __ECLIC_GetPendingIRQ(IRQn_Type IRQn)
Get the pending specific interrupt.
Definition: core_feature_eclic.h:530
CSR_MTVT2
#define CSR_MTVT2
Definition: riscv_encoding.h:1041
__ECLIC_ClearPendingIRQ
__STATIC_FORCEINLINE void __ECLIC_ClearPendingIRQ(IRQn_Type IRQn)
Clear a specific interrupt from pending.
Definition: core_feature_eclic.h:563
CLIC_Type::CFG
__IOM uint8_t CFG
Offset: 0x000 (R/W) CLIC configuration register.
Definition: core_feature_eclic.h:98
CLIC_Type::RESERVED6
__IM uint8_t RESERVED6
Definition: core_feature_eclic.h:113
__get_exc_entry
__STATIC_FORCEINLINE rv_csr_t __get_exc_entry(void)
Get Exception entry address.
Definition: core_feature_eclic.h:1784
__RV_CSR_SET
#define __RV_CSR_SET(csr, val)
CSR operation Macro for csrs instruction.
Definition: core_feature_base.h:762
__ECLIC_SetSth
__STATIC_FORCEINLINE void __ECLIC_SetSth(uint8_t sth)
Set supervisor-mode Interrupt Level Threshold in supervisor mode.
Definition: core_feature_eclic.h:1117
CLIC_Type::SSTH
__IOM uint8_t SSTH
Offset: 0x2009 (R) CLIC supervisor mode threshold register, which is a mirror to mintthresh....
Definition: core_feature_eclic.h:114
Reserved4_IRQn
@ Reserved4_IRQn
Internal reserved.
Definition: core_feature_eclic.h:222
Reserved13_IRQn
@ Reserved13_IRQn
Internal reserved.
Definition: core_feature_eclic.h:232
__get_nonvec_entry
__STATIC_INLINE rv_csr_t __get_nonvec_entry(void)
Get Non-vector interrupt entry address.
Definition: core_feature_eclic.h:1823
__ECLIC_GetLevelIRQ_S
__STATIC_INLINE uint8_t __ECLIC_GetLevelIRQ_S(IRQn_Type IRQn)
Get ECLIC Interrupt level of a specific interrupt.
Definition: core_feature_eclic.h:1356
CLICINFO_Type::version
__IM uint32_t version
bit: 13..20 Hardware implementation version number.
Definition: core_feature_eclic.h:76
Reserved1_IRQn
@ Reserved1_IRQn
Internal reserved.
Definition: core_feature_eclic.h:218
SysTimerSW_IRQn
@ SysTimerSW_IRQn
System Timer SW interrupt.
Definition: core_feature_eclic.h:220
CLICINFO_Type::w
__IM uint32_t w
Type used for word access.
Definition: core_feature_eclic.h:81
__ECLIC_GetVector_S
__STATIC_FORCEINLINE rv_csr_t __ECLIC_GetVector_S(IRQn_Type IRQn)
Get Interrupt Vector of a specific interrupt in supervisor mode.
Definition: core_feature_eclic.h:1529
__ECLIC_GetTrigIRQ_S
__STATIC_FORCEINLINE uint8_t __ECLIC_GetTrigIRQ_S(IRQn_Type IRQn)
Get trigger mode and polarity for a specific interrupt in supervisor mode.
Definition: core_feature_eclic.h:1229
CLIC_CLICINFO_VER_Pos
#define CLIC_CLICINFO_VER_Pos
CLIC CLICINFO: VERSION Position.
Definition: core_feature_eclic.h:130
__ECLIC_GetInfoCtlbits
__STATIC_FORCEINLINE uint32_t __ECLIC_GetInfoCtlbits(void)
Get CLICINTCTLBITS.
Definition: core_feature_eclic.h:396
__ECLIC_SetModeIRQ
__STATIC_FORCEINLINE void __ECLIC_SetModeIRQ(IRQn_Type IRQn, uint32_t mode)
Set privilege mode of a specific interrupt.
Definition: core_feature_eclic.h:1094
MECLIC_CTL_SHADOW_EN
#define MECLIC_CTL_SHADOW_EN
Definition: riscv_encoding.h:281
CLIC_CLICINFO_CTLBIT_Msk
#define CLIC_CLICINFO_CTLBIT_Msk
CLIC INTINFO: CLICINTCTLBITS Mask.
Definition: core_feature_eclic.h:128
Reserved12_IRQn
@ Reserved12_IRQn
Internal reserved.
Definition: core_feature_eclic.h:231
__ECLIC_SetPendingIRQ
__STATIC_FORCEINLINE void __ECLIC_SetPendingIRQ(IRQn_Type IRQn)
Set a specific interrupt to pending.
Definition: core_feature_eclic.h:546
CLICCFG_Type::nmbits
__IM uint8_t nmbits
bit: 5..6 ties to 1 if supervisor-level interrupt supported, or else it's reserved
Definition: core_feature_eclic.h:64
rv_csr_t
unsigned long rv_csr_t
Type of Control and Status Register(CSR), depends on the XLEN defined in RISC-V.
Definition: core_feature_base.h:55
CLIC_INTIP_IP_Msk
#define CLIC_INTIP_IP_Msk
CLIC INTIP: IP Mask.
Definition: core_feature_eclic.h:140
__ECLIC_SetCfgNlbits
__STATIC_FORCEINLINE void __ECLIC_SetCfgNlbits(uint32_t nlbits)
Set nlbits value.
Definition: core_feature_eclic.h:345
CLIC_CLICINFO_NUM_Pos
#define CLIC_CLICINFO_NUM_Pos
CLIC CLICINFO: NUM_INTERRUPT Position.
Definition: core_feature_eclic.h:133
CLIC_CLICINFO_VER_Msk
#define CLIC_CLICINFO_VER_Msk
CLIC CLICINFO: VERSION Mask.
Definition: core_feature_eclic.h:131