From 878f4926bfabfdb77361d691693f3824ac7b5343 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Tue, 2 Oct 2018 16:01:22 +0100 Subject: [PATCH] start work on parallelsing LOAD, pass in parameter to reinterpret immed --- id_regs.py | 4 ++-- riscv/insn_template_sv.cc | 10 ++++++++-- riscv/sv.cc | 8 ++++++++ riscv/sv_decode.h | 8 ++++++-- 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/id_regs.py b/id_regs.py index 435b871..21a3faa 100644 --- a/id_regs.py +++ b/id_regs.py @@ -111,8 +111,8 @@ if __name__ == '__main__': # help identify type of register if insn in ['beq', 'bne', 'blt', 'bltu', 'bge', 'bgeu']: txt += "#define INSN_TYPE_BRANCH\n" - elif insn in ['c_ld', 'c_bnez']: - txt += "\n#define INSN_TYPE_C_BRANCH\n" + if insn in ['lb', 'lbu', 'lw', 'lwu', 'ld', 'ldu']: + txt += "#define INSN_TYPE_LOAD\n" elif insn in ['c_lwsp', 'c_ldsp', 'c_lqsp', 'c_flwsp', 'c_fldsp']: txt += "\n#define INSN_TYPE_C_STACK_LD\n" elif insn in ['c_swsp', 'c_sdsp', 'c_sqsp', 'c_fswsp', 'c_fsdsp']: diff --git a/riscv/insn_template_sv.cc b/riscv/insn_template_sv.cc index 7e98462..4a547a6 100644 --- a/riscv/insn_template_sv.cc +++ b/riscv/insn_template_sv.cc @@ -19,8 +19,13 @@ reg_t FN(processor_t* p, insn_t s_insn, reg_t pc) // REGS_PATTERN is generated by id_regs.py (per opcode) unsigned int floatintmap = REGS_PATTERN; reg_t dest_pred = ~0x0; + bool ldimm_sv = false; +#ifdef INSN_TYPE_LOAD + bool ldimm_sv = true; +#endif sv_insn_t insn(p, bits, floatintmap, - dest_pred, dest_pred, dest_pred, dest_pred); + dest_pred, dest_pred, dest_pred, dest_pred, + ldimm_sv); bool zeroing; #if defined(USING_REG_RD) || defined(USING_REG_FRD) // use the ORIGINAL, i.e. NON-REDIRECTED, register here @@ -63,7 +68,8 @@ reg_t FN(processor_t* p, insn_t s_insn, reg_t pc) #if defined(USING_REG_FRD) fprintf(stderr, "reg %s %x vloop %d vlen %d stop %d pred %lx rd%lx\n", xstr(INSN), INSNCODE, voffs, vlen, insn.stop_vloop(), - dest_pred & (1<