P4C
The P4 Compiler
Loading...
Searching...
No Matches
map_tables_to_actions.h
1
19#ifndef BACKENDS_TOFINO_BF_P4C_COMMON_MAP_TABLES_TO_ACTIONS_H_
20#define BACKENDS_TOFINO_BF_P4C_COMMON_MAP_TABLES_TO_ACTIONS_H_
21
22#include "backends/tofino/bf-p4c/phv/utils/utils.h"
23#include "ir/ir.h"
24
25using namespace P4;
26
30 public:
33
34 private:
36 TableActionsMap tableToActionsMap;
37
39 TableActionsMap defaultActions;
40
42 ActionTableMap actionMap;
43
44 profile_t init_apply(const IR::Node *root) override;
45 bool preorder(const IR::MAU::Table *t) override;
46 void end_apply() override;
47
49 void printTableActionsMap(const TableActionsMap &tblActMap, cstring logMessage) const;
50
51 public:
53 const PHV::ActionSet &getActionsForTable(const IR::MAU::Table *t) const;
54
56 const PHV::ActionSet &getDefaultActionsForTable(const IR::MAU::Table *t) const;
57
59 std::optional<const IR::MAU::Table *> getTableForAction(const IR::MAU::Action *act) const;
60};
61
62#endif /* BACKENDS_TOFINO_BF_P4C_COMMON_MAP_TABLES_TO_ACTIONS_H_ */
Definition map_tables_to_actions.h:29
const PHV::ActionSet & getActionsForTable(const IR::MAU::Table *t) const
Definition map_tables_to_actions.cpp:28
const PHV::ActionSet & getDefaultActionsForTable(const IR::MAU::Table *t) const
Definition map_tables_to_actions.cpp:35
std::optional< const IR::MAU::Table * > getTableForAction(const IR::MAU::Action *act) const
Definition map_tables_to_actions.cpp:42
Definition node.h:94
Definition visitor.h:400
Definition visitor.h:78
Definition cstring.h:85
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24