riscvarchive / riscv-qemu

QEMU with RISC-V (RV64G, RV32G) Emulation Support
385 stars 154 forks source link

Add RVE register bounds checks to Base ISA ('I'/'E') in translate.c #144

Open michaeljclark opened 6 years ago

michaeljclark commented 6 years ago

To enforce misa.E, target/riscv/translate.c needs register bounds checks added for the Base ISA ('I'/'E') and to generate illegal instruction exceptions if 'E' is set in misa and regno >= 16.

All other extensions are already disallowed on 'E' processors. 'M', 'A', 'F', 'D' and 'C' will already generate illegal instruction exceptions if not present so we only need to add register bounds checks to the Base ISA ('I'/'E') opcodes.

After adding enforcement to translate.c we need to alter write_misa to allow setting the 'E' flag: