mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-17 08:55:05 -04:00
first buildable implementation of a async realtime executer
This commit is contained in:
parent
89cf567dde
commit
8ef8c9895a
@ -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() {
|
public AsyncSeq getAsyncInfos() {
|
||||||
return asyncInfos;
|
return asyncInfos;
|
||||||
|
@ -190,11 +190,11 @@ public class ElementLibrary implements Iterable<ElementLibrary.ElementContainer>
|
|||||||
.add(TransGate.DESCRIPTION))
|
.add(TransGate.DESCRIPTION))
|
||||||
.add(new LibraryNode(Lang.get("lib_misc"))
|
.add(new LibraryNode(Lang.get("lib_misc"))
|
||||||
.add(TestCaseElement.TESTCASEDESCRIPTION)
|
.add(TestCaseElement.TESTCASEDESCRIPTION)
|
||||||
.add(AsyncSeq.DESCRIPTION)
|
|
||||||
.add(PowerSupply.DESCRIPTION)
|
.add(PowerSupply.DESCRIPTION)
|
||||||
.add(BusSplitter.DESCRIPTION)
|
.add(BusSplitter.DESCRIPTION)
|
||||||
.add(Reset.DESCRIPTION)
|
.add(Reset.DESCRIPTION)
|
||||||
.add(Break.DESCRIPTION)
|
.add(Break.DESCRIPTION)
|
||||||
|
.add(AsyncSeq.DESCRIPTION)
|
||||||
.add(External.DESCRIPTION));
|
.add(External.DESCRIPTION));
|
||||||
|
|
||||||
addExternalJarComponents(jarFile);
|
addExternalJarComponents(jarFile);
|
||||||
|
@ -53,8 +53,8 @@ public class AsyncSequentialClock implements ModelStateObserverTyped {
|
|||||||
switch (event) {
|
switch (event) {
|
||||||
case STARTED:
|
case STARTED:
|
||||||
int delayMuS = 1000000 / frequency;
|
int delayMuS = 1000000 / frequency;
|
||||||
if (delayMuS < 50)
|
if (delayMuS < 100)
|
||||||
delayMuS = 50;
|
delayMuS = 100;
|
||||||
runner = new RealTimeRunner(delayMuS);
|
runner = new RealTimeRunner(delayMuS);
|
||||||
break;
|
break;
|
||||||
case STOPPED:
|
case STOPPED:
|
||||||
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -134,6 +134,7 @@ public final class ShapeFactory {
|
|||||||
|
|
||||||
map.put(DummyElement.TEXTDESCRIPTION.getName(), TextShape::new);
|
map.put(DummyElement.TEXTDESCRIPTION.getName(), TextShape::new);
|
||||||
map.put(TestCaseElement.TESTCASEDESCRIPTION.getName(), TestCaseShape::new);
|
map.put(TestCaseElement.TESTCASEDESCRIPTION.getName(), TestCaseShape::new);
|
||||||
|
map.put(AsyncSeq.DESCRIPTION.getName(), AsyncClockShape::new);
|
||||||
|
|
||||||
map.put(Diode.DESCRIPTION.getName(), DiodeShape::new);
|
map.put(Diode.DESCRIPTION.getName(), DiodeShape::new);
|
||||||
map.put(DiodeForward.DESCRIPTION.getName(), DiodeForewardShape::new);
|
map.put(DiodeForward.DESCRIPTION.getName(), DiodeForewardShape::new);
|
||||||
|
@ -708,6 +708,10 @@
|
|||||||
<string name="elem_Testcase_tt">Beschreibt einen Testfall. In einem Testfall kann beschrieben werden, wie sich eine
|
<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
|
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>
|
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">Versorgung</string>
|
||||||
<string name="elem_PowerSupply_tt">Hat keine weitere Funktion. Stellt nur sicher, dass VDD und GND angeschlossen sind.
|
<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
|
Kann im Zusammenhang mit den 74xx Bausteinen verwendet werden, um Anschlüsse für die Spannungsversorgung
|
||||||
|
@ -705,6 +705,10 @@
|
|||||||
behavior of the circuit actually corresponds to this description. If this is not the case, an
|
behavior of the circuit actually corresponds to this description. If this is not the case, an
|
||||||
error message is shown.
|
error message is shown.
|
||||||
</string>
|
</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">Power</string>
|
||||||
<string name="elem_PowerSupply_tt">Has no function. Makes sure that VDD and GND are connected.
|
<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>
|
Can be used in 74xx circuits to generate the pins for the voltage supply, which are tested for correct wiring.</string>
|
||||||
|
@ -544,6 +544,11 @@
|
|||||||
<elementAttributes/>
|
<elementAttributes/>
|
||||||
<pos x="180" y="680"/>
|
<pos x="180" y="680"/>
|
||||||
</visualElement>
|
</visualElement>
|
||||||
|
<visualElement>
|
||||||
|
<elementName>AsyncSeq</elementName>
|
||||||
|
<elementAttributes/>
|
||||||
|
<pos x="100" y="820"/>
|
||||||
|
</visualElement>
|
||||||
</visualElements>
|
</visualElements>
|
||||||
<wires>
|
<wires>
|
||||||
<wire>
|
<wire>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user