Main /
CodeGenerationResources
Edward's 10/25/14 emailDocumentation is pretty sparse. I've cc'd Christopher in case he has additional pointers. Here's what I see currently in the Ptolemy tree (the current development version from SVN): You can access a bunch of demo by going to the "Complete list of demos" (Help->About->Tour of Ptolemy II-> Complete List of Demos)and looking in the code generation section. Possibly more useful than demos are tests. Anything in the $PTII/ptolemy/cg/ subtree matching the pattern */test/auto/*.xml is a test. Demos: I would start here... Just try some out to get a feel. Look at the generated code. Java code generation:
C code generation:
C code generation for Arduino:
Mixed code generation:
I'm not seeing any FSM code generation. It might be that FSM code generation never got ported from the older "codegen" code generation tree. The general pattern of the "cg" code generator that every component in a model (an actor, a director) needs to have an "adapter" in order to be code generated. Adapters are looked for within the subtree $PTII/ptolemy/cg/adapter. A particular model will specify a more specific subtree in which to look for adapters. For example, this model: $PTII/ptolemy/cg/adapter/generic/program/procedural/c/arduino/adapters/ptolemy/actor/lib/gui/test/auto/Display.xml has a CCodeGenerator attribute with the generator package specified to be generic.program.procedural.c. NotesCode generation for Ptides failsThe issue is that:
fails: ./Network1 commons/_CompositeActor.c:101: CompositeActorFire():(1) director did not transfer inputs?. commons/_CompositeActor.c:101: CompositeActorFire():(2) director did not transfer inputs?. commons/_CompositeActor.c:101: CompositeActorFire():(3) director did not transfer inputs?. commons/_CompositeActor.c:101: CompositeActorFire():(4) director did not transfer inputs?. Test Network1_Test__0 fails in iteration 0. Value was: -5. Should have been between: -4.00000000100000008274037099909 and -3.99999999899999991725962900091 make: *** [run] Error 255 |