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

[P4Testgen] Improve library support for P4Testgen and the P4Tools framework. #4294

Open
1 of 4 tasks
fruffy opened this issue Dec 16, 2023 · 0 comments
Open
1 of 4 tasks
Assignees
Labels
enhancement This topic discusses an improvement to existing compiler code. p4tools Topics related to the P4Tools back end

Comments

@fruffy
Copy link
Collaborator

fruffy commented Dec 16, 2023

It should be possible to link P4Testgen or P4Tools in general as a library. Currently, we can only call it as a binary. For that to be possible several things need to happen first.

  • Move ProgramInfo into common. ProgramInfo will become a first-class construct of the framework.
  • Remove the Singleton patterns from Target and AbstractP4cToolOptions. No construct in the framework should be a static global singleton. Instead they will be members of ProgramInfo ([P4Testgen] Reduce the use of static objects in P4Testgen #4286).
  • Split the options into compiler options and ToolsOptions. These options are currently conflated, which makes it hard to make clean library calls to the tool.
  • Finally, build the P4Testgen library, which takes in CompilerOptions and P4TestgenOptions as arguments and generates tests based on these two classes.
@fruffy fruffy added enhancement This topic discusses an improvement to existing compiler code. p4tools Topics related to the P4Tools back end labels Dec 16, 2023
@fruffy fruffy self-assigned this Dec 16, 2023
@fruffy fruffy changed the title [P4Testgen] Add library support for P4Testgen and the P4Tools framework. [P4Testgen] Improve library support for P4Testgen and the P4Tools framework. Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This topic discusses an improvement to existing compiler code. p4tools Topics related to the P4Tools back end
Projects
None yet
Development

No branches or pull requests

1 participant