Merge branch 'development' of https://gitlab.lrz.de/lrr-tum/students/eragp-misim...
authorChristian Femers <femers@in.tum.de>
Mon, 14 Oct 2019 21:21:07 +0000 (23:21 +0200)
committerChristian Femers <femers@in.tum.de>
Mon, 14 Oct 2019 21:21:07 +0000 (23:21 +0200)
plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/launch/MainMemoryBlockExtension.java

index 7e517ca..2bec702 100644 (file)
@@ -72,7 +72,7 @@ public class MainMemoryBlockExtension extends PlatformObject implements IMemoryB
 
                if (baseAddrWords.compareTo(minAddrWords) < 0 || baseAddrWords.compareTo(maxAddrWords) > 0)
                        throwDebugException("Base address out of range");
-               if (baseAddrWords.add(lengthWords).compareTo(maxAddrWords) > 0)
+               if (baseAddrWords.add(lengthWords).subtract(BigInteger.ONE).compareTo(maxAddrWords) > 0)
                        throwDebugException("End address out of range");
 
                this.clients = new HashSet<>();
@@ -195,7 +195,7 @@ public class MainMemoryBlockExtension extends PlatformObject implements IMemoryB
        @Override
        public int getAddressSize() throws DebugException
        {
-               return Long.BYTES;
+               return getBigLength().bitLength() / 8;
        }
 
        @Override