P4C
The P4 Compiler
Loading...
Searching...
No Matches
split_gateways.h
1
19#ifndef BF_P4C_MAU_SPLIT_GATEWAYS_H_
20#define BF_P4C_MAU_SPLIT_GATEWAYS_H_
21
22#include "field_use.h"
23#include "gateway.h"
24#include "mau_visitor.h"
25
26using namespace P4;
27
29 FieldUse uses;
30 bool do_splitting = false;
31 struct enable : public Backtrack::trigger {
32 DECLARE_TYPEINFO(enable);
33 };
34 bool backtrack(trigger &trig) override {
35 if (!do_splitting && trig.is<enable>()) {
36 do_splitting = true;
37 return true;
38 }
39 return false;
40 }
41 Visitor::profile_t init_apply(const IR::Node *) override;
42 const IR::Node *postorder(IR::MAU::Table *) override;
43
44 public:
45 explicit SpreadGatewayAcrossSeq(const PhvInfo &p) : uses(p) {}
46};
47
49 const PhvInfo &phv;
50 const IR::MAU::Table *preorder(IR::MAU::Table *tbl) override;
51
52 public:
53 explicit SplitComplexGateways(const PhvInfo &phv) : phv(phv) {}
54};
55
56#endif /* BF_P4C_MAU_SPLIT_GATEWAYS_H_ */
Definition field_use.h:32
Definition mau_visitor.h:55
Definition visitor.h:766
Definition node.h:94
Definition visitor.h:424
Definition visitor.h:78
Definition phv_fields.h:1095
Definition split_gateways.h:48
Definition split_gateways.h:28
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24
Definition visitor.h:768
bool is() const noexcept
Definition rtti.h:216