You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
CMSIS-DSP/ComputeGraph/examples/simple/create.py

32 lines
987 B
Python

# Include definition of the nodes
from nodes import *
# Include definition of the graph
from graph import *
# Create a configuration object
conf=Configuration()
# The number of schedule iteration is limited to 1
# to prevent the scheduling from running forever
# (which should be the case for a stream computation)
conf.debugLimit=1
# Disable inclusion of CMSIS-DSP headers so that we don't have
# to recompile CMSIS-DSP for such a simple example
conf.CMSISDSP = False
# Compute a static scheduling of the graph
# The size of FIFO is also computed
scheduling = the_graph.computeSchedule(config=conf)
# Print some statistics about the compute schedule
# and the memory usage
print("Schedule length = %d" % scheduling.scheduleLength)
print("Memory usage %d bytes" % scheduling.memory)
# Generate the C++ code for the static scheduler
scheduling.ccode("generated",conf)
# Generate a graphviz representation of the graph
with open("simple.dot","w") as f:
scheduling.graphviz(f)