Skip to content

Generate C code for a topology #14

@hidmic

Description

@hidmic

Description

To actually use and validate an optimized LTI system, it has to be translated into code that can be assembled or compiled for a given processor architecture. C is by far the most common language for that purpose. Thus, putting all together, ltitop must support C code generation for a given realization or diagram.

Definition of Done

In the following, it is assumed that #9 was implemented.

  • Write a function to extract a Python AST for an entire diagram.
    • Collate block ASTs as function definitions.
    • Drop repeated function definitions.
    • Capture block connections via function calls.
  • Write a function to transform a Python AST into a pycparse C-AST.
  • Use pycparse.c_generator.CGenerator to generate C code.
    • Toss in all necessary C preprocessor directives for compilation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions