hades.models.ruge
Class RAM_64K

java.lang.Object
  extended byhades.simulator.SimObject
      extended byhades.models.ruge.RAM_64K
All Implemented Interfaces:
java.lang.Cloneable, ContextToolTip, java.io.Serializable, Simulatable

public class RAM_64K
extends SimObject

RAM_64K - a subclass of SimObject that models a static RAM of 64K integer words. Ports are for IntegerSignals. The RAM has separate nWE and nME lines.

The behaviour is modeled similar to typical ASIC SRAM macrocells. The RAM outputs are tri-stated and the input disabled as long as nCS is high. RAM outputs and the whole RAM contents are lost, whenever one of the control-lines is undefined.

On the rising edge of nME, the RAM latches the current value of the address inputs. If nWE is high during a nME cycle, the data from the selected RAM location appears on the data outputs after t_access. For a write cycle, hold nWE low during a nME cycle. The value from the data input lines is written to the selected address, as soon as the first of either nWE or nME goes low.

Clicking 'edit' on the RAM model will open a dialog window which allows selection of the initial RAM data file only.

See Also:
Serialized Form

Field Summary
(package private)  StdLogic1164 output_0
           
(package private)  StdLogic1164 output_1
           
(package private)  StdLogic1164 output_X
           
(package private)  StdLogic1164 output_Z
           
(package private)  Port port_ADDR
           
(package private)  Port port_DIN
           
(package private)  Port port_DOUT
           
(package private)  Port port_nME
           
(package private)  Port port_nWE
           
(package private)  java.lang.String resourcename
           
static double t_access
           
static double t_tristate
           
static double t_undefined
           
static int TRISTATED
           
static int UNDEFINED
           
(package private)  java.lang.Integer value_ADDR
           
(package private)  java.lang.Integer value_DIN
           
(package private)  java.lang.Integer value_DOUT
           
 
Fields inherited from class hades.simulator.SimObject
classloader, console, debug, editor, name, parent, ports, propertySheet, simulator, symbol, versionId, visible
 
Constructor Summary
RAM_64K()
          RAM_64K constructor
 
Method Summary
 void configure()
          create and display a 'ConfigDialog' to set the parameters for a SimObject.
 void dbg(java.lang.String msg)
           
 void elaborate(java.lang.Object arg)
          elaborate(): This method is called by the simulation engine to initialize the simulation object.
 void evaluate(java.lang.Object arg)
          evaluate(): called by the simulation engine on all events that concern this object.
 java.lang.String[] getExternalResources()
          return a String[] array of length 1 with our ROM initialization data file.
 java.lang.String getResourcename()
           
 boolean initialize(java.lang.String s)
          initialize a RAM_64K from a String.
 void initRAM()
           
protected  void latchAdress(IntegerSignal signal_A)
           
 boolean needsExternalResources()
          one external resource: the data file to initialize the RAM contents.
 void parseRAM(java.lang.String resourcename)
          parse RAM data from a file specified via its Java 1.1 resourcename.
 void printSramContent()
           
 void setResourcename(java.lang.String s)
           
 java.lang.String toString()
          toString() - the usual info method
 void updateDisplay(int address, int value)
           
 void write(java.io.PrintWriter ps)
           
 
Methods inherited from class hades.simulator.SimObject
constructDynamicSymbol, copy, getBindkey, getClassLoader, getDebug, getEditor, getFullName, getName, getParent, getPort, getPorts, getPropertySheet, getResourceAsStream, getSimulator, getSymbol, getSymbolResourceName, getToolTip, getVersionId, isVisible, keyPressed, message, mousePressed, needsDynamicSymbol, 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
 

Field Detail

output_0

StdLogic1164 output_0

output_1

StdLogic1164 output_1

output_X

StdLogic1164 output_X

output_Z

StdLogic1164 output_Z

port_nWE

Port port_nWE

port_nME

Port port_nME

port_ADDR

Port port_ADDR

port_DIN

Port port_DIN

port_DOUT

Port port_DOUT

value_ADDR

java.lang.Integer value_ADDR

value_DIN

java.lang.Integer value_DIN

value_DOUT

java.lang.Integer value_DOUT

resourcename

java.lang.String resourcename

TRISTATED

public static final int TRISTATED
See Also:
Constant Field Values

UNDEFINED

public static final int UNDEFINED
See Also:
Constant Field Values

t_access

public static final double t_access
See Also:
Constant Field Values

t_tristate

public static final double t_tristate
See Also:
Constant Field Values

t_undefined

public static final double t_undefined
See Also:
Constant Field Values
Constructor Detail

RAM_64K

public RAM_64K()
RAM_64K constructor

Method Detail

needsExternalResources

public boolean needsExternalResources()
one external resource: the data file to initialize the RAM contents.

Overrides:
needsExternalResources in class SimObject

getExternalResources

public java.lang.String[] getExternalResources()
return a String[] array of length 1 with our ROM initialization data file.

Overrides:
getExternalResources in class SimObject

initRAM

public void initRAM()

printSramContent

public void printSramContent()

getResourcename

public java.lang.String getResourcename()

setResourcename

public void setResourcename(java.lang.String s)

initialize

public boolean initialize(java.lang.String s)
initialize a RAM_64K from a String. Currently, the String should contain the following things: the RAM_64K versionId, and the Java resource-name of the RAM datafile to parse, e.g.
       1002 /hades/examples/b-tutorial/ampel-43.rom
    

Overrides:
initialize in class SimObject

write

public void write(java.io.PrintWriter ps)
Overrides:
write in class SimObject

parseRAM

public void parseRAM(java.lang.String resourcename)
parse RAM data from a file specified via its Java 1.1 resourcename. If the file is not found or contains illegal data, the RAM is re-initialized to the all-invalid state.

Each line of the RAM data file should contain the address and the corresponding data in hex format, seperated by a colon, e.g. '0001:D3' or '03FF:20'.

The alternative DigLOG compact format, e.g. '0000:000102030405060708090A0B0C0D0E0F' is also accepted.

The RAM model will issue a warning message, if the same location is written multiple times.


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

elaborate

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

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

evaluate

public void evaluate(java.lang.Object arg)
evaluate(): called by the simulation engine on all events that concern this object. The object is responsible for updating its internal state and for scheduling all pending output events.

Specified by:
evaluate in interface Simulatable
Overrides:
evaluate in class SimObject
Parameters:
arg - an arbitrary object argument

latchAdress

protected void latchAdress(IntegerSignal signal_A)

updateDisplay

public void updateDisplay(int address,
                          int value)

dbg

public void dbg(java.lang.String msg)

toString

public java.lang.String toString()
toString() - the usual info method

Overrides:
toString in class SimObject