|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.cmpware.cmp.Link
com.cmpware.cmp.links.FIFO
public class FIFO
This class implements a synchronous FIFO. This is used as a link component to build inter-processor communication networks. The input port of the FIFO is typically mapped to a memory mapped IO address on one processor and the output port to a memory mapped IO address on another processor. This creates a communication link between the processors. Note that the internal implementation of this link object requires some care to support the multiprocessor simulation environment. All state update should be done at commit time.
Copyright (c) 2004 Cmpware, Inc. All Rights Reserved.
| Field Summary | |
|---|---|
static java.lang.String |
copyright
Copyright string |
static int |
DEFAULT_SIZE
The default FIFO size |
protected int[] |
fifo
The FIFO data |
protected int |
head
The FIFO 'head' pointer |
protected MemoryMappedIOException |
mmioe
A Memory Mapped IO Execption (so we don't have to keep re-allocating them) |
protected int |
readAddr
The read address (for information only) |
protected int |
readCount
The number of reads |
protected boolean |
readFlag
This flag indicates that a read was performed on this cycle |
protected int |
readStallCount
The number of read stalls |
protected int |
tail
The FIFO 'tail' pointer |
protected int |
writeAddr
The write address (for information only) |
protected int |
writeCount
The number of writes |
protected int |
writeStallCount
The number of write stalls |
protected boolean |
writtenFlag
This flag indicates that a write was performed on this cycle |
| Constructor Summary | |
|---|---|
FIFO()
This constructor allocates a FIFO using the default FIFO size. |
|
FIFO(int size)
This constructor allocates a FIFO. |
|
| Method Summary | |
|---|---|
int |
free()
This method returns the number of remaining slots in the FIFO. |
int |
getReadAddress()
This method returns the processor address to which the read port of this Memory Mapped IO is mapped. |
int |
getReadCount()
This method returns the number of times the read port has been accessed. |
int |
getReadStallCount()
This method returns the number of times the read port has stalled. |
int |
getValue()
This method returns the most recently written value of the Memory Mapped IO. |
int |
getWriteAddress()
This method returns the processor address to which the write port of this Memory Mapped IO is mapped. |
int |
getWriteCount()
This method returns the number of times the write port has been accessed. |
int |
getWriteStallCount()
This method returns the number of times the write port has stalled. |
protected boolean |
isEmpty()
This method returns a true if the FIFO is empty and a false otherwise. |
protected boolean |
isFull()
This method returns a true if the FIFO is full and a false otherwise. |
boolean |
isReadable()
This method returns a true if the Memory Mapped IO is currently readable. |
boolean |
isWriteable()
This method returns a true if the Memory Mapped IO port is currently writeable. |
int |
read()
This method reads a value from the Memory Mapped IO port. |
void |
readCommit()
All Memory Mapped IO reads are performed whenever data is available. |
void |
reset()
This abstract class is used to reset the link. |
void |
setBufferSize(int size)
This method is used to set the buffer size in the communication link. |
void |
setReadAddress(int addr)
This method sets the read address of the Memeory Mapped IO. |
void |
setWriteAddress(int addr)
This method sets the write address of the Memory Mapped IO. |
int |
used()
This method returns the number of used slots in the FIFO. |
void |
write(int val)
This method writes a word to the Memory Mapped IO. |
void |
writeCommit()
All Memory Mapped IO writes are performed whenever data is available. |
| Methods inherited from class com.cmpware.cmp.Link |
|---|
get |
| 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 int DEFAULT_SIZE
protected int[] fifo
protected int head
protected int tail
protected int readAddr
protected int writeAddr
protected int readCount
protected int writeCount
protected int readStallCount
protected int writeStallCount
protected boolean writtenFlag
protected boolean readFlag
protected MemoryMappedIOException mmioe
| Constructor Detail |
|---|
public FIFO()
public FIFO(int size)
size - the FIFO size.| Method Detail |
|---|
public void setBufferSize(int size)
Link
setBufferSize in class Linksize - The buffer size.public void reset()
MemoryMappedIOReader
public void write(int val)
throws MemoryMappedIOException
MemoryMappedIOWriter
val - The value to write to the Memory Mapped IO.
MemoryMappedIOException - - this method throws
a MemoryMappedIOException if the write could not
be completed on this cycle. This will typically
cause a stall of the processor and a retry on the
next cycle.
public int read()
throws MemoryMappedIOException
MemoryMappedIOReader
MemoryMappedIOException - - this method throws
a MemoryMappedIOException if the read could not
be completed on this cycle. This will typically
cause a stall of the processor and a retry on the
next cycle.public void writeCommit()
MemoryMappedIOWriter
public void readCommit()
MemoryMappedIOReader
public void setReadAddress(int addr)
MemoryMappedIOReader
addr - The Memory Mapped IO read address.public int getReadAddress()
MemoryMappedIOReader
public int getReadCount()
MemoryMappedIOReader
public int getReadStallCount()
MemoryMappedIOReader
public void setWriteAddress(int addr)
MemoryMappedIOWriter
addr - The Memory Mapped IO write address.public int getWriteAddress()
MemoryMappedIOWriter
public int getWriteCount()
MemoryMappedIOWriter
public int getWriteStallCount()
MemoryMappedIOWriter
public int getValue()
MemoryMappedIOReader
public boolean isReadable()
MemoryMappedIOReader
public boolean isWriteable()
MemoryMappedIOWriter
public int used()
public int free()
protected boolean isEmpty()
protected boolean isFull()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||