Class MR20

  extended byhades.simulator.SimObject
      extended byhades.models.rtlib.memory.GenericMemory
          extended byhades.models.rtlib.memory.MR
              extended byhades.models.rtlib.memory.MR20
All Implemented Interfaces:
java.lang.Cloneable, ContextToolTip, Memory, java.io.Serializable, Simulatable

public class MR20
extends MR

MR20 - a microcode ROM with some bus- and 20 single outputs.

See Also:
Serialized Form

Field Summary
(package private) static java.lang.String[] labels
Fields inherited from class hades.models.rtlib.memory.MR
alabel, cache_read_addr, D_SIZE, fdata, fdefaultValues, flabel, flength, fseparator, lengthMask, MEF, n_fields, n_words, port_A, port_D, port_S0, port_S1, port_STATE, port_X, port_Y, stateLabel, t_access, t_tristate, t_undefined
Fields inherited from class hades.models.rtlib.memory.GenericMemory
bit_mask, data, enableAnimationFlag, last_read_addr, last_read_data, last_write_addr, last_write_data, n_bits, resourcename, TRISTATED, UNDEFINED, vector_000, vector_111, vector_UUU, vector_XXX, vector_ZZZ
Fields inherited from class hades.simulator.SimObject
classloader, console, debug, editor, name, parent, ports, propertySheet, simulator, symbol, versionId, visible
Constructor Summary
          MR20 constructor
Method Summary
(package private)  boolean checkChange(int addr, int field)
 void configure()
          create and display a 'ConfigDialog' to set the parameters for a SimObject.
 void createField(int index, int length, java.lang.String name)
 void createTypesAndFieldsAndMemory()
 void elaborate(java.lang.Object arg)
          elaborate(): On elaboration, the inputs of the MR20 will be undefined.
 void evaluate(java.lang.Object arg)
          evaluate(): Return the data at address after t_access
 boolean parse(java.io.BufferedReader reader)
          parse RAM data from a file specified via its Java 1.1 resourcename.
 boolean save(java.io.PrintWriter PW)
          write the memory data in a trivial addr:data format, one address per line.
 void setData(int addr, int field, int value)
          set the data of microcode field 'field' at address 'addr' to 'value'.
 void setDataAt(int address, long value)
 void setDSize()
Methods inherited from class hades.models.rtlib.memory.MR
constructPorts, createDefaultValues, getData, getFieldBits, getFieldChars, getFieldName, getNumberOfFields, getSize, getStateLabel, getToolTip, initializeWithDefaultValues, isDefaultValue, isSeparator, schedulePortOutput, scheduleSingleOutput, setFieldName, setStateLabel, setSymbol
Methods inherited from class hades.models.rtlib.memory.GenericMemory
addMemoryListener, addMemoryListenerOld, canChangeSize, checkInvalidateMemory, constructStandardValues, createMemory, dataAtAddressIsUndefined, dbg, getAddressBusWidth, getAddrOffset, getBitsPerWord, getConfigDialog, getDataArray, getDataAt, getEnableAnimationFlag, getExternalResources, getHexDigitsPerWord, getHexString, getInstructionDecoder, getPropertySheet, getResourcename, initialize, initializeWithRandomValues, initializeWithX, initializeWithZeroes, isConnected, main, merge, needsExternalResources, notifyReadListeners, notifyReadListenersOld, notifyWriteListeners, notifyWriteListenersOld, parseLabelLine, parseRAM, removeMemoryListener, removeMemoryListenerOld, resize, setBitsPerWord, setDataArray, setEnableAnimationFlag, setEnableAnimationFlag, setInstructionDecoder, setResourcename, setSize, toString, warning, write
Methods inherited from class hades.simulator.SimObject
constructDynamicSymbol, copy, getBindkey, getClassLoader, getDebug, getEditor, getFullName, getName, getParent, getPort, getPorts, getResourceAsStream, getSimulator, getSymbol, getSymbolResourceName, getVersionId, isVisible, keyPressed, message, mousePressed, needsDynamicSymbol, 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

Field Detail


static java.lang.String[] labels
Constructor Detail


public MR20()
MR20 constructor

Method Detail


public void setDSize()
setDSize in class MR


public void createTypesAndFieldsAndMemory()
createTypesAndFieldsAndMemory in class MR


public void createField(int index,
                        int length,
                        java.lang.String name)
createField in class MR


public void setData(int addr,
                    int field,
                    int value)
set the data of microcode field 'field' at address 'addr' to 'value'.

We also reset the internal cache_read_addr to a negative value, to ensure that the changed data will appear in the simulation

setData in class MR


public boolean save(java.io.PrintWriter PW)
write the memory data in a trivial addr:data format, one address per line. Both address and data are hex-formatted and separated by a colon (and optionally, some blanks).

Specified by:
save in interface Memory
save in class MR


public boolean parse(java.io.BufferedReader reader)
              throws java.lang.Exception
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.

Comment lines starting with '#' or ';' are allowed in the data part of the microcode file only.

Specified by:
parse in interface Memory
parse in class MR


public void setDataAt(int address,
                      long value)
Specified by:
setDataAt in interface Memory
setDataAt in class GenericMemory


public void elaborate(java.lang.Object arg)
elaborate(): On elaboration, the inputs of the MR20 will be undefined. Correspondingly, the outputs are, too.

Specified by:
elaborate in interface Simulatable
elaborate in class MR


public void evaluate(java.lang.Object arg)
evaluate(): Return the data at address after t_access

Specified by:
evaluate in interface Simulatable
evaluate in class MR


boolean checkChange(int addr,
                    int field)


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.

configure in class MR