Improvements to CG

Small bug fix to make it easier to use several scheduler.
Improvement to declare new arguments for a node.
pull/64/head
Christophe Favergeon 3 years ago
parent 5a99a5c5ad
commit 568e45afc6

@ -7,8 +7,8 @@ The support classes and code is covered by CMSIS-DSP license.
*/ */
#ifndef _SCHED_H_ #ifndef _SCHEDULER_H_
#define _SCHED_H_ #define _SCHEDULER_H_
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"

@ -37,8 +37,7 @@ class ProcessingNode(Node):
floatType=CType(F32) floatType=CType(F32)
src=Source("source",floatType,5) src=Source("source",floatType,5)
b=ProcessingNode("filter",floatType,7,5) b=ProcessingNode("filter",floatType,7,5)
b.addLiteralArg(4) b.addLiteralArg(4,"Test")
b.addLiteralArg("Test")
b.addVariableArg("someVariable") b.addVariableArg("someVariable")
sink=Sink("sink",floatType,5) sink=Sink("sink",floatType,5)

@ -239,6 +239,11 @@ The wrapper is now containing the compute graph Python scripts and you should re
# Change history # Change history
## Version 1.9.1:
* Small fix to the compute graph generator. The `#ifdef` at beginning of the custom header should be different for different scheduler names
* Improve `addLiteralArg` and `addVariableArg` in compute graph to use variable number of arguments
## Version 1.9.0: ## Version 1.9.0:
* New scheduling mode, in the compute graph generator, giving priority to sinks in the scheduling. The idea is to try to decrease the latency between sinks and sources. * New scheduling mode, in the compute graph generator, giving priority to sinks in the scheduling. The idea is to try to decrease the latency between sinks and sources.

@ -300,17 +300,19 @@ class BaseNode:
else: else:
return(0) return(0)
def addLiteralArg(self,l): def addLiteralArg(self,*ls):
if self.schedArgs: for l in ls:
self.schedArgs.append(ArgLiteral(l)) if self.schedArgs:
else: self.schedArgs.append(ArgLiteral(l))
self.schedArgs=[ArgLiteral(l)] else:
self.schedArgs=[ArgLiteral(l)]
def addVariableArg(self,l): def addVariableArg(self,*ls):
if self.schedArgs: for l in ls:
self.schedArgs.append(VarLiteral(l)) if self.schedArgs:
else: self.schedArgs.append(VarLiteral(l))
self.schedArgs=[VarLiteral(l)] else:
self.schedArgs=[VarLiteral(l)]
@property @property
def isConstantNode(self): def isConstantNode(self):

@ -7,8 +7,8 @@ The support classes and code is covered by CMSIS-DSP license.
*/ */
#ifndef _SCHED_H_ #ifndef _{{config.schedulerCFileName |replace(".h","")|upper()}}_H_
#define _SCHED_H_ #define _{{config.schedulerCFileName |replace(".h","")|upper()}}_H_
{% macro optionalargs() -%} {% macro optionalargs() -%}
{% if config.cOptionalArgs %},{{config.cOptionalArgs}}{% endif %} {% if config.cOptionalArgs %},{{config.cOptionalArgs}}{% endif %}

@ -1,2 +1,2 @@
# Python wrapper version # Python wrapper version
__version__ = "1.9.0" __version__ = "1.9.1"

Loading…
Cancel
Save