Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/komaljai/p4c into tc_kfunc_…
Browse files Browse the repository at this point in the history
…v13_changes
  • Loading branch information
komaljai committed Apr 5, 2024
2 parents 0f93c2b + 3e3726a commit c7d101f
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 10 deletions.
52 changes: 51 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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/).

8 changes: 0 additions & 8 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion tools/driver/p4c_src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down

0 comments on commit c7d101f

Please sign in to comment.