--
You received this message because you are subscribed to the Google Groups "RISC-V SW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sw-dev+un...@groups.riscv.org.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/sw-dev/272e79dd-05b2-4141-b074-3d48ced6b8b9%40groups.riscv.org.
To unsubscribe from this group and stop receiving emails from it, send an email to sw-...@groups.riscv.org.
Thank's for your reply.
I added this line: for (i = 0; i <100000000; i ++) {
a + = 1;}
to increment the constant 'a', but the result is the same. I used SpinalHDL / VexRiscv: A FPGA friendly 32 bit RISC-V ... - GitHub, with the riscv64 toolchaine to compile my code.
A few things to check:
- Look at the disassembly to see what the compiler did. Such as there being two rdcycle instructions, and what's in between does what you think. (The "volatile" on asm means there probably are two rdcycle instructions, as you're using the results. The "GPIO_A->OUTPUT" and the whole loop might get optimized out depending on how it's defined, because the result is unused.)
- If running in M-mode, that might be all,
although it may depend on the hardware you're using and how it
supports this feature. If in S-mode, bit 0 of the mcounteren
CSR must be set. If in U-mode, bit 0 of both the mcounteren and
scounteren registers must be set.
M
--
You received this message because you are subscribed to the Google Groups "RISC-V SW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sw-dev+un...@groups.riscv.org.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/sw-dev/0e7d7407-2bd1-41ca-b564-49665365f82a%40groups.riscv.org.