|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.cmpware.cmp.mmio.MemoryMappedIO
public class MemoryMappedIO
This class implements the memory mapped IO. Here, registers or devices may be mapped to arbitrary addresses outside of the normal memory range.
This class has been changed to support the standard Memory interface, in addition to the send() and recv(). This only impacts the internal use of this class and should not change the way Link models are implemented.
Copyright (c) 2004, 2005 Cmpware, Inc. All Rights Reserved.
| Field Summary | |
|---|---|
static java.lang.String |
copyright
Copyright string |
| Constructor Summary | |
|---|---|
MemoryMappedIO()
|
|
| Method Summary | |
|---|---|
void |
addInput(int addr,
MemoryMappedIOReader mmior)
This method adds a Memory Mapped IO Reader interface to the memory mapped IO. |
void |
addOutput(int addr,
MemoryMappedIOWriter mmiow)
This method adds a Memory Mapped IO Writer interface to the memory mapped IO. |
static void |
commit()
Since all writes should be shadowed in the Memory Mapped IO output ports, they must all be committed at the end of a simulation cycle. |
java.lang.String |
dumpPorts()
This method prints status information about the Memory Mapped IO registers. |
MemoryMappedIOReader[] |
getInputPorts()
This method returns an array of Memory Mapped IO Readers currently used as input ports. |
MemoryMappedIOWriter[] |
getOutputPorts()
This method returns an array of Memory Mapped IO Writers currently used as output ports. |
boolean |
isReadable(int addr)
This method returns true if the current address is readable and false otherwise. |
boolean |
isValidAddress(int addr)
|
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'. |
int |
recv(int addr)
This method reads the memory mapped IO from a specified address. |
void |
send(int addr,
int val)
This method writes the memory mapped IO at a specified address. |
void |
write(int addr,
byte data)
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
| Constructor Detail |
|---|
public MemoryMappedIO()
| Method Detail |
|---|
public void addInput(int addr,
MemoryMappedIOReader mmior)
addr - the address of the Memory Mapped IO Input port.mmior - The Memory Mapped IO reader.
public void addOutput(int addr,
MemoryMappedIOWriter mmiow)
addr - the address of the Memory Mapped IO Output port.mmiow - The Memroy Mapped IO writer.
public int recv(int addr)
throws MemoryAccessException
addr - The address to be read.
MemoryAccessException - if no shared register exists at
this address.
public void send(int addr,
int val)
throws MemoryAccessException
addr - The address to be written.val - The value to be written.
MemoryAccessException - if no shared register exists at
this address or if the write is an attempt to overwrite
the shared register.public static void commit()
public MemoryMappedIOReader[] getInputPorts()
public MemoryMappedIOWriter[] getOutputPorts()
public boolean isValidAddress(int addr)
public 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 data)
throws MemoryAccessException
ReadWriteInterface
write in interface ReadWriteInterfaceaddr - The memory address.data - 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.public java.lang.String dumpPorts()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||