P4C
The P4 Compiler
Loading...
Searching...
No Matches
group_constraint_extractor.h
1
19#ifndef BF_P4C_LOGGING_GROUP_CONSTRAINT_EXTRACTOR_H_
20#define BF_P4C_LOGGING_GROUP_CONSTRAINT_EXTRACTOR_H_
21
22#include <map>
23#include <set>
24#include <vector>
25
26#include "bf-p4c/logging/constrained_fields.h"
27#include "bf-p4c/phv/phv_fields.h"
28#include "bf-p4c/phv/utils/utils.h"
29
30class PhvInfo;
31
36 public:
37 using Group = std::vector<ConstrainedSlice>;
38
39 protected:
40 std::vector<Group> groups;
41 std::map<cstring, std::set<unsigned>> fieldToGroupMap; // Key is name of the field
42
43 void processSlice(unsigned groupId, const PHV::FieldSlice &slice,
44 const ConstrainedFieldMap &map);
45
46 public:
47 std::vector<const Group *> getGroups(const cstring &name) const;
48
49 // For a given field, check whether it is contained in any group
50 bool isFieldInAnyGroup(const cstring &name) const;
51};
52
57 public:
58 using MauGroup = Group;
59
60 private:
61 bool superClusterContainsOnlySingleField(const PHV::SuperCluster *sc) const;
62
63 public:
64 MauGroupExtractor(const std::list<PHV::SuperCluster *> &clusterGroups,
65 const ConstrainedFieldMap &map);
66};
67
72 private:
73 void processCluster(const PHV::AlignedCluster *cluster, const ConstrainedFieldMap &map);
74
75 public:
76 EquivalentAlignExtractor(const std::list<PHV::SuperCluster *> &superclusters,
77 const ConstrainedFieldMap &map);
78};
79
80#endif /* BF_P4C_LOGGING_GROUP_CONSTRAINT_EXTRACTOR_H_ */
Definition group_constraint_extractor.h:71
Blueprint for group constraint extractor classes.
Definition group_constraint_extractor.h:35
Definition group_constraint_extractor.h:56
Definition cstring.h:85
Definition phv/utils/utils.h:789
Definition phv_fields.h:898
Definition phv/utils/utils.h:1049
Definition phv_fields.h:1095