From 4aa938b4104c1601cb56b5b59b047365b4ed2a2f Mon Sep 17 00:00:00 2001 From: Yen-Fu Chen Date: Sat, 17 Dec 2022 23:47:42 +0800 Subject: [PATCH] Set rv->compressed for instruction ecall and ebreak The exception handler is invoked by the instructions ecall and ebreak, thus we must set rv->compressed for these instructions. --- src/emulate.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/emulate.c b/src/emulate.c index 8960dbf8..737fbf8e 100644 --- a/src/emulate.c +++ b/src/emulate.c @@ -649,6 +649,7 @@ static bool emulate(riscv_t *rv, const block_t *block) /* ECALL: Environment Call */ _(ecall, { + rv->compressed = false; rv->io.on_ecall(rv); /* increment the cycles csr */ rv->csr_cycle++; return true; @@ -656,6 +657,7 @@ static bool emulate(riscv_t *rv, const block_t *block) /* EBREAK: Environment Break */ _(ebreak, { + rv->compressed = false; rv->io.on_ebreak(rv); /* increment the cycles csr */ rv->csr_cycle++; return true; @@ -1288,6 +1290,7 @@ static bool emulate(riscv_t *rv, const block_t *block) /* C.EBREAK */ _(cebreak, { + rv->compressed = true; rv->io.on_ebreak(rv); /* increment the cycles csr */ rv->csr_cycle++;