first buildable implementation of a async realtime executer

This commit is contained in:
hneemann 2018-04-06 17:57:59 +02:00
parent 89cf567dde
commit 8ef8c9895a
8 changed files with 82 additions and 4 deletions

View File

@ -730,7 +730,7 @@ public class Model implements Iterable<Node> {
}
/**
* @return the infos uset for async execution
* @return the infos used for async execution
*/
public AsyncSeq getAsyncInfos() {
return asyncInfos;

View File

@ -190,11 +190,11 @@ public class ElementLibrary implements Iterable<ElementLibrary.ElementContainer>
.add(TransGate.DESCRIPTION))
.add(new LibraryNode(Lang.get("lib_misc"))
.add(TestCaseElement.TESTCASEDESCRIPTION)
.add(AsyncSeq.DESCRIPTION)
.add(PowerSupply.DESCRIPTION)
.add(BusSplitter.DESCRIPTION)
.add(Reset.DESCRIPTION)
.add(Break.DESCRIPTION)
.add(AsyncSeq.DESCRIPTION)
.add(External.DESCRIPTION));
addExternalJarComponents(jarFile);

View File

@ -53,8 +53,8 @@ public class AsyncSequentialClock implements ModelStateObserverTyped {
switch (event) {
case STARTED:
int delayMuS = 1000000 / frequency;
if (delayMuS < 50)
delayMuS = 50;
if (delayMuS < 100)
delayMuS = 100;
runner = new RealTimeRunner(delayMuS);
break;
case STOPPED:

View File

@ -0,0 +1,64 @@
/*
* Copyright (c) 2016 Helmut Neemann
* Use of this source code is governed by the GPL v3 license
* that can be found in the LICENSE file.
*/
package de.neemann.digital.draw.shapes;
import de.neemann.digital.core.Observer;
import de.neemann.digital.core.element.ElementAttributes;
import de.neemann.digital.core.element.PinDescriptions;
import de.neemann.digital.draw.elements.IOState;
import de.neemann.digital.draw.elements.Pins;
import de.neemann.digital.draw.graphics.*;
import de.neemann.digital.draw.graphics.Polygon;
import java.awt.*;
import static de.neemann.digital.draw.shapes.GenericShape.SIZE;
import static de.neemann.digital.draw.shapes.GenericShape.SIZE2;
/**
* The shape to visualize a test case
*/
public class AsyncClockShape implements Shape {
private static final Style TESTSTYLE = Style.NORMAL.deriveFillStyle(new Color(255, 180, 180, 200));
private final String label;
/**
* Creates a new instance
*
* @param attributes the attributes
* @param inputs inputs
* @param outputs outputs
*/
public AsyncClockShape(ElementAttributes attributes, PinDescriptions inputs, PinDescriptions outputs) {
label = attributes.getCleanLabel();
}
@Override
public Pins getPins() {
return new Pins();
}
@Override
public InteractorInterface applyStateMonitor(IOState ioState, Observer guiObserver) {
return null;
}
@Override
public void drawTo(Graphic graphic, Style highLight) {
if (!graphic.isFlagSet(Graphic.LATEX)) {
Polygon pol = new Polygon(true)
.add(SIZE2, SIZE2)
.add(SIZE2 + SIZE * 4, SIZE2)
.add(SIZE2 + SIZE * 4, SIZE * 2 + SIZE2)
.add(SIZE2, SIZE * 2 + SIZE2);
graphic.drawPolygon(pol, TESTSTYLE);
graphic.drawPolygon(pol, Style.THIN);
graphic.drawText(new Vector(SIZE2 + SIZE * 2, SIZE + SIZE2), new Vector(SIZE * 4, SIZE + SIZE2), "Async", Orientation.CENTERCENTER, Style.NORMAL);
graphic.drawText(new Vector(SIZE2 + SIZE * 2, 0), new Vector(SIZE * 4, 0), label, Orientation.CENTERBOTTOM, Style.NORMAL);
}
}
}

View File

@ -134,6 +134,7 @@ public final class ShapeFactory {
map.put(DummyElement.TEXTDESCRIPTION.getName(), TextShape::new);
map.put(TestCaseElement.TESTCASEDESCRIPTION.getName(), TestCaseShape::new);
map.put(AsyncSeq.DESCRIPTION.getName(), AsyncClockShape::new);
map.put(Diode.DESCRIPTION.getName(), DiodeShape::new);
map.put(DiodeForward.DESCRIPTION.getName(), DiodeForewardShape::new);

View File

@ -708,6 +708,10 @@
<string name="elem_Testcase_tt">Beschreibt einen Testfall. In einem Testfall kann beschrieben werden, wie sich eine
Schaltung verhalten soll. Es kann dann automatisch überprüft werden, ob das Verhalten der Schaltung tatsächlich
dieser Beschreibung entspricht. Ist das nicht der Fall, wird eine entsprechende Fehlermeldung angezeigt.</string>
<string name="elem_AsyncSeq">Asynchrones Timing</string>
<string name="elem_AsyncSeq_tt">Erlaubt die Konfiguration des Timings eines asynchronen Automaten wie z.B einer
Muller-Pipeline. Die Schaltung muss im Gatterschrittmodus gestartet werden und muss zunächst einen stabilen Zustand
einnehmen. Interaktiv kann dann der Automat gestartet werden.</string>
<string name="elem_PowerSupply">Versorgung</string>
<string name="elem_PowerSupply_tt">Hat keine weitere Funktion. Stellt nur sicher, dass VDD und GND angeschlossen sind.
Kann im Zusammenhang mit den 74xx Bausteinen verwendet werden, um Anschlüsse für die Spannungsversorgung

View File

@ -705,6 +705,10 @@
behavior of the circuit actually corresponds to this description. If this is not the case, an
error message is shown.
</string>
<string name="elem_AsyncSeq">Asynchronous Timing</string>
<string name="elem_AsyncSeq_tt">Allows configuration of the timing of an asynchronous sequential circuit such as a
Muller pipeline. The circuit must be started in single gate step mode and must be able to reach a stable state
at startup. The automat can then be started interactively.</string>
<string name="elem_PowerSupply">Power</string>
<string name="elem_PowerSupply_tt">Has no function. Makes sure that VDD and GND are connected.
Can be used in 74xx circuits to generate the pins for the voltage supply, which are tested for correct wiring.</string>

View File

@ -544,6 +544,11 @@
<elementAttributes/>
<pos x="180" y="680"/>
</visualElement>
<visualElement>
<elementName>AsyncSeq</elementName>
<elementAttributes/>
<pos x="100" y="820"/>
</visualElement>
</visualElements>
<wires>
<wire>