Skip to content

risc-v/litex: Update docs for vexriscv invalidate and no-op flush.#17792

Merged
lupyuen merged 1 commit into
apache:masterfrom
jerenkrantz:litex_cache_invalidate_flush
Jan 8, 2026
Merged

risc-v/litex: Update docs for vexriscv invalidate and no-op flush.#17792
lupyuen merged 1 commit into
apache:masterfrom
jerenkrantz:litex_cache_invalidate_flush

Conversation

@jerenkrantz
Copy link
Copy Markdown
Contributor

@jerenkrantz jerenkrantz commented Jan 7, 2026

Per further feedback from Litex community on Discord, the vexriscv cache is write-through so no flush is required - therefore, make it a nop.

And add a pointer to vexriscv invalidation magic instruction docs:

https://github.com/SpinalHDL/VexRiscv?tab=readme-ov-file#dbuscachedplugin

Summary

A prior PR #17696 issued an invalidation instruction when asked to flush; but, that's not strictly necessary as the cache is write-through. Therefore, make flush a nop. This matches Zephyr's behavior which implements vexriscv caching:

https://github.com/zephyrproject-rtos/zephyr/pull/97925/files

I believe a nop is slightly better than trying to make flush function conditional upstream, but I'm open to modifying the PR accordingly.

Impact

When asked to flush, NuttX won't invalidate the entire cache.

Testing

I tested with arty_a7:nsh build which ran successfully locally.

Per further feedback from Litex community, the vexriscv cache is
write-through so no flush is required - therefore, make it a nop.

And add a pointer to vexriscv invalidation magic instr docs.

Signed-off-by: Justin Erenkrantz <justin@erenkrantz.com>
@github-actions github-actions Bot added Arch: risc-v Issues related to the RISC-V (32-bit or 64-bit) architecture Size: XS The size of the change in this PR is very small labels Jan 7, 2026
@jerenkrantz jerenkrantz marked this pull request as ready for review January 7, 2026 15:36
@jerenkrantz jerenkrantz requested a review from jerpelea as a code owner January 7, 2026 15:36
@jerenkrantz
Copy link
Copy Markdown
Contributor Author

I see that the CI run failed, but in reviewing the build logs, I'm not sure how this PR could have triggered that failure. Could this be a transient failure or some other CI failure in master?

@acassis
Copy link
Copy Markdown
Contributor

acassis commented Jan 7, 2026

@jerenkrantz the issue is happening in BL602 board:

riscv-none-elf-ld: cannot find /github/workspace/sources/nuttx/arch/risc-v/src/crt0.o: No such file or directory
make[4]: *** [Makefile:57: errno] Error 1
make[4]: Target 'install' not remade because of errors.
make[3]: *** [Makefile:88: errno_install] Error 2
riscv-none-elf-ld: cannot find /github/workspace/sources/nuttx/arch/risc-v/src/crt0.o: No such file or directory
make[4]: *** [Makefile:57: hello] Error 1
make[4]: Target 'install' not remade because of errors.
make[3]: *** [Makefile:88: hello_install] Error 2
riscv-none-elf-ld: cannot find /github/workspace/sources/nuttx/arch/risc-v/src/crt0.o: No such file or directory
make[4]: *** [Makefile:56: struct] Error 1
make[4]: Target 'install' not remade because of errors.
make[3]: *** [Makefile:88: struct_install] Error 2
riscv-none-elf-ld: cannot find /github/workspace/sources/nuttx/arch/risc-v/src/crt0.o: No such file or directory
make[4]: *** [Makefile:57: signal] Error 1
make[4]: Target 'install' not remade because of errors.
make[3]: *** [Makefile:88: signal_install] Error 2
riscv-none-elf-ld: cannot find /github/workspace/sources/nuttx/arch/risc-v/src/crt0.o: No such file or directory
make[4]: *** [Makefile:57: mutex] Error 1
make[4]: Target 'install' not remade because of errors.
make[3]: *** [Makefile:88: mutex_install] Error 2
riscv-none-elf-ld: cannot find /github/workspace/sources/nuttx/arch/risc-v/src/crt0.o: No such file or directory
make[4]: *** [Makefile:101: hello++1] Error 1
riscv-none-elf-ld: cannot find /github/workspace/sources/nuttx/arch/risc-v/src/crt0.o: No such file or directory
make[4]: *** [Makefile:105: hello++2] Error 1
riscv-none-elf-ld: cannot find /github/workspace/sources/nuttx/arch/risc-v/src/crt0.o: No such file or directory
make[4]: *** [Makefile:112: hello++3] Error 1
make[4]: Target 'install' not remade because of errors.
make[3]: *** [Makefile:88: helloxx_install] Error 2
riscv-none-elf-ld: cannot find /github/workspace/sources/nuttx/arch/risc-v/src/crt0.o: No such file or directory
make[4]: *** [Makefile:57: pthread] Error 1
make[4]: Target 'install' not remade because of errors.
make[3]: *** [Makefile:88: pthread_install] Error 2
riscv-none-elf-ld: cannot find /github/workspace/sources/nuttx/arch/risc-v/src/crt0.o: No such file or directory
make[4]: *** [Makefile:57: task] Error 1
make[4]: Target 'install' not remade because of errors.
make[3]: *** [Makefile:88: task_install] Error 2
make[3]: Target 'all' not remade because of errors.
make[2]: *** [Makefile:61: build] Error 2
make[2]: Target 'all' not remade because of errors.
make[1]: *** [Makefile:54: /github/workspace/sources/apps/examples/elf_all] Error 2
make[1]: Target 'all' not remade because of errors.
make: *** [tools/LibTargets.mk:248: /github/workspace/sources/apps/libapps.a] Error 2
make: Target 'all' not remade because of errors.
/github/workspace/sources/nuttx/tools/testbuild.sh: line 385: /github/workspace/sources/nuttx/../nuttx/nuttx.manifest: No such file or directory
  [1/1] Normalize bl602evb/elf

