mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
target/riscv: check 'I' and 'E' after checking 'G' in riscv_cpu_realize
- setting ext_g will implicitly set ext_i Signed-off-by: Weiwei Li <liweiwei@iscas.ac.cn> Signed-off-by: Junqiang Wang <wangjunqiang@iscas.ac.cn> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-Id: <20220518012611.6772-1-liweiwei@iscas.ac.cn> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
parent
96c7fff703
commit
bb06941f95
1 changed files with 12 additions and 12 deletions
|
@ -584,18 +584,6 @@ static void riscv_cpu_realize(DeviceState *dev, Error **errp)
|
||||||
uint32_t ext = 0;
|
uint32_t ext = 0;
|
||||||
|
|
||||||
/* Do some ISA extension error checking */
|
/* Do some ISA extension error checking */
|
||||||
if (cpu->cfg.ext_i && cpu->cfg.ext_e) {
|
|
||||||
error_setg(errp,
|
|
||||||
"I and E extensions are incompatible");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!cpu->cfg.ext_i && !cpu->cfg.ext_e) {
|
|
||||||
error_setg(errp,
|
|
||||||
"Either I or E extension must be set");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cpu->cfg.ext_g && !(cpu->cfg.ext_i && cpu->cfg.ext_m &&
|
if (cpu->cfg.ext_g && !(cpu->cfg.ext_i && cpu->cfg.ext_m &&
|
||||||
cpu->cfg.ext_a && cpu->cfg.ext_f &&
|
cpu->cfg.ext_a && cpu->cfg.ext_f &&
|
||||||
cpu->cfg.ext_d &&
|
cpu->cfg.ext_d &&
|
||||||
|
@ -610,6 +598,18 @@ static void riscv_cpu_realize(DeviceState *dev, Error **errp)
|
||||||
cpu->cfg.ext_ifencei = true;
|
cpu->cfg.ext_ifencei = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cpu->cfg.ext_i && cpu->cfg.ext_e) {
|
||||||
|
error_setg(errp,
|
||||||
|
"I and E extensions are incompatible");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!cpu->cfg.ext_i && !cpu->cfg.ext_e) {
|
||||||
|
error_setg(errp,
|
||||||
|
"Either I or E extension must be set");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (cpu->cfg.ext_f && !cpu->cfg.ext_icsr) {
|
if (cpu->cfg.ext_f && !cpu->cfg.ext_icsr) {
|
||||||
error_setg(errp, "F extension requires Zicsr");
|
error_setg(errp, "F extension requires Zicsr");
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue