Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate C code for a topology #14

Open
6 tasks
hidmic opened this issue Sep 19, 2021 · 0 comments
Open
6 tasks

Generate C code for a topology #14

hidmic opened this issue Sep 19, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@hidmic
Copy link
Owner

hidmic commented Sep 19, 2021

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.
@hidmic hidmic added the enhancement New feature or request label Sep 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant