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
•
All
Classes
Namespaces
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Modules
Pages
Loading...
Searching...
No Matches
parde_phv_constraints.h
1
18
19
#ifndef BF_P4C_PHV_PARDE_PHV_CONSTRAINTS_H_
20
#define BF_P4C_PHV_PARDE_PHV_CONSTRAINTS_H_
21
22
#include "backends/tofino/bf-p4c/mau/mau_visitor.h"
23
#include "backends/tofino/bf-p4c/phv/phv_fields.h"
24
#include "backends/tofino/bf-p4c/phv/pragma/pa_container_size.h"
25
#include "ir/ir.h"
26
43
class
PardePhvConstraints :
public
Inspector
{
44
private
:
45
static
constexpr
int
MAX_CONSTANT_WINDOW = 3;
46
48
unsigned
DIGEST_BYTES_THRESHOLD;
49
50
PhvInfo
&phv;
51
PragmaContainerSize
&sizePragmas;
52
53
profile_t
init_apply(
const
IR::Node
*root)
override
;
54
bool
preorder(
const
IR::BFN::Digest *digest)
override
;
55
56
public
:
57
explicit
PardePhvConstraints(
PhvInfo
&p,
PragmaContainerSize
&pa) : phv(p), sizePragmas(pa) {
58
// Set the threshold for setting restrictions of unused bits in digest fields to 90% of the
59
// maximum.
60
DIGEST_BYTES_THRESHOLD = Device::maxDigestSizeInBytes() * 9 / 10;
61
}
62
};
43
class
PardePhvConstraints :
public
Inspector
{
…
};
63
64
class
TofinoParserConstantExtract :
public
Inspector
{
65
private
:
66
PhvInfo
&phv;
67
68
ordered_map<const IR::BFN::ParserState *, ordered_set<PHV::Field *>
> stateToPOVMap;
69
70
profile_t
init_apply(
const
IR::Node
*root)
override
;
71
bool
preorder(
const
IR::BFN::Extract *extract)
override
;
72
void
end_apply()
override
;
73
74
public
:
75
explicit
TofinoParserConstantExtract(
PhvInfo
&p) : phv(p) {}
76
};
64
class
TofinoParserConstantExtract :
public
Inspector
{
…
};
77
78
#endif
/* BF_P4C_PHV_PARDE_PHV_CONSTRAINTS_H_ */
P4::IR::Node
Definition
node.h:94
P4::Inspector
Definition
visitor.h:413
P4::Visitor::profile_t
Definition
visitor.h:78
P4::ordered_map
Definition
ordered_map.h:32
PhvInfo
Definition
phv_fields.h:1095
PragmaContainerSize
Definition
pa_container_size.h:39
backends
tofino
bf-p4c
phv
parde_phv_constraints.h
Generated by
1.13.0