create.py 854 B

12345678910111213141516171819202122232425262728
  1. # Include definition of the nodes
  2. from nodes import *
  3. # Include definition of the graph
  4. from graph import *
  5. # Create a configuration object
  6. conf=Configuration()
  7. # The number of schedule iteration is limited to 1
  8. # to prevent the scheduling from running forever
  9. # (which should be the case for a stream computation)
  10. conf.debugLimit=1
  11. # Compute a static scheduling of the graph
  12. # The size of FIFO is also computed
  13. scheduling = the_graph.computeSchedule(config=conf)
  14. # Print some statistics about the compute schedule
  15. # and the memory usage
  16. print("Schedule length = %d" % scheduling.scheduleLength)
  17. print("Memory usage %d bytes" % scheduling.memory)
  18. # Generate the C++ code for the static scheduler
  19. scheduling.ccode("generated",conf)
  20. # Generate a graphviz representation of the graph
  21. with open("simpledsp.dot","w") as f:
  22. scheduling.graphviz(f)