diff options
| author | Prashanth Mundkur | 2018-06-11 15:18:23 -0700 |
|---|---|---|
| committer | Prashanth Mundkur | 2018-06-11 15:18:34 -0700 |
| commit | 665e32897a4564fd27e0048af3ade274e9001052 (patch) | |
| tree | deedf054d4933def6fa8a4f020a7a7a3a5fb6416 /riscv | |
| parent | 2b159b297ab6e1f7118b0c094427aa708e1375b8 (diff) | |
Update retire semantics for riscv WFI.
Diffstat (limited to 'riscv')
| -rw-r--r-- | riscv/riscv.sail | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/riscv/riscv.sail b/riscv/riscv.sail index 9f4385e7..5f86e030 100644 --- a/riscv/riscv.sail +++ b/riscv/riscv.sail @@ -828,17 +828,14 @@ union clause ast = WFI : unit mapping clause encdec = WFI() <-> 0b000100000101 @ 0b00000 @ 0b000 @ 0b00000 @ 0b1110011 -function clause execute WFI() = { +function clause execute WFI() = match cur_privilege { - Machine => (), + Machine => true, Supervisor => if mstatus.TW() == true - then handle_illegal() - else (), - User => handle_illegal() - }; - /* NOTE: since WFI is always interrupted, it should never retire. TODO: Confirm this. */ - false -} + then { handle_illegal(); false } + else true, + User => { handle_illegal(); false } + } function clause print_insn (WFI()) = "wfi" @@ -1769,4 +1766,4 @@ end print_insn end assembly end encdec -function decode bv = Some(encdec(bv))
\ No newline at end of file +function decode bv = Some(encdec(bv)) |
