journal 2026-05-01

P27 adds the first machine-mode trap path

p27riscvcsrtraps

After the ACT4 rv32i/I pass, the next useful RISC-V step was not another integer instruction. It was the first machine-mode substrate.

P27 adds:

Command:

make -C projects/27_rv32i_machine_traps/test

Result: PASS

The directed testbench runs six small hand-encoded programs:

testresult
CSR read/write and immediate setPASS
ecall trap and mret resumePASS
illegal-instruction trap and mret resumePASS
ebreak trap and mret resumePASS
misaligned load trapPASS
misaligned store trapPASS

Later in the same session, P27 got its own LibreLane config, reran the ACT4/Sail base-integer directory on the modified core, and hardened. The follow-up result is recorded in the P27 hardening journal entry.

This is still not full compliance. It is the first point where the core can run a software trap handler instead of treating unsupported behavior as a terminal simulator halt.

Next best step: timer and external interrupts. The trap path exists now; it needs an event source.