P4C
The P4 Compiler
Loading...
Searching...
No Matches
matchActionTableMetrics.h
1
/*
2
Collects match-action table metrics by inspecting each table's
3
properties and extracting the number of actions, as well as unwrapping
4
each key field and extracting its bit width.
5
*/
6
7
#ifndef FRONTENDS_P4_METRICS_MATCHACTIONTABLEMETRICS_H_
8
#define FRONTENDS_P4_METRICS_MATCHACTIONTABLEMETRICS_H_
9
10
#include "frontends/p4/metrics/metricsStructure.h"
11
#include "frontends/p4/typeChecking/typeChecker.h"
12
#include "ir/ir.h"
13
14
namespace
P4
{
15
16
class
MatchActionTableMetricsPass :
public
Inspector
{
17
private
:
18
unsigned
keySize(
const
IR::KeyElement *keyElement);
19
TypeMap
*typeMap;
20
MatchActionTableMetrics
&metrics;
21
22
public
:
23
explicit
MatchActionTableMetricsPass(
TypeMap
*map,
Metrics
&metricsRef)
24
: typeMap(map), metrics(metricsRef.matchActionTableMetrics) {
25
setName(
"MatchActionTableMetricsPass"
);
26
}
27
28
void
postorder(
const
IR::P4Table *table)
override
;
29
void
postorder(
const
IR::P4Program *
/*program*/
)
override
;
30
};
31
32
}
// namespace P4
33
34
#endif
/* FRONTENDS_P4_METRICS_MATCHACTIONTABLEMETRICS_H_ */
P4::Inspector
Definition
visitor.h:413
P4::TypeMap
Definition
typeMap.h:41
P4
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition
applyOptionsPragmas.cpp:24
P4::MatchActionTableMetrics
Definition
metricsStructure.h:68
P4::Metrics
Definition
metricsStructure.h:119
frontends
p4
metrics
matchActionTableMetrics.h
Generated by
1.13.2