jmce - 1_02

jmce.intel.mcs51
Class Serial

java.lang.Object
  extended by jmce.sim.AbstractHardware
      extended by jmce.sim.AbstractPeripheral
          extended by jmce.sim.Device<java.lang.Integer>
              extended by jmce.sim.Serial
                  extended by jmce.intel.mcs51.Serial
All Implemented Interfaces:
MCS51Constants, Console, Hardware, MemoryReadListener, MemoryWriteListener, Peripheral

public class Serial
extends Serial
implements MemoryReadListener, MemoryWriteListener, MCS51Constants

Standard 8051 serial interface.

All function to send receive data are supported in polling and interrupt mode. The timing of the uart are not simulated and all character sent or received are processed as soon as possible.

The serial interface extends the jmce.sim.serial class an order to connect the uart to another CPU or to one terminal.

Version:
1.01
Author:
Mario Viara
See Also:
Serial

Field Summary
 
Fields inherited from class jmce.sim.AbstractPeripheral
cpu
 
Fields inherited from interface jmce.intel.mcs51.MCS51Constants
ACC, AUXR1, B, DPH, DPL, IE, IE_EA, IE_EC, IE_ES, IE_ET0, IE_ET1, IE_ET2, IE_EX0, IE_EX1, P0, P0M1, P0M2, P1, P1M1, P1M2, P2, P2M1, P2M2, P3, P3M1, P3M2, PSW, PSW_AC, PSW_CY, PSW_F0, PSW_F1, PSW_OV, PSW_P, PSW_RS0, PSW_RS1, SBUF, SCON, SCON_RI, SCON_TI, SP, TCON, TCON_TF0, TCON_TF1, TCON_TR0, TCON_TR1, TH0, TH1, TL0, TL1, TMOD, TMOD_C_T0, TMOD_C_T1, TMOD_GATE0, TMOD_GATE1, TMOD_T0_M0, TMOD_T0_M1, TMOD_T1_M0, TMOD_T1_M1
 
Constructor Summary
Serial()
          Default constructor
 
Method Summary
 int readMemory(Memory m, int a, int v)
          Called when the memory is readed.
 void registerCPU(CPU cpu)
          Register a parent CPU for future reference.
 void reset()
          Reset the the device to the initial state.
 void writeInput(java.lang.Integer c)
          Write data in the input buffer
 void writeMemory(Memory m, int a, int v, int oldValue)
          Called when a memory write event occours.
 
Methods inherited from class jmce.sim.Serial
print, println, println, putchar
 
Methods inherited from class jmce.sim.Device
addInputConsumer, addInputProducer, addOutputConsumer, addOutputProducer, getConnected, read, readOutput, readyRead, readyReadOutput, readyWrite, removeInputConsumer, removeOutputConsumer, setConnected, write
 
Methods inherited from class jmce.sim.AbstractPeripheral
idle, setIdle, setLive
 
Methods inherited from class jmce.sim.AbstractHardware
addHardware, createFrame, destroy, getHardware, getHardware, getHardware, getHardware, getHardware, getHardwareCount, getHardwareForName, getHardwareInstances, getHardwareTree, getName, getParent, init, initSwing, removeHardware, removeHardware, setHardware, setHardware, setName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jmce.sim.Hardware
addHardware, destroy, getHardware, getHardware, getHardware, getHardware, getHardwareCount, getHardwareInstances, getHardwareTree, getName, getParent, init, initSwing, removeHardware, removeHardware, setHardware, setHardware, setName
 

Constructor Detail

Serial

public Serial()
Default constructor

Method Detail

registerCPU

public void registerCPU(CPU cpu)
                 throws SIMException
Description copied from interface: Peripheral
Register a parent CPU for future reference.

Specified by:
registerCPU in interface Peripheral
Overrides:
registerCPU in class AbstractPeripheral
Throws:
SIMException

reset

public void reset()
           throws SIMException
Description copied from interface: Hardware
Reset the the device to the initial state. This method will be called after init.

Specified by:
reset in interface Hardware
Overrides:
reset in class AbstractHardware
Throws:
SIMException

writeInput

public void writeInput(java.lang.Integer c)
                throws SIMException
Description copied from class: Device
Write data in the input buffer

Overrides:
writeInput in class Device<java.lang.Integer>
Throws:
SIMException

readMemory

public int readMemory(Memory m,
                      int a,
                      int v)
               throws SIMException
Description copied from interface: MemoryReadListener
Called when the memory is readed.

This is method is called to notify a read at the specified memory loction.

Specified by:
readMemory in interface MemoryReadListener
Parameters:
m - - Memory readed.
a - - Address where the operation occours.
v - - Value readed from the phisical memory or from previus installed listener.
Returns:
Value readed from the memory.
Throws:
SIMException

writeMemory

public void writeMemory(Memory m,
                        int a,
                        int v,
                        int oldValue)
                 throws SIMException
Description copied from interface: MemoryWriteListener
Called when a memory write event occours.

This method is called when a memory write operation occours in the specified memory.

Specified by:
writeMemory in interface MemoryWriteListener
Parameters:
m - - Memory involved in the write operation.
a - - Address written.
v - - Value written.
oldValue - - Old value of this memory location.
Throws:
SIMException

jmce - 1_02