Added a dynamic mode to the compute graph.
The compute graph hierarchy (Python and C++) has been modified. It will break the code using the CG and the include and import will have to be modified. New function prepareForRunning is needed in CG nodes even if not used in static mode. Without this function, code using compute graph won't build.pull/94/head
parent
82559adce2
commit
66ea68b096
@ -0,0 +1,17 @@
|
||||
#ifndef _CG_STATUS_H_
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
CG_SUCCESS = 0, /**< No error */
|
||||
CG_BUFFER_UNDERFLOW = -1, /**< FIFO underflow */
|
||||
CG_BUFFER_OVERFLOW = -2, /**< FIFO overflow */
|
||||
CG_MEMORY_ALLOCATION_FAILURE = -3, /**< Memory allocation failure */
|
||||
CG_INIT_FAILURE = -4, /**< Node initialization failure */
|
||||
CG_SKIP_EXECUTION = -5, /**< Skip node execution (asynchronous mode) */
|
||||
CG_BUFFER_ERROR = -6, /**< Stop execution due to FIFO overflow or underflow (asynchronous mode for pure function) */
|
||||
} cg_status;
|
||||
|
||||
|
||||
|
||||
#endif /* _CG_STATUS_H_ */
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 6.6 KiB |
@ -0,0 +1,195 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
* Project: CMSIS DSP Library
|
||||
* Title: AppNodes.h
|
||||
* Description: Application nodes for Example 1
|
||||
*
|
||||
* $Date: 29 July 2021
|
||||
* $Revision: V1.10.0
|
||||
*
|
||||
* Target Processor: Cortex-M and Cortex-A cores
|
||||
* -------------------------------------------------------------------- */
|
||||
/*
|
||||
* Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef _APPNODES_H_
|
||||
#define _APPNODES_H_
|
||||
|
||||
#include <iostream>
|
||||
#include <cstdio>
|
||||
|
||||
static int count=0;
|
||||
|
||||
template<typename OUT,int outputSize>
|
||||
class SourceOdd;
|
||||
|
||||
template<typename OUT,int outputSize>
|
||||
class SourceEven;
|
||||
|
||||
template<>
|
||||
class SourceOdd<int16_t,1>: public GenericSource<int16_t,1>
|
||||
{
|
||||
public:
|
||||
SourceOdd(FIFOBase<int16_t> &dst):
|
||||
GenericSource<int16_t,1>(dst){};
|
||||
|
||||
int prepareForRunning() override
|
||||
{
|
||||
if (this->willOverflow())
|
||||
{
|
||||
return(CG_SKIP_EXECUTION_ID_CODE); // Skip execution
|
||||
}
|
||||
|
||||
return(0);
|
||||
};
|
||||
|
||||
int run() override{
|
||||
if (count & 1)
|
||||
{
|
||||
int16_t *b=this->getWriteBuffer();
|
||||
b[0] = count;
|
||||
}
|
||||
return(0);
|
||||
};
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
template<>
|
||||
class SourceEven<int16_t,1>: public GenericSource<int16_t,1>
|
||||
{
|
||||
public:
|
||||
SourceEven(FIFOBase<int16_t> &dst):
|
||||
GenericSource<int16_t,1>(dst){};
|
||||
|
||||
int prepareForRunning() override
|
||||
{
|
||||
if (this->willOverflow())
|
||||
{
|
||||
return(CG_SKIP_EXECUTION_ID_CODE); // Skip execution
|
||||
}
|
||||
|
||||
return(0);
|
||||
};
|
||||
|
||||
int run() override{
|
||||
if (!(count & 1))
|
||||
{
|
||||
int16_t *b=this->getWriteBuffer();
|
||||
b[0] = count;
|
||||
}
|
||||
return(0);
|
||||
};
|
||||
|
||||
|
||||
};
|
||||
|
||||
template<typename INA, int inputSizeA,
|
||||
typename INB, int inputSizeB,
|
||||
typename OUT,int outputSize>
|
||||
class ProcessingOddEven;
|
||||
|
||||
template<>
|
||||
class ProcessingOddEven<int16_t,1,
|
||||
int16_t,1,
|
||||
int16_t,1>:
|
||||
public GenericNode21<int16_t,1,
|
||||
int16_t,1,
|
||||
int16_t,1>
|
||||
{
|
||||
public:
|
||||
ProcessingOddEven(FIFOBase<int16_t> &srcOdd,
|
||||
FIFOBase<int16_t> &srcEven,
|
||||
FIFOBase<int16_t> &dst):
|
||||
GenericNode21<int16_t,1,
|
||||
int16_t,1,
|
||||
int16_t,1>(srcOdd,srcEven,dst){};
|
||||
|
||||
int prepareForRunning() override
|
||||
{
|
||||
if (this->willOverflow())
|
||||
{
|
||||
return(CG_SKIP_EXECUTION_ID_CODE);
|
||||
}
|
||||
return(0);
|
||||
};
|
||||
|
||||
int run() override{
|
||||
int16_t oddVal=0;
|
||||
int16_t evenVal=0;
|
||||
if (!this->willUnderflow1())
|
||||
{
|
||||
int16_t *odd=this->getReadBuffer1();
|
||||
oddVal=odd[0];
|
||||
}
|
||||
|
||||
if (!this->willUnderflow2())
|
||||
{
|
||||
int16_t *even=this->getReadBuffer2();
|
||||
evenVal=even[0];
|
||||
}
|
||||
|
||||
int16_t *dst=this->getWriteBuffer();
|
||||
|
||||
dst[0] = (evenVal + oddVal);
|
||||
|
||||
return(0);
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
template<typename IN, int inputSize>
|
||||
class SinkAsync;
|
||||
|
||||
template<int inputSize>
|
||||
class SinkAsync<int16_t,inputSize>:
|
||||
public GenericSink<int16_t, inputSize>
|
||||
{
|
||||
public:
|
||||
SinkAsync(FIFOBase<int16_t> &src):
|
||||
GenericSink<int16_t,inputSize>(src){
|
||||
};
|
||||
|
||||
int prepareForRunning() override
|
||||
{
|
||||
if (this->willUnderflow())
|
||||
{
|
||||
return(CG_SKIP_EXECUTION_ID_CODE); // Skip execution
|
||||
}
|
||||
|
||||
return(0);
|
||||
};
|
||||
|
||||
int run() override
|
||||
{
|
||||
int16_t *b=this->getReadBuffer();
|
||||
for(int i=0;i<inputSize;i++)
|
||||
{
|
||||
printf("%d\n",b[i]);
|
||||
}
|
||||
return(0);
|
||||
};
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
void compute(int16_t *in,int16_t *out, int nb)
|
||||
{
|
||||
out[0] = in[0];
|
||||
}
|
||||
#endif
|
||||
@ -0,0 +1,13 @@
|
||||
cmake_minimum_required (VERSION 3.14)
|
||||
include(CMakePrintHelpers)
|
||||
|
||||
project(Example10)
|
||||
|
||||
|
||||
add_executable(example10 main.cpp)
|
||||
|
||||
sdf(example10)
|
||||
add_sdf_dir(example10)
|
||||
|
||||
target_include_directories(example10 PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
target_include_directories(example10 PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/generated)
|
||||
@ -0,0 +1,9 @@
|
||||
#ifndef _CUSTOM_H_
|
||||
|
||||
#include "cg_status.h"
|
||||
|
||||
#define CG_BEFORE_BUFFER __ALIGNED(4)
|
||||
|
||||
#define CG_AFTER_ITERATION count++
|
||||
|
||||
#endif
|
||||
@ -0,0 +1,297 @@
|
||||
/*
|
||||
|
||||
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.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#include "arm_math.h"
|
||||
#include "custom.h"
|
||||
#include "GenericNodes.h"
|
||||
#include "AppNodes.h"
|
||||
#include "scheduler.h"
|
||||
|
||||
#if !defined(CHECKERROR)
|
||||
#define CHECKERROR if (cgStaticError < 0) \
|
||||
{\
|
||||
goto errorHandling;\
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if !defined(CG_BEFORE_ITERATION)
|
||||
#define CG_BEFORE_ITERATION
|
||||
#endif
|
||||
|
||||
#if !defined(CG_AFTER_ITERATION)
|
||||
#define CG_AFTER_ITERATION
|
||||
#endif
|
||||
|
||||
#if !defined(CG_BEFORE_SCHEDULE)
|
||||
#define CG_BEFORE_SCHEDULE
|
||||
#endif
|
||||
|
||||
#if !defined(CG_AFTER_SCHEDULE)
|
||||
#define CG_AFTER_SCHEDULE
|
||||
#endif
|
||||
|
||||
#if !defined(CG_BEFORE_BUFFER)
|
||||
#define CG_BEFORE_BUFFER
|
||||
#endif
|
||||
|
||||
#if !defined(CG_BEFORE_FIFO_BUFFERS)
|
||||
#define CG_BEFORE_FIFO_BUFFERS
|
||||
#endif
|
||||
|
||||
#if !defined(CG_BEFORE_FIFO_INIT)
|
||||
#define CG_BEFORE_FIFO_INIT
|
||||
#endif
|
||||
|
||||
#if !defined(CG_BEFORE_NODE_INIT)
|
||||
#define CG_BEFORE_NODE_INIT
|
||||
#endif
|
||||
|
||||
#if !defined(CG_AFTER_INCLUDES)
|
||||
#define CG_AFTER_INCLUDES
|
||||
#endif
|
||||
|
||||
#if !defined(CG_BEFORE_SCHEDULER_FUNCTION)
|
||||
#define CG_BEFORE_SCHEDULER_FUNCTION
|
||||
#endif
|
||||
|
||||
#if !defined(CG_BEFORE_NODE_EXECUTION)
|
||||
#define CG_BEFORE_NODE_EXECUTION
|
||||
#endif
|
||||
|
||||
#if !defined(CG_AFTER_NODE_EXECUTION)
|
||||
#define CG_AFTER_NODE_EXECUTION
|
||||
#endif
|
||||
|
||||
CG_AFTER_INCLUDES
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Description of the scheduling.
|
||||
|
||||
*/
|
||||
static unsigned int schedule[7]=
|
||||
{
|
||||
5,6,2,0,1,3,4,
|
||||
};
|
||||
|
||||
CG_BEFORE_FIFO_BUFFERS
|
||||
/***********
|
||||
|
||||
FIFO buffers
|
||||
|
||||
************/
|
||||
#define FIFOSIZE0 2
|
||||
#define FIFOSIZE1 2
|
||||
#define FIFOSIZE2 2
|
||||
#define FIFOSIZE3 2
|
||||
#define FIFOSIZE4 2
|
||||
#define FIFOSIZE5 2
|
||||
|
||||
#define BUFFERSIZE1 2
|
||||
CG_BEFORE_BUFFER
|
||||
int16_t buf1[BUFFERSIZE1]={0};
|
||||
|
||||
#define BUFFERSIZE2 2
|
||||
CG_BEFORE_BUFFER
|
||||
int16_t buf2[BUFFERSIZE2]={0};
|
||||
|
||||
#define BUFFERSIZE3 2
|
||||
CG_BEFORE_BUFFER
|
||||
int16_t buf3[BUFFERSIZE3]={0};
|
||||
|
||||
#define BUFFERSIZE4 2
|
||||
CG_BEFORE_BUFFER
|
||||
int16_t buf4[BUFFERSIZE4]={0};
|
||||
|
||||
#define BUFFERSIZE5 2
|
||||
CG_BEFORE_BUFFER
|
||||
int16_t buf5[BUFFERSIZE5]={0};
|
||||
|
||||
#define BUFFERSIZE6 2
|
||||
CG_BEFORE_BUFFER
|
||||
int16_t buf6[BUFFERSIZE6]={0};
|
||||
|
||||
|
||||
CG_BEFORE_SCHEDULER_FUNCTION
|
||||
uint32_t scheduler(int *error)
|
||||
{
|
||||
int cgStaticError=0;
|
||||
uint32_t nbSchedule=0;
|
||||
int32_t debugCounter=10;
|
||||
|
||||
CG_BEFORE_FIFO_INIT;
|
||||
/*
|
||||
Create FIFOs objects
|
||||
*/
|
||||
FIFO<int16_t,FIFOSIZE0,0,1> fifo0(buf1);
|
||||
FIFO<int16_t,FIFOSIZE1,0,1> fifo1(buf2);
|
||||
FIFO<int16_t,FIFOSIZE2,0,1> fifo2(buf3);
|
||||
FIFO<int16_t,FIFOSIZE3,0,1> fifo3(buf4);
|
||||
FIFO<int16_t,FIFOSIZE4,0,1> fifo4(buf5);
|
||||
FIFO<int16_t,FIFOSIZE5,0,1> fifo5(buf6);
|
||||
|
||||
CG_BEFORE_NODE_INIT;
|
||||
/*
|
||||
Create node objects
|
||||
*/
|
||||
Duplicate2<int16_t,1,int16_t,1,int16_t,1> dup0(fifo3,fifo4,fifo5);
|
||||
ProcessingOddEven<int16_t,1,int16_t,1,int16_t,1> proc(fifo0,fifo1,fifo2);
|
||||
SinkAsync<int16_t,1> sinka(fifo4);
|
||||
SinkAsync<int16_t,1> sinkb(fifo5);
|
||||
SourceEven<int16_t,1> sourceEven(fifo1);
|
||||
SourceOdd<int16_t,1> sourceOdd(fifo0);
|
||||
|
||||
/* Run several schedule iterations */
|
||||
CG_BEFORE_SCHEDULE;
|
||||
while((cgStaticError==0) && (debugCounter > 0))
|
||||
{
|
||||
/* Run a schedule iteration */
|
||||
CG_BEFORE_ITERATION;
|
||||
for(unsigned long id=0 ; id < 7; id++)
|
||||
{
|
||||
CG_BEFORE_NODE_EXECUTION;
|
||||
|
||||
cgStaticError = 0;
|
||||
switch(schedule[id])
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
|
||||
bool canRun=true;
|
||||
canRun &= !fifo2.willUnderflowWith(1);
|
||||
canRun &= !fifo3.willOverflowWith(1);
|
||||
|
||||
if (!canRun)
|
||||
{
|
||||
cgStaticError = CG_SKIP_EXECUTION_ID_CODE;
|
||||
}
|
||||
else
|
||||
{
|
||||
cgStaticError = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 1:
|
||||
{
|
||||
cgStaticError = dup0.prepareForRunning();
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
{
|
||||
cgStaticError = proc.prepareForRunning();
|
||||
}
|
||||
break;
|
||||
|
||||
case 3:
|
||||
{
|
||||
cgStaticError = sinka.prepareForRunning();
|
||||
}
|
||||
break;
|
||||
|
||||
case 4:
|
||||
{
|
||||
cgStaticError = sinkb.prepareForRunning();
|
||||
}
|
||||
break;
|
||||
|
||||
case 5:
|
||||
{
|
||||
cgStaticError = sourceEven.prepareForRunning();
|
||||
}
|
||||
break;
|
||||
|
||||
case 6:
|
||||
{
|
||||
cgStaticError = sourceOdd.prepareForRunning();
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (cgStaticError == CG_SKIP_EXECUTION_ID_CODE)
|
||||
continue;
|
||||
|
||||
CHECKERROR;
|
||||
|
||||
switch(schedule[id])
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
|
||||
{
|
||||
|
||||
int16_t* i0;
|
||||
int16_t* o1;
|
||||
i0=fifo2.getReadBuffer(1);
|
||||
o1=fifo3.getWriteBuffer(1);
|
||||
compute(i0,o1,1);
|
||||
cgStaticError = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 1:
|
||||
{
|
||||
cgStaticError = dup0.run();
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
{
|
||||
cgStaticError = proc.run();
|
||||
}
|
||||
break;
|
||||
|
||||
case 3:
|
||||
{
|
||||
cgStaticError = sinka.run();
|
||||
}
|
||||
break;
|
||||
|
||||
case 4:
|
||||
{
|
||||
cgStaticError = sinkb.run();
|
||||
}
|
||||
break;
|
||||
|
||||
case 5:
|
||||
{
|
||||
cgStaticError = sourceEven.run();
|
||||
}
|
||||
break;
|
||||
|
||||
case 6:
|
||||
{
|
||||
cgStaticError = sourceOdd.run();
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
CG_AFTER_NODE_EXECUTION;
|
||||
CHECKERROR;
|
||||
}
|
||||
debugCounter--;
|
||||
CG_AFTER_ITERATION;
|
||||
nbSchedule++;
|
||||
}
|
||||
|
||||
errorHandling:
|
||||
CG_AFTER_SCHEDULE;
|
||||
*error=cgStaticError;
|
||||
return(nbSchedule);
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
/*
|
||||
|
||||
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.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef _SCHEDULER_H_
|
||||
#define _SCHEDULER_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
|
||||
extern uint32_t scheduler(int *error);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@ -0,0 +1,132 @@
|
||||
from cmsisdsp.cg.scheduler import *
|
||||
|
||||
### Define new types of Nodes
|
||||
|
||||
|
||||
|
||||
class SinkAsync(GenericSink):
|
||||
def __init__(self,name,theType,inLength):
|
||||
GenericSink.__init__(self,name)
|
||||
self.addInput("i",theType,inLength)
|
||||
|
||||
@property
|
||||
def typeName(self):
|
||||
return "SinkAsync"
|
||||
|
||||
class SourceOdd(GenericSource):
|
||||
def __init__(self,name,theType,inLength):
|
||||
GenericSource.__init__(self,name)
|
||||
self.addOutput("o",theType,inLength)
|
||||
|
||||
@property
|
||||
def typeName(self):
|
||||
return "SourceOdd"
|
||||
|
||||
class SourceEven(GenericSource):
|
||||
def __init__(self,name,theType,inLength):
|
||||
GenericSource.__init__(self,name)
|
||||
self.addOutput("o",theType,inLength)
|
||||
|
||||
@property
|
||||
def typeName(self):
|
||||
return "SourceEven"
|
||||
|
||||
class ProcessingOddEven(GenericNode):
|
||||
def __init__(self,name,theType,inLength,outLength):
|
||||
GenericNode.__init__(self,name)
|
||||
self.addInput("ia",theType,inLength)
|
||||
self.addInput("ib",theType,inLength)
|
||||
self.addOutput("o",theType,outLength)
|
||||
|
||||
@property
|
||||
def typeName(self):
|
||||
return "ProcessingOddEven"
|
||||
|
||||
|
||||
|
||||
### Define nodes
|
||||
dataType=CType(SINT16)
|
||||
odd=SourceOdd("sourceOdd",dataType,1)
|
||||
even=SourceEven("sourceEven",dataType,1)
|
||||
|
||||
proc=ProcessingOddEven("proc",dataType,1,1)
|
||||
comp=Unary("compute",dataType,1)
|
||||
|
||||
sinka=SinkAsync("sinka",dataType,1)
|
||||
sinkb=SinkAsync("sinkb",dataType,1)
|
||||
|
||||
g = Graph()
|
||||
|
||||
# Option to customize the default class
|
||||
# to use for Duplicate and FIFO
|
||||
# FIFO class can also be changed in the connect
|
||||
# function to change the class for a specific
|
||||
# connection
|
||||
g.defaultFIFOClass = "FIFO"
|
||||
g.duplicateNodeClassName = "Duplicate"
|
||||
|
||||
g.connect(odd.o,proc.ia)
|
||||
g.connect(even.o,proc.ib)
|
||||
|
||||
g.connect(proc.o,comp.i)
|
||||
g.connect(comp.o,sinka.i)
|
||||
g.connect(comp.o,sinkb.i)
|
||||
|
||||
|
||||
print("Generate graphviz and code")
|
||||
|
||||
conf=Configuration()
|
||||
conf.debugLimit=10
|
||||
conf.cOptionalArgs=""
|
||||
|
||||
# It is disabled in asynchronous mode
|
||||
# since the schedule has no mor any reason to
|
||||
# be periodic and thus the FIFO content can
|
||||
# overlap several executions of the schedule
|
||||
conf.memoryOptimization=True
|
||||
|
||||
conf.codeArray = True
|
||||
conf.switchCase = True
|
||||
|
||||
# Asynchronous mode enable. It implies
|
||||
# switchCase and codeArray true
|
||||
conf.asynchronous = True
|
||||
|
||||
# Increase size of synchronous FIFOs by 100%
|
||||
# for the asynchronous case (so 2 samples
|
||||
# instead of 1 in this example)
|
||||
conf.FIFOIncrease = 100 # percent
|
||||
|
||||
|
||||
#conf.displayFIFOSizes=True
|
||||
# Prefix for global FIFO buffers
|
||||
#conf.prefix="sched1"
|
||||
|
||||
#conf.dumpSchedule = True
|
||||
sched = g.computeSchedule(config=conf)
|
||||
#print(sched.schedule)
|
||||
print("Schedule length = %d" % sched.scheduleLength)
|
||||
print("Memory usage %d bytes" % sched.memory)
|
||||
#
|
||||
|
||||
|
||||
#conf.postCustomCName = "post.h"
|
||||
#conf.CAPI = True
|
||||
#conf.prefix="global"
|
||||
#conf.dumpFIFO = True
|
||||
#conf.CMSISDSP = False
|
||||
#conf.codeArray = False
|
||||
#conf.switchCase = False
|
||||
|
||||
# For pure functions (like CMSIS-DSP) which are not
|
||||
# packaged in a C++ class, we have to decide of the
|
||||
# asynchronous policy. What must be done in case of
|
||||
# FIFO overflow or underflow.
|
||||
# By default, the execution is skipped.
|
||||
conf.asyncDefaultSkip = True
|
||||
|
||||
sched.ccode("./generated",conf)
|
||||
|
||||
with open("test.dot","w") as f:
|
||||
sched.graphviz(f)
|
||||
|
||||
@ -0,0 +1,11 @@
|
||||
#include <cstdio>
|
||||
#include <cstdint>
|
||||
#include "scheduler.h"
|
||||
|
||||
int main(int argc, char const *argv[])
|
||||
{
|
||||
int error;
|
||||
printf("Start\n");
|
||||
uint32_t nbSched=scheduler(&error);
|
||||
return 0;
|
||||
}
|
||||
@ -0,0 +1,104 @@
|
||||
|
||||
|
||||
|
||||
|
||||
digraph structs {
|
||||
node [shape=plaintext]
|
||||
rankdir=LR
|
||||
edge [arrowsize=0.5]
|
||||
fontname="times"
|
||||
|
||||
|
||||
compute1 [label=<
|
||||
<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4">
|
||||
<TR>
|
||||
<TD ALIGN="CENTER" PORT="i">compute<BR/>(Function)</TD>
|
||||
</TR>
|
||||
</TABLE>>];
|
||||
|
||||
dup0 [shape=point,label=dup0]
|
||||
|
||||
|
||||
proc [label=<
|
||||
<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4">
|
||||
<TR>
|
||||
<TD PORT="ia"><FONT POINT-SIZE="9.0">ia</FONT></TD>
|
||||
<TD ALIGN="CENTER" ROWSPAN="2">proc<BR/>(ProcessingOddEven)</TD>
|
||||
<TD PORT="o"><FONT POINT-SIZE="9.0">o</FONT></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD PORT="ib"><FONT POINT-SIZE="9.0">ib</FONT></TD>
|
||||
|
||||
|
||||
<TD></TD></TR>
|
||||
|
||||
</TABLE>>];
|
||||
|
||||
sinka [label=<
|
||||
<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4">
|
||||
<TR>
|
||||
<TD ALIGN="CENTER" PORT="i">sinka<BR/>(SinkAsync)</TD>
|
||||
</TR>
|
||||
</TABLE>>];
|
||||
|
||||
sinkb [label=<
|
||||
<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4">
|
||||
<TR>
|
||||
<TD ALIGN="CENTER" PORT="i">sinkb<BR/>(SinkAsync)</TD>
|
||||
</TR>
|
||||
</TABLE>>];
|
||||
|
||||
sourceEven [label=<
|
||||
<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4">
|
||||
<TR>
|
||||
<TD ALIGN="CENTER" PORT="i">sourceEven<BR/>(SourceEven)</TD>
|
||||
</TR>
|
||||
</TABLE>>];
|
||||
|
||||
sourceOdd [label=<
|
||||
<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4">
|
||||
<TR>
|
||||
<TD ALIGN="CENTER" PORT="i">sourceOdd<BR/>(SourceOdd)</TD>
|
||||
</TR>
|
||||
</TABLE>>];
|
||||
|
||||
|
||||
|
||||
sourceOdd:i -> proc:ia [label="s16(2)"
|
||||
,headlabel=<<TABLE BORDER="0" CELLPADDING="2"><TR><TD><FONT COLOR="blue" POINT-SIZE="12.0" >1</FONT>
|
||||
</TD></TR></TABLE>>
|
||||
,taillabel=<<TABLE BORDER="0" CELLPADDING="2"><TR><TD><FONT COLOR="blue" POINT-SIZE="12.0" >1</FONT>
|
||||
</TD></TR></TABLE>>]
|
||||
|
||||
sourceEven:i -> proc:ib [label="s16(2)"
|
||||
,headlabel=<<TABLE BORDER="0" CELLPADDING="2"><TR><TD><FONT COLOR="blue" POINT-SIZE="12.0" >1</FONT>
|
||||
</TD></TR></TABLE>>
|
||||
,taillabel=<<TABLE BORDER="0" CELLPADDING="2"><TR><TD><FONT COLOR="blue" POINT-SIZE="12.0" >1</FONT>
|
||||
</TD></TR></TABLE>>]
|
||||
|
||||
proc:o -> compute1:i [label="s16(2)"
|
||||
,headlabel=<<TABLE BORDER="0" CELLPADDING="2"><TR><TD><FONT COLOR="blue" POINT-SIZE="12.0" >1</FONT>
|
||||
</TD></TR></TABLE>>
|
||||
,taillabel=<<TABLE BORDER="0" CELLPADDING="2"><TR><TD><FONT COLOR="blue" POINT-SIZE="12.0" >1</FONT>
|
||||
</TD></TR></TABLE>>]
|
||||
|
||||
compute1:i ->
|
||||
dup0 [label="s16(2)"
|
||||
|
||||
,taillabel=<<TABLE BORDER="0" CELLPADDING="2"><TR><TD><FONT COLOR="blue" POINT-SIZE="12.0" >1</FONT>
|
||||
</TD></TR></TABLE>>]
|
||||
|
||||
|
||||
dup0 -> sinka:i [label="s16(2)"
|
||||
,headlabel=<<TABLE BORDER="0" CELLPADDING="2"><TR><TD><FONT COLOR="blue" POINT-SIZE="12.0" >1</FONT>
|
||||
</TD></TR></TABLE>>
|
||||
]
|
||||
|
||||
|
||||
dup0 -> sinkb:i [label="s16(2)"
|
||||
,headlabel=<<TABLE BORDER="0" CELLPADDING="2"><TR><TD><FONT COLOR="blue" POINT-SIZE="12.0" >1</FONT>
|
||||
</TD></TR></TABLE>>
|
||||
]
|
||||
|
||||
|
||||
}
|
||||
Binary file not shown.
@ -0,0 +1,10 @@
|
||||
cmake_minimum_required (VERSION 3.14)
|
||||
include(CMakePrintHelpers)
|
||||
|
||||
project(Example4)
|
||||
|
||||
|
||||
add_custom_target(example4 ALL DEPENDS sched.py)
|
||||
|
||||
sdfpython(example4)
|
||||
|
||||
@ -0,0 +1,10 @@
|
||||
cmake_minimum_required (VERSION 3.14)
|
||||
include(CMakePrintHelpers)
|
||||
|
||||
project(Example5)
|
||||
|
||||
|
||||
add_custom_target(example5 ALL DEPENDS sched.py)
|
||||
|
||||
sdfpython(example5)
|
||||
|
||||
Binary file not shown.
@ -0,0 +1,10 @@
|
||||
cmake_minimum_required (VERSION 3.14)
|
||||
include(CMakePrintHelpers)
|
||||
|
||||
project(Example7)
|
||||
|
||||
|
||||
add_custom_target(example7 ALL DEPENDS sched.py)
|
||||
|
||||
sdfpython(example7)
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
from multiprocessing import Process,Semaphore
|
||||
import multiprocessing as mp
|
||||
import socket
|
||||
import cmsisdsp.cg.static.nodes.host.message as msg
|
||||
import cmsisdsp.cg.nodes.host.message as msg
|
||||
|
||||
HOST = '127.0.0.1' # The remote host
|
||||
PORT = 50007
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue