P4C
The P4 Compiler
Loading...
Searching...
No Matches
do_not_use_clot.h
1
19#ifndef BACKENDS_TOFINO_BF_P4C_PARDE_CLOT_PRAGMA_DO_NOT_USE_CLOT_H_
20#define BACKENDS_TOFINO_BF_P4C_PARDE_CLOT_PRAGMA_DO_NOT_USE_CLOT_H_
21
22#include <map>
23#include <optional>
24
25#include "backends/tofino/bf-p4c/phv/phv_fields.h"
26#include "backends/tofino/bf-p4c/phv/utils/utils.h"
27#include "ir/ir.h"
28
29using namespace P4;
30
38 const PhvInfo &phv_info;
39 ordered_set<const PHV::Field *> do_not_use_clot;
40
41 profile_t init_apply(const IR::Node *root) override {
42 profile_t rv = Inspector::init_apply(root);
43 do_not_use_clot.clear();
44 return rv;
45 }
46
50 bool preorder(const IR::BFN::Pipe *pipe) override;
51
52 public:
53 explicit PragmaDoNotUseClot(const PhvInfo &phv_info) : phv_info(phv_info) {}
54
55 // BFN::Pragma interface
56 static const char *name;
57 static const char *description;
58 static const char *help;
59
60 const ordered_set<const PHV::Field *> &do_not_use_clot_fields() const {
61 return do_not_use_clot;
62 }
63};
64
65std::ostream &operator<<(std::ostream &out, const PragmaDoNotUseClot &do_not_use_clot);
66
67#endif /* BACKENDS_TOFINO_BF_P4C_PARDE_CLOT_PRAGMA_DO_NOT_USE_CLOT_H_ */
Definition node.h:94
Definition visitor.h:400
Definition visitor.h:78
Definition ordered_set.h:32
Definition phv_fields.h:1095
do_not_use_clot pragma support.
Definition do_not_use_clot.h:37
static const char * name
Definition do_not_use_clot.h:56
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24