P4C
The P4 Compiler
Loading...
Searching...
No Matches
header_validity_analysis.h
1
19#ifndef BACKENDS_TOFINO_BF_P4C_PARDE_CLOT_HEADER_VALIDITY_ANALYSIS_H_
20#define BACKENDS_TOFINO_BF_P4C_PARDE_CLOT_HEADER_VALIDITY_ANALYSIS_H_
21
22#include "bf-p4c/mau/mau_visitor.h"
23#include "bf-p4c/phv/phv_fields.h"
24#include "field_slice_set.h"
25
82 public:
83 using ResultMap = std::map<FieldSliceSet, std::set<FieldSliceSet>>;
84
85 const PhvInfo &phvInfo;
86
88 std::map<const PHV::FieldSlice *, std::set<FieldSliceSet>, PHV::FieldSlice::Less>
90
91 std::set<const PHV::Field *> povBitsSetInvalidInMau;
92 std::set<const PHV::Field *> povBitsSetValidInMau;
93
94 std::map<const PHV::Field *, std::set<const IR::MAU::Action *>> povBitsUpdateActions;
95 std::map<const PHV::Field *, std::set<const IR::MAU::Action *>>
96 povBitsUpdateOrInvalidateActions;
97 std::map<const PHV::Field *, std::set<const IR::MAU::Action *>> povBitsUpdateOrValidateActions;
98 std::map<const PHV::Field *, std::set<const IR::MAU::Action *>> povBitsInvalidateActions;
99 std::map<const PHV::Field *, std::set<const IR::MAU::Action *>> povBitsValidateActions;
100
101 SymBitMatrix povBitsAlwaysInvalidateTogether;
102 SymBitMatrix povBitsAlwaysValidateTogether;
103
105 ResultMap resultMap;
106
107 HeaderValidityAnalysis(const PhvInfo &phvInfo, const std::set<FieldSliceSet> &correlations);
110
111 Visitor::profile_t init_apply(const IR::Node *root) override;
112 bool preorder(const IR::MAU::Instruction *instruction) override;
113 bool preorder(const IR::MAU::Action *act) override;
114 void end_apply() override;
115
116 HeaderValidityAnalysis *clone() const override;
117 HeaderValidityAnalysis &flow_clone() override;
118 void flow_merge(Visitor &v) override;
119 // FIXME -- not a ControlFlowVisitor, so there will never be any clones to merge...
120 // void flow_copy(::ControlFlowVisitor& v) override;
121};
122
123#endif /* BACKENDS_TOFINO_BF_P4C_PARDE_CLOT_HEADER_VALIDITY_ANALYSIS_H_ */
Identify headers marked as valid/invalid in MAU pipeline and find correlations between removal of hea...
Definition header_validity_analysis.h:81
HeaderValidityAnalysis(const PhvInfo &phvInfo, const std::set< FieldSliceSet > &correlations)
Definition header_validity_analysis.cpp:21
ResultMap resultMap
The output of this analysis.
Definition header_validity_analysis.h:105
void flow_merge(Visitor &v) override
Definition header_validity_analysis.cpp:205
std::map< const PHV::FieldSlice *, std::set< FieldSliceSet >, PHV::FieldSlice::Less > * interestedCorrelations
The correlations that the client is interested in, indexed by POV bit.
Definition header_validity_analysis.h:89
Definition mau_visitor.h:29
Definition node.h:95
Definition symbitmatrix.h:27
Definition visitor.h:78
Definition visitor.h:75
Definition phv_fields.h:1095