-
Notifications
You must be signed in to change notification settings - Fork 445
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
Showing
22 changed files
with
537 additions
and
10 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
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,20 @@ | ||
struct mystruct1 { | ||
bit<4> a; | ||
} | ||
|
||
extern myExtern1 { | ||
myExtern1(bit x); | ||
mystruct1(in bit<8> a, out bit<16> b); | ||
} | ||
|
||
control c() { | ||
myExtern1(1) m; | ||
apply {} | ||
} | ||
|
||
#if 0 | ||
control ct(); | ||
package top(ct c); | ||
|
||
top(c()) main; | ||
#endif |
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,15 @@ | ||
struct mystruct1 { | ||
bit<4> a; | ||
} | ||
|
||
extern myExtern1 { | ||
myExtern1(bit<1> x); | ||
mystruct1(in bit<8> a, out bit<16> b); | ||
} | ||
|
||
control c() { | ||
myExtern1(1) m; | ||
apply { | ||
} | ||
} | ||
|
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,3 @@ | ||
../testdata/p4_16_errors/issue435.p4(7): error: mystruct1: Method has no return type | ||
mystruct1(in bit<8> a, out bit<16> b); | ||
^^^^^^^^^ |
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
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
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
74 changes: 74 additions & 0 deletions
74
testdata/p4_16_samples_outputs/table-entries-exact-bmv2-midend.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,74 @@ | ||
#include <core.p4> | ||
#include <v1model.p4> | ||
|
||
header hdr { | ||
bit<8> e; | ||
bit<16> t; | ||
bit<8> l; | ||
bit<8> r; | ||
bit<1> v; | ||
} | ||
|
||
struct Header_t { | ||
hdr h; | ||
} | ||
|
||
struct Meta_t { | ||
} | ||
|
||
parser p(packet_in b, out Header_t h, inout Meta_t m, inout standard_metadata_t sm) { | ||
state start { | ||
b.extract<hdr>(h.h); | ||
transition accept; | ||
} | ||
} | ||
|
||
control vrfy(in Header_t h, inout Meta_t m) { | ||
apply { | ||
} | ||
} | ||
|
||
control update(inout Header_t h, inout Meta_t m) { | ||
apply { | ||
} | ||
} | ||
|
||
control egress(inout Header_t h, inout Meta_t m, inout standard_metadata_t sm) { | ||
apply { | ||
} | ||
} | ||
|
||
control deparser(packet_out b, in Header_t h) { | ||
apply { | ||
b.emit<hdr>(h.h); | ||
} | ||
} | ||
|
||
control ingress(inout Header_t h, inout Meta_t m, inout standard_metadata_t standard_meta) { | ||
@name("a") action a_0() { | ||
standard_meta.egress_spec = 9w0; | ||
} | ||
@name("a_with_control_params") action a_with_control_params_0(bit<9> x) { | ||
standard_meta.egress_spec = x; | ||
} | ||
@name("t_exact") table t_exact { | ||
key = { | ||
h.h.e: exact @name("h.h.e") ; | ||
} | ||
actions = { | ||
a_0(); | ||
a_with_control_params_0(); | ||
} | ||
default_action = a_0(); | ||
const entries = { | ||
8w0x1 : a_with_control_params_0(9w1); | ||
8w0x2 : a_with_control_params_0(9w2); | ||
} | ||
|
||
} | ||
apply { | ||
t_exact.apply(); | ||
} | ||
} | ||
|
||
V1Switch<Header_t, Meta_t>(p(), vrfy(), ingress(), egress(), update(), deparser()) main; |
Empty file.
Oops, something went wrong.