|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.cmpware.cmp.memory.LocalMemory
com.cmpware.cmp.memory.SharedMemory
public class SharedMemory
This class implements Shared Memory. This memory is just like local memory, except that writes are not performed immediately, but on the simulation commit() cycle. Note that the original version of this class assumed only one call from this class per simulation cycle. Recent versions take multiple writes per simulation cycle.
Copyright (c) 2004, 2005 Cmpware, Inc. All Rights Reserved.
| Field Summary | |
|---|---|
static java.lang.String |
copyright
Copyright string |
| Fields inherited from class com.cmpware.cmp.memory.LocalMemory |
|---|
BIG, LITTLE |
| Constructor Summary | |
|---|---|
SharedMemory()
Constructor |
|
SharedMemory(byte[] b)
Constructor |
|
SharedMemory(int size)
Constructor |
|
| Method Summary | |
|---|---|
static void |
commit()
This method commits all writes at the end of the simulation cycle. |
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 |
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. |
void |
writeCommit()
This method is called at the end of the simulation cycle and updates the shared memory with any pending writes. |
| Methods inherited from class com.cmpware.cmp.memory.LocalMemory |
|---|
clearProfile, get, getBaseAddress, getEndian, getMaxProfile, getProfile, getProfile, getProfileGranularity, isReadable, isValidAddress, isWriteable, profile, read, read16, read24, read32, read64, resize, setBaseAddress, setEndian, size, write24 |
| 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
| Constructor Detail |
|---|
public SharedMemory()
public SharedMemory(int size)
size - The size of the memory in bytespublic SharedMemory(byte[] b)
b - The byte array used as the memory store.| Method Detail |
|---|
public void write(int addr,
byte a)
throws MemoryAccessException
ReadWriteInterface
write in interface ReadWriteInterfacewrite in class LocalMemoryaddr - 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 ReadWriteInterfacewrite16 in class LocalMemoryaddr - 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 ReadWriteInterfacewrite32 in class LocalMemoryaddr - 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 ReadWriteInterfacewrite64 in class LocalMemoryaddr - The memory address.a - The value to be written.
MemoryAccessException - if an illegal memory address
is encountered.
public void writeCommit()
throws MemoryAccessException
MemoryAccessException
public static void commit()
throws MemoryAccessException
MemoryAccessException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||