forked from p4lang/p4c
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make HasTableApply a resolution context, so it could resolve declarat…
…ions on its own if desired (p4lang#4781) * Make HasTableApply a resolution context, so it could resolve declarations on its own if desired Fixes p4lang#4775 Signed-off-by: Anton Korobeynikov <[email protected]> * Get rid of refMap in HasTableApply. Some cleanup while there Signed-off-by: Anton Korobeynikov <[email protected]> --------- Signed-off-by: Anton Korobeynikov <[email protected]>
- Loading branch information
Showing
18 changed files
with
293 additions
and
16 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
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,26 @@ | ||
bit<8> add_1(in bit<8> a, in bit<8> b) { return 1; } | ||
bit<8> add_1(in bit<8> c, in bit<8> d) { return 2; } | ||
|
||
header hdr_t { | ||
bit<8> value_1; | ||
bit<8> value_2; | ||
bit<8> value_3; | ||
bit<8> value_4; | ||
bit<8> value_5; | ||
bit<8> value_6; | ||
bit<8> value_7; | ||
} | ||
|
||
control c(inout hdr_t hdr) { | ||
apply { | ||
if (hdr.isValid()) { | ||
hdr.value_6 = add_1(a = hdr.value_1, b = hdr.value_2); | ||
hdr.value_7 = add_1(d = hdr.value_3, c = hdr.value_4); | ||
} | ||
} | ||
} | ||
|
||
control ctrl(inout hdr_t hdr); | ||
package top(ctrl _c); | ||
|
||
top(c()) 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,26 @@ | ||
bit<8> add(in bit<8> a, in bit<8> b) { return 1; } | ||
bit<8> add(in bit<8> a, in bit<8> b, in bit<8> c) { return 2; } | ||
|
||
header hdr_t { | ||
bit<8> value_1; | ||
bit<8> value_2; | ||
bit<8> value_3; | ||
bit<8> value_4; | ||
bit<8> value_5; | ||
bit<8> value_6; | ||
bit<8> value_7; | ||
} | ||
|
||
control c(inout hdr_t hdr) { | ||
apply { | ||
if (hdr.isValid()) { | ||
hdr.value_3 = add(hdr.value_1, hdr.value_2); | ||
hdr.value_7 = add(hdr.value_4, hdr.value_5, hdr.value_6); | ||
} | ||
} | ||
} | ||
|
||
control ctrl(inout hdr_t hdr); | ||
package top(ctrl _c); | ||
|
||
top(c()) 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,28 @@ | ||
bit<8> add_1(in bit<8> a, in bit<8> b) { | ||
return 8w1; | ||
} | ||
bit<8> add_1(in bit<8> c, in bit<8> d) { | ||
return 8w2; | ||
} | ||
header hdr_t { | ||
bit<8> value_1; | ||
bit<8> value_2; | ||
bit<8> value_3; | ||
bit<8> value_4; | ||
bit<8> value_5; | ||
bit<8> value_6; | ||
bit<8> value_7; | ||
} | ||
|
||
control c(inout hdr_t hdr) { | ||
apply { | ||
if (hdr.isValid()) { | ||
hdr.value_6 = add_1(a = hdr.value_1, b = hdr.value_2); | ||
hdr.value_7 = add_1(d = hdr.value_3, c = hdr.value_4); | ||
} | ||
} | ||
} | ||
|
||
control ctrl(inout hdr_t hdr); | ||
package top(ctrl _c); | ||
top(c()) 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,26 @@ | ||
header hdr_t { | ||
bit<8> value_1; | ||
bit<8> value_2; | ||
bit<8> value_3; | ||
bit<8> value_4; | ||
bit<8> value_5; | ||
bit<8> value_6; | ||
bit<8> value_7; | ||
} | ||
|
||
control c(inout hdr_t hdr) { | ||
@name("c.retval") bit<8> retval; | ||
@name("c.retval_0") bit<8> retval_0; | ||
apply { | ||
if (hdr.isValid()) { | ||
retval = 8w1; | ||
hdr.value_6 = retval; | ||
retval_0 = 8w2; | ||
hdr.value_7 = retval_0; | ||
} | ||
} | ||
} | ||
|
||
control ctrl(inout hdr_t hdr); | ||
package top(ctrl _c); | ||
top(c()) 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,31 @@ | ||
header hdr_t { | ||
bit<8> value_1; | ||
bit<8> value_2; | ||
bit<8> value_3; | ||
bit<8> value_4; | ||
bit<8> value_5; | ||
bit<8> value_6; | ||
bit<8> value_7; | ||
} | ||
|
||
control c(inout hdr_t hdr) { | ||
@hidden action issue47752l17() { | ||
hdr.value_6 = 8w1; | ||
hdr.value_7 = 8w2; | ||
} | ||
@hidden table tbl_issue47752l17 { | ||
actions = { | ||
issue47752l17(); | ||
} | ||
const default_action = issue47752l17(); | ||
} | ||
apply { | ||
if (hdr.isValid()) { | ||
tbl_issue47752l17.apply(); | ||
} | ||
} | ||
} | ||
|
||
control ctrl(inout hdr_t hdr); | ||
package top(ctrl _c); | ||
top(c()) 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,28 @@ | ||
bit<8> add_1(in bit<8> a, in bit<8> b) { | ||
return 1; | ||
} | ||
bit<8> add_1(in bit<8> c, in bit<8> d) { | ||
return 2; | ||
} | ||
header hdr_t { | ||
bit<8> value_1; | ||
bit<8> value_2; | ||
bit<8> value_3; | ||
bit<8> value_4; | ||
bit<8> value_5; | ||
bit<8> value_6; | ||
bit<8> value_7; | ||
} | ||
|
||
control c(inout hdr_t hdr) { | ||
apply { | ||
if (hdr.isValid()) { | ||
hdr.value_6 = add_1(a = hdr.value_1, b = hdr.value_2); | ||
hdr.value_7 = add_1(d = hdr.value_3, c = hdr.value_4); | ||
} | ||
} | ||
} | ||
|
||
control ctrl(inout hdr_t hdr); | ||
package top(ctrl _c); | ||
top(c()) main; |
Empty file.
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,28 @@ | ||
bit<8> add(in bit<8> a, in bit<8> b) { | ||
return 8w1; | ||
} | ||
bit<8> add(in bit<8> a, in bit<8> b, in bit<8> c) { | ||
return 8w2; | ||
} | ||
header hdr_t { | ||
bit<8> value_1; | ||
bit<8> value_2; | ||
bit<8> value_3; | ||
bit<8> value_4; | ||
bit<8> value_5; | ||
bit<8> value_6; | ||
bit<8> value_7; | ||
} | ||
|
||
control c(inout hdr_t hdr) { | ||
apply { | ||
if (hdr.isValid()) { | ||
hdr.value_3 = add(hdr.value_1, hdr.value_2); | ||
hdr.value_7 = add(hdr.value_4, hdr.value_5, hdr.value_6); | ||
} | ||
} | ||
} | ||
|
||
control ctrl(inout hdr_t hdr); | ||
package top(ctrl _c); | ||
top(c()) 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,26 @@ | ||
header hdr_t { | ||
bit<8> value_1; | ||
bit<8> value_2; | ||
bit<8> value_3; | ||
bit<8> value_4; | ||
bit<8> value_5; | ||
bit<8> value_6; | ||
bit<8> value_7; | ||
} | ||
|
||
control c(inout hdr_t hdr) { | ||
@name("c.retval") bit<8> retval; | ||
@name("c.retval_0") bit<8> retval_0; | ||
apply { | ||
if (hdr.isValid()) { | ||
retval = 8w1; | ||
hdr.value_3 = retval; | ||
retval_0 = 8w2; | ||
hdr.value_7 = retval_0; | ||
} | ||
} | ||
} | ||
|
||
control ctrl(inout hdr_t hdr); | ||
package top(ctrl _c); | ||
top(c()) 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,31 @@ | ||
header hdr_t { | ||
bit<8> value_1; | ||
bit<8> value_2; | ||
bit<8> value_3; | ||
bit<8> value_4; | ||
bit<8> value_5; | ||
bit<8> value_6; | ||
bit<8> value_7; | ||
} | ||
|
||
control c(inout hdr_t hdr) { | ||
@hidden action issue4775l17() { | ||
hdr.value_3 = 8w1; | ||
hdr.value_7 = 8w2; | ||
} | ||
@hidden table tbl_issue4775l17 { | ||
actions = { | ||
issue4775l17(); | ||
} | ||
const default_action = issue4775l17(); | ||
} | ||
apply { | ||
if (hdr.isValid()) { | ||
tbl_issue4775l17.apply(); | ||
} | ||
} | ||
} | ||
|
||
control ctrl(inout hdr_t hdr); | ||
package top(ctrl _c); | ||
top(c()) 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,28 @@ | ||
bit<8> add(in bit<8> a, in bit<8> b) { | ||
return 1; | ||
} | ||
bit<8> add(in bit<8> a, in bit<8> b, in bit<8> c) { | ||
return 2; | ||
} | ||
header hdr_t { | ||
bit<8> value_1; | ||
bit<8> value_2; | ||
bit<8> value_3; | ||
bit<8> value_4; | ||
bit<8> value_5; | ||
bit<8> value_6; | ||
bit<8> value_7; | ||
} | ||
|
||
control c(inout hdr_t hdr) { | ||
apply { | ||
if (hdr.isValid()) { | ||
hdr.value_3 = add(hdr.value_1, hdr.value_2); | ||
hdr.value_7 = add(hdr.value_4, hdr.value_5, hdr.value_6); | ||
} | ||
} | ||
} | ||
|
||
control ctrl(inout hdr_t hdr); | ||
package top(ctrl _c); | ||
top(c()) main; |
Empty file.