Giacomo Travaglini has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/51947 )

Change subject: arch: Fix serialization/deserialization of Vector registers
......................................................................

arch: Fix serialization/deserialization of Vector registers

This bug has been introduced by [1].
Without this fix a vector register is only partially unserialized, effectively
breaking checkpoiting for vectored applications. For example if I am
initializing a vector register with the following checkpointed value:

0xaaaaaaaa_aaaaaaaa_aaaaaaaa_aaaaaaaa

The ParseParam logic will produce instead

0xaaaaaaaa_aaaaaaaa_00000000_00000000

[1]: https://gem5-review.googlesource.com/c/public/gem5/+/41994

Change-Id: I5010d9f39d57fcee390e7419a64dbcd293e51fa0
Signed-off-by: Giacomo Travaglini <[email protected]>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/51947
Maintainer: Bobby R. Bruce <[email protected]>
Maintainer: Jason Lowe-Power <[email protected]>
Tested-by: kokoro <[email protected]>
Reviewed-by: Jason Lowe-Power <[email protected]>
---
M src/arch/generic/vec_reg.hh
1 file changed, 29 insertions(+), 1 deletion(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
  Bobby R. Bruce: Looks good to me, approved
  kokoro: Regressions pass




diff --git a/src/arch/generic/vec_reg.hh b/src/arch/generic/vec_reg.hh
index 1bc9099..34ba554 100644
--- a/src/arch/generic/vec_reg.hh
+++ b/src/arch/generic/vec_reg.hh
@@ -238,7 +238,7 @@

         for (int i = 0; i < Sz; i++) {
             uint8_t b = 0;
-            if (2 * i < value.size())
+            if (2 * i < str.size())
                 b = stoul(str.substr(i * 2, 2), nullptr, 16);
             value.template as<uint8_t>()[i] = b;
         }

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/51947
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I5010d9f39d57fcee390e7419a64dbcd293e51fa0
Gerrit-Change-Number: 51947
Gerrit-PatchSet: 2
Gerrit-Owner: Giacomo Travaglini <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Bobby R. Bruce <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Giacomo Travaglini <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to