This is step 5 of the book Writing a RISC-V Emulator from Scratch in 10 Steps, whose goal is running xv6, a small Unix-like OS, in your emulator in the final step.
The source code is available at d0iasm/rvemu-for-book/step05/.
In the end of this page, we support exceptions and can execute
fence, parts of the base integer instruction set (RV64I). The
ebreak instructions raise an exception.