sim.mem
Class MemBus

java.lang.Object
  extended by sim.mem.MemBus

public class MemBus
extends java.lang.Object

On the processor side of a MemBus is an MMU. On the other side are memory components -- RAM and any memory mapped devices.


Constructor Summary
MemBus(DebuggableMachine machine)
           
 
Method Summary
 void attach(Memory mem, PhysicalAddress location)
          Attach memory of size, at location
 void doCycle()
          Give each block a cycle
 PhysicalAddress getLastWriteAddr()
           
 int getLastWriteVal()
           
 void initialize()
          Initialize each block
 byte readByte(PhysicalAddress address)
          Read a byte at the given address.
 int readWord(PhysicalAddress address)
          Read a word at the given address.
 java.lang.String toString()
           
 void writeByte(PhysicalAddress address, byte value)
          Write a byte at the given address.
 void writeWord(PhysicalAddress address, int value)
          Write a word at the given address.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MemBus

public MemBus(DebuggableMachine machine)
Method Detail

initialize

public void initialize()
Initialize each block


getLastWriteAddr

public PhysicalAddress getLastWriteAddr()

getLastWriteVal

public int getLastWriteVal()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

attach

public void attach(Memory mem,
                   PhysicalAddress location)
Attach memory of size, at location


doCycle

public void doCycle()
             throws DebuggableMachineException
Give each block a cycle

Throws:
DebuggableMachineException

readWord

public int readWord(PhysicalAddress address)
             throws DebuggableMachineException
Read a word at the given address. If there is no memory mapped at that address, an exception in the simulator is raised.

Throws:
DebuggableMachineException

readByte

public byte readByte(PhysicalAddress address)
              throws DebuggableMachineException
Read a byte at the given address. If there is no memory mapped at that address, an exception in the simulator is raised.

Throws:
DebuggableMachineException

writeWord

public void writeWord(PhysicalAddress address,
                      int value)
               throws DebuggableMachineException
Write a word at the given address. If there is no memory mapped at that address, an exception in the simulator is raised.

Throws:
DebuggableMachineException

writeByte

public void writeByte(PhysicalAddress address,
                      byte value)
               throws DebuggableMachineException
Write a byte at the given address. If there is no memory mapped at that address, an exception in the simulator is raised.

Throws:
DebuggableMachineException