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

Improve component parameter code gen #304

Open
tiffany1618 opened this issue Aug 2, 2023 · 0 comments
Open

Improve component parameter code gen #304

tiffany1618 opened this issue Aug 2, 2023 · 0 comments
Labels
code generation Issues related to code generation

Comments

@tiffany1618
Copy link
Collaborator

Currently, a separate function is generated for each parameter for each parameter operation (get, set, and save). To reduce the size of the generated code for component parameters, we could consider having a single function for each operation that takes in an additional opcode parameter.

For example, instead of generating one function per parameter for the set operation like this:

https://github.com/fprime-community/fpp/blob/8d1b620db6b978a75b2d3dc5f5ff8a465122493a/compiler/tools/fpp-to-cpp/test/component/base/ActiveParamsComponentAc.ref.hpp#L1305-L1345

we could generate a single function:

void paramSet(FwOpcodeType opcode, Fw::SerializeBufferBase& val)
{
  // Common code

  switch (opcode) {
     case PARAMID_PARAMU32: {...}
     ...
  }

  // Common code
}
@bocchino bocchino added the code generation Issues related to code generation label Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code generation Issues related to code generation
Projects
None yet
Development

No branches or pull requests

2 participants