-
Notifications
You must be signed in to change notification settings - Fork 442
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Adarsh <Adarshbunny293@gmail.com>
- Loading branch information
1 parent
7581570
commit b7c6aec
Showing
2 changed files
with
39 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,39 @@ | ||
# P4test Backend | ||
|
||
This is a "fake" backend, whose sole purpose is to test the P4-16 front-end. | ||
The P4test Backend is a tool designed for testing and debugging P4 | ||
programs. It supports both the P4_14 and P4_16 standards and can | ||
translate P4 code from one version to another. Additionally, it | ||
provides a syntax checker for P4 code, enabling the verification of | ||
the correctness of your P4 programs. It supports both the P4_14 and | ||
P4_16 standards and can translate P4 code from one version to another. | ||
|
||
## Auto-translate P4_14 source to P4_16 source: | ||
You can automatically translate a P4_14 program to a P4_16 program | ||
using the following command: | ||
```bash | ||
p4test --std p4-14 my-p4-14-prog.p4 --pp auto-translated-p4-16-prog.p4 | ||
``` | ||
|
||
This command takes the P4_14 program (my-p4-14-prog.p4) and generates | ||
a corresponding P4_16 program (auto-translated-p4-16-prog.p4). | ||
|
||
|
||
## Check syntax of P4_16 or P4_14 source code | ||
The P4test Backend can check the syntax of P4 programs without being | ||
restricted by any specific compiler back end. This is useful for | ||
ensuring that your P4 code is syntactically correct. | ||
|
||
For P4_16 code: | ||
```bash | ||
p4test my-p4-16-prog.p4 | ||
``` | ||
|
||
For P4_14 code: | ||
```bash | ||
p4test --std p4-14 my-p4-14-prog.p4 | ||
``` | ||
|
||
These commands will output error and/or warning messages if there | ||
are any issues with the syntax of your P4 code, enabling you to | ||
verify the correctness of your P4 programs, due to that it is | ||
possible to verify the correctness of your P4 programs. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters