Skip to content

Commit 756b62a

Browse files
committed
fix: correting IDL for loop for read_memory
1 parent 70dc817 commit 756b62a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

spec/std/isa/isa/globals.isa

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2569,8 +2569,8 @@ function read_memory {
25692569
# misaligned, must break into multiple reads
25702570
if (MISALIGNED_SPLIT_STRATEGY == "by_byte") {
25712571
Bits<LEN> result = 0;
2572-
for (U32 I = 0; I <= (LEN/8); I++) {
2573-
result = result | (read_memory_aligned<8>(virtual_address + I, encoding) << (8*I));
2572+
for (U32 I = 0; I < (LEN/8); I++) {
2573+
result = result | (read_memory_aligned<8>(virtual_address + I, encoding) `<< (8*I));
25742574
}
25752575
return result;
25762576
} else if (MISALIGNED_SPLIT_STRATEGY == "custom") {
@@ -2955,8 +2955,8 @@ function write_memory {
29552955
} else {
29562956
# misaligned, must break into multiple reads
29572957
if (MISALIGNED_SPLIT_STRATEGY == "by_byte") {
2958-
for (U32 i = 0; i <= (LEN/8); i++) {
2959-
write_memory_aligned<8>(virtual_address + i, (value >> (8*i))[7:0], encoding);
2958+
for (U32 I = 0; I < (LEN/8); I++) {
2959+
write_memory_aligned<8>(virtual_address + I, (value >> (8*I))[7:0], encoding);
29602960
}
29612961
} else if (MISALIGNED_SPLIT_STRATEGY == "custom") {
29622962
unpredictable("An implementation is free to break a misaligned access any way, leading to unpredictable behavior when any part of the misaligned access causes an exception");

0 commit comments

Comments
 (0)