jmce - 1_02

jmce.sim.memory
Class OpenCollectorMemoryBit

java.lang.Object
  extended by jmce.sim.memory.MemoryBits
      extended by jmce.sim.memory.MemoryBit
          extended by jmce.sim.memory.OpenCollectorMemoryBit
All Implemented Interfaces:
MemoryReadListener

public class OpenCollectorMemoryBit
extends MemoryBit
implements MemoryReadListener

Memory bit open collector.

Memory bit shared between one cpu and one peripheral. This bit operate as a 'Open Collector' circuit if the peripheral set the bit to 0 the result will be 0 otherwise the result will be read from the associated memory.

Version:
1.00
Author:
Mario Viara

Field Summary
 
Fields inherited from class jmce.sim.memory.MemoryBits
mask, shift
 
Constructor Summary
OpenCollectorMemoryBit(Memory memory, int a, int b)
           
 
Method Summary
 boolean get()
           
 int readMemory(Memory m, int a, int v)
          Called when the memory is readed.
 void set(boolean v)
           
 
Methods inherited from class jmce.sim.memory.MemoryBits
addMemoryWriteListener, getBits, getWidth, setBits
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OpenCollectorMemoryBit

public OpenCollectorMemoryBit(Memory memory,
                              int a,
                              int b)
Method Detail

get

public boolean get()
            throws SIMException
Overrides:
get in class MemoryBit
Throws:
SIMException

set

public void set(boolean v)
         throws SIMException
Overrides:
set in class MemoryBit
Throws:
SIMException

readMemory

public int readMemory(Memory m,
                      int a,
                      int v)
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.

jmce - 1_02