revamp hwacha; now runs in physical mode
[riscv-isa-sim.git] / hwacha / insn_template_hwacha.cc
1 // See LICENSE for license details.
2
3 #include "config.h"
4 #include "processor.h"
5 #include "mmu.h"
6 #include "hwacha.h"
7 #include "decode_hwacha.h"
8 #include "rocc.h"
9 #include <assert.h>
10
11 reg_t hwacha_NAME(processor_t* p, insn_t insn, reg_t pc)
12 {
13 int xprlen = 64;
14 reg_t npc = sext_xprlen(pc + insn_length(OPCODE));
15 hwacha_t* h = static_cast<hwacha_t*>(p->get_extension());
16 rocc_insn_union_t u;
17 u.i = insn;
18 reg_t xs1 = u.r.xs1 ? RS1 : -1;
19 reg_t xs2 = u.r.xs2 ? RS2 : -1;
20 reg_t xd = -1;
21 #include "insns/NAME.h"
22 if (u.r.xd) WRITE_RD(xd);
23 return npc;
24 }