P4C
The P4 Compiler
Loading...
Searching...
No Matches
mocha.h
1
19#ifndef BACKENDS_TOFINO_BF_P4C_PHV_ANALYSIS_MOCHA_H_
20#define BACKENDS_TOFINO_BF_P4C_PHV_ANALYSIS_MOCHA_H_
21
22#include "backends/tofino/bf-p4c/mau/action_analysis.h"
23#include "backends/tofino/bf-p4c/phv/analysis/non_mocha_dark_fields.h"
24#include "backends/tofino/bf-p4c/phv/phv_fields.h"
25#include "ir/ir.h"
26
38 private:
39 PhvInfo &phv;
40 const PhvUse &uses;
41 const ReductionOrInfo &red_info;
42 const NonMochaDarkFields &nonMochaDark;
43 bool pov_on_mocha = false;
44
46 size_t mochaCount;
48 size_t mochaSize;
49
50 profile_t init_apply(const IR::Node *root) override;
51 bool preorder(const IR::MAU::Action *act) override;
52 void end_apply() override;
53
54 public:
56 const NonMochaDarkFields &nmd)
57 : phv(p), uses(u), red_info(ri), nonMochaDark(nmd), mochaCount(0), mochaSize(0) {}
58
60 static bool isPacketField(const PHV::Field *f) {
61 return (f && !f->metadata && !f->pov && !f->bridged && !f->overlayable &&
62 !f->is_intrinsic());
63 }
64};
65
66#endif /* BACKENDS_TOFINO_BF_P4C_PHV_ANALYSIS_MOCHA_H_ */
Definition mocha.h:37
static bool isPacketField(const PHV::Field *f)
Definition mocha.h:60
Definition non_mocha_dark_fields.h:29
Definition node.h:94
Definition visitor.h:400
Definition visitor.h:78
Definition phv_fields.h:154
bool overlayable
Definition phv_fields.h:226
bool pov
True if this Field is a validity bit.
Definition phv_fields.h:253
bool bridged
True if this Field is metadata bridged from ingress to egress.
Definition phv_fields.h:219
bool metadata
True if this Field is metadata.
Definition phv_fields.h:209
Definition phv_fields.h:1095
Definition phv_parde_mau_use.h:154
Definition reduction_or.h:47