P4C
The P4 Compiler
Loading...
Searching...
No Matches
bridged_packing.h
1
19#ifndef BACKENDS_TOFINO_BF_P4C_COMMON_BRIDGED_PACKING_H_
20#define BACKENDS_TOFINO_BF_P4C_COMMON_BRIDGED_PACKING_H_
21
22#include "bf-p4c/bf-p4c-options.h"
23#include "bf-p4c/common/extract_maupipe.h"
24#include "bf-p4c/common/field_defuse.h"
25#include "bf-p4c/common/pragma/collect_global_pragma.h"
26#include "bf-p4c/logging/source_info_logging.h"
27#include "bf-p4c/midend/blockmap.h"
28#include "bf-p4c/midend/normalize_params.h"
29#include "bf-p4c/midend/param_binding.h"
30#include "bf-p4c/midend/simplify_references.h"
31#include "bf-p4c/midend/type_checker.h"
32#include "bf-p4c/phv/action_phv_constraints.h"
33#include "bf-p4c/phv/constraints/constraints.h"
34#include "bf-p4c/phv/phv.h"
35#include "bf-p4c/phv/phv_fields.h"
36#include "frontends/common/resolveReferences/referenceMap.h"
37#include "frontends/common/resolveReferences/resolveReferences.h"
38#include "frontends/p4/methodInstance.h"
39#include "frontends/p4/typeMap.h"
40#include "z3++.h"
41
42using namespace P4;
43
44// Collection of bridge metadata constraints across all pipelines
45// in the program.
56
57using FieldListEntry = std::pair<int, const IR::Type *>;
60using RepackedHeaders = std::vector<std::pair<const IR::HeaderOrMetadata *, std::string>>;
65
71
84
105 private:
106 const PhvInfo &phv;
107
108 bool preorder(const IR::BFN::Unit *unit) override {
109 if (unit->thread() == EGRESS) return false;
110 return true;
111 }
112
113 profile_t init_apply(const IR::Node *root) override;
114 void postorder(const IR::BFN::AliasMember *mem) override;
115 void end_apply() override;
116
117 public:
118 explicit CollectIngressBridgedFields(const PhvInfo &phv) : phv(phv) {}
119
122};
123
146 const PhvInfo &phv;
148 ordered_map<const PHV::Field *,
150 candidateSourcesInParser;
151
152 public:
153 explicit CollectEgressBridgedFields(const PhvInfo &p) : phv(p) {}
154
157
158 Visitor::profile_t init_apply(const IR::Node *root) override;
159 bool preorder(const IR::BFN::Extract *extract) override;
160 void end_apply() override;
161};
162
179 public:
181
182 private:
183 const PhvInfo &phv;
185 FieldToFieldSet parserAlignedFields;
187 FieldToFieldSet reverseParserAlignMap;
188
189 profile_t init_apply(const IR::Node *root) override {
190 parserAlignedFields.clear();
191 reverseParserAlignMap.clear();
192 return Inspector::init_apply(root);
193 }
194
195 bool preorder(const IR::BFN::Extract *e) override;
196
197 public:
198 explicit GatherParserExtracts(const PhvInfo &p) : phv(p) {}
199
200 bool count(const PHV::Field *f) const { return parserAlignedFields.count(f); }
201
202 const ordered_set<const PHV::Field *> &at(const PHV::Field *f) const {
203 static ordered_set<const PHV::Field *> emptySet;
204 if (!parserAlignedFields.count(f)) return emptySet;
205 return parserAlignedFields.at(f);
206 }
207
208 bool revCount(const PHV::Field *f) const { return reverseParserAlignMap.count(f); }
209
210 const ordered_set<const PHV::Field *> &revAt(const PHV::Field *f) const {
211 static ordered_set<const PHV::Field *> emptySet;
212 if (!reverseParserAlignMap.count(f)) return emptySet;
213 return reverseParserAlignMap.at(f);
214 }
215
216 const FieldToFieldSet &getAlignedMap() const { return parserAlignedFields; }
217 const FieldToFieldSet &getReverseMap() const { return reverseParserAlignMap; }
218};
219
220template <typename NodeType, typename Func, typename Func2>
221void forAllMatchingDoPreAndPostOrder(const IR::Node *root, Func &&function, Func2 &&function2) {
222 struct NodeVisitor : public Inspector {
223 explicit NodeVisitor(Func &&function, Func2 &&function2)
224 : function(function), function2(function2) {}
225 Func function;
226 Func2 function2;
227 bool preorder(const NodeType *node) override {
228 function(node);
229 return true;
230 }
231 void postorder(const NodeType *node) override { function2(node); }
232 };
233 root->apply(NodeVisitor(std::forward<Func>(function), std::forward<Func2>(function2)));
234}
235
236template <typename NodeType, typename Func>
237void forAllMatchingDoPostOrder(const IR::Node *root, Func &&function) {
238 struct NodeVisitor : public Inspector {
239 explicit NodeVisitor(Func &&function) : function(function) {}
240 Func function;
241 void postorder(const NodeType *node) override { function(node); }
242 };
243 root->apply(NodeVisitor(std::forward<Func>(function)));
244}
245
264 public:
266
267 private:
268 const PhvInfo &phv;
271 FieldToFieldSet digestFieldMap;
272 FieldToFieldSet reverseDigestFieldMap;
273
275 const FieldToFieldSet &getDigestMap() const { return digestFieldMap; }
277 const FieldToFieldSet &getReverseDigestMap() const { return reverseDigestFieldMap; }
278
279 public:
280 explicit GatherDigestFields(const PhvInfo &p) : phv(p) {}
281 bool preorder(const IR::BFN::DigestFieldList *fl) override;
282 bool preorder(const IR::HeaderOrMetadata *hdr) override;
283 void end_apply() override;
284};
285
303 PhvInfo &phv;
304
305 struct Constraints {
306 // collected alignment constraints;
308 // two field must have the same constraint, exact value to be determined by solver.
310
313 };
314 Constraints constraints;
315
316 const CollectIngressBridgedFields &ingressBridgedFields;
317 const CollectEgressBridgedFields &egressBridgedFields;
318 const GatherParserExtracts &parserAlignedFields;
319 const GatherDigestFields &digestFields;
320 const ActionPhvConstraints &actionConstraints;
321
322 // determine alignment constraint on a single field.
323 cstring getOppositeGressFieldName(cstring);
324 cstring getEgressFieldName(cstring);
325
326 ordered_set<const PHV::Field *> findAllRelatedFields(const PHV::Field *f);
327 ordered_set<const PHV::Field *> findAllReachingFields(const PHV::Field *f);
328 ordered_set<const PHV::Field *> findAllSourcingFields(const PHV::Field *f);
329 ordered_set<const PHV::Field *> findAllRelatedFieldsOfCopackedFields(const PHV::Field *f);
330 void computeAlignmentConstraint(const ordered_set<const PHV::Field *> &, bool);
331
334 void computeMustPackConstraints(const ordered_set<const PHV::Field *> &, bool);
335
336 void computeNoPackIfIntrinsicMeta(const ordered_set<const PHV::Field *> &, bool);
337 void computeNoPackIfActionDataWrite(const ordered_set<const PHV::Field *> &, bool);
338 void computeNoPackIfSpecialityRead(const ordered_set<const PHV::Field *> &, bool);
339 void computeNoPackIfDigestUse(const ordered_set<const PHV::Field *> &, bool);
340 void computeNoSplitConstraints(const ordered_set<const PHV::Field *> &, bool);
341
342 bool preorder(const IR::HeaderOrMetadata *) override;
343 bool preorder(const IR::BFN::DigestFieldList *) override;
344 profile_t init_apply(const IR::Node *root) override;
345 void end_apply() override;
346
352 template <typename NodeType, typename Func, typename Func2>
353 void forAllMatching(const IR::Node *root, Func &&function, Func2 &&function2) {
354 struct NodeVisitor : public Inspector {
355 explicit NodeVisitor(Func &&function, Func2 &&function2)
356 : function(function), function2(function2) {}
357 Func function;
358 Func2 function2;
359 bool preorder(const NodeType *node) override {
360 function(node);
361 return true;
362 }
363 void postorder(const NodeType *node) override { function2(node); }
364 };
365 root->apply(NodeVisitor(std::forward<Func>(function), std::forward<Func2>(function2)));
366 }
367
368 public:
371 const GatherDigestFields &d, const ActionPhvConstraints &a)
372 : phv(p),
373 ingressBridgedFields(b),
374 egressBridgedFields(e),
375 parserAlignedFields(g),
376 digestFields(d),
377 actionConstraints(a) {}
378};
379
384 private:
385 CollectIngressBridgedFields collectIngressBridgedFields;
386 CollectEgressBridgedFields collectEgressBridgedFields;
387 GatherParserExtracts collectParserAlignedFields;
388 GatherDigestFields collectDigestFields; // Outputs currently not used
389
390 public:
392 : collectIngressBridgedFields(p),
393 collectEgressBridgedFields(p),
394 collectParserAlignedFields(p),
395 collectDigestFields(p) {
396 addPasses({
397 &collectIngressBridgedFields,
398 &collectEgressBridgedFields,
399 &collectParserAlignedFields,
400 &collectDigestFields,
401 new CollectConstraints(p, collectIngressBridgedFields, collectEgressBridgedFields,
402 collectParserAlignedFields, collectDigestFields, a),
403 });
404 }
405};
406
440 const PhvInfo &phv;
441 z3::context &context;
442 z3::optimize &solver;
443 PackingConstraints &packingConstraints;
444 AllConstraints &constraints;
447 DebugInfo &debug_info;
448
449 void add_field_alignment_constraints(cstring, const PHV::Field *, int);
450 void add_non_overlap_constraints(cstring, ordered_set<const PHV::Field *> &);
451 void add_extract_together_constraints(cstring, ordered_set<const PHV::Field *> &);
452 void add_solitary_constraints(cstring, ordered_set<const PHV::Field *> &);
453 void add_deparsed_to_tm_constraints(cstring, ordered_set<const PHV::Field *> &);
454 void add_no_pack_constraints(cstring, ordered_set<const PHV::Field *> &);
455 void add_no_split_constraints(cstring, ordered_set<const PHV::Field *> &);
456
457 const PHV::Field *create_padding(int size);
458 std::vector<const PHV::Field *> insert_padding(std::vector<std::pair<unsigned, std::string>> &);
459
460 void dump_unsat_core();
461
462 public:
463 explicit ConstraintSolver(const PhvInfo &p, z3::context &context, z3::optimize &solver,
464 PackingConstraints &pc, AllConstraints &constraints, DebugInfo &dbg)
465 : phv(p),
466 context(context),
467 solver(solver),
468 packingConstraints(pc),
469 constraints(constraints),
470 debug_info(dbg) {}
471
476
477 void print_assertions();
478};
479
524 const PhvInfo &phv;
530 const ordered_set<cstring> &candidates;
531
534
543 // XXX: make this a ordered_map<cstring, IR::StructField>
545 phvFieldToStructFieldMap;
546
551
552 PackingCandidateFields &packingCandidateFields;
553 PackingConstraints &packingConstraints;
554
558
559 // Pipeline name for printing debug messages
560 cstring pipelineName;
561
562 public:
564 const ordered_set<cstring> &c,
567 : phv(p),
568 solver(solver),
569 candidates(c),
570 repackedTypes(r),
571 packingCandidateFields(pcf),
572 packingConstraints(pc) {}
573
574 Visitor::profile_t init_apply(const IR::Node *root) override;
575 bool preorder(const IR::HeaderOrMetadata *hdr) override;
576 bool preorder(const IR::BFN::DigestFieldList *dfl) override;
577 void end_apply() override;
578
579 void set_pipeline_name(cstring name) { pipelineName = name; }
580 void optimize();
581 void solve();
582};
583
591
592 public:
594 : repackedTypes(r) {}
595
596 bool preorder(const IR::BFN::Type_FixedSizeHeader *h) override {
597 auto width = [&](const IR::Type_StructLike *s) -> int {
598 int rv = 0;
599 for (auto f : s->fields) rv += f->type->width_bits();
600 return rv;
601 };
602
603 auto countPadding = [&](const IR::IndexedVector<IR::StructField> &fields) -> int {
604 int count = 0;
605 for (auto f = fields.begin(); f != fields.end(); f++) {
606 if ((*f)->getAnnotation("padding"_cs)) count++;
607 }
608 return count;
609 };
610
611 auto genPadding = [&](int size, int id) {
612 cstring padFieldName = "__pad_" + cstring::to_cstring(id);
613 auto *fieldAnnotations =
614 new IR::Annotations({new IR::Annotation(IR::ID("padding"), {}),
615 new IR::Annotation(IR::ID("overlayable"), {})});
616 const IR::StructField *padField =
617 new IR::StructField(padFieldName, fieldAnnotations, IR::Type::Bits::get(size));
618 return padField;
619 };
620
621 size_t bits = static_cast<size_t>(width(h));
622 ERROR_CHECK(bits <= Device::pardeSpec().bitResubmitSize(), "%1% digest limited to %2% bits",
623 h->name, Device::pardeSpec().bitResubmitSize());
624 auto pad_size = h->fixed_size - bits;
625
626 auto fields = new IR::IndexedVector<IR::StructField>();
627 fields->append(h->fields);
628 auto index = countPadding(h->fields);
629 if (pad_size != 0) {
630 auto padding = genPadding(pad_size, index++);
631 fields->push_back(padding);
632 }
633
634 auto newType = new IR::Type_Header(h->name, *fields);
635 repackedTypes.emplace(h->name, newType);
636 return false;
637 }
638};
639
648 const RepackedHeaderTypes &repackedTypes;
649
650 public:
651 explicit ReplaceFlexibleType(const RepackedHeaderTypes &m) : repackedTypes(m) {}
652
653 // if used in backend
654 const IR::Node *postorder(IR::HeaderOrMetadata *h) override;
655 const IR::Node *postorder(IR::BFN::DigestFieldList *d) override;
656 const IR::BFN::DigestFieldList *repackFieldList(
657 cstring digest, std::vector<FieldListEntry> repackedFieldIndices,
658 const IR::Type_StructLike *repackedHeaderType,
659 const IR::BFN::DigestFieldList *origFieldList) const;
660
661 // if used in midend
662 const IR::Node *postorder(IR::Type_StructLike *h) override;
663 const IR::Node *postorder(IR::StructExpression *h) override;
664};
665
666bool findFlexibleAnnotation(const IR::Type_StructLike *);
667
673 private:
674 const PhvInfo &phv;
677
678 profile_t init_apply(const IR::Node *root) override {
679 params.clear();
680 return Inspector::init_apply(root);
681 }
682
683 bool preorder(const IR::BFN::DeparserParameter *p) override;
684
685 public:
687 : phv(p), params(f) {}
688};
689
694 private:
695 const PhvInfo &phv;
698 static constexpr char const *PHASE0_PARSER_STATE_NAME = "ingress::$phase0";
699
700 profile_t init_apply(const IR::Node *root) override {
701 noPackFields.clear();
702 return Inspector::init_apply(root);
703 }
704
705 bool preorder(const IR::BFN::ParserState *p) override;
706
707 bool preorder(const IR::BFN::DigestFieldList *d) override;
708
709 public:
711 : phv(p), noPackFields(f) {}
712};
713
714// set of variables for bridged fields (pretty print)
715// set of constraints for bridged fields
716// helper function to convert between PHV::Field to z3::expr
717// constraints are objects on PHV fields
718// constraints can be pretty_printed, encoded to z3
720 private:
721 // Need this for field names
722 const PhvInfo &phv;
723 // Contains all of the (potentially) repacked headers
724 RepackedHeaders repacked;
725 // All headers we have seen before, but with "egress" or "ingress" removed (avoid duplication)
726 std::unordered_set<std::string> hdrs;
727
728 // Collects all headers/metadatas that may have been repacked (i.e. have a field that is
729 // flexible)
730 bool preorder(const IR::HeaderOrMetadata *h) override;
731
732 // Pretty print all of the flexible headers
733 void end_apply() override;
734
735 // Returns the full field name
736 std::string getFieldName(std::string hdr, const IR::StructField *field) const;
737
738 // Pretty prints a single header/metadata
739 std::string pretty_print(const IR::HeaderOrMetadata *h, std::string hdr) const;
740
741 // Strips the given prefix from the front of the cstring, returns as string
742 std::string strip_prefix(cstring str, std::string pre);
743
744 public:
745 explicit LogRepackedHeaders(const PhvInfo &p) : phv(p) {}
746
747 std::string asm_output() const;
748};
749
751 LogRepackedHeaders *flexibleLogging;
752
753 public:
754 explicit LogFlexiblePacking(const PhvInfo &phv)
755 : Logging::PassManager("flexible_packing"_cs, Logging::Mode::AUTO) {
756 flexibleLogging = new LogRepackedHeaders(phv);
757 addPasses({
758 flexibleLogging,
759 });
760 }
761
762 const LogRepackedHeaders *get_flexible_logging() const { return flexibleLogging; }
763};
764
766 private:
767 const BFN_Options &options;
768 MauBacktracker table_alloc;
769 PragmaNoPack pa_no_pack;
770 PackConflicts packConflicts;
771 MapTablesToActions tableActionsMap;
772 ActionPhvConstraints actionConstraints;
773 SymBitMatrix doNotPack;
777 ordered_set<const PHV::Field *> deparserParams;
778
779 // used by solver-based packing
781 PackWithConstraintSolver &packWithConstraintSolver;
782
783 public:
785 DependencyGraph &dg, const BFN_Options &o,
787
788 // Return a Json representation of flexible headers to be saved in .bfa/context.json
789 // must be called after the pass is applied
790 std::string asm_output() const;
791};
792
793// PackFlexibleHeader manages the global context for packing bridge metadata
794// The global context includes:
795// - instance of z3 solver and its context
796//
797// We need to manage the global context at this level is because bridge
798// metadata can be used across multiple pipelines in folded pipeline. To
799// support folded pipeline, we first collect bridge metadata constraints across
800// each pair of ingress/egress, and run z3 solver over the global set of
801// constraints over all pairs of ingress&egress pipelines. Therefore, it
802// is necessary to maintain z3 context as this level.
804 std::vector<const IR::BFN::Pipe *> pipe;
805 PhvInfo phv;
806 PhvUse uses;
807 FieldDefUse defuse;
808 DependencyGraph deps;
809
810 z3::context context;
811 z3::optimize solver;
812 ConstraintSolver constraint_solver;
813 PackWithConstraintSolver packWithConstraintSolver;
814 PackingCandidateFields packingCandidateFields;
815 PackingConstraints packingConstraints;
816 PackedFields packedFields;
817 AllConstraints constraints;
818
819 cstring pipelineName;
820 /* storage for debug log */
821 DebugInfo debug_info;
822
824
825 public:
826 explicit PackFlexibleHeaders(const BFN_Options &options, ordered_set<cstring> &,
827 RepackedHeaderTypes &repackedTypes);
828
829 void set_pipeline_name(cstring name) { pipelineName = name; }
830 // encode constraints to z3 expressions
831 void optimize() {
832 packWithConstraintSolver.set_pipeline_name(pipelineName);
833 packWithConstraintSolver.optimize();
834 }
835 // execute z3 solver to find a solution
836 void solve() { packWithConstraintSolver.solve(); }
837 // convert the solution to P4 header format
838 void end_apply() override;
839
840 void print_packing_candidate_fields() const {
841 for (auto &[hdr_type, fields] : packingCandidateFields) {
842 LOG3("Packing candidate fields for " << hdr_type << ":");
843 for (auto f : fields) {
844 LOG3(" " << f);
845 }
846 }
847 }
848 void check_conflicting_constraints();
849};
850
925using PipeAndGress = std::pair<std::pair<cstring, gress_t>, std::pair<cstring, gress_t>>;
926
928
930 public:
931 P4::ReferenceMap *refMap;
932 P4::TypeMap *typeMap;
933
934 struct Use {
935 const IR::Type *type;
936 cstring name;
937 cstring method;
938 gress_t thread;
939
940 bool operator<(const Use &other) const {
941 return std::tie(type, name, method, thread) <
942 std::tie(other.type, other.name, other.method, other.thread);
943 }
944
945 bool operator==(const Use &other) const {
946 return std::tie(type, name, method, thread) ==
947 std::tie(other.type, other.name, other.method, other.thread);
948 }
949 };
950
951 ordered_set<Use> bridge_uses;
952
953 friend std::ostream &operator<<(std::ostream &, const Use &u);
954
955 public:
957 : refMap(refMap), typeMap(typeMap) {}
958
959 void postorder(const IR::MethodCallExpression *mc) override;
960};
961
963 int pipe_id;
965 IR::BFN::Pipe::thread_t thread;
966};
967
969 const BFN_Options &options;
970 P4::ReferenceMap *refMap;
971 P4::TypeMap *typeMap;
973 ParamBinding *bindings;
975 CollectGlobalPragma collect_pragma;
976
977 public:
979
980 ExtractBridgeInfo(BFN_Options &options, P4::ReferenceMap *refMap, P4::TypeMap *typeMap,
982 : options(options),
983 refMap(refMap),
984 typeMap(typeMap),
985 conv(conv),
986 bindings(bindings),
987 map(ht) {}
988
989 std::vector<const IR::BFN::Pipe *> *generate_bridge_pairs(std::vector<BridgeContext> &);
990
991 bool preorder(const IR::P4Program *program) override;
992 void end_apply(const IR::Node *) override;
993};
994
1003 ParamBinding *bindings;
1004 BFN::ApplyEvaluator *evaluator;
1007 ExtractBridgeInfo *extractBridgeInfo;
1008
1009 public:
1010 P4::ReferenceMap refMap;
1011 P4::TypeMap typeMap;
1012
1013 public:
1014 BridgedPacking(BFN_Options &options, RepackedHeaderTypes &repackMap,
1015 CollectSourceInfoLogging &sourceInfoLogging);
1016
1019};
1020
1027 ParamBinding *bindings;
1028 BFN::ApplyEvaluator *evaluator;
1030
1031 public:
1032 P4::ReferenceMap refMap;
1033 P4::TypeMap typeMap;
1036
1037 public:
1038 SubstitutePackedHeaders(BFN_Options &options, const RepackedHeaderTypes &repackedMap,
1039 CollectSourceInfoLogging &sourceInfoLogging);
1040 const BFN::ProgramPipelines &getPipelines() const { return conv->getPipelines(); }
1041 const IR::ToplevelBlock *getToplevelBlock() const { return evaluator->toplevel; }
1042};
1043
1044#endif /* BACKENDS_TOFINO_BF_P4C_COMMON_BRIDGED_PACKING_H_ */
Definition action_mutex.h:29
Definition action_phv_constraints.h:107
Definition extract_maupipe.h:212
Definition arch.h:294
Definition bf-p4c-options.h:28
Definition bridged_packing.h:929
Definition bridged_packing.h:302
Definition bridged_packing.h:145
ordered_map< cstring, cstring > bridged_to_orig
Map: bridged field name -> original field name.
Definition bridged_packing.h:156
Definition collect_global_pragma.h:28
Definition bridged_packing.h:104
ordered_map< cstring, cstring > bridged_to_orig
Key: bridged field name, value: original field name.
Definition bridged_packing.h:121
The class uses the Z3 solver to generate packing for a set of PHV fields given a set of constraints.
Definition bridged_packing.h:439
void add_constraints(cstring, ordered_set< const PHV::Field * > &)
Definition bridged_packing.cpp:1297
ordered_map< cstring, std::vector< const PHV::Field * > > solve(ordered_map< cstring, ordered_set< const PHV::Field * > > &)
Definition bridged_packing.cpp:1432
void add_mutually_aligned_constraints(ordered_set< const PHV::Field * > &)
Definition bridged_packing.cpp:1109
Definition constraints.h:149
Definition constraints.h:56
Definition bridged_packing.h:968
bool preorder(const IR::P4Program *program) override
Definition bridged_packing.cpp:2330
Definition bridged_packing.h:383
Definition bridged_packing.h:672
Definition bridged_packing.h:263
bool preorder(const IR::BFN::DigestFieldList *fl) override
Definition bridged_packing.cpp:169
Definition bridged_packing.h:765
Definition bridged_packing.h:178
Definition bridged_packing.h:693
Definition bridged_packing.h:750
Definition bridged_packing.h:719
Definition backends/tofino/bf-p4c/logging/pass_manager.h:36
Definition map_tables_to_actions.h:29
Definition mau_backtracker.h:29
Definition node.h:52
Definition node.h:95
Definition vector.h:59
Definition visitor.h:400
Definition ir/pass_manager.h:40
Class used to encode maps from paths to declarations.
Definition referenceMap.h:66
Definition symbitmatrix.h:27
Definition visitor.h:424
Definition typeMap.h:41
Definition visitor.h:78
Definition cstring.h:85
Definition ordered_set.h:32
Definition phv_fields.h:154
Definition pack_conflicts.h:36
Definition bridged_packing.h:803
PackFlexibleHeaders(const BFN_Options &options, ordered_set< cstring > &, RepackedHeaderTypes &repackedTypes)
Definition bridged_packing.cpp:2182
Definition bridged_packing.h:523
bool preorder(const IR::HeaderOrMetadata *hdr) override
Definition bridged_packing.cpp:1488
void optimize()
Definition bridged_packing.cpp:1628
void solve()
Definition bridged_packing.cpp:1669
void end_apply() override
Definition bridged_packing.cpp:1651
Definition bridged_packing.h:589
Definition param_binding.h:32
size_t bitResubmitSize() const
Definition parde_spec.h:395
Definition phv_fields.h:1095
Definition phv_parde_mau_use.h:154
Definition pa_no_pack.h:28
Definition bridged_packing.h:647
Definition mau/table_mutex.h:110
Definition arch.h:453
The pass analyzes the usage of bridged headers and adjusts their packing.
Definition bridged_packing.h:1002
The pass substitutes bridged headers with adjusted ones and converts the IR into the backend form.
Definition bridged_packing.h:1026
Pass that collects source information.
Definition source_info_logging.h:39
Definition field_defuse.h:77
Definition tofino/bf-p4c/phv/constraints/constraints.cpp:21
@ AUTO
Creates if this is the first time writing to the log; otherwise, appends.
Definition filelog.h:43
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24
Definition phv/solver/action_constraint_solver.cpp:33
Definition bridged_packing.h:46
Definition bridged_packing.h:962
Definition bridged_packing.h:934
Definition table_dependency_graph.h:52
Definition id.h:28