P4C
The P4 Compiler
Loading...
Searching...
No Matches
action_packing_validator_interface.h
1
19#ifndef BF_P4C_PHV_ACTION_PACKING_VALIDATOR_INTERFACE_H_
20#define BF_P4C_PHV_ACTION_PACKING_VALIDATOR_INTERFACE_H_
21
22#include <optional>
23
24#include "backends/tofino/bf-p4c/phv/action_source_tracker.h"
25#include "backends/tofino/bf-p4c/phv/utils/utils.h"
26#include "lib/cstring.h"
27#include "lib/ordered_set.h"
28
29namespace PHV {
30
34 public:
35 struct Result {
36 enum class Code { OK, BAD, UNKNOWN };
37 Code code = Code::UNKNOWN;
38 cstring err = cstring::empty;
46 std::optional<const IR::MAU::Action *> invalid_action = std::nullopt;
47 Result() = default;
48 explicit Result(Code code, cstring err = cstring::empty) : code(code), err(err) {}
49 };
50
69 const ordered_set<const SuperCluster::SliceList *> &can_be_further_split = {},
70 const bool loose_mode = false) const = 0;
71};
72
73} // namespace PHV
74
75#endif /* BF_P4C_PHV_ACTION_PACKING_VALIDATOR_INTERFACE_H_ */
Definition cstring.h:85
Definition ordered_set.h:32
Definition action_packing_validator_interface.h:33
virtual Result can_pack(const ordered_set< const SuperCluster::SliceList * > &slice_lists, const ordered_set< const SuperCluster::SliceList * > &can_be_further_split={}, const bool loose_mode=false) const =0
The namespace encapsulating PHV-related stuff.
Definition gateway.h:32
Definition action_packing_validator_interface.h:35
ordered_set< const SuperCluster::SliceList * > * invalid_packing
Definition action_packing_validator_interface.h:44
Definition common/field_defuse.cpp:590