Maybe @lupyuen could know what is happening anyway I will restart the CI to check whether it is a transient issue or not.

@lupyuen
Copy link
Copy Markdown
Member

lupyuen commented Jan 8, 2026

Sorry @simbit18: Any idea why bl602evb/elf fails sometimes? Should we disable it? Thanks!

https://github.com/apache/nuttx/actions/runs/20786276050/job/59697000727?pr=17792#step:11:156

riscv-none-elf-ld: cannot find /github/workspace/sources/nuttx/arch/risc-v/src/crt0.o: No such file or directory

@lupyuen lupyuen merged commit 220263e into apache:master Jan 8, 2026
27 of 33 checks passed
@simbit18
Copy link
Copy Markdown
Contributor

simbit18 commented Jan 8, 2026

Sorry @simbit18: Any idea why bl602evb/elf fails sometimes? Should we disable it? Thanks!

https://github.com/apache/nuttx/actions/runs/20786276050/job/59697000727?pr=17792#step:11:156

riscv-none-elf-ld: cannot find /github/workspace/sources/nuttx/arch/risc-v/src/crt0.o: No such file or directory

Hi @lupyuen, I have no idea why this is happening, sorry.

@jerenkrantz jerenkrantz deleted the litex_cache_invalidate_flush branch January 8, 2026 16:37
simbit18 added a commit to simbit18/nuttx that referenced this pull request Mar 18, 2026
This bl602evb:elf configuration has caused job risc-v-01 to fail on several occasions.

riscv-none-elf-ld: cannot find /github/workspace/sources/nuttx/arch/risc-v/src/crt0.o: No such file or directory

apache#17792

Added -bl602evb:elf to the risc-v-01.dat file to skip the build.

Signed-off-by: simbit18 <simbit18@gmail.com>
simbit18 added a commit to simbit18/nuttx that referenced this pull request Mar 18, 2026
This bl602evb:elf configuration has caused job risc-v-01 to fail on several occasions.

riscv-none-elf-ld: cannot find /github/workspace/sources/nuttx/arch/risc-v/src/crt0.o: No such file or directory

apache#17792

Added -bl602evb:elf to the risc-v-01.dat file to skip the build.

Signed-off-by: simbit18 <simbit18@gmail.com>
linguini1 pushed a commit that referenced this pull request Mar 18, 2026
This bl602evb:elf configuration has caused job risc-v-01 to fail on several occasions.

riscv-none-elf-ld: cannot find /github/workspace/sources/nuttx/arch/risc-v/src/crt0.o: No such file or directory

#17792

Added -bl602evb:elf to the risc-v-01.dat file to skip the build.

Signed-off-by: simbit18 <simbit18@gmail.com>
pbarada pushed a commit to pbarada/nuttx that referenced this pull request Mar 20, 2026
This bl602evb:elf configuration has caused job risc-v-01 to fail on several occasions.

riscv-none-elf-ld: cannot find /github/workspace/sources/nuttx/arch/risc-v/src/crt0.o: No such file or directory

apache#17792

Added -bl602evb:elf to the risc-v-01.dat file to skip the build.

Signed-off-by: simbit18 <simbit18@gmail.com>
Otpvondoiats pushed a commit to Otpvondoiats/nuttx that referenced this pull request Mar 31, 2026
This bl602evb:elf configuration has caused job risc-v-01 to fail on several occasions.

riscv-none-elf-ld: cannot find /github/workspace/sources/nuttx/arch/risc-v/src/crt0.o: No such file or directory

apache#17792

Added -bl602evb:elf to the risc-v-01.dat file to skip the build.

Signed-off-by: simbit18 <simbit18@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: risc-v Issues related to the RISC-V (32-bit or 64-bit) architecture Size: XS The size of the change in this PR is very small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants