From: Luke Kenneth Casson Leighton Date: Thu, 27 Jun 2019 12:53:05 +0000 (+0100) Subject: make vlen loop run times subvl, set subvl default to 1 not 0 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3fda13c559be78dbb69c9cb0d353e4856a62fde6;p=riscv-isa-sim.git make vlen loop run times subvl, set subvl default to 1 not 0 --- diff --git a/riscv/insn_template_sv.cc b/riscv/insn_template_sv.cc index a8dacd3..f249d7e 100644 --- a/riscv/insn_template_sv.cc +++ b/riscv/insn_template_sv.cc @@ -46,7 +46,7 @@ reg_t sv_proc_t::FN(processor_t* p, insn_t s_insn, reg_t pc) // in a stack of other things that are needed. insn_bits_t bits = s_insn.bits(); int vlen = 0; - int subvl = 0; + int subvl = 1; if (p->get_state()->prv == 0) { // XXX HACK - disable in supervisor mode vlen = p->get_state()->sv().vl; subvl = p->get_state()->sv().subvl; @@ -98,10 +98,11 @@ reg_t sv_proc_t::FN(processor_t* p, insn_t s_insn, reg_t pc) reg_spec_t sp = {0, NULL}; if (vlen > 0) { - fprintf(stderr, "pre-ex reg %s %x %ld rd %ld rs1 %ld rs2 %ld vlen %d\n", + fprintf(stderr, + "pre-ex reg %s %x %ld rd %ld rs1 %ld rs2 %ld vlen %d subvl %d\n", xstr(INSN), INSNCODE, p->get_state()->prv, s_insn.rd(), s_insn.rs1(), s_insn.rs2(), - vlen); + vlen, subvl); #ifdef INSN_TYPE_C_STACK_LD sp = insn._remap(X_SP, true, src_offs, src_subo); #endif @@ -155,7 +156,7 @@ reg_t sv_proc_t::FN(processor_t* p, insn_t s_insn, reg_t pc) { vlen = 1; // minimum of one loop } - for (int voffs=0; voffs < vlen; voffs++) + for (int voffs=0; voffs < vlen*subvl; voffs++) { insn.reset_vloop_check(); #ifdef INSN_C_MV @@ -213,7 +214,7 @@ reg_t sv_proc_t::FN(processor_t* p, insn_t s_insn, reg_t pc) "vlen %d stop %d pred %lx rdv %lx v %ld rvc2 %ld sp %lx\n", xstr(INSN), INSNCODE, voffs, *src_offs, *dest_offs, vlen, insn.stop_vloop(), - dest_pred & (1< 1) { #if defined(USING_REG_RD) - fprintf(stderr, "reg %s %x vloop %d vlen %d stop %d pred %lx rd%lx\n", + 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<