Improvement to compute graph
New cyclo static scheduler New code generation mode using switch / case to decrease code size.pull/53/head
parent
1edf36dff6
commit
c91c8d6cec
@ -0,0 +1,36 @@
|
||||
# Reference statistics
|
||||
|
||||
The different examples should return following schedule statistics:
|
||||
|
||||
|
||||
## Example 1
|
||||
Schedule length = 17
|
||||
Memory usage 64 bytes
|
||||
|
||||
## Example 2
|
||||
Schedule length = 302
|
||||
Memory usage 10720 bytes
|
||||
|
||||
## Example 3
|
||||
Schedule length = 25
|
||||
Memory usage 11264 bytes
|
||||
|
||||
## Example 4
|
||||
Schedule length = 25
|
||||
Memory usage 11264 bytes
|
||||
|
||||
## Example 5
|
||||
Schedule length = 292
|
||||
Memory usage 6614 bytes
|
||||
|
||||
## Example 6
|
||||
Schedule length = 17
|
||||
Memory usage 2204 bytes
|
||||
|
||||
## Example 7
|
||||
Schedule length = 3
|
||||
Memory usage 512 bytes
|
||||
|
||||
## Example 8
|
||||
Schedule length = 37
|
||||
Memory usage 288 bytes
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,46 @@
|
||||
{% extends "commonc.cpp" %}
|
||||
|
||||
{% block schedArray %}
|
||||
/*
|
||||
|
||||
Description of the scheduling. It is a list of nodes to call.
|
||||
The values are indexes in the previous array.
|
||||
|
||||
*/
|
||||
static unsigned int schedule[{{schedLen}}]=
|
||||
{
|
||||
{{schedDescription}}
|
||||
};
|
||||
{% endblock %}
|
||||
|
||||
{% block scheduleLoop %}
|
||||
{% if config.debug %}
|
||||
while((cgStaticError==0) && (debugCounter > 0))
|
||||
{% else %}
|
||||
while(cgStaticError==0)
|
||||
{% endif %}
|
||||
{
|
||||
/* Run a schedule iteration */
|
||||
for(unsigned long id=0 ; id < {{schedLen}}; id++)
|
||||
{
|
||||
switch(schedule[id])
|
||||
{
|
||||
{% for nodeID in range(nbNodes) -%}
|
||||
case {{nodeID}}:
|
||||
{
|
||||
{{nodes[nodeID].cRun()}}
|
||||
CHECKERROR;
|
||||
}
|
||||
break;
|
||||
|
||||
{% endfor %}default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
{% if config.debug %}
|
||||
debugCounter--;
|
||||
{% endif %}
|
||||
nbSchedule++;
|
||||
}
|
||||
|
||||
{% endblock %}
|
||||
@ -0,0 +1,75 @@
|
||||
/*
|
||||
|
||||
Generated with CMSIS-DSP Compute Graph Scripts.
|
||||
The generated code is not covered by CMSIS-DSP license.
|
||||
|
||||
The support classes and code is covered by CMSIS-DSP license.
|
||||
|
||||
*/
|
||||
|
||||
{% if config.dumpFIFO %}
|
||||
#define DEBUGSCHED 1
|
||||
{% endif %}
|
||||
|
||||
#include "arm_math.h"
|
||||
#include "custom.h"
|
||||
#include "GenericNodes.h"
|
||||
#include "AppNodes.h"
|
||||
#include "scheduler.h"
|
||||
|
||||
{% macro optionalargs() -%}
|
||||
{% if config.cOptionalArgs %},{{config.cOptionalArgs}}{% endif %}
|
||||
{% endmacro -%}
|
||||
|
||||
{% block schedArray %}
|
||||
{% endblock %}
|
||||
|
||||
/***********
|
||||
|
||||
FIFO buffers
|
||||
|
||||
************/
|
||||
{% for fifo in fifos %}
|
||||
#define FIFOSIZE{{fifo.fifoID}} {{fifo.length}}
|
||||
{% endfor %}
|
||||
|
||||
{% for buf in sched._graph._allBuffers %}
|
||||
#define BUFFERSIZE{{buf._bufferID}} {{buf._length}}
|
||||
{{buf._theType.ctype}} {{config.prefix}}buf{{buf._bufferID}}[BUFFERSIZE{{buf._bufferID}}]={0};
|
||||
|
||||
{% endfor %}
|
||||
|
||||
uint32_t {{config.schedName}}(int *error{{optionalargs()}})
|
||||
{
|
||||
int cgStaticError=0;
|
||||
uint32_t nbSchedule=0;
|
||||
{% if config.debug %}
|
||||
int32_t debugCounter={{config.debugLimit}};
|
||||
{% endif %}
|
||||
|
||||
/*
|
||||
Create FIFOs objects
|
||||
*/
|
||||
{% for id in range(nbFifos) %}
|
||||
{% if fifos[id].hasDelay %}
|
||||
FIFO<{{fifos[id].theType.ctype}},FIFOSIZE{{id}},{{fifos[id].isArrayAsInt}}> fifo{{id}}({{config.prefix}}buf{{fifos[id].buffer._bufferID}},{{fifos[id].delay}});
|
||||
{% else %}
|
||||
FIFO<{{fifos[id].theType.ctype}},FIFOSIZE{{id}},{{fifos[id].isArrayAsInt}}> fifo{{id}}({{config.prefix}}buf{{fifos[id].buffer._bufferID}});
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
/*
|
||||
Create node objects
|
||||
*/
|
||||
{% for node in nodes %}
|
||||
{% if node.hasState %}
|
||||
{{node.typeName}}<{{node.ioTemplate()}}> {{node.nodeName}}({{node.args}});
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
/* Run several schedule iterations */
|
||||
{% block scheduleLoop %}
|
||||
{% endblock %}
|
||||
*error=cgStaticError;
|
||||
return(nbSchedule);
|
||||
}
|
||||
Loading…
Reference in New Issue