com.cmpware.cmp.memory
Interface ReadWriteInterface

All Known Subinterfaces:
MemoryInterface
All Known Implementing Classes:
ALU, ARC700, ARC700EX, AutoModel, AutoModelVLIW, AutoSimple, BigEndianMemory, FastModel, FastModel_old, FastSimple, HardNode, HardNodeDemo, LatticeMicro32, LittleEndianMemory, LM32, LocalMemory, Memory, MemoryMappedIO, MicroBlaze, MicroBlaze_old, MIPS32, MIPS32EX, NIOS, NIOS2, Null, PowerPC, PowerPC64, Processor, SharedMemory, Sparc, SPU, Xtensa, XtensaEX

public interface ReadWriteInterface

This implements the basic memory read / write interface.

Copyright (c) 2004, 2005 Cmpware, Inc. All Rights Reserved.

Author:
SAG

Method Summary
 boolean isReadable(int addr)
          This method returns true if the current address is readable and false otherwise.
 boolean isWriteable(int addr)
          This method returns true if the current address is writeable and false otherwise.
 byte read(int addr)
          This method returns a byte from the memory at address 'addr'.
 short read16(int addr)
          This method returns a 16-bit short from the memory at address 'addr'.
 int read24(int addr)
          This method returns a 24-bit unsigned integer from the memory at address 'addr'.
 int read32(int addr)
          This method returns a 32-bit int from the memory at address 'addr'.
 long read64(int addr)
          This method returns a 64-bit long from the memory at address 'addr'.
 void write(int addr, byte a)
          This method copies a byte from 'a' into the memory at address 'addr'.
 void write16(int addr, short a)
          This method writes the 16-bit value 'a' to the requested memory address.
 void write24(int addr, int a)
          This method writes a 24-bit value 'a' to the requested memory address.
 void write32(int addr, int a)
          This method writes the 32-bit value 'a' to the requested memory address.
 void write64(int addr, long a)
          This method writes the 64-bit value 'a' to the requested memory address.
 

Method Detail

isReadable

boolean isReadable(int addr)
This method returns true if the current address is readable and false otherwise.

Parameters:
addr - the address
Returns:
This method returns true if the current address is readable and false otherwise.

isWriteable

boolean isWriteable(int addr)
This method returns true if the current address is writeable and false otherwise.

Parameters:
addr - the address
Returns:
This method returns true if the current address is writeable and false otherwise.

read

byte read(int addr)
          throws MemoryAccessException
This method returns a byte from the memory at address 'addr'.

Parameters:
addr - The memory address.
Returns:
The requested data is returned.
Throws:
MemoryAccessException - if an illegal memory address is encountered.

read16

short read16(int addr)
             throws MemoryAccessException
This method returns a 16-bit short from the memory at address 'addr'.

Parameters:
addr - The memory address.
Returns:
The requested data is returned from the memory.
Throws:
MemoryAccessException - if an illegal memory address is encountered.

read24

int read24(int addr)
           throws MemoryAccessException
This method returns a 24-bit unsigned integer from the memory at address 'addr'. The value is returned as a 32-bit int, with the upper 8 bits always zero.

Parameters:
addr - The memory address.
Returns:
The requested data is returned from the memory.
Throws:
MemoryAccessException - if an illegal memory address is encountered.

read32

int read32(int addr)
           throws MemoryAccessException
This method returns a 32-bit int from the memory at address 'addr'. Note that this method also attempts a Memory Mapped IO if an illegal memory address is encountered.

Parameters:
addr - The memory address.
Throws:
MemoryAccessException - if an illegal memory address is encountered.

read64

long read64(int addr)
            throws MemoryAccessException
This method returns a 64-bit long from the memory at address 'addr'.

Parameters:
addr - The memory address.
Throws:
MemoryAccessException - if an illegal memory address is encountered.

write

void write(int addr,
           byte a)
           throws MemoryAccessException
This method copies a byte from 'a' into the memory at address 'addr'.

Parameters:
addr - The memory address.
a - The data to be written to the memory.
Throws:
MemoryAccessException - if an illegal memory address is encountered.

write16

void write16(int addr,
             short a)
             throws MemoryAccessException
This method writes the 16-bit value 'a' to the requested memory address.

Parameters:
addr - The memory address.
a - The value to be written.
Throws:
MemoryAccessException - if an illegal memory address is encountered.

write24

void write24(int addr,
             int a)
             throws MemoryAccessException
This method writes a 24-bit value 'a' to the requested memory address. The upper 8 bits of the value of 'a' are always ignored.

Parameters:
addr - The memory address.
a - The value to be written.
Throws:
MemoryAccessException - if an illegal memory address is encountered.

write32

void write32(int addr,
             int a)
             throws MemoryAccessException
This method writes the 32-bit value 'a' to the requested memory address.

Parameters:
addr - The memory address.
a - The value to be written.
Throws:
MemoryAccessException - if an illegal memory address is encountered.

write64

void write64(int addr,
             long a)
             throws MemoryAccessException
This method writes the 64-bit value 'a' to the requested memory address.

Parameters:
addr - The memory address.
a - The value to be written.
Throws:
MemoryAccessException - if an illegal memory address is encountered.