com.cmpware.cmp.memory
Interface MemoryInterface

All Superinterfaces:
ReadWriteInterface
All Known Implementing Classes:
BigEndianMemory, LittleEndianMemory, LocalMemory, SharedMemory

public interface MemoryInterface
extends ReadWriteInterface

This implements the basic memory interface.

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

Author:
SAG

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 (byte order) of the memory.
 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 isValidAddress(int addr)
          This method returns true if the address is valid and false otherwise.
 void profile(int addr)
          This method increments the profile count for a particular address.
 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 endian)
          This method sets the endian (byte order) of the memory.
 int size()
          This method returns the size of the memory.
 
Methods inherited from interface com.cmpware.cmp.memory.ReadWriteInterface
isReadable, isWriteable, read, read16, read24, read32, read64, write, write16, write24, write32, write64
 

Method Detail

get

byte[] get()
This method returns the byte array used to represent the memory.

Returns:
This method returns the byte array used to represent the memory.

resize

void resize(int size)
This method resizes the memory array. Any data in the old memory array is lost.

Parameters:
size - The size of the new memory array in bytes.

size

int size()
This method returns the size of the memory.

Returns:
This method returns the size of the memory.

setBaseAddress

void setBaseAddress(int baseAddr)
This method sets the base address of the memory. The default base address is zero.

Parameters:
baseAddr - The base address.

getBaseAddress

int getBaseAddress()
This method returns the current base address of the memory.

Returns:
This method returns the current base address of the memory.

getEndian

boolean getEndian()
This method returns the endian (byte order) of the memory.

Returns:
This method returns the endian (byte order) of the memory.

setEndian

void setEndian(boolean endian)
This method sets the endian (byte order) of the memory.

Parameters:
endian - The endian (either Memory.BIG or Memory.LITTLE).

isValidAddress

boolean isValidAddress(int addr)
This method returns true if the address is valid and false otherwise.

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

getProfile

int[] getProfile()
This method returns the current memory access profile data as an array of integers. Each integer in the array represents the number of accesses in a fixed, aligned range of addresses of size getProfileGranularity().

Returns:
This method returns the current memory access profile data as an array of integers.

profile

void profile(int addr)
This method increments the profile count for a particular address.

Parameters:
addr - The address.

getProfile

int getProfile(int addr)
This method returns the number of times an address has been visited by the Program Counter.

Parameters:
addr - The address.
Returns:
This method returns the number of times an address has been visited by the Program Counter.

getProfileGranularity

int getProfileGranularity()
This method returns the profile granularity. This is the size, in bytes, of the fixed, aligned address range tracked. The size of the profile data array is the size of the memory array in bytes divided by the profile granularity.

Returns:
This method returns the profile granularity.

clearProfile

void clearProfile()
This method clears the profile table.


getMaxProfile

int getMaxProfile()
This method returns the largest value currently in the profile table.

Returns:
This method returns the largest value currently in the profile table.