|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object hades.simulator.SimObject hades.models.rtlib.GenericRtlibObject
GenericRtlibObject - the utility base class for HADES RTLIB models, that is, the "Rechnerbaukasten" models.
This class supplies a generic configuration dialog with object name, input bus width (n_bits), default output value, default delay.
Signals are expected to be SignalStdLogicVector objects, typically with n_bits bits.
This class also implements the default behaviour for a Wakeup-event, which is to update (and repaint) the value label in the component's Symbol.
Finally, note that this class implements the assign() method defined in the hades.simulator.Assignable interface. This default implementation expects a (binary, decimal, hex-formatted) string with the new output value, schedules the corresponding event on our vectorOutputPort, and a WakeupEvent which is used to update our internal "vector" value at the corresponding simulation time. Subclasses are free to implement Assignable if this implementation does the right thing.
Nested Class Summary | |
class |
GenericRtlibObject.BinaryValueLabelFormatter
|
class |
GenericRtlibObject.DecimalValueLabelFormatter
|
class |
GenericRtlibObject.DINColorSource
|
class |
GenericRtlibObject.FlexibleLabelFormatter
|
class |
GenericRtlibObject.HexValueLabelFormatter
|
Field Summary | |
static int |
BINARY
|
static int |
DECIMAL
|
protected double |
defaultdelay
|
protected double |
delay
|
protected boolean |
enableAnimationFlag
|
static int |
HEX
|
protected GenericRtlibObject.FlexibleLabelFormatter |
labelFormatter
|
protected int |
n_bits
|
protected ColoredValueLabel |
valueLabel
|
protected StdLogicVector |
vector
|
protected StdLogicVector |
vector_000
|
protected StdLogicVector |
vector_111
|
protected StdLogicVector |
vector_UUU
|
protected StdLogicVector |
vector_XXX
|
protected StdLogicVector |
vector_ZZZ
|
protected PortStdLogicVector |
vectorOutputPort
|
Fields inherited from class hades.simulator.SimObject |
classloader, console, debug, editor, name, parent, ports, propertySheet, simulator, symbol, versionId, visible |
Constructor Summary | |
GenericRtlibObject()
construct a generic Rtlib object. |
Method Summary | |
void |
assign(java.lang.String value,
double simTime)
a default implementation of the assign() method defined in the hades.simulator.Assignable interface. |
void |
configure()
create and display a 'ConfigDialog' to set the parameters for a SimObject. |
protected void |
constructPorts()
|
protected void |
constructStandardValues()
|
SimObject |
copy()
copy(): This function is used to create a clone of this RTLIB object, including the values for width (n_bits), current value (vector), propagation delay, and version ID. |
void |
elaborate(java.lang.Object arg)
elaborate(): This method is called by the simulation engine to initialize this RTLIB object for simulation. |
double |
getDelay()
|
boolean |
getEnableAnimationFlag()
|
java.lang.String |
getFormattedValue()
return a String representation of the current "vector" value using the selected number formatting (dec/hex/bin/...). |
int |
getNumberFormat()
|
java.lang.String |
getToolTip(java.awt.Point position,
long millis)
construct a (short) tool tip message. |
long |
getValue()
|
int |
getWidth()
|
boolean |
initialize(java.lang.String s)
initialize a RTLIB object from a String which contains the integer version id, the width of this vector, and optionally a String of the desired start value (e.g. |
protected void |
initValueLabel()
|
boolean |
isConnected()
|
void |
scheduleAfter(double t_delay,
Port port,
java.lang.Object value)
scheduleAfter: an utility method to schedule a SimEvent on the Signal connected to Port "port" with "value" at time "simTime+t_delay". |
void |
scheduleAfter(double t_delay,
Port port,
StdLogic1164 value)
|
protected void |
scheduleVectorOutputPort()
|
void |
setDelay(double _delay)
|
void |
setDelay(java.lang.String s)
|
void |
setEnableAnimationFlag(boolean b)
|
void |
setEnableAnimationFlag(java.lang.String s)
|
void |
setFormattedValue(java.lang.String s)
|
void |
setNumberFormat(int i)
set the number format to one of DECIMAL, BINARY, HEX |
void |
setNumberFormat(java.lang.String s)
|
void |
setSymbol(Symbol s)
|
void |
setValue(long _value)
|
void |
setValue(java.lang.String s)
|
void |
setWidth(int _n)
|
void |
setWidth(java.lang.String s)
|
java.lang.String |
toString()
toString: generate a text description for this SimObject. |
void |
updateSymbol()
|
void |
wakeup(java.lang.Object arg)
wakeup(): Called by the simulator as a reaction to our own scheduleWakeup()-calls. |
void |
wakeupAfter(double t_delay)
|
void |
write(java.io.PrintWriter ps)
write the following data to PrintWriter ps: our versionId, the width (n_bits), the default output value (vector), and the default delay. |
Methods inherited from class hades.simulator.SimObject |
constructDynamicSymbol, evaluate, getBindkey, getClassLoader, getDebug, getEditor, getExternalResources, getFullName, getName, getParent, getPort, getPorts, getPropertySheet, getResourceAsStream, getSimulator, getSymbol, getSymbolResourceName, getVersionId, isVisible, keyPressed, message, mousePressed, 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 |
evaluate, message |
Field Detail |
protected int n_bits
protected StdLogicVector vector
protected StdLogicVector vector_UUU
protected StdLogicVector vector_XXX
protected StdLogicVector vector_ZZZ
protected StdLogicVector vector_000
protected StdLogicVector vector_111
protected PortStdLogicVector vectorOutputPort
protected double delay
protected double defaultdelay
protected boolean enableAnimationFlag
protected ColoredValueLabel valueLabel
protected GenericRtlibObject.FlexibleLabelFormatter labelFormatter
public static final int DECIMAL
public static final int HEX
public static final int BINARY
Constructor Detail |
public GenericRtlibObject()
Method Detail |
protected void constructPorts()
protected void constructStandardValues()
public boolean getEnableAnimationFlag()
public void setEnableAnimationFlag(boolean b)
public void setEnableAnimationFlag(java.lang.String s)
public double getDelay()
public void setDelay(double _delay)
public void setDelay(java.lang.String s)
public int getWidth()
public void setWidth(int _n)
public void setWidth(java.lang.String s)
public long getValue()
public void setValue(long _value)
public void setValue(java.lang.String s)
public java.lang.String getFormattedValue()
public void setFormattedValue(java.lang.String s)
protected void scheduleVectorOutputPort()
public void setNumberFormat(int i)
public void setNumberFormat(java.lang.String s)
public int getNumberFormat()
public boolean isConnected()
public void configure()
SimObject
configure
in class SimObject
public void setSymbol(Symbol s)
setSymbol
in class SimObject
protected void initValueLabel()
public void updateSymbol()
public void elaborate(java.lang.Object arg)
GenericRtlibObject just calls updateSymbol() to initialize its graphical representation. Probably, most RTLIB classes won't need to override this method.
elaborate
in interface Simulatable
elaborate
in class SimObject
public void wakeup(java.lang.Object arg)
A second use is to update our internal 'vector' variable at a specified simulation time, which is needed to implement the assign() method from interface hades.simulator.Assignable. A WakeupEvent for this purpose is expected to hold a StdLogicVector object (with the 'value' from the assign call) as its payload.
wakeup
in interface Wakeable
public void scheduleAfter(double t_delay, Port port, java.lang.Object value)
public void scheduleAfter(double t_delay, Port port, StdLogic1164 value)
public void wakeupAfter(double t_delay)
public void assign(java.lang.String value, double simTime)
public boolean initialize(java.lang.String s)
initialize
in class SimObject
public void write(java.io.PrintWriter ps)
write
in class SimObject
public SimObject copy()
copy
in class SimObject
public java.lang.String getToolTip(java.awt.Point position, long millis)
getToolTip
in interface ContextToolTip
getToolTip
in class SimObject
public java.lang.String toString()
SimObject
toString
in class SimObject
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |