From 6a134fb837f9772bd5a89243beed5a0a600c4731 Mon Sep 17 00:00:00 2001 From: hneemann Date: Sat, 8 Apr 2017 21:28:18 +0200 Subject: [PATCH] added a LedMatrix circuit to the processor. --- src/main/dig/processor/LedMatrix.dig | 364 ++++++++++++++++++ .../dig/processor/ProcessorVonNeumann.dig | 114 +++--- src/main/dig/processor/core/Memory.dig | 38 +- .../digital/integration/TestExamples.java | 2 +- 4 files changed, 458 insertions(+), 60 deletions(-) create mode 100644 src/main/dig/processor/LedMatrix.dig diff --git a/src/main/dig/processor/LedMatrix.dig b/src/main/dig/processor/LedMatrix.dig new file mode 100644 index 000000000..48ce921ed --- /dev/null +++ b/src/main/dig/processor/LedMatrix.dig @@ -0,0 +1,364 @@ + + + 1 + + + In + + + Description + Datenbus + + + Label + D + + + Bits + 16 + + + + + + In + + + Description + Addressbus + + + Label + A + + + Bits + 16 + + + + + + Comparator + + + Bits + 16 + + + + + + Const + + + Value + 10 + + + Bits + 16 + + + + + + In + + + Description + Takt + + + Label + C + + + + + + And + + + + + In + + + Description + Write Enable + + + Label + W + + + + + + LedMatrix + + + ledPersistence + true + + + colAddrBits + 6 + + + rowDataBits + 16 + + + + + + Register + + + Bits + 16 + + + + + + Comparator + + + Bits + 16 + + + + + + Const + + + Value + 11 + + + Bits + 16 + + + + + + And + + + + + Register + + + Bits + 16 + + + + + + Register + + + Bits + 16 + + + + + + Splitter + + + Input Splitting + 16 + + + Output Splitting + 6,10 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/dig/processor/ProcessorVonNeumann.dig b/src/main/dig/processor/ProcessorVonNeumann.dig index 45d34b844..400f00812 100644 --- a/src/main/dig/processor/ProcessorVonNeumann.dig +++ b/src/main/dig/processor/ProcessorVonNeumann.dig @@ -659,34 +659,6 @@ Von Neumann Two-Cycle CPU. - - Tunnel - - - rotation - - - - NetName - ioW - - - - - - Tunnel - - - rotation - - - - NetName - C - - - - /home/hneemann/Dokumente/Java/digital/src/main/dig/processor/Memory.dig @@ -792,10 +764,38 @@ Von Neumann Two-Cycle CPU. - /home/hneemann/Dokumente/Java/digital/src/main/dig/processor/Terminal.dig + LedMatrix.dig + + Tunnel + + + rotation + + + + NetName + ioW + + + + + + Tunnel + + + rotation + + + + NetName + C + + + + @@ -998,10 +998,6 @@ Von Neumann Two-Cycle CPU. - - - - @@ -1010,10 +1006,26 @@ Von Neumann Two-Cycle CPU. + + + + + + + + + + + + + + + + @@ -1026,18 +1038,6 @@ Von Neumann Two-Cycle CPU. - - - - - - - - - - - - @@ -1094,14 +1094,6 @@ Von Neumann Two-Cycle CPU. - - - - - - - - @@ -1114,6 +1106,14 @@ Von Neumann Two-Cycle CPU. + + + + + + + + @@ -1314,14 +1314,14 @@ Von Neumann Two-Cycle CPU. - - - - + + + + Clock diff --git a/src/main/dig/processor/core/Memory.dig b/src/main/dig/processor/core/Memory.dig index de620cbd2..6320e92bb 100644 --- a/src/main/dig/processor/core/Memory.dig +++ b/src/main/dig/processor/core/Memory.dig @@ -43,11 +43,45 @@ selben Adressraum. Data - 6e0d,48,65,6c,6c,6f,20,57,6f,72,6c,64,a,0,1401,4e10,3c10,5ffc,73f1,1801,6ffa + 8311,6c00,0,0,0,0,0,0,0,0,0,0,38,dfc,dfc,38,0,0,0,e,1e,0,0,1e,e,0,220,ff8,ff8,220, +ff8,ff8,220,0,638,c7c,844,3847,3847,fcc,798,0,c30,630,300,180,c0,c60,c30,0,780,fd8, +87c,8e4,7bc,fd8,840,0,0,10,1e,e,0,0,0,0,0,0,3f0,7f8,c0c,804,0,0,0,0,804,c0c,7f8,3f0, +0,0,80,2a0,3e0,1c0,1c0,3e0,2a0,80,0,80,80,3e0,3e0,80,80,0,0,0,1000,1e00,e00,0,0,0, +80,80,80,80,80,80,80,0,0,0,0,c00,c00,0,0,0,c00,600,300,180,c0,60,30,0,3f0,7f8,c0c, +8c4,8c4,c0c,7f8,3f0,0,810,818,ffc,ffc,800,800,0,e08,f0c,984,8c4,864,c3c,c18,0,408, +c0c,844,844,844,ffc,7b8,0,c0,e0,b0,898,ffc,ffc,880,0,47c,c7c,844,844,844,fc4,784, +0,7f0,ff8,84c,844,844,fc0,780,0,c,c,f04,f84,c4,7c,3c,0,7b8,ffc,844,844,844,ffc,7b8, +0,38,87c,844,844,c44,7fc,3f8,0,0,0,0,630,630,0,0,0,0,0,800,e30,630,0,0,0,0,80,1c0, +360,630,c18,808,0,0,120,120,120,120,120,120,0,0,808,c18,630,360,1c0,80,0,18,1c,4, +dc4,de4,3c,18,0,7f0,ff8,808,bc8,bc8,bf8,1f0,0,fe0,ff0,98,8c,98,ff0,fe0,0,804,ffc, +ffc,844,844,ffc,7b8,0,3f0,7f8,c0c,804,804,c0c,618,0,804,ffc,ffc,804,c0c,7f8,3f0,0, +804,ffc,ffc,844,8e4,c0c,e1c,0,804,ffc,ffc,844,e4,c,1c,0,3f0,7f8,c0c,884,884,78c,f98, +0,ffc,ffc,40,40,40,ffc,ffc,0,0,0,804,ffc,ffc,804,0,0,700,f00,800,804,ffc,7fc,4,0, +804,ffc,ffc,c0,1e0,f3c,e1c,0,804,ffc,ffc,804,800,c00,e00,0,ffc,ffc,38,70,70,38,ffc, +ffc,ffc,ffc,38,70,e0,ffc,ffc,0,7f8,ffc,804,804,804,ffc,7f8,0,804,ffc,ffc,844,44,7c, +38,0,7f8,ffc,804,e04,3c04,3ffc,27f8,0,804,ffc,ffc,44,c4,ffc,f38,0,618,e3c,864,844, +8c4,f9c,718,0,1c,c,804,ffc,ffc,804,c,1c,7fc,ffc,800,800,800,ffc,7fc,0,1fc,3fc,600, +c00,c00,600,3fc,1fc,3fc,ffc,e00,380,380,e00,ffc,3fc,c0c,e1c,330,1e0,1e0,330,e1c,c0c, +1c,3c,860,fc0,fc0,860,3c,1c,e1c,f0c,984,8c4,864,834,c1c,e0c,0,0,ffc,ffc,804,804,0, +0,38,70,e0,1c0,380,700,e00,0,0,0,804,804,ffc,ffc,0,0,8,c,6,3,6,c,8,0,2000,2000,2000, +2000,2000,2000,2000,2000,0,0,3,7,4,0,0,0,700,fa0,8a0,8a0,7e0,fc0,800,0,4,ffc,ffc, +820,860,fc0,780,0,7c0,fe0,820,820,820,c60,440,0,780,fc0,860,824,7fc,ffc,800,0,7c0, +fe0,8a0,8a0,8a0,ce0,4c0,0,840,ff8,ffc,844,c,18,0,0,27c0,6fe0,4820,4820,7fc0,3fe0, +20,0,804,ffc,ffc,40,20,fe0,fc0,0,0,0,820,fec,fec,800,0,0,0,3000,7000,4000,4020,7fec, +3fec,0,804,ffc,ffc,180,3c0,e60,c20,0,0,0,804,ffc,ffc,800,0,0,fe0,fe0,60,fc0,fc0,60, +fe0,fc0,20,fe0,fc0,20,20,fe0,fc0,0,7c0,fe0,820,820,820,fe0,7c0,0,4020,7fe0,7fc0,4820, +820,fe0,7c0,0,7c0,fe0,820,4820,7fc0,7fe0,4020,0,820,fe0,fc0,860,20,e0,c0,0,440,ce0, +9a0,920,b20,e60,440,0,20,20,7f8,ffc,820,c20,400,0,7e0,fe0,800,800,7e0,fe0,800,0,1e0, +3e0,600,c00,c00,600,3e0,1e0,7e0,fe0,c00,700,700,c00,fe0,7e0,820,c60,6c0,380,380,6c0, +c60,820,47e0,4fe0,4800,4800,6800,3fe0,1fe0,0,c60,e60,b20,9a0,8e0,c60,c20,0,0,40,40, +7f8,fbc,804,804,0,0,0,0,fbc,fbc,0,0,0,0,804,804,fbc,7f8,40,40,0,8,c,4,c,8,c,4,0,20, +20,20,20,20,20,20,20,20,20,48,65,6c,6c,6f,20,57,6f,72,6c,64,21,0,82fa,1240,1430,203, +264,4e16,8020,1e10,3618,1812,1458,3c00,6003,4e21,72a2,72b0,1801,8040,3a00,5e05,1811, +2051,65f4,1861,6fec,7c00,2031,fff8,3b30,65e5,1430,1841,4e14,3c10,65e0,6fdc lastDataFile - /home/hneemann/Dokumente/Java/assembler/assembler3/src/main/asm/vonNeumann.hex + /home/hneemann/Dokumente/DHBW/Technische_Informatik_I/Vorlesung/06_Prozessoren/LogiSim/Text.hex diff --git a/src/test/java/de/neemann/digital/integration/TestExamples.java b/src/test/java/de/neemann/digital/integration/TestExamples.java index ad15497a4..ac44b8bb3 100644 --- a/src/test/java/de/neemann/digital/integration/TestExamples.java +++ b/src/test/java/de/neemann/digital/integration/TestExamples.java @@ -28,7 +28,7 @@ public class TestExamples extends TestCase { */ public void testDistExamples() throws Exception { File examples = new File(Resources.getRoot().getParentFile().getParentFile(), "/main/dig"); - assertEquals(108, new FileScanner(this::check).scan(examples)); + assertEquals(109, new FileScanner(this::check).scan(examples)); assertEquals(55, testCasesInFiles); }