aboutsummaryrefslogtreecommitdiff
path: root/model/riscv_insts_next.sail
blob: 2af2eeb210d9fdb1c92a0ead416df02f6e542628 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* *****************************************************************/
/* This file specifies the instruction added by the 'N' extension. */

union clause ast = URET : unit

mapping clause encdec = URET()
  <-> 0b0000000 @ 0b00010 @ 0b00000 @ 0b000 @ 0b00000 @ 0b1110011

function clause execute URET() = {
  if   (~ (haveUsrMode()))
  then handle_illegal()
  else set_next_pc(exception_handler(cur_privilege, CTL_URET(), PC));
  RETIRE_FAIL
}

mapping clause assembly = URET() <-> "uret"