Skip to content
This repository was archived by the owner on Nov 22, 2023. It is now read-only.

how to solve this issue 'mstatus' undeclared (first use in this function) #421

Closed
takeshineshiro opened this issue Jun 24, 2022 · 2 comments

Comments

@takeshineshiro
Copy link

hi, when i use docker and follow the Quick Start to run the platform . when i go to the step of Build the software with make cmd , some errors like this blow:
root@59651dd59bcc:/repo/hw/system/snitch_cluster/sw/build# make
[ 3%] Building C object snRuntime/CMakeFiles/snRuntime-cluster.dir/src/platforms/shared/start.c.o
In file included from /repo/sw/snRuntime/src/platforms/shared/../../team.h:5:0,
from /repo/sw/snRuntime/src/platforms/shared/start.c:4:
/repo/sw/snRuntime/include/snrt.h: In function 'snrt_interrupt_global_enable':
/repo/sw/snRuntime/include/snrt.h:208:5: warning: implicit declaration of function 'set_csr' [-Wimplicit-function-declaration]
set_csr(mstatus, MSTATUS_MIE); // set M global interrupt enable
^~~~~~~
/repo/sw/snRuntime/include/snrt.h:208:13: error: 'mstatus' undeclared (first use in this function)
set_csr(mstatus, MSTATUS_MIE); // set M global interrupt enable
^~~~~~~
/repo/sw/snRuntime/include/snrt.h:208:13: note: each undeclared identifier is reported only once for each function it appears in
/repo/sw/snRuntime/include/snrt.h: In function 'snrt_interrupt_global_disable':

and i find that variable mstatus is declared in doc directory , my question is how to solve this issue 'mstatus' undeclared ??
thx !

@takeshineshiro
Copy link
Author

meanwhile , same error like above:
repo/sw/snRuntime/include/snrt.h: In function 'snrt_interrupt_enable':
/repo/sw/snRuntime/include/snrt.h:226:13: error: 'mie' undeclared (first use in this function)
set_csr(mie, 1 << irq);
^~~
/repo/sw/snRuntime/include/snrt.h: In function 'snrt_interrupt_disable':
/repo/sw/snRuntime/include/snrt.h:235:15: error: 'mie' undeclared (first use in this function)
clear_csr(mie, 1 << irq);
^~~
/repo/sw/snRuntime/include/snrt.h: In function 'snrt_interrupt_cause':
/repo/sw/snRuntime/include/snrt.h:243:12: warning: implicit declaration of function 'read_csr' [-Wimplicit-function-declaration]
return read_csr(mcause) & ~0x80000000;
^~~~~~~~
/repo/sw/snRuntime/include/snrt.h:243:21: error: 'mcause' undeclared (first use in this function)
return read_csr(mcause) & ~0x80000000;
^~~~~~
/repo/sw/snRuntime/src/platforms/shared/start.c: In function '_snrt_init_team':
/repo/sw/snRuntime/src/platforms/shared/start.c:64:29: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
team->barrier_reg_ptr = (uint32_t)spm_start + bootdata->tcdm_size +
^
/repo/sw/snRuntime/src/platforms/shared/start.c:86:31: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
team->peripherals.clint = (uint32_t *)bootdata->clint_base;

@mihaivitanescu
Copy link

Hi Takeshineshro,

did you manage to get a fix for this issue? I am facing the same problem as you.

Best regards,
Mihai

@paulsc96 paulsc96 closed this as not planned Won't fix, can't repro, duplicate, stale Nov 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants