Great work!
This reminded me of a project I built a while back: a RV32IM emulator in C++ that can boot and run DOOM. Initially I implemented only RV32I, and implementing the M extension provided a massive speedup!
If anyone's curious, here's the source code: https://github.com/lalitshankarch/rvcore
Nice one! Sounds like a fun project to do. Did you follow any tutorial or guide for this? If so, I would appreciate it if you shared it.