diff --git a/README.md b/README.md index c6278d6633..e8ea66f365 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,31 @@ [![Validation](https://github.com/p4lang/p4c/actions/workflows/ci-validation-nightly.yml/badge.svg)](https://github.com/p4lang/p4c/actions/workflows/ci-validation-nightly.yml) [![Docker Container](https://github.com/p4lang/p4c/actions/workflows/ci-container-image.yml/badge.svg)](https://github.com/p4lang/p4c/actions/workflows/ci-container-image.yml) -# p4c + +p4c +================= + +* [Getting started](#getting-started) + * [Installing packaged versions of p4c](#installing-packaged-versions-of-p4c) + * [Installing p4c from source](#installing-p4c-from-source) +* [Dependencies](#dependencies) + * [Ubuntu dependencies](#ubuntu-dependencies) + * [Fedora dependencies](#fedora-dependencies) + * [macOS dependencies](#macos-dependencies) + * [Garbage collector](#garbage-collector) + * [Crash dumps](#crash-dumps) +* [Development tools](#development-tools) + * [Git setup](#git-setup) +* [Docker](#docker) +* [Bazel](#bazel) +* [Build system](#build-system) + * [Defining new CMake targets](#defining-new-cmake-targets) +* [Known issues](#known-issues) + * [Frontend](#frontend) + * [Backends](#backends) +* [How to Contribute](#how-to-contribute) +* [P4 Compiler Onboarding](#p4-compiler-onboarding) +* [Contact](#contact) p4c is a reference compiler for the P4 programming language. It supports both P4-14 and P4-16; you can find more information about P4 @@ -625,3 +649,29 @@ access them from the IR * Tables with multiple apply calls See also [unsupported P4_16 language features](backends/bmv2/README.md#unsupported-p4_16-language-features). + +# How to Contribute + +We welcome and appreciate new contributions. Please take a moment to review our [Contribution Guidelines](CONTRIBUTING.md) to get started. + +# P4 Compiler Onboarding +Educational material on P4: + +- General hands-on [tutorials](https://github.com/p4lang/tutorials). +- [Technical documentation on P4-related topics](https://github.com/jafingerhut/p4-guide?tab=readme-ov-file#introduction). +- Motivating P4: [IEEE ICC 2018 // Keynote: Nick McKeown, Programmable Forwarding Planes Are Here To Stay](https://www.youtube.com/watch?v=8ie0FcsN07U) +- Introducing P4-16 in detail: + - Part 1: [Introduction to P4_16. Part 1](https://www.youtube.com/watch?v=GslseT4hY1w) + - Part 2: [Introduction to P4_16. Part 2](https://www.youtube.com/watch?v=yqxpypXIOtQ) +- Material on the official P4 compiler: + - [Understanding the Open-Source P4-16 Compiler - February 15, 2022 - Mihai Budiu](https://www.youtube.com/watch?v=Rx5AQ0IF6eU) + - [Understanding P4-16 Open-Source Compiler, Part 2 - March 1, 2022 - Mihai Budiu](https://www.youtube.com/watch?v=YnPHPaPSmpU) + - [Compiler Design - Implementation Architecture](https://github.com/p4lang/p4c/blob/main/docs/compiler-design.pdf). +- Introduction to P4Runtime: [Next-Gen SDN Tutorial - Session 1: P4 and P4Runtime Basics](https://www.youtube.com/watch?v=KRx92qSLgo4) + +# Contact +We appreciate your contributions and look forward to working with you to improve the P4 Compiler Project (p4c)! +- For further assistance or questions regarding contributions, reach out to us in our [community chat](https://p4-lang.slack.com/). [Joining link](https://join.slack.com/t/p4-lang/shared_invite/zt-a9pe96br-Th73ueaBAwJw1ZbD_z1Rpg) . +- For general P4-related questions, use the [P4 forum](https://forum.p4.org/). +- For other communication channels click [here](https://p4.org/join/). + diff --git a/docs/README.md b/docs/README.md index d18bc7dec2..fc1c8f1128 100644 --- a/docs/README.md +++ b/docs/README.md @@ -86,14 +86,6 @@ p4c * Check out the [IntelliJ P4 plugin](https://github.com/TakeshiTseng/IntelliJ-P4-Plugin) -# How to contribute - -* do write unit test code -* code has to be reviewed before it is merged -* make sure all tests pass when you send a pull request -* make sure `make cpplint` produces no errors (`make check` will also run this) -* write documentation - # Writing documentation Documenting the workings of the compiler is a never-ending (many times diff --git a/tools/driver/p4c_src/main.py b/tools/driver/p4c_src/main.py index a4e0f8fe0d..633bef1dd7 100644 --- a/tools/driver/p4c_src/main.py +++ b/tools/driver/p4c_src/main.py @@ -631,7 +631,8 @@ def main(): string_to_pass_as___source_file = opts.json_source if P4_input_or_inputs_specified: - assert 1 == len(opts.P4_source_files) + if checkInput: + assert 1 == len(opts.P4_source_files) assert not JSON_input_specified string_to_pass_as___source_file = opts.P4_source_files[0]