Skip to content

Commit

Permalink
Reference files.
Browse files Browse the repository at this point in the history
Signed-off-by: fruffy <[email protected]>
  • Loading branch information
fruffy committed Jan 7, 2025
1 parent 1376d86 commit 1a3989f
Show file tree
Hide file tree
Showing 17 changed files with 361 additions and 592 deletions.
33 changes: 9 additions & 24 deletions testdata/p4_16_samples_outputs/invalid-hdr-warnings5-midend.p4
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ header Header2 {
bit<16> data;
}

header_union Union {
Header1 h1;
Header2 h2;
Header1 h3;
}

struct H {
Header1 h1;
Header1 u1_h1;
Expand Down Expand Up @@ -77,9 +83,11 @@ control IngressI(inout H hdr, inout M meta, inout standard_metadata_t smeta) {
@name("u1_0_h1") Header1 u1_0_h1_0;
@name("u1_0_h2") Header2 u1_0_h2_0;
@name("u1_0_h3") Header1 u1_0_h3_0;
@name("IngressI.u1") Union u1;
@name("u2_0_h1") Header1 u2_0_h1_0;
@name("u2_0_h2") Header2 u2_0_h2_0;
@name("u2_0_h3") Header1 u2_0_h3_0;
@name("IngressI.u2") Union u2;
@hidden @name("invalidhdrwarnings5l58") action invalidhdrwarnings5l58_0() {
u1_0_h1_0.setInvalid();
u1_0_h2_0.setInvalid();
Expand All @@ -97,30 +105,7 @@ control IngressI(inout H hdr, inout M meta, inout standard_metadata_t smeta) {
u1_0_h2_0.setValid();
u1_0_h1_0.setInvalid();
u1_0_h3_0.setInvalid();
if (u1_0_h1_0.isValid()) {
u2_0_h1_0.setValid();
u2_0_h1_0 = u1_0_h1_0;
u2_0_h2_0.setInvalid();
u2_0_h3_0.setInvalid();
} else {
u2_0_h1_0.setInvalid();
}
if (u1_0_h2_0.isValid()) {
u2_0_h2_0.setValid();
u2_0_h2_0 = u1_0_h2_0;
u2_0_h1_0.setInvalid();
u2_0_h3_0.setInvalid();
} else {
u2_0_h2_0.setInvalid();
}
if (u1_0_h3_0.isValid()) {
u2_0_h3_0.setValid();
u2_0_h3_0 = u1_0_h3_0;
u2_0_h1_0.setInvalid();
u2_0_h2_0.setInvalid();
} else {
u2_0_h3_0.setInvalid();
}
u2 = u1;
u2_0_h2_0.setValid();
u2_0_h2_0.data = 16w1;
u2_0_h1_0.setInvalid();
Expand Down
25 changes: 1 addition & 24 deletions testdata/p4_16_samples_outputs/invalid-hdr-warnings6-midend.p4
Original file line number Diff line number Diff line change
Expand Up @@ -105,30 +105,7 @@ control IngressI(inout H hdr, inout M meta, inout standard_metadata_t smeta) {
u_1[0].h2.setValid();
u_1[0].h1.setInvalid();
u_1[0].h3.setInvalid();
if (u_1[1w0].h1.isValid()) {
u_1[1].h1.setValid();
u_1[1].h1 = u_1[1w0].h1;
u_1[1].h2.setInvalid();
u_1[1].h3.setInvalid();
} else {
u_1[1].h1.setInvalid();
}
if (u_1[1w0].h2.isValid()) {
u_1[1].h2.setValid();
u_1[1].h2 = u_1[1w0].h2;
u_1[1].h1.setInvalid();
u_1[1].h3.setInvalid();
} else {
u_1[1].h2.setInvalid();
}
if (u_1[1w0].h3.isValid()) {
u_1[1].h3.setValid();
u_1[1].h3 = u_1[1w0].h3;
u_1[1].h1.setInvalid();
u_1[1].h2.setInvalid();
} else {
u_1[1].h3.setInvalid();
}
u_1[1] = u_1[1w0];
u_1[1].h2.setValid();
u_1[1].h2.data = 16w1;
u_1[1].h1.setInvalid();
Expand Down
214 changes: 18 additions & 196 deletions testdata/p4_16_samples_outputs/invalid-hdr-warnings7-midend.p4
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,23 @@ package top(ct _ct);
control c(inout bit<32> x) {
H1 u_0_h1;
H2 u_0_h2;
@name("c.u") U u_0;
@name("c.hs") H1[2] hs_0;
@name("c.us") U[2] us_0;
H1 u1_0_h1;
H2 u1_0_h2;
@name("c.u1") U u1_0;
@name("c.hs1") H1[2] hs1_0;
@name("c.us1") U[2] us1_0;
H1 u1_1_h1;
H2 u1_1_h2;
@name("c.u1") U u1_1;
@name("c.hs1") H1[2] hs1_1;
@name("c.us1") U[2] us1_1;
@name("c.us1") U[2] us1_2;
H1 u1_3_h1;
H2 u1_3_h2;
@name("c.u1") U u1_3;
@name("c.hs1") H1[2] hs1_3;
@name("c.us1") U[2] us1_3;
@name("c.initialize") action initialize() {
Expand Down Expand Up @@ -56,96 +60,18 @@ control c(inout bit<32> x) {
us1_0[0].h2.setInvalid();
us1_0[0].h2.setValid();
us1_0[0].h1.setInvalid();
if (u1_0_h1.isValid()) {
u_0_h1.setValid();
u_0_h1 = u1_0_h1;
u_0_h2.setInvalid();
} else {
u_0_h1.setInvalid();
}
if (u1_0_h2.isValid()) {
u_0_h2.setValid();
u_0_h2 = u1_0_h2;
u_0_h1.setInvalid();
} else {
u_0_h2.setInvalid();
}
u_0 = u1_0;
hs_0[0] = hs1_0[0];
hs_0[1] = hs1_0[1];
if (us1_0[0].h1.isValid()) {
us_0[0].h1.setValid();
us_0[0].h1 = us1_0[0].h1;
us_0[0].h2.setInvalid();
} else {
us_0[0].h1.setInvalid();
}
if (us1_0[0].h2.isValid()) {
us_0[0].h2.setValid();
us_0[0].h2 = us1_0[0].h2;
us_0[0].h1.setInvalid();
} else {
us_0[0].h2.setInvalid();
}
if (us1_0[1].h1.isValid()) {
us_0[1].h1.setValid();
us_0[1].h1 = us1_0[1].h1;
us_0[1].h2.setInvalid();
} else {
us_0[1].h1.setInvalid();
}
if (us1_0[1].h2.isValid()) {
us_0[1].h2.setValid();
us_0[1].h2 = us1_0[1].h2;
us_0[1].h1.setInvalid();
} else {
us_0[1].h2.setInvalid();
}
us_0[0] = us1_0[0];
us_0[1] = us1_0[1];
}
@name("c.inout_action1") action inout_action1() {
if (u_0_h1.isValid()) {
u1_1_h1.setValid();
u1_1_h1 = u_0_h1;
u1_1_h2.setInvalid();
} else {
u1_1_h1.setInvalid();
}
if (u_0_h2.isValid()) {
u1_1_h2.setValid();
u1_1_h2 = u_0_h2;
u1_1_h1.setInvalid();
} else {
u1_1_h2.setInvalid();
}
u1_1 = u_0;
hs1_1[0] = hs_0[0];
hs1_1[1] = hs_0[1];
if (us_0[0].h1.isValid()) {
us1_1[0].h1.setValid();
us1_1[0].h1 = us_0[0].h1;
us1_1[0].h2.setInvalid();
} else {
us1_1[0].h1.setInvalid();
}
if (us_0[0].h2.isValid()) {
us1_1[0].h2.setValid();
us1_1[0].h2 = us_0[0].h2;
us1_1[0].h1.setInvalid();
} else {
us1_1[0].h2.setInvalid();
}
if (us_0[1].h1.isValid()) {
us1_1[1].h1.setValid();
us1_1[1].h1 = us_0[1].h1;
us1_1[1].h2.setInvalid();
} else {
us1_1[1].h1.setInvalid();
}
if (us_0[1].h2.isValid()) {
us1_1[1].h2.setValid();
us1_1[1].h2 = us_0[1].h2;
us1_1[1].h1.setInvalid();
} else {
us1_1[1].h2.setInvalid();
}
us1_1[0] = us_0[0];
us1_1[1] = us_0[1];
u1_1_h1.setValid();
u1_1_h1.a = 32w1;
u1_1_h2.setInvalid();
Expand All @@ -165,129 +91,25 @@ control c(inout bit<32> x) {
u1_1_h2.setInvalid();
us1_1[0].h1.setValid();
us1_1[0].h2.setInvalid();
if (u1_1_h1.isValid()) {
u_0_h1.setValid();
u_0_h1 = u1_1_h1;
u_0_h2.setInvalid();
} else {
u_0_h1.setInvalid();
}
if (u1_1_h2.isValid()) {
u_0_h2.setValid();
u_0_h2 = u1_1_h2;
u_0_h1.setInvalid();
} else {
u_0_h2.setInvalid();
}
u_0 = u1_1;
hs_0[0] = hs1_1[0];
hs_0[1] = hs1_1[1];
if (us1_1[0].h1.isValid()) {
us_0[0].h1.setValid();
us_0[0].h1 = us1_1[0].h1;
us_0[0].h2.setInvalid();
} else {
us_0[0].h1.setInvalid();
}
if (us1_1[0].h2.isValid()) {
us_0[0].h2.setValid();
us_0[0].h2 = us1_1[0].h2;
us_0[0].h1.setInvalid();
} else {
us_0[0].h2.setInvalid();
}
us_0[0] = us1_1[0];
}
@name("c.inout_action2") action inout_action2() {
if (us_0[0].h1.isValid()) {
us1_2[0].h1.setValid();
us1_2[0].h1 = us_0[0].h1;
us1_2[0].h2.setInvalid();
} else {
us1_2[0].h1.setInvalid();
}
if (us_0[0].h2.isValid()) {
us1_2[0].h2.setValid();
us1_2[0].h2 = us_0[0].h2;
us1_2[0].h1.setInvalid();
} else {
us1_2[0].h2.setInvalid();
}
if (us_0[1].h1.isValid()) {
us1_2[1].h1.setValid();
us1_2[1].h1 = us_0[1].h1;
us1_2[1].h2.setInvalid();
} else {
us1_2[1].h1.setInvalid();
}
if (us_0[1].h2.isValid()) {
us1_2[1].h2.setValid();
us1_2[1].h2 = us_0[1].h2;
us1_2[1].h1.setInvalid();
} else {
us1_2[1].h2.setInvalid();
}
us1_2[0] = us_0[0];
us1_2[1] = us_0[1];
us1_2[1w1].h1.setInvalid();
us1_2[1w1].h2.setValid();
us1_2[1w1].h1.setInvalid();
if (us1_2[1].h1.isValid()) {
us_0[1].h1.setValid();
us_0[1].h1 = us1_2[1].h1;
us_0[1].h2.setInvalid();
} else {
us_0[1].h1.setInvalid();
}
if (us1_2[1].h2.isValid()) {
us_0[1].h2.setValid();
us_0[1].h2 = us1_2[1].h2;
us_0[1].h1.setInvalid();
} else {
us_0[1].h2.setInvalid();
}
us_0[1] = us1_2[1];
}
@name("c.xor") action xor() {
if (u_0_h1.isValid()) {
u1_3_h1.setValid();
u1_3_h1 = u_0_h1;
u1_3_h2.setInvalid();
} else {
u1_3_h1.setInvalid();
}
if (u_0_h2.isValid()) {
u1_3_h2.setValid();
u1_3_h2 = u_0_h2;
u1_3_h1.setInvalid();
} else {
u1_3_h2.setInvalid();
}
u1_3 = u_0;
hs1_3[0] = hs_0[0];
hs1_3[1] = hs_0[1];
if (us_0[0].h1.isValid()) {
us1_3[0].h1.setValid();
us1_3[0].h1 = us_0[0].h1;
us1_3[0].h2.setInvalid();
} else {
us1_3[0].h1.setInvalid();
}
if (us_0[0].h2.isValid()) {
us1_3[0].h2.setValid();
us1_3[0].h2 = us_0[0].h2;
us1_3[0].h1.setInvalid();
} else {
us1_3[0].h2.setInvalid();
}
if (us_0[1].h1.isValid()) {
us1_3[1].h1.setValid();
us1_3[1].h1 = us_0[1].h1;
us1_3[1].h2.setInvalid();
} else {
us1_3[1].h1.setInvalid();
}
if (us_0[1].h2.isValid()) {
us1_3[1].h2.setValid();
us1_3[1].h2 = us_0[1].h2;
us1_3[1].h1.setInvalid();
} else {
us1_3[1].h2.setInvalid();
}
us1_3[0] = us_0[0];
us1_3[1] = us_0[1];
x = u1_3_h1.a ^ u1_3_h2.a ^ hs1_3[0].a ^ hs1_3[1].a ^ us1_3[0].h1.a ^ us1_3[0].h2.a ^ us1_3[1].h1.a ^ us1_3[1].h2.a;
}
@hidden action invalidhdrwarnings7l13() {
Expand Down
Loading

0 comments on commit 1a3989f

Please sign in to comment.