P4C
The P4 Compiler
Loading...
Searching...
No Matches
pa_no_init.h
1
19#ifndef BACKENDS_TOFINO_BF_P4C_PHV_PRAGMA_PA_NO_INIT_H_
20#define BACKENDS_TOFINO_BF_P4C_PHV_PRAGMA_PA_NO_INIT_H_
21
22#include "bf-p4c/phv/phv_fields.h"
23#include "ir/ir.h"
24
25using namespace P4;
26
35class PragmaNoInit : public Inspector {
36 const PhvInfo &phv_i;
37
41
42 profile_t init_apply(const IR::Node *root) override {
43 profile_t rv = Inspector::init_apply(root);
44 fields.clear();
45 return rv;
46 }
47
48 bool add_constraint(cstring field_name);
49
50 bool preorder(const IR::BFN::Pipe *pipe) override;
51
52 public:
53 explicit PragmaNoInit(const PhvInfo &phv) : phv_i(phv) {}
54
56 static const char *name;
57 static const char *description;
58 static const char *help;
59
61 const ordered_set<const PHV::Field *> &getFields() const { return fields; }
62};
63
64std::ostream &operator<<(std::ostream &out, const PragmaNoInit &pa_a);
65
66#endif /* BACKENDS_TOFINO_BF_P4C_PHV_PRAGMA_PA_NO_INIT_H_ */
Definition node.h:95
Definition visitor.h:400
Definition visitor.h:78
Definition cstring.h:85
Definition ordered_set.h:32
Definition phv_fields.h:1095
const ordered_set< const PHV::Field * > & getFields() const
Definition pa_no_init.h:61
static const char * name
BFN::Pragma interface.
Definition pa_no_init.h:56
Adds the no_init pragma to the specified fields with the specified gress.
Definition pa_no_init.h:35
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24