|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.cmpware.cmp.memory.LocalMemory
public class LocalMemory
This class implements the Local Memory. It implements the standard Memory Interface, but permits the Endian to be changed.
Copyright (c) 2004, 2005 Cmpware, Inc. All Rights Reserved.
| Field Summary | |
|---|---|
static boolean |
BIG
Big Endian |
static java.lang.String |
copyright
Copyright string |
static boolean |
LITTLE
Little Endian (default) |
| Constructor Summary | |
|---|---|
LocalMemory()
Constructor |
|
LocalMemory(byte[] b)
Constructor |
|
LocalMemory(int size)
Constructor |
|
| Method Summary | |
|---|---|
void |
clearProfile()
This method clears the profile table. |
byte[] |
get()
This method returns the byte array used to represent the memory. |
int |
getBaseAddress()
This method returns the current base address of the memory. |
boolean |
getEndian()
This method returns the endian of the memory accesses. |
int |
getMaxProfile()
This method returns the largest value currently in the profile table. |
int[] |
getProfile()
This method returns the current memory access profile data as an array of integers. |
int |
getProfile(int addr)
This method returns the number of times an address has been visited by the Program Counter. |
int |
getProfileGranularity()
This method returns the profile granularity. |
boolean |
isReadable(int addr)
This method returns true if the current address is readable and false otherwise. |
boolean |
isValidAddress(int addr)
This method returns true if the address is valid and false otherwise. |
boolean |
isWriteable(int addr)
This method returns true if the current address is writeable and false otherwise. |
void |
profile(int addr)
This method increments the profile count for a particular address. |
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 |
resize(int size)
This method resizes the memory array. |
void |
setBaseAddress(int baseAddr)
This method sets the base address of the memory. |
void |
setEndian(boolean e)
This method sets the endian of the memory accesses. |
int |
size()
This method returns the size of the memory. |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String copyright
public static final boolean BIG
public static final boolean LITTLE
| Constructor Detail |
|---|
public LocalMemory()
public LocalMemory(int size)
size - The size of the memory in bytespublic LocalMemory(byte[] b)
b - The byte array used as the memory store.| Method Detail |
|---|
public void setEndian(boolean e)
setEndian in interface MemoryInterfacee - The endian value. Should be "BIG" or "LITTLE".public boolean getEndian()
getEndian in interface MemoryInterfacepublic void setBaseAddress(int baseAddr)
MemoryInterface
setBaseAddress in interface MemoryInterfacebaseAddr - The base address.public int getBaseAddress()
MemoryInterface
getBaseAddress in interface MemoryInterfacepublic byte[] get()
MemoryInterface
get in interface MemoryInterfacepublic void resize(int size)
MemoryInterface
resize in interface MemoryInterfacesize - The size of the new memory array in bytes.public int size()
MemoryInterface
size in interface MemoryInterfacepublic boolean isValidAddress(int addr)
MemoryInterface
isValidAddress in interface MemoryInterfaceaddr - The address.
public int[] getProfile()
MemoryInterface
getProfile in interface MemoryInterfacepublic void profile(int addr)
MemoryInterface
profile in interface MemoryInterfaceaddr - The address.public int getProfile(int addr)
MemoryInterface
getProfile in interface MemoryInterfaceaddr - The address.
public int getProfileGranularity()
MemoryInterface
getProfileGranularity in interface MemoryInterfacepublic void clearProfile()
MemoryInterface
clearProfile in interface MemoryInterfacepublic int getMaxProfile()
MemoryInterface
getMaxProfile in interface MemoryInterfacepublic boolean isReadable(int addr)
ReadWriteInterface
isReadable in interface ReadWriteInterfaceaddr - the address
public boolean isWriteable(int addr)
ReadWriteInterface
isWriteable in interface ReadWriteInterfaceaddr - the address
public byte read(int addr)
throws MemoryAccessException
ReadWriteInterface
read in interface ReadWriteInterfaceaddr - The memory address.
MemoryAccessException - if an illegal memory address
is encountered.
public short read16(int addr)
throws MemoryAccessException
ReadWriteInterface
read16 in interface ReadWriteInterfaceaddr - The memory address.
MemoryAccessException - if an illegal memory address
is encountered.
public int read24(int addr)
throws MemoryAccessException
ReadWriteInterface
read24 in interface ReadWriteInterfaceaddr - The memory address.
MemoryAccessException - if an illegal memory address
is encountered.
public int read32(int addr)
throws MemoryAccessException
ReadWriteInterface
read32 in interface ReadWriteInterfaceaddr - The memory address.
MemoryAccessException - if an illegal memory address
is encountered.
public long read64(int addr)
throws MemoryAccessException
ReadWriteInterface
read64 in interface ReadWriteInterfaceaddr - The memory address.
MemoryAccessException - if an illegal memory address
is encountered.
public void write(int addr,
byte a)
throws MemoryAccessException
ReadWriteInterface
write in interface ReadWriteInterfaceaddr - The memory address.a - The data to be written to the memory.
MemoryAccessException - if an illegal memory address
is encountered.
public void write16(int addr,
short a)
throws MemoryAccessException
ReadWriteInterface
write16 in interface ReadWriteInterfaceaddr - The memory address.a - The value to be written.
MemoryAccessException - if an illegal memory address
is encountered.
public void write24(int addr,
int a)
throws MemoryAccessException
ReadWriteInterface
write24 in interface ReadWriteInterfaceaddr - The memory address.a - The value to be written.
MemoryAccessException - if an illegal memory address
is encountered.
public void write32(int addr,
int a)
throws MemoryAccessException
ReadWriteInterface
write32 in interface ReadWriteInterfaceaddr - The memory address.a - The value to be written.
MemoryAccessException - if an illegal memory address
is encountered.
public void write64(int addr,
long a)
throws MemoryAccessException
ReadWriteInterface
write64 in interface ReadWriteInterfaceaddr - The memory address.a - The value to be written.
MemoryAccessException - if an illegal memory address
is encountered.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||