P4C
The P4 Compiler
Loading...
Searching...
No Matches
pa_atomic.h
1
19#ifndef BACKENDS_TOFINO_BF_P4C_PHV_PRAGMA_PA_ATOMIC_H_
20#define BACKENDS_TOFINO_BF_P4C_PHV_PRAGMA_PA_ATOMIC_H_
21
22#include "backends/tofino/bf-p4c/phv/phv_fields.h"
23#include "ir/ir.h"
24
25using namespace P4;
26
30class PragmaAtomic : public Inspector {
31 PhvInfo &phv_i;
32
36
37 profile_t init_apply(const IR::Node *root) override {
38 profile_t rv = Inspector::init_apply(root);
39 fields.clear();
40 return rv;
41 }
42
43 bool add_constraint(const IR::BFN::Pipe *pipe, const IR::Expression *expr, cstring field_name);
44
45 bool preorder(const IR::BFN::Pipe *pipe) override;
46
47 public:
48 explicit PragmaAtomic(PhvInfo &phv) : phv_i(phv) {}
49
51 const ordered_set<const PHV::Field *> getFields() const { return fields; }
52
54 static const char *name;
55 static const char *description;
56 static const char *help;
57};
58
59std::ostream &operator<<(std::ostream &out, const PragmaAtomic &pa_a);
60
61#endif /* BACKENDS_TOFINO_BF_P4C_PHV_PRAGMA_PA_ATOMIC_H_ */
Definition node.h:94
Definition visitor.h:400
Definition visitor.h:78
Definition cstring.h:85
Definition ordered_set.h:32
Definition phv_fields.h:1095
Definition pa_atomic.h:30
static const char * name
BFN::Pragma interface.
Definition pa_atomic.h:54
const ordered_set< const PHV::Field * > getFields() const
Definition pa_atomic.h:51
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24