From b7e23180646c8243178ae5ef490ac80d9767bf14 Mon Sep 17 00:00:00 2001 From: Colby Nyce Date: Thu, 12 Dec 2024 15:01:09 -0600 Subject: [PATCH] Do not allow dmiWrite to touch x0 --- sparta/sparta/functional/Register.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sparta/sparta/functional/Register.hpp b/sparta/sparta/functional/Register.hpp index 4190d3918d..a08bde18f1 100644 --- a/sparta/sparta/functional/Register.hpp +++ b/sparta/sparta/functional/Register.hpp @@ -1081,7 +1081,9 @@ class RegisterBase : public TreeNode template void dmiWrite(T val, index_type idx = 0) { - dmiWrite_(&val, sizeof(val), sizeof(val) * idx); + if (getID() || getGroupNum()) { + dmiWrite_(&val, sizeof(val), sizeof(val) * idx); + } } /*! @@ -1534,7 +1536,9 @@ class Register : public RegisterBase template inline void dmiWrite(T val, index_type idx = 0) { - dmiWriteImpl_(&val, sizeof(val), sizeof(val) * idx); + if (getID() || getGroupNum()) { + dmiWriteImpl_(&val, sizeof(val), sizeof(val) * idx); + } } /*!