de.michab.simulator
Class Port

java.lang.Object
  extended byde.michab.simulator.Port
All Implemented Interfaces:
Forwarder

public class Port
extends java.lang.Object
implements Forwarder

A Port models a Chip's register cells. These may be mapped into the memory space. This results in a forwarding of all memory read/write accesses to the associated Chip's registers.

See Also:
Chip

Constructor Summary
Port(Chip home, int portId)
          Creates an instance.
 
Method Summary
 byte read()
          Read a byte from this port.
 void write(byte value)
          Write a byte to this port.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Port

public Port(Chip home,
            int portId)
Creates an instance.

Parameters:
home - The Chip this Port belongs to.
portId - The port number.
Method Detail

read

public byte read()
Read a byte from this port. This is actually forwarded to the hosting Chip of this port.

Specified by:
read in interface Forwarder
Returns:
The port's contents.

write

public void write(byte value)
Write a byte to this port. This is actually forwarded to the hosting Chip of this port.

Specified by:
write in interface Forwarder
Parameters:
value - The byte to be written.