diff options
author | Zhen Wei <zhen.wei@sifive.com> | 2020-03-05 17:59:25 +0800 |
---|---|---|
committer | Zhen Wei <zhen.wei@sifive.com> | 2020-03-05 17:59:25 +0800 |
commit | 4deba51d66ff970376311e9cbe2bc9d89e3f1528 (patch) | |
tree | 145343580206ab6ff6f0ec7a20c2579ec176ad49 /riscv/processor.cc | |
parent | 7754a2adf8b3beedf726eccc05149c44be8cd17e (diff) | |
download | spike-4deba51d66ff970376311e9cbe2bc9d89e3f1528.zip spike-4deba51d66ff970376311e9cbe2bc9d89e3f1528.tar.gz spike-4deba51d66ff970376311e9cbe2bc9d89e3f1528.tar.bz2 |
rvv: fix vf(w)redsum option parsing bug
Fix the bug that Spike aborted when fredsum option is not specified even
those test cases are not involved in vf(w)redsum.
Diffstat (limited to 'riscv/processor.cc')
-rw-r--r-- | riscv/processor.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/riscv/processor.cc b/riscv/processor.cc index 07d3057..075ddfa 100644 --- a/riscv/processor.cc +++ b/riscv/processor.cc @@ -126,9 +126,9 @@ void processor_t::parse_varch_string(const char* s) valu = get_int_token(str, ',', pos); else if (attr == "fredsum-impl") { std::string temp = get_string_token(str, ',', pos); - if (temp == "ordered") VU.fredsum_impl = vectorUnit_t::ORDERED_FREDSUM_IMPL; - else if (temp == "parallel") VU.fredsum_impl = vectorUnit_t::PARALLEL_FREDSUM_IMPL; - else VU.fredsum_impl = vectorUnit_t::UNKNOWN_FREDSUM_IMPL; + if (temp == "ordered") fredsum_impl = vectorUnit_t::ORDERED_FREDSUM_IMPL; + else if (temp == "parallel") fredsum_impl = vectorUnit_t::PARALLEL_FREDSUM_IMPL; + else fredsum_impl = vectorUnit_t::UNKNOWN_FREDSUM_IMPL; } else bad_varch_string(s, "Unsupported token"); @@ -138,7 +138,7 @@ void processor_t::parse_varch_string(const char* s) if (!check_pow2(vlen) || !check_pow2(elen) || !check_pow2(slen) || !check_pow2(valu)){ bad_varch_string(s, "The integer value should be the power of 2"); } - if (VU.fredsum_impl == vectorUnit_t::UNKNOWN_FREDSUM_IMPL) { + if (fredsum_impl == vectorUnit_t::UNKNOWN_FREDSUM_IMPL) { bad_varch_string(s, "fredsum-impl now only supported ordered/parallel"); } @@ -163,6 +163,7 @@ void processor_t::parse_varch_string(const char* s) VU.ELEN = elen; VU.SLEN = slen; VU.VALU = valu; + VU.fredsum_impl = fredsum_impl; VU.vlenb = vlen / 8; } |