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
May 11, 2017
1 parent
9fd3ed3
commit 5d8f0ce
Showing
17 changed files
with
144 additions
and
67 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
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 |
---|---|---|
|
@@ -18,4 +18,7 @@ control C<H>() { | |
apply {} | ||
} | ||
|
||
C() c; | ||
control cproto(); | ||
package top(cproto _c); | ||
|
||
top(C()) c; |
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,47 @@ | ||
#include <v1model.p4> | ||
|
||
header h_t { | ||
bit<8> f; | ||
} | ||
|
||
struct my_packet { | ||
h_t h; | ||
} | ||
|
||
struct my_metadata { | ||
|
||
} | ||
|
||
parser MyParser(packet_in b, out my_packet p, inout my_metadata m, inout standard_metadata_t s) { | ||
state start { | ||
transition accept; | ||
} | ||
} | ||
|
||
control MyVerifyChecksum(in my_packet hdr, inout my_metadata meta) { | ||
apply { } | ||
} | ||
|
||
control C() { | ||
apply {} | ||
} | ||
|
||
C() c; | ||
|
||
control MyIngress(inout my_packet p, inout my_metadata m, inout standard_metadata_t s) { | ||
apply { c.apply(); } | ||
} | ||
|
||
control MyEgress(inout my_packet p, inout my_metadata m, inout standard_metadata_t s) { | ||
apply { } | ||
} | ||
|
||
control MyComputeChecksum(inout my_packet p, inout my_metadata m) { | ||
apply { } | ||
} | ||
|
||
control MyDeparser(packet_out b, in my_packet p) { | ||
apply { } | ||
} | ||
|
||
V1Switch(MyParser(), MyVerifyChecksum(), MyIngress(), MyEgress(), MyComputeChecksum(), MyDeparser()) 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
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 |
---|---|---|
|
@@ -3,4 +3,6 @@ control C<H>() { | |
} | ||
} | ||
|
||
C() c; | ||
control cproto(); | ||
package top(cproto _c); | ||
top(C()) c; |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
../testdata/p4_16_errors/issue344.p4(21): error: c: cannot infer type for type parameter H | ||
C() c; | ||
^ | ||
../testdata/p4_16_errors/issue344.p4(24): error: C: cannot infer type for type parameter H | ||
top(C()) c; | ||
^^^ | ||
../testdata/p4_16_errors/issue344.p4(17) | ||
control C<H>() { | ||
^ |
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> | ||
|
||
header h_t { | ||
bit<8> f; | ||
} | ||
|
||
struct my_packet { | ||
h_t h; | ||
} | ||
|
||
struct my_metadata { | ||
} | ||
|
||
parser MyParser(packet_in b, out my_packet p, inout my_metadata m, inout standard_metadata_t s) { | ||
state start { | ||
transition accept; | ||
} | ||
} | ||
|
||
control MyVerifyChecksum(in my_packet hdr, inout my_metadata meta) { | ||
apply { | ||
} | ||
} | ||
|
||
control C() { | ||
apply { | ||
} | ||
} | ||
|
||
C() c; | ||
control MyIngress(inout my_packet p, inout my_metadata m, inout standard_metadata_t s) { | ||
apply { | ||
c.apply(); | ||
} | ||
} | ||
|
||
control MyEgress(inout my_packet p, inout my_metadata m, inout standard_metadata_t s) { | ||
apply { | ||
} | ||
} | ||
|
||
control MyComputeChecksum(inout my_packet p, inout my_metadata m) { | ||
apply { | ||
} | ||
} | ||
|
||
control MyDeparser(packet_out b, in my_packet p) { | ||
apply { | ||
} | ||
} | ||
|
||
V1Switch(MyParser(), MyVerifyChecksum(), MyIngress(), MyEgress(), MyComputeChecksum(), MyDeparser()) 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,12 @@ | ||
../testdata/p4_16_errors/issue388.p4(29): error: c: cannot instantiate at top-level | ||
C() c; | ||
^ | ||
../testdata/p4_16_errors/issue388.p4(29): error: Could not find type of c | ||
C() c; | ||
^ | ||
../testdata/p4_16_errors/issue388.p4(32): error: Could not find type of c | ||
apply { c.apply(); } | ||
^ | ||
../testdata/p4_16_errors/issue388.p4(32): error: Could not find type of c.apply | ||
apply { c.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
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