Adding P4 cheat cheet and its latex source files. (#201)

This commit is contained in:
sibanez12
2018-10-05 12:52:35 -07:00
committed by Nate Foster
parent e3ef4d14db
commit 7ff3af57fb
14 changed files with 476 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
// Local metadata declaration, assignment
bit<16> tmp1; bit<16> tmp2;
tmp1 = hdr.ethernet.type;
// bit slicing, concatenation
tmp2 = tmp1[7:0] ++ tmp1[15:8];
// addition, subtraction, casts
tmp2 = tmp1 + tmp1 - (bit<16>)tmp1[7:0];
// bitwise operators
tmp2 = (~tmp1 & tmp1) | (tmp1 ^ tmp1);
tmp2 = tmp1 << 3;