Message ID | 20220718130955.11899-2-liweiwei@iscas.ac.cn (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Improve the U/S/H extension related check | expand |
diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index db2b8e4d30..36c1b26fb3 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -726,6 +726,12 @@ static void riscv_cpu_realize(DeviceState *dev, Error **errp) return; } + if (cpu->cfg.ext_s && !cpu->cfg.ext_u) { + error_setg(errp, + "Setting S extension without U extension is illegal"); + return; + } + if (cpu->cfg.ext_f && !cpu->cfg.ext_icsr) { error_setg(errp, "F extension requires Zicsr"); return;