![]() |
NMSIS-Core
Version 1.6.0
NMSIS-Core support for Nuclei processor-based devices
|
Type definitions and defines for plic registers. More...
Macros | |
| #define | PLIC_PRIORITY_OFFSET _AC(0x0000,UL) |
| PLIC Priority register offset. More... | |
| #define | PLIC_PRIORITY_SHIFT_PER_SOURCE 2 |
| log2(4), shift per source More... | |
| #define | PLIC_PENDING_OFFSET _AC(0x1000,UL) |
| PLIC Pending register offset. More... | |
| #define | PLIC_PENDING_SHIFT_PER_SOURCE 0 |
| bit index within word More... | |
| #define | PLIC_ENABLE_OFFSET _AC(0x2000,UL) |
| PLIC Enable register offset. More... | |
| #define | PLIC_ENABLE_SHIFT_PER_CONTEXT 7 |
| log2(0x80), shift per context More... | |
| #define | PLIC_THRESHOLD_OFFSET _AC(0x200000,UL) |
| PLIC Threshold register offset. More... | |
| #define | PLIC_CLAIM_OFFSET _AC(0x200004,UL) |
| PLIC Claim/Complete register offset. More... | |
| #define | PLIC_THRESHOLD_SHIFT_PER_CONTEXT 12 |
| log2(0x1000), shift per context More... | |
| #define | PLIC_CLAIM_SHIFT_PER_CONTEXT 12 |
| log2(0x1000), shift per context More... | |
| #define | PLIC_BASE __PLIC_BASEADDR |
| PLIC Base Address. More... | |
| #define | PLIC_GetHartID() (__get_hart_index()) |
| PLIC_GetHartID() is used to get plic hartid which might not be the same as cpu hart id, for example, cpu hartid may be 1, but plic hartid may be 0, then plic hartid offset is 1. More... | |
| #define | PLIC_GetHartID_S() (__get_hart_index_s()) |
| #define | PLIC_GetHartMContextID() (PLIC_GetHartID() << 1) |
| #define | PLIC_GetHartSContextID() ((PLIC_GetHartID_S() << 1) + 1) |
| #define | PLIC_PRIORITY_REGADDR(source) ((PLIC_BASE) + (PLIC_PRIORITY_OFFSET) + ((source) << PLIC_PRIORITY_SHIFT_PER_SOURCE)) |
| #define | PLIC_PENDING_REGADDR(source) ((PLIC_BASE) + (PLIC_PENDING_OFFSET) + (((source) >> 5) * 4)) |
| #define | PLIC_ENABLE_REGADDR(ctxid, source) ((PLIC_BASE) + (PLIC_ENABLE_OFFSET) + ((ctxid) << PLIC_ENABLE_SHIFT_PER_CONTEXT) + ((source) >> 5) * 4) |
| #define | PLIC_THRESHOLD_REGADDR(ctxid) ((PLIC_BASE) + (PLIC_THRESHOLD_OFFSET) + ((ctxid) << PLIC_THRESHOLD_SHIFT_PER_CONTEXT)) |
| #define | PLIC_CLAIM_REGADDR(ctxid) ((PLIC_BASE) + (PLIC_CLAIM_OFFSET) + ((ctxid) << PLIC_CLAIM_SHIFT_PER_CONTEXT)) |
| #define | PLIC_COMPLETE_REGADDR(ctxid) (PLIC_CLAIM_REGADDR(ctxid)) |
Type definitions and defines for plic registers.
| #define PLIC_BASE __PLIC_BASEADDR |
PLIC Base Address.
Definition at line 121 of file core_feature_plic.h.
| #define PLIC_CLAIM_OFFSET _AC(0x200004,UL) |
PLIC Claim/Complete register offset.
Definition at line 111 of file core_feature_plic.h.
| #define PLIC_CLAIM_REGADDR | ( | ctxid | ) | ((PLIC_BASE) + (PLIC_CLAIM_OFFSET) + ((ctxid) << PLIC_CLAIM_SHIFT_PER_CONTEXT)) |
Definition at line 152 of file core_feature_plic.h.
| #define PLIC_CLAIM_SHIFT_PER_CONTEXT 12 |
log2(0x1000), shift per context
Definition at line 113 of file core_feature_plic.h.
| #define PLIC_COMPLETE_REGADDR | ( | ctxid | ) | (PLIC_CLAIM_REGADDR(ctxid)) |
Definition at line 153 of file core_feature_plic.h.
| #define PLIC_ENABLE_OFFSET _AC(0x2000,UL) |
PLIC Enable register offset.
Definition at line 106 of file core_feature_plic.h.
| #define PLIC_ENABLE_REGADDR | ( | ctxid, | |
| source | |||
| ) | ((PLIC_BASE) + (PLIC_ENABLE_OFFSET) + ((ctxid) << PLIC_ENABLE_SHIFT_PER_CONTEXT) + ((source) >> 5) * 4) |
Definition at line 150 of file core_feature_plic.h.
| #define PLIC_ENABLE_SHIFT_PER_CONTEXT 7 |
log2(0x80), shift per context
Definition at line 107 of file core_feature_plic.h.
| #define PLIC_GetHartID | ( | ) | (__get_hart_index()) |
PLIC_GetHartID() is used to get plic hartid which might not be the same as cpu hart id, for example, cpu hartid may be 1, but plic hartid may be 0, then plic hartid offset is 1.
If defined __PLIC_HARTID, it will use __PLIC_HARTID as plic hartid, otherwise, it will use __get_hart_index(). The cpu hartid is get by using __get_hart_id function
Definition at line 131 of file core_feature_plic.h.
| #define PLIC_GetHartID_S | ( | ) | (__get_hart_index_s()) |
Definition at line 132 of file core_feature_plic.h.
| #define PLIC_GetHartMContextID | ( | ) | (PLIC_GetHartID() << 1) |
Definition at line 144 of file core_feature_plic.h.
| #define PLIC_GetHartSContextID | ( | ) | ((PLIC_GetHartID_S() << 1) + 1) |
Definition at line 146 of file core_feature_plic.h.
| #define PLIC_PENDING_OFFSET _AC(0x1000,UL) |
PLIC Pending register offset.
Definition at line 102 of file core_feature_plic.h.
| #define PLIC_PENDING_REGADDR | ( | source | ) | ((PLIC_BASE) + (PLIC_PENDING_OFFSET) + (((source) >> 5) * 4)) |
Definition at line 149 of file core_feature_plic.h.
| #define PLIC_PENDING_SHIFT_PER_SOURCE 0 |
bit index within word
Definition at line 103 of file core_feature_plic.h.
| #define PLIC_PRIORITY_OFFSET _AC(0x0000,UL) |
PLIC Priority register offset.
Definition at line 98 of file core_feature_plic.h.
| #define PLIC_PRIORITY_REGADDR | ( | source | ) | ((PLIC_BASE) + (PLIC_PRIORITY_OFFSET) + ((source) << PLIC_PRIORITY_SHIFT_PER_SOURCE)) |
Definition at line 148 of file core_feature_plic.h.
| #define PLIC_PRIORITY_SHIFT_PER_SOURCE 2 |
log2(4), shift per source
Definition at line 99 of file core_feature_plic.h.
| #define PLIC_THRESHOLD_OFFSET _AC(0x200000,UL) |
PLIC Threshold register offset.
Definition at line 110 of file core_feature_plic.h.
| #define PLIC_THRESHOLD_REGADDR | ( | ctxid | ) | ((PLIC_BASE) + (PLIC_THRESHOLD_OFFSET) + ((ctxid) << PLIC_THRESHOLD_SHIFT_PER_CONTEXT)) |
Definition at line 151 of file core_feature_plic.h.
| #define PLIC_THRESHOLD_SHIFT_PER_CONTEXT 12 |
log2(0x1000), shift per context
Definition at line 112 of file core_feature_plic.h.