ZCC reports error for nuclei register “shartid”. But ZCC can work for nuclei register ‘mhartid’.
The mhartid is a CSR defined by the RISC-V standard, whereas shartid is a custom CSR introduced by Nuclei. You can handle it the same way as in Nuclei-SDK:
#define CSR_SHARTID 0xDC0
__STATIC_FORCEINLINE unsigned long __get_hart_index_s(void)
{
unsigned long id;
#ifdef __HARTID_OFFSET
id = __RV_CSR_READ(CSR_SHARTID) - __HARTID_OFFSET;
#else
id = __RV_CSR_READ(CSR_SHARTID);
#endif
return id;
}
