P4C
The P4 Compiler
Loading...
Searching...
No Matches
parde_phv_constraints.h
1
19#ifndef BF_P4C_PHV_PARDE_PHV_CONSTRAINTS_H_
20#define BF_P4C_PHV_PARDE_PHV_CONSTRAINTS_H_
21
22#include "backends/tofino/bf-p4c/mau/mau_visitor.h"
23#include "backends/tofino/bf-p4c/phv/phv_fields.h"
24#include "backends/tofino/bf-p4c/phv/pragma/pa_container_size.h"
25#include "ir/ir.h"
26
44 private:
45 static constexpr int MAX_CONSTANT_WINDOW = 3;
46
48 unsigned DIGEST_BYTES_THRESHOLD;
49
50 PhvInfo &phv;
51 PragmaContainerSize &sizePragmas;
52
53 profile_t init_apply(const IR::Node *root) override;
54 bool preorder(const IR::BFN::Digest *digest) override;
55
56 public:
57 explicit PardePhvConstraints(PhvInfo &p, PragmaContainerSize &pa) : phv(p), sizePragmas(pa) {
58 // Set the threshold for setting restrictions of unused bits in digest fields to 90% of the
59 // maximum.
60 DIGEST_BYTES_THRESHOLD = Device::maxDigestSizeInBytes() * 9 / 10;
61 }
62};
63
65 private:
66 PhvInfo &phv;
67
69
70 profile_t init_apply(const IR::Node *root) override;
71 bool preorder(const IR::BFN::Extract *extract) override;
72 void end_apply() override;
73
74 public:
75 explicit TofinoParserConstantExtract(PhvInfo &p) : phv(p) {}
76};
77
78#endif /* BF_P4C_PHV_PARDE_PHV_CONSTRAINTS_H_ */
Definition node.h:94
Definition visitor.h:400
Definition visitor.h:78
Definition ordered_map.h:32
Definition parde_phv_constraints.h:43
Definition phv_fields.h:1095
Definition pa_container_size.h:39
Definition parde_phv_constraints.h:64