projects
/
Mograsim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed a bug in Am2900; created dlatch8/80; relayouted some components
[Mograsim.git]
/
net.mograsim.machine
/
test
/
net
/
mograsim
/
machine
/
standard
/
memory
/
WordAddressableMemoryTest.java
diff --git
a/net.mograsim.machine/test/net/mograsim/machine/standard/memory/WordAddressableMemoryTest.java
b/net.mograsim.machine/test/net/mograsim/machine/standard/memory/WordAddressableMemoryTest.java
index
5f50dbc
..
9d38b89
100644
(file)
--- a/
net.mograsim.machine/test/net/mograsim/machine/standard/memory/WordAddressableMemoryTest.java
+++ b/
net.mograsim.machine/test/net/mograsim/machine/standard/memory/WordAddressableMemoryTest.java
@@
-10,26
+10,28
@@
import org.junit.jupiter.api.Test;
import net.mograsim.logic.core.timeline.Timeline;
import net.mograsim.logic.core.types.Bit;
import net.mograsim.logic.core.types.BitVector;
import net.mograsim.logic.core.timeline.Timeline;
import net.mograsim.logic.core.types.Bit;
import net.mograsim.logic.core.types.BitVector;
-import net.mograsim.logic.core.wires.Wire;
-import net.mograsim.logic.core.wires.Wire.ReadWriteEnd;
+import net.mograsim.logic.core.wires.
Core
Wire;
+import net.mograsim.logic.core.wires.
Core
Wire.ReadWriteEnd;
import net.mograsim.machine.MainMemoryDefinition;
import net.mograsim.machine.MainMemoryDefinition;
-class WordAddressableMemoryTest {
-
+class WordAddressableMemoryTest
+{
+
private Timeline t = new Timeline(10);
@Test
public void wordAddressableMemoryLargeTest()
{
private Timeline t = new Timeline(10);
@Test
public void wordAddressableMemoryLargeTest()
{
-
Wire rW = new
Wire(t, 1, 2);
-
Wire data = new
Wire(t, 16, 2);
-
Wire address = new
Wire(t, 64, 2);
+
CoreWire rW = new Core
Wire(t, 1, 2);
+
CoreWire data = new Core
Wire(t, 16, 2);
+
CoreWire address = new Core
Wire(t, 64, 2);
ReadWriteEnd rWI = rW.createReadWriteEnd();
ReadWriteEnd dataI = data.createReadWriteEnd();
ReadWriteEnd addressI = address.createReadWriteEnd();
@SuppressWarnings("unused")
ReadWriteEnd rWI = rW.createReadWriteEnd();
ReadWriteEnd dataI = data.createReadWriteEnd();
ReadWriteEnd addressI = address.createReadWriteEnd();
@SuppressWarnings("unused")
- WordAddressableMemoryComponent memory = new WordAddressableMemoryComponent(t, 4, MainMemoryDefinition.create(64, 16, 4096L, Long.MAX_VALUE), data.createReadWriteEnd(),
+ CoreWordAddressableMemory memory = new CoreWordAddressableMemory(t, 4,
+ new WordAddressableMemory(MainMemoryDefinition.create(64, 16, 4096L, Long.MAX_VALUE)), data.createReadWriteEnd(),
rW.createReadOnlyEnd(), address.createReadOnlyEnd());
Random r = new Random();
rW.createReadOnlyEnd(), address.createReadOnlyEnd());
Random r = new Random();
@@
-38,7
+40,6
@@
class WordAddressableMemoryTest {
for (int i = 0; i < 50; i++)
{
String sAddress = String.format("%64s", BigInteger.valueOf(4096 + i + j).toString(2)).replace(' ', '0');
for (int i = 0; i < 50; i++)
{
String sAddress = String.format("%64s", BigInteger.valueOf(4096 + i + j).toString(2)).replace(' ', '0');
- sAddress = new StringBuilder(sAddress).reverse().toString();
BitVector bAddress = BitVector.parse(sAddress);
addressI.feedSignals(bAddress);
t.executeAll();
BitVector bAddress = BitVector.parse(sAddress);
addressI.feedSignals(bAddress);
t.executeAll();