Calculator Example Design - 2022.2 English - UG1308

Vitis Networking P4 User Guide (UG1308)

Document ID
UG1308
Version
2022.2 English
Revision

The Calculator example implements a simple calculator based on a custom protocol carried over Ethernet. The device uses the operation ID to perform an exact-match (with direct matching) and execute the requested operation. Packets with an unknown operation ID are dropped. The packet containing the result of the operation is sent back out of the same port it came in on, while swapping the Ethernet source and destination addresses. The supported operations are: arithmetic addition, subtraction and multiplication, as well as bit-wise AND, OR and XOR.

In the Calculator test, nine packets (contained in traffic_in.user) are input to the Vitis Networking P4 Parser. The Calculator.p4 file describes one direct table.