Generalized common functionality of different Memories to new interface
[Mograsim.git] / net.mograsim.machine / src / net / mograsim / machine / MainMemory.java
index e38d325..dcd3ee2 100644 (file)
@@ -4,11 +4,13 @@ import java.math.BigInteger;
 
 import net.mograsim.logic.core.types.BitVector;
 
-public interface MainMemory {
+public interface MainMemory extends Memory<BitVector> {
        
-       public BitVector getCell(long address);
-       public void setCell(long address, BitVector word);
        public BigInteger getCellAsBigInteger(long address);
        public void setCellAsBigInteger(long address, BigInteger word);
        public MainMemoryDefinition getDefinition();
+       public default long size()
+       {
+               return getDefinition().size();
+       }
 }