P4C
The P4 Compiler
Toggle main menu visibility
Main Page
P4C Repository Organization
Getting Started
P4C Intermediate Representation (IR)
Frontend
Midend
Backends
Behavioral Model Backend
DPDK Backend
eBPF Backend
TC Backend
uBPF Backend
P4test Backend
Graphs Backend
p4fmt (P4 Formatter)
P4Tools
P4Smith
P4Testgen
Contribute to the P4 Compiler Project
Releases
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
w
x
z
Functions
a
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
w
x
Variables
Typedefs
Enumerations
Enumerator
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
y
z
~
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
y
Typedefs
Enumerations
Enumerator
Related Symbols
►
P4 Compiler Documentation (P4C)
•
All
Classes
Namespaces
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Modules
Pages
Loading...
Searching...
No Matches
group_constraint_extractor.h
1
18
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 "backends/tofino/bf-p4c/logging/constrained_fields.h"
27
#include "backends/tofino/bf-p4c/phv/phv_fields.h"
28
#include "backends/tofino/bf-p4c/phv/utils/utils.h"
29
30
class
PhvInfo
;
31
35
class
GroupConstraintExtractor
{
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
};
35
class
GroupConstraintExtractor
{
…
};
52
56
class
MauGroupExtractor :
public
GroupConstraintExtractor
{
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
};
56
class
MauGroupExtractor :
public
GroupConstraintExtractor
{
…
};
67
71
class
EquivalentAlignExtractor :
public
GroupConstraintExtractor
{
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
};
71
class
EquivalentAlignExtractor :
public
GroupConstraintExtractor
{
…
};
79
80
#endif
/* BF_P4C_LOGGING_GROUP_CONSTRAINT_EXTRACTOR_H_ */
GroupConstraintExtractor
Blueprint for group constraint extractor classes.
Definition
group_constraint_extractor.h:35
P4::cstring
Definition
cstring.h:85
PHV::AlignedCluster
Definition
phv/utils/utils.h:789
PHV::FieldSlice
Definition
phv_fields.h:898
PHV::SuperCluster
Definition
phv/utils/utils.h:1049
PhvInfo
Definition
phv_fields.h:1095
backends
tofino
bf-p4c
logging
group_constraint_extractor.h
Generated by
1.13.2