1 #ifndef _RISCV_DUMMY_ROCC_H
2 #define _RISCV_DUMMY_ROCC_H
7 class dummy_rocc_t
: public rocc_t
10 const char* name() { return "dummy"; }
12 reg_t
custom0(rocc_insn_t insn
, reg_t xs1
, reg_t xs2
)
14 reg_t prev_acc
= acc
[insn
.rs2
];
16 if (insn
.rs2
> num_acc
)
17 illegal_instruction();
24 case 1: // xd <- acc (the only real work is the return statement below)
26 case 2: // acc[rs2] <- Mem[xs1]
27 acc
[insn
.rs2
] = p
->get_mmu()->load_uint64(xs1
);
29 case 3: // acc[rs2] <- accX + xs1
33 illegal_instruction();
36 return prev_acc
; // in all cases, xd <- previous value of acc[rs2]
41 for(int i
= 0; i
< num_acc
; i
++) acc
[i
] = 0;
45 static const int num_acc
= 4;