|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthades.simulator.SimObject
hades.models.rtlib.memory.GenericMemory
hades.models.mcore.DcoreRAM
DcoreRAM - a RAM with n words by m bits with asynchronous (level sensitive) write enable and separate active-low chip select and output enable inputs for the D*CORE processor.
The user interface for the RAM offers a disassembler view with support for LABEL resolution and editing. Input and output formats display and use byte-addresses, but only aligned works will be accepted on input.
When chip-select or output enable are high, the data output of the RAM is tristated and writes are ignored. This component models a standard MSI/LSI RAM with asynchronous write enable - the adress is never latched. As long as write enable is low, the input data is written to the currently selected address.
Note that the model currently does not check for timing violations during write cycles.
Field Summary | |
protected int |
addr_offset
|
protected DcoreDisassemblerEditorFrame |
editor
|
protected PortStdLogicVector |
port_A
|
protected PortStdLogicVector |
port_DIN
|
protected PortStdLogicVector |
port_DOUT
|
protected PortStdLogic1164 |
port_nCS
|
protected PortStdLogic1164 |
port_nOE
|
protected PortStdLogic1164 |
port_nWE
|
static double |
t_access
|
static double |
t_min_we_cycle
|
static double |
t_setup
|
static double |
t_tristate
|
static double |
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, MEF, n_bits, n_words, resourcename, TRISTATED, UNDEFINED, vector_000, vector_111, vector_UUU, vector_XXX, vector_ZZZ |
Fields inherited from class hades.simulator.SimObject |
classloader, console, debug, name, parent, ports, propertySheet, simulator, symbol, versionId, visible |
Constructor Summary | |
DcoreRAM()
DcoreRAM constructor |
Method Summary | |
boolean |
canChangeSize()
|
void |
configure()
create and display a 'ConfigDialog' to set the parameters for a SimObject. |
protected void |
constructPorts()
construct the ports for this memory. |
protected void |
createEditor()
|
void |
elaborate(java.lang.Object arg)
elaborate(): On elaboration, the inputs of the DcoreRAM will be undefined. |
void |
evaluate(java.lang.Object arg)
evaluate(): If either port_nCS, port_nOE or port_nWE are undefined, the DcoreRAM data is invalidated, and the DOUT value is undefined. |
int |
getAddrOffset()
utility method to support systems with different memory components mapped into a single address space at different offsets. |
java.awt.Component |
getPropertySheet()
return a reference to the 'property sheet' or configuration window for this SimObject. |
boolean |
initialize(java.lang.String s)
initialize this DcoreRAM from a String. |
boolean |
parse(java.io.BufferedReader br)
parse RAM data from a file specified via its Java 1.1 resourcename. |
protected void |
parseLabelLine(java.lang.String line)
|
boolean |
resize(int n_words,
int n_bits)
|
boolean |
save(java.io.PrintWriter PW)
write the memory data in a trivial addr:data format, one address per line. |
void |
setBitsPerWord(int n_bits)
|
void |
setSize(int n_words)
|
void |
write(java.io.PrintWriter ps)
|
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, setSymbol, setVersionId, setVisible, tearDown |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected PortStdLogicVector port_A
protected PortStdLogicVector port_DIN
protected PortStdLogicVector port_DOUT
protected PortStdLogic1164 port_nWE
protected PortStdLogic1164 port_nCS
protected PortStdLogic1164 port_nOE
protected int addr_offset
public static final double t_access
public static final double t_tristate
public static final double t_undefined
public static final double t_setup
public static final double t_min_we_cycle
protected DcoreDisassemblerEditorFrame editor
Constructor Detail |
public DcoreRAM()
Method Detail |
protected void constructPorts()
constructPorts
in class GenericMemory
public int getAddrOffset()
Memory
For example, the D*CORE processor used in our T3 practical course uses one ROM mapped to addresses 0x000..0x6FFF with address offset 0, a RAM mapped to addresses 0x8000..0xFFFF with address offset 0x8000, and IO components mapped to 0x7000..0x7FFF. Standard memory components will usually return 0 here.
getAddrOffset
in interface Memory
getAddrOffset
in class GenericMemory
public boolean canChangeSize()
canChangeSize
in interface Memory
canChangeSize
in class GenericMemory
public void setSize(int n_words)
setSize
in interface Memory
setSize
in class GenericMemory
public void setBitsPerWord(int n_bits)
setBitsPerWord
in interface Memory
setBitsPerWord
in class GenericMemory
public boolean resize(int n_words, int n_bits)
resize
in interface Memory
resize
in class GenericMemory
public void elaborate(java.lang.Object arg)
elaborate
in interface Simulatable
elaborate
in class GenericMemory
public void evaluate(java.lang.Object arg)
Warning: The DcoreRAM model currently does not check for timing violations or address glitches during write cycles. Instead, the corresponding memory locations are written.
evaluate
in interface Simulatable
evaluate
in class GenericMemory
public boolean parse(java.io.BufferedReader br) throws java.lang.Exception
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:0000' or '03FF:CAFE'. A value of "XXXX" or "ZZZZ" or "UUUU" is also accepted and results in the value "xxxx" for the corresponding address.
Input file lines starting with a '#' or ';' character are interpreted as comment lines and are ignored, with the single exception of the following special comments used to specify labels: '#label addr name', e.g. '#label fffc RESET'.
This RAM model converts from external byte addresses to internal word addresses on input and output. Therefore, all addresses in the input file should be word-aligned byte addresses, i.e. 0000, 0002, 0004, 0006, ..., fffe.
The RAM model will issue a warning message, if the same location is written multiple times or if misaligned addresses are used.
parse
in interface Memory
parse
in class GenericMemory
java.lang.Exception
protected void parseLabelLine(java.lang.String line) throws java.lang.Exception
parseLabelLine
in class GenericMemory
java.lang.Exception
public boolean save(java.io.PrintWriter PW)
save
in interface Memory
save
in class GenericMemory
public void write(java.io.PrintWriter ps)
write
in class GenericMemory
public boolean initialize(java.lang.String s)
1001 1024 16 8000 /hades/examples/b-tutorial/ampel-43.rom
initialize
in class GenericMemory
protected void createEditor()
public void configure()
SimObject
configure
in class GenericMemory
public java.awt.Component getPropertySheet()
SimObject
getPropertySheet
in class GenericMemory
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |