Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix var bytes calculation to support list variables which span transaction size #1017

Merged
merged 7 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/rogue/interfaces/memory/Block.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,14 +511,14 @@ void rim::Block::addVariables(std::vector<rim::VariablePtr> variables) {
(*vit)->verifyEn_);
}

// List variables
// List variables
} else {
for (x = 0; x < (*vit)->numValues_; x++) {
// Variable allows overlaps, add to overlap enable mask
if ((*vit)->overlapEn_) {
setBits(oleMask, x * (*vit)->valueStride_ + (*vit)->bitOffset_[0], (*vit)->valueBits_);

// Otherwise add to exclusive mask and check for existing mapping
// Otherwise add to exclusive mask and check for existing mapping
} else {
if (anyBits(excMask, x * (*vit)->valueStride_ + (*vit)->bitOffset_[0], (*vit)->valueBits_))
throw(rogue::GeneralError::create(
Expand Down
4 changes: 2 additions & 2 deletions src/rogue/interfaces/memory/Variable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ void rim::Variable::shiftOffsetDown(uint32_t shift, uint32_t minSize) {
highTranByte_[0] = varBytes_ - 1;
staleHighByte_ = highTranByte_[0];

// List variable
// List variable
} else {
for (x = 0; x < numValues_; x++) {
lowTranByte_[x] =
Expand All @@ -487,7 +487,7 @@ void rim::Variable::shiftOffsetDown(uint32_t shift, uint32_t minSize) {
}

// Compute total bit range of accessed bytes
varBytes_ = highTranByte_[numValues_ - 1] - lowTranByte_[0] + 1;
varBytes_ = highTranByte_[numValues_ - 1] + 1;
staleHighByte_ = highTranByte_[numValues_ - 1];
}

Expand Down
2 changes: 1 addition & 1 deletion tests/test_list_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import numpy as np
import random

#rogue.Logging.setLevel(rogue.Logging.Warning)
#rogue.Logging.setLevel(rogue.Logging.Debug)
#import logging
#logger = logging.getLogger('pyrogue')
#logger.setLevel(logging.DEBUG)
Expand Down
Loading