|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmapss.dif.csdf.sdf.mem.BufferSharing
public class BufferSharing
Communication buffers can share physical memory spaces if their lifetimes do not overlap. The purpose of sharing is to reduce the total space cost.
This class implements the algorithm proposed in Shared Buffer Implementations of Signal Processing Systems Using Lifetime Analysis Techniques by Praveen K. Murthy and Shuvra S. Bhattcharyya. In their algorithm, lifetime analysis is derived from an SDF schedule. The periodical behavior presented in SDF schedule enables efficient analysis on lifetimes. After that, the actual storage allocation is done by dynamic storage allocation (DSA) algorithms, e.g., first-fit.
CAUTION: The buffer lifetime analysis in the above algorithm assumes the input graph to be ACYCLIC. If not, an exception will be thrown.
Field Summary | |
---|---|
protected SDFGraph |
_graph
The associated SDF graph. |
Constructor Summary | |
---|---|
BufferSharing(SDFGraph graph,
mocgraph.sched.Schedule schedule)
Constructor for given graph. |
Method Summary | |
---|---|
protected int |
_bufferRepetition(mocgraph.Edge edge)
Get repetition counts for the given buffer. |
protected int |
_computeBufferSharing()
Evaluate buffer sharing and compute total buffer size needed. |
int |
bufferCount()
Get the total number of buffers. |
java.util.Map |
bufferIntersections()
Compute buffer intersections. |
java.util.List |
enumerateBuffersByDuration()
Configure the internal buffer enumeration by durations. |
java.util.List |
enumerateBuffersByStart()
Configure the internal buffer enumeration by start times (default enumeration). |
static int |
firstFit(java.util.List enumeration,
java.util.Map intersections,
java.util.Map sizeMap)
First-fit algorithm for Dynamic Storage Allocation (DSA). |
static java.util.Map |
getBufferAddresses()
Get buffer start addresses after calling firstFit to
allocate buffers. |
int |
sharingCost()
The space allocated to buffer sharing. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected SDFGraph _graph
Constructor Detail |
---|
public BufferSharing(SDFGraph graph, mocgraph.sched.Schedule schedule)
graph
- The given SDF graphMethod Detail |
---|
public int bufferCount()
public java.util.Map bufferIntersections()
Set
).
public java.util.List enumerateBuffersByDuration()
public java.util.List enumerateBuffersByStart()
public static int firstFit(java.util.List enumeration, java.util.Map intersections, java.util.Map sizeMap)
enumeration
- Enumeration over storages.intersection
- Storage intersections/lifetime overlaps.sizeMap
- A map from storage to Integer objects with integer
valued storage size.
public static java.util.Map getBufferAddresses()
firstFit
to
allocate buffers.
End address of edge e = start address e + size e
-1.
public int sharingCost()
protected int _bufferRepetition(mocgraph.Edge edge)
edge
- The given buffer's associated edge.
protected int _computeBufferSharing()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |