hades.models.rtlib.logic
Class GenericOnebitLogicObject

java.lang.Object
  extended byhades.simulator.SimObject
      extended byhades.models.rtlib.logic.GenericOnebitLogicObject
All Implemented Interfaces:
java.lang.Cloneable, ContextToolTip, java.io.Serializable, Simulatable, Wakeable
Direct Known Subclasses:
AddressDecoder4, And, CompareAll, CompareEqual, CompareGreater, CompareLess, CompareNotEqual, Nand, Nor, Or, Xnor, Xor

public class GenericOnebitLogicObject
extends SimObject
implements Simulatable, Wakeable, java.io.Serializable

GenericOnebitLogicObject - the utility base class for HADES n-to-1 bit logical RTLIB models,

This class supplies a generic configuration dialog with object name, input bus width (n_bits), default output value, default delay.

Input Signals are expected to be SignalStdLogicVector objects with n_bits bits, output Signals are of type SignalStdLogic1164.

See Also:
Serialized Form

Field Summary
protected  double defaultdelay
           
protected  double delay
           
protected  int n_bits
           
protected  StdLogic1164 value
           
protected  StdLogic1164 value_0
           
protected  StdLogic1164 value_1
           
protected  StdLogic1164 value_U
           
protected  StdLogic1164 value_X
           
protected  StdLogic1164 value_Z
           
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
           
 
Fields inherited from class hades.simulator.SimObject
classloader, console, debug, editor, name, parent, ports, propertySheet, simulator, symbol, versionId, visible
 
Constructor Summary
GenericOnebitLogicObject()
           
 
Method Summary
 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), currenct 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()
           
 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, the desired start value, and the default delay (e.g.
protected  void initValueLabel()
           
 boolean isConnected()
           
 void setDelay(double _delay)
           
 void setDelay(java.lang.String 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 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, getToolTip, getVersionId, isVisible, keyPressed, message, mousePressed, needsDynamicSymbol, needsExternalResources, setClassLoader, setConsole, setDebug, setEditor, setName, setParent, setPorts, setSimulator, setSymbol, 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

n_bits

protected int n_bits

vector

protected StdLogicVector vector

vector_UUU

protected StdLogicVector vector_UUU

vector_XXX

protected StdLogicVector vector_XXX

vector_ZZZ

protected StdLogicVector vector_ZZZ

vector_000

protected StdLogicVector vector_000

vector_111

protected StdLogicVector vector_111

value

protected StdLogic1164 value

value_U

protected StdLogic1164 value_U

value_X

protected StdLogic1164 value_X

value_0

protected StdLogic1164 value_0

value_1

protected StdLogic1164 value_1

value_Z

protected StdLogic1164 value_Z

delay

protected double delay

defaultdelay

protected double defaultdelay

valueLabel

protected ColoredValueLabel valueLabel
Constructor Detail

GenericOnebitLogicObject

public GenericOnebitLogicObject()
Method Detail

constructPorts

protected void constructPorts()

constructStandardValues

protected void constructStandardValues()

getDelay

public double getDelay()

setDelay

public void setDelay(double _delay)

setDelay

public void setDelay(java.lang.String s)

getWidth

public int getWidth()

setWidth

public void setWidth(int _n)

setWidth

public void setWidth(java.lang.String s)

getValue

public long getValue()

setValue

public void setValue(long _value)

setValue

public void setValue(java.lang.String s)

isConnected

public boolean isConnected()

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 SimObject

initValueLabel

protected void initValueLabel()

updateSymbol

public void updateSymbol()

elaborate

public void elaborate(java.lang.Object arg)
elaborate(): This method is called by the simulation engine to initialize this RTLIB object for simulation.

GenericOnebitLogicObject just calls updateSymbol() to initialize its graphical representation. Probably, most RTLIB classes won't need to override this method.

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

wakeup

public void wakeup(java.lang.Object arg)
wakeup(): Called by the simulator as a reaction to our own scheduleWakeup()-calls. For RTLIB components, a wakeup() is normally used to update the value label

Specified by:
wakeup in interface Wakeable

initialize

public boolean initialize(java.lang.String s)
initialize a RTLIB object from a String which contains the integer version id, the width of this vector, the desired start value, and the default delay (e.g. "1001 8 U 0.3E-9" for an 8 bit vector).

Overrides:
initialize in class SimObject

write

public 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. Hopefully, many RTLIB classes won't need to override write().

Overrides:
write in class SimObject

copy

public SimObject copy()
copy(): This function is used to create a clone of this RTLIB object, including the values for width (n_bits), currenct value (vector), propagation delay, and version ID.

Overrides:
copy in class SimObject

toString

public java.lang.String toString()
Description copied from class: SimObject
toString: generate a text description for this SimObject. This method currently combines the class name for the SimObject (or subclass) and its full name in the current Hades Design, e.g. "hades.models.gates.And2: /uut/adder16/adder1/i3".

Overrides:
toString in class SimObject