def computeSchedule(self,config=Configuration()):
This is a method on the Graph
object. It can take an optional Configuration
object.
It returns a Schedule
object. This object contains:
- A description of the static schedule
- The computed size of the FIFOs
- The FIFOs
- The buffers for the FIFOs (with sharing when possible if memory optimizations were enabled)
- A rewritten graph with
Duplicate
nodes inserted
def generateGenericNodes(folder):
Create the file GenericNodes.h
in the folder folder
. You can also use the GenericNodes.h
from the CMSIS-Stream repository. But, to make it easier to start, it is included in the Python wrapper.
GenericNodes.h
contains the definitions required for CMSIS-Stream to work (FIFO, Generic nodes, sources and sinks ...)
def generateCGStatus(folder):
Create the file cg_status.h
in the folder folder
. You can also use the cg_status.h
from the CMSIS-Stream repository. But, to make it easier to start, it is included in the Python wrapper.
cg_status.h
contains error codes.
Those options needs to be used on a configuration objects passed as argument of the scheduling function. For instance:
conf = Configuration()
conf.debugLimit = 10
sched = g.computeSchedule(config = conf)
Note that the configuration object also contain options for the code generators. They are described in different part of the documentation.
When the amount of data written to a FIFO and read from the FIFO is the same, the FIFO is just an array. In this case, depending on the scheduling, the memory used by different arrays may be reused if those arrays are not needed at the same time.
This option is enabling an analysis to optimize the memory usage by merging some buffers when it is possible.
Graph coloring strategy used to allocate buffers when memoryOptimization
is enabled.
The strategies are the ones recognized by the Python package NetworkX
and are:
- largest_first
- random_sequential
- smallest_last
- independent_set
- connected_sequential_bfs
- connected_sequential_dfs
- saturation_largest_first
Try to prioritize the scheduling of the sinks to minimize the latency between sources and sinks.
When this option is enabled, the tool may not be able to find a schedule in all cases. If it can't find a schedule, it will raise a DeadLock
exception.
During computation of the schedule, the evolution of the FIFO sizes is generated on stdout
.
During computation of the schedule, the human readable schedule is generated on stdout
.
(It would be more coherent to have this option as a code generation option only but currently it has to be a scheduling option).
By default, C++ objects are assumed to be very light (they are just wrappers around algorithms and the state should be in the algorithms and not in the C++ object). As consequence they are allocated on the stack.
But with big graphs and lot of objects, or if the user would like to implement the algorithm directly in the C++ object, stack allocation is a problem.
By enabling the heapAllocation
feature, the FIFOs object and nodes objects are allocated on the heap. Two new functions are generated by CMSIS-Stream : int init_scheduler()
and void free_scheduler()
. Note that the name scheduler
can be changed with the option schedName
The buffers for the FIFOs are still declared as global to allow control on where they are mapped (this can be changed with the bufferAllocation
option)
Enable the callback mode where the generated state machine can be suspended and resumed.
See section integration of the documentation.
Duplicate
node buffer sharing is an experimental feature. In case of bug, this feature can be disabled with this option.
Note that Duplicate
node buffer sharing is applied only when `memoryOptimization is enabled.