create_fifobench_sync.py 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. # Include definition of the nodes
  2. from nodes import *
  3. # Include definition of the graph
  4. from graph_bench_sync 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=10
  11. conf.customCName = "custom_bench.h"
  12. conf.appNodesCName = "BenchAppNodes.h"
  13. conf.cOptionalArgs=["float32_t* inputArray",
  14. "float32_t* outputArray"
  15. ]
  16. # Compute a static scheduling of the graph
  17. # The size of FIFO is also computed
  18. scheduling = the_graph.computeSchedule(config=conf)
  19. # Print some statistics about the compute schedule
  20. # and the memory usage
  21. print("Schedule length = %d" % scheduling.scheduleLength)
  22. print("Memory usage %d bytes" % scheduling.memory)
  23. # Generate the C++ code for the static scheduler
  24. scheduling.ccode("fifobench_sync",conf)
  25. # Generate a graphviz representation of the graph
  26. with open("dot/fifobench_sync.dot","w") as f:
  27. scheduling.graphviz(f)