From c43a6168d6eee105c911c97bf5bbab9157cfbd84 Mon Sep 17 00:00:00 2001 From: Mihai Budiu Date: Thu, 16 Sep 2021 17:56:33 -0700 Subject: [PATCH 01/11] Rebased version of #1698 --- backends/bmv2/CMakeLists.txt | 13 - backends/bmv2/common/JsonObjects.cpp | 2 +- backends/bmv2/common/annotations.h | 1 + backends/bmv2/common/backend.h | 12 +- backends/bmv2/common/extern.cpp | 27 +- backends/bmv2/common/header.cpp | 12 +- backends/bmv2/common/helpers.cpp | 131 ++++++- backends/bmv2/common/helpers.h | 8 + backends/bmv2/common/programStructure.h | 8 +- backends/bmv2/psa_switch/psaSwitch.cpp | 3 +- backends/bmv2/simple_switch/simpleSwitch.cpp | 333 ++++++++++-------- backends/bmv2/simple_switch/simpleSwitch.h | 2 + frontends/p4/fromv1.0/converters.cpp | 47 ++- frontends/p4/fromv1.0/converters.h | 14 +- frontends/p4/fromv1.0/programStructure.cpp | 145 ++++++-- frontends/p4/fromv1.0/programStructure.h | 11 + frontends/p4/typeChecking/typeChecker.cpp | 3 + ir/base.def | 7 + midend/eliminateSerEnums.cpp | 5 +- midend/flattenInterfaceStructs.cpp | 17 +- midend/flattenInterfaceStructs.h | 1 + p4include/v1model.p4 | 54 +-- .../p4_14_errors_outputs/issue747.p4-stderr | 5 +- testdata/p4_14_samples_outputs/acl1-midend.p4 | 12 + .../copy_to_cpu-first.p4 | 6 +- .../copy_to_cpu-frontend.p4 | 6 +- .../copy_to_cpu-midend.p4 | 6 +- testdata/p4_14_samples_outputs/copy_to_cpu.p4 | 6 +- .../p414-special-ops-2-bmv2-first.p4 | 17 +- .../p414-special-ops-2-bmv2-frontend.p4 | 17 +- .../p414-special-ops-2-bmv2-midend.p4 | 20 +- .../p414-special-ops-2-bmv2.p4 | 17 +- .../p414-special-ops-3-bmv2-first.p4 | 16 +- .../p414-special-ops-3-bmv2-frontend.p4 | 16 +- .../p414-special-ops-3-bmv2-midend.p4 | 19 +- .../p414-special-ops-3-bmv2.p4 | 16 +- .../p414-special-ops-first.p4 | 16 +- .../p414-special-ops-frontend.p4 | 16 +- .../p414-special-ops-midend.p4 | 19 +- .../p4_14_samples_outputs/p414-special-ops.p4 | 16 +- .../packet_redirect-first.p4 | 14 +- .../packet_redirect-frontend.p4 | 14 +- .../packet_redirect-midend.p4 | 17 +- .../p4_14_samples_outputs/packet_redirect.p4 | 14 +- .../p4_14_samples_outputs/resubmit-first.p4 | 7 +- .../resubmit-frontend.p4 | 7 +- .../p4_14_samples_outputs/resubmit-midend.p4 | 9 +- testdata/p4_14_samples_outputs/resubmit.p4 | 7 +- .../p4_14_samples_outputs/simple_nat-first.p4 | 6 +- .../simple_nat-frontend.p4 | 6 +- .../simple_nat-midend.p4 | 18 +- testdata/p4_14_samples_outputs/simple_nat.p4 | 6 +- .../switch_20160512/switch-first.p4 | 37 +- .../switch_20160512/switch-frontend.p4 | 41 ++- .../switch_20160512/switch-midend.p4 | 100 +++--- .../switch_20160512/switch.p4 | 37 +- .../issue1557-bmv2.p4-stderr | 2 +- .../p4_16_errors_outputs/issue513.p4-stderr | 2 +- testdata/p4_16_samples/issue1001-bmv2.p4 | 4 +- testdata/p4_16_samples/issue1043-bmv2.p4 | 2 +- testdata/p4_16_samples/issue1642-bmv2.p4 | 27 +- testdata/p4_16_samples/issue1653-bmv2.p4 | 3 +- .../p4_16_samples/issue1653-complex-bmv2.p4 | 3 +- testdata/p4_16_samples/issue1660-bmv2.p4 | 3 +- testdata/p4_16_samples/issue1765-1-bmv2.p4 | 9 +- testdata/p4_16_samples/issue383-bmv2.p4 | 35 +- testdata/p4_16_samples/issue562-bmv2.p4 | 5 +- .../p4_16_samples/v1model-special-ops-bmv2.p4 | 8 +- .../invalid-hdr-warnings3.p4 | 1 + .../issue1001-bmv2-first.p4 | 4 +- .../issue1001-bmv2-frontend.p4 | 4 +- .../issue1001-bmv2-midend.p4 | 4 +- .../p4_16_samples_outputs/issue1001-bmv2.p4 | 4 +- .../issue1001-bmv2.p4-stderr | 3 - .../issue1043-bmv2-first.p4 | 2 +- .../issue1043-bmv2-frontend.p4 | 2 +- .../issue1043-bmv2-midend.p4 | 2 +- .../p4_16_samples_outputs/issue1043-bmv2.p4 | 2 +- .../p4_16_samples_outputs/issue1541.p4-stderr | 2 +- .../issue1642-bmv2-first.p4 | 3 +- .../issue1642-bmv2-frontend.p4 | 3 +- .../issue1642-bmv2-midend.p4 | 16 +- .../p4_16_samples_outputs/issue1642-bmv2.p4 | 3 +- .../issue1653-bmv2-first.p4 | 2 +- .../issue1653-bmv2-frontend.p4 | 2 +- .../issue1653-bmv2-midend.p4 | 2 +- .../p4_16_samples_outputs/issue1653-bmv2.p4 | 2 +- .../issue1653-bmv2.p4-stderr | 2 +- .../issue1653-complex-bmv2-first.p4 | 3 +- .../issue1653-complex-bmv2-frontend.p4 | 3 +- .../issue1653-complex-bmv2-midend.p4 | 34 +- .../issue1653-complex-bmv2.p4 | 3 +- .../issue1653-complex-bmv2.p4-stderr | 6 +- .../issue1660-bmv2-first.p4 | 3 +- .../issue1660-bmv2-frontend.p4 | 5 +- .../issue1660-bmv2-midend.p4 | 15 +- .../p4_16_samples_outputs/issue1660-bmv2.p4 | 3 +- .../issue1765-1-bmv2-first.p4 | 9 +- .../issue1765-1-bmv2-frontend.p4 | 13 +- .../issue1765-1-bmv2-midend.p4 | 23 +- .../p4_16_samples_outputs/issue1765-1-bmv2.p4 | 9 +- .../issue1765-1-bmv2.p4-stderr | 8 +- .../issue2176-bmv2.p4-stderr | 4 +- .../issue383-bmv2-first.p4 | 3 +- .../issue383-bmv2-frontend.p4 | 3 +- .../issue383-bmv2-midend.p4 | 26 +- .../p4_16_samples_outputs/issue383-bmv2.p4 | 3 +- .../issue383-bmv2.p4-stderr | 4 +- .../issue562-bmv2-first.p4 | 3 +- .../issue562-bmv2-frontend.p4 | 3 +- .../issue562-bmv2-midend.p4 | 16 +- .../p4_16_samples_outputs/issue562-bmv2.p4 | 3 +- .../p4_16_samples_outputs/issue841.p4-stderr | 2 +- .../methodArgDontcare.p4 | 2 +- ...ey-consolidation-mixed-keys-4.p4.bfrt.json | 2 +- .../v1model-special-ops-bmv2-first.p4 | 8 +- .../v1model-special-ops-bmv2-frontend.p4 | 8 +- .../v1model-special-ops-bmv2-midend.p4 | 17 +- .../v1model-special-ops-bmv2.p4 | 8 +- 119 files changed, 1205 insertions(+), 657 deletions(-) diff --git a/backends/bmv2/CMakeLists.txt b/backends/bmv2/CMakeLists.txt index 6ce93f7f881..ceb0d590999 100644 --- a/backends/bmv2/CMakeLists.txt +++ b/backends/bmv2/CMakeLists.txt @@ -158,19 +158,6 @@ set (XFAIL_TESTS testdata/p4_14_samples/issue60.p4 # compiler claims (incorrectly?) that c2 has mulitple successors, so is not supported testdata/p4_14_samples/issue-1426.p4 - # As of 2019-Feb-04 latest p4c code, this program fails due to the - # root cause of both issues #1694 and #1669. I have tested it with - # the proposed fix for issue #1694 that is on PR #1704, and while - # that does make the produced BMv2 JSON file able to cause packets - # to be recirculated, resubmitted, etc. it still has the bug of not - # preserving the metadata specified in the program's field_lists, so - # the STF tests fail because of issue #1669. As of this writing, - # these programs rely for - # successful execution on the preservation of metadata across - # resubmit, recirculate, and/or clone operations. - testdata/p4_14_samples/p414-special-ops.p4 - testdata/p4_14_samples/p414-special-ops-2-bmv2.p4 - testdata/p4_14_samples/p414-special-ops-3-bmv2.p4 # This test uses a feature currently unsupported in the BMv2 back-end. testdata/p4_16_samples/issue907-bmv2.p4 # This test uses a table graph that is not implementable in BMv2 diff --git a/backends/bmv2/common/JsonObjects.cpp b/backends/bmv2/common/JsonObjects.cpp index 6f498346a33..5585588e3ef 100644 --- a/backends/bmv2/common/JsonObjects.cpp +++ b/backends/bmv2/common/JsonObjects.cpp @@ -231,7 +231,7 @@ unsigned JsonObjects::add_metadata(const cstring& type, const cstring& name) { auto header = new Util::JsonObject(); unsigned id = BMV2::nextId("headers"); - LOG1("add metadata header id " << id); + LOG3("add metadata header id " << id); header->emplace("name", name); header->emplace("id", id); header->emplace("header_type", type); diff --git a/backends/bmv2/common/annotations.h b/backends/bmv2/common/annotations.h index 8308af6c494..4636921733b 100644 --- a/backends/bmv2/common/annotations.h +++ b/backends/bmv2/common/annotations.h @@ -29,6 +29,7 @@ class ParseAnnotations : public P4::ParseAnnotations { public: ParseAnnotations() : P4::ParseAnnotations("BMV2", false, { PARSE_EMPTY("metadata"), + PARSE_EXPRESSION_LIST("field_list"), PARSE("alias", StringLiteral), PARSE("priority", Constant) }) { } diff --git a/backends/bmv2/common/backend.h b/backends/bmv2/common/backend.h index 6305e9ba038..cb0631e4138 100644 --- a/backends/bmv2/common/backend.h +++ b/backends/bmv2/common/backend.h @@ -122,6 +122,7 @@ class RenameUserMetadata : public Transform { // Used as a prefix for the fields of the userMetadata structure // and also as a name for the userMetadata type clone. cstring namePrefix; + bool renamed = false; public: RenameUserMetadata(P4::ReferenceMap* refMap, @@ -131,11 +132,13 @@ class RenameUserMetadata : public Transform { const IR::Node* postorder(IR::Type_Struct* type) override { // Clone the user metadata type - if (userMetaType != getOriginal()) + auto orig = getOriginal(); + if (userMetaType->name != orig->name) return type; auto vec = new IR::IndexedVector(); - LOG2("Creating clone" << getOriginal()); + LOG2("Creating clone of " << orig); + renamed = true; auto clone = type->clone(); clone->name = namePrefix; vec->push_back(clone); @@ -180,6 +183,11 @@ class RenameUserMetadata : public Transform { LOG2("Replacing reference with " << type); return type; } + + void end_apply(const IR::Node*) override { + BUG_CHECK(renamed, "Could not identify user metadata type declaration %1%", + userMetaType); + } }; } // namespace BMV2 diff --git a/backends/bmv2/common/extern.cpp b/backends/bmv2/common/extern.cpp index 8aeec93d4cb..1e0520a61c6 100644 --- a/backends/bmv2/common/extern.cpp +++ b/backends/bmv2/common/extern.cpp @@ -221,29 +221,10 @@ ExternConverter::createCalculation(ConversionContext* ctxt, if (sourcePositionNode != nullptr) calc->emplace_non_null("source_info", sourcePositionNode->sourceInfoJsonObj()); calc->emplace("algo", algo); - if (!fields->is()) { - // expand it into a list - auto list = new IR::ListExpression({}); - auto type = ctxt->typeMap->getType(fields, true); - if (!type->is()) { - modelError("%1%: expected a struct", fields); - return calcName; - } - if (auto se = fields->to()) { - for (auto f : se->components) { - auto e = f->expression; - list->push_back(e); - } - } else { - for (auto f : type->to()->fields) { - auto e = new IR::Member(fields, f->name); - auto ftype = ctxt->typeMap->getType(f); - ctxt->typeMap->setType(e, ftype); - list->push_back(e); - } - } - fields = list; - ctxt->typeMap->setType(fields, type); + fields = convertToList(fields, ctxt->typeMap); + if (!fields) { + modelError("%1%: expected a struct", fields); + return calcName; } auto jright = ctxt->conv->convertWithConstantWidths(fields); if (withPayload) { diff --git a/backends/bmv2/common/header.cpp b/backends/bmv2/common/header.cpp index 13af9fd83fa..03f23b7a792 100644 --- a/backends/bmv2/common/header.cpp +++ b/backends/bmv2/common/header.cpp @@ -39,7 +39,7 @@ HeaderConverter::HeaderConverter(ConversionContext* ctxt, cstring scalarsName) * @param meta this boolean indicates if the struct is a metadata or header. */ void HeaderConverter::addTypesAndInstances(const IR::Type_StructLike* type, bool meta) { - LOG1("Adding " << type); + LOG2("Adding " << type); for (auto f : type->fields) { auto ft = ctxt->typeMap->getType(f, true); if (ft->is()) { @@ -85,7 +85,7 @@ void HeaderConverter::addTypesAndInstances(const IR::Type_StructLike* type, bool } } else if (ft->is()) { // Done elsewhere - LOG1("stack generation done elsewhere"); + LOG3("stack generation done elsewhere"); continue; } else { // Treat this field like a scalar local variable @@ -141,7 +141,7 @@ Util::JsonArray* HeaderConverter::addHeaderUnionFields( } void HeaderConverter::addHeaderStacks(const IR::Type_Struct* headersStruct) { - LOG1("Creating stack " << headersStruct); + LOG2("Creating stack " << headersStruct); for (auto f : headersStruct->fields) { auto ft = ctxt->typeMap->getType(f, true); auto stack = ft->to(); @@ -290,7 +290,7 @@ void HeaderConverter::addHeaderType(const IR::Type_StructLike *st) { } ctxt->json->add_header_type(name, fields, max_length_bytes); - LOG1("... creating aliases for metadata fields " << st); + LOG2("... creating aliases for metadata fields " << st); for (auto f : st->fields) { if (auto aliasAnnotation = f->getAnnotation("alias")) { auto container = new Util::JsonArray(); @@ -328,7 +328,7 @@ Visitor::profile_t HeaderConverter::init_apply(const IR::Node* node) { // bit, bool, error are packed into scalars type, // varbit, struct and stack introduce new header types for (auto v : ctxt->structure->variables) { - LOG1("variable " << v); + LOG2("variable " << v); auto type = ctxt->typeMap->getType(v, true); if (auto st = type->to()) { auto metadata_type = st->controlPlaneName(); @@ -443,7 +443,7 @@ void HeaderConverter::end_apply(const IR::Node*) { */ bool HeaderConverter::preorder(const IR::Parameter* param) { LOG3("convert param " << param); - //// keep track of which headers we've already generated the ctxt->json for + // keep track of which headers we've already generated in ctxt->json auto ft = ctxt->typeMap->getType(param->getNode(), true); if (ft->is()) { auto st = ft->to(); diff --git a/backends/bmv2/common/helpers.cpp b/backends/bmv2/common/helpers.cpp index d2842d35277..66d7298f004 100644 --- a/backends/bmv2/common/helpers.cpp +++ b/backends/bmv2/common/helpers.cpp @@ -78,6 +78,135 @@ unsigned nextId(cstring group) { return counters[group]++; } -} // namespace BMV2 +void +ConversionContext::addToFieldList(const IR::Expression* expr, Util::JsonArray* fl) { + if (auto le = expr->to()) { + for (auto e : le->components) { + addToFieldList(e, fl); + } + return; + } else if (auto si = expr->to()) { + for (auto e : si->components) { + addToFieldList(e->expression, fl); + } + return; + } + + auto type = typeMap->getType(expr, true); + if (type->is()) { + // recursively add all fields + auto st = type->to(); + for (auto f : st->fields) { + auto member = new IR::Member(expr, f->name); + typeMap->setType(member, typeMap->getType(f, true)); + addToFieldList(member, fl); + } + return; + } + + bool simple = conv->simpleExpressionsOnly; + conv->simpleExpressionsOnly = true; // we do not want casts d2b in field_lists + auto j = conv->convert(expr); + conv->simpleExpressionsOnly = simple; // restore state + if (auto jo = j->to()) { + if (auto t = jo->get("type")) { + if (auto type = t->to()) { + if (*type == "runtime_data") { + // Can't have runtime_data in field lists -- need hexstr instead + auto val = jo->get("value")->to(); + j = jo = new Util::JsonObject(); + jo->emplace("type", "hexstr"); + jo->emplace("value", stringRepr(val->getValue())); + } + } + } + } + fl->append(j); +} + +int +ConversionContext::createFieldList( + const IR::Expression* expr, cstring listName, bool learn) { + cstring group; + auto fl = new Util::JsonObject(); + if (learn) { + group = "learn_lists"; + json->learn_lists->append(fl); + } else { + group = "field_lists"; + json->field_lists->append(fl); + } + int id = nextId(group); + fl->emplace("id", id); + fl->emplace("name", listName); + fl->emplace_non_null("source_info", expr->sourceInfoJsonObj()); + auto elements = mkArrayField(fl, "elements"); + addToFieldList(expr, elements); + return id; +} +void +ConversionContext::modelError(const char* format, const IR::Node* node) { + ::error(format, node); + ::error("Are you using an up-to-date v1model.p4?"); +} + +cstring +ConversionContext::createCalculation(cstring algo, const IR::Expression* fields, + Util::JsonArray* calculations, bool withPayload, + const IR::Node* sourcePositionNode = nullptr) { + cstring calcName = refMap->newName("calc_"); + auto calc = new Util::JsonObject(); + calc->emplace("name", calcName); + calc->emplace("id", nextId("calculations")); + if (sourcePositionNode != nullptr) + calc->emplace_non_null("source_info", sourcePositionNode->sourceInfoJsonObj()); + calc->emplace("algo", algo); + fields = convertToList(fields, typeMap); + if (!fields) { + modelError("%1%: expected a struct", fields); + return calcName; + } + auto jright = conv->convertWithConstantWidths(fields); + if (withPayload) { + auto array = jright->to(); + BUG_CHECK(array, "expected a JSON array"); + auto payload = new Util::JsonObject(); + payload->emplace("type", "payload"); + payload->emplace("value", (Util::IJson*)nullptr); + array->append(payload); + } + calc->emplace("input", jright); + calculations->append(calc); + return calcName; +} +/// Converts expr into a ListExpression or returns nullptr if not +/// possible +const IR::ListExpression* convertToList(const IR::Expression* expr, P4::TypeMap* typeMap) { + if (auto l = expr->to()) + return l; + + // expand it into a list + auto list = new IR::ListExpression({}); + auto type = typeMap->getType(expr, true); + auto st = type->to(); + if (!st) { + return nullptr; + } + if (auto se = expr->to()) { + for (auto f : se->components) + list->push_back(f->expression); + } else { + for (auto f : st->fields) { + auto e = new IR::Member(expr, f->name); + auto ftype = typeMap->getType(f); + typeMap->setType(e, ftype); + list->push_back(e); + } + } + typeMap->setType(list, type); + return list; +} + +} // namespace BMV2 diff --git a/backends/bmv2/common/helpers.h b/backends/bmv2/common/helpers.h index ebcaaa05d8d..0d0107d50f9 100644 --- a/backends/bmv2/common/helpers.h +++ b/backends/bmv2/common/helpers.h @@ -324,6 +324,12 @@ struct ConversionContext { ExpressionConverter* conv, JsonObjects* json) : refMap(refMap), typeMap(typeMap), toplevel(toplevel), blockConverted(BlockConverted::None), structure(structure), conv(conv), json(json) { } + + void addToFieldList(const IR::Expression* expr, Util::JsonArray* fl); + int createFieldList(const IR::Expression* expr, cstring listName, bool learn = false); + cstring createCalculation(cstring algo, const IR::Expression* fields, + Util::JsonArray* calculations, bool usePayload, const IR::Node* node); + static void modelError(const char* format, const IR::Node* place); }; Util::IJson* nodeName(const CFG::Node* node); @@ -333,6 +339,8 @@ Util::JsonObject* mkPrimitive(cstring name, Util::JsonArray* appendTo); Util::JsonObject* mkPrimitive(cstring name); cstring stringRepr(big_int value, unsigned bytes = 0); unsigned nextId(cstring group); +/// Converts expr into a ListExpression or returns nullptr if not possible +const IR::ListExpression* convertToList(const IR::Expression* expr, P4::TypeMap* typeMap); } // namespace BMV2 diff --git a/backends/bmv2/common/programStructure.h b/backends/bmv2/common/programStructure.h index c0821ba7240..e38efe8616e 100644 --- a/backends/bmv2/common/programStructure.h +++ b/backends/bmv2/common/programStructure.h @@ -54,13 +54,13 @@ class ProgramStructure { // in the scalarsName metadata object, so we may need to rename // these fields. This map holds the new names. std::map scalarMetadataFields; - // All the direct meters. + /// All the direct meters. DirectMeterMap directMeterMap; - // All the direct counters. + /// All the direct counters. ordered_map directCounterMap; - // All match kinds + /// All match kinds std::set match_kinds; - // map IR node to compile-time allocated resource blocks. + /// map IR node to compile-time allocated resource blocks. ResourceMap resourceMap; ProgramStructure() {} diff --git a/backends/bmv2/psa_switch/psaSwitch.cpp b/backends/bmv2/psa_switch/psaSwitch.cpp index a50d4b54ff4..0b8289bea85 100644 --- a/backends/bmv2/psa_switch/psaSwitch.cpp +++ b/backends/bmv2/psa_switch/psaSwitch.cpp @@ -939,8 +939,7 @@ Util::IJson* ExternConverter_Digest::convertExternObject( listName = st->controlPlaneName(); } } - int id = createFieldList(ctxt, mc->arguments->at(0)->expression, "learn_lists", - listName, ctxt->json->learn_lists); + int id = ctxt->createFieldList(mc->arguments->at(0)->expression, listName, true); auto cst = new IR::Constant(id); ctxt->typeMap->setType(cst, IR::Type_Bits::get(32)); auto jcst = ctxt->conv->convert(cst); diff --git a/backends/bmv2/simple_switch/simpleSwitch.cpp b/backends/bmv2/simple_switch/simpleSwitch.cpp index bd475180f5e..26b721b65d3 100644 --- a/backends/bmv2/simple_switch/simpleSwitch.cpp +++ b/backends/bmv2/simple_switch/simpleSwitch.cpp @@ -112,8 +112,8 @@ ExternConverter_action_selector ExternConverter_action_selector::singleton; ExternConverter_log_msg ExternConverter_log_msg::singleton; Util::IJson* ExternConverter_clone::convertExternFunction( - UNUSED ConversionContext* ctxt, UNUSED const P4::ExternFunction* ef, - UNUSED const IR::MethodCallExpression* mc, UNUSED const IR::StatOrDecl* s, + ConversionContext* ctxt, UNUSED const P4::ExternFunction* ef, + const IR::MethodCallExpression* mc, UNUSED const IR::StatOrDecl* s, UNUSED const bool emitExterns) { int id = -1; if (mc->arguments->size() != 2) { @@ -122,7 +122,7 @@ Util::IJson* ExternConverter_clone::convertExternFunction( } cstring name = ctxt->refMap->newName("fl"); auto emptylist = new IR::ListExpression({}); - id = createFieldList(ctxt, emptylist, "field_lists", name, ctxt->json->field_lists); + id = ctxt->createFieldList(emptylist, name); auto cloneType = mc->arguments->at(0); auto ei = P4::EnumInstance::resolve(cloneType->expression, ctxt->typeMap); @@ -160,9 +160,33 @@ Util::IJson* ExternConverter_clone::convertExternFunction( return primitive; } +// Returns the id of the Json field list called "field_list". +static unsigned getFieldListById(ConversionContext* ctxt, unsigned index) { + cstring search = cstring("field_list") + Util::toString(index); + int id = -1; + for (auto it : *ctxt->json->field_lists) { + auto j = it->to(); + CHECK_NULL(j); + auto name = j->get("name")->to()->getString(); + if (name == search) { + id = j->get("id")->to()->getInt(); + break; + } + } + if (id == -1) { + ::warning(ErrorType::WARN_INVALID, + "no user metadata fields tagged with @field_list(%1%)", + index); + // Create an empty list. + cstring name = ctxt->refMap->newName("empty"); + id = ctxt->createFieldList(new IR::ListExpression({}), name); + } + return (unsigned)id; +} + Util::IJson* ExternConverter_clone3::convertExternFunction( ConversionContext* ctxt, UNUSED const P4::ExternFunction* ef, - UNUSED const IR::MethodCallExpression* mc, UNUSED const IR::StatOrDecl* s, + const IR::MethodCallExpression* mc, UNUSED const IR::StatOrDecl* s, UNUSED const bool emitExterns) { (void) v1model.clone.clone3.name; int id = -1; @@ -170,9 +194,7 @@ Util::IJson* ExternConverter_clone3::convertExternFunction( modelError("Expected 3 arguments for %1%", mc); return nullptr; } - cstring name = ctxt->refMap->newName("fl"); - id = createFieldList(ctxt, mc->arguments->at(2)->expression, "field_lists", name, - ctxt->json->field_lists); + auto cloneType = mc->arguments->at(0); auto ei = P4::EnumInstance::resolve(cloneType->expression, ctxt->typeMap); if (ei == nullptr) { @@ -199,24 +221,24 @@ Util::IJson* ExternConverter_clone3::convertExternFunction( primitive->emplace_non_null("source_info", mc->sourceInfoJsonObj()); parameters->append(session); - if (id >= 0) { - auto cst = new IR::Constant(id); - ctxt->typeMap->setType(cst, IR::Type_Bits::get(32)); - auto jcst = ctxt->conv->convert(cst); - parameters->append(jcst); - - // clone with a non-empty field list is not correctly implemented; give a warning - auto arr = ctxt->json->get_field_list_contents(id); - if (arr != nullptr && !arr->empty()) - ::warning(ErrorType::WARN_UNSUPPORTED, - "%1%: clone with non-empty argument not supported", mc); + auto fl = mc->arguments->at(2); + auto cst = fl->expression->to(); + if (cst == nullptr) { + modelError("%1%: Expected a constant", fl); + return nullptr; } + + id = getFieldListById(ctxt, cst->asUnsigned()); + cst = new IR::Constant(id); + ctxt->typeMap->setType(cst, IR::Type_Bits::get(32)); + auto jcst = ctxt->conv->convert(cst); + parameters->append(jcst); return primitive; } Util::IJson* ExternConverter_hash::convertExternFunction( - UNUSED ConversionContext* ctxt, UNUSED const P4::ExternFunction* ef, - UNUSED const IR::MethodCallExpression* mc, UNUSED const IR::StatOrDecl* s, + ConversionContext* ctxt, UNUSED const P4::ExternFunction* ef, + const IR::MethodCallExpression* mc, UNUSED const IR::StatOrDecl* s, UNUSED const bool emitExterns) { static std::set supportedHashAlgorithms = { v1model.algorithm.crc32.name, v1model.algorithm.crc32_custom.name, @@ -244,7 +266,7 @@ Util::IJson* ExternConverter_hash::convertExternFunction( return nullptr; } auto fields = mc->arguments->at(3); - auto calcName = createCalculation(ctxt, ei->name, fields->expression, ctxt->json->calculations, + auto calcName = ctxt->createCalculation(ei->name, fields->expression, ctxt->json->calculations, false, nullptr); calculation->emplace("type", "calculation"); calculation->emplace("value", calcName); @@ -255,8 +277,8 @@ Util::IJson* ExternConverter_hash::convertExternFunction( } Util::IJson* ExternConverter_digest::convertExternFunction( - UNUSED ConversionContext* ctxt, UNUSED const P4::ExternFunction* ef, - UNUSED const IR::MethodCallExpression* mc, UNUSED const IR::StatOrDecl* s, + ConversionContext* ctxt, UNUSED const P4::ExternFunction* ef, + const IR::MethodCallExpression* mc, UNUSED const IR::StatOrDecl* s, UNUSED const bool emitExterns) { if (mc->arguments->size() != 2) { modelError("Expected 2 arguments for %1%", mc); @@ -283,8 +305,7 @@ Util::IJson* ExternConverter_digest::convertExternFunction( listName = st->controlPlaneName(); } } - int id = createFieldList(ctxt, mc->arguments->at(1)->expression, "learn_lists", - listName, ctxt->json->learn_lists); + int id = ctxt->createFieldList(mc->arguments->at(1)->expression, listName, true); auto cst = new IR::Constant(id); ctxt->typeMap->setType(cst, IR::Type_Bits::get(32)); auto jcst = ctxt->conv->convert(cst); @@ -294,98 +315,68 @@ Util::IJson* ExternConverter_digest::convertExternFunction( Util::IJson* ExternConverter_resubmit::convertExternFunction( ConversionContext* ctxt, UNUSED const P4::ExternFunction* ef, - UNUSED const IR::MethodCallExpression* mc, UNUSED const IR::StatOrDecl* s, + const IR::MethodCallExpression* mc, UNUSED const IR::StatOrDecl* s, UNUSED const bool emitExterns) { if (ctxt->blockConverted != BlockConverted::Ingress) { ::error("'resubmit' can only be invoked in ingress %1%", mc); return nullptr; } - if (mc->arguments->size() != 1) { - modelError("Expected 1 argument for %1%", mc); - return nullptr; - } - auto primitive = mkPrimitive("resubmit"); - auto parameters = mkParameters(primitive); - primitive->emplace_non_null("source_info", mc->sourceInfoJsonObj()); - cstring listName = "resubmit"; - // If we are supplied a type argument that is a named type use - // that for the list name. - if (mc->typeArguments->size() == 1) { - auto typeArg = mc->typeArguments->at(0); - if (typeArg->is()) { - auto origType = ctxt->refMap->getDeclaration( - typeArg->to()->path, true); - if (!origType->is()) { - modelError("%1%: expected a struct type", origType->getNode()); - return nullptr; - } - auto st = origType->to(); - listName = st->controlPlaneName(); + if (mc->arguments->size() == 1) { + auto primitive = mkPrimitive("resubmit"); + auto parameters = mkParameters(primitive); + primitive->emplace_non_null("source_info", mc->sourceInfoJsonObj()); + auto arg = mc->arguments->at(0); + auto cst = arg->expression->to(); + if (cst == nullptr) { + modelError("%1%: expected a constant", arg); + return nullptr; } + unsigned index = cst->asUnsigned(); + int id = getFieldListById(ctxt, index); + cst = new IR::Constant(id); + ctxt->typeMap->setType(cst, IR::Type_Bits::get(32)); + auto jcst = ctxt->conv->convert(cst); + parameters->append(jcst); + return primitive; } - int id = createFieldList(ctxt, mc->arguments->at(0)->expression, "field_lists", - listName, ctxt->json->field_lists); - // resubmit with a non-empty field list is not correctly implemented; give a warning - auto arr = ctxt->json->get_field_list_contents(id); - if (arr != nullptr && !arr->empty()) - ::warning(ErrorType::WARN_UNSUPPORTED, - "%1%: resubmit with non-empty argument not supported", mc); - auto cst = new IR::Constant(id); - ctxt->typeMap->setType(cst, IR::Type_Bits::get(32)); - auto jcst = ctxt->conv->convert(cst); - parameters->append(jcst); - return primitive; + modelError("Expected 0 or 1 arguments for %1%", mc); + return nullptr; } Util::IJson* ExternConverter_recirculate::convertExternFunction( ConversionContext* ctxt, UNUSED const P4::ExternFunction* ef, - UNUSED const IR::MethodCallExpression* mc, UNUSED const IR::StatOrDecl* s, + const IR::MethodCallExpression* mc, UNUSED const IR::StatOrDecl* s, UNUSED const bool emitExterns) { if (ctxt->blockConverted != BlockConverted::Egress) { ::error("'resubmit' can only be invoked in egress %1%", mc); return nullptr; } - if (mc->arguments->size() != 1) { + if (mc->arguments->size() == 1) { + auto primitive = mkPrimitive("recirculate"); + auto parameters = mkParameters(primitive); + primitive->emplace_non_null("source_info", mc->sourceInfoJsonObj()); + auto arg = mc->arguments->at(0); + auto cst = arg->expression->to(); + if (cst == nullptr) { + modelError("%1%: must be a constant", arg); + return nullptr; + } + unsigned index = cst->asUnsigned(); + int id = getFieldListById(ctxt, index); + cst = new IR::Constant(id); + ctxt->typeMap->setType(cst, IR::Type_Bits::get(32)); + auto jcst = ctxt->conv->convert(cst); + parameters->append(jcst); + return primitive; + } else { modelError("Expected 1 argument for %1%", mc); return nullptr; } - auto primitive = mkPrimitive("recirculate"); - auto parameters = mkParameters(primitive); - primitive->emplace_non_null("source_info", mc->sourceInfoJsonObj()); - cstring listName = "recirculate"; - // If we are supplied a type argument that is a named type use - // that for the list name. - if (mc->typeArguments->size() == 1) { - auto typeArg = mc->typeArguments->at(0); - if (typeArg->is()) { - auto origType = ctxt->refMap->getDeclaration( - typeArg->to()->path, true); - if (!origType->is()) { - modelError("%1%: expected a struct type", origType->getNode()); - return nullptr; - } - auto st = origType->to(); - listName = st->controlPlaneName(); - } - } - int id = createFieldList(ctxt, mc->arguments->at(0)->expression, "field_lists", - listName, ctxt->json->field_lists); - // recirculate with a non-empty field list is not correctly implemented; give a warning - auto arr = ctxt->json->get_field_list_contents(id); - if (arr != nullptr && !arr->empty()) - ::warning(ErrorType::WARN_UNSUPPORTED, - "%1%: recirculate with non-empty argument not supported", mc); - - auto cst = new IR::Constant(id); - ctxt->typeMap->setType(cst, IR::Type_Bits::get(32)); - auto jcst = ctxt->conv->convert(cst); - parameters->append(jcst); - return primitive; } Util::IJson* ExternConverter_mark_to_drop::convertExternFunction( - UNUSED ConversionContext* ctxt, UNUSED const P4::ExternFunction* ef, - UNUSED const IR::MethodCallExpression* mc, UNUSED const IR::StatOrDecl* s, + ConversionContext* ctxt, UNUSED const P4::ExternFunction* ef, + const IR::MethodCallExpression* mc, UNUSED const IR::StatOrDecl* s, UNUSED const bool emitExterns) { if (mc->arguments->size() != 1) { modelError("Expected 1 argument for %1%", mc); @@ -400,8 +391,8 @@ Util::IJson* ExternConverter_mark_to_drop::convertExternFunction( } Util::IJson* ExternConverter_random::convertExternFunction( - UNUSED ConversionContext* ctxt, UNUSED const P4::ExternFunction* ef, - UNUSED const IR::MethodCallExpression* mc, UNUSED const IR::StatOrDecl* s, + ConversionContext* ctxt, UNUSED const P4::ExternFunction* ef, + const IR::MethodCallExpression* mc, UNUSED const IR::StatOrDecl* s, UNUSED const bool emitExterns) { if (mc->arguments->size() != 3) { modelError("Expected 3 arguments for %1%", mc); @@ -422,7 +413,7 @@ Util::IJson* ExternConverter_random::convertExternFunction( Util::IJson* ExternConverter_truncate::convertExternFunction( UNUSED ConversionContext* ctxt, UNUSED const P4::ExternFunction* ef, - UNUSED const IR::MethodCallExpression* mc, UNUSED const IR::StatOrDecl* s, + const IR::MethodCallExpression* mc, UNUSED const IR::StatOrDecl* s, UNUSED const bool emitExterns) { if (mc->arguments->size() != 1) { modelError("Expected 1 arguments for %1%", mc); @@ -437,8 +428,8 @@ Util::IJson* ExternConverter_truncate::convertExternFunction( } Util::IJson* ExternConverter_counter::convertExternObject( - UNUSED ConversionContext* ctxt, UNUSED const P4::ExternMethod* em, - UNUSED const IR::MethodCallExpression* mc, UNUSED const IR::StatOrDecl *s, + ConversionContext* ctxt, const P4::ExternMethod* em, + const IR::MethodCallExpression* mc, UNUSED const IR::StatOrDecl *s, UNUSED const bool& emitExterns) { if (mc->arguments->size() != 1) { modelError("Expected 1 argument for %1%", mc); @@ -457,8 +448,8 @@ Util::IJson* ExternConverter_counter::convertExternObject( } void ExternConverter_counter::convertExternInstance( - UNUSED ConversionContext* ctxt, UNUSED const IR::Declaration* c, - UNUSED const IR::ExternBlock* eb, UNUSED const bool& emitExterns) { + ConversionContext* ctxt, const IR::Declaration* c, + const IR::ExternBlock* eb, UNUSED const bool& emitExterns) { auto inst = c->to(); cstring name = inst->controlPlaneName(); auto jctr = new Util::JsonObject(); @@ -477,8 +468,8 @@ void ExternConverter_counter::convertExternInstance( } Util::IJson* ExternConverter_meter::convertExternObject( - UNUSED ConversionContext* ctxt, UNUSED const P4::ExternMethod* em, - UNUSED const IR::MethodCallExpression* mc, UNUSED const IR::StatOrDecl *s, + ConversionContext* ctxt, const P4::ExternMethod* em, + const IR::MethodCallExpression* mc, UNUSED const IR::StatOrDecl *s, UNUSED const bool& emitExterns) { if (mc->arguments->size() != 2) { modelError("Expected 2 arguments for %1%", mc); @@ -499,8 +490,8 @@ Util::IJson* ExternConverter_meter::convertExternObject( } void ExternConverter_meter::convertExternInstance( - UNUSED ConversionContext* ctxt, UNUSED const IR::Declaration* c, - UNUSED const IR::ExternBlock* eb, UNUSED const bool& emitExterns) { + ConversionContext* ctxt, const IR::Declaration* c, + const IR::ExternBlock* eb, UNUSED const bool& emitExterns) { auto inst = c->to(); cstring name = inst->controlPlaneName(); auto jmtr = new Util::JsonObject(); @@ -536,8 +527,8 @@ void ExternConverter_meter::convertExternInstance( } Util::IJson* ExternConverter_register::convertExternObject( - UNUSED ConversionContext* ctxt, UNUSED const P4::ExternMethod* em, - UNUSED const IR::MethodCallExpression* mc, UNUSED const IR::StatOrDecl *s, + ConversionContext* ctxt, const P4::ExternMethod* em, + const IR::MethodCallExpression* mc, UNUSED const IR::StatOrDecl *s, UNUSED const bool& emitExterns) { if (mc->arguments->size() != 2) { modelError("Expected 2 arguments for %1%", mc); @@ -572,8 +563,8 @@ Util::IJson* ExternConverter_register::convertExternObject( } void ExternConverter_register::convertExternInstance( - UNUSED ConversionContext* ctxt, UNUSED const IR::Declaration* c, - UNUSED const IR::ExternBlock* eb, UNUSED const bool& emitExterns) { + ConversionContext* ctxt, const IR::Declaration* c, + const IR::ExternBlock* eb, UNUSED const bool& emitExterns) { auto inst = c->to(); cstring name = inst->controlPlaneName(); auto jreg = new Util::JsonObject(); @@ -617,7 +608,7 @@ void ExternConverter_register::convertExternInstance( Util::IJson* ExternConverter_direct_counter::convertExternObject( UNUSED ConversionContext* ctxt, UNUSED const P4::ExternMethod* em, - UNUSED const IR::MethodCallExpression* mc, UNUSED const IR::StatOrDecl *s, + const IR::MethodCallExpression* mc, UNUSED const IR::StatOrDecl *s, UNUSED const bool& emitExterns) { if (mc->arguments->size() != 0) { modelError("Expected 0 argument for %1%", mc); @@ -628,8 +619,8 @@ Util::IJson* ExternConverter_direct_counter::convertExternObject( } void ExternConverter_direct_counter::convertExternInstance( - UNUSED ConversionContext* ctxt, UNUSED const IR::Declaration* c, - UNUSED const IR::ExternBlock* eb, UNUSED const bool& emitExterns) { + ConversionContext* ctxt, const IR::Declaration* c, + const IR::ExternBlock* eb, UNUSED const bool& emitExterns) { auto inst = c->to(); cstring name = inst->controlPlaneName(); auto it = ctxt->structure->directCounterMap.find(name); @@ -647,8 +638,8 @@ void ExternConverter_direct_counter::convertExternInstance( } Util::IJson* ExternConverter_direct_meter::convertExternObject( - UNUSED ConversionContext* ctxt, UNUSED const P4::ExternMethod* em, - UNUSED const IR::MethodCallExpression* mc, UNUSED const IR::StatOrDecl *s, + ConversionContext* ctxt, const P4::ExternMethod* em, + const IR::MethodCallExpression* mc, UNUSED const IR::StatOrDecl *s, UNUSED const bool& emitExterns) { if (mc->arguments->size() != 1) { modelError("Expected 1 argument for %1%", mc); @@ -661,8 +652,8 @@ Util::IJson* ExternConverter_direct_meter::convertExternObject( } void ExternConverter_direct_meter::convertExternInstance( - UNUSED ConversionContext* ctxt, UNUSED const IR::Declaration* c, - UNUSED const IR::ExternBlock* eb, UNUSED const bool& emitExterns) { + ConversionContext* ctxt, const IR::Declaration* c, + const IR::ExternBlock* eb, UNUSED const bool& emitExterns) { auto inst = c->to(); cstring name = inst->controlPlaneName(); auto info = ctxt->structure->directMeterMap.getInfo(c); @@ -720,8 +711,8 @@ void ExternConverter_direct_meter::convertExternInstance( } void ExternConverter_action_profile::convertExternInstance( - UNUSED ConversionContext* ctxt, UNUSED const IR::Declaration* c, - UNUSED const IR::ExternBlock* eb, UNUSED const bool& emitExterns) { + ConversionContext* ctxt, const IR::Declaration* c, + const IR::ExternBlock* eb, UNUSED const bool& emitExterns) { auto inst = c->to(); cstring name = inst->controlPlaneName(); // Might call this multiple times if the selector/profile is used more than @@ -779,8 +770,8 @@ void ExternConverter_action_profile::convertExternInstance( // action selector conversion is the same as action profile void ExternConverter_action_selector::convertExternInstance( - UNUSED ConversionContext* ctxt, UNUSED const IR::Declaration* c, - UNUSED const IR::ExternBlock* eb, UNUSED const bool& emitExterns) { + ConversionContext* ctxt, const IR::Declaration* c, + const IR::ExternBlock* eb, UNUSED const bool& emitExterns) { auto inst = c->to(); cstring name = inst->controlPlaneName(); // Might call this multiple times if the selector/profile is used more than @@ -836,36 +827,6 @@ void ExternConverter_action_selector::convertExternInstance( ctxt->action_profiles->append(action_profile); } -namespace { -/// Converts expr into a ListExpression or returns nullptr if not -/// possible -static const IR::ListExpression* convertToList(const IR::Expression* expr, P4::TypeMap* typeMap) { - if (auto l = expr->to()) - return l; - - // expand it into a list - auto list = new IR::ListExpression({}); - auto type = typeMap->getType(expr, true); - auto st = type->to(); - if (!st) { - return nullptr; - } - if (auto se = expr->to()) { - for (auto f : se->components) - list->push_back(f->expression); - } else { - for (auto f : st->fields) { - auto e = new IR::Member(expr, f->name); - auto ftype = typeMap->getType(f); - typeMap->setType(e, ftype); - list->push_back(e); - } - } - typeMap->setType(list, type); - return list; -} -} // namespace - Util::IJson* ExternConverter_log_msg::convertExternFunction( ConversionContext* ctxt, UNUSED const P4::ExternFunction* ef, const IR::MethodCallExpression* mc, const IR::StatOrDecl* s, @@ -1036,6 +997,72 @@ void SimpleSwitchBackend::createActions(ConversionContext* ctxt, V1ProgramStruct } } +void +SimpleSwitchBackend::createRecirculateFieldsList( + ConversionContext* ctxt, const IR::ToplevelBlock* tlb, cstring scalarName) { + auto main = tlb->getMain(); + CHECK_NULL(main); + + // Find the user metadata declaration. + // Validation has already been done, so we use BUG instead of error. + auto parser = main->findParameterValue(v1model.sw.parser.name)->to(); + CHECK_NULL(parser); + auto params = parser->container->getApplyParameters(); + BUG_CHECK(params->size() == 4, "%1%: expected 4 parameters", parser); + auto metaParam = params->parameters.at(2); + auto paramType = ctxt->typeMap->getType(metaParam, true); + auto userMetaType = paramType->to(); + LOG2("User metadata type is " << userMetaType); + + /// metadata fields may be annotated with e.g., + /// @field_list(0, 1, 4) + /// Such a field will be added to fieldLists with indexes 0, 1 and 4. + /// These fields lists will be named "field_list0", "field_list1", etc. + std::map fieldLists; + + LOG2("Scanning user metadata fields for annotations"); + for (auto f : userMetaType->fields) { + LOG3("Scanning field " << f); + auto anno = f->getAnnotations()->getSingle("field_list"); + if (anno == nullptr) + continue; + + for (auto e : anno->expr) { + auto cst = e->to(); + if (cst == nullptr) { + ::error("%1%: Annotation must be a constant integer", e); + continue; + } + + unsigned index = cst->asUnsigned(); + Util::JsonArray* elements; + auto fl = ::get(fieldLists, index); + if (fl == nullptr) { + fl = new Util::JsonObject(); + ctxt->json->field_lists->append(fl); + fieldLists.emplace(index, fl); + int id = nextId("field_lists"); + fl->emplace("id", id); + cstring listName = cstring("field_list") + Util::toString(index); + fl->emplace("name", listName); + elements = mkArrayField(fl, "elements"); + } else { + elements = fl->get("elements")->to(); + CHECK_NULL(elements); + } + + auto field = new Util::JsonObject(); + field->emplace("type", "field"); + auto value = new Util::JsonArray(); + value->append(scalarName); + auto name = ::get(ctxt->structure->scalarMetadataFields, f); + value->append(name); + field->emplace("value", value); + elements->append(field); + } + } +} + void SimpleSwitchBackend::convert(const IR::ToplevelBlock* tlb) { structure = new V1ProgramStructure(); @@ -1191,13 +1218,13 @@ SimpleSwitchBackend::convert(const IR::ToplevelBlock* tlb) { cstring scalarsName = refMap->newName("scalars"); // This visitor is used in multiple passes to convert expression to json conv = new SimpleSwitchExpressionConverter(refMap, typeMap, structure, scalarsName); - auto ctxt = new ConversionContext(refMap, typeMap, toplevel, structure, conv, json); - auto hconv = new HeaderConverter(ctxt, scalarsName); program->apply(*hconv); ctxt->blockConverted = BlockConverted::Parser; + createRecirculateFieldsList(ctxt, toplevel, scalarsName); + auto pconv = new ParserConverter(ctxt); structure->parser->apply(*pconv); diff --git a/backends/bmv2/simple_switch/simpleSwitch.h b/backends/bmv2/simple_switch/simpleSwitch.h index 8e793c20a43..f936422aa82 100644 --- a/backends/bmv2/simple_switch/simpleSwitch.h +++ b/backends/bmv2/simple_switch/simpleSwitch.h @@ -148,6 +148,8 @@ class SimpleSwitchBackend : public Backend { ExpressionConverter* conv = nullptr; protected: + void createRecirculateFieldsList(ConversionContext* ctxt, const IR::ToplevelBlock* tlb, + cstring scalarName); cstring createCalculation(cstring algo, const IR::Expression* fields, Util::JsonArray* calculations, bool usePayload, const IR::Node* node); diff --git a/frontends/p4/fromv1.0/converters.cpp b/frontends/p4/fromv1.0/converters.cpp index 71b538a2b3a..14e258a0278 100644 --- a/frontends/p4/fromv1.0/converters.cpp +++ b/frontends/p4/fromv1.0/converters.cpp @@ -454,10 +454,13 @@ class ValidateLenExpr : public Inspector { } // namespace const IR::StructField *TypeConverter::postorder(IR::StructField *field) { - if (!field->type->is()) return field; + auto type = findContext(); + if (type == nullptr) + return field; + // given a struct with length and max_length, the // varbit field size is max_length * 8 - struct_size - if (auto type = findContext()) { + if (field->type->is()) { if (auto len = type->getAnnotation("length")) { if (len->expr.size() == 1) { auto lenexpr = len->expr[0]; @@ -472,6 +475,9 @@ const IR::StructField *TypeConverter::postorder(IR::StructField *field) { } } } + if (auto vec = structure->listIndexes(type->name.name, field->name.name)) + field->annotations = field->annotations->add( + new IR::Annotation("field_list", *vec)); return field; } @@ -629,6 +635,42 @@ ProgramStructure *(*Converter::createProgramStructure)() = defaultCreateProgramS ConversionContext *(*Converter::createConversionContext)() = defaultCreateConversionContext; namespace { +/// This visitor finds all field lists that participate in +/// recirculation, resubmission, and cloning +class FindRecirculated : public Inspector { + ProgramStructure* structure; + + void add(const IR::Primitive* primitive, unsigned operand) { + auto expression = primitive->operands.at(operand); + if (!expression->is()) { + ::error("%1%: expected a field list", expression); + return; + } + auto nr = expression->to(); + auto fl = structure->field_lists.get(nr->path->name); + if (fl == nullptr) { + ::error("%1%: Expected a field list", expression); + return; + } + LOG3("Recirculated " << nr->path->name); + structure->allFieldLists.emplace(fl); + } + + public: + explicit FindRecirculated(ProgramStructure* structure): structure(structure) + { CHECK_NULL(structure); setName("FindRecirculated"); } + + void postorder(const IR::Primitive* primitive) override { + if (primitive->name == "recirculate") { + add(primitive, 0); + } else if (primitive->name == "resubmit") { + add(primitive, 0); + } else if (primitive->name.startsWith("clone") && primitive->operands.size() == 2) { + add(primitive, 1); + } + } +}; + class RemoveLengthAnnotations: public Transform { const IR::Node* postorder(IR::Annotation* annotation) override { if (annotation->name == "length") @@ -653,6 +695,7 @@ Converter::Converter() { passes.emplace_back(new TypeCheck()); // Convert passes.emplace_back(new DiscoverStructure(structure)); + passes.emplace_back(new FindRecirculated(structure)); passes.emplace_back(new ComputeCallGraph(structure)); passes.emplace_back(new ComputeTableCallGraph(structure)); passes.emplace_back(new Rewriter(structure)); diff --git a/frontends/p4/fromv1.0/converters.h b/frontends/p4/fromv1.0/converters.h index 2c9087d909d..cd5e4f0d079 100644 --- a/frontends/p4/fromv1.0/converters.h +++ b/frontends/p4/fromv1.0/converters.h @@ -148,14 +148,14 @@ class PrimitiveConverter { * next highest will be run, etc. The macro invocation is followed by the body of the * converter function. */ -#define CONVERT_PRIMITIVE(NAME, ...) \ - class PrimitiveConverter_##NAME##_##__VA_ARGS__ : public PrimitiveConverter { \ +#define CONVERT_PRIMITIVE(NAME) \ + class PrimitiveConverter_##NAME : public PrimitiveConverter { \ const IR::Statement *convert(ProgramStructure *, const IR::Primitive *) override; \ - PrimitiveConverter_##NAME##_##__VA_ARGS__() \ - : PrimitiveConverter(#NAME, __VA_ARGS__ + 0) {} \ - static PrimitiveConverter_##NAME##_##__VA_ARGS__ singleton; \ - } PrimitiveConverter_##NAME##_##__VA_ARGS__::singleton; \ - const IR::Statement *PrimitiveConverter_##NAME##_##__VA_ARGS__::convert( \ + PrimitiveConverter_##NAME() \ + : PrimitiveConverter(#NAME, 0) {} \ + static PrimitiveConverter_##NAME singleton; \ + } PrimitiveConverter_##NAME::singleton; \ + const IR::Statement *PrimitiveConverter_##NAME::convert( \ ProgramStructure *structure, const IR::Primitive *primitive) /////////////////////////////////////////////////////////////// diff --git a/frontends/p4/fromv1.0/programStructure.cpp b/frontends/p4/fromv1.0/programStructure.cpp index 87f4828b48b..d370f0fdcb8 100644 --- a/frontends/p4/fromv1.0/programStructure.cpp +++ b/frontends/p4/fromv1.0/programStructure.cpp @@ -36,6 +36,19 @@ limitations under the License. namespace P4V1 { +static const IR::IDeclaration* getFirstDeclaration( + const IR::Vector* nodes, + cstring name) { + for (auto node : *nodes) { + auto decl = node->to(); + if (decl == nullptr) + continue; + if (decl->getName() == name) + return decl; + } + return nullptr; +} + ProgramStructure::ProgramStructure() : v1model(P4V1::V1Model::instance), p4lib(P4::P4CoreLibrary::instance), types(&allNames), metadata(&allNames), headers(&allNames), stacks(&allNames), @@ -102,6 +115,62 @@ void ProgramStructure::checkHeaderType(const IR::Type_StructLike* hdr, bool meta } } +bool ProgramStructure::isFieldInList(cstring type, cstring field, const IR::FieldList* fl) const { + LOG3("Checking " << type << "." << field << " in " << fl); + for (auto e : fl->fields) { + if (auto mem = e->to()) { + auto expr = mem->expr; + auto mfield = mem->member; + if (mfield != field) + continue; + CHECK_NULL(expr->type); + auto etype = expr->type->to(); + if (etype != nullptr && etype->name == type) + return true; + } else if (auto path = e->to()) { + auto l = field_lists.get(path->path->name); + BUG_CHECK(l != nullptr, "%1%: unexpected expression in field list", e); + return isFieldInList(type, field, l); + } else if (auto chr = e->to()) { + auto htype = chr->ref->type; + CHECK_NULL(htype); + if (htype->name != type) + continue; + for (auto f : htype->fields) { + if (f->name == field) + return true; + } + } else { + BUG("%1%: unexpected expression in field list", e); + } + } + return false; +} + +const IR::Vector* ProgramStructure::listIndexes(cstring type, cstring field) const { + IR::Vector* result = nullptr; + for (auto f : allFieldLists) { + if (isFieldInList(type, field, f)) { + if (result == nullptr) + result = new IR::Vector(); + result->push_back( + new IR::Member(new IR::TypeNameExpression(fieldListsEnum), f->name)); + } + } + return result; +} + +const IR::Expression* ProgramStructure::listIndex(const IR::Expression* expression) const { + auto pe = expression->to(); + if (pe == nullptr) { + ::error("%1%: Expected a field list", expression); + return 0; + } + + return new IR::Cast(IR::Type_Bits::get(8), + new IR::Member(new IR::TypeNameExpression(fieldListsEnum), pe->path->name)); +} + cstring ProgramStructure::createType(const IR::Type_StructLike* type, bool header, std::unordered_set *converted) { if (converted->count(type)) @@ -127,6 +196,19 @@ cstring ProgramStructure::createType(const IR::Type_StructLike* type, bool heade } void ProgramStructure::createTypes() { + if (allFieldLists.size()) { + // An enum containing the recirculated/cloned/resubmitted field lists + fieldListsEnum = makeUniqueName("FieldLists"); + auto members = new IR::IndexedVector(); + unsigned index = 0; + for (auto fl : allFieldLists) { + auto me = new IR::SerEnumMember(fl->srcInfo, fl->name, new IR::Constant(index++)); + members->push_back(me); + } + auto fieldLists = new IR::Type_SerEnum(fieldListsEnum, IR::Type_Bits::get(8), *members); + declarations->push_back(fieldLists); + } + std::unordered_set converted; // Metadata first for (auto it : metadata) { @@ -182,14 +264,14 @@ void ProgramStructure::createTypes() { const IR::Type_Struct* ProgramStructure::createFieldListType(const IR::Expression* expression) { if (!expression->is()) { - ::error(ErrorType::ERR_EXPECTED, "%1%: expected a field list", expression); - return nullptr; + ::error(ErrorType::ERR_EXPECTED, "%1%: expected a field list", expression); + return nullptr; } auto nr = expression->to(); auto fl = field_lists.get(nr->path->name); if (fl == nullptr) { - ::error(ErrorType::ERR_EXPECTED, "%1%: Expected a field list", expression); - return nullptr; + ::error(ErrorType::ERR_EXPECTED, "%1%: Expected a field list", expression); + return nullptr; } auto name = makeUniqueName(nr->path->name); @@ -276,7 +358,8 @@ void ProgramStructure::createExterns() { if (auto et = ExternConverter::cvtExternType(this, it.first, it.second)) { if (et != it.first) extern_remap[it.first] = et; - declarations->push_back(et); } } + if (et != getFirstDeclaration(declarations, et->name)) + declarations->push_back(et); } } } const IR::Expression* ProgramStructure::paramReference(const IR::Parameter* param) { @@ -1117,14 +1200,14 @@ const IR::Expression* ProgramStructure::convertFieldList(const IR::Expression* e ExpressionConverter conv(this); if (!expression->is()) { - ::error(ErrorType::ERR_EXPECTED, "%1%: expected a field list", expression); - return expression; + ::error(ErrorType::ERR_EXPECTED, "%1%: expected a field list", expression); + return expression; } auto nr = expression->to(); auto fl = field_lists.get(nr->path->name); if (fl == nullptr) { - ::error(ErrorType::ERR_EXPECTED, "%1%: Expected a field list", expression); - return expression; + ::error(ErrorType::ERR_EXPECTED, "%1%: Expected a field list", expression); + return expression; } auto result = conv.convert(fl); return result; @@ -1551,11 +1634,10 @@ CONVERT_PRIMITIVE(modify_field_rng_uniform) { CONVERT_PRIMITIVE(recirculate) { ExpressionConverter conv(structure); OPS_CK(primitive, 1); - auto right = structure->convertFieldList(primitive->operands.at(0)); - if (right == nullptr) - return nullptr; auto args = new IR::Vector(); - args->push_back(new IR::Argument(right)); + auto fieldList = primitive->operands.at(0); + if (auto expr = structure->listIndex(fieldList)) + args->push_back(new IR::Argument(expr)); auto path = new IR::PathExpression(structure->v1model.recirculate.Id()); auto mc = new IR::MethodCallExpression(primitive->srcInfo, path, args); return new IR::MethodCallStatement(mc->srcInfo, mc); @@ -1563,7 +1645,8 @@ CONVERT_PRIMITIVE(recirculate) { static const IR::Statement * convertClone(ProgramStructure *structure, const IR::Primitive *primitive, Model::Elem kind) { - BUG_CHECK(primitive->operands.size() == 1 || primitive->operands.size() == 2, + unsigned opcount = primitive->operands.size(); + BUG_CHECK(opcount == 1 || opcount == 2, "Expected 1 or 2 operands for %1%", primitive); ExpressionConverter conv(structure); auto session = conv.convert(primitive->operands.at(0)); @@ -1576,14 +1659,14 @@ convertClone(ProgramStructure *structure, const IR::Primitive *primitive, Model: args->push_back( new IR::Argument(new IR::Cast(primitive->operands.at(0)->srcInfo, structure->v1model.clone.sessionType, session))); - if (primitive->operands.size() == 2) { - auto list = structure->convertFieldList(primitive->operands.at(1)); - if (list != nullptr) - args->push_back(new IR::Argument(list)); - } - auto id = primitive->operands.size() == 2 ? structure->v1model.clone.clone3.Id() - : structure->v1model.clone.Id(); + auto id = opcount == 2 ? structure->v1model.clone.clone3.Id() + : structure->v1model.clone.Id(); + if (opcount == 2) { + auto fl = primitive->operands.at(1); + if (auto expr = structure->listIndex(fl)) + args->push_back(new IR::Argument(expr)); + } auto clone = new IR::PathExpression(id); auto mc = new IR::MethodCallExpression(primitive->srcInfo, clone, args); return new IR::MethodCallStatement(mc->srcInfo, mc); @@ -1600,14 +1683,18 @@ CONVERT_PRIMITIVE(clone_i2e) { CONVERT_PRIMITIVE(resubmit) { ExpressionConverter conv(structure); - BUG_CHECK(primitive->operands.size() <= 1, "Expected 0 or 1 operands for %1%", primitive); - const IR::Expression *list; - if (primitive->operands.size() > 0) - list = structure->convertFieldList(primitive->operands.at(0)); - else - list = new IR::ListExpression({}); - return new IR::MethodCallStatement(primitive->srcInfo, structure->v1model.resubmit.Id(), - { new IR::Argument(list) }); + unsigned opcount = primitive->operands.size(); + BUG_CHECK(opcount <= 1, "Expected 0 or 1 operands for %1%", primitive); + auto args = new IR::Vector(); + if (opcount == 1) { + auto fl = primitive->operands.at(0); + if (auto expr = structure->listIndex(fl)) + args->push_back(new IR::Argument(expr)); + } + return new IR::MethodCallStatement(primitive->srcInfo, + new IR::MethodCallExpression(primitive->srcInfo, + new IR::PathExpression(structure->v1model.resubmit.Id()), + args)); } CONVERT_PRIMITIVE(execute_meter) { diff --git a/frontends/p4/fromv1.0/programStructure.h b/frontends/p4/fromv1.0/programStructure.h index ad318eb0412..aaca72fdc91 100644 --- a/frontends/p4/fromv1.0/programStructure.h +++ b/frontends/p4/fromv1.0/programStructure.h @@ -154,6 +154,8 @@ class ProgramStructure { std::map directMeters; std::map meterMap; std::map counterMap; + /// Field lists that appear in the program. + ordered_set allFieldLists; std::map tableMapping; std::map tableInvocation; @@ -172,6 +174,8 @@ class ProgramStructure { std::map extractsSynthesized; std::map parserEntryPoints; + /// Name of the serializable enum that holds one id for each field list. + cstring fieldListsEnum; // P4-14 struct/header type can be converted to three types // of struct/header in P4-16. @@ -292,6 +296,13 @@ class ProgramStructure { void tablesReferred(const IR::V1Control* control, std::vector &out); bool isHeader(const IR::ConcreteHeaderRef* nhr) const; cstring makeUniqueName(cstring base); + bool isFieldInList(cstring type, cstring field, const IR::FieldList* fl) const; + /// A vector with indexes of the field lists that contain this field. + /// Returns nullptr if the field does not appear in any list. + virtual const IR::Vector* listIndexes(cstring type, cstring field) const; + /// Given an expression which is supposed to be a field list + /// return a constant representing its value in the fieldListsEnum. + const IR::Expression* listIndex(const IR::Expression* fl) const; const IR::Type* explodeType(const std::vector &fieldTypes); const IR::Expression* explodeLabel(const IR::Constant* value, const IR::Constant* mask, diff --git a/frontends/p4/typeChecking/typeChecker.cpp b/frontends/p4/typeChecking/typeChecker.cpp index 2964d7622b2..875316d7c64 100644 --- a/frontends/p4/typeChecking/typeChecker.cpp +++ b/frontends/p4/typeChecking/typeChecker.cpp @@ -2625,6 +2625,9 @@ const IR::Node* TypeInference::postorder(IR::PathExpression* expression) { return expression; } } + } else if (decl->is() || decl->is()) { + setCompileTimeConstant(expression); + setCompileTimeConstant(getOriginal()); } if (decl->is()) { diff --git a/ir/base.def b/ir/base.def index 437b2fbe420..98b45a1d6aa 100644 --- a/ir/base.def +++ b/ir/base.def @@ -341,6 +341,13 @@ class Annotations { // already present. Annotations addAnnotationIfNew(cstring name, Expression expr, bool structured = false) const { return getSingle(name) ? this : addAnnotation(name, expr, structured); } + Annotations append(Annotations other) { + if (other == nullptr) + return this; + for (auto a : other->annotations) + add(a); + return this; + } // If annotations with the same name are already present, remove them. // Add this annotation. Annotations addOrReplace(cstring name, Expression expr, bool structured = false) const { diff --git a/midend/eliminateSerEnums.cpp b/midend/eliminateSerEnums.cpp index 22583fb31f6..aed91624f81 100644 --- a/midend/eliminateSerEnums.cpp +++ b/midend/eliminateSerEnums.cpp @@ -34,6 +34,7 @@ const IR::Node* DoEliminateSerEnums::postorder(IR::Type_Name* type) { // This will be resolved by the caller. return type; auto enumType = canontype->to(); + LOG2("Replacing " << type << " with " << enumType->type); return enumType->type; } @@ -41,8 +42,10 @@ const IR::Node* DoEliminateSerEnums::postorder(IR::Type_Name* type) { const IR::Node* DoEliminateSerEnums::postorder(IR::Member* expression) { auto ei = EnumInstance::resolve(getOriginal(), typeMap); if (!ei) return expression; - if (auto sei = ei->to()) + if (auto sei = ei->to()) { + LOG2("Replacing " << expression << " with " << sei->value); return sei->value; + } return expression; } diff --git a/midend/flattenInterfaceStructs.cpp b/midend/flattenInterfaceStructs.cpp index e0d481bc2be..e6cb493d0a1 100644 --- a/midend/flattenInterfaceStructs.cpp +++ b/midend/flattenInterfaceStructs.cpp @@ -21,23 +21,32 @@ namespace P4 { void StructTypeReplacement::flatten(const P4::TypeMap* typeMap, cstring prefix, const IR::Type* type, + const IR::Annotations* annotations, // from parent IR::IndexedVector *fields) { + // Drop name annotations + IR::Annotations::Filter f = + [](const IR::Annotation* a) { return a->name != IR::Annotation::nameAnnotation; }; + annotations = annotations->where(f); if (auto st = type->to()) { structFieldMap.emplace(prefix, st); - for (auto f : st->fields) - flatten(typeMap, prefix + "." + f->name, f->type, fields); + for (auto f : st->fields) { + auto na = new IR::Annotations(); + na->append(annotations); + na->append(f->annotations); + flatten(typeMap, prefix + "." + f->name, f->type, na, fields); + } return; } cstring fieldName = prefix.replace(".", "_") + cstring::to_cstring(fieldNameRemap.size()); fieldNameRemap.emplace(prefix, fieldName); - fields->push_back(new IR::StructField(IR::ID(fieldName), type->getP4Type())); + fields->push_back(new IR::StructField(IR::ID(fieldName), annotations, type->getP4Type())); } StructTypeReplacement::StructTypeReplacement( const P4::TypeMap* typeMap, const IR::Type_Struct* type) { auto vec = new IR::IndexedVector(); - flatten(typeMap, "", type, vec); + flatten(typeMap, "", type, type->annotations, vec); replacementType = new IR::Type_Struct(type->name, IR::Annotations::empty, *vec); } diff --git a/midend/flattenInterfaceStructs.h b/midend/flattenInterfaceStructs.h index cda1088c51c..0ecf2bf9059 100644 --- a/midend/flattenInterfaceStructs.h +++ b/midend/flattenInterfaceStructs.h @@ -72,6 +72,7 @@ struct StructTypeReplacement : public IHasDbPrint { void flatten(const P4::TypeMap* typeMap, cstring prefix, const IR::Type* type, + const IR::Annotations* annotations, IR::IndexedVector *fields); /// Returns a StructExpression suitable for diff --git a/p4include/v1model.p4 b/p4include/v1model.p4 index ef6683844c9..a51c3b458bd 100644 --- a/p4include/v1model.p4 +++ b/p4include/v1model.p4 @@ -21,15 +21,6 @@ limitations under the License. * * https://github.com/p4lang/behavioral-model/blob/main/docs/simple_switch.md * - * Note 2: There were several discussions among P4 working group - * members in early 2019 regarding exactly how resubmit, recirculate, - * and clone3 operations can be called anywhere in their respective - * controls, but the values of the fields to be preserved is the value - * they have when that control is finished executing. That is how - * these operations are defined in P4_14. See - * https://github.com/p4lang/behavioral-model/blob/main/docs/simple_switch.md#restrictions-on-recirculate-resubmit-and-clone-operations - * for more details on the current state of affairs. - * * Note 3: There are at least some P4_14 implementations where * invoking a generate_digest operation on a field_list will create a * message to the control plane that contains the values of those @@ -536,6 +527,15 @@ extern void verify_checksum_with_payload(in bool condition, in T data, in @noSideEffects extern void update_checksum_with_payload(in bool condition, in T data, inout O checksum, HashAlgorithm algo); +/*** + * clone is in most ways identical to the clone3 operation, with the + * only difference being that it never preserves any user-defined + * metadata fields with the cloned packet. It is equivalent to + * calling clone3 with the same type and session parameter values, + * with empty data. + */ +extern void clone(in CloneType type, in bit<32> session); + /*** * Calling resubmit during execution of the ingress control will, * under certain documented conditions, cause the packet to be @@ -546,10 +546,8 @@ extern void update_checksum_with_payload(in bool condition, in T data, ino * metadata fields that the resubmit operation causes to be * preserved. * - * The value of the user-defined metadata fields that are preserved in - * resubmitted packets is the value they have at the end of ingress - * processing, not their values at the time the resubmit call is made. - * See Note 2 for issues with this. + * The user metadata fields that are tagged with @field_list(index) will + * be sent to the parser together with the packet. * * Calling resubmit is only supported in the ingress control. There * is no way to undo its effects once it has been called. If resubmit @@ -558,8 +556,7 @@ extern void update_checksum_with_payload(in bool condition, in T data, ino * last such call is preserved. See the v1model architecture * documentation (Note 1) for more details. */ -extern void resubmit(in T data); - +extern void resubmit(bit<8> index); /*** * Calling recirculate during execution of the egress control will, * under certain documented conditions, cause the packet to be @@ -570,10 +567,8 @@ extern void resubmit(in T data); * instance_type field. The caller may request that some user-defined * metadata fields be preserved with the recirculated packet. * - * The value of the user-defined metadata fields that are preserved in - * recirculated packets is the value they have at the end of egress - * processing, not their values at the time the recirculate call is - * made. See Note 2 for issues with this. + * The user metadata fields that are tagged with @field_list(index) will be + * sent to the parser together with the packet. * * Calling recirculate is only supported in the egress control. There * is no way to undo its effects once it has been called. If @@ -582,17 +577,8 @@ extern void resubmit(in T data); * data from the last such call is preserved. See the v1model * architecture documentation (Note 1) for more details. */ -extern void recirculate(in T data); - -/*** - * clone is in most ways identical to the clone3 operation, with the - * only difference being that it never preserves any user-defined - * metadata fields with the cloned packet. It is equivalent to - * calling clone3 with the same type and session parameter values, - * with empty data. - */ +extern void recirculate(bit<8> index); extern void clone(in CloneType type, in bit<32> session); - /*** * Calling clone3 during execution of the ingress or egress control * will cause the packet to be cloned, sometimes also called @@ -613,12 +599,8 @@ extern void clone(in CloneType type, in bit<32> session); * Cloned packets can be distinguished from others by the value of the * standard_metadata instance_type field. * - * The caller may request that some user-defined metadata field values - * from the original packet should be preserved with the cloned - * packet(s). The value of the user-defined metadata fields that are - * preserved with cloned packets is the value they have at the end of - * ingress or egress processing, not their values at the time the - * clone3 call is made. See Note 2 for issues with this. + * The user metadata fields that are tagged with @field_list(index) will be + * sent to the parser together with a clone of the packet. * * If clone3 is called during ingress processing, the first parameter * must be CloneType.I2E. If clone3 is called during egress @@ -630,7 +612,7 @@ extern void clone(in CloneType type, in bit<32> session); * clone session and data are used. See the v1model architecture * documentation (Note 1) for more details. */ -extern void clone3(in CloneType type, in bit<32> session, in T data); +extern void clone3(in CloneType type, in bit<32> session, bit<8> index); extern void truncate(in bit<32> length); diff --git a/testdata/p4_14_errors_outputs/issue747.p4-stderr b/testdata/p4_14_errors_outputs/issue747.p4-stderr index 460bccc9086..728c666d47b 100644 --- a/testdata/p4_14_errors_outputs/issue747.p4-stderr +++ b/testdata/p4_14_errors_outputs/issue747.p4-stderr @@ -1,7 +1,4 @@ -issue747.p4(31): [--Wwarn=type-inference] warning: Could not infer type for local_port, using bit<8> -action local_recirc(local_port) { - ^^^^^^^^^^ -issue747.p4(31): [--Werror=expected] error: local_port: expected a field list +issue747.p4(31): [--Werror=legacy] error: local_port: expected a field list action local_recirc(local_port) { ^^^^^^^^^^ [--Werror=overlimit] error: 1 errors encountered, aborting compilation diff --git a/testdata/p4_14_samples_outputs/acl1-midend.p4 b/testdata/p4_14_samples_outputs/acl1-midend.p4 index 90098be9f9d..533f6f26030 100644 --- a/testdata/p4_14_samples_outputs/acl1-midend.p4 +++ b/testdata/p4_14_samples_outputs/acl1-midend.p4 @@ -134,16 +134,27 @@ header data_t { } struct metadata { + @pa_solitary("ingress", "acl_metadata.if_label") bit<1> _acl_metadata_acl_deny0; + @pa_solitary("ingress", "acl_metadata.if_label") bit<1> _acl_metadata_racl_deny1; + @pa_solitary("ingress", "acl_metadata.if_label") bit<16> _acl_metadata_acl_nexthop2; + @pa_solitary("ingress", "acl_metadata.if_label") bit<16> _acl_metadata_racl_nexthop3; + @pa_solitary("ingress", "acl_metadata.if_label") bit<1> _acl_metadata_acl_nexthop_type4; + @pa_solitary("ingress", "acl_metadata.if_label") bit<1> _acl_metadata_racl_nexthop_type5; + @pa_solitary("ingress", "acl_metadata.if_label") bit<1> _acl_metadata_acl_redirect6; + @pa_solitary("ingress", "acl_metadata.if_label") bit<1> _acl_metadata_racl_redirect7; + @pa_solitary("ingress", "acl_metadata.if_label") bit<15> _acl_metadata_if_label8; + @pa_solitary("ingress", "acl_metadata.if_label") bit<16> _acl_metadata_bd_label9; + @pa_solitary("ingress", "acl_metadata.if_label") bit<10> _acl_metadata_mirror_session_id10; bit<3> _fabric_metadata_packetType11; bit<1> _fabric_metadata_fabric_header_present12; @@ -206,6 +217,7 @@ struct metadata { bit<1> _l3_metadata_routed69; bit<1> _l3_metadata_outer_routed70; bit<8> _l3_metadata_mtu_index71; + @saturating bit<16> _l3_metadata_l3_mtu_check72; bit<1> _security_metadata_storm_control_color73; bit<1> _security_metadata_ipsg_enabled74; 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 83ad8efe2c4..d59eff08915 100644 --- a/testdata/p4_14_samples_outputs/copy_to_cpu-first.p4 +++ b/testdata/p4_14_samples_outputs/copy_to_cpu-first.p4 @@ -2,6 +2,10 @@ #define V1MODEL_VERSION 20200408 #include +enum bit<8> FieldLists { + copy_to_cpu_fields = 8w0 +} + struct intrinsic_metadata_t { bit<4> mcast_grp; bit<4> egress_rid; @@ -73,7 +77,7 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { @name(".do_copy_to_cpu") action do_copy_to_cpu() { - clone3>(CloneType.I2E, 32w250, { standard_metadata }); + clone3(CloneType.I2E, 32w250, (bit<8>)FieldLists.copy_to_cpu_fields); } @name(".copy_to_cpu") table copy_to_cpu { actions = { 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 24b0ace251c..e5215211933 100644 --- a/testdata/p4_14_samples_outputs/copy_to_cpu-frontend.p4 +++ b/testdata/p4_14_samples_outputs/copy_to_cpu-frontend.p4 @@ -2,6 +2,10 @@ #define V1MODEL_VERSION 20200408 #include +enum bit<8> FieldLists { + copy_to_cpu_fields = 8w0 +} + struct intrinsic_metadata_t { bit<4> mcast_grp; bit<4> egress_rid; @@ -81,7 +85,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ @noWarn("unused") @name(".NoAction") action NoAction_3() { } @name(".do_copy_to_cpu") action do_copy_to_cpu() { - clone3>(CloneType.I2E, 32w250, { standard_metadata }); + clone3(CloneType.I2E, 32w250, (bit<8>)FieldLists.copy_to_cpu_fields); } @name(".copy_to_cpu") table copy_to_cpu_0 { actions = { 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 04721e8a62c..cfb53942711 100644 --- a/testdata/p4_14_samples_outputs/copy_to_cpu-midend.p4 +++ b/testdata/p4_14_samples_outputs/copy_to_cpu-midend.p4 @@ -75,15 +75,11 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t } } -struct tuple_0 { - standard_metadata_t f0; -} - control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { @noWarn("unused") @name(".NoAction") action NoAction_3() { } @name(".do_copy_to_cpu") action do_copy_to_cpu() { - clone3(CloneType.I2E, 32w250, (tuple_0){f0 = standard_metadata}); + clone3(CloneType.I2E, 32w250, 8w0); } @name(".copy_to_cpu") table copy_to_cpu_0 { actions = { diff --git a/testdata/p4_14_samples_outputs/copy_to_cpu.p4 b/testdata/p4_14_samples_outputs/copy_to_cpu.p4 index b076eba7f32..5b6400b8202 100644 --- a/testdata/p4_14_samples_outputs/copy_to_cpu.p4 +++ b/testdata/p4_14_samples_outputs/copy_to_cpu.p4 @@ -2,6 +2,10 @@ #define V1MODEL_VERSION 20200408 #include +enum bit<8> FieldLists { + copy_to_cpu_fields = 0 +} + struct intrinsic_metadata_t { bit<4> mcast_grp; bit<4> egress_rid; @@ -71,7 +75,7 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { @name(".do_copy_to_cpu") action do_copy_to_cpu() { - clone3(CloneType.I2E, (bit<32>)32w250, { standard_metadata }); + clone3(CloneType.I2E, (bit<32>)32w250, (bit<8>)FieldLists.copy_to_cpu_fields); } @name(".copy_to_cpu") table copy_to_cpu { actions = { 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 75916e6520b..e527108c764 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 @@ -2,6 +2,12 @@ #define V1MODEL_VERSION 20200408 #include +enum bit<8> FieldLists { + clone_e2e_FL = 8w0, + recirculate_FL = 8w1, + resubmit_FL = 8w2 +} + struct intrinsic_metadata_t { bit<48> ingress_global_timestamp; bit<48> egress_global_timestamp; @@ -10,10 +16,15 @@ struct intrinsic_metadata_t { } struct mymeta_t { + @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) bit<8> recirculate_count; + @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) bit<8> last_ing_instance_type; + @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) bit<8> f1; } @@ -54,13 +65,13 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710633; meta.mymeta.f1 = meta.mymeta.f1 + 8w23; meta.mymeta.clone_e2e_count = meta.mymeta.clone_e2e_count + 8w1; - clone3>(CloneType.E2E, 32w1, { meta.mymeta }); + clone3(CloneType.E2E, 32w1, (bit<8>)FieldLists.clone_e2e_FL); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710637; meta.mymeta.f1 = meta.mymeta.f1 + 8w19; meta.mymeta.recirculate_count = meta.mymeta.recirculate_count + 8w1; - recirculate>({ meta.mymeta }); + recirculate((bit<8>)FieldLists.recirculate_FL); } @name("._nop") action _nop() { } @@ -218,7 +229,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710639; meta.mymeta.f1 = meta.mymeta.f1 + 8w17; meta.mymeta.resubmit_count = meta.mymeta.resubmit_count + 8w1; - resubmit>({ meta.mymeta }); + resubmit((bit<8>)FieldLists.resubmit_FL); } @name("._nop") action _nop() { } 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 b7cfb6fd700..cb3a638803c 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 @@ -2,6 +2,12 @@ #define V1MODEL_VERSION 20200408 #include +enum bit<8> FieldLists { + clone_e2e_FL = 8w0, + recirculate_FL = 8w1, + resubmit_FL = 8w2 +} + struct intrinsic_metadata_t { bit<48> ingress_global_timestamp; bit<48> egress_global_timestamp; @@ -10,10 +16,15 @@ struct intrinsic_metadata_t { } struct mymeta_t { + @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) bit<8> recirculate_count; + @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) bit<8> last_ing_instance_type; + @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) bit<8> f1; } @@ -54,13 +65,13 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710633; meta.mymeta.f1 = meta.mymeta.f1 + 8w23; meta.mymeta.clone_e2e_count = meta.mymeta.clone_e2e_count + 8w1; - clone3>(CloneType.E2E, 32w1, { meta.mymeta }); + clone3(CloneType.E2E, 32w1, (bit<8>)FieldLists.clone_e2e_FL); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710637; meta.mymeta.f1 = meta.mymeta.f1 + 8w19; meta.mymeta.recirculate_count = meta.mymeta.recirculate_count + 8w1; - recirculate>({ meta.mymeta }); + recirculate((bit<8>)FieldLists.recirculate_FL); } @name("._nop") action _nop() { } @@ -247,7 +258,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710639; meta.mymeta.f1 = meta.mymeta.f1 + 8w17; meta.mymeta.resubmit_count = meta.mymeta.resubmit_count + 8w1; - resubmit>({ meta.mymeta }); + resubmit((bit<8>)FieldLists.resubmit_FL); } @name("._nop") action _nop_3() { } 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 b45208f4797..2f2c00a69f0 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,10 +10,15 @@ struct intrinsic_metadata_t { } struct mymeta_t { + @field_list(8w0, 8w1, 8w2) bit<8> resubmit_count; + @field_list(8w0, 8w1, 8w2) bit<8> recirculate_count; + @field_list(8w0, 8w1, 8w2) bit<8> clone_e2e_count; + @field_list(8w0, 8w1, 8w2) bit<8> last_ing_instance_type; + @field_list(8w0, 8w1, 8w2) bit<8> f1; } @@ -28,10 +33,15 @@ header ethernet_t { } struct metadata { + @field_list(8w0, 8w1, 8w2) bit<8> _mymeta_resubmit_count0; + @field_list(8w0, 8w1, 8w2) bit<8> _mymeta_recirculate_count1; + @field_list(8w0, 8w1, 8w2) bit<8> _mymeta_clone_e2e_count2; + @field_list(8w0, 8w1, 8w2) bit<8> _mymeta_last_ing_instance_type3; + @field_list(8w0, 8w1, 8w2) bit<8> _mymeta_f14; bit<48> _temporaries_temp15; } @@ -51,22 +61,18 @@ parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout } } -struct tuple_0 { - mymeta_t f0; -} - control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { @name(".do_clone_e2e") action do_clone_e2e() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710633; meta._mymeta_f14 = meta._mymeta_f14 + 8w23; meta._mymeta_clone_e2e_count2 = meta._mymeta_clone_e2e_count2 + 8w1; - clone3(CloneType.E2E, 32w1, (tuple_0){f0 = (mymeta_t){resubmit_count = meta._mymeta_resubmit_count0,recirculate_count = meta._mymeta_recirculate_count1,clone_e2e_count = meta._mymeta_clone_e2e_count2,last_ing_instance_type = meta._mymeta_last_ing_instance_type3,f1 = meta._mymeta_f14}}); + clone3(CloneType.E2E, 32w1, 8w0); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710637; meta._mymeta_f14 = meta._mymeta_f14 + 8w19; meta._mymeta_recirculate_count1 = meta._mymeta_recirculate_count1 + 8w1; - recirculate((tuple_0){f0 = (mymeta_t){resubmit_count = meta._mymeta_resubmit_count0,recirculate_count = meta._mymeta_recirculate_count1,clone_e2e_count = meta._mymeta_clone_e2e_count2,last_ing_instance_type = meta._mymeta_last_ing_instance_type3,f1 = meta._mymeta_f14}}); + recirculate(8w1); } @name("._nop") action _nop() { } @@ -253,7 +259,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710639; meta._mymeta_f14 = meta._mymeta_f14 + 8w17; meta._mymeta_resubmit_count0 = meta._mymeta_resubmit_count0 + 8w1; - resubmit((tuple_0){f0 = (mymeta_t){resubmit_count = meta._mymeta_resubmit_count0,recirculate_count = meta._mymeta_recirculate_count1,clone_e2e_count = meta._mymeta_clone_e2e_count2,last_ing_instance_type = meta._mymeta_last_ing_instance_type3,f1 = meta._mymeta_f14}}); + resubmit(8w2); } @name("._nop") action _nop_3() { } 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 e1d344a3774..1da21df7f6f 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 @@ -2,6 +2,12 @@ #define V1MODEL_VERSION 20200408 #include +enum bit<8> FieldLists { + clone_e2e_FL = 0, + recirculate_FL = 1, + resubmit_FL = 2 +} + struct intrinsic_metadata_t { bit<48> ingress_global_timestamp; bit<48> egress_global_timestamp; @@ -10,10 +16,15 @@ struct intrinsic_metadata_t { } struct mymeta_t { + @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) bit<8> recirculate_count; + @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) bit<8> last_ing_instance_type; + @field_list(FieldLists.clone_e2e_FL, FieldLists.recirculate_FL, FieldLists.resubmit_FL) bit<8> f1; } @@ -54,13 +65,13 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr - 48w23; meta.mymeta.f1 = meta.mymeta.f1 + 8w23; meta.mymeta.clone_e2e_count = meta.mymeta.clone_e2e_count + 8w1; - clone3(CloneType.E2E, (bit<32>)32w1, { meta.mymeta }); + clone3(CloneType.E2E, (bit<32>)32w1, (bit<8>)FieldLists.clone_e2e_FL); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr - 48w19; meta.mymeta.f1 = meta.mymeta.f1 + 8w19; meta.mymeta.recirculate_count = meta.mymeta.recirculate_count + 8w1; - recirculate({ meta.mymeta }); + recirculate((bit<8>)FieldLists.recirculate_FL); } @name("._nop") action _nop() { } @@ -222,7 +233,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ethernet.srcAddr = hdr.ethernet.srcAddr - 48w17; meta.mymeta.f1 = meta.mymeta.f1 + 8w17; meta.mymeta.resubmit_count = meta.mymeta.resubmit_count + 8w1; - resubmit({ meta.mymeta }); + resubmit((bit<8>)FieldLists.resubmit_FL); } @name("._nop") action _nop() { } 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 3992a53e044..ebcc6dc3f94 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 @@ -2,6 +2,12 @@ #define V1MODEL_VERSION 20200408 #include +enum bit<8> FieldLists { + clone_e2e_FL = 8w0, + recirculate_FL = 8w1, + resubmit_FL = 8w2 +} + struct intrinsic_metadata_t { bit<48> ingress_global_timestamp; bit<48> egress_global_timestamp; @@ -10,10 +16,14 @@ struct intrinsic_metadata_t { } struct mymeta_t { + @field_list(FieldLists.resubmit_FL) bit<8> resubmit_count; + @field_list(FieldLists.recirculate_FL) bit<8> recirculate_count; + @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) bit<8> f1; } @@ -54,13 +64,13 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710633; meta.mymeta.f1 = meta.mymeta.f1 + 8w23; meta.mymeta.clone_e2e_count = meta.mymeta.clone_e2e_count + 8w1; - clone3, bit<8>>>(CloneType.E2E, 32w1, { meta.mymeta.clone_e2e_count, meta.mymeta.f1 }); + clone3(CloneType.E2E, 32w1, (bit<8>)FieldLists.clone_e2e_FL); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710637; meta.mymeta.f1 = meta.mymeta.f1 + 8w19; meta.mymeta.recirculate_count = meta.mymeta.recirculate_count + 8w1; - recirculate, bit<8>>>({ meta.mymeta.recirculate_count, meta.mymeta.f1 }); + recirculate((bit<8>)FieldLists.recirculate_FL); } @name("._nop") action _nop() { } @@ -231,7 +241,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710639; meta.mymeta.f1 = meta.mymeta.f1 + 8w17; meta.mymeta.resubmit_count = meta.mymeta.resubmit_count + 8w1; - resubmit, bit<8>>>({ meta.mymeta.resubmit_count, meta.mymeta.f1 }); + resubmit((bit<8>)FieldLists.resubmit_FL); } @name("._nop") action _nop() { } 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 2b4f23f3897..1fb52873429 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 @@ -2,6 +2,12 @@ #define V1MODEL_VERSION 20200408 #include +enum bit<8> FieldLists { + clone_e2e_FL = 8w0, + recirculate_FL = 8w1, + resubmit_FL = 8w2 +} + struct intrinsic_metadata_t { bit<48> ingress_global_timestamp; bit<48> egress_global_timestamp; @@ -10,10 +16,14 @@ struct intrinsic_metadata_t { } struct mymeta_t { + @field_list(FieldLists.resubmit_FL) bit<8> resubmit_count; + @field_list(FieldLists.recirculate_FL) bit<8> recirculate_count; + @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) bit<8> f1; } @@ -54,13 +64,13 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710633; meta.mymeta.f1 = meta.mymeta.f1 + 8w23; meta.mymeta.clone_e2e_count = meta.mymeta.clone_e2e_count + 8w1; - clone3, bit<8>>>(CloneType.E2E, 32w1, { meta.mymeta.clone_e2e_count, meta.mymeta.f1 }); + clone3(CloneType.E2E, 32w1, (bit<8>)FieldLists.clone_e2e_FL); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710637; meta.mymeta.f1 = meta.mymeta.f1 + 8w19; meta.mymeta.recirculate_count = meta.mymeta.recirculate_count + 8w1; - recirculate, bit<8>>>({ meta.mymeta.recirculate_count, meta.mymeta.f1 }); + recirculate((bit<8>)FieldLists.recirculate_FL); } @name("._nop") action _nop() { } @@ -260,7 +270,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710639; meta.mymeta.f1 = meta.mymeta.f1 + 8w17; meta.mymeta.resubmit_count = meta.mymeta.resubmit_count + 8w1; - resubmit, bit<8>>>({ meta.mymeta.resubmit_count, meta.mymeta.f1 }); + resubmit((bit<8>)FieldLists.resubmit_FL); } @name("._nop") action _nop_3() { } 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 7b2007b5093..f867a5fa699 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,10 +10,14 @@ struct intrinsic_metadata_t { } struct mymeta_t { + @field_list(8w2) bit<8> resubmit_count; + @field_list(8w1) bit<8> recirculate_count; + @field_list(8w0) bit<8> clone_e2e_count; bit<8> last_ing_instance_type; + @field_list(8w0, 8w1, 8w2) bit<8> f1; } @@ -28,10 +32,14 @@ header ethernet_t { } struct metadata { + @field_list(8w2) bit<8> _mymeta_resubmit_count0; + @field_list(8w1) bit<8> _mymeta_recirculate_count1; + @field_list(8w0) bit<8> _mymeta_clone_e2e_count2; bit<8> _mymeta_last_ing_instance_type3; + @field_list(8w0, 8w1, 8w2) bit<8> _mymeta_f14; bit<48> _temporaries_temp15; } @@ -51,23 +59,18 @@ parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout } } -struct tuple_0 { - bit<8> f0; - bit<8> f1; -} - control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { @name(".do_clone_e2e") action do_clone_e2e() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710633; meta._mymeta_f14 = meta._mymeta_f14 + 8w23; meta._mymeta_clone_e2e_count2 = meta._mymeta_clone_e2e_count2 + 8w1; - clone3(CloneType.E2E, 32w1, (tuple_0){f0 = meta._mymeta_clone_e2e_count2,f1 = meta._mymeta_f14}); + clone3(CloneType.E2E, 32w1, 8w0); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710637; meta._mymeta_f14 = meta._mymeta_f14 + 8w19; meta._mymeta_recirculate_count1 = meta._mymeta_recirculate_count1 + 8w1; - recirculate((tuple_0){f0 = meta._mymeta_recirculate_count1,f1 = meta._mymeta_f14}); + recirculate(8w1); } @name("._nop") action _nop() { } @@ -267,7 +270,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710639; meta._mymeta_f14 = meta._mymeta_f14 + 8w17; meta._mymeta_resubmit_count0 = meta._mymeta_resubmit_count0 + 8w1; - resubmit((tuple_0){f0 = meta._mymeta_resubmit_count0,f1 = meta._mymeta_f14}); + resubmit(8w2); } @name("._nop") action _nop_3() { } 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 4f714c0809a..2d3697b7c4e 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 @@ -2,6 +2,12 @@ #define V1MODEL_VERSION 20200408 #include +enum bit<8> FieldLists { + clone_e2e_FL = 0, + recirculate_FL = 1, + resubmit_FL = 2 +} + struct intrinsic_metadata_t { bit<48> ingress_global_timestamp; bit<48> egress_global_timestamp; @@ -10,10 +16,14 @@ struct intrinsic_metadata_t { } struct mymeta_t { + @field_list(FieldLists.resubmit_FL) bit<8> resubmit_count; + @field_list(FieldLists.recirculate_FL) bit<8> recirculate_count; + @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) bit<8> f1; } @@ -54,13 +64,13 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr - 48w23; meta.mymeta.f1 = meta.mymeta.f1 + 8w23; meta.mymeta.clone_e2e_count = meta.mymeta.clone_e2e_count + 8w1; - clone3(CloneType.E2E, (bit<32>)32w1, { meta.mymeta.clone_e2e_count, meta.mymeta.f1 }); + clone3(CloneType.E2E, (bit<32>)32w1, (bit<8>)FieldLists.clone_e2e_FL); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr - 48w19; meta.mymeta.f1 = meta.mymeta.f1 + 8w19; meta.mymeta.recirculate_count = meta.mymeta.recirculate_count + 8w1; - recirculate({ meta.mymeta.recirculate_count, meta.mymeta.f1 }); + recirculate((bit<8>)FieldLists.recirculate_FL); } @name("._nop") action _nop() { } @@ -235,7 +245,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ethernet.srcAddr = hdr.ethernet.srcAddr - 48w17; meta.mymeta.f1 = meta.mymeta.f1 + 8w17; meta.mymeta.resubmit_count = meta.mymeta.resubmit_count + 8w1; - resubmit({ meta.mymeta.resubmit_count, meta.mymeta.f1 }); + resubmit((bit<8>)FieldLists.resubmit_FL); } @name("._nop") action _nop() { } 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 296b63682e3..198aebc55be 100644 --- a/testdata/p4_14_samples_outputs/p414-special-ops-first.p4 +++ b/testdata/p4_14_samples_outputs/p414-special-ops-first.p4 @@ -2,6 +2,12 @@ #define V1MODEL_VERSION 20200408 #include +enum bit<8> FieldLists { + clone_e2e_FL = 8w0, + recirculate_FL = 8w1, + resubmit_FL = 8w2 +} + struct intrinsic_metadata_t { bit<48> ingress_global_timestamp; bit<48> egress_global_timestamp; @@ -10,10 +16,14 @@ struct intrinsic_metadata_t { } struct mymeta_t { + @field_list(FieldLists.resubmit_FL) bit<8> resubmit_count; + @field_list(FieldLists.recirculate_FL) bit<8> recirculate_count; + @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) bit<8> f1; } @@ -54,13 +64,13 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710633; meta.mymeta.f1 = meta.mymeta.f1 + 8w23; meta.mymeta.clone_e2e_count = meta.mymeta.clone_e2e_count + 8w1; - clone3, bit<8>>>(CloneType.E2E, 32w1, { meta.mymeta.clone_e2e_count, meta.mymeta.f1 }); + clone3(CloneType.E2E, 32w1, (bit<8>)FieldLists.clone_e2e_FL); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710637; meta.mymeta.f1 = meta.mymeta.f1 + 8w19; meta.mymeta.recirculate_count = meta.mymeta.recirculate_count + 8w1; - recirculate, bit<8>>>({ meta.mymeta.recirculate_count, meta.mymeta.f1 }); + recirculate((bit<8>)FieldLists.recirculate_FL); } @name("._nop") action _nop() { } @@ -218,7 +228,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710639; meta.mymeta.f1 = meta.mymeta.f1 + 8w17; meta.mymeta.resubmit_count = meta.mymeta.resubmit_count + 8w1; - resubmit, bit<8>>>({ meta.mymeta.resubmit_count, meta.mymeta.f1 }); + resubmit((bit<8>)FieldLists.resubmit_FL); } @name("._nop") action _nop() { } 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 ab18d484045..d52f4609bfb 100644 --- a/testdata/p4_14_samples_outputs/p414-special-ops-frontend.p4 +++ b/testdata/p4_14_samples_outputs/p414-special-ops-frontend.p4 @@ -2,6 +2,12 @@ #define V1MODEL_VERSION 20200408 #include +enum bit<8> FieldLists { + clone_e2e_FL = 8w0, + recirculate_FL = 8w1, + resubmit_FL = 8w2 +} + struct intrinsic_metadata_t { bit<48> ingress_global_timestamp; bit<48> egress_global_timestamp; @@ -10,10 +16,14 @@ struct intrinsic_metadata_t { } struct mymeta_t { + @field_list(FieldLists.resubmit_FL) bit<8> resubmit_count; + @field_list(FieldLists.recirculate_FL) bit<8> recirculate_count; + @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) bit<8> f1; } @@ -54,13 +64,13 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710633; meta.mymeta.f1 = meta.mymeta.f1 + 8w23; meta.mymeta.clone_e2e_count = meta.mymeta.clone_e2e_count + 8w1; - clone3, bit<8>>>(CloneType.E2E, 32w1, { meta.mymeta.clone_e2e_count, meta.mymeta.f1 }); + clone3(CloneType.E2E, 32w1, (bit<8>)FieldLists.clone_e2e_FL); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710637; meta.mymeta.f1 = meta.mymeta.f1 + 8w19; meta.mymeta.recirculate_count = meta.mymeta.recirculate_count + 8w1; - recirculate, bit<8>>>({ meta.mymeta.recirculate_count, meta.mymeta.f1 }); + recirculate((bit<8>)FieldLists.recirculate_FL); } @name("._nop") action _nop() { } @@ -247,7 +257,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710639; meta.mymeta.f1 = meta.mymeta.f1 + 8w17; meta.mymeta.resubmit_count = meta.mymeta.resubmit_count + 8w1; - resubmit, bit<8>>>({ meta.mymeta.resubmit_count, meta.mymeta.f1 }); + resubmit((bit<8>)FieldLists.resubmit_FL); } @name("._nop") action _nop_3() { } 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 41fda9fc3c2..1fd5132e91d 100644 --- a/testdata/p4_14_samples_outputs/p414-special-ops-midend.p4 +++ b/testdata/p4_14_samples_outputs/p414-special-ops-midend.p4 @@ -10,10 +10,14 @@ struct intrinsic_metadata_t { } struct mymeta_t { + @field_list(8w2) bit<8> resubmit_count; + @field_list(8w1) bit<8> recirculate_count; + @field_list(8w0) bit<8> clone_e2e_count; bit<8> last_ing_instance_type; + @field_list(8w0, 8w1, 8w2) bit<8> f1; } @@ -28,10 +32,14 @@ header ethernet_t { } struct metadata { + @field_list(8w2) bit<8> _mymeta_resubmit_count0; + @field_list(8w1) bit<8> _mymeta_recirculate_count1; + @field_list(8w0) bit<8> _mymeta_clone_e2e_count2; bit<8> _mymeta_last_ing_instance_type3; + @field_list(8w0, 8w1, 8w2) bit<8> _mymeta_f14; bit<48> _temporaries_temp15; } @@ -51,23 +59,18 @@ parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout } } -struct tuple_0 { - bit<8> f0; - bit<8> f1; -} - control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { @name(".do_clone_e2e") action do_clone_e2e() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710633; meta._mymeta_f14 = meta._mymeta_f14 + 8w23; meta._mymeta_clone_e2e_count2 = meta._mymeta_clone_e2e_count2 + 8w1; - clone3(CloneType.E2E, 32w1, (tuple_0){f0 = meta._mymeta_clone_e2e_count2,f1 = meta._mymeta_f14}); + clone3(CloneType.E2E, 32w1, 8w0); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710637; meta._mymeta_f14 = meta._mymeta_f14 + 8w19; meta._mymeta_recirculate_count1 = meta._mymeta_recirculate_count1 + 8w1; - recirculate((tuple_0){f0 = meta._mymeta_recirculate_count1,f1 = meta._mymeta_f14}); + recirculate(8w1); } @name("._nop") action _nop() { } @@ -254,7 +257,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710639; meta._mymeta_f14 = meta._mymeta_f14 + 8w17; meta._mymeta_resubmit_count0 = meta._mymeta_resubmit_count0 + 8w1; - resubmit((tuple_0){f0 = meta._mymeta_resubmit_count0,f1 = meta._mymeta_f14}); + resubmit(8w2); } @name("._nop") action _nop_3() { } diff --git a/testdata/p4_14_samples_outputs/p414-special-ops.p4 b/testdata/p4_14_samples_outputs/p414-special-ops.p4 index 777dd682b61..7c92e274d44 100644 --- a/testdata/p4_14_samples_outputs/p414-special-ops.p4 +++ b/testdata/p4_14_samples_outputs/p414-special-ops.p4 @@ -2,6 +2,12 @@ #define V1MODEL_VERSION 20200408 #include +enum bit<8> FieldLists { + clone_e2e_FL = 0, + recirculate_FL = 1, + resubmit_FL = 2 +} + struct intrinsic_metadata_t { bit<48> ingress_global_timestamp; bit<48> egress_global_timestamp; @@ -10,10 +16,14 @@ struct intrinsic_metadata_t { } struct mymeta_t { + @field_list(FieldLists.resubmit_FL) bit<8> resubmit_count; + @field_list(FieldLists.recirculate_FL) bit<8> recirculate_count; + @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) bit<8> f1; } @@ -54,13 +64,13 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr - 48w23; meta.mymeta.f1 = meta.mymeta.f1 + 8w23; meta.mymeta.clone_e2e_count = meta.mymeta.clone_e2e_count + 8w1; - clone3(CloneType.E2E, (bit<32>)32w1, { meta.mymeta.clone_e2e_count, meta.mymeta.f1 }); + clone3(CloneType.E2E, (bit<32>)32w1, (bit<8>)FieldLists.clone_e2e_FL); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr - 48w19; meta.mymeta.f1 = meta.mymeta.f1 + 8w19; meta.mymeta.recirculate_count = meta.mymeta.recirculate_count + 8w1; - recirculate({ meta.mymeta.recirculate_count, meta.mymeta.f1 }); + recirculate((bit<8>)FieldLists.recirculate_FL); } @name("._nop") action _nop() { } @@ -222,7 +232,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ethernet.srcAddr = hdr.ethernet.srcAddr - 48w17; meta.mymeta.f1 = meta.mymeta.f1 + 8w17; meta.mymeta.resubmit_count = meta.mymeta.resubmit_count + 8w1; - resubmit({ meta.mymeta.resubmit_count, meta.mymeta.f1 }); + resubmit((bit<8>)FieldLists.resubmit_FL); } @name("._nop") action _nop() { } diff --git a/testdata/p4_14_samples_outputs/packet_redirect-first.p4 b/testdata/p4_14_samples_outputs/packet_redirect-first.p4 index b7dff2ae776..67b084243d7 100644 --- a/testdata/p4_14_samples_outputs/packet_redirect-first.p4 +++ b/testdata/p4_14_samples_outputs/packet_redirect-first.p4 @@ -2,6 +2,10 @@ #define V1MODEL_VERSION 20200408 #include +enum bit<8> FieldLists { + redirect_FL = 8w0 +} + struct intrinsic_metadata_t { bit<16> mcast_grp; bit<4> egress_rid; @@ -9,7 +13,9 @@ struct intrinsic_metadata_t { } struct metaA_t { + @field_list(FieldLists.redirect_FL) bit<8> f1; + @field_list(FieldLists.redirect_FL) bit<8> f2; } @@ -46,10 +52,10 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t @name("._nop") action _nop() { } @name("._recirculate") action _recirculate() { - recirculate>({ standard_metadata, meta.metaA }); + recirculate((bit<8>)FieldLists.redirect_FL); } @name("._clone_e2e") action _clone_e2e(bit<32> mirror_id) { - clone3>(CloneType.E2E, mirror_id, { standard_metadata, meta.metaA }); + clone3(CloneType.E2E, mirror_id, (bit<8>)FieldLists.redirect_FL); } @name(".t_egress") table t_egress { actions = { @@ -81,10 +87,10 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ standard_metadata.mcast_grp = mgrp; } @name("._resubmit") action _resubmit() { - resubmit>({ standard_metadata, meta.metaA }); + resubmit((bit<8>)FieldLists.redirect_FL); } @name("._clone_i2e") action _clone_i2e(bit<32> mirror_id) { - clone3>(CloneType.I2E, mirror_id, { standard_metadata, meta.metaA }); + clone3(CloneType.I2E, mirror_id, (bit<8>)FieldLists.redirect_FL); } @name(".t_ingress_1") table t_ingress_1 { actions = { diff --git a/testdata/p4_14_samples_outputs/packet_redirect-frontend.p4 b/testdata/p4_14_samples_outputs/packet_redirect-frontend.p4 index 4e07d9280e2..af0ecd65476 100644 --- a/testdata/p4_14_samples_outputs/packet_redirect-frontend.p4 +++ b/testdata/p4_14_samples_outputs/packet_redirect-frontend.p4 @@ -2,6 +2,10 @@ #define V1MODEL_VERSION 20200408 #include +enum bit<8> FieldLists { + redirect_FL = 8w0 +} + struct intrinsic_metadata_t { bit<16> mcast_grp; bit<4> egress_rid; @@ -9,7 +13,9 @@ struct intrinsic_metadata_t { } struct metaA_t { + @field_list(FieldLists.redirect_FL) bit<8> f1; + @field_list(FieldLists.redirect_FL) bit<8> f2; } @@ -48,10 +54,10 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t @name("._nop") action _nop() { } @name("._recirculate") action _recirculate() { - recirculate>({ standard_metadata, meta.metaA }); + recirculate((bit<8>)FieldLists.redirect_FL); } @name("._clone_e2e") action _clone_e2e(@name("mirror_id") bit<32> mirror_id) { - clone3>(CloneType.E2E, mirror_id, { standard_metadata, meta.metaA }); + clone3(CloneType.E2E, mirror_id, (bit<8>)FieldLists.redirect_FL); } @name(".t_egress") table t_egress_0 { actions = { @@ -89,10 +95,10 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ standard_metadata.mcast_grp = mgrp; } @name("._resubmit") action _resubmit() { - resubmit>({ standard_metadata, meta.metaA }); + resubmit((bit<8>)FieldLists.redirect_FL); } @name("._clone_i2e") action _clone_i2e(@name("mirror_id") bit<32> mirror_id_2) { - clone3>(CloneType.I2E, mirror_id_2, { standard_metadata, meta.metaA }); + clone3(CloneType.I2E, mirror_id_2, (bit<8>)FieldLists.redirect_FL); } @name(".t_ingress_1") table t_ingress { actions = { diff --git a/testdata/p4_14_samples_outputs/packet_redirect-midend.p4 b/testdata/p4_14_samples_outputs/packet_redirect-midend.p4 index cf7478723cc..e4ca5e8bb72 100644 --- a/testdata/p4_14_samples_outputs/packet_redirect-midend.p4 +++ b/testdata/p4_14_samples_outputs/packet_redirect-midend.p4 @@ -9,7 +9,9 @@ struct intrinsic_metadata_t { } struct metaA_t { + @field_list(8w0) bit<8> f1; + @field_list(8w0) bit<8> f2; } @@ -24,7 +26,9 @@ header hdrA_t { } struct metadata { + @field_list(8w0) bit<8> _metaA_f10; + @field_list(8w0) bit<8> _metaA_f21; bit<8> _metaB_f12; bit<8> _metaB_f23; @@ -42,21 +46,16 @@ parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout } } -struct tuple_0 { - standard_metadata_t f0; - metaA_t f1; -} - control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { @noWarn("unused") @name(".NoAction") action NoAction_2() { } @name("._nop") action _nop() { } @name("._recirculate") action _recirculate() { - recirculate((tuple_0){f0 = standard_metadata,f1 = (metaA_t){f1 = meta._metaA_f10,f2 = meta._metaA_f21}}); + recirculate(8w0); } @name("._clone_e2e") action _clone_e2e(@name("mirror_id") bit<32> mirror_id) { - clone3(CloneType.E2E, mirror_id, (tuple_0){f0 = standard_metadata,f1 = (metaA_t){f1 = meta._metaA_f10,f2 = meta._metaA_f21}}); + clone3(CloneType.E2E, mirror_id, 8w0); } @name(".t_egress") table t_egress_0 { actions = { @@ -94,10 +93,10 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ standard_metadata.mcast_grp = mgrp; } @name("._resubmit") action _resubmit() { - resubmit((tuple_0){f0 = standard_metadata,f1 = (metaA_t){f1 = meta._metaA_f10,f2 = meta._metaA_f21}}); + resubmit(8w0); } @name("._clone_i2e") action _clone_i2e(@name("mirror_id") bit<32> mirror_id_2) { - clone3(CloneType.I2E, mirror_id_2, (tuple_0){f0 = standard_metadata,f1 = (metaA_t){f1 = meta._metaA_f10,f2 = meta._metaA_f21}}); + clone3(CloneType.I2E, mirror_id_2, 8w0); } @name(".t_ingress_1") table t_ingress { actions = { diff --git a/testdata/p4_14_samples_outputs/packet_redirect.p4 b/testdata/p4_14_samples_outputs/packet_redirect.p4 index cdecf1846ed..ca89db60689 100644 --- a/testdata/p4_14_samples_outputs/packet_redirect.p4 +++ b/testdata/p4_14_samples_outputs/packet_redirect.p4 @@ -2,6 +2,10 @@ #define V1MODEL_VERSION 20200408 #include +enum bit<8> FieldLists { + redirect_FL = 0 +} + struct intrinsic_metadata_t { bit<16> mcast_grp; bit<4> egress_rid; @@ -9,7 +13,9 @@ struct intrinsic_metadata_t { } struct metaA_t { + @field_list(FieldLists.redirect_FL) bit<8> f1; + @field_list(FieldLists.redirect_FL) bit<8> f2; } @@ -46,10 +52,10 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t @name("._nop") action _nop() { } @name("._recirculate") action _recirculate() { - recirculate({ standard_metadata, meta.metaA }); + recirculate((bit<8>)FieldLists.redirect_FL); } @name("._clone_e2e") action _clone_e2e(bit<32> mirror_id) { - clone3(CloneType.E2E, (bit<32>)mirror_id, { standard_metadata, meta.metaA }); + clone3(CloneType.E2E, (bit<32>)mirror_id, (bit<8>)FieldLists.redirect_FL); } @name(".t_egress") table t_egress { actions = { @@ -79,10 +85,10 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ standard_metadata.mcast_grp = mgrp; } @name("._resubmit") action _resubmit() { - resubmit({ standard_metadata, meta.metaA }); + resubmit((bit<8>)FieldLists.redirect_FL); } @name("._clone_i2e") action _clone_i2e(bit<32> mirror_id) { - clone3(CloneType.I2E, (bit<32>)mirror_id, { standard_metadata, meta.metaA }); + clone3(CloneType.I2E, (bit<32>)mirror_id, (bit<8>)FieldLists.redirect_FL); } @name(".t_ingress_1") table t_ingress_1 { actions = { diff --git a/testdata/p4_14_samples_outputs/resubmit-first.p4 b/testdata/p4_14_samples_outputs/resubmit-first.p4 index 17fcdc18135..ce77f9d140f 100644 --- a/testdata/p4_14_samples_outputs/resubmit-first.p4 +++ b/testdata/p4_14_samples_outputs/resubmit-first.p4 @@ -2,12 +2,17 @@ #define V1MODEL_VERSION 20200408 #include +enum bit<8> FieldLists { + resubmit_FL = 8w0 +} + struct intrinsic_metadata_t { bit<4> mcast_grp; bit<4> egress_rid; } struct mymeta_t { + @field_list(FieldLists.resubmit_FL) bit<8> f1; } @@ -50,7 +55,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ } @name("._resubmit") action _resubmit() { meta.mymeta.f1 = 8w1; - resubmit>({ standard_metadata, meta.mymeta }); + resubmit((bit<8>)FieldLists.resubmit_FL); } @name(".t_ingress_1") table t_ingress_1 { actions = { diff --git a/testdata/p4_14_samples_outputs/resubmit-frontend.p4 b/testdata/p4_14_samples_outputs/resubmit-frontend.p4 index 1c42a332ee2..e9bd8322b62 100644 --- a/testdata/p4_14_samples_outputs/resubmit-frontend.p4 +++ b/testdata/p4_14_samples_outputs/resubmit-frontend.p4 @@ -2,12 +2,17 @@ #define V1MODEL_VERSION 20200408 #include +enum bit<8> FieldLists { + resubmit_FL = 8w0 +} + struct intrinsic_metadata_t { bit<4> mcast_grp; bit<4> egress_rid; } struct mymeta_t { + @field_list(FieldLists.resubmit_FL) bit<8> f1; } @@ -56,7 +61,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ } @name("._resubmit") action _resubmit() { meta.mymeta.f1 = 8w1; - resubmit>({ standard_metadata, meta.mymeta }); + resubmit((bit<8>)FieldLists.resubmit_FL); } @name(".t_ingress_1") table t_ingress { actions = { diff --git a/testdata/p4_14_samples_outputs/resubmit-midend.p4 b/testdata/p4_14_samples_outputs/resubmit-midend.p4 index 222bb6c0a21..3a9fb2a7e19 100644 --- a/testdata/p4_14_samples_outputs/resubmit-midend.p4 +++ b/testdata/p4_14_samples_outputs/resubmit-midend.p4 @@ -8,6 +8,7 @@ struct intrinsic_metadata_t { } struct mymeta_t { + @field_list(8w0) bit<8> f1; } @@ -18,6 +19,7 @@ header ethernet_t { } struct metadata { + @field_list(8w0) bit<8> _mymeta_f10; } @@ -41,11 +43,6 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t } } -struct tuple_0 { - standard_metadata_t f0; - mymeta_t f1; -} - control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { @noWarn("unused") @name(".NoAction") action NoAction_1() { } @@ -60,7 +57,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ } @name("._resubmit") action _resubmit() { meta._mymeta_f10 = 8w1; - resubmit((tuple_0){f0 = standard_metadata,f1 = (mymeta_t){f1 = 8w1}}); + resubmit(8w0); } @name(".t_ingress_1") table t_ingress { actions = { diff --git a/testdata/p4_14_samples_outputs/resubmit.p4 b/testdata/p4_14_samples_outputs/resubmit.p4 index caf543277b4..e7622356f45 100644 --- a/testdata/p4_14_samples_outputs/resubmit.p4 +++ b/testdata/p4_14_samples_outputs/resubmit.p4 @@ -2,12 +2,17 @@ #define V1MODEL_VERSION 20200408 #include +enum bit<8> FieldLists { + resubmit_FL = 0 +} + struct intrinsic_metadata_t { bit<4> mcast_grp; bit<4> egress_rid; } struct mymeta_t { + @field_list(FieldLists.resubmit_FL) bit<8> f1; } @@ -50,7 +55,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ } @name("._resubmit") action _resubmit() { meta.mymeta.f1 = 8w1; - resubmit({ standard_metadata, meta.mymeta }); + resubmit((bit<8>)FieldLists.resubmit_FL); } @name(".t_ingress_1") table t_ingress_1 { actions = { diff --git a/testdata/p4_14_samples_outputs/simple_nat-first.p4 b/testdata/p4_14_samples_outputs/simple_nat-first.p4 index 81f4d09f08f..afdfd91c6ca 100644 --- a/testdata/p4_14_samples_outputs/simple_nat-first.p4 +++ b/testdata/p4_14_samples_outputs/simple_nat-first.p4 @@ -2,6 +2,10 @@ #define V1MODEL_VERSION 20200408 #include +enum bit<8> FieldLists { + copy_to_cpu_fields = 8w0 +} + struct intrinsic_metadata_t { bit<4> mcast_grp; bit<4> egress_rid; @@ -181,7 +185,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ipv4.ttl = hdr.ipv4.ttl + 8w255; } @name(".nat_miss_int_to_ext") action nat_miss_int_to_ext() { - clone3>(CloneType.I2E, 32w250, { standard_metadata }); + clone3(CloneType.I2E, 32w250, (bit<8>)FieldLists.copy_to_cpu_fields); } @name(".nat_miss_ext_to_int") action nat_miss_ext_to_int() { meta.meta.do_forward = 1w0; diff --git a/testdata/p4_14_samples_outputs/simple_nat-frontend.p4 b/testdata/p4_14_samples_outputs/simple_nat-frontend.p4 index b7b10219fdc..9c5e0b97350 100644 --- a/testdata/p4_14_samples_outputs/simple_nat-frontend.p4 +++ b/testdata/p4_14_samples_outputs/simple_nat-frontend.p4 @@ -2,6 +2,10 @@ #define V1MODEL_VERSION 20200408 #include +enum bit<8> FieldLists { + copy_to_cpu_fields = 8w0 +} + struct intrinsic_metadata_t { bit<4> mcast_grp; bit<4> egress_rid; @@ -206,7 +210,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ipv4.ttl = hdr.ipv4.ttl + 8w255; } @name(".nat_miss_int_to_ext") action nat_miss_int_to_ext() { - clone3>(CloneType.I2E, 32w250, { standard_metadata }); + clone3(CloneType.I2E, 32w250, (bit<8>)FieldLists.copy_to_cpu_fields); } @name(".nat_miss_ext_to_int") action nat_miss_ext_to_int() { meta.meta.do_forward = 1w0; diff --git a/testdata/p4_14_samples_outputs/simple_nat-midend.p4 b/testdata/p4_14_samples_outputs/simple_nat-midend.p4 index 820deef3db1..0a42ecb1e19 100644 --- a/testdata/p4_14_samples_outputs/simple_nat-midend.p4 +++ b/testdata/p4_14_samples_outputs/simple_nat-midend.p4 @@ -178,10 +178,6 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t } } -struct tuple_0 { - standard_metadata_t f0; -} - control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { @noWarn("unused") @name(".NoAction") action NoAction_4() { } @@ -217,7 +213,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ipv4.ttl = hdr.ipv4.ttl + 8w255; } @name(".nat_miss_int_to_ext") action nat_miss_int_to_ext() { - clone3(CloneType.I2E, 32w250, (tuple_0){f0 = standard_metadata}); + clone3(CloneType.I2E, 32w250, 8w0); } @name(".nat_miss_ext_to_int") action nat_miss_ext_to_int() { meta._meta_do_forward0 = 1w0; @@ -312,7 +308,7 @@ control DeparserImpl(packet_out packet, in headers hdr) { } } -struct tuple_1 { +struct tuple_0 { bit<4> f0; bit<4> f1; bit<8> f2; @@ -326,7 +322,7 @@ struct tuple_1 { bit<32> f10; } -struct tuple_2 { +struct tuple_1 { bit<32> f0; bit<32> f1; bit<8> f2; @@ -345,15 +341,15 @@ struct tuple_2 { control verifyChecksum(inout headers hdr, inout metadata meta) { apply { - verify_checksum>(true, (tuple_1){f0 = hdr.ipv4.version,f1 = hdr.ipv4.ihl,f2 = hdr.ipv4.diffserv,f3 = hdr.ipv4.totalLen,f4 = hdr.ipv4.identification,f5 = hdr.ipv4.flags,f6 = hdr.ipv4.fragOffset,f7 = hdr.ipv4.ttl,f8 = hdr.ipv4.protocol,f9 = hdr.ipv4.srcAddr,f10 = hdr.ipv4.dstAddr}, hdr.ipv4.hdrChecksum, HashAlgorithm.csum16); - verify_checksum_with_payload>(hdr.tcp.isValid(), (tuple_2){f0 = hdr.ipv4.srcAddr,f1 = hdr.ipv4.dstAddr,f2 = 8w0,f3 = hdr.ipv4.protocol,f4 = meta._meta_tcpLength9,f5 = hdr.tcp.srcPort,f6 = hdr.tcp.dstPort,f7 = hdr.tcp.seqNo,f8 = hdr.tcp.ackNo,f9 = hdr.tcp.dataOffset,f10 = hdr.tcp.res,f11 = hdr.tcp.flags,f12 = hdr.tcp.window,f13 = hdr.tcp.urgentPtr}, hdr.tcp.checksum, HashAlgorithm.csum16); + verify_checksum>(true, (tuple_0){f0 = hdr.ipv4.version,f1 = hdr.ipv4.ihl,f2 = hdr.ipv4.diffserv,f3 = hdr.ipv4.totalLen,f4 = hdr.ipv4.identification,f5 = hdr.ipv4.flags,f6 = hdr.ipv4.fragOffset,f7 = hdr.ipv4.ttl,f8 = hdr.ipv4.protocol,f9 = hdr.ipv4.srcAddr,f10 = hdr.ipv4.dstAddr}, hdr.ipv4.hdrChecksum, HashAlgorithm.csum16); + verify_checksum_with_payload>(hdr.tcp.isValid(), (tuple_1){f0 = hdr.ipv4.srcAddr,f1 = hdr.ipv4.dstAddr,f2 = 8w0,f3 = hdr.ipv4.protocol,f4 = meta._meta_tcpLength9,f5 = hdr.tcp.srcPort,f6 = hdr.tcp.dstPort,f7 = hdr.tcp.seqNo,f8 = hdr.tcp.ackNo,f9 = hdr.tcp.dataOffset,f10 = hdr.tcp.res,f11 = hdr.tcp.flags,f12 = hdr.tcp.window,f13 = hdr.tcp.urgentPtr}, hdr.tcp.checksum, HashAlgorithm.csum16); } } control computeChecksum(inout headers hdr, inout metadata meta) { apply { - update_checksum>(true, (tuple_1){f0 = hdr.ipv4.version,f1 = hdr.ipv4.ihl,f2 = hdr.ipv4.diffserv,f3 = hdr.ipv4.totalLen,f4 = hdr.ipv4.identification,f5 = hdr.ipv4.flags,f6 = hdr.ipv4.fragOffset,f7 = hdr.ipv4.ttl,f8 = hdr.ipv4.protocol,f9 = hdr.ipv4.srcAddr,f10 = hdr.ipv4.dstAddr}, hdr.ipv4.hdrChecksum, HashAlgorithm.csum16); - update_checksum_with_payload>(hdr.tcp.isValid(), (tuple_2){f0 = hdr.ipv4.srcAddr,f1 = hdr.ipv4.dstAddr,f2 = 8w0,f3 = hdr.ipv4.protocol,f4 = meta._meta_tcpLength9,f5 = hdr.tcp.srcPort,f6 = hdr.tcp.dstPort,f7 = hdr.tcp.seqNo,f8 = hdr.tcp.ackNo,f9 = hdr.tcp.dataOffset,f10 = hdr.tcp.res,f11 = hdr.tcp.flags,f12 = hdr.tcp.window,f13 = hdr.tcp.urgentPtr}, hdr.tcp.checksum, HashAlgorithm.csum16); + update_checksum>(true, (tuple_0){f0 = hdr.ipv4.version,f1 = hdr.ipv4.ihl,f2 = hdr.ipv4.diffserv,f3 = hdr.ipv4.totalLen,f4 = hdr.ipv4.identification,f5 = hdr.ipv4.flags,f6 = hdr.ipv4.fragOffset,f7 = hdr.ipv4.ttl,f8 = hdr.ipv4.protocol,f9 = hdr.ipv4.srcAddr,f10 = hdr.ipv4.dstAddr}, hdr.ipv4.hdrChecksum, HashAlgorithm.csum16); + update_checksum_with_payload>(hdr.tcp.isValid(), (tuple_1){f0 = hdr.ipv4.srcAddr,f1 = hdr.ipv4.dstAddr,f2 = 8w0,f3 = hdr.ipv4.protocol,f4 = meta._meta_tcpLength9,f5 = hdr.tcp.srcPort,f6 = hdr.tcp.dstPort,f7 = hdr.tcp.seqNo,f8 = hdr.tcp.ackNo,f9 = hdr.tcp.dataOffset,f10 = hdr.tcp.res,f11 = hdr.tcp.flags,f12 = hdr.tcp.window,f13 = hdr.tcp.urgentPtr}, hdr.tcp.checksum, HashAlgorithm.csum16); } } diff --git a/testdata/p4_14_samples_outputs/simple_nat.p4 b/testdata/p4_14_samples_outputs/simple_nat.p4 index 54cec7446e9..d09a482502a 100644 --- a/testdata/p4_14_samples_outputs/simple_nat.p4 +++ b/testdata/p4_14_samples_outputs/simple_nat.p4 @@ -2,6 +2,10 @@ #define V1MODEL_VERSION 20200408 #include +enum bit<8> FieldLists { + copy_to_cpu_fields = 0 +} + struct intrinsic_metadata_t { bit<4> mcast_grp; bit<4> egress_rid; @@ -177,7 +181,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ipv4.ttl = hdr.ipv4.ttl - 8w1; } @name(".nat_miss_int_to_ext") action nat_miss_int_to_ext() { - clone3(CloneType.I2E, (bit<32>)32w250, { standard_metadata }); + clone3(CloneType.I2E, (bit<32>)32w250, (bit<8>)FieldLists.copy_to_cpu_fields); } @name(".nat_miss_ext_to_int") action nat_miss_ext_to_int() { meta.meta.do_forward = 1w0; 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 17bfb1e3582..4ff7243c687 100644 --- a/testdata/p4_14_samples_outputs/switch_20160512/switch-first.p4 +++ b/testdata/p4_14_samples_outputs/switch_20160512/switch-first.p4 @@ -2,6 +2,15 @@ #define V1MODEL_VERSION 20200408 #include +enum bit<8> FieldLists { + i2e_mirror_info = 8w0, + cpu_info = 8w1, + e2e_mirror_info = 8w2, + int_i2e_mirror_info = 8w3, + mirror_info = 8w4, + sflow_cpu_info = 8w5 +} + struct acl_metadata_t { bit<1> acl_deny; bit<1> acl_copy; @@ -40,6 +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) bit<16> reason_code; bit<8> dst_device; bit<16> dst_port; @@ -56,18 +66,24 @@ struct hash_metadata_t { } struct i2e_metadata_t { + @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) bit<16> mirror_session_id; } struct ingress_metadata_t { + @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) bit<16> ifindex; bit<16> egress_ifindex; bit<2> port_type; bit<16> outer_bd; + @field_list(FieldLists.cpu_info, FieldLists.sflow_cpu_info) bit<16> bd; bit<1> drop_flag; + @field_list(FieldLists.mirror_info) bit<8> drop_reason; bit<1> control_frame; bit<16> bypass_lookups; @@ -85,6 +101,7 @@ struct int_metadata_t { } struct int_metadata_i2e_t { + @field_list(FieldLists.int_i2e_mirror_info) bit<1> sink; bit<1> source; } @@ -2961,7 +2978,7 @@ control process_egress_acl(inout headers hdr, inout metadata meta, inout standar } @name(".egress_mirror") action egress_mirror(bit<32> session_id) { meta.i2e_metadata.mirror_session_id = (bit<16>)session_id; - clone3, bit<16>>>(CloneType.E2E, session_id, { meta.i2e_metadata.ingress_tstamp, meta.i2e_metadata.mirror_session_id }); + clone3(CloneType.E2E, session_id, (bit<8>)FieldLists.e2e_mirror_info); } @name(".egress_mirror_drop") action egress_mirror_drop(bit<32> session_id) { egress_mirror(session_id); @@ -2969,7 +2986,7 @@ control process_egress_acl(inout headers hdr, inout metadata meta, inout standar } @name(".egress_copy_to_cpu") action egress_copy_to_cpu(bit<16> reason_code) { meta.fabric_metadata.reason_code = reason_code; - clone3, bit<16>, bit<16>, bit<9>>>(CloneType.E2E, 32w250, { meta.ingress_metadata.bd, meta.ingress_metadata.ifindex, meta.fabric_metadata.reason_code, meta.ingress_metadata.ingress_port }); + clone3(CloneType.E2E, 32w250, (bit<8>)FieldLists.cpu_info); } @name(".egress_redirect_to_cpu") action egress_redirect_to_cpu(bit<16> reason_code) { egress_copy_to_cpu(reason_code); @@ -3493,7 +3510,7 @@ control process_int_endpoint(inout headers hdr, inout metadata meta, inout stand @name(".int_sink") action int_sink(bit<32> mirror_id) { meta.int_metadata_i2e.sink = 1w1; meta.i2e_metadata.mirror_session_id = (bit<16>)mirror_id; - clone3, bit<16>>>(CloneType.I2E, mirror_id, { meta.int_metadata_i2e.sink, meta.i2e_metadata.mirror_session_id }); + clone3(CloneType.I2E, mirror_id, (bit<8>)FieldLists.int_i2e_mirror_info); hdr.int_header.setInvalid(); hdr.int_val[0].setInvalid(); hdr.int_val[1].setInvalid(); @@ -4284,7 +4301,7 @@ control process_ingress_sflow(inout headers hdr, inout metadata meta, inout stan @name(".sflow_ing_pkt_to_cpu") action sflow_ing_pkt_to_cpu(bit<32> sflow_i2e_mirror_id, bit<16> reason_code) { meta.fabric_metadata.reason_code = reason_code; meta.i2e_metadata.mirror_session_id = (bit<16>)sflow_i2e_mirror_id; - clone3, bit<16>, bit<16>, bit<9>>, bit<16>, bit<16>>>(CloneType.I2E, sflow_i2e_mirror_id, { { meta.ingress_metadata.bd, meta.ingress_metadata.ifindex, meta.fabric_metadata.reason_code, meta.ingress_metadata.ingress_port }, meta.sflow_metadata.sflow_session_id, meta.i2e_metadata.mirror_session_id }); + clone3(CloneType.I2E, sflow_i2e_mirror_id, (bit<8>)FieldLists.sflow_cpu_info); } @name(".sflow_ing_session_enable") action sflow_ing_session_enable(bit<32> rate_thr, bit<16> session_id) { meta.ingress_metadata.sflow_take_sample = rate_thr |+| meta.ingress_metadata.sflow_take_sample; @@ -4297,7 +4314,7 @@ control process_ingress_sflow(inout headers hdr, inout metadata meta, inout stan sflow_ingress_session_pkt_counter.count(); meta.fabric_metadata.reason_code = reason_code; meta.i2e_metadata.mirror_session_id = (bit<16>)sflow_i2e_mirror_id; - clone3, bit<16>, bit<16>, bit<9>>, bit<16>, bit<16>>>(CloneType.I2E, sflow_i2e_mirror_id, { { meta.ingress_metadata.bd, meta.ingress_metadata.ifindex, meta.fabric_metadata.reason_code, meta.ingress_metadata.ingress_port }, meta.sflow_metadata.sflow_session_id, meta.i2e_metadata.mirror_session_id }); + clone3(CloneType.I2E, sflow_i2e_mirror_id, (bit<8>)FieldLists.sflow_cpu_info); } @name(".sflow_ing_take_sample") table sflow_ing_take_sample { actions = { @@ -4515,7 +4532,7 @@ control process_mac_acl(inout headers hdr, inout metadata meta, inout standard_m @name(".acl_mirror") action acl_mirror(bit<32> session_id, bit<14> acl_stats_index, bit<16> acl_meter_index) { meta.i2e_metadata.mirror_session_id = (bit<16>)session_id; meta.i2e_metadata.ingress_tstamp = (bit<32>)standard_metadata.ingress_global_timestamp; - clone3, bit<16>>>(CloneType.I2E, session_id, { meta.i2e_metadata.ingress_tstamp, meta.i2e_metadata.mirror_session_id }); + clone3(CloneType.I2E, session_id, (bit<8>)FieldLists.i2e_mirror_info); meta.acl_metadata.acl_stats_index = acl_stats_index; meta.meter_metadata.meter_index = acl_meter_index; } @@ -4583,7 +4600,7 @@ control process_ip_acl(inout headers hdr, inout metadata meta, inout standard_me @name(".acl_mirror") action acl_mirror(bit<32> session_id, bit<14> acl_stats_index, bit<16> acl_meter_index) { meta.i2e_metadata.mirror_session_id = (bit<16>)session_id; meta.i2e_metadata.ingress_tstamp = (bit<32>)standard_metadata.ingress_global_timestamp; - clone3, bit<16>>>(CloneType.I2E, session_id, { meta.i2e_metadata.ingress_tstamp, meta.i2e_metadata.mirror_session_id }); + clone3(CloneType.I2E, session_id, (bit<8>)FieldLists.i2e_mirror_info); meta.acl_metadata.acl_stats_index = acl_stats_index; meta.meter_metadata.meter_index = acl_meter_index; } @@ -5834,7 +5851,7 @@ control process_system_acl(inout headers hdr, inout metadata meta, inout standar } @name(".copy_to_cpu_with_reason") action copy_to_cpu_with_reason(bit<16> reason_code) { meta.fabric_metadata.reason_code = reason_code; - clone3, bit<16>, bit<16>, bit<9>>>(CloneType.I2E, 32w250, { meta.ingress_metadata.bd, meta.ingress_metadata.ifindex, meta.fabric_metadata.reason_code, meta.ingress_metadata.ingress_port }); + clone3(CloneType.I2E, 32w250, (bit<8>)FieldLists.cpu_info); } @name(".redirect_to_cpu") action redirect_to_cpu(bit<16> reason_code) { copy_to_cpu_with_reason(reason_code); @@ -5842,7 +5859,7 @@ control process_system_acl(inout headers hdr, inout metadata meta, inout standar meta.fabric_metadata.dst_device = 8w0; } @name(".copy_to_cpu") action copy_to_cpu() { - clone3, bit<16>, bit<16>, bit<9>>>(CloneType.I2E, 32w250, { meta.ingress_metadata.bd, meta.ingress_metadata.ifindex, meta.fabric_metadata.reason_code, meta.ingress_metadata.ingress_port }); + clone3(CloneType.I2E, 32w250, (bit<8>)FieldLists.cpu_info); } @name(".drop_packet") action drop_packet() { mark_to_drop(standard_metadata); @@ -5852,7 +5869,7 @@ control process_system_acl(inout headers hdr, inout metadata meta, inout standar mark_to_drop(standard_metadata); } @name(".negative_mirror") action negative_mirror(bit<32> session_id) { - clone3, bit<8>>>(CloneType.I2E, session_id, { meta.ingress_metadata.ifindex, meta.ingress_metadata.drop_reason }); + clone3(CloneType.I2E, session_id, (bit<8>)FieldLists.mirror_info); mark_to_drop(standard_metadata); } @name(".drop_stats") table drop_stats_0 { 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 869f00ef257..cae003c4bec 100644 --- a/testdata/p4_14_samples_outputs/switch_20160512/switch-frontend.p4 +++ b/testdata/p4_14_samples_outputs/switch_20160512/switch-frontend.p4 @@ -2,6 +2,15 @@ #define V1MODEL_VERSION 20200408 #include +enum bit<8> FieldLists { + i2e_mirror_info = 8w0, + cpu_info = 8w1, + e2e_mirror_info = 8w2, + int_i2e_mirror_info = 8w3, + mirror_info = 8w4, + sflow_cpu_info = 8w5 +} + struct acl_metadata_t { bit<1> acl_deny; bit<1> acl_copy; @@ -40,6 +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) bit<16> reason_code; bit<8> dst_device; bit<16> dst_port; @@ -56,18 +66,24 @@ struct hash_metadata_t { } struct i2e_metadata_t { + @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) bit<16> mirror_session_id; } struct ingress_metadata_t { + @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) bit<16> ifindex; bit<16> egress_ifindex; bit<2> port_type; bit<16> outer_bd; + @field_list(FieldLists.cpu_info, FieldLists.sflow_cpu_info) bit<16> bd; bit<1> drop_flag; + @field_list(FieldLists.mirror_info) bit<8> drop_reason; bit<1> control_frame; bit<16> bypass_lookups; @@ -85,6 +101,7 @@ struct int_metadata_t { } struct int_metadata_i2e_t { + @field_list(FieldLists.int_i2e_mirror_info) bit<1> sink; bit<1> source; } @@ -3028,16 +3045,16 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t } @name(".egress_mirror") action _egress_mirror_0(@name("session_id") bit<32> session_id) { meta.i2e_metadata.mirror_session_id = (bit<16>)session_id; - clone3, bit<16>>>(CloneType.E2E, session_id, { meta.i2e_metadata.ingress_tstamp, meta.i2e_metadata.mirror_session_id }); + clone3(CloneType.E2E, session_id, (bit<8>)FieldLists.e2e_mirror_info); } @name(".egress_mirror_drop") action _egress_mirror_drop_0(@name("session_id") bit<32> session_id_6) { meta.i2e_metadata.mirror_session_id = (bit<16>)session_id_6; - clone3, bit<16>>>(CloneType.E2E, session_id_6, { meta.i2e_metadata.ingress_tstamp, meta.i2e_metadata.mirror_session_id }); + clone3(CloneType.E2E, session_id_6, (bit<8>)FieldLists.e2e_mirror_info); mark_to_drop(standard_metadata); } @name(".egress_redirect_to_cpu") action _egress_redirect_to_cpu_0(@name("reason_code") bit<16> reason_code_0) { meta.fabric_metadata.reason_code = reason_code_0; - clone3, bit<16>, bit<16>, bit<9>>>(CloneType.E2E, 32w250, { meta.ingress_metadata.bd, meta.ingress_metadata.ifindex, meta.fabric_metadata.reason_code, meta.ingress_metadata.ingress_port }); + clone3(CloneType.E2E, 32w250, (bit<8>)FieldLists.cpu_info); mark_to_drop(standard_metadata); } @name(".egress_acl") table _egress_acl { @@ -3637,7 +3654,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ meta.int_metadata.insert_byte_cnt = meta.int_metadata.gpe_int_hdr_len << 2; meta.int_metadata_i2e.sink = 1w1; meta.i2e_metadata.mirror_session_id = (bit<16>)mirror_id; - clone3, bit<16>>>(CloneType.I2E, mirror_id, { meta.int_metadata_i2e.sink, meta.i2e_metadata.mirror_session_id }); + clone3(CloneType.I2E, mirror_id, (bit<8>)FieldLists.int_i2e_mirror_info); hdr.int_header.setInvalid(); hdr.int_val[0].setInvalid(); hdr.int_val[1].setInvalid(); @@ -4327,7 +4344,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ _sflow_ingress_session_pkt_counter.count(); meta.fabric_metadata.reason_code = reason_code_5; meta.i2e_metadata.mirror_session_id = (bit<16>)sflow_i2e_mirror_id; - clone3, bit<16>, bit<16>, bit<9>>, bit<16>, bit<16>>>(CloneType.I2E, sflow_i2e_mirror_id, { { meta.ingress_metadata.bd, meta.ingress_metadata.ifindex, meta.fabric_metadata.reason_code, meta.ingress_metadata.ingress_port }, meta.sflow_metadata.sflow_session_id, meta.i2e_metadata.mirror_session_id }); + clone3(CloneType.I2E, sflow_i2e_mirror_id, (bit<8>)FieldLists.sflow_cpu_info); } @name(".sflow_ing_take_sample") table _sflow_ing_take_sample { actions = { @@ -4511,7 +4528,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ @name(".acl_mirror") action _acl_mirror_1(@name("session_id") bit<32> session_id_8, @name("acl_stats_index") bit<14> acl_stats_index_20, @name("acl_meter_index") bit<16> acl_meter_index_11) { meta.i2e_metadata.mirror_session_id = (bit<16>)session_id_8; meta.i2e_metadata.ingress_tstamp = (bit<32>)standard_metadata.ingress_global_timestamp; - clone3, bit<16>>>(CloneType.I2E, session_id_8, { meta.i2e_metadata.ingress_tstamp, meta.i2e_metadata.mirror_session_id }); + clone3(CloneType.I2E, session_id_8, (bit<8>)FieldLists.i2e_mirror_info); meta.acl_metadata.acl_stats_index = acl_stats_index_20; meta.meter_metadata.meter_index = acl_meter_index_11; } @@ -4586,14 +4603,14 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ @name(".acl_mirror") action _acl_mirror_2(@name("session_id") bit<32> session_id_9, @name("acl_stats_index") bit<14> acl_stats_index_27, @name("acl_meter_index") bit<16> acl_meter_index_18) { meta.i2e_metadata.mirror_session_id = (bit<16>)session_id_9; meta.i2e_metadata.ingress_tstamp = (bit<32>)standard_metadata.ingress_global_timestamp; - clone3, bit<16>>>(CloneType.I2E, session_id_9, { meta.i2e_metadata.ingress_tstamp, meta.i2e_metadata.mirror_session_id }); + clone3(CloneType.I2E, session_id_9, (bit<8>)FieldLists.i2e_mirror_info); meta.acl_metadata.acl_stats_index = acl_stats_index_27; meta.meter_metadata.meter_index = acl_meter_index_18; } @name(".acl_mirror") action _acl_mirror_3(@name("session_id") bit<32> session_id_10, @name("acl_stats_index") bit<14> acl_stats_index_28, @name("acl_meter_index") bit<16> acl_meter_index_19) { meta.i2e_metadata.mirror_session_id = (bit<16>)session_id_10; meta.i2e_metadata.ingress_tstamp = (bit<32>)standard_metadata.ingress_global_timestamp; - clone3, bit<16>>>(CloneType.I2E, session_id_10, { meta.i2e_metadata.ingress_tstamp, meta.i2e_metadata.mirror_session_id }); + clone3(CloneType.I2E, session_id_10, (bit<8>)FieldLists.i2e_mirror_info); meta.acl_metadata.acl_stats_index = acl_stats_index_28; meta.meter_metadata.meter_index = acl_meter_index_19; } @@ -5587,16 +5604,16 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ } @name(".copy_to_cpu_with_reason") action _copy_to_cpu_with_reason_0(@name("reason_code") bit<16> reason_code_6) { meta.fabric_metadata.reason_code = reason_code_6; - clone3, bit<16>, bit<16>, bit<9>>>(CloneType.I2E, 32w250, { meta.ingress_metadata.bd, meta.ingress_metadata.ifindex, meta.fabric_metadata.reason_code, meta.ingress_metadata.ingress_port }); + clone3(CloneType.I2E, 32w250, (bit<8>)FieldLists.cpu_info); } @name(".redirect_to_cpu") action _redirect_to_cpu_0(@name("reason_code") bit<16> reason_code_7) { meta.fabric_metadata.reason_code = reason_code_7; - clone3, bit<16>, bit<16>, bit<9>>>(CloneType.I2E, 32w250, { meta.ingress_metadata.bd, meta.ingress_metadata.ifindex, meta.fabric_metadata.reason_code, meta.ingress_metadata.ingress_port }); + clone3(CloneType.I2E, 32w250, (bit<8>)FieldLists.cpu_info); mark_to_drop(standard_metadata); meta.fabric_metadata.dst_device = 8w0; } @name(".copy_to_cpu") action _copy_to_cpu_0() { - clone3, bit<16>, bit<16>, bit<9>>>(CloneType.I2E, 32w250, { meta.ingress_metadata.bd, meta.ingress_metadata.ifindex, meta.fabric_metadata.reason_code, meta.ingress_metadata.ingress_port }); + clone3(CloneType.I2E, 32w250, (bit<8>)FieldLists.cpu_info); } @name(".drop_packet") action _drop_packet_0() { mark_to_drop(standard_metadata); @@ -5606,7 +5623,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ mark_to_drop(standard_metadata); } @name(".negative_mirror") action _negative_mirror_0(@name("session_id") bit<32> session_id_11) { - clone3, bit<8>>>(CloneType.I2E, session_id_11, { meta.ingress_metadata.ifindex, meta.ingress_metadata.drop_reason }); + clone3(CloneType.I2E, session_id_11, (bit<8>)FieldLists.mirror_info); mark_to_drop(standard_metadata); } @name(".drop_stats") table _drop_stats { 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 66779a31b42..e1d032332cb 100644 --- a/testdata/p4_14_samples_outputs/switch_20160512/switch-midend.p4 +++ b/testdata/p4_14_samples_outputs/switch_20160512/switch-midend.p4 @@ -40,6 +40,7 @@ struct egress_metadata_t { struct fabric_metadata_t { bit<3> packetType; bit<1> fabric_header_present; + @field_list(8w1, 8w5) bit<16> reason_code; bit<8> dst_device; bit<16> dst_port; @@ -56,18 +57,24 @@ struct hash_metadata_t { } struct i2e_metadata_t { + @field_list(8w0, 8w2) bit<32> ingress_tstamp; + @field_list(8w0, 8w2, 8w3) bit<16> mirror_session_id; } struct ingress_metadata_t { + @field_list(8w1, 8w5) bit<9> ingress_port; + @field_list(8w1, 8w4, 8w5) bit<16> ifindex; bit<16> egress_ifindex; bit<2> port_type; bit<16> outer_bd; + @field_list(8w1, 8w5) bit<16> bd; bit<1> drop_flag; + @field_list(8w4) bit<8> drop_reason; bit<1> control_frame; bit<16> bypass_lookups; @@ -85,6 +92,7 @@ struct int_metadata_t { } struct int_metadata_i2e_t { + @field_list(8w3) bit<1> sink; bit<1> source; } @@ -668,6 +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) bit<16> _fabric_metadata_reason_code28; bit<8> _fabric_metadata_dst_device29; bit<16> _fabric_metadata_dst_port30; @@ -675,18 +684,25 @@ struct metadata { bit<16> _hash_metadata_hash132; bit<16> _hash_metadata_hash233; bit<16> _hash_metadata_entropy_hash34; + @field_list(8w0, 8w2) bit<32> _i2e_metadata_ingress_tstamp35; + @field_list(8w0, 8w2, 8w3) bit<16> _i2e_metadata_mirror_session_id36; + @field_list(8w1, 8w5) bit<9> _ingress_metadata_ingress_port37; + @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) bit<16> _ingress_metadata_bd42; bit<1> _ingress_metadata_drop_flag43; + @field_list(8w4) bit<8> _ingress_metadata_drop_reason44; bit<1> _ingress_metadata_control_frame45; bit<16> _ingress_metadata_bypass_lookups46; + @saturating bit<32> _ingress_metadata_sflow_take_sample47; bit<32> _int_metadata_switch_id48; bit<8> _int_metadata_insert_cnt49; @@ -694,6 +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) bit<1> _int_metadata_i2e_sink54; bit<1> _int_metadata_i2e_source55; bit<32> _ipv4_metadata_lkp_ipv4_sa56; @@ -745,6 +762,7 @@ struct metadata { bit<1> _l3_metadata_outer_routed102; bit<8> _l3_metadata_mtu_index103; bit<1> _l3_metadata_l3_copy104; + @saturating bit<16> _l3_metadata_l3_mtu_check105; bit<2> _meter_metadata_meter_color106; bit<16> _meter_metadata_meter_index107; @@ -1314,18 +1332,6 @@ parser ParserImpl(packet_in packet, out headers hdr, inout metadata meta, inout @name(".lag_action_profile") @mode("fair") action_selector(HashAlgorithm.identity, 32w1024, 32w8) lag_action_profile; -struct tuple_0 { - bit<32> f0; - bit<16> f1; -} - -struct tuple_1 { - bit<16> f0; - bit<16> f1; - bit<16> f2; - bit<9> f3; -} - control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { @noWarn("unused") @name(".NoAction") action NoAction_2() { } @@ -3143,16 +3149,16 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t } @name(".egress_mirror") action _egress_mirror_0(@name("session_id") bit<32> session_id) { meta._i2e_metadata_mirror_session_id36 = (bit<16>)session_id; - clone3(CloneType.E2E, session_id, (tuple_0){f0 = meta._i2e_metadata_ingress_tstamp35,f1 = (bit<16>)session_id}); + clone3(CloneType.E2E, session_id, 8w2); } @name(".egress_mirror_drop") action _egress_mirror_drop_0(@name("session_id") bit<32> session_id_6) { meta._i2e_metadata_mirror_session_id36 = (bit<16>)session_id_6; - clone3(CloneType.E2E, session_id_6, (tuple_0){f0 = meta._i2e_metadata_ingress_tstamp35,f1 = (bit<16>)session_id_6}); + clone3(CloneType.E2E, session_id_6, 8w2); mark_to_drop(standard_metadata); } @name(".egress_redirect_to_cpu") action _egress_redirect_to_cpu_0(@name("reason_code") bit<16> reason_code_0) { meta._fabric_metadata_reason_code28 = reason_code_0; - clone3(CloneType.E2E, 32w250, (tuple_1){f0 = meta._ingress_metadata_bd42,f1 = meta._ingress_metadata_ifindex38,f2 = reason_code_0,f3 = meta._ingress_metadata_ingress_port37}); + clone3(CloneType.E2E, 32w250, 8w1); mark_to_drop(standard_metadata); } @name(".egress_acl") table _egress_acl { @@ -3267,18 +3273,7 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t @name(".drop_stats_2") counter>(32w1024, CounterType.packets) drop_stats_2; -struct tuple_2 { - bit<1> f0; - bit<16> f1; -} - -struct tuple_3 { - tuple_1 f0; - bit<16> f1; - bit<16> f2; -} - -struct tuple_4 { +struct tuple_0 { bit<32> f0; bit<32> f1; bit<8> f2; @@ -3286,7 +3281,7 @@ struct tuple_4 { bit<16> f4; } -struct tuple_5 { +struct tuple_1 { bit<48> f0; bit<48> f1; bit<32> f2; @@ -3296,7 +3291,7 @@ struct tuple_5 { bit<16> f6; } -struct tuple_6 { +struct tuple_2 { bit<128> f0; bit<128> f1; bit<8> f2; @@ -3304,7 +3299,7 @@ struct tuple_6 { bit<16> f4; } -struct tuple_7 { +struct tuple_3 { bit<48> f0; bit<48> f1; bit<128> f2; @@ -3314,18 +3309,13 @@ struct tuple_7 { bit<16> f6; } -struct tuple_8 { +struct tuple_4 { bit<16> f0; bit<48> f1; bit<48> f2; bit<16> f3; } -struct tuple_9 { - bit<16> f0; - bit<8> f1; -} - control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { @noWarn("unused") @name(".NoAction") action NoAction_37() { } @@ -3811,7 +3801,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ meta._int_metadata_insert_byte_cnt50 = meta._int_metadata_gpe_int_hdr_len51 << 2; meta._int_metadata_i2e_sink54 = 1w1; meta._i2e_metadata_mirror_session_id36 = (bit<16>)mirror_id; - clone3(CloneType.I2E, mirror_id, (tuple_2){f0 = 1w1,f1 = (bit<16>)mirror_id}); + clone3(CloneType.I2E, mirror_id, 8w3); hdr.int_header.setInvalid(); hdr.int_val[0].setInvalid(); hdr.int_val[1].setInvalid(); @@ -4501,7 +4491,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ _sflow_ingress_session_pkt_counter.count(); meta._fabric_metadata_reason_code28 = reason_code_5; meta._i2e_metadata_mirror_session_id36 = (bit<16>)sflow_i2e_mirror_id; - clone3(CloneType.I2E, sflow_i2e_mirror_id, (tuple_3){f0 = (tuple_1){f0 = meta._ingress_metadata_bd42,f1 = meta._ingress_metadata_ifindex38,f2 = reason_code_5,f3 = meta._ingress_metadata_ingress_port37},f1 = meta._sflow_metadata_sflow_session_id136,f2 = (bit<16>)sflow_i2e_mirror_id}); + clone3(CloneType.I2E, sflow_i2e_mirror_id, 8w5); } @name(".sflow_ing_take_sample") table _sflow_ing_take_sample { actions = { @@ -4685,7 +4675,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ @name(".acl_mirror") action _acl_mirror_1(@name("session_id") bit<32> session_id_8, @name("acl_stats_index") bit<14> acl_stats_index_20, @name("acl_meter_index") bit<16> acl_meter_index_11) { meta._i2e_metadata_mirror_session_id36 = (bit<16>)session_id_8; meta._i2e_metadata_ingress_tstamp35 = (bit<32>)standard_metadata.ingress_global_timestamp; - clone3(CloneType.I2E, session_id_8, (tuple_0){f0 = (bit<32>)standard_metadata.ingress_global_timestamp,f1 = (bit<16>)session_id_8}); + clone3(CloneType.I2E, session_id_8, 8w0); meta._acl_metadata_acl_stats_index11 = acl_stats_index_20; meta._meter_metadata_meter_index107 = acl_meter_index_11; } @@ -4760,14 +4750,14 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ @name(".acl_mirror") action _acl_mirror_2(@name("session_id") bit<32> session_id_9, @name("acl_stats_index") bit<14> acl_stats_index_27, @name("acl_meter_index") bit<16> acl_meter_index_18) { meta._i2e_metadata_mirror_session_id36 = (bit<16>)session_id_9; meta._i2e_metadata_ingress_tstamp35 = (bit<32>)standard_metadata.ingress_global_timestamp; - clone3(CloneType.I2E, session_id_9, (tuple_0){f0 = (bit<32>)standard_metadata.ingress_global_timestamp,f1 = (bit<16>)session_id_9}); + clone3(CloneType.I2E, session_id_9, 8w0); meta._acl_metadata_acl_stats_index11 = acl_stats_index_27; meta._meter_metadata_meter_index107 = acl_meter_index_18; } @name(".acl_mirror") action _acl_mirror_3(@name("session_id") bit<32> session_id_10, @name("acl_stats_index") bit<14> acl_stats_index_28, @name("acl_meter_index") bit<16> acl_meter_index_19) { meta._i2e_metadata_mirror_session_id36 = (bit<16>)session_id_10; meta._i2e_metadata_ingress_tstamp35 = (bit<32>)standard_metadata.ingress_global_timestamp; - clone3(CloneType.I2E, session_id_10, (tuple_0){f0 = (bit<32>)standard_metadata.ingress_global_timestamp,f1 = (bit<16>)session_id_10}); + clone3(CloneType.I2E, session_id_10, 8w0); meta._acl_metadata_acl_stats_index11 = acl_stats_index_28; meta._meter_metadata_meter_index107 = acl_meter_index_19; } @@ -5403,15 +5393,15 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ default_action = NoAction_97(); } @name(".compute_lkp_ipv4_hash") action _compute_lkp_ipv4_hash_0() { - hash, bit<16>, tuple_4, bit<32>>(meta._hash_metadata_hash132, HashAlgorithm.crc16, 16w0, (tuple_4){f0 = meta._ipv4_metadata_lkp_ipv4_sa56,f1 = meta._ipv4_metadata_lkp_ipv4_da57,f2 = meta._l3_metadata_lkp_ip_proto82,f3 = meta._l3_metadata_lkp_l4_sport85,f4 = meta._l3_metadata_lkp_l4_dport86}, 32w65536); - hash, bit<16>, tuple_5, bit<32>>(meta._hash_metadata_hash233, HashAlgorithm.crc16, 16w0, (tuple_5){f0 = meta._l2_metadata_lkp_mac_sa65,f1 = meta._l2_metadata_lkp_mac_da66,f2 = meta._ipv4_metadata_lkp_ipv4_sa56,f3 = meta._ipv4_metadata_lkp_ipv4_da57,f4 = meta._l3_metadata_lkp_ip_proto82,f5 = meta._l3_metadata_lkp_l4_sport85,f6 = meta._l3_metadata_lkp_l4_dport86}, 32w65536); + hash, bit<16>, tuple_0, bit<32>>(meta._hash_metadata_hash132, HashAlgorithm.crc16, 16w0, (tuple_0){f0 = meta._ipv4_metadata_lkp_ipv4_sa56,f1 = meta._ipv4_metadata_lkp_ipv4_da57,f2 = meta._l3_metadata_lkp_ip_proto82,f3 = meta._l3_metadata_lkp_l4_sport85,f4 = meta._l3_metadata_lkp_l4_dport86}, 32w65536); + hash, bit<16>, tuple_1, bit<32>>(meta._hash_metadata_hash233, HashAlgorithm.crc16, 16w0, (tuple_1){f0 = meta._l2_metadata_lkp_mac_sa65,f1 = meta._l2_metadata_lkp_mac_da66,f2 = meta._ipv4_metadata_lkp_ipv4_sa56,f3 = meta._ipv4_metadata_lkp_ipv4_da57,f4 = meta._l3_metadata_lkp_ip_proto82,f5 = meta._l3_metadata_lkp_l4_sport85,f6 = meta._l3_metadata_lkp_l4_dport86}, 32w65536); } @name(".compute_lkp_ipv6_hash") action _compute_lkp_ipv6_hash_0() { - hash, bit<16>, tuple_6, bit<32>>(meta._hash_metadata_hash132, HashAlgorithm.crc16, 16w0, (tuple_6){f0 = meta._ipv6_metadata_lkp_ipv6_sa60,f1 = meta._ipv6_metadata_lkp_ipv6_da61,f2 = meta._l3_metadata_lkp_ip_proto82,f3 = meta._l3_metadata_lkp_l4_sport85,f4 = meta._l3_metadata_lkp_l4_dport86}, 32w65536); - hash, bit<16>, tuple_7, bit<32>>(meta._hash_metadata_hash233, HashAlgorithm.crc16, 16w0, (tuple_7){f0 = meta._l2_metadata_lkp_mac_sa65,f1 = meta._l2_metadata_lkp_mac_da66,f2 = meta._ipv6_metadata_lkp_ipv6_sa60,f3 = meta._ipv6_metadata_lkp_ipv6_da61,f4 = meta._l3_metadata_lkp_ip_proto82,f5 = meta._l3_metadata_lkp_l4_sport85,f6 = meta._l3_metadata_lkp_l4_dport86}, 32w65536); + hash, bit<16>, tuple_2, bit<32>>(meta._hash_metadata_hash132, HashAlgorithm.crc16, 16w0, (tuple_2){f0 = meta._ipv6_metadata_lkp_ipv6_sa60,f1 = meta._ipv6_metadata_lkp_ipv6_da61,f2 = meta._l3_metadata_lkp_ip_proto82,f3 = meta._l3_metadata_lkp_l4_sport85,f4 = meta._l3_metadata_lkp_l4_dport86}, 32w65536); + hash, bit<16>, tuple_3, bit<32>>(meta._hash_metadata_hash233, HashAlgorithm.crc16, 16w0, (tuple_3){f0 = meta._l2_metadata_lkp_mac_sa65,f1 = meta._l2_metadata_lkp_mac_da66,f2 = meta._ipv6_metadata_lkp_ipv6_sa60,f3 = meta._ipv6_metadata_lkp_ipv6_da61,f4 = meta._l3_metadata_lkp_ip_proto82,f5 = meta._l3_metadata_lkp_l4_sport85,f6 = meta._l3_metadata_lkp_l4_dport86}, 32w65536); } @name(".compute_lkp_non_ip_hash") action _compute_lkp_non_ip_hash_0() { - hash, bit<16>, tuple_8, bit<32>>(meta._hash_metadata_hash233, HashAlgorithm.crc16, 16w0, (tuple_8){f0 = meta._ingress_metadata_ifindex38,f1 = meta._l2_metadata_lkp_mac_sa65,f2 = meta._l2_metadata_lkp_mac_da66,f3 = meta._l2_metadata_lkp_mac_type68}, 32w65536); + hash, bit<16>, tuple_4, bit<32>>(meta._hash_metadata_hash233, HashAlgorithm.crc16, 16w0, (tuple_4){f0 = meta._ingress_metadata_ifindex38,f1 = meta._l2_metadata_lkp_mac_sa65,f2 = meta._l2_metadata_lkp_mac_da66,f3 = meta._l2_metadata_lkp_mac_type68}, 32w65536); } @name(".computed_two_hashes") action _computed_two_hashes_0() { meta._hash_metadata_entropy_hash34 = meta._hash_metadata_hash233; @@ -5761,16 +5751,16 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ } @name(".copy_to_cpu_with_reason") action _copy_to_cpu_with_reason_0(@name("reason_code") bit<16> reason_code_6) { meta._fabric_metadata_reason_code28 = reason_code_6; - clone3(CloneType.I2E, 32w250, (tuple_1){f0 = meta._ingress_metadata_bd42,f1 = meta._ingress_metadata_ifindex38,f2 = reason_code_6,f3 = meta._ingress_metadata_ingress_port37}); + clone3(CloneType.I2E, 32w250, 8w1); } @name(".redirect_to_cpu") action _redirect_to_cpu_0(@name("reason_code") bit<16> reason_code_7) { meta._fabric_metadata_reason_code28 = reason_code_7; - clone3(CloneType.I2E, 32w250, (tuple_1){f0 = meta._ingress_metadata_bd42,f1 = meta._ingress_metadata_ifindex38,f2 = reason_code_7,f3 = meta._ingress_metadata_ingress_port37}); + clone3(CloneType.I2E, 32w250, 8w1); mark_to_drop(standard_metadata); meta._fabric_metadata_dst_device29 = 8w0; } @name(".copy_to_cpu") action _copy_to_cpu_0() { - clone3(CloneType.I2E, 32w250, (tuple_1){f0 = meta._ingress_metadata_bd42,f1 = meta._ingress_metadata_ifindex38,f2 = meta._fabric_metadata_reason_code28,f3 = meta._ingress_metadata_ingress_port37}); + clone3(CloneType.I2E, 32w250, 8w1); } @name(".drop_packet") action _drop_packet_0() { mark_to_drop(standard_metadata); @@ -5780,7 +5770,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ mark_to_drop(standard_metadata); } @name(".negative_mirror") action _negative_mirror_0(@name("session_id") bit<32> session_id_11) { - clone3(CloneType.I2E, session_id_11, (tuple_9){f0 = meta._ingress_metadata_ifindex38,f1 = meta._ingress_metadata_drop_reason44}); + clone3(CloneType.I2E, session_id_11, 8w4); mark_to_drop(standard_metadata); } @name(".drop_stats") table _drop_stats { @@ -6176,7 +6166,7 @@ control DeparserImpl(packet_out packet, in headers hdr) { } } -struct tuple_10 { +struct tuple_5 { bit<4> f0; bit<4> f1; bit<8> f2; @@ -6192,15 +6182,15 @@ struct tuple_10 { control verifyChecksum(inout headers hdr, inout metadata meta) { apply { - verify_checksum>(hdr.inner_ipv4.ihl == 4w5, (tuple_10){f0 = hdr.inner_ipv4.version,f1 = hdr.inner_ipv4.ihl,f2 = hdr.inner_ipv4.diffserv,f3 = hdr.inner_ipv4.totalLen,f4 = hdr.inner_ipv4.identification,f5 = hdr.inner_ipv4.flags,f6 = hdr.inner_ipv4.fragOffset,f7 = hdr.inner_ipv4.ttl,f8 = hdr.inner_ipv4.protocol,f9 = hdr.inner_ipv4.srcAddr,f10 = hdr.inner_ipv4.dstAddr}, hdr.inner_ipv4.hdrChecksum, HashAlgorithm.csum16); - verify_checksum>(hdr.ipv4.ihl == 4w5, (tuple_10){f0 = hdr.ipv4.version,f1 = hdr.ipv4.ihl,f2 = hdr.ipv4.diffserv,f3 = hdr.ipv4.totalLen,f4 = hdr.ipv4.identification,f5 = hdr.ipv4.flags,f6 = hdr.ipv4.fragOffset,f7 = hdr.ipv4.ttl,f8 = hdr.ipv4.protocol,f9 = hdr.ipv4.srcAddr,f10 = hdr.ipv4.dstAddr}, hdr.ipv4.hdrChecksum, HashAlgorithm.csum16); + verify_checksum>(hdr.inner_ipv4.ihl == 4w5, (tuple_5){f0 = hdr.inner_ipv4.version,f1 = hdr.inner_ipv4.ihl,f2 = hdr.inner_ipv4.diffserv,f3 = hdr.inner_ipv4.totalLen,f4 = hdr.inner_ipv4.identification,f5 = hdr.inner_ipv4.flags,f6 = hdr.inner_ipv4.fragOffset,f7 = hdr.inner_ipv4.ttl,f8 = hdr.inner_ipv4.protocol,f9 = hdr.inner_ipv4.srcAddr,f10 = hdr.inner_ipv4.dstAddr}, hdr.inner_ipv4.hdrChecksum, HashAlgorithm.csum16); + verify_checksum>(hdr.ipv4.ihl == 4w5, (tuple_5){f0 = hdr.ipv4.version,f1 = hdr.ipv4.ihl,f2 = hdr.ipv4.diffserv,f3 = hdr.ipv4.totalLen,f4 = hdr.ipv4.identification,f5 = hdr.ipv4.flags,f6 = hdr.ipv4.fragOffset,f7 = hdr.ipv4.ttl,f8 = hdr.ipv4.protocol,f9 = hdr.ipv4.srcAddr,f10 = hdr.ipv4.dstAddr}, hdr.ipv4.hdrChecksum, HashAlgorithm.csum16); } } control computeChecksum(inout headers hdr, inout metadata meta) { apply { - update_checksum>(hdr.inner_ipv4.ihl == 4w5, (tuple_10){f0 = hdr.inner_ipv4.version,f1 = hdr.inner_ipv4.ihl,f2 = hdr.inner_ipv4.diffserv,f3 = hdr.inner_ipv4.totalLen,f4 = hdr.inner_ipv4.identification,f5 = hdr.inner_ipv4.flags,f6 = hdr.inner_ipv4.fragOffset,f7 = hdr.inner_ipv4.ttl,f8 = hdr.inner_ipv4.protocol,f9 = hdr.inner_ipv4.srcAddr,f10 = hdr.inner_ipv4.dstAddr}, hdr.inner_ipv4.hdrChecksum, HashAlgorithm.csum16); - update_checksum>(hdr.ipv4.ihl == 4w5, (tuple_10){f0 = hdr.ipv4.version,f1 = hdr.ipv4.ihl,f2 = hdr.ipv4.diffserv,f3 = hdr.ipv4.totalLen,f4 = hdr.ipv4.identification,f5 = hdr.ipv4.flags,f6 = hdr.ipv4.fragOffset,f7 = hdr.ipv4.ttl,f8 = hdr.ipv4.protocol,f9 = hdr.ipv4.srcAddr,f10 = hdr.ipv4.dstAddr}, hdr.ipv4.hdrChecksum, HashAlgorithm.csum16); + update_checksum>(hdr.inner_ipv4.ihl == 4w5, (tuple_5){f0 = hdr.inner_ipv4.version,f1 = hdr.inner_ipv4.ihl,f2 = hdr.inner_ipv4.diffserv,f3 = hdr.inner_ipv4.totalLen,f4 = hdr.inner_ipv4.identification,f5 = hdr.inner_ipv4.flags,f6 = hdr.inner_ipv4.fragOffset,f7 = hdr.inner_ipv4.ttl,f8 = hdr.inner_ipv4.protocol,f9 = hdr.inner_ipv4.srcAddr,f10 = hdr.inner_ipv4.dstAddr}, hdr.inner_ipv4.hdrChecksum, HashAlgorithm.csum16); + update_checksum>(hdr.ipv4.ihl == 4w5, (tuple_5){f0 = hdr.ipv4.version,f1 = hdr.ipv4.ihl,f2 = hdr.ipv4.diffserv,f3 = hdr.ipv4.totalLen,f4 = hdr.ipv4.identification,f5 = hdr.ipv4.flags,f6 = hdr.ipv4.fragOffset,f7 = hdr.ipv4.ttl,f8 = hdr.ipv4.protocol,f9 = hdr.ipv4.srcAddr,f10 = hdr.ipv4.dstAddr}, hdr.ipv4.hdrChecksum, HashAlgorithm.csum16); } } diff --git a/testdata/p4_14_samples_outputs/switch_20160512/switch.p4 b/testdata/p4_14_samples_outputs/switch_20160512/switch.p4 index 7ae9e18b784..6d0cbdfa79b 100644 --- a/testdata/p4_14_samples_outputs/switch_20160512/switch.p4 +++ b/testdata/p4_14_samples_outputs/switch_20160512/switch.p4 @@ -2,6 +2,15 @@ #define V1MODEL_VERSION 20200408 #include +enum bit<8> FieldLists { + i2e_mirror_info = 0, + cpu_info = 1, + e2e_mirror_info = 2, + int_i2e_mirror_info = 3, + mirror_info = 4, + sflow_cpu_info = 5 +} + struct acl_metadata_t { bit<1> acl_deny; bit<1> acl_copy; @@ -40,6 +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) bit<16> reason_code; bit<8> dst_device; bit<16> dst_port; @@ -56,18 +66,24 @@ struct hash_metadata_t { } struct i2e_metadata_t { + @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) bit<16> mirror_session_id; } struct ingress_metadata_t { + @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) bit<16> ifindex; bit<16> egress_ifindex; bit<2> port_type; bit<16> outer_bd; + @field_list(FieldLists.cpu_info, FieldLists.sflow_cpu_info) bit<16> bd; bit<1> drop_flag; + @field_list(FieldLists.mirror_info) bit<8> drop_reason; bit<1> control_frame; bit<16> bypass_lookups; @@ -85,6 +101,7 @@ struct int_metadata_t { } struct int_metadata_i2e_t { + @field_list(FieldLists.int_i2e_mirror_info) bit<1> sink; bit<1> source; } @@ -2907,7 +2924,7 @@ control process_egress_acl(inout headers hdr, inout metadata meta, inout standar } @name(".egress_mirror") action egress_mirror(bit<32> session_id) { meta.i2e_metadata.mirror_session_id = (bit<16>)session_id; - clone3(CloneType.E2E, (bit<32>)session_id, { meta.i2e_metadata.ingress_tstamp, meta.i2e_metadata.mirror_session_id }); + clone3(CloneType.E2E, (bit<32>)session_id, (bit<8>)FieldLists.e2e_mirror_info); } @name(".egress_mirror_drop") action egress_mirror_drop(bit<32> session_id) { egress_mirror(session_id); @@ -2915,7 +2932,7 @@ control process_egress_acl(inout headers hdr, inout metadata meta, inout standar } @name(".egress_copy_to_cpu") action egress_copy_to_cpu(bit<16> reason_code) { meta.fabric_metadata.reason_code = reason_code; - clone3(CloneType.E2E, (bit<32>)32w250, { meta.ingress_metadata.bd, meta.ingress_metadata.ifindex, meta.fabric_metadata.reason_code, meta.ingress_metadata.ingress_port }); + clone3(CloneType.E2E, (bit<32>)32w250, (bit<8>)FieldLists.cpu_info); } @name(".egress_redirect_to_cpu") action egress_redirect_to_cpu(bit<16> reason_code) { egress_copy_to_cpu(reason_code); @@ -3411,7 +3428,7 @@ control process_int_endpoint(inout headers hdr, inout metadata meta, inout stand @name(".int_sink") action int_sink(bit<32> mirror_id) { meta.int_metadata_i2e.sink = 1w1; meta.i2e_metadata.mirror_session_id = (bit<16>)mirror_id; - clone3(CloneType.I2E, (bit<32>)mirror_id, { meta.int_metadata_i2e.sink, meta.i2e_metadata.mirror_session_id }); + clone3(CloneType.I2E, (bit<32>)mirror_id, (bit<8>)FieldLists.int_i2e_mirror_info); hdr.int_header.setInvalid(); hdr.int_val[0].setInvalid(); hdr.int_val[1].setInvalid(); @@ -4160,7 +4177,7 @@ control process_ingress_sflow(inout headers hdr, inout metadata meta, inout stan @name(".sflow_ing_pkt_to_cpu") action sflow_ing_pkt_to_cpu(bit<32> sflow_i2e_mirror_id, bit<16> reason_code) { meta.fabric_metadata.reason_code = reason_code; meta.i2e_metadata.mirror_session_id = (bit<16>)sflow_i2e_mirror_id; - clone3(CloneType.I2E, (bit<32>)sflow_i2e_mirror_id, { { meta.ingress_metadata.bd, meta.ingress_metadata.ifindex, meta.fabric_metadata.reason_code, meta.ingress_metadata.ingress_port }, meta.sflow_metadata.sflow_session_id, meta.i2e_metadata.mirror_session_id }); + clone3(CloneType.I2E, (bit<32>)sflow_i2e_mirror_id, (bit<8>)FieldLists.sflow_cpu_info); } @name(".sflow_ing_session_enable") action sflow_ing_session_enable(bit<32> rate_thr, bit<16> session_id) { meta.ingress_metadata.sflow_take_sample = rate_thr |+| meta.ingress_metadata.sflow_take_sample; @@ -4173,7 +4190,7 @@ control process_ingress_sflow(inout headers hdr, inout metadata meta, inout stan sflow_ingress_session_pkt_counter.count(); meta.fabric_metadata.reason_code = reason_code; meta.i2e_metadata.mirror_session_id = (bit<16>)sflow_i2e_mirror_id; - clone3(CloneType.I2E, (bit<32>)sflow_i2e_mirror_id, { { meta.ingress_metadata.bd, meta.ingress_metadata.ifindex, meta.fabric_metadata.reason_code, meta.ingress_metadata.ingress_port }, meta.sflow_metadata.sflow_session_id, meta.i2e_metadata.mirror_session_id }); + clone3(CloneType.I2E, (bit<32>)sflow_i2e_mirror_id, (bit<8>)FieldLists.sflow_cpu_info); } @name(".sflow_ing_take_sample") table sflow_ing_take_sample { actions = { @@ -4379,7 +4396,7 @@ control process_mac_acl(inout headers hdr, inout metadata meta, inout standard_m @name(".acl_mirror") action acl_mirror(bit<32> session_id, bit<14> acl_stats_index, bit<16> acl_meter_index) { meta.i2e_metadata.mirror_session_id = (bit<16>)session_id; meta.i2e_metadata.ingress_tstamp = (bit<32>)standard_metadata.ingress_global_timestamp; - clone3(CloneType.I2E, (bit<32>)session_id, { meta.i2e_metadata.ingress_tstamp, meta.i2e_metadata.mirror_session_id }); + clone3(CloneType.I2E, (bit<32>)session_id, (bit<8>)FieldLists.i2e_mirror_info); meta.acl_metadata.acl_stats_index = acl_stats_index; meta.meter_metadata.meter_index = acl_meter_index; } @@ -4445,7 +4462,7 @@ control process_ip_acl(inout headers hdr, inout metadata meta, inout standard_me @name(".acl_mirror") action acl_mirror(bit<32> session_id, bit<14> acl_stats_index, bit<16> acl_meter_index) { meta.i2e_metadata.mirror_session_id = (bit<16>)session_id; meta.i2e_metadata.ingress_tstamp = (bit<32>)standard_metadata.ingress_global_timestamp; - clone3(CloneType.I2E, (bit<32>)session_id, { meta.i2e_metadata.ingress_tstamp, meta.i2e_metadata.mirror_session_id }); + clone3(CloneType.I2E, (bit<32>)session_id, (bit<8>)FieldLists.i2e_mirror_info); meta.acl_metadata.acl_stats_index = acl_stats_index; meta.meter_metadata.meter_index = acl_meter_index; } @@ -5610,7 +5627,7 @@ control process_system_acl(inout headers hdr, inout metadata meta, inout standar } @name(".copy_to_cpu_with_reason") action copy_to_cpu_with_reason(bit<16> reason_code) { meta.fabric_metadata.reason_code = reason_code; - clone3(CloneType.I2E, (bit<32>)32w250, { meta.ingress_metadata.bd, meta.ingress_metadata.ifindex, meta.fabric_metadata.reason_code, meta.ingress_metadata.ingress_port }); + clone3(CloneType.I2E, (bit<32>)32w250, (bit<8>)FieldLists.cpu_info); } @name(".redirect_to_cpu") action redirect_to_cpu(bit<16> reason_code) { copy_to_cpu_with_reason(reason_code); @@ -5618,7 +5635,7 @@ control process_system_acl(inout headers hdr, inout metadata meta, inout standar meta.fabric_metadata.dst_device = 8w0; } @name(".copy_to_cpu") action copy_to_cpu() { - clone3(CloneType.I2E, (bit<32>)32w250, { meta.ingress_metadata.bd, meta.ingress_metadata.ifindex, meta.fabric_metadata.reason_code, meta.ingress_metadata.ingress_port }); + clone3(CloneType.I2E, (bit<32>)32w250, (bit<8>)FieldLists.cpu_info); } @name(".drop_packet") action drop_packet() { mark_to_drop(standard_metadata); @@ -5628,7 +5645,7 @@ control process_system_acl(inout headers hdr, inout metadata meta, inout standar mark_to_drop(standard_metadata); } @name(".negative_mirror") action negative_mirror(bit<32> session_id) { - clone3(CloneType.I2E, (bit<32>)session_id, { meta.ingress_metadata.ifindex, meta.ingress_metadata.drop_reason }); + clone3(CloneType.I2E, (bit<32>)session_id, (bit<8>)FieldLists.mirror_info); mark_to_drop(standard_metadata); } @name(".drop_stats") table drop_stats_0 { diff --git a/testdata/p4_16_errors_outputs/issue1557-bmv2.p4-stderr b/testdata/p4_16_errors_outputs/issue1557-bmv2.p4-stderr index bd5628c07d0..2ab466cbd08 100644 --- a/testdata/p4_16_errors_outputs/issue1557-bmv2.p4-stderr +++ b/testdata/p4_16_errors_outputs/issue1557-bmv2.p4-stderr @@ -1,7 +1,7 @@ issue1557-bmv2.p4(17): [--Werror=type-error] error: Field drop is not a member of structure struct standard_metadata action drop() { smeta.drop = 1; } ^^^^ -v1model.p4(73) +v1model.p4(64) struct standard_metadata_t { ^^^^^^^^^^^^^^^^^^^ issue1557-bmv2.p4(19): [--Werror=type-error] error: idx: parameter should be assigned in call rewrite diff --git a/testdata/p4_16_errors_outputs/issue513.p4-stderr b/testdata/p4_16_errors_outputs/issue513.p4-stderr index b251bb67af4..894c8e4e166 100644 --- a/testdata/p4_16_errors_outputs/issue513.p4-stderr +++ b/testdata/p4_16_errors_outputs/issue513.p4-stderr @@ -1,7 +1,7 @@ issue513.p4(60): [--Wwarn=deprecated] warning: mark_to_drop: Using deprecated feature mark_to_drop. Please use mark_to_drop(standard_metadata) instead. mark_to_drop(); ^^^^^^^^^^^^ -v1model.p4(415) +v1model.p4(406) extern void mark_to_drop(); ^^^^^^^^^^^^ issue513.p4(60): [--Werror=target-error] error: mark_to_drop: Conditional execution in actions unsupported on this target diff --git a/testdata/p4_16_samples/issue1001-bmv2.p4 b/testdata/p4_16_samples/issue1001-bmv2.p4 index 196eb962daa..930fd5cc743 100644 --- a/testdata/p4_16_samples/issue1001-bmv2.p4 +++ b/testdata/p4_16_samples/issue1001-bmv2.p4 @@ -4,6 +4,7 @@ struct Headers {} struct Meta { + @field_list(0) bit<1> b; } @@ -15,9 +16,8 @@ parser p(packet_in b, out Headers h, inout Meta m, inout standard_metadata_t sm) } control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { - Meta x; apply { - clone3(CloneType.I2E, 32w64, x); + clone3(CloneType.I2E, 32w64, 0); } } diff --git a/testdata/p4_16_samples/issue1043-bmv2.p4 b/testdata/p4_16_samples/issue1043-bmv2.p4 index ec45fb242a2..2bcf76bd4fb 100644 --- a/testdata/p4_16_samples/issue1043-bmv2.p4 +++ b/testdata/p4_16_samples/issue1043-bmv2.p4 @@ -30,7 +30,7 @@ control deparser(packet_out b, in Headers h) { control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { apply { - resubmit(m); + resubmit(0); sm.egress_spec = 0; } } diff --git a/testdata/p4_16_samples/issue1642-bmv2.p4 b/testdata/p4_16_samples/issue1642-bmv2.p4 index 1fc01da9229..10d98d3402d 100644 --- a/testdata/p4_16_samples/issue1642-bmv2.p4 +++ b/testdata/p4_16_samples/issue1642-bmv2.p4 @@ -5,28 +5,29 @@ header short { } struct alt_t { - bit<1> valid; - bit<7> port; + bit<1> valid; + bit<7> port; }; struct row_t { - alt_t alt0; - alt_t alt1; + alt_t alt0; + alt_t alt1; }; struct parsed_packet_t {}; struct local_metadata_t { short s; + @field_list(0) row_t row; }; parser parse(packet_in pk, out parsed_packet_t hdr, inout local_metadata_t local_metadata, inout standard_metadata_t standard_metadata) { - state start { - transition accept; - } + state start { + transition accept; + } } control ingress(inout parsed_packet_t hdr, @@ -38,28 +39,28 @@ control ingress(inout parsed_packet_t hdr, local_metadata.row.alt0 = local_metadata.row.alt1; local_metadata.row.alt0.valid = 1; local_metadata.row.alt1.port = local_metadata.row.alt1.port + 1; - clone3(CloneType.I2E, 0, local_metadata.row); + clone3(CloneType.I2E, 0, 0); } } control egress(inout parsed_packet_t hdr, inout local_metadata_t local_metadata, - inout standard_metadata_t standard_metadata) { - apply { } + inout standard_metadata_t standard_metadata) { + apply { } } control deparser(packet_out b, in parsed_packet_t hdr) { - apply { } + apply { } } control verifyChecksum(inout parsed_packet_t hdr, inout local_metadata_t local_metadata) { - apply { } + apply { } } control compute_checksum(inout parsed_packet_t hdr, inout local_metadata_t local_metadata) { - apply { } + apply { } } V1Switch(parse(), verifyChecksum(), ingress(), egress(), diff --git a/testdata/p4_16_samples/issue1653-bmv2.p4 b/testdata/p4_16_samples/issue1653-bmv2.p4 index 002d907d7b6..44af4c3a9f5 100644 --- a/testdata/p4_16_samples/issue1653-bmv2.p4 +++ b/testdata/p4_16_samples/issue1653-bmv2.p4 @@ -43,10 +43,9 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, bitvec_hdr bh; apply { - // Copy another header's data to local variable. bh.x = h.bvh0.x; - clone3(CloneType.I2E, 0, h); + clone3(CloneType.I2E, 0, 0); } } diff --git a/testdata/p4_16_samples/issue1653-complex-bmv2.p4 b/testdata/p4_16_samples/issue1653-complex-bmv2.p4 index e1a227c2152..b8861b8d37e 100644 --- a/testdata/p4_16_samples/issue1653-complex-bmv2.p4 +++ b/testdata/p4_16_samples/issue1653-complex-bmv2.p4 @@ -44,6 +44,7 @@ header bitvec_hdr { } struct local_metadata_t { + @field_list(0) row_t row0; row_t row1; bitvec_hdr bvh0; @@ -95,7 +96,7 @@ control ingress(inout parsed_packet_t h, h.bvh0.row.alt1.type = bh.row.alt1.type; local_metadata.row0.alt0.useHash = true; - clone3(CloneType.I2E, 0, local_metadata.row0); + clone3(CloneType.I2E, 0, 0); } } diff --git a/testdata/p4_16_samples/issue1660-bmv2.p4 b/testdata/p4_16_samples/issue1660-bmv2.p4 index 45b0518daec..8914133442a 100644 --- a/testdata/p4_16_samples/issue1660-bmv2.p4 +++ b/testdata/p4_16_samples/issue1660-bmv2.p4 @@ -1,6 +1,7 @@ #include struct HasBool { + @field_list(0) bool x; } @@ -19,7 +20,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, apply { HasBool b; b.x = true; - clone3(CloneType.I2E, 0, b); + clone3(CloneType.I2E, 0, 0); } } diff --git a/testdata/p4_16_samples/issue1765-1-bmv2.p4 b/testdata/p4_16_samples/issue1765-1-bmv2.p4 index ed650dafb71..3f3e26cf18a 100644 --- a/testdata/p4_16_samples/issue1765-1-bmv2.p4 +++ b/testdata/p4_16_samples/issue1765-1-bmv2.p4 @@ -115,10 +115,15 @@ struct headers { } struct metadata { + @field_list(0) port_t ingress_port; + @field_list(0) task_t task; + @field_list(0) bit<16> tcp_length; + @field_list(0) bit<32> cast_length; + @field_list(0) bit<1> do_cksum; } @@ -203,12 +208,12 @@ control MyIngress(inout headers hdr, inout metadata meta, inout standard_metadat action controller_debug() { meta.task = TASK_DEBUG; meta.ingress_port = standard_metadata.ingress_port; - clone3(CloneType.I2E, 100, meta); + clone3(CloneType.I2E, 100, 0); } action controller_reply(task_t task) { meta.task = task; meta.ingress_port = standard_metadata.ingress_port; - clone3(CloneType.I2E, 100, meta); + clone3(CloneType.I2E, 100, 0); } action multicast_pkg(mcast_t mcast_grp) { standard_metadata.mcast_grp = mcast_grp; diff --git a/testdata/p4_16_samples/issue383-bmv2.p4 b/testdata/p4_16_samples/issue383-bmv2.p4 index cc5f8586ed0..d69d37398dd 100644 --- a/testdata/p4_16_samples/issue383-bmv2.p4 +++ b/testdata/p4_16_samples/issue383-bmv2.p4 @@ -18,30 +18,31 @@ limitations under the License. #include struct alt_t { - bit<1> valid; - bit<7> port; + bit<1> valid; + bit<7> port; }; @MNK_annotation("(test flatten)") struct row_t { - alt_t alt0; - alt_t alt1; + alt_t alt0; + alt_t alt1; }; header bitvec_hdr { - row_t row; + row_t row; } struct col_t { - bitvec_hdr bvh; + bitvec_hdr bvh; } struct local_metadata_t { - row_t row0; - row_t row1; - col_t col; - bitvec_hdr bvh0; - bitvec_hdr bvh1; + @field_list(0) + row_t row0; + row_t row1; + col_t col; + bitvec_hdr bvh0; + bitvec_hdr bvh1; }; struct parsed_packet_t { @@ -50,11 +51,11 @@ struct parsed_packet_t { }; struct tst_t { - row_t row0; - row_t row1; - col_t col; - bitvec_hdr bvh0; - bitvec_hdr bvh1; + row_t row0; + row_t row1; + col_t col; + bitvec_hdr bvh0; + bitvec_hdr bvh1; } parser parse(packet_in pk, out parsed_packet_t h, @@ -105,7 +106,7 @@ control ingress(inout parsed_packet_t h, local_metadata.row0.alt0 = local_metadata.row1.alt1; local_metadata.row1.alt0.valid = 1; local_metadata.row1.alt1.port = local_metadata.row0.alt1.port + 1; - clone3(CloneType.I2E, 0, local_metadata.row0); + clone3(CloneType.I2E, 0, 0); /* Cast support is TODO for bmv2. diff --git a/testdata/p4_16_samples/issue562-bmv2.p4 b/testdata/p4_16_samples/issue562-bmv2.p4 index 36ff7baae99..a1f2995befd 100644 --- a/testdata/p4_16_samples/issue562-bmv2.p4 +++ b/testdata/p4_16_samples/issue562-bmv2.p4 @@ -13,7 +13,8 @@ struct row_t { struct parsed_packet_t {}; struct local_metadata_t { - row_t row; + @field_list(0) + row_t row; }; parser parse(packet_in pk, out parsed_packet_t hdr, @@ -31,7 +32,7 @@ control ingress(inout parsed_packet_t hdr, local_metadata.row.alt0 = local_metadata.row.alt1; local_metadata.row.alt0.valid = 1; local_metadata.row.alt1.port = local_metadata.row.alt1.port + 1; - clone3(CloneType.I2E, 0, local_metadata.row); + clone3(CloneType.I2E, 0, 0); } } diff --git a/testdata/p4_16_samples/v1model-special-ops-bmv2.p4 b/testdata/p4_16_samples/v1model-special-ops-bmv2.p4 index 604a6eb5d3c..f3b62f480e5 100644 --- a/testdata/p4_16_samples/v1model-special-ops-bmv2.p4 +++ b/testdata/p4_16_samples/v1model-special-ops-bmv2.p4 @@ -229,7 +229,7 @@ control ingress(inout headers_t hdr, // If you give an entire struct, it includes all fields inside // of that struct. - resubmit({}); + resubmit(0); } action do_clone_i2e(bit<32> l2ptr) { // BMv2 simple_switch can have multiple different clone @@ -244,7 +244,7 @@ control ingress(inout headers_t hdr, // resubmit() call above. clone() is the same as clone3(), // except there are only 2 parameters, and thus no metadata // field values are preserved in the cloned packet. - clone3(CloneType.I2E, I2E_CLONE_SESSION_ID, {}); + clone3(CloneType.I2E, I2E_CLONE_SESSION_ID, 0); meta.fwd.l2ptr = l2ptr; } table ipv4_da_lpm { @@ -354,13 +354,13 @@ control egress(inout headers_t hdr, // See the resubmit() call above for comments about the // parameter to recirculate(), which has the same form as for // resubmit. - recirculate({}); + recirculate(0); } action do_clone_e2e(bit<48> smac) { hdr.ethernet.srcAddr = smac; // See the resubmit() call for notes on the 3rd argument, // which is similar to the only argument to resubmit(). - clone3(CloneType.E2E, E2E_CLONE_SESSION_ID, {}); + clone3(CloneType.E2E, E2E_CLONE_SESSION_ID, 0); } table send_frame { key = { diff --git a/testdata/p4_16_samples_outputs/invalid-hdr-warnings3.p4 b/testdata/p4_16_samples_outputs/invalid-hdr-warnings3.p4 index febf7e422bd..77b63dc504f 100644 --- a/testdata/p4_16_samples_outputs/invalid-hdr-warnings3.p4 +++ b/testdata/p4_16_samples_outputs/invalid-hdr-warnings3.p4 @@ -77,3 +77,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/issue1001-bmv2-first.p4 b/testdata/p4_16_samples_outputs/issue1001-bmv2-first.p4 index f83d89d33cf..c36f177760c 100644 --- a/testdata/p4_16_samples_outputs/issue1001-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/issue1001-bmv2-first.p4 @@ -6,6 +6,7 @@ struct Headers { } struct Meta { + @field_list(0) bit<1> b; } @@ -17,9 +18,8 @@ parser p(packet_in b, out Headers h, inout Meta m, inout standard_metadata_t sm) } control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { - Meta x; apply { - clone3(CloneType.I2E, 32w64, x); + clone3(CloneType.I2E, 32w64, 8w0); } } diff --git a/testdata/p4_16_samples_outputs/issue1001-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue1001-bmv2-frontend.p4 index 3a118c9aa4c..c36f177760c 100644 --- a/testdata/p4_16_samples_outputs/issue1001-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1001-bmv2-frontend.p4 @@ -6,6 +6,7 @@ struct Headers { } struct Meta { + @field_list(0) bit<1> b; } @@ -17,9 +18,8 @@ parser p(packet_in b, out Headers h, inout Meta m, inout standard_metadata_t sm) } control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { - @name("ingress.x") Meta x_0; apply { - clone3(CloneType.I2E, 32w64, x_0); + clone3(CloneType.I2E, 32w64, 8w0); } } diff --git a/testdata/p4_16_samples_outputs/issue1001-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/issue1001-bmv2-midend.p4 index 7cc1f314621..f3feb05cc80 100644 --- a/testdata/p4_16_samples_outputs/issue1001-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue1001-bmv2-midend.p4 @@ -6,6 +6,7 @@ struct Headers { } struct Meta { + @field_list(0) bit<1> b; } @@ -17,9 +18,8 @@ parser p(packet_in b, out Headers h, inout Meta m, inout standard_metadata_t sm) } control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { - @name("ingress.x") Meta x_0; @hidden action issue1001bmv2l20() { - clone3(CloneType.I2E, 32w64, x_0); + clone3(CloneType.I2E, 32w64, 8w0); } @hidden table tbl_issue1001bmv2l20 { actions = { diff --git a/testdata/p4_16_samples_outputs/issue1001-bmv2.p4 b/testdata/p4_16_samples_outputs/issue1001-bmv2.p4 index b099b8c153c..9327029989b 100644 --- a/testdata/p4_16_samples_outputs/issue1001-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/issue1001-bmv2.p4 @@ -6,6 +6,7 @@ struct Headers { } struct Meta { + @field_list(0) bit<1> b; } @@ -17,9 +18,8 @@ parser p(packet_in b, out Headers h, inout Meta m, inout standard_metadata_t sm) } control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { - Meta x; apply { - clone3(CloneType.I2E, 32w64, x); + clone3(CloneType.I2E, 32w64, 0); } } diff --git a/testdata/p4_16_samples_outputs/issue1001-bmv2.p4-stderr b/testdata/p4_16_samples_outputs/issue1001-bmv2.p4-stderr index 247e78e8d95..e69de29bb2d 100644 --- a/testdata/p4_16_samples_outputs/issue1001-bmv2.p4-stderr +++ b/testdata/p4_16_samples_outputs/issue1001-bmv2.p4-stderr @@ -1,3 +0,0 @@ -issue1001-bmv2.p4(20): [--Wwarn=uninitialized_use] warning: x may not be completely initialized - clone3(CloneType.I2E, 32w64, x); - ^ diff --git a/testdata/p4_16_samples_outputs/issue1043-bmv2-first.p4 b/testdata/p4_16_samples_outputs/issue1043-bmv2-first.p4 index 0ff12e06cf3..4a6a663158b 100644 --- a/testdata/p4_16_samples_outputs/issue1043-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/issue1043-bmv2-first.p4 @@ -44,7 +44,7 @@ control deparser(packet_out b, in Headers h) { control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { apply { - resubmit(m); + resubmit(8w0); sm.egress_spec = 9w0; } } diff --git a/testdata/p4_16_samples_outputs/issue1043-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue1043-bmv2-frontend.p4 index 0ff12e06cf3..4a6a663158b 100644 --- a/testdata/p4_16_samples_outputs/issue1043-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1043-bmv2-frontend.p4 @@ -44,7 +44,7 @@ control deparser(packet_out b, in Headers h) { control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { apply { - resubmit(m); + resubmit(8w0); sm.egress_spec = 9w0; } } diff --git a/testdata/p4_16_samples_outputs/issue1043-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/issue1043-bmv2-midend.p4 index c5e2e3fb08d..2f7203a24df 100644 --- a/testdata/p4_16_samples_outputs/issue1043-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue1043-bmv2-midend.p4 @@ -44,7 +44,7 @@ control deparser(packet_out b, in Headers h) { control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @hidden action issue1043bmv2l33() { - resubmit(m); + resubmit(8w0); sm.egress_spec = 9w0; } @hidden table tbl_issue1043bmv2l33 { diff --git a/testdata/p4_16_samples_outputs/issue1043-bmv2.p4 b/testdata/p4_16_samples_outputs/issue1043-bmv2.p4 index 79f5eb05f0c..018f43d7725 100644 --- a/testdata/p4_16_samples_outputs/issue1043-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/issue1043-bmv2.p4 @@ -44,7 +44,7 @@ control deparser(packet_out b, in Headers h) { control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { apply { - resubmit(m); + resubmit(0); sm.egress_spec = 0; } } diff --git a/testdata/p4_16_samples_outputs/issue1541.p4-stderr b/testdata/p4_16_samples_outputs/issue1541.p4-stderr index 390ca819c54..f6eceba50a9 100644 --- a/testdata/p4_16_samples_outputs/issue1541.p4-stderr +++ b/testdata/p4_16_samples_outputs/issue1541.p4-stderr @@ -1,6 +1,6 @@ issue1541.p4(25): [--Wwarn=shadow] warning: 'hash' shadows 'hash' action hash() { ^^^^ -v1model.p4(453) +v1model.p4(444) extern void hash(out O result, in HashAlgorithm algo, in T base, in D data, in M max); ^^^^ diff --git a/testdata/p4_16_samples_outputs/issue1642-bmv2-first.p4 b/testdata/p4_16_samples_outputs/issue1642-bmv2-first.p4 index d230d08731d..91b9011248b 100644 --- a/testdata/p4_16_samples_outputs/issue1642-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/issue1642-bmv2-first.p4 @@ -21,6 +21,7 @@ struct parsed_packet_t { struct local_metadata_t { short s; + @field_list(0) row_t row; } @@ -37,7 +38,7 @@ control ingress(inout parsed_packet_t hdr, inout local_metadata_t local_metadata local_metadata.row.alt0 = local_metadata.row.alt1; local_metadata.row.alt0.valid = 1w1; local_metadata.row.alt1.port = local_metadata.row.alt1.port + 7w1; - clone3(CloneType.I2E, 32w0, local_metadata.row); + clone3(CloneType.I2E, 32w0, 8w0); } } diff --git a/testdata/p4_16_samples_outputs/issue1642-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue1642-bmv2-frontend.p4 index d230d08731d..91b9011248b 100644 --- a/testdata/p4_16_samples_outputs/issue1642-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1642-bmv2-frontend.p4 @@ -21,6 +21,7 @@ struct parsed_packet_t { struct local_metadata_t { short s; + @field_list(0) row_t row; } @@ -37,7 +38,7 @@ control ingress(inout parsed_packet_t hdr, inout local_metadata_t local_metadata local_metadata.row.alt0 = local_metadata.row.alt1; local_metadata.row.alt0.valid = 1w1; local_metadata.row.alt1.port = local_metadata.row.alt1.port + 7w1; - clone3(CloneType.I2E, 32w0, local_metadata.row); + clone3(CloneType.I2E, 32w0, 8w0); } } diff --git a/testdata/p4_16_samples_outputs/issue1642-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/issue1642-bmv2-midend.p4 index eaee0068af3..912a14b4cb6 100644 --- a/testdata/p4_16_samples_outputs/issue1642-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue1642-bmv2-midend.p4 @@ -21,9 +21,13 @@ struct parsed_packet_t { struct local_metadata_t { short _s0; + @field_list(0) bit<1> _row_alt0_valid1; + @field_list(0) bit<7> _row_alt0_port2; + @field_list(0) bit<1> _row_alt1_valid3; + @field_list(0) bit<7> _row_alt1_port4; } @@ -34,23 +38,23 @@ parser parse(packet_in pk, out parsed_packet_t hdr, inout local_metadata_t local } control ingress(inout parsed_packet_t hdr, inout local_metadata_t local_metadata, inout standard_metadata_t standard_metadata) { - @hidden action issue1642bmv2l36() { + @hidden action issue1642bmv2l37() { local_metadata._s0.setValid(); local_metadata._s0.f = 32w0; local_metadata._row_alt0_valid1 = local_metadata._row_alt1_valid3; local_metadata._row_alt0_port2 = local_metadata._row_alt1_port4; local_metadata._row_alt0_valid1 = 1w1; local_metadata._row_alt1_port4 = local_metadata._row_alt1_port4 + 7w1; - clone3(CloneType.I2E, 32w0, (row_t){alt0 = (alt_t){valid = 1w1,port = local_metadata._row_alt0_port2},alt1 = (alt_t){valid = local_metadata._row_alt1_valid3,port = local_metadata._row_alt1_port4}}); + clone3(CloneType.I2E, 32w0, 8w0); } - @hidden table tbl_issue1642bmv2l36 { + @hidden table tbl_issue1642bmv2l37 { actions = { - issue1642bmv2l36(); + issue1642bmv2l37(); } - const default_action = issue1642bmv2l36(); + const default_action = issue1642bmv2l37(); } apply { - tbl_issue1642bmv2l36.apply(); + tbl_issue1642bmv2l37.apply(); } } diff --git a/testdata/p4_16_samples_outputs/issue1642-bmv2.p4 b/testdata/p4_16_samples_outputs/issue1642-bmv2.p4 index 80a1b3cc946..ebd8e9a881c 100644 --- a/testdata/p4_16_samples_outputs/issue1642-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/issue1642-bmv2.p4 @@ -21,6 +21,7 @@ struct parsed_packet_t { struct local_metadata_t { short s; + @field_list(0) row_t row; } @@ -37,7 +38,7 @@ control ingress(inout parsed_packet_t hdr, inout local_metadata_t local_metadata local_metadata.row.alt0 = local_metadata.row.alt1; local_metadata.row.alt0.valid = 1; local_metadata.row.alt1.port = local_metadata.row.alt1.port + 1; - clone3(CloneType.I2E, 0, local_metadata.row); + clone3(CloneType.I2E, 0, 0); } } diff --git a/testdata/p4_16_samples_outputs/issue1653-bmv2-first.p4 b/testdata/p4_16_samples_outputs/issue1653-bmv2-first.p4 index 6fe26c972de..5f6103a837f 100644 --- a/testdata/p4_16_samples_outputs/issue1653-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/issue1653-bmv2-first.p4 @@ -26,7 +26,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, bitvec_hdr bh; apply { bh.x = h.bvh0.x; - clone3(CloneType.I2E, 32w0, h); + clone3(CloneType.I2E, 32w0, 8w0); } } diff --git a/testdata/p4_16_samples_outputs/issue1653-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue1653-bmv2-frontend.p4 index 28eda3de6a0..d9276ddb664 100644 --- a/testdata/p4_16_samples_outputs/issue1653-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1653-bmv2-frontend.p4 @@ -26,7 +26,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, @name("ingress.bh") bitvec_hdr bh_0; apply { bh_0.setInvalid(); - clone3(CloneType.I2E, 32w0, h); + clone3(CloneType.I2E, 32w0, 8w0); } } diff --git a/testdata/p4_16_samples_outputs/issue1653-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/issue1653-bmv2-midend.p4 index fd97fa379a4..b32dd879701 100644 --- a/testdata/p4_16_samples_outputs/issue1653-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue1653-bmv2-midend.p4 @@ -26,7 +26,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, @name("ingress.bh") bitvec_hdr bh_0; @hidden action issue1653bmv2l43() { bh_0.setInvalid(); - clone3(CloneType.I2E, 32w0, h); + clone3(CloneType.I2E, 32w0, 8w0); } @hidden table tbl_issue1653bmv2l43 { actions = { diff --git a/testdata/p4_16_samples_outputs/issue1653-bmv2.p4 b/testdata/p4_16_samples_outputs/issue1653-bmv2.p4 index 21b514c01b3..f697ed0f816 100644 --- a/testdata/p4_16_samples_outputs/issue1653-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/issue1653-bmv2.p4 @@ -26,7 +26,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, bitvec_hdr bh; apply { bh.x = h.bvh0.x; - clone3(CloneType.I2E, 0, h); + clone3(CloneType.I2E, 0, 0); } } diff --git a/testdata/p4_16_samples_outputs/issue1653-bmv2.p4-stderr b/testdata/p4_16_samples_outputs/issue1653-bmv2.p4-stderr index 631674926c3..7ea4a2dfc07 100644 --- a/testdata/p4_16_samples_outputs/issue1653-bmv2.p4-stderr +++ b/testdata/p4_16_samples_outputs/issue1653-bmv2.p4-stderr @@ -1,3 +1,3 @@ -issue1653-bmv2.p4(48): [--Wwarn=invalid_header] warning: accessing a field of an invalid header bh +issue1653-bmv2.p4(47): [--Wwarn=invalid_header] warning: accessing a field of an invalid header bh bh.x = h.bvh0.x; ^^ 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 359f0f78d7d..fd41c15c8dc 100644 --- a/testdata/p4_16_samples_outputs/issue1653-complex-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/issue1653-complex-bmv2-first.p4 @@ -31,6 +31,7 @@ header bitvec_hdr { } struct local_metadata_t { + @field_list(0) row_t row0; row_t row1; bitvec_hdr bvh0; @@ -73,7 +74,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, bh.row.alt1.type = EthTypes.IPv4; h.bvh0.row.alt1.type = bh.row.alt1.type; local_metadata.row0.alt0.useHash = true; - clone3(CloneType.I2E, 32w0, local_metadata.row0); + clone3(CloneType.I2E, 32w0, 8w0); } } 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 cb96370af09..516c445c763 100644 --- a/testdata/p4_16_samples_outputs/issue1653-complex-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1653-complex-bmv2-frontend.p4 @@ -31,6 +31,7 @@ header bitvec_hdr { } struct local_metadata_t { + @field_list(0) row_t row0; row_t row1; bitvec_hdr bvh0; @@ -75,7 +76,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, bh_0.row.alt1.type = EthTypes.IPv4; h.bvh0.row.alt1.type = bh_0.row.alt1.type; local_metadata.row0.alt0.useHash = true; - clone3(CloneType.I2E, 32w0, local_metadata.row0); + clone3(CloneType.I2E, 32w0, 8w0); } } 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 42bf7d66efe..5ca92382f2d 100644 --- a/testdata/p4_16_samples_outputs/issue1653-complex-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue1653-complex-bmv2-midend.p4 @@ -32,17 +32,29 @@ header bitvec_hdr { } struct local_metadata_t { + @field_list(0) bit<1> _row0_alt0_valid0; + @field_list(0) bit<7> _row0_alt0_port1; + @field_list(0) int<8> _row0_alt0_hashRes2; + @field_list(0) bool _row0_alt0_useHash3; + @field_list(0) bit<16> _row0_alt0_type4; + @field_list(0) bit<7> _row0_alt0_pad5; + @field_list(0) bit<1> _row0_alt1_valid6; + @field_list(0) bit<7> _row0_alt1_port7; + @field_list(0) int<8> _row0_alt1_hashRes8; + @field_list(0) bool _row0_alt1_useHash9; + @field_list(0) bit<16> _row0_alt1_type10; + @field_list(0) bit<7> _row0_alt1_pad11; bit<1> _row1_alt0_valid12; bit<7> _row1_alt0_port13; @@ -92,31 +104,31 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, } default_action = NoAction_1(); } - @hidden action issue1653complexbmv2l71() { + @hidden action issue1653complexbmv2l72() { bh_0.setInvalid(); } - @hidden action issue1653complexbmv2l94() { + @hidden action issue1653complexbmv2l95() { bh_0._row_alt1_type10 = 16w0x800; h.bvh0._row_alt1_type10 = 16w0x800; local_metadata._row0_alt0_useHash3 = true; - clone3(CloneType.I2E, 32w0, (row_t){alt0 = (alt_t){valid = local_metadata._row0_alt0_valid0,port = local_metadata._row0_alt0_port1,hashRes = local_metadata._row0_alt0_hashRes2,useHash = true,type = local_metadata._row0_alt0_type4,pad = local_metadata._row0_alt0_pad5},alt1 = (alt_t){valid = local_metadata._row0_alt1_valid6,port = local_metadata._row0_alt1_port7,hashRes = local_metadata._row0_alt1_hashRes8,useHash = local_metadata._row0_alt1_useHash9,type = local_metadata._row0_alt1_type10,pad = local_metadata._row0_alt1_pad11}}); + clone3(CloneType.I2E, 32w0, 8w0); } - @hidden table tbl_issue1653complexbmv2l71 { + @hidden table tbl_issue1653complexbmv2l72 { actions = { - issue1653complexbmv2l71(); + issue1653complexbmv2l72(); } - const default_action = issue1653complexbmv2l71(); + const default_action = issue1653complexbmv2l72(); } - @hidden table tbl_issue1653complexbmv2l94 { + @hidden table tbl_issue1653complexbmv2l95 { actions = { - issue1653complexbmv2l94(); + issue1653complexbmv2l95(); } - const default_action = issue1653complexbmv2l94(); + const default_action = issue1653complexbmv2l95(); } apply { - tbl_issue1653complexbmv2l71.apply(); + tbl_issue1653complexbmv2l72.apply(); tns_0.apply(); - tbl_issue1653complexbmv2l94.apply(); + tbl_issue1653complexbmv2l95.apply(); } } diff --git a/testdata/p4_16_samples_outputs/issue1653-complex-bmv2.p4 b/testdata/p4_16_samples_outputs/issue1653-complex-bmv2.p4 index ae02076e466..a626ca7c784 100644 --- a/testdata/p4_16_samples_outputs/issue1653-complex-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/issue1653-complex-bmv2.p4 @@ -31,6 +31,7 @@ header bitvec_hdr { } struct local_metadata_t { + @field_list(0) row_t row0; row_t row1; bitvec_hdr bvh0; @@ -71,7 +72,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, bh.row.alt1.type = EthTypes.IPv4; h.bvh0.row.alt1.type = bh.row.alt1.type; local_metadata.row0.alt0.useHash = true; - clone3(CloneType.I2E, 0, local_metadata.row0); + clone3(CloneType.I2E, 0, 0); } } diff --git a/testdata/p4_16_samples_outputs/issue1653-complex-bmv2.p4-stderr b/testdata/p4_16_samples_outputs/issue1653-complex-bmv2.p4-stderr index fd1359c4c35..15ee836f8a8 100644 --- a/testdata/p4_16_samples_outputs/issue1653-complex-bmv2.p4-stderr +++ b/testdata/p4_16_samples_outputs/issue1653-complex-bmv2.p4-stderr @@ -1,9 +1,9 @@ -issue1653-complex-bmv2.p4(93): [--Wwarn=invalid_header] warning: accessing a field of an invalid header bh +issue1653-complex-bmv2.p4(94): [--Wwarn=invalid_header] warning: accessing a field of an invalid header bh bh.row.alt0.useHash = h.bvh0.row.alt0.useHash; ^^ -issue1653-complex-bmv2.p4(94): [--Wwarn=invalid_header] warning: accessing a field of an invalid header bh +issue1653-complex-bmv2.p4(95): [--Wwarn=invalid_header] warning: accessing a field of an invalid header bh bh.row.alt1.type = EthTypes.IPv4; ^^ -issue1653-complex-bmv2.p4(95): [--Wwarn=invalid_header] warning: accessing a field of an invalid header bh +issue1653-complex-bmv2.p4(96): [--Wwarn=invalid_header] warning: accessing a field of an invalid header bh h.bvh0.row.alt1.type = bh.row.alt1.type; ^^ diff --git a/testdata/p4_16_samples_outputs/issue1660-bmv2-first.p4 b/testdata/p4_16_samples_outputs/issue1660-bmv2-first.p4 index 3c07f326139..e1607db5b61 100644 --- a/testdata/p4_16_samples_outputs/issue1660-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/issue1660-bmv2-first.p4 @@ -3,6 +3,7 @@ #include struct HasBool { + @field_list(0) bool x; } @@ -22,7 +23,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, apply { HasBool b; b.x = true; - clone3(CloneType.I2E, 32w0, b); + clone3(CloneType.I2E, 32w0, 8w0); } } diff --git a/testdata/p4_16_samples_outputs/issue1660-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue1660-bmv2-frontend.p4 index 3e49150e906..2899482575d 100644 --- a/testdata/p4_16_samples_outputs/issue1660-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1660-bmv2-frontend.p4 @@ -3,6 +3,7 @@ #include struct HasBool { + @field_list(0) bool x; } @@ -19,10 +20,8 @@ parser parse(packet_in pk, out parsed_packet_t h, inout local_metadata_t local_m } control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, inout standard_metadata_t standard_metadata) { - @name("ingress.b") HasBool b_0; apply { - b_0.x = true; - clone3(CloneType.I2E, 32w0, b_0); + clone3(CloneType.I2E, 32w0, 8w0); } } diff --git a/testdata/p4_16_samples_outputs/issue1660-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/issue1660-bmv2-midend.p4 index bb4ae3fbe25..66b2091fd07 100644 --- a/testdata/p4_16_samples_outputs/issue1660-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue1660-bmv2-midend.p4 @@ -3,6 +3,7 @@ #include struct HasBool { + @field_list(0) bool x; } @@ -19,19 +20,17 @@ parser parse(packet_in pk, out parsed_packet_t h, inout local_metadata_t local_m } control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, inout standard_metadata_t standard_metadata) { - @name("ingress.b") HasBool b_0; - @hidden action issue1660bmv2l21() { - b_0.x = true; - clone3(CloneType.I2E, 32w0, b_0); + @hidden action issue1660bmv2l23() { + clone3(CloneType.I2E, 32w0, 8w0); } - @hidden table tbl_issue1660bmv2l21 { + @hidden table tbl_issue1660bmv2l23 { actions = { - issue1660bmv2l21(); + issue1660bmv2l23(); } - const default_action = issue1660bmv2l21(); + const default_action = issue1660bmv2l23(); } apply { - tbl_issue1660bmv2l21.apply(); + tbl_issue1660bmv2l23.apply(); } } diff --git a/testdata/p4_16_samples_outputs/issue1660-bmv2.p4 b/testdata/p4_16_samples_outputs/issue1660-bmv2.p4 index 83b4ecd2a3b..4ea8c108c2f 100644 --- a/testdata/p4_16_samples_outputs/issue1660-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/issue1660-bmv2.p4 @@ -3,6 +3,7 @@ #include struct HasBool { + @field_list(0) bool x; } @@ -22,7 +23,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, apply { HasBool b; b.x = true; - clone3(CloneType.I2E, 0, b); + clone3(CloneType.I2E, 0, 0); } } 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 6613a6c6dde..8cb761033e7 100644 --- a/testdata/p4_16_samples_outputs/issue1765-1-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/issue1765-1-bmv2-first.p4 @@ -116,10 +116,15 @@ struct headers { } struct metadata { + @field_list(0) port_t ingress_port; + @field_list(0) task_t task; + @field_list(0) bit<16> tcp_length; + @field_list(0) bit<32> cast_length; + @field_list(0) bit<1> do_cksum; } @@ -204,12 +209,12 @@ control MyIngress(inout headers hdr, inout metadata meta, inout standard_metadat action controller_debug() { meta.task = 16w3; meta.ingress_port = standard_metadata.ingress_port; - clone3(CloneType.I2E, 32w100, meta); + clone3(CloneType.I2E, 32w100, 8w0); } action controller_reply(task_t task) { meta.task = task; meta.ingress_port = standard_metadata.ingress_port; - clone3(CloneType.I2E, 32w100, meta); + clone3(CloneType.I2E, 32w100, 8w0); } action multicast_pkg(mcast_t mcast_grp) { standard_metadata.mcast_grp = mcast_grp; 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 5d2761f958d..ddacabf6c63 100644 --- a/testdata/p4_16_samples_outputs/issue1765-1-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1765-1-bmv2-frontend.p4 @@ -98,10 +98,15 @@ struct headers { } struct metadata { + @field_list(0) port_t ingress_port; + @field_list(0) task_t task; + @field_list(0) bit<16> tcp_length; + @field_list(0) bit<32> cast_length; + @field_list(0) bit<1> do_cksum; } @@ -194,22 +199,22 @@ control MyIngress(inout headers hdr, inout metadata meta, inout standard_metadat @name("MyIngress.controller_debug") action controller_debug() { meta.task = 16w3; meta.ingress_port = standard_metadata.ingress_port; - clone3(CloneType.I2E, 32w100, meta); + clone3(CloneType.I2E, 32w100, 8w0); } @name("MyIngress.controller_debug") action controller_debug_1() { meta.task = 16w3; meta.ingress_port = standard_metadata.ingress_port; - clone3(CloneType.I2E, 32w100, meta); + clone3(CloneType.I2E, 32w100, 8w0); } @name("MyIngress.controller_reply") action controller_reply(@name("task") task_t task_1) { meta.task = task_1; meta.ingress_port = standard_metadata.ingress_port; - clone3(CloneType.I2E, 32w100, meta); + clone3(CloneType.I2E, 32w100, 8w0); } @name("MyIngress.controller_reply") action controller_reply_1(@name("task") task_t task_2) { meta.task = task_2; meta.ingress_port = standard_metadata.ingress_port; - clone3(CloneType.I2E, 32w100, meta); + clone3(CloneType.I2E, 32w100, 8w0); } @name("MyIngress.icmp6_echo_reply") action icmp6_echo_reply() { mac_tmp_0 = hdr.ethernet.dst_addr; 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 05aadd0b011..89bf232d5d7 100644 --- a/testdata/p4_16_samples_outputs/issue1765-1-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue1765-1-bmv2-midend.p4 @@ -98,10 +98,15 @@ struct headers { } struct metadata { + @field_list(0) port_t ingress_port; + @field_list(0) task_t task; + @field_list(0) bit<16> tcp_length; + @field_list(0) bit<32> cast_length; + @field_list(0) bit<1> do_cksum; } @@ -202,22 +207,22 @@ control MyIngress(inout headers hdr, inout metadata meta, inout standard_metadat @name("MyIngress.controller_debug") action controller_debug() { meta.task = 16w3; meta.ingress_port = standard_metadata.ingress_port; - clone3(CloneType.I2E, 32w100, meta); + clone3(CloneType.I2E, 32w100, 8w0); } @name("MyIngress.controller_debug") action controller_debug_1() { meta.task = 16w3; meta.ingress_port = standard_metadata.ingress_port; - clone3(CloneType.I2E, 32w100, meta); + clone3(CloneType.I2E, 32w100, 8w0); } @name("MyIngress.controller_reply") action controller_reply(@name("task") task_t task_1) { meta.task = task_1; meta.ingress_port = standard_metadata.ingress_port; - clone3(CloneType.I2E, 32w100, meta); + clone3(CloneType.I2E, 32w100, 8w0); } @name("MyIngress.controller_reply") action controller_reply_1(@name("task") task_t task_2) { meta.task = task_2; meta.ingress_port = standard_metadata.ingress_port; - clone3(CloneType.I2E, 32w100, meta); + clone3(CloneType.I2E, 32w100, 8w0); } @name("MyIngress.icmp6_echo_reply") action icmp6_echo_reply() { mac_tmp_0 = hdr.ethernet.dst_addr; @@ -278,22 +283,22 @@ control MyIngress(inout headers hdr, inout metadata meta, inout standard_metadat } control MyEgress(inout headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { - @hidden action issue17651bmv2l343() { + @hidden action issue17651bmv2l348() { hdr.cpu.setValid(); hdr.cpu.task = meta.task; hdr.cpu.ethertype = hdr.ethernet.ethertype; hdr.cpu.ingress_port = (bit<16>)meta.ingress_port; hdr.ethernet.ethertype = 16w0x4242; } - @hidden table tbl_issue17651bmv2l343 { + @hidden table tbl_issue17651bmv2l348 { actions = { - issue17651bmv2l343(); + issue17651bmv2l348(); } - const default_action = issue17651bmv2l343(); + const default_action = issue17651bmv2l348(); } apply { if (standard_metadata.instance_type == 32w1) { - tbl_issue17651bmv2l343.apply(); + tbl_issue17651bmv2l348.apply(); } } } diff --git a/testdata/p4_16_samples_outputs/issue1765-1-bmv2.p4 b/testdata/p4_16_samples_outputs/issue1765-1-bmv2.p4 index fe5751c7981..15b1b372c9a 100644 --- a/testdata/p4_16_samples_outputs/issue1765-1-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/issue1765-1-bmv2.p4 @@ -116,10 +116,15 @@ struct headers { } struct metadata { + @field_list(0) port_t ingress_port; + @field_list(0) task_t task; + @field_list(0) bit<16> tcp_length; + @field_list(0) bit<32> cast_length; + @field_list(0) bit<1> do_cksum; } @@ -204,12 +209,12 @@ control MyIngress(inout headers hdr, inout metadata meta, inout standard_metadat action controller_debug() { meta.task = TASK_DEBUG; meta.ingress_port = standard_metadata.ingress_port; - clone3(CloneType.I2E, 100, meta); + clone3(CloneType.I2E, 100, 0); } action controller_reply(task_t task) { meta.task = task; meta.ingress_port = standard_metadata.ingress_port; - clone3(CloneType.I2E, 100, meta); + clone3(CloneType.I2E, 100, 0); } action multicast_pkg(mcast_t mcast_grp) { standard_metadata.mcast_grp = mcast_grp; diff --git a/testdata/p4_16_samples_outputs/issue1765-1-bmv2.p4-stderr b/testdata/p4_16_samples_outputs/issue1765-1-bmv2.p4-stderr index 8553db45cd4..417498608ae 100644 --- a/testdata/p4_16_samples_outputs/issue1765-1-bmv2.p4-stderr +++ b/testdata/p4_16_samples_outputs/issue1765-1-bmv2.p4-stderr @@ -1,12 +1,12 @@ -issue1765-1-bmv2.p4(232): [--Wwarn=unused] warning: Table ndp_answer is not used; removing +issue1765-1-bmv2.p4(237): [--Wwarn=unused] warning: Table ndp_answer is not used; removing table ndp_answer { ^^^^^^^^^^ -issue1765-1-bmv2.p4(245): [--Wwarn=unused] warning: Table port2mcast is not used; removing +issue1765-1-bmv2.p4(250): [--Wwarn=unused] warning: Table port2mcast is not used; removing table port2mcast { ^^^^^^^^^^ -issue1765-1-bmv2.p4(257): [--Wwarn=unused] warning: Table addr2mcast is not used; removing +issue1765-1-bmv2.p4(262): [--Wwarn=unused] warning: Table addr2mcast is not used; removing table addr2mcast { ^^^^^^^^^^ -issue1765-1-bmv2.p4(269): [--Wwarn=unused] warning: Table ndp is not used; removing +issue1765-1-bmv2.p4(274): [--Wwarn=unused] warning: Table ndp is not used; removing table ndp { ^^^ diff --git a/testdata/p4_16_samples_outputs/issue2176-bmv2.p4-stderr b/testdata/p4_16_samples_outputs/issue2176-bmv2.p4-stderr index 42fe707d841..1f0b2e631ea 100644 --- a/testdata/p4_16_samples_outputs/issue2176-bmv2.p4-stderr +++ b/testdata/p4_16_samples_outputs/issue2176-bmv2.p4-stderr @@ -3,7 +3,7 @@ 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); ^^^^^ @@ -15,4 +15,4 @@ 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); - ^^^^^ + ^^^^^ diff --git a/testdata/p4_16_samples_outputs/issue383-bmv2-first.p4 b/testdata/p4_16_samples_outputs/issue383-bmv2-first.p4 index 343463724db..0e9948a755a 100644 --- a/testdata/p4_16_samples_outputs/issue383-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/issue383-bmv2-first.p4 @@ -21,6 +21,7 @@ struct col_t { } struct local_metadata_t { + @field_list(0) row_t row0; row_t row1; col_t col; @@ -79,7 +80,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, local_metadata.row0.alt0 = local_metadata.row1.alt1; local_metadata.row1.alt0.valid = 1w1; local_metadata.row1.alt1.port = local_metadata.row0.alt1.port + 7w1; - clone3(CloneType.I2E, 32w0, local_metadata.row0); + clone3(CloneType.I2E, 32w0, 8w0); } } diff --git a/testdata/p4_16_samples_outputs/issue383-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue383-bmv2-frontend.p4 index 4d22b4fe2c6..d1b8e209471 100644 --- a/testdata/p4_16_samples_outputs/issue383-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue383-bmv2-frontend.p4 @@ -21,6 +21,7 @@ struct col_t { } struct local_metadata_t { + @field_list(0) row_t row0; row_t row1; col_t col; @@ -79,7 +80,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, local_metadata.row0.alt0 = local_metadata.row1.alt1; local_metadata.row1.alt0.valid = 1w1; local_metadata.row1.alt1.port = local_metadata.row0.alt1.port + 7w1; - clone3(CloneType.I2E, 32w0, local_metadata.row0); + clone3(CloneType.I2E, 32w0, 8w0); } } diff --git a/testdata/p4_16_samples_outputs/issue383-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/issue383-bmv2-midend.p4 index c90ed32c679..044ee79600f 100644 --- a/testdata/p4_16_samples_outputs/issue383-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue383-bmv2-midend.p4 @@ -24,9 +24,13 @@ struct col_t { } struct local_metadata_t { + @field_list(0) bit<1> _row0_alt0_valid0; + @field_list(0) bit<7> _row0_alt0_port1; + @field_list(0) bit<1> _row0_alt1_valid2; + @field_list(0) bit<7> _row0_alt1_port3; bit<1> _row1_alt0_valid4; bit<7> _row1_alt0_port5; @@ -80,36 +84,36 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, } default_action = NoAction_1(); } - @hidden action issue383bmv2l74() { + @hidden action issue383bmv2l75() { s_0_col_bvh.setInvalid(); s_0_bvh0.setInvalid(); s_0_bvh1.setInvalid(); bh_0.setInvalid(); } - @hidden action issue383bmv2l104() { + @hidden action issue383bmv2l105() { local_metadata._col_bvh8._row_alt0_valid0 = 1w0; local_metadata._row0_alt0_valid0 = local_metadata._row1_alt1_valid6; local_metadata._row0_alt0_port1 = local_metadata._row1_alt1_port7; local_metadata._row1_alt0_valid4 = 1w1; local_metadata._row1_alt1_port7 = local_metadata._row0_alt1_port3 + 7w1; - clone3(CloneType.I2E, 32w0, (row_t){alt0 = (alt_t){valid = local_metadata._row1_alt1_valid6,port = local_metadata._row0_alt0_port1},alt1 = (alt_t){valid = local_metadata._row0_alt1_valid2,port = local_metadata._row0_alt1_port3}}); + clone3(CloneType.I2E, 32w0, 8w0); } - @hidden table tbl_issue383bmv2l74 { + @hidden table tbl_issue383bmv2l75 { actions = { - issue383bmv2l74(); + issue383bmv2l75(); } - const default_action = issue383bmv2l74(); + const default_action = issue383bmv2l75(); } - @hidden table tbl_issue383bmv2l104 { + @hidden table tbl_issue383bmv2l105 { actions = { - issue383bmv2l104(); + issue383bmv2l105(); } - const default_action = issue383bmv2l104(); + const default_action = issue383bmv2l105(); } apply { - tbl_issue383bmv2l74.apply(); + tbl_issue383bmv2l75.apply(); tns_0.apply(); - tbl_issue383bmv2l104.apply(); + tbl_issue383bmv2l105.apply(); } } diff --git a/testdata/p4_16_samples_outputs/issue383-bmv2.p4 b/testdata/p4_16_samples_outputs/issue383-bmv2.p4 index a3f50979fdf..d035eeec9b3 100644 --- a/testdata/p4_16_samples_outputs/issue383-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/issue383-bmv2.p4 @@ -21,6 +21,7 @@ struct col_t { } struct local_metadata_t { + @field_list(0) row_t row0; row_t row1; col_t col; @@ -77,7 +78,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, local_metadata.row0.alt0 = local_metadata.row1.alt1; local_metadata.row1.alt0.valid = 1; local_metadata.row1.alt1.port = local_metadata.row0.alt1.port + 1; - clone3(CloneType.I2E, 0, local_metadata.row0); + clone3(CloneType.I2E, 0, 0); } } diff --git a/testdata/p4_16_samples_outputs/issue383-bmv2.p4-stderr b/testdata/p4_16_samples_outputs/issue383-bmv2.p4-stderr index 475cef84962..78fb65501fd 100644 --- a/testdata/p4_16_samples_outputs/issue383-bmv2.p4-stderr +++ b/testdata/p4_16_samples_outputs/issue383-bmv2.p4-stderr @@ -1,6 +1,6 @@ -issue383-bmv2.p4(97): [--Wwarn=invalid_header] warning: accessing a field of an invalid header bh +issue383-bmv2.p4(98): [--Wwarn=invalid_header] warning: accessing a field of an invalid header bh bh.row.alt0.valid = h.bvh0.row.alt0.valid; ^^ -issue383-bmv2.p4(102): [--Wwarn=invalid_header] warning: accessing a field of an invalid header s.col.bvh +issue383-bmv2.p4(103): [--Wwarn=invalid_header] warning: accessing a field of an invalid header s.col.bvh s.col.bvh.row.alt0.valid = 0; ^^^^^^^^^ diff --git a/testdata/p4_16_samples_outputs/issue562-bmv2-first.p4 b/testdata/p4_16_samples_outputs/issue562-bmv2-first.p4 index fd249eab87d..0873ede05c1 100644 --- a/testdata/p4_16_samples_outputs/issue562-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/issue562-bmv2-first.p4 @@ -16,6 +16,7 @@ struct parsed_packet_t { } struct local_metadata_t { + @field_list(0) row_t row; } @@ -30,7 +31,7 @@ control ingress(inout parsed_packet_t hdr, inout local_metadata_t local_metadata local_metadata.row.alt0 = local_metadata.row.alt1; local_metadata.row.alt0.valid = 1w1; local_metadata.row.alt1.port = local_metadata.row.alt1.port + 7w1; - clone3(CloneType.I2E, 32w0, local_metadata.row); + clone3(CloneType.I2E, 32w0, 8w0); } } diff --git a/testdata/p4_16_samples_outputs/issue562-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue562-bmv2-frontend.p4 index fd249eab87d..0873ede05c1 100644 --- a/testdata/p4_16_samples_outputs/issue562-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue562-bmv2-frontend.p4 @@ -16,6 +16,7 @@ struct parsed_packet_t { } struct local_metadata_t { + @field_list(0) row_t row; } @@ -30,7 +31,7 @@ control ingress(inout parsed_packet_t hdr, inout local_metadata_t local_metadata local_metadata.row.alt0 = local_metadata.row.alt1; local_metadata.row.alt0.valid = 1w1; local_metadata.row.alt1.port = local_metadata.row.alt1.port + 7w1; - clone3(CloneType.I2E, 32w0, local_metadata.row); + clone3(CloneType.I2E, 32w0, 8w0); } } diff --git a/testdata/p4_16_samples_outputs/issue562-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/issue562-bmv2-midend.p4 index 1605cf03d3c..1e6a41b5b5c 100644 --- a/testdata/p4_16_samples_outputs/issue562-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue562-bmv2-midend.p4 @@ -16,9 +16,13 @@ struct parsed_packet_t { } struct local_metadata_t { + @field_list(0) bit<1> _row_alt0_valid0; + @field_list(0) bit<7> _row_alt0_port1; + @field_list(0) bit<1> _row_alt1_valid2; + @field_list(0) bit<7> _row_alt1_port3; } @@ -29,21 +33,21 @@ parser parse(packet_in pk, out parsed_packet_t hdr, inout local_metadata_t local } control ingress(inout parsed_packet_t hdr, inout local_metadata_t local_metadata, inout standard_metadata_t standard_metadata) { - @hidden action issue562bmv2l31() { + @hidden action issue562bmv2l32() { local_metadata._row_alt0_valid0 = local_metadata._row_alt1_valid2; local_metadata._row_alt0_port1 = local_metadata._row_alt1_port3; local_metadata._row_alt0_valid0 = 1w1; local_metadata._row_alt1_port3 = local_metadata._row_alt1_port3 + 7w1; - clone3(CloneType.I2E, 32w0, (row_t){alt0 = (alt_t){valid = 1w1,port = local_metadata._row_alt0_port1},alt1 = (alt_t){valid = local_metadata._row_alt1_valid2,port = local_metadata._row_alt1_port3}}); + clone3(CloneType.I2E, 32w0, 8w0); } - @hidden table tbl_issue562bmv2l31 { + @hidden table tbl_issue562bmv2l32 { actions = { - issue562bmv2l31(); + issue562bmv2l32(); } - const default_action = issue562bmv2l31(); + const default_action = issue562bmv2l32(); } apply { - tbl_issue562bmv2l31.apply(); + tbl_issue562bmv2l32.apply(); } } diff --git a/testdata/p4_16_samples_outputs/issue562-bmv2.p4 b/testdata/p4_16_samples_outputs/issue562-bmv2.p4 index b9b29b68cec..71d18d6588c 100644 --- a/testdata/p4_16_samples_outputs/issue562-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/issue562-bmv2.p4 @@ -16,6 +16,7 @@ struct parsed_packet_t { } struct local_metadata_t { + @field_list(0) row_t row; } @@ -30,7 +31,7 @@ control ingress(inout parsed_packet_t hdr, inout local_metadata_t local_metadata local_metadata.row.alt0 = local_metadata.row.alt1; local_metadata.row.alt0.valid = 1; local_metadata.row.alt1.port = local_metadata.row.alt1.port + 1; - clone3(CloneType.I2E, 0, local_metadata.row); + clone3(CloneType.I2E, 0, 0); } } diff --git a/testdata/p4_16_samples_outputs/issue841.p4-stderr b/testdata/p4_16_samples_outputs/issue841.p4-stderr index 78807545244..238152c222c 100644 --- a/testdata/p4_16_samples_outputs/issue841.p4-stderr +++ b/testdata/p4_16_samples_outputs/issue841.p4-stderr @@ -1,6 +1,6 @@ issue841.p4(39): [--Wwarn=deprecated] warning: Checksum16: Using deprecated feature Checksum16. Please use verify_checksum/update_checksum instead. Checksum16() checksum; ^^^^^^^^^^ -v1model.p4(465) +v1model.p4(456) extern Checksum16 { ^^^^^^^^^^ diff --git a/testdata/p4_16_samples_outputs/methodArgDontcare.p4 b/testdata/p4_16_samples_outputs/methodArgDontcare.p4 index 35a1243e420..7c1247d49de 100644 --- a/testdata/p4_16_samples_outputs/methodArgDontcare.p4 +++ b/testdata/p4_16_samples_outputs/methodArgDontcare.p4 @@ -12,5 +12,5 @@ control c() { control proto(); package top(proto p); - top(c()) 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 1214883be65..0fa762318d9 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/v1model-special-ops-bmv2-first.p4 b/testdata/p4_16_samples_outputs/v1model-special-ops-bmv2-first.p4 index ef2d39e1f69..1596f9450d5 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 @@ -91,10 +91,10 @@ control ingress(inout headers_t hdr, inout meta_t meta, inout standard_metadata_ } action do_resubmit(bit<32> new_ipv4_dstAddr) { hdr.ipv4.dstAddr = new_ipv4_dstAddr; - resubmit>({ }); + resubmit(8w0); } action do_clone_i2e(bit<32> l2ptr) { - clone3>(CloneType.I2E, 32w5, { }); + clone3(CloneType.I2E, 32w5, 8w0); meta.fwd.l2ptr = l2ptr; } table ipv4_da_lpm { @@ -162,11 +162,11 @@ control egress(inout headers_t hdr, inout meta_t meta, inout standard_metadata_t } action do_recirculate(bit<32> new_ipv4_dstAddr) { hdr.ipv4.dstAddr = new_ipv4_dstAddr; - recirculate>({ }); + recirculate(8w0); } action do_clone_e2e(bit<48> smac) { hdr.ethernet.srcAddr = smac; - clone3>(CloneType.E2E, 32w11, { }); + clone3(CloneType.E2E, 32w11, 8w0); } table send_frame { key = { 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 fbec61c1991..4ca006eeb68 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 @@ -83,10 +83,10 @@ control ingress(inout headers_t hdr, inout meta_t meta, inout standard_metadata_ } @name("ingress.do_resubmit") action do_resubmit(@name("new_ipv4_dstAddr") bit<32> new_ipv4_dstAddr) { hdr.ipv4.dstAddr = new_ipv4_dstAddr; - resubmit>({ }); + resubmit(8w0); } @name("ingress.do_clone_i2e") action do_clone_i2e(@name("l2ptr") bit<32> l2ptr_3) { - clone3>(CloneType.I2E, 32w5, { }); + clone3(CloneType.I2E, 32w5, 8w0); meta.fwd.l2ptr = l2ptr_3; } @name("ingress.ipv4_da_lpm") table ipv4_da_lpm_0 { @@ -172,11 +172,11 @@ control egress(inout headers_t hdr, inout meta_t meta, inout standard_metadata_t } @name("egress.do_recirculate") action do_recirculate(@name("new_ipv4_dstAddr") bit<32> new_ipv4_dstAddr_2) { hdr.ipv4.dstAddr = new_ipv4_dstAddr_2; - recirculate>({ }); + recirculate(8w0); } @name("egress.do_clone_e2e") action do_clone_e2e(@name("smac") bit<48> smac_2) { hdr.ethernet.srcAddr = smac_2; - clone3>(CloneType.E2E, 32w11, { }); + clone3(CloneType.E2E, 32w11, 8w0); } @name("egress.send_frame") table send_frame_0 { key = { 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 41a3646b0fc..1a1fa2972ec 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 @@ -58,9 +58,6 @@ parser ParserImpl(packet_in packet, out headers_t hdr, inout meta_t meta, inout } } -struct tuple_0 { -} - control ingress(inout headers_t hdr, inout meta_t meta, inout standard_metadata_t standard_metadata) { @name("ingress.smeta") standard_metadata_t smeta_0; @name("ingress.smeta") standard_metadata_t smeta_3; @@ -142,10 +139,10 @@ control ingress(inout headers_t hdr, inout meta_t meta, inout standard_metadata_ } @name("ingress.do_resubmit") action do_resubmit(@name("new_ipv4_dstAddr") bit<32> new_ipv4_dstAddr) { hdr.ipv4.dstAddr = new_ipv4_dstAddr; - resubmit((tuple_0){}); + resubmit(8w0); } @name("ingress.do_clone_i2e") action do_clone_i2e(@name("l2ptr") bit<32> l2ptr_3) { - clone3(CloneType.I2E, 32w5, (tuple_0){}); + clone3(CloneType.I2E, 32w5, 8w0); meta._fwd_l2ptr0 = l2ptr_3; } @name("ingress.ipv4_da_lpm") table ipv4_da_lpm_0 { @@ -269,11 +266,11 @@ control egress(inout headers_t hdr, inout meta_t meta, inout standard_metadata_t } @name("egress.do_recirculate") action do_recirculate(@name("new_ipv4_dstAddr") bit<32> new_ipv4_dstAddr_2) { hdr.ipv4.dstAddr = new_ipv4_dstAddr_2; - recirculate((tuple_0){}); + recirculate(8w0); } @name("egress.do_clone_e2e") action do_clone_e2e(@name("smac") bit<48> smac_2) { hdr.ethernet.srcAddr = smac_2; - clone3(CloneType.E2E, 32w11, (tuple_0){}); + clone3(CloneType.E2E, 32w11, 8w0); } @name("egress.send_frame") table send_frame_0 { key = { @@ -331,7 +328,7 @@ control DeparserImpl(packet_out packet, in headers_t hdr) { } } -struct tuple_1 { +struct tuple_0 { bit<4> f0; bit<4> f1; bit<8> f2; @@ -347,13 +344,13 @@ struct tuple_1 { control verifyChecksum(inout headers_t hdr, inout meta_t meta) { apply { - verify_checksum>(hdr.ipv4.isValid() && hdr.ipv4.ihl == 4w5, (tuple_1){f0 = hdr.ipv4.version,f1 = hdr.ipv4.ihl,f2 = hdr.ipv4.diffserv,f3 = hdr.ipv4.totalLen,f4 = hdr.ipv4.identification,f5 = hdr.ipv4.flags,f6 = hdr.ipv4.fragOffset,f7 = hdr.ipv4.ttl,f8 = hdr.ipv4.protocol,f9 = hdr.ipv4.srcAddr,f10 = hdr.ipv4.dstAddr}, hdr.ipv4.hdrChecksum, HashAlgorithm.csum16); + verify_checksum>(hdr.ipv4.isValid() && hdr.ipv4.ihl == 4w5, (tuple_0){f0 = hdr.ipv4.version,f1 = hdr.ipv4.ihl,f2 = hdr.ipv4.diffserv,f3 = hdr.ipv4.totalLen,f4 = hdr.ipv4.identification,f5 = hdr.ipv4.flags,f6 = hdr.ipv4.fragOffset,f7 = hdr.ipv4.ttl,f8 = hdr.ipv4.protocol,f9 = hdr.ipv4.srcAddr,f10 = hdr.ipv4.dstAddr}, hdr.ipv4.hdrChecksum, HashAlgorithm.csum16); } } control computeChecksum(inout headers_t hdr, inout meta_t meta) { apply { - update_checksum>(hdr.ipv4.isValid() && hdr.ipv4.ihl == 4w5, (tuple_1){f0 = hdr.ipv4.version,f1 = hdr.ipv4.ihl,f2 = hdr.ipv4.diffserv,f3 = hdr.ipv4.totalLen,f4 = hdr.ipv4.identification,f5 = hdr.ipv4.flags,f6 = hdr.ipv4.fragOffset,f7 = hdr.ipv4.ttl,f8 = hdr.ipv4.protocol,f9 = hdr.ipv4.srcAddr,f10 = hdr.ipv4.dstAddr}, hdr.ipv4.hdrChecksum, HashAlgorithm.csum16); + update_checksum>(hdr.ipv4.isValid() && hdr.ipv4.ihl == 4w5, (tuple_0){f0 = hdr.ipv4.version,f1 = hdr.ipv4.ihl,f2 = hdr.ipv4.diffserv,f3 = hdr.ipv4.totalLen,f4 = hdr.ipv4.identification,f5 = hdr.ipv4.flags,f6 = hdr.ipv4.fragOffset,f7 = hdr.ipv4.ttl,f8 = hdr.ipv4.protocol,f9 = hdr.ipv4.srcAddr,f10 = hdr.ipv4.dstAddr}, hdr.ipv4.hdrChecksum, HashAlgorithm.csum16); } } 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 9d32d331068..29ecfe8fa32 100644 --- a/testdata/p4_16_samples_outputs/v1model-special-ops-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/v1model-special-ops-bmv2.p4 @@ -91,10 +91,10 @@ control ingress(inout headers_t hdr, inout meta_t meta, inout standard_metadata_ } action do_resubmit(bit<32> new_ipv4_dstAddr) { hdr.ipv4.dstAddr = new_ipv4_dstAddr; - resubmit({ }); + resubmit(0); } action do_clone_i2e(bit<32> l2ptr) { - clone3(CloneType.I2E, I2E_CLONE_SESSION_ID, { }); + clone3(CloneType.I2E, I2E_CLONE_SESSION_ID, 0); meta.fwd.l2ptr = l2ptr; } table ipv4_da_lpm { @@ -160,11 +160,11 @@ control egress(inout headers_t hdr, inout meta_t meta, inout standard_metadata_t } action do_recirculate(bit<32> new_ipv4_dstAddr) { hdr.ipv4.dstAddr = new_ipv4_dstAddr; - recirculate({ }); + recirculate(0); } action do_clone_e2e(bit<48> smac) { hdr.ethernet.srcAddr = smac; - clone3(CloneType.E2E, E2E_CLONE_SESSION_ID, { }); + clone3(CloneType.E2E, E2E_CLONE_SESSION_ID, 0); } table send_frame { key = { From a65d505db845eaa6ae340c6ba0815424b311f102 Mon Sep 17 00:00:00 2001 From: Mihai Budiu Date: Mon, 1 Nov 2021 19:19:57 -0700 Subject: [PATCH 02/11] Rename resubmit to resubmit_field_list, etc. --- backends/bmv2/simple_switch/simpleSwitch.cpp | 15 +++++++-------- backends/bmv2/simple_switch/simpleSwitch.h | 6 +++--- frontends/p4/fromv1.0/programStructure.cpp | 3 +++ frontends/p4/fromv1.0/v1model.h | 6 +++--- p4include/v1model.p4 | 15 ++++++++++++--- 5 files changed, 28 insertions(+), 17 deletions(-) diff --git a/backends/bmv2/simple_switch/simpleSwitch.cpp b/backends/bmv2/simple_switch/simpleSwitch.cpp index 26b721b65d3..fd440bfb661 100644 --- a/backends/bmv2/simple_switch/simpleSwitch.cpp +++ b/backends/bmv2/simple_switch/simpleSwitch.cpp @@ -94,11 +94,11 @@ bool ParseV1Architecture::preorder(const IR::PackageBlock* main) { } ExternConverter_clone ExternConverter_clone::singleton; -ExternConverter_clone3 ExternConverter_clone3::singleton; +ExternConverter_clone3_field_list ExternConverter_clone3_field_list::singleton; ExternConverter_hash ExternConverter_hash::singleton; ExternConverter_digest ExternConverter_digest::singleton; -ExternConverter_resubmit ExternConverter_resubmit::singleton; -ExternConverter_recirculate ExternConverter_recirculate::singleton; +ExternConverter_resubmit_field_list ExternConverter_resubmit_field_list::singleton; +ExternConverter_recirculate_field_list ExternConverter_recirculate_field_list::singleton; ExternConverter_mark_to_drop ExternConverter_mark_to_drop::singleton; ExternConverter_random ExternConverter_random::singleton; ExternConverter_truncate ExternConverter_truncate::singleton; @@ -184,11 +184,10 @@ static unsigned getFieldListById(ConversionContext* ctxt, unsigned index) { return (unsigned)id; } -Util::IJson* ExternConverter_clone3::convertExternFunction( +Util::IJson* ExternConverter_clone3_field_list::convertExternFunction( ConversionContext* ctxt, UNUSED const P4::ExternFunction* ef, const IR::MethodCallExpression* mc, UNUSED const IR::StatOrDecl* s, UNUSED const bool emitExterns) { - (void) v1model.clone.clone3.name; int id = -1; if (mc->arguments->size() != 3) { modelError("Expected 3 arguments for %1%", mc); @@ -205,7 +204,7 @@ Util::IJson* ExternConverter_clone3::convertExternFunction( if (ei->name == "I2E") { prim = "clone_ingress_pkt_to_egress"; if (ctxt->blockConverted != BlockConverted::Ingress) { - ::error("'clone3(I2E, ...) not invoked in ingress %1%", mc); + ::error("'clone3_field_list(I2E, ...) not invoked in ingress %1%", mc); return nullptr; } } else { @@ -313,7 +312,7 @@ Util::IJson* ExternConverter_digest::convertExternFunction( return primitive; } -Util::IJson* ExternConverter_resubmit::convertExternFunction( +Util::IJson* ExternConverter_resubmit_field_list::convertExternFunction( ConversionContext* ctxt, UNUSED const P4::ExternFunction* ef, const IR::MethodCallExpression* mc, UNUSED const IR::StatOrDecl* s, UNUSED const bool emitExterns) { @@ -343,7 +342,7 @@ Util::IJson* ExternConverter_resubmit::convertExternFunction( return nullptr; } -Util::IJson* ExternConverter_recirculate::convertExternFunction( +Util::IJson* ExternConverter_recirculate_field_list::convertExternFunction( ConversionContext* ctxt, UNUSED const P4::ExternFunction* ef, const IR::MethodCallExpression* mc, UNUSED const IR::StatOrDecl* s, UNUSED const bool emitExterns) { diff --git a/backends/bmv2/simple_switch/simpleSwitch.h b/backends/bmv2/simple_switch/simpleSwitch.h index f936422aa82..70d4a10f87f 100644 --- a/backends/bmv2/simple_switch/simpleSwitch.h +++ b/backends/bmv2/simple_switch/simpleSwitch.h @@ -167,11 +167,11 @@ class SimpleSwitchBackend : public Backend { }; EXTERN_CONVERTER_W_FUNCTION(clone) -EXTERN_CONVERTER_W_FUNCTION_AND_MODEL(clone3, P4V1::V1Model, v1model) +EXTERN_CONVERTER_W_FUNCTION_AND_MODEL(clone3_field_list, P4V1::V1Model, v1model) EXTERN_CONVERTER_W_FUNCTION_AND_MODEL(hash, P4V1::V1Model, v1model) EXTERN_CONVERTER_W_FUNCTION(digest) -EXTERN_CONVERTER_W_FUNCTION(resubmit) -EXTERN_CONVERTER_W_FUNCTION(recirculate) +EXTERN_CONVERTER_W_FUNCTION(resubmit_field_list) +EXTERN_CONVERTER_W_FUNCTION(recirculate_field_list) EXTERN_CONVERTER_W_FUNCTION(mark_to_drop) EXTERN_CONVERTER_W_FUNCTION(log_msg) EXTERN_CONVERTER_W_FUNCTION_AND_MODEL(random, P4V1::V1Model, v1model) diff --git a/frontends/p4/fromv1.0/programStructure.cpp b/frontends/p4/fromv1.0/programStructure.cpp index d370f0fdcb8..b4a07a9b378 100644 --- a/frontends/p4/fromv1.0/programStructure.cpp +++ b/frontends/p4/fromv1.0/programStructure.cpp @@ -2675,9 +2675,12 @@ void ProgramStructure::populateOutputNames() { "mark_to_drop", "hash", "resubmit", + "resubmit_field_list", "recirculate", + "recirculate_field_list", "clone", "clone3", + "clone3_field_list", "truncate", "V1Switch", // other v1model names diff --git a/frontends/p4/fromv1.0/v1model.h b/frontends/p4/fromv1.0/v1model.h index 0ae649a52d2..3d12eb1a645 100644 --- a/frontends/p4/fromv1.0/v1model.h +++ b/frontends/p4/fromv1.0/v1model.h @@ -202,7 +202,7 @@ struct Hash_Model : public ::Model::Elem { }; struct Cloner_Model : public ::Model::Extern_Model { - Cloner_Model() : Extern_Model("clone"), clone3("clone3"), cloneType(), + Cloner_Model() : Extern_Model("clone"), clone3("clone3_field_list"), cloneType(), sessionType(IR::Type_Bits::get(32)) {} ::Model::Elem clone3; CloneType_Model cloneType; @@ -250,13 +250,13 @@ class V1Model : public ::Model::Model { egress("egress", headersType, metadataType, standardMetadataType), ingress("ingress", headersType, metadataType, standardMetadataType), sw(), counterOrMeter("$"), counter(), meter(), random(), action_profile(), - action_selector(), clone(), resubmit("resubmit"), + action_selector(), clone(), resubmit("resubmit_field_list"), tableAttributes(), rangeMatchType("range"), optionalMatchType("optional"), selectorMatchType("selector"), verify("verifyChecksum", headersType), compute("computeChecksum", headersType), digest_receiver(), hash(), algorithm(), registers(), drop("mark_to_drop"), - recirculate("recirculate"), verify_checksum("verify_checksum"), + recirculate("recirculate_field_list"), verify_checksum("verify_checksum"), update_checksum("update_checksum"), verify_checksum_with_payload("verify_checksum_with_payload"), update_checksum_with_payload("update_checksum_with_payload"), diff --git a/p4include/v1model.p4 b/p4include/v1model.p4 index a51c3b458bd..434620b4288 100644 --- a/p4include/v1model.p4 +++ b/p4include/v1model.p4 @@ -536,6 +536,8 @@ extern void update_checksum_with_payload(in bool condition, in T data, ino */ extern void clone(in CloneType type, in bit<32> session); +@deprecated("Please use 'resubmit_field_list' instead") +extern void resubmit(in T data); /*** * Calling resubmit during execution of the ingress control will, * under certain documented conditions, cause the packet to be @@ -556,7 +558,10 @@ extern void clone(in CloneType type, in bit<32> session); * last such call is preserved. See the v1model architecture * documentation (Note 1) for more details. */ -extern void resubmit(bit<8> index); +extern void resubmit_field_list(bit<8> index); + +@deprecated("Please use 'recirculate_field_list' instead") +extern void recirculate(in T data); /*** * Calling recirculate during execution of the egress control will, * under certain documented conditions, cause the packet to be @@ -577,8 +582,12 @@ extern void resubmit(bit<8> index); * data from the last such call is preserved. See the v1model * architecture documentation (Note 1) for more details. */ -extern void recirculate(bit<8> index); +extern void recirculate_field_list(bit<8> index); extern void clone(in CloneType type, in bit<32> session); + +@deprecated("Please use 'clone3_field_list' instead") +extern void clone3(in CloneType type, in bit<32> session, in T data); + /*** * Calling clone3 during execution of the ingress or egress control * will cause the packet to be cloned, sometimes also called @@ -612,7 +621,7 @@ extern void clone(in CloneType type, in bit<32> session); * clone session and data are used. See the v1model architecture * documentation (Note 1) for more details. */ -extern void clone3(in CloneType type, in bit<32> session, bit<8> index); +extern void clone3_field_list(in CloneType type, in bit<32> session, bit<8> index); extern void truncate(in bit<32> length); From e2e5490e45464e990a005fb17b672b543664aff2 Mon Sep 17 00:00:00 2001 From: Mihai Budiu Date: Mon, 1 Nov 2021 19:20:04 -0700 Subject: [PATCH 03/11] Update tests --- .../copy_to_cpu-first.p4 | 2 +- .../copy_to_cpu-frontend.p4 | 2 +- .../copy_to_cpu-midend.p4 | 2 +- testdata/p4_14_samples_outputs/copy_to_cpu.p4 | 2 +- .../p414-special-ops-2-bmv2-first.p4 | 6 ++--- .../p414-special-ops-2-bmv2-frontend.p4 | 6 ++--- .../p414-special-ops-2-bmv2-midend.p4 | 6 ++--- .../p414-special-ops-2-bmv2.p4 | 6 ++--- .../p414-special-ops-3-bmv2-first.p4 | 6 ++--- .../p414-special-ops-3-bmv2-frontend.p4 | 6 ++--- .../p414-special-ops-3-bmv2-midend.p4 | 6 ++--- .../p414-special-ops-3-bmv2.p4 | 6 ++--- .../p414-special-ops-first.p4 | 6 ++--- .../p414-special-ops-frontend.p4 | 6 ++--- .../p414-special-ops-midend.p4 | 6 ++--- .../p4_14_samples_outputs/p414-special-ops.p4 | 6 ++--- .../packet_redirect-first.p4 | 8 +++---- .../packet_redirect-frontend.p4 | 8 +++---- .../packet_redirect-midend.p4 | 8 +++---- .../p4_14_samples_outputs/packet_redirect.p4 | 8 +++---- .../p4_14_samples_outputs/resubmit-first.p4 | 2 +- .../resubmit-frontend.p4 | 2 +- .../p4_14_samples_outputs/resubmit-midend.p4 | 2 +- testdata/p4_14_samples_outputs/resubmit.p4 | 2 +- .../p4_14_samples_outputs/simple_nat-first.p4 | 2 +- .../simple_nat-frontend.p4 | 2 +- .../simple_nat-midend.p4 | 2 +- testdata/p4_14_samples_outputs/simple_nat.p4 | 2 +- .../switch_20160512/switch-first.p4 | 20 ++++++++-------- .../switch_20160512/switch-frontend.p4 | 24 +++++++++---------- .../switch_20160512/switch-midend.p4 | 24 +++++++++---------- .../switch_20160512/switch.p4 | 20 ++++++++-------- testdata/p4_16_samples/issue1001-bmv2.p4 | 2 +- testdata/p4_16_samples/issue1043-bmv2.p4 | 2 +- testdata/p4_16_samples/issue1642-bmv2.p4 | 2 +- testdata/p4_16_samples/issue1653-bmv2.p4 | 2 +- .../p4_16_samples/issue1653-complex-bmv2.p4 | 2 +- testdata/p4_16_samples/issue1660-bmv2.p4 | 2 +- testdata/p4_16_samples/issue1765-1-bmv2.p4 | 4 ++-- testdata/p4_16_samples/issue383-bmv2.p4 | 2 +- testdata/p4_16_samples/issue562-bmv2.p4 | 2 +- .../p4_16_samples/v1model-special-ops-bmv2.p4 | 8 +++---- .../issue1001-bmv2-first.p4 | 2 +- .../issue1001-bmv2-frontend.p4 | 2 +- .../issue1001-bmv2-midend.p4 | 2 +- .../p4_16_samples_outputs/issue1001-bmv2.p4 | 2 +- .../issue1642-bmv2-first.p4 | 2 +- .../issue1642-bmv2-frontend.p4 | 2 +- .../issue1642-bmv2-midend.p4 | 2 +- .../p4_16_samples_outputs/issue1642-bmv2.p4 | 2 +- .../issue1653-bmv2-first.p4 | 2 +- .../issue1653-bmv2-frontend.p4 | 2 +- .../issue1653-bmv2-midend.p4 | 2 +- .../p4_16_samples_outputs/issue1653-bmv2.p4 | 2 +- .../issue1653-complex-bmv2-first.p4 | 2 +- .../issue1653-complex-bmv2-frontend.p4 | 2 +- .../issue1653-complex-bmv2-midend.p4 | 2 +- .../issue1653-complex-bmv2.p4 | 2 +- .../issue1660-bmv2-first.p4 | 2 +- .../issue1660-bmv2-frontend.p4 | 2 +- .../issue1660-bmv2-midend.p4 | 2 +- .../p4_16_samples_outputs/issue1660-bmv2.p4 | 2 +- .../issue1765-1-bmv2-first.p4 | 4 ++-- .../issue1765-1-bmv2-frontend.p4 | 8 +++---- .../issue1765-1-bmv2-midend.p4 | 8 +++---- .../p4_16_samples_outputs/issue1765-1-bmv2.p4 | 4 ++-- .../issue383-bmv2-first.p4 | 2 +- .../issue383-bmv2-frontend.p4 | 2 +- .../issue383-bmv2-midend.p4 | 2 +- .../p4_16_samples_outputs/issue383-bmv2.p4 | 2 +- .../issue562-bmv2-first.p4 | 2 +- .../issue562-bmv2-frontend.p4 | 2 +- .../issue562-bmv2-midend.p4 | 2 +- .../p4_16_samples_outputs/issue562-bmv2.p4 | 2 +- .../v1model-special-ops-bmv2-first.p4 | 8 +++---- .../v1model-special-ops-bmv2-frontend.p4 | 8 +++---- .../v1model-special-ops-bmv2-midend.p4 | 8 +++---- .../v1model-special-ops-bmv2.p4 | 8 +++---- 78 files changed, 178 insertions(+), 178 deletions(-) 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 d59eff08915..a49705eff44 100644 --- a/testdata/p4_14_samples_outputs/copy_to_cpu-first.p4 +++ b/testdata/p4_14_samples_outputs/copy_to_cpu-first.p4 @@ -77,7 +77,7 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { @name(".do_copy_to_cpu") action do_copy_to_cpu() { - clone3(CloneType.I2E, 32w250, (bit<8>)FieldLists.copy_to_cpu_fields); + clone3_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.copy_to_cpu_fields); } @name(".copy_to_cpu") table copy_to_cpu { actions = { 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 e5215211933..e43209a6885 100644 --- a/testdata/p4_14_samples_outputs/copy_to_cpu-frontend.p4 +++ b/testdata/p4_14_samples_outputs/copy_to_cpu-frontend.p4 @@ -85,7 +85,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ @noWarn("unused") @name(".NoAction") action NoAction_3() { } @name(".do_copy_to_cpu") action do_copy_to_cpu() { - clone3(CloneType.I2E, 32w250, (bit<8>)FieldLists.copy_to_cpu_fields); + clone3_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.copy_to_cpu_fields); } @name(".copy_to_cpu") table copy_to_cpu_0 { actions = { 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 cfb53942711..efa4862943d 100644 --- a/testdata/p4_14_samples_outputs/copy_to_cpu-midend.p4 +++ b/testdata/p4_14_samples_outputs/copy_to_cpu-midend.p4 @@ -79,7 +79,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ @noWarn("unused") @name(".NoAction") action NoAction_3() { } @name(".do_copy_to_cpu") action do_copy_to_cpu() { - clone3(CloneType.I2E, 32w250, 8w0); + clone3_field_list(CloneType.I2E, 32w250, 8w0); } @name(".copy_to_cpu") table copy_to_cpu_0 { actions = { diff --git a/testdata/p4_14_samples_outputs/copy_to_cpu.p4 b/testdata/p4_14_samples_outputs/copy_to_cpu.p4 index 5b6400b8202..c3961e63247 100644 --- a/testdata/p4_14_samples_outputs/copy_to_cpu.p4 +++ b/testdata/p4_14_samples_outputs/copy_to_cpu.p4 @@ -75,7 +75,7 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { @name(".do_copy_to_cpu") action do_copy_to_cpu() { - clone3(CloneType.I2E, (bit<32>)32w250, (bit<8>)FieldLists.copy_to_cpu_fields); + clone3_field_list(CloneType.I2E, (bit<32>)32w250, (bit<8>)FieldLists.copy_to_cpu_fields); } @name(".copy_to_cpu") table copy_to_cpu { actions = { 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 e527108c764..858717c0648 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 @@ -65,13 +65,13 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710633; meta.mymeta.f1 = meta.mymeta.f1 + 8w23; meta.mymeta.clone_e2e_count = meta.mymeta.clone_e2e_count + 8w1; - clone3(CloneType.E2E, 32w1, (bit<8>)FieldLists.clone_e2e_FL); + clone3_field_list(CloneType.E2E, 32w1, (bit<8>)FieldLists.clone_e2e_FL); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710637; meta.mymeta.f1 = meta.mymeta.f1 + 8w19; meta.mymeta.recirculate_count = meta.mymeta.recirculate_count + 8w1; - recirculate((bit<8>)FieldLists.recirculate_FL); + recirculate_field_list((bit<8>)FieldLists.recirculate_FL); } @name("._nop") action _nop() { } @@ -229,7 +229,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710639; meta.mymeta.f1 = meta.mymeta.f1 + 8w17; meta.mymeta.resubmit_count = meta.mymeta.resubmit_count + 8w1; - resubmit((bit<8>)FieldLists.resubmit_FL); + resubmit_field_list((bit<8>)FieldLists.resubmit_FL); } @name("._nop") action _nop() { } 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 cb3a638803c..bfb3d934506 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 @@ -65,13 +65,13 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710633; meta.mymeta.f1 = meta.mymeta.f1 + 8w23; meta.mymeta.clone_e2e_count = meta.mymeta.clone_e2e_count + 8w1; - clone3(CloneType.E2E, 32w1, (bit<8>)FieldLists.clone_e2e_FL); + clone3_field_list(CloneType.E2E, 32w1, (bit<8>)FieldLists.clone_e2e_FL); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710637; meta.mymeta.f1 = meta.mymeta.f1 + 8w19; meta.mymeta.recirculate_count = meta.mymeta.recirculate_count + 8w1; - recirculate((bit<8>)FieldLists.recirculate_FL); + recirculate_field_list((bit<8>)FieldLists.recirculate_FL); } @name("._nop") action _nop() { } @@ -258,7 +258,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710639; meta.mymeta.f1 = meta.mymeta.f1 + 8w17; meta.mymeta.resubmit_count = meta.mymeta.resubmit_count + 8w1; - resubmit((bit<8>)FieldLists.resubmit_FL); + resubmit_field_list((bit<8>)FieldLists.resubmit_FL); } @name("._nop") action _nop_3() { } 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 2f2c00a69f0..b0aae15e18c 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 @@ -66,13 +66,13 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710633; meta._mymeta_f14 = meta._mymeta_f14 + 8w23; meta._mymeta_clone_e2e_count2 = meta._mymeta_clone_e2e_count2 + 8w1; - clone3(CloneType.E2E, 32w1, 8w0); + clone3_field_list(CloneType.E2E, 32w1, 8w0); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710637; meta._mymeta_f14 = meta._mymeta_f14 + 8w19; meta._mymeta_recirculate_count1 = meta._mymeta_recirculate_count1 + 8w1; - recirculate(8w1); + recirculate_field_list(8w1); } @name("._nop") action _nop() { } @@ -259,7 +259,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710639; meta._mymeta_f14 = meta._mymeta_f14 + 8w17; meta._mymeta_resubmit_count0 = meta._mymeta_resubmit_count0 + 8w1; - resubmit(8w2); + resubmit_field_list(8w2); } @name("._nop") action _nop_3() { } 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 1da21df7f6f..033e93f9c59 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 @@ -65,13 +65,13 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr - 48w23; meta.mymeta.f1 = meta.mymeta.f1 + 8w23; meta.mymeta.clone_e2e_count = meta.mymeta.clone_e2e_count + 8w1; - clone3(CloneType.E2E, (bit<32>)32w1, (bit<8>)FieldLists.clone_e2e_FL); + clone3_field_list(CloneType.E2E, (bit<32>)32w1, (bit<8>)FieldLists.clone_e2e_FL); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr - 48w19; meta.mymeta.f1 = meta.mymeta.f1 + 8w19; meta.mymeta.recirculate_count = meta.mymeta.recirculate_count + 8w1; - recirculate((bit<8>)FieldLists.recirculate_FL); + recirculate_field_list((bit<8>)FieldLists.recirculate_FL); } @name("._nop") action _nop() { } @@ -233,7 +233,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ethernet.srcAddr = hdr.ethernet.srcAddr - 48w17; meta.mymeta.f1 = meta.mymeta.f1 + 8w17; meta.mymeta.resubmit_count = meta.mymeta.resubmit_count + 8w1; - resubmit((bit<8>)FieldLists.resubmit_FL); + resubmit_field_list((bit<8>)FieldLists.resubmit_FL); } @name("._nop") action _nop() { } 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 ebcc6dc3f94..96e27435adb 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 @@ -64,13 +64,13 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710633; meta.mymeta.f1 = meta.mymeta.f1 + 8w23; meta.mymeta.clone_e2e_count = meta.mymeta.clone_e2e_count + 8w1; - clone3(CloneType.E2E, 32w1, (bit<8>)FieldLists.clone_e2e_FL); + clone3_field_list(CloneType.E2E, 32w1, (bit<8>)FieldLists.clone_e2e_FL); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710637; meta.mymeta.f1 = meta.mymeta.f1 + 8w19; meta.mymeta.recirculate_count = meta.mymeta.recirculate_count + 8w1; - recirculate((bit<8>)FieldLists.recirculate_FL); + recirculate_field_list((bit<8>)FieldLists.recirculate_FL); } @name("._nop") action _nop() { } @@ -241,7 +241,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710639; meta.mymeta.f1 = meta.mymeta.f1 + 8w17; meta.mymeta.resubmit_count = meta.mymeta.resubmit_count + 8w1; - resubmit((bit<8>)FieldLists.resubmit_FL); + resubmit_field_list((bit<8>)FieldLists.resubmit_FL); } @name("._nop") action _nop() { } 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 1fb52873429..3c66b896291 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 @@ -64,13 +64,13 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710633; meta.mymeta.f1 = meta.mymeta.f1 + 8w23; meta.mymeta.clone_e2e_count = meta.mymeta.clone_e2e_count + 8w1; - clone3(CloneType.E2E, 32w1, (bit<8>)FieldLists.clone_e2e_FL); + clone3_field_list(CloneType.E2E, 32w1, (bit<8>)FieldLists.clone_e2e_FL); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710637; meta.mymeta.f1 = meta.mymeta.f1 + 8w19; meta.mymeta.recirculate_count = meta.mymeta.recirculate_count + 8w1; - recirculate((bit<8>)FieldLists.recirculate_FL); + recirculate_field_list((bit<8>)FieldLists.recirculate_FL); } @name("._nop") action _nop() { } @@ -270,7 +270,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710639; meta.mymeta.f1 = meta.mymeta.f1 + 8w17; meta.mymeta.resubmit_count = meta.mymeta.resubmit_count + 8w1; - resubmit((bit<8>)FieldLists.resubmit_FL); + resubmit_field_list((bit<8>)FieldLists.resubmit_FL); } @name("._nop") action _nop_3() { } 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 f867a5fa699..28dc270b23b 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 @@ -64,13 +64,13 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710633; meta._mymeta_f14 = meta._mymeta_f14 + 8w23; meta._mymeta_clone_e2e_count2 = meta._mymeta_clone_e2e_count2 + 8w1; - clone3(CloneType.E2E, 32w1, 8w0); + clone3_field_list(CloneType.E2E, 32w1, 8w0); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710637; meta._mymeta_f14 = meta._mymeta_f14 + 8w19; meta._mymeta_recirculate_count1 = meta._mymeta_recirculate_count1 + 8w1; - recirculate(8w1); + recirculate_field_list(8w1); } @name("._nop") action _nop() { } @@ -270,7 +270,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710639; meta._mymeta_f14 = meta._mymeta_f14 + 8w17; meta._mymeta_resubmit_count0 = meta._mymeta_resubmit_count0 + 8w1; - resubmit(8w2); + resubmit_field_list(8w2); } @name("._nop") action _nop_3() { } 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 2d3697b7c4e..a3d585c61cb 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 @@ -64,13 +64,13 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr - 48w23; meta.mymeta.f1 = meta.mymeta.f1 + 8w23; meta.mymeta.clone_e2e_count = meta.mymeta.clone_e2e_count + 8w1; - clone3(CloneType.E2E, (bit<32>)32w1, (bit<8>)FieldLists.clone_e2e_FL); + clone3_field_list(CloneType.E2E, (bit<32>)32w1, (bit<8>)FieldLists.clone_e2e_FL); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr - 48w19; meta.mymeta.f1 = meta.mymeta.f1 + 8w19; meta.mymeta.recirculate_count = meta.mymeta.recirculate_count + 8w1; - recirculate((bit<8>)FieldLists.recirculate_FL); + recirculate_field_list((bit<8>)FieldLists.recirculate_FL); } @name("._nop") action _nop() { } @@ -245,7 +245,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ethernet.srcAddr = hdr.ethernet.srcAddr - 48w17; meta.mymeta.f1 = meta.mymeta.f1 + 8w17; meta.mymeta.resubmit_count = meta.mymeta.resubmit_count + 8w1; - resubmit((bit<8>)FieldLists.resubmit_FL); + resubmit_field_list((bit<8>)FieldLists.resubmit_FL); } @name("._nop") action _nop() { } 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 198aebc55be..4ee243d5eb7 100644 --- a/testdata/p4_14_samples_outputs/p414-special-ops-first.p4 +++ b/testdata/p4_14_samples_outputs/p414-special-ops-first.p4 @@ -64,13 +64,13 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710633; meta.mymeta.f1 = meta.mymeta.f1 + 8w23; meta.mymeta.clone_e2e_count = meta.mymeta.clone_e2e_count + 8w1; - clone3(CloneType.E2E, 32w1, (bit<8>)FieldLists.clone_e2e_FL); + clone3_field_list(CloneType.E2E, 32w1, (bit<8>)FieldLists.clone_e2e_FL); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710637; meta.mymeta.f1 = meta.mymeta.f1 + 8w19; meta.mymeta.recirculate_count = meta.mymeta.recirculate_count + 8w1; - recirculate((bit<8>)FieldLists.recirculate_FL); + recirculate_field_list((bit<8>)FieldLists.recirculate_FL); } @name("._nop") action _nop() { } @@ -228,7 +228,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710639; meta.mymeta.f1 = meta.mymeta.f1 + 8w17; meta.mymeta.resubmit_count = meta.mymeta.resubmit_count + 8w1; - resubmit((bit<8>)FieldLists.resubmit_FL); + resubmit_field_list((bit<8>)FieldLists.resubmit_FL); } @name("._nop") action _nop() { } 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 d52f4609bfb..663f89616f8 100644 --- a/testdata/p4_14_samples_outputs/p414-special-ops-frontend.p4 +++ b/testdata/p4_14_samples_outputs/p414-special-ops-frontend.p4 @@ -64,13 +64,13 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710633; meta.mymeta.f1 = meta.mymeta.f1 + 8w23; meta.mymeta.clone_e2e_count = meta.mymeta.clone_e2e_count + 8w1; - clone3(CloneType.E2E, 32w1, (bit<8>)FieldLists.clone_e2e_FL); + clone3_field_list(CloneType.E2E, 32w1, (bit<8>)FieldLists.clone_e2e_FL); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710637; meta.mymeta.f1 = meta.mymeta.f1 + 8w19; meta.mymeta.recirculate_count = meta.mymeta.recirculate_count + 8w1; - recirculate((bit<8>)FieldLists.recirculate_FL); + recirculate_field_list((bit<8>)FieldLists.recirculate_FL); } @name("._nop") action _nop() { } @@ -257,7 +257,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710639; meta.mymeta.f1 = meta.mymeta.f1 + 8w17; meta.mymeta.resubmit_count = meta.mymeta.resubmit_count + 8w1; - resubmit((bit<8>)FieldLists.resubmit_FL); + resubmit_field_list((bit<8>)FieldLists.resubmit_FL); } @name("._nop") action _nop_3() { } 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 1fd5132e91d..f1cb7693de9 100644 --- a/testdata/p4_14_samples_outputs/p414-special-ops-midend.p4 +++ b/testdata/p4_14_samples_outputs/p414-special-ops-midend.p4 @@ -64,13 +64,13 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710633; meta._mymeta_f14 = meta._mymeta_f14 + 8w23; meta._mymeta_clone_e2e_count2 = meta._mymeta_clone_e2e_count2 + 8w1; - clone3(CloneType.E2E, 32w1, 8w0); + clone3_field_list(CloneType.E2E, 32w1, 8w0); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710637; meta._mymeta_f14 = meta._mymeta_f14 + 8w19; meta._mymeta_recirculate_count1 = meta._mymeta_recirculate_count1 + 8w1; - recirculate(8w1); + recirculate_field_list(8w1); } @name("._nop") action _nop() { } @@ -257,7 +257,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710639; meta._mymeta_f14 = meta._mymeta_f14 + 8w17; meta._mymeta_resubmit_count0 = meta._mymeta_resubmit_count0 + 8w1; - resubmit(8w2); + resubmit_field_list(8w2); } @name("._nop") action _nop_3() { } diff --git a/testdata/p4_14_samples_outputs/p414-special-ops.p4 b/testdata/p4_14_samples_outputs/p414-special-ops.p4 index 7c92e274d44..9dbc32438b4 100644 --- a/testdata/p4_14_samples_outputs/p414-special-ops.p4 +++ b/testdata/p4_14_samples_outputs/p414-special-ops.p4 @@ -64,13 +64,13 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr - 48w23; meta.mymeta.f1 = meta.mymeta.f1 + 8w23; meta.mymeta.clone_e2e_count = meta.mymeta.clone_e2e_count + 8w1; - clone3(CloneType.E2E, (bit<32>)32w1, (bit<8>)FieldLists.clone_e2e_FL); + clone3_field_list(CloneType.E2E, (bit<32>)32w1, (bit<8>)FieldLists.clone_e2e_FL); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr - 48w19; meta.mymeta.f1 = meta.mymeta.f1 + 8w19; meta.mymeta.recirculate_count = meta.mymeta.recirculate_count + 8w1; - recirculate((bit<8>)FieldLists.recirculate_FL); + recirculate_field_list((bit<8>)FieldLists.recirculate_FL); } @name("._nop") action _nop() { } @@ -232,7 +232,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ethernet.srcAddr = hdr.ethernet.srcAddr - 48w17; meta.mymeta.f1 = meta.mymeta.f1 + 8w17; meta.mymeta.resubmit_count = meta.mymeta.resubmit_count + 8w1; - resubmit((bit<8>)FieldLists.resubmit_FL); + resubmit_field_list((bit<8>)FieldLists.resubmit_FL); } @name("._nop") action _nop() { } diff --git a/testdata/p4_14_samples_outputs/packet_redirect-first.p4 b/testdata/p4_14_samples_outputs/packet_redirect-first.p4 index 67b084243d7..4b56c7e287e 100644 --- a/testdata/p4_14_samples_outputs/packet_redirect-first.p4 +++ b/testdata/p4_14_samples_outputs/packet_redirect-first.p4 @@ -52,10 +52,10 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t @name("._nop") action _nop() { } @name("._recirculate") action _recirculate() { - recirculate((bit<8>)FieldLists.redirect_FL); + recirculate_field_list((bit<8>)FieldLists.redirect_FL); } @name("._clone_e2e") action _clone_e2e(bit<32> mirror_id) { - clone3(CloneType.E2E, mirror_id, (bit<8>)FieldLists.redirect_FL); + clone3_field_list(CloneType.E2E, mirror_id, (bit<8>)FieldLists.redirect_FL); } @name(".t_egress") table t_egress { actions = { @@ -87,10 +87,10 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ standard_metadata.mcast_grp = mgrp; } @name("._resubmit") action _resubmit() { - resubmit((bit<8>)FieldLists.redirect_FL); + resubmit_field_list((bit<8>)FieldLists.redirect_FL); } @name("._clone_i2e") action _clone_i2e(bit<32> mirror_id) { - clone3(CloneType.I2E, mirror_id, (bit<8>)FieldLists.redirect_FL); + clone3_field_list(CloneType.I2E, mirror_id, (bit<8>)FieldLists.redirect_FL); } @name(".t_ingress_1") table t_ingress_1 { actions = { diff --git a/testdata/p4_14_samples_outputs/packet_redirect-frontend.p4 b/testdata/p4_14_samples_outputs/packet_redirect-frontend.p4 index af0ecd65476..0894be49d76 100644 --- a/testdata/p4_14_samples_outputs/packet_redirect-frontend.p4 +++ b/testdata/p4_14_samples_outputs/packet_redirect-frontend.p4 @@ -54,10 +54,10 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t @name("._nop") action _nop() { } @name("._recirculate") action _recirculate() { - recirculate((bit<8>)FieldLists.redirect_FL); + recirculate_field_list((bit<8>)FieldLists.redirect_FL); } @name("._clone_e2e") action _clone_e2e(@name("mirror_id") bit<32> mirror_id) { - clone3(CloneType.E2E, mirror_id, (bit<8>)FieldLists.redirect_FL); + clone3_field_list(CloneType.E2E, mirror_id, (bit<8>)FieldLists.redirect_FL); } @name(".t_egress") table t_egress_0 { actions = { @@ -95,10 +95,10 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ standard_metadata.mcast_grp = mgrp; } @name("._resubmit") action _resubmit() { - resubmit((bit<8>)FieldLists.redirect_FL); + resubmit_field_list((bit<8>)FieldLists.redirect_FL); } @name("._clone_i2e") action _clone_i2e(@name("mirror_id") bit<32> mirror_id_2) { - clone3(CloneType.I2E, mirror_id_2, (bit<8>)FieldLists.redirect_FL); + clone3_field_list(CloneType.I2E, mirror_id_2, (bit<8>)FieldLists.redirect_FL); } @name(".t_ingress_1") table t_ingress { actions = { diff --git a/testdata/p4_14_samples_outputs/packet_redirect-midend.p4 b/testdata/p4_14_samples_outputs/packet_redirect-midend.p4 index e4ca5e8bb72..799237483e5 100644 --- a/testdata/p4_14_samples_outputs/packet_redirect-midend.p4 +++ b/testdata/p4_14_samples_outputs/packet_redirect-midend.p4 @@ -52,10 +52,10 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t @name("._nop") action _nop() { } @name("._recirculate") action _recirculate() { - recirculate(8w0); + recirculate_field_list(8w0); } @name("._clone_e2e") action _clone_e2e(@name("mirror_id") bit<32> mirror_id) { - clone3(CloneType.E2E, mirror_id, 8w0); + clone3_field_list(CloneType.E2E, mirror_id, 8w0); } @name(".t_egress") table t_egress_0 { actions = { @@ -93,10 +93,10 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ standard_metadata.mcast_grp = mgrp; } @name("._resubmit") action _resubmit() { - resubmit(8w0); + resubmit_field_list(8w0); } @name("._clone_i2e") action _clone_i2e(@name("mirror_id") bit<32> mirror_id_2) { - clone3(CloneType.I2E, mirror_id_2, 8w0); + clone3_field_list(CloneType.I2E, mirror_id_2, 8w0); } @name(".t_ingress_1") table t_ingress { actions = { diff --git a/testdata/p4_14_samples_outputs/packet_redirect.p4 b/testdata/p4_14_samples_outputs/packet_redirect.p4 index ca89db60689..b88f88445c0 100644 --- a/testdata/p4_14_samples_outputs/packet_redirect.p4 +++ b/testdata/p4_14_samples_outputs/packet_redirect.p4 @@ -52,10 +52,10 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t @name("._nop") action _nop() { } @name("._recirculate") action _recirculate() { - recirculate((bit<8>)FieldLists.redirect_FL); + recirculate_field_list((bit<8>)FieldLists.redirect_FL); } @name("._clone_e2e") action _clone_e2e(bit<32> mirror_id) { - clone3(CloneType.E2E, (bit<32>)mirror_id, (bit<8>)FieldLists.redirect_FL); + clone3_field_list(CloneType.E2E, (bit<32>)mirror_id, (bit<8>)FieldLists.redirect_FL); } @name(".t_egress") table t_egress { actions = { @@ -85,10 +85,10 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ standard_metadata.mcast_grp = mgrp; } @name("._resubmit") action _resubmit() { - resubmit((bit<8>)FieldLists.redirect_FL); + resubmit_field_list((bit<8>)FieldLists.redirect_FL); } @name("._clone_i2e") action _clone_i2e(bit<32> mirror_id) { - clone3(CloneType.I2E, (bit<32>)mirror_id, (bit<8>)FieldLists.redirect_FL); + clone3_field_list(CloneType.I2E, (bit<32>)mirror_id, (bit<8>)FieldLists.redirect_FL); } @name(".t_ingress_1") table t_ingress_1 { actions = { diff --git a/testdata/p4_14_samples_outputs/resubmit-first.p4 b/testdata/p4_14_samples_outputs/resubmit-first.p4 index ce77f9d140f..6d9edc96fdf 100644 --- a/testdata/p4_14_samples_outputs/resubmit-first.p4 +++ b/testdata/p4_14_samples_outputs/resubmit-first.p4 @@ -55,7 +55,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ } @name("._resubmit") action _resubmit() { meta.mymeta.f1 = 8w1; - resubmit((bit<8>)FieldLists.resubmit_FL); + resubmit_field_list((bit<8>)FieldLists.resubmit_FL); } @name(".t_ingress_1") table t_ingress_1 { actions = { diff --git a/testdata/p4_14_samples_outputs/resubmit-frontend.p4 b/testdata/p4_14_samples_outputs/resubmit-frontend.p4 index e9bd8322b62..37f4fe0adea 100644 --- a/testdata/p4_14_samples_outputs/resubmit-frontend.p4 +++ b/testdata/p4_14_samples_outputs/resubmit-frontend.p4 @@ -61,7 +61,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ } @name("._resubmit") action _resubmit() { meta.mymeta.f1 = 8w1; - resubmit((bit<8>)FieldLists.resubmit_FL); + resubmit_field_list((bit<8>)FieldLists.resubmit_FL); } @name(".t_ingress_1") table t_ingress { actions = { diff --git a/testdata/p4_14_samples_outputs/resubmit-midend.p4 b/testdata/p4_14_samples_outputs/resubmit-midend.p4 index 3a9fb2a7e19..50f5806255c 100644 --- a/testdata/p4_14_samples_outputs/resubmit-midend.p4 +++ b/testdata/p4_14_samples_outputs/resubmit-midend.p4 @@ -57,7 +57,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ } @name("._resubmit") action _resubmit() { meta._mymeta_f10 = 8w1; - resubmit(8w0); + resubmit_field_list(8w0); } @name(".t_ingress_1") table t_ingress { actions = { diff --git a/testdata/p4_14_samples_outputs/resubmit.p4 b/testdata/p4_14_samples_outputs/resubmit.p4 index e7622356f45..eeb35562fe0 100644 --- a/testdata/p4_14_samples_outputs/resubmit.p4 +++ b/testdata/p4_14_samples_outputs/resubmit.p4 @@ -55,7 +55,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ } @name("._resubmit") action _resubmit() { meta.mymeta.f1 = 8w1; - resubmit((bit<8>)FieldLists.resubmit_FL); + resubmit_field_list((bit<8>)FieldLists.resubmit_FL); } @name(".t_ingress_1") table t_ingress_1 { actions = { diff --git a/testdata/p4_14_samples_outputs/simple_nat-first.p4 b/testdata/p4_14_samples_outputs/simple_nat-first.p4 index afdfd91c6ca..3f63f98876c 100644 --- a/testdata/p4_14_samples_outputs/simple_nat-first.p4 +++ b/testdata/p4_14_samples_outputs/simple_nat-first.p4 @@ -185,7 +185,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ipv4.ttl = hdr.ipv4.ttl + 8w255; } @name(".nat_miss_int_to_ext") action nat_miss_int_to_ext() { - clone3(CloneType.I2E, 32w250, (bit<8>)FieldLists.copy_to_cpu_fields); + clone3_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.copy_to_cpu_fields); } @name(".nat_miss_ext_to_int") action nat_miss_ext_to_int() { meta.meta.do_forward = 1w0; diff --git a/testdata/p4_14_samples_outputs/simple_nat-frontend.p4 b/testdata/p4_14_samples_outputs/simple_nat-frontend.p4 index 9c5e0b97350..43648a591b5 100644 --- a/testdata/p4_14_samples_outputs/simple_nat-frontend.p4 +++ b/testdata/p4_14_samples_outputs/simple_nat-frontend.p4 @@ -210,7 +210,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ipv4.ttl = hdr.ipv4.ttl + 8w255; } @name(".nat_miss_int_to_ext") action nat_miss_int_to_ext() { - clone3(CloneType.I2E, 32w250, (bit<8>)FieldLists.copy_to_cpu_fields); + clone3_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.copy_to_cpu_fields); } @name(".nat_miss_ext_to_int") action nat_miss_ext_to_int() { meta.meta.do_forward = 1w0; diff --git a/testdata/p4_14_samples_outputs/simple_nat-midend.p4 b/testdata/p4_14_samples_outputs/simple_nat-midend.p4 index 0a42ecb1e19..8570463384d 100644 --- a/testdata/p4_14_samples_outputs/simple_nat-midend.p4 +++ b/testdata/p4_14_samples_outputs/simple_nat-midend.p4 @@ -213,7 +213,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ipv4.ttl = hdr.ipv4.ttl + 8w255; } @name(".nat_miss_int_to_ext") action nat_miss_int_to_ext() { - clone3(CloneType.I2E, 32w250, 8w0); + clone3_field_list(CloneType.I2E, 32w250, 8w0); } @name(".nat_miss_ext_to_int") action nat_miss_ext_to_int() { meta._meta_do_forward0 = 1w0; diff --git a/testdata/p4_14_samples_outputs/simple_nat.p4 b/testdata/p4_14_samples_outputs/simple_nat.p4 index d09a482502a..28eef2179ff 100644 --- a/testdata/p4_14_samples_outputs/simple_nat.p4 +++ b/testdata/p4_14_samples_outputs/simple_nat.p4 @@ -181,7 +181,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ipv4.ttl = hdr.ipv4.ttl - 8w1; } @name(".nat_miss_int_to_ext") action nat_miss_int_to_ext() { - clone3(CloneType.I2E, (bit<32>)32w250, (bit<8>)FieldLists.copy_to_cpu_fields); + clone3_field_list(CloneType.I2E, (bit<32>)32w250, (bit<8>)FieldLists.copy_to_cpu_fields); } @name(".nat_miss_ext_to_int") action nat_miss_ext_to_int() { meta.meta.do_forward = 1w0; 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 4ff7243c687..06893d8514e 100644 --- a/testdata/p4_14_samples_outputs/switch_20160512/switch-first.p4 +++ b/testdata/p4_14_samples_outputs/switch_20160512/switch-first.p4 @@ -2978,7 +2978,7 @@ control process_egress_acl(inout headers hdr, inout metadata meta, inout standar } @name(".egress_mirror") action egress_mirror(bit<32> session_id) { meta.i2e_metadata.mirror_session_id = (bit<16>)session_id; - clone3(CloneType.E2E, session_id, (bit<8>)FieldLists.e2e_mirror_info); + clone3_field_list(CloneType.E2E, session_id, (bit<8>)FieldLists.e2e_mirror_info); } @name(".egress_mirror_drop") action egress_mirror_drop(bit<32> session_id) { egress_mirror(session_id); @@ -2986,7 +2986,7 @@ control process_egress_acl(inout headers hdr, inout metadata meta, inout standar } @name(".egress_copy_to_cpu") action egress_copy_to_cpu(bit<16> reason_code) { meta.fabric_metadata.reason_code = reason_code; - clone3(CloneType.E2E, 32w250, (bit<8>)FieldLists.cpu_info); + clone3_field_list(CloneType.E2E, 32w250, (bit<8>)FieldLists.cpu_info); } @name(".egress_redirect_to_cpu") action egress_redirect_to_cpu(bit<16> reason_code) { egress_copy_to_cpu(reason_code); @@ -3510,7 +3510,7 @@ control process_int_endpoint(inout headers hdr, inout metadata meta, inout stand @name(".int_sink") action int_sink(bit<32> mirror_id) { meta.int_metadata_i2e.sink = 1w1; meta.i2e_metadata.mirror_session_id = (bit<16>)mirror_id; - clone3(CloneType.I2E, mirror_id, (bit<8>)FieldLists.int_i2e_mirror_info); + clone3_field_list(CloneType.I2E, mirror_id, (bit<8>)FieldLists.int_i2e_mirror_info); hdr.int_header.setInvalid(); hdr.int_val[0].setInvalid(); hdr.int_val[1].setInvalid(); @@ -4301,7 +4301,7 @@ control process_ingress_sflow(inout headers hdr, inout metadata meta, inout stan @name(".sflow_ing_pkt_to_cpu") action sflow_ing_pkt_to_cpu(bit<32> sflow_i2e_mirror_id, bit<16> reason_code) { meta.fabric_metadata.reason_code = reason_code; meta.i2e_metadata.mirror_session_id = (bit<16>)sflow_i2e_mirror_id; - clone3(CloneType.I2E, sflow_i2e_mirror_id, (bit<8>)FieldLists.sflow_cpu_info); + clone3_field_list(CloneType.I2E, sflow_i2e_mirror_id, (bit<8>)FieldLists.sflow_cpu_info); } @name(".sflow_ing_session_enable") action sflow_ing_session_enable(bit<32> rate_thr, bit<16> session_id) { meta.ingress_metadata.sflow_take_sample = rate_thr |+| meta.ingress_metadata.sflow_take_sample; @@ -4314,7 +4314,7 @@ control process_ingress_sflow(inout headers hdr, inout metadata meta, inout stan sflow_ingress_session_pkt_counter.count(); meta.fabric_metadata.reason_code = reason_code; meta.i2e_metadata.mirror_session_id = (bit<16>)sflow_i2e_mirror_id; - clone3(CloneType.I2E, sflow_i2e_mirror_id, (bit<8>)FieldLists.sflow_cpu_info); + clone3_field_list(CloneType.I2E, sflow_i2e_mirror_id, (bit<8>)FieldLists.sflow_cpu_info); } @name(".sflow_ing_take_sample") table sflow_ing_take_sample { actions = { @@ -4532,7 +4532,7 @@ control process_mac_acl(inout headers hdr, inout metadata meta, inout standard_m @name(".acl_mirror") action acl_mirror(bit<32> session_id, bit<14> acl_stats_index, bit<16> acl_meter_index) { meta.i2e_metadata.mirror_session_id = (bit<16>)session_id; meta.i2e_metadata.ingress_tstamp = (bit<32>)standard_metadata.ingress_global_timestamp; - clone3(CloneType.I2E, session_id, (bit<8>)FieldLists.i2e_mirror_info); + clone3_field_list(CloneType.I2E, session_id, (bit<8>)FieldLists.i2e_mirror_info); meta.acl_metadata.acl_stats_index = acl_stats_index; meta.meter_metadata.meter_index = acl_meter_index; } @@ -4600,7 +4600,7 @@ control process_ip_acl(inout headers hdr, inout metadata meta, inout standard_me @name(".acl_mirror") action acl_mirror(bit<32> session_id, bit<14> acl_stats_index, bit<16> acl_meter_index) { meta.i2e_metadata.mirror_session_id = (bit<16>)session_id; meta.i2e_metadata.ingress_tstamp = (bit<32>)standard_metadata.ingress_global_timestamp; - clone3(CloneType.I2E, session_id, (bit<8>)FieldLists.i2e_mirror_info); + clone3_field_list(CloneType.I2E, session_id, (bit<8>)FieldLists.i2e_mirror_info); meta.acl_metadata.acl_stats_index = acl_stats_index; meta.meter_metadata.meter_index = acl_meter_index; } @@ -5851,7 +5851,7 @@ control process_system_acl(inout headers hdr, inout metadata meta, inout standar } @name(".copy_to_cpu_with_reason") action copy_to_cpu_with_reason(bit<16> reason_code) { meta.fabric_metadata.reason_code = reason_code; - clone3(CloneType.I2E, 32w250, (bit<8>)FieldLists.cpu_info); + clone3_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.cpu_info); } @name(".redirect_to_cpu") action redirect_to_cpu(bit<16> reason_code) { copy_to_cpu_with_reason(reason_code); @@ -5859,7 +5859,7 @@ control process_system_acl(inout headers hdr, inout metadata meta, inout standar meta.fabric_metadata.dst_device = 8w0; } @name(".copy_to_cpu") action copy_to_cpu() { - clone3(CloneType.I2E, 32w250, (bit<8>)FieldLists.cpu_info); + clone3_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.cpu_info); } @name(".drop_packet") action drop_packet() { mark_to_drop(standard_metadata); @@ -5869,7 +5869,7 @@ control process_system_acl(inout headers hdr, inout metadata meta, inout standar mark_to_drop(standard_metadata); } @name(".negative_mirror") action negative_mirror(bit<32> session_id) { - clone3(CloneType.I2E, session_id, (bit<8>)FieldLists.mirror_info); + clone3_field_list(CloneType.I2E, session_id, (bit<8>)FieldLists.mirror_info); mark_to_drop(standard_metadata); } @name(".drop_stats") table drop_stats_0 { 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 cae003c4bec..4a51eaea924 100644 --- a/testdata/p4_14_samples_outputs/switch_20160512/switch-frontend.p4 +++ b/testdata/p4_14_samples_outputs/switch_20160512/switch-frontend.p4 @@ -3045,16 +3045,16 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t } @name(".egress_mirror") action _egress_mirror_0(@name("session_id") bit<32> session_id) { meta.i2e_metadata.mirror_session_id = (bit<16>)session_id; - clone3(CloneType.E2E, session_id, (bit<8>)FieldLists.e2e_mirror_info); + clone3_field_list(CloneType.E2E, session_id, (bit<8>)FieldLists.e2e_mirror_info); } @name(".egress_mirror_drop") action _egress_mirror_drop_0(@name("session_id") bit<32> session_id_6) { meta.i2e_metadata.mirror_session_id = (bit<16>)session_id_6; - clone3(CloneType.E2E, session_id_6, (bit<8>)FieldLists.e2e_mirror_info); + clone3_field_list(CloneType.E2E, session_id_6, (bit<8>)FieldLists.e2e_mirror_info); mark_to_drop(standard_metadata); } @name(".egress_redirect_to_cpu") action _egress_redirect_to_cpu_0(@name("reason_code") bit<16> reason_code_0) { meta.fabric_metadata.reason_code = reason_code_0; - clone3(CloneType.E2E, 32w250, (bit<8>)FieldLists.cpu_info); + clone3_field_list(CloneType.E2E, 32w250, (bit<8>)FieldLists.cpu_info); mark_to_drop(standard_metadata); } @name(".egress_acl") table _egress_acl { @@ -3654,7 +3654,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ meta.int_metadata.insert_byte_cnt = meta.int_metadata.gpe_int_hdr_len << 2; meta.int_metadata_i2e.sink = 1w1; meta.i2e_metadata.mirror_session_id = (bit<16>)mirror_id; - clone3(CloneType.I2E, mirror_id, (bit<8>)FieldLists.int_i2e_mirror_info); + clone3_field_list(CloneType.I2E, mirror_id, (bit<8>)FieldLists.int_i2e_mirror_info); hdr.int_header.setInvalid(); hdr.int_val[0].setInvalid(); hdr.int_val[1].setInvalid(); @@ -4344,7 +4344,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ _sflow_ingress_session_pkt_counter.count(); meta.fabric_metadata.reason_code = reason_code_5; meta.i2e_metadata.mirror_session_id = (bit<16>)sflow_i2e_mirror_id; - clone3(CloneType.I2E, sflow_i2e_mirror_id, (bit<8>)FieldLists.sflow_cpu_info); + clone3_field_list(CloneType.I2E, sflow_i2e_mirror_id, (bit<8>)FieldLists.sflow_cpu_info); } @name(".sflow_ing_take_sample") table _sflow_ing_take_sample { actions = { @@ -4528,7 +4528,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ @name(".acl_mirror") action _acl_mirror_1(@name("session_id") bit<32> session_id_8, @name("acl_stats_index") bit<14> acl_stats_index_20, @name("acl_meter_index") bit<16> acl_meter_index_11) { meta.i2e_metadata.mirror_session_id = (bit<16>)session_id_8; meta.i2e_metadata.ingress_tstamp = (bit<32>)standard_metadata.ingress_global_timestamp; - clone3(CloneType.I2E, session_id_8, (bit<8>)FieldLists.i2e_mirror_info); + clone3_field_list(CloneType.I2E, session_id_8, (bit<8>)FieldLists.i2e_mirror_info); meta.acl_metadata.acl_stats_index = acl_stats_index_20; meta.meter_metadata.meter_index = acl_meter_index_11; } @@ -4603,14 +4603,14 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ @name(".acl_mirror") action _acl_mirror_2(@name("session_id") bit<32> session_id_9, @name("acl_stats_index") bit<14> acl_stats_index_27, @name("acl_meter_index") bit<16> acl_meter_index_18) { meta.i2e_metadata.mirror_session_id = (bit<16>)session_id_9; meta.i2e_metadata.ingress_tstamp = (bit<32>)standard_metadata.ingress_global_timestamp; - clone3(CloneType.I2E, session_id_9, (bit<8>)FieldLists.i2e_mirror_info); + clone3_field_list(CloneType.I2E, session_id_9, (bit<8>)FieldLists.i2e_mirror_info); meta.acl_metadata.acl_stats_index = acl_stats_index_27; meta.meter_metadata.meter_index = acl_meter_index_18; } @name(".acl_mirror") action _acl_mirror_3(@name("session_id") bit<32> session_id_10, @name("acl_stats_index") bit<14> acl_stats_index_28, @name("acl_meter_index") bit<16> acl_meter_index_19) { meta.i2e_metadata.mirror_session_id = (bit<16>)session_id_10; meta.i2e_metadata.ingress_tstamp = (bit<32>)standard_metadata.ingress_global_timestamp; - clone3(CloneType.I2E, session_id_10, (bit<8>)FieldLists.i2e_mirror_info); + clone3_field_list(CloneType.I2E, session_id_10, (bit<8>)FieldLists.i2e_mirror_info); meta.acl_metadata.acl_stats_index = acl_stats_index_28; meta.meter_metadata.meter_index = acl_meter_index_19; } @@ -5604,16 +5604,16 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ } @name(".copy_to_cpu_with_reason") action _copy_to_cpu_with_reason_0(@name("reason_code") bit<16> reason_code_6) { meta.fabric_metadata.reason_code = reason_code_6; - clone3(CloneType.I2E, 32w250, (bit<8>)FieldLists.cpu_info); + clone3_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.cpu_info); } @name(".redirect_to_cpu") action _redirect_to_cpu_0(@name("reason_code") bit<16> reason_code_7) { meta.fabric_metadata.reason_code = reason_code_7; - clone3(CloneType.I2E, 32w250, (bit<8>)FieldLists.cpu_info); + clone3_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.cpu_info); mark_to_drop(standard_metadata); meta.fabric_metadata.dst_device = 8w0; } @name(".copy_to_cpu") action _copy_to_cpu_0() { - clone3(CloneType.I2E, 32w250, (bit<8>)FieldLists.cpu_info); + clone3_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.cpu_info); } @name(".drop_packet") action _drop_packet_0() { mark_to_drop(standard_metadata); @@ -5623,7 +5623,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ mark_to_drop(standard_metadata); } @name(".negative_mirror") action _negative_mirror_0(@name("session_id") bit<32> session_id_11) { - clone3(CloneType.I2E, session_id_11, (bit<8>)FieldLists.mirror_info); + clone3_field_list(CloneType.I2E, session_id_11, (bit<8>)FieldLists.mirror_info); mark_to_drop(standard_metadata); } @name(".drop_stats") table _drop_stats { 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 e1d032332cb..c1a20cd08ba 100644 --- a/testdata/p4_14_samples_outputs/switch_20160512/switch-midend.p4 +++ b/testdata/p4_14_samples_outputs/switch_20160512/switch-midend.p4 @@ -3149,16 +3149,16 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t } @name(".egress_mirror") action _egress_mirror_0(@name("session_id") bit<32> session_id) { meta._i2e_metadata_mirror_session_id36 = (bit<16>)session_id; - clone3(CloneType.E2E, session_id, 8w2); + clone3_field_list(CloneType.E2E, session_id, 8w2); } @name(".egress_mirror_drop") action _egress_mirror_drop_0(@name("session_id") bit<32> session_id_6) { meta._i2e_metadata_mirror_session_id36 = (bit<16>)session_id_6; - clone3(CloneType.E2E, session_id_6, 8w2); + clone3_field_list(CloneType.E2E, session_id_6, 8w2); mark_to_drop(standard_metadata); } @name(".egress_redirect_to_cpu") action _egress_redirect_to_cpu_0(@name("reason_code") bit<16> reason_code_0) { meta._fabric_metadata_reason_code28 = reason_code_0; - clone3(CloneType.E2E, 32w250, 8w1); + clone3_field_list(CloneType.E2E, 32w250, 8w1); mark_to_drop(standard_metadata); } @name(".egress_acl") table _egress_acl { @@ -3801,7 +3801,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ meta._int_metadata_insert_byte_cnt50 = meta._int_metadata_gpe_int_hdr_len51 << 2; meta._int_metadata_i2e_sink54 = 1w1; meta._i2e_metadata_mirror_session_id36 = (bit<16>)mirror_id; - clone3(CloneType.I2E, mirror_id, 8w3); + clone3_field_list(CloneType.I2E, mirror_id, 8w3); hdr.int_header.setInvalid(); hdr.int_val[0].setInvalid(); hdr.int_val[1].setInvalid(); @@ -4491,7 +4491,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ _sflow_ingress_session_pkt_counter.count(); meta._fabric_metadata_reason_code28 = reason_code_5; meta._i2e_metadata_mirror_session_id36 = (bit<16>)sflow_i2e_mirror_id; - clone3(CloneType.I2E, sflow_i2e_mirror_id, 8w5); + clone3_field_list(CloneType.I2E, sflow_i2e_mirror_id, 8w5); } @name(".sflow_ing_take_sample") table _sflow_ing_take_sample { actions = { @@ -4675,7 +4675,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ @name(".acl_mirror") action _acl_mirror_1(@name("session_id") bit<32> session_id_8, @name("acl_stats_index") bit<14> acl_stats_index_20, @name("acl_meter_index") bit<16> acl_meter_index_11) { meta._i2e_metadata_mirror_session_id36 = (bit<16>)session_id_8; meta._i2e_metadata_ingress_tstamp35 = (bit<32>)standard_metadata.ingress_global_timestamp; - clone3(CloneType.I2E, session_id_8, 8w0); + clone3_field_list(CloneType.I2E, session_id_8, 8w0); meta._acl_metadata_acl_stats_index11 = acl_stats_index_20; meta._meter_metadata_meter_index107 = acl_meter_index_11; } @@ -4750,14 +4750,14 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ @name(".acl_mirror") action _acl_mirror_2(@name("session_id") bit<32> session_id_9, @name("acl_stats_index") bit<14> acl_stats_index_27, @name("acl_meter_index") bit<16> acl_meter_index_18) { meta._i2e_metadata_mirror_session_id36 = (bit<16>)session_id_9; meta._i2e_metadata_ingress_tstamp35 = (bit<32>)standard_metadata.ingress_global_timestamp; - clone3(CloneType.I2E, session_id_9, 8w0); + clone3_field_list(CloneType.I2E, session_id_9, 8w0); meta._acl_metadata_acl_stats_index11 = acl_stats_index_27; meta._meter_metadata_meter_index107 = acl_meter_index_18; } @name(".acl_mirror") action _acl_mirror_3(@name("session_id") bit<32> session_id_10, @name("acl_stats_index") bit<14> acl_stats_index_28, @name("acl_meter_index") bit<16> acl_meter_index_19) { meta._i2e_metadata_mirror_session_id36 = (bit<16>)session_id_10; meta._i2e_metadata_ingress_tstamp35 = (bit<32>)standard_metadata.ingress_global_timestamp; - clone3(CloneType.I2E, session_id_10, 8w0); + clone3_field_list(CloneType.I2E, session_id_10, 8w0); meta._acl_metadata_acl_stats_index11 = acl_stats_index_28; meta._meter_metadata_meter_index107 = acl_meter_index_19; } @@ -5751,16 +5751,16 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ } @name(".copy_to_cpu_with_reason") action _copy_to_cpu_with_reason_0(@name("reason_code") bit<16> reason_code_6) { meta._fabric_metadata_reason_code28 = reason_code_6; - clone3(CloneType.I2E, 32w250, 8w1); + clone3_field_list(CloneType.I2E, 32w250, 8w1); } @name(".redirect_to_cpu") action _redirect_to_cpu_0(@name("reason_code") bit<16> reason_code_7) { meta._fabric_metadata_reason_code28 = reason_code_7; - clone3(CloneType.I2E, 32w250, 8w1); + clone3_field_list(CloneType.I2E, 32w250, 8w1); mark_to_drop(standard_metadata); meta._fabric_metadata_dst_device29 = 8w0; } @name(".copy_to_cpu") action _copy_to_cpu_0() { - clone3(CloneType.I2E, 32w250, 8w1); + clone3_field_list(CloneType.I2E, 32w250, 8w1); } @name(".drop_packet") action _drop_packet_0() { mark_to_drop(standard_metadata); @@ -5770,7 +5770,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ mark_to_drop(standard_metadata); } @name(".negative_mirror") action _negative_mirror_0(@name("session_id") bit<32> session_id_11) { - clone3(CloneType.I2E, session_id_11, 8w4); + clone3_field_list(CloneType.I2E, session_id_11, 8w4); mark_to_drop(standard_metadata); } @name(".drop_stats") table _drop_stats { diff --git a/testdata/p4_14_samples_outputs/switch_20160512/switch.p4 b/testdata/p4_14_samples_outputs/switch_20160512/switch.p4 index 6d0cbdfa79b..794d3f944ac 100644 --- a/testdata/p4_14_samples_outputs/switch_20160512/switch.p4 +++ b/testdata/p4_14_samples_outputs/switch_20160512/switch.p4 @@ -2924,7 +2924,7 @@ control process_egress_acl(inout headers hdr, inout metadata meta, inout standar } @name(".egress_mirror") action egress_mirror(bit<32> session_id) { meta.i2e_metadata.mirror_session_id = (bit<16>)session_id; - clone3(CloneType.E2E, (bit<32>)session_id, (bit<8>)FieldLists.e2e_mirror_info); + clone3_field_list(CloneType.E2E, (bit<32>)session_id, (bit<8>)FieldLists.e2e_mirror_info); } @name(".egress_mirror_drop") action egress_mirror_drop(bit<32> session_id) { egress_mirror(session_id); @@ -2932,7 +2932,7 @@ control process_egress_acl(inout headers hdr, inout metadata meta, inout standar } @name(".egress_copy_to_cpu") action egress_copy_to_cpu(bit<16> reason_code) { meta.fabric_metadata.reason_code = reason_code; - clone3(CloneType.E2E, (bit<32>)32w250, (bit<8>)FieldLists.cpu_info); + clone3_field_list(CloneType.E2E, (bit<32>)32w250, (bit<8>)FieldLists.cpu_info); } @name(".egress_redirect_to_cpu") action egress_redirect_to_cpu(bit<16> reason_code) { egress_copy_to_cpu(reason_code); @@ -3428,7 +3428,7 @@ control process_int_endpoint(inout headers hdr, inout metadata meta, inout stand @name(".int_sink") action int_sink(bit<32> mirror_id) { meta.int_metadata_i2e.sink = 1w1; meta.i2e_metadata.mirror_session_id = (bit<16>)mirror_id; - clone3(CloneType.I2E, (bit<32>)mirror_id, (bit<8>)FieldLists.int_i2e_mirror_info); + clone3_field_list(CloneType.I2E, (bit<32>)mirror_id, (bit<8>)FieldLists.int_i2e_mirror_info); hdr.int_header.setInvalid(); hdr.int_val[0].setInvalid(); hdr.int_val[1].setInvalid(); @@ -4177,7 +4177,7 @@ control process_ingress_sflow(inout headers hdr, inout metadata meta, inout stan @name(".sflow_ing_pkt_to_cpu") action sflow_ing_pkt_to_cpu(bit<32> sflow_i2e_mirror_id, bit<16> reason_code) { meta.fabric_metadata.reason_code = reason_code; meta.i2e_metadata.mirror_session_id = (bit<16>)sflow_i2e_mirror_id; - clone3(CloneType.I2E, (bit<32>)sflow_i2e_mirror_id, (bit<8>)FieldLists.sflow_cpu_info); + clone3_field_list(CloneType.I2E, (bit<32>)sflow_i2e_mirror_id, (bit<8>)FieldLists.sflow_cpu_info); } @name(".sflow_ing_session_enable") action sflow_ing_session_enable(bit<32> rate_thr, bit<16> session_id) { meta.ingress_metadata.sflow_take_sample = rate_thr |+| meta.ingress_metadata.sflow_take_sample; @@ -4190,7 +4190,7 @@ control process_ingress_sflow(inout headers hdr, inout metadata meta, inout stan sflow_ingress_session_pkt_counter.count(); meta.fabric_metadata.reason_code = reason_code; meta.i2e_metadata.mirror_session_id = (bit<16>)sflow_i2e_mirror_id; - clone3(CloneType.I2E, (bit<32>)sflow_i2e_mirror_id, (bit<8>)FieldLists.sflow_cpu_info); + clone3_field_list(CloneType.I2E, (bit<32>)sflow_i2e_mirror_id, (bit<8>)FieldLists.sflow_cpu_info); } @name(".sflow_ing_take_sample") table sflow_ing_take_sample { actions = { @@ -4396,7 +4396,7 @@ control process_mac_acl(inout headers hdr, inout metadata meta, inout standard_m @name(".acl_mirror") action acl_mirror(bit<32> session_id, bit<14> acl_stats_index, bit<16> acl_meter_index) { meta.i2e_metadata.mirror_session_id = (bit<16>)session_id; meta.i2e_metadata.ingress_tstamp = (bit<32>)standard_metadata.ingress_global_timestamp; - clone3(CloneType.I2E, (bit<32>)session_id, (bit<8>)FieldLists.i2e_mirror_info); + clone3_field_list(CloneType.I2E, (bit<32>)session_id, (bit<8>)FieldLists.i2e_mirror_info); meta.acl_metadata.acl_stats_index = acl_stats_index; meta.meter_metadata.meter_index = acl_meter_index; } @@ -4462,7 +4462,7 @@ control process_ip_acl(inout headers hdr, inout metadata meta, inout standard_me @name(".acl_mirror") action acl_mirror(bit<32> session_id, bit<14> acl_stats_index, bit<16> acl_meter_index) { meta.i2e_metadata.mirror_session_id = (bit<16>)session_id; meta.i2e_metadata.ingress_tstamp = (bit<32>)standard_metadata.ingress_global_timestamp; - clone3(CloneType.I2E, (bit<32>)session_id, (bit<8>)FieldLists.i2e_mirror_info); + clone3_field_list(CloneType.I2E, (bit<32>)session_id, (bit<8>)FieldLists.i2e_mirror_info); meta.acl_metadata.acl_stats_index = acl_stats_index; meta.meter_metadata.meter_index = acl_meter_index; } @@ -5627,7 +5627,7 @@ control process_system_acl(inout headers hdr, inout metadata meta, inout standar } @name(".copy_to_cpu_with_reason") action copy_to_cpu_with_reason(bit<16> reason_code) { meta.fabric_metadata.reason_code = reason_code; - clone3(CloneType.I2E, (bit<32>)32w250, (bit<8>)FieldLists.cpu_info); + clone3_field_list(CloneType.I2E, (bit<32>)32w250, (bit<8>)FieldLists.cpu_info); } @name(".redirect_to_cpu") action redirect_to_cpu(bit<16> reason_code) { copy_to_cpu_with_reason(reason_code); @@ -5635,7 +5635,7 @@ control process_system_acl(inout headers hdr, inout metadata meta, inout standar meta.fabric_metadata.dst_device = 8w0; } @name(".copy_to_cpu") action copy_to_cpu() { - clone3(CloneType.I2E, (bit<32>)32w250, (bit<8>)FieldLists.cpu_info); + clone3_field_list(CloneType.I2E, (bit<32>)32w250, (bit<8>)FieldLists.cpu_info); } @name(".drop_packet") action drop_packet() { mark_to_drop(standard_metadata); @@ -5645,7 +5645,7 @@ control process_system_acl(inout headers hdr, inout metadata meta, inout standar mark_to_drop(standard_metadata); } @name(".negative_mirror") action negative_mirror(bit<32> session_id) { - clone3(CloneType.I2E, (bit<32>)session_id, (bit<8>)FieldLists.mirror_info); + clone3_field_list(CloneType.I2E, (bit<32>)session_id, (bit<8>)FieldLists.mirror_info); mark_to_drop(standard_metadata); } @name(".drop_stats") table drop_stats_0 { diff --git a/testdata/p4_16_samples/issue1001-bmv2.p4 b/testdata/p4_16_samples/issue1001-bmv2.p4 index 930fd5cc743..7f9ab891afd 100644 --- a/testdata/p4_16_samples/issue1001-bmv2.p4 +++ b/testdata/p4_16_samples/issue1001-bmv2.p4 @@ -17,7 +17,7 @@ parser p(packet_in b, out Headers h, inout Meta m, inout standard_metadata_t sm) control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { apply { - clone3(CloneType.I2E, 32w64, 0); + clone3_field_list(CloneType.I2E, 32w64, 0); } } diff --git a/testdata/p4_16_samples/issue1043-bmv2.p4 b/testdata/p4_16_samples/issue1043-bmv2.p4 index 2bcf76bd4fb..bdc0e1e2668 100644 --- a/testdata/p4_16_samples/issue1043-bmv2.p4 +++ b/testdata/p4_16_samples/issue1043-bmv2.p4 @@ -30,7 +30,7 @@ control deparser(packet_out b, in Headers h) { control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { apply { - resubmit(0); + resubmit_field_list(0); sm.egress_spec = 0; } } diff --git a/testdata/p4_16_samples/issue1642-bmv2.p4 b/testdata/p4_16_samples/issue1642-bmv2.p4 index 10d98d3402d..a3cb4428f83 100644 --- a/testdata/p4_16_samples/issue1642-bmv2.p4 +++ b/testdata/p4_16_samples/issue1642-bmv2.p4 @@ -39,7 +39,7 @@ control ingress(inout parsed_packet_t hdr, local_metadata.row.alt0 = local_metadata.row.alt1; local_metadata.row.alt0.valid = 1; local_metadata.row.alt1.port = local_metadata.row.alt1.port + 1; - clone3(CloneType.I2E, 0, 0); + clone3_field_list(CloneType.I2E, 0, 0); } } diff --git a/testdata/p4_16_samples/issue1653-bmv2.p4 b/testdata/p4_16_samples/issue1653-bmv2.p4 index 44af4c3a9f5..69eb809642c 100644 --- a/testdata/p4_16_samples/issue1653-bmv2.p4 +++ b/testdata/p4_16_samples/issue1653-bmv2.p4 @@ -45,7 +45,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, apply { // Copy another header's data to local variable. bh.x = h.bvh0.x; - clone3(CloneType.I2E, 0, 0); + clone3_field_list(CloneType.I2E, 0, 0); } } diff --git a/testdata/p4_16_samples/issue1653-complex-bmv2.p4 b/testdata/p4_16_samples/issue1653-complex-bmv2.p4 index b8861b8d37e..757d0d60597 100644 --- a/testdata/p4_16_samples/issue1653-complex-bmv2.p4 +++ b/testdata/p4_16_samples/issue1653-complex-bmv2.p4 @@ -96,7 +96,7 @@ control ingress(inout parsed_packet_t h, h.bvh0.row.alt1.type = bh.row.alt1.type; local_metadata.row0.alt0.useHash = true; - clone3(CloneType.I2E, 0, 0); + clone3_field_list(CloneType.I2E, 0, 0); } } diff --git a/testdata/p4_16_samples/issue1660-bmv2.p4 b/testdata/p4_16_samples/issue1660-bmv2.p4 index 8914133442a..1d0f7f85314 100644 --- a/testdata/p4_16_samples/issue1660-bmv2.p4 +++ b/testdata/p4_16_samples/issue1660-bmv2.p4 @@ -20,7 +20,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, apply { HasBool b; b.x = true; - clone3(CloneType.I2E, 0, 0); + clone3_field_list(CloneType.I2E, 0, 0); } } diff --git a/testdata/p4_16_samples/issue1765-1-bmv2.p4 b/testdata/p4_16_samples/issue1765-1-bmv2.p4 index 3f3e26cf18a..755bc63d540 100644 --- a/testdata/p4_16_samples/issue1765-1-bmv2.p4 +++ b/testdata/p4_16_samples/issue1765-1-bmv2.p4 @@ -208,12 +208,12 @@ control MyIngress(inout headers hdr, inout metadata meta, inout standard_metadat action controller_debug() { meta.task = TASK_DEBUG; meta.ingress_port = standard_metadata.ingress_port; - clone3(CloneType.I2E, 100, 0); + clone3_field_list(CloneType.I2E, 100, 0); } action controller_reply(task_t task) { meta.task = task; meta.ingress_port = standard_metadata.ingress_port; - clone3(CloneType.I2E, 100, 0); + clone3_field_list(CloneType.I2E, 100, 0); } action multicast_pkg(mcast_t mcast_grp) { standard_metadata.mcast_grp = mcast_grp; diff --git a/testdata/p4_16_samples/issue383-bmv2.p4 b/testdata/p4_16_samples/issue383-bmv2.p4 index d69d37398dd..8562abd7b15 100644 --- a/testdata/p4_16_samples/issue383-bmv2.p4 +++ b/testdata/p4_16_samples/issue383-bmv2.p4 @@ -106,7 +106,7 @@ control ingress(inout parsed_packet_t h, local_metadata.row0.alt0 = local_metadata.row1.alt1; local_metadata.row1.alt0.valid = 1; local_metadata.row1.alt1.port = local_metadata.row0.alt1.port + 1; - clone3(CloneType.I2E, 0, 0); + clone3_field_list(CloneType.I2E, 0, 0); /* Cast support is TODO for bmv2. diff --git a/testdata/p4_16_samples/issue562-bmv2.p4 b/testdata/p4_16_samples/issue562-bmv2.p4 index a1f2995befd..67251266801 100644 --- a/testdata/p4_16_samples/issue562-bmv2.p4 +++ b/testdata/p4_16_samples/issue562-bmv2.p4 @@ -32,7 +32,7 @@ control ingress(inout parsed_packet_t hdr, local_metadata.row.alt0 = local_metadata.row.alt1; local_metadata.row.alt0.valid = 1; local_metadata.row.alt1.port = local_metadata.row.alt1.port + 1; - clone3(CloneType.I2E, 0, 0); + clone3_field_list(CloneType.I2E, 0, 0); } } diff --git a/testdata/p4_16_samples/v1model-special-ops-bmv2.p4 b/testdata/p4_16_samples/v1model-special-ops-bmv2.p4 index f3b62f480e5..132eecbcfb6 100644 --- a/testdata/p4_16_samples/v1model-special-ops-bmv2.p4 +++ b/testdata/p4_16_samples/v1model-special-ops-bmv2.p4 @@ -229,7 +229,7 @@ control ingress(inout headers_t hdr, // If you give an entire struct, it includes all fields inside // of that struct. - resubmit(0); + resubmit_field_list(0); } action do_clone_i2e(bit<32> l2ptr) { // BMv2 simple_switch can have multiple different clone @@ -244,7 +244,7 @@ control ingress(inout headers_t hdr, // resubmit() call above. clone() is the same as clone3(), // except there are only 2 parameters, and thus no metadata // field values are preserved in the cloned packet. - clone3(CloneType.I2E, I2E_CLONE_SESSION_ID, 0); + clone3_field_list(CloneType.I2E, I2E_CLONE_SESSION_ID, 0); meta.fwd.l2ptr = l2ptr; } table ipv4_da_lpm { @@ -354,13 +354,13 @@ control egress(inout headers_t hdr, // See the resubmit() call above for comments about the // parameter to recirculate(), which has the same form as for // resubmit. - recirculate(0); + recirculate_field_list(0); } action do_clone_e2e(bit<48> smac) { hdr.ethernet.srcAddr = smac; // See the resubmit() call for notes on the 3rd argument, // which is similar to the only argument to resubmit(). - clone3(CloneType.E2E, E2E_CLONE_SESSION_ID, 0); + clone3_field_list(CloneType.E2E, E2E_CLONE_SESSION_ID, 0); } table send_frame { key = { diff --git a/testdata/p4_16_samples_outputs/issue1001-bmv2-first.p4 b/testdata/p4_16_samples_outputs/issue1001-bmv2-first.p4 index c36f177760c..cf6e4106b4d 100644 --- a/testdata/p4_16_samples_outputs/issue1001-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/issue1001-bmv2-first.p4 @@ -19,7 +19,7 @@ parser p(packet_in b, out Headers h, inout Meta m, inout standard_metadata_t sm) control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { apply { - clone3(CloneType.I2E, 32w64, 8w0); + clone3_field_list(CloneType.I2E, 32w64, 8w0); } } diff --git a/testdata/p4_16_samples_outputs/issue1001-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue1001-bmv2-frontend.p4 index c36f177760c..cf6e4106b4d 100644 --- a/testdata/p4_16_samples_outputs/issue1001-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1001-bmv2-frontend.p4 @@ -19,7 +19,7 @@ parser p(packet_in b, out Headers h, inout Meta m, inout standard_metadata_t sm) control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { apply { - clone3(CloneType.I2E, 32w64, 8w0); + clone3_field_list(CloneType.I2E, 32w64, 8w0); } } diff --git a/testdata/p4_16_samples_outputs/issue1001-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/issue1001-bmv2-midend.p4 index f3feb05cc80..8f49f6be927 100644 --- a/testdata/p4_16_samples_outputs/issue1001-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue1001-bmv2-midend.p4 @@ -19,7 +19,7 @@ parser p(packet_in b, out Headers h, inout Meta m, inout standard_metadata_t sm) control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @hidden action issue1001bmv2l20() { - clone3(CloneType.I2E, 32w64, 8w0); + clone3_field_list(CloneType.I2E, 32w64, 8w0); } @hidden table tbl_issue1001bmv2l20 { actions = { diff --git a/testdata/p4_16_samples_outputs/issue1001-bmv2.p4 b/testdata/p4_16_samples_outputs/issue1001-bmv2.p4 index 9327029989b..b34e84699bd 100644 --- a/testdata/p4_16_samples_outputs/issue1001-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/issue1001-bmv2.p4 @@ -19,7 +19,7 @@ parser p(packet_in b, out Headers h, inout Meta m, inout standard_metadata_t sm) control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { apply { - clone3(CloneType.I2E, 32w64, 0); + clone3_field_list(CloneType.I2E, 32w64, 0); } } diff --git a/testdata/p4_16_samples_outputs/issue1642-bmv2-first.p4 b/testdata/p4_16_samples_outputs/issue1642-bmv2-first.p4 index 91b9011248b..a3266892ec0 100644 --- a/testdata/p4_16_samples_outputs/issue1642-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/issue1642-bmv2-first.p4 @@ -38,7 +38,7 @@ control ingress(inout parsed_packet_t hdr, inout local_metadata_t local_metadata local_metadata.row.alt0 = local_metadata.row.alt1; local_metadata.row.alt0.valid = 1w1; local_metadata.row.alt1.port = local_metadata.row.alt1.port + 7w1; - clone3(CloneType.I2E, 32w0, 8w0); + clone3_field_list(CloneType.I2E, 32w0, 8w0); } } diff --git a/testdata/p4_16_samples_outputs/issue1642-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue1642-bmv2-frontend.p4 index 91b9011248b..a3266892ec0 100644 --- a/testdata/p4_16_samples_outputs/issue1642-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1642-bmv2-frontend.p4 @@ -38,7 +38,7 @@ control ingress(inout parsed_packet_t hdr, inout local_metadata_t local_metadata local_metadata.row.alt0 = local_metadata.row.alt1; local_metadata.row.alt0.valid = 1w1; local_metadata.row.alt1.port = local_metadata.row.alt1.port + 7w1; - clone3(CloneType.I2E, 32w0, 8w0); + clone3_field_list(CloneType.I2E, 32w0, 8w0); } } diff --git a/testdata/p4_16_samples_outputs/issue1642-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/issue1642-bmv2-midend.p4 index 912a14b4cb6..261772f1966 100644 --- a/testdata/p4_16_samples_outputs/issue1642-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue1642-bmv2-midend.p4 @@ -45,7 +45,7 @@ control ingress(inout parsed_packet_t hdr, inout local_metadata_t local_metadata local_metadata._row_alt0_port2 = local_metadata._row_alt1_port4; local_metadata._row_alt0_valid1 = 1w1; local_metadata._row_alt1_port4 = local_metadata._row_alt1_port4 + 7w1; - clone3(CloneType.I2E, 32w0, 8w0); + clone3_field_list(CloneType.I2E, 32w0, 8w0); } @hidden table tbl_issue1642bmv2l37 { actions = { diff --git a/testdata/p4_16_samples_outputs/issue1642-bmv2.p4 b/testdata/p4_16_samples_outputs/issue1642-bmv2.p4 index ebd8e9a881c..254eb7ae3e5 100644 --- a/testdata/p4_16_samples_outputs/issue1642-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/issue1642-bmv2.p4 @@ -38,7 +38,7 @@ control ingress(inout parsed_packet_t hdr, inout local_metadata_t local_metadata local_metadata.row.alt0 = local_metadata.row.alt1; local_metadata.row.alt0.valid = 1; local_metadata.row.alt1.port = local_metadata.row.alt1.port + 1; - clone3(CloneType.I2E, 0, 0); + clone3_field_list(CloneType.I2E, 0, 0); } } diff --git a/testdata/p4_16_samples_outputs/issue1653-bmv2-first.p4 b/testdata/p4_16_samples_outputs/issue1653-bmv2-first.p4 index 5f6103a837f..4e49650d12a 100644 --- a/testdata/p4_16_samples_outputs/issue1653-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/issue1653-bmv2-first.p4 @@ -26,7 +26,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, bitvec_hdr bh; apply { bh.x = h.bvh0.x; - clone3(CloneType.I2E, 32w0, 8w0); + clone3_field_list(CloneType.I2E, 32w0, 8w0); } } diff --git a/testdata/p4_16_samples_outputs/issue1653-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue1653-bmv2-frontend.p4 index d9276ddb664..9c618a5e0be 100644 --- a/testdata/p4_16_samples_outputs/issue1653-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1653-bmv2-frontend.p4 @@ -26,7 +26,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, @name("ingress.bh") bitvec_hdr bh_0; apply { bh_0.setInvalid(); - clone3(CloneType.I2E, 32w0, 8w0); + clone3_field_list(CloneType.I2E, 32w0, 8w0); } } diff --git a/testdata/p4_16_samples_outputs/issue1653-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/issue1653-bmv2-midend.p4 index b32dd879701..a9656e08eb2 100644 --- a/testdata/p4_16_samples_outputs/issue1653-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue1653-bmv2-midend.p4 @@ -26,7 +26,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, @name("ingress.bh") bitvec_hdr bh_0; @hidden action issue1653bmv2l43() { bh_0.setInvalid(); - clone3(CloneType.I2E, 32w0, 8w0); + clone3_field_list(CloneType.I2E, 32w0, 8w0); } @hidden table tbl_issue1653bmv2l43 { actions = { diff --git a/testdata/p4_16_samples_outputs/issue1653-bmv2.p4 b/testdata/p4_16_samples_outputs/issue1653-bmv2.p4 index f697ed0f816..b6f535deb7f 100644 --- a/testdata/p4_16_samples_outputs/issue1653-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/issue1653-bmv2.p4 @@ -26,7 +26,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, bitvec_hdr bh; apply { bh.x = h.bvh0.x; - clone3(CloneType.I2E, 0, 0); + clone3_field_list(CloneType.I2E, 0, 0); } } 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 fd41c15c8dc..3d2eb7cd59e 100644 --- a/testdata/p4_16_samples_outputs/issue1653-complex-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/issue1653-complex-bmv2-first.p4 @@ -74,7 +74,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, bh.row.alt1.type = EthTypes.IPv4; h.bvh0.row.alt1.type = bh.row.alt1.type; local_metadata.row0.alt0.useHash = true; - clone3(CloneType.I2E, 32w0, 8w0); + clone3_field_list(CloneType.I2E, 32w0, 8w0); } } 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 516c445c763..ca44e816cfd 100644 --- a/testdata/p4_16_samples_outputs/issue1653-complex-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1653-complex-bmv2-frontend.p4 @@ -76,7 +76,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, bh_0.row.alt1.type = EthTypes.IPv4; h.bvh0.row.alt1.type = bh_0.row.alt1.type; local_metadata.row0.alt0.useHash = true; - clone3(CloneType.I2E, 32w0, 8w0); + clone3_field_list(CloneType.I2E, 32w0, 8w0); } } 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 5ca92382f2d..be325955d4b 100644 --- a/testdata/p4_16_samples_outputs/issue1653-complex-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue1653-complex-bmv2-midend.p4 @@ -111,7 +111,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, bh_0._row_alt1_type10 = 16w0x800; h.bvh0._row_alt1_type10 = 16w0x800; local_metadata._row0_alt0_useHash3 = true; - clone3(CloneType.I2E, 32w0, 8w0); + clone3_field_list(CloneType.I2E, 32w0, 8w0); } @hidden table tbl_issue1653complexbmv2l72 { actions = { diff --git a/testdata/p4_16_samples_outputs/issue1653-complex-bmv2.p4 b/testdata/p4_16_samples_outputs/issue1653-complex-bmv2.p4 index a626ca7c784..6f2217a9f25 100644 --- a/testdata/p4_16_samples_outputs/issue1653-complex-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/issue1653-complex-bmv2.p4 @@ -72,7 +72,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, bh.row.alt1.type = EthTypes.IPv4; h.bvh0.row.alt1.type = bh.row.alt1.type; local_metadata.row0.alt0.useHash = true; - clone3(CloneType.I2E, 0, 0); + clone3_field_list(CloneType.I2E, 0, 0); } } diff --git a/testdata/p4_16_samples_outputs/issue1660-bmv2-first.p4 b/testdata/p4_16_samples_outputs/issue1660-bmv2-first.p4 index e1607db5b61..72173b5e6e1 100644 --- a/testdata/p4_16_samples_outputs/issue1660-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/issue1660-bmv2-first.p4 @@ -23,7 +23,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, apply { HasBool b; b.x = true; - clone3(CloneType.I2E, 32w0, 8w0); + clone3_field_list(CloneType.I2E, 32w0, 8w0); } } diff --git a/testdata/p4_16_samples_outputs/issue1660-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue1660-bmv2-frontend.p4 index 2899482575d..003e176d2ff 100644 --- a/testdata/p4_16_samples_outputs/issue1660-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1660-bmv2-frontend.p4 @@ -21,7 +21,7 @@ parser parse(packet_in pk, out parsed_packet_t h, inout local_metadata_t local_m control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, inout standard_metadata_t standard_metadata) { apply { - clone3(CloneType.I2E, 32w0, 8w0); + clone3_field_list(CloneType.I2E, 32w0, 8w0); } } diff --git a/testdata/p4_16_samples_outputs/issue1660-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/issue1660-bmv2-midend.p4 index 66b2091fd07..f0c926eb929 100644 --- a/testdata/p4_16_samples_outputs/issue1660-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue1660-bmv2-midend.p4 @@ -21,7 +21,7 @@ parser parse(packet_in pk, out parsed_packet_t h, inout local_metadata_t local_m control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, inout standard_metadata_t standard_metadata) { @hidden action issue1660bmv2l23() { - clone3(CloneType.I2E, 32w0, 8w0); + clone3_field_list(CloneType.I2E, 32w0, 8w0); } @hidden table tbl_issue1660bmv2l23 { actions = { diff --git a/testdata/p4_16_samples_outputs/issue1660-bmv2.p4 b/testdata/p4_16_samples_outputs/issue1660-bmv2.p4 index 4ea8c108c2f..bd886c5e61b 100644 --- a/testdata/p4_16_samples_outputs/issue1660-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/issue1660-bmv2.p4 @@ -23,7 +23,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, apply { HasBool b; b.x = true; - clone3(CloneType.I2E, 0, 0); + clone3_field_list(CloneType.I2E, 0, 0); } } 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 8cb761033e7..b2e4646e0df 100644 --- a/testdata/p4_16_samples_outputs/issue1765-1-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/issue1765-1-bmv2-first.p4 @@ -209,12 +209,12 @@ control MyIngress(inout headers hdr, inout metadata meta, inout standard_metadat action controller_debug() { meta.task = 16w3; meta.ingress_port = standard_metadata.ingress_port; - clone3(CloneType.I2E, 32w100, 8w0); + clone3_field_list(CloneType.I2E, 32w100, 8w0); } action controller_reply(task_t task) { meta.task = task; meta.ingress_port = standard_metadata.ingress_port; - clone3(CloneType.I2E, 32w100, 8w0); + clone3_field_list(CloneType.I2E, 32w100, 8w0); } action multicast_pkg(mcast_t mcast_grp) { standard_metadata.mcast_grp = mcast_grp; 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 ddacabf6c63..99edf0ae55a 100644 --- a/testdata/p4_16_samples_outputs/issue1765-1-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1765-1-bmv2-frontend.p4 @@ -199,22 +199,22 @@ control MyIngress(inout headers hdr, inout metadata meta, inout standard_metadat @name("MyIngress.controller_debug") action controller_debug() { meta.task = 16w3; meta.ingress_port = standard_metadata.ingress_port; - clone3(CloneType.I2E, 32w100, 8w0); + clone3_field_list(CloneType.I2E, 32w100, 8w0); } @name("MyIngress.controller_debug") action controller_debug_1() { meta.task = 16w3; meta.ingress_port = standard_metadata.ingress_port; - clone3(CloneType.I2E, 32w100, 8w0); + clone3_field_list(CloneType.I2E, 32w100, 8w0); } @name("MyIngress.controller_reply") action controller_reply(@name("task") task_t task_1) { meta.task = task_1; meta.ingress_port = standard_metadata.ingress_port; - clone3(CloneType.I2E, 32w100, 8w0); + clone3_field_list(CloneType.I2E, 32w100, 8w0); } @name("MyIngress.controller_reply") action controller_reply_1(@name("task") task_t task_2) { meta.task = task_2; meta.ingress_port = standard_metadata.ingress_port; - clone3(CloneType.I2E, 32w100, 8w0); + clone3_field_list(CloneType.I2E, 32w100, 8w0); } @name("MyIngress.icmp6_echo_reply") action icmp6_echo_reply() { mac_tmp_0 = hdr.ethernet.dst_addr; 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 89bf232d5d7..a4b420ce728 100644 --- a/testdata/p4_16_samples_outputs/issue1765-1-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue1765-1-bmv2-midend.p4 @@ -207,22 +207,22 @@ control MyIngress(inout headers hdr, inout metadata meta, inout standard_metadat @name("MyIngress.controller_debug") action controller_debug() { meta.task = 16w3; meta.ingress_port = standard_metadata.ingress_port; - clone3(CloneType.I2E, 32w100, 8w0); + clone3_field_list(CloneType.I2E, 32w100, 8w0); } @name("MyIngress.controller_debug") action controller_debug_1() { meta.task = 16w3; meta.ingress_port = standard_metadata.ingress_port; - clone3(CloneType.I2E, 32w100, 8w0); + clone3_field_list(CloneType.I2E, 32w100, 8w0); } @name("MyIngress.controller_reply") action controller_reply(@name("task") task_t task_1) { meta.task = task_1; meta.ingress_port = standard_metadata.ingress_port; - clone3(CloneType.I2E, 32w100, 8w0); + clone3_field_list(CloneType.I2E, 32w100, 8w0); } @name("MyIngress.controller_reply") action controller_reply_1(@name("task") task_t task_2) { meta.task = task_2; meta.ingress_port = standard_metadata.ingress_port; - clone3(CloneType.I2E, 32w100, 8w0); + clone3_field_list(CloneType.I2E, 32w100, 8w0); } @name("MyIngress.icmp6_echo_reply") action icmp6_echo_reply() { mac_tmp_0 = hdr.ethernet.dst_addr; diff --git a/testdata/p4_16_samples_outputs/issue1765-1-bmv2.p4 b/testdata/p4_16_samples_outputs/issue1765-1-bmv2.p4 index 15b1b372c9a..38baf4ccd62 100644 --- a/testdata/p4_16_samples_outputs/issue1765-1-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/issue1765-1-bmv2.p4 @@ -209,12 +209,12 @@ control MyIngress(inout headers hdr, inout metadata meta, inout standard_metadat action controller_debug() { meta.task = TASK_DEBUG; meta.ingress_port = standard_metadata.ingress_port; - clone3(CloneType.I2E, 100, 0); + clone3_field_list(CloneType.I2E, 100, 0); } action controller_reply(task_t task) { meta.task = task; meta.ingress_port = standard_metadata.ingress_port; - clone3(CloneType.I2E, 100, 0); + clone3_field_list(CloneType.I2E, 100, 0); } action multicast_pkg(mcast_t mcast_grp) { standard_metadata.mcast_grp = mcast_grp; diff --git a/testdata/p4_16_samples_outputs/issue383-bmv2-first.p4 b/testdata/p4_16_samples_outputs/issue383-bmv2-first.p4 index 0e9948a755a..924dc1aa99f 100644 --- a/testdata/p4_16_samples_outputs/issue383-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/issue383-bmv2-first.p4 @@ -80,7 +80,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, local_metadata.row0.alt0 = local_metadata.row1.alt1; local_metadata.row1.alt0.valid = 1w1; local_metadata.row1.alt1.port = local_metadata.row0.alt1.port + 7w1; - clone3(CloneType.I2E, 32w0, 8w0); + clone3_field_list(CloneType.I2E, 32w0, 8w0); } } diff --git a/testdata/p4_16_samples_outputs/issue383-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue383-bmv2-frontend.p4 index d1b8e209471..5544fcc97f6 100644 --- a/testdata/p4_16_samples_outputs/issue383-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue383-bmv2-frontend.p4 @@ -80,7 +80,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, local_metadata.row0.alt0 = local_metadata.row1.alt1; local_metadata.row1.alt0.valid = 1w1; local_metadata.row1.alt1.port = local_metadata.row0.alt1.port + 7w1; - clone3(CloneType.I2E, 32w0, 8w0); + clone3_field_list(CloneType.I2E, 32w0, 8w0); } } diff --git a/testdata/p4_16_samples_outputs/issue383-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/issue383-bmv2-midend.p4 index 044ee79600f..24c96cdf666 100644 --- a/testdata/p4_16_samples_outputs/issue383-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue383-bmv2-midend.p4 @@ -96,7 +96,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, local_metadata._row0_alt0_port1 = local_metadata._row1_alt1_port7; local_metadata._row1_alt0_valid4 = 1w1; local_metadata._row1_alt1_port7 = local_metadata._row0_alt1_port3 + 7w1; - clone3(CloneType.I2E, 32w0, 8w0); + clone3_field_list(CloneType.I2E, 32w0, 8w0); } @hidden table tbl_issue383bmv2l75 { actions = { diff --git a/testdata/p4_16_samples_outputs/issue383-bmv2.p4 b/testdata/p4_16_samples_outputs/issue383-bmv2.p4 index d035eeec9b3..d85863e34f8 100644 --- a/testdata/p4_16_samples_outputs/issue383-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/issue383-bmv2.p4 @@ -78,7 +78,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, local_metadata.row0.alt0 = local_metadata.row1.alt1; local_metadata.row1.alt0.valid = 1; local_metadata.row1.alt1.port = local_metadata.row0.alt1.port + 1; - clone3(CloneType.I2E, 0, 0); + clone3_field_list(CloneType.I2E, 0, 0); } } diff --git a/testdata/p4_16_samples_outputs/issue562-bmv2-first.p4 b/testdata/p4_16_samples_outputs/issue562-bmv2-first.p4 index 0873ede05c1..5ddddad1d1d 100644 --- a/testdata/p4_16_samples_outputs/issue562-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/issue562-bmv2-first.p4 @@ -31,7 +31,7 @@ control ingress(inout parsed_packet_t hdr, inout local_metadata_t local_metadata local_metadata.row.alt0 = local_metadata.row.alt1; local_metadata.row.alt0.valid = 1w1; local_metadata.row.alt1.port = local_metadata.row.alt1.port + 7w1; - clone3(CloneType.I2E, 32w0, 8w0); + clone3_field_list(CloneType.I2E, 32w0, 8w0); } } diff --git a/testdata/p4_16_samples_outputs/issue562-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue562-bmv2-frontend.p4 index 0873ede05c1..5ddddad1d1d 100644 --- a/testdata/p4_16_samples_outputs/issue562-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue562-bmv2-frontend.p4 @@ -31,7 +31,7 @@ control ingress(inout parsed_packet_t hdr, inout local_metadata_t local_metadata local_metadata.row.alt0 = local_metadata.row.alt1; local_metadata.row.alt0.valid = 1w1; local_metadata.row.alt1.port = local_metadata.row.alt1.port + 7w1; - clone3(CloneType.I2E, 32w0, 8w0); + clone3_field_list(CloneType.I2E, 32w0, 8w0); } } diff --git a/testdata/p4_16_samples_outputs/issue562-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/issue562-bmv2-midend.p4 index 1e6a41b5b5c..013814f6a91 100644 --- a/testdata/p4_16_samples_outputs/issue562-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue562-bmv2-midend.p4 @@ -38,7 +38,7 @@ control ingress(inout parsed_packet_t hdr, inout local_metadata_t local_metadata local_metadata._row_alt0_port1 = local_metadata._row_alt1_port3; local_metadata._row_alt0_valid0 = 1w1; local_metadata._row_alt1_port3 = local_metadata._row_alt1_port3 + 7w1; - clone3(CloneType.I2E, 32w0, 8w0); + clone3_field_list(CloneType.I2E, 32w0, 8w0); } @hidden table tbl_issue562bmv2l32 { actions = { diff --git a/testdata/p4_16_samples_outputs/issue562-bmv2.p4 b/testdata/p4_16_samples_outputs/issue562-bmv2.p4 index 71d18d6588c..53ed42bc959 100644 --- a/testdata/p4_16_samples_outputs/issue562-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/issue562-bmv2.p4 @@ -31,7 +31,7 @@ control ingress(inout parsed_packet_t hdr, inout local_metadata_t local_metadata local_metadata.row.alt0 = local_metadata.row.alt1; local_metadata.row.alt0.valid = 1; local_metadata.row.alt1.port = local_metadata.row.alt1.port + 1; - clone3(CloneType.I2E, 0, 0); + clone3_field_list(CloneType.I2E, 0, 0); } } 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 1596f9450d5..ae829823d5c 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 @@ -91,10 +91,10 @@ control ingress(inout headers_t hdr, inout meta_t meta, inout standard_metadata_ } action do_resubmit(bit<32> new_ipv4_dstAddr) { hdr.ipv4.dstAddr = new_ipv4_dstAddr; - resubmit(8w0); + resubmit_field_list(8w0); } action do_clone_i2e(bit<32> l2ptr) { - clone3(CloneType.I2E, 32w5, 8w0); + clone3_field_list(CloneType.I2E, 32w5, 8w0); meta.fwd.l2ptr = l2ptr; } table ipv4_da_lpm { @@ -162,11 +162,11 @@ control egress(inout headers_t hdr, inout meta_t meta, inout standard_metadata_t } action do_recirculate(bit<32> new_ipv4_dstAddr) { hdr.ipv4.dstAddr = new_ipv4_dstAddr; - recirculate(8w0); + recirculate_field_list(8w0); } action do_clone_e2e(bit<48> smac) { hdr.ethernet.srcAddr = smac; - clone3(CloneType.E2E, 32w11, 8w0); + clone3_field_list(CloneType.E2E, 32w11, 8w0); } table send_frame { key = { 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 4ca006eeb68..ebbb45ea54b 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 @@ -83,10 +83,10 @@ control ingress(inout headers_t hdr, inout meta_t meta, inout standard_metadata_ } @name("ingress.do_resubmit") action do_resubmit(@name("new_ipv4_dstAddr") bit<32> new_ipv4_dstAddr) { hdr.ipv4.dstAddr = new_ipv4_dstAddr; - resubmit(8w0); + resubmit_field_list(8w0); } @name("ingress.do_clone_i2e") action do_clone_i2e(@name("l2ptr") bit<32> l2ptr_3) { - clone3(CloneType.I2E, 32w5, 8w0); + clone3_field_list(CloneType.I2E, 32w5, 8w0); meta.fwd.l2ptr = l2ptr_3; } @name("ingress.ipv4_da_lpm") table ipv4_da_lpm_0 { @@ -172,11 +172,11 @@ control egress(inout headers_t hdr, inout meta_t meta, inout standard_metadata_t } @name("egress.do_recirculate") action do_recirculate(@name("new_ipv4_dstAddr") bit<32> new_ipv4_dstAddr_2) { hdr.ipv4.dstAddr = new_ipv4_dstAddr_2; - recirculate(8w0); + recirculate_field_list(8w0); } @name("egress.do_clone_e2e") action do_clone_e2e(@name("smac") bit<48> smac_2) { hdr.ethernet.srcAddr = smac_2; - clone3(CloneType.E2E, 32w11, 8w0); + clone3_field_list(CloneType.E2E, 32w11, 8w0); } @name("egress.send_frame") table send_frame_0 { key = { 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 1a1fa2972ec..971026a6c42 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 @@ -139,10 +139,10 @@ control ingress(inout headers_t hdr, inout meta_t meta, inout standard_metadata_ } @name("ingress.do_resubmit") action do_resubmit(@name("new_ipv4_dstAddr") bit<32> new_ipv4_dstAddr) { hdr.ipv4.dstAddr = new_ipv4_dstAddr; - resubmit(8w0); + resubmit_field_list(8w0); } @name("ingress.do_clone_i2e") action do_clone_i2e(@name("l2ptr") bit<32> l2ptr_3) { - clone3(CloneType.I2E, 32w5, 8w0); + clone3_field_list(CloneType.I2E, 32w5, 8w0); meta._fwd_l2ptr0 = l2ptr_3; } @name("ingress.ipv4_da_lpm") table ipv4_da_lpm_0 { @@ -266,11 +266,11 @@ control egress(inout headers_t hdr, inout meta_t meta, inout standard_metadata_t } @name("egress.do_recirculate") action do_recirculate(@name("new_ipv4_dstAddr") bit<32> new_ipv4_dstAddr_2) { hdr.ipv4.dstAddr = new_ipv4_dstAddr_2; - recirculate(8w0); + recirculate_field_list(8w0); } @name("egress.do_clone_e2e") action do_clone_e2e(@name("smac") bit<48> smac_2) { hdr.ethernet.srcAddr = smac_2; - clone3(CloneType.E2E, 32w11, 8w0); + clone3_field_list(CloneType.E2E, 32w11, 8w0); } @name("egress.send_frame") table send_frame_0 { key = { 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 29ecfe8fa32..a74870d91e5 100644 --- a/testdata/p4_16_samples_outputs/v1model-special-ops-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/v1model-special-ops-bmv2.p4 @@ -91,10 +91,10 @@ control ingress(inout headers_t hdr, inout meta_t meta, inout standard_metadata_ } action do_resubmit(bit<32> new_ipv4_dstAddr) { hdr.ipv4.dstAddr = new_ipv4_dstAddr; - resubmit(0); + resubmit_field_list(0); } action do_clone_i2e(bit<32> l2ptr) { - clone3(CloneType.I2E, I2E_CLONE_SESSION_ID, 0); + clone3_field_list(CloneType.I2E, I2E_CLONE_SESSION_ID, 0); meta.fwd.l2ptr = l2ptr; } table ipv4_da_lpm { @@ -160,11 +160,11 @@ control egress(inout headers_t hdr, inout meta_t meta, inout standard_metadata_t } action do_recirculate(bit<32> new_ipv4_dstAddr) { hdr.ipv4.dstAddr = new_ipv4_dstAddr; - recirculate(0); + recirculate_field_list(0); } action do_clone_e2e(bit<48> smac) { hdr.ethernet.srcAddr = smac; - clone3(CloneType.E2E, E2E_CLONE_SESSION_ID, 0); + clone3_field_list(CloneType.E2E, E2E_CLONE_SESSION_ID, 0); } table send_frame { key = { From 63183a4246823d7b715068f18f98bd39e7fd1a85 Mon Sep 17 00:00:00 2001 From: Mihai Budiu Date: Tue, 2 Nov 2021 10:43:52 -0700 Subject: [PATCH 04/11] reference output --- testdata/p4_16_samples_outputs/issue1043-bmv2-first.p4 | 2 +- testdata/p4_16_samples_outputs/issue1043-bmv2-frontend.p4 | 2 +- testdata/p4_16_samples_outputs/issue1043-bmv2-midend.p4 | 2 +- testdata/p4_16_samples_outputs/issue1043-bmv2.p4 | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/testdata/p4_16_samples_outputs/issue1043-bmv2-first.p4 b/testdata/p4_16_samples_outputs/issue1043-bmv2-first.p4 index 4a6a663158b..f62460f642c 100644 --- a/testdata/p4_16_samples_outputs/issue1043-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/issue1043-bmv2-first.p4 @@ -44,7 +44,7 @@ control deparser(packet_out b, in Headers h) { control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { apply { - resubmit(8w0); + resubmit_field_list(8w0); sm.egress_spec = 9w0; } } diff --git a/testdata/p4_16_samples_outputs/issue1043-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue1043-bmv2-frontend.p4 index 4a6a663158b..f62460f642c 100644 --- a/testdata/p4_16_samples_outputs/issue1043-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1043-bmv2-frontend.p4 @@ -44,7 +44,7 @@ control deparser(packet_out b, in Headers h) { control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { apply { - resubmit(8w0); + resubmit_field_list(8w0); sm.egress_spec = 9w0; } } diff --git a/testdata/p4_16_samples_outputs/issue1043-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/issue1043-bmv2-midend.p4 index 2f7203a24df..d65c70260b1 100644 --- a/testdata/p4_16_samples_outputs/issue1043-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue1043-bmv2-midend.p4 @@ -44,7 +44,7 @@ control deparser(packet_out b, in Headers h) { control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @hidden action issue1043bmv2l33() { - resubmit(8w0); + resubmit_field_list(8w0); sm.egress_spec = 9w0; } @hidden table tbl_issue1043bmv2l33 { diff --git a/testdata/p4_16_samples_outputs/issue1043-bmv2.p4 b/testdata/p4_16_samples_outputs/issue1043-bmv2.p4 index 018f43d7725..0efd52d4379 100644 --- a/testdata/p4_16_samples_outputs/issue1043-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/issue1043-bmv2.p4 @@ -44,7 +44,7 @@ control deparser(packet_out b, in Headers h) { control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { apply { - resubmit(0); + resubmit_field_list(0); sm.egress_spec = 0; } } From fe8fa2d226bfeb440c16961f2bf13432cb1426de Mon Sep 17 00:00:00 2001 From: Mihai Budiu Date: Tue, 30 Nov 2021 17:52:04 -0800 Subject: [PATCH 05/11] Renamed functions as suggested --- backends/bmv2/simple_switch/simpleSwitch.cpp | 17 +++--- backends/bmv2/simple_switch/simpleSwitch.h | 6 +- frontends/p4/fromv1.0/programStructure.cpp | 6 +- frontends/p4/fromv1.0/v1model.h | 6 +- frontends/p4/parseAnnotations.cpp | 2 + ir/base.def | 1 + ir/type.cpp | 1 + p4include/v1model.p4 | 37 ++++++++---- .../copy_to_cpu-first.p4 | 2 +- .../copy_to_cpu-frontend.p4 | 2 +- .../copy_to_cpu-midend.p4 | 2 +- testdata/p4_14_samples_outputs/copy_to_cpu.p4 | 2 +- .../p414-special-ops-2-bmv2-first.p4 | 6 +- .../p414-special-ops-2-bmv2-frontend.p4 | 6 +- .../p414-special-ops-2-bmv2-midend.p4 | 6 +- .../p414-special-ops-2-bmv2.p4 | 6 +- .../p414-special-ops-3-bmv2-first.p4 | 6 +- .../p414-special-ops-3-bmv2-frontend.p4 | 6 +- .../p414-special-ops-3-bmv2-midend.p4 | 6 +- .../p414-special-ops-3-bmv2.p4 | 6 +- .../p414-special-ops-first.p4 | 6 +- .../p414-special-ops-frontend.p4 | 6 +- .../p414-special-ops-midend.p4 | 6 +- .../p4_14_samples_outputs/p414-special-ops.p4 | 6 +- .../packet_redirect-first.p4 | 8 +-- .../packet_redirect-frontend.p4 | 8 +-- .../packet_redirect-midend.p4 | 8 +-- .../p4_14_samples_outputs/packet_redirect.p4 | 8 +-- .../p4_14_samples_outputs/resubmit-first.p4 | 2 +- .../resubmit-frontend.p4 | 2 +- .../p4_14_samples_outputs/resubmit-midend.p4 | 2 +- testdata/p4_14_samples_outputs/resubmit.p4 | 2 +- .../p4_14_samples_outputs/simple_nat-first.p4 | 2 +- .../simple_nat-frontend.p4 | 2 +- .../simple_nat-midend.p4 | 2 +- testdata/p4_14_samples_outputs/simple_nat.p4 | 2 +- .../switch_20160512/switch-first.p4 | 20 +++---- .../switch_20160512/switch-frontend.p4 | 24 ++++---- .../switch_20160512/switch-midend.p4 | 24 ++++---- .../switch_20160512/switch.p4 | 20 +++---- testdata/p4_16_samples/issue1001-1-bmv2.p4 | 33 +++++++++++ testdata/p4_16_samples/issue1001-bmv2.p4 | 2 +- testdata/p4_16_samples/issue1043-bmv2.p4 | 2 +- testdata/p4_16_samples/issue1642-bmv2.p4 | 2 +- testdata/p4_16_samples/issue1653-bmv2.p4 | 2 +- .../p4_16_samples/issue1653-complex-bmv2.p4 | 2 +- testdata/p4_16_samples/issue1660-bmv2.p4 | 2 +- testdata/p4_16_samples/issue1765-1-bmv2.p4 | 4 +- testdata/p4_16_samples/issue383-bmv2.p4 | 2 +- testdata/p4_16_samples/issue562-bmv2.p4 | 2 +- .../p4_16_samples/v1model-special-ops-bmv2.p4 | 8 +-- .../issue1001-1-bmv2-first.p4 | 51 +++++++++++++++++ .../issue1001-1-bmv2-frontend.p4 | 51 +++++++++++++++++ .../issue1001-1-bmv2-midend.p4 | 56 +++++++++++++++++++ .../p4_16_samples_outputs/issue1001-1-bmv2.p4 | 51 +++++++++++++++++ .../issue1001-1-bmv2.p4-stderr | 0 .../issue1001-1-bmv2.p4.entries.txt | 0 .../issue1001-1-bmv2.p4.p4info.txt | 5 ++ .../issue1001-bmv2-first.p4 | 2 +- .../issue1001-bmv2-frontend.p4 | 2 +- .../issue1001-bmv2-midend.p4 | 2 +- .../p4_16_samples_outputs/issue1001-bmv2.p4 | 2 +- .../issue1043-bmv2-first.p4 | 2 +- .../issue1043-bmv2-frontend.p4 | 2 +- .../issue1043-bmv2-midend.p4 | 2 +- .../p4_16_samples_outputs/issue1043-bmv2.p4 | 2 +- .../issue1642-bmv2-first.p4 | 2 +- .../issue1642-bmv2-frontend.p4 | 2 +- .../issue1642-bmv2-midend.p4 | 2 +- .../p4_16_samples_outputs/issue1642-bmv2.p4 | 2 +- .../issue1653-bmv2-first.p4 | 2 +- .../issue1653-bmv2-frontend.p4 | 2 +- .../issue1653-bmv2-midend.p4 | 2 +- .../p4_16_samples_outputs/issue1653-bmv2.p4 | 2 +- .../issue1653-complex-bmv2-first.p4 | 2 +- .../issue1653-complex-bmv2-frontend.p4 | 2 +- .../issue1653-complex-bmv2-midend.p4 | 2 +- .../issue1653-complex-bmv2.p4 | 2 +- .../issue1660-bmv2-first.p4 | 2 +- .../issue1660-bmv2-frontend.p4 | 2 +- .../issue1660-bmv2-midend.p4 | 2 +- .../p4_16_samples_outputs/issue1660-bmv2.p4 | 2 +- .../issue1765-1-bmv2-first.p4 | 4 +- .../issue1765-1-bmv2-frontend.p4 | 8 +-- .../issue1765-1-bmv2-midend.p4 | 8 +-- .../p4_16_samples_outputs/issue1765-1-bmv2.p4 | 4 +- .../issue383-bmv2-first.p4 | 2 +- .../issue383-bmv2-frontend.p4 | 2 +- .../issue383-bmv2-midend.p4 | 2 +- .../p4_16_samples_outputs/issue383-bmv2.p4 | 2 +- .../issue562-bmv2-first.p4 | 2 +- .../issue562-bmv2-frontend.p4 | 2 +- .../issue562-bmv2-midend.p4 | 2 +- .../p4_16_samples_outputs/issue562-bmv2.p4 | 2 +- .../v1model-special-ops-bmv2-first.p4 | 8 +-- .../v1model-special-ops-bmv2-frontend.p4 | 8 +-- .../v1model-special-ops-bmv2-midend.p4 | 8 +-- .../v1model-special-ops-bmv2.p4 | 8 +-- 98 files changed, 477 insertions(+), 210 deletions(-) create mode 100644 testdata/p4_16_samples/issue1001-1-bmv2.p4 create mode 100644 testdata/p4_16_samples_outputs/issue1001-1-bmv2-first.p4 create mode 100644 testdata/p4_16_samples_outputs/issue1001-1-bmv2-frontend.p4 create mode 100644 testdata/p4_16_samples_outputs/issue1001-1-bmv2-midend.p4 create mode 100644 testdata/p4_16_samples_outputs/issue1001-1-bmv2.p4 create mode 100644 testdata/p4_16_samples_outputs/issue1001-1-bmv2.p4-stderr create mode 100644 testdata/p4_16_samples_outputs/issue1001-1-bmv2.p4.entries.txt create mode 100644 testdata/p4_16_samples_outputs/issue1001-1-bmv2.p4.p4info.txt diff --git a/backends/bmv2/simple_switch/simpleSwitch.cpp b/backends/bmv2/simple_switch/simpleSwitch.cpp index fd440bfb661..2ac83cc2bb1 100644 --- a/backends/bmv2/simple_switch/simpleSwitch.cpp +++ b/backends/bmv2/simple_switch/simpleSwitch.cpp @@ -94,11 +94,14 @@ bool ParseV1Architecture::preorder(const IR::PackageBlock* main) { } ExternConverter_clone ExternConverter_clone::singleton; -ExternConverter_clone3_field_list ExternConverter_clone3_field_list::singleton; +ExternConverter_clone3_preserving_field_list + ExternConverter_clone3_preserving_field_list::singleton; ExternConverter_hash ExternConverter_hash::singleton; ExternConverter_digest ExternConverter_digest::singleton; -ExternConverter_resubmit_field_list ExternConverter_resubmit_field_list::singleton; -ExternConverter_recirculate_field_list ExternConverter_recirculate_field_list::singleton; +ExternConverter_resubmit_preserving_field_list + ExternConverter_resubmit_preserving_field_list::singleton; +ExternConverter_recirculate_preserving_field_list + ExternConverter_recirculate_preserving_field_list::singleton; ExternConverter_mark_to_drop ExternConverter_mark_to_drop::singleton; ExternConverter_random ExternConverter_random::singleton; ExternConverter_truncate ExternConverter_truncate::singleton; @@ -184,7 +187,7 @@ static unsigned getFieldListById(ConversionContext* ctxt, unsigned index) { return (unsigned)id; } -Util::IJson* ExternConverter_clone3_field_list::convertExternFunction( +Util::IJson* ExternConverter_clone3_preserving_field_list::convertExternFunction( ConversionContext* ctxt, UNUSED const P4::ExternFunction* ef, const IR::MethodCallExpression* mc, UNUSED const IR::StatOrDecl* s, UNUSED const bool emitExterns) { @@ -204,7 +207,7 @@ Util::IJson* ExternConverter_clone3_field_list::convertExternFunction( if (ei->name == "I2E") { prim = "clone_ingress_pkt_to_egress"; if (ctxt->blockConverted != BlockConverted::Ingress) { - ::error("'clone3_field_list(I2E, ...) not invoked in ingress %1%", mc); + ::error("'clone3_preserving_field_list(I2E, ...) not invoked in ingress %1%", mc); return nullptr; } } else { @@ -312,7 +315,7 @@ Util::IJson* ExternConverter_digest::convertExternFunction( return primitive; } -Util::IJson* ExternConverter_resubmit_field_list::convertExternFunction( +Util::IJson* ExternConverter_resubmit_preserving_field_list::convertExternFunction( ConversionContext* ctxt, UNUSED const P4::ExternFunction* ef, const IR::MethodCallExpression* mc, UNUSED const IR::StatOrDecl* s, UNUSED const bool emitExterns) { @@ -342,7 +345,7 @@ Util::IJson* ExternConverter_resubmit_field_list::convertExternFunction( return nullptr; } -Util::IJson* ExternConverter_recirculate_field_list::convertExternFunction( +Util::IJson* ExternConverter_recirculate_preserving_field_list::convertExternFunction( ConversionContext* ctxt, UNUSED const P4::ExternFunction* ef, const IR::MethodCallExpression* mc, UNUSED const IR::StatOrDecl* s, UNUSED const bool emitExterns) { diff --git a/backends/bmv2/simple_switch/simpleSwitch.h b/backends/bmv2/simple_switch/simpleSwitch.h index 70d4a10f87f..c0d64861f05 100644 --- a/backends/bmv2/simple_switch/simpleSwitch.h +++ b/backends/bmv2/simple_switch/simpleSwitch.h @@ -167,11 +167,11 @@ class SimpleSwitchBackend : public Backend { }; EXTERN_CONVERTER_W_FUNCTION(clone) -EXTERN_CONVERTER_W_FUNCTION_AND_MODEL(clone3_field_list, P4V1::V1Model, v1model) +EXTERN_CONVERTER_W_FUNCTION_AND_MODEL(clone3_preserving_field_list, P4V1::V1Model, v1model) EXTERN_CONVERTER_W_FUNCTION_AND_MODEL(hash, P4V1::V1Model, v1model) EXTERN_CONVERTER_W_FUNCTION(digest) -EXTERN_CONVERTER_W_FUNCTION(resubmit_field_list) -EXTERN_CONVERTER_W_FUNCTION(recirculate_field_list) +EXTERN_CONVERTER_W_FUNCTION(resubmit_preserving_field_list) +EXTERN_CONVERTER_W_FUNCTION(recirculate_preserving_field_list) EXTERN_CONVERTER_W_FUNCTION(mark_to_drop) EXTERN_CONVERTER_W_FUNCTION(log_msg) EXTERN_CONVERTER_W_FUNCTION_AND_MODEL(random, P4V1::V1Model, v1model) diff --git a/frontends/p4/fromv1.0/programStructure.cpp b/frontends/p4/fromv1.0/programStructure.cpp index b4a07a9b378..bb39cc9cbdc 100644 --- a/frontends/p4/fromv1.0/programStructure.cpp +++ b/frontends/p4/fromv1.0/programStructure.cpp @@ -2675,12 +2675,12 @@ void ProgramStructure::populateOutputNames() { "mark_to_drop", "hash", "resubmit", - "resubmit_field_list", + "resubmit_preserving_field_list", "recirculate", - "recirculate_field_list", + "recirculate_preserving_field_list", "clone", "clone3", - "clone3_field_list", + "clone3_preserving_field_list", "truncate", "V1Switch", // other v1model names diff --git a/frontends/p4/fromv1.0/v1model.h b/frontends/p4/fromv1.0/v1model.h index 3d12eb1a645..8a7a7123a31 100644 --- a/frontends/p4/fromv1.0/v1model.h +++ b/frontends/p4/fromv1.0/v1model.h @@ -202,7 +202,7 @@ struct Hash_Model : public ::Model::Elem { }; struct Cloner_Model : public ::Model::Extern_Model { - Cloner_Model() : Extern_Model("clone"), clone3("clone3_field_list"), cloneType(), + Cloner_Model() : Extern_Model("clone"), clone3("clone3_preserving_field_list"), cloneType(), sessionType(IR::Type_Bits::get(32)) {} ::Model::Elem clone3; CloneType_Model cloneType; @@ -250,13 +250,13 @@ class V1Model : public ::Model::Model { egress("egress", headersType, metadataType, standardMetadataType), ingress("ingress", headersType, metadataType, standardMetadataType), sw(), counterOrMeter("$"), counter(), meter(), random(), action_profile(), - action_selector(), clone(), resubmit("resubmit_field_list"), + action_selector(), clone(), resubmit("resubmit_preserving_field_list"), tableAttributes(), rangeMatchType("range"), optionalMatchType("optional"), selectorMatchType("selector"), verify("verifyChecksum", headersType), compute("computeChecksum", headersType), digest_receiver(), hash(), algorithm(), registers(), drop("mark_to_drop"), - recirculate("recirculate_field_list"), verify_checksum("verify_checksum"), + recirculate("recirculate_preserving_field_list"), verify_checksum("verify_checksum"), update_checksum("update_checksum"), verify_checksum_with_payload("verify_checksum_with_payload"), update_checksum_with_payload("update_checksum_with_payload"), diff --git a/frontends/p4/parseAnnotations.cpp b/frontends/p4/parseAnnotations.cpp index 7137b356631..6d4b3ff6738 100644 --- a/frontends/p4/parseAnnotations.cpp +++ b/frontends/p4/parseAnnotations.cpp @@ -46,6 +46,8 @@ ParseAnnotations::HandlerMap ParseAnnotations::standardHandlers() { // @match has an expression argument PARSE(IR::Annotation::matchAnnotation, Expression), + // @field_list also has an expression + PARSE(IR::Annotation::fieldListAnnotation, Expression), }; } diff --git a/ir/base.def b/ir/base.def index 98b45a1d6aa..09671d8aa8f 100644 --- a/ir/base.def +++ b/ir/base.def @@ -283,6 +283,7 @@ class Annotation { static const cstring noSideEffectsAnnotation; /// extern function/method annotation. static const cstring noWarnAnnotation; /// noWarn annotation. static const cstring matchAnnotation; /// Match annotation (for value sets). + static const cstring fieldListAnnotation; /// Used for recirculate, etc. toString{ return cstring("@") + name; } validate{ BUG_CHECK(!name.name.isNullOrEmpty(), "empty annotation name"); diff --git a/ir/type.cpp b/ir/type.cpp index dc087f310f9..86c4702bd86 100644 --- a/ir/type.cpp +++ b/ir/type.cpp @@ -50,6 +50,7 @@ const cstring IR::Annotation::pureAnnotation = "pure"; const cstring IR::Annotation::noSideEffectsAnnotation = "noSideEffects"; const cstring IR::Annotation::noWarnAnnotation = "noWarn"; const cstring IR::Annotation::matchAnnotation = "match"; +const cstring IR::Annotation::fieldListAnnotation = "field_list"; int Type_Declaration::nextId = 0; int Type_InfInt::nextId = 0; diff --git a/p4include/v1model.p4 b/p4include/v1model.p4 index 434620b4288..3bcc4fdab03 100644 --- a/p4include/v1model.p4 +++ b/p4include/v1model.p4 @@ -536,11 +536,11 @@ extern void update_checksum_with_payload(in bool condition, in T data, ino */ extern void clone(in CloneType type, in bit<32> session); -@deprecated("Please use 'resubmit_field_list' instead") +@deprecated("Please use 'resubmit_preserving_field_list' instead") extern void resubmit(in T data); /*** - * Calling resubmit during execution of the ingress control will, - * under certain documented conditions, cause the packet to be + * Calling resubmit_preserving_field_list during execution of the ingress + * control will cause the packet to be * resubmitted, i.e. it will begin processing again with the parser, * with the contents of the packet exactly as they were when it last * began parsing. The only difference is in the value of the @@ -557,14 +557,28 @@ extern void resubmit(in T data); * control, only one packet is resubmitted, and only the data from the * last such call is preserved. See the v1model architecture * documentation (Note 1) for more details. + * + * For example, the user metadata fields can be annotated as follows: + * struct UM { + * @field_list(1) + * bit<32> x; + * @field_list(1) + * @field_list(2) + * bit<32> y; + * bit<32> z; + * } + * + * Calling resubmit_preserving_field_list(1) will resubmit the packet + * and preserve fields x and y of the user metadata. Calling + * resubmit_preserving_field_list(2) will only preserve field y. */ -extern void resubmit_field_list(bit<8> index); +extern void resubmit_preserving_field_list(bit<8> index); -@deprecated("Please use 'recirculate_field_list' instead") +@deprecated("Please use 'recirculate_preserving_field_list' instead") extern void recirculate(in T data); /*** - * Calling recirculate during execution of the egress control will, - * under certain documented conditions, cause the packet to be + * Calling recirculate_preserving_field_list during execution of the + * egress control will cause the packet to be * recirculated, i.e. it will begin processing again with the parser, * with the contents of the packet as they are created by the * deparser. Recirculated packets can be distinguished from new @@ -582,14 +596,13 @@ extern void recirculate(in T data); * data from the last such call is preserved. See the v1model * architecture documentation (Note 1) for more details. */ -extern void recirculate_field_list(bit<8> index); -extern void clone(in CloneType type, in bit<32> session); +extern void recirculate_preserving_field_list(bit<8> index); -@deprecated("Please use 'clone3_field_list' instead") +@deprecated("Please use 'clone3_preserving_field_list' instead") extern void clone3(in CloneType type, in bit<32> session, in T data); /*** - * Calling clone3 during execution of the ingress or egress control + * Calling clone3_preserving_field_list during execution of the ingress or egress control * will cause the packet to be cloned, sometimes also called * mirroring, i.e. zero or more copies of the packet are made, and * each will later begin egress processing as an independent packet @@ -621,7 +634,7 @@ extern void clone3(in CloneType type, in bit<32> session, in T data); * clone session and data are used. See the v1model architecture * documentation (Note 1) for more details. */ -extern void clone3_field_list(in CloneType type, in bit<32> session, bit<8> index); +extern void clone3_preserving_field_list(in CloneType type, in bit<32> session, bit<8> index); extern void truncate(in bit<32> length); 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 a49705eff44..59fa7845832 100644 --- a/testdata/p4_14_samples_outputs/copy_to_cpu-first.p4 +++ b/testdata/p4_14_samples_outputs/copy_to_cpu-first.p4 @@ -77,7 +77,7 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { @name(".do_copy_to_cpu") action do_copy_to_cpu() { - clone3_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.copy_to_cpu_fields); + clone3_preserving_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.copy_to_cpu_fields); } @name(".copy_to_cpu") table copy_to_cpu { actions = { 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 e43209a6885..21f5f816d96 100644 --- a/testdata/p4_14_samples_outputs/copy_to_cpu-frontend.p4 +++ b/testdata/p4_14_samples_outputs/copy_to_cpu-frontend.p4 @@ -85,7 +85,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ @noWarn("unused") @name(".NoAction") action NoAction_3() { } @name(".do_copy_to_cpu") action do_copy_to_cpu() { - clone3_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.copy_to_cpu_fields); + clone3_preserving_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.copy_to_cpu_fields); } @name(".copy_to_cpu") table copy_to_cpu_0 { actions = { 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 efa4862943d..bf509393547 100644 --- a/testdata/p4_14_samples_outputs/copy_to_cpu-midend.p4 +++ b/testdata/p4_14_samples_outputs/copy_to_cpu-midend.p4 @@ -79,7 +79,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ @noWarn("unused") @name(".NoAction") action NoAction_3() { } @name(".do_copy_to_cpu") action do_copy_to_cpu() { - clone3_field_list(CloneType.I2E, 32w250, 8w0); + clone3_preserving_field_list(CloneType.I2E, 32w250, 8w0); } @name(".copy_to_cpu") table copy_to_cpu_0 { actions = { diff --git a/testdata/p4_14_samples_outputs/copy_to_cpu.p4 b/testdata/p4_14_samples_outputs/copy_to_cpu.p4 index c3961e63247..85e5c2bb2c5 100644 --- a/testdata/p4_14_samples_outputs/copy_to_cpu.p4 +++ b/testdata/p4_14_samples_outputs/copy_to_cpu.p4 @@ -75,7 +75,7 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { @name(".do_copy_to_cpu") action do_copy_to_cpu() { - clone3_field_list(CloneType.I2E, (bit<32>)32w250, (bit<8>)FieldLists.copy_to_cpu_fields); + clone3_preserving_field_list(CloneType.I2E, (bit<32>)32w250, (bit<8>)FieldLists.copy_to_cpu_fields); } @name(".copy_to_cpu") table copy_to_cpu { actions = { 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 858717c0648..7942915ca1f 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 @@ -65,13 +65,13 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710633; meta.mymeta.f1 = meta.mymeta.f1 + 8w23; meta.mymeta.clone_e2e_count = meta.mymeta.clone_e2e_count + 8w1; - clone3_field_list(CloneType.E2E, 32w1, (bit<8>)FieldLists.clone_e2e_FL); + clone3_preserving_field_list(CloneType.E2E, 32w1, (bit<8>)FieldLists.clone_e2e_FL); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710637; meta.mymeta.f1 = meta.mymeta.f1 + 8w19; meta.mymeta.recirculate_count = meta.mymeta.recirculate_count + 8w1; - recirculate_field_list((bit<8>)FieldLists.recirculate_FL); + recirculate_preserving_field_list((bit<8>)FieldLists.recirculate_FL); } @name("._nop") action _nop() { } @@ -229,7 +229,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710639; meta.mymeta.f1 = meta.mymeta.f1 + 8w17; meta.mymeta.resubmit_count = meta.mymeta.resubmit_count + 8w1; - resubmit_field_list((bit<8>)FieldLists.resubmit_FL); + resubmit_preserving_field_list((bit<8>)FieldLists.resubmit_FL); } @name("._nop") action _nop() { } 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 bfb3d934506..30004e82b03 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 @@ -65,13 +65,13 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710633; meta.mymeta.f1 = meta.mymeta.f1 + 8w23; meta.mymeta.clone_e2e_count = meta.mymeta.clone_e2e_count + 8w1; - clone3_field_list(CloneType.E2E, 32w1, (bit<8>)FieldLists.clone_e2e_FL); + clone3_preserving_field_list(CloneType.E2E, 32w1, (bit<8>)FieldLists.clone_e2e_FL); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710637; meta.mymeta.f1 = meta.mymeta.f1 + 8w19; meta.mymeta.recirculate_count = meta.mymeta.recirculate_count + 8w1; - recirculate_field_list((bit<8>)FieldLists.recirculate_FL); + recirculate_preserving_field_list((bit<8>)FieldLists.recirculate_FL); } @name("._nop") action _nop() { } @@ -258,7 +258,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710639; meta.mymeta.f1 = meta.mymeta.f1 + 8w17; meta.mymeta.resubmit_count = meta.mymeta.resubmit_count + 8w1; - resubmit_field_list((bit<8>)FieldLists.resubmit_FL); + resubmit_preserving_field_list((bit<8>)FieldLists.resubmit_FL); } @name("._nop") action _nop_3() { } 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 b0aae15e18c..8edbd11cead 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 @@ -66,13 +66,13 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710633; meta._mymeta_f14 = meta._mymeta_f14 + 8w23; meta._mymeta_clone_e2e_count2 = meta._mymeta_clone_e2e_count2 + 8w1; - clone3_field_list(CloneType.E2E, 32w1, 8w0); + clone3_preserving_field_list(CloneType.E2E, 32w1, 8w0); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710637; meta._mymeta_f14 = meta._mymeta_f14 + 8w19; meta._mymeta_recirculate_count1 = meta._mymeta_recirculate_count1 + 8w1; - recirculate_field_list(8w1); + recirculate_preserving_field_list(8w1); } @name("._nop") action _nop() { } @@ -259,7 +259,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710639; meta._mymeta_f14 = meta._mymeta_f14 + 8w17; meta._mymeta_resubmit_count0 = meta._mymeta_resubmit_count0 + 8w1; - resubmit_field_list(8w2); + resubmit_preserving_field_list(8w2); } @name("._nop") action _nop_3() { } 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 033e93f9c59..64fa13baf76 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 @@ -65,13 +65,13 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr - 48w23; meta.mymeta.f1 = meta.mymeta.f1 + 8w23; meta.mymeta.clone_e2e_count = meta.mymeta.clone_e2e_count + 8w1; - clone3_field_list(CloneType.E2E, (bit<32>)32w1, (bit<8>)FieldLists.clone_e2e_FL); + clone3_preserving_field_list(CloneType.E2E, (bit<32>)32w1, (bit<8>)FieldLists.clone_e2e_FL); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr - 48w19; meta.mymeta.f1 = meta.mymeta.f1 + 8w19; meta.mymeta.recirculate_count = meta.mymeta.recirculate_count + 8w1; - recirculate_field_list((bit<8>)FieldLists.recirculate_FL); + recirculate_preserving_field_list((bit<8>)FieldLists.recirculate_FL); } @name("._nop") action _nop() { } @@ -233,7 +233,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ethernet.srcAddr = hdr.ethernet.srcAddr - 48w17; meta.mymeta.f1 = meta.mymeta.f1 + 8w17; meta.mymeta.resubmit_count = meta.mymeta.resubmit_count + 8w1; - resubmit_field_list((bit<8>)FieldLists.resubmit_FL); + resubmit_preserving_field_list((bit<8>)FieldLists.resubmit_FL); } @name("._nop") action _nop() { } 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 96e27435adb..c93c24fd173 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 @@ -64,13 +64,13 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710633; meta.mymeta.f1 = meta.mymeta.f1 + 8w23; meta.mymeta.clone_e2e_count = meta.mymeta.clone_e2e_count + 8w1; - clone3_field_list(CloneType.E2E, 32w1, (bit<8>)FieldLists.clone_e2e_FL); + clone3_preserving_field_list(CloneType.E2E, 32w1, (bit<8>)FieldLists.clone_e2e_FL); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710637; meta.mymeta.f1 = meta.mymeta.f1 + 8w19; meta.mymeta.recirculate_count = meta.mymeta.recirculate_count + 8w1; - recirculate_field_list((bit<8>)FieldLists.recirculate_FL); + recirculate_preserving_field_list((bit<8>)FieldLists.recirculate_FL); } @name("._nop") action _nop() { } @@ -241,7 +241,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710639; meta.mymeta.f1 = meta.mymeta.f1 + 8w17; meta.mymeta.resubmit_count = meta.mymeta.resubmit_count + 8w1; - resubmit_field_list((bit<8>)FieldLists.resubmit_FL); + resubmit_preserving_field_list((bit<8>)FieldLists.resubmit_FL); } @name("._nop") action _nop() { } 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 3c66b896291..13f78b99c54 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 @@ -64,13 +64,13 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710633; meta.mymeta.f1 = meta.mymeta.f1 + 8w23; meta.mymeta.clone_e2e_count = meta.mymeta.clone_e2e_count + 8w1; - clone3_field_list(CloneType.E2E, 32w1, (bit<8>)FieldLists.clone_e2e_FL); + clone3_preserving_field_list(CloneType.E2E, 32w1, (bit<8>)FieldLists.clone_e2e_FL); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710637; meta.mymeta.f1 = meta.mymeta.f1 + 8w19; meta.mymeta.recirculate_count = meta.mymeta.recirculate_count + 8w1; - recirculate_field_list((bit<8>)FieldLists.recirculate_FL); + recirculate_preserving_field_list((bit<8>)FieldLists.recirculate_FL); } @name("._nop") action _nop() { } @@ -270,7 +270,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710639; meta.mymeta.f1 = meta.mymeta.f1 + 8w17; meta.mymeta.resubmit_count = meta.mymeta.resubmit_count + 8w1; - resubmit_field_list((bit<8>)FieldLists.resubmit_FL); + resubmit_preserving_field_list((bit<8>)FieldLists.resubmit_FL); } @name("._nop") action _nop_3() { } 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 28dc270b23b..bd33c187c56 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 @@ -64,13 +64,13 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710633; meta._mymeta_f14 = meta._mymeta_f14 + 8w23; meta._mymeta_clone_e2e_count2 = meta._mymeta_clone_e2e_count2 + 8w1; - clone3_field_list(CloneType.E2E, 32w1, 8w0); + clone3_preserving_field_list(CloneType.E2E, 32w1, 8w0); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710637; meta._mymeta_f14 = meta._mymeta_f14 + 8w19; meta._mymeta_recirculate_count1 = meta._mymeta_recirculate_count1 + 8w1; - recirculate_field_list(8w1); + recirculate_preserving_field_list(8w1); } @name("._nop") action _nop() { } @@ -270,7 +270,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710639; meta._mymeta_f14 = meta._mymeta_f14 + 8w17; meta._mymeta_resubmit_count0 = meta._mymeta_resubmit_count0 + 8w1; - resubmit_field_list(8w2); + resubmit_preserving_field_list(8w2); } @name("._nop") action _nop_3() { } 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 a3d585c61cb..a0d694bba7c 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 @@ -64,13 +64,13 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr - 48w23; meta.mymeta.f1 = meta.mymeta.f1 + 8w23; meta.mymeta.clone_e2e_count = meta.mymeta.clone_e2e_count + 8w1; - clone3_field_list(CloneType.E2E, (bit<32>)32w1, (bit<8>)FieldLists.clone_e2e_FL); + clone3_preserving_field_list(CloneType.E2E, (bit<32>)32w1, (bit<8>)FieldLists.clone_e2e_FL); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr - 48w19; meta.mymeta.f1 = meta.mymeta.f1 + 8w19; meta.mymeta.recirculate_count = meta.mymeta.recirculate_count + 8w1; - recirculate_field_list((bit<8>)FieldLists.recirculate_FL); + recirculate_preserving_field_list((bit<8>)FieldLists.recirculate_FL); } @name("._nop") action _nop() { } @@ -245,7 +245,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ethernet.srcAddr = hdr.ethernet.srcAddr - 48w17; meta.mymeta.f1 = meta.mymeta.f1 + 8w17; meta.mymeta.resubmit_count = meta.mymeta.resubmit_count + 8w1; - resubmit_field_list((bit<8>)FieldLists.resubmit_FL); + resubmit_preserving_field_list((bit<8>)FieldLists.resubmit_FL); } @name("._nop") action _nop() { } 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 4ee243d5eb7..3c2588a1558 100644 --- a/testdata/p4_14_samples_outputs/p414-special-ops-first.p4 +++ b/testdata/p4_14_samples_outputs/p414-special-ops-first.p4 @@ -64,13 +64,13 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710633; meta.mymeta.f1 = meta.mymeta.f1 + 8w23; meta.mymeta.clone_e2e_count = meta.mymeta.clone_e2e_count + 8w1; - clone3_field_list(CloneType.E2E, 32w1, (bit<8>)FieldLists.clone_e2e_FL); + clone3_preserving_field_list(CloneType.E2E, 32w1, (bit<8>)FieldLists.clone_e2e_FL); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710637; meta.mymeta.f1 = meta.mymeta.f1 + 8w19; meta.mymeta.recirculate_count = meta.mymeta.recirculate_count + 8w1; - recirculate_field_list((bit<8>)FieldLists.recirculate_FL); + recirculate_preserving_field_list((bit<8>)FieldLists.recirculate_FL); } @name("._nop") action _nop() { } @@ -228,7 +228,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710639; meta.mymeta.f1 = meta.mymeta.f1 + 8w17; meta.mymeta.resubmit_count = meta.mymeta.resubmit_count + 8w1; - resubmit_field_list((bit<8>)FieldLists.resubmit_FL); + resubmit_preserving_field_list((bit<8>)FieldLists.resubmit_FL); } @name("._nop") action _nop() { } 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 663f89616f8..1ac485f5a05 100644 --- a/testdata/p4_14_samples_outputs/p414-special-ops-frontend.p4 +++ b/testdata/p4_14_samples_outputs/p414-special-ops-frontend.p4 @@ -64,13 +64,13 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710633; meta.mymeta.f1 = meta.mymeta.f1 + 8w23; meta.mymeta.clone_e2e_count = meta.mymeta.clone_e2e_count + 8w1; - clone3_field_list(CloneType.E2E, 32w1, (bit<8>)FieldLists.clone_e2e_FL); + clone3_preserving_field_list(CloneType.E2E, 32w1, (bit<8>)FieldLists.clone_e2e_FL); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710637; meta.mymeta.f1 = meta.mymeta.f1 + 8w19; meta.mymeta.recirculate_count = meta.mymeta.recirculate_count + 8w1; - recirculate_field_list((bit<8>)FieldLists.recirculate_FL); + recirculate_preserving_field_list((bit<8>)FieldLists.recirculate_FL); } @name("._nop") action _nop() { } @@ -257,7 +257,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710639; meta.mymeta.f1 = meta.mymeta.f1 + 8w17; meta.mymeta.resubmit_count = meta.mymeta.resubmit_count + 8w1; - resubmit_field_list((bit<8>)FieldLists.resubmit_FL); + resubmit_preserving_field_list((bit<8>)FieldLists.resubmit_FL); } @name("._nop") action _nop_3() { } 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 f1cb7693de9..8e935cd059a 100644 --- a/testdata/p4_14_samples_outputs/p414-special-ops-midend.p4 +++ b/testdata/p4_14_samples_outputs/p414-special-ops-midend.p4 @@ -64,13 +64,13 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710633; meta._mymeta_f14 = meta._mymeta_f14 + 8w23; meta._mymeta_clone_e2e_count2 = meta._mymeta_clone_e2e_count2 + 8w1; - clone3_field_list(CloneType.E2E, 32w1, 8w0); + clone3_preserving_field_list(CloneType.E2E, 32w1, 8w0); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710637; meta._mymeta_f14 = meta._mymeta_f14 + 8w19; meta._mymeta_recirculate_count1 = meta._mymeta_recirculate_count1 + 8w1; - recirculate_field_list(8w1); + recirculate_preserving_field_list(8w1); } @name("._nop") action _nop() { } @@ -257,7 +257,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710639; meta._mymeta_f14 = meta._mymeta_f14 + 8w17; meta._mymeta_resubmit_count0 = meta._mymeta_resubmit_count0 + 8w1; - resubmit_field_list(8w2); + resubmit_preserving_field_list(8w2); } @name("._nop") action _nop_3() { } diff --git a/testdata/p4_14_samples_outputs/p414-special-ops.p4 b/testdata/p4_14_samples_outputs/p414-special-ops.p4 index 9dbc32438b4..7035802b03f 100644 --- a/testdata/p4_14_samples_outputs/p414-special-ops.p4 +++ b/testdata/p4_14_samples_outputs/p414-special-ops.p4 @@ -64,13 +64,13 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr - 48w23; meta.mymeta.f1 = meta.mymeta.f1 + 8w23; meta.mymeta.clone_e2e_count = meta.mymeta.clone_e2e_count + 8w1; - clone3_field_list(CloneType.E2E, (bit<32>)32w1, (bit<8>)FieldLists.clone_e2e_FL); + clone3_preserving_field_list(CloneType.E2E, (bit<32>)32w1, (bit<8>)FieldLists.clone_e2e_FL); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr - 48w19; meta.mymeta.f1 = meta.mymeta.f1 + 8w19; meta.mymeta.recirculate_count = meta.mymeta.recirculate_count + 8w1; - recirculate_field_list((bit<8>)FieldLists.recirculate_FL); + recirculate_preserving_field_list((bit<8>)FieldLists.recirculate_FL); } @name("._nop") action _nop() { } @@ -232,7 +232,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ethernet.srcAddr = hdr.ethernet.srcAddr - 48w17; meta.mymeta.f1 = meta.mymeta.f1 + 8w17; meta.mymeta.resubmit_count = meta.mymeta.resubmit_count + 8w1; - resubmit_field_list((bit<8>)FieldLists.resubmit_FL); + resubmit_preserving_field_list((bit<8>)FieldLists.resubmit_FL); } @name("._nop") action _nop() { } diff --git a/testdata/p4_14_samples_outputs/packet_redirect-first.p4 b/testdata/p4_14_samples_outputs/packet_redirect-first.p4 index 4b56c7e287e..56aefcef6ca 100644 --- a/testdata/p4_14_samples_outputs/packet_redirect-first.p4 +++ b/testdata/p4_14_samples_outputs/packet_redirect-first.p4 @@ -52,10 +52,10 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t @name("._nop") action _nop() { } @name("._recirculate") action _recirculate() { - recirculate_field_list((bit<8>)FieldLists.redirect_FL); + recirculate_preserving_field_list((bit<8>)FieldLists.redirect_FL); } @name("._clone_e2e") action _clone_e2e(bit<32> mirror_id) { - clone3_field_list(CloneType.E2E, mirror_id, (bit<8>)FieldLists.redirect_FL); + clone3_preserving_field_list(CloneType.E2E, mirror_id, (bit<8>)FieldLists.redirect_FL); } @name(".t_egress") table t_egress { actions = { @@ -87,10 +87,10 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ standard_metadata.mcast_grp = mgrp; } @name("._resubmit") action _resubmit() { - resubmit_field_list((bit<8>)FieldLists.redirect_FL); + resubmit_preserving_field_list((bit<8>)FieldLists.redirect_FL); } @name("._clone_i2e") action _clone_i2e(bit<32> mirror_id) { - clone3_field_list(CloneType.I2E, mirror_id, (bit<8>)FieldLists.redirect_FL); + clone3_preserving_field_list(CloneType.I2E, mirror_id, (bit<8>)FieldLists.redirect_FL); } @name(".t_ingress_1") table t_ingress_1 { actions = { diff --git a/testdata/p4_14_samples_outputs/packet_redirect-frontend.p4 b/testdata/p4_14_samples_outputs/packet_redirect-frontend.p4 index 0894be49d76..de4d3f40bea 100644 --- a/testdata/p4_14_samples_outputs/packet_redirect-frontend.p4 +++ b/testdata/p4_14_samples_outputs/packet_redirect-frontend.p4 @@ -54,10 +54,10 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t @name("._nop") action _nop() { } @name("._recirculate") action _recirculate() { - recirculate_field_list((bit<8>)FieldLists.redirect_FL); + recirculate_preserving_field_list((bit<8>)FieldLists.redirect_FL); } @name("._clone_e2e") action _clone_e2e(@name("mirror_id") bit<32> mirror_id) { - clone3_field_list(CloneType.E2E, mirror_id, (bit<8>)FieldLists.redirect_FL); + clone3_preserving_field_list(CloneType.E2E, mirror_id, (bit<8>)FieldLists.redirect_FL); } @name(".t_egress") table t_egress_0 { actions = { @@ -95,10 +95,10 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ standard_metadata.mcast_grp = mgrp; } @name("._resubmit") action _resubmit() { - resubmit_field_list((bit<8>)FieldLists.redirect_FL); + resubmit_preserving_field_list((bit<8>)FieldLists.redirect_FL); } @name("._clone_i2e") action _clone_i2e(@name("mirror_id") bit<32> mirror_id_2) { - clone3_field_list(CloneType.I2E, mirror_id_2, (bit<8>)FieldLists.redirect_FL); + clone3_preserving_field_list(CloneType.I2E, mirror_id_2, (bit<8>)FieldLists.redirect_FL); } @name(".t_ingress_1") table t_ingress { actions = { diff --git a/testdata/p4_14_samples_outputs/packet_redirect-midend.p4 b/testdata/p4_14_samples_outputs/packet_redirect-midend.p4 index 799237483e5..560353ed6f5 100644 --- a/testdata/p4_14_samples_outputs/packet_redirect-midend.p4 +++ b/testdata/p4_14_samples_outputs/packet_redirect-midend.p4 @@ -52,10 +52,10 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t @name("._nop") action _nop() { } @name("._recirculate") action _recirculate() { - recirculate_field_list(8w0); + recirculate_preserving_field_list(8w0); } @name("._clone_e2e") action _clone_e2e(@name("mirror_id") bit<32> mirror_id) { - clone3_field_list(CloneType.E2E, mirror_id, 8w0); + clone3_preserving_field_list(CloneType.E2E, mirror_id, 8w0); } @name(".t_egress") table t_egress_0 { actions = { @@ -93,10 +93,10 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ standard_metadata.mcast_grp = mgrp; } @name("._resubmit") action _resubmit() { - resubmit_field_list(8w0); + resubmit_preserving_field_list(8w0); } @name("._clone_i2e") action _clone_i2e(@name("mirror_id") bit<32> mirror_id_2) { - clone3_field_list(CloneType.I2E, mirror_id_2, 8w0); + clone3_preserving_field_list(CloneType.I2E, mirror_id_2, 8w0); } @name(".t_ingress_1") table t_ingress { actions = { diff --git a/testdata/p4_14_samples_outputs/packet_redirect.p4 b/testdata/p4_14_samples_outputs/packet_redirect.p4 index b88f88445c0..fa1b8f68134 100644 --- a/testdata/p4_14_samples_outputs/packet_redirect.p4 +++ b/testdata/p4_14_samples_outputs/packet_redirect.p4 @@ -52,10 +52,10 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t @name("._nop") action _nop() { } @name("._recirculate") action _recirculate() { - recirculate_field_list((bit<8>)FieldLists.redirect_FL); + recirculate_preserving_field_list((bit<8>)FieldLists.redirect_FL); } @name("._clone_e2e") action _clone_e2e(bit<32> mirror_id) { - clone3_field_list(CloneType.E2E, (bit<32>)mirror_id, (bit<8>)FieldLists.redirect_FL); + clone3_preserving_field_list(CloneType.E2E, (bit<32>)mirror_id, (bit<8>)FieldLists.redirect_FL); } @name(".t_egress") table t_egress { actions = { @@ -85,10 +85,10 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ standard_metadata.mcast_grp = mgrp; } @name("._resubmit") action _resubmit() { - resubmit_field_list((bit<8>)FieldLists.redirect_FL); + resubmit_preserving_field_list((bit<8>)FieldLists.redirect_FL); } @name("._clone_i2e") action _clone_i2e(bit<32> mirror_id) { - clone3_field_list(CloneType.I2E, (bit<32>)mirror_id, (bit<8>)FieldLists.redirect_FL); + clone3_preserving_field_list(CloneType.I2E, (bit<32>)mirror_id, (bit<8>)FieldLists.redirect_FL); } @name(".t_ingress_1") table t_ingress_1 { actions = { diff --git a/testdata/p4_14_samples_outputs/resubmit-first.p4 b/testdata/p4_14_samples_outputs/resubmit-first.p4 index 6d9edc96fdf..7fad2ed29ed 100644 --- a/testdata/p4_14_samples_outputs/resubmit-first.p4 +++ b/testdata/p4_14_samples_outputs/resubmit-first.p4 @@ -55,7 +55,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ } @name("._resubmit") action _resubmit() { meta.mymeta.f1 = 8w1; - resubmit_field_list((bit<8>)FieldLists.resubmit_FL); + resubmit_preserving_field_list((bit<8>)FieldLists.resubmit_FL); } @name(".t_ingress_1") table t_ingress_1 { actions = { diff --git a/testdata/p4_14_samples_outputs/resubmit-frontend.p4 b/testdata/p4_14_samples_outputs/resubmit-frontend.p4 index 37f4fe0adea..02a382f5cd6 100644 --- a/testdata/p4_14_samples_outputs/resubmit-frontend.p4 +++ b/testdata/p4_14_samples_outputs/resubmit-frontend.p4 @@ -61,7 +61,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ } @name("._resubmit") action _resubmit() { meta.mymeta.f1 = 8w1; - resubmit_field_list((bit<8>)FieldLists.resubmit_FL); + resubmit_preserving_field_list((bit<8>)FieldLists.resubmit_FL); } @name(".t_ingress_1") table t_ingress { actions = { diff --git a/testdata/p4_14_samples_outputs/resubmit-midend.p4 b/testdata/p4_14_samples_outputs/resubmit-midend.p4 index 50f5806255c..bdc242f73f8 100644 --- a/testdata/p4_14_samples_outputs/resubmit-midend.p4 +++ b/testdata/p4_14_samples_outputs/resubmit-midend.p4 @@ -57,7 +57,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ } @name("._resubmit") action _resubmit() { meta._mymeta_f10 = 8w1; - resubmit_field_list(8w0); + resubmit_preserving_field_list(8w0); } @name(".t_ingress_1") table t_ingress { actions = { diff --git a/testdata/p4_14_samples_outputs/resubmit.p4 b/testdata/p4_14_samples_outputs/resubmit.p4 index eeb35562fe0..91ef7319be3 100644 --- a/testdata/p4_14_samples_outputs/resubmit.p4 +++ b/testdata/p4_14_samples_outputs/resubmit.p4 @@ -55,7 +55,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ } @name("._resubmit") action _resubmit() { meta.mymeta.f1 = 8w1; - resubmit_field_list((bit<8>)FieldLists.resubmit_FL); + resubmit_preserving_field_list((bit<8>)FieldLists.resubmit_FL); } @name(".t_ingress_1") table t_ingress_1 { actions = { diff --git a/testdata/p4_14_samples_outputs/simple_nat-first.p4 b/testdata/p4_14_samples_outputs/simple_nat-first.p4 index 3f63f98876c..cc05e3c4700 100644 --- a/testdata/p4_14_samples_outputs/simple_nat-first.p4 +++ b/testdata/p4_14_samples_outputs/simple_nat-first.p4 @@ -185,7 +185,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ipv4.ttl = hdr.ipv4.ttl + 8w255; } @name(".nat_miss_int_to_ext") action nat_miss_int_to_ext() { - clone3_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.copy_to_cpu_fields); + clone3_preserving_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.copy_to_cpu_fields); } @name(".nat_miss_ext_to_int") action nat_miss_ext_to_int() { meta.meta.do_forward = 1w0; diff --git a/testdata/p4_14_samples_outputs/simple_nat-frontend.p4 b/testdata/p4_14_samples_outputs/simple_nat-frontend.p4 index 43648a591b5..c41e3cc1b86 100644 --- a/testdata/p4_14_samples_outputs/simple_nat-frontend.p4 +++ b/testdata/p4_14_samples_outputs/simple_nat-frontend.p4 @@ -210,7 +210,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ipv4.ttl = hdr.ipv4.ttl + 8w255; } @name(".nat_miss_int_to_ext") action nat_miss_int_to_ext() { - clone3_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.copy_to_cpu_fields); + clone3_preserving_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.copy_to_cpu_fields); } @name(".nat_miss_ext_to_int") action nat_miss_ext_to_int() { meta.meta.do_forward = 1w0; diff --git a/testdata/p4_14_samples_outputs/simple_nat-midend.p4 b/testdata/p4_14_samples_outputs/simple_nat-midend.p4 index 8570463384d..b771b5958cb 100644 --- a/testdata/p4_14_samples_outputs/simple_nat-midend.p4 +++ b/testdata/p4_14_samples_outputs/simple_nat-midend.p4 @@ -213,7 +213,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ipv4.ttl = hdr.ipv4.ttl + 8w255; } @name(".nat_miss_int_to_ext") action nat_miss_int_to_ext() { - clone3_field_list(CloneType.I2E, 32w250, 8w0); + clone3_preserving_field_list(CloneType.I2E, 32w250, 8w0); } @name(".nat_miss_ext_to_int") action nat_miss_ext_to_int() { meta._meta_do_forward0 = 1w0; diff --git a/testdata/p4_14_samples_outputs/simple_nat.p4 b/testdata/p4_14_samples_outputs/simple_nat.p4 index 28eef2179ff..080940d650b 100644 --- a/testdata/p4_14_samples_outputs/simple_nat.p4 +++ b/testdata/p4_14_samples_outputs/simple_nat.p4 @@ -181,7 +181,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ipv4.ttl = hdr.ipv4.ttl - 8w1; } @name(".nat_miss_int_to_ext") action nat_miss_int_to_ext() { - clone3_field_list(CloneType.I2E, (bit<32>)32w250, (bit<8>)FieldLists.copy_to_cpu_fields); + clone3_preserving_field_list(CloneType.I2E, (bit<32>)32w250, (bit<8>)FieldLists.copy_to_cpu_fields); } @name(".nat_miss_ext_to_int") action nat_miss_ext_to_int() { meta.meta.do_forward = 1w0; 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 06893d8514e..a656f30d2c9 100644 --- a/testdata/p4_14_samples_outputs/switch_20160512/switch-first.p4 +++ b/testdata/p4_14_samples_outputs/switch_20160512/switch-first.p4 @@ -2978,7 +2978,7 @@ control process_egress_acl(inout headers hdr, inout metadata meta, inout standar } @name(".egress_mirror") action egress_mirror(bit<32> session_id) { meta.i2e_metadata.mirror_session_id = (bit<16>)session_id; - clone3_field_list(CloneType.E2E, session_id, (bit<8>)FieldLists.e2e_mirror_info); + clone3_preserving_field_list(CloneType.E2E, session_id, (bit<8>)FieldLists.e2e_mirror_info); } @name(".egress_mirror_drop") action egress_mirror_drop(bit<32> session_id) { egress_mirror(session_id); @@ -2986,7 +2986,7 @@ control process_egress_acl(inout headers hdr, inout metadata meta, inout standar } @name(".egress_copy_to_cpu") action egress_copy_to_cpu(bit<16> reason_code) { meta.fabric_metadata.reason_code = reason_code; - clone3_field_list(CloneType.E2E, 32w250, (bit<8>)FieldLists.cpu_info); + clone3_preserving_field_list(CloneType.E2E, 32w250, (bit<8>)FieldLists.cpu_info); } @name(".egress_redirect_to_cpu") action egress_redirect_to_cpu(bit<16> reason_code) { egress_copy_to_cpu(reason_code); @@ -3510,7 +3510,7 @@ control process_int_endpoint(inout headers hdr, inout metadata meta, inout stand @name(".int_sink") action int_sink(bit<32> mirror_id) { meta.int_metadata_i2e.sink = 1w1; meta.i2e_metadata.mirror_session_id = (bit<16>)mirror_id; - clone3_field_list(CloneType.I2E, mirror_id, (bit<8>)FieldLists.int_i2e_mirror_info); + clone3_preserving_field_list(CloneType.I2E, mirror_id, (bit<8>)FieldLists.int_i2e_mirror_info); hdr.int_header.setInvalid(); hdr.int_val[0].setInvalid(); hdr.int_val[1].setInvalid(); @@ -4301,7 +4301,7 @@ control process_ingress_sflow(inout headers hdr, inout metadata meta, inout stan @name(".sflow_ing_pkt_to_cpu") action sflow_ing_pkt_to_cpu(bit<32> sflow_i2e_mirror_id, bit<16> reason_code) { meta.fabric_metadata.reason_code = reason_code; meta.i2e_metadata.mirror_session_id = (bit<16>)sflow_i2e_mirror_id; - clone3_field_list(CloneType.I2E, sflow_i2e_mirror_id, (bit<8>)FieldLists.sflow_cpu_info); + clone3_preserving_field_list(CloneType.I2E, sflow_i2e_mirror_id, (bit<8>)FieldLists.sflow_cpu_info); } @name(".sflow_ing_session_enable") action sflow_ing_session_enable(bit<32> rate_thr, bit<16> session_id) { meta.ingress_metadata.sflow_take_sample = rate_thr |+| meta.ingress_metadata.sflow_take_sample; @@ -4314,7 +4314,7 @@ control process_ingress_sflow(inout headers hdr, inout metadata meta, inout stan sflow_ingress_session_pkt_counter.count(); meta.fabric_metadata.reason_code = reason_code; meta.i2e_metadata.mirror_session_id = (bit<16>)sflow_i2e_mirror_id; - clone3_field_list(CloneType.I2E, sflow_i2e_mirror_id, (bit<8>)FieldLists.sflow_cpu_info); + clone3_preserving_field_list(CloneType.I2E, sflow_i2e_mirror_id, (bit<8>)FieldLists.sflow_cpu_info); } @name(".sflow_ing_take_sample") table sflow_ing_take_sample { actions = { @@ -4532,7 +4532,7 @@ control process_mac_acl(inout headers hdr, inout metadata meta, inout standard_m @name(".acl_mirror") action acl_mirror(bit<32> session_id, bit<14> acl_stats_index, bit<16> acl_meter_index) { meta.i2e_metadata.mirror_session_id = (bit<16>)session_id; meta.i2e_metadata.ingress_tstamp = (bit<32>)standard_metadata.ingress_global_timestamp; - clone3_field_list(CloneType.I2E, session_id, (bit<8>)FieldLists.i2e_mirror_info); + clone3_preserving_field_list(CloneType.I2E, session_id, (bit<8>)FieldLists.i2e_mirror_info); meta.acl_metadata.acl_stats_index = acl_stats_index; meta.meter_metadata.meter_index = acl_meter_index; } @@ -4600,7 +4600,7 @@ control process_ip_acl(inout headers hdr, inout metadata meta, inout standard_me @name(".acl_mirror") action acl_mirror(bit<32> session_id, bit<14> acl_stats_index, bit<16> acl_meter_index) { meta.i2e_metadata.mirror_session_id = (bit<16>)session_id; meta.i2e_metadata.ingress_tstamp = (bit<32>)standard_metadata.ingress_global_timestamp; - clone3_field_list(CloneType.I2E, session_id, (bit<8>)FieldLists.i2e_mirror_info); + clone3_preserving_field_list(CloneType.I2E, session_id, (bit<8>)FieldLists.i2e_mirror_info); meta.acl_metadata.acl_stats_index = acl_stats_index; meta.meter_metadata.meter_index = acl_meter_index; } @@ -5851,7 +5851,7 @@ control process_system_acl(inout headers hdr, inout metadata meta, inout standar } @name(".copy_to_cpu_with_reason") action copy_to_cpu_with_reason(bit<16> reason_code) { meta.fabric_metadata.reason_code = reason_code; - clone3_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.cpu_info); + clone3_preserving_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.cpu_info); } @name(".redirect_to_cpu") action redirect_to_cpu(bit<16> reason_code) { copy_to_cpu_with_reason(reason_code); @@ -5859,7 +5859,7 @@ control process_system_acl(inout headers hdr, inout metadata meta, inout standar meta.fabric_metadata.dst_device = 8w0; } @name(".copy_to_cpu") action copy_to_cpu() { - clone3_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.cpu_info); + clone3_preserving_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.cpu_info); } @name(".drop_packet") action drop_packet() { mark_to_drop(standard_metadata); @@ -5869,7 +5869,7 @@ control process_system_acl(inout headers hdr, inout metadata meta, inout standar mark_to_drop(standard_metadata); } @name(".negative_mirror") action negative_mirror(bit<32> session_id) { - clone3_field_list(CloneType.I2E, session_id, (bit<8>)FieldLists.mirror_info); + clone3_preserving_field_list(CloneType.I2E, session_id, (bit<8>)FieldLists.mirror_info); mark_to_drop(standard_metadata); } @name(".drop_stats") table drop_stats_0 { 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 4a51eaea924..c6e38b2d474 100644 --- a/testdata/p4_14_samples_outputs/switch_20160512/switch-frontend.p4 +++ b/testdata/p4_14_samples_outputs/switch_20160512/switch-frontend.p4 @@ -3045,16 +3045,16 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t } @name(".egress_mirror") action _egress_mirror_0(@name("session_id") bit<32> session_id) { meta.i2e_metadata.mirror_session_id = (bit<16>)session_id; - clone3_field_list(CloneType.E2E, session_id, (bit<8>)FieldLists.e2e_mirror_info); + clone3_preserving_field_list(CloneType.E2E, session_id, (bit<8>)FieldLists.e2e_mirror_info); } @name(".egress_mirror_drop") action _egress_mirror_drop_0(@name("session_id") bit<32> session_id_6) { meta.i2e_metadata.mirror_session_id = (bit<16>)session_id_6; - clone3_field_list(CloneType.E2E, session_id_6, (bit<8>)FieldLists.e2e_mirror_info); + clone3_preserving_field_list(CloneType.E2E, session_id_6, (bit<8>)FieldLists.e2e_mirror_info); mark_to_drop(standard_metadata); } @name(".egress_redirect_to_cpu") action _egress_redirect_to_cpu_0(@name("reason_code") bit<16> reason_code_0) { meta.fabric_metadata.reason_code = reason_code_0; - clone3_field_list(CloneType.E2E, 32w250, (bit<8>)FieldLists.cpu_info); + clone3_preserving_field_list(CloneType.E2E, 32w250, (bit<8>)FieldLists.cpu_info); mark_to_drop(standard_metadata); } @name(".egress_acl") table _egress_acl { @@ -3654,7 +3654,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ meta.int_metadata.insert_byte_cnt = meta.int_metadata.gpe_int_hdr_len << 2; meta.int_metadata_i2e.sink = 1w1; meta.i2e_metadata.mirror_session_id = (bit<16>)mirror_id; - clone3_field_list(CloneType.I2E, mirror_id, (bit<8>)FieldLists.int_i2e_mirror_info); + clone3_preserving_field_list(CloneType.I2E, mirror_id, (bit<8>)FieldLists.int_i2e_mirror_info); hdr.int_header.setInvalid(); hdr.int_val[0].setInvalid(); hdr.int_val[1].setInvalid(); @@ -4344,7 +4344,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ _sflow_ingress_session_pkt_counter.count(); meta.fabric_metadata.reason_code = reason_code_5; meta.i2e_metadata.mirror_session_id = (bit<16>)sflow_i2e_mirror_id; - clone3_field_list(CloneType.I2E, sflow_i2e_mirror_id, (bit<8>)FieldLists.sflow_cpu_info); + clone3_preserving_field_list(CloneType.I2E, sflow_i2e_mirror_id, (bit<8>)FieldLists.sflow_cpu_info); } @name(".sflow_ing_take_sample") table _sflow_ing_take_sample { actions = { @@ -4528,7 +4528,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ @name(".acl_mirror") action _acl_mirror_1(@name("session_id") bit<32> session_id_8, @name("acl_stats_index") bit<14> acl_stats_index_20, @name("acl_meter_index") bit<16> acl_meter_index_11) { meta.i2e_metadata.mirror_session_id = (bit<16>)session_id_8; meta.i2e_metadata.ingress_tstamp = (bit<32>)standard_metadata.ingress_global_timestamp; - clone3_field_list(CloneType.I2E, session_id_8, (bit<8>)FieldLists.i2e_mirror_info); + clone3_preserving_field_list(CloneType.I2E, session_id_8, (bit<8>)FieldLists.i2e_mirror_info); meta.acl_metadata.acl_stats_index = acl_stats_index_20; meta.meter_metadata.meter_index = acl_meter_index_11; } @@ -4603,14 +4603,14 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ @name(".acl_mirror") action _acl_mirror_2(@name("session_id") bit<32> session_id_9, @name("acl_stats_index") bit<14> acl_stats_index_27, @name("acl_meter_index") bit<16> acl_meter_index_18) { meta.i2e_metadata.mirror_session_id = (bit<16>)session_id_9; meta.i2e_metadata.ingress_tstamp = (bit<32>)standard_metadata.ingress_global_timestamp; - clone3_field_list(CloneType.I2E, session_id_9, (bit<8>)FieldLists.i2e_mirror_info); + clone3_preserving_field_list(CloneType.I2E, session_id_9, (bit<8>)FieldLists.i2e_mirror_info); meta.acl_metadata.acl_stats_index = acl_stats_index_27; meta.meter_metadata.meter_index = acl_meter_index_18; } @name(".acl_mirror") action _acl_mirror_3(@name("session_id") bit<32> session_id_10, @name("acl_stats_index") bit<14> acl_stats_index_28, @name("acl_meter_index") bit<16> acl_meter_index_19) { meta.i2e_metadata.mirror_session_id = (bit<16>)session_id_10; meta.i2e_metadata.ingress_tstamp = (bit<32>)standard_metadata.ingress_global_timestamp; - clone3_field_list(CloneType.I2E, session_id_10, (bit<8>)FieldLists.i2e_mirror_info); + clone3_preserving_field_list(CloneType.I2E, session_id_10, (bit<8>)FieldLists.i2e_mirror_info); meta.acl_metadata.acl_stats_index = acl_stats_index_28; meta.meter_metadata.meter_index = acl_meter_index_19; } @@ -5604,16 +5604,16 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ } @name(".copy_to_cpu_with_reason") action _copy_to_cpu_with_reason_0(@name("reason_code") bit<16> reason_code_6) { meta.fabric_metadata.reason_code = reason_code_6; - clone3_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.cpu_info); + clone3_preserving_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.cpu_info); } @name(".redirect_to_cpu") action _redirect_to_cpu_0(@name("reason_code") bit<16> reason_code_7) { meta.fabric_metadata.reason_code = reason_code_7; - clone3_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.cpu_info); + clone3_preserving_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.cpu_info); mark_to_drop(standard_metadata); meta.fabric_metadata.dst_device = 8w0; } @name(".copy_to_cpu") action _copy_to_cpu_0() { - clone3_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.cpu_info); + clone3_preserving_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.cpu_info); } @name(".drop_packet") action _drop_packet_0() { mark_to_drop(standard_metadata); @@ -5623,7 +5623,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ mark_to_drop(standard_metadata); } @name(".negative_mirror") action _negative_mirror_0(@name("session_id") bit<32> session_id_11) { - clone3_field_list(CloneType.I2E, session_id_11, (bit<8>)FieldLists.mirror_info); + clone3_preserving_field_list(CloneType.I2E, session_id_11, (bit<8>)FieldLists.mirror_info); mark_to_drop(standard_metadata); } @name(".drop_stats") table _drop_stats { 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 c1a20cd08ba..f13dfb38805 100644 --- a/testdata/p4_14_samples_outputs/switch_20160512/switch-midend.p4 +++ b/testdata/p4_14_samples_outputs/switch_20160512/switch-midend.p4 @@ -3149,16 +3149,16 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t } @name(".egress_mirror") action _egress_mirror_0(@name("session_id") bit<32> session_id) { meta._i2e_metadata_mirror_session_id36 = (bit<16>)session_id; - clone3_field_list(CloneType.E2E, session_id, 8w2); + clone3_preserving_field_list(CloneType.E2E, session_id, 8w2); } @name(".egress_mirror_drop") action _egress_mirror_drop_0(@name("session_id") bit<32> session_id_6) { meta._i2e_metadata_mirror_session_id36 = (bit<16>)session_id_6; - clone3_field_list(CloneType.E2E, session_id_6, 8w2); + clone3_preserving_field_list(CloneType.E2E, session_id_6, 8w2); mark_to_drop(standard_metadata); } @name(".egress_redirect_to_cpu") action _egress_redirect_to_cpu_0(@name("reason_code") bit<16> reason_code_0) { meta._fabric_metadata_reason_code28 = reason_code_0; - clone3_field_list(CloneType.E2E, 32w250, 8w1); + clone3_preserving_field_list(CloneType.E2E, 32w250, 8w1); mark_to_drop(standard_metadata); } @name(".egress_acl") table _egress_acl { @@ -3801,7 +3801,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ meta._int_metadata_insert_byte_cnt50 = meta._int_metadata_gpe_int_hdr_len51 << 2; meta._int_metadata_i2e_sink54 = 1w1; meta._i2e_metadata_mirror_session_id36 = (bit<16>)mirror_id; - clone3_field_list(CloneType.I2E, mirror_id, 8w3); + clone3_preserving_field_list(CloneType.I2E, mirror_id, 8w3); hdr.int_header.setInvalid(); hdr.int_val[0].setInvalid(); hdr.int_val[1].setInvalid(); @@ -4491,7 +4491,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ _sflow_ingress_session_pkt_counter.count(); meta._fabric_metadata_reason_code28 = reason_code_5; meta._i2e_metadata_mirror_session_id36 = (bit<16>)sflow_i2e_mirror_id; - clone3_field_list(CloneType.I2E, sflow_i2e_mirror_id, 8w5); + clone3_preserving_field_list(CloneType.I2E, sflow_i2e_mirror_id, 8w5); } @name(".sflow_ing_take_sample") table _sflow_ing_take_sample { actions = { @@ -4675,7 +4675,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ @name(".acl_mirror") action _acl_mirror_1(@name("session_id") bit<32> session_id_8, @name("acl_stats_index") bit<14> acl_stats_index_20, @name("acl_meter_index") bit<16> acl_meter_index_11) { meta._i2e_metadata_mirror_session_id36 = (bit<16>)session_id_8; meta._i2e_metadata_ingress_tstamp35 = (bit<32>)standard_metadata.ingress_global_timestamp; - clone3_field_list(CloneType.I2E, session_id_8, 8w0); + clone3_preserving_field_list(CloneType.I2E, session_id_8, 8w0); meta._acl_metadata_acl_stats_index11 = acl_stats_index_20; meta._meter_metadata_meter_index107 = acl_meter_index_11; } @@ -4750,14 +4750,14 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ @name(".acl_mirror") action _acl_mirror_2(@name("session_id") bit<32> session_id_9, @name("acl_stats_index") bit<14> acl_stats_index_27, @name("acl_meter_index") bit<16> acl_meter_index_18) { meta._i2e_metadata_mirror_session_id36 = (bit<16>)session_id_9; meta._i2e_metadata_ingress_tstamp35 = (bit<32>)standard_metadata.ingress_global_timestamp; - clone3_field_list(CloneType.I2E, session_id_9, 8w0); + clone3_preserving_field_list(CloneType.I2E, session_id_9, 8w0); meta._acl_metadata_acl_stats_index11 = acl_stats_index_27; meta._meter_metadata_meter_index107 = acl_meter_index_18; } @name(".acl_mirror") action _acl_mirror_3(@name("session_id") bit<32> session_id_10, @name("acl_stats_index") bit<14> acl_stats_index_28, @name("acl_meter_index") bit<16> acl_meter_index_19) { meta._i2e_metadata_mirror_session_id36 = (bit<16>)session_id_10; meta._i2e_metadata_ingress_tstamp35 = (bit<32>)standard_metadata.ingress_global_timestamp; - clone3_field_list(CloneType.I2E, session_id_10, 8w0); + clone3_preserving_field_list(CloneType.I2E, session_id_10, 8w0); meta._acl_metadata_acl_stats_index11 = acl_stats_index_28; meta._meter_metadata_meter_index107 = acl_meter_index_19; } @@ -5751,16 +5751,16 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ } @name(".copy_to_cpu_with_reason") action _copy_to_cpu_with_reason_0(@name("reason_code") bit<16> reason_code_6) { meta._fabric_metadata_reason_code28 = reason_code_6; - clone3_field_list(CloneType.I2E, 32w250, 8w1); + clone3_preserving_field_list(CloneType.I2E, 32w250, 8w1); } @name(".redirect_to_cpu") action _redirect_to_cpu_0(@name("reason_code") bit<16> reason_code_7) { meta._fabric_metadata_reason_code28 = reason_code_7; - clone3_field_list(CloneType.I2E, 32w250, 8w1); + clone3_preserving_field_list(CloneType.I2E, 32w250, 8w1); mark_to_drop(standard_metadata); meta._fabric_metadata_dst_device29 = 8w0; } @name(".copy_to_cpu") action _copy_to_cpu_0() { - clone3_field_list(CloneType.I2E, 32w250, 8w1); + clone3_preserving_field_list(CloneType.I2E, 32w250, 8w1); } @name(".drop_packet") action _drop_packet_0() { mark_to_drop(standard_metadata); @@ -5770,7 +5770,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ mark_to_drop(standard_metadata); } @name(".negative_mirror") action _negative_mirror_0(@name("session_id") bit<32> session_id_11) { - clone3_field_list(CloneType.I2E, session_id_11, 8w4); + clone3_preserving_field_list(CloneType.I2E, session_id_11, 8w4); mark_to_drop(standard_metadata); } @name(".drop_stats") table _drop_stats { diff --git a/testdata/p4_14_samples_outputs/switch_20160512/switch.p4 b/testdata/p4_14_samples_outputs/switch_20160512/switch.p4 index 794d3f944ac..4ebc252f881 100644 --- a/testdata/p4_14_samples_outputs/switch_20160512/switch.p4 +++ b/testdata/p4_14_samples_outputs/switch_20160512/switch.p4 @@ -2924,7 +2924,7 @@ control process_egress_acl(inout headers hdr, inout metadata meta, inout standar } @name(".egress_mirror") action egress_mirror(bit<32> session_id) { meta.i2e_metadata.mirror_session_id = (bit<16>)session_id; - clone3_field_list(CloneType.E2E, (bit<32>)session_id, (bit<8>)FieldLists.e2e_mirror_info); + clone3_preserving_field_list(CloneType.E2E, (bit<32>)session_id, (bit<8>)FieldLists.e2e_mirror_info); } @name(".egress_mirror_drop") action egress_mirror_drop(bit<32> session_id) { egress_mirror(session_id); @@ -2932,7 +2932,7 @@ control process_egress_acl(inout headers hdr, inout metadata meta, inout standar } @name(".egress_copy_to_cpu") action egress_copy_to_cpu(bit<16> reason_code) { meta.fabric_metadata.reason_code = reason_code; - clone3_field_list(CloneType.E2E, (bit<32>)32w250, (bit<8>)FieldLists.cpu_info); + clone3_preserving_field_list(CloneType.E2E, (bit<32>)32w250, (bit<8>)FieldLists.cpu_info); } @name(".egress_redirect_to_cpu") action egress_redirect_to_cpu(bit<16> reason_code) { egress_copy_to_cpu(reason_code); @@ -3428,7 +3428,7 @@ control process_int_endpoint(inout headers hdr, inout metadata meta, inout stand @name(".int_sink") action int_sink(bit<32> mirror_id) { meta.int_metadata_i2e.sink = 1w1; meta.i2e_metadata.mirror_session_id = (bit<16>)mirror_id; - clone3_field_list(CloneType.I2E, (bit<32>)mirror_id, (bit<8>)FieldLists.int_i2e_mirror_info); + clone3_preserving_field_list(CloneType.I2E, (bit<32>)mirror_id, (bit<8>)FieldLists.int_i2e_mirror_info); hdr.int_header.setInvalid(); hdr.int_val[0].setInvalid(); hdr.int_val[1].setInvalid(); @@ -4177,7 +4177,7 @@ control process_ingress_sflow(inout headers hdr, inout metadata meta, inout stan @name(".sflow_ing_pkt_to_cpu") action sflow_ing_pkt_to_cpu(bit<32> sflow_i2e_mirror_id, bit<16> reason_code) { meta.fabric_metadata.reason_code = reason_code; meta.i2e_metadata.mirror_session_id = (bit<16>)sflow_i2e_mirror_id; - clone3_field_list(CloneType.I2E, (bit<32>)sflow_i2e_mirror_id, (bit<8>)FieldLists.sflow_cpu_info); + clone3_preserving_field_list(CloneType.I2E, (bit<32>)sflow_i2e_mirror_id, (bit<8>)FieldLists.sflow_cpu_info); } @name(".sflow_ing_session_enable") action sflow_ing_session_enable(bit<32> rate_thr, bit<16> session_id) { meta.ingress_metadata.sflow_take_sample = rate_thr |+| meta.ingress_metadata.sflow_take_sample; @@ -4190,7 +4190,7 @@ control process_ingress_sflow(inout headers hdr, inout metadata meta, inout stan sflow_ingress_session_pkt_counter.count(); meta.fabric_metadata.reason_code = reason_code; meta.i2e_metadata.mirror_session_id = (bit<16>)sflow_i2e_mirror_id; - clone3_field_list(CloneType.I2E, (bit<32>)sflow_i2e_mirror_id, (bit<8>)FieldLists.sflow_cpu_info); + clone3_preserving_field_list(CloneType.I2E, (bit<32>)sflow_i2e_mirror_id, (bit<8>)FieldLists.sflow_cpu_info); } @name(".sflow_ing_take_sample") table sflow_ing_take_sample { actions = { @@ -4396,7 +4396,7 @@ control process_mac_acl(inout headers hdr, inout metadata meta, inout standard_m @name(".acl_mirror") action acl_mirror(bit<32> session_id, bit<14> acl_stats_index, bit<16> acl_meter_index) { meta.i2e_metadata.mirror_session_id = (bit<16>)session_id; meta.i2e_metadata.ingress_tstamp = (bit<32>)standard_metadata.ingress_global_timestamp; - clone3_field_list(CloneType.I2E, (bit<32>)session_id, (bit<8>)FieldLists.i2e_mirror_info); + clone3_preserving_field_list(CloneType.I2E, (bit<32>)session_id, (bit<8>)FieldLists.i2e_mirror_info); meta.acl_metadata.acl_stats_index = acl_stats_index; meta.meter_metadata.meter_index = acl_meter_index; } @@ -4462,7 +4462,7 @@ control process_ip_acl(inout headers hdr, inout metadata meta, inout standard_me @name(".acl_mirror") action acl_mirror(bit<32> session_id, bit<14> acl_stats_index, bit<16> acl_meter_index) { meta.i2e_metadata.mirror_session_id = (bit<16>)session_id; meta.i2e_metadata.ingress_tstamp = (bit<32>)standard_metadata.ingress_global_timestamp; - clone3_field_list(CloneType.I2E, (bit<32>)session_id, (bit<8>)FieldLists.i2e_mirror_info); + clone3_preserving_field_list(CloneType.I2E, (bit<32>)session_id, (bit<8>)FieldLists.i2e_mirror_info); meta.acl_metadata.acl_stats_index = acl_stats_index; meta.meter_metadata.meter_index = acl_meter_index; } @@ -5627,7 +5627,7 @@ control process_system_acl(inout headers hdr, inout metadata meta, inout standar } @name(".copy_to_cpu_with_reason") action copy_to_cpu_with_reason(bit<16> reason_code) { meta.fabric_metadata.reason_code = reason_code; - clone3_field_list(CloneType.I2E, (bit<32>)32w250, (bit<8>)FieldLists.cpu_info); + clone3_preserving_field_list(CloneType.I2E, (bit<32>)32w250, (bit<8>)FieldLists.cpu_info); } @name(".redirect_to_cpu") action redirect_to_cpu(bit<16> reason_code) { copy_to_cpu_with_reason(reason_code); @@ -5635,7 +5635,7 @@ control process_system_acl(inout headers hdr, inout metadata meta, inout standar meta.fabric_metadata.dst_device = 8w0; } @name(".copy_to_cpu") action copy_to_cpu() { - clone3_field_list(CloneType.I2E, (bit<32>)32w250, (bit<8>)FieldLists.cpu_info); + clone3_preserving_field_list(CloneType.I2E, (bit<32>)32w250, (bit<8>)FieldLists.cpu_info); } @name(".drop_packet") action drop_packet() { mark_to_drop(standard_metadata); @@ -5645,7 +5645,7 @@ control process_system_acl(inout headers hdr, inout metadata meta, inout standar mark_to_drop(standard_metadata); } @name(".negative_mirror") action negative_mirror(bit<32> session_id) { - clone3_field_list(CloneType.I2E, (bit<32>)session_id, (bit<8>)FieldLists.mirror_info); + clone3_preserving_field_list(CloneType.I2E, (bit<32>)session_id, (bit<8>)FieldLists.mirror_info); mark_to_drop(standard_metadata); } @name(".drop_stats") table drop_stats_0 { diff --git a/testdata/p4_16_samples/issue1001-1-bmv2.p4 b/testdata/p4_16_samples/issue1001-1-bmv2.p4 new file mode 100644 index 00000000000..1b9644460b0 --- /dev/null +++ b/testdata/p4_16_samples/issue1001-1-bmv2.p4 @@ -0,0 +1,33 @@ +#include +#include + +struct Headers {} + +enum bit<8> PreservedFieldList { + Field = 8w1 +} + +struct Meta { + @field_list(PreservedFieldList.Field) + bit<1> b; +} + +parser p(packet_in b, out Headers h, inout Meta m, inout standard_metadata_t sm) { + state start { + m.b = m.b + 1; + transition accept; + } +} + +control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { + apply { + clone3_preserving_field_list(CloneType.I2E, 32w64, PreservedFieldList.Field); + } +} + +control vrfy(inout Headers h, inout Meta m) { apply {} } +control update(inout Headers h, inout Meta m) { apply {} } +control egress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { apply {} } +control deparser(packet_out b, in Headers h) { apply {} } + +V1Switch(p(), vrfy(), ingress(), egress(), update(), deparser()) main; diff --git a/testdata/p4_16_samples/issue1001-bmv2.p4 b/testdata/p4_16_samples/issue1001-bmv2.p4 index 7f9ab891afd..ddae22feb9b 100644 --- a/testdata/p4_16_samples/issue1001-bmv2.p4 +++ b/testdata/p4_16_samples/issue1001-bmv2.p4 @@ -17,7 +17,7 @@ parser p(packet_in b, out Headers h, inout Meta m, inout standard_metadata_t sm) control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { apply { - clone3_field_list(CloneType.I2E, 32w64, 0); + clone3_preserving_field_list(CloneType.I2E, 32w64, 0); } } diff --git a/testdata/p4_16_samples/issue1043-bmv2.p4 b/testdata/p4_16_samples/issue1043-bmv2.p4 index bdc0e1e2668..bbe35d09830 100644 --- a/testdata/p4_16_samples/issue1043-bmv2.p4 +++ b/testdata/p4_16_samples/issue1043-bmv2.p4 @@ -30,7 +30,7 @@ control deparser(packet_out b, in Headers h) { control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { apply { - resubmit_field_list(0); + resubmit_preserving_field_list(0); sm.egress_spec = 0; } } diff --git a/testdata/p4_16_samples/issue1642-bmv2.p4 b/testdata/p4_16_samples/issue1642-bmv2.p4 index a3cb4428f83..46b4bb571c4 100644 --- a/testdata/p4_16_samples/issue1642-bmv2.p4 +++ b/testdata/p4_16_samples/issue1642-bmv2.p4 @@ -39,7 +39,7 @@ control ingress(inout parsed_packet_t hdr, local_metadata.row.alt0 = local_metadata.row.alt1; local_metadata.row.alt0.valid = 1; local_metadata.row.alt1.port = local_metadata.row.alt1.port + 1; - clone3_field_list(CloneType.I2E, 0, 0); + clone3_preserving_field_list(CloneType.I2E, 0, 0); } } diff --git a/testdata/p4_16_samples/issue1653-bmv2.p4 b/testdata/p4_16_samples/issue1653-bmv2.p4 index 69eb809642c..99b0bb1a57e 100644 --- a/testdata/p4_16_samples/issue1653-bmv2.p4 +++ b/testdata/p4_16_samples/issue1653-bmv2.p4 @@ -45,7 +45,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, apply { // Copy another header's data to local variable. bh.x = h.bvh0.x; - clone3_field_list(CloneType.I2E, 0, 0); + clone3_preserving_field_list(CloneType.I2E, 0, 0); } } diff --git a/testdata/p4_16_samples/issue1653-complex-bmv2.p4 b/testdata/p4_16_samples/issue1653-complex-bmv2.p4 index 757d0d60597..07e0810a1bb 100644 --- a/testdata/p4_16_samples/issue1653-complex-bmv2.p4 +++ b/testdata/p4_16_samples/issue1653-complex-bmv2.p4 @@ -96,7 +96,7 @@ control ingress(inout parsed_packet_t h, h.bvh0.row.alt1.type = bh.row.alt1.type; local_metadata.row0.alt0.useHash = true; - clone3_field_list(CloneType.I2E, 0, 0); + clone3_preserving_field_list(CloneType.I2E, 0, 0); } } diff --git a/testdata/p4_16_samples/issue1660-bmv2.p4 b/testdata/p4_16_samples/issue1660-bmv2.p4 index 1d0f7f85314..c02be08fe07 100644 --- a/testdata/p4_16_samples/issue1660-bmv2.p4 +++ b/testdata/p4_16_samples/issue1660-bmv2.p4 @@ -20,7 +20,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, apply { HasBool b; b.x = true; - clone3_field_list(CloneType.I2E, 0, 0); + clone3_preserving_field_list(CloneType.I2E, 0, 0); } } diff --git a/testdata/p4_16_samples/issue1765-1-bmv2.p4 b/testdata/p4_16_samples/issue1765-1-bmv2.p4 index 755bc63d540..b2cc9a945f8 100644 --- a/testdata/p4_16_samples/issue1765-1-bmv2.p4 +++ b/testdata/p4_16_samples/issue1765-1-bmv2.p4 @@ -208,12 +208,12 @@ control MyIngress(inout headers hdr, inout metadata meta, inout standard_metadat action controller_debug() { meta.task = TASK_DEBUG; meta.ingress_port = standard_metadata.ingress_port; - clone3_field_list(CloneType.I2E, 100, 0); + clone3_preserving_field_list(CloneType.I2E, 100, 0); } action controller_reply(task_t task) { meta.task = task; meta.ingress_port = standard_metadata.ingress_port; - clone3_field_list(CloneType.I2E, 100, 0); + clone3_preserving_field_list(CloneType.I2E, 100, 0); } action multicast_pkg(mcast_t mcast_grp) { standard_metadata.mcast_grp = mcast_grp; diff --git a/testdata/p4_16_samples/issue383-bmv2.p4 b/testdata/p4_16_samples/issue383-bmv2.p4 index 8562abd7b15..12000fd87ee 100644 --- a/testdata/p4_16_samples/issue383-bmv2.p4 +++ b/testdata/p4_16_samples/issue383-bmv2.p4 @@ -106,7 +106,7 @@ control ingress(inout parsed_packet_t h, local_metadata.row0.alt0 = local_metadata.row1.alt1; local_metadata.row1.alt0.valid = 1; local_metadata.row1.alt1.port = local_metadata.row0.alt1.port + 1; - clone3_field_list(CloneType.I2E, 0, 0); + clone3_preserving_field_list(CloneType.I2E, 0, 0); /* Cast support is TODO for bmv2. diff --git a/testdata/p4_16_samples/issue562-bmv2.p4 b/testdata/p4_16_samples/issue562-bmv2.p4 index 67251266801..e63f0440823 100644 --- a/testdata/p4_16_samples/issue562-bmv2.p4 +++ b/testdata/p4_16_samples/issue562-bmv2.p4 @@ -32,7 +32,7 @@ control ingress(inout parsed_packet_t hdr, local_metadata.row.alt0 = local_metadata.row.alt1; local_metadata.row.alt0.valid = 1; local_metadata.row.alt1.port = local_metadata.row.alt1.port + 1; - clone3_field_list(CloneType.I2E, 0, 0); + clone3_preserving_field_list(CloneType.I2E, 0, 0); } } diff --git a/testdata/p4_16_samples/v1model-special-ops-bmv2.p4 b/testdata/p4_16_samples/v1model-special-ops-bmv2.p4 index 132eecbcfb6..042f95a3906 100644 --- a/testdata/p4_16_samples/v1model-special-ops-bmv2.p4 +++ b/testdata/p4_16_samples/v1model-special-ops-bmv2.p4 @@ -229,7 +229,7 @@ control ingress(inout headers_t hdr, // If you give an entire struct, it includes all fields inside // of that struct. - resubmit_field_list(0); + resubmit_preserving_field_list(0); } action do_clone_i2e(bit<32> l2ptr) { // BMv2 simple_switch can have multiple different clone @@ -244,7 +244,7 @@ control ingress(inout headers_t hdr, // resubmit() call above. clone() is the same as clone3(), // except there are only 2 parameters, and thus no metadata // field values are preserved in the cloned packet. - clone3_field_list(CloneType.I2E, I2E_CLONE_SESSION_ID, 0); + clone3_preserving_field_list(CloneType.I2E, I2E_CLONE_SESSION_ID, 0); meta.fwd.l2ptr = l2ptr; } table ipv4_da_lpm { @@ -354,13 +354,13 @@ control egress(inout headers_t hdr, // See the resubmit() call above for comments about the // parameter to recirculate(), which has the same form as for // resubmit. - recirculate_field_list(0); + recirculate_preserving_field_list(0); } action do_clone_e2e(bit<48> smac) { hdr.ethernet.srcAddr = smac; // See the resubmit() call for notes on the 3rd argument, // which is similar to the only argument to resubmit(). - clone3_field_list(CloneType.E2E, E2E_CLONE_SESSION_ID, 0); + clone3_preserving_field_list(CloneType.E2E, E2E_CLONE_SESSION_ID, 0); } table send_frame { key = { diff --git a/testdata/p4_16_samples_outputs/issue1001-1-bmv2-first.p4 b/testdata/p4_16_samples_outputs/issue1001-1-bmv2-first.p4 new file mode 100644 index 00000000000..5fd16c46a4a --- /dev/null +++ b/testdata/p4_16_samples_outputs/issue1001-1-bmv2-first.p4 @@ -0,0 +1,51 @@ +#include +#define V1MODEL_VERSION 20180101 +#include + +struct Headers { +} + +enum bit<8> PreservedFieldList { + Field = 8w1 +} + +struct Meta { + @field_list(PreservedFieldList . Field) + bit<1> b; +} + +parser p(packet_in b, out Headers h, inout Meta m, inout standard_metadata_t sm) { + state start { + m.b = m.b + 1w1; + transition accept; + } +} + +control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { + apply { + clone3_preserving_field_list(CloneType.I2E, 32w64, PreservedFieldList.Field); + } +} + +control vrfy(inout Headers h, inout Meta m) { + apply { + } +} + +control update(inout Headers h, inout Meta m) { + apply { + } +} + +control egress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { + apply { + } +} + +control deparser(packet_out b, in Headers h) { + apply { + } +} + +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 new file mode 100644 index 00000000000..5fd16c46a4a --- /dev/null +++ b/testdata/p4_16_samples_outputs/issue1001-1-bmv2-frontend.p4 @@ -0,0 +1,51 @@ +#include +#define V1MODEL_VERSION 20180101 +#include + +struct Headers { +} + +enum bit<8> PreservedFieldList { + Field = 8w1 +} + +struct Meta { + @field_list(PreservedFieldList . Field) + bit<1> b; +} + +parser p(packet_in b, out Headers h, inout Meta m, inout standard_metadata_t sm) { + state start { + m.b = m.b + 1w1; + transition accept; + } +} + +control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { + apply { + clone3_preserving_field_list(CloneType.I2E, 32w64, PreservedFieldList.Field); + } +} + +control vrfy(inout Headers h, inout Meta m) { + apply { + } +} + +control update(inout Headers h, inout Meta m) { + apply { + } +} + +control egress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { + apply { + } +} + +control deparser(packet_out b, in Headers h) { + apply { + } +} + +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 new file mode 100644 index 00000000000..1b166917ad9 --- /dev/null +++ b/testdata/p4_16_samples_outputs/issue1001-1-bmv2-midend.p4 @@ -0,0 +1,56 @@ +#include +#define V1MODEL_VERSION 20180101 +#include + +struct Headers { +} + +struct Meta { + @field_list(PreservedFieldList . Field) + bit<1> b; +} + +parser p(packet_in b, out Headers h, inout Meta m, inout standard_metadata_t sm) { + state start { + m.b = m.b + 1w1; + transition accept; + } +} + +control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { + @hidden action issue10011bmv2l24() { + clone3_preserving_field_list(CloneType.I2E, 32w64, 8w1); + } + @hidden table tbl_issue10011bmv2l24 { + actions = { + issue10011bmv2l24(); + } + const default_action = issue10011bmv2l24(); + } + apply { + tbl_issue10011bmv2l24.apply(); + } +} + +control vrfy(inout Headers h, inout Meta m) { + apply { + } +} + +control update(inout Headers h, inout Meta m) { + apply { + } +} + +control egress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { + apply { + } +} + +control deparser(packet_out b, in Headers h) { + apply { + } +} + +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 new file mode 100644 index 00000000000..2b94732f8b7 --- /dev/null +++ b/testdata/p4_16_samples_outputs/issue1001-1-bmv2.p4 @@ -0,0 +1,51 @@ +#include +#define V1MODEL_VERSION 20180101 +#include + +struct Headers { +} + +enum bit<8> PreservedFieldList { + Field = 8w1 +} + +struct Meta { + @field_list(PreservedFieldList . Field) + bit<1> b; +} + +parser p(packet_in b, out Headers h, inout Meta m, inout standard_metadata_t sm) { + state start { + m.b = m.b + 1; + transition accept; + } +} + +control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { + apply { + clone3_preserving_field_list(CloneType.I2E, 32w64, PreservedFieldList.Field); + } +} + +control vrfy(inout Headers h, inout Meta m) { + apply { + } +} + +control update(inout Headers h, inout Meta m) { + apply { + } +} + +control egress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { + apply { + } +} + +control deparser(packet_out b, in Headers h) { + apply { + } +} + +V1Switch(p(), vrfy(), ingress(), egress(), update(), deparser()) main; + diff --git a/testdata/p4_16_samples_outputs/issue1001-1-bmv2.p4-stderr b/testdata/p4_16_samples_outputs/issue1001-1-bmv2.p4-stderr new file mode 100644 index 00000000000..e69de29bb2d diff --git a/testdata/p4_16_samples_outputs/issue1001-1-bmv2.p4.entries.txt b/testdata/p4_16_samples_outputs/issue1001-1-bmv2.p4.entries.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/testdata/p4_16_samples_outputs/issue1001-1-bmv2.p4.p4info.txt b/testdata/p4_16_samples_outputs/issue1001-1-bmv2.p4.p4info.txt new file mode 100644 index 00000000000..e162b5de6ac --- /dev/null +++ b/testdata/p4_16_samples_outputs/issue1001-1-bmv2.p4.p4info.txt @@ -0,0 +1,5 @@ +pkg_info { + arch: "v1model" +} +type_info { +} diff --git a/testdata/p4_16_samples_outputs/issue1001-bmv2-first.p4 b/testdata/p4_16_samples_outputs/issue1001-bmv2-first.p4 index cf6e4106b4d..b65e9989c1e 100644 --- a/testdata/p4_16_samples_outputs/issue1001-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/issue1001-bmv2-first.p4 @@ -19,7 +19,7 @@ parser p(packet_in b, out Headers h, inout Meta m, inout standard_metadata_t sm) control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { apply { - clone3_field_list(CloneType.I2E, 32w64, 8w0); + clone3_preserving_field_list(CloneType.I2E, 32w64, 8w0); } } diff --git a/testdata/p4_16_samples_outputs/issue1001-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue1001-bmv2-frontend.p4 index cf6e4106b4d..b65e9989c1e 100644 --- a/testdata/p4_16_samples_outputs/issue1001-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1001-bmv2-frontend.p4 @@ -19,7 +19,7 @@ parser p(packet_in b, out Headers h, inout Meta m, inout standard_metadata_t sm) control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { apply { - clone3_field_list(CloneType.I2E, 32w64, 8w0); + clone3_preserving_field_list(CloneType.I2E, 32w64, 8w0); } } diff --git a/testdata/p4_16_samples_outputs/issue1001-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/issue1001-bmv2-midend.p4 index 8f49f6be927..9d31145cfda 100644 --- a/testdata/p4_16_samples_outputs/issue1001-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue1001-bmv2-midend.p4 @@ -19,7 +19,7 @@ parser p(packet_in b, out Headers h, inout Meta m, inout standard_metadata_t sm) control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @hidden action issue1001bmv2l20() { - clone3_field_list(CloneType.I2E, 32w64, 8w0); + clone3_preserving_field_list(CloneType.I2E, 32w64, 8w0); } @hidden table tbl_issue1001bmv2l20 { actions = { diff --git a/testdata/p4_16_samples_outputs/issue1001-bmv2.p4 b/testdata/p4_16_samples_outputs/issue1001-bmv2.p4 index b34e84699bd..73fe88535fc 100644 --- a/testdata/p4_16_samples_outputs/issue1001-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/issue1001-bmv2.p4 @@ -19,7 +19,7 @@ parser p(packet_in b, out Headers h, inout Meta m, inout standard_metadata_t sm) control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { apply { - clone3_field_list(CloneType.I2E, 32w64, 0); + clone3_preserving_field_list(CloneType.I2E, 32w64, 0); } } diff --git a/testdata/p4_16_samples_outputs/issue1043-bmv2-first.p4 b/testdata/p4_16_samples_outputs/issue1043-bmv2-first.p4 index f62460f642c..1bede1b35ee 100644 --- a/testdata/p4_16_samples_outputs/issue1043-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/issue1043-bmv2-first.p4 @@ -44,7 +44,7 @@ control deparser(packet_out b, in Headers h) { control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { apply { - resubmit_field_list(8w0); + resubmit_preserving_field_list(8w0); sm.egress_spec = 9w0; } } diff --git a/testdata/p4_16_samples_outputs/issue1043-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue1043-bmv2-frontend.p4 index f62460f642c..1bede1b35ee 100644 --- a/testdata/p4_16_samples_outputs/issue1043-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1043-bmv2-frontend.p4 @@ -44,7 +44,7 @@ control deparser(packet_out b, in Headers h) { control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { apply { - resubmit_field_list(8w0); + resubmit_preserving_field_list(8w0); sm.egress_spec = 9w0; } } diff --git a/testdata/p4_16_samples_outputs/issue1043-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/issue1043-bmv2-midend.p4 index d65c70260b1..5003ec9eb5f 100644 --- a/testdata/p4_16_samples_outputs/issue1043-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue1043-bmv2-midend.p4 @@ -44,7 +44,7 @@ control deparser(packet_out b, in Headers h) { control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @hidden action issue1043bmv2l33() { - resubmit_field_list(8w0); + resubmit_preserving_field_list(8w0); sm.egress_spec = 9w0; } @hidden table tbl_issue1043bmv2l33 { diff --git a/testdata/p4_16_samples_outputs/issue1043-bmv2.p4 b/testdata/p4_16_samples_outputs/issue1043-bmv2.p4 index 0efd52d4379..b64649fb04c 100644 --- a/testdata/p4_16_samples_outputs/issue1043-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/issue1043-bmv2.p4 @@ -44,7 +44,7 @@ control deparser(packet_out b, in Headers h) { control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { apply { - resubmit_field_list(0); + resubmit_preserving_field_list(0); sm.egress_spec = 0; } } diff --git a/testdata/p4_16_samples_outputs/issue1642-bmv2-first.p4 b/testdata/p4_16_samples_outputs/issue1642-bmv2-first.p4 index a3266892ec0..fb0e7d6fe65 100644 --- a/testdata/p4_16_samples_outputs/issue1642-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/issue1642-bmv2-first.p4 @@ -38,7 +38,7 @@ control ingress(inout parsed_packet_t hdr, inout local_metadata_t local_metadata local_metadata.row.alt0 = local_metadata.row.alt1; local_metadata.row.alt0.valid = 1w1; local_metadata.row.alt1.port = local_metadata.row.alt1.port + 7w1; - clone3_field_list(CloneType.I2E, 32w0, 8w0); + clone3_preserving_field_list(CloneType.I2E, 32w0, 8w0); } } diff --git a/testdata/p4_16_samples_outputs/issue1642-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue1642-bmv2-frontend.p4 index a3266892ec0..fb0e7d6fe65 100644 --- a/testdata/p4_16_samples_outputs/issue1642-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1642-bmv2-frontend.p4 @@ -38,7 +38,7 @@ control ingress(inout parsed_packet_t hdr, inout local_metadata_t local_metadata local_metadata.row.alt0 = local_metadata.row.alt1; local_metadata.row.alt0.valid = 1w1; local_metadata.row.alt1.port = local_metadata.row.alt1.port + 7w1; - clone3_field_list(CloneType.I2E, 32w0, 8w0); + clone3_preserving_field_list(CloneType.I2E, 32w0, 8w0); } } diff --git a/testdata/p4_16_samples_outputs/issue1642-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/issue1642-bmv2-midend.p4 index 261772f1966..2f56f8f4fac 100644 --- a/testdata/p4_16_samples_outputs/issue1642-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue1642-bmv2-midend.p4 @@ -45,7 +45,7 @@ control ingress(inout parsed_packet_t hdr, inout local_metadata_t local_metadata local_metadata._row_alt0_port2 = local_metadata._row_alt1_port4; local_metadata._row_alt0_valid1 = 1w1; local_metadata._row_alt1_port4 = local_metadata._row_alt1_port4 + 7w1; - clone3_field_list(CloneType.I2E, 32w0, 8w0); + clone3_preserving_field_list(CloneType.I2E, 32w0, 8w0); } @hidden table tbl_issue1642bmv2l37 { actions = { diff --git a/testdata/p4_16_samples_outputs/issue1642-bmv2.p4 b/testdata/p4_16_samples_outputs/issue1642-bmv2.p4 index 254eb7ae3e5..811eff4ab1d 100644 --- a/testdata/p4_16_samples_outputs/issue1642-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/issue1642-bmv2.p4 @@ -38,7 +38,7 @@ control ingress(inout parsed_packet_t hdr, inout local_metadata_t local_metadata local_metadata.row.alt0 = local_metadata.row.alt1; local_metadata.row.alt0.valid = 1; local_metadata.row.alt1.port = local_metadata.row.alt1.port + 1; - clone3_field_list(CloneType.I2E, 0, 0); + clone3_preserving_field_list(CloneType.I2E, 0, 0); } } diff --git a/testdata/p4_16_samples_outputs/issue1653-bmv2-first.p4 b/testdata/p4_16_samples_outputs/issue1653-bmv2-first.p4 index 4e49650d12a..b5f82047ab1 100644 --- a/testdata/p4_16_samples_outputs/issue1653-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/issue1653-bmv2-first.p4 @@ -26,7 +26,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, bitvec_hdr bh; apply { bh.x = h.bvh0.x; - clone3_field_list(CloneType.I2E, 32w0, 8w0); + clone3_preserving_field_list(CloneType.I2E, 32w0, 8w0); } } diff --git a/testdata/p4_16_samples_outputs/issue1653-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue1653-bmv2-frontend.p4 index 9c618a5e0be..ac265faee81 100644 --- a/testdata/p4_16_samples_outputs/issue1653-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1653-bmv2-frontend.p4 @@ -26,7 +26,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, @name("ingress.bh") bitvec_hdr bh_0; apply { bh_0.setInvalid(); - clone3_field_list(CloneType.I2E, 32w0, 8w0); + clone3_preserving_field_list(CloneType.I2E, 32w0, 8w0); } } diff --git a/testdata/p4_16_samples_outputs/issue1653-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/issue1653-bmv2-midend.p4 index a9656e08eb2..54f988cd20c 100644 --- a/testdata/p4_16_samples_outputs/issue1653-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue1653-bmv2-midend.p4 @@ -26,7 +26,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, @name("ingress.bh") bitvec_hdr bh_0; @hidden action issue1653bmv2l43() { bh_0.setInvalid(); - clone3_field_list(CloneType.I2E, 32w0, 8w0); + clone3_preserving_field_list(CloneType.I2E, 32w0, 8w0); } @hidden table tbl_issue1653bmv2l43 { actions = { diff --git a/testdata/p4_16_samples_outputs/issue1653-bmv2.p4 b/testdata/p4_16_samples_outputs/issue1653-bmv2.p4 index b6f535deb7f..d13ce1a2cae 100644 --- a/testdata/p4_16_samples_outputs/issue1653-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/issue1653-bmv2.p4 @@ -26,7 +26,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, bitvec_hdr bh; apply { bh.x = h.bvh0.x; - clone3_field_list(CloneType.I2E, 0, 0); + clone3_preserving_field_list(CloneType.I2E, 0, 0); } } 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 3d2eb7cd59e..a92b7bcc2d2 100644 --- a/testdata/p4_16_samples_outputs/issue1653-complex-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/issue1653-complex-bmv2-first.p4 @@ -74,7 +74,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, bh.row.alt1.type = EthTypes.IPv4; h.bvh0.row.alt1.type = bh.row.alt1.type; local_metadata.row0.alt0.useHash = true; - clone3_field_list(CloneType.I2E, 32w0, 8w0); + clone3_preserving_field_list(CloneType.I2E, 32w0, 8w0); } } 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 ca44e816cfd..b3e95cf939d 100644 --- a/testdata/p4_16_samples_outputs/issue1653-complex-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1653-complex-bmv2-frontend.p4 @@ -76,7 +76,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, bh_0.row.alt1.type = EthTypes.IPv4; h.bvh0.row.alt1.type = bh_0.row.alt1.type; local_metadata.row0.alt0.useHash = true; - clone3_field_list(CloneType.I2E, 32w0, 8w0); + clone3_preserving_field_list(CloneType.I2E, 32w0, 8w0); } } 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 be325955d4b..860a986510a 100644 --- a/testdata/p4_16_samples_outputs/issue1653-complex-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue1653-complex-bmv2-midend.p4 @@ -111,7 +111,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, bh_0._row_alt1_type10 = 16w0x800; h.bvh0._row_alt1_type10 = 16w0x800; local_metadata._row0_alt0_useHash3 = true; - clone3_field_list(CloneType.I2E, 32w0, 8w0); + clone3_preserving_field_list(CloneType.I2E, 32w0, 8w0); } @hidden table tbl_issue1653complexbmv2l72 { actions = { diff --git a/testdata/p4_16_samples_outputs/issue1653-complex-bmv2.p4 b/testdata/p4_16_samples_outputs/issue1653-complex-bmv2.p4 index 6f2217a9f25..3928f641472 100644 --- a/testdata/p4_16_samples_outputs/issue1653-complex-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/issue1653-complex-bmv2.p4 @@ -72,7 +72,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, bh.row.alt1.type = EthTypes.IPv4; h.bvh0.row.alt1.type = bh.row.alt1.type; local_metadata.row0.alt0.useHash = true; - clone3_field_list(CloneType.I2E, 0, 0); + clone3_preserving_field_list(CloneType.I2E, 0, 0); } } diff --git a/testdata/p4_16_samples_outputs/issue1660-bmv2-first.p4 b/testdata/p4_16_samples_outputs/issue1660-bmv2-first.p4 index 72173b5e6e1..0671b26553b 100644 --- a/testdata/p4_16_samples_outputs/issue1660-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/issue1660-bmv2-first.p4 @@ -23,7 +23,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, apply { HasBool b; b.x = true; - clone3_field_list(CloneType.I2E, 32w0, 8w0); + clone3_preserving_field_list(CloneType.I2E, 32w0, 8w0); } } diff --git a/testdata/p4_16_samples_outputs/issue1660-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue1660-bmv2-frontend.p4 index 003e176d2ff..fe2f06a55b0 100644 --- a/testdata/p4_16_samples_outputs/issue1660-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1660-bmv2-frontend.p4 @@ -21,7 +21,7 @@ parser parse(packet_in pk, out parsed_packet_t h, inout local_metadata_t local_m control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, inout standard_metadata_t standard_metadata) { apply { - clone3_field_list(CloneType.I2E, 32w0, 8w0); + clone3_preserving_field_list(CloneType.I2E, 32w0, 8w0); } } diff --git a/testdata/p4_16_samples_outputs/issue1660-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/issue1660-bmv2-midend.p4 index f0c926eb929..69a24686093 100644 --- a/testdata/p4_16_samples_outputs/issue1660-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue1660-bmv2-midend.p4 @@ -21,7 +21,7 @@ parser parse(packet_in pk, out parsed_packet_t h, inout local_metadata_t local_m control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, inout standard_metadata_t standard_metadata) { @hidden action issue1660bmv2l23() { - clone3_field_list(CloneType.I2E, 32w0, 8w0); + clone3_preserving_field_list(CloneType.I2E, 32w0, 8w0); } @hidden table tbl_issue1660bmv2l23 { actions = { diff --git a/testdata/p4_16_samples_outputs/issue1660-bmv2.p4 b/testdata/p4_16_samples_outputs/issue1660-bmv2.p4 index bd886c5e61b..126013210af 100644 --- a/testdata/p4_16_samples_outputs/issue1660-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/issue1660-bmv2.p4 @@ -23,7 +23,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, apply { HasBool b; b.x = true; - clone3_field_list(CloneType.I2E, 0, 0); + clone3_preserving_field_list(CloneType.I2E, 0, 0); } } 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 b2e4646e0df..ea6f5565174 100644 --- a/testdata/p4_16_samples_outputs/issue1765-1-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/issue1765-1-bmv2-first.p4 @@ -209,12 +209,12 @@ control MyIngress(inout headers hdr, inout metadata meta, inout standard_metadat action controller_debug() { meta.task = 16w3; meta.ingress_port = standard_metadata.ingress_port; - clone3_field_list(CloneType.I2E, 32w100, 8w0); + clone3_preserving_field_list(CloneType.I2E, 32w100, 8w0); } action controller_reply(task_t task) { meta.task = task; meta.ingress_port = standard_metadata.ingress_port; - clone3_field_list(CloneType.I2E, 32w100, 8w0); + clone3_preserving_field_list(CloneType.I2E, 32w100, 8w0); } action multicast_pkg(mcast_t mcast_grp) { standard_metadata.mcast_grp = mcast_grp; 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 99edf0ae55a..f7ba402ec97 100644 --- a/testdata/p4_16_samples_outputs/issue1765-1-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1765-1-bmv2-frontend.p4 @@ -199,22 +199,22 @@ control MyIngress(inout headers hdr, inout metadata meta, inout standard_metadat @name("MyIngress.controller_debug") action controller_debug() { meta.task = 16w3; meta.ingress_port = standard_metadata.ingress_port; - clone3_field_list(CloneType.I2E, 32w100, 8w0); + clone3_preserving_field_list(CloneType.I2E, 32w100, 8w0); } @name("MyIngress.controller_debug") action controller_debug_1() { meta.task = 16w3; meta.ingress_port = standard_metadata.ingress_port; - clone3_field_list(CloneType.I2E, 32w100, 8w0); + clone3_preserving_field_list(CloneType.I2E, 32w100, 8w0); } @name("MyIngress.controller_reply") action controller_reply(@name("task") task_t task_1) { meta.task = task_1; meta.ingress_port = standard_metadata.ingress_port; - clone3_field_list(CloneType.I2E, 32w100, 8w0); + clone3_preserving_field_list(CloneType.I2E, 32w100, 8w0); } @name("MyIngress.controller_reply") action controller_reply_1(@name("task") task_t task_2) { meta.task = task_2; meta.ingress_port = standard_metadata.ingress_port; - clone3_field_list(CloneType.I2E, 32w100, 8w0); + clone3_preserving_field_list(CloneType.I2E, 32w100, 8w0); } @name("MyIngress.icmp6_echo_reply") action icmp6_echo_reply() { mac_tmp_0 = hdr.ethernet.dst_addr; 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 a4b420ce728..b5ee75d8200 100644 --- a/testdata/p4_16_samples_outputs/issue1765-1-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue1765-1-bmv2-midend.p4 @@ -207,22 +207,22 @@ control MyIngress(inout headers hdr, inout metadata meta, inout standard_metadat @name("MyIngress.controller_debug") action controller_debug() { meta.task = 16w3; meta.ingress_port = standard_metadata.ingress_port; - clone3_field_list(CloneType.I2E, 32w100, 8w0); + clone3_preserving_field_list(CloneType.I2E, 32w100, 8w0); } @name("MyIngress.controller_debug") action controller_debug_1() { meta.task = 16w3; meta.ingress_port = standard_metadata.ingress_port; - clone3_field_list(CloneType.I2E, 32w100, 8w0); + clone3_preserving_field_list(CloneType.I2E, 32w100, 8w0); } @name("MyIngress.controller_reply") action controller_reply(@name("task") task_t task_1) { meta.task = task_1; meta.ingress_port = standard_metadata.ingress_port; - clone3_field_list(CloneType.I2E, 32w100, 8w0); + clone3_preserving_field_list(CloneType.I2E, 32w100, 8w0); } @name("MyIngress.controller_reply") action controller_reply_1(@name("task") task_t task_2) { meta.task = task_2; meta.ingress_port = standard_metadata.ingress_port; - clone3_field_list(CloneType.I2E, 32w100, 8w0); + clone3_preserving_field_list(CloneType.I2E, 32w100, 8w0); } @name("MyIngress.icmp6_echo_reply") action icmp6_echo_reply() { mac_tmp_0 = hdr.ethernet.dst_addr; diff --git a/testdata/p4_16_samples_outputs/issue1765-1-bmv2.p4 b/testdata/p4_16_samples_outputs/issue1765-1-bmv2.p4 index 38baf4ccd62..2d093188e8b 100644 --- a/testdata/p4_16_samples_outputs/issue1765-1-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/issue1765-1-bmv2.p4 @@ -209,12 +209,12 @@ control MyIngress(inout headers hdr, inout metadata meta, inout standard_metadat action controller_debug() { meta.task = TASK_DEBUG; meta.ingress_port = standard_metadata.ingress_port; - clone3_field_list(CloneType.I2E, 100, 0); + clone3_preserving_field_list(CloneType.I2E, 100, 0); } action controller_reply(task_t task) { meta.task = task; meta.ingress_port = standard_metadata.ingress_port; - clone3_field_list(CloneType.I2E, 100, 0); + clone3_preserving_field_list(CloneType.I2E, 100, 0); } action multicast_pkg(mcast_t mcast_grp) { standard_metadata.mcast_grp = mcast_grp; diff --git a/testdata/p4_16_samples_outputs/issue383-bmv2-first.p4 b/testdata/p4_16_samples_outputs/issue383-bmv2-first.p4 index 924dc1aa99f..ba84c27bfe6 100644 --- a/testdata/p4_16_samples_outputs/issue383-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/issue383-bmv2-first.p4 @@ -80,7 +80,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, local_metadata.row0.alt0 = local_metadata.row1.alt1; local_metadata.row1.alt0.valid = 1w1; local_metadata.row1.alt1.port = local_metadata.row0.alt1.port + 7w1; - clone3_field_list(CloneType.I2E, 32w0, 8w0); + clone3_preserving_field_list(CloneType.I2E, 32w0, 8w0); } } diff --git a/testdata/p4_16_samples_outputs/issue383-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue383-bmv2-frontend.p4 index 5544fcc97f6..515023c2171 100644 --- a/testdata/p4_16_samples_outputs/issue383-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue383-bmv2-frontend.p4 @@ -80,7 +80,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, local_metadata.row0.alt0 = local_metadata.row1.alt1; local_metadata.row1.alt0.valid = 1w1; local_metadata.row1.alt1.port = local_metadata.row0.alt1.port + 7w1; - clone3_field_list(CloneType.I2E, 32w0, 8w0); + clone3_preserving_field_list(CloneType.I2E, 32w0, 8w0); } } diff --git a/testdata/p4_16_samples_outputs/issue383-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/issue383-bmv2-midend.p4 index 24c96cdf666..925a39360cc 100644 --- a/testdata/p4_16_samples_outputs/issue383-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue383-bmv2-midend.p4 @@ -96,7 +96,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, local_metadata._row0_alt0_port1 = local_metadata._row1_alt1_port7; local_metadata._row1_alt0_valid4 = 1w1; local_metadata._row1_alt1_port7 = local_metadata._row0_alt1_port3 + 7w1; - clone3_field_list(CloneType.I2E, 32w0, 8w0); + clone3_preserving_field_list(CloneType.I2E, 32w0, 8w0); } @hidden table tbl_issue383bmv2l75 { actions = { diff --git a/testdata/p4_16_samples_outputs/issue383-bmv2.p4 b/testdata/p4_16_samples_outputs/issue383-bmv2.p4 index d85863e34f8..1dff1149c8c 100644 --- a/testdata/p4_16_samples_outputs/issue383-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/issue383-bmv2.p4 @@ -78,7 +78,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, local_metadata.row0.alt0 = local_metadata.row1.alt1; local_metadata.row1.alt0.valid = 1; local_metadata.row1.alt1.port = local_metadata.row0.alt1.port + 1; - clone3_field_list(CloneType.I2E, 0, 0); + clone3_preserving_field_list(CloneType.I2E, 0, 0); } } diff --git a/testdata/p4_16_samples_outputs/issue562-bmv2-first.p4 b/testdata/p4_16_samples_outputs/issue562-bmv2-first.p4 index 5ddddad1d1d..8e70e72f1c5 100644 --- a/testdata/p4_16_samples_outputs/issue562-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/issue562-bmv2-first.p4 @@ -31,7 +31,7 @@ control ingress(inout parsed_packet_t hdr, inout local_metadata_t local_metadata local_metadata.row.alt0 = local_metadata.row.alt1; local_metadata.row.alt0.valid = 1w1; local_metadata.row.alt1.port = local_metadata.row.alt1.port + 7w1; - clone3_field_list(CloneType.I2E, 32w0, 8w0); + clone3_preserving_field_list(CloneType.I2E, 32w0, 8w0); } } diff --git a/testdata/p4_16_samples_outputs/issue562-bmv2-frontend.p4 b/testdata/p4_16_samples_outputs/issue562-bmv2-frontend.p4 index 5ddddad1d1d..8e70e72f1c5 100644 --- a/testdata/p4_16_samples_outputs/issue562-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue562-bmv2-frontend.p4 @@ -31,7 +31,7 @@ control ingress(inout parsed_packet_t hdr, inout local_metadata_t local_metadata local_metadata.row.alt0 = local_metadata.row.alt1; local_metadata.row.alt0.valid = 1w1; local_metadata.row.alt1.port = local_metadata.row.alt1.port + 7w1; - clone3_field_list(CloneType.I2E, 32w0, 8w0); + clone3_preserving_field_list(CloneType.I2E, 32w0, 8w0); } } diff --git a/testdata/p4_16_samples_outputs/issue562-bmv2-midend.p4 b/testdata/p4_16_samples_outputs/issue562-bmv2-midend.p4 index 013814f6a91..cc0694d7da0 100644 --- a/testdata/p4_16_samples_outputs/issue562-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue562-bmv2-midend.p4 @@ -38,7 +38,7 @@ control ingress(inout parsed_packet_t hdr, inout local_metadata_t local_metadata local_metadata._row_alt0_port1 = local_metadata._row_alt1_port3; local_metadata._row_alt0_valid0 = 1w1; local_metadata._row_alt1_port3 = local_metadata._row_alt1_port3 + 7w1; - clone3_field_list(CloneType.I2E, 32w0, 8w0); + clone3_preserving_field_list(CloneType.I2E, 32w0, 8w0); } @hidden table tbl_issue562bmv2l32 { actions = { diff --git a/testdata/p4_16_samples_outputs/issue562-bmv2.p4 b/testdata/p4_16_samples_outputs/issue562-bmv2.p4 index 53ed42bc959..0676d9e9621 100644 --- a/testdata/p4_16_samples_outputs/issue562-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/issue562-bmv2.p4 @@ -31,7 +31,7 @@ control ingress(inout parsed_packet_t hdr, inout local_metadata_t local_metadata local_metadata.row.alt0 = local_metadata.row.alt1; local_metadata.row.alt0.valid = 1; local_metadata.row.alt1.port = local_metadata.row.alt1.port + 1; - clone3_field_list(CloneType.I2E, 0, 0); + clone3_preserving_field_list(CloneType.I2E, 0, 0); } } 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 ae829823d5c..97b3f55d419 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 @@ -91,10 +91,10 @@ control ingress(inout headers_t hdr, inout meta_t meta, inout standard_metadata_ } action do_resubmit(bit<32> new_ipv4_dstAddr) { hdr.ipv4.dstAddr = new_ipv4_dstAddr; - resubmit_field_list(8w0); + resubmit_preserving_field_list(8w0); } action do_clone_i2e(bit<32> l2ptr) { - clone3_field_list(CloneType.I2E, 32w5, 8w0); + clone3_preserving_field_list(CloneType.I2E, 32w5, 8w0); meta.fwd.l2ptr = l2ptr; } table ipv4_da_lpm { @@ -162,11 +162,11 @@ control egress(inout headers_t hdr, inout meta_t meta, inout standard_metadata_t } action do_recirculate(bit<32> new_ipv4_dstAddr) { hdr.ipv4.dstAddr = new_ipv4_dstAddr; - recirculate_field_list(8w0); + recirculate_preserving_field_list(8w0); } action do_clone_e2e(bit<48> smac) { hdr.ethernet.srcAddr = smac; - clone3_field_list(CloneType.E2E, 32w11, 8w0); + clone3_preserving_field_list(CloneType.E2E, 32w11, 8w0); } table send_frame { key = { 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 ebbb45ea54b..e7bf4251279 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 @@ -83,10 +83,10 @@ control ingress(inout headers_t hdr, inout meta_t meta, inout standard_metadata_ } @name("ingress.do_resubmit") action do_resubmit(@name("new_ipv4_dstAddr") bit<32> new_ipv4_dstAddr) { hdr.ipv4.dstAddr = new_ipv4_dstAddr; - resubmit_field_list(8w0); + resubmit_preserving_field_list(8w0); } @name("ingress.do_clone_i2e") action do_clone_i2e(@name("l2ptr") bit<32> l2ptr_3) { - clone3_field_list(CloneType.I2E, 32w5, 8w0); + clone3_preserving_field_list(CloneType.I2E, 32w5, 8w0); meta.fwd.l2ptr = l2ptr_3; } @name("ingress.ipv4_da_lpm") table ipv4_da_lpm_0 { @@ -172,11 +172,11 @@ control egress(inout headers_t hdr, inout meta_t meta, inout standard_metadata_t } @name("egress.do_recirculate") action do_recirculate(@name("new_ipv4_dstAddr") bit<32> new_ipv4_dstAddr_2) { hdr.ipv4.dstAddr = new_ipv4_dstAddr_2; - recirculate_field_list(8w0); + recirculate_preserving_field_list(8w0); } @name("egress.do_clone_e2e") action do_clone_e2e(@name("smac") bit<48> smac_2) { hdr.ethernet.srcAddr = smac_2; - clone3_field_list(CloneType.E2E, 32w11, 8w0); + clone3_preserving_field_list(CloneType.E2E, 32w11, 8w0); } @name("egress.send_frame") table send_frame_0 { key = { 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 971026a6c42..c72de59a92b 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 @@ -139,10 +139,10 @@ control ingress(inout headers_t hdr, inout meta_t meta, inout standard_metadata_ } @name("ingress.do_resubmit") action do_resubmit(@name("new_ipv4_dstAddr") bit<32> new_ipv4_dstAddr) { hdr.ipv4.dstAddr = new_ipv4_dstAddr; - resubmit_field_list(8w0); + resubmit_preserving_field_list(8w0); } @name("ingress.do_clone_i2e") action do_clone_i2e(@name("l2ptr") bit<32> l2ptr_3) { - clone3_field_list(CloneType.I2E, 32w5, 8w0); + clone3_preserving_field_list(CloneType.I2E, 32w5, 8w0); meta._fwd_l2ptr0 = l2ptr_3; } @name("ingress.ipv4_da_lpm") table ipv4_da_lpm_0 { @@ -266,11 +266,11 @@ control egress(inout headers_t hdr, inout meta_t meta, inout standard_metadata_t } @name("egress.do_recirculate") action do_recirculate(@name("new_ipv4_dstAddr") bit<32> new_ipv4_dstAddr_2) { hdr.ipv4.dstAddr = new_ipv4_dstAddr_2; - recirculate_field_list(8w0); + recirculate_preserving_field_list(8w0); } @name("egress.do_clone_e2e") action do_clone_e2e(@name("smac") bit<48> smac_2) { hdr.ethernet.srcAddr = smac_2; - clone3_field_list(CloneType.E2E, 32w11, 8w0); + clone3_preserving_field_list(CloneType.E2E, 32w11, 8w0); } @name("egress.send_frame") table send_frame_0 { key = { 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 a74870d91e5..b91d440e3dc 100644 --- a/testdata/p4_16_samples_outputs/v1model-special-ops-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/v1model-special-ops-bmv2.p4 @@ -91,10 +91,10 @@ control ingress(inout headers_t hdr, inout meta_t meta, inout standard_metadata_ } action do_resubmit(bit<32> new_ipv4_dstAddr) { hdr.ipv4.dstAddr = new_ipv4_dstAddr; - resubmit_field_list(0); + resubmit_preserving_field_list(0); } action do_clone_i2e(bit<32> l2ptr) { - clone3_field_list(CloneType.I2E, I2E_CLONE_SESSION_ID, 0); + clone3_preserving_field_list(CloneType.I2E, I2E_CLONE_SESSION_ID, 0); meta.fwd.l2ptr = l2ptr; } table ipv4_da_lpm { @@ -160,11 +160,11 @@ control egress(inout headers_t hdr, inout meta_t meta, inout standard_metadata_t } action do_recirculate(bit<32> new_ipv4_dstAddr) { hdr.ipv4.dstAddr = new_ipv4_dstAddr; - recirculate_field_list(0); + recirculate_preserving_field_list(0); } action do_clone_e2e(bit<48> smac) { hdr.ethernet.srcAddr = smac; - clone3_field_list(CloneType.E2E, E2E_CLONE_SESSION_ID, 0); + clone3_preserving_field_list(CloneType.E2E, E2E_CLONE_SESSION_ID, 0); } table send_frame { key = { From e19906e67e0270f22733ba8ae91b7ac85d1903c5 Mon Sep 17 00:00:00 2001 From: Mihai Budiu Date: Wed, 1 Dec 2021 10:30:51 -0800 Subject: [PATCH 06/11] field_list can take a list of expressions --- frontends/p4/parseAnnotations.cpp | 4 ++-- p4include/v1model.p4 | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/frontends/p4/parseAnnotations.cpp b/frontends/p4/parseAnnotations.cpp index 6d4b3ff6738..9ff300db499 100644 --- a/frontends/p4/parseAnnotations.cpp +++ b/frontends/p4/parseAnnotations.cpp @@ -43,11 +43,11 @@ ParseAnnotations::HandlerMap ParseAnnotations::standardHandlers() { // @synchronous has a list of method names PARSE_EXPRESSION_LIST(IR::Annotation::synchronousAnnotation), + // @field_list also has a list of expressions + PARSE_EXPRESSION_LIST(IR::Annotation::fieldListAnnotation), // @match has an expression argument PARSE(IR::Annotation::matchAnnotation, Expression), - // @field_list also has an expression - PARSE(IR::Annotation::fieldListAnnotation, Expression), }; } diff --git a/p4include/v1model.p4 b/p4include/v1model.p4 index 3bcc4fdab03..cfa63d024fe 100644 --- a/p4include/v1model.p4 +++ b/p4include/v1model.p4 @@ -562,8 +562,7 @@ extern void resubmit(in T data); * struct UM { * @field_list(1) * bit<32> x; - * @field_list(1) - * @field_list(2) + * @field_list(1, 2) * bit<32> y; * bit<32> z; * } From f52093110c6f6617b3dc52dbe36cecdf99574a48 Mon Sep 17 00:00:00 2001 From: Jovana-Syrmia <95021557+Jovana-Syrmia@users.noreply.github.com> Date: Wed, 1 Dec 2021 19:35:50 +0100 Subject: [PATCH 07/11] Compiler Bug : overwriting definitions in defuse (#2900) (#2971) * Fix bug in file def_use in method setDefinitionsAt class AllDefinitions --- backends/dpdk/dpdkArch.cpp | 18 +++ backends/dpdk/dpdkArch.h | 6 +- frontends/p4/sideEffects.cpp | 6 +- frontends/p4/sideEffects.h | 3 +- testdata/p4_16_samples/issue2900.p4 | 89 +++++++++++++ .../p4_16_samples_outputs/issue2900-first.p4 | 89 +++++++++++++ .../issue2900-frontend.p4 | 103 +++++++++++++++ .../p4_16_samples_outputs/issue2900-midend.p4 | 118 ++++++++++++++++++ testdata/p4_16_samples_outputs/issue2900.p4 | 89 +++++++++++++ .../p4_16_samples_outputs/issue2900.p4-stderr | 0 10 files changed, 516 insertions(+), 5 deletions(-) create mode 100644 testdata/p4_16_samples/issue2900.p4 create mode 100644 testdata/p4_16_samples_outputs/issue2900-first.p4 create mode 100644 testdata/p4_16_samples_outputs/issue2900-frontend.p4 create mode 100644 testdata/p4_16_samples_outputs/issue2900-midend.p4 create mode 100644 testdata/p4_16_samples_outputs/issue2900.p4 create mode 100644 testdata/p4_16_samples_outputs/issue2900.p4-stderr diff --git a/backends/dpdk/dpdkArch.cpp b/backends/dpdk/dpdkArch.cpp index 307acde61e6..7c5d1ccdfca 100644 --- a/backends/dpdk/dpdkArch.cpp +++ b/backends/dpdk/dpdkArch.cpp @@ -1038,6 +1038,24 @@ const IR::Node* CopyMatchKeysToSingleStruct::postorder(IR::KeyElement* element) } return element; } +const IR::Node* CopyMatchKeysToSingleStruct::doStatement(const IR::Statement* statement, + const IR::Expression *expression) { + LOG3("Visiting " << getOriginal()); + P4::HasTableApply hta(refMap, typeMap); + hta.setCalledBy(this); + (void)expression->apply(hta); + if (hta.table == nullptr) + return statement; + auto insertions = get(toInsert, hta.table); + if (insertions == nullptr) + return statement; + auto result = new IR::IndexedVector(); + for (auto assign : insertions->statements) + result->push_back(assign); + result->push_back(statement); + auto block = new IR::BlockStatement(*result); + return block; +} namespace Helpers { diff --git a/backends/dpdk/dpdkArch.h b/backends/dpdk/dpdkArch.h index 4dfd029c6ea..5582f75d51a 100644 --- a/backends/dpdk/dpdkArch.h +++ b/backends/dpdk/dpdkArch.h @@ -553,11 +553,13 @@ class CopyMatchKeysToSingleStruct : public P4::KeySideEffect { public: CopyMatchKeysToSingleStruct(P4::ReferenceMap* refMap, P4::TypeMap* typeMap, std::set* invokedInKey) - : P4::KeySideEffect (refMap, typeMap, invokedInKey) - { setName("CopyMatchKeysToSingleStruct"); } + : P4::KeySideEffect(refMap, typeMap, invokedInKey) + { setName("CopyMatchKeysToSinSgleStruct"); } const IR::Node* preorder(IR::Key* key) override; const IR::Node* postorder(IR::KeyElement* element) override; + const IR::Node* doStatement(const IR::Statement* statement, + const IR::Expression* expression) override; }; /** diff --git a/frontends/p4/sideEffects.cpp b/frontends/p4/sideEffects.cpp index 04ece4d6c57..95d571f8a07 100644 --- a/frontends/p4/sideEffects.cpp +++ b/frontends/p4/sideEffects.cpp @@ -777,8 +777,10 @@ const IR::Node* KeySideEffect::doStatement(const IR::Statement* statement, return statement; auto result = new IR::IndexedVector(); - for (auto assign : insertions->statements) - result->push_back(assign); + for (auto assign : insertions->statements){ + auto cloneAssign = assign->clone(); + result->push_back(cloneAssign); + } result->push_back(statement); auto block = new IR::BlockStatement(*result); return block; diff --git a/frontends/p4/sideEffects.h b/frontends/p4/sideEffects.h index 110e6c13335..fc19c88002c 100644 --- a/frontends/p4/sideEffects.h +++ b/frontends/p4/sideEffects.h @@ -293,7 +293,8 @@ class KeySideEffect : public Transform { std::set* invokedInKey) : refMap(refMap), typeMap(typeMap), invokedInKey(invokedInKey) { CHECK_NULL(refMap); CHECK_NULL(typeMap); CHECK_NULL(invokedInKey); setName("KeySideEffect"); } - const IR::Node* doStatement(const IR::Statement* statement, const IR::Expression* expression); + virtual const IR::Node* doStatement(const IR::Statement* statement, + const IR::Expression* expression); const IR::Node* preorder(IR::Key* key) override; diff --git a/testdata/p4_16_samples/issue2900.p4 b/testdata/p4_16_samples/issue2900.p4 new file mode 100644 index 00000000000..808f5113494 --- /dev/null +++ b/testdata/p4_16_samples/issue2900.p4 @@ -0,0 +1,89 @@ +#include +#include + +typedef bit<48> EthernetAddress; +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; +} + +struct headers_t { + ethernet_t ethernet; + ipv4_t ipv4; +} + +struct main_metadata_t { + PortId_t dst_port; +} + +bool RxPkt(in pna_main_input_metadata_t istd) { + return istd.direction == PNA_Direction_t.NET_TO_HOST; +} +bool TxPkt(in pna_main_input_metadata_t istd) { + return istd.direction == PNA_Direction_t.HOST_TO_NET; +} +control PreControlImpl(in headers_t hdr, inout main_metadata_t meta, in pna_pre_input_metadata_t istd, inout pna_pre_output_metadata_t ostd) { + apply { + } +} + +parser MainParserImpl(packet_in pkt, out headers_t hdr, inout main_metadata_t main_meta, in pna_main_parser_input_metadata_t istd) { + state start { + pkt.extract(hdr.ethernet); + transition select(hdr.ethernet.etherType) { + 0x800: parse_ipv4; + default: accept; + } + } + state parse_ipv4 { + pkt.extract(hdr.ipv4); + transition accept; + } +} + +control MainControlImpl(inout headers_t hdr, inout main_metadata_t meta, in pna_main_input_metadata_t istd, inout pna_main_output_metadata_t ostd) { + table clb_pinned_flows { + key = { + SelectByDirection(istd.direction, hdr.ipv4.srcAddr, hdr.ipv4.dstAddr): exact @name("ipv4_addr_0") ; + SelectByDirection(istd.direction, hdr.ipv4.dstAddr, hdr.ipv4.srcAddr): exact @name("ipv4_addr_1") ; + hdr.ipv4.protocol : exact; + } + actions = { + NoAction; + } + const default_action = NoAction; + } + apply { + if (TxPkt(istd)) { + clb_pinned_flows.apply(); + } else { + clb_pinned_flows.apply(); + } + } +} + +control MainDeparserImpl(packet_out pkt, in headers_t hdr, in main_metadata_t user_meta, in pna_main_output_metadata_t ostd) { + apply { + pkt.emit(hdr.ethernet); + pkt.emit(hdr.ipv4); + } +} + +PNA_NIC(MainParserImpl(), PreControlImpl(), MainControlImpl(), MainDeparserImpl()) main; + diff --git a/testdata/p4_16_samples_outputs/issue2900-first.p4 b/testdata/p4_16_samples_outputs/issue2900-first.p4 new file mode 100644 index 00000000000..6ffd412f5c2 --- /dev/null +++ b/testdata/p4_16_samples_outputs/issue2900-first.p4 @@ -0,0 +1,89 @@ +#include +#include + +typedef bit<48> EthernetAddress; +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; +} + +struct headers_t { + ethernet_t ethernet; + ipv4_t ipv4; +} + +struct main_metadata_t { + PortId_t dst_port; +} + +bool RxPkt(in pna_main_input_metadata_t istd) { + return istd.direction == PNA_Direction_t.NET_TO_HOST; +} +bool TxPkt(in pna_main_input_metadata_t istd) { + return istd.direction == PNA_Direction_t.HOST_TO_NET; +} +control PreControlImpl(in headers_t hdr, inout main_metadata_t meta, in pna_pre_input_metadata_t istd, inout pna_pre_output_metadata_t ostd) { + apply { + } +} + +parser MainParserImpl(packet_in pkt, out headers_t hdr, inout main_metadata_t main_meta, in pna_main_parser_input_metadata_t istd) { + state start { + pkt.extract(hdr.ethernet); + transition select(hdr.ethernet.etherType) { + 16w0x800: parse_ipv4; + default: accept; + } + } + state parse_ipv4 { + pkt.extract(hdr.ipv4); + transition accept; + } +} + +control MainControlImpl(inout headers_t hdr, inout main_metadata_t meta, in pna_main_input_metadata_t istd, inout pna_main_output_metadata_t ostd) { + table clb_pinned_flows { + key = { + SelectByDirection>(istd.direction, hdr.ipv4.srcAddr, hdr.ipv4.dstAddr): exact @name("ipv4_addr_0") ; + SelectByDirection>(istd.direction, hdr.ipv4.dstAddr, hdr.ipv4.srcAddr): exact @name("ipv4_addr_1") ; + hdr.ipv4.protocol : exact @name("hdr.ipv4.protocol") ; + } + actions = { + NoAction(); + } + const default_action = NoAction(); + } + apply { + if (TxPkt(istd)) { + clb_pinned_flows.apply(); + } else { + clb_pinned_flows.apply(); + } + } +} + +control MainDeparserImpl(packet_out pkt, in headers_t hdr, in main_metadata_t user_meta, in pna_main_output_metadata_t ostd) { + apply { + pkt.emit(hdr.ethernet); + pkt.emit(hdr.ipv4); + } +} + +PNA_NIC(MainParserImpl(), PreControlImpl(), MainControlImpl(), MainDeparserImpl()) main; + diff --git a/testdata/p4_16_samples_outputs/issue2900-frontend.p4 b/testdata/p4_16_samples_outputs/issue2900-frontend.p4 new file mode 100644 index 00000000000..27635ee0599 --- /dev/null +++ b/testdata/p4_16_samples_outputs/issue2900-frontend.p4 @@ -0,0 +1,103 @@ +#include +#include + +typedef bit<48> EthernetAddress; +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; +} + +struct headers_t { + ethernet_t ethernet; + ipv4_t ipv4; +} + +struct main_metadata_t { + PortId_t dst_port; +} + +control PreControlImpl(in headers_t hdr, inout main_metadata_t meta, in pna_pre_input_metadata_t istd, inout pna_pre_output_metadata_t ostd) { + apply { + } +} + +parser MainParserImpl(packet_in pkt, out headers_t hdr, inout main_metadata_t main_meta, in pna_main_parser_input_metadata_t istd) { + state start { + pkt.extract(hdr.ethernet); + transition select(hdr.ethernet.etherType) { + 16w0x800: parse_ipv4; + default: accept; + } + } + state parse_ipv4 { + pkt.extract(hdr.ipv4); + transition accept; + } +} + +control MainControlImpl(inout headers_t hdr, inout main_metadata_t meta, in pna_main_input_metadata_t istd, inout pna_main_output_metadata_t ostd) { + @name("MainControlImpl.key_0") bit<32> key_0; + @name("MainControlImpl.key_1") bit<32> key_1; + @name("MainControlImpl.key_2") bit<8> key_2; + @name("MainControlImpl.tmp") bool tmp; + @name("MainControlImpl.istd_0") pna_main_input_metadata_t istd_1; + @name("MainControlImpl.hasReturned") bool hasReturned; + @name("MainControlImpl.retval") bool retval; + @noWarn("unused") @name(".NoAction") action NoAction_1() { + } + @name("MainControlImpl.clb_pinned_flows") table clb_pinned_flows_0 { + key = { + key_0: exact @name("ipv4_addr_0") ; + key_1: exact @name("ipv4_addr_1") ; + key_2: exact @name("hdr.ipv4.protocol") ; + } + actions = { + NoAction_1(); + } + const default_action = NoAction_1(); + } + apply { + istd_1 = istd; + hasReturned = false; + hasReturned = true; + retval = istd_1.direction == PNA_Direction_t.HOST_TO_NET; + tmp = retval; + if (tmp) { + key_0 = SelectByDirection>(istd.direction, hdr.ipv4.srcAddr, hdr.ipv4.dstAddr); + key_1 = SelectByDirection>(istd.direction, hdr.ipv4.dstAddr, hdr.ipv4.srcAddr); + key_2 = hdr.ipv4.protocol; + clb_pinned_flows_0.apply(); + } else { + key_0 = SelectByDirection>(istd.direction, hdr.ipv4.srcAddr, hdr.ipv4.dstAddr); + key_1 = SelectByDirection>(istd.direction, hdr.ipv4.dstAddr, hdr.ipv4.srcAddr); + key_2 = hdr.ipv4.protocol; + clb_pinned_flows_0.apply(); + } + } +} + +control MainDeparserImpl(packet_out pkt, in headers_t hdr, in main_metadata_t user_meta, in pna_main_output_metadata_t ostd) { + apply { + pkt.emit(hdr.ethernet); + pkt.emit(hdr.ipv4); + } +} + +PNA_NIC(MainParserImpl(), PreControlImpl(), MainControlImpl(), MainDeparserImpl()) main; + diff --git a/testdata/p4_16_samples_outputs/issue2900-midend.p4 b/testdata/p4_16_samples_outputs/issue2900-midend.p4 new file mode 100644 index 00000000000..797c6eb554c --- /dev/null +++ b/testdata/p4_16_samples_outputs/issue2900-midend.p4 @@ -0,0 +1,118 @@ +#include +#include + +typedef bit<48> EthernetAddress; +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; +} + +struct headers_t { + ethernet_t ethernet; + ipv4_t ipv4; +} + +struct main_metadata_t { + PortId_t dst_port; +} + +control PreControlImpl(in headers_t hdr, inout main_metadata_t meta, in pna_pre_input_metadata_t istd, inout pna_pre_output_metadata_t ostd) { + apply { + } +} + +parser MainParserImpl(packet_in pkt, out headers_t hdr, inout main_metadata_t main_meta, in pna_main_parser_input_metadata_t istd) { + state start { + pkt.extract(hdr.ethernet); + transition select(hdr.ethernet.etherType) { + 16w0x800: parse_ipv4; + default: accept; + } + } + state parse_ipv4 { + pkt.extract(hdr.ipv4); + transition accept; + } +} + +control MainControlImpl(inout headers_t hdr, inout main_metadata_t meta, in pna_main_input_metadata_t istd, inout pna_main_output_metadata_t ostd) { + @name("MainControlImpl.key_0") bit<32> key_0; + @name("MainControlImpl.key_1") bit<32> key_1; + @noWarn("unused") @name(".NoAction") action NoAction_1() { + } + @name("MainControlImpl.clb_pinned_flows") table clb_pinned_flows_0 { + key = { + key_0 : exact @name("ipv4_addr_0") ; + key_1 : exact @name("ipv4_addr_1") ; + hdr.ipv4.protocol: exact @name("hdr.ipv4.protocol") ; + } + actions = { + NoAction_1(); + } + const default_action = NoAction_1(); + } + @hidden action issue2900l63() { + key_0 = SelectByDirection>(istd.direction, hdr.ipv4.srcAddr, hdr.ipv4.dstAddr); + key_1 = SelectByDirection>(istd.direction, hdr.ipv4.dstAddr, hdr.ipv4.srcAddr); + } + @hidden action issue2900l63_0() { + key_0 = SelectByDirection>(istd.direction, hdr.ipv4.srcAddr, hdr.ipv4.dstAddr); + key_1 = SelectByDirection>(istd.direction, hdr.ipv4.dstAddr, hdr.ipv4.srcAddr); + } + @hidden table tbl_issue2900l63 { + actions = { + issue2900l63(); + } + const default_action = issue2900l63(); + } + @hidden table tbl_issue2900l63_0 { + actions = { + issue2900l63_0(); + } + const default_action = issue2900l63_0(); + } + apply { + if (istd.direction == PNA_Direction_t.HOST_TO_NET) { + tbl_issue2900l63.apply(); + clb_pinned_flows_0.apply(); + } else { + tbl_issue2900l63_0.apply(); + clb_pinned_flows_0.apply(); + } + } +} + +control MainDeparserImpl(packet_out pkt, in headers_t hdr, in main_metadata_t user_meta, in pna_main_output_metadata_t ostd) { + @hidden action issue2900l83() { + pkt.emit(hdr.ethernet); + pkt.emit(hdr.ipv4); + } + @hidden table tbl_issue2900l83 { + actions = { + issue2900l83(); + } + const default_action = issue2900l83(); + } + apply { + tbl_issue2900l83.apply(); + } +} + +PNA_NIC(MainParserImpl(), PreControlImpl(), MainControlImpl(), MainDeparserImpl()) main; + diff --git a/testdata/p4_16_samples_outputs/issue2900.p4 b/testdata/p4_16_samples_outputs/issue2900.p4 new file mode 100644 index 00000000000..808f5113494 --- /dev/null +++ b/testdata/p4_16_samples_outputs/issue2900.p4 @@ -0,0 +1,89 @@ +#include +#include + +typedef bit<48> EthernetAddress; +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; +} + +struct headers_t { + ethernet_t ethernet; + ipv4_t ipv4; +} + +struct main_metadata_t { + PortId_t dst_port; +} + +bool RxPkt(in pna_main_input_metadata_t istd) { + return istd.direction == PNA_Direction_t.NET_TO_HOST; +} +bool TxPkt(in pna_main_input_metadata_t istd) { + return istd.direction == PNA_Direction_t.HOST_TO_NET; +} +control PreControlImpl(in headers_t hdr, inout main_metadata_t meta, in pna_pre_input_metadata_t istd, inout pna_pre_output_metadata_t ostd) { + apply { + } +} + +parser MainParserImpl(packet_in pkt, out headers_t hdr, inout main_metadata_t main_meta, in pna_main_parser_input_metadata_t istd) { + state start { + pkt.extract(hdr.ethernet); + transition select(hdr.ethernet.etherType) { + 0x800: parse_ipv4; + default: accept; + } + } + state parse_ipv4 { + pkt.extract(hdr.ipv4); + transition accept; + } +} + +control MainControlImpl(inout headers_t hdr, inout main_metadata_t meta, in pna_main_input_metadata_t istd, inout pna_main_output_metadata_t ostd) { + table clb_pinned_flows { + key = { + SelectByDirection(istd.direction, hdr.ipv4.srcAddr, hdr.ipv4.dstAddr): exact @name("ipv4_addr_0") ; + SelectByDirection(istd.direction, hdr.ipv4.dstAddr, hdr.ipv4.srcAddr): exact @name("ipv4_addr_1") ; + hdr.ipv4.protocol : exact; + } + actions = { + NoAction; + } + const default_action = NoAction; + } + apply { + if (TxPkt(istd)) { + clb_pinned_flows.apply(); + } else { + clb_pinned_flows.apply(); + } + } +} + +control MainDeparserImpl(packet_out pkt, in headers_t hdr, in main_metadata_t user_meta, in pna_main_output_metadata_t ostd) { + apply { + pkt.emit(hdr.ethernet); + pkt.emit(hdr.ipv4); + } +} + +PNA_NIC(MainParserImpl(), PreControlImpl(), MainControlImpl(), MainDeparserImpl()) main; + diff --git a/testdata/p4_16_samples_outputs/issue2900.p4-stderr b/testdata/p4_16_samples_outputs/issue2900.p4-stderr new file mode 100644 index 00000000000..e69de29bb2d From 9943732a70fdd4347c23428fbbde00ea891f4118 Mon Sep 17 00:00:00 2001 From: Mihai Budiu Date: Wed, 1 Dec 2021 10:52:28 -0800 Subject: [PATCH 08/11] reference outputs --- testdata/p4_16_samples_outputs/issue1001-1-bmv2-first.p4 | 2 +- testdata/p4_16_samples_outputs/issue1001-1-bmv2-frontend.p4 | 2 +- testdata/p4_16_samples_outputs/issue1001-1-bmv2-midend.p4 | 2 +- testdata/p4_16_samples_outputs/issue1001-1-bmv2.p4 | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) 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 5fd16c46a4a..66391e2f78a 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; } 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 5fd16c46a4a..66391e2f78a 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; } 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 1b166917ad9..30f65b2b2d0 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(PreservedFieldList . Field) + @field_list(8w1) bit<1> b; } diff --git a/testdata/p4_16_samples_outputs/issue1001-1-bmv2.p4 b/testdata/p4_16_samples_outputs/issue1001-1-bmv2.p4 index 2b94732f8b7..00c29fa4c1f 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; } From f12dc2ef46541e0c9a8df080bcf6ca4bf0406421 Mon Sep 17 00:00:00 2001 From: Mihai Budiu Date: Wed, 1 Dec 2021 15:36:24 -0800 Subject: [PATCH 09/11] Add temporary IR nodes to typeMap (#2972) --- frontends/p4/simplifyDefUse.cpp | 29 +++++++++++-------- testdata/p4_16_samples/issue2958.p4 | 29 +++++++++++++++++++ .../p4_16_samples_outputs/issue2958-first.p4 | 29 +++++++++++++++++++ .../issue2958-frontend.p4 | 27 +++++++++++++++++ .../p4_16_samples_outputs/issue2958-midend.p4 | 27 +++++++++++++++++ testdata/p4_16_samples_outputs/issue2958.p4 | 29 +++++++++++++++++++ .../p4_16_samples_outputs/issue2958.p4-stderr | 0 7 files changed, 158 insertions(+), 12 deletions(-) create mode 100644 testdata/p4_16_samples/issue2958.p4 create mode 100644 testdata/p4_16_samples_outputs/issue2958-first.p4 create mode 100644 testdata/p4_16_samples_outputs/issue2958-frontend.p4 create mode 100644 testdata/p4_16_samples_outputs/issue2958-midend.p4 create mode 100644 testdata/p4_16_samples_outputs/issue2958.p4 create mode 100644 testdata/p4_16_samples_outputs/issue2958.p4-stderr diff --git a/frontends/p4/simplifyDefUse.cpp b/frontends/p4/simplifyDefUse.cpp index 033100f3ba6..1d5c082f2cb 100644 --- a/frontends/p4/simplifyDefUse.cpp +++ b/frontends/p4/simplifyDefUse.cpp @@ -714,9 +714,10 @@ class FindUninitialized : public Inspector { if (auto list = src->to()) { auto it = list->components.begin(); for (auto field : dst_struct->fields) { - IR::Member member(dst, field->name); - processHeadersInAssignment(&member, (*it)->expression, - typeMap->getType(field, true), + auto ftype = typeMap->getType(field, true); + auto member = new IR::Member(dst, field->name); + typeMap->setType(member, ftype); + processHeadersInAssignment(member, (*it)->expression, ftype, typeMap->getType((*it)->expression, true)); ++it; } @@ -727,11 +728,12 @@ class FindUninitialized : public Inspector { } } else if (src_type->to()) { for (auto field : dst_struct->fields) { - IR::Member dst_member(dst, field->name); - IR::Member src_member(src, field->name); - processHeadersInAssignment(&dst_member, &src_member, - typeMap->getType(field, true), - typeMap->getType(field, true)); + auto ftype = typeMap->getType(field, true); + auto dst_member = new IR::Member(dst, field->name); + auto src_member = new IR::Member(src, field->name); + typeMap->setType(dst_member, ftype); + typeMap->setType(src_member, ftype); + processHeadersInAssignment(dst_member, src_member, ftype, ftype); } } else { BUG("%1%: unexpected expression on RHS", src); @@ -752,11 +754,14 @@ class FindUninitialized : public Inspector { false; for (auto field : dst_headerunion->fields) { - IR::Member dst_member(dst, field->name); - IR::Member src_member(src, field->name); - auto valid = headerDefs->find(&src_member); + auto ftype = typeMap->getType(field, true); + auto dst_member = new IR::Member(dst, field->name); + auto src_member = new IR::Member(src, field->name); + typeMap->setType(dst_member, ftype); + typeMap->setType(src_member, ftype); + auto valid = headerDefs->find(src_member); if (!non_constant_indexing || valid == TernaryBool::Yes) - headerDefs->update(headerDefs->getStorageLocation(&dst_member), + headerDefs->update(headerDefs->getStorageLocation(dst_member), valid); } auto valid = headerDefs->find(src); diff --git a/testdata/p4_16_samples/issue2958.p4 b/testdata/p4_16_samples/issue2958.p4 new file mode 100644 index 00000000000..8ae39023834 --- /dev/null +++ b/testdata/p4_16_samples/issue2958.p4 @@ -0,0 +1,29 @@ +#include + +header ethernet_t { + bit<48> dst_addr; +} + +struct G { + ethernet_t eth; +} + +struct H { + G g; +} + +struct Headers { + ethernet_t eth_hdr; +} + +control ingress(inout Headers h) { + H tmp = { { { 1 } } }; + + apply { + tmp.g.eth.dst_addr = 1; + } +} + +control Ingress(inout Headers hdr); +package top(Ingress ig); +top(ingress()) main; diff --git a/testdata/p4_16_samples_outputs/issue2958-first.p4 b/testdata/p4_16_samples_outputs/issue2958-first.p4 new file mode 100644 index 00000000000..06573010529 --- /dev/null +++ b/testdata/p4_16_samples_outputs/issue2958-first.p4 @@ -0,0 +1,29 @@ +#include + +header ethernet_t { + bit<48> dst_addr; +} + +struct G { + ethernet_t eth; +} + +struct H { + G g; +} + +struct Headers { + ethernet_t eth_hdr; +} + +control ingress(inout Headers h) { + H tmp = (H){g = (G){eth = (ethernet_t){dst_addr = 48w1}}}; + apply { + tmp.g.eth.dst_addr = 48w1; + } +} + +control Ingress(inout Headers hdr); +package top(Ingress ig); +top(ingress()) main; + diff --git a/testdata/p4_16_samples_outputs/issue2958-frontend.p4 b/testdata/p4_16_samples_outputs/issue2958-frontend.p4 new file mode 100644 index 00000000000..4267a1617d8 --- /dev/null +++ b/testdata/p4_16_samples_outputs/issue2958-frontend.p4 @@ -0,0 +1,27 @@ +#include + +header ethernet_t { + bit<48> dst_addr; +} + +struct G { + ethernet_t eth; +} + +struct H { + G g; +} + +struct Headers { + ethernet_t eth_hdr; +} + +control ingress(inout Headers h) { + apply { + } +} + +control Ingress(inout Headers hdr); +package top(Ingress ig); +top(ingress()) main; + diff --git a/testdata/p4_16_samples_outputs/issue2958-midend.p4 b/testdata/p4_16_samples_outputs/issue2958-midend.p4 new file mode 100644 index 00000000000..4267a1617d8 --- /dev/null +++ b/testdata/p4_16_samples_outputs/issue2958-midend.p4 @@ -0,0 +1,27 @@ +#include + +header ethernet_t { + bit<48> dst_addr; +} + +struct G { + ethernet_t eth; +} + +struct H { + G g; +} + +struct Headers { + ethernet_t eth_hdr; +} + +control ingress(inout Headers h) { + apply { + } +} + +control Ingress(inout Headers hdr); +package top(Ingress ig); +top(ingress()) main; + diff --git a/testdata/p4_16_samples_outputs/issue2958.p4 b/testdata/p4_16_samples_outputs/issue2958.p4 new file mode 100644 index 00000000000..4b17fb2f5b9 --- /dev/null +++ b/testdata/p4_16_samples_outputs/issue2958.p4 @@ -0,0 +1,29 @@ +#include + +header ethernet_t { + bit<48> dst_addr; +} + +struct G { + ethernet_t eth; +} + +struct H { + G g; +} + +struct Headers { + ethernet_t eth_hdr; +} + +control ingress(inout Headers h) { + H tmp = { { { 1 } } }; + apply { + tmp.g.eth.dst_addr = 1; + } +} + +control Ingress(inout Headers hdr); +package top(Ingress ig); +top(ingress()) main; + diff --git a/testdata/p4_16_samples_outputs/issue2958.p4-stderr b/testdata/p4_16_samples_outputs/issue2958.p4-stderr new file mode 100644 index 00000000000..e69de29bb2d From b958226848cf08cec1077f05e388ef085bb440a9 Mon Sep 17 00:00:00 2001 From: Usha Gupta Date: Thu, 2 Dec 2021 07:55:07 +0530 Subject: [PATCH 10/11] Add minWidthBits for Type_Error (#2967) * Treat error type as string in p4RuntimeSerializer --- backends/dpdk/DpdkXfail.cmake | 6 +----- control-plane/p4RuntimeSerializer.cpp | 4 ++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/backends/dpdk/DpdkXfail.cmake b/backends/dpdk/DpdkXfail.cmake index 32d492c7c8d..1539c396d42 100644 --- a/backends/dpdk/DpdkXfail.cmake +++ b/backends/dpdk/DpdkXfail.cmake @@ -18,11 +18,6 @@ p4c_add_xfail_reason("dpdk" testdata/p4_16_samples/psa-counter6.p4 ) -p4c_add_xfail_reason("dpdk" - "error: error: width not well-defined" - testdata/p4_16_samples/psa-example-parser-checksum.p4 - ) - p4c_add_xfail_reason("dpdk" "Expected psa_implementation property value for table.* to resolve to an extern instance" testdata/p4_16_samples/psa-action-profile2.p4 @@ -56,6 +51,7 @@ p4c_add_xfail_reason("dpdk" p4c_add_xfail_reason("dpdk" "Unknown extern function" + testdata/p4_16_samples/psa-example-parser-checksum.p4 testdata/p4_16_samples/psa-meter6.p4 ) diff --git a/control-plane/p4RuntimeSerializer.cpp b/control-plane/p4RuntimeSerializer.cpp index d50f155d03f..ccfcb047b3e 100644 --- a/control-plane/p4RuntimeSerializer.cpp +++ b/control-plane/p4RuntimeSerializer.cpp @@ -729,6 +729,10 @@ getTypeWidth(const IR::Type* type, TypeMap* typeMap) { // W if the type is bit, and 0 if the type is string return annotation.controller_type.width; } + /* Treat error type as string */ + if (type->is()) + return 0; + return typeMap->minWidthBits(type, type->getNode()); } From e8579cf1e8259999a7b6a3aa895c7fdf04ec41eb Mon Sep 17 00:00:00 2001 From: Mihai Budiu Date: Thu, 2 Dec 2021 17:34:49 -0800 Subject: [PATCH 11/11] Rename clone3_... to clone_... --- backends/bmv2/simple_switch/simpleSwitch.cpp | 10 +- backends/bmv2/simple_switch/simpleSwitch.h | 2 +- frontends/p4/fromv1.0/programStructure.cpp | 2 +- frontends/p4/fromv1.0/v1model.h | 2 +- p4include/v1model.p4 | 16 +- .../copy_to_cpu-first.p4 | 7 +- .../copy_to_cpu-frontend.p4 | 7 +- .../copy_to_cpu-midend.p4 | 7 +- testdata/p4_14_samples_outputs/copy_to_cpu.p4 | 7 +- .../p414-special-ops-2-bmv2-first.p4 | 19 +- .../p414-special-ops-2-bmv2-frontend.p4 | 19 +- .../p414-special-ops-2-bmv2-midend.p4 | 25 ++- .../p414-special-ops-2-bmv2.p4 | 19 +- .../p414-special-ops-3-bmv2-first.p4 | 17 +- .../p414-special-ops-3-bmv2-frontend.p4 | 17 +- .../p414-special-ops-3-bmv2-midend.p4 | 21 +- .../p414-special-ops-3-bmv2.p4 | 17 +- .../p414-special-ops-first.p4 | 17 +- .../p414-special-ops-frontend.p4 | 17 +- .../p414-special-ops-midend.p4 | 21 +- .../p4_14_samples_outputs/p414-special-ops.p4 | 17 +- .../packet_redirect-first.p4 | 15 +- .../packet_redirect-frontend.p4 | 15 +- .../packet_redirect-midend.p4 | 15 +- .../p4_14_samples_outputs/packet_redirect.p4 | 15 +- .../p4_14_samples_outputs/simple_nat-first.p4 | 13 +- .../simple_nat-frontend.p4 | 13 +- .../simple_nat-midend.p4 | 11 +- testdata/p4_14_samples_outputs/simple_nat.p4 | 13 +- .../switch_20160512/switch-first.p4 | 199 +++++++++-------- .../switch_20160512/switch-frontend.p4 | 203 +++++++++--------- .../switch_20160512/switch-midend.p4 | 181 ++++++++-------- .../switch_20160512/switch.p4 | 199 +++++++++-------- testdata/p4_16_samples/issue1001-1-bmv2.p4 | 2 +- testdata/p4_16_samples/issue1001-bmv2.p4 | 2 +- testdata/p4_16_samples/issue1642-bmv2.p4 | 2 +- testdata/p4_16_samples/issue1653-bmv2.p4 | 2 +- .../p4_16_samples/issue1653-complex-bmv2.p4 | 2 +- testdata/p4_16_samples/issue1660-bmv2.p4 | 2 +- testdata/p4_16_samples/issue1765-1-bmv2.p4 | 4 +- testdata/p4_16_samples/issue383-bmv2.p4 | 2 +- testdata/p4_16_samples/issue562-bmv2.p4 | 2 +- .../p4_16_samples/v1model-special-ops-bmv2.p4 | 8 +- .../issue1001-1-bmv2-first.p4 | 5 +- .../issue1001-1-bmv2-frontend.p4 | 5 +- .../issue1001-1-bmv2-midend.p4 | 5 +- .../p4_16_samples_outputs/issue1001-1-bmv2.p4 | 5 +- .../issue1001-bmv2-first.p4 | 5 +- .../issue1001-bmv2-frontend.p4 | 5 +- .../issue1001-bmv2-midend.p4 | 5 +- .../p4_16_samples_outputs/issue1001-bmv2.p4 | 5 +- .../issue1642-bmv2-first.p4 | 5 +- .../issue1642-bmv2-frontend.p4 | 5 +- .../issue1642-bmv2-midend.p4 | 11 +- .../p4_16_samples_outputs/issue1642-bmv2.p4 | 5 +- .../issue1653-bmv2-first.p4 | 3 +- .../issue1653-bmv2-frontend.p4 | 3 +- .../issue1653-bmv2-midend.p4 | 3 +- .../p4_16_samples_outputs/issue1653-bmv2.p4 | 3 +- .../issue1653-complex-bmv2-first.p4 | 5 +- .../issue1653-complex-bmv2-frontend.p4 | 5 +- .../issue1653-complex-bmv2-midend.p4 | 27 ++- .../issue1653-complex-bmv2.p4 | 5 +- .../issue1660-bmv2-first.p4 | 5 +- .../issue1660-bmv2-frontend.p4 | 5 +- .../issue1660-bmv2-midend.p4 | 5 +- .../p4_16_samples_outputs/issue1660-bmv2.p4 | 5 +- .../issue1765-1-bmv2-first.p4 | 15 +- .../issue1765-1-bmv2-frontend.p4 | 19 +- .../issue1765-1-bmv2-midend.p4 | 19 +- .../p4_16_samples_outputs/issue1765-1-bmv2.p4 | 15 +- .../issue383-bmv2-first.p4 | 5 +- .../issue383-bmv2-frontend.p4 | 5 +- .../issue383-bmv2-midend.p4 | 11 +- .../p4_16_samples_outputs/issue383-bmv2.p4 | 5 +- .../issue562-bmv2-first.p4 | 5 +- .../issue562-bmv2-frontend.p4 | 5 +- .../issue562-bmv2-midend.p4 | 11 +- .../p4_16_samples_outputs/issue562-bmv2.p4 | 5 +- .../v1model-special-ops-bmv2-first.p4 | 5 +- .../v1model-special-ops-bmv2-frontend.p4 | 5 +- .../v1model-special-ops-bmv2-midend.p4 | 5 +- .../v1model-special-ops-bmv2.p4 | 5 +- 83 files changed, 709 insertions(+), 777 deletions(-) diff --git a/backends/bmv2/simple_switch/simpleSwitch.cpp b/backends/bmv2/simple_switch/simpleSwitch.cpp index 2ac83cc2bb1..f939cdd0e47 100644 --- a/backends/bmv2/simple_switch/simpleSwitch.cpp +++ b/backends/bmv2/simple_switch/simpleSwitch.cpp @@ -94,8 +94,8 @@ bool ParseV1Architecture::preorder(const IR::PackageBlock* main) { } ExternConverter_clone ExternConverter_clone::singleton; -ExternConverter_clone3_preserving_field_list - ExternConverter_clone3_preserving_field_list::singleton; +ExternConverter_clone_preserving_field_list + ExternConverter_clone_preserving_field_list::singleton; ExternConverter_hash ExternConverter_hash::singleton; ExternConverter_digest ExternConverter_digest::singleton; ExternConverter_resubmit_preserving_field_list @@ -187,7 +187,7 @@ static unsigned getFieldListById(ConversionContext* ctxt, unsigned index) { return (unsigned)id; } -Util::IJson* ExternConverter_clone3_preserving_field_list::convertExternFunction( +Util::IJson* ExternConverter_clone_preserving_field_list::convertExternFunction( ConversionContext* ctxt, UNUSED const P4::ExternFunction* ef, const IR::MethodCallExpression* mc, UNUSED const IR::StatOrDecl* s, UNUSED const bool emitExterns) { @@ -207,13 +207,13 @@ Util::IJson* ExternConverter_clone3_preserving_field_list::convertExternFunction if (ei->name == "I2E") { prim = "clone_ingress_pkt_to_egress"; if (ctxt->blockConverted != BlockConverted::Ingress) { - ::error("'clone3_preserving_field_list(I2E, ...) not invoked in ingress %1%", mc); + ::error("'clone_preserving_field_list(I2E, ...) not invoked in ingress %1%", mc); return nullptr; } } else { prim = "clone_egress_pkt_to_egress"; if (ctxt->blockConverted != BlockConverted::Egress) { - ::error("'clone3(E2E, ...) not invoked in egress %1%", mc); + ::error("'clone_preserving_field_list(E2E, ...) not invoked in egress %1%", mc); return nullptr; } } diff --git a/backends/bmv2/simple_switch/simpleSwitch.h b/backends/bmv2/simple_switch/simpleSwitch.h index c0d64861f05..eae8c0b7d2d 100644 --- a/backends/bmv2/simple_switch/simpleSwitch.h +++ b/backends/bmv2/simple_switch/simpleSwitch.h @@ -167,7 +167,7 @@ class SimpleSwitchBackend : public Backend { }; EXTERN_CONVERTER_W_FUNCTION(clone) -EXTERN_CONVERTER_W_FUNCTION_AND_MODEL(clone3_preserving_field_list, P4V1::V1Model, v1model) +EXTERN_CONVERTER_W_FUNCTION_AND_MODEL(clone_preserving_field_list, P4V1::V1Model, v1model) EXTERN_CONVERTER_W_FUNCTION_AND_MODEL(hash, P4V1::V1Model, v1model) EXTERN_CONVERTER_W_FUNCTION(digest) EXTERN_CONVERTER_W_FUNCTION(resubmit_preserving_field_list) diff --git a/frontends/p4/fromv1.0/programStructure.cpp b/frontends/p4/fromv1.0/programStructure.cpp index bb39cc9cbdc..6e0901dc213 100644 --- a/frontends/p4/fromv1.0/programStructure.cpp +++ b/frontends/p4/fromv1.0/programStructure.cpp @@ -2680,7 +2680,7 @@ void ProgramStructure::populateOutputNames() { "recirculate_preserving_field_list", "clone", "clone3", - "clone3_preserving_field_list", + "clone_preserving_field_list", "truncate", "V1Switch", // other v1model names diff --git a/frontends/p4/fromv1.0/v1model.h b/frontends/p4/fromv1.0/v1model.h index 8a7a7123a31..4d70f658ffe 100644 --- a/frontends/p4/fromv1.0/v1model.h +++ b/frontends/p4/fromv1.0/v1model.h @@ -202,7 +202,7 @@ struct Hash_Model : public ::Model::Elem { }; struct Cloner_Model : public ::Model::Extern_Model { - Cloner_Model() : Extern_Model("clone"), clone3("clone3_preserving_field_list"), cloneType(), + Cloner_Model() : Extern_Model("clone"), clone3("clone_preserving_field_list"), cloneType(), sessionType(IR::Type_Bits::get(32)) {} ::Model::Elem clone3; CloneType_Model cloneType; diff --git a/p4include/v1model.p4 b/p4include/v1model.p4 index cfa63d024fe..9a02a056a3e 100644 --- a/p4include/v1model.p4 +++ b/p4include/v1model.p4 @@ -528,10 +528,10 @@ extern void verify_checksum_with_payload(in bool condition, in T data, in extern void update_checksum_with_payload(in bool condition, in T data, inout O checksum, HashAlgorithm algo); /*** - * clone is in most ways identical to the clone3 operation, with the + * clone is in most ways identical to the clone_preserving_field_list operation, with the * only difference being that it never preserves any user-defined * metadata fields with the cloned packet. It is equivalent to - * calling clone3 with the same type and session parameter values, + * calling clone_preserving_field_list with the same type and session parameter values, * with empty data. */ extern void clone(in CloneType type, in bit<32> session); @@ -597,11 +597,11 @@ extern void recirculate(in T data); */ extern void recirculate_preserving_field_list(bit<8> index); -@deprecated("Please use 'clone3_preserving_field_list' instead") +@deprecated("Please use 'clone_preserving_field_list' instead") extern void clone3(in CloneType type, in bit<32> session, in T data); /*** - * Calling clone3_preserving_field_list during execution of the ingress or egress control + * Calling clone_preserving_field_list during execution of the ingress or egress control * will cause the packet to be cloned, sometimes also called * mirroring, i.e. zero or more copies of the packet are made, and * each will later begin egress processing as an independent packet @@ -623,17 +623,17 @@ extern void clone3(in CloneType type, in bit<32> session, in T data); * The user metadata fields that are tagged with @field_list(index) will be * sent to the parser together with a clone of the packet. * - * If clone3 is called during ingress processing, the first parameter - * must be CloneType.I2E. If clone3 is called during egress + * If clone_preserving_field_list is called during ingress processing, the first parameter + * must be CloneType.I2E. If clone_preserving_field_list is called during egress * processing, the first parameter must be CloneType.E2E. * * There is no way to undo its effects once it has been called. If - * there are multiple calls to clone3 and/or clone during a single + * there are multiple calls to clone_preserving_field_list and/or clone during a single * execution of the same ingress (or egress) control, only the last * clone session and data are used. See the v1model architecture * documentation (Note 1) for more details. */ -extern void clone3_preserving_field_list(in CloneType type, in bit<32> session, bit<8> index); +extern void clone_preserving_field_list(in CloneType type, in bit<32> session, bit<8> index); extern void truncate(in bit<32> length); 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 59fa7845832..eb1ff388134 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; } @@ -77,7 +77,7 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { @name(".do_copy_to_cpu") action do_copy_to_cpu() { - clone3_preserving_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.copy_to_cpu_fields); + clone_preserving_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.copy_to_cpu_fields); } @name(".copy_to_cpu") table copy_to_cpu { actions = { @@ -110,4 +110,3 @@ 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 21f5f816d96..222306c199e 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; } @@ -85,7 +85,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ @noWarn("unused") @name(".NoAction") action NoAction_3() { } @name(".do_copy_to_cpu") action do_copy_to_cpu() { - clone3_preserving_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.copy_to_cpu_fields); + clone_preserving_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.copy_to_cpu_fields); } @name(".copy_to_cpu") table copy_to_cpu_0 { actions = { @@ -118,4 +118,3 @@ 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 bf509393547..267e8139fa2 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; } @@ -79,7 +79,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ @noWarn("unused") @name(".NoAction") action NoAction_3() { } @name(".do_copy_to_cpu") action do_copy_to_cpu() { - clone3_preserving_field_list(CloneType.I2E, 32w250, 8w0); + clone_preserving_field_list(CloneType.I2E, 32w250, 8w0); } @name(".copy_to_cpu") table copy_to_cpu_0 { actions = { @@ -112,4 +112,3 @@ 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 85e5c2bb2c5..d593e93990e 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; } @@ -75,7 +75,7 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_t standard_metadata) { @name(".do_copy_to_cpu") action do_copy_to_cpu() { - clone3_preserving_field_list(CloneType.I2E, (bit<32>)32w250, (bit<8>)FieldLists.copy_to_cpu_fields); + clone_preserving_field_list(CloneType.I2E, (bit<32>)32w250, (bit<8>)FieldLists.copy_to_cpu_fields); } @name(".copy_to_cpu") table copy_to_cpu { actions = { @@ -106,4 +106,3 @@ 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 7942915ca1f..1a42a30740f 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; } @@ -65,7 +65,7 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710633; meta.mymeta.f1 = meta.mymeta.f1 + 8w23; meta.mymeta.clone_e2e_count = meta.mymeta.clone_e2e_count + 8w1; - clone3_preserving_field_list(CloneType.E2E, 32w1, (bit<8>)FieldLists.clone_e2e_FL); + clone_preserving_field_list(CloneType.E2E, 32w1, (bit<8>)FieldLists.clone_e2e_FL); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710637; @@ -357,4 +357,3 @@ 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 30004e82b03..7d83a585fc7 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; } @@ -65,7 +65,7 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710633; meta.mymeta.f1 = meta.mymeta.f1 + 8w23; meta.mymeta.clone_e2e_count = meta.mymeta.clone_e2e_count + 8w1; - clone3_preserving_field_list(CloneType.E2E, 32w1, (bit<8>)FieldLists.clone_e2e_FL); + clone_preserving_field_list(CloneType.E2E, 32w1, (bit<8>)FieldLists.clone_e2e_FL); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710637; @@ -388,4 +388,3 @@ 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 8edbd11cead..a5c7299cfc0 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; } @@ -66,7 +66,7 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710633; meta._mymeta_f14 = meta._mymeta_f14 + 8w23; meta._mymeta_clone_e2e_count2 = meta._mymeta_clone_e2e_count2 + 8w1; - clone3_preserving_field_list(CloneType.E2E, 32w1, 8w0); + clone_preserving_field_list(CloneType.E2E, 32w1, 8w0); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710637; @@ -389,4 +389,3 @@ 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 64fa13baf76..b64ea1cf64d 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; } @@ -65,7 +65,7 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr - 48w23; meta.mymeta.f1 = meta.mymeta.f1 + 8w23; meta.mymeta.clone_e2e_count = meta.mymeta.clone_e2e_count + 8w1; - clone3_preserving_field_list(CloneType.E2E, (bit<32>)32w1, (bit<8>)FieldLists.clone_e2e_FL); + clone_preserving_field_list(CloneType.E2E, (bit<32>)32w1, (bit<8>)FieldLists.clone_e2e_FL); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr - 48w19; @@ -361,4 +361,3 @@ 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 c93c24fd173..d011952d283 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; } @@ -64,7 +64,7 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710633; meta.mymeta.f1 = meta.mymeta.f1 + 8w23; meta.mymeta.clone_e2e_count = meta.mymeta.clone_e2e_count + 8w1; - clone3_preserving_field_list(CloneType.E2E, 32w1, (bit<8>)FieldLists.clone_e2e_FL); + clone_preserving_field_list(CloneType.E2E, 32w1, (bit<8>)FieldLists.clone_e2e_FL); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710637; @@ -381,4 +381,3 @@ 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 13f78b99c54..b9dce8aaf69 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; } @@ -64,7 +64,7 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710633; meta.mymeta.f1 = meta.mymeta.f1 + 8w23; meta.mymeta.clone_e2e_count = meta.mymeta.clone_e2e_count + 8w1; - clone3_preserving_field_list(CloneType.E2E, 32w1, (bit<8>)FieldLists.clone_e2e_FL); + clone_preserving_field_list(CloneType.E2E, 32w1, (bit<8>)FieldLists.clone_e2e_FL); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710637; @@ -412,4 +412,3 @@ 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 bd33c187c56..fd86c9750ab 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; } @@ -64,7 +64,7 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710633; meta._mymeta_f14 = meta._mymeta_f14 + 8w23; meta._mymeta_clone_e2e_count2 = meta._mymeta_clone_e2e_count2 + 8w1; - clone3_preserving_field_list(CloneType.E2E, 32w1, 8w0); + clone_preserving_field_list(CloneType.E2E, 32w1, 8w0); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710637; @@ -412,4 +412,3 @@ 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 a0d694bba7c..031587a112c 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; } @@ -64,7 +64,7 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr - 48w23; meta.mymeta.f1 = meta.mymeta.f1 + 8w23; meta.mymeta.clone_e2e_count = meta.mymeta.clone_e2e_count + 8w1; - clone3_preserving_field_list(CloneType.E2E, (bit<32>)32w1, (bit<8>)FieldLists.clone_e2e_FL); + clone_preserving_field_list(CloneType.E2E, (bit<32>)32w1, (bit<8>)FieldLists.clone_e2e_FL); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr - 48w19; @@ -385,4 +385,3 @@ 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 3c2588a1558..377848928ec 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; } @@ -64,7 +64,7 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710633; meta.mymeta.f1 = meta.mymeta.f1 + 8w23; meta.mymeta.clone_e2e_count = meta.mymeta.clone_e2e_count + 8w1; - clone3_preserving_field_list(CloneType.E2E, 32w1, (bit<8>)FieldLists.clone_e2e_FL); + clone_preserving_field_list(CloneType.E2E, 32w1, (bit<8>)FieldLists.clone_e2e_FL); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710637; @@ -356,4 +356,3 @@ 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 1ac485f5a05..bd8ecec07c6 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; } @@ -64,7 +64,7 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710633; meta.mymeta.f1 = meta.mymeta.f1 + 8w23; meta.mymeta.clone_e2e_count = meta.mymeta.clone_e2e_count + 8w1; - clone3_preserving_field_list(CloneType.E2E, 32w1, (bit<8>)FieldLists.clone_e2e_FL); + clone_preserving_field_list(CloneType.E2E, 32w1, (bit<8>)FieldLists.clone_e2e_FL); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710637; @@ -387,4 +387,3 @@ 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 8e935cd059a..6dfcc70babb 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; } @@ -64,7 +64,7 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710633; meta._mymeta_f14 = meta._mymeta_f14 + 8w23; meta._mymeta_clone_e2e_count2 = meta._mymeta_clone_e2e_count2 + 8w1; - clone3_preserving_field_list(CloneType.E2E, 32w1, 8w0); + clone_preserving_field_list(CloneType.E2E, 32w1, 8w0); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr + 48w281474976710637; @@ -387,4 +387,3 @@ 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 7035802b03f..8cef4098714 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; } @@ -64,7 +64,7 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t hdr.ethernet.srcAddr = hdr.ethernet.srcAddr - 48w23; meta.mymeta.f1 = meta.mymeta.f1 + 8w23; meta.mymeta.clone_e2e_count = meta.mymeta.clone_e2e_count + 8w1; - clone3_preserving_field_list(CloneType.E2E, (bit<32>)32w1, (bit<8>)FieldLists.clone_e2e_FL); + clone_preserving_field_list(CloneType.E2E, (bit<32>)32w1, (bit<8>)FieldLists.clone_e2e_FL); } @name(".do_recirculate") action do_recirculate() { hdr.ethernet.srcAddr = hdr.ethernet.srcAddr - 48w19; @@ -360,4 +360,3 @@ 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 56aefcef6ca..0efa358d4e2 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; } @@ -55,7 +55,7 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t recirculate_preserving_field_list((bit<8>)FieldLists.redirect_FL); } @name("._clone_e2e") action _clone_e2e(bit<32> mirror_id) { - clone3_preserving_field_list(CloneType.E2E, mirror_id, (bit<8>)FieldLists.redirect_FL); + clone_preserving_field_list(CloneType.E2E, mirror_id, (bit<8>)FieldLists.redirect_FL); } @name(".t_egress") table t_egress { actions = { @@ -90,7 +90,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ resubmit_preserving_field_list((bit<8>)FieldLists.redirect_FL); } @name("._clone_i2e") action _clone_i2e(bit<32> mirror_id) { - clone3_preserving_field_list(CloneType.I2E, mirror_id, (bit<8>)FieldLists.redirect_FL); + clone_preserving_field_list(CloneType.I2E, mirror_id, (bit<8>)FieldLists.redirect_FL); } @name(".t_ingress_1") table t_ingress_1 { actions = { @@ -143,4 +143,3 @@ 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 de4d3f40bea..65a6aad4903 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; } @@ -57,7 +57,7 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t recirculate_preserving_field_list((bit<8>)FieldLists.redirect_FL); } @name("._clone_e2e") action _clone_e2e(@name("mirror_id") bit<32> mirror_id) { - clone3_preserving_field_list(CloneType.E2E, mirror_id, (bit<8>)FieldLists.redirect_FL); + clone_preserving_field_list(CloneType.E2E, mirror_id, (bit<8>)FieldLists.redirect_FL); } @name(".t_egress") table t_egress_0 { actions = { @@ -98,7 +98,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ resubmit_preserving_field_list((bit<8>)FieldLists.redirect_FL); } @name("._clone_i2e") action _clone_i2e(@name("mirror_id") bit<32> mirror_id_2) { - clone3_preserving_field_list(CloneType.I2E, mirror_id_2, (bit<8>)FieldLists.redirect_FL); + clone_preserving_field_list(CloneType.I2E, mirror_id_2, (bit<8>)FieldLists.redirect_FL); } @name(".t_ingress_1") table t_ingress { actions = { @@ -151,4 +151,3 @@ 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 560353ed6f5..153ab27d883 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; } @@ -55,7 +55,7 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t recirculate_preserving_field_list(8w0); } @name("._clone_e2e") action _clone_e2e(@name("mirror_id") bit<32> mirror_id) { - clone3_preserving_field_list(CloneType.E2E, mirror_id, 8w0); + clone_preserving_field_list(CloneType.E2E, mirror_id, 8w0); } @name(".t_egress") table t_egress_0 { actions = { @@ -96,7 +96,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ resubmit_preserving_field_list(8w0); } @name("._clone_i2e") action _clone_i2e(@name("mirror_id") bit<32> mirror_id_2) { - clone3_preserving_field_list(CloneType.I2E, mirror_id_2, 8w0); + clone_preserving_field_list(CloneType.I2E, mirror_id_2, 8w0); } @name(".t_ingress_1") table t_ingress { actions = { @@ -149,4 +149,3 @@ 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 fa1b8f68134..57c191464a4 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; } @@ -55,7 +55,7 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t recirculate_preserving_field_list((bit<8>)FieldLists.redirect_FL); } @name("._clone_e2e") action _clone_e2e(bit<32> mirror_id) { - clone3_preserving_field_list(CloneType.E2E, (bit<32>)mirror_id, (bit<8>)FieldLists.redirect_FL); + clone_preserving_field_list(CloneType.E2E, (bit<32>)mirror_id, (bit<8>)FieldLists.redirect_FL); } @name(".t_egress") table t_egress { actions = { @@ -88,7 +88,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ resubmit_preserving_field_list((bit<8>)FieldLists.redirect_FL); } @name("._clone_i2e") action _clone_i2e(bit<32> mirror_id) { - clone3_preserving_field_list(CloneType.I2E, (bit<32>)mirror_id, (bit<8>)FieldLists.redirect_FL); + clone_preserving_field_list(CloneType.I2E, (bit<32>)mirror_id, (bit<8>)FieldLists.redirect_FL); } @name(".t_ingress_1") table t_ingress_1 { actions = { @@ -137,4 +137,3 @@ 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 cc05e3c4700..a0764431d9b 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; } @@ -185,7 +185,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ipv4.ttl = hdr.ipv4.ttl + 8w255; } @name(".nat_miss_int_to_ext") action nat_miss_int_to_ext() { - clone3_preserving_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.copy_to_cpu_fields); + clone_preserving_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.copy_to_cpu_fields); } @name(".nat_miss_ext_to_int") action nat_miss_ext_to_int() { meta.meta.do_forward = 1w0; @@ -295,4 +295,3 @@ 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 c41e3cc1b86..9115443aa44 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; } @@ -210,7 +210,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ipv4.ttl = hdr.ipv4.ttl + 8w255; } @name(".nat_miss_int_to_ext") action nat_miss_int_to_ext() { - clone3_preserving_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.copy_to_cpu_fields); + clone_preserving_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.copy_to_cpu_fields); } @name(".nat_miss_ext_to_int") action nat_miss_ext_to_int() { meta.meta.do_forward = 1w0; @@ -320,4 +320,3 @@ 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 b771b5958cb..d7d2b3e64fc 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; } @@ -213,7 +213,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ipv4.ttl = hdr.ipv4.ttl + 8w255; } @name(".nat_miss_int_to_ext") action nat_miss_int_to_ext() { - clone3_preserving_field_list(CloneType.I2E, 32w250, 8w0); + clone_preserving_field_list(CloneType.I2E, 32w250, 8w0); } @name(".nat_miss_ext_to_int") action nat_miss_ext_to_int() { meta._meta_do_forward0 = 1w0; @@ -354,4 +354,3 @@ 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 080940d650b..5108e7cc524 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; } @@ -181,7 +181,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ hdr.ipv4.ttl = hdr.ipv4.ttl - 8w1; } @name(".nat_miss_int_to_ext") action nat_miss_int_to_ext() { - clone3_preserving_field_list(CloneType.I2E, (bit<32>)32w250, (bit<8>)FieldLists.copy_to_cpu_fields); + clone_preserving_field_list(CloneType.I2E, (bit<32>)32w250, (bit<8>)FieldLists.copy_to_cpu_fields); } @name(".nat_miss_ext_to_int") action nat_miss_ext_to_int() { meta.meta.do_forward = 1w0; @@ -283,4 +283,3 @@ 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 a656f30d2c9..540fd030179 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_; } @@ -2978,7 +2978,7 @@ control process_egress_acl(inout headers hdr, inout metadata meta, inout standar } @name(".egress_mirror") action egress_mirror(bit<32> session_id) { meta.i2e_metadata.mirror_session_id = (bit<16>)session_id; - clone3_preserving_field_list(CloneType.E2E, session_id, (bit<8>)FieldLists.e2e_mirror_info); + clone_preserving_field_list(CloneType.E2E, session_id, (bit<8>)FieldLists.e2e_mirror_info); } @name(".egress_mirror_drop") action egress_mirror_drop(bit<32> session_id) { egress_mirror(session_id); @@ -2986,7 +2986,7 @@ control process_egress_acl(inout headers hdr, inout metadata meta, inout standar } @name(".egress_copy_to_cpu") action egress_copy_to_cpu(bit<16> reason_code) { meta.fabric_metadata.reason_code = reason_code; - clone3_preserving_field_list(CloneType.E2E, 32w250, (bit<8>)FieldLists.cpu_info); + clone_preserving_field_list(CloneType.E2E, 32w250, (bit<8>)FieldLists.cpu_info); } @name(".egress_redirect_to_cpu") action egress_redirect_to_cpu(bit<16> reason_code) { egress_copy_to_cpu(reason_code); @@ -3510,7 +3510,7 @@ control process_int_endpoint(inout headers hdr, inout metadata meta, inout stand @name(".int_sink") action int_sink(bit<32> mirror_id) { meta.int_metadata_i2e.sink = 1w1; meta.i2e_metadata.mirror_session_id = (bit<16>)mirror_id; - clone3_preserving_field_list(CloneType.I2E, mirror_id, (bit<8>)FieldLists.int_i2e_mirror_info); + clone_preserving_field_list(CloneType.I2E, mirror_id, (bit<8>)FieldLists.int_i2e_mirror_info); hdr.int_header.setInvalid(); hdr.int_val[0].setInvalid(); hdr.int_val[1].setInvalid(); @@ -4301,7 +4301,7 @@ control process_ingress_sflow(inout headers hdr, inout metadata meta, inout stan @name(".sflow_ing_pkt_to_cpu") action sflow_ing_pkt_to_cpu(bit<32> sflow_i2e_mirror_id, bit<16> reason_code) { meta.fabric_metadata.reason_code = reason_code; meta.i2e_metadata.mirror_session_id = (bit<16>)sflow_i2e_mirror_id; - clone3_preserving_field_list(CloneType.I2E, sflow_i2e_mirror_id, (bit<8>)FieldLists.sflow_cpu_info); + clone_preserving_field_list(CloneType.I2E, sflow_i2e_mirror_id, (bit<8>)FieldLists.sflow_cpu_info); } @name(".sflow_ing_session_enable") action sflow_ing_session_enable(bit<32> rate_thr, bit<16> session_id) { meta.ingress_metadata.sflow_take_sample = rate_thr |+| meta.ingress_metadata.sflow_take_sample; @@ -4314,7 +4314,7 @@ control process_ingress_sflow(inout headers hdr, inout metadata meta, inout stan sflow_ingress_session_pkt_counter.count(); meta.fabric_metadata.reason_code = reason_code; meta.i2e_metadata.mirror_session_id = (bit<16>)sflow_i2e_mirror_id; - clone3_preserving_field_list(CloneType.I2E, sflow_i2e_mirror_id, (bit<8>)FieldLists.sflow_cpu_info); + clone_preserving_field_list(CloneType.I2E, sflow_i2e_mirror_id, (bit<8>)FieldLists.sflow_cpu_info); } @name(".sflow_ing_take_sample") table sflow_ing_take_sample { actions = { @@ -4532,7 +4532,7 @@ control process_mac_acl(inout headers hdr, inout metadata meta, inout standard_m @name(".acl_mirror") action acl_mirror(bit<32> session_id, bit<14> acl_stats_index, bit<16> acl_meter_index) { meta.i2e_metadata.mirror_session_id = (bit<16>)session_id; meta.i2e_metadata.ingress_tstamp = (bit<32>)standard_metadata.ingress_global_timestamp; - clone3_preserving_field_list(CloneType.I2E, session_id, (bit<8>)FieldLists.i2e_mirror_info); + clone_preserving_field_list(CloneType.I2E, session_id, (bit<8>)FieldLists.i2e_mirror_info); meta.acl_metadata.acl_stats_index = acl_stats_index; meta.meter_metadata.meter_index = acl_meter_index; } @@ -4600,7 +4600,7 @@ control process_ip_acl(inout headers hdr, inout metadata meta, inout standard_me @name(".acl_mirror") action acl_mirror(bit<32> session_id, bit<14> acl_stats_index, bit<16> acl_meter_index) { meta.i2e_metadata.mirror_session_id = (bit<16>)session_id; meta.i2e_metadata.ingress_tstamp = (bit<32>)standard_metadata.ingress_global_timestamp; - clone3_preserving_field_list(CloneType.I2E, session_id, (bit<8>)FieldLists.i2e_mirror_info); + clone_preserving_field_list(CloneType.I2E, session_id, (bit<8>)FieldLists.i2e_mirror_info); meta.acl_metadata.acl_stats_index = acl_stats_index; meta.meter_metadata.meter_index = acl_meter_index; } @@ -5851,7 +5851,7 @@ control process_system_acl(inout headers hdr, inout metadata meta, inout standar } @name(".copy_to_cpu_with_reason") action copy_to_cpu_with_reason(bit<16> reason_code) { meta.fabric_metadata.reason_code = reason_code; - clone3_preserving_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.cpu_info); + clone_preserving_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.cpu_info); } @name(".redirect_to_cpu") action redirect_to_cpu(bit<16> reason_code) { copy_to_cpu_with_reason(reason_code); @@ -5859,7 +5859,7 @@ control process_system_acl(inout headers hdr, inout metadata meta, inout standar meta.fabric_metadata.dst_device = 8w0; } @name(".copy_to_cpu") action copy_to_cpu() { - clone3_preserving_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.cpu_info); + clone_preserving_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.cpu_info); } @name(".drop_packet") action drop_packet() { mark_to_drop(standard_metadata); @@ -5869,7 +5869,7 @@ control process_system_acl(inout headers hdr, inout metadata meta, inout standar mark_to_drop(standard_metadata); } @name(".negative_mirror") action negative_mirror(bit<32> session_id) { - clone3_preserving_field_list(CloneType.I2E, session_id, (bit<8>)FieldLists.mirror_info); + clone_preserving_field_list(CloneType.I2E, session_id, (bit<8>)FieldLists.mirror_info); mark_to_drop(standard_metadata); } @name(".drop_stats") table drop_stats_0 { @@ -6120,4 +6120,3 @@ 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 c6e38b2d474..a03dfc942d7 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_; } @@ -3045,16 +3045,16 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t } @name(".egress_mirror") action _egress_mirror_0(@name("session_id") bit<32> session_id) { meta.i2e_metadata.mirror_session_id = (bit<16>)session_id; - clone3_preserving_field_list(CloneType.E2E, session_id, (bit<8>)FieldLists.e2e_mirror_info); + clone_preserving_field_list(CloneType.E2E, session_id, (bit<8>)FieldLists.e2e_mirror_info); } @name(".egress_mirror_drop") action _egress_mirror_drop_0(@name("session_id") bit<32> session_id_6) { meta.i2e_metadata.mirror_session_id = (bit<16>)session_id_6; - clone3_preserving_field_list(CloneType.E2E, session_id_6, (bit<8>)FieldLists.e2e_mirror_info); + clone_preserving_field_list(CloneType.E2E, session_id_6, (bit<8>)FieldLists.e2e_mirror_info); mark_to_drop(standard_metadata); } @name(".egress_redirect_to_cpu") action _egress_redirect_to_cpu_0(@name("reason_code") bit<16> reason_code_0) { meta.fabric_metadata.reason_code = reason_code_0; - clone3_preserving_field_list(CloneType.E2E, 32w250, (bit<8>)FieldLists.cpu_info); + clone_preserving_field_list(CloneType.E2E, 32w250, (bit<8>)FieldLists.cpu_info); mark_to_drop(standard_metadata); } @name(".egress_acl") table _egress_acl { @@ -3654,7 +3654,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ meta.int_metadata.insert_byte_cnt = meta.int_metadata.gpe_int_hdr_len << 2; meta.int_metadata_i2e.sink = 1w1; meta.i2e_metadata.mirror_session_id = (bit<16>)mirror_id; - clone3_preserving_field_list(CloneType.I2E, mirror_id, (bit<8>)FieldLists.int_i2e_mirror_info); + clone_preserving_field_list(CloneType.I2E, mirror_id, (bit<8>)FieldLists.int_i2e_mirror_info); hdr.int_header.setInvalid(); hdr.int_val[0].setInvalid(); hdr.int_val[1].setInvalid(); @@ -4344,7 +4344,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ _sflow_ingress_session_pkt_counter.count(); meta.fabric_metadata.reason_code = reason_code_5; meta.i2e_metadata.mirror_session_id = (bit<16>)sflow_i2e_mirror_id; - clone3_preserving_field_list(CloneType.I2E, sflow_i2e_mirror_id, (bit<8>)FieldLists.sflow_cpu_info); + clone_preserving_field_list(CloneType.I2E, sflow_i2e_mirror_id, (bit<8>)FieldLists.sflow_cpu_info); } @name(".sflow_ing_take_sample") table _sflow_ing_take_sample { actions = { @@ -4528,7 +4528,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ @name(".acl_mirror") action _acl_mirror_1(@name("session_id") bit<32> session_id_8, @name("acl_stats_index") bit<14> acl_stats_index_20, @name("acl_meter_index") bit<16> acl_meter_index_11) { meta.i2e_metadata.mirror_session_id = (bit<16>)session_id_8; meta.i2e_metadata.ingress_tstamp = (bit<32>)standard_metadata.ingress_global_timestamp; - clone3_preserving_field_list(CloneType.I2E, session_id_8, (bit<8>)FieldLists.i2e_mirror_info); + clone_preserving_field_list(CloneType.I2E, session_id_8, (bit<8>)FieldLists.i2e_mirror_info); meta.acl_metadata.acl_stats_index = acl_stats_index_20; meta.meter_metadata.meter_index = acl_meter_index_11; } @@ -4603,14 +4603,14 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ @name(".acl_mirror") action _acl_mirror_2(@name("session_id") bit<32> session_id_9, @name("acl_stats_index") bit<14> acl_stats_index_27, @name("acl_meter_index") bit<16> acl_meter_index_18) { meta.i2e_metadata.mirror_session_id = (bit<16>)session_id_9; meta.i2e_metadata.ingress_tstamp = (bit<32>)standard_metadata.ingress_global_timestamp; - clone3_preserving_field_list(CloneType.I2E, session_id_9, (bit<8>)FieldLists.i2e_mirror_info); + clone_preserving_field_list(CloneType.I2E, session_id_9, (bit<8>)FieldLists.i2e_mirror_info); meta.acl_metadata.acl_stats_index = acl_stats_index_27; meta.meter_metadata.meter_index = acl_meter_index_18; } @name(".acl_mirror") action _acl_mirror_3(@name("session_id") bit<32> session_id_10, @name("acl_stats_index") bit<14> acl_stats_index_28, @name("acl_meter_index") bit<16> acl_meter_index_19) { meta.i2e_metadata.mirror_session_id = (bit<16>)session_id_10; meta.i2e_metadata.ingress_tstamp = (bit<32>)standard_metadata.ingress_global_timestamp; - clone3_preserving_field_list(CloneType.I2E, session_id_10, (bit<8>)FieldLists.i2e_mirror_info); + clone_preserving_field_list(CloneType.I2E, session_id_10, (bit<8>)FieldLists.i2e_mirror_info); meta.acl_metadata.acl_stats_index = acl_stats_index_28; meta.meter_metadata.meter_index = acl_meter_index_19; } @@ -5604,16 +5604,16 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ } @name(".copy_to_cpu_with_reason") action _copy_to_cpu_with_reason_0(@name("reason_code") bit<16> reason_code_6) { meta.fabric_metadata.reason_code = reason_code_6; - clone3_preserving_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.cpu_info); + clone_preserving_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.cpu_info); } @name(".redirect_to_cpu") action _redirect_to_cpu_0(@name("reason_code") bit<16> reason_code_7) { meta.fabric_metadata.reason_code = reason_code_7; - clone3_preserving_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.cpu_info); + clone_preserving_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.cpu_info); mark_to_drop(standard_metadata); meta.fabric_metadata.dst_device = 8w0; } @name(".copy_to_cpu") action _copy_to_cpu_0() { - clone3_preserving_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.cpu_info); + clone_preserving_field_list(CloneType.I2E, 32w250, (bit<8>)FieldLists.cpu_info); } @name(".drop_packet") action _drop_packet_0() { mark_to_drop(standard_metadata); @@ -5623,7 +5623,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ mark_to_drop(standard_metadata); } @name(".negative_mirror") action _negative_mirror_0(@name("session_id") bit<32> session_id_11) { - clone3_preserving_field_list(CloneType.I2E, session_id_11, (bit<8>)FieldLists.mirror_info); + clone_preserving_field_list(CloneType.I2E, session_id_11, (bit<8>)FieldLists.mirror_info); mark_to_drop(standard_metadata); } @name(".drop_stats") table _drop_stats { @@ -6009,4 +6009,3 @@ 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 f13dfb38805..a05580d4dec 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_; } @@ -3149,16 +3149,16 @@ control egress(inout headers hdr, inout metadata meta, inout standard_metadata_t } @name(".egress_mirror") action _egress_mirror_0(@name("session_id") bit<32> session_id) { meta._i2e_metadata_mirror_session_id36 = (bit<16>)session_id; - clone3_preserving_field_list(CloneType.E2E, session_id, 8w2); + clone_preserving_field_list(CloneType.E2E, session_id, 8w2); } @name(".egress_mirror_drop") action _egress_mirror_drop_0(@name("session_id") bit<32> session_id_6) { meta._i2e_metadata_mirror_session_id36 = (bit<16>)session_id_6; - clone3_preserving_field_list(CloneType.E2E, session_id_6, 8w2); + clone_preserving_field_list(CloneType.E2E, session_id_6, 8w2); mark_to_drop(standard_metadata); } @name(".egress_redirect_to_cpu") action _egress_redirect_to_cpu_0(@name("reason_code") bit<16> reason_code_0) { meta._fabric_metadata_reason_code28 = reason_code_0; - clone3_preserving_field_list(CloneType.E2E, 32w250, 8w1); + clone_preserving_field_list(CloneType.E2E, 32w250, 8w1); mark_to_drop(standard_metadata); } @name(".egress_acl") table _egress_acl { @@ -3801,7 +3801,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ meta._int_metadata_insert_byte_cnt50 = meta._int_metadata_gpe_int_hdr_len51 << 2; meta._int_metadata_i2e_sink54 = 1w1; meta._i2e_metadata_mirror_session_id36 = (bit<16>)mirror_id; - clone3_preserving_field_list(CloneType.I2E, mirror_id, 8w3); + clone_preserving_field_list(CloneType.I2E, mirror_id, 8w3); hdr.int_header.setInvalid(); hdr.int_val[0].setInvalid(); hdr.int_val[1].setInvalid(); @@ -4491,7 +4491,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ _sflow_ingress_session_pkt_counter.count(); meta._fabric_metadata_reason_code28 = reason_code_5; meta._i2e_metadata_mirror_session_id36 = (bit<16>)sflow_i2e_mirror_id; - clone3_preserving_field_list(CloneType.I2E, sflow_i2e_mirror_id, 8w5); + clone_preserving_field_list(CloneType.I2E, sflow_i2e_mirror_id, 8w5); } @name(".sflow_ing_take_sample") table _sflow_ing_take_sample { actions = { @@ -4675,7 +4675,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ @name(".acl_mirror") action _acl_mirror_1(@name("session_id") bit<32> session_id_8, @name("acl_stats_index") bit<14> acl_stats_index_20, @name("acl_meter_index") bit<16> acl_meter_index_11) { meta._i2e_metadata_mirror_session_id36 = (bit<16>)session_id_8; meta._i2e_metadata_ingress_tstamp35 = (bit<32>)standard_metadata.ingress_global_timestamp; - clone3_preserving_field_list(CloneType.I2E, session_id_8, 8w0); + clone_preserving_field_list(CloneType.I2E, session_id_8, 8w0); meta._acl_metadata_acl_stats_index11 = acl_stats_index_20; meta._meter_metadata_meter_index107 = acl_meter_index_11; } @@ -4750,14 +4750,14 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ @name(".acl_mirror") action _acl_mirror_2(@name("session_id") bit<32> session_id_9, @name("acl_stats_index") bit<14> acl_stats_index_27, @name("acl_meter_index") bit<16> acl_meter_index_18) { meta._i2e_metadata_mirror_session_id36 = (bit<16>)session_id_9; meta._i2e_metadata_ingress_tstamp35 = (bit<32>)standard_metadata.ingress_global_timestamp; - clone3_preserving_field_list(CloneType.I2E, session_id_9, 8w0); + clone_preserving_field_list(CloneType.I2E, session_id_9, 8w0); meta._acl_metadata_acl_stats_index11 = acl_stats_index_27; meta._meter_metadata_meter_index107 = acl_meter_index_18; } @name(".acl_mirror") action _acl_mirror_3(@name("session_id") bit<32> session_id_10, @name("acl_stats_index") bit<14> acl_stats_index_28, @name("acl_meter_index") bit<16> acl_meter_index_19) { meta._i2e_metadata_mirror_session_id36 = (bit<16>)session_id_10; meta._i2e_metadata_ingress_tstamp35 = (bit<32>)standard_metadata.ingress_global_timestamp; - clone3_preserving_field_list(CloneType.I2E, session_id_10, 8w0); + clone_preserving_field_list(CloneType.I2E, session_id_10, 8w0); meta._acl_metadata_acl_stats_index11 = acl_stats_index_28; meta._meter_metadata_meter_index107 = acl_meter_index_19; } @@ -5751,16 +5751,16 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ } @name(".copy_to_cpu_with_reason") action _copy_to_cpu_with_reason_0(@name("reason_code") bit<16> reason_code_6) { meta._fabric_metadata_reason_code28 = reason_code_6; - clone3_preserving_field_list(CloneType.I2E, 32w250, 8w1); + clone_preserving_field_list(CloneType.I2E, 32w250, 8w1); } @name(".redirect_to_cpu") action _redirect_to_cpu_0(@name("reason_code") bit<16> reason_code_7) { meta._fabric_metadata_reason_code28 = reason_code_7; - clone3_preserving_field_list(CloneType.I2E, 32w250, 8w1); + clone_preserving_field_list(CloneType.I2E, 32w250, 8w1); mark_to_drop(standard_metadata); meta._fabric_metadata_dst_device29 = 8w0; } @name(".copy_to_cpu") action _copy_to_cpu_0() { - clone3_preserving_field_list(CloneType.I2E, 32w250, 8w1); + clone_preserving_field_list(CloneType.I2E, 32w250, 8w1); } @name(".drop_packet") action _drop_packet_0() { mark_to_drop(standard_metadata); @@ -5770,7 +5770,7 @@ control ingress(inout headers hdr, inout metadata meta, inout standard_metadata_ mark_to_drop(standard_metadata); } @name(".negative_mirror") action _negative_mirror_0(@name("session_id") bit<32> session_id_11) { - clone3_preserving_field_list(CloneType.I2E, session_id_11, 8w4); + clone_preserving_field_list(CloneType.I2E, session_id_11, 8w4); mark_to_drop(standard_metadata); } @name(".drop_stats") table _drop_stats { @@ -6195,4 +6195,3 @@ 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 4ebc252f881..44152b60a48 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_; } @@ -2924,7 +2924,7 @@ control process_egress_acl(inout headers hdr, inout metadata meta, inout standar } @name(".egress_mirror") action egress_mirror(bit<32> session_id) { meta.i2e_metadata.mirror_session_id = (bit<16>)session_id; - clone3_preserving_field_list(CloneType.E2E, (bit<32>)session_id, (bit<8>)FieldLists.e2e_mirror_info); + clone_preserving_field_list(CloneType.E2E, (bit<32>)session_id, (bit<8>)FieldLists.e2e_mirror_info); } @name(".egress_mirror_drop") action egress_mirror_drop(bit<32> session_id) { egress_mirror(session_id); @@ -2932,7 +2932,7 @@ control process_egress_acl(inout headers hdr, inout metadata meta, inout standar } @name(".egress_copy_to_cpu") action egress_copy_to_cpu(bit<16> reason_code) { meta.fabric_metadata.reason_code = reason_code; - clone3_preserving_field_list(CloneType.E2E, (bit<32>)32w250, (bit<8>)FieldLists.cpu_info); + clone_preserving_field_list(CloneType.E2E, (bit<32>)32w250, (bit<8>)FieldLists.cpu_info); } @name(".egress_redirect_to_cpu") action egress_redirect_to_cpu(bit<16> reason_code) { egress_copy_to_cpu(reason_code); @@ -3428,7 +3428,7 @@ control process_int_endpoint(inout headers hdr, inout metadata meta, inout stand @name(".int_sink") action int_sink(bit<32> mirror_id) { meta.int_metadata_i2e.sink = 1w1; meta.i2e_metadata.mirror_session_id = (bit<16>)mirror_id; - clone3_preserving_field_list(CloneType.I2E, (bit<32>)mirror_id, (bit<8>)FieldLists.int_i2e_mirror_info); + clone_preserving_field_list(CloneType.I2E, (bit<32>)mirror_id, (bit<8>)FieldLists.int_i2e_mirror_info); hdr.int_header.setInvalid(); hdr.int_val[0].setInvalid(); hdr.int_val[1].setInvalid(); @@ -4177,7 +4177,7 @@ control process_ingress_sflow(inout headers hdr, inout metadata meta, inout stan @name(".sflow_ing_pkt_to_cpu") action sflow_ing_pkt_to_cpu(bit<32> sflow_i2e_mirror_id, bit<16> reason_code) { meta.fabric_metadata.reason_code = reason_code; meta.i2e_metadata.mirror_session_id = (bit<16>)sflow_i2e_mirror_id; - clone3_preserving_field_list(CloneType.I2E, (bit<32>)sflow_i2e_mirror_id, (bit<8>)FieldLists.sflow_cpu_info); + clone_preserving_field_list(CloneType.I2E, (bit<32>)sflow_i2e_mirror_id, (bit<8>)FieldLists.sflow_cpu_info); } @name(".sflow_ing_session_enable") action sflow_ing_session_enable(bit<32> rate_thr, bit<16> session_id) { meta.ingress_metadata.sflow_take_sample = rate_thr |+| meta.ingress_metadata.sflow_take_sample; @@ -4190,7 +4190,7 @@ control process_ingress_sflow(inout headers hdr, inout metadata meta, inout stan sflow_ingress_session_pkt_counter.count(); meta.fabric_metadata.reason_code = reason_code; meta.i2e_metadata.mirror_session_id = (bit<16>)sflow_i2e_mirror_id; - clone3_preserving_field_list(CloneType.I2E, (bit<32>)sflow_i2e_mirror_id, (bit<8>)FieldLists.sflow_cpu_info); + clone_preserving_field_list(CloneType.I2E, (bit<32>)sflow_i2e_mirror_id, (bit<8>)FieldLists.sflow_cpu_info); } @name(".sflow_ing_take_sample") table sflow_ing_take_sample { actions = { @@ -4396,7 +4396,7 @@ control process_mac_acl(inout headers hdr, inout metadata meta, inout standard_m @name(".acl_mirror") action acl_mirror(bit<32> session_id, bit<14> acl_stats_index, bit<16> acl_meter_index) { meta.i2e_metadata.mirror_session_id = (bit<16>)session_id; meta.i2e_metadata.ingress_tstamp = (bit<32>)standard_metadata.ingress_global_timestamp; - clone3_preserving_field_list(CloneType.I2E, (bit<32>)session_id, (bit<8>)FieldLists.i2e_mirror_info); + clone_preserving_field_list(CloneType.I2E, (bit<32>)session_id, (bit<8>)FieldLists.i2e_mirror_info); meta.acl_metadata.acl_stats_index = acl_stats_index; meta.meter_metadata.meter_index = acl_meter_index; } @@ -4462,7 +4462,7 @@ control process_ip_acl(inout headers hdr, inout metadata meta, inout standard_me @name(".acl_mirror") action acl_mirror(bit<32> session_id, bit<14> acl_stats_index, bit<16> acl_meter_index) { meta.i2e_metadata.mirror_session_id = (bit<16>)session_id; meta.i2e_metadata.ingress_tstamp = (bit<32>)standard_metadata.ingress_global_timestamp; - clone3_preserving_field_list(CloneType.I2E, (bit<32>)session_id, (bit<8>)FieldLists.i2e_mirror_info); + clone_preserving_field_list(CloneType.I2E, (bit<32>)session_id, (bit<8>)FieldLists.i2e_mirror_info); meta.acl_metadata.acl_stats_index = acl_stats_index; meta.meter_metadata.meter_index = acl_meter_index; } @@ -5627,7 +5627,7 @@ control process_system_acl(inout headers hdr, inout metadata meta, inout standar } @name(".copy_to_cpu_with_reason") action copy_to_cpu_with_reason(bit<16> reason_code) { meta.fabric_metadata.reason_code = reason_code; - clone3_preserving_field_list(CloneType.I2E, (bit<32>)32w250, (bit<8>)FieldLists.cpu_info); + clone_preserving_field_list(CloneType.I2E, (bit<32>)32w250, (bit<8>)FieldLists.cpu_info); } @name(".redirect_to_cpu") action redirect_to_cpu(bit<16> reason_code) { copy_to_cpu_with_reason(reason_code); @@ -5635,7 +5635,7 @@ control process_system_acl(inout headers hdr, inout metadata meta, inout standar meta.fabric_metadata.dst_device = 8w0; } @name(".copy_to_cpu") action copy_to_cpu() { - clone3_preserving_field_list(CloneType.I2E, (bit<32>)32w250, (bit<8>)FieldLists.cpu_info); + clone_preserving_field_list(CloneType.I2E, (bit<32>)32w250, (bit<8>)FieldLists.cpu_info); } @name(".drop_packet") action drop_packet() { mark_to_drop(standard_metadata); @@ -5645,7 +5645,7 @@ control process_system_acl(inout headers hdr, inout metadata meta, inout standar mark_to_drop(standard_metadata); } @name(".negative_mirror") action negative_mirror(bit<32> session_id) { - clone3_preserving_field_list(CloneType.I2E, (bit<32>)session_id, (bit<8>)FieldLists.mirror_info); + clone_preserving_field_list(CloneType.I2E, (bit<32>)session_id, (bit<8>)FieldLists.mirror_info); mark_to_drop(standard_metadata); } @name(".drop_stats") table drop_stats_0 { @@ -5890,4 +5890,3 @@ control computeChecksum(inout headers hdr, inout metadata meta) { } V1Switch(ParserImpl(), verifyChecksum(), ingress(), egress(), computeChecksum(), DeparserImpl()) main; - diff --git a/testdata/p4_16_samples/issue1001-1-bmv2.p4 b/testdata/p4_16_samples/issue1001-1-bmv2.p4 index 1b9644460b0..c6eadd3291a 100644 --- a/testdata/p4_16_samples/issue1001-1-bmv2.p4 +++ b/testdata/p4_16_samples/issue1001-1-bmv2.p4 @@ -21,7 +21,7 @@ parser p(packet_in b, out Headers h, inout Meta m, inout standard_metadata_t sm) control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { apply { - clone3_preserving_field_list(CloneType.I2E, 32w64, PreservedFieldList.Field); + clone_preserving_field_list(CloneType.I2E, 32w64, PreservedFieldList.Field); } } diff --git a/testdata/p4_16_samples/issue1001-bmv2.p4 b/testdata/p4_16_samples/issue1001-bmv2.p4 index ddae22feb9b..4aff2655c9c 100644 --- a/testdata/p4_16_samples/issue1001-bmv2.p4 +++ b/testdata/p4_16_samples/issue1001-bmv2.p4 @@ -17,7 +17,7 @@ parser p(packet_in b, out Headers h, inout Meta m, inout standard_metadata_t sm) control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { apply { - clone3_preserving_field_list(CloneType.I2E, 32w64, 0); + clone_preserving_field_list(CloneType.I2E, 32w64, 0); } } diff --git a/testdata/p4_16_samples/issue1642-bmv2.p4 b/testdata/p4_16_samples/issue1642-bmv2.p4 index 46b4bb571c4..2065c7866d3 100644 --- a/testdata/p4_16_samples/issue1642-bmv2.p4 +++ b/testdata/p4_16_samples/issue1642-bmv2.p4 @@ -39,7 +39,7 @@ control ingress(inout parsed_packet_t hdr, local_metadata.row.alt0 = local_metadata.row.alt1; local_metadata.row.alt0.valid = 1; local_metadata.row.alt1.port = local_metadata.row.alt1.port + 1; - clone3_preserving_field_list(CloneType.I2E, 0, 0); + clone_preserving_field_list(CloneType.I2E, 0, 0); } } diff --git a/testdata/p4_16_samples/issue1653-bmv2.p4 b/testdata/p4_16_samples/issue1653-bmv2.p4 index 99b0bb1a57e..c8f387e1c17 100644 --- a/testdata/p4_16_samples/issue1653-bmv2.p4 +++ b/testdata/p4_16_samples/issue1653-bmv2.p4 @@ -45,7 +45,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, apply { // Copy another header's data to local variable. bh.x = h.bvh0.x; - clone3_preserving_field_list(CloneType.I2E, 0, 0); + clone_preserving_field_list(CloneType.I2E, 0, 0); } } diff --git a/testdata/p4_16_samples/issue1653-complex-bmv2.p4 b/testdata/p4_16_samples/issue1653-complex-bmv2.p4 index 07e0810a1bb..25019e36b16 100644 --- a/testdata/p4_16_samples/issue1653-complex-bmv2.p4 +++ b/testdata/p4_16_samples/issue1653-complex-bmv2.p4 @@ -96,7 +96,7 @@ control ingress(inout parsed_packet_t h, h.bvh0.row.alt1.type = bh.row.alt1.type; local_metadata.row0.alt0.useHash = true; - clone3_preserving_field_list(CloneType.I2E, 0, 0); + clone_preserving_field_list(CloneType.I2E, 0, 0); } } diff --git a/testdata/p4_16_samples/issue1660-bmv2.p4 b/testdata/p4_16_samples/issue1660-bmv2.p4 index c02be08fe07..3ca84cd167c 100644 --- a/testdata/p4_16_samples/issue1660-bmv2.p4 +++ b/testdata/p4_16_samples/issue1660-bmv2.p4 @@ -20,7 +20,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, apply { HasBool b; b.x = true; - clone3_preserving_field_list(CloneType.I2E, 0, 0); + clone_preserving_field_list(CloneType.I2E, 0, 0); } } diff --git a/testdata/p4_16_samples/issue1765-1-bmv2.p4 b/testdata/p4_16_samples/issue1765-1-bmv2.p4 index b2cc9a945f8..16d94d9bea6 100644 --- a/testdata/p4_16_samples/issue1765-1-bmv2.p4 +++ b/testdata/p4_16_samples/issue1765-1-bmv2.p4 @@ -208,12 +208,12 @@ control MyIngress(inout headers hdr, inout metadata meta, inout standard_metadat action controller_debug() { meta.task = TASK_DEBUG; meta.ingress_port = standard_metadata.ingress_port; - clone3_preserving_field_list(CloneType.I2E, 100, 0); + clone_preserving_field_list(CloneType.I2E, 100, 0); } action controller_reply(task_t task) { meta.task = task; meta.ingress_port = standard_metadata.ingress_port; - clone3_preserving_field_list(CloneType.I2E, 100, 0); + clone_preserving_field_list(CloneType.I2E, 100, 0); } action multicast_pkg(mcast_t mcast_grp) { standard_metadata.mcast_grp = mcast_grp; diff --git a/testdata/p4_16_samples/issue383-bmv2.p4 b/testdata/p4_16_samples/issue383-bmv2.p4 index 12000fd87ee..94fe476fcd1 100644 --- a/testdata/p4_16_samples/issue383-bmv2.p4 +++ b/testdata/p4_16_samples/issue383-bmv2.p4 @@ -106,7 +106,7 @@ control ingress(inout parsed_packet_t h, local_metadata.row0.alt0 = local_metadata.row1.alt1; local_metadata.row1.alt0.valid = 1; local_metadata.row1.alt1.port = local_metadata.row0.alt1.port + 1; - clone3_preserving_field_list(CloneType.I2E, 0, 0); + clone_preserving_field_list(CloneType.I2E, 0, 0); /* Cast support is TODO for bmv2. diff --git a/testdata/p4_16_samples/issue562-bmv2.p4 b/testdata/p4_16_samples/issue562-bmv2.p4 index e63f0440823..52c60c0de69 100644 --- a/testdata/p4_16_samples/issue562-bmv2.p4 +++ b/testdata/p4_16_samples/issue562-bmv2.p4 @@ -32,7 +32,7 @@ control ingress(inout parsed_packet_t hdr, local_metadata.row.alt0 = local_metadata.row.alt1; local_metadata.row.alt0.valid = 1; local_metadata.row.alt1.port = local_metadata.row.alt1.port + 1; - clone3_preserving_field_list(CloneType.I2E, 0, 0); + clone_preserving_field_list(CloneType.I2E, 0, 0); } } diff --git a/testdata/p4_16_samples/v1model-special-ops-bmv2.p4 b/testdata/p4_16_samples/v1model-special-ops-bmv2.p4 index 042f95a3906..0527382fd29 100644 --- a/testdata/p4_16_samples/v1model-special-ops-bmv2.p4 +++ b/testdata/p4_16_samples/v1model-special-ops-bmv2.p4 @@ -239,12 +239,12 @@ control ingress(inout headers_t hdr, // that. A 'mirroring session' and 'clone session' are simply // two different names for the same thing. - // The 3rd argument to clone3() is similar to the only + // The 3rd argument to clone() is similar to the only // argument to the resubmit() call. See the notes for the - // resubmit() call above. clone() is the same as clone3(), + // resubmit() call above. clone() is the same as clone(), // except there are only 2 parameters, and thus no metadata // field values are preserved in the cloned packet. - clone3_preserving_field_list(CloneType.I2E, I2E_CLONE_SESSION_ID, 0); + clone_preserving_field_list(CloneType.I2E, I2E_CLONE_SESSION_ID, 0); meta.fwd.l2ptr = l2ptr; } table ipv4_da_lpm { @@ -360,7 +360,7 @@ control egress(inout headers_t hdr, hdr.ethernet.srcAddr = smac; // See the resubmit() call for notes on the 3rd argument, // which is similar to the only argument to resubmit(). - clone3_preserving_field_list(CloneType.E2E, E2E_CLONE_SESSION_ID, 0); + clone_preserving_field_list(CloneType.E2E, E2E_CLONE_SESSION_ID, 0); } table send_frame { key = { 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 66391e2f78a..5eb2e13827d 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; } @@ -23,7 +23,7 @@ parser p(packet_in b, out Headers h, inout Meta m, inout standard_metadata_t sm) control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { apply { - clone3_preserving_field_list(CloneType.I2E, 32w64, PreservedFieldList.Field); + clone_preserving_field_list(CloneType.I2E, 32w64, PreservedFieldList.Field); } } @@ -48,4 +48,3 @@ 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 66391e2f78a..5eb2e13827d 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; } @@ -23,7 +23,7 @@ parser p(packet_in b, out Headers h, inout Meta m, inout standard_metadata_t sm) control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { apply { - clone3_preserving_field_list(CloneType.I2E, 32w64, PreservedFieldList.Field); + clone_preserving_field_list(CloneType.I2E, 32w64, PreservedFieldList.Field); } } @@ -48,4 +48,3 @@ 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 30f65b2b2d0..0deb85b6b39 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; } @@ -19,7 +19,7 @@ parser p(packet_in b, out Headers h, inout Meta m, inout standard_metadata_t sm) control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @hidden action issue10011bmv2l24() { - clone3_preserving_field_list(CloneType.I2E, 32w64, 8w1); + clone_preserving_field_list(CloneType.I2E, 32w64, 8w1); } @hidden table tbl_issue10011bmv2l24 { actions = { @@ -53,4 +53,3 @@ 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 00c29fa4c1f..8fb43025974 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; } @@ -23,7 +23,7 @@ parser p(packet_in b, out Headers h, inout Meta m, inout standard_metadata_t sm) control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { apply { - clone3_preserving_field_list(CloneType.I2E, 32w64, PreservedFieldList.Field); + clone_preserving_field_list(CloneType.I2E, 32w64, PreservedFieldList.Field); } } @@ -48,4 +48,3 @@ 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 b65e9989c1e..937ff870422 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; } @@ -19,7 +19,7 @@ parser p(packet_in b, out Headers h, inout Meta m, inout standard_metadata_t sm) control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { apply { - clone3_preserving_field_list(CloneType.I2E, 32w64, 8w0); + clone_preserving_field_list(CloneType.I2E, 32w64, 8w0); } } @@ -44,4 +44,3 @@ 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 b65e9989c1e..937ff870422 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; } @@ -19,7 +19,7 @@ parser p(packet_in b, out Headers h, inout Meta m, inout standard_metadata_t sm) control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { apply { - clone3_preserving_field_list(CloneType.I2E, 32w64, 8w0); + clone_preserving_field_list(CloneType.I2E, 32w64, 8w0); } } @@ -44,4 +44,3 @@ 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 9d31145cfda..6c9807e4071 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; } @@ -19,7 +19,7 @@ parser p(packet_in b, out Headers h, inout Meta m, inout standard_metadata_t sm) control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { @hidden action issue1001bmv2l20() { - clone3_preserving_field_list(CloneType.I2E, 32w64, 8w0); + clone_preserving_field_list(CloneType.I2E, 32w64, 8w0); } @hidden table tbl_issue1001bmv2l20 { actions = { @@ -53,4 +53,3 @@ 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 73fe88535fc..2a703619e0b 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; } @@ -19,7 +19,7 @@ parser p(packet_in b, out Headers h, inout Meta m, inout standard_metadata_t sm) control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) { apply { - clone3_preserving_field_list(CloneType.I2E, 32w64, 0); + clone_preserving_field_list(CloneType.I2E, 32w64, 0); } } @@ -44,4 +44,3 @@ 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 fb0e7d6fe65..00661351a5e 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; } @@ -38,7 +38,7 @@ control ingress(inout parsed_packet_t hdr, inout local_metadata_t local_metadata local_metadata.row.alt0 = local_metadata.row.alt1; local_metadata.row.alt0.valid = 1w1; local_metadata.row.alt1.port = local_metadata.row.alt1.port + 7w1; - clone3_preserving_field_list(CloneType.I2E, 32w0, 8w0); + clone_preserving_field_list(CloneType.I2E, 32w0, 8w0); } } @@ -63,4 +63,3 @@ 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 fb0e7d6fe65..00661351a5e 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; } @@ -38,7 +38,7 @@ control ingress(inout parsed_packet_t hdr, inout local_metadata_t local_metadata local_metadata.row.alt0 = local_metadata.row.alt1; local_metadata.row.alt0.valid = 1w1; local_metadata.row.alt1.port = local_metadata.row.alt1.port + 7w1; - clone3_preserving_field_list(CloneType.I2E, 32w0, 8w0); + clone_preserving_field_list(CloneType.I2E, 32w0, 8w0); } } @@ -63,4 +63,3 @@ 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 2f56f8f4fac..e0282a43397 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; } @@ -45,7 +45,7 @@ control ingress(inout parsed_packet_t hdr, inout local_metadata_t local_metadata local_metadata._row_alt0_port2 = local_metadata._row_alt1_port4; local_metadata._row_alt0_valid1 = 1w1; local_metadata._row_alt1_port4 = local_metadata._row_alt1_port4 + 7w1; - clone3_preserving_field_list(CloneType.I2E, 32w0, 8w0); + clone_preserving_field_list(CloneType.I2E, 32w0, 8w0); } @hidden table tbl_issue1642bmv2l37 { actions = { @@ -79,4 +79,3 @@ 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 811eff4ab1d..2c5fe737a9f 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; } @@ -38,7 +38,7 @@ control ingress(inout parsed_packet_t hdr, inout local_metadata_t local_metadata local_metadata.row.alt0 = local_metadata.row.alt1; local_metadata.row.alt0.valid = 1; local_metadata.row.alt1.port = local_metadata.row.alt1.port + 1; - clone3_preserving_field_list(CloneType.I2E, 0, 0); + clone_preserving_field_list(CloneType.I2E, 0, 0); } } @@ -63,4 +63,3 @@ 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 b5f82047ab1..fbdffd0e297 100644 --- a/testdata/p4_16_samples_outputs/issue1653-bmv2-first.p4 +++ b/testdata/p4_16_samples_outputs/issue1653-bmv2-first.p4 @@ -26,7 +26,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, bitvec_hdr bh; apply { bh.x = h.bvh0.x; - clone3_preserving_field_list(CloneType.I2E, 32w0, 8w0); + clone_preserving_field_list(CloneType.I2E, 32w0, 8w0); } } @@ -51,4 +51,3 @@ 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 ac265faee81..f9e1c2c61d7 100644 --- a/testdata/p4_16_samples_outputs/issue1653-bmv2-frontend.p4 +++ b/testdata/p4_16_samples_outputs/issue1653-bmv2-frontend.p4 @@ -26,7 +26,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, @name("ingress.bh") bitvec_hdr bh_0; apply { bh_0.setInvalid(); - clone3_preserving_field_list(CloneType.I2E, 32w0, 8w0); + clone_preserving_field_list(CloneType.I2E, 32w0, 8w0); } } @@ -51,4 +51,3 @@ 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 54f988cd20c..86b5cf3134b 100644 --- a/testdata/p4_16_samples_outputs/issue1653-bmv2-midend.p4 +++ b/testdata/p4_16_samples_outputs/issue1653-bmv2-midend.p4 @@ -26,7 +26,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, @name("ingress.bh") bitvec_hdr bh_0; @hidden action issue1653bmv2l43() { bh_0.setInvalid(); - clone3_preserving_field_list(CloneType.I2E, 32w0, 8w0); + clone_preserving_field_list(CloneType.I2E, 32w0, 8w0); } @hidden table tbl_issue1653bmv2l43 { actions = { @@ -60,4 +60,3 @@ 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 d13ce1a2cae..a263d52d617 100644 --- a/testdata/p4_16_samples_outputs/issue1653-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/issue1653-bmv2.p4 @@ -26,7 +26,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, bitvec_hdr bh; apply { bh.x = h.bvh0.x; - clone3_preserving_field_list(CloneType.I2E, 0, 0); + clone_preserving_field_list(CloneType.I2E, 0, 0); } } @@ -51,4 +51,3 @@ 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 a92b7bcc2d2..a1bebbde925 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; @@ -74,7 +74,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, bh.row.alt1.type = EthTypes.IPv4; h.bvh0.row.alt1.type = bh.row.alt1.type; local_metadata.row0.alt0.useHash = true; - clone3_preserving_field_list(CloneType.I2E, 32w0, 8w0); + clone_preserving_field_list(CloneType.I2E, 32w0, 8w0); } } @@ -101,4 +101,3 @@ 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 b3e95cf939d..62b9ecb0c98 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; @@ -76,7 +76,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, bh_0.row.alt1.type = EthTypes.IPv4; h.bvh0.row.alt1.type = bh_0.row.alt1.type; local_metadata.row0.alt0.useHash = true; - clone3_preserving_field_list(CloneType.I2E, 32w0, 8w0); + clone_preserving_field_list(CloneType.I2E, 32w0, 8w0); } } @@ -103,4 +103,3 @@ 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 860a986510a..8195e38f4e7 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; @@ -111,7 +111,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, bh_0._row_alt1_type10 = 16w0x800; h.bvh0._row_alt1_type10 = 16w0x800; local_metadata._row0_alt0_useHash3 = true; - clone3_preserving_field_list(CloneType.I2E, 32w0, 8w0); + clone_preserving_field_list(CloneType.I2E, 32w0, 8w0); } @hidden table tbl_issue1653complexbmv2l72 { actions = { @@ -155,4 +155,3 @@ 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 3928f641472..4910a097ecf 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; @@ -72,7 +72,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, bh.row.alt1.type = EthTypes.IPv4; h.bvh0.row.alt1.type = bh.row.alt1.type; local_metadata.row0.alt0.useHash = true; - clone3_preserving_field_list(CloneType.I2E, 0, 0); + clone_preserving_field_list(CloneType.I2E, 0, 0); } } @@ -99,4 +99,3 @@ 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 0671b26553b..4c722510391 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; } @@ -23,7 +23,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, apply { HasBool b; b.x = true; - clone3_preserving_field_list(CloneType.I2E, 32w0, 8w0); + clone_preserving_field_list(CloneType.I2E, 32w0, 8w0); } } @@ -48,4 +48,3 @@ 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 fe2f06a55b0..3787f931978 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; } @@ -21,7 +21,7 @@ parser parse(packet_in pk, out parsed_packet_t h, inout local_metadata_t local_m control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, inout standard_metadata_t standard_metadata) { apply { - clone3_preserving_field_list(CloneType.I2E, 32w0, 8w0); + clone_preserving_field_list(CloneType.I2E, 32w0, 8w0); } } @@ -46,4 +46,3 @@ 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 69a24686093..14310cac4e6 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; } @@ -21,7 +21,7 @@ parser parse(packet_in pk, out parsed_packet_t h, inout local_metadata_t local_m control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, inout standard_metadata_t standard_metadata) { @hidden action issue1660bmv2l23() { - clone3_preserving_field_list(CloneType.I2E, 32w0, 8w0); + clone_preserving_field_list(CloneType.I2E, 32w0, 8w0); } @hidden table tbl_issue1660bmv2l23 { actions = { @@ -55,4 +55,3 @@ 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 126013210af..5c3a015f06c 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; } @@ -23,7 +23,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, apply { HasBool b; b.x = true; - clone3_preserving_field_list(CloneType.I2E, 0, 0); + clone_preserving_field_list(CloneType.I2E, 0, 0); } } @@ -48,4 +48,3 @@ 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 ea6f5565174..f36ae63ac26 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; } @@ -209,12 +209,12 @@ control MyIngress(inout headers hdr, inout metadata meta, inout standard_metadat action controller_debug() { meta.task = 16w3; meta.ingress_port = standard_metadata.ingress_port; - clone3_preserving_field_list(CloneType.I2E, 32w100, 8w0); + clone_preserving_field_list(CloneType.I2E, 32w100, 8w0); } action controller_reply(task_t task) { meta.task = task; meta.ingress_port = standard_metadata.ingress_port; - clone3_preserving_field_list(CloneType.I2E, 32w100, 8w0); + clone_preserving_field_list(CloneType.I2E, 32w100, 8w0); } action multicast_pkg(mcast_t mcast_grp) { standard_metadata.mcast_grp = mcast_grp; @@ -356,4 +356,3 @@ 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 f7ba402ec97..cf8e9ba0979 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; } @@ -199,22 +199,22 @@ control MyIngress(inout headers hdr, inout metadata meta, inout standard_metadat @name("MyIngress.controller_debug") action controller_debug() { meta.task = 16w3; meta.ingress_port = standard_metadata.ingress_port; - clone3_preserving_field_list(CloneType.I2E, 32w100, 8w0); + clone_preserving_field_list(CloneType.I2E, 32w100, 8w0); } @name("MyIngress.controller_debug") action controller_debug_1() { meta.task = 16w3; meta.ingress_port = standard_metadata.ingress_port; - clone3_preserving_field_list(CloneType.I2E, 32w100, 8w0); + clone_preserving_field_list(CloneType.I2E, 32w100, 8w0); } @name("MyIngress.controller_reply") action controller_reply(@name("task") task_t task_1) { meta.task = task_1; meta.ingress_port = standard_metadata.ingress_port; - clone3_preserving_field_list(CloneType.I2E, 32w100, 8w0); + clone_preserving_field_list(CloneType.I2E, 32w100, 8w0); } @name("MyIngress.controller_reply") action controller_reply_1(@name("task") task_t task_2) { meta.task = task_2; meta.ingress_port = standard_metadata.ingress_port; - clone3_preserving_field_list(CloneType.I2E, 32w100, 8w0); + clone_preserving_field_list(CloneType.I2E, 32w100, 8w0); } @name("MyIngress.icmp6_echo_reply") action icmp6_echo_reply() { mac_tmp_0 = hdr.ethernet.dst_addr; @@ -287,4 +287,3 @@ 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 b5ee75d8200..e7a0423bb4d 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; } @@ -207,22 +207,22 @@ control MyIngress(inout headers hdr, inout metadata meta, inout standard_metadat @name("MyIngress.controller_debug") action controller_debug() { meta.task = 16w3; meta.ingress_port = standard_metadata.ingress_port; - clone3_preserving_field_list(CloneType.I2E, 32w100, 8w0); + clone_preserving_field_list(CloneType.I2E, 32w100, 8w0); } @name("MyIngress.controller_debug") action controller_debug_1() { meta.task = 16w3; meta.ingress_port = standard_metadata.ingress_port; - clone3_preserving_field_list(CloneType.I2E, 32w100, 8w0); + clone_preserving_field_list(CloneType.I2E, 32w100, 8w0); } @name("MyIngress.controller_reply") action controller_reply(@name("task") task_t task_1) { meta.task = task_1; meta.ingress_port = standard_metadata.ingress_port; - clone3_preserving_field_list(CloneType.I2E, 32w100, 8w0); + clone_preserving_field_list(CloneType.I2E, 32w100, 8w0); } @name("MyIngress.controller_reply") action controller_reply_1(@name("task") task_t task_2) { meta.task = task_2; meta.ingress_port = standard_metadata.ingress_port; - clone3_preserving_field_list(CloneType.I2E, 32w100, 8w0); + clone_preserving_field_list(CloneType.I2E, 32w100, 8w0); } @name("MyIngress.icmp6_echo_reply") action icmp6_echo_reply() { mac_tmp_0 = hdr.ethernet.dst_addr; @@ -304,4 +304,3 @@ 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 2d093188e8b..00e74ff9e17 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; } @@ -209,12 +209,12 @@ control MyIngress(inout headers hdr, inout metadata meta, inout standard_metadat action controller_debug() { meta.task = TASK_DEBUG; meta.ingress_port = standard_metadata.ingress_port; - clone3_preserving_field_list(CloneType.I2E, 100, 0); + clone_preserving_field_list(CloneType.I2E, 100, 0); } action controller_reply(task_t task) { meta.task = task; meta.ingress_port = standard_metadata.ingress_port; - clone3_preserving_field_list(CloneType.I2E, 100, 0); + clone_preserving_field_list(CloneType.I2E, 100, 0); } action multicast_pkg(mcast_t mcast_grp) { standard_metadata.mcast_grp = mcast_grp; @@ -356,4 +356,3 @@ 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/issue383-bmv2-first.p4 b/testdata/p4_16_samples_outputs/issue383-bmv2-first.p4 index ba84c27bfe6..4c42a4ece67 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; @@ -80,7 +80,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, local_metadata.row0.alt0 = local_metadata.row1.alt1; local_metadata.row1.alt0.valid = 1w1; local_metadata.row1.alt1.port = local_metadata.row0.alt1.port + 7w1; - clone3_preserving_field_list(CloneType.I2E, 32w0, 8w0); + clone_preserving_field_list(CloneType.I2E, 32w0, 8w0); } } @@ -107,4 +107,3 @@ 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 515023c2171..d91b4999752 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; @@ -80,7 +80,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, local_metadata.row0.alt0 = local_metadata.row1.alt1; local_metadata.row1.alt0.valid = 1w1; local_metadata.row1.alt1.port = local_metadata.row0.alt1.port + 7w1; - clone3_preserving_field_list(CloneType.I2E, 32w0, 8w0); + clone_preserving_field_list(CloneType.I2E, 32w0, 8w0); } } @@ -107,4 +107,3 @@ 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 925a39360cc..4a305851a40 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; @@ -96,7 +96,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, local_metadata._row0_alt0_port1 = local_metadata._row1_alt1_port7; local_metadata._row1_alt0_valid4 = 1w1; local_metadata._row1_alt1_port7 = local_metadata._row0_alt1_port3 + 7w1; - clone3_preserving_field_list(CloneType.I2E, 32w0, 8w0); + clone_preserving_field_list(CloneType.I2E, 32w0, 8w0); } @hidden table tbl_issue383bmv2l75 { actions = { @@ -140,4 +140,3 @@ 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 1dff1149c8c..f46de800606 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; @@ -78,7 +78,7 @@ control ingress(inout parsed_packet_t h, inout local_metadata_t local_metadata, local_metadata.row0.alt0 = local_metadata.row1.alt1; local_metadata.row1.alt0.valid = 1; local_metadata.row1.alt1.port = local_metadata.row0.alt1.port + 1; - clone3_preserving_field_list(CloneType.I2E, 0, 0); + clone_preserving_field_list(CloneType.I2E, 0, 0); } } @@ -105,4 +105,3 @@ 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 8e70e72f1c5..b6780d46394 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; } @@ -31,7 +31,7 @@ control ingress(inout parsed_packet_t hdr, inout local_metadata_t local_metadata local_metadata.row.alt0 = local_metadata.row.alt1; local_metadata.row.alt0.valid = 1w1; local_metadata.row.alt1.port = local_metadata.row.alt1.port + 7w1; - clone3_preserving_field_list(CloneType.I2E, 32w0, 8w0); + clone_preserving_field_list(CloneType.I2E, 32w0, 8w0); } } @@ -56,4 +56,3 @@ 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 8e70e72f1c5..b6780d46394 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; } @@ -31,7 +31,7 @@ control ingress(inout parsed_packet_t hdr, inout local_metadata_t local_metadata local_metadata.row.alt0 = local_metadata.row.alt1; local_metadata.row.alt0.valid = 1w1; local_metadata.row.alt1.port = local_metadata.row.alt1.port + 7w1; - clone3_preserving_field_list(CloneType.I2E, 32w0, 8w0); + clone_preserving_field_list(CloneType.I2E, 32w0, 8w0); } } @@ -56,4 +56,3 @@ 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 cc0694d7da0..f7c0d8cc7a4 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; } @@ -38,7 +38,7 @@ control ingress(inout parsed_packet_t hdr, inout local_metadata_t local_metadata local_metadata._row_alt0_port1 = local_metadata._row_alt1_port3; local_metadata._row_alt0_valid0 = 1w1; local_metadata._row_alt1_port3 = local_metadata._row_alt1_port3 + 7w1; - clone3_preserving_field_list(CloneType.I2E, 32w0, 8w0); + clone_preserving_field_list(CloneType.I2E, 32w0, 8w0); } @hidden table tbl_issue562bmv2l32 { actions = { @@ -72,4 +72,3 @@ 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 0676d9e9621..0a36f96579f 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; } @@ -31,7 +31,7 @@ control ingress(inout parsed_packet_t hdr, inout local_metadata_t local_metadata local_metadata.row.alt0 = local_metadata.row.alt1; local_metadata.row.alt0.valid = 1; local_metadata.row.alt1.port = local_metadata.row.alt1.port + 1; - clone3_preserving_field_list(CloneType.I2E, 0, 0); + clone_preserving_field_list(CloneType.I2E, 0, 0); } } @@ -56,4 +56,3 @@ 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/v1model-special-ops-bmv2-first.p4 b/testdata/p4_16_samples_outputs/v1model-special-ops-bmv2-first.p4 index 97b3f55d419..bfca126cbac 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 @@ -94,7 +94,7 @@ control ingress(inout headers_t hdr, inout meta_t meta, inout standard_metadata_ resubmit_preserving_field_list(8w0); } action do_clone_i2e(bit<32> l2ptr) { - clone3_preserving_field_list(CloneType.I2E, 32w5, 8w0); + clone_preserving_field_list(CloneType.I2E, 32w5, 8w0); meta.fwd.l2ptr = l2ptr; } table ipv4_da_lpm { @@ -166,7 +166,7 @@ control egress(inout headers_t hdr, inout meta_t meta, inout standard_metadata_t } action do_clone_e2e(bit<48> smac) { hdr.ethernet.srcAddr = smac; - clone3_preserving_field_list(CloneType.E2E, 32w11, 8w0); + clone_preserving_field_list(CloneType.E2E, 32w11, 8w0); } table send_frame { key = { @@ -219,4 +219,3 @@ 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 e7bf4251279..1252d863dc1 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 @@ -86,7 +86,7 @@ control ingress(inout headers_t hdr, inout meta_t meta, inout standard_metadata_ resubmit_preserving_field_list(8w0); } @name("ingress.do_clone_i2e") action do_clone_i2e(@name("l2ptr") bit<32> l2ptr_3) { - clone3_preserving_field_list(CloneType.I2E, 32w5, 8w0); + clone_preserving_field_list(CloneType.I2E, 32w5, 8w0); meta.fwd.l2ptr = l2ptr_3; } @name("ingress.ipv4_da_lpm") table ipv4_da_lpm_0 { @@ -176,7 +176,7 @@ control egress(inout headers_t hdr, inout meta_t meta, inout standard_metadata_t } @name("egress.do_clone_e2e") action do_clone_e2e(@name("smac") bit<48> smac_2) { hdr.ethernet.srcAddr = smac_2; - clone3_preserving_field_list(CloneType.E2E, 32w11, 8w0); + clone_preserving_field_list(CloneType.E2E, 32w11, 8w0); } @name("egress.send_frame") table send_frame_0 { key = { @@ -229,4 +229,3 @@ 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 c72de59a92b..91505d559d0 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 @@ -142,7 +142,7 @@ control ingress(inout headers_t hdr, inout meta_t meta, inout standard_metadata_ resubmit_preserving_field_list(8w0); } @name("ingress.do_clone_i2e") action do_clone_i2e(@name("l2ptr") bit<32> l2ptr_3) { - clone3_preserving_field_list(CloneType.I2E, 32w5, 8w0); + clone_preserving_field_list(CloneType.I2E, 32w5, 8w0); meta._fwd_l2ptr0 = l2ptr_3; } @name("ingress.ipv4_da_lpm") table ipv4_da_lpm_0 { @@ -270,7 +270,7 @@ control egress(inout headers_t hdr, inout meta_t meta, inout standard_metadata_t } @name("egress.do_clone_e2e") action do_clone_e2e(@name("smac") bit<48> smac_2) { hdr.ethernet.srcAddr = smac_2; - clone3_preserving_field_list(CloneType.E2E, 32w11, 8w0); + clone_preserving_field_list(CloneType.E2E, 32w11, 8w0); } @name("egress.send_frame") table send_frame_0 { key = { @@ -355,4 +355,3 @@ 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 b91d440e3dc..d2d398d580d 100644 --- a/testdata/p4_16_samples_outputs/v1model-special-ops-bmv2.p4 +++ b/testdata/p4_16_samples_outputs/v1model-special-ops-bmv2.p4 @@ -94,7 +94,7 @@ control ingress(inout headers_t hdr, inout meta_t meta, inout standard_metadata_ resubmit_preserving_field_list(0); } action do_clone_i2e(bit<32> l2ptr) { - clone3_preserving_field_list(CloneType.I2E, I2E_CLONE_SESSION_ID, 0); + clone_preserving_field_list(CloneType.I2E, I2E_CLONE_SESSION_ID, 0); meta.fwd.l2ptr = l2ptr; } table ipv4_da_lpm { @@ -164,7 +164,7 @@ control egress(inout headers_t hdr, inout meta_t meta, inout standard_metadata_t } action do_clone_e2e(bit<48> smac) { hdr.ethernet.srcAddr = smac; - clone3_preserving_field_list(CloneType.E2E, E2E_CLONE_SESSION_ID, 0); + clone_preserving_field_list(CloneType.E2E, E2E_CLONE_SESSION_ID, 0); } table send_frame { key = { @@ -217,4 +217,3 @@ control computeChecksum(inout headers_t hdr, inout meta_t meta) { } V1Switch(ParserImpl(), verifyChecksum(), ingress(), egress(), computeChecksum(), DeparserImpl()) main; -