aboutsummaryrefslogtreecommitdiff
path: root/target/microblaze/cpu.c
diff options
context:
space:
mode:
authorEdgar E. Iglesias <edgar.iglesias@xilinx.com>2019-10-30 14:03:38 +0100
committerEdgar E. Iglesias <edgar.iglesias@xilinx.com>2020-04-30 12:11:03 +0200
commit622cc7305cdfe2402950d21bc2160a76646bf259 (patch)
treef4273d6cc62eb3fb97f9ff7e58da6b1ee2357e13 /target/microblaze/cpu.c
parent5143fdf36f78bd4c11c4bacedfdbd44365aa5781 (diff)
target/microblaze: Add the div-zero-exception property
Add the div-zero-exception property to control if the core traps divizions by zero. Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Luc Michel <luc.michel@greensocs.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Diffstat (limited to 'target/microblaze/cpu.c')
-rw-r--r--target/microblaze/cpu.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c
index 2cc6b1513c..4211f50c11 100644
--- a/target/microblaze/cpu.c
+++ b/target/microblaze/cpu.c
@@ -207,6 +207,8 @@ static void mb_cpu_realizefn(DeviceState *dev, Error **errp)
PVR2_DOPB_BUS_EXC_MASK : 0) |
(cpu->cfg.iopb_bus_exception ?
PVR2_IOPB_BUS_EXC_MASK : 0) |
+ (cpu->cfg.div_zero_exception ?
+ PVR2_DIV_ZERO_EXC_MASK : 0) |
(cpu->cfg.illegal_opcode_exception ?
PVR2_ILL_OPCODE_EXC_MASK : 0) |
(cpu->cfg.opcode_0_illegal ?
@@ -280,6 +282,8 @@ static Property mb_properties[] = {
cfg.iopb_bus_exception, false),
DEFINE_PROP_BOOL("ill-opcode-exception", MicroBlazeCPU,
cfg.illegal_opcode_exception, false),
+ DEFINE_PROP_BOOL("div-zero-exception", MicroBlazeCPU,
+ cfg.div_zero_exception, false),
DEFINE_PROP_BOOL("opcode-0x0-illegal", MicroBlazeCPU,
cfg.opcode_0_illegal, false),
DEFINE_PROP_STRING("version", MicroBlazeCPU, cfg.version),