Org Babel back-end for evaluating RISC-V assembly blocks from Org documents. The library assembles each block with a configurable cross toolchain and runs the result under Spike (optionally via the proxy kernel).
GPT-5-Codex made all of this. Don't know what to feel about it. Quick org-babel setup for working with risc-v assembly for educational purposes.
- Place
ob-riscv.elon yourload-pathand(require 'ob-riscv)in your init. - Ensure
riscv64-unknown-elf-gcc,spike, andpkare available (customizable via theOB_RISCV_*env vars). - In Org buffers, use blocks like:
#+begin_src riscv :results output
.section .text
.globl _start
_start:
li a0, 42
li a7, 93 ; exit
ecall
#+end_src
If you use Nix, run nix develop to enter the bundled dev shell with the required toolchain preconfigured. Preferably, just place use flake github:yathxyz/ob-riscv into .envrc if you use direnv.