From fd5322936443b38202267bdb82904b226bfa46e4 Mon Sep 17 00:00:00 2001 From: "sajan.kumar@intel.com" Date: Mon, 13 Dec 2021 03:48:47 -0800 Subject: [PATCH] Switch statement not correctly translated when default case is not present --- midend/eliminateSwitch.cpp | 13 + .../copy_to_cpu-first.p4 | 5 +- .../copy_to_cpu-frontend.p4 | 5 +- .../copy_to_cpu-midend.p4 | 5 +- testdata/p4_14_samples_outputs/copy_to_cpu.p4 | 5 +- .../p414-special-ops-2-bmv2-first.p4 | 17 +- .../p414-special-ops-2-bmv2-frontend.p4 | 17 +- .../p414-special-ops-2-bmv2-midend.p4 | 23 +- .../p414-special-ops-2-bmv2.p4 | 17 +- .../p414-special-ops-3-bmv2-first.p4 | 15 +- .../p414-special-ops-3-bmv2-frontend.p4 | 15 +- .../p414-special-ops-3-bmv2-midend.p4 | 19 +- .../p414-special-ops-3-bmv2.p4 | 15 +- .../p414-special-ops-first.p4 | 15 +- .../p414-special-ops-frontend.p4 | 15 +- .../p414-special-ops-midend.p4 | 19 +- .../p4_14_samples_outputs/p414-special-ops.p4 | 15 +- .../packet_redirect-first.p4 | 11 +- .../packet_redirect-frontend.p4 | 11 +- .../packet_redirect-midend.p4 | 11 +- .../p4_14_samples_outputs/packet_redirect.p4 | 11 +- .../p4_14_samples_outputs/simple_nat-first.p4 | 11 +- .../simple_nat-frontend.p4 | 11 +- .../simple_nat-midend.p4 | 9 +- testdata/p4_14_samples_outputs/simple_nat.p4 | 11 +- .../switch_20160512/switch-first.p4 | 179 ++++++------- .../switch_20160512/switch-frontend.p4 | 179 ++++++------- .../switch_20160512/switch-midend.p4 | 157 ++++++------ .../switch_20160512/switch.p4 | 179 ++++++------- .../psa-switch-expression-without-default.p4 | 174 +++++++++++++ .../invalid-hdr-warnings2-first.p4 | 1 + .../invalid-hdr-warnings2-frontend.p4 | 1 + .../invalid-hdr-warnings2-midend.p4 | 1 + .../invalid-hdr-warnings5.p4-stderr | 1 - .../invalid-hdr-warnings7.p4-stderr | 1 - .../invalid-hdr-warnings8.p4-stderr | 1 - .../issue1001-1-bmv2-first.p4 | 3 +- .../issue1001-1-bmv2-frontend.p4 | 3 +- .../issue1001-1-bmv2-midend.p4 | 3 +- .../p4_16_samples_outputs/issue1001-1-bmv2.p4 | 3 +- .../issue1001-bmv2-first.p4 | 3 +- .../issue1001-bmv2-frontend.p4 | 3 +- .../issue1001-bmv2-midend.p4 | 3 +- .../p4_16_samples_outputs/issue1001-bmv2.p4 | 3 +- .../issue1642-bmv2-first.p4 | 3 +- .../issue1642-bmv2-frontend.p4 | 3 +- .../issue1642-bmv2-midend.p4 | 9 +- .../p4_16_samples_outputs/issue1642-bmv2.p4 | 3 +- .../issue1653-bmv2-first.p4 | 1 + .../issue1653-bmv2-frontend.p4 | 1 + .../issue1653-bmv2-midend.p4 | 1 + .../p4_16_samples_outputs/issue1653-bmv2.p4 | 1 + .../issue1653-complex-bmv2-first.p4 | 3 +- .../issue1653-complex-bmv2-frontend.p4 | 3 +- .../issue1653-complex-bmv2-midend.p4 | 25 +- .../issue1653-complex-bmv2.p4 | 3 +- .../issue1660-bmv2-first.p4 | 3 +- .../issue1660-bmv2-frontend.p4 | 3 +- .../issue1660-bmv2-midend.p4 | 3 +- .../p4_16_samples_outputs/issue1660-bmv2.p4 | 3 +- .../issue1765-1-bmv2-first.p4 | 11 +- .../issue1765-1-bmv2-frontend.p4 | 11 +- .../issue1765-1-bmv2-midend.p4 | 11 +- .../p4_16_samples_outputs/issue1765-1-bmv2.p4 | 11 +- .../issue2176-bmv2.p4-stderr | 4 +- .../issue383-bmv2-first.p4 | 3 +- .../issue383-bmv2-frontend.p4 | 3 +- .../issue383-bmv2-midend.p4 | 9 +- .../p4_16_samples_outputs/issue383-bmv2.p4 | 3 +- .../issue562-bmv2-first.p4 | 3 +- .../issue562-bmv2-frontend.p4 | 3 +- .../issue562-bmv2-midend.p4 | 9 +- .../p4_16_samples_outputs/issue562-bmv2.p4 | 3 +- ...ey-consolidation-mixed-keys-4.p4.bfrt.json | 2 +- ...switch-expression-without-default-first.p4 | 161 ++++++++++++ ...tch-expression-without-default-frontend.p4 | 168 ++++++++++++ ...witch-expression-without-default-midend.p4 | 240 ++++++++++++++++++ .../psa-switch-expression-without-default.p4 | 157 ++++++++++++ ...switch-expression-without-default.p4-error | 7 + ...witch-expression-without-default.p4-stderr | 6 + ...ch-expression-without-default.p4.bfrt.json | 137 ++++++++++ ...-expression-without-default.p4.entries.txt | 0 ...h-expression-without-default.p4.p4info.txt | 88 +++++++ ...-switch-expression-without-default.p4.spec | 220 ++++++++++++++++ .../v1model-special-ops-bmv2-first.p4 | 1 + .../v1model-special-ops-bmv2-frontend.p4 | 1 + .../v1model-special-ops-bmv2-midend.p4 | 1 + .../v1model-special-ops-bmv2.p4 | 1 + 88 files changed, 2000 insertions(+), 561 deletions(-) create mode 100644 testdata/p4_16_samples/psa-switch-expression-without-default.p4 create mode 100644 testdata/p4_16_samples_outputs/psa-switch-expression-without-default-first.p4 create mode 100644 testdata/p4_16_samples_outputs/psa-switch-expression-without-default-frontend.p4 create mode 100644 testdata/p4_16_samples_outputs/psa-switch-expression-without-default-midend.p4 create mode 100644 testdata/p4_16_samples_outputs/psa-switch-expression-without-default.p4 create mode 100644 testdata/p4_16_samples_outputs/psa-switch-expression-without-default.p4-error create mode 100644 testdata/p4_16_samples_outputs/psa-switch-expression-without-default.p4-stderr create mode 100644 testdata/p4_16_samples_outputs/psa-switch-expression-without-default.p4.bfrt.json create mode 100644 testdata/p4_16_samples_outputs/psa-switch-expression-without-default.p4.entries.txt create mode 100644 testdata/p4_16_samples_outputs/psa-switch-expression-without-default.p4.p4info.txt create mode 100644 testdata/p4_16_samples_outputs/psa-switch-expression-without-default.p4.spec diff --git a/midend/eliminateSwitch.cpp b/midend/eliminateSwitch.cpp index 3504058960f..ff9912be7f8 100644 --- a/midend/eliminateSwitch.cpp +++ b/midend/eliminateSwitch.cpp @@ -56,6 +56,19 @@ const IR::Node* DoEliminateSwitch::postorder(IR::SwitchStatement* statement) { properties.push_back(new IR::Property(src, "key", new IR::Key({tableKeyEl}), false)); IR::ID defaultAction = P4CoreLibrary::instance.noAction.Id(); + // Add Default switch Expression if not present + bool isDefaultPresent = false; + for (auto sc : statement->cases) { + if (sc->label->is()) { + isDefaultPresent = true; + break; + } + } + if (!isDefaultPresent) { + statement->cases.push_back( + new IR::SwitchCase(new IR::DefaultExpression(IR::Type_Dontcare::get()), + new IR::BlockStatement)); + } // Create actions IR::Vector pendingLabels; // switch labels with no statement for (auto sc : statement->cases) { diff --git a/testdata/p4_14_samples_outputs/copy_to_cpu-first.p4 b/testdata/p4_14_samples_outputs/copy_to_cpu-first.p4 index eb1ff388134..61d4f7f8d2d 100644 --- a/testdata/p4_14_samples_outputs/copy_to_cpu-first.p4 +++ b/testdata/p4_14_samples_outputs/copy_to_cpu-first.p4 @@ -26,9 +26,9 @@ struct metadata { } struct headers { - @name(".cpu_header") + @name(".cpu_header") cpu_header_t cpu_header; - @name(".ethernet") + @name(".ethernet") ethernet_t ethernet; } @@ -110,3 +110,4 @@ control computeChecksum(inout headers hdr, inout metadata meta) { } V1Switch(ParserImpl(), verifyChecksum(), ingress(), egress(), computeChecksum(), DeparserImpl()) main; + diff --git a/testdata/p4_14_samples_outputs/copy_to_cpu-frontend.p4 b/testdata/p4_14_samples_outputs/copy_to_cpu-frontend.p4 index 222306c199e..5588ffc0384 100644 --- a/testdata/p4_14_samples_outputs/copy_to_cpu-frontend.p4 +++ b/testdata/p4_14_samples_outputs/copy_to_cpu-frontend.p4 @@ -26,9 +26,9 @@ struct metadata { } struct headers { - @name(".cpu_header") + @name(".cpu_header") cpu_header_t cpu_header; - @name(".ethernet") + @name(".ethernet") ethernet_t ethernet; } @@ -118,3 +118,4 @@ control computeChecksum(inout headers hdr, inout metadata meta) { } V1Switch(ParserImpl(), verifyChecksum(), ingress(), egress(), computeChecksum(), DeparserImpl()) main; + diff --git a/testdata/p4_14_samples_outputs/copy_to_cpu-midend.p4 b/testdata/p4_14_samples_outputs/copy_to_cpu-midend.p4 index 267e8139fa2..68b271ab6ec 100644 --- a/testdata/p4_14_samples_outputs/copy_to_cpu-midend.p4 +++ b/testdata/p4_14_samples_outputs/copy_to_cpu-midend.p4 @@ -22,9 +22,9 @@ struct metadata { } struct headers { - @name(".cpu_header") + @name(".cpu_header") cpu_header_t cpu_header; - @name(".ethernet") + @name(".ethernet") ethernet_t ethernet; } @@ -112,3 +112,4 @@ control computeChecksum(inout headers hdr, inout metadata meta) { } V1Switch(ParserImpl(), verifyChecksum(), ingress(), egress(), computeChecksum(), DeparserImpl()) main; + diff --git a/testdata/p4_14_samples_outputs/copy_to_cpu.p4 b/testdata/p4_14_samples_outputs/copy_to_cpu.p4 index d593e93990e..eb0991f5f4c 100644 --- a/testdata/p4_14_samples_outputs/copy_to_cpu.p4 +++ b/testdata/p4_14_samples_outputs/copy_to_cpu.p4 @@ -26,9 +26,9 @@ struct metadata { } struct headers { - @name(".cpu_header") + @name(".cpu_header") cpu_header_t cpu_header; - @name(".ethernet") + @name(".ethernet") ethernet_t ethernet; } @@ -106,3 +106,4 @@ control computeChecksum(inout headers hdr, inout metadata meta) { } V1Switch(ParserImpl(), verifyChecksum(), ingress(), egress(), computeChecksum(), DeparserImpl()) main; + diff --git a/testdata/p4_14_samples_outputs/p414-special-ops-2-bmv2-first.p4 b/testdata/p4_14_samples_outputs/p414-special-ops-2-bmv2-first.p4 index 1a42a30740f..90c955fdf17 100644 --- a/testdata/p4_14_samples_outputs/p414-special-ops-2-bmv2-first.p4 +++ b/testdata/p4_14_samples_outputs/p414-special-ops-2-bmv2-first.p4 @@ -16,15 +16,15 @@ struct intrinsic_metadata_t { } struct mymeta_t { - @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) + @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) bit<8> resubmit_count; - @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) + @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) bit<8> recirculate_count; - @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) + @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) bit<8> clone_e2e_count; - @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) + @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) bit<8> last_ing_instance_type; - @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) + @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) bit<8> f1; } @@ -39,14 +39,14 @@ header ethernet_t { } struct metadata { - @name(".mymeta") + @name(".mymeta") mymeta_t mymeta; - @name(".temporaries") + @name(".temporaries") temporaries_t temporaries; } struct headers { - @name(".ethernet") + @name(".ethernet") ethernet_t ethernet; } @@ -357,3 +357,4 @@ control computeChecksum(inout headers hdr, inout metadata meta) { } V1Switch(ParserImpl(), verifyChecksum(), ingress(), egress(), computeChecksum(), DeparserImpl()) main; + diff --git a/testdata/p4_14_samples_outputs/p414-special-ops-2-bmv2-frontend.p4 b/testdata/p4_14_samples_outputs/p414-special-ops-2-bmv2-frontend.p4 index 7d83a585fc7..66496df1efc 100644 --- a/testdata/p4_14_samples_outputs/p414-special-ops-2-bmv2-frontend.p4 +++ b/testdata/p4_14_samples_outputs/p414-special-ops-2-bmv2-frontend.p4 @@ -16,15 +16,15 @@ struct intrinsic_metadata_t { } struct mymeta_t { - @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) + @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) bit<8> resubmit_count; - @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) + @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) bit<8> recirculate_count; - @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) + @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) bit<8> clone_e2e_count; - @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) + @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) bit<8> last_ing_instance_type; - @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) + @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) bit<8> f1; } @@ -39,14 +39,14 @@ header ethernet_t { } struct metadata { - @name(".mymeta") + @name(".mymeta") mymeta_t mymeta; - @name(".temporaries") + @name(".temporaries") temporaries_t temporaries; } struct headers { - @name(".ethernet") + @name(".ethernet") ethernet_t ethernet; } @@ -388,3 +388,4 @@ control computeChecksum(inout headers hdr, inout metadata meta) { } V1Switch(ParserImpl(), verifyChecksum(), ingress(), egress(), computeChecksum(), DeparserImpl()) main; + diff --git a/testdata/p4_14_samples_outputs/p414-special-ops-2-bmv2-midend.p4 b/testdata/p4_14_samples_outputs/p414-special-ops-2-bmv2-midend.p4 index a5c7299cfc0..e8abf1f0dc1 100644 --- a/testdata/p4_14_samples_outputs/p414-special-ops-2-bmv2-midend.p4 +++ b/testdata/p4_14_samples_outputs/p414-special-ops-2-bmv2-midend.p4 @@ -10,15 +10,15 @@ struct intrinsic_metadata_t { } struct mymeta_t { - @field_list(8w0, 8w1, 8w2) + @field_list(8w0, 8w1, 8w2) bit<8> resubmit_count; - @field_list(8w0, 8w1, 8w2) + @field_list(8w0, 8w1, 8w2) bit<8> recirculate_count; - @field_list(8w0, 8w1, 8w2) + @field_list(8w0, 8w1, 8w2) bit<8> clone_e2e_count; - @field_list(8w0, 8w1, 8w2) + @field_list(8w0, 8w1, 8w2) bit<8> last_ing_instance_type; - @field_list(8w0, 8w1, 8w2) + @field_list(8w0, 8w1, 8w2) bit<8> f1; } @@ -33,21 +33,21 @@ header ethernet_t { } struct metadata { - @field_list(8w0, 8w1, 8w2) + @field_list(8w0, 8w1, 8w2) bit<8> _mymeta_resubmit_count0; - @field_list(8w0, 8w1, 8w2) + @field_list(8w0, 8w1, 8w2) bit<8> _mymeta_recirculate_count1; - @field_list(8w0, 8w1, 8w2) + @field_list(8w0, 8w1, 8w2) bit<8> _mymeta_clone_e2e_count2; - @field_list(8w0, 8w1, 8w2) + @field_list(8w0, 8w1, 8w2) bit<8> _mymeta_last_ing_instance_type3; - @field_list(8w0, 8w1, 8w2) + @field_list(8w0, 8w1, 8w2) bit<8> _mymeta_f14; bit<48> _temporaries_temp15; } struct headers { - @name(".ethernet") + @name(".ethernet") ethernet_t ethernet; } @@ -389,3 +389,4 @@ control computeChecksum(inout headers hdr, inout metadata meta) { } V1Switch(ParserImpl(), verifyChecksum(), ingress(), egress(), computeChecksum(), DeparserImpl()) main; + diff --git a/testdata/p4_14_samples_outputs/p414-special-ops-2-bmv2.p4 b/testdata/p4_14_samples_outputs/p414-special-ops-2-bmv2.p4 index b64ea1cf64d..409cea2c06d 100644 --- a/testdata/p4_14_samples_outputs/p414-special-ops-2-bmv2.p4 +++ b/testdata/p4_14_samples_outputs/p414-special-ops-2-bmv2.p4 @@ -16,15 +16,15 @@ struct intrinsic_metadata_t { } struct mymeta_t { - @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) + @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) bit<8> resubmit_count; - @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) + @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) bit<8> recirculate_count; - @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) + @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) bit<8> clone_e2e_count; - @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) + @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) bit<8> last_ing_instance_type; - @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) + @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) bit<8> f1; } @@ -39,14 +39,14 @@ header ethernet_t { } struct metadata { - @name(".mymeta") + @name(".mymeta") mymeta_t mymeta; - @name(".temporaries") + @name(".temporaries") temporaries_t temporaries; } struct headers { - @name(".ethernet") + @name(".ethernet") ethernet_t ethernet; } @@ -361,3 +361,4 @@ control computeChecksum(inout headers hdr, inout metadata meta) { } V1Switch(ParserImpl(), verifyChecksum(), ingress(), egress(), computeChecksum(), DeparserImpl()) main; + diff --git a/testdata/p4_14_samples_outputs/p414-special-ops-3-bmv2-first.p4 b/testdata/p4_14_samples_outputs/p414-special-ops-3-bmv2-first.p4 index d011952d283..d3cce8e887a 100644 --- a/testdata/p4_14_samples_outputs/p414-special-ops-3-bmv2-first.p4 +++ b/testdata/p4_14_samples_outputs/p414-special-ops-3-bmv2-first.p4 @@ -16,14 +16,14 @@ struct intrinsic_metadata_t { } struct mymeta_t { - @field_list(FieldLists.resubmit_FL) + @field_list(FieldLists.resubmit_FL) bit<8> resubmit_count; - @field_list(FieldLists.recirculate_FL) + @field_list(FieldLists.recirculate_FL) bit<8> recirculate_count; - @field_list(FieldLists.clone_e2e_FL) + @field_list(FieldLists.clone_e2e_FL) bit<8> clone_e2e_count; bit<8> last_ing_instance_type; - @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) + @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) bit<8> f1; } @@ -38,14 +38,14 @@ header ethernet_t { } struct metadata { - @name(".mymeta") + @name(".mymeta") mymeta_t mymeta; - @name(".temporaries") + @name(".temporaries") temporaries_t temporaries; } struct headers { - @name(".ethernet") + @name(".ethernet") ethernet_t ethernet; } @@ -381,3 +381,4 @@ control computeChecksum(inout headers hdr, inout metadata meta) { } V1Switch(ParserImpl(), verifyChecksum(), ingress(), egress(), computeChecksum(), DeparserImpl()) main; + diff --git a/testdata/p4_14_samples_outputs/p414-special-ops-3-bmv2-frontend.p4 b/testdata/p4_14_samples_outputs/p414-special-ops-3-bmv2-frontend.p4 index b9dce8aaf69..27846682958 100644 --- a/testdata/p4_14_samples_outputs/p414-special-ops-3-bmv2-frontend.p4 +++ b/testdata/p4_14_samples_outputs/p414-special-ops-3-bmv2-frontend.p4 @@ -16,14 +16,14 @@ struct intrinsic_metadata_t { } struct mymeta_t { - @field_list(FieldLists.resubmit_FL) + @field_list(FieldLists.resubmit_FL) bit<8> resubmit_count; - @field_list(FieldLists.recirculate_FL) + @field_list(FieldLists.recirculate_FL) bit<8> recirculate_count; - @field_list(FieldLists.clone_e2e_FL) + @field_list(FieldLists.clone_e2e_FL) bit<8> clone_e2e_count; bit<8> last_ing_instance_type; - @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) + @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) bit<8> f1; } @@ -38,14 +38,14 @@ header ethernet_t { } struct metadata { - @name(".mymeta") + @name(".mymeta") mymeta_t mymeta; - @name(".temporaries") + @name(".temporaries") temporaries_t temporaries; } struct headers { - @name(".ethernet") + @name(".ethernet") ethernet_t ethernet; } @@ -412,3 +412,4 @@ control computeChecksum(inout headers hdr, inout metadata meta) { } V1Switch(ParserImpl(), verifyChecksum(), ingress(), egress(), computeChecksum(), DeparserImpl()) main; + diff --git a/testdata/p4_14_samples_outputs/p414-special-ops-3-bmv2-midend.p4 b/testdata/p4_14_samples_outputs/p414-special-ops-3-bmv2-midend.p4 index fd86c9750ab..535bb28fc0d 100644 --- a/testdata/p4_14_samples_outputs/p414-special-ops-3-bmv2-midend.p4 +++ b/testdata/p4_14_samples_outputs/p414-special-ops-3-bmv2-midend.p4 @@ -10,14 +10,14 @@ struct intrinsic_metadata_t { } struct mymeta_t { - @field_list(8w2) + @field_list(8w2) bit<8> resubmit_count; - @field_list(8w1) + @field_list(8w1) bit<8> recirculate_count; - @field_list(8w0) + @field_list(8w0) bit<8> clone_e2e_count; bit<8> last_ing_instance_type; - @field_list(8w0, 8w1, 8w2) + @field_list(8w0, 8w1, 8w2) bit<8> f1; } @@ -32,20 +32,20 @@ header ethernet_t { } struct metadata { - @field_list(8w2) + @field_list(8w2) bit<8> _mymeta_resubmit_count0; - @field_list(8w1) + @field_list(8w1) bit<8> _mymeta_recirculate_count1; - @field_list(8w0) + @field_list(8w0) bit<8> _mymeta_clone_e2e_count2; bit<8> _mymeta_last_ing_instance_type3; - @field_list(8w0, 8w1, 8w2) + @field_list(8w0, 8w1, 8w2) bit<8> _mymeta_f14; bit<48> _temporaries_temp15; } struct headers { - @name(".ethernet") + @name(".ethernet") ethernet_t ethernet; } @@ -412,3 +412,4 @@ control computeChecksum(inout headers hdr, inout metadata meta) { } V1Switch(ParserImpl(), verifyChecksum(), ingress(), egress(), computeChecksum(), DeparserImpl()) main; + diff --git a/testdata/p4_14_samples_outputs/p414-special-ops-3-bmv2.p4 b/testdata/p4_14_samples_outputs/p414-special-ops-3-bmv2.p4 index 031587a112c..049c597bb46 100644 --- a/testdata/p4_14_samples_outputs/p414-special-ops-3-bmv2.p4 +++ b/testdata/p4_14_samples_outputs/p414-special-ops-3-bmv2.p4 @@ -16,14 +16,14 @@ struct intrinsic_metadata_t { } struct mymeta_t { - @field_list(FieldLists.resubmit_FL) + @field_list(FieldLists.resubmit_FL) bit<8> resubmit_count; - @field_list(FieldLists.recirculate_FL) + @field_list(FieldLists.recirculate_FL) bit<8> recirculate_count; - @field_list(FieldLists.clone_e2e_FL) + @field_list(FieldLists.clone_e2e_FL) bit<8> clone_e2e_count; bit<8> last_ing_instance_type; - @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) + @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) bit<8> f1; } @@ -38,14 +38,14 @@ header ethernet_t { } struct metadata { - @name(".mymeta") + @name(".mymeta") mymeta_t mymeta; - @name(".temporaries") + @name(".temporaries") temporaries_t temporaries; } struct headers { - @name(".ethernet") + @name(".ethernet") ethernet_t ethernet; } @@ -385,3 +385,4 @@ control computeChecksum(inout headers hdr, inout metadata meta) { } V1Switch(ParserImpl(), verifyChecksum(), ingress(), egress(), computeChecksum(), DeparserImpl()) main; + diff --git a/testdata/p4_14_samples_outputs/p414-special-ops-first.p4 b/testdata/p4_14_samples_outputs/p414-special-ops-first.p4 index 377848928ec..c71e31d4827 100644 --- a/testdata/p4_14_samples_outputs/p414-special-ops-first.p4 +++ b/testdata/p4_14_samples_outputs/p414-special-ops-first.p4 @@ -16,14 +16,14 @@ struct intrinsic_metadata_t { } struct mymeta_t { - @field_list(FieldLists.resubmit_FL) + @field_list(FieldLists.resubmit_FL) bit<8> resubmit_count; - @field_list(FieldLists.recirculate_FL) + @field_list(FieldLists.recirculate_FL) bit<8> recirculate_count; - @field_list(FieldLists.clone_e2e_FL) + @field_list(FieldLists.clone_e2e_FL) bit<8> clone_e2e_count; bit<8> last_ing_instance_type; - @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) + @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) bit<8> f1; } @@ -38,14 +38,14 @@ header ethernet_t { } struct metadata { - @name(".mymeta") + @name(".mymeta") mymeta_t mymeta; - @name(".temporaries") + @name(".temporaries") temporaries_t temporaries; } struct headers { - @name(".ethernet") + @name(".ethernet") ethernet_t ethernet; } @@ -356,3 +356,4 @@ control computeChecksum(inout headers hdr, inout metadata meta) { } V1Switch(ParserImpl(), verifyChecksum(), ingress(), egress(), computeChecksum(), DeparserImpl()) main; + diff --git a/testdata/p4_14_samples_outputs/p414-special-ops-frontend.p4 b/testdata/p4_14_samples_outputs/p414-special-ops-frontend.p4 index bd8ecec07c6..a3a27db3217 100644 --- a/testdata/p4_14_samples_outputs/p414-special-ops-frontend.p4 +++ b/testdata/p4_14_samples_outputs/p414-special-ops-frontend.p4 @@ -16,14 +16,14 @@ struct intrinsic_metadata_t { } struct mymeta_t { - @field_list(FieldLists.resubmit_FL) + @field_list(FieldLists.resubmit_FL) bit<8> resubmit_count; - @field_list(FieldLists.recirculate_FL) + @field_list(FieldLists.recirculate_FL) bit<8> recirculate_count; - @field_list(FieldLists.clone_e2e_FL) + @field_list(FieldLists.clone_e2e_FL) bit<8> clone_e2e_count; bit<8> last_ing_instance_type; - @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) + @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) bit<8> f1; } @@ -38,14 +38,14 @@ header ethernet_t { } struct metadata { - @name(".mymeta") + @name(".mymeta") mymeta_t mymeta; - @name(".temporaries") + @name(".temporaries") temporaries_t temporaries; } struct headers { - @name(".ethernet") + @name(".ethernet") ethernet_t ethernet; } @@ -387,3 +387,4 @@ control computeChecksum(inout headers hdr, inout metadata meta) { } V1Switch(ParserImpl(), verifyChecksum(), ingress(), egress(), computeChecksum(), DeparserImpl()) main; + diff --git a/testdata/p4_14_samples_outputs/p414-special-ops-midend.p4 b/testdata/p4_14_samples_outputs/p414-special-ops-midend.p4 index 6dfcc70babb..80865271f74 100644 --- a/testdata/p4_14_samples_outputs/p414-special-ops-midend.p4 +++ b/testdata/p4_14_samples_outputs/p414-special-ops-midend.p4 @@ -10,14 +10,14 @@ struct intrinsic_metadata_t { } struct mymeta_t { - @field_list(8w2) + @field_list(8w2) bit<8> resubmit_count; - @field_list(8w1) + @field_list(8w1) bit<8> recirculate_count; - @field_list(8w0) + @field_list(8w0) bit<8> clone_e2e_count; bit<8> last_ing_instance_type; - @field_list(8w0, 8w1, 8w2) + @field_list(8w0, 8w1, 8w2) bit<8> f1; } @@ -32,20 +32,20 @@ header ethernet_t { } struct metadata { - @field_list(8w2) + @field_list(8w2) bit<8> _mymeta_resubmit_count0; - @field_list(8w1) + @field_list(8w1) bit<8> _mymeta_recirculate_count1; - @field_list(8w0) + @field_list(8w0) bit<8> _mymeta_clone_e2e_count2; bit<8> _mymeta_last_ing_instance_type3; - @field_list(8w0, 8w1, 8w2) + @field_list(8w0, 8w1, 8w2) bit<8> _mymeta_f14; bit<48> _temporaries_temp15; } struct headers { - @name(".ethernet") + @name(".ethernet") ethernet_t ethernet; } @@ -387,3 +387,4 @@ control computeChecksum(inout headers hdr, inout metadata meta) { } V1Switch(ParserImpl(), verifyChecksum(), ingress(), egress(), computeChecksum(), DeparserImpl()) main; + diff --git a/testdata/p4_14_samples_outputs/p414-special-ops.p4 b/testdata/p4_14_samples_outputs/p414-special-ops.p4 index 8cef4098714..c1012e9f2df 100644 --- a/testdata/p4_14_samples_outputs/p414-special-ops.p4 +++ b/testdata/p4_14_samples_outputs/p414-special-ops.p4 @@ -16,14 +16,14 @@ struct intrinsic_metadata_t { } struct mymeta_t { - @field_list(FieldLists.resubmit_FL) + @field_list(FieldLists.resubmit_FL) bit<8> resubmit_count; - @field_list(FieldLists.recirculate_FL) + @field_list(FieldLists.recirculate_FL) bit<8> recirculate_count; - @field_list(FieldLists.clone_e2e_FL) + @field_list(FieldLists.clone_e2e_FL) bit<8> clone_e2e_count; bit<8> last_ing_instance_type; - @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) + @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) bit<8> f1; } @@ -38,14 +38,14 @@ header ethernet_t { } struct metadata { - @name(".mymeta") + @name(".mymeta") mymeta_t mymeta; - @name(".temporaries") + @name(".temporaries") temporaries_t temporaries; } struct headers { - @name(".ethernet") + @name(".ethernet") ethernet_t ethernet; } @@ -360,3 +360,4 @@ control computeChecksum(inout headers hdr, inout metadata meta) { } V1Switch(ParserImpl(), verifyChecksum(), ingress(), egress(), computeChecksum(), DeparserImpl()) main; + diff --git a/testdata/p4_14_samples_outputs/packet_redirect-first.p4 b/testdata/p4_14_samples_outputs/packet_redirect-first.p4 index 0efa358d4e2..9c03d639bc1 100644 --- a/testdata/p4_14_samples_outputs/packet_redirect-first.p4 +++ b/testdata/p4_14_samples_outputs/packet_redirect-first.p4 @@ -13,9 +13,9 @@ struct intrinsic_metadata_t { } struct metaA_t { - @field_list(FieldLists.redirect_FL) + @field_list(FieldLists.redirect_FL) bit<8> f1; - @field_list(FieldLists.redirect_FL) + @field_list(FieldLists.redirect_FL) bit<8> f2; } @@ -30,14 +30,14 @@ header hdrA_t { } struct metadata { - @name(".metaA") + @name(".metaA") metaA_t metaA; - @name(".metaB") + @name(".metaB") metaB_t metaB; } struct headers { - @name(".hdrA") + @name(".hdrA") hdrA_t hdrA; } @@ -143,3 +143,4 @@ control computeChecksum(inout headers hdr, inout metadata meta) { } V1Switch(ParserImpl(), verifyChecksum(), ingress(), egress(), computeChecksum(), DeparserImpl()) main; + diff --git a/testdata/p4_14_samples_outputs/packet_redirect-frontend.p4 b/testdata/p4_14_samples_outputs/packet_redirect-frontend.p4 index 65a6aad4903..21841f449b2 100644 --- a/testdata/p4_14_samples_outputs/packet_redirect-frontend.p4 +++ b/testdata/p4_14_samples_outputs/packet_redirect-frontend.p4 @@ -13,9 +13,9 @@ struct intrinsic_metadata_t { } struct metaA_t { - @field_list(FieldLists.redirect_FL) + @field_list(FieldLists.redirect_FL) bit<8> f1; - @field_list(FieldLists.redirect_FL) + @field_list(FieldLists.redirect_FL) bit<8> f2; } @@ -30,14 +30,14 @@ header hdrA_t { } struct metadata { - @name(".metaA") + @name(".metaA") metaA_t metaA; - @name(".metaB") + @name(".metaB") metaB_t metaB; } struct headers { - @name(".hdrA") + @name(".hdrA") hdrA_t hdrA; } @@ -151,3 +151,4 @@ control computeChecksum(inout headers hdr, inout metadata meta) { } V1Switch(ParserImpl(), verifyChecksum(), ingress(), egress(), computeChecksum(), DeparserImpl()) main; + diff --git a/testdata/p4_14_samples_outputs/packet_redirect-midend.p4 b/testdata/p4_14_samples_outputs/packet_redirect-midend.p4 index 153ab27d883..e96b444eb2c 100644 --- a/testdata/p4_14_samples_outputs/packet_redirect-midend.p4 +++ b/testdata/p4_14_samples_outputs/packet_redirect-midend.p4 @@ -9,9 +9,9 @@ struct intrinsic_metadata_t { } struct metaA_t { - @field_list(8w0) + @field_list(8w0) bit<8> f1; - @field_list(8w0) + @field_list(8w0) bit<8> f2; } @@ -26,16 +26,16 @@ header hdrA_t { } struct metadata { - @field_list(8w0) + @field_list(8w0) bit<8> _metaA_f10; - @field_list(8w0) + @field_list(8w0) bit<8> _metaA_f21; bit<8> _metaB_f12; bit<8> _metaB_f23; } struct headers { - @name(".hdrA") + @name(".hdrA") hdrA_t hdrA; } @@ -149,3 +149,4 @@ control computeChecksum(inout headers hdr, inout metadata meta) { } V1Switch(ParserImpl(), verifyChecksum(), ingress(), egress(), computeChecksum(), DeparserImpl()) main; + diff --git a/testdata/p4_14_samples_outputs/packet_redirect.p4 b/testdata/p4_14_samples_outputs/packet_redirect.p4 index 57c191464a4..e38910b5457 100644 --- a/testdata/p4_14_samples_outputs/packet_redirect.p4 +++ b/testdata/p4_14_samples_outputs/packet_redirect.p4 @@ -13,9 +13,9 @@ struct intrinsic_metadata_t { } struct metaA_t { - @field_list(FieldLists.redirect_FL) + @field_list(FieldLists.redirect_FL) bit<8> f1; - @field_list(FieldLists.redirect_FL) + @field_list(FieldLists.redirect_FL) bit<8> f2; } @@ -30,14 +30,14 @@ header hdrA_t { } struct metadata { - @name(".metaA") + @name(".metaA") metaA_t metaA; - @name(".metaB") + @name(".metaB") metaB_t metaB; } struct headers { - @name(".hdrA") + @name(".hdrA") hdrA_t hdrA; } @@ -137,3 +137,4 @@ control computeChecksum(inout headers hdr, inout metadata meta) { } V1Switch(ParserImpl(), verifyChecksum(), ingress(), egress(), computeChecksum(), DeparserImpl()) main; + diff --git a/testdata/p4_14_samples_outputs/simple_nat-first.p4 b/testdata/p4_14_samples_outputs/simple_nat-first.p4 index a0764431d9b..2cf6355fb99 100644 --- a/testdata/p4_14_samples_outputs/simple_nat-first.p4 +++ b/testdata/p4_14_samples_outputs/simple_nat-first.p4 @@ -67,18 +67,18 @@ header tcp_t { } struct metadata { - @name(".meta") + @name(".meta") meta_t meta; } struct headers { - @name(".cpu_header") + @name(".cpu_header") cpu_header_t cpu_header; - @name(".ethernet") + @name(".ethernet") ethernet_t ethernet; - @name(".ipv4") + @name(".ipv4") ipv4_t ipv4; - @name(".tcp") + @name(".tcp") tcp_t tcp; } @@ -295,3 +295,4 @@ control computeChecksum(inout headers hdr, inout metadata meta) { } V1Switch(ParserImpl(), verifyChecksum(), ingress(), egress(), computeChecksum(), DeparserImpl()) main; + diff --git a/testdata/p4_14_samples_outputs/simple_nat-frontend.p4 b/testdata/p4_14_samples_outputs/simple_nat-frontend.p4 index 9115443aa44..d135f4199f5 100644 --- a/testdata/p4_14_samples_outputs/simple_nat-frontend.p4 +++ b/testdata/p4_14_samples_outputs/simple_nat-frontend.p4 @@ -67,18 +67,18 @@ header tcp_t { } struct metadata { - @name(".meta") + @name(".meta") meta_t meta; } struct headers { - @name(".cpu_header") + @name(".cpu_header") cpu_header_t cpu_header; - @name(".ethernet") + @name(".ethernet") ethernet_t ethernet; - @name(".ipv4") + @name(".ipv4") ipv4_t ipv4; - @name(".tcp") + @name(".tcp") tcp_t tcp; } @@ -320,3 +320,4 @@ control computeChecksum(inout headers hdr, inout metadata meta) { } V1Switch(ParserImpl(), verifyChecksum(), ingress(), egress(), computeChecksum(), DeparserImpl()) main; + diff --git a/testdata/p4_14_samples_outputs/simple_nat-midend.p4 b/testdata/p4_14_samples_outputs/simple_nat-midend.p4 index d7d2b3e64fc..04afed0231f 100644 --- a/testdata/p4_14_samples_outputs/simple_nat-midend.p4 +++ b/testdata/p4_14_samples_outputs/simple_nat-midend.p4 @@ -77,13 +77,13 @@ struct metadata { } struct headers { - @name(".cpu_header") + @name(".cpu_header") cpu_header_t cpu_header; - @name(".ethernet") + @name(".ethernet") ethernet_t ethernet; - @name(".ipv4") + @name(".ipv4") ipv4_t ipv4; - @name(".tcp") + @name(".tcp") tcp_t tcp; } @@ -354,3 +354,4 @@ control computeChecksum(inout headers hdr, inout metadata meta) { } V1Switch(ParserImpl(), verifyChecksum(), ingress(), egress(), computeChecksum(), DeparserImpl()) main; + diff --git a/testdata/p4_14_samples_outputs/simple_nat.p4 b/testdata/p4_14_samples_outputs/simple_nat.p4 index 5108e7cc524..b17ab81d709 100644 --- a/testdata/p4_14_samples_outputs/simple_nat.p4 +++ b/testdata/p4_14_samples_outputs/simple_nat.p4 @@ -67,18 +67,18 @@ header tcp_t { } struct metadata { - @name(".meta") + @name(".meta") meta_t meta; } struct headers { - @name(".cpu_header") + @name(".cpu_header") cpu_header_t cpu_header; - @name(".ethernet") + @name(".ethernet") ethernet_t ethernet; - @name(".ipv4") + @name(".ipv4") ipv4_t ipv4; - @name(".tcp") + @name(".tcp") tcp_t tcp; } @@ -283,3 +283,4 @@ control computeChecksum(inout headers hdr, inout metadata meta) { } V1Switch(ParserImpl(), verifyChecksum(), ingress(), egress(), computeChecksum(), DeparserImpl()) main; + diff --git a/testdata/p4_14_samples_outputs/switch_20160512/switch-first.p4 b/testdata/p4_14_samples_outputs/switch_20160512/switch-first.p4 index 540fd030179..2abcac62a76 100644 --- a/testdata/p4_14_samples_outputs/switch_20160512/switch-first.p4 +++ b/testdata/p4_14_samples_outputs/switch_20160512/switch-first.p4 @@ -49,7 +49,7 @@ struct egress_metadata_t { struct fabric_metadata_t { bit<3> packetType; bit<1> fabric_header_present; - @field_list(FieldLists.cpu_info, FieldLists.sflow_cpu_info) + @field_list(FieldLists.cpu_info, FieldLists.sflow_cpu_info) bit<16> reason_code; bit<8> dst_device; bit<16> dst_port; @@ -66,28 +66,28 @@ struct hash_metadata_t { } struct i2e_metadata_t { - @field_list(FieldLists.i2e_mirror_info, FieldLists.e2e_mirror_info) + @field_list(FieldLists.i2e_mirror_info, FieldLists.e2e_mirror_info) bit<32> ingress_tstamp; - @field_list(FieldLists.i2e_mirror_info, FieldLists.e2e_mirror_info, FieldLists.int_i2e_mirror_info) + @field_list(FieldLists.i2e_mirror_info, FieldLists.e2e_mirror_info, FieldLists.int_i2e_mirror_info) bit<16> mirror_session_id; } struct ingress_metadata_t { - @field_list(FieldLists.cpu_info, FieldLists.sflow_cpu_info) + @field_list(FieldLists.cpu_info, FieldLists.sflow_cpu_info) bit<9> ingress_port; - @field_list(FieldLists.cpu_info, FieldLists.mirror_info, FieldLists.sflow_cpu_info) + @field_list(FieldLists.cpu_info, FieldLists.mirror_info, FieldLists.sflow_cpu_info) bit<16> ifindex; bit<16> egress_ifindex; bit<2> port_type; bit<16> outer_bd; - @field_list(FieldLists.cpu_info, FieldLists.sflow_cpu_info) + @field_list(FieldLists.cpu_info, FieldLists.sflow_cpu_info) bit<16> bd; bit<1> drop_flag; - @field_list(FieldLists.mirror_info) + @field_list(FieldLists.mirror_info) bit<8> drop_reason; bit<1> control_frame; bit<16> bypass_lookups; - @saturating + @saturating bit<32> sflow_take_sample; } @@ -101,7 +101,7 @@ struct int_metadata_t { } struct int_metadata_i2e_t { - @field_list(FieldLists.int_i2e_mirror_info) + @field_list(FieldLists.int_i2e_mirror_info) bit<1> sink; bit<1> source; } @@ -172,7 +172,7 @@ struct l3_metadata_t { bit<1> outer_routed; bit<8> mtu_index; bit<1> l3_copy; - @saturating + @saturating bit<16> l3_mtu_check; } @@ -657,166 +657,166 @@ header vlan_tag_t { } struct metadata { - @name(".acl_metadata") + @name(".acl_metadata") acl_metadata_t acl_metadata; - @name(".egress_filter_metadata") + @name(".egress_filter_metadata") egress_filter_metadata_t egress_filter_metadata; - @name(".egress_metadata") + @name(".egress_metadata") egress_metadata_t egress_metadata; - @name(".fabric_metadata") + @name(".fabric_metadata") fabric_metadata_t fabric_metadata; - @name(".global_config_metadata") + @name(".global_config_metadata") global_config_metadata_t global_config_metadata; - @name(".hash_metadata") + @name(".hash_metadata") hash_metadata_t hash_metadata; - @name(".i2e_metadata") + @name(".i2e_metadata") i2e_metadata_t i2e_metadata; - @name(".ingress_metadata") + @name(".ingress_metadata") ingress_metadata_t ingress_metadata; - @name(".int_metadata") + @name(".int_metadata") int_metadata_t int_metadata; - @name(".int_metadata_i2e") + @name(".int_metadata_i2e") int_metadata_i2e_t int_metadata_i2e; - @name(".ipv4_metadata") + @name(".ipv4_metadata") ipv4_metadata_t ipv4_metadata; - @name(".ipv6_metadata") + @name(".ipv6_metadata") ipv6_metadata_t ipv6_metadata; - @name(".l2_metadata") + @name(".l2_metadata") l2_metadata_t l2_metadata; - @name(".l3_metadata") + @name(".l3_metadata") l3_metadata_t l3_metadata; - @name(".meter_metadata") + @name(".meter_metadata") meter_metadata_t meter_metadata; - @name(".multicast_metadata") + @name(".multicast_metadata") multicast_metadata_t multicast_metadata; - @name(".nexthop_metadata") + @name(".nexthop_metadata") nexthop_metadata_t nexthop_metadata; - @name(".qos_metadata") + @name(".qos_metadata") qos_metadata_t qos_metadata; - @name(".security_metadata") + @name(".security_metadata") security_metadata_t security_metadata; - @name(".sflow_metadata") + @name(".sflow_metadata") sflow_meta_t sflow_metadata; - @name(".tunnel_metadata") + @name(".tunnel_metadata") tunnel_metadata_t tunnel_metadata; } struct headers { - @name(".arp_rarp") + @name(".arp_rarp") arp_rarp_t arp_rarp; - @name(".arp_rarp_ipv4") + @name(".arp_rarp_ipv4") arp_rarp_ipv4_t arp_rarp_ipv4; - @name(".bfd") + @name(".bfd") bfd_t bfd; - @name(".eompls") + @name(".eompls") eompls_t eompls; - @name(".erspan_t3_header") + @name(".erspan_t3_header") erspan_header_t3_t_0 erspan_t3_header; - @name(".ethernet") + @name(".ethernet") ethernet_t ethernet; - @name(".fabric_header") + @name(".fabric_header") fabric_header_t fabric_header; - @name(".fabric_header_cpu") + @name(".fabric_header_cpu") fabric_header_cpu_t fabric_header_cpu; - @name(".fabric_header_mirror") + @name(".fabric_header_mirror") fabric_header_mirror_t fabric_header_mirror; - @name(".fabric_header_multicast") + @name(".fabric_header_multicast") fabric_header_multicast_t fabric_header_multicast; - @name(".fabric_header_sflow") + @name(".fabric_header_sflow") fabric_header_sflow_t fabric_header_sflow; - @name(".fabric_header_unicast") + @name(".fabric_header_unicast") fabric_header_unicast_t fabric_header_unicast; - @name(".fabric_payload_header") + @name(".fabric_payload_header") fabric_payload_header_t fabric_payload_header; - @name(".fcoe") + @name(".fcoe") fcoe_header_t fcoe; - @name(".genv") + @name(".genv") genv_t genv; - @name(".gre") + @name(".gre") gre_t gre; - @name(".icmp") + @name(".icmp") icmp_t icmp; - @name(".inner_ethernet") + @name(".inner_ethernet") ethernet_t inner_ethernet; - @name(".inner_icmp") + @name(".inner_icmp") icmp_t inner_icmp; - @name(".inner_ipv4") + @name(".inner_ipv4") ipv4_t inner_ipv4; - @name(".inner_ipv6") + @name(".inner_ipv6") ipv6_t inner_ipv6; - @name(".inner_sctp") + @name(".inner_sctp") sctp_t inner_sctp; - @name(".inner_tcp") + @name(".inner_tcp") tcp_t inner_tcp; - @name(".inner_udp") + @name(".inner_udp") udp_t inner_udp; - @name(".int_egress_port_id_header") + @name(".int_egress_port_id_header") int_egress_port_id_header_t int_egress_port_id_header; - @name(".int_egress_port_tx_utilization_header") + @name(".int_egress_port_tx_utilization_header") int_egress_port_tx_utilization_header_t int_egress_port_tx_utilization_header; - @name(".int_header") + @name(".int_header") int_header_t int_header; - @name(".int_hop_latency_header") + @name(".int_hop_latency_header") int_hop_latency_header_t int_hop_latency_header; - @name(".int_ingress_port_id_header") + @name(".int_ingress_port_id_header") int_ingress_port_id_header_t int_ingress_port_id_header; - @name(".int_ingress_tstamp_header") + @name(".int_ingress_tstamp_header") int_ingress_tstamp_header_t int_ingress_tstamp_header; - @name(".int_q_congestion_header") + @name(".int_q_congestion_header") int_q_congestion_header_t int_q_congestion_header; - @name(".int_q_occupancy_header") + @name(".int_q_occupancy_header") int_q_occupancy_header_t int_q_occupancy_header; - @name(".int_switch_id_header") + @name(".int_switch_id_header") int_switch_id_header_t int_switch_id_header; - @name(".ipv4") + @name(".ipv4") ipv4_t ipv4; - @name(".ipv6") + @name(".ipv6") ipv6_t ipv6; - @name(".lisp") + @name(".lisp") lisp_t lisp; - @name(".llc_header") + @name(".llc_header") llc_header_t llc_header; - @name(".nsh") + @name(".nsh") nsh_t nsh; - @name(".nsh_context") + @name(".nsh_context") nsh_context_t nsh_context; - @name(".nvgre") + @name(".nvgre") nvgre_t nvgre; - @name(".outer_udp") + @name(".outer_udp") udp_t outer_udp; - @name(".roce") + @name(".roce") roce_header_t roce; - @name(".roce_v2") + @name(".roce_v2") roce_v2_header_t roce_v2; - @name(".sctp") + @name(".sctp") sctp_t sctp; - @name(".sflow") + @name(".sflow") sflow_hdr_t sflow; - @name(".sflow_raw_hdr_record") + @name(".sflow_raw_hdr_record") sflow_raw_hdr_record_t sflow_raw_hdr_record; - @name(".sflow_sample") + @name(".sflow_sample") sflow_sample_t sflow_sample; - @name(".snap_header") + @name(".snap_header") snap_header_t snap_header; - @name(".tcp") + @name(".tcp") tcp_t tcp; - @name(".trill") + @name(".trill") trill_t trill; - @name(".udp") + @name(".udp") udp_t udp; - @name(".vntag") + @name(".vntag") vntag_t vntag; - @name(".vxlan") + @name(".vxlan") vxlan_t vxlan; - @name(".vxlan_gpe") + @name(".vxlan_gpe") vxlan_gpe_t vxlan_gpe; - @name(".vxlan_gpe_int_header") + @name(".vxlan_gpe_int_header") vxlan_gpe_int_header_t vxlan_gpe_int_header; - @name(".int_val") + @name(".int_val") int_value_t[24] int_val; - @name(".mpls") + @name(".mpls") mpls_t[3] mpls; - @name(".vlan_tag_") + @name(".vlan_tag_") vlan_tag_t[2] vlan_tag_; } @@ -6120,3 +6120,4 @@ control computeChecksum(inout headers hdr, inout metadata meta) { } V1Switch(ParserImpl(), verifyChecksum(), ingress(), egress(), computeChecksum(), DeparserImpl()) main; + diff --git a/testdata/p4_14_samples_outputs/switch_20160512/switch-frontend.p4 b/testdata/p4_14_samples_outputs/switch_20160512/switch-frontend.p4 index a03dfc942d7..b6e37d1c13c 100644 --- a/testdata/p4_14_samples_outputs/switch_20160512/switch-frontend.p4 +++ b/testdata/p4_14_samples_outputs/switch_20160512/switch-frontend.p4 @@ -49,7 +49,7 @@ struct egress_metadata_t { struct fabric_metadata_t { bit<3> packetType; bit<1> fabric_header_present; - @field_list(FieldLists.cpu_info, FieldLists.sflow_cpu_info) + @field_list(FieldLists.cpu_info, FieldLists.sflow_cpu_info) bit<16> reason_code; bit<8> dst_device; bit<16> dst_port; @@ -66,28 +66,28 @@ struct hash_metadata_t { } struct i2e_metadata_t { - @field_list(FieldLists.i2e_mirror_info, FieldLists.e2e_mirror_info) + @field_list(FieldLists.i2e_mirror_info, FieldLists.e2e_mirror_info) bit<32> ingress_tstamp; - @field_list(FieldLists.i2e_mirror_info, FieldLists.e2e_mirror_info, FieldLists.int_i2e_mirror_info) + @field_list(FieldLists.i2e_mirror_info, FieldLists.e2e_mirror_info, FieldLists.int_i2e_mirror_info) bit<16> mirror_session_id; } struct ingress_metadata_t { - @field_list(FieldLists.cpu_info, FieldLists.sflow_cpu_info) + @field_list(FieldLists.cpu_info, FieldLists.sflow_cpu_info) bit<9> ingress_port; - @field_list(FieldLists.cpu_info, FieldLists.mirror_info, FieldLists.sflow_cpu_info) + @field_list(FieldLists.cpu_info, FieldLists.mirror_info, FieldLists.sflow_cpu_info) bit<16> ifindex; bit<16> egress_ifindex; bit<2> port_type; bit<16> outer_bd; - @field_list(FieldLists.cpu_info, FieldLists.sflow_cpu_info) + @field_list(FieldLists.cpu_info, FieldLists.sflow_cpu_info) bit<16> bd; bit<1> drop_flag; - @field_list(FieldLists.mirror_info) + @field_list(FieldLists.mirror_info) bit<8> drop_reason; bit<1> control_frame; bit<16> bypass_lookups; - @saturating + @saturating bit<32> sflow_take_sample; } @@ -101,7 +101,7 @@ struct int_metadata_t { } struct int_metadata_i2e_t { - @field_list(FieldLists.int_i2e_mirror_info) + @field_list(FieldLists.int_i2e_mirror_info) bit<1> sink; bit<1> source; } @@ -172,7 +172,7 @@ struct l3_metadata_t { bit<1> outer_routed; bit<8> mtu_index; bit<1> l3_copy; - @saturating + @saturating bit<16> l3_mtu_check; } @@ -657,166 +657,166 @@ header vlan_tag_t { } struct metadata { - @name(".acl_metadata") + @name(".acl_metadata") acl_metadata_t acl_metadata; - @name(".egress_filter_metadata") + @name(".egress_filter_metadata") egress_filter_metadata_t egress_filter_metadata; - @name(".egress_metadata") + @name(".egress_metadata") egress_metadata_t egress_metadata; - @name(".fabric_metadata") + @name(".fabric_metadata") fabric_metadata_t fabric_metadata; - @name(".global_config_metadata") + @name(".global_config_metadata") global_config_metadata_t global_config_metadata; - @name(".hash_metadata") + @name(".hash_metadata") hash_metadata_t hash_metadata; - @name(".i2e_metadata") + @name(".i2e_metadata") i2e_metadata_t i2e_metadata; - @name(".ingress_metadata") + @name(".ingress_metadata") ingress_metadata_t ingress_metadata; - @name(".int_metadata") + @name(".int_metadata") int_metadata_t int_metadata; - @name(".int_metadata_i2e") + @name(".int_metadata_i2e") int_metadata_i2e_t int_metadata_i2e; - @name(".ipv4_metadata") + @name(".ipv4_metadata") ipv4_metadata_t ipv4_metadata; - @name(".ipv6_metadata") + @name(".ipv6_metadata") ipv6_metadata_t ipv6_metadata; - @name(".l2_metadata") + @name(".l2_metadata") l2_metadata_t l2_metadata; - @name(".l3_metadata") + @name(".l3_metadata") l3_metadata_t l3_metadata; - @name(".meter_metadata") + @name(".meter_metadata") meter_metadata_t meter_metadata; - @name(".multicast_metadata") + @name(".multicast_metadata") multicast_metadata_t multicast_metadata; - @name(".nexthop_metadata") + @name(".nexthop_metadata") nexthop_metadata_t nexthop_metadata; - @name(".qos_metadata") + @name(".qos_metadata") qos_metadata_t qos_metadata; - @name(".security_metadata") + @name(".security_metadata") security_metadata_t security_metadata; - @name(".sflow_metadata") + @name(".sflow_metadata") sflow_meta_t sflow_metadata; - @name(".tunnel_metadata") + @name(".tunnel_metadata") tunnel_metadata_t tunnel_metadata; } struct headers { - @name(".arp_rarp") + @name(".arp_rarp") arp_rarp_t arp_rarp; - @name(".arp_rarp_ipv4") + @name(".arp_rarp_ipv4") arp_rarp_ipv4_t arp_rarp_ipv4; - @name(".bfd") + @name(".bfd") bfd_t bfd; - @name(".eompls") + @name(".eompls") eompls_t eompls; - @name(".erspan_t3_header") + @name(".erspan_t3_header") erspan_header_t3_t_0 erspan_t3_header; - @name(".ethernet") + @name(".ethernet") ethernet_t ethernet; - @name(".fabric_header") + @name(".fabric_header") fabric_header_t fabric_header; - @name(".fabric_header_cpu") + @name(".fabric_header_cpu") fabric_header_cpu_t fabric_header_cpu; - @name(".fabric_header_mirror") + @name(".fabric_header_mirror") fabric_header_mirror_t fabric_header_mirror; - @name(".fabric_header_multicast") + @name(".fabric_header_multicast") fabric_header_multicast_t fabric_header_multicast; - @name(".fabric_header_sflow") + @name(".fabric_header_sflow") fabric_header_sflow_t fabric_header_sflow; - @name(".fabric_header_unicast") + @name(".fabric_header_unicast") fabric_header_unicast_t fabric_header_unicast; - @name(".fabric_payload_header") + @name(".fabric_payload_header") fabric_payload_header_t fabric_payload_header; - @name(".fcoe") + @name(".fcoe") fcoe_header_t fcoe; - @name(".genv") + @name(".genv") genv_t genv; - @name(".gre") + @name(".gre") gre_t gre; - @name(".icmp") + @name(".icmp") icmp_t icmp; - @name(".inner_ethernet") + @name(".inner_ethernet") ethernet_t inner_ethernet; - @name(".inner_icmp") + @name(".inner_icmp") icmp_t inner_icmp; - @name(".inner_ipv4") + @name(".inner_ipv4") ipv4_t inner_ipv4; - @name(".inner_ipv6") + @name(".inner_ipv6") ipv6_t inner_ipv6; - @name(".inner_sctp") + @name(".inner_sctp") sctp_t inner_sctp; - @name(".inner_tcp") + @name(".inner_tcp") tcp_t inner_tcp; - @name(".inner_udp") + @name(".inner_udp") udp_t inner_udp; - @name(".int_egress_port_id_header") + @name(".int_egress_port_id_header") int_egress_port_id_header_t int_egress_port_id_header; - @name(".int_egress_port_tx_utilization_header") + @name(".int_egress_port_tx_utilization_header") int_egress_port_tx_utilization_header_t int_egress_port_tx_utilization_header; - @name(".int_header") + @name(".int_header") int_header_t int_header; - @name(".int_hop_latency_header") + @name(".int_hop_latency_header") int_hop_latency_header_t int_hop_latency_header; - @name(".int_ingress_port_id_header") + @name(".int_ingress_port_id_header") int_ingress_port_id_header_t int_ingress_port_id_header; - @name(".int_ingress_tstamp_header") + @name(".int_ingress_tstamp_header") int_ingress_tstamp_header_t int_ingress_tstamp_header; - @name(".int_q_congestion_header") + @name(".int_q_congestion_header") int_q_congestion_header_t int_q_congestion_header; - @name(".int_q_occupancy_header") + @name(".int_q_occupancy_header") int_q_occupancy_header_t int_q_occupancy_header; - @name(".int_switch_id_header") + @name(".int_switch_id_header") int_switch_id_header_t int_switch_id_header; - @name(".ipv4") + @name(".ipv4") ipv4_t ipv4; - @name(".ipv6") + @name(".ipv6") ipv6_t ipv6; - @name(".lisp") + @name(".lisp") lisp_t lisp; - @name(".llc_header") + @name(".llc_header") llc_header_t llc_header; - @name(".nsh") + @name(".nsh") nsh_t nsh; - @name(".nsh_context") + @name(".nsh_context") nsh_context_t nsh_context; - @name(".nvgre") + @name(".nvgre") nvgre_t nvgre; - @name(".outer_udp") + @name(".outer_udp") udp_t outer_udp; - @name(".roce") + @name(".roce") roce_header_t roce; - @name(".roce_v2") + @name(".roce_v2") roce_v2_header_t roce_v2; - @name(".sctp") + @name(".sctp") sctp_t sctp; - @name(".sflow") + @name(".sflow") sflow_hdr_t sflow; - @name(".sflow_raw_hdr_record") + @name(".sflow_raw_hdr_record") sflow_raw_hdr_record_t sflow_raw_hdr_record; - @name(".sflow_sample") + @name(".sflow_sample") sflow_sample_t sflow_sample; - @name(".snap_header") + @name(".snap_header") snap_header_t snap_header; - @name(".tcp") + @name(".tcp") tcp_t tcp; - @name(".trill") + @name(".trill") trill_t trill; - @name(".udp") + @name(".udp") udp_t udp; - @name(".vntag") + @name(".vntag") vntag_t vntag; - @name(".vxlan") + @name(".vxlan") vxlan_t vxlan; - @name(".vxlan_gpe") + @name(".vxlan_gpe") vxlan_gpe_t vxlan_gpe; - @name(".vxlan_gpe_int_header") + @name(".vxlan_gpe_int_header") vxlan_gpe_int_header_t vxlan_gpe_int_header; - @name(".int_val") + @name(".int_val") int_value_t[24] int_val; - @name(".mpls") + @name(".mpls") mpls_t[3] mpls; - @name(".vlan_tag_") + @name(".vlan_tag_") vlan_tag_t[2] vlan_tag_; } @@ -6009,3 +6009,4 @@ control computeChecksum(inout headers hdr, inout metadata meta) { } V1Switch(ParserImpl(), verifyChecksum(), ingress(), egress(), computeChecksum(), DeparserImpl()) main; + diff --git a/testdata/p4_14_samples_outputs/switch_20160512/switch-midend.p4 b/testdata/p4_14_samples_outputs/switch_20160512/switch-midend.p4 index a05580d4dec..1b3bf331856 100644 --- a/testdata/p4_14_samples_outputs/switch_20160512/switch-midend.p4 +++ b/testdata/p4_14_samples_outputs/switch_20160512/switch-midend.p4 @@ -40,7 +40,7 @@ struct egress_metadata_t { struct fabric_metadata_t { bit<3> packetType; bit<1> fabric_header_present; - @field_list(8w1, 8w5) + @field_list(8w1, 8w5) bit<16> reason_code; bit<8> dst_device; bit<16> dst_port; @@ -57,28 +57,28 @@ struct hash_metadata_t { } struct i2e_metadata_t { - @field_list(8w0, 8w2) + @field_list(8w0, 8w2) bit<32> ingress_tstamp; - @field_list(8w0, 8w2, 8w3) + @field_list(8w0, 8w2, 8w3) bit<16> mirror_session_id; } struct ingress_metadata_t { - @field_list(8w1, 8w5) + @field_list(8w1, 8w5) bit<9> ingress_port; - @field_list(8w1, 8w4, 8w5) + @field_list(8w1, 8w4, 8w5) bit<16> ifindex; bit<16> egress_ifindex; bit<2> port_type; bit<16> outer_bd; - @field_list(8w1, 8w5) + @field_list(8w1, 8w5) bit<16> bd; bit<1> drop_flag; - @field_list(8w4) + @field_list(8w4) bit<8> drop_reason; bit<1> control_frame; bit<16> bypass_lookups; - @saturating + @saturating bit<32> sflow_take_sample; } @@ -92,7 +92,7 @@ struct int_metadata_t { } struct int_metadata_i2e_t { - @field_list(8w3) + @field_list(8w3) bit<1> sink; bit<1> source; } @@ -163,7 +163,7 @@ struct l3_metadata_t { bit<1> outer_routed; bit<8> mtu_index; bit<1> l3_copy; - @saturating + @saturating bit<16> l3_mtu_check; } @@ -676,7 +676,7 @@ struct metadata { bit<16> _egress_metadata_ifindex25; bit<3> _fabric_metadata_packetType26; bit<1> _fabric_metadata_fabric_header_present27; - @field_list(8w1, 8w5) + @field_list(8w1, 8w5) bit<16> _fabric_metadata_reason_code28; bit<8> _fabric_metadata_dst_device29; bit<16> _fabric_metadata_dst_port30; @@ -684,25 +684,25 @@ struct metadata { bit<16> _hash_metadata_hash132; bit<16> _hash_metadata_hash233; bit<16> _hash_metadata_entropy_hash34; - @field_list(8w0, 8w2) + @field_list(8w0, 8w2) bit<32> _i2e_metadata_ingress_tstamp35; - @field_list(8w0, 8w2, 8w3) + @field_list(8w0, 8w2, 8w3) bit<16> _i2e_metadata_mirror_session_id36; - @field_list(8w1, 8w5) + @field_list(8w1, 8w5) bit<9> _ingress_metadata_ingress_port37; - @field_list(8w1, 8w4, 8w5) + @field_list(8w1, 8w4, 8w5) bit<16> _ingress_metadata_ifindex38; bit<16> _ingress_metadata_egress_ifindex39; bit<2> _ingress_metadata_port_type40; bit<16> _ingress_metadata_outer_bd41; - @field_list(8w1, 8w5) + @field_list(8w1, 8w5) bit<16> _ingress_metadata_bd42; bit<1> _ingress_metadata_drop_flag43; - @field_list(8w4) + @field_list(8w4) bit<8> _ingress_metadata_drop_reason44; bit<1> _ingress_metadata_control_frame45; bit<16> _ingress_metadata_bypass_lookups46; - @saturating + @saturating bit<32> _ingress_metadata_sflow_take_sample47; bit<32> _int_metadata_switch_id48; bit<8> _int_metadata_insert_cnt49; @@ -710,7 +710,7 @@ struct metadata { bit<16> _int_metadata_gpe_int_hdr_len51; bit<8> _int_metadata_gpe_int_hdr_len852; bit<16> _int_metadata_instruction_cnt53; - @field_list(8w3) + @field_list(8w3) bit<1> _int_metadata_i2e_sink54; bit<1> _int_metadata_i2e_source55; bit<32> _ipv4_metadata_lkp_ipv4_sa56; @@ -762,7 +762,7 @@ struct metadata { bit<1> _l3_metadata_outer_routed102; bit<8> _l3_metadata_mtu_index103; bit<1> _l3_metadata_l3_copy104; - @saturating + @saturating bit<16> _l3_metadata_l3_mtu_check105; bit<2> _meter_metadata_meter_color106; bit<16> _meter_metadata_meter_index107; @@ -815,121 +815,121 @@ struct metadata { } struct headers { - @name(".arp_rarp") + @name(".arp_rarp") arp_rarp_t arp_rarp; - @name(".arp_rarp_ipv4") + @name(".arp_rarp_ipv4") arp_rarp_ipv4_t arp_rarp_ipv4; - @name(".bfd") + @name(".bfd") bfd_t bfd; - @name(".eompls") + @name(".eompls") eompls_t eompls; - @name(".erspan_t3_header") + @name(".erspan_t3_header") erspan_header_t3_t_0 erspan_t3_header; - @name(".ethernet") + @name(".ethernet") ethernet_t ethernet; - @name(".fabric_header") + @name(".fabric_header") fabric_header_t fabric_header; - @name(".fabric_header_cpu") + @name(".fabric_header_cpu") fabric_header_cpu_t fabric_header_cpu; - @name(".fabric_header_mirror") + @name(".fabric_header_mirror") fabric_header_mirror_t fabric_header_mirror; - @name(".fabric_header_multicast") + @name(".fabric_header_multicast") fabric_header_multicast_t fabric_header_multicast; - @name(".fabric_header_sflow") + @name(".fabric_header_sflow") fabric_header_sflow_t fabric_header_sflow; - @name(".fabric_header_unicast") + @name(".fabric_header_unicast") fabric_header_unicast_t fabric_header_unicast; - @name(".fabric_payload_header") + @name(".fabric_payload_header") fabric_payload_header_t fabric_payload_header; - @name(".fcoe") + @name(".fcoe") fcoe_header_t fcoe; - @name(".genv") + @name(".genv") genv_t genv; - @name(".gre") + @name(".gre") gre_t gre; - @name(".icmp") + @name(".icmp") icmp_t icmp; - @name(".inner_ethernet") + @name(".inner_ethernet") ethernet_t inner_ethernet; - @name(".inner_icmp") + @name(".inner_icmp") icmp_t inner_icmp; - @name(".inner_ipv4") + @name(".inner_ipv4") ipv4_t inner_ipv4; - @name(".inner_ipv6") + @name(".inner_ipv6") ipv6_t inner_ipv6; - @name(".inner_sctp") + @name(".inner_sctp") sctp_t inner_sctp; - @name(".inner_tcp") + @name(".inner_tcp") tcp_t inner_tcp; - @name(".inner_udp") + @name(".inner_udp") udp_t inner_udp; - @name(".int_egress_port_id_header") + @name(".int_egress_port_id_header") int_egress_port_id_header_t int_egress_port_id_header; - @name(".int_egress_port_tx_utilization_header") + @name(".int_egress_port_tx_utilization_header") int_egress_port_tx_utilization_header_t int_egress_port_tx_utilization_header; - @name(".int_header") + @name(".int_header") int_header_t int_header; - @name(".int_hop_latency_header") + @name(".int_hop_latency_header") int_hop_latency_header_t int_hop_latency_header; - @name(".int_ingress_port_id_header") + @name(".int_ingress_port_id_header") int_ingress_port_id_header_t int_ingress_port_id_header; - @name(".int_ingress_tstamp_header") + @name(".int_ingress_tstamp_header") int_ingress_tstamp_header_t int_ingress_tstamp_header; - @name(".int_q_congestion_header") + @name(".int_q_congestion_header") int_q_congestion_header_t int_q_congestion_header; - @name(".int_q_occupancy_header") + @name(".int_q_occupancy_header") int_q_occupancy_header_t int_q_occupancy_header; - @name(".int_switch_id_header") + @name(".int_switch_id_header") int_switch_id_header_t int_switch_id_header; - @name(".ipv4") + @name(".ipv4") ipv4_t ipv4; - @name(".ipv6") + @name(".ipv6") ipv6_t ipv6; - @name(".lisp") + @name(".lisp") lisp_t lisp; - @name(".llc_header") + @name(".llc_header") llc_header_t llc_header; - @name(".nsh") + @name(".nsh") nsh_t nsh; - @name(".nsh_context") + @name(".nsh_context") nsh_context_t nsh_context; - @name(".nvgre") + @name(".nvgre") nvgre_t nvgre; - @name(".outer_udp") + @name(".outer_udp") udp_t outer_udp; - @name(".roce") + @name(".roce") roce_header_t roce; - @name(".roce_v2") + @name(".roce_v2") roce_v2_header_t roce_v2; - @name(".sctp") + @name(".sctp") sctp_t sctp; - @name(".sflow") + @name(".sflow") sflow_hdr_t sflow; - @name(".sflow_raw_hdr_record") + @name(".sflow_raw_hdr_record") sflow_raw_hdr_record_t sflow_raw_hdr_record; - @name(".sflow_sample") + @name(".sflow_sample") sflow_sample_t sflow_sample; - @name(".snap_header") + @name(".snap_header") snap_header_t snap_header; - @name(".tcp") + @name(".tcp") tcp_t tcp; - @name(".trill") + @name(".trill") trill_t trill; - @name(".udp") + @name(".udp") udp_t udp; - @name(".vntag") + @name(".vntag") vntag_t vntag; - @name(".vxlan") + @name(".vxlan") vxlan_t vxlan; - @name(".vxlan_gpe") + @name(".vxlan_gpe") vxlan_gpe_t vxlan_gpe; - @name(".vxlan_gpe_int_header") + @name(".vxlan_gpe_int_header") vxlan_gpe_int_header_t vxlan_gpe_int_header; - @name(".int_val") + @name(".int_val") int_value_t[24] int_val; - @name(".mpls") + @name(".mpls") mpls_t[3] mpls; - @name(".vlan_tag_") + @name(".vlan_tag_") vlan_tag_t[2] vlan_tag_; } @@ -6195,3 +6195,4 @@ control computeChecksum(inout headers hdr, inout metadata meta) { } V1Switch(ParserImpl(), verifyChecksum(), ingress(), egress(), computeChecksum(), DeparserImpl()) main; + diff --git a/testdata/p4_14_samples_outputs/switch_20160512/switch.p4 b/testdata/p4_14_samples_outputs/switch_20160512/switch.p4 index 44152b60a48..8fcb29a0631 100644 --- a/testdata/p4_14_samples_outputs/switch_20160512/switch.p4 +++ b/testdata/p4_14_samples_outputs/switch_20160512/switch.p4 @@ -49,7 +49,7 @@ struct egress_metadata_t { struct fabric_metadata_t { bit<3> packetType; bit<1> fabric_header_present; - @field_list(FieldLists.cpu_info, FieldLists.sflow_cpu_info) + @field_list(FieldLists.cpu_info, FieldLists.sflow_cpu_info) bit<16> reason_code; bit<8> dst_device; bit<16> dst_port; @@ -66,28 +66,28 @@ struct hash_metadata_t { } struct i2e_metadata_t { - @field_list(FieldLists.i2e_mirror_info, FieldLists.e2e_mirror_info) + @field_list(FieldLists.i2e_mirror_info, FieldLists.e2e_mirror_info) bit<32> ingress_tstamp; - @field_list(FieldLists.i2e_mirror_info, FieldLists.e2e_mirror_info, FieldLists.int_i2e_mirror_info) + @field_list(FieldLists.i2e_mirror_info, FieldLists.e2e_mirror_info, FieldLists.int_i2e_mirror_info) bit<16> mirror_session_id; } struct ingress_metadata_t { - @field_list(FieldLists.cpu_info, FieldLists.sflow_cpu_info) + @field_list(FieldLists.cpu_info, FieldLists.sflow_cpu_info) bit<9> ingress_port; - @field_list(FieldLists.cpu_info, FieldLists.mirror_info, FieldLists.sflow_cpu_info) + @field_list(FieldLists.cpu_info, FieldLists.mirror_info, FieldLists.sflow_cpu_info) bit<16> ifindex; bit<16> egress_ifindex; bit<2> port_type; bit<16> outer_bd; - @field_list(FieldLists.cpu_info, FieldLists.sflow_cpu_info) + @field_list(FieldLists.cpu_info, FieldLists.sflow_cpu_info) bit<16> bd; bit<1> drop_flag; - @field_list(FieldLists.mirror_info) + @field_list(FieldLists.mirror_info) bit<8> drop_reason; bit<1> control_frame; bit<16> bypass_lookups; - @saturating + @saturating bit<32> sflow_take_sample; } @@ -101,7 +101,7 @@ struct int_metadata_t { } struct int_metadata_i2e_t { - @field_list(FieldLists.int_i2e_mirror_info) + @field_list(FieldLists.int_i2e_mirror_info) bit<1> sink; bit<1> source; } @@ -172,7 +172,7 @@ struct l3_metadata_t { bit<1> outer_routed; bit<8> mtu_index; bit<1> l3_copy; - @saturating + @saturating bit<16> l3_mtu_check; } @@ -657,166 +657,166 @@ header vlan_tag_t { } struct metadata { - @name(".acl_metadata") + @name(".acl_metadata") acl_metadata_t acl_metadata; - @name(".egress_filter_metadata") + @name(".egress_filter_metadata") egress_filter_metadata_t egress_filter_metadata; - @name(".egress_metadata") + @name(".egress_metadata") egress_metadata_t egress_metadata; - @name(".fabric_metadata") + @name(".fabric_metadata") fabric_metadata_t fabric_metadata; - @name(".global_config_metadata") + @name(".global_config_metadata") global_config_metadata_t global_config_metadata; - @name(".hash_metadata") + @name(".hash_metadata") hash_metadata_t hash_metadata; - @name(".i2e_metadata") + @name(".i2e_metadata") i2e_metadata_t i2e_metadata; - @name(".ingress_metadata") + @name(".ingress_metadata") ingress_metadata_t ingress_metadata; - @name(".int_metadata") + @name(".int_metadata") int_metadata_t int_metadata; - @name(".int_metadata_i2e") + @name(".int_metadata_i2e") int_metadata_i2e_t int_metadata_i2e; - @name(".ipv4_metadata") + @name(".ipv4_metadata") ipv4_metadata_t ipv4_metadata; - @name(".ipv6_metadata") + @name(".ipv6_metadata") ipv6_metadata_t ipv6_metadata; - @name(".l2_metadata") + @name(".l2_metadata") l2_metadata_t l2_metadata; - @name(".l3_metadata") + @name(".l3_metadata") l3_metadata_t l3_metadata; - @name(".meter_metadata") + @name(".meter_metadata") meter_metadata_t meter_metadata; - @name(".multicast_metadata") + @name(".multicast_metadata") multicast_metadata_t multicast_metadata; - @name(".nexthop_metadata") + @name(".nexthop_metadata") nexthop_metadata_t nexthop_metadata; - @name(".qos_metadata") + @name(".qos_metadata") qos_metadata_t qos_metadata; - @name(".security_metadata") + @name(".security_metadata") security_metadata_t security_metadata; - @name(".sflow_metadata") + @name(".sflow_metadata") sflow_meta_t sflow_metadata; - @name(".tunnel_metadata") + @name(".tunnel_metadata") tunnel_metadata_t tunnel_metadata; } struct headers { - @name(".arp_rarp") + @name(".arp_rarp") arp_rarp_t arp_rarp; - @name(".arp_rarp_ipv4") + @name(".arp_rarp_ipv4") arp_rarp_ipv4_t arp_rarp_ipv4; - @name(".bfd") + @name(".bfd") bfd_t bfd; - @name(".eompls") + @name(".eompls") eompls_t eompls; - @name(".erspan_t3_header") + @name(".erspan_t3_header") erspan_header_t3_t_0 erspan_t3_header; - @name(".ethernet") + @name(".ethernet") ethernet_t ethernet; - @name(".fabric_header") + @name(".fabric_header") fabric_header_t fabric_header; - @name(".fabric_header_cpu") + @name(".fabric_header_cpu") fabric_header_cpu_t fabric_header_cpu; - @name(".fabric_header_mirror") + @name(".fabric_header_mirror") fabric_header_mirror_t fabric_header_mirror; - @name(".fabric_header_multicast") + @name(".fabric_header_multicast") fabric_header_multicast_t fabric_header_multicast; - @name(".fabric_header_sflow") + @name(".fabric_header_sflow") fabric_header_sflow_t fabric_header_sflow; - @name(".fabric_header_unicast") + @name(".fabric_header_unicast") fabric_header_unicast_t fabric_header_unicast; - @name(".fabric_payload_header") + @name(".fabric_payload_header") fabric_payload_header_t fabric_payload_header; - @name(".fcoe") + @name(".fcoe") fcoe_header_t fcoe; - @name(".genv") + @name(".genv") genv_t genv; - @name(".gre") + @name(".gre") gre_t gre; - @name(".icmp") + @name(".icmp") icmp_t icmp; - @name(".inner_ethernet") + @name(".inner_ethernet") ethernet_t inner_ethernet; - @name(".inner_icmp") + @name(".inner_icmp") icmp_t inner_icmp; - @name(".inner_ipv4") + @name(".inner_ipv4") ipv4_t inner_ipv4; - @name(".inner_ipv6") + @name(".inner_ipv6") ipv6_t inner_ipv6; - @name(".inner_sctp") + @name(".inner_sctp") sctp_t inner_sctp; - @name(".inner_tcp") + @name(".inner_tcp") tcp_t inner_tcp; - @name(".inner_udp") + @name(".inner_udp") udp_t inner_udp; - @name(".int_egress_port_id_header") + @name(".int_egress_port_id_header") int_egress_port_id_header_t int_egress_port_id_header; - @name(".int_egress_port_tx_utilization_header") + @name(".int_egress_port_tx_utilization_header") int_egress_port_tx_utilization_header_t int_egress_port_tx_utilization_header; - @name(".int_header") + @name(".int_header") int_header_t int_header; - @name(".int_hop_latency_header") + @name(".int_hop_latency_header") int_hop_latency_header_t int_hop_latency_header; - @name(".int_ingress_port_id_header") + @name(".int_ingress_port_id_header") int_ingress_port_id_header_t int_ingress_port_id_header; - @name(".int_ingress_tstamp_header") + @name(".int_ingress_tstamp_header") int_ingress_tstamp_header_t int_ingress_tstamp_header; - @name(".int_q_congestion_header") + @name(".int_q_congestion_header") int_q_congestion_header_t int_q_congestion_header; - @name(".int_q_occupancy_header") + @name(".int_q_occupancy_header") int_q_occupancy_header_t int_q_occupancy_header; - @name(".int_switch_id_header") + @name(".int_switch_id_header") int_switch_id_header_t int_switch_id_header; - @name(".ipv4") + @name(".ipv4") ipv4_t ipv4; - @name(".ipv6") + @name(".ipv6") ipv6_t ipv6; - @name(".lisp") + @name(".lisp") lisp_t lisp; - @name(".llc_header") + @name(".llc_header") llc_header_t llc_header; - @name(".nsh") + @name(".nsh") nsh_t nsh; - @name(".nsh_context") + @name(".nsh_context") nsh_context_t nsh_context; - @name(".nvgre") + @name(".nvgre") nvgre_t nvgre; - @name(".outer_udp") + @name(".outer_udp") udp_t outer_udp; - @name(".roce") + @name(".roce") roce_header_t roce; - @name(".roce_v2") + @name(".roce_v2") roce_v2_header_t roce_v2; - @name(".sctp") + @name(".sctp") sctp_t sctp; - @name(".sflow") + @name(".sflow") sflow_hdr_t sflow; - @name(".sflow_raw_hdr_record") + @name(".sflow_raw_hdr_record") sflow_raw_hdr_record_t sflow_raw_hdr_record; - @name(".sflow_sample") + @name(".sflow_sample") sflow_sample_t sflow_sample; - @name(".snap_header") + @name(".snap_header") snap_header_t snap_header; - @name(".tcp") + @name(".tcp") tcp_t tcp; - @name(".trill") + @name(".trill") trill_t trill; - @name(".udp") + @name(".udp") udp_t udp; - @name(".vntag") + @name(".vntag") vntag_t vntag; - @name(".vxlan") + @name(".vxlan") vxlan_t vxlan; - @name(".vxlan_gpe") + @name(".vxlan_gpe") vxlan_gpe_t vxlan_gpe; - @name(".vxlan_gpe_int_header") + @name(".vxlan_gpe_int_header") vxlan_gpe_int_header_t vxlan_gpe_int_header; - @name(".int_val") + @name(".int_val") int_value_t[24] int_val; - @name(".mpls") + @name(".mpls") mpls_t[3] mpls; - @name(".vlan_tag_") + @name(".vlan_tag_") vlan_tag_t[2] vlan_tag_; } @@ -5890,3 +5890,4 @@ control computeChecksum(inout headers hdr, inout metadata meta) { } V1Switch(ParserImpl(), verifyChecksum(), ingress(), egress(), computeChecksum(), DeparserImpl()) main; + diff --git a/testdata/p4_16_samples/psa-switch-expression-without-default.p4 b/testdata/p4_16_samples/psa-switch-expression-without-default.p4 new file mode 100644 index 00000000000..59ce306432b --- /dev/null +++ b/testdata/p4_16_samples/psa-switch-expression-without-default.p4 @@ -0,0 +1,174 @@ +#include +#include + +struct EMPTY { }; + +typedef bit<48> EthernetAddress; + +struct user_meta_t { + bit<16> data; + bit<16> data1; +} + +header ethernet_t { + EthernetAddress dstAddr; + EthernetAddress srcAddr; + bit<16> etherType; +} + +header ipv4_t { + bit<4> version; + bit<4> ihl; + bit<8> diffserv; + bit<16> totalLen; + bit<16> identification; + bit<3> flags; + bit<13> fragOffset; + bit<8> ttl; + bit<8> protocol; + bit<16> hdrChecksum; + bit<32> srcAddr; + bit<32> dstAddr; + bit<80> newfield; +} + +header tcp_t { + bit<16> srcPort; + bit<16> dstPort; + bit<32> seqNo; + bit<32> ackNo; + bit<4> dataOffset; + bit<3> res; + bit<3> ecn; + bit<6> ctrl; + bit<16> window; + bit<16> checksum; + bit<16> urgentPtr; +} + +struct headers_t { + ethernet_t ethernet; + ipv4_t ipv4; + tcp_t tcp; +} + +parser MyIP( + packet_in buffer, + out headers_t hdr, + inout user_meta_t b, + in psa_ingress_parser_input_metadata_t c, + in EMPTY d, + in EMPTY e) { + + state start { + buffer.extract(hdr.ethernet); + transition select(hdr.ethernet.etherType) { + 0x0800 &&& 0x0F00 : parse_ipv4; + 16w0x0d00 : parse_tcp; + default : accept; + } + } + state parse_ipv4 { + buffer.extract(hdr.ipv4); + transition select(hdr.ipv4.protocol) { + 8w4 .. 8w7: parse_tcp; + default: accept; + } + } + state parse_tcp { + buffer.extract(hdr.tcp); + transition accept; + } +} + +parser MyEP( + packet_in buffer, + out EMPTY a, + inout EMPTY b, + in psa_egress_parser_input_metadata_t c, + in EMPTY d, + in EMPTY e, + in EMPTY f) { + state start { + transition accept; + } +} + +control MyIC( + inout headers_t hdr, + inout user_meta_t b, + in psa_ingress_input_metadata_t c, + inout psa_ingress_output_metadata_t d) { + bit<16> tmp = 16; + action a1(bit<48> param) { hdr.ethernet.dstAddr = param; } + action a2(bit<16> param) { hdr.ethernet.etherType = param; } + table tbl { + key = { + hdr.ethernet.srcAddr : exact; + b.data : lpm; + } + actions = { NoAction; a1; a2; } + } + + table foo { + actions = { NoAction; } + } + + table bar { + actions = { NoAction; } + } + + apply { + switch (tmp) { + 16: + 32: { tmp = 1; } + 64: { tmp = 2; } + 92: + } + switch (tbl.apply().action_run) { + a1: { if (tmp == 1) foo.apply(); } + a2: { bar.apply(); } + } + } +} + +control MyEC( + inout EMPTY a, + inout EMPTY b, + in psa_egress_input_metadata_t c, + inout psa_egress_output_metadata_t d) { + apply { } +} + +control MyID( + packet_out buffer, + out EMPTY a, + out EMPTY b, + out EMPTY c, + inout headers_t hdr, + in user_meta_t e, + in psa_ingress_output_metadata_t f) { + apply { + buffer.emit(hdr.ethernet); + } +} + +control MyED( + packet_out buffer, + out EMPTY a, + out EMPTY b, + inout EMPTY c, + in EMPTY d, + in psa_egress_output_metadata_t e, + in psa_egress_deparser_input_metadata_t f) { + apply { } +} + +IngressPipeline(MyIP(), MyIC(), MyID()) ip; +EgressPipeline(MyEP(), MyEC(), MyED()) ep; + +PSA_Switch( + ip, + PacketReplicationEngine(), + ep, + BufferingQueueingEngine()) main; diff --git a/testdata/p4_16_samples_outputs/invalid-hdr-warnings2-first.p4 b/testdata/p4_16_samples_outputs/invalid-hdr-warnings2-first.p4 index 6db642c62d1..7036e914573 100644 --- a/testdata/p4_16_samples_outputs/invalid-hdr-warnings2-first.p4 +++ b/testdata/p4_16_samples_outputs/invalid-hdr-warnings2-first.p4 @@ -86,3 +86,4 @@ control ComputeChecksumI(inout H hdr, inout M meta) { } V1Switch(ParserI(), VerifyChecksumI(), IngressI(), EgressI(), ComputeChecksumI(), DeparserI()) main; + diff --git a/testdata/p4_16_samples_outputs/invalid-hdr-warnings2-frontend.p4 b/testdata/p4_16_samples_outputs/invalid-hdr-warnings2-frontend.p4 index f87c7c78618..580e201dc04 100644 --- a/testdata/p4_16_samples_outputs/invalid-hdr-warnings2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/invalid-hdr-warnings2-frontend.p4 @@ -95,3 +95,4 @@ control ComputeChecksumI(inout H hdr, inout M meta) { } V1Switch(ParserI(), VerifyChecksumI(), IngressI(), EgressI(), ComputeChecksumI(), DeparserI()) main; + diff --git a/testdata/p4_16_samples_outputs/invalid-hdr-warnings2-midend.p4 b/testdata/p4_16_samples_outputs/invalid-hdr-warnings2-midend.p4 index 726e666e3ae..811cdcdf5df 100644 --- a/testdata/p4_16_samples_outputs/invalid-hdr-warnings2-midend.p4 +++ b/testdata/p4_16_samples_outputs/invalid-hdr-warnings2-midend.p4 @@ -225,3 +225,4 @@ control ComputeChecksumI(inout H hdr, inout M meta) { } V1Switch(ParserI(), VerifyChecksumI(), IngressI(), EgressI(), ComputeChecksumI(), DeparserI()) main; + diff --git a/testdata/p4_16_samples_outputs/invalid-hdr-warnings5.p4-stderr b/testdata/p4_16_samples_outputs/invalid-hdr-warnings5.p4-stderr index e1aa7ac6e56..0c62bc1a85c 100644 --- a/testdata/p4_16_samples_outputs/invalid-hdr-warnings5.p4-stderr +++ b/testdata/p4_16_samples_outputs/invalid-hdr-warnings5.p4-stderr @@ -34,4 +34,3 @@ invalid-hdr-warnings5.p4(83): [--Wwarn=invalid_header] warning: accessing a fiel invalid-hdr-warnings5.p4(84): [--Wwarn=invalid_header] warning: accessing a field of an invalid header u1.h3 u1.h3.data = 1; ^^^^^ - diff --git a/testdata/p4_16_samples_outputs/invalid-hdr-warnings7.p4-stderr b/testdata/p4_16_samples_outputs/invalid-hdr-warnings7.p4-stderr index eb14396b55d..44bc5e8bd97 100644 --- a/testdata/p4_16_samples_outputs/invalid-hdr-warnings7.p4-stderr +++ b/testdata/p4_16_samples_outputs/invalid-hdr-warnings7.p4-stderr @@ -46,4 +46,3 @@ invalid-hdr-warnings7.p4(56): [--Wwarn=invalid_header] warning: accessing a fiel invalid-hdr-warnings7.p4(57): [--Wwarn=invalid_header] warning: accessing a field of an invalid header us1[1].h1 ^ us1[0].h2.a ^ us1[1].h1.a ^ us1[1].h2.a; ^^^^^^^^^ - diff --git a/testdata/p4_16_samples_outputs/invalid-hdr-warnings8.p4-stderr b/testdata/p4_16_samples_outputs/invalid-hdr-warnings8.p4-stderr index 8ec9a601add..e432fc25bab 100644 --- a/testdata/p4_16_samples_outputs/invalid-hdr-warnings8.p4-stderr +++ b/testdata/p4_16_samples_outputs/invalid-hdr-warnings8.p4-stderr @@ -40,4 +40,3 @@ invalid-hdr-warnings8.p4(68): [--Wwarn=invalid_header] warning: accessing a fiel invalid-hdr-warnings8.p4(69): [--Wwarn=invalid_header] warning: accessing a field of an invalid header us1[1].h1 ^ us1[0].h2.a ^ us1[1].h1.a ^ us1[1].h2.a; ^^^^^^^^^ - diff --git a/testdata/p4_16_samples_outputs/issue1001-1-bmv2-first.p4 b/testdata/p4_16_samples_outputs/issue1001-1-bmv2-first.p4 index 5eb2e13827d..35abad11c15 100644 --- a/testdata/p4_16_samples_outputs/issue1001-1-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/issue1001-1-bmv2-first.p4 @@ -10,7 +10,7 @@ enum bit<8> PreservedFieldList { } struct Meta { - @field_list(PreservedFieldList.Field) + @field_list(PreservedFieldList.Field) bit<1> b; } @@ -48,3 +48,4 @@ control deparser(packet_out b, in Headers h) { } V1Switch(p(), vrfy(), ingress(), egress(), update(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1001-1-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue1001-1-bmv2-frontend.p4 index 5eb2e13827d..35abad11c15 100644 --- a/testdata/p4_16_samples_outputs/issue1001-1-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1001-1-bmv2-frontend.p4 @@ -10,7 +10,7 @@ enum bit<8> PreservedFieldList { } struct Meta { - @field_list(PreservedFieldList.Field) + @field_list(PreservedFieldList.Field) bit<1> b; } @@ -48,3 +48,4 @@ control deparser(packet_out b, in Headers h) { } V1Switch(p(), vrfy(), ingress(), egress(), update(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1001-1-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/issue1001-1-bmv2-midend.p4 index 0deb85b6b39..cf41ea2b665 100644 --- a/testdata/p4_16_samples_outputs/issue1001-1-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue1001-1-bmv2-midend.p4 @@ -6,7 +6,7 @@ struct Headers { } struct Meta { - @field_list(8w1) + @field_list(8w1) bit<1> b; } @@ -53,3 +53,4 @@ control deparser(packet_out b, in Headers h) { } V1Switch(p(), vrfy(), ingress(), egress(), update(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1001-1-bmv2.p4 b/testdata/p4_16_samples_outputs/issue1001-1-bmv2.p4 index 8fb43025974..752e66b5310 100644 --- a/testdata/p4_16_samples_outputs/issue1001-1-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/issue1001-1-bmv2.p4 @@ -10,7 +10,7 @@ enum bit<8> PreservedFieldList { } struct Meta { - @field_list(PreservedFieldList.Field) + @field_list(PreservedFieldList.Field) bit<1> b; } @@ -48,3 +48,4 @@ control deparser(packet_out b, in Headers h) { } V1Switch(p(), vrfy(), ingress(), egress(), update(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1001-bmv2-first.p4 b/testdata/p4_16_samples_outputs/issue1001-bmv2-first.p4 index 937ff870422..3761a70f25c 100644 --- a/testdata/p4_16_samples_outputs/issue1001-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/issue1001-bmv2-first.p4 @@ -6,7 +6,7 @@ struct Headers { } struct Meta { - @field_list(0) + @field_list(0) bit<1> b; } @@ -44,3 +44,4 @@ control deparser(packet_out b, in Headers h) { } V1Switch(p(), vrfy(), ingress(), egress(), update(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1001-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue1001-bmv2-frontend.p4 index 937ff870422..3761a70f25c 100644 --- a/testdata/p4_16_samples_outputs/issue1001-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1001-bmv2-frontend.p4 @@ -6,7 +6,7 @@ struct Headers { } struct Meta { - @field_list(0) + @field_list(0) bit<1> b; } @@ -44,3 +44,4 @@ control deparser(packet_out b, in Headers h) { } V1Switch(p(), vrfy(), ingress(), egress(), update(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1001-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/issue1001-bmv2-midend.p4 index 6c9807e4071..ff5ba9f3b21 100644 --- a/testdata/p4_16_samples_outputs/issue1001-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue1001-bmv2-midend.p4 @@ -6,7 +6,7 @@ struct Headers { } struct Meta { - @field_list(0) + @field_list(0) bit<1> b; } @@ -53,3 +53,4 @@ control deparser(packet_out b, in Headers h) { } V1Switch(p(), vrfy(), ingress(), egress(), update(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1001-bmv2.p4 b/testdata/p4_16_samples_outputs/issue1001-bmv2.p4 index 2a703619e0b..e404603371c 100644 --- a/testdata/p4_16_samples_outputs/issue1001-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/issue1001-bmv2.p4 @@ -6,7 +6,7 @@ struct Headers { } struct Meta { - @field_list(0) + @field_list(0) bit<1> b; } @@ -44,3 +44,4 @@ control deparser(packet_out b, in Headers h) { } V1Switch(p(), vrfy(), ingress(), egress(), update(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1642-bmv2-first.p4 b/testdata/p4_16_samples_outputs/issue1642-bmv2-first.p4 index 00661351a5e..73f4e203a62 100644 --- a/testdata/p4_16_samples_outputs/issue1642-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/issue1642-bmv2-first.p4 @@ -21,7 +21,7 @@ struct parsed_packet_t { struct local_metadata_t { short s; - @field_list(0) + @field_list(0) row_t row; } @@ -63,3 +63,4 @@ control compute_checksum(inout parsed_packet_t hdr, inout local_metadata_t local } V1Switch(parse(), verifyChecksum(), ingress(), egress(), compute_checksum(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1642-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue1642-bmv2-frontend.p4 index 00661351a5e..73f4e203a62 100644 --- a/testdata/p4_16_samples_outputs/issue1642-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1642-bmv2-frontend.p4 @@ -21,7 +21,7 @@ struct parsed_packet_t { struct local_metadata_t { short s; - @field_list(0) + @field_list(0) row_t row; } @@ -63,3 +63,4 @@ control compute_checksum(inout parsed_packet_t hdr, inout local_metadata_t local } V1Switch(parse(), verifyChecksum(), ingress(), egress(), compute_checksum(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1642-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/issue1642-bmv2-midend.p4 index e0282a43397..42babd22d2c 100644 --- a/testdata/p4_16_samples_outputs/issue1642-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue1642-bmv2-midend.p4 @@ -21,13 +21,13 @@ struct parsed_packet_t { struct local_metadata_t { short _s0; - @field_list(0) + @field_list(0) bit<1> _row_alt0_valid1; - @field_list(0) + @field_list(0) bit<7> _row_alt0_port2; - @field_list(0) + @field_list(0) bit<1> _row_alt1_valid3; - @field_list(0) + @field_list(0) bit<7> _row_alt1_port4; } @@ -79,3 +79,4 @@ control compute_checksum(inout parsed_packet_t hdr, inout local_metadata_t local } V1Switch(parse(), verifyChecksum(), ingress(), egress(), compute_checksum(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1642-bmv2.p4 b/testdata/p4_16_samples_outputs/issue1642-bmv2.p4 index 2c5fe737a9f..0f5b2b59ae5 100644 --- a/testdata/p4_16_samples_outputs/issue1642-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/issue1642-bmv2.p4 @@ -21,7 +21,7 @@ struct parsed_packet_t { struct local_metadata_t { short s; - @field_list(0) + @field_list(0) row_t row; } @@ -63,3 +63,4 @@ control compute_checksum(inout parsed_packet_t hdr, inout local_metadata_t local } V1Switch(parse(), verifyChecksum(), ingress(), egress(), compute_checksum(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1653-bmv2-first.p4 b/testdata/p4_16_samples_outputs/issue1653-bmv2-first.p4 index fbdffd0e297..7e3a6876745 100644 --- a/testdata/p4_16_samples_outputs/issue1653-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/issue1653-bmv2-first.p4 @@ -51,3 +51,4 @@ control compute_checksum(inout parsed_packet_t hdr, inout local_metadata_t local } V1Switch(parse(), verifyChecksum(), ingress(), egress(), compute_checksum(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1653-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue1653-bmv2-frontend.p4 index f9e1c2c61d7..c3c22fb4828 100644 --- a/testdata/p4_16_samples_outputs/issue1653-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1653-bmv2-frontend.p4 @@ -51,3 +51,4 @@ control compute_checksum(inout parsed_packet_t hdr, inout local_metadata_t local } V1Switch(parse(), verifyChecksum(), ingress(), egress(), compute_checksum(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1653-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/issue1653-bmv2-midend.p4 index 86b5cf3134b..78c744a0980 100644 --- a/testdata/p4_16_samples_outputs/issue1653-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue1653-bmv2-midend.p4 @@ -60,3 +60,4 @@ control compute_checksum(inout parsed_packet_t hdr, inout local_metadata_t local } V1Switch(parse(), verifyChecksum(), ingress(), egress(), compute_checksum(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1653-bmv2.p4 b/testdata/p4_16_samples_outputs/issue1653-bmv2.p4 index a263d52d617..26cdca67f3a 100644 --- a/testdata/p4_16_samples_outputs/issue1653-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/issue1653-bmv2.p4 @@ -51,3 +51,4 @@ control compute_checksum(inout parsed_packet_t hdr, inout local_metadata_t local } V1Switch(parse(), verifyChecksum(), ingress(), egress(), compute_checksum(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1653-complex-bmv2-first.p4 b/testdata/p4_16_samples_outputs/issue1653-complex-bmv2-first.p4 index a1bebbde925..95fbd25c302 100644 --- a/testdata/p4_16_samples_outputs/issue1653-complex-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/issue1653-complex-bmv2-first.p4 @@ -31,7 +31,7 @@ header bitvec_hdr { } struct local_metadata_t { - @field_list(0) + @field_list(0) row_t row0; row_t row1; bitvec_hdr bvh0; @@ -101,3 +101,4 @@ control compute_checksum(inout parsed_packet_t hdr, inout local_metadata_t local } V1Switch(parse(), verifyChecksum(), ingress(), egress(), compute_checksum(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1653-complex-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue1653-complex-bmv2-frontend.p4 index 62b9ecb0c98..6700a675ac9 100644 --- a/testdata/p4_16_samples_outputs/issue1653-complex-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1653-complex-bmv2-frontend.p4 @@ -31,7 +31,7 @@ header bitvec_hdr { } struct local_metadata_t { - @field_list(0) + @field_list(0) row_t row0; row_t row1; bitvec_hdr bvh0; @@ -103,3 +103,4 @@ control compute_checksum(inout parsed_packet_t hdr, inout local_metadata_t local } V1Switch(parse(), verifyChecksum(), ingress(), egress(), compute_checksum(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1653-complex-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/issue1653-complex-bmv2-midend.p4 index 8195e38f4e7..48be27437f8 100644 --- a/testdata/p4_16_samples_outputs/issue1653-complex-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue1653-complex-bmv2-midend.p4 @@ -32,29 +32,29 @@ header bitvec_hdr { } struct local_metadata_t { - @field_list(0) + @field_list(0) bit<1> _row0_alt0_valid0; - @field_list(0) + @field_list(0) bit<7> _row0_alt0_port1; - @field_list(0) + @field_list(0) int<8> _row0_alt0_hashRes2; - @field_list(0) + @field_list(0) bool _row0_alt0_useHash3; - @field_list(0) + @field_list(0) bit<16> _row0_alt0_type4; - @field_list(0) + @field_list(0) bit<7> _row0_alt0_pad5; - @field_list(0) + @field_list(0) bit<1> _row0_alt1_valid6; - @field_list(0) + @field_list(0) bit<7> _row0_alt1_port7; - @field_list(0) + @field_list(0) int<8> _row0_alt1_hashRes8; - @field_list(0) + @field_list(0) bool _row0_alt1_useHash9; - @field_list(0) + @field_list(0) bit<16> _row0_alt1_type10; - @field_list(0) + @field_list(0) bit<7> _row0_alt1_pad11; bit<1> _row1_alt0_valid12; bit<7> _row1_alt0_port13; @@ -155,3 +155,4 @@ control compute_checksum(inout parsed_packet_t hdr, inout local_metadata_t local } V1Switch(parse(), verifyChecksum(), ingress(), egress(), compute_checksum(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1653-complex-bmv2.p4 b/testdata/p4_16_samples_outputs/issue1653-complex-bmv2.p4 index 4910a097ecf..14918539bfb 100644 --- a/testdata/p4_16_samples_outputs/issue1653-complex-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/issue1653-complex-bmv2.p4 @@ -31,7 +31,7 @@ header bitvec_hdr { } struct local_metadata_t { - @field_list(0) + @field_list(0) row_t row0; row_t row1; bitvec_hdr bvh0; @@ -99,3 +99,4 @@ control compute_checksum(inout parsed_packet_t hdr, inout local_metadata_t local } V1Switch(parse(), verifyChecksum(), ingress(), egress(), compute_checksum(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1660-bmv2-first.p4 b/testdata/p4_16_samples_outputs/issue1660-bmv2-first.p4 index 4c722510391..24b54c35729 100644 --- a/testdata/p4_16_samples_outputs/issue1660-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/issue1660-bmv2-first.p4 @@ -3,7 +3,7 @@ #include struct HasBool { - @field_list(0) + @field_list(0) bool x; } @@ -48,3 +48,4 @@ control compute_checksum(inout parsed_packet_t hdr, inout local_metadata_t local } V1Switch(parse(), verifyChecksum(), ingress(), egress(), compute_checksum(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1660-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue1660-bmv2-frontend.p4 index 3787f931978..1b68c7ca24d 100644 --- a/testdata/p4_16_samples_outputs/issue1660-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1660-bmv2-frontend.p4 @@ -3,7 +3,7 @@ #include struct HasBool { - @field_list(0) + @field_list(0) bool x; } @@ -46,3 +46,4 @@ control compute_checksum(inout parsed_packet_t hdr, inout local_metadata_t local } V1Switch(parse(), verifyChecksum(), ingress(), egress(), compute_checksum(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1660-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/issue1660-bmv2-midend.p4 index 14310cac4e6..9f4018bde26 100644 --- a/testdata/p4_16_samples_outputs/issue1660-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue1660-bmv2-midend.p4 @@ -3,7 +3,7 @@ #include struct HasBool { - @field_list(0) + @field_list(0) bool x; } @@ -55,3 +55,4 @@ control compute_checksum(inout parsed_packet_t hdr, inout local_metadata_t local } V1Switch(parse(), verifyChecksum(), ingress(), egress(), compute_checksum(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1660-bmv2.p4 b/testdata/p4_16_samples_outputs/issue1660-bmv2.p4 index 5c3a015f06c..0ae5ca70ac3 100644 --- a/testdata/p4_16_samples_outputs/issue1660-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/issue1660-bmv2.p4 @@ -3,7 +3,7 @@ #include struct HasBool { - @field_list(0) + @field_list(0) bool x; } @@ -48,3 +48,4 @@ control compute_checksum(inout parsed_packet_t hdr, inout local_metadata_t local } V1Switch(parse(), verifyChecksum(), ingress(), egress(), compute_checksum(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1765-1-bmv2-first.p4 b/testdata/p4_16_samples_outputs/issue1765-1-bmv2-first.p4 index f36ae63ac26..188336e7e7c 100644 --- a/testdata/p4_16_samples_outputs/issue1765-1-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/issue1765-1-bmv2-first.p4 @@ -116,15 +116,15 @@ struct headers { } struct metadata { - @field_list(0) + @field_list(0) port_t ingress_port; - @field_list(0) + @field_list(0) task_t task; - @field_list(0) + @field_list(0) bit<16> tcp_length; - @field_list(0) + @field_list(0) bit<32> cast_length; - @field_list(0) + @field_list(0) bit<1> do_cksum; } @@ -356,3 +356,4 @@ control MyEgress(inout headers hdr, inout metadata meta, inout standard_metadata } V1Switch(MyParser(), MyVerifyChecksum(), MyIngress(), MyEgress(), MyComputeChecksum(), MyDeparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1765-1-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue1765-1-bmv2-frontend.p4 index cf8e9ba0979..8bc4de20f94 100644 --- a/testdata/p4_16_samples_outputs/issue1765-1-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1765-1-bmv2-frontend.p4 @@ -98,15 +98,15 @@ struct headers { } struct metadata { - @field_list(0) + @field_list(0) port_t ingress_port; - @field_list(0) + @field_list(0) task_t task; - @field_list(0) + @field_list(0) bit<16> tcp_length; - @field_list(0) + @field_list(0) bit<32> cast_length; - @field_list(0) + @field_list(0) bit<1> do_cksum; } @@ -287,3 +287,4 @@ control MyEgress(inout headers hdr, inout metadata meta, inout standard_metadata } V1Switch(MyParser(), MyVerifyChecksum(), MyIngress(), MyEgress(), MyComputeChecksum(), MyDeparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1765-1-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/issue1765-1-bmv2-midend.p4 index e7a0423bb4d..8766ac548a0 100644 --- a/testdata/p4_16_samples_outputs/issue1765-1-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue1765-1-bmv2-midend.p4 @@ -98,15 +98,15 @@ struct headers { } struct metadata { - @field_list(0) + @field_list(0) port_t ingress_port; - @field_list(0) + @field_list(0) task_t task; - @field_list(0) + @field_list(0) bit<16> tcp_length; - @field_list(0) + @field_list(0) bit<32> cast_length; - @field_list(0) + @field_list(0) bit<1> do_cksum; } @@ -304,3 +304,4 @@ control MyEgress(inout headers hdr, inout metadata meta, inout standard_metadata } V1Switch(MyParser(), MyVerifyChecksum(), MyIngress(), MyEgress(), MyComputeChecksum(), MyDeparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1765-1-bmv2.p4 b/testdata/p4_16_samples_outputs/issue1765-1-bmv2.p4 index 00e74ff9e17..eafe7a7446a 100644 --- a/testdata/p4_16_samples_outputs/issue1765-1-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/issue1765-1-bmv2.p4 @@ -116,15 +116,15 @@ struct headers { } struct metadata { - @field_list(0) + @field_list(0) port_t ingress_port; - @field_list(0) + @field_list(0) task_t task; - @field_list(0) + @field_list(0) bit<16> tcp_length; - @field_list(0) + @field_list(0) bit<32> cast_length; - @field_list(0) + @field_list(0) bit<1> do_cksum; } @@ -356,3 +356,4 @@ control MyEgress(inout headers hdr, inout metadata meta, inout standard_metadata } V1Switch(MyParser(), MyVerifyChecksum(), MyIngress(), MyEgress(), MyComputeChecksum(), MyDeparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue2176-bmv2.p4-stderr b/testdata/p4_16_samples_outputs/issue2176-bmv2.p4-stderr index 1f0b2e631ea..7bc678e20a9 100644 --- a/testdata/p4_16_samples_outputs/issue2176-bmv2.p4-stderr +++ b/testdata/p4_16_samples_outputs/issue2176-bmv2.p4-stderr @@ -3,13 +3,13 @@ issue2176-bmv2.p4(43): [--Wwarn=ordering] warning: h.h.b: 'out' argument has fie ^^^^^ issue2176-bmv2.p4(43) do_action_2(h.h.b, h.h.b, h.h.b); - ^^^^^ + ^^^^^ issue2176-bmv2.p4(43): [--Wwarn=ordering] warning: h.h.b: 'out' argument has fields in common with h.h.b do_action_2(h.h.b, h.h.b, h.h.b); ^^^^^ issue2176-bmv2.p4(43) do_action_2(h.h.b, h.h.b, h.h.b); - ^^^^^ + ^^^^^ issue2176-bmv2.p4(43): [--Wwarn=ordering] warning: h.h.b: 'out' argument has fields in common with h.h.b do_action_2(h.h.b, h.h.b, h.h.b); ^^^^^ diff --git a/testdata/p4_16_samples_outputs/issue383-bmv2-first.p4 b/testdata/p4_16_samples_outputs/issue383-bmv2-first.p4 index 4c42a4ece67..87549f96405 100644 --- a/testdata/p4_16_samples_outputs/issue383-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/issue383-bmv2-first.p4 @@ -21,7 +21,7 @@ struct col_t { } struct local_metadata_t { - @field_list(0) + @field_list(0) row_t row0; row_t row1; col_t col; @@ -107,3 +107,4 @@ control compute_checksum(inout parsed_packet_t hdr, inout local_metadata_t local } V1Switch(parse(), verifyChecksum(), ingress(), egress(), compute_checksum(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue383-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue383-bmv2-frontend.p4 index d91b4999752..030c8e6d1b3 100644 --- a/testdata/p4_16_samples_outputs/issue383-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue383-bmv2-frontend.p4 @@ -21,7 +21,7 @@ struct col_t { } struct local_metadata_t { - @field_list(0) + @field_list(0) row_t row0; row_t row1; col_t col; @@ -107,3 +107,4 @@ control compute_checksum(inout parsed_packet_t hdr, inout local_metadata_t local } V1Switch(parse(), verifyChecksum(), ingress(), egress(), compute_checksum(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue383-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/issue383-bmv2-midend.p4 index 4a305851a40..bb52ab80148 100644 --- a/testdata/p4_16_samples_outputs/issue383-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue383-bmv2-midend.p4 @@ -24,13 +24,13 @@ struct col_t { } struct local_metadata_t { - @field_list(0) + @field_list(0) bit<1> _row0_alt0_valid0; - @field_list(0) + @field_list(0) bit<7> _row0_alt0_port1; - @field_list(0) + @field_list(0) bit<1> _row0_alt1_valid2; - @field_list(0) + @field_list(0) bit<7> _row0_alt1_port3; bit<1> _row1_alt0_valid4; bit<7> _row1_alt0_port5; @@ -140,3 +140,4 @@ control compute_checksum(inout parsed_packet_t hdr, inout local_metadata_t local } V1Switch(parse(), verifyChecksum(), ingress(), egress(), compute_checksum(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue383-bmv2.p4 b/testdata/p4_16_samples_outputs/issue383-bmv2.p4 index f46de800606..56b8f633946 100644 --- a/testdata/p4_16_samples_outputs/issue383-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/issue383-bmv2.p4 @@ -21,7 +21,7 @@ struct col_t { } struct local_metadata_t { - @field_list(0) + @field_list(0) row_t row0; row_t row1; col_t col; @@ -105,3 +105,4 @@ control compute_checksum(inout parsed_packet_t hdr, inout local_metadata_t local } V1Switch(parse(), verifyChecksum(), ingress(), egress(), compute_checksum(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue562-bmv2-first.p4 b/testdata/p4_16_samples_outputs/issue562-bmv2-first.p4 index b6780d46394..aaa77e19490 100644 --- a/testdata/p4_16_samples_outputs/issue562-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/issue562-bmv2-first.p4 @@ -16,7 +16,7 @@ struct parsed_packet_t { } struct local_metadata_t { - @field_list(0) + @field_list(0) row_t row; } @@ -56,3 +56,4 @@ control compute_checksum(inout parsed_packet_t hdr, inout local_metadata_t local } V1Switch(parse(), verifyChecksum(), ingress(), egress(), compute_checksum(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue562-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue562-bmv2-frontend.p4 index b6780d46394..aaa77e19490 100644 --- a/testdata/p4_16_samples_outputs/issue562-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue562-bmv2-frontend.p4 @@ -16,7 +16,7 @@ struct parsed_packet_t { } struct local_metadata_t { - @field_list(0) + @field_list(0) row_t row; } @@ -56,3 +56,4 @@ control compute_checksum(inout parsed_packet_t hdr, inout local_metadata_t local } V1Switch(parse(), verifyChecksum(), ingress(), egress(), compute_checksum(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue562-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/issue562-bmv2-midend.p4 index f7c0d8cc7a4..26e29af0aff 100644 --- a/testdata/p4_16_samples_outputs/issue562-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue562-bmv2-midend.p4 @@ -16,13 +16,13 @@ struct parsed_packet_t { } struct local_metadata_t { - @field_list(0) + @field_list(0) bit<1> _row_alt0_valid0; - @field_list(0) + @field_list(0) bit<7> _row_alt0_port1; - @field_list(0) + @field_list(0) bit<1> _row_alt1_valid2; - @field_list(0) + @field_list(0) bit<7> _row_alt1_port3; } @@ -72,3 +72,4 @@ control compute_checksum(inout parsed_packet_t hdr, inout local_metadata_t local } V1Switch(parse(), verifyChecksum(), ingress(), egress(), compute_checksum(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue562-bmv2.p4 b/testdata/p4_16_samples_outputs/issue562-bmv2.p4 index 0a36f96579f..e526772259b 100644 --- a/testdata/p4_16_samples_outputs/issue562-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/issue562-bmv2.p4 @@ -16,7 +16,7 @@ struct parsed_packet_t { } struct local_metadata_t { - @field_list(0) + @field_list(0) row_t row; } @@ -56,3 +56,4 @@ control compute_checksum(inout parsed_packet_t hdr, inout local_metadata_t local } V1Switch(parse(), verifyChecksum(), ingress(), egress(), compute_checksum(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/psa-dpdk-table-key-consolidation-mixed-keys-4.p4.bfrt.json b/testdata/p4_16_samples_outputs/psa-dpdk-table-key-consolidation-mixed-keys-4.p4.bfrt.json index 0fa762318d9..1214883be65 100644 --- a/testdata/p4_16_samples_outputs/psa-dpdk-table-key-consolidation-mixed-keys-4.p4.bfrt.json +++ b/testdata/p4_16_samples_outputs/psa-dpdk-table-key-consolidation-mixed-keys-4.p4.bfrt.json @@ -57,4 +57,4 @@ } ], "learn_filters" : [] -} +} \ No newline at end of file diff --git a/testdata/p4_16_samples_outputs/psa-switch-expression-without-default-first.p4 b/testdata/p4_16_samples_outputs/psa-switch-expression-without-default-first.p4 new file mode 100644 index 00000000000..93e1d07aeb7 --- /dev/null +++ b/testdata/p4_16_samples_outputs/psa-switch-expression-without-default-first.p4 @@ -0,0 +1,161 @@ +#include +#include + +struct EMPTY { +} + +typedef bit<48> EthernetAddress; +struct user_meta_t { + bit<16> data; + bit<16> data1; +} + +header ethernet_t { + EthernetAddress dstAddr; + EthernetAddress srcAddr; + bit<16> etherType; +} + +header ipv4_t { + bit<4> version; + bit<4> ihl; + bit<8> diffserv; + bit<16> totalLen; + bit<16> identification; + bit<3> flags; + bit<13> fragOffset; + bit<8> ttl; + bit<8> protocol; + bit<16> hdrChecksum; + bit<32> srcAddr; + bit<32> dstAddr; + bit<80> newfield; +} + +header tcp_t { + bit<16> srcPort; + bit<16> dstPort; + bit<32> seqNo; + bit<32> ackNo; + bit<4> dataOffset; + bit<3> res; + bit<3> ecn; + bit<6> ctrl; + bit<16> window; + bit<16> checksum; + bit<16> urgentPtr; +} + +struct headers_t { + ethernet_t ethernet; + ipv4_t ipv4; + tcp_t tcp; +} + +parser MyIP(packet_in buffer, out headers_t hdr, inout user_meta_t b, in psa_ingress_parser_input_metadata_t c, in EMPTY d, in EMPTY e) { + state start { + buffer.extract(hdr.ethernet); + transition select(hdr.ethernet.etherType) { + 16w0x800 &&& 16w0xf00: parse_ipv4; + 16w0xd00: parse_tcp; + default: accept; + } + } + state parse_ipv4 { + buffer.extract(hdr.ipv4); + transition select(hdr.ipv4.protocol) { + 8w4 .. 8w7: parse_tcp; + default: accept; + } + } + state parse_tcp { + buffer.extract(hdr.tcp); + transition accept; + } +} + +parser MyEP(packet_in buffer, out EMPTY a, inout EMPTY b, in psa_egress_parser_input_metadata_t c, in EMPTY d, in EMPTY e, in EMPTY f) { + state start { + transition accept; + } +} + +control MyIC(inout headers_t hdr, inout user_meta_t b, in psa_ingress_input_metadata_t c, inout psa_ingress_output_metadata_t d) { + bit<16> tmp = 16w16; + action a1(bit<48> param) { + hdr.ethernet.dstAddr = param; + } + action a2(bit<16> param) { + hdr.ethernet.etherType = param; + } + table tbl { + key = { + hdr.ethernet.srcAddr: exact @name("hdr.ethernet.srcAddr") ; + b.data : lpm @name("b.data") ; + } + actions = { + NoAction(); + a1(); + a2(); + } + default_action = NoAction(); + } + table foo { + actions = { + NoAction(); + } + default_action = NoAction(); + } + table bar { + actions = { + NoAction(); + } + default_action = NoAction(); + } + apply { + switch (tmp) { + 16w16: + 16w32: { + tmp = 16w1; + } + 16w64: { + tmp = 16w2; + } + } + switch (tbl.apply().action_run) { + a1: { + if (tmp == 16w1) { + foo.apply(); + } + } + a2: { + bar.apply(); + } + default: { + } + } + } +} + +control MyEC(inout EMPTY a, inout EMPTY b, in psa_egress_input_metadata_t c, inout psa_egress_output_metadata_t d) { + apply { + } +} + +control MyID(packet_out buffer, out EMPTY a, out EMPTY b, out EMPTY c, inout headers_t hdr, in user_meta_t e, in psa_ingress_output_metadata_t f) { + apply { + buffer.emit(hdr.ethernet); + } +} + +control MyED(packet_out buffer, out EMPTY a, out EMPTY b, inout EMPTY c, in EMPTY d, in psa_egress_output_metadata_t e, in psa_egress_deparser_input_metadata_t f) { + apply { + } +} + +IngressPipeline(MyIP(), MyIC(), MyID()) ip; + +EgressPipeline(MyEP(), MyEC(), MyED()) ep; + +PSA_Switch(ip, PacketReplicationEngine(), ep, BufferingQueueingEngine()) main; + diff --git a/testdata/p4_16_samples_outputs/psa-switch-expression-without-default-frontend.p4 b/testdata/p4_16_samples_outputs/psa-switch-expression-without-default-frontend.p4 new file mode 100644 index 00000000000..dd08af5498a --- /dev/null +++ b/testdata/p4_16_samples_outputs/psa-switch-expression-without-default-frontend.p4 @@ -0,0 +1,168 @@ +#include +#include + +struct EMPTY { +} + +typedef bit<48> EthernetAddress; +struct user_meta_t { + bit<16> data; + bit<16> data1; +} + +header ethernet_t { + EthernetAddress dstAddr; + EthernetAddress srcAddr; + bit<16> etherType; +} + +header ipv4_t { + bit<4> version; + bit<4> ihl; + bit<8> diffserv; + bit<16> totalLen; + bit<16> identification; + bit<3> flags; + bit<13> fragOffset; + bit<8> ttl; + bit<8> protocol; + bit<16> hdrChecksum; + bit<32> srcAddr; + bit<32> dstAddr; + bit<80> newfield; +} + +header tcp_t { + bit<16> srcPort; + bit<16> dstPort; + bit<32> seqNo; + bit<32> ackNo; + bit<4> dataOffset; + bit<3> res; + bit<3> ecn; + bit<6> ctrl; + bit<16> window; + bit<16> checksum; + bit<16> urgentPtr; +} + +struct headers_t { + ethernet_t ethernet; + ipv4_t ipv4; + tcp_t tcp; +} + +parser MyIP(packet_in buffer, out headers_t hdr, inout user_meta_t b, in psa_ingress_parser_input_metadata_t c, in EMPTY d, in EMPTY e) { + state start { + buffer.extract(hdr.ethernet); + transition select(hdr.ethernet.etherType) { + 16w0x800 &&& 16w0xf00: parse_ipv4; + 16w0xd00: parse_tcp; + default: accept; + } + } + state parse_ipv4 { + buffer.extract(hdr.ipv4); + transition select(hdr.ipv4.protocol) { + 8w4 .. 8w7: parse_tcp; + default: accept; + } + } + state parse_tcp { + buffer.extract(hdr.tcp); + transition accept; + } +} + +parser MyEP(packet_in buffer, out EMPTY a, inout EMPTY b, in psa_egress_parser_input_metadata_t c, in EMPTY d, in EMPTY e, in EMPTY f) { + state start { + transition accept; + } +} + +control MyIC(inout headers_t hdr, inout user_meta_t b, in psa_ingress_input_metadata_t c, inout psa_ingress_output_metadata_t d) { + @name("MyIC.tmp") bit<16> tmp_0; + @noWarn("unused") @name(".NoAction") action NoAction_1() { + } + @noWarn("unused") @name(".NoAction") action NoAction_2() { + } + @noWarn("unused") @name(".NoAction") action NoAction_3() { + } + @name("MyIC.a1") action a1(@name("param") bit<48> param) { + hdr.ethernet.dstAddr = param; + } + @name("MyIC.a2") action a2(@name("param") bit<16> param_2) { + hdr.ethernet.etherType = param_2; + } + @name("MyIC.tbl") table tbl_0 { + key = { + hdr.ethernet.srcAddr: exact @name("hdr.ethernet.srcAddr") ; + b.data : lpm @name("b.data") ; + } + actions = { + NoAction_1(); + a1(); + a2(); + } + default_action = NoAction_1(); + } + @name("MyIC.foo") table foo_0 { + actions = { + NoAction_2(); + } + default_action = NoAction_2(); + } + @name("MyIC.bar") table bar_0 { + actions = { + NoAction_3(); + } + default_action = NoAction_3(); + } + apply { + tmp_0 = 16w16; + switch (tmp_0) { + 16w16: + 16w32: { + tmp_0 = 16w1; + } + 16w64: { + tmp_0 = 16w2; + } + } + switch (tbl_0.apply().action_run) { + a1: { + if (tmp_0 == 16w1) { + foo_0.apply(); + } + } + a2: { + bar_0.apply(); + } + default: { + } + } + } +} + +control MyEC(inout EMPTY a, inout EMPTY b, in psa_egress_input_metadata_t c, inout psa_egress_output_metadata_t d) { + apply { + } +} + +control MyID(packet_out buffer, out EMPTY a, out EMPTY b, out EMPTY c, inout headers_t hdr, in user_meta_t e, in psa_ingress_output_metadata_t f) { + apply { + buffer.emit(hdr.ethernet); + } +} + +control MyED(packet_out buffer, out EMPTY a, out EMPTY b, inout EMPTY c, in EMPTY d, in psa_egress_output_metadata_t e, in psa_egress_deparser_input_metadata_t f) { + apply { + } +} + +IngressPipeline(MyIP(), MyIC(), MyID()) ip; + +EgressPipeline(MyEP(), MyEC(), MyED()) ep; + +PSA_Switch(ip, PacketReplicationEngine(), ep, BufferingQueueingEngine()) main; + diff --git a/testdata/p4_16_samples_outputs/psa-switch-expression-without-default-midend.p4 b/testdata/p4_16_samples_outputs/psa-switch-expression-without-default-midend.p4 new file mode 100644 index 00000000000..47da8f2bf49 --- /dev/null +++ b/testdata/p4_16_samples_outputs/psa-switch-expression-without-default-midend.p4 @@ -0,0 +1,240 @@ +#include +#include + +struct EMPTY { +} + +typedef bit<48> EthernetAddress; +struct user_meta_t { + bit<16> data; + bit<16> data1; +} + +header ethernet_t { + EthernetAddress dstAddr; + EthernetAddress srcAddr; + bit<16> etherType; +} + +header ipv4_t { + bit<4> version; + bit<4> ihl; + bit<8> diffserv; + bit<16> totalLen; + bit<16> identification; + bit<3> flags; + bit<13> fragOffset; + bit<8> ttl; + bit<8> protocol; + bit<16> hdrChecksum; + bit<32> srcAddr; + bit<32> dstAddr; + bit<80> newfield; +} + +header tcp_t { + bit<16> srcPort; + bit<16> dstPort; + bit<32> seqNo; + bit<32> ackNo; + bit<4> dataOffset; + bit<3> res; + bit<3> ecn; + bit<6> ctrl; + bit<16> window; + bit<16> checksum; + bit<16> urgentPtr; +} + +struct headers_t { + ethernet_t ethernet; + ipv4_t ipv4; + tcp_t tcp; +} + +parser MyIP(packet_in buffer, out headers_t hdr, inout user_meta_t b, in psa_ingress_parser_input_metadata_t c, in EMPTY d, in EMPTY e) { + state start { + buffer.extract(hdr.ethernet); + transition select(hdr.ethernet.etherType) { + 16w0x800 &&& 16w0xf00: parse_ipv4; + 16w0xd00: parse_tcp; + default: accept; + } + } + state parse_ipv4 { + buffer.extract(hdr.ipv4); + transition select(hdr.ipv4.protocol) { + 8w4 &&& 8w252: parse_tcp; + default: accept; + } + } + state parse_tcp { + buffer.extract(hdr.tcp); + transition accept; + } +} + +parser MyEP(packet_in buffer, out EMPTY a, inout EMPTY b, in psa_egress_parser_input_metadata_t c, in EMPTY d, in EMPTY e, in EMPTY f) { + state start { + transition accept; + } +} + +control MyIC(inout headers_t hdr, inout user_meta_t b, in psa_ingress_input_metadata_t c, inout psa_ingress_output_metadata_t d) { + @name("MyIC.tmp") bit<16> tmp_0; + @noWarn("unused") @name(".NoAction") action NoAction_1() { + } + @noWarn("unused") @name(".NoAction") action NoAction_2() { + } + @noWarn("unused") @name(".NoAction") action NoAction_3() { + } + @name("MyIC.a1") action a1(@name("param") bit<48> param) { + hdr.ethernet.dstAddr = param; + } + @name("MyIC.a2") action a2(@name("param") bit<16> param_2) { + hdr.ethernet.etherType = param_2; + } + @name("MyIC.tbl") table tbl_0 { + key = { + hdr.ethernet.srcAddr: exact @name("hdr.ethernet.srcAddr") ; + b.data : lpm @name("b.data") ; + } + actions = { + NoAction_1(); + a1(); + a2(); + } + default_action = NoAction_1(); + } + @name("MyIC.foo") table foo_0 { + actions = { + NoAction_2(); + } + default_action = NoAction_2(); + } + @name("MyIC.bar") table bar_0 { + actions = { + NoAction_3(); + } + default_action = NoAction_3(); + } + bit<16> switch_0_key; + @hidden action switch_0_case() { + } + @hidden action switch_0_case_0() { + } + @hidden action switch_0_case_1() { + } + @hidden table switch_0_table { + key = { + switch_0_key: exact; + } + actions = { + switch_0_case(); + switch_0_case_0(); + switch_0_case_1(); + } + const default_action = switch_0_case_1(); + const entries = { + 16w16 : switch_0_case(); + 16w32 : switch_0_case(); + 16w64 : switch_0_case_0(); + } + } + @hidden action psaswitchexpressionwithoutdefault124() { + tmp_0 = 16w1; + } + @hidden action psaswitchexpressionwithoutdefault125() { + tmp_0 = 16w2; + } + @hidden action psaswitchexpressionwithoutdefault122() { + switch_0_key = 16w16; + } + @hidden action psaswitchexpressionwithoutdefault102() { + tmp_0 = 16w16; + } + @hidden table tbl_psaswitchexpressionwithoutdefault102 { + actions = { + psaswitchexpressionwithoutdefault102(); + } + const default_action = psaswitchexpressionwithoutdefault102(); + } + @hidden table tbl_psaswitchexpressionwithoutdefault122 { + actions = { + psaswitchexpressionwithoutdefault122(); + } + const default_action = psaswitchexpressionwithoutdefault122(); + } + @hidden table tbl_psaswitchexpressionwithoutdefault124 { + actions = { + psaswitchexpressionwithoutdefault124(); + } + const default_action = psaswitchexpressionwithoutdefault124(); + } + @hidden table tbl_psaswitchexpressionwithoutdefault125 { + actions = { + psaswitchexpressionwithoutdefault125(); + } + const default_action = psaswitchexpressionwithoutdefault125(); + } + apply { + tbl_psaswitchexpressionwithoutdefault102.apply(); + { + tbl_psaswitchexpressionwithoutdefault122.apply(); + switch (switch_0_table.apply().action_run) { + switch_0_case: { + tbl_psaswitchexpressionwithoutdefault124.apply(); + } + switch_0_case_0: { + tbl_psaswitchexpressionwithoutdefault125.apply(); + } + switch_0_case_1: { + } + } + } + switch (tbl_0.apply().action_run) { + a1: { + if (tmp_0 == 16w1) { + foo_0.apply(); + } + } + a2: { + bar_0.apply(); + } + default: { + } + } + } +} + +control MyEC(inout EMPTY a, inout EMPTY b, in psa_egress_input_metadata_t c, inout psa_egress_output_metadata_t d) { + apply { + } +} + +control MyID(packet_out buffer, out EMPTY a, out EMPTY b, out EMPTY c, inout headers_t hdr, in user_meta_t e, in psa_ingress_output_metadata_t f) { + @hidden action psaswitchexpressionwithoutdefault152() { + buffer.emit(hdr.ethernet); + } + @hidden table tbl_psaswitchexpressionwithoutdefault152 { + actions = { + psaswitchexpressionwithoutdefault152(); + } + const default_action = psaswitchexpressionwithoutdefault152(); + } + apply { + tbl_psaswitchexpressionwithoutdefault152.apply(); + } +} + +control MyED(packet_out buffer, out EMPTY a, out EMPTY b, inout EMPTY c, in EMPTY d, in psa_egress_output_metadata_t e, in psa_egress_deparser_input_metadata_t f) { + apply { + } +} + +IngressPipeline(MyIP(), MyIC(), MyID()) ip; + +EgressPipeline(MyEP(), MyEC(), MyED()) ep; + +PSA_Switch(ip, PacketReplicationEngine(), ep, BufferingQueueingEngine()) main; + diff --git a/testdata/p4_16_samples_outputs/psa-switch-expression-without-default.p4 b/testdata/p4_16_samples_outputs/psa-switch-expression-without-default.p4 new file mode 100644 index 00000000000..61b6edd5069 --- /dev/null +++ b/testdata/p4_16_samples_outputs/psa-switch-expression-without-default.p4 @@ -0,0 +1,157 @@ +#include +#include + +struct EMPTY { +} + +typedef bit<48> EthernetAddress; +struct user_meta_t { + bit<16> data; + bit<16> data1; +} + +header ethernet_t { + EthernetAddress dstAddr; + EthernetAddress srcAddr; + bit<16> etherType; +} + +header ipv4_t { + bit<4> version; + bit<4> ihl; + bit<8> diffserv; + bit<16> totalLen; + bit<16> identification; + bit<3> flags; + bit<13> fragOffset; + bit<8> ttl; + bit<8> protocol; + bit<16> hdrChecksum; + bit<32> srcAddr; + bit<32> dstAddr; + bit<80> newfield; +} + +header tcp_t { + bit<16> srcPort; + bit<16> dstPort; + bit<32> seqNo; + bit<32> ackNo; + bit<4> dataOffset; + bit<3> res; + bit<3> ecn; + bit<6> ctrl; + bit<16> window; + bit<16> checksum; + bit<16> urgentPtr; +} + +struct headers_t { + ethernet_t ethernet; + ipv4_t ipv4; + tcp_t tcp; +} + +parser MyIP(packet_in buffer, out headers_t hdr, inout user_meta_t b, in psa_ingress_parser_input_metadata_t c, in EMPTY d, in EMPTY e) { + state start { + buffer.extract(hdr.ethernet); + transition select(hdr.ethernet.etherType) { + 0x800 &&& 0xf00: parse_ipv4; + 16w0xd00: parse_tcp; + default: accept; + } + } + state parse_ipv4 { + buffer.extract(hdr.ipv4); + transition select(hdr.ipv4.protocol) { + 8w4 .. 8w7: parse_tcp; + default: accept; + } + } + state parse_tcp { + buffer.extract(hdr.tcp); + transition accept; + } +} + +parser MyEP(packet_in buffer, out EMPTY a, inout EMPTY b, in psa_egress_parser_input_metadata_t c, in EMPTY d, in EMPTY e, in EMPTY f) { + state start { + transition accept; + } +} + +control MyIC(inout headers_t hdr, inout user_meta_t b, in psa_ingress_input_metadata_t c, inout psa_ingress_output_metadata_t d) { + bit<16> tmp = 16; + action a1(bit<48> param) { + hdr.ethernet.dstAddr = param; + } + action a2(bit<16> param) { + hdr.ethernet.etherType = param; + } + table tbl { + key = { + hdr.ethernet.srcAddr: exact; + b.data : lpm; + } + actions = { + NoAction; + a1; + a2; + } + } + table foo { + actions = { + NoAction; + } + } + table bar { + actions = { + NoAction; + } + } + apply { + switch (tmp) { + 16: + 32: { + tmp = 1; + } + 64: { + tmp = 2; + } + 92: + } + switch (tbl.apply().action_run) { + a1: { + if (tmp == 1) { + foo.apply(); + } + } + a2: { + bar.apply(); + } + } + } +} + +control MyEC(inout EMPTY a, inout EMPTY b, in psa_egress_input_metadata_t c, inout psa_egress_output_metadata_t d) { + apply { + } +} + +control MyID(packet_out buffer, out EMPTY a, out EMPTY b, out EMPTY c, inout headers_t hdr, in user_meta_t e, in psa_ingress_output_metadata_t f) { + apply { + buffer.emit(hdr.ethernet); + } +} + +control MyED(packet_out buffer, out EMPTY a, out EMPTY b, inout EMPTY c, in EMPTY d, in psa_egress_output_metadata_t e, in psa_egress_deparser_input_metadata_t f) { + apply { + } +} + +IngressPipeline(MyIP(), MyIC(), MyID()) ip; + +EgressPipeline(MyEP(), MyEC(), MyED()) ep; + +PSA_Switch(ip, PacketReplicationEngine(), ep, BufferingQueueingEngine()) main; + diff --git a/testdata/p4_16_samples_outputs/psa-switch-expression-without-default.p4-error b/testdata/p4_16_samples_outputs/psa-switch-expression-without-default.p4-error new file mode 100644 index 00000000000..9f27d2c89c9 --- /dev/null +++ b/testdata/p4_16_samples_outputs/psa-switch-expression-without-default.p4-error @@ -0,0 +1,7 @@ +psa-switch-expression-without-default.p4(126): [--Wwarn=missing] warning: SwitchCase: fallthrough with no statement + 92: + ^^ +psa-switch-expression-without-default.p4(102): [--Wwarn=mismatch] warning: 16w16: constant expression in switch + bit<16> tmp = 16; + ^^ +[--Wwarn=mismatch] warning: Mismatched header/metadata struct for key elements in table tbl. Copying all match fields to metadata diff --git a/testdata/p4_16_samples_outputs/psa-switch-expression-without-default.p4-stderr b/testdata/p4_16_samples_outputs/psa-switch-expression-without-default.p4-stderr new file mode 100644 index 00000000000..76a44b03b04 --- /dev/null +++ b/testdata/p4_16_samples_outputs/psa-switch-expression-without-default.p4-stderr @@ -0,0 +1,6 @@ +psa-switch-expression-without-default.p4(126): [--Wwarn=missing] warning: SwitchCase: fallthrough with no statement + 92: + ^^ +psa-switch-expression-without-default.p4(102): [--Wwarn=mismatch] warning: 16w16: constant expression in switch + bit<16> tmp = 16; + ^^ diff --git a/testdata/p4_16_samples_outputs/psa-switch-expression-without-default.p4.bfrt.json b/testdata/p4_16_samples_outputs/psa-switch-expression-without-default.p4.bfrt.json new file mode 100644 index 00000000000..26e24e07895 --- /dev/null +++ b/testdata/p4_16_samples_outputs/psa-switch-expression-without-default.p4.bfrt.json @@ -0,0 +1,137 @@ +{ + "schema_version" : "1.0.0", + "tables" : [ + { + "name" : "ip.MyIC.tbl", + "id" : 39967501, + "table_type" : "MatchAction_Direct", + "size" : 1024, + "annotations" : [], + "depends_on" : [], + "has_const_default_action" : false, + "key" : [ + { + "id" : 1, + "name" : "hdr.ethernet.srcAddr", + "repeated" : false, + "annotations" : [], + "mandatory" : false, + "match_type" : "Exact", + "type" : { + "type" : "bytes", + "width" : 48 + } + }, + { + "id" : 2, + "name" : "b.data", + "repeated" : false, + "annotations" : [], + "mandatory" : false, + "match_type" : "LPM", + "type" : { + "type" : "bytes", + "width" : 16 + } + } + ], + "action_specs" : [ + { + "id" : 21257015, + "name" : "NoAction", + "action_scope" : "TableAndDefault", + "annotations" : [], + "data" : [] + }, + { + "id" : 21832421, + "name" : "MyIC.a1", + "action_scope" : "TableAndDefault", + "annotations" : [], + "data" : [ + { + "id" : 1, + "name" : "param", + "repeated" : false, + "mandatory" : true, + "read_only" : false, + "annotations" : [], + "type" : { + "type" : "bytes", + "width" : 48 + } + } + ] + }, + { + "id" : 23466264, + "name" : "MyIC.a2", + "action_scope" : "TableAndDefault", + "annotations" : [], + "data" : [ + { + "id" : 1, + "name" : "param", + "repeated" : false, + "mandatory" : true, + "read_only" : false, + "annotations" : [], + "type" : { + "type" : "bytes", + "width" : 16 + } + } + ] + } + ], + "data" : [], + "supported_operations" : [], + "attributes" : ["EntryScope"] + }, + { + "name" : "ip.MyIC.foo", + "id" : 49266188, + "table_type" : "MatchAction_Direct", + "size" : 1024, + "annotations" : [], + "depends_on" : [], + "has_const_default_action" : false, + "key" : [], + "action_specs" : [ + { + "id" : 21257015, + "name" : "NoAction", + "action_scope" : "TableAndDefault", + "annotations" : [], + "data" : [] + } + ], + "data" : [], + "supported_operations" : [], + "attributes" : ["EntryScope"] + }, + { + "name" : "ip.MyIC.bar", + "id" : 49390123, + "table_type" : "MatchAction_Direct", + "size" : 1024, + "annotations" : [], + "depends_on" : [], + "has_const_default_action" : false, + "key" : [], + "action_specs" : [ + { + "id" : 21257015, + "name" : "NoAction", + "action_scope" : "TableAndDefault", + "annotations" : [], + "data" : [] + } + ], + "data" : [], + "supported_operations" : [], + "attributes" : ["EntryScope"] + } + ], + "learn_filters" : [] +} \ No newline at end of file diff --git a/testdata/p4_16_samples_outputs/psa-switch-expression-without-default.p4.entries.txt b/testdata/p4_16_samples_outputs/psa-switch-expression-without-default.p4.entries.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/testdata/p4_16_samples_outputs/psa-switch-expression-without-default.p4.p4info.txt b/testdata/p4_16_samples_outputs/psa-switch-expression-without-default.p4.p4info.txt new file mode 100644 index 00000000000..766b5076b65 --- /dev/null +++ b/testdata/p4_16_samples_outputs/psa-switch-expression-without-default.p4.p4info.txt @@ -0,0 +1,88 @@ +pkg_info { + arch: "psa" +} +tables { + preamble { + id: 39967501 + name: "MyIC.tbl" + alias: "tbl" + } + match_fields { + id: 1 + name: "hdr.ethernet.srcAddr" + bitwidth: 48 + match_type: EXACT + } + match_fields { + id: 2 + name: "b.data" + bitwidth: 16 + match_type: LPM + } + action_refs { + id: 21257015 + } + action_refs { + id: 21832421 + } + action_refs { + id: 23466264 + } + size: 1024 +} +tables { + preamble { + id: 49266188 + name: "MyIC.foo" + alias: "foo" + } + action_refs { + id: 21257015 + } + size: 1024 +} +tables { + preamble { + id: 49390123 + name: "MyIC.bar" + alias: "bar" + } + action_refs { + id: 21257015 + } + size: 1024 +} +actions { + preamble { + id: 21257015 + name: "NoAction" + alias: "NoAction" + annotations: "@noWarn(\"unused\")" + } +} +actions { + preamble { + id: 21832421 + name: "MyIC.a1" + alias: "a1" + } + params { + id: 1 + name: "param" + bitwidth: 48 + } +} +actions { + preamble { + id: 23466264 + name: "MyIC.a2" + alias: "a2" + } + params { + id: 1 + name: "param" + bitwidth: 16 + } +} +type_info { +} diff --git a/testdata/p4_16_samples_outputs/psa-switch-expression-without-default.p4.spec b/testdata/p4_16_samples_outputs/psa-switch-expression-without-default.p4.spec new file mode 100644 index 00000000000..b7d8b8e21f2 --- /dev/null +++ b/testdata/p4_16_samples_outputs/psa-switch-expression-without-default.p4.spec @@ -0,0 +1,220 @@ + + + +struct ethernet_t { + bit<48> dstAddr + bit<48> srcAddr + bit<16> etherType +} + +struct ipv4_t { + bit<4> version + bit<4> ihl + bit<8> diffserv + bit<16> totalLen + bit<16> identification + bit<3> flags + bit<13> fragOffset + bit<8> ttl + bit<8> protocol + bit<16> hdrChecksum + bit<32> srcAddr + bit<32> dstAddr + bit<80> newfield +} + +struct tcp_t { + bit<16> srcPort + bit<16> dstPort + bit<32> seqNo + bit<32> ackNo + bit<4> dataOffset + bit<3> res + bit<3> ecn + bit<6> ctrl + bit<16> window + bit<16> checksum + bit<16> urgentPtr +} + +struct a1_arg_t { + bit<48> param +} + +struct a2_arg_t { + bit<16> param +} + +struct user_meta_t { + bit<32> psa_ingress_parser_input_metadata_ingress_port + bit<32> psa_ingress_parser_input_metadata_packet_path + bit<32> psa_egress_parser_input_metadata_egress_port + bit<32> psa_egress_parser_input_metadata_packet_path + bit<32> psa_ingress_input_metadata_ingress_port + bit<32> psa_ingress_input_metadata_packet_path + bit<64> psa_ingress_input_metadata_ingress_timestamp + bit<8> psa_ingress_input_metadata_parser_error + bit<8> psa_ingress_output_metadata_class_of_service + bit<8> psa_ingress_output_metadata_clone + bit<16> psa_ingress_output_metadata_clone_session_id + bit<8> psa_ingress_output_metadata_drop + bit<8> psa_ingress_output_metadata_resubmit + bit<32> psa_ingress_output_metadata_multicast_group + bit<32> psa_ingress_output_metadata_egress_port + bit<8> psa_egress_input_metadata_class_of_service + bit<32> psa_egress_input_metadata_egress_port + bit<32> psa_egress_input_metadata_packet_path + bit<16> psa_egress_input_metadata_instance + bit<64> psa_egress_input_metadata_egress_timestamp + bit<8> psa_egress_input_metadata_parser_error + bit<32> psa_egress_deparser_input_metadata_egress_port + bit<8> psa_egress_output_metadata_clone + bit<16> psa_egress_output_metadata_clone_session_id + bit<8> psa_egress_output_metadata_drop + bit<16> local_metadata_data + bit<16> local_metadata_data1 + bit<16> Ingress_tmp_0 + bit<16> Ingress_switch_0_key + bit<48> Ingress_tbl_ethernet_srcAddr + bit<16> tmpMask + bit<8> tmpMask_0 +} +metadata instanceof user_meta_t + +header ethernet instanceof ethernet_t +header ipv4 instanceof ipv4_t +header tcp instanceof tcp_t + +struct psa_ingress_output_metadata_t { + bit<8> class_of_service + bit<8> clone + bit<16> clone_session_id + bit<8> drop + bit<8> resubmit + bit<32> multicast_group + bit<32> egress_port +} + +struct psa_egress_output_metadata_t { + bit<8> clone + bit<16> clone_session_id + bit<8> drop +} + +struct psa_egress_deparser_input_metadata_t { + bit<32> egress_port +} + +action NoAction args none { + return +} + +action a1 args instanceof a1_arg_t { + mov h.ethernet.dstAddr t.param + return +} + +action a2 args instanceof a2_arg_t { + mov h.ethernet.etherType t.param + return +} + +action switch_0_case args none { + return +} + +action switch_0_case_0 args none { + return +} + +action switch_0_case_1 args none { + return +} + +table tbl { + key { + m.Ingress_tbl_ethernet_srcAddr exact + m.local_metadata_data lpm + } + actions { + NoAction + a1 + a2 + } + default_action NoAction args none + size 0x10000 +} + + +table foo { + actions { + NoAction + } + default_action NoAction args none + size 0x10000 +} + + +table bar { + actions { + NoAction + } + default_action NoAction args none + size 0x10000 +} + + +table switch_0_table { + key { + m.Ingress_switch_0_key exact + } + actions { + switch_0_case + switch_0_case_0 + switch_0_case_1 + } + default_action switch_0_case_1 args none + size 0x10000 +} + + +apply { + rx m.psa_ingress_input_metadata_ingress_port + mov m.psa_ingress_output_metadata_drop 0x0 + extract h.ethernet + mov m.tmpMask h.ethernet.etherType + and m.tmpMask 0xf00 + jmpeq MYIP_PARSE_IPV4 m.tmpMask 0x800 + jmpeq MYIP_PARSE_TCP h.ethernet.etherType 0xd00 + jmp MYIP_ACCEPT + MYIP_PARSE_IPV4 : extract h.ipv4 + mov m.tmpMask_0 h.ipv4.protocol + and m.tmpMask_0 0xfc + jmpeq MYIP_PARSE_TCP m.tmpMask_0 0x4 + jmp MYIP_ACCEPT + MYIP_PARSE_TCP : extract h.tcp + MYIP_ACCEPT : mov m.Ingress_tmp_0 0x10 + mov m.Ingress_switch_0_key 0x10 + jmpa LABEL_ACTION switch_0_case + jmpa LABEL_ACTION_0 switch_0_case_0 + jmpa LABEL_ENDSWITCH switch_0_case_1 + jmp LABEL_ENDSWITCH + LABEL_ACTION : mov m.Ingress_tmp_0 0x1 + jmp LABEL_ENDSWITCH + LABEL_ACTION_0 : mov m.Ingress_tmp_0 0x2 + LABEL_ENDSWITCH : mov m.Ingress_tbl_ethernet_srcAddr h.ethernet.srcAddr + jmpa LABEL_ACTION_2 a1 + jmpa LABEL_ACTION_3 a2 + jmp LABEL_ENDSWITCH_0 + LABEL_ACTION_2 : jmpneq LABEL_ENDSWITCH_0 m.Ingress_tmp_0 0x1 + table foo + jmp LABEL_ENDSWITCH_0 + jmp LABEL_ENDSWITCH_0 + LABEL_ACTION_3 : table bar + LABEL_ENDSWITCH_0 : jmpneq LABEL_DROP m.psa_ingress_output_metadata_drop 0x0 + emit h.ethernet + tx m.psa_ingress_output_metadata_egress_port + LABEL_DROP : drop +} + + diff --git a/testdata/p4_16_samples_outputs/v1model-special-ops-bmv2-first.p4 b/testdata/p4_16_samples_outputs/v1model-special-ops-bmv2-first.p4 index bfca126cbac..756cce9b39b 100644 --- a/testdata/p4_16_samples_outputs/v1model-special-ops-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/v1model-special-ops-bmv2-first.p4 @@ -219,3 +219,4 @@ control computeChecksum(inout headers_t hdr, inout meta_t meta) { } V1Switch(ParserImpl(), verifyChecksum(), ingress(), egress(), computeChecksum(), DeparserImpl()) main; + diff --git a/testdata/p4_16_samples_outputs/v1model-special-ops-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/v1model-special-ops-bmv2-frontend.p4 index 1252d863dc1..920affe87e1 100644 --- a/testdata/p4_16_samples_outputs/v1model-special-ops-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/v1model-special-ops-bmv2-frontend.p4 @@ -229,3 +229,4 @@ control computeChecksum(inout headers_t hdr, inout meta_t meta) { } V1Switch(ParserImpl(), verifyChecksum(), ingress(), egress(), computeChecksum(), DeparserImpl()) main; + diff --git a/testdata/p4_16_samples_outputs/v1model-special-ops-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/v1model-special-ops-bmv2-midend.p4 index 91505d559d0..4b5bb2623f3 100644 --- a/testdata/p4_16_samples_outputs/v1model-special-ops-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/v1model-special-ops-bmv2-midend.p4 @@ -355,3 +355,4 @@ control computeChecksum(inout headers_t hdr, inout meta_t meta) { } V1Switch(ParserImpl(), verifyChecksum(), ingress(), egress(), computeChecksum(), DeparserImpl()) main; + diff --git a/testdata/p4_16_samples_outputs/v1model-special-ops-bmv2.p4 b/testdata/p4_16_samples_outputs/v1model-special-ops-bmv2.p4 index d2d398d580d..1aa90ac48d5 100644 --- a/testdata/p4_16_samples_outputs/v1model-special-ops-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/v1model-special-ops-bmv2.p4 @@ -217,3 +217,4 @@ control computeChecksum(inout headers_t hdr, inout meta_t meta) { } V1Switch(ParserImpl(), verifyChecksum(), ingress(), egress(), computeChecksum(), DeparserImpl()) main; +