Skip to content

Commit

Permalink
Do not allow dmiWrite to touch x0
Browse files Browse the repository at this point in the history
  • Loading branch information
colby-nyce committed Dec 12, 2024
1 parent 7f7bf30 commit b7e2318
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions sparta/sparta/functional/Register.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1081,7 +1081,9 @@ class RegisterBase : public TreeNode
template <typename T>
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);
}
}

/*!
Expand Down Expand Up @@ -1534,7 +1536,9 @@ class Register : public RegisterBase
template <typename T>
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);
}
}

/*!
Expand Down

0 comments on commit b7e2318

Please sign in to comment.