P4C
The P4 Compiler
Loading...
Searching...
No Matches
remove_act_tables.h
1
18
19
#ifndef _BACKENDS_TOFINO_BF_P4C_MAU_REMOVE_ACT_TABLES_H_
20
#define _BACKENDS_TOFINO_BF_P4C_MAU_REMOVE_ACT_TABLES_H_
21
22
#include "ir/ir.h"
23
24
using namespace
P4
;
25
34
class
AnalyzeActionTables :
public
MAU::Inspector {
35
public
:
36
AnalyzeActionTables() {}
37
bool
isCandidate(
const
IR::MAU::Table *t)
const
{
return
_candidates. }
38
39
private
:
40
bool
preorder(IR::P4Control *control)
override
;
41
bool
preorder(
const
IR::MAU::Table *t)
override
;
42
bool
preorder(IR::P4Action *action)
override
;
43
44
std::set<cstring> _candidates;
45
};
46
48
class
DoRemoveActionTables :
public
Transform
{
49
const
AnalyzeActionTables
*analysis;
50
51
public
:
52
explicit
DoRemoveActionTables(
const
AnalyzeActionTables
*a) : analysis(a) {}
53
54
private
:
55
const
IR::Node
*postorder(
const
IR::MAU::Table *t)
override
;
56
};
57
58
class
RemoveActionTables :
public
PassManager {
59
public
:
60
RemoveActionTables() {
61
auto
analysis =
new
AnalyzeActionTables
();
62
addPasses({
63
&analysis,
64
new
DoRemoveActionTables
(analysis),
65
});
66
}
67
};
68
69
#endif
/* _BACKENDS_TOFINO_BF_P4C_MAU_REMOVE_ACT_TABLES_H_ */
AnalyzeActionTables
Definition
remove_act_tables.h:34
DoRemoveActionTables
Do the actual moves after the analysis has completed.
Definition
remove_act_tables.h:48
P4::IR::Node
Definition
node.h:94
P4::Transform
Definition
visitor.h:437
P4
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition
applyOptionsPragmas.cpp:24
backends
tofino
bf-p4c
mau
remove_act_tables.h
Generated by
1.13.2