|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthades.simulator.SimObject
hades.models.gates.GenericGate
hades.models.io.ClockGen2
ClockGen2 - a clock generator with selectable frequency, duty cycle and phase. Default is a symmetric 1 Hz clock signal. Signals are expected to be StdLogic1164 objects.
+----+ +----+ +----+ +----------------+ +-----+ +-----+ +-----+ .... | | | | | |< offset >|< period >|< >| | dutycycle
Field Summary | |
protected java.lang.String |
bindkey
|
protected Circle |
circleOnOff
|
protected boolean |
debug
|
protected double |
dutycycle
|
protected int |
n_clicks
|
protected int |
n_cycles
|
protected double |
offset
|
protected StdLogic1164 |
output_0
|
protected StdLogic1164 |
output_1
|
protected StdLogic1164 |
output_U
|
protected double |
period
|
protected PortStdLogic1164 |
port_Y
|
protected boolean |
running
|
protected java.awt.Color |
runningColor
|
protected StdLogic1164 |
state
|
Fields inherited from class hades.models.gates.GenericGate |
t_delay |
Fields inherited from class hades.simulator.SimObject |
classloader, console, editor, name, parent, ports, propertySheet, simulator, symbol, versionId, visible |
Constructor Summary | |
ClockGen2()
ClockGen2: create a ClockGen2 with default parameters (1Hz symmetric clock). |
Method Summary | |
void |
configure()
configure: display a dialog window to specify the ClockGen2 instance name and the period, initial offset, and duty cycle timing parameters. |
void |
elaborate(java.lang.Object arg)
elaborate: store a reference to our simulator, then schedule the events for the initial "U" phase, the first "1" phase, and the first wakeup. |
void |
evaluate(java.lang.Object arg)
evaluate: as the ClockGen2 has no input signals, this method should never be called. |
java.lang.String |
getBindkey()
return the bindkey as a String. |
double |
getDutycycle()
|
double |
getOffset()
|
double |
getPeriod()
|
java.lang.String |
getToolTip(java.awt.Point position,
long millis)
construct a tool tip message (with the timing parameters) |
boolean |
initialize(java.lang.String s)
initialize a ClockGen2'erator from a String, which contains its integer version id, and the double values for clock period (in seconds), dutycycle (fraction 0.0 .. |
void |
keyPressed(java.awt.event.KeyEvent ke)
react to a KeyEvent. |
void |
mouseOrKeyPressed(boolean isShiftDown)
|
void |
mousePressed(java.awt.event.MouseEvent me)
start or stop this ClockGen2'erator |
double |
parse(java.lang.String s)
|
void |
setBindkey(java.lang.String s)
|
void |
setDutycycle(double d)
|
void |
setDutycycle(java.lang.String s)
|
void |
setOffset(double d)
|
void |
setOffset(java.lang.String s)
|
void |
setPeriod(double d)
|
void |
setPeriod(java.lang.String s)
|
void |
setSymbol(Symbol s)
|
java.lang.String |
toString()
toString: generate a short description including class name, full instance name, and the timing parameters. |
void |
wakeup(java.lang.Object arg)
wakeup(): Called by the simulator as a reaction to our own scheduleWakeup()-calls. |
void |
write(java.io.PrintWriter ps)
write: write versionId, period [seconds], dutycycle [ratio], and initial offset [seconds]. |
Methods inherited from class hades.models.gates.GenericGate |
copy, getDelay, scheduleEvent, scheduleEventAfter, scheduleOutputValue, scheduleOutputValueAfter, setDelay, setDelay |
Methods inherited from class hades.simulator.SimObject |
constructDynamicSymbol, getClassLoader, getDebug, getEditor, getExternalResources, getFullName, getName, getParent, getPort, getPorts, getPropertySheet, getResourceAsStream, getSimulator, getSymbol, getSymbolResourceName, getVersionId, isVisible, message, needsDynamicSymbol, needsExternalResources, setClassLoader, setConsole, setDebug, setEditor, setName, setParent, setPorts, setSimulator, setVersionId, setVisible, tearDown |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface hades.simulator.Simulatable |
message |
Field Detail |
protected PortStdLogic1164 port_Y
protected StdLogic1164 state
protected StdLogic1164 output_U
protected StdLogic1164 output_0
protected StdLogic1164 output_1
protected double period
protected double dutycycle
protected double offset
protected int n_cycles
protected int n_clicks
protected boolean running
protected boolean debug
protected java.lang.String bindkey
protected Circle circleOnOff
protected java.awt.Color runningColor
Constructor Detail |
public ClockGen2()
Method Detail |
public void setSymbol(Symbol s)
setSymbol
in class SimObject
public double getPeriod()
public double getOffset()
public double getDutycycle()
public void setPeriod(double d)
public void setOffset(double d)
public void setDutycycle(double d)
public void setPeriod(java.lang.String s)
public void setOffset(java.lang.String s)
public void setDutycycle(java.lang.String s)
public java.lang.String getBindkey()
SimObject
Returns the lowercase bindkey character as a String; this key is used by KeyHandler to check whether this SimObject should be activated (via keyPressed()) in view-mode. We return null here. Should be overridden by SimObject's that want to be notified by and react to global key-events on the main editor canvas.
If you plan to enable a bindkey for your SimObject, please: override getBindkey(), implement setBindkey() - e.g. via NameMangler.getBindkey(), change write() to write the bindkey string, change initialize() to parse the bindkey string, modify getToolTip() to print the bindkey, and change configure() to allow setting the bindkey.
getBindkey
in class SimObject
public void setBindkey(java.lang.String s)
public double parse(java.lang.String s)
public boolean initialize(java.lang.String s)
initialize
in class GenericGate
public void write(java.io.PrintWriter ps)
write
in class GenericGate
public void configure()
configure
in class GenericGate
public void mousePressed(java.awt.event.MouseEvent me)
mousePressed
in class SimObject
public void keyPressed(java.awt.event.KeyEvent ke)
SimObject
At the moment this is actually called from KeyHandler.keyTyped(), but this naming mismatch is not considered critical...
keyPressed
in class SimObject
public void mouseOrKeyPressed(boolean isShiftDown)
public void elaborate(java.lang.Object arg)
elaborate
in interface Simulatable
elaborate
in class GenericGate
public void evaluate(java.lang.Object arg)
evaluate
in interface Simulatable
evaluate
in class SimObject
arg
- an arbitrary object argumentpublic void wakeup(java.lang.Object arg)
wakeup
in interface Wakeable
public java.lang.String getToolTip(java.awt.Point position, long millis)
getToolTip
in interface ContextToolTip
getToolTip
in class GenericGate
public java.lang.String toString()
toString
in class SimObject
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |