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
kind_size_indexed_map.h
1
19
#ifndef BF_P4C_PHV_V2_KIND_SIZE_INDEXED_MAP_H_
20
#define BF_P4C_PHV_V2_KIND_SIZE_INDEXED_MAP_H_
21
22
#include <map>
23
#include <optional>
24
25
#include "backends/tofino/bf-p4c/phv/phv_fields.h"
26
27
namespace
PHV
{
28
namespace
v2 {
29
30
struct
KindSizeIndexedMap
{
31
std::map<std::pair<PHV::Kind, PHV::Size>,
int
> m;
32
int
&operator[](
const
std::pair<PHV::Kind, PHV::Size> &ks) {
return
m[ks]; }
33
int
sum(
const
PHV::Kind
&k)
const
;
34
int
sum(
const
PHV::Size
&k)
const
;
35
std::optional<int> get(
const
PHV::Kind
&k,
const
PHV::Size
&s)
const
;
36
int
get_or(
const
PHV::Kind
&k,
const
PHV::Size
&s,
int
default_val)
const
;
37
};
30
struct
KindSizeIndexedMap
{
…
};
38
std::ostream &operator<<(std::ostream &,
const
KindSizeIndexedMap
&);
39
40
}
// namespace v2
41
}
// namespace PHV
42
43
#endif
/* BF_P4C_PHV_V2_KIND_SIZE_INDEXED_MAP_H_ */
PHV
The namespace encapsulating PHV-related stuff.
Definition
gateway.h:32
PHV::Size
Size
all possible PHV container sizes in BFN devices
Definition
phv.h:110
PHV::Kind
Kind
Definition
phv.h:44
PHV::v2::KindSizeIndexedMap
Definition
kind_size_indexed_map.h:30
backends
tofino
bf-p4c
phv
v2
kind_size_indexed_map.h
Generated by
1.12.0