hades.models.rtlib.io
Class IpinVector

java.lang.Object
  extended byhades.simulator.SimObject
      extended byhades.models.rtlib.GenericRtlibObject
          extended byhades.models.rtlib.io.IpinVector
All Implemented Interfaces:
Assignable, java.lang.Cloneable, ContextToolTip, InputConnector, java.io.Serializable, Simulatable, Wakeable
Direct Known Subclasses:
IpinVectorLarge

public class IpinVector
extends GenericRtlibObject
implements InputConnector, Assignable

IpinVector - a simple switch to specify bus values from Integer values. The width of the corresponding bus is specified by an IpinVector attribute and cannot be changed once a Signal (or the matching width) is connected. The default width is 16 bits.

Also, a IpinVector object can be used as an input for a hierarchical Design.

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
protected  int numberFormat
           
protected  Port port_toplevel
           
protected  Port port_Y
           
protected  double t_delay
           
 
Fields inherited from class hades.models.rtlib.GenericRtlibObject
BINARY, DECIMAL, defaultdelay, delay, enableAnimationFlag, HEX, labelFormatter, 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
IpinVector()
          IpinVector(): simple constructor
 
Method Summary
 void assign(java.lang.String value, double simTime)
          assign: set a new value for a SimObject's internal state at the specified simulation time.
 void configure()
          create and display a 'ConfigDialog' to set the parameters for a SimObject.
 void constructPorts()
           
 void elaborate(java.lang.Object arg)
          elaborate():
 void evaluate(java.lang.Object arg)
          evaluate(): for an IpinVector, 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.
 boolean initialize(java.lang.String s)
          initialize an IpinVector object from a String, which contains the integer version id, the width of this vector, the start value(e.g.
 boolean isUXZClick(java.awt.event.MouseEvent evt)
           
 boolean isUXZClickOLD(java.awt.event.MouseEvent evt)
           
 void mousePressed(java.awt.event.MouseEvent me)
          mousePressed: increment (click) or decrement (shift+click) the output value of this IpinVector.
 void schedule()
           
 void setName(java.lang.String name)
          set the name of this SimObject.
 void setNumberFormat(java.lang.String s)
           
 void setSymbol(Symbol s)
           
 void setValue(java.lang.String s)
           
 void wakeup(java.lang.Object arg)
          wakeup: react to wakeup events.
 void write(java.io.PrintWriter ps)
          write the following data to PrintWriter ps: our versionId, the width (n_bits), the current value, the default delay (propagation delay from the next lower hierarchy level, might be zero), and the default label format (dec=0/hex=1/bin=2)
 
Methods inherited from class hades.models.rtlib.GenericRtlibObject
constructStandardValues, copy, getDelay, getEnableAnimationFlag, getFormattedValue, getValue, getWidth, initValueLabel, isConnected, scheduleAfter, scheduleAfter, scheduleVectorOutputPort, setDelay, setDelay, setEnableAnimationFlag, setEnableAnimationFlag, setFormattedValue, setNumberFormat, setValue, setWidth, setWidth, toString, updateSymbol, 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

port_Y

protected Port port_Y

port_toplevel

protected Port port_toplevel

numberFormat

protected int numberFormat

t_delay

protected double t_delay
Constructor Detail

IpinVector

public IpinVector()
IpinVector(): 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

setValue

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

mousePressed

public void mousePressed(java.awt.event.MouseEvent me)
mousePressed: increment (click) or decrement (shift+click) the output value of this IpinVector.

<-- old way of doing things To allow efficient input of the nonstandard values UUU, XXX, ZZZ, we use the following convention. If the mouse click is in the rightmost part of the IpinVector symbol, the output uses the sequence --> To allow efficient input of the values UUU, XXX, ZZZ, we check for the modifier key. If this is used for the mouse click, 0xvalue : 0xZZZ : 0xXXX : 0xUUU : 0xZZZ, and in reverse order for a shift+click: 0xvalue : 0xUUU : 0xXXX : xZZZ : 0xUUU.

A normal mouse click in the IpinVector symbol, however, increments through the standard numerical values (use + for decrements): 0x -> 0x 0x 0x000.

Overrides:
mousePressed in class SimObject

schedule

public void schedule()

isUXZClickOLD

public boolean isUXZClickOLD(java.awt.event.MouseEvent evt)

isUXZClick

public boolean isUXZClick(java.awt.event.MouseEvent evt)

elaborate

public void elaborate(java.lang.Object arg)
elaborate():

Specified by:
elaborate in interface Simulatable
Overrides:
elaborate in class GenericRtlibObject

evaluate

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

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

assign

public void assign(java.lang.String value,
                   double simTime)
Description copied from interface: Assignable
assign: set a new value for a SimObject's internal state at the specified simulation time. The interpretation of the "value" parameter depends on the SimObject in question; for example, SimObjects based on the StdLogic1164 logic model will accept the parameter strings "U" "X" "0" "1" ... "D".

Specified by:
assign in interface Assignable
Overrides:
assign in class GenericRtlibObject

wakeup

public void wakeup(java.lang.Object arg)
wakeup: react to wakeup events. We have to override the wakeup method from GenericRtlibObject in order to support WakeupEvents generated by previous calls to assign(). To this end, assign() schedules a WakeupEvent which contains the new "vector" output value as its optional argument. We extract that value and call setValue() before calling updateSymobl().

Specified by:
wakeup in interface Wakeable
Overrides:
wakeup in class GenericRtlibObject

initialize

public boolean initialize(java.lang.String s)
initialize an IpinVector object from a String, which contains the integer version id, the width of this vector, the start value(e.g. "1001 8 01ZXW001" for an 8 bit vector), the default delay, and the default number format (dec=0,hex=1,bin=2).

Overrides:
initialize in class GenericRtlibObject

write

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

Overrides:
write 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

getNumberFormat

public int getNumberFormat()
Overrides:
getNumberFormat in class GenericRtlibObject

setNumberFormat

public void setNumberFormat(java.lang.String s)
Overrides:
setNumberFormat 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