whoops nbytes in DO_WRITE_FREG has to be flen not xlen based
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 31 Oct 2018 13:19:22 +0000 (13:19 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 31 Oct 2018 13:19:22 +0000 (13:19 +0000)
riscv/sv_insn_redirect.cc

index e270a99c59eddd90b9135eb11eb72d206c8c7c35..fddf32240dada3369e175803807ac7e9a1aa81e5 100644 (file)
@@ -102,7 +102,7 @@ void (sv_proc_t::DO_WRITE_FREG)(reg_spec_t const& spec, sv_freg_t const& value)
     unsigned int shift = 0;
     unsigned int offs = 0;
     if (spec.offset != NULL) {
-        unsigned int nbytes = xlen / bitwidth;
+        unsigned int nbytes = flen / bitwidth;
         offs = *spec.offset;
         shift = offs % nbytes;
         offs /= nbytes;