From 18f3cf39c5d4bc1abb1500ca1fee2fdb13717ffd Mon Sep 17 00:00:00 2001 From: Ryan Herbst Date: Wed, 31 Jul 2024 09:39:50 -0700 Subject: [PATCH 1/6] Fix block alignment --- src/rogue/interfaces/memory/Block.cpp | 5 ++++- src/rogue/interfaces/memory/Variable.cpp | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/rogue/interfaces/memory/Block.cpp b/src/rogue/interfaces/memory/Block.cpp index f7f517f44..f327805ac 100644 --- a/src/rogue/interfaces/memory/Block.cpp +++ b/src/rogue/interfaces/memory/Block.cpp @@ -511,7 +511,7 @@ void rim::Block::addVariables(std::vector variables) { (*vit)->verifyEn_); } - // List variables + // List variables } else { for (x = 0; x < (*vit)->numValues_; x++) { // Variable allows overlaps, add to overlap enable mask @@ -520,6 +520,9 @@ void rim::Block::addVariables(std::vector variables) { // Otherwise add to exclusive mask and check for existing mapping } else { + + printf("Overlap Check size = %i, index = %i, base = %i, bits = %i\n", size_, x, x * (*vit)->valueStride_ + (*vit)->bitOffset_[0], (*vit)->valueBits_); + if (anyBits(excMask, x * (*vit)->valueStride_ + (*vit)->bitOffset_[0], (*vit)->valueBits_)) throw(rogue::GeneralError::create( "Block::addVariables", diff --git a/src/rogue/interfaces/memory/Variable.cpp b/src/rogue/interfaces/memory/Variable.cpp index 4661dd20b..4b4c356a2 100644 --- a/src/rogue/interfaces/memory/Variable.cpp +++ b/src/rogue/interfaces/memory/Variable.cpp @@ -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] = @@ -484,10 +484,11 @@ void rim::Variable::shiftOffsetDown(uint32_t shift, uint32_t minSize) { (static_cast(minSize) * 8.0))) * minSize - 1; + printf("Idx = %i, low = %i, high = %i\n", x, lowTranByte_[x], highTranByte_[x]); } // Compute total bit range of accessed bytes - varBytes_ = highTranByte_[numValues_ - 1] - lowTranByte_[0] + 1; + varBytes_ = highTranByte_[numValues_ - 1]; staleHighByte_ = highTranByte_[numValues_ - 1]; } From df8e60e73a1a08a1fdf1def6b8da7c81f7d0fc08 Mon Sep 17 00:00:00 2001 From: Ryan Herbst Date: Wed, 31 Jul 2024 09:50:13 -0700 Subject: [PATCH 2/6] Remove debug statement --- src/rogue/interfaces/memory/Block.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/rogue/interfaces/memory/Block.cpp b/src/rogue/interfaces/memory/Block.cpp index f327805ac..d2182ca90 100644 --- a/src/rogue/interfaces/memory/Block.cpp +++ b/src/rogue/interfaces/memory/Block.cpp @@ -521,8 +521,6 @@ void rim::Block::addVariables(std::vector variables) { // Otherwise add to exclusive mask and check for existing mapping } else { - printf("Overlap Check size = %i, index = %i, base = %i, bits = %i\n", size_, x, x * (*vit)->valueStride_ + (*vit)->bitOffset_[0], (*vit)->valueBits_); - if (anyBits(excMask, x * (*vit)->valueStride_ + (*vit)->bitOffset_[0], (*vit)->valueBits_)) throw(rogue::GeneralError::create( "Block::addVariables", From 2d9b9505c7454067a9c9296ab9c962c5b9f30db3 Mon Sep 17 00:00:00 2001 From: Ryan Herbst Date: Wed, 31 Jul 2024 09:50:40 -0700 Subject: [PATCH 3/6] Remove debug statement --- src/rogue/interfaces/memory/Variable.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/rogue/interfaces/memory/Variable.cpp b/src/rogue/interfaces/memory/Variable.cpp index 4b4c356a2..1a40ff295 100644 --- a/src/rogue/interfaces/memory/Variable.cpp +++ b/src/rogue/interfaces/memory/Variable.cpp @@ -484,7 +484,6 @@ void rim::Variable::shiftOffsetDown(uint32_t shift, uint32_t minSize) { (static_cast(minSize) * 8.0))) * minSize - 1; - printf("Idx = %i, low = %i, high = %i\n", x, lowTranByte_[x], highTranByte_[x]); } // Compute total bit range of accessed bytes From 460382d65936a6f268773820a24204a78e799dce Mon Sep 17 00:00:00 2001 From: Ryan Herbst Date: Wed, 31 Jul 2024 11:16:27 -0700 Subject: [PATCH 4/6] Fix linter area --- src/rogue/interfaces/memory/Block.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/rogue/interfaces/memory/Block.cpp b/src/rogue/interfaces/memory/Block.cpp index d2182ca90..2c81292ea 100644 --- a/src/rogue/interfaces/memory/Block.cpp +++ b/src/rogue/interfaces/memory/Block.cpp @@ -518,9 +518,8 @@ void rim::Block::addVariables(std::vector variables) { 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( "Block::addVariables", From 1de28071adce87efd64da4420062e9234b307b33 Mon Sep 17 00:00:00 2001 From: Ryan Herbst Date: Wed, 31 Jul 2024 11:43:15 -0700 Subject: [PATCH 5/6] Fix block size calculation --- src/rogue/interfaces/memory/Variable.cpp | 2 +- tests/test_list_memory.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rogue/interfaces/memory/Variable.cpp b/src/rogue/interfaces/memory/Variable.cpp index 1a40ff295..3bb928625 100644 --- a/src/rogue/interfaces/memory/Variable.cpp +++ b/src/rogue/interfaces/memory/Variable.cpp @@ -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]; + varBytes_ = highTranByte_[numValues_ - 1] + 1; staleHighByte_ = highTranByte_[numValues_ - 1]; } diff --git a/tests/test_list_memory.py b/tests/test_list_memory.py index 68baae441..da5cb7aca 100644 --- a/tests/test_list_memory.py +++ b/tests/test_list_memory.py @@ -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) From 84181435623fe04dd4041739ed9f082fe195aac1 Mon Sep 17 00:00:00 2001 From: Ryan Herbst Date: Wed, 31 Jul 2024 12:15:35 -0700 Subject: [PATCH 6/6] Fix logging --- tests/test_list_memory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_list_memory.py b/tests/test_list_memory.py index da5cb7aca..8e4c80e2e 100644 --- a/tests/test_list_memory.py +++ b/tests/test_list_memory.py @@ -16,7 +16,7 @@ import numpy as np import random -rogue.Logging.setLevel(rogue.Logging.Debug) +#rogue.Logging.setLevel(rogue.Logging.Debug) #import logging #logger = logging.getLogger('pyrogue') #logger.setLevel(logging.DEBUG)