Correction in python script for compute graph

Buffer numbering issue for memory optimzation and buffer sharing
pull/53/head
Christophe Favergeon 3 years ago
parent 06c439f7e7
commit 142dcec5c3

@ -54,7 +54,7 @@ class Configuration:
# Prefix to add before the global FIFO buffer names
self.prefix = ""
# Experimental so disbaled by default
# Experimental so disabled by default
self.memoryOptimization = False
# Path to CG module for Python simu

@ -359,7 +359,7 @@ class Graph():
allBuffers=[]
# Compute a graph describing when FIFOs are used at the same time
# The use graph coloring to allocate buffer to those FIFOs.
# Then use graph coloring to allocate buffer to those FIFOs.
# Then size the buffer based on the longest FIFO using it
if config.memoryOptimization:
G = nx.Graph()
@ -376,7 +376,7 @@ class Graph():
currentTime=0
while currentTime<=maxTime:
# Remove fifo no more active.
# Thei stop time < currenTime
# Their stop time < currentTime
toDelete=[]
for k in active:
start,stop=k._liveInterval
@ -394,9 +394,11 @@ class Graph():
start,stop=fifo._liveInterval
# If a src -> node -> dst
# At time t, node will read for src and the stop time
# will be currentTime t.
# will be currentTime t because once read
# the buffer can be reused.
# And it will write to dst and the start time will be
# currentTime
# currentTime because once written the buffer
# cannot be used again until it has been read.
# So, src and dst are both live at this time.
# Which means the condition on the stop time must be
# stop >= currentTime and not a strict comparison
@ -410,6 +412,7 @@ class Graph():
# To debug and display the graph
if False:
import matplotlib.pyplot as plt
labels={}
for n in G.nodes:
labels[n]="%s -> %s" % (n.src.owner.nodeName,n.dst.owner.nodeName)
@ -450,6 +453,9 @@ class Graph():
sharedA = FifoBuffer(theID,CType(UINT8),maxSizes[theID])
allBuffers.append(sharedA)
# bufferID must start after all shared buffers
bufferID = bufferID + 1
for fifo in allFIFOs:
# Use shared buffer if memory optimization
if fifo.isArray and config.memoryOptimization:
@ -472,6 +478,7 @@ class Graph():
#for fifo in allFIFOs:
# fifo.dump()
return(allBuffers)

@ -3,8 +3,7 @@
{% block schedArray %}
/*
Description of the scheduling. It is a list of nodes to call.
The values are indexes in the previous array.
Description of the scheduling.
*/
static unsigned int schedule[{{schedLen}}]=

@ -1,2 +1,2 @@
# Python wrapper version
__version__ = "1.7.0"
__version__ = "1.7.1"

Loading…
Cancel
Save