From 77030fe8c29e108bd2828bf11337859509fd0ea6 Mon Sep 17 00:00:00 2001 From: Chih-Min Chao Date: Tue, 6 Oct 2020 00:22:33 -0700 Subject: rvv: vamo needs to keep exception index in vstart Signed-off-by: Chih-Min Chao --- riscv/decode.h | 1 + 1 file changed, 1 insertion(+) diff --git a/riscv/decode.h b/riscv/decode.h index 614f884..390e3d1 100644 --- a/riscv/decode.h +++ b/riscv/decode.h @@ -1831,6 +1831,7 @@ for (reg_t i = 0; i < P.VU.vlmax && P.VU.vl != 0; ++i) { \ for (reg_t i = P.VU.vstart; i < vl; ++i) { \ VI_ELEMENT_SKIP(i); \ VI_STRIP(i); \ + P.VU.vstart = i; \ switch (P.VU.vsew) { \ case e32: {\ auto vs3 = P.VU.elt< type ## 32_t>(vd, vreg_inx); \ -- cgit v1.1 From f37ebaca770d91a90b83fe2be1ae61028ae69152 Mon Sep 17 00:00:00 2001 From: Chih-Min Chao Date: Tue, 6 Oct 2020 09:07:09 -0700 Subject: rvv: commitlog: get hartid directly To avoid handling inconsistent csr status when running with reference design Signed-off-by: Chih-Min Chao --- riscv/execute.cc | 3 +-- riscv/processor.h | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/riscv/execute.cc b/riscv/execute.cc index 7313c51..9a91ce6 100644 --- a/riscv/execute.cc +++ b/riscv/execute.cc @@ -76,8 +76,7 @@ static void commit_log_print_insn(processor_t *p, reg_t pc, insn_t insn) int flen = p->get_state()->last_inst_flen; // print core id on all lines so it is easy to grep - uint64_t id = p->get_csr(CSR_MHARTID); - fprintf(log_file, "core%4" PRId64 ": ", id); + fprintf(log_file, "core%4" PRId64 ": ", p->get_id()); fprintf(log_file, "%1d ", priv); commit_log_print_value(log_file, xlen, pc); diff --git a/riscv/processor.h b/riscv/processor.h index 87df69f..2187608 100644 --- a/riscv/processor.h +++ b/riscv/processor.h @@ -272,6 +272,7 @@ public: void reset(); void step(size_t n); // run for n cycles void set_csr(int which, reg_t val); + uint32_t get_id() const { return id; } reg_t get_csr(int which, insn_t insn, bool write, bool peek = 0); reg_t get_csr(int which) { return get_csr(which, insn_t(0), false, true); } mmu_t* get_mmu() { return mmu; } -- cgit v1.1 From 681fbac9abefd2a370b34e1ce16a4b4804aa7783 Mon Sep 17 00:00:00 2001 From: Chih-Min Chao Date: Mon, 5 Oct 2020 00:06:43 -0700 Subject: rvv: remove elen >= max(xlen, flen) check The original constraint is for baseline u-arch but could be more flexsible Signed-off-by: Chih-Min Chao --- riscv/processor.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/riscv/processor.cc b/riscv/processor.cc index 77a4eda..4e13622 100644 --- a/riscv/processor.cc +++ b/riscv/processor.cc @@ -152,8 +152,6 @@ void processor_t::parse_varch_string(const char* s) /* Vector spec requirements. */ if (vlen < elen) bad_varch_string(s, "vlen must be >= elen"); - if ((unsigned) elen < std::max(max_xlen, get_flen())) - bad_varch_string(s, "elen must be >= max(xlen, flen)"); if (vlen != slen) bad_varch_string(s, "vlen must be == slen for current limitation"); -- cgit v1.1