Skip to content

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

Open
@fruffy

Description

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.

Metadata

Assignees

Labels

enhancementThis topic discusses an improvement to existing compiler code.p4toolsTopics related to the P4Tools back end

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions