hades.models.rtlib.io
Class OpinVector

java.lang.Object
  extended byhades.simulator.SimObject
      extended byhades.models.rtlib.GenericRtlibObject
          extended byhades.models.rtlib.io.OpinVector
All Implemented Interfaces:
java.lang.Cloneable, ContextToolTip, OutputConnector, java.io.Serializable, Simulatable, Wakeable
Direct Known Subclasses:
OpinVectorLarge

public class OpinVector
extends GenericRtlibObject
implements OutputConnector

OpinVector - the HADES RTLIB hierarchy output connector, which may also be used to display the value on a StdLogicVector bus. The default width is 16 bits.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class hades.models.rtlib.GenericRtlibObject
GenericRtlibObject.BinaryValueLabelFormatter, GenericRtlibObject.DecimalValueLabelFormatter, GenericRtlibObject.DINColorSource, GenericRtlibObject.FlexibleLabelFormatter, GenericRtlibObject.HexValueLabelFormatter
 
Field Summary
static int BINARY
           
static int DECIMAL
           
static int HEX
           
protected  GenericRtlibObject.FlexibleLabelFormatter labelFormatter
           
protected  int numberFormat
           
protected  Port port_A
           
protected  Port port_toplevel
           
protected  double t_delay
           
 
Fields inherited from class hades.models.rtlib.GenericRtlibObject
defaultdelay, delay, enableAnimationFlag, n_bits, valueLabel, vector, vector_000, vector_111, vector_UUU, vector_XXX, vector_ZZZ, vectorOutputPort
 
Fields inherited from class hades.simulator.SimObject
classloader, console, debug, editor, name, parent, ports, propertySheet, simulator, symbol, versionId, visible
 
Constructor Summary
OpinVector()
          OpinVector(): simple constructor
 
Method Summary
 void configure()
          create and display a 'ConfigDialog' to set the parameters for a SimObject.
 void constructPorts()
           
 void evaluate(java.lang.Object arg)
          evaluate(): for an OpinVector, this method is only called in hierarchical designs on any change on the toplevel input.
 int getNumberFormat()
           
 java.lang.String getToolTip(java.awt.Point position, long millis)
          construct a (short) tool tip message.
(package private)  StdLogicVector getVector()
          return a reference to our current result value 'vector'.
 boolean initialize(java.lang.String s)
          initialize an OpinVector from a String which contains the integer version id, the width of this vector, the delay (propagation delay to the next higher hierarchy level), and the default label format (dec/hex/bin).
 void mousePressed(java.awt.event.MouseEvent me)
          mousePressed: toggle the formatting of the value label between decimal, hex, binary.
 void setName(java.lang.String name)
          set the name of this SimObject.
 void setNumberFormat(java.lang.String s)
           
 void setSymbol(Symbol s)
           
 void updateSymbol()
           
 void write(java.io.PrintWriter ps)
          write the following data to PrintWriter ps: our versionId, the width (n_bits), the default delay (propagation delay to the next higher hierarchy level, might be zero), and the default label format (dec=0/hex=1/bin=2)
 
Methods inherited from class hades.models.rtlib.GenericRtlibObject
assign, constructStandardValues, copy, elaborate, getDelay, getEnableAnimationFlag, getFormattedValue, getValue, getWidth, initValueLabel, isConnected, scheduleAfter, scheduleAfter, scheduleVectorOutputPort, setDelay, setDelay, setEnableAnimationFlag, setEnableAnimationFlag, setFormattedValue, setNumberFormat, setValue, setValue, setWidth, setWidth, toString, wakeup, wakeupAfter
 
Methods inherited from class hades.simulator.SimObject
constructDynamicSymbol, getBindkey, getClassLoader, getDebug, getEditor, getExternalResources, getFullName, getName, getParent, getPort, getPorts, getPropertySheet, getResourceAsStream, getSimulator, getSymbol, getSymbolResourceName, getVersionId, isVisible, keyPressed, message, needsDynamicSymbol, needsExternalResources, setClassLoader, setConsole, setDebug, setEditor, 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

DECIMAL

public static final int DECIMAL
See Also:
Constant Field Values

HEX

public static final int HEX
See Also:
Constant Field Values

BINARY

public static final int BINARY
See Also:
Constant Field Values

numberFormat

protected int numberFormat

port_A

protected Port port_A

port_toplevel

protected Port port_toplevel

t_delay

protected double t_delay

labelFormatter

protected GenericRtlibObject.FlexibleLabelFormatter labelFormatter
Constructor Detail

OpinVector

public OpinVector()
OpinVector(): simple constructor

Method Detail

constructPorts

public void constructPorts()
Overrides:
constructPorts in class GenericRtlibObject

setSymbol

public void setSymbol(Symbol s)
Overrides:
setSymbol in class GenericRtlibObject

setName

public void setName(java.lang.String name)
Description copied from class: SimObject
set the name of this SimObject. If there is a Symbol for this SimObject, we also try to set the InstanceLabel in the Symbol.

To avoid consistency problems, when the user changes a SimObject's name interactively, we also try to enforce a unique name.

Overrides:
setName in class SimObject

getNumberFormat

public int getNumberFormat()
Overrides:
getNumberFormat in class GenericRtlibObject

setNumberFormat

public void setNumberFormat(java.lang.String s)
Overrides:
setNumberFormat in class GenericRtlibObject

updateSymbol

public void updateSymbol()
Overrides:
updateSymbol in class GenericRtlibObject

getVector

StdLogicVector getVector()
return a reference to our current result value 'vector'. This method is necessary to allow our inner class FlexibleLabelFormatter access to 'vector', which is protected in GenericRtlibObject and therefore not accessible from the formatter... Ugly protection complexity here.


mousePressed

public void mousePressed(java.awt.event.MouseEvent me)
mousePressed: toggle the formatting of the value label between decimal, hex, binary.

Overrides:
mousePressed in class SimObject

evaluate

public void evaluate(java.lang.Object arg)
evaluate(): for an OpinVector, this method is only called in hierarchical designs on any change on the toplevel input. Propagate the toplevel value to the OpinVector's design.

Specified by:
evaluate in interface Simulatable
Overrides:
evaluate in class SimObject
Parameters:
arg - An arbitrary and unused object

write

public void write(java.io.PrintWriter ps)
write the following data to PrintWriter ps: our versionId, the width (n_bits), the default delay (propagation delay to the next higher hierarchy level, might be zero), and the default label format (dec=0/hex=1/bin=2)

Overrides:
write in class GenericRtlibObject

initialize

public boolean initialize(java.lang.String s)
initialize an OpinVector from a String which contains the integer version id, the width of this vector, the delay (propagation delay to the next higher hierarchy level), and the default label format (dec/hex/bin).

Overrides:
initialize in class GenericRtlibObject

configure

public void configure()
Description copied from class: SimObject
create and display a 'ConfigDialog' to set the parameters for a SimObject. The default ConfigDialog for the base class (SimObject) itself is empty except for the 'instance name' of the SimObject.

Overrides:
configure in class GenericRtlibObject

getToolTip

public java.lang.String getToolTip(java.awt.Point position,
                                   long millis)
construct a (short) tool tip message.

Specified by:
getToolTip in interface ContextToolTip
Overrides:
getToolTip in class GenericRtlibObject