From 11b47024904875cb559e7f8436d2809d566c1e7c Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Tue, 25 Sep 2018 02:45:26 +0100 Subject: [PATCH] add sv_insn_t class (inherits from insn_t) --- riscv/sv_decode.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 riscv/sv_decode.h diff --git a/riscv/sv_decode.h b/riscv/sv_decode.h new file mode 100644 index 0000000..0508de1 --- /dev/null +++ b/riscv/sv_decode.h @@ -0,0 +1,22 @@ +// See LICENSE for license details. + +#ifndef _RISCV_SV_DECODE_H +#define _RISCV_SV_DECODE_H + +#include "sv.h" +#include "decode.h" + +class sv_insn_t: public insn_t +{ +public: + uint64_t rd () { return remap(insn_t::rd()); } + uint64_t rs1() { return remap(insn_t::rs1(); } + uint64_t rs2() { return remap(insn_t::rs2(); } + uint64_t rs3() { return remap(insn_t::rs3(); } +private: + // remaps the register through the lookup table. + // will need to take the current loop index/offset somehow + uint64_t remap(uint64_t reg) { return reg; } // TODO +}; + +#endif -- 2.30.2