P4C
The P4 Compiler
Loading...
Searching...
No Matches
check_field_corruption.h
1
19#ifndef BF_P4C_COMMON_CHECK_FIELD_CORRUPTION_H_
20#define BF_P4C_COMMON_CHECK_FIELD_CORRUPTION_H_
21
22#include "bf-p4c/common/field_defuse.h"
23#include "bf-p4c/phv/phv_parde_mau_use.h"
24#include "bf-p4c/phv/pragma/phv_pragmas.h"
25#include "ir/ir.h"
26
27using namespace P4;
28
33 private:
34 const FieldDefUse &defuse;
35 const PhvInfo &phv;
36 const PHV::Pragmas &pragmas;
38 ordered_set<const PHV::Field *> pov_protected_fields;
39 std::map<const IR::BFN::ParserState *, std::set<const IR::Expression *>> state_extracts;
40 std::map<const PHV::Field *, std::set<const IR::Expression *>> parser_inits;
41
42 protected:
51
52 public:
53 CheckFieldCorruption(const FieldDefUse &defuse, const PhvInfo &phv, const PHV::Pragmas &pragmas)
54 : defuse(defuse), phv(phv), pragmas(pragmas), uses(phv) {}
55
56 void end_apply() override;
57 bool preorder(const IR::BFN::Pipe *) override;
58 bool preorder(const IR::BFN::DeparserParameter *) override;
59 bool preorder(const IR::BFN::Digest *) override;
60 bool preorder(const IR::Expression *) override;
61 bool preorder(const IR::BFN::ParserZeroInit *) override;
62};
63
64#endif /* BF_P4C_COMMON_CHECK_FIELD_CORRUPTION_H_ */
Definition visitor.h:400
Definition ordered_set.h:32
Definition phv_pragmas.h:46
Definition phv_parde_mau_use.h:38
Definition phv_fields.h:1095
Definition tofino_write_context.h:24
std::pair< const IR::BFN::Unit *, const IR::Expression * > locpair
Definition field_defuse.h:82
bool copackedFieldExtractedSeparately(const FieldDefUse::locpair &use)
Definition check_field_corruption.cpp:51
bool preorder(const IR::BFN::Pipe *) override
Definition check_field_corruption.cpp:21
Definition check_field_corruption.h:32
Definition field_defuse.h:77
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24