forked from p4lang/p4c
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
mbudiu-vmw
committed
Feb 2, 2017
1 parent
727910a
commit 772bc78
Showing
11 changed files
with
406 additions
and
1 deletion.
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
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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
Copyright 2017 VMware, Inc. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
#include <core.p4> | ||
#include <v1model.p4> | ||
|
||
typedef standard_metadata_t std_meta_t; | ||
|
||
struct some_meta_t { bool flag; } | ||
|
||
struct H { } | ||
|
||
struct M { some_meta_t some_meta; } | ||
|
||
control DeparserI(packet_out packet, in H hdr) { | ||
apply { } | ||
} | ||
|
||
parser ParserI(packet_in pk, out H hdr, inout M meta, inout std_meta_t std_meta) { | ||
state start { transition accept; } | ||
} | ||
|
||
control VerifyChecksumI(in H hdr, inout M meta) { | ||
apply { } | ||
} | ||
|
||
control ComputeChecksumI(inout H hdr, inout M meta) { | ||
apply { } | ||
} | ||
|
||
control IngressI(inout H hdr, inout M meta, inout std_meta_t std_meta) { | ||
apply { | ||
meta.some_meta.flag = true; | ||
} | ||
} | ||
|
||
control EgressI(inout H hdr, inout M meta, inout std_meta_t std_meta) { | ||
apply { } | ||
} | ||
|
||
V1Switch(ParserI(), VerifyChecksumI(), IngressI(), EgressI(), ComputeChecksumI(), DeparserI()) main; |
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
Copyright 2017 VMware, Inc. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
#include <core.p4> | ||
#include <v1model.p4> | ||
|
||
typedef standard_metadata_t std_meta_t; | ||
|
||
struct H { } | ||
|
||
struct M { bool flag; } | ||
|
||
control DeparserI(packet_out packet, in H hdr) { | ||
apply { } | ||
} | ||
|
||
parser ParserI(packet_in pk, out H hdr, inout M meta, inout std_meta_t std_meta) { | ||
state start { transition accept; } | ||
} | ||
|
||
control VerifyChecksumI(in H hdr, inout M meta) { | ||
apply { } | ||
} | ||
|
||
control ComputeChecksumI(inout H hdr, inout M meta) { | ||
apply { } | ||
} | ||
|
||
control IngressI(inout H hdr, inout M meta, inout std_meta_t std_meta) { | ||
apply { | ||
meta.flag = true; | ||
} | ||
} | ||
|
||
control EgressI(inout H hdr, inout M meta, inout std_meta_t std_meta) { | ||
apply { } | ||
} | ||
|
||
V1Switch(ParserI(), VerifyChecksumI(), IngressI(), EgressI(), ComputeChecksumI(), DeparserI()) main; |
48 changes: 48 additions & 0 deletions
48
testdata/p4_16_samples_outputs/issue272-1-bmv2-frontend.p4
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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#include <core.p4> | ||
#include <v1model.p4> | ||
|
||
typedef standard_metadata_t std_meta_t; | ||
struct some_meta_t { | ||
bool flag; | ||
} | ||
|
||
struct H { | ||
} | ||
|
||
struct M { | ||
some_meta_t some_meta; | ||
} | ||
|
||
control DeparserI(packet_out packet, in H hdr) { | ||
apply { | ||
} | ||
} | ||
|
||
parser ParserI(packet_in pk, out H hdr, inout M meta, inout std_meta_t std_meta) { | ||
state start { | ||
transition accept; | ||
} | ||
} | ||
|
||
control VerifyChecksumI(in H hdr, inout M meta) { | ||
apply { | ||
} | ||
} | ||
|
||
control ComputeChecksumI(inout H hdr, inout M meta) { | ||
apply { | ||
} | ||
} | ||
|
||
control IngressI(inout H hdr, inout M meta, inout std_meta_t std_meta) { | ||
apply { | ||
meta.some_meta.flag = true; | ||
} | ||
} | ||
|
||
control EgressI(inout H hdr, inout M meta, inout std_meta_t std_meta) { | ||
apply { | ||
} | ||
} | ||
|
||
V1Switch<H, M>(ParserI(), VerifyChecksumI(), IngressI(), EgressI(), ComputeChecksumI(), DeparserI()) main; |
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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#include <core.p4> | ||
#include <v1model.p4> | ||
|
||
typedef standard_metadata_t std_meta_t; | ||
struct some_meta_t { | ||
bool flag; | ||
} | ||
|
||
struct H { | ||
} | ||
|
||
struct M { | ||
some_meta_t some_meta; | ||
} | ||
|
||
control DeparserI(packet_out packet, in H hdr) { | ||
apply { | ||
} | ||
} | ||
|
||
parser ParserI(packet_in pk, out H hdr, inout M meta, inout std_meta_t std_meta) { | ||
state start { | ||
transition accept; | ||
} | ||
} | ||
|
||
control VerifyChecksumI(in H hdr, inout M meta) { | ||
apply { | ||
} | ||
} | ||
|
||
control ComputeChecksumI(inout H hdr, inout M meta) { | ||
apply { | ||
} | ||
} | ||
|
||
control IngressI(inout H hdr, inout M meta, inout std_meta_t std_meta) { | ||
action act() { | ||
meta.some_meta.flag = true; | ||
} | ||
table tbl_act() { | ||
actions = { | ||
act(); | ||
} | ||
const default_action = act(); | ||
} | ||
apply { | ||
tbl_act.apply(); | ||
} | ||
} | ||
|
||
control EgressI(inout H hdr, inout M meta, inout std_meta_t std_meta) { | ||
apply { | ||
} | ||
} | ||
|
||
V1Switch<H, M>(ParserI(), VerifyChecksumI(), IngressI(), EgressI(), ComputeChecksumI(), DeparserI()) main; |
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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#include <core.p4> | ||
#include <v1model.p4> | ||
|
||
typedef standard_metadata_t std_meta_t; | ||
struct some_meta_t { | ||
bool flag; | ||
} | ||
|
||
struct H { | ||
} | ||
|
||
struct M { | ||
some_meta_t some_meta; | ||
} | ||
|
||
control DeparserI(packet_out packet, in H hdr) { | ||
apply { | ||
} | ||
} | ||
|
||
parser ParserI(packet_in pk, out H hdr, inout M meta, inout std_meta_t std_meta) { | ||
state start { | ||
transition accept; | ||
} | ||
} | ||
|
||
control VerifyChecksumI(in H hdr, inout M meta) { | ||
apply { | ||
} | ||
} | ||
|
||
control ComputeChecksumI(inout H hdr, inout M meta) { | ||
apply { | ||
} | ||
} | ||
|
||
control IngressI(inout H hdr, inout M meta, inout std_meta_t std_meta) { | ||
apply { | ||
meta.some_meta.flag = true; | ||
} | ||
} | ||
|
||
control EgressI(inout H hdr, inout M meta, inout std_meta_t std_meta) { | ||
apply { | ||
} | ||
} | ||
|
||
V1Switch(ParserI(), VerifyChecksumI(), IngressI(), EgressI(), ComputeChecksumI(), DeparserI()) main; |
Empty file.
44 changes: 44 additions & 0 deletions
44
testdata/p4_16_samples_outputs/issue272-2-bmv2-frontend.p4
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#include <core.p4> | ||
#include <v1model.p4> | ||
|
||
typedef standard_metadata_t std_meta_t; | ||
struct H { | ||
} | ||
|
||
struct M { | ||
bool flag; | ||
} | ||
|
||
control DeparserI(packet_out packet, in H hdr) { | ||
apply { | ||
} | ||
} | ||
|
||
parser ParserI(packet_in pk, out H hdr, inout M meta, inout std_meta_t std_meta) { | ||
state start { | ||
transition accept; | ||
} | ||
} | ||
|
||
control VerifyChecksumI(in H hdr, inout M meta) { | ||
apply { | ||
} | ||
} | ||
|
||
control ComputeChecksumI(inout H hdr, inout M meta) { | ||
apply { | ||
} | ||
} | ||
|
||
control IngressI(inout H hdr, inout M meta, inout std_meta_t std_meta) { | ||
apply { | ||
meta.flag = true; | ||
} | ||
} | ||
|
||
control EgressI(inout H hdr, inout M meta, inout std_meta_t std_meta) { | ||
apply { | ||
} | ||
} | ||
|
||
V1Switch<H, M>(ParserI(), VerifyChecksumI(), IngressI(), EgressI(), ComputeChecksumI(), DeparserI()) main; |
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#include <core.p4> | ||
#include <v1model.p4> | ||
|
||
typedef standard_metadata_t std_meta_t; | ||
struct H { | ||
} | ||
|
||
struct M { | ||
bool flag; | ||
} | ||
|
||
control DeparserI(packet_out packet, in H hdr) { | ||
apply { | ||
} | ||
} | ||
|
||
parser ParserI(packet_in pk, out H hdr, inout M meta, inout std_meta_t std_meta) { | ||
state start { | ||
transition accept; | ||
} | ||
} | ||
|
||
control VerifyChecksumI(in H hdr, inout M meta) { | ||
apply { | ||
} | ||
} | ||
|
||
control ComputeChecksumI(inout H hdr, inout M meta) { | ||
apply { | ||
} | ||
} | ||
|
||
control IngressI(inout H hdr, inout M meta, inout std_meta_t std_meta) { | ||
action act() { | ||
meta.flag = true; | ||
} | ||
table tbl_act() { | ||
actions = { | ||
act(); | ||
} | ||
const default_action = act(); | ||
} | ||
apply { | ||
tbl_act.apply(); | ||
} | ||
} | ||
|
||
control EgressI(inout H hdr, inout M meta, inout std_meta_t std_meta) { | ||
apply { | ||
} | ||
} | ||
|
||
V1Switch<H, M>(ParserI(), VerifyChecksumI(), IngressI(), EgressI(), ComputeChecksumI(), DeparserI()) main; |
Oops, something went wrong.