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] Add the Tofino testgen target. #5038

Merged
merged 4 commits into from
Feb 7, 2025
Merged

Conversation

fruffy
Copy link
Collaborator

@fruffy fruffy commented Nov 30, 2024

This adds the Tofino extension to P4Testgen. The only change necessary to the P4Testgen core was to skip extern resolution in method calls.

This extension can already generate tests but these test are not validated on the model because we do not have the infrastructure for it yet. Currently, we only check P4Testgen's Tofino extension by generating tests, then compiling the Tofino program.

Adding support for full P4Testgen runs on Tofino is future work.

@fruffy fruffy added p4tools Topics related to the P4Tools back end tofino Topics related to the Tofino switch and back end. labels Nov 30, 2024
@fruffy fruffy force-pushed the fruffy/tools_tofino branch 6 times, most recently from 37d6316 to 602ef1e Compare December 4, 2024 13:14
@fruffy fruffy force-pushed the fruffy/tools_tofino branch from 427b17d to 3a126c4 Compare December 5, 2024 16:58
@fruffy fruffy force-pushed the fruffy/tools_tofino branch from 3a126c4 to f62132b Compare February 4, 2025 23:24
@fruffy fruffy marked this pull request as ready for review February 4, 2025 23:46
@fruffy fruffy requested review from vlstill and pkotikal February 4, 2025 23:46
@fruffy fruffy force-pushed the fruffy/tools_tofino branch from f62132b to 4737cae Compare February 5, 2025 01:30
* and limitations under the License.
*
*
* SPDX-License-Identifier: Apache-2.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Should we use the abridged license?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can simplify this, @jafingerhut what is the format that you prefer here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SPDX-License-Identifier line looks perfect as is, as does the Copyright line. Those two are the minimum I would hope we have in every source file, since the top level LICENSE file should have the full text of the Apache2.0 license.

If we want any more than that, then the next smaller thing I am aware of is what the Apache 2.0 license recommends be in a source file, copied below from near the end of this page https://spdx.org/licenses/Apache-2.0.html which is what appears to be in the file right now, so I do not know which abbreviated license @pkotikal is referring to.

Copyright [yyyy] [name of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pkotikal
Copy link
Contributor

pkotikal commented Feb 5, 2025

This adds the Tofino extension to P4Testgen. The only change necessary to the P4Testgen core was to skip extern resolution in method calls.

This extension can already generate tests but these test are not validated on the model because we do not have the infrastructure for it yet. Currently, we only check P4Testgen's Tofino extension by generating tests, then compiling the Tofino program.

Adding support for full P4Testgen runs on Tofino is future work.

Can we add the tofino model binary to the docker image?

@fruffy
Copy link
Collaborator Author

fruffy commented Feb 5, 2025

This adds the Tofino extension to P4Testgen. The only change necessary to the P4Testgen core was to skip extern resolution in method calls.
This extension can already generate tests but these test are not validated on the model because we do not have the infrastructure for it yet. Currently, we only check P4Testgen's Tofino extension by generating tests, then compiling the Tofino program.
Adding support for full P4Testgen runs on Tofino is future work.

Can we add the tofino model binary to the docker image?

Afaik we do not have a docker image for the studio yet. This could be very useful for testing P4C. Or we try to create a package from the open-p4studio that we can use.

@fruffy fruffy force-pushed the fruffy/tools_tofino branch from c1dc8b6 to 2492940 Compare February 7, 2025 00:19
@fruffy fruffy added this pull request to the merge queue Feb 7, 2025
Merged via the queue into main with commit 3796b5d Feb 7, 2025
19 checks passed
@fruffy fruffy deleted the fruffy/tools_tofino branch February 7, 2025 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p4tools Topics related to the P4Tools back end tofino Topics related to the Tofino switch and back end.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